videoplayback/videoplaybackcontrols/src/mpxvideoplaybackcontrolscontroller.cpp
branchRCL_3
changeset 15 8f0df5c82986
parent 14 55fa1ec415c6
child 16 67eb01668b0e
equal deleted inserted replaced
14:55fa1ec415c6 15:8f0df5c82986
    14 * Description:  Implementation of MPXVideoPlaybackControlsController
    14 * Description:  Implementation of MPXVideoPlaybackControlsController
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 // Version : %version: 37 %
    19 // Version : %version: 41 %
    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>
    77 //
    77 //
    78 CMPXVideoPlaybackControlsController::CMPXVideoPlaybackControlsController(
    78 CMPXVideoPlaybackControlsController::CMPXVideoPlaybackControlsController(
    79     CMPXVideoPlaybackContainer* aContainer, TRect aRect )
    79     CMPXVideoPlaybackContainer* aContainer, TRect aRect )
    80     : iControls( EMPXControlsCount ),
    80     : iControls( EMPXControlsCount ),
    81       iRect( aRect ),
    81       iRect( aRect ),
    82       iSurfaceCreated( EFalse ),
       
    83       iContainer( aContainer )
    82       iContainer( aContainer )
    84 {
    83 {
    85 }
    84 }
    86 
    85 
    87 // -------------------------------------------------------------------------------------------------
    86 // -------------------------------------------------------------------------------------------------
   192 
   191 
   193     iControls.ResetAndDestroy();
   192     iControls.ResetAndDestroy();
   194 
   193 
   195     if ( iRealOneBitmap )
   194     if ( iRealOneBitmap )
   196     {
   195     {
       
   196         SetRealOneBitmapVisibility( EFalse );
   197         delete iRealOneBitmap;
   197         delete iRealOneBitmap;
   198         iRealOneBitmap = NULL ;
   198         iRealOneBitmap = NULL ;
   199     }
   199     }
   200 
   200 
   201     if ( iVideoResourceOffset )
   201     if ( iVideoResourceOffset )
   335                 iControls[i]->ResetControl();
   335                 iControls[i]->ResetControl();
   336             }
   336             }
   337 
   337 
   338             break;
   338             break;
   339         }
   339         }
       
   340         case EMPXControlCmdHandleForegroundEvent:
       
   341         {
       
   342             MPX_DEBUG(_L("    [EMPXControlCmdHandleForegroundEvent]"));
       
   343             UpdateControlsVisibility();
       
   344             break;
       
   345         }
   340         case EMPXControlCmdHandleErrors:
   346         case EMPXControlCmdHandleErrors:
   341         {
   347         {
   342             MPX_DEBUG(_L("    [EMPXControlCmdHandleErrors]"));
   348             MPX_DEBUG(_L("    [EMPXControlCmdHandleErrors]"));
   343             HandleErrors();
   349             HandleErrors();
   344             break;
   350             break;
   370             ShowControls();
   376             ShowControls();
   371             break;
   377             break;
   372         }
   378         }
   373         case EMPXControlCmdSurfaceCreated:
   379         case EMPXControlCmdSurfaceCreated:
   374         {
   380         {
   375             iSurfaceCreated = ETrue;
       
   376             SetRealOneBitmapVisibility( EFalse );
   381             SetRealOneBitmapVisibility( EFalse );
   377             RedrawControlsForSurfaceChanges();
       
   378             break;
       
   379         }
       
   380         case EMPXControlCmdSurfaceRemoved:
       
   381         {
       
   382             iSurfaceCreated = EFalse;
       
   383             RedrawControlsForSurfaceChanges();
       
   384             break;
   382             break;
   385         }
   383         }
   386         case EMPXControlCmdLoadingStarted:
   384         case EMPXControlCmdLoadingStarted:
   387         {
   385         {
   388             HandleLoadingStarted();
   386             HandleLoadingStarted();
  1383 //
  1381 //
  1384 void CMPXVideoPlaybackControlsController::AspectRatioChanged( TInt aAspectRatio )
  1382 void CMPXVideoPlaybackControlsController::AspectRatioChanged( TInt aAspectRatio )
  1385 {
  1383 {
  1386     MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::AspectRatioChanged() [%d]"), aAspectRatio);
  1384     MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::AspectRatioChanged() [%d]"), aAspectRatio);
  1387 
  1385 
       
  1386     iAspectRatio = (TMMFScalingType)aAspectRatio;
       
  1387 
  1388     for ( TInt i = 0 ; i < iControls.Count() ; i++ )
  1388     for ( TInt i = 0 ; i < iControls.Count() ; i++ )
  1389     {
  1389     {
  1390         if ( iControls[i]->AspectRatioChanged( aAspectRatio ) )
  1390         if ( iControls[i]->AspectRatioChanged( aAspectRatio ) )
  1391         {
  1391         {
  1392             break;
  1392             break;
  1797 // -------------------------------------------------------------------------------------------------
  1797 // -------------------------------------------------------------------------------------------------
  1798 //
  1798 //
  1799 void CMPXVideoPlaybackControlsController::HandleTvOutEventL(
  1799 void CMPXVideoPlaybackControlsController::HandleTvOutEventL(
  1800         TBool aConnected, TMPXVideoPlaybackControlCommandIds aEvent )
  1800         TBool aConnected, TMPXVideoPlaybackControlCommandIds aEvent )
  1801 {
  1801 {
  1802     MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::HandleTvOutEventL()"));
  1802     MPX_ENTER_EXIT(_L("CMPXVideoPlaybackControlsController::HandleTvOutEventL()"));
  1803 
  1803 
  1804     iFileDetails->iTvOutConnected = aConnected;
  1804     iFileDetails->iTvOutConnected = aConnected;
  1805     iControlsConfig->UpdateControlListL( aEvent );
  1805     iControlsConfig->UpdateControlListL( aEvent );
  1806     ControlsListUpdatedL();
  1806     ControlsListUpdatedL();
  1807 }
  1807 }
  1921         iMediaDetailsViewerControl = NULL;
  1921         iMediaDetailsViewerControl = NULL;
  1922     }
  1922     }
  1923 }
  1923 }
  1924 
  1924 
  1925 // -------------------------------------------------------------------------------------------------
  1925 // -------------------------------------------------------------------------------------------------
  1926 //   CMPXVideoPlaybackControlsController::SetBackgroundBlack
       
  1927 // -------------------------------------------------------------------------------------------------
       
  1928 //
       
  1929 TBool CMPXVideoPlaybackControlsController::SetBackgroundBlack()
       
  1930 {
       
  1931     TBool backgroundBlack = iSurfaceCreated && ! iTvOutConnected;
       
  1932 
       
  1933     MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::SetBackgroundBlack(%d)"), backgroundBlack);
       
  1934     return backgroundBlack;
       
  1935 }
       
  1936 
       
  1937 // -------------------------------------------------------------------------------------------------
       
  1938 //   CMPXVideoPlaybackControlsController::ShowAspectRatioIcon
  1926 //   CMPXVideoPlaybackControlsController::ShowAspectRatioIcon
  1939 // -------------------------------------------------------------------------------------------------
  1927 // -------------------------------------------------------------------------------------------------
  1940 //
  1928 //
  1941 TBool CMPXVideoPlaybackControlsController::ShowAspectRatioIcon()
  1929 TBool CMPXVideoPlaybackControlsController::ShowAspectRatioIcon()
  1942 {
  1930 {
  1980         UpdateStateOnButtonBar();
  1968         UpdateStateOnButtonBar();
  1981         UpdateControlsVisibility();
  1969         UpdateControlsVisibility();
  1982     }
  1970     }
  1983 }
  1971 }
  1984 
  1972 
  1985 // -------------------------------------------------------------------------------------------------
       
  1986 //   CMPXVideoPlaybackControlsController::RedrawControlsForSurfaceChanges
       
  1987 // -------------------------------------------------------------------------------------------------
       
  1988 //
       
  1989 void CMPXVideoPlaybackControlsController::RedrawControlsForSurfaceChanges()
       
  1990 {
       
  1991     MPX_ENTER_EXIT(_L("CMPXVideoPlaybackControlsController::RedrawControlsForSurfaceChanges()"));
       
  1992 
       
  1993     //
       
  1994     //  A surface has been added or removed.
       
  1995     //  If the controls are visible, redraw them with the new transparency value.
       
  1996     //
       
  1997     if ( IsVisible() )
       
  1998     {
       
  1999         UpdateControlsVisibility();
       
  2000     }
       
  2001 }
       
  2002 
       
  2003 
       
  2004 // End of File
  1973 // End of File