841 { |
837 { |
842 label->StartMarquee(); |
838 label->StartMarquee(); |
843 label->DrawDeferred(); |
839 label->DrawDeferred(); |
844 } |
840 } |
845 } |
841 } |
846 } |
|
847 |
|
848 // --------------------------------------------------------------------------- |
|
849 // Creates background images |
|
850 // --------------------------------------------------------------------------- |
|
851 // |
|
852 EXPORT_C void CMPXCommonPlaybackViewContainer::CreateBackgroundImagesL() |
|
853 { |
|
854 |
|
855 CWindowGc& gc( SystemGc() ); |
|
856 CGraphicsDevice* device( gc.Device() ); |
|
857 TSize size( device->SizeInPixels() ); |
|
858 TDisplayMode mode( device->DisplayMode() ); |
|
859 |
|
860 if( iOffScreenBitmap && |
|
861 size == iOffScreenBitmap->SizeInPixels() && |
|
862 mode == iOffScreenBitmap->DisplayMode() ) |
|
863 { |
|
864 // No need to update backbuffer |
|
865 return; |
|
866 } |
|
867 |
|
868 delete iOffScreenBitmap; |
|
869 iOffScreenBitmap = NULL; |
|
870 delete iOSBitmapContext; |
|
871 iOSBitmapContext = NULL; |
|
872 delete iOSBitmapDevice; |
|
873 iOSBitmapDevice = NULL; |
|
874 |
|
875 iOffScreenBitmap = new (ELeave) CFbsBitmap(); |
|
876 TInt err( iOffScreenBitmap->Create( size, mode )); |
|
877 if ( KErrNone != err ) |
|
878 { |
|
879 delete iOffScreenBitmap; |
|
880 iOffScreenBitmap = NULL; |
|
881 User::Leave( err ); |
|
882 } |
|
883 |
|
884 iOSBitmapDevice = CFbsBitmapDevice::NewL( iOffScreenBitmap ); |
|
885 err = iOSBitmapDevice->CreateContext( iOSBitmapContext ); |
|
886 if ( KErrNone != err ) |
|
887 { |
|
888 delete iOSBitmapDevice; |
|
889 iOSBitmapDevice = NULL; |
|
890 User::Leave( err ); |
|
891 } |
|
892 iRefreshBackBuffer = ETrue; |
|
893 } |
842 } |
894 |
843 |
895 // --------------------------------------------------------------------------- |
844 // --------------------------------------------------------------------------- |
896 // Creates labels. |
845 // Creates labels. |
897 // --------------------------------------------------------------------------- |
846 // --------------------------------------------------------------------------- |
987 // --------------------------------------------------------------------------- |
936 // --------------------------------------------------------------------------- |
988 // Draw an icon |
937 // Draw an icon |
989 // --------------------------------------------------------------------------- |
938 // --------------------------------------------------------------------------- |
990 // |
939 // |
991 EXPORT_C void CMPXCommonPlaybackViewContainer::DrawIndicator( |
940 EXPORT_C void CMPXCommonPlaybackViewContainer::DrawIndicator( |
992 CBitmapContext& aGc, |
941 CWindowGc& aGc , |
993 const TRect& aDirtyRect, |
942 const TRect& aDirtyRect, |
994 const TRect& aIndicatorRect, |
943 const TRect& aIndicatorRect, |
995 const CGulIcon* aIcon, |
944 const CGulIcon* aIcon, |
996 TBool aInvertMask ) const |
945 TBool aInvertMask ) const |
997 { |
946 { |
1009 // --------------------------------------------------------------------------- |
958 // --------------------------------------------------------------------------- |
1010 // Redraw part of the screen. |
959 // Redraw part of the screen. |
1011 // --------------------------------------------------------------------------- |
960 // --------------------------------------------------------------------------- |
1012 // |
961 // |
1013 EXPORT_C void CMPXCommonPlaybackViewContainer::RedrawRect( |
962 EXPORT_C void CMPXCommonPlaybackViewContainer::RedrawRect( |
1014 const TRect& aRect, |
963 const TRect& aRect) const |
1015 CBitmapContext& aGc) const |
964 { |
1016 { |
965 CWindowGc& gc = SystemGc(); |
1017 MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
966 MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
1018 AknsDrawUtils::DrawBackground( |
967 |
1019 skin, |
968 AknsDrawUtils::Background( skin, iBackground, |
1020 iBackground, |
969 this, gc, aRect ); |
1021 this, |
|
1022 aGc, |
|
1023 aRect.iTl, |
|
1024 aRect, |
|
1025 KAknsDrawParamDefault ); |
|
1026 |
|
1027 |
970 |
1028 TBool embedded = iEikonEnv->StartedAsServerApp(); |
971 TBool embedded = iEikonEnv->StartedAsServerApp(); |
1029 |
972 |
1030 if ( iPrerollCompleted ) |
973 if ( iPrerollCompleted ) |
1031 { |
974 { |
1032 if ( iRepeatAllMode && !embedded ) |
975 if ( iRepeatAllMode && !embedded ) |
1033 { |
976 { |
1034 DrawIndicator( aGc, aRect, iRepeatIconRect, iRepeatAllIcon ); |
977 DrawIndicator( gc, aRect, iRepeatIconRect, iRepeatAllIcon ); |
1035 } |
978 } |
1036 |
979 |
1037 if ( iRepeatOneMode && !embedded ) |
980 if ( iRepeatOneMode && !embedded ) |
1038 { |
981 { |
1039 DrawIndicator(aGc, aRect, iRepeatIconRect, iRepeatOneIcon); |
982 DrawIndicator(gc, aRect, iRepeatIconRect, iRepeatOneIcon); |
1040 } |
983 } |
1041 |
984 |
1042 if ( iRandomMode && !embedded ) |
985 if ( iRandomMode && !embedded ) |
1043 { |
986 { |
1044 DrawIndicator(aGc, aRect, iRandomIconRect, iRandomIcon); |
987 DrawIndicator(gc, aRect, iRandomIconRect, iRandomIcon); |
1045 } |
988 } |
1046 |
989 |
1047 #ifdef RD_RA_SUPPORT_FOR_MUSIC_PLAYER |
990 #ifdef RD_RA_SUPPORT_FOR_MUSIC_PLAYER |
1048 if ( iRealAudioMode ) |
991 if ( iRealAudioMode ) |
1049 { |
992 { |
1050 DrawIndicator( aGc, aRect, iRealIconRect, iRealIcon ); |
993 DrawIndicator( gc, aRect, iRealIconRect, iRealIcon ); |
1051 } |
994 } |
1052 #endif |
995 #endif |
1053 |
996 |
1054 DrawIndicator( aGc, aRect, iSliderBackgroundRect, iSliderBackground ); |
997 DrawIndicator( gc, aRect, iSliderBackgroundRect, iSliderBackground ); |
1055 if ( iMode == EPlayMode || iMode == EPauseMode ) |
998 if ( iMode == EPlayMode || iMode == EPauseMode ) |
1056 { |
999 { |
1057 |
1000 |
1058 DrawIndicator( aGc, aRect, TRect(iDownloadSliderRect.iTl, |
1001 DrawIndicator( gc, aRect, TRect(iDownloadSliderRect.iTl, |
1059 iDownloadSlider->Bitmap()->SizeInPixels()), |
1002 iDownloadSlider->Bitmap()->SizeInPixels()), |
1060 iDownloadSlider ); |
1003 iDownloadSlider ); |
1061 DrawIndicator(aGc, aRect, TRect(iPlaybackSliderRect.iTl, |
1004 DrawIndicator(gc, aRect, TRect(iPlaybackSliderRect.iTl, |
1062 iPlaybackSlider->Bitmap()->SizeInPixels() ), |
1005 iPlaybackSlider->Bitmap()->SizeInPixels() ), |
1063 iPlaybackSlider ); |
1006 iPlaybackSlider ); |
1064 } |
1007 } |
1065 |
1008 |
1066 if ( iDisplayAlbumArt && aRect.Intersects( iAlbumArtRect ) ) |
1009 if ( iDisplayAlbumArt && aRect.Intersects( iAlbumArtRect ) ) |
1077 TPoint Centerpos = TPoint(xPos, yPos ); |
1020 TPoint Centerpos = TPoint(xPos, yPos ); |
1078 // bitmap top left corner position |
1021 // bitmap top left corner position |
1079 Centerpos += iAlbumArtRect.iTl; |
1022 Centerpos += iAlbumArtRect.iTl; |
1080 |
1023 |
1081 // Draw album art and frame |
1024 // Draw album art and frame |
1082 aGc.BitBlt( Centerpos, iTrackAlbumArt); |
1025 gc.BitBlt( Centerpos, iTrackAlbumArt); |
1083 TRgb color = KRgbBlack; |
1026 TRgb color = KRgbBlack; |
1084 AknsUtils::GetCachedColor( skin, color, KAknsIIDQsnTextColors, |
1027 AknsUtils::GetCachedColor( skin, color, KAknsIIDQsnTextColors, |
1085 EAknsCIQsnTextColorsCG50 ); |
1028 EAknsCIQsnTextColorsCG50 ); |
1086 TRect imageRect( Centerpos, iTrackAlbumArt->SizeInPixels() ); |
1029 TRect imageRect( Centerpos, iTrackAlbumArt->SizeInPixels() ); |
1087 aGc.SetPenStyle( CGraphicsContext::ESolidPen ); |
1030 gc.SetPenStyle( CGraphicsContext::ESolidPen ); |
1088 aGc.SetBrushStyle( CGraphicsContext::ENullBrush ); |
1031 gc.SetBrushStyle( CGraphicsContext::ENullBrush ); |
1089 aGc.SetPenColor( color ); |
1032 gc.SetPenColor( color ); |
1090 aGc.DrawRect( imageRect ); |
1033 gc.DrawRect( imageRect ); |
1091 } |
1034 } |
1092 else |
1035 else |
1093 { |
1036 { |
1094 DrawIndicator( aGc, aRect, iAlbumArtRect, iDefaultAlbumArt ); |
1037 DrawIndicator( gc, aRect, iAlbumArtRect, iDefaultAlbumArt ); |
1095 } |
1038 } |
1096 } |
1039 } |
1097 } |
1040 } |
1098 } |
1041 } |
1099 |
1042 |
1161 EXPORT_C void CMPXCommonPlaybackViewContainer::UpdateBackgroundSkinControlContext( |
1104 EXPORT_C void CMPXCommonPlaybackViewContainer::UpdateBackgroundSkinControlContext( |
1162 const TRect& aRect ) |
1105 const TRect& aRect ) |
1163 { |
1106 { |
1164 CAknsBasicBackgroundControlContext* background = |
1107 CAknsBasicBackgroundControlContext* background = |
1165 static_cast<CAknsBasicBackgroundControlContext*>( iBackground ); |
1108 static_cast<CAknsBasicBackgroundControlContext*>( iBackground ); |
1166 |
|
1167 if ( Layout_Meta_Data::IsLandscapeOrientation() ) |
1109 if ( Layout_Meta_Data::IsLandscapeOrientation() ) |
1168 { |
1110 { |
1169 TAknWindowLineLayout screenLayout = |
1111 TAknWindowLineLayout screenLayout = |
1170 AknLayout::screen(); |
1112 AknLayout::screen(); |
1171 TRect screenRect = screenLayout.Rect(); |
1113 TRect screenRect = screenLayout.Rect(); |
1172 background->SetBitmap( KAknsIIDQsnBgAreaMainMp ); |
1114 background->SetBitmap( KAknsIIDQsnBgAreaMain ); |
1173 background->SetRect( screenRect ); |
1115 background->SetRect( screenRect ); |
|
1116 |
1174 } |
1117 } |
1175 else |
1118 else |
1176 { |
1119 { |
1177 background->SetBitmap( KAknsIIDQsnBgAreaMainMp ); |
1120 background->SetBitmap( KAknsIIDQsnBgAreaMain ); |
1178 background->SetRect( aRect ); |
1121 background->SetRect( aRect ); |
1179 } |
1122 } |
1180 iRefreshBackBuffer = ETrue; |
1123 |
1181 } |
1124 } |
1182 |
1125 |
1183 // --------------------------------------------------------------------------- |
1126 // --------------------------------------------------------------------------- |
1184 // Set FMTX mode. |
1127 // Set FMTX mode. |
1185 // FMTX label shouldn't appear in some playback views |
1128 // FMTX label shouldn't appear in some playback views |
1252 // Draws the control. |
1195 // Draws the control. |
1253 // --------------------------------------------------------------------------- |
1196 // --------------------------------------------------------------------------- |
1254 // |
1197 // |
1255 EXPORT_C void CMPXCommonPlaybackViewContainer::Draw( const TRect& aRect ) const |
1198 EXPORT_C void CMPXCommonPlaybackViewContainer::Draw( const TRect& aRect ) const |
1256 { |
1199 { |
1257 if( iActiveView || iRefreshBackBuffer ) |
1200 RedrawRect(aRect); |
1258 { |
|
1259 if ( iOSBitmapContext ) |
|
1260 { |
|
1261 RedrawRect( aRect, *iOSBitmapContext ); |
|
1262 iRefreshBackBuffer = EFalse; |
|
1263 } |
|
1264 } |
|
1265 |
|
1266 // Draw off-screen bitmap to display |
|
1267 if ( iOffScreenBitmap ) |
|
1268 { |
|
1269 CWindowGc& gc = SystemGc(); |
|
1270 gc.BitBlt( TPoint(),iOffScreenBitmap ); |
|
1271 } |
|
1272 } |
1201 } |
1273 |
1202 |
1274 // ----------------------------------------------------------------------------- |
1203 // ----------------------------------------------------------------------------- |
1275 // CMPXCommonPlaybackViewContainer::HandleButtonCommandL |
1204 // CMPXCommonPlaybackViewContainer::HandleButtonCommandL |
1276 // ----------------------------------------------------------------------------- |
1205 // ----------------------------------------------------------------------------- |