Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    5

    Control Music Player over Bluetooth with Python

    Hi!

    I would like to develop a Software in Python which enables my BT equipped watch to control the integrated music player. So far I've not been able to find some API, which could be useful to accomplish this. For C++ there is a Music Player Remote Control API, but this seems not to feature to skip tracks forward or backward in a playlist...
    Is it possible to to this by any means?

    Thanks!
    Last edited by ra9na; 2010-03-11 at 13:40.

  2. #2
    Regular Contributor
    Join Date
    May 2007
    Posts
    75

    Re: Control Music Player over Bluetooth with Python

    The Music Player Remote Control API does support those actions through the handleCommand method:
    Code:
    // MMPlayerRemoteControl::HandleCommand parameter values
    enum TMPlayerRemoteControlCommands
        {
        EMPlayerRCtrlCmdNoCommand = 0,
        EMPlayerRCtrlCmdPlay,
        EMPlayerRCtrlCmdPause,
        EMPlayerRCtrlCmdStop,
        EMPlayerRCtrlCmdStartSeekForward,
        EMPlayerRCtrlCmdStartSeekBackward,
        EMPlayerRCtrlCmdStopSeeking,
        EMPlayerRCtrlCmdNextTrack,
        EMPlayerRCtrlCmdPreviousTrack,
        EMPlayerRCtrlCmdStartMusicPlayer,
        EMPlayerRCtrlCmdCloseMusicPlayer,
        EMPlayerRCtrlCmdBack,
        // EMPlayerRCtrlCmdPlayPause action depends on Music Player internal state.
        //
        // State   | Executed command
        // ----------------------------------------
        // Playing | Pause
        // Paused  | Play
        // Stopped | Play highlighted playlist item
        EMPlayerRCtrlCmdPlayPause 
        };
    But availability varies (not supported on 5th edition devices) and on some devices the API doesn't work:
    KIS001005 Music Player Remote Control API does not work in all S60 3rd Edition FP1 and FP2 devices

  3. #3
    Registered User
    Join Date
    Oct 2008
    Posts
    5

    Re: Control Music Player over Bluetooth with Python

    Thanks for your information =) !
    But can I use this API also for Python? There are instructions, how to extend Python with C++ Plugins... Can I just keep on this How-Tos to get this working?

  4. #4
    Regular Contributor
    Join Date
    May 2007
    Posts
    75

    Re: Control Music Player over Bluetooth with Python

    For Python 1.4 there's an extension here. For 2.0 it will become available, but if you're in hurry porting it isn't that hard. The sources should give you a head-start anyway.

  5. #5
    Registered User
    Join Date
    Oct 2008
    Posts
    5

    Re: Control Music Player over Bluetooth with Python

    Wow!!! Thank you very much! =)
    I will look into the source and try to port it to 2.0...
    But first I need to get an idea how do I establish a serial BT connection between my handset and my watch.
    Maybe you also have a hint for me? =)

  6. #6
    Regular Contributor
    Join Date
    May 2007
    Posts
    75

    Re: Control Music Player over Bluetooth with Python

    Take a look at the btsocket module. This allows you to discover the watch and connect to it. After that it becomes watch specific, I guess ...

  7. #7
    Registered User
    Join Date
    Oct 2008
    Posts
    5

    Re: Control Music Player over Bluetooth with Python

    Ok! Thank you very much for your help =) ! I will try do code something this weekend and perhaps I will get some results thanks to your support =) !

    Edit: I just realized, that the source of the Music Player Remote is not available. The link points to another file... a wrong one apparently... =(

  8. #8
    Regular Contributor
    Join Date
    May 2007
    Posts
    75

    Re: Control Music Player over Bluetooth with Python

    Whoops! I'll fix that ;-) Anyway, here are the sources that were ported to Python 2.0. And here is an unsigned SIS file for 3rd edition (UID in test range)
    Last edited by mwibbels; 2010-03-12 at 21:08.

  9. #9
    Registered User
    Join Date
    Oct 2008
    Posts
    5

    Re: Control Music Player over Bluetooth with Python

    Unbelievable O_o !!!
    Thank you so much! I'll start digging into this and try to get some results =)!
    Thanks again!

Similar Threads

  1. Replies: 9
    Last Post: 2012-02-10, 08:36
  2. Music Player Remote Control API for 5th edition?
    By Bernd42 in forum Symbian Tools & SDKs
    Replies: 3
    Last Post: 2009-05-20, 15:48
  3. Which FP1/FP" devices does Music Player Remote Control API not work on
    By kevinvernon in forum Symbian Media (Closed)
    Replies: 0
    Last Post: 2009-02-09, 13:17
  4. Nokia music player series 40 handset 6300
    By caldran in forum Series 40 & S60 Platform Feedback Archive
    Replies: 1
    Last Post: 2008-02-21, 20:37
  5. Replies: 1
    Last Post: 2007-08-11, 14:57

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×