64 using namespace AknLayoutScalable_Avkon; |
65 using namespace AknLayoutScalable_Avkon; |
65 |
66 |
66 const TInt KMPXControlsTimeOut = 4000000; |
67 const TInt KMPXControlsTimeOut = 4000000; |
67 |
68 |
68 const TInt KMP4LayoutSet = 6; |
69 const TInt KMP4LayoutSet = 6; |
|
70 |
69 // ================= MEMBER FUNCTIONS ============================================================== |
71 // ================= MEMBER FUNCTIONS ============================================================== |
70 |
72 |
71 // ------------------------------------------------------------------------------------------------- |
73 // ------------------------------------------------------------------------------------------------- |
72 // CMPXVideoPlaybackControlsController::CMPXVideoPlaybackControlsController |
74 // CMPXVideoPlaybackControlsController::CMPXVideoPlaybackControlsController |
73 // C++ default constructor can NOT contain any code, that might leave. |
75 // C++ default constructor can NOT contain any code, that might leave. |
75 // |
77 // |
76 CMPXVideoPlaybackControlsController::CMPXVideoPlaybackControlsController( |
78 CMPXVideoPlaybackControlsController::CMPXVideoPlaybackControlsController( |
77 CMPXVideoPlaybackContainer* aContainer, TRect aRect ) |
79 CMPXVideoPlaybackContainer* aContainer, TRect aRect ) |
78 : iControls( EMPXControlsCount ), |
80 : iControls( EMPXControlsCount ), |
79 iRect( aRect ), |
81 iRect( aRect ), |
80 iContainer( aContainer ), |
82 iSurfaceCreated( EFalse ), |
81 iSurfaceCreated(EFalse) |
83 iContainer( aContainer ) |
82 { |
84 { |
83 } |
85 } |
84 |
86 |
85 // ------------------------------------------------------------------------------------------------- |
87 // ------------------------------------------------------------------------------------------------- |
86 // CMPXVideoPlaybackControlsController::ConstructL() |
88 // CMPXVideoPlaybackControlsController::ConstructL() |
113 iVideoResourceOffset = coeEnv->AddResourceFileL( resourceFile ); |
115 iVideoResourceOffset = coeEnv->AddResourceFileL( resourceFile ); |
114 |
116 |
115 iFileDetails = aDetails; |
117 iFileDetails = aDetails; |
116 iTvOutConnected = iFileDetails->iTvOutConnected; |
118 iTvOutConnected = iFileDetails->iTvOutConnected; |
117 |
119 |
118 iFileDetails->iRNFormat = IsRealFormatL( iFileDetails->iClipName->Des() ); |
120 iRNFormat = IsRealFormatL( iFileDetails->iClipName->Des() ); |
119 |
|
120 if ( iFileDetails->iRNFormat ) |
|
121 { |
|
122 CreateRealOneBitmapL(); |
|
123 } |
|
124 |
121 |
125 iControlsPolicy = CMPXVideoPlaybackControlPolicy::NewL(); |
122 iControlsPolicy = CMPXVideoPlaybackControlPolicy::NewL(); |
126 iControlsConfig = CMPXVideoPlaybackControlConfiguration::NewL( this ); |
123 iControlsConfig = CMPXVideoPlaybackControlConfiguration::NewL( this ); |
127 |
124 |
128 iControlsTimer = CPeriodic::NewL( CActive::EPriorityStandard ); |
125 iControlsTimer = CPeriodic::NewL( CActive::EPriorityStandard ); |
222 CMPXVideoPlaybackViewFileDetails* aDetails ) |
218 CMPXVideoPlaybackViewFileDetails* aDetails ) |
223 { |
219 { |
224 MPX_ENTER_EXIT(_L("CMPXVideoPlaybackControlsController::AddFileDetailsL()")); |
220 MPX_ENTER_EXIT(_L("CMPXVideoPlaybackControlsController::AddFileDetailsL()")); |
225 |
221 |
226 iFileDetails = aDetails; |
222 iFileDetails = aDetails; |
227 |
|
228 iFileDetails->iRNFormat = IsRealFormatL( iFileDetails->iClipName->Des() ); |
|
229 |
223 |
230 iControlsConfig->UpdateControlsWithFileDetailsL(); |
224 iControlsConfig->UpdateControlsWithFileDetailsL(); |
231 |
225 |
232 ControlsListUpdatedL(); |
226 ControlsListUpdatedL(); |
233 |
227 |
375 { |
369 { |
376 ShowControls(); |
370 ShowControls(); |
377 break; |
371 break; |
378 } |
372 } |
379 case EMPXControlCmdSurfaceCreated: |
373 case EMPXControlCmdSurfaceCreated: |
380 { |
374 { |
381 // |
375 iSurfaceCreated = ETrue; |
382 // When surface is created, remove the Real One Bitmap |
376 SetRealOneBitmapVisibility( EFalse ); |
383 // |
377 break; |
384 iSurfaceCreated = ETrue; |
378 } |
385 SetRealOneBitmapVisibility( EFalse ); |
379 case EMPXControlCmdSurfaceRemoved: |
386 break; |
380 { |
387 } |
381 iSurfaceCreated = EFalse; |
|
382 break; |
|
383 } |
388 } |
384 } |
389 } |
385 } |
390 |
386 |
391 // ------------------------------------------------------------------------------------------------- |
387 // ------------------------------------------------------------------------------------------------- |
392 // CMPXVideoPlaybackControlsController::HandleStateChange |
388 // CMPXVideoPlaybackControlsController::HandleStateChange |
414 // remove branding control when the state is transitioned to Initialized |
410 // remove branding control when the state is transitioned to Initialized |
415 // |
411 // |
416 if ( iFileDetails->iPlaybackMode == EMPXVideoStreaming || |
412 if ( iFileDetails->iPlaybackMode == EMPXVideoStreaming || |
417 iFileDetails->iPlaybackMode == EMPXVideoLiveStreaming ) |
413 iFileDetails->iPlaybackMode == EMPXVideoLiveStreaming ) |
418 { |
414 { |
419 iControlsConfig->UpdateControlListL( EMPXControlCmdPluginInitialized ); |
415 TRAP_IGNORE( |
420 ControlsListUpdatedL(); |
416 iControlsConfig->UpdateControlListL( EMPXControlCmdPluginInitialized ); |
|
417 ControlsListUpdatedL(); |
|
418 ); |
421 } |
419 } |
422 |
420 |
423 break; |
421 break; |
424 } |
422 } |
425 case EPbStatePlaying: |
423 case EPbStatePlaying: |
494 // ------------------------------------------------------------------------------------------------- |
492 // ------------------------------------------------------------------------------------------------- |
495 // |
493 // |
496 void CMPXVideoPlaybackControlsController::CreateRealOneBitmapL() |
494 void CMPXVideoPlaybackControlsController::CreateRealOneBitmapL() |
497 { |
495 { |
498 MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::CreateRealOneBitmapL()")); |
496 MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::CreateRealOneBitmapL()")); |
499 |
|
500 |
497 |
501 TFileName iconsPath; |
498 TFileName iconsPath; |
502 LocateBitmapFileL( iconsPath ); |
499 LocateBitmapFileL( iconsPath ); |
503 |
500 |
504 iRealOneBitmap = CreateBitmapL( iconsPath, |
501 iRealOneBitmap = CreateBitmapL( iconsPath, |
878 brandingPaneRect.Rect().iBr.iX-20, |
875 brandingPaneRect.Rect().iBr.iX-20, |
879 brandingPaneRect.Rect().iBr.iY-50 ); |
876 brandingPaneRect.Rect().iBr.iY-50 ); |
880 CMPXVideoPlaybackBrandingAnimation* brandingAnimation = |
877 CMPXVideoPlaybackBrandingAnimation* brandingAnimation = |
881 CMPXVideoPlaybackBrandingAnimation::NewL( this, |
878 CMPXVideoPlaybackBrandingAnimation::NewL( this, |
882 brandingLogoRect, |
879 brandingLogoRect, |
883 iFileDetails->iRNFormat ); |
880 iRNFormat ); |
884 |
881 |
885 CleanupStack::PushL( brandingAnimation ); |
882 CleanupStack::PushL( brandingAnimation ); |
886 |
883 |
887 CMPXVideoPlaybackControl* control = |
884 CMPXVideoPlaybackControl* control = |
888 CMPXVideoPlaybackControl::NewL( this, |
885 CMPXVideoPlaybackControl::NewL( this, |
1581 TBool realFormat = EFalse; |
1578 TBool realFormat = EFalse; |
1582 |
1579 |
1583 _LIT(KMPXReal, "real" ); |
1580 _LIT(KMPXReal, "real" ); |
1584 _LIT(KMPXRN, "rn" ); |
1581 _LIT(KMPXRN, "rn" ); |
1585 |
1582 |
1586 if (iFileDetails->iMimeType) |
1583 if ( iFileDetails->iMimeType ) |
1587 { |
1584 { |
1588 iFileDetails->iMimeType->Des().LowerCase(); |
1585 iFileDetails->iMimeType->Des().LowerCase(); |
1589 |
1586 |
1590 if ( iFileDetails->iMimeType->Find( KMPXReal ) >= 0 || |
1587 if ( iFileDetails->iMimeType->Find( KMPXReal ) >= 0 || |
1591 iFileDetails->iMimeType->Find( KMPXRN ) >= 0 ) |
1588 iFileDetails->iMimeType->Find( KMPXRN ) >= 0 ) |
1592 { |
1589 { |
|
1590 // |
|
1591 // RN clip and local mode, add RN logo bitmap to show while initializing |
|
1592 // |
|
1593 CreateRealOneBitmapL(); |
|
1594 SetRealOneBitmapVisibility( ETrue ); |
1593 realFormat = ETrue; |
1595 realFormat = ETrue; |
1594 } |
1596 } |
1595 } |
1597 } |
1596 |
1598 |
1597 MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::RealFormatForLocalL() [%d]"), realFormat); |
1599 MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::RealFormatForLocalL() [%d]"), realFormat); |
1717 { |
1719 { |
1718 MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::SetRealOneBitmapVisibility(%d)"), aVisible); |
1720 MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::SetRealOneBitmapVisibility(%d)"), aVisible); |
1719 |
1721 |
1720 if ( iRealOneBitmap ) |
1722 if ( iRealOneBitmap ) |
1721 { |
1723 { |
1722 iRealOneBitmap->MakeVisible( aVisible ); |
1724 iRealOneBitmap->MakeVisible( aVisible ); |
1723 } |
1725 } |
1724 } |
1726 } |
1725 |
1727 |
1726 // ------------------------------------------------------------------------------------------------- |
1728 // ------------------------------------------------------------------------------------------------- |
1727 // CMPXVideoPlaybackControlsController::HandleErrors |
1729 // CMPXVideoPlaybackControlsController::HandleErrors |
1923 delete iMediaDetailsViewerControl; |
1921 delete iMediaDetailsViewerControl; |
1924 iMediaDetailsViewerControl = NULL; |
1922 iMediaDetailsViewerControl = NULL; |
1925 } |
1923 } |
1926 } |
1924 } |
1927 |
1925 |
|
1926 // ------------------------------------------------------------------------------------------------- |
|
1927 // CMPXVideoPlaybackControlsController::SetBackgroundBlack |
|
1928 // ------------------------------------------------------------------------------------------------- |
|
1929 // |
1928 TBool CMPXVideoPlaybackControlsController::SetBackgroundBlack() |
1930 TBool CMPXVideoPlaybackControlsController::SetBackgroundBlack() |
1929 { |
1931 { |
1930 TBool backgroundBlack = iSurfaceCreated && !iTvOutConnected; |
1932 TBool backgroundBlack = iSurfaceCreated && ! iTvOutConnected; |
1931 |
1933 |
1932 MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::SetBackgroundBlack(%d)"), backgroundBlack); |
1934 MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::SetBackgroundBlack(%d)"), backgroundBlack); |
1933 return backgroundBlack; |
1935 return backgroundBlack; |
1934 } |
1936 } |
1935 |
1937 |
|
1938 // ------------------------------------------------------------------------------------------------- |
|
1939 // CMPXVideoPlaybackControlsController::IsSameAspectRatio |
|
1940 // ------------------------------------------------------------------------------------------------- |
|
1941 // |
|
1942 TBool CMPXVideoPlaybackControlsController::IsSameAspectRatio() |
|
1943 { |
|
1944 MPX_ENTER_EXIT( _L( "CMPXVideoPlaybackControlsController::IsSameAspectRatio()" ) ); |
|
1945 |
|
1946 TBool retVal = EFalse; |
|
1947 |
|
1948 if ( iFileDetails->iVideoEnabled && |
|
1949 iFileDetails->iVideoHeight > 0 && |
|
1950 iFileDetails->iVideoWidth > 0 ) |
|
1951 { |
|
1952 TRect displayRect = iContainer->Rect(); |
|
1953 TReal displayAspectRatio = ( TReal32 )displayRect.Width() / ( TReal32 )displayRect.Height(); |
|
1954 TReal videoAspectRatio = ( TReal32 )iFileDetails->iVideoWidth / |
|
1955 ( TReal32 )iFileDetails->iVideoHeight; |
|
1956 |
|
1957 if ( displayAspectRatio == videoAspectRatio ) |
|
1958 { |
|
1959 retVal = ETrue; |
|
1960 } |
|
1961 } |
|
1962 |
|
1963 MPX_DEBUG( _L( "CMPXVideoPlaybackControlsController::IsSameAspectRatio(%d)" ), retVal ); |
|
1964 |
|
1965 return retVal; |
|
1966 } |
1936 |
1967 |
1937 // End of File |
1968 // End of File |