78 #include <mpxmessagegeneraldefs.h> |
78 #include <mpxmessagegeneraldefs.h> |
79 #include <mpxcommandgeneraldefs.h> |
79 #include <mpxcommandgeneraldefs.h> |
80 #include <mpxcollectioncommanddefs.h> |
80 #include <mpxcollectioncommanddefs.h> |
81 #include <mpxviewpluginmanager.h> |
81 #include <mpxviewpluginmanager.h> |
82 #include <mpxviewplugin.h> |
82 #include <mpxviewplugin.h> |
|
83 #ifdef BACKSTEPPING_INCLUDED |
83 #include <mpxbacksteppingutility.h> |
84 #include <mpxbacksteppingutility.h> |
|
85 #endif // BACKSTEPPING_INCLUDED |
84 #include <mpxcollectionopenutility.h> |
86 #include <mpxcollectionopenutility.h> |
85 |
87 |
86 #include <mpxfindinmusicshop.h> |
88 #include <mpxfindinmusicshop.h> |
87 #include <mpxfindinmusicshopcommon.h> // KFindInMShopKeyInValid |
89 #include <mpxfindinmusicshopcommon.h> // KFindInMShopKeyInValid |
88 #include <MusicWapCenRepKeys.h> |
|
89 |
90 |
90 // cenrep key need to be checked whether USB cable is connected in MTP/Combined Mode |
91 // cenrep key need to be checked whether USB cable is connected in MTP/Combined Mode |
91 #include <UsbWatcherInternalPSKeys.h> |
92 #include <UsbWatcherInternalPSKeys.h> |
92 #include <usbpersonalityids.h> |
93 #include <usbpersonalityids.h> |
93 #include <mpxappui.hrh> |
94 #include <mpxappui.hrh> |
160 |
161 |
161 // Music collection browse type |
162 // Music collection browse type |
162 const TInt KMPXCollectionArtistAlbum( 3 ); |
163 const TInt KMPXCollectionArtistAlbum( 3 ); |
163 const TInt KMPXCollectionGenre( 5 ); |
164 const TInt KMPXCollectionGenre( 5 ); |
164 |
165 |
|
166 const TInt KMPXTimeoutTimer = 1000000; // 1 second |
165 |
167 |
166 // ======== MEMBER FUNCTIONS ======== |
168 // ======== MEMBER FUNCTIONS ======== |
167 |
169 |
168 // --------------------------------------------------------------------------- |
170 // --------------------------------------------------------------------------- |
169 // Two-phased constructor. |
171 // Two-phased constructor. |
267 if ( iMediaRecognizer ) |
269 if ( iMediaRecognizer ) |
268 { |
270 { |
269 delete iMediaRecognizer; |
271 delete iMediaRecognizer; |
270 } |
272 } |
271 |
273 |
|
274 if ( iTimer ) |
|
275 { |
|
276 if ( iTimer->IsActive() ) |
|
277 iTimer->Cancel(); |
|
278 |
|
279 delete iTimer; |
|
280 iTimer = NULL; |
|
281 } |
|
282 #ifdef BACKSTEPPING_INCLUDED |
272 if( iBackSteppingUtility ) |
283 if( iBackSteppingUtility ) |
273 { |
284 { |
274 iBackSteppingUtility->Close(); |
285 iBackSteppingUtility->Close(); |
275 } |
286 } |
|
287 #endif // BACKSTEPPING_INCLUDED |
276 |
288 |
277 if ( iResourceOffset ) |
289 if ( iResourceOffset ) |
278 { |
290 { |
279 iEikonEnv->DeleteResourceFile( iResourceOffset ); |
291 iEikonEnv->DeleteResourceFile( iResourceOffset ); |
280 } |
292 } |
387 iPlaybackUtility->AddObserverL( *this ); |
399 iPlaybackUtility->AddObserverL( *this ); |
388 iViewUtility = MMPXViewUtility::UtilityL(); |
400 iViewUtility = MMPXViewUtility::UtilityL(); |
389 iViewUtility->AddObserverL( this ); |
401 iViewUtility->AddObserverL( this ); |
390 iBottomIndex = new (ELeave) CArrayFixFlat<TInt>( 1 ); |
402 iBottomIndex = new (ELeave) CArrayFixFlat<TInt>( 1 ); |
391 |
403 |
|
404 iTimer = CPeriodic::NewL( CActive::EPriorityIdle ); |
|
405 |
392 iCommonUiHelper = CMPXCommonUiHelper::NewL( iCollectionUtility ); |
406 iCommonUiHelper = CMPXCommonUiHelper::NewL( iCollectionUtility ); |
393 iCollectionUiHelper = CMPXCollectionHelperFactory::NewCollectionUiHelperL(); |
407 iCollectionUiHelper = CMPXCollectionHelperFactory::NewCollectionUiHelperL(); |
394 |
408 |
395 // Monitor for view activation |
409 // Monitor for view activation |
396 AppUi()->AddViewActivationObserverL( this ); |
410 AppUi()->AddViewActivationObserverL( this ); |
507 } |
521 } |
508 |
522 |
509 iCachedSelectionIndex = new ( ELeave )CArrayFixFlat<TInt>( KMPXArrayGranularity ); |
523 iCachedSelectionIndex = new ( ELeave )CArrayFixFlat<TInt>( KMPXArrayGranularity ); |
510 iIncrementalOpenUtil = CMPXCollectionOpenUtility::NewL( this ); |
524 iIncrementalOpenUtil = CMPXCollectionOpenUtility::NewL( this ); |
511 |
525 |
|
526 #ifdef BACKSTEPPING_INCLUDED |
512 // Initialize the Back Stepping Service Utility with the MPX Music Player |
527 // Initialize the Back Stepping Service Utility with the MPX Music Player |
513 iBackSteppingUtility = MMPXBackSteppingUtility::UtilityL(); |
528 iBackSteppingUtility = MMPXBackSteppingUtility::UtilityL(); |
514 iBackSteppingUtility->InitializeL( |
529 iBackSteppingUtility->InitializeL( |
515 TUid::Uid( KMusicPlayerAppUidConstant ) ); |
530 TUid::Uid( KMusicPlayerAppUidConstant ) ); |
516 iActivateBackStepping = EFalse; |
531 iActivateBackStepping = EFalse; |
|
532 #endif //BACKSTEPPING_INCLUDED |
517 |
533 |
518 iIsAddingToPlaylist = EFalse; |
534 iIsAddingToPlaylist = EFalse; |
519 |
535 |
520 // Get music store information from cenrep |
536 // Get music store information from cenrep |
521 // |
537 // |
593 |
609 |
594 TInt usbStatus; |
610 TInt usbStatus; |
595 RProperty::Get(KPSUidUsbWatcher, KUsbWatcherSelectedPersonality, usbStatus); |
611 RProperty::Get(KPSUidUsbWatcher, KUsbWatcherSelectedPersonality, usbStatus); |
596 |
612 |
597 |
613 |
598 // if object doesn't exist or the usb doesn't connect |
614 // Whenever usb is connected |
599 if(( retval2 != KErrAlreadyExists ) |
615 if ( usbStatus == KUsbPersonalityIdMTP |
600 || ( usbStatus != KUsbPersonalityIdPCSuite |
616 || usbStatus == KUsbPersonalityIdMS |
601 || usbStatus != KUsbPersonalityIdMS |
617 || usbStatus == KUsbPersonalityIdPTP |
602 || usbStatus != KUsbPersonalityIdPTP |
618 || usbStatus == KUsbPersonalityIdPCSuiteMTP |
603 || usbStatus != KUsbPersonalityIdMTP |
619 || usbStatus == KUsbPersonalityIdPCSuite ) |
604 || usbStatus != KUsbPersonalityIdPCSuiteMTP )) |
|
605 { |
620 { |
606 RProperty::Set( KMPXViewPSUid, |
621 RProperty::Set( KMPXViewPSUid, |
607 KMPXUSBUnblockingPSStatus, |
622 KMPXUSBUnblockingPSStatus, |
|
623 EMPXUSBUnblockingPSStatusActive); |
|
624 } |
|
625 else |
|
626 { |
|
627 RProperty::Set( KMPXViewPSUid, |
|
628 KMPXUSBUnblockingPSStatus, |
608 EMPXUSBUnblockingPSStatusUninitialized ); |
629 EMPXUSBUnblockingPSStatusUninitialized ); |
609 } |
630 } |
610 // if usb mode is in MTP mode or pc suite mode |
631 } |
611 else if ( usbStatus == KUsbPersonalityIdMTP |
|
612 || usbStatus == KUsbPersonalityIdPCSuiteMTP |
|
613 || usbStatus == KUsbPersonalityIdPCSuite ) |
|
614 { |
|
615 RProperty::Set( KMPXViewPSUid, |
|
616 KMPXUSBUnblockingPSStatus, |
|
617 EMPXUSBUnblockingPSStatusActive ); |
|
618 } |
|
619 } |
|
620 |
632 |
621 // --------------------------------------------------------------------------- |
633 // --------------------------------------------------------------------------- |
622 // Delete the selected items in TBone View |
634 // Delete the selected items in TBone View |
623 // --------------------------------------------------------------------------- |
635 // --------------------------------------------------------------------------- |
624 // |
636 // |
4001 } |
4013 } |
4002 // USB flags |
4014 // USB flags |
4003 // |
4015 // |
4004 CEikMenuBar* menuBar( MenuBar() ); |
4016 CEikMenuBar* menuBar( MenuBar() ); |
4005 #ifdef SINGLE_CLICK_INCLUDED |
4017 #ifdef SINGLE_CLICK_INCLUDED |
4006 iContainer->EnableMarking( EFalse ); |
4018 if(iContainer) |
4007 menuBar->SetMenuTitleResourceId( R_MPX_COLLECTION_VIEW_MENUBAR_NO_MARKING ); |
4019 { |
|
4020 iContainer->EnableMarking( EFalse ); |
|
4021 } |
|
4022 if(menuBar) |
|
4023 { |
|
4024 menuBar->SetMenuTitleResourceId( R_MPX_COLLECTION_VIEW_MENUBAR_NO_MARKING ); |
|
4025 } |
4008 #else |
4026 #else |
4009 iContainer->EnableMarking( ETrue ); |
4027 if(iContainer) |
|
4028 { |
|
4029 iContainer->EnableMarking( ETrue ); |
|
4030 } |
|
4031 if(menuBar) |
|
4032 { |
4010 menuBar->SetMenuTitleResourceId( R_MPX_COLLECTION_VIEW_MENUBAR ); |
4033 menuBar->SetMenuTitleResourceId( R_MPX_COLLECTION_VIEW_MENUBAR ); |
|
4034 } |
4011 #endif |
4035 #endif |
4012 TBool IsUSBEvent( EFalse ); |
4036 TBool IsUSBEvent( EFalse ); |
4013 if( type == EMcMsgUSBMassStorageStart || type == EMcMsgUSBMTPStart ) |
4037 if( type == EMcMsgUSBMassStorageStart || type == EMcMsgUSBMTPStart ) |
4014 { |
4038 { |
4015 iUSBOnGoing = ETrue; |
4039 iUSBOnGoing = ETrue; |
4187 if ( !iContainer ) |
4211 if ( !iContainer ) |
4188 { |
4212 { |
4189 // View is not active. Ignore. |
4213 // View is not active. Ignore. |
4190 return; |
4214 return; |
4191 } |
4215 } |
|
4216 #ifdef BACKSTEPPING_INCLUDED |
4192 // handle deferred notification when view is in focus but not for view transitions |
4217 // handle deferred notification when view is in focus but not for view transitions |
4193 if ( iActivateBackStepping ) |
4218 if ( iActivateBackStepping ) |
4194 { |
4219 { |
4195 HandleBacksteppingActivation(); |
4220 HandleBacksteppingActivation(); |
4196 } |
4221 } |
|
4222 #endif // BACKSTEPPING_INCLUDED |
4197 |
4223 |
4198 iCollectionReady = aComplete; |
4224 iCollectionReady = aComplete; |
4199 #ifdef __ENABLE_PODCAST_IN_MUSIC_MENU |
4225 #ifdef __ENABLE_PODCAST_IN_MUSIC_MENU |
4200 if( iPodcast && !iDisablePodcasting ) |
4226 if( iPodcast && !iDisablePodcasting ) |
4201 { |
4227 { |
4579 if ( EMPXOpeningNote == iNoteType || EMPXImmediatelyOpeningNote == iNoteType ) |
4605 if ( EMPXOpeningNote == iNoteType || EMPXImmediatelyOpeningNote == iNoteType ) |
4580 { |
4606 { |
4581 CloseWaitNoteL(); |
4607 CloseWaitNoteL(); |
4582 } |
4608 } |
4583 } |
4609 } |
|
4610 |
|
4611 MPX_DEBUG1( "HandleOpenL CheckingTimer" ); |
|
4612 if ( iTimer && !iTimer->IsActive() ) |
|
4613 { |
|
4614 MPX_DEBUG1( "HandleOpenL Starting" ); |
|
4615 iTimer->Start( KMPXTimeoutTimer, KMPXTimeoutTimer, TCallBack( IADCheckTimerCallBack, this)); |
|
4616 } |
4584 |
4617 |
4585 MPX_PERF_CHECKPT("Collection View opened"); |
4618 MPX_PERF_CHECKPT("Collection View opened"); |
4586 } |
4619 } |
4587 |
4620 |
4588 // --------------------------------------------------------------------------- |
4621 // --------------------------------------------------------------------------- |
5562 CMPXCollectionPath* cpath = iCollectionUtility->Collection().PathL(); |
5595 CMPXCollectionPath* cpath = iCollectionUtility->Collection().PathL(); |
5563 CleanupStack::PushL( cpath ); |
5596 CleanupStack::PushL( cpath ); |
5564 TInt currentDepth( cpath->Levels() ); |
5597 TInt currentDepth( cpath->Levels() ); |
5565 if ( currentDepth == 2 ) // 2 is the level of music main view |
5598 if ( currentDepth == 2 ) // 2 is the level of music main view |
5566 { |
5599 { |
|
5600 #ifdef BACKSTEPPING_INCLUDED |
5567 // let Back Stepping Service handle the event |
5601 // let Back Stepping Service handle the event |
5568 TInt statusInfo( KMPXBackSteppingNotConsumed ); |
5602 TInt statusInfo( KMPXBackSteppingNotConsumed ); |
5569 if( iViewUtility && |
5603 if( iViewUtility && |
5570 ( iViewUtility->ActiveViewImplementationUid() != KNullUid ) ) |
5604 ( iViewUtility->ActiveViewImplementationUid() != KNullUid ) ) |
5571 { |
5605 { |
5578 viewId, statusInfo ); |
5612 viewId, statusInfo ); |
5579 } |
5613 } |
5580 if ( statusInfo == KMPXBackSteppingNotConsumed ) |
5614 if ( statusInfo == KMPXBackSteppingNotConsumed ) |
5581 // event not consumed by Back Stepping utility, handle here |
5615 // event not consumed by Back Stepping utility, handle here |
5582 // |
5616 // |
|
5617 #endif // BACKSTEPPING_INCLUDED |
5583 { |
5618 { |
5584 AppUi()->HandleCommandL( aCommand ); |
5619 AppUi()->HandleCommandL( aCommand ); |
5585 } |
5620 } |
5586 } |
5621 } |
5587 else |
5622 else |
5987 if ( aForeground && iOpeningNote ) |
6022 if ( aForeground && iOpeningNote ) |
5988 { |
6023 { |
5989 CloseWaitNoteL(); |
6024 CloseWaitNoteL(); |
5990 iOpeningNote = EFalse; |
6025 iOpeningNote = EFalse; |
5991 } |
6026 } |
|
6027 #ifdef BACKSTEPPING_INCLUDED |
5992 iActivateBackStepping = EFalse; |
6028 iActivateBackStepping = EFalse; |
5993 MPX_DEBUG3("CMPXCollectionViewHgImp::HandleForegroundEventL - is in foreground=%d, this view=0x%x", |
6029 MPX_DEBUG3("CMPXCollectionViewHgImp::HandleForegroundEventL - is in foreground=%d, this view=0x%x", |
5994 aForeground, Id().iUid ); |
6030 aForeground, Id().iUid ); |
5995 if( aForeground && |
6031 if( aForeground && |
5996 iViewUtility && |
6032 iViewUtility && |
5997 ( iViewUtility->ActiveViewImplementationUid() != KNullUid ) ) |
6033 ( iViewUtility->ActiveViewImplementationUid() != KNullUid ) ) |
5998 { |
6034 { |
5999 iActivateBackStepping = ETrue; |
6035 iActivateBackStepping = ETrue; |
6000 } |
6036 } |
|
6037 #endif // BACKSTEPPING_INCLUDED |
6001 { |
6038 { |
6002 CAknView::HandleForegroundEventL( aForeground ); |
6039 CAknView::HandleForegroundEventL( aForeground ); |
6003 } |
6040 } |
6004 } |
6041 } |
6005 |
6042 |
6008 // Handle backstepping activation |
6045 // Handle backstepping activation |
6009 // ----------------------------------------------------------------------------- |
6046 // ----------------------------------------------------------------------------- |
6010 // |
6047 // |
6011 void CMPXCollectionViewHgImp::HandleBacksteppingActivation() |
6048 void CMPXCollectionViewHgImp::HandleBacksteppingActivation() |
6012 { |
6049 { |
|
6050 #ifdef BACKSTEPPING_INCLUDED |
6013 TInt viewId( iViewUtility->ActiveViewType().iUid ); |
6051 TInt viewId( iViewUtility->ActiveViewType().iUid ); |
6014 TBuf8<KMVPrefixLen + KMaxIntLen> buf; |
6052 TBuf8<KMVPrefixLen + KMaxIntLen> buf; |
6015 buf.Copy( KMVPrefix ); |
6053 buf.Copy( KMVPrefix ); |
6016 buf.AppendNum( viewId ); |
6054 buf.AppendNum( viewId ); |
6017 TInt statusInfo( KMPXBackSteppingNotConsumed ); |
6055 TInt statusInfo( KMPXBackSteppingNotConsumed ); |
6019 statusInfo = |
6057 statusInfo = |
6020 iBackSteppingUtility->ForwardActivationEventL( buf, ETrue ); |
6058 iBackSteppingUtility->ForwardActivationEventL( buf, ETrue ); |
6021 ); |
6059 ); |
6022 MPX_DEBUG3("CMPXCollectionViewHgImp::HandleBacksteppingActivation - viewId=0x%x, statusInfo=%d", viewId, statusInfo ); |
6060 MPX_DEBUG3("CMPXCollectionViewHgImp::HandleBacksteppingActivation - viewId=0x%x, statusInfo=%d", viewId, statusInfo ); |
6023 iActivateBackStepping = EFalse; |
6061 iActivateBackStepping = EFalse; |
|
6062 #endif // BACKSTEPPING_INCLUDED |
6024 } |
6063 } |
6025 |
6064 |
6026 // --------------------------------------------------------------------------- |
6065 // --------------------------------------------------------------------------- |
6027 // Handle initialing a music menu pane. |
6066 // Handle initialing a music menu pane. |
6028 // --------------------------------------------------------------------------- |
6067 // --------------------------------------------------------------------------- |
6514 aMenuPane->SetItemDimmed( EMPXCmdReorder, ETrue ); |
6553 aMenuPane->SetItemDimmed( EMPXCmdReorder, ETrue ); |
6515 aMenuPane->SetItemDimmed( EMPXCmdSend, ETrue ); |
6554 aMenuPane->SetItemDimmed( EMPXCmdSend, ETrue ); |
6516 aMenuPane->SetItemDimmed( EMPXCmdDelete, ETrue ); |
6555 aMenuPane->SetItemDimmed( EMPXCmdDelete, ETrue ); |
6517 aMenuPane->SetItemDimmed( EMPXCmdRemove, ETrue ); |
6556 aMenuPane->SetItemDimmed( EMPXCmdRemove, ETrue ); |
6518 aMenuPane->SetItemDimmed( EMPXCmdPlayItem, ETrue ); |
6557 aMenuPane->SetItemDimmed( EMPXCmdPlayItem, ETrue ); |
|
6558 aMenuPane->SetItemDimmed( EMPXCmdGoToNowPlaying, ETrue ); |
6519 } |
6559 } |
6520 break; |
6560 break; |
6521 } |
6561 } |
6522 case R_MPX_COLLECTION_VIEW_MENU_2: |
6562 case R_MPX_COLLECTION_VIEW_MENU_2: |
6523 { |
6563 { |
8084 CleanupStack::PushL( path ); |
8124 CleanupStack::PushL( path ); |
8085 iCollectionUtility->Collection().OpenL( *path ); |
8125 iCollectionUtility->Collection().OpenL( *path ); |
8086 CleanupStack::PopAndDestroy( path ); |
8126 CleanupStack::PopAndDestroy( path ); |
8087 } |
8127 } |
8088 |
8128 |
|
8129 // ----------------------------------------------------------------------------- |
|
8130 // CMPXCollectionViewHgImp::IADCheckTimerCallBack |
|
8131 // ----------------------------------------------------------------------------- |
|
8132 // |
|
8133 TInt CMPXCollectionViewHgImp::IADCheckTimerCallBack(TAny* aHgViewObject) |
|
8134 { |
|
8135 MPX_FUNC( "CMPXCollectionViewHgImp::IADCheckTimerCallBack" ); |
|
8136 |
|
8137 if (aHgViewObject) |
|
8138 { |
|
8139 CMPXCollectionViewHgImp* hgViewObject = static_cast<CMPXCollectionViewHgImp*>(aHgViewObject); |
|
8140 hgViewObject->StartCheckingforIADUpdates(); |
|
8141 } |
|
8142 |
|
8143 return KErrNone; |
|
8144 } |
|
8145 |
|
8146 // ----------------------------------------------------------------------------- |
|
8147 // CMPXCollectionViewHgImp::StartCheckingforIADUpdates |
|
8148 // ----------------------------------------------------------------------------- |
|
8149 // |
|
8150 void CMPXCollectionViewHgImp::StartCheckingforIADUpdates() |
|
8151 { |
|
8152 MPX_FUNC( "CMPXCollectionViewHgImp::StartCheckingforIADUpdates" ); |
|
8153 |
|
8154 if ( iTimer ) |
|
8155 { |
|
8156 iTimer->Cancel(); |
|
8157 delete iTimer; |
|
8158 iTimer = NULL; |
|
8159 } |
|
8160 |
|
8161 AppUi()->HandleCommandL(EMPXCmdCheckIADUpdates); |
|
8162 } |
|
8163 |
|
8164 |
8089 // End of File |
8165 // End of File |