videoplayback/videoplaybackcontrols/src/mpxvideoplaybackcontrolscontroller.cpp
branchRCL_3
changeset 16 67eb01668b0e
parent 15 8f0df5c82986
child 21 315810614048
equal deleted inserted replaced
15:8f0df5c82986 16:67eb01668b0e
    14 * Description:  Implementation of MPXVideoPlaybackControlsController
    14 * Description:  Implementation of MPXVideoPlaybackControlsController
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 // Version : %version: 41 %
    19 // Version : %version: 42 %
    20 
    20 
    21 
    21 
    22 // INCLUDE FILES
    22 // INCLUDE FILES
    23 #include <fbs.h>
    23 #include <fbs.h>
    24 #include <coecntrl.h>
    24 #include <coecntrl.h>
    40 #include <data_caging_path_literals.hrh>
    40 #include <data_caging_path_literals.hrh>
    41 
    41 
    42 #include <mpxvideoplaybackcontrols.rsg>
    42 #include <mpxvideoplaybackcontrols.rsg>
    43 #include <mpxvideoplaybackcontrols.mbg>
    43 #include <mpxvideoplaybackcontrols.mbg>
    44 
    44 
       
    45 #include <avkondomainpskeys.h>
       
    46 
    45 #ifdef RD_TACTILE_FEEDBACK
    47 #ifdef RD_TACTILE_FEEDBACK
    46 #include <touchfeedback.h>
    48 #include <touchfeedback.h>
    47 #endif //RD_TACTILE_FEEDBACK
    49 #endif //RD_TACTILE_FEEDBACK
    48 
    50 
    49 #include "mpxvideoplaybackcontrol.h"
    51 #include "mpxvideoplaybackcontrol.h"
   113 
   115 
   114     iVideoResourceOffset = coeEnv->AddResourceFileL( resourceFile );
   116     iVideoResourceOffset = coeEnv->AddResourceFileL( resourceFile );
   115 
   117 
   116     iFileDetails = aDetails;
   118     iFileDetails = aDetails;
   117     iTvOutConnected = iFileDetails->iTvOutConnected;
   119     iTvOutConnected = iFileDetails->iTvOutConnected;
       
   120     iShowControls  = ETrue;
   118 
   121 
   119     iRNFormat = IsRealFormatL( iFileDetails->iClipName->Des() );
   122     iRNFormat = IsRealFormatL( iFileDetails->iClipName->Des() );
   120 
   123 
   121     iControlsPolicy = CMPXVideoPlaybackControlPolicy::NewL();
   124     iControlsPolicy = CMPXVideoPlaybackControlPolicy::NewL();
   122     iControlsConfig = CMPXVideoPlaybackControlConfiguration::NewL( this );
   125     iControlsConfig = CMPXVideoPlaybackControlConfiguration::NewL( this );
   326         }
   329         }
   327         case EMPXControlCmdHandleBackgroundEvent:
   330         case EMPXControlCmdHandleBackgroundEvent:
   328         {
   331         {
   329             MPX_DEBUG(_L("    [EMPXControlCmdHandleBackgroundEvent]"));
   332             MPX_DEBUG(_L("    [EMPXControlCmdHandleBackgroundEvent]"));
   330 
   333 
       
   334             TBool keylock( EFalse );
       
   335             RProperty::Get( KPSUidAvkonDomain, KAknKeyguardStatus, keylock );
       
   336 
       
   337             // Don't show controls when key is locked 
       
   338             if ( keylock )
       
   339             {
       
   340                 iShowControls = EFalse;
       
   341             }
       
   342 
   331             ResetDisappearingTimers( EMPXTimerReset );
   343             ResetDisappearingTimers( EMPXTimerReset );
   332 
   344 
   333             for ( TInt i = 0 ; i < iControls.Count() ; i++ )
   345             for ( TInt i = 0 ; i < iControls.Count() ; i++ )
   334             {
   346             {
   335                 iControls[i]->ResetControl();
   347                 iControls[i]->ResetControl();
   338             break;
   350             break;
   339         }
   351         }
   340         case EMPXControlCmdHandleForegroundEvent:
   352         case EMPXControlCmdHandleForegroundEvent:
   341         {
   353         {
   342             MPX_DEBUG(_L("    [EMPXControlCmdHandleForegroundEvent]"));
   354             MPX_DEBUG(_L("    [EMPXControlCmdHandleForegroundEvent]"));
       
   355             iShowControls = ETrue;
   343             UpdateControlsVisibility();
   356             UpdateControlsVisibility();
   344             break;
   357             break;
   345         }
   358         }
   346         case EMPXControlCmdHandleErrors:
   359         case EMPXControlCmdHandleErrors:
   347         {
   360         {
  1261 void CMPXVideoPlaybackControlsController::ShowControls()
  1274 void CMPXVideoPlaybackControlsController::ShowControls()
  1262 {
  1275 {
  1263     MPX_ENTER_EXIT(_L("CMPXVideoPlaybackControlsController::ShowControls()"),
  1276     MPX_ENTER_EXIT(_L("CMPXVideoPlaybackControlsController::ShowControls()"),
  1264                    _L("iState = %d"), iState );
  1277                    _L("iState = %d"), iState );
  1265 
  1278 
  1266     CloseMediaDetailsViewer();
  1279     if ( iShowControls )
  1267 
  1280     {
  1268     ResetDisappearingTimers( EMPXTimerReset );
  1281         CloseMediaDetailsViewer();
  1269 
  1282 
  1270     for ( TInt i = 0 ; i < iControls.Count() ; i++ )
  1283         ResetDisappearingTimers( EMPXTimerReset );
  1271     {
  1284 
  1272         iControls[i]->SetVisibility( iState );
  1285         for ( TInt i = 0 ; i < iControls.Count() ; i++ )
       
  1286         {
       
  1287             iControls[i]->SetVisibility( iState );
       
  1288         }
  1273     }
  1289     }
  1274 }
  1290 }
  1275 
  1291 
  1276 // -------------------------------------------------------------------------------------------------
  1292 // -------------------------------------------------------------------------------------------------
  1277 //   CMPXVideoPlaybackControlsController::IsVisible()
  1293 //   CMPXVideoPlaybackControlsController::IsVisible()