videoplayback/videoplaybackcontrols/src/mpxvideoplaybackvolumebar.cpp
branchRCL_3
changeset 12 7f2b2a65da29
parent 11 8970fbd719ec
child 14 55fa1ec415c6
equal deleted inserted replaced
11:8970fbd719ec 12:7f2b2a65da29
    13 *
    13 *
    14 * Description: Volume bar control
    14 * Description: Volume bar control
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 // Version : %version: e003sa33#20 %
    18 // Version : %version: 21 %
    19 
    19 
    20 
    20 
    21 // INCLUDE FILES
    21 // INCLUDE FILES
    22 #include <eikenv.h>
    22 #include <eikenv.h>
    23 #include <gulicon.h>
    23 #include <gulicon.h>
   479 {
   479 {
   480     MPX_ENTER_EXIT(_L("CMPXVideoPlaybackVolumeBar::HandleVolumeIncreaseL()"));
   480     MPX_ENTER_EXIT(_L("CMPXVideoPlaybackVolumeBar::HandleVolumeIncreaseL()"));
   481 
   481 
   482     switch ( aPointerEvent.iType )
   482     switch ( aPointerEvent.iType )
   483     {
   483     {
   484         case TPointerEvent::EButtonRepeat: 
   484         case TPointerEvent::EButtonRepeat:
   485         {    
   485         {
   486 #ifdef RD_TACTILE_FEEDBACK 
   486 #ifdef RD_TACTILE_FEEDBACK
   487             if ( iFeedback ) 
   487             if ( iFeedback )
   488             { 
   488             {
   489 #ifdef SYMBIAN_BUILD_GCE
   489 #ifdef SYMBIAN_BUILD_GCE
   490                 iFeedback->InstantFeedback( ETouchFeedbackSlider );
   490                 iFeedback->InstantFeedback( ETouchFeedbackSlider );
   491 #else
   491 #else
   492                 iFeedback->InstantFeedback( ETouchFeedbackSensitive );
   492                 iFeedback->InstantFeedback( ETouchFeedbackSensitive );
   493 #endif //SYMBIAN_BUILD_GCE 
   493 #endif //SYMBIAN_BUILD_GCE
   494             } 
   494             }
   495 #endif //RD_TACTILE_FEEDBACK                 
   495 #endif //RD_TACTILE_FEEDBACK
   496             iController->HandleCommandL( EMPXPbvCmdIncreaseVolume );
   496             iController->HandleCommandL( EMPXPbvCmdIncreaseVolume );
   497             iDragging = EVolumeIncreaseDragging;
   497             iDragging = EVolumeIncreaseDragging;
   498             
   498 
   499         }    
   499         }
   500         case TPointerEvent::EButton1Down: 
   500         case TPointerEvent::EButton1Down:
   501         { 
   501         {
   502             Window().RequestPointerRepeatEvent( 
   502             Window().RequestPointerRepeatEvent(
   503                          TTimeIntervalMicroSeconds32(KMPXPtrEventRepeatRequestTime) 
   503                          TTimeIntervalMicroSeconds32(KMPXPtrEventRepeatRequestTime)
   504                          ,iVolumeUpControlRect); 
   504                          ,iVolumeUpControlRect);
   505 
   505 
   506             break;
   506             break;
   507         } 
   507         }
   508         case TPointerEvent::EDrag:
   508         case TPointerEvent::EDrag:
   509         {
   509         {
   510             iDragging = EVolumeIncreaseDragging;
   510             iDragging = EVolumeIncreaseDragging;
   511 
   511 
   512             break;
   512             break;
   518             {
   518             {
   519 #ifdef SYMBIAN_BUILD_GCE
   519 #ifdef SYMBIAN_BUILD_GCE
   520                 iFeedback->InstantFeedback( ETouchFeedbackSlider );
   520                 iFeedback->InstantFeedback( ETouchFeedbackSlider );
   521 #else
   521 #else
   522                 iFeedback->InstantFeedback( ETouchFeedbackBasic );
   522                 iFeedback->InstantFeedback( ETouchFeedbackBasic );
   523 #endif //SYMBIAN_BUILD_GCE       
   523 #endif //SYMBIAN_BUILD_GCE
   524             }
   524             }
   525 #endif //RD_TACTILE_FEEDBACK
   525 #endif //RD_TACTILE_FEEDBACK
   526 
   526 
   527             iController->HandleCommandL( EMPXPbvCmdIncreaseVolume );
   527             iController->HandleCommandL( EMPXPbvCmdIncreaseVolume );
   528 
   528 
   541 {
   541 {
   542     MPX_ENTER_EXIT(_L("CMPXVideoPlaybackVolumeBar::HandleVolumeDecreaseL()"));
   542     MPX_ENTER_EXIT(_L("CMPXVideoPlaybackVolumeBar::HandleVolumeDecreaseL()"));
   543 
   543 
   544     switch ( aPointerEvent.iType )
   544     switch ( aPointerEvent.iType )
   545     {
   545     {
   546         case TPointerEvent::EButtonRepeat: 
   546         case TPointerEvent::EButtonRepeat:
   547         {    
   547         {
   548 #ifdef RD_TACTILE_FEEDBACK 
   548 #ifdef RD_TACTILE_FEEDBACK
   549             if ( iFeedback ) 
   549             if ( iFeedback )
   550             { 
   550             {
   551 #ifdef SYMBIAN_BUILD_GCE
   551 #ifdef SYMBIAN_BUILD_GCE
   552                 iFeedback->InstantFeedback( ETouchFeedbackSlider );
   552                 iFeedback->InstantFeedback( ETouchFeedbackSlider );
   553 #else
   553 #else
   554                 iFeedback->InstantFeedback( ETouchFeedbackSensitive ); 
   554                 iFeedback->InstantFeedback( ETouchFeedbackSensitive );
   555 #endif //SYMBIAN_BUILD_GCE 
   555 #endif //SYMBIAN_BUILD_GCE
   556             } 
   556             }
   557 #endif //RD_TACTILE_FEEDBACK                 
   557 #endif //RD_TACTILE_FEEDBACK
   558             iController->HandleCommandL( EMPXPbvCmdDecreaseVolume );
   558             iController->HandleCommandL( EMPXPbvCmdDecreaseVolume );
   559             iDragging = EVolumeDecreaseDragging;
   559             iDragging = EVolumeDecreaseDragging;
   560             
   560 
   561         }    
   561         }
   562         case TPointerEvent::EButton1Down: 
   562         case TPointerEvent::EButton1Down:
   563         { 
   563         {
   564             Window().RequestPointerRepeatEvent( 
   564             Window().RequestPointerRepeatEvent(
   565                          TTimeIntervalMicroSeconds32(KMPXPtrEventRepeatRequestTime) 
   565                          TTimeIntervalMicroSeconds32(KMPXPtrEventRepeatRequestTime)
   566                          ,iVolumeDownControlRect); 
   566                          ,iVolumeDownControlRect);
   567 
   567 
   568             break;
   568             break;
   569         } 
   569         }
   570         case TPointerEvent::EDrag:
   570         case TPointerEvent::EDrag:
   571         {
   571         {
   572             iDragging = EVolumeDecreaseDragging;
   572             iDragging = EVolumeDecreaseDragging;
   573             break;
   573             break;
   574         }
   574         }
   575         case TPointerEvent::EButton1Up:
   575         case TPointerEvent::EButton1Up:
   576         {
   576         {
   577 #ifdef RD_TACTILE_FEEDBACK
   577 #ifdef RD_TACTILE_FEEDBACK
   578             if ( iFeedback )
   578             if ( iFeedback )
   579             {
   579             {
   580 #ifdef SYMBIAN_BUILD_GCE           	
   580 #ifdef SYMBIAN_BUILD_GCE
   581                 iFeedback->InstantFeedback( ETouchFeedbackSlider );
   581                 iFeedback->InstantFeedback( ETouchFeedbackSlider );
   582 #else
   582 #else
   583                 iFeedback->InstantFeedback( ETouchFeedbackBasic );
   583                 iFeedback->InstantFeedback( ETouchFeedbackBasic );
   584 #endif //SYMBIAN_BUILD_GCE
   584 #endif //SYMBIAN_BUILD_GCE
   585             }
   585             }
   699         case TPointerEvent::EDrag:
   699         case TPointerEvent::EDrag:
   700         {
   700         {
   701 #ifdef RD_TACTILE_FEEDBACK
   701 #ifdef RD_TACTILE_FEEDBACK
   702             if ( iFeedback )
   702             if ( iFeedback )
   703             {
   703             {
   704 #ifdef SYMBIAN_BUILD_GCE           	
   704 #ifdef SYMBIAN_BUILD_GCE
   705                 iFeedback->InstantFeedback( ETouchFeedbackSlider );
   705                 iFeedback->InstantFeedback( ETouchFeedbackSlider );
   706 #else
   706 #else
   707                 iFeedback->InstantFeedback( ETouchFeedbackSensitive );
   707                 iFeedback->InstantFeedback( ETouchFeedbackSensitive );
   708 #endif //SYMBIAN_BUILD_GCE
   708 #endif //SYMBIAN_BUILD_GCE
   709             }
   709             }
   725 
   725 
   726             if ( iDragging == EVolumeBarDragging && vol == 0 )
   726             if ( iDragging == EVolumeBarDragging && vol == 0 )
   727             {
   727             {
   728                 //
   728                 //
   729                 // volume & mute levels are kept track in playbackplugin.
   729                 // volume & mute levels are kept track in playbackplugin.
   730                 // 
   730                 //
   731                 iController->HandleCommandL( EMPXPbvCmdMute );
   731                 iController->HandleCommandL( EMPXPbvCmdMute );
   732             }
   732             }
   733 
   733 
   734             iDragging = EVolumeNotDragging;
   734             iDragging = EVolumeNotDragging;
   735 
   735 
   998 // CMPXVideoPlaybackVolumeBar::Reset
   998 // CMPXVideoPlaybackVolumeBar::Reset
   999 // -------------------------------------------------------------------------------------------------
   999 // -------------------------------------------------------------------------------------------------
  1000 //
  1000 //
  1001 void CMPXVideoPlaybackVolumeBar::Reset()
  1001 void CMPXVideoPlaybackVolumeBar::Reset()
  1002 {
  1002 {
  1003 	MPX_DEBUG(_L("CMPXVideoPlaybackVolumeBar::Reset()"));
  1003 	MPX_ENTER_EXIT(_L("CMPXVideoPlaybackVolumeBar::Reset()"));
  1004 
  1004 
  1005     if ( iDragging != EVolumeNotDragging )
  1005     if ( iDragging != EVolumeNotDragging )
  1006     {
  1006     {
  1007         TPointerEvent event;
  1007         TPointerEvent event;
  1008         event.iType = TPointerEvent::EButton1Up;
  1008         event.iType = TPointerEvent::EButton1Up;
  1009         event.iPosition.iY = ( iSliderRect.iTl.iY + iSliderRect.iBr.iY ) / 2;
  1009         event.iPosition.iY = ( iSliderRect.iTl.iY + iSliderRect.iBr.iY ) / 2;
  1010         
  1010 
  1011         MPX_TRAPD( err, HandlePointerEventL(event) );
  1011         MPX_TRAPD( err, HandlePointerEventL(event) );
  1012     }
  1012     }
  1013 }
  1013 }
  1014 
  1014 
  1015 // -------------------------------------------------------------------------------------------------
  1015 // -------------------------------------------------------------------------------------------------
  1016 // CMPXVideoPlaybackVolumeBar::SetVolumeL()
  1016 // CMPXVideoPlaybackVolumeBar::SetVolumeL()
  1017 // -------------------------------------------------------------------------------------------------
  1017 // -------------------------------------------------------------------------------------------------
  1018 //
  1018 //
  1019 void CMPXVideoPlaybackVolumeBar::SetVolumeL( TInt aVolume )
  1019 void CMPXVideoPlaybackVolumeBar::SetVolumeL( TInt aVolume )
  1020 {
  1020 {
  1021     MPX_DEBUG(_L("CMPXVideoPlaybackVolumeBar::SetVolumeL(%d)"), aVolume);
  1021     MPX_ENTER_EXIT(_L("CMPXVideoPlaybackVolumeBar::SetVolumeL()"),
  1022        
  1022                    _L("aVolume = %d"), aVolume );
       
  1023 
  1023     iController->HandleCommandL( EMPXPbvCmdSetVolume, aVolume );
  1024     iController->HandleCommandL( EMPXPbvCmdSetVolume, aVolume );
  1024 }
  1025 }
  1025 
  1026 
  1026 //  End of File
  1027 //  End of File