videoplayback/videoplaybackviews/src/mpxvideobaseplaybackview.cpp
branchRCL_3
changeset 21 315810614048
parent 20 2d690156cf8f
equal deleted inserted replaced
20:2d690156cf8f 21:315810614048
    14 * Description:   Implementation of Video base playback view
    14 * Description:   Implementation of Video base playback view
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 // Version : %version: 83 %
    19 // Version : %version: 86 %
    20 
    20 
    21 
    21 
    22 //  Include Files
    22 //  Include Files
    23 
    23 
    24 #include <aknViewAppUi.h>
    24 #include <aknViewAppUi.h>
   187 
   187 
   188 // -------------------------------------------------------------------------------------------------
   188 // -------------------------------------------------------------------------------------------------
   189 //   CMPXVideoBasePlaybackView::CreateGeneralPlaybackCommandL()
   189 //   CMPXVideoBasePlaybackView::CreateGeneralPlaybackCommandL()
   190 // -------------------------------------------------------------------------------------------------
   190 // -------------------------------------------------------------------------------------------------
   191 //
   191 //
   192 void CMPXVideoBasePlaybackView::CreateGeneralPlaybackCommandL( TMPXPlaybackCommand aCmd, TBool aDoSync )
   192 void CMPXVideoBasePlaybackView::CreateGeneralPlaybackCommandL( TMPXPlaybackCommand aCmd,
       
   193                                                                TBool aDoSync )
   193 {
   194 {
   194     MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::CreateGeneralPlaybackCommandL()"),
   195     MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::CreateGeneralPlaybackCommandL()"),
   195                    _L("aCmd = %d, aDoSync, = %d"), aCmd, aDoSync );
   196                    _L("aCmd = %d, aDoSync, = %d"), aCmd, aDoSync );
   196 
   197 
   197     CMPXCommand* cmd = CMPXCommand::NewL();
   198     CMPXCommand* cmd = CMPXCommand::NewL();
   232         }
   233         }
   233         case EAknSoftkeyClose:
   234         case EAknSoftkeyClose:
   234         case EMPXPbvCmdClose:
   235         case EMPXPbvCmdClose:
   235         {
   236         {
   236             MPX_DEBUG(_L("CMPXVideoBasePlaybackView::HandleCommandL() EMPXPbvCmdClose"));
   237             MPX_DEBUG(_L("CMPXVideoBasePlaybackView::HandleCommandL() EMPXPbvCmdClose"));
   237             CreateGeneralPlaybackCommandL( EPbCmdClose );
   238             CreateGeneralPlaybackCommandL( EPbCmdClose, iSyncClose );
   238             break;
   239             break;
   239         }
   240         }
   240         case EMPXPbvCmdSeekForward:
   241         case EMPXPbvCmdSeekForward:
   241         {
   242         {
   242             MPX_DEBUG(_L("CMPXVideoBasePlaybackView::HandleCommandL() EMPXPbvCmdSeekForward"));
   243             MPX_DEBUG(_L("CMPXVideoBasePlaybackView::HandleCommandL() EMPXPbvCmdSeekForward"));
   467     iContainer->GetWindow().EnableVisibilityChangeEvents();
   468     iContainer->GetWindow().EnableVisibilityChangeEvents();
   468 
   469 
   469     iKeyboardInFocus = ETrue;
   470     iKeyboardInFocus = ETrue;
   470     iAknEventMonitor->Enable( ETrue );
   471     iAknEventMonitor->Enable( ETrue );
   471     iAknEventMonitor->AddObserverL( this );
   472     iAknEventMonitor->AddObserverL( this );
   472 
       
   473     //
       
   474     //  Deactivate the CBA set the LSK & RSK to empty
       
   475     //
       
   476     Cba()->SetCommandSetL( R_AVKON_SOFTKEYS_EMPTY );
       
   477 
   473 
   478     //
   474     //
   479     //  Determine if the playback is from a playlist on view activation
   475     //  Determine if the playback is from a playlist on view activation
   480     //
   476     //
   481     MMPXSource* s = iPlaybackUtility->Source();
   477     MMPXSource* s = iPlaybackUtility->Source();
   889                 cmdId = EMPXControlCmdTvOutConnected;
   885                 cmdId = EMPXControlCmdTvOutConnected;
   890             }
   886             }
   891 
   887 
   892             if ( iContainer )
   888             if ( iContainer )
   893             {
   889             {
   894                 MPX_TRAPD( err, iContainer->HandleEventL( cmdId ) );
   890                 MPX_TRAPD( err,
   895             }
   891                     iContainer->HandleEventL( cmdId, iDisplayHandler->ShowAspectRatioIcon() ) );
       
   892             }
       
   893 
   896             break;
   894             break;
   897         }
   895         }
   898         case EPbCmdLoadingStarted:
   896         case EPbCmdLoadingStarted:
   899         {
   897         {
   900             if ( iContainer )
   898             if ( iContainer )
  1278             //
  1276             //
  1279             //  Calculate the aspect ratio and setup the display hanlder with the display window
  1277             //  Calculate the aspect ratio and setup the display hanlder with the display window
  1280             //  Aspect ratio should be calculated 1st so the auto scale will be set when
  1278             //  Aspect ratio should be calculated 1st so the auto scale will be set when
  1281             //  the display window is created.
  1279             //  the display window is created.
  1282             //
  1280             //
  1283             TInt newAspectRatio = iDisplayHandler->SetDefaultAspectRatioL( iFileDetails );
       
  1284 
       
  1285             iDisplayHandler->CreateDisplayWindowL( *(CCoeEnv::Static()->ScreenDevice()),
  1281             iDisplayHandler->CreateDisplayWindowL( *(CCoeEnv::Static()->ScreenDevice()),
  1286                                                    iContainer->GetWindow() );
  1282                                                    iContainer->GetWindow(),
  1287 
  1283                                                    iFileDetails );
  1288             iContainer->HandleEventL( EMPXControlCmdSetAspectRatio, newAspectRatio );
       
  1289         }
  1284         }
  1290         else
  1285         else
  1291         {
  1286         {
  1292             //
  1287             //
  1293             //  Remove the display window so the surface can be released
  1288             //  Remove the display window so the surface can be released
  1618 //
  1613 //
  1619 void CMPXVideoBasePlaybackView::SetAspectRatioL( TMPXVideoPlaybackCommand aCmd )
  1614 void CMPXVideoBasePlaybackView::SetAspectRatioL( TMPXVideoPlaybackCommand aCmd )
  1620 {
  1615 {
  1621     MPX_DEBUG(_L("CMPXVideoBasePlaybackView::SetAspectRatioL()"));
  1616     MPX_DEBUG(_L("CMPXVideoBasePlaybackView::SetAspectRatioL()"));
  1622 
  1617 
  1623     TInt newAspectRatio = iDisplayHandler->SetAspectRatioL( aCmd );
  1618     iDisplayHandler->SetAspectRatioL( aCmd );
  1624 
       
  1625     if ( iContainer )
       
  1626     {
       
  1627         iContainer->HandleEventL( EMPXControlCmdSetAspectRatio, newAspectRatio );
       
  1628     }
       
  1629 }
  1619 }
  1630 
  1620 
  1631 // -------------------------------------------------------------------------------------------------
  1621 // -------------------------------------------------------------------------------------------------
  1632 //   CMPXVideoBasePlaybackView::IsAppInFrontL()
  1622 //   CMPXVideoBasePlaybackView::IsAppInFrontL()
  1633 // -------------------------------------------------------------------------------------------------
  1623 // -------------------------------------------------------------------------------------------------