×

Discussion Board

Results 1 to 15 of 15
  1. #1
    Registered User
    Join Date
    Jul 2012
    Posts
    20

    Forward Volume key event to music player

    I am using Qt Game Enabler which uses MrccatoCommand from MRemConCoreApiTargetObserver to capture volume keys like this:

    Code:
    void VolumeKeys::MrccatoCommand(TRemConCoreApiOperationId operationId,
                                    TRemConCoreApiButtonAction buttonAct)
    {
        DEBUG_INFO("operation:" << operationId << " action:" << buttonAct);
    
        if (buttonAct == ERemConCoreApiButtonClick) {
            if (operationId == ERemConCoreApiVolumeUp)
            {
                m_observer->onVolumeUp();
            }
            else if (operationId == ERemConCoreApiVolumeDown)
                m_observer->onVolumeDown();
        }
    }
    This works fine but my problem is that the Symbian music player now has no response to the keys, I'm guessing this is because I have caught them. I would like to know if there is any way I can send the command back or forward it once I have used it?

    OR if there is a way I can get the volume events without "stealing" them then that would also works.

    Thanks in advance!

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,687

    Re: Forward Volume key event to music player

    You can control the music player if you really want to: http://www.developer.nokia.com/Commu...te_Control_API
    However my opinion is that you should do it vice versa: release capturing the events when you do not need them.
    Handling them both in your code and with the Music Player at the same time probably is not a good idea. Here I imagine a situation where let us say you have a breakout game and move the paddle with the volume keys. Most probably the user does not want to lower the volume just because she moves the paddle downwards, and she especially does not want the phone start shouting loud when the paddle is moving upwards.

  3. #3
    Registered User
    Join Date
    Jul 2012
    Posts
    20

    Re: Forward Volume key event to music player

    Thanks for the quick reply but I have already tried the music player remote control api but it doesn't seemto be compatible with symbian 3. My game though on the other hand does not use the volume keys as controls, they are used the lower the volume of the sound eefects therefor I think the user would want all events to be passed to the next listner (music player). So my question is actually how can I just look at the event and then release it to be further proccessed?

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,687

    Re: Forward Volume key event to music player

    Since the plug-in API-s are not released for Symbian^3, it may be worth mentioning here that there was a time when Symbian^3 was open source, and there is a snapshot of that source code on SourceForge, project symbiandump (the other half of the truth is that this snapshot is almost 2 years old now). There you may find what has happened to this API, and perhaps get a working one.

  5. #5
    Registered User
    Join Date
    Jul 2012
    Posts
    20

    Re: Forward Volume key event to music player

    Thanks for the help but all I really want to know is how I can read the volume key event and then release it again, I read in another post that there is apparently a wiki about this but I cannot find it?

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,687

    Re: Forward Volume key event to music player

    Quote Originally Posted by Gerhman.dc View Post
    I read in another post that there is apparently a wiki about this but I cannot find it?
    I can not find related articles either. Can you tell where you have read about it? That may help in searching.

  7. #7
    Registered User
    Join Date
    Jul 2012
    Posts
    20

    Re: Forward Volume key event to music player

    Quote Originally Posted by wizard_hu_ View Post
    I can not find related articles either. Can you tell where you have read about it? That may help in searching.
    I read about it here: http://www.developer.nokia.com/Commu...-in-Background

  8. #8
    Registered User
    Join Date
    Jan 2005
    Location
    Italy
    Posts
    639

    Re: Forward Volume key event to music player

    Are you referring to RemConCoreApi? I've found this link:
    http://qt-project.org/wiki/Audio_Vol...ent_On_Symbian
    pointing to http://www.developer.nokia.com/Commu...ing_media_keys
    but at a very fast glance it doesn't talk about releasing the key to other applications, or maybe the API itself is doing it.... ?

  9. #9
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,687

    Re: Forward Volume key event to music player

    Yes, that is what Gehrman.dc is using already.

    A thing you can try is the other way which Kranti started to discuss in the referred thread, if you can capture them as normal keys. The remote control stuff may be important if you really want to capture events from the, well, remote control (the tiny thing you usually get with the headset and sometimes get one separately too, and perhaps events from a BT set). However the actual volume keys on the device itself may emit normal key events.
    For checking various keycodes your device emits you may find the snippet in #10 of http://www.developer.nokia.com/Commu...a-key-scancode useful (put it into a HelloWorld-like skeleton app)
    There is also a short keycapture example in #27 of http://www.developer.nokia.com/Commu...is-key-capture, similarly designed for testing with a HelloWorld-like skeleton (re-uses the Message and Message from file commands).

  10. #10
    Registered User
    Join Date
    Jul 2012
    Posts
    20

    Re: Forward Volume key event to music player

    Thanks for the tip, I will try it as soon as possible but I can't help noticing it appears to not be cross device compatible or am I mistaken?

    Also if any one else has some more info regarding the volume key event release it would be greatly appreciated, also thanks for the link pavarang but I have already looked at it and the api does not seem to release the event itself(no response from music player).

  11. #11
    Registered User
    Join Date
    Jul 2012
    Posts
    20

    Re: Forward Volume key event to music player

    Sorry wizard_hu but I have not come around to testing your keycode example yet but I have just though of something. I think what I could perhaps do is after capturing the event I should then create the same event using a controller but stop capturing events until the controller has finished sending, would that be possible and do any of you know how I could do that?

  12. #12
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,687

    Re: Forward Volume key event to music player

    Quote Originally Posted by Gerhman.dc View Post
    Thanks for the tip, I will try it as soon as possible but I can't help noticing it appears to not be cross device compatible or am I mistaken?
    I have never tried. Kranti in his post refers to some standard keycodes, the missing part is if they work or not, that is why it is probably simpler to try with this code-displaying snippet.

  13. #13
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,687

    Re: Forward Volume key event to music player

    Quote Originally Posted by Gerhman.dc View Post
    Sorry wizard_hu but I have not come around to testing your keycode example yet but I have just though of something. I think what I could perhaps do is after capturing the event I should then create the same event using a controller but stop capturing events until the controller has finished sending, would that be possible and do any of you know how I could do that?
    If you mean capturing the media keys with the code in your first post, and re-emitting standard volume-keypresses instead, that may work. However you will yet again need the keycodes for the simulation part.

  14. #14
    Registered User
    Join Date
    Jul 2012
    Posts
    20

    Re: Forward Volume key event to music player

    Sorry for the late reply but I determined the cause of my problem. After noticing that on a hello world app with the remocon observer the volume key events were not detected when the music player was open because the player reserved them and used them itself. After some inspection and confirmation I determined that once I start playing audio (using either QAudio which uses CMdaAudioPlayerUtility or QAudioOutput which uses "the default implementation") the music player volume increases and it stops listing to any media key events.

    So to solve my orignal qeustion I think I must now ask if any of you know if this is a known problem with CMdaAudioPlayerUtility or if it is just a problem with the qt implementation, I also want to know if any of you know a way to play audio on Symbian without influencing the music player?

  15. #15
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,687

    Re: Forward Volume key event to music player

    I do not know any details, but this sudden increase of Music Player volume sounds familiar to me as an end-user, following system notifications (a low battery warning for example), which indeed use CMdaAudioPlayerUtility internally. But I am using Bluetooth headphones, which creates a slightly different situation, so I can not say that it is the same thing.
    For the Qt part I have no experience, but it is unlikely that Qt would do any fancy extra things in addition to forwarding the parameters to a simple CMdaXy class.

Similar Threads

  1. Things I miss in new Media Player and prefer old Music Player instead.
    By haroonbarech in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2012-04-12, 06:27
  2. How to make KD Player as default music player on s40?
    By Ssnigdho in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2011-03-08, 19:40
  3. keep 'music player'-music going while using flash sounds
    By redfuse in forum [Archived] Flash Lite on Nokia Devices
    Replies: 2
    Last Post: 2009-10-18, 23:13
  4. N79 Music Player is not deducting songs in music folder
    By vijayan.vvv in forum General Development Questions
    Replies: 1
    Last Post: 2009-09-11, 13:38
  5. Capturing Music Slider Event ( Nokia 5610 Express Music )
    By mekadur in forum Mobile Java General
    Replies: 2
    Last Post: 2008-01-24, 06: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
  •  
×