×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Oct 2010
    Posts
    136

    How to change volume dynamically

    Hi,
    I have developed a video application that plays video, everything is perfect. But when I try to change the volume (increase/ decrease) using the volume key of the device nothing happens. I set the volume like this,
    Code:
    CVideoPlayerUtility::SetVolumeL(CVideoPlayerUtility::MaxVolume()
    How do I change the volume dynamically.

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: How to change volume dynamically

    you would need to call the SetVolumeL() for the class instance that is currently playing the sound, as well as you would need to use the MaxVolume() function of that same instance.

  3. #3
    Registered User
    Join Date
    Oct 2010
    Posts
    136

    Re: How to change volume dynamically

    but could you please tell me how do I do it using the Volumeup and volumedown key of the device.
    Do i need to use OfferKeyEventL or CKeyCapturer for this?
    Last edited by v-6; 2011-06-13 at 07:18. Reason: edited

  4. #4
    Registered User
    Join Date
    Oct 2010
    Posts
    136

    Re: How to change volume dynamically

    Quote Originally Posted by symbianyucca View Post
    you would need to call the SetVolumeL() for the class instance that is currently playing the sound, as well as you would need to use the MaxVolume() function of that same instance.
    i first try to get the key event in the app, so I did this way
    but i am not getting the key even when I press the up/down volume key of the device

    view class
    Code:
    TKeyResponse CVideoPlayingMainView::OfferKeyEventL( 
        const TKeyEvent& aKeyEvent,TEventCode aType )
        {
    	 if (aKeyEvent.iScanCode == EStdKeyIncVolume)
    	            {
    	           CAknInformationNote *info = new(ELeave)CAknInformationNote();
    	           info->ExecuteLD(_L("Hello"));
    	       		return( EKeyWasConsumed );
    	            }
    	 if (aKeyEvent.iScanCode == EStdKeyDecVolume)
    		            {
    	 CAknInformationNote *info = new(ELeave)CAknInformationNote();
    		           info->ExecuteLD(_L("Hello"));
    		       		return( EKeyWasConsumed );
    		            }
        return EKeyWasNotConsumed;
        }

  5. #5
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: How to change volume dynamically

    a bit unrelated question to the original one, anyway, volume keys are not normal keys: http://wiki.forum.nokia.com/index.ph...ing_media_keys

    Also please search older discussions on possible utilizing problems..

  6. #6
    Registered User
    Join Date
    Oct 2010
    Posts
    136

    Re: How to change volume dynamically

    Quote Originally Posted by symbianyucca View Post
    a bit unrelated question to the original one, anyway, volume keys are not normal keys: http://wiki.forum.nokia.com/index.ph...ing_media_keys

    Also please search older discussions on possible utilizing problems..

    i have followed this link but i don't see the lib in the list of my lib RemConInterfaceBase.lib and RemConCoreApi.lib


    Sorry I got the lib
    Last edited by v-6; 2011-06-13 at 08:34. Reason: edited

  7. #7
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: How to change volume dynamically

    ok, I suppose it is ok then..

  8. #8
    Registered User
    Join Date
    Oct 2010
    Posts
    136

    Re: How to change volume dynamically

    I put the message in the volume up and down key but when In press the up/down key nothing happens
    Code:
    void CVideoPlayingAppUi::MrccatoCommand(TRemConCoreApiOperationId aOperationId,
                                           TRemConCoreApiButtonAction aButtonAct)
       {
       TRequestStatus status;
           switch( aOperationId )
           {
           case ERemConCoreApiPausePlayFunction:
               {
               switch (aButtonAct)
                   {
                   case ERemConCoreApiButtonPress:
                       // Play/Pause button pressed
                       break;
                   case ERemConCoreApiButtonRelease:
                       // Play/Pause button released
                       break;
                   case ERemConCoreApiButtonClick:
                       // Play/Pause button clicked
                       break;
                   default:
                       // Play/Pause unknown action
                       break;
                   }                               
               //Send the response back to Remcon server       
               iCoreTarget->PausePlayFunctionResponse(status, KErrNone);
               User::WaitForRequest(status);
               break;
               }   
    
           case ERemConCoreApiStop:
               {
               switch (aButtonAct)
                   {
                   // see above (case ERemConCoreApiPausePlayFunction)
                   // for possible actions
                   }
               iCoreTarget->StopResponse(status, KErrNone);
               User::WaitForRequest(status);
               break;
               }
           case ERemConCoreApiRewind:
               {
               switch (aButtonAct)
                   {
                   // see above for possible actions
                   }
               iCoreTarget->RewindResponse(status, KErrNone);
               User::WaitForRequest(status);   
               break;
               }       
           case ERemConCoreApiForward:
               {
               switch (aButtonAct)
                   {
                   // see above for possible actions
                   }
               iCoreTarget->ForwardResponse(status, KErrNone);
               User::WaitForRequest(status);
               break;
               }
           case ERemConCoreApiVolumeUp:
               {   
               switch (aButtonAct)
                   {
                   // see above for possible actions
            	   CAknInformationNote *info = new(ELeave)CAknInformationNote();
            	   info->ExecuteLD(_L("up"));
            			   
                   }
               iCoreTarget->VolumeUpResponse(status, KErrNone);
               User::WaitForRequest(status);   
               break;
               }       
           case ERemConCoreApiVolumeDown:
               {
               switch (aButtonAct)
                   {
            	   CAknInformationNote *info = new(ELeave)CAknInformationNote();
            	   info->ExecuteLD(_L("down"));
                   // see above for possible actions
                   }
               iCoreTarget->VolumeDownResponse(status, KErrNone);
               User::WaitForRequest(status);   
               break;
               }
           case ERemConCoreApiFastForward:
               {
               switch (aButtonAct)
                   {
                   // see above for possible actions
                   }
               iCoreTarget->FastForwardResponse(status, KErrNone);
               User::WaitForRequest(status);
               break;
               }              
           case ERemConCoreApiBackward:
               {
               switch (aButtonAct)
                   {
                   // see above for possible actions
                   }
               iCoreTarget->BackwardResponse(status, KErrNone);
               User::WaitForRequest(status);
               break;
               }                   
           default:
               break;
           }
       }

    please tell me where I am making mistake

  9. #9
    Registered User
    Join Date
    Oct 2010
    Posts
    136

    Re: How to change volume dynamically

    I got it i put the mesage in the wrong place, you are great. you have solved my problem

Similar Threads

  1. How to change the sound volume
    By lgmenu in forum Symbian
    Replies: 7
    Last Post: 2010-05-17, 06:43
  2. How to change Command label dynamically
    By launch in forum Symbian User Interface
    Replies: 1
    Last Post: 2008-11-13, 15:44
  3. How to change the control's color dynamically?
    By xhsoldier in forum Symbian
    Replies: 4
    Last Post: 2007-04-18, 07:14
  4. How to Change Menu Dynamically.
    By gauravgandhi80 in forum Symbian
    Replies: 1
    Last Post: 2004-12-20, 13:20
  5. How to change cba buttons dynamically
    By Nokia_Archive in forum Symbian User Interface
    Replies: 4
    Last Post: 2004-03-02, 09:27

Posting Permissions

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