63 const TUint KPlay_dimmed = 0x080; //000010000000 |
63 const TUint KPlay_dimmed = 0x080; //000010000000 |
64 const TUint KPlay_last_played = 0x100; //000100000000 |
64 const TUint KPlay_last_played = 0x100; //000100000000 |
65 } |
65 } |
66 |
66 |
67 _LIT( KEmpty, "" ); |
67 _LIT( KEmpty, "" ); |
68 _LIT( KNowPlaying, "LOC:NOW PLAYING" ); |
|
69 _LIT( KLastPlayed, "LOC:LAST PLAYED" ); |
|
70 |
68 |
71 |
69 |
72 _LIT( KMIF, "z:\\resource\\apps\\musichomescreenicons.mif"); |
70 _LIT( KMIF, "z:\\resource\\apps\\musichomescreenicons.mif"); |
73 |
71 |
74 _LIT( KResourceFile, "z:musichomescreen.rsc"); |
72 _LIT( KResourceFile, "z:musichomescreen.rsc"); |
78 _LIT8( KPBCommand, "command" ); |
76 _LIT8( KPBCommand, "command" ); |
79 |
77 |
80 //for music player action handler - message to music player |
78 //for music player action handler - message to music player |
81 _LIT( KactionMessageToMusicPlayer, "MessageToMusicPlayer" ); |
79 _LIT( KactionMessageToMusicPlayer, "MessageToMusicPlayer" ); |
82 _LIT( KGoToNowPlaying, "GoToNowPlaying" ); |
80 _LIT( KGoToNowPlaying, "GoToNowPlaying" ); |
83 _LIT( KGoToLastPlayed, "GoToLastPlayed" ); |
|
84 _LIT( KGoToLastPlayedMinimized, "GoToLastPlayedMinimized" ); |
81 _LIT( KGoToLastPlayedMinimized, "GoToLastPlayedMinimized" ); |
85 _LIT( KGoToAlbumView, "GoToAlbumView" ); |
82 _LIT( KGoToAlbumView, "GoToAlbumView" ); |
86 |
83 |
87 _LIT8( KMessage, "message" ); |
84 _LIT8( KMessage, "message" ); |
88 _LIT8( KAdditionalData, "additional_data" ); |
85 _LIT8( KAdditionalData, "additional_data" ); |
305 // --------------------------------------------------------------------------- |
302 // --------------------------------------------------------------------------- |
306 // |
303 // |
307 // --------------------------------------------------------------------------- |
304 // --------------------------------------------------------------------------- |
308 // |
305 // |
309 void CMCPMusicPlayer::InstallGoToLastPlayedL( |
306 void CMCPMusicPlayer::InstallGoToLastPlayedL( |
310 TMCPTriggerDestination aDestination, TBool aMinimized ) |
307 TMCPTriggerDestination aDestination ) |
311 { |
308 { |
312 MPX_DEBUG1("CMCPMusicPlayer::InstallGoToLastPlayedL <---"); |
309 MPX_DEBUG1("CMCPMusicPlayer::InstallGoToLastPlayedL <---"); |
313 CLiwDefaultMap* mapTrigger = CLiwDefaultMap::NewLC(); |
310 CLiwDefaultMap* mapTrigger = CLiwDefaultMap::NewLC(); |
314 CLiwDefaultMap* mapData = CLiwDefaultMap::NewLC(); |
311 CLiwDefaultMap* mapData = CLiwDefaultMap::NewLC(); |
315 |
312 |
316 mapTrigger->InsertL( KPluginUid, TLiwVariant( TUid::Uid( 0x10207C16 ) ) ); |
313 mapTrigger->InsertL( KPluginUid, TLiwVariant( TUid::Uid( 0x10207C16 ) ) ); |
317 mapData->InsertL( KType, TLiwVariant( KactionMessageToMusicPlayer ) ); |
314 mapData->InsertL( KType, TLiwVariant( KactionMessageToMusicPlayer ) ); |
318 if (aMinimized) |
315 mapData->InsertL( KMessage, TLiwVariant( KGoToLastPlayedMinimized ) ); |
319 { |
|
320 mapData->InsertL( KMessage, TLiwVariant( KGoToLastPlayedMinimized ) ); |
|
321 } |
|
322 else |
|
323 { |
|
324 mapData->InsertL( KMessage, TLiwVariant( KGoToLastPlayed ) ); |
|
325 } |
|
326 mapTrigger->InsertL( KData , TLiwVariant( mapData ) ); |
316 mapTrigger->InsertL( KData , TLiwVariant( mapData ) ); |
327 |
317 |
328 iMHObserver->PublishActionL( this, aDestination, mapTrigger ); |
318 iMHObserver->PublishActionL( this, aDestination, mapTrigger ); |
329 |
319 |
330 CleanupStack::PopAndDestroy( mapData ); |
320 CleanupStack::PopAndDestroy( mapData ); |
473 iconId.Set( EAknsMajorGeneric, |
463 iconId.Set( EAknsMajorGeneric, |
474 EAknsMinorGenericQgnPropImageTbPlay2 ); |
464 EAknsMinorGenericQgnPropImageTbPlay2 ); |
475 iMHObserver->PublishImageL( this, EMusicWidgetToolbarB2, iconId, |
465 iMHObserver->PublishImageL( this, EMusicWidgetToolbarB2, iconId, |
476 KMIF, EMbmMusichomescreeniconsQgn_prop_image_tb_play2, |
466 KMIF, EMbmMusichomescreeniconsQgn_prop_image_tb_play2, |
477 EMbmMusichomescreeniconsQgn_prop_image_tb_play2_mask); |
467 EMbmMusichomescreeniconsQgn_prop_image_tb_play2_mask); |
478 InstallGoToLastPlayedL(EMusicWidgetTB2Trigger, ETrue); |
468 InstallGoToLastPlayedL(EMusicWidgetTB2Trigger); |
479 iToolBarState |= TBK::KPlay_last_played; |
469 iToolBarState |= TBK::KPlay_last_played; |
480 MPX_DEBUG1("CMCPMusicPlayer::UpdateToolBarL KPlay_last_played"); |
470 MPX_DEBUG1("CMCPMusicPlayer::UpdateToolBarL KPlay_last_played"); |
481 } |
471 } |
482 |
472 |
483 if ( TBK::KSkeep_L_dimmed & updateState ) |
473 if ( TBK::KSkeep_L_dimmed & updateState ) |
568 iMHObserver->PublishImageL(this,EMusicWidgetToolbarB3,KEmpty); |
558 iMHObserver->PublishImageL(this,EMusicWidgetToolbarB3,KEmpty); |
569 InstallEmptyActionL(EMusicWidgetTB1Trigger); |
559 InstallEmptyActionL(EMusicWidgetTB1Trigger); |
570 InstallEmptyActionL(EMusicWidgetTB2Trigger); |
560 InstallEmptyActionL(EMusicWidgetTB2Trigger); |
571 InstallEmptyActionL(EMusicWidgetTB3Trigger); |
561 InstallEmptyActionL(EMusicWidgetTB3Trigger); |
572 InstallGoToAlbumL(EMusicWidgetTrigger2); |
562 InstallGoToAlbumL(EMusicWidgetTrigger2); |
573 |
563 |
574 |
|
575 //Reset the music menu info |
|
576 InstallEmptyActionL(EMusicMenuMusicInfoTrigger); |
|
577 iMHObserver->PublishTextL( this, EMusicMenuMusicInfoLine1, |
|
578 KLastPlayed ); |
|
579 iMHObserver->PublishTextL( this, EMusicMenuMusicInfoLine2, |
|
580 KEmpty ); |
|
581 iMHObserver->PublishImageL( this, EMusicMenuMusicInfoImage1, |
|
582 KAknsIIDQgnIndiMupDefaultAlbum, |
|
583 KMIF, |
|
584 EMbmMusichomescreeniconsQgn_indi_mup_default_album, |
|
585 EMbmMusichomescreeniconsQgn_indi_mup_default_album_mask); |
|
586 MPX_DEBUG1("CMCPMusicPlayer::ResetL --->"); |
564 MPX_DEBUG1("CMCPMusicPlayer::ResetL --->"); |
587 } |
565 } |
588 |
566 |
589 // ---------------------------------------------------------------------------- |
567 // ---------------------------------------------------------------------------- |
590 // Get a heap descriptor from the resource file |
568 // Get a heap descriptor from the resource file |
610 { |
588 { |
611 MPX_DEBUG1("CMCPMusicPlayer::ActivateL <---"); |
589 MPX_DEBUG1("CMCPMusicPlayer::ActivateL <---"); |
612 if ( iPNSMonitor ) |
590 if ( iPNSMonitor ) |
613 { |
591 { |
614 delete iPNSMonitor; |
592 delete iPNSMonitor; |
615 iFileMonitor = NULL; |
593 iPNSMonitor = NULL; |
616 MPX_DEBUG1("CMCPMusicPlayer::ActivateL pns monitor deleted"); |
594 MPX_DEBUG1("CMCPMusicPlayer::ActivateL pns monitor deleted"); |
617 } |
595 } |
618 iPNSMonitor = CPNSMonitor::NewL(*this); |
596 iPNSMonitor = CPNSMonitor::NewL(*this); |
619 MPX_DEBUG1("CMCPMusicPlayer::ActivateL pns monitor created"); |
597 MPX_DEBUG1("CMCPMusicPlayer::ActivateL pns monitor created"); |
620 iPNSMonitor->Start(); |
598 iPNSMonitor->Start(); |
655 iActive = ETrue; |
633 iActive = ETrue; |
656 MPX_DEBUG1("CMCPMusicPlayer::ActivateL we are active now"); |
634 MPX_DEBUG1("CMCPMusicPlayer::ActivateL we are active now"); |
657 |
635 |
658 iMHObserver->PublishTextL( this, EMusicWidgetDefaultText, KEmpty ); |
636 iMHObserver->PublishTextL( this, EMusicWidgetDefaultText, KEmpty ); |
659 InstallGoToNowPlayingL(EMusicWidgetTrigger1); |
637 InstallGoToNowPlayingL(EMusicWidgetTrigger1); |
660 InstallGoToLastPlayedL(EMusicMenuMusicInfoTrigger, EFalse); |
|
661 iMHObserver->PublishTextL(this, EMusicMenuMusicInfoLine1, |
|
662 KNowPlaying); |
|
663 DoUpdateTrackInfoL(iEngine->TitleL(), iEngine->Artist()); |
638 DoUpdateTrackInfoL(iEngine->TitleL(), iEngine->Artist()); |
664 iToolBarState = 0; |
639 iToolBarState = 0; |
665 DoUpdatePlayerStateL( iEngine->PlayerState() ); |
640 DoUpdatePlayerStateL( iEngine->PlayerState() ); |
666 DoUpdateAlbumArtL(iArtCached ? iCachedArtBitmap : iArtBitmap); |
641 DoUpdateAlbumArtL(iArtCached ? iCachedArtBitmap : iArtBitmap); |
667 } |
642 } |
733 { |
708 { |
734 nowPlayingForMMPtr.Append(KSeparatorhyphen); |
709 nowPlayingForMMPtr.Append(KSeparatorhyphen); |
735 nowPlayingForMMPtr.Append(aArtist); |
710 nowPlayingForMMPtr.Append(aArtist); |
736 } |
711 } |
737 iMHObserver->PublishTextL( this,EMusicWidgetText1, *nowPlayingForMM ); |
712 iMHObserver->PublishTextL( this,EMusicWidgetText1, *nowPlayingForMM ); |
738 iMHObserver->PublishTextL(this, EMusicMenuMusicInfoLine2, |
|
739 *nowPlayingForMM); |
|
740 CleanupStack::PopAndDestroy( nowPlayingForMM ); |
713 CleanupStack::PopAndDestroy( nowPlayingForMM ); |
741 MPX_DEBUG1("CMCPMusicPlayer::DoUpdatePlayerStateL deliting file monitor"); |
714 MPX_DEBUG1("CMCPMusicPlayer::DoUpdatePlayerStateL deliting file monitor"); |
742 if (iFileMonitor) |
715 if (iFileMonitor) |
743 { |
716 { |
744 delete iFileMonitor; |
717 delete iFileMonitor; |
873 } |
846 } |
874 else |
847 else |
875 { |
848 { |
876 iMHObserver->PublishImageL(this,EMusicWidgetImage1,handle); |
849 iMHObserver->PublishImageL(this,EMusicWidgetImage1,handle); |
877 } |
850 } |
878 iMHObserver->PublishImageL( this, EMusicMenuMusicInfoImage1, |
|
879 handle ); |
|
880 } |
851 } |
881 else |
852 else |
882 { |
853 { |
883 iMHObserver->PublishImageL( this, EMusicMenuMusicInfoImage1, |
|
884 KAknsIIDQgnIndiMupDefaultAlbum, |
|
885 KMIF, EMbmMusichomescreeniconsQgn_indi_mup_default_album, |
|
886 EMbmMusichomescreeniconsQgn_indi_mup_default_album_mask); |
|
887 iMHObserver->PublishImageL( this, EMusicWidgetImage1, |
854 iMHObserver->PublishImageL( this, EMusicWidgetImage1, |
888 KAknsIIDQgnIndiMupDefaultAlbum, |
855 KAknsIIDQgnIndiMupDefaultAlbum, |
889 KMIF, EMbmMusichomescreeniconsQgn_indi_mup_default_album, |
856 KMIF, EMbmMusichomescreeniconsQgn_indi_mup_default_album, |
890 EMbmMusichomescreeniconsQgn_indi_mup_default_album_mask); |
857 EMbmMusichomescreeniconsQgn_indi_mup_default_album_mask); |
891 } |
858 } |
956 handle); |
923 handle); |
957 } |
924 } |
958 } |
925 } |
959 else |
926 else |
960 { |
927 { |
961 iMHObserver->PublishImageL( this, EMusicMenuMusicInfoImage1, |
|
962 KAknsIIDQgnIndiMupDefaultAlbum, |
|
963 KMIF, EMbmMusichomescreeniconsQgn_indi_mup_default_album, |
|
964 EMbmMusichomescreeniconsQgn_indi_mup_default_album_mask); |
|
965 iMHObserver->PublishImageL( this, EMusicWidgetImage1, |
928 iMHObserver->PublishImageL( this, EMusicWidgetImage1, |
966 KAknsIIDQgnIndiMupDefaultAlbum, |
929 KAknsIIDQgnIndiMupDefaultAlbum, |
967 KMIF, EMbmMusichomescreeniconsQgn_indi_mup_default_album, |
930 KMIF, EMbmMusichomescreeniconsQgn_indi_mup_default_album, |
968 EMbmMusichomescreeniconsQgn_indi_mup_default_album_mask); |
931 EMbmMusichomescreeniconsQgn_indi_mup_default_album_mask); |
969 } |
932 } |
1147 TBK::KPlay_last_played | |
1115 TBK::KPlay_last_played | |
1148 TBK::KSkeep_R_dimmed ); |
1116 TBK::KSkeep_R_dimmed ); |
1149 if (IsOKToPublishData() ) |
1117 if (IsOKToPublishData() ) |
1150 { |
1118 { |
1151 iMHObserver->PublishTextL( this, EMusicWidgetDefaultText, KEmpty ); |
1119 iMHObserver->PublishTextL( this, EMusicWidgetDefaultText, KEmpty ); |
1152 InstallGoToLastPlayedL(EMusicMenuMusicInfoTrigger, EFalse); |
|
1153 iMHObserver->PublishTextL(this, EMusicMenuMusicInfoLine1, |
|
1154 KLastPlayed); |
|
1155 DoUpdateTrackInfoL(iEngine->TitleL(), iEngine->Artist()); |
1120 DoUpdateTrackInfoL(iEngine->TitleL(), iEngine->Artist()); |
1156 DoUpdateAlbumArtL(iArtCached ? iCachedArtBitmap : iArtBitmap); |
1121 DoUpdateAlbumArtL(iArtCached ? iCachedArtBitmap : iArtBitmap); |
1157 } |
1122 } |
1158 if ( iAppMonitor ) |
1123 if ( iAppMonitor ) |
1159 { |
1124 { |
1220 MPX_DEBUG2("CMCPMusicPlayer::DoHandleGeneralMessageL(), iBlockingOperationOngoing changed to: %d", |
1185 MPX_DEBUG2("CMCPMusicPlayer::DoHandleGeneralMessageL(), iBlockingOperationOngoing changed to: %d", |
1221 iBlockingOperationOngoing ); |
1186 iBlockingOperationOngoing ); |
1222 UpdateToolBarL( TBK::KSkeep_L_dimmed | |
1187 UpdateToolBarL( TBK::KSkeep_L_dimmed | |
1223 TBK::KPlay_dimmed | |
1188 TBK::KPlay_dimmed | |
1224 TBK::KSkeep_R_dimmed ); |
1189 TBK::KSkeep_R_dimmed ); |
1225 if ( IsOKToPublishData() ) |
|
1226 { |
|
1227 InstallGoToAlbumL(EMusicMenuMusicInfoTrigger); |
|
1228 } |
|
1229 } |
1190 } |
1230 else if ( event == TMPXCollectionMessage::EBroadcastEvent |
1191 else if ( event == TMPXCollectionMessage::EBroadcastEvent |
1231 && ( type == EMcMsgUSBMassStorageEnd || |
1192 && ( type == EMcMsgUSBMassStorageEnd || |
1232 type == EMcMsgUSBMTPEnd || |
1193 type == EMcMsgUSBMTPEnd || |
1233 type == EMcMsgRefreshEnd )) |
1194 type == EMcMsgRefreshEnd )) |
1238 DoUpdatePlayerStateL( iEngine->PlayerState() ); |
1199 DoUpdatePlayerStateL( iEngine->PlayerState() ); |
1239 if ( IsOKToPublishData() ) |
1200 if ( IsOKToPublishData() ) |
1240 { |
1201 { |
1241 iMHObserver->PublishTextL( this, EMusicWidgetDefaultText, |
1202 iMHObserver->PublishTextL( this, EMusicWidgetDefaultText, |
1242 KEmpty ); |
1203 KEmpty ); |
1243 InstallGoToLastPlayedL( EMusicMenuMusicInfoTrigger, ETrue ); |
|
1244 iMHObserver->PublishTextL( this, EMusicMenuMusicInfoLine1, |
|
1245 KLastPlayed ); |
|
1246 DoUpdateTrackInfoL( iEngine->TitleL(), iEngine->Artist() ); |
1204 DoUpdateTrackInfoL( iEngine->TitleL(), iEngine->Artist() ); |
1247 DoUpdateAlbumArtL( iArtCached ? iCachedArtBitmap : iArtBitmap ); |
1205 DoUpdateAlbumArtL( iArtCached ? iCachedArtBitmap : iArtBitmap ); |
1248 } |
1206 } |
1249 } |
1207 } |
1250 MPX_DEBUG3("<---CMCPMusicPlayer::DoHandleGeneralMessageL(), event = %d, type = %d", event, type); |
1208 MPX_DEBUG3("<---CMCPMusicPlayer::DoHandleGeneralMessageL(), event = %d, type = %d", event, type); |