videoplayback/videoplaybackcontrols/src/mpxvideoplaybackcontrolscontroller.cpp
branchRCL_3
changeset 70 375929f879c2
parent 57 befca0ec475f
equal deleted inserted replaced
64:3eb824b18d67 70:375929f879c2
    14 * Description:  Implementation of MPXVideoPlaybackControlsController
    14 * Description:  Implementation of MPXVideoPlaybackControlsController
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 // Version : %version: 45 %
    19 // Version : %version: 44 %
    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>
   115 
   115 
   116     iVideoResourceOffset = coeEnv->AddResourceFileL( resourceFile );
   116     iVideoResourceOffset = coeEnv->AddResourceFileL( resourceFile );
   117 
   117 
   118     iFileDetails = aDetails;
   118     iFileDetails = aDetails;
   119     iTvOutConnected = iFileDetails->iTvOutConnected;
   119     iTvOutConnected = iFileDetails->iTvOutConnected;
       
   120     iShowControls  = ETrue;
   120 
   121 
   121     iRNFormat = IsRealFormatL( iFileDetails->iClipName->Des() );
   122     iRNFormat = IsRealFormatL( iFileDetails->iClipName->Des() );
   122 
       
   123     if ( IsRealOneBitmapVisible() )
       
   124     {
       
   125         iShowControls  = EFalse;
       
   126     }
       
   127     else
       
   128     {
       
   129         iShowControls  = ETrue;
       
   130     }
       
   131 
   123 
   132     iControlsPolicy = CMPXVideoPlaybackControlPolicy::NewL();
   124     iControlsPolicy = CMPXVideoPlaybackControlPolicy::NewL();
   133     iControlsConfig = CMPXVideoPlaybackControlConfiguration::NewL( this );
   125     iControlsConfig = CMPXVideoPlaybackControlConfiguration::NewL( this );
   134 
   126 
   135     iControlsTimer = CPeriodic::NewL( CActive::EPriorityStandard );
   127     iControlsTimer = CPeriodic::NewL( CActive::EPriorityStandard );
   363             break;
   355             break;
   364         }
   356         }
   365         case EMPXControlCmdHandleForegroundEvent:
   357         case EMPXControlCmdHandleForegroundEvent:
   366         {
   358         {
   367             MPX_DEBUG(_L("    [EMPXControlCmdHandleForegroundEvent]"));
   359             MPX_DEBUG(_L("    [EMPXControlCmdHandleForegroundEvent]"));
   368 
   360             iShowControls = ETrue;
   369             if ( ! IsRealOneBitmapVisible() )
   361             UpdateControlsVisibility();
   370             {
       
   371                 iShowControls = ETrue;
       
   372                 UpdateControlsVisibility();
       
   373             }
       
   374 
       
   375             break;
   362             break;
   376         }
   363         }
   377         case EMPXControlCmdHandleErrors:
   364         case EMPXControlCmdHandleErrors:
   378         {
   365         {
   379             MPX_DEBUG(_L("    [EMPXControlCmdHandleErrors]"));
   366             MPX_DEBUG(_L("    [EMPXControlCmdHandleErrors]"));
  1787     MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::SetRealOneBitmapVisibility(%d)"), aVisible);
  1774     MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::SetRealOneBitmapVisibility(%d)"), aVisible);
  1788 
  1775 
  1789     if ( iRealOneBitmap )
  1776     if ( iRealOneBitmap )
  1790     {
  1777     {
  1791         iRealOneBitmap->MakeVisible( aVisible );
  1778         iRealOneBitmap->MakeVisible( aVisible );
  1792 
  1779     }
  1793         if ( ! aVisible )
       
  1794         {
       
  1795             // HDMI/TV-out cable connected then show the controls
       
  1796             if ( iTvOutConnected  && !iShowControls )
       
  1797             {
       
  1798                 iShowControls = ETrue;
       
  1799                 UpdateControlsVisibility();
       
  1800             }
       
  1801             else
       
  1802             {
       
  1803                 iShowControls = ETrue;
       
  1804             }
       
  1805         }
       
  1806     }// iRealOneBitmap
       
  1807 }
       
  1808 
       
  1809 // -------------------------------------------------------------------------------------------------
       
  1810 //   CMPXVideoPlaybackControlsController::IsRealOneBitmapVisible()
       
  1811 // -------------------------------------------------------------------------------------------------
       
  1812 //
       
  1813 TBool CMPXVideoPlaybackControlsController::IsRealOneBitmapVisible()
       
  1814 {
       
  1815     TBool visible = EFalse;
       
  1816 
       
  1817     if ( iRealOneBitmap )
       
  1818     {
       
  1819         visible = iRealOneBitmap->IsVisible();
       
  1820     }
       
  1821 
       
  1822     MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::IsRealOneBitmapVisible(%d)"), visible);
       
  1823 
       
  1824     return visible;
       
  1825 }
  1780 }
  1826 
  1781 
  1827 // -------------------------------------------------------------------------------------------------
  1782 // -------------------------------------------------------------------------------------------------
  1828 // CMPXVideoPlaybackControlsController::HandleErrors
  1783 // CMPXVideoPlaybackControlsController::HandleErrors
  1829 // -------------------------------------------------------------------------------------------------
  1784 // -------------------------------------------------------------------------------------------------