458 CRepository* repository = CRepository::NewL( KCRUidMPXMPFeatures ); |
457 CRepository* repository = CRepository::NewL( KCRUidMPXMPFeatures ); |
459 repository->Get( KMPXMPLocalVariation, flags ); |
458 repository->Get( KMPXMPLocalVariation, flags ); |
460 delete repository; |
459 delete repository; |
461 iGoToMusicShopOptionHidden = |
460 iGoToMusicShopOptionHidden = |
462 !static_cast<TBool>( flags & KMPXEnableGoToMusicShopOption ); |
461 !static_cast<TBool>( flags & KMPXEnableGoToMusicShopOption ); |
463 iUsingNokiaService = |
462 iUsingNokiaService = flags & KMPXEnableFindInMusicShopOption ? ETrue : EFalse; |
464 static_cast<TBool>( flags & KMPXEnableFindInMusicShopOption ); |
463 |
465 MPX_DEBUG2( "CMPXCollectionViewHgImp::ConstructL(): iUsingNokiaService: %d", iUsingNokiaService ); |
464 MPX_DEBUG2( "CMPXCollectionViewHgImp::ConstructL(): iUsingNokiaService: %d", iUsingNokiaService ); |
466 iDisablePodcasting = flags&KMPXDisablePodcastingOption ? ETrue : EFalse; |
465 iDisablePodcasting = flags&KMPXDisablePodcastingOption ? ETrue : EFalse; |
467 |
466 |
468 #ifdef _DEBUG |
467 #ifdef _DEBUG |
469 iExitOptionHidden = EFalse; |
468 iExitOptionHidden = EFalse; |
521 KMShopCategoryName, |
520 KMShopCategoryName, |
522 RProperty::ELargeText, |
521 RProperty::ELargeText, |
523 KMPlayerRemoteReadPolicy, |
522 KMPlayerRemoteReadPolicy, |
524 KMPlayerRemoteWritePolicy ); |
523 KMPlayerRemoteWritePolicy ); |
525 } |
524 } |
526 |
525 // Check if Music Store dll is in ROM |
|
526 iMusicStoreAppInstalled = IsMusicAppInstalledL( TUid::Uid( iMusicStoreUID ) ); |
|
527 iUsingNokiaService&=iMusicStoreAppInstalled; |
|
528 |
527 iCachedSelectionIndex = new ( ELeave )CArrayFixFlat<TInt>( KMPXArrayGranularity ); |
529 iCachedSelectionIndex = new ( ELeave )CArrayFixFlat<TInt>( KMPXArrayGranularity ); |
528 iIncrementalOpenUtil = CMPXCollectionOpenUtility::NewL( this ); |
530 iIncrementalOpenUtil = CMPXCollectionOpenUtility::NewL( this ); |
529 |
531 |
530 #ifdef BACKSTEPPING_INCLUDED |
532 #ifdef BACKSTEPPING_INCLUDED |
531 // Initialize the Back Stepping Service Utility with the MPX Music Player |
533 // Initialize the Back Stepping Service Utility with the MPX Music Player |
4287 UpdateListBoxL( aEntries, KMusicMenuPodcastMenuItemIndex, aComplete ); |
4288 UpdateListBoxL( aEntries, KMusicMenuPodcastMenuItemIndex, aComplete ); |
4288 ( void ) aIndex; |
4289 ( void ) aIndex; |
4289 } |
4290 } |
4290 else |
4291 else |
4291 { |
4292 { |
4292 TInt topIndex = aIndex; |
4293 UpdateListBoxL( aEntries, aIndex, aComplete ); |
4293 if ( iFirstIndexOnScreen > 0 ) |
|
4294 { |
|
4295 topIndex = iFirstIndexOnScreen; |
|
4296 if ( aComplete ) |
|
4297 { |
|
4298 iFirstIndexOnScreen = 0; |
|
4299 } |
|
4300 } |
|
4301 UpdateListBoxL( aEntries, topIndex, aComplete ); |
|
4302 } |
4294 } |
4303 #else |
4295 #else |
4304 UpdateListBoxL( aEntries, aIndex, aComplete ); |
4296 UpdateListBoxL( aEntries, aIndex, aComplete ); |
4305 #endif // __ENABLE_PODCAST_IN_MUSIC_MENU |
4297 #endif // __ENABLE_PODCAST_IN_MUSIC_MENU |
4306 if ( iContainer ) |
4298 if ( iContainer ) |
6712 aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, EFalse ); |
6680 aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, EFalse ); |
6713 aMenuPane->SetItemDimmed( EMPXCmdSend, SendOptionVisibilityL() ); |
6681 aMenuPane->SetItemDimmed( EMPXCmdSend, SendOptionVisibilityL() ); |
6714 aMenuPane->SetItemDimmed( EMPXCmdDelete, EFalse ); |
6682 aMenuPane->SetItemDimmed( EMPXCmdDelete, EFalse ); |
6715 } |
6683 } |
6716 } |
6684 } |
6717 if ( iOperatorMusicStore ) |
6685 DisplayMusicShopOptions(aMenuPane); |
6718 { |
|
6719 aMenuPane->SetItemDimmed(EMPXCmdGoToMusicShop, ETrue); |
|
6720 } |
|
6721 else |
|
6722 { |
|
6723 aMenuPane->SetItemDimmed(EMPXCmdGoToMultipleMusicShop, ETrue); |
|
6724 } |
|
6725 break; |
6686 break; |
6726 } |
6687 } |
6727 |
6688 |
6728 case R_MPX_COLLECTION_VIEW_MENU_2: |
6689 case R_MPX_COLLECTION_VIEW_MENU_2: |
6729 { |
6690 { |
6978 void CMPXCollectionViewHgImp::DynInitMenuPaneL( |
6939 void CMPXCollectionViewHgImp::DynInitMenuPaneL( |
6979 TInt aResourceId, |
6940 TInt aResourceId, |
6980 CEikMenuPane* aMenuPane ) |
6941 CEikMenuPane* aMenuPane ) |
6981 { |
6942 { |
6982 MPX_FUNC( "CMPXCollectionViewHgImp::DynInitMenuPaneL" ); |
6943 MPX_FUNC( "CMPXCollectionViewHgImp::DynInitMenuPaneL" ); |
6983 |
6944 |
6984 if ( iContainer->IsTBoneView() ) |
|
6985 { |
|
6986 //makesure mediawall is not flicking before handling long tap |
|
6987 TInt currentIndex( iContainer->CurrentLbxItemIndex() ); |
|
6988 MPX_DEBUG2( "CMPXCollectionViewHgImp::DynInitMenuPaneL currentIndex = %d", currentIndex ); |
|
6989 if (currentIndex == KErrNotFound) |
|
6990 { |
|
6991 MPX_DEBUG1( "DynInitMenuPaneL NOT handling stylus popup menu when flicking"); |
|
6992 DimAllOptions(aResourceId, aMenuPane); |
|
6993 return; |
|
6994 } |
|
6995 } |
|
6996 |
|
6997 CMPXCollectionViewListBoxArray* array = |
6945 CMPXCollectionViewListBoxArray* array = |
6998 static_cast<CMPXCollectionViewListBoxArray*>( |
6946 static_cast<CMPXCollectionViewListBoxArray*>( |
6999 iContainer->ListBoxArray() ); |
6947 iContainer->ListBoxArray() ); |
7000 const CMPXMedia& containerMedia = array->ContainerMedia(); |
6948 const CMPXMedia& containerMedia = array->ContainerMedia(); |
7001 |
6949 |
7496 // ----------------------------------------------------------------------------- |
7444 // ----------------------------------------------------------------------------- |
7497 // |
7445 // |
7498 void CMPXCollectionViewHgImp::LaunchMusicShopL() |
7446 void CMPXCollectionViewHgImp::LaunchMusicShopL() |
7499 { |
7447 { |
7500 MPX_FUNC( "CMPXCollectionViewHgImp::LaunchMusicShopL" ); |
7448 MPX_FUNC( "CMPXCollectionViewHgImp::LaunchMusicShopL" ); |
7501 |
7449 if (iOperatorMusicStore && !iMusicStoreAppInstalled) //Launch Operator Store |
7502 if ( iMusicStoreUID != 0) |
7450 { |
7503 { |
7451 if (iMusicStoreWebPage) |
7504 TApaTaskList taskList( iCoeEnv->WsSession() ); |
7452 { |
7505 TApaTask task = taskList.FindApp( TUid::Uid(iMusicStoreUID) ); |
7453 LaunchOperatorURLMusicShopL(); |
7506 |
7454 } |
7507 if ( task.Exists() ) |
7455 else |
7508 { |
7456 { |
7509 GfxTransEffect::BeginFullScreen( |
7457 if (iOperatorMusicStoreType) |
7510 AknTransEffect::EApplicationStart, |
7458 { |
7511 TRect(), |
7459 LaunchOperatorJavaMusicShopL(iOperatorMusicStoreUID); |
7512 AknTransEffect::EParameterType, |
7460 } |
7513 AknTransEffect::GfxTransParam( TUid::Uid(iMusicStoreUID), |
7461 else |
7514 AknTransEffect::TParameter::EActivateExplicitContinue )); |
7462 { |
7515 task.BringToForeground(); |
7463 LaunchOperatorNativeMusicShopL(); |
7516 } |
7464 } |
7517 else |
7465 } |
7518 { |
7466 } |
7519 RApaLsSession session; |
7467 else //Launch Ovi Music Store |
7520 if ( KErrNone == session.Connect() ) |
7468 { |
7521 { |
7469 LaunchOviMusicShopL(); |
7522 CleanupClosePushL( session ); |
|
7523 TThreadId threadId; |
|
7524 session.CreateDocument( KNullDesC, TUid::Uid(iMusicStoreUID), threadId ); |
|
7525 CleanupStack::PopAndDestroy(&session); |
|
7526 } |
|
7527 } |
|
7528 } |
7470 } |
7529 } |
7471 } |
7530 |
7472 |
7531 |
7473 |
7532 // ----------------------------------------------------------------------------- |
7474 // ----------------------------------------------------------------------------- |
8544 aMenuPane->SetItemDimmed( EMPXCmdRename, ETrue ); |
8486 aMenuPane->SetItemDimmed( EMPXCmdRename, ETrue ); |
8545 aMenuPane->SetItemDimmed( EMPXCmdAlbumArt, ETrue ); |
8487 aMenuPane->SetItemDimmed( EMPXCmdAlbumArt, ETrue ); |
8546 aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, ETrue ); |
8488 aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, ETrue ); |
8547 aMenuPane->SetItemDimmed( EMPXCmdSongDetails, ETrue ); |
8489 aMenuPane->SetItemDimmed( EMPXCmdSongDetails, ETrue ); |
8548 aMenuPane->SetItemDimmed( EMPXCmdPlaylistDetails, ETrue ); |
8490 aMenuPane->SetItemDimmed( EMPXCmdPlaylistDetails, ETrue ); |
8549 aMenuPane->SetItemDimmed( EMPXCmdUseAsCascade, ETrue ); |
|
8550 break; |
8491 break; |
8551 } |
8492 } |
8552 case R_AVKON_MENUPANE_MARKABLE_LIST: |
8493 case R_AVKON_MENUPANE_MARKABLE_LIST: |
8553 { |
8494 { |
8554 aMenuPane->SetItemDimmed(EAknCmdEditListMenu, ETrue); |
8495 aMenuPane->SetItemDimmed(EAknCmdEditListMenu, ETrue); |
8555 break; |
8496 break; |
8556 } |
8497 } |
8557 } |
8498 } |
8558 } |
8499 } |
|
8500 |
|
8501 // ----------------------------------------------------------------------------- |
|
8502 // CMPXCollectionViewHgImp::IsMusicAppInstalledL |
|
8503 // ----------------------------------------------------------------------------- |
|
8504 // |
|
8505 TBool CMPXCollectionViewHgImp::IsMusicAppInstalledL( const TUid& aAppUid ) |
|
8506 { |
|
8507 MPX_FUNC( "CMPXCollectionViewHgImp::IsMusicAppInstalledL" ); |
|
8508 TBool response = EFalse; |
|
8509 |
|
8510 RApaLsSession apaSession; |
|
8511 CleanupClosePushL( apaSession ); |
|
8512 User::LeaveIfError( apaSession.Connect() ); |
|
8513 apaSession.GetAllApps(); |
|
8514 |
|
8515 TApaAppInfo appInfo; |
|
8516 TInt err = apaSession.GetAppInfo( appInfo, aAppUid ); |
|
8517 CleanupStack::PopAndDestroy( &apaSession ); |
|
8518 |
|
8519 if ( !err ) |
|
8520 { |
|
8521 // app was found |
|
8522 response = ETrue; |
|
8523 } |
|
8524 MPX_DEBUG2( "CMPXCollectionViewHgImp::IsMusicAppInstalledL response = %d", response ); |
|
8525 return response; |
|
8526 } |
|
8527 |
|
8528 // ----------------------------------------------------------------------------- |
|
8529 // CMPXCollectionViewHgImp::DisplayMusicShopOptions |
|
8530 // ----------------------------------------------------------------------------- |
|
8531 // |
|
8532 void CMPXCollectionViewHgImp::DisplayMusicShopOptions(CEikMenuPane* aMenuPane) |
|
8533 { |
|
8534 if (iOperatorMusicStore && iMusicStoreAppInstalled) |
|
8535 { |
|
8536 aMenuPane->SetItemDimmed(EMPXCmdGoToMusicShop, ETrue); |
|
8537 aMenuPane->SetItemDimmed(EMPXCmdGoToMultipleMusicShop, EFalse); //Show the cascade menu with Ovi and operator store |
|
8538 } |
|
8539 else if ((iOperatorMusicStore && !iMusicStoreAppInstalled) |
|
8540 || (!iOperatorMusicStore && iMusicStoreAppInstalled)) |
|
8541 { |
|
8542 aMenuPane->SetItemDimmed(EMPXCmdGoToMultipleMusicShop, ETrue); |
|
8543 aMenuPane->SetItemDimmed(EMPXCmdGoToMusicShop, EFalse); //Show "Go to Music Store" |
|
8544 } |
|
8545 else |
|
8546 { |
|
8547 aMenuPane->SetItemDimmed(EMPXCmdGoToMultipleMusicShop, ETrue); |
|
8548 aMenuPane->SetItemDimmed(EMPXCmdGoToMusicShop, ETrue); |
|
8549 } |
|
8550 } |
|
8551 |
|
8552 |
|
8553 // ----------------------------------------------------------------------------- |
|
8554 // CMPXCollectionViewHgImp::LaunchOviMusicShopL |
|
8555 // Launch Ovi music shop application |
|
8556 // ----------------------------------------------------------------------------- |
|
8557 // |
|
8558 void CMPXCollectionViewHgImp::LaunchOviMusicShopL() |
|
8559 { |
|
8560 MPX_FUNC( "CMPXCollectionViewHgImp::LaunchOviMusicShopL" ); |
|
8561 if (iMusicStoreUID != 0) |
|
8562 { |
|
8563 TApaTaskList taskList(iCoeEnv->WsSession()); |
|
8564 TApaTask task = taskList.FindApp(TUid::Uid(iMusicStoreUID)); |
|
8565 |
|
8566 if (task.Exists()) |
|
8567 { |
|
8568 GfxTransEffect::BeginFullScreen( |
|
8569 AknTransEffect::EApplicationStart, |
|
8570 TRect(), |
|
8571 AknTransEffect::EParameterType, |
|
8572 AknTransEffect::GfxTransParam( TUid::Uid(iMusicStoreUID), |
|
8573 AknTransEffect::TParameter::EActivateExplicitContinue)); |
|
8574 task.BringToForeground(); |
|
8575 } |
|
8576 else |
|
8577 { |
|
8578 RApaLsSession session; |
|
8579 if (KErrNone == session.Connect()) |
|
8580 { |
|
8581 CleanupClosePushL(session); |
|
8582 TThreadId threadId; |
|
8583 session.CreateDocument(KNullDesC, TUid::Uid(iMusicStoreUID), |
|
8584 threadId); |
|
8585 CleanupStack::PopAndDestroy(&session); |
|
8586 } |
|
8587 } |
|
8588 } |
|
8589 } |
8559 // End of File |
8590 // End of File |