54 #include <mpxfmtx.rsg> // For FF_FMTX |
54 #include <mpxfmtx.rsg> // For FF_FMTX |
55 #include <mpxappui.hrh> |
55 #include <mpxappui.hrh> |
56 #include <mpxinternalcrkeys.h> |
56 #include <mpxinternalcrkeys.h> |
57 #include <touchfeedback.h> |
57 #include <touchfeedback.h> |
58 #include <akntranseffect.h> // For transition effects |
58 #include <akntranseffect.h> // For transition effects |
59 #include <gfxtranseffect\gfxtranseffect.h> // For transition effects |
59 #include <gfxtranseffect/gfxtranseffect.h> // For transition effects |
60 |
60 |
61 #include "mpxcommonplaybackviewcontainer.h" |
61 #include "mpxcommonplaybackviewcontainer.h" |
62 #include "mpxcommonplaybackviewlayout.h" |
62 #include "mpxcommonplaybackviewlayout.h" |
63 #include "mpxcommonplaybackview.hrh" |
63 #include "mpxcommonplaybackview.hrh" |
64 #include "mpxplaybackview.hlp.hrh" |
64 #include "mpxplaybackview.hlp.hrh" |
180 iActiveView = ETrue; |
180 iActiveView = ETrue; |
181 iPrerollCompleted = EFalse; |
181 iPrerollCompleted = EFalse; |
182 |
182 |
183 iLightStatus = CHWRMLight::ELightStatusUnknown; |
183 iLightStatus = CHWRMLight::ELightStatusUnknown; |
184 iIsForeground = EFalse ; |
184 iIsForeground = EFalse ; |
185 iLight = CHWRMLight::NewL(this); |
185 iLight = CHWRMLight::NewL(this); |
186 |
186 |
187 DrawableWindow()->SetPointerGrab( ETrue ); |
187 DrawableWindow()->SetPointerGrab( ETrue ); |
188 EnableDragEvents(); |
188 EnableDragEvents(); |
189 |
189 |
190 MPX_DEBUG1( "CMPXCommonPlaybackViewContainer::ConstructL() exiting" ); |
190 MPX_DEBUG1( "CMPXCommonPlaybackViewContainer::ConstructL() exiting" ); |
717 if ( aBitmap && KErrNone == aErr ) |
717 if ( aBitmap && KErrNone == aErr ) |
718 { |
718 { |
719 iTrackAlbumArt = aBitmap; |
719 iTrackAlbumArt = aBitmap; |
720 } |
720 } |
721 |
721 |
722 DrawDeferred(); |
722 DrawDeferred(); |
723 //Window().Invalidate( iAlbumArtRect ); |
723 //Window().Invalidate( iAlbumArtRect ); |
724 //Window().Invalidate( iSliderPaneRect ); |
724 //Window().Invalidate( iSliderPaneRect ); |
725 } |
725 } |
726 |
726 |
727 // --------------------------------------------------------------------------- |
727 // --------------------------------------------------------------------------- |
1018 |
1018 |
1019 if ( iDisplayAlbumArt && aRect.Intersects( iAlbumArtRect ) ) |
1019 if ( iDisplayAlbumArt && aRect.Intersects( iAlbumArtRect ) ) |
1020 { |
1020 { |
1021 if ( iTrackAlbumArt ) |
1021 if ( iTrackAlbumArt ) |
1022 { |
1022 { |
1023 // Calculating the CenterPoint for Drawing the albumart image |
|
1024 TSize bmpSizeInPixels = iTrackAlbumArt->SizeInPixels(); |
|
1025 TInt xPos = ( iAlbumArtRect.Width() - bmpSizeInPixels.iWidth ) |
|
1026 / 2; |
|
1027 TInt yPos = |
|
1028 ( iAlbumArtRect.Height() - bmpSizeInPixels.iHeight ) |
|
1029 / 2; |
|
1030 TPoint Centerpos = TPoint(xPos, yPos ); |
|
1031 // bitmap top left corner position |
|
1032 Centerpos += iAlbumArtRect.iTl; |
|
1033 |
|
1034 // Draw album art and frame |
1023 // Draw album art and frame |
1035 gc.BitBlt( Centerpos, iTrackAlbumArt); |
1024 gc.DrawBitmap( iAlbumArtRect, iTrackAlbumArt, iTrackAlbumArt->SizeInPixels() ); |
|
1025 |
1036 TRgb color = KRgbBlack; |
1026 TRgb color = KRgbBlack; |
1037 AknsUtils::GetCachedColor( skin, color, KAknsIIDQsnTextColors, |
1027 AknsUtils::GetCachedColor( skin, color, KAknsIIDQsnTextColors, |
1038 EAknsCIQsnTextColorsCG50 ); |
1028 EAknsCIQsnTextColorsCG50 ); |
1039 TRect imageRect( Centerpos, iTrackAlbumArt->SizeInPixels() ); |
|
1040 gc.SetPenStyle( CGraphicsContext::ESolidPen ); |
1029 gc.SetPenStyle( CGraphicsContext::ESolidPen ); |
1041 gc.SetBrushStyle( CGraphicsContext::ENullBrush ); |
1030 gc.SetBrushStyle( CGraphicsContext::ENullBrush ); |
1042 gc.SetPenColor( color ); |
1031 gc.SetPenColor( color ); |
1043 gc.DrawRect( imageRect ); |
1032 gc.DrawRect( iAlbumArtRect ); |
1044 } |
1033 } |
1045 else |
1034 else |
1046 { |
1035 { |
1047 DrawIndicator( gc, aRect, iAlbumArtRect, iDefaultAlbumArt ); |
1036 DrawIndicator( gc, aRect, iAlbumArtRect, iDefaultAlbumArt ); |
1048 } |
1037 } |
1075 } |
1064 } |
1076 |
1065 |
1077 // --------------------------------------------------------------------------- |
1066 // --------------------------------------------------------------------------- |
1078 // Update progress bar graphics and redraw. |
1067 // Update progress bar graphics and redraw. |
1079 // Refresh happens only when backlight is ON and |
1068 // Refresh happens only when backlight is ON and |
1080 // the UI is in foreground. |
1069 // the UI is in foreground. |
1081 // Note: Some display types may not need backlight. In that case |
1070 // Note: Some display types may not need backlight. In that case |
1082 // code may need to be adjusted accordingly. |
1071 // code may need to be adjusted accordingly. |
1083 // --------------------------------------------------------------------------- |
1072 // --------------------------------------------------------------------------- |
1084 // |
1073 // |
1085 EXPORT_C void CMPXCommonPlaybackViewContainer::RefreshProgressBar() |
1074 EXPORT_C void CMPXCommonPlaybackViewContainer::RefreshProgressBar() |
1250 TReal width; |
1239 TReal width; |
1251 switch( aPointerEvent.iType ) |
1240 switch( aPointerEvent.iType ) |
1252 { |
1241 { |
1253 case TPointerEvent::EButton1Down: |
1242 case TPointerEvent::EButton1Down: |
1254 { |
1243 { |
1255 if ( iSliderPaneRect.Contains(aPointerEvent.iPosition) && |
1244 if ( iSliderPaneRect.Contains(aPointerEvent.iPosition) && |
1256 ( iMode == EPlayMode || iMode == EPauseMode )) |
1245 ( iMode == EPlayMode || iMode == EPauseMode )) |
1257 { |
1246 { |
1258 // Pointer events |
1247 // Pointer events |
1259 SetGloballyCapturing( ETrue ); |
1248 SetGloballyCapturing( ETrue ); |
1260 SetPointerCapture( ETrue ); |
1249 SetPointerCapture( ETrue ); |
1267 iPlaybackSlider->Bitmap(), |
1256 iPlaybackSlider->Bitmap(), |
1268 playbackBarSize, |
1257 playbackBarSize, |
1269 EAspectRatioNotPreserved ); |
1258 EAspectRatioNotPreserved ); |
1270 } |
1259 } |
1271 if ( iAlbumArtRect.Contains(aPointerEvent.iPosition ) ) |
1260 if ( iAlbumArtRect.Contains(aPointerEvent.iPosition ) ) |
1272 { |
1261 { |
1273 MTouchFeedback* feedback = MTouchFeedback::Instance(); |
1262 MTouchFeedback* feedback = MTouchFeedback::Instance(); |
1274 if (feedback) |
1263 if (feedback) |
1275 { |
1264 { |
1276 feedback->InstantFeedback(ETouchFeedbackBasic); |
1265 feedback->InstantFeedback(ETouchFeedbackBasic); |
1277 } |
1266 } |
1278 |
1267 |
1279 if ( iCommandObserver ) |
1268 if ( iCommandObserver ) |
1280 { |
1269 { |
1281 iCommandObserver->ProcessCommandL( EMPXCmdVolumeChanged ); |
1270 iCommandObserver->ProcessCommandL( EMPXCmdVolumeChanged ); |
1282 } |
1271 } |
1283 } |
1272 } |
1435 MPX_FUNC( "CMPXCommonPlaybackViewContainer::LightStatusChanged" ); |
1424 MPX_FUNC( "CMPXCommonPlaybackViewContainer::LightStatusChanged" ); |
1436 if ( aTarget == CHWRMLight::EPrimaryDisplay ) |
1425 if ( aTarget == CHWRMLight::EPrimaryDisplay ) |
1437 { |
1426 { |
1438 MPX_DEBUG2(" LightStatusChanged: (%d)", aStatus); |
1427 MPX_DEBUG2(" LightStatusChanged: (%d)", aStatus); |
1439 if ( ( aStatus == CHWRMLight::ELightOn || aStatus == CHWRMLight::ELightOff ) && aStatus != iLightStatus ) |
1428 if ( ( aStatus == CHWRMLight::ELightOn || aStatus == CHWRMLight::ELightOff ) && aStatus != iLightStatus ) |
1440 { |
1429 { |
1441 iLightStatus = aStatus; |
1430 iLightStatus = aStatus; |
1442 } |
1431 } |
1443 } |
1432 } |
1444 } |
1433 } |
1445 |
1434 |
1617 |
1606 |
1618 // ----------------------------------------------------------------------------- |
1607 // ----------------------------------------------------------------------------- |
1619 // CMPXCommonPlaybackViewContainer::ReStoreButtons |
1608 // CMPXCommonPlaybackViewContainer::ReStoreButtons |
1620 // ----------------------------------------------------------------------------- |
1609 // ----------------------------------------------------------------------------- |
1621 // |
1610 // |
1622 void CMPXCommonPlaybackViewContainer::RestoreButtons( |
1611 void CMPXCommonPlaybackViewContainer::RestoreButtons( |
1623 TMPXPlaybackState aState ) |
1612 TMPXPlaybackState aState ) |
1624 { |
1613 { |
1625 if ( iEnableButtons ) |
1614 if ( iEnableButtons ) |
1626 { |
1615 { |
1627 iButtonManager->RestoreButtonStates( aState ); |
1616 iButtonManager->RestoreButtonStates( aState ); |