--- a/mpxmusicplayer/app/src/mpxappui.cpp Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxmusicplayer/app/src/mpxappui.cpp Fri Mar 12 15:42:25 2010 +0200
@@ -211,6 +211,10 @@
// initialize FeatureManager
FeatureManager::InitializeLibL();
+ // Check updates from IAD, continue UI launching even if something fails there
+ // Uncomment when to add IAD update checking functionality to music player
+ // TRAP_IGNORE( CheckUpdatesL() );
+
if ( FeatureManager::FeatureSupported( KFeatureIdCoverDisplay ) )
{
iCoverDisplay = ETrue;
@@ -780,11 +784,17 @@
if ( !MPXUser::IsCallOngoing( KMPXCallTypeGenericVoice ) ||
( playerState == EPbStatePlaying ) ||
( playerState == EPbStateSeekingForward ) ||
- ( playerState == EPbStateSeekingBackward ) )
+ ( playerState == EPbStateSeekingBackward ) ||
+ iPdParameterHandler )
{
+ TMPXPlaybackState pdPlayerState( EPbStateNotInitialised );
+ if ( iPdParameterHandler )
+ {
+ pdPlayerState = iPdParameterHandler->PdStateL();
+ }
// only process command if there no call ongoing
// or if we're actively playing during call
- if ( IsForeground() || EPbStatePlaying == playerState )
+ if ( IsForeground() || EPbStatePlaying == playerState || EPbStatePlaying == pdPlayerState )
{
MuteVolume();
HandlePopupL( EPbCmdMuteVolume );
@@ -799,11 +809,17 @@
if ( !MPXUser::IsCallOngoing( KMPXCallTypeGenericVoice ) ||
( playerState == EPbStatePlaying ) ||
( playerState == EPbStateSeekingForward ) ||
- ( playerState == EPbStateSeekingBackward ) )
+ ( playerState == EPbStateSeekingBackward ) ||
+ iPdParameterHandler )
{
// only process command if there no call ongoing
// or if we're actively playing during call
- if ( IsForeground() || EPbStatePlaying == playerState )
+ TMPXPlaybackState pdPlayerState( EPbStateNotInitialised );
+ if ( iPdParameterHandler )
+ {
+ pdPlayerState = iPdParameterHandler->PdStateL();
+ }
+ if ( IsForeground() || EPbStatePlaying == playerState || EPbStatePlaying == pdPlayerState )
{
UnMuteVolume();
HandlePopupL( EPbCmdUnMuteVolume );
@@ -2096,8 +2112,9 @@
CleanupClosePushL( procArray );
TProcessId npProcId( 0 );
MMPXPlaybackUtility* activePbU = MMPXPlaybackUtility::UtilityL( KPbModeActivePlayer );
+ CleanupClosePushL( *activePbU );
activePbU->GetClientsL( procArray );
- activePbU->Close();
+ CleanupStack::PopAndDestroy( activePbU );
npProcId = procArray[ 0 ];
CleanupStack::PopAndDestroy( &procArray );
@@ -3333,11 +3350,6 @@
TMPXPlaybackCommand cmd = EPbCmdEnd;
switch ( aCommand )
{
- case EMPXCmdCheckIADUpdates:
- {
- TRAP_IGNORE( CheckUpdatesL() );
- break;
- }
case EMPXCmdPlay:
case EMPXCmdPause:
case EMPXCmdPlayPause:
@@ -4352,7 +4364,12 @@
cmd->SetTObjectValueL<TBool>( KMPXCommandPlaybackGeneralNoBuffer, ETrue );
cmd->SetTObjectValueL<TInt>( KMPXCommandPlaybackGeneralType, EPbCmdSetVolume );
cmd->SetTObjectValueL<TUint>( KMPXCommandPlaybackGeneralData, aVolume );
- iPlaybackUtility->CommandL( *cmd );
+
+ MMPXPlaybackUtility* activePbu = MMPXPlaybackUtility::UtilityL( KPbModeActivePlayer );
+ CleanupClosePushL( *activePbu );
+ activePbu->CommandL( *cmd );
+ CleanupStack::PopAndDestroy( activePbu );
+
CleanupStack::PopAndDestroy( cmd );
}
@@ -4368,7 +4385,12 @@
cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
cmd->SetTObjectValueL<TBool>( KMPXCommandPlaybackGeneralNoBuffer, ETrue );
cmd->SetTObjectValueL<TInt>( KMPXCommandPlaybackGeneralType, EPbCmdMuteVolume );
- iPlaybackUtility->CommandL( *cmd );
+
+ MMPXPlaybackUtility* activePbu = MMPXPlaybackUtility::UtilityL( KPbModeActivePlayer );
+ CleanupClosePushL( *activePbu );
+ activePbu->CommandL( *cmd );
+ CleanupStack::PopAndDestroy( activePbu );
+
CleanupStack::PopAndDestroy( cmd );
}
@@ -4384,7 +4406,12 @@
cmd->SetTObjectValueL<TBool>( KMPXCommandGeneralDoSync, ETrue );
cmd->SetTObjectValueL<TBool>( KMPXCommandPlaybackGeneralNoBuffer, ETrue );
cmd->SetTObjectValueL<TInt>( KMPXCommandPlaybackGeneralType, EPbCmdUnMuteVolume );
- iPlaybackUtility->CommandL( *cmd );
+
+ MMPXPlaybackUtility* activePbu = MMPXPlaybackUtility::UtilityL( KPbModeActivePlayer );
+ CleanupClosePushL( *activePbu );
+ activePbu->CommandL( *cmd );
+ CleanupStack::PopAndDestroy( activePbu );
+
CleanupStack::PopAndDestroy( cmd );
}
--- a/mpxmusicplayer/commonui/inc/mpxcommonui.hrh Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxmusicplayer/commonui/inc/mpxcommonui.hrh Fri Mar 12 15:42:25 2010 +0200
@@ -35,6 +35,7 @@
#define KMPXBrowserUid 0x10008D39
#define KMPXBrowserUid2 0x1020724D
#define KPodcastingAppUid 0x1028190B
+#define KMPXCommonMailUid 0x2001E277
#endif // MPXCOMMONUI_HRH
--- a/mpxmusicplayer/commonui/src/mpxcommonuihelper.cpp Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxmusicplayer/commonui/src/mpxcommonuihelper.cpp Fri Mar 12 15:42:25 2010 +0200
@@ -232,7 +232,8 @@
TInt hostUid = MPXTlsHelper::HostUid().iUid;
if ( hostUid == KMPXMmsViewerUid || hostUid == KMPXMmsEditorUid ||
hostUid == KMPXMailViewerUid || hostUid == KMPXMailEditorUid ||
- hostUid == KMPXMessagingUid || hostUid == KMPXUniEditorUid )
+ hostUid == KMPXMessagingUid || hostUid == KMPXUniEditorUid ||
+ hostUid == KMPXCommonMailUid )
{
ret = ETrue;
}
--- a/mpxplugins/serviceplugins/collectionplugins/inc/mpxdbcommonutil.h Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/serviceplugins/collectionplugins/inc/mpxdbcommonutil.h Fri Mar 12 15:42:25 2010 +0200
@@ -410,6 +410,19 @@
*/
IMPORT_C static TPtrC GetColumnTextL(RSqlStatement& aStatement, TInt aField);
+ /**
+ * Constructs an item changed message and adds it to the array
+ * @param aMessageArray array to add the message to
+ * @param aId item ID
+ * @param aChangeType change type
+ * @param aCategory category of the item changed
+ * @param aUid plugin UID
+ * @param aAlbumArt is the flag for album art changed
+ * @param aDeprecatedId deprecated id of the item after it's been moved/renamed
+ */
+ IMPORT_C static void AddItemAlbumChangedMessageL(CMPXMessageArray& aMessageArray, TMPXItemId aId,
+ TMPXChangeEventType aChangeType, TMPXGeneralCategory aCategory, TUint aUid,
+ TBool aAlbumArt, TMPXItemId aDeprecatedId = 0 );
private:
/**
* Create a media object with title, type, category and ID and push onto the CS.
--- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbcommon/bwinscw/mpxsqlitedbcommonu.def Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbcommon/bwinscw/mpxsqlitedbcommonu.def Fri Mar 12 15:42:25 2010 +0200
@@ -125,4 +125,5 @@
?IsRemoteDrive@CMPXDbManager@@QAEHW4TDriveNumber@@@Z @ 124 NONAME ; int CMPXDbManager::IsRemoteDrive(enum TDriveNumber)
?ExecuteSumQueryL@CMPXDbTable@@IAEHABVTDesC16@@@Z @ 125 NONAME ; int CMPXDbTable::ExecuteSumQueryL(class TDesC16 const &)
?ExecuteSumQueryL@CMPXDbTable@@IAEHABVTDesC16@@KK@Z @ 126 NONAME ; int CMPXDbTable::ExecuteSumQueryL(class TDesC16 const &, unsigned long, unsigned long)
+ ?AddItemAlbumChangedMessageL@MPXDbCommonUtil@@SAXAAVCMPXMediaArray@@VTMPXItemId@@W4TMPXChangeEventType@@W4TMPXGeneralCategory@@IH1@Z @ 127 NONAME ; void MPXDbCommonUtil::AddItemAlbumChangedMessageL(class CMPXMediaArray &, class TMPXItemId, enum TMPXChangeEventType, enum TMPXGeneralCategory, unsigned int, int, class TMPXItemId)
--- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbcommon/eabi/mpxsqlitedbcommonu.def Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbcommon/eabi/mpxsqlitedbcommonu.def Fri Mar 12 15:42:25 2010 +0200
@@ -138,4 +138,5 @@
_ZTV11CMPXDbTable @ 137 NONAME
_ZTV12CMPXResource @ 138 NONAME
_ZTV13CMPXDbManager @ 139 NONAME
+ _ZN15MPXDbCommonUtil27AddItemAlbumChangedMessageLER14CMPXMediaArray10TMPXItemId19TMPXChangeEventType19TMPXGeneralCategoryjiS2_ @ 140 NONAME
--- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbcommon/group/mpxsqlitedbcommon.mmp Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbcommon/group/mpxsqlitedbcommon.mmp Fri Mar 12 15:42:25 2010 +0200
@@ -64,6 +64,9 @@
LIBRARY mpxcommon.lib
LIBRARY centralrepository.lib
+ALWAYS_BUILD_AS_ARM
+OPTION ARMCC -O3 -Otime
+
#if defined(ARMCC)
deffile ../eabi/
#elif defined(WINSCW)
--- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbcommon/src/mpxdbcommonutil.cpp Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbcommon/src/mpxdbcommonutil.cpp Fri Mar 12 15:42:25 2010 +0200
@@ -483,14 +483,7 @@
if ((aDeprecatedId != 0) && (aId != aDeprecatedId))
{
- if ( aCategory == EMPXAlbum && aChangeType == EMPXItemModified )
- {
- aMessage.SetTObjectValueL<TMPXItemId>(KMPXMessageMediaDeprecatedId, aId);
- }
- else
- {
- aMessage.SetTObjectValueL<TMPXItemId>(KMPXMessageMediaDeprecatedId, aDeprecatedId);
- }
+ aMessage.SetTObjectValueL<TMPXItemId>(KMPXMessageMediaDeprecatedId, aDeprecatedId);
}
}
@@ -1285,5 +1278,33 @@
return text;
}
+// ----------------------------------------------------------------------------
+// Add an album item changed message to the message array
+// ----------------------------------------------------------------------------
+//
+EXPORT_C void MPXDbCommonUtil::AddItemAlbumChangedMessageL(
+ CMPXMessageArray& aMessageArray,
+ TMPXItemId aId,
+ TMPXChangeEventType aChangeType,
+ TMPXGeneralCategory aCategory,
+ TUint aUid,
+ TBool aAlbumArt,
+ TMPXItemId aDeprecatedId)
+ {
+ MPX_FUNC("MPXDbCommonUtil::AddItemChangedMessageL");
+ CMPXMessage* message = CMPXMedia::NewL();
+ CleanupStack::PushL(message);
+ FillItemChangedMessageL(*message, aId, aChangeType, aCategory, aUid,
+ aDeprecatedId );
+ if ( aAlbumArt )
+ {
+ message->SetTObjectValueL<TMPXItemId>(KMPXMessageMediaDeprecatedId, aId);
+ }
+ if (FindItemChangedMessageL(aMessageArray, *message) == KErrNotFound)
+ {
+ aMessageArray.AppendL(*message); // ownership xfer
+ }
+ CleanupStack::PopAndDestroy(message);
+ }
// End of File
--- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/data/mpxcollectiondbhgres.rss Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/data/mpxcollectiondbhgres.rss Fri Mar 12 15:42:25 2010 +0200
@@ -236,12 +236,6 @@
{
txt = qtn_mus_pl_recently_downloaded;
}
-
-// ** Shuffle All
-RESOURCE LBUF r_mc_shuffle_all
- {
- txt = "Shuffle All";
- }
// ---------------------------------------------------------------------------
// r_mpx_qtn_mus_music_num_songs
--- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/group/mpxsqlitedbhgplugin.mmp Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/group/mpxsqlitedbhgplugin.mmp Fri Mar 12 15:42:25 2010 +0200
@@ -91,4 +91,7 @@
LIBRARY mpxsqlitedbcommon.lib
LIBRARY mpxcommon.lib
+ALWAYS_BUILD_AS_ARM
+OPTION ARMCC -O3 -Otime
+
// End of File
--- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/inc/mpxdbplugin.h Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/inc/mpxdbplugin.h Fri Mar 12 15:42:25 2010 +0200
@@ -780,7 +780,6 @@
RArray<TInt> iMusicLibraryMenuIds; // music library item menu IDs
HBufC* iAllSongsForArtistTitle;
HBufC* iMusicMenuTitle;
- HBufC* iShuffleAllText;
TBool iDisablePodcasting;
TBool iMtpInUse;
TBool iRefreshing;
--- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/src/mpxdbalbum.cpp Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/src/mpxdbalbum.cpp Fri Mar 12 15:42:25 2010 +0200
@@ -313,9 +313,8 @@
{
// execute the query
iDbManager.ExecuteQueryL(aDriveId, KQueryAlbumUpdate, setStr, aId);
- TInt oldSongId = (aMedia.ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId)).iId2;
- MPXDbCommonUtil::AddItemChangedMessageL(*aItemChangedMessages, aId, EMPXItemModified,
- EMPXAlbum, KDBPluginUid, oldSongId );
+ MPXDbCommonUtil::AddItemAlbumChangedMessageL(*aItemChangedMessages, aId, EMPXItemModified,
+ EMPXAlbum, KDBPluginUid, ETrue, 0 );
}
CleanupStack::PopAndDestroy(setStr);
--- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/src/mpxdbartist.cpp Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/src/mpxdbartist.cpp Fri Mar 12 15:42:25 2010 +0200
@@ -335,9 +335,8 @@
{
// execute the query
iDbManager.ExecuteQueryL(aDriveId, KQueryArtistUpdate, setStr, aId);
- TInt oldSongId = (aMedia.ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId)).iId2;
- MPXDbCommonUtil::AddItemChangedMessageL(*aItemChangedMessages, aId, EMPXItemModified,
- EMPXArtist, KDBPluginUid, oldSongId );
+ MPXDbCommonUtil::AddItemAlbumChangedMessageL(*aItemChangedMessages, aId, EMPXItemModified,
+ EMPXArtist, KDBPluginUid, ETrue, 0 );
}
CleanupStack::PopAndDestroy(setStr);
--- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/src/mpxdbhandler.cpp Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/src/mpxdbhandler.cpp Fri Mar 12 15:42:25 2010 +0200
@@ -1402,18 +1402,21 @@
void CMPXDbHandler::MtpStartL()
{
MPX_DEBUG1("-->CMPXDbHandler::MtpStartL");
- iMtpInUse = ETrue;
- iOpOnDbCount = 0;
-
-#ifdef __RAMDISK_PERF_ENABLE
- TRAPD(err, iDbManager->CopyDBsToRamL(iMtpInUse));
- if ( err != KErrNone )
- {
- MPX_DEBUG2("CMPXDbHandler::MtpStartL error=%d", err);
- }
-#endif //__RAMDISK_PERF_ENABLE
-
- iDbManager->BeginL();
+ if(!iMtpInUse)
+ {
+ iMtpInUse = ETrue;
+ iOpOnDbCount = 0;
+
+ #ifdef __RAMDISK_PERF_ENABLE
+ TRAPD(err, iDbManager->CopyDBsToRamL(iMtpInUse));
+ if ( err != KErrNone )
+ {
+ MPX_DEBUG2("CMPXDbHandler::MtpStartL error=%d", err);
+ }
+ #endif //__RAMDISK_PERF_ENABLE
+
+ iDbManager->BeginL();
+ }
MPX_DEBUG1("<--CMPXDbHandler::MtpStartL");
}
@@ -1815,6 +1818,11 @@
{
visibleChange = CMPXDbActiveTask::EAllVisible;
}
+ if ( aMedia.ValueTObjectL<TInt>( KMPXMediaMusicAlbumArtChanged )== 1 )
+ {
+ ( const_cast<CMPXMedia*>( &aMedia )
+ )->SetTObjectValueL<TInt>( KMPXMediaMusicAlbumArtChanged, 0 );
+ }
return visibleChange;
}
--- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/src/mpxdbplaylistsongs.cpp Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/src/mpxdbplaylistsongs.cpp Fri Mar 12 15:42:25 2010 +0200
@@ -23,6 +23,7 @@
#include <mpxmedia.h>
#include <mpxmediaarray.h>
#include <mpxmediageneraldefs.h>
+#include <mpxmediamusicdefs.h>
#include "mpxdbcommonutil.h"
#include "mpxcollectiondbdef.h"
@@ -300,6 +301,13 @@
} // end case
} // end switch
} // end for
+ if ( aMedia.IsSupported( KMPXMediaMusicAlbumArtChanged ) )
+ {
+ if ( aMedia.ValueTObjectL<TInt>( KMPXMediaMusicAlbumArtChanged )== 1 )
+ {
+ aUpdated = ETrue;
+ }
+ }
}
CleanupStack::PopAndDestroy(&recordset);
--- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/src/mpxdbplugin.cpp Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/src/mpxdbplugin.cpp Fri Mar 12 15:42:25 2010 +0200
@@ -109,7 +109,6 @@
delete iMusicLibraryTitles;
delete iAllSongsForArtistTitle;
delete iMusicMenuTitle;
- delete iShuffleAllText;
if (iActiveTask)
{
@@ -156,7 +155,6 @@
iMusicMenuTitle = iResource->ReadHBufCL(R_MPX_QTN_MUS_TITLE_MUSIC_MENU);
#endif // __ENABLE_MUSIC_TEXT_ALIGNMENT
- iShuffleAllText = iResource->ReadHBufCL(R_MC_SHUFFLE_ALL);
iActiveTask = CMPXDbActiveTask::NewL(*this);
@@ -990,16 +988,7 @@
CleanupClosePushL( ids );
iDbHandler->GetAllSongsLimitedL( aAttrs, *aArray, KFirstFetchCount );
- if ( aArray->Count() > 1 )
- {
- // Add "Shuffle" item
- MPXDbCommonUtil::PrependMediaL(*aArray, *iShuffleAllText,
- EMPXItem, EMPXCommand, 0, 0, 0, 0);
- //MPXDbCommonUtil::AppendMediaL(*aArray, *iShuffleAllText, EMPXItem, EMPXCommand,
- // 0, 0, 0);
- aArray->AtL(0)->SetTObjectValueL(KMPXMediaColDetailNumberOfItems,
- iDbHandler->NumberOfItemsL(EMPXSong));
- }
+
TInt c( aArray->Count() );
for( TInt i=0; i<c; ++i )
{
@@ -1072,15 +1061,6 @@
SetMediaGeneralAttributesL(aEntries, EMPXGroup, EMPXSong,
iMusicLibraryTitles->MdcaPoint(EBrowseAll));
- // Add "Shuffle" item
- if (aArray->Count() > 2)
- {
- MPXDbCommonUtil::PrependMediaL(*aArray, *iShuffleAllText,
- EMPXItem, EMPXCommand, 0, 0, 0, 1);
- aArray->AtL(1)->SetTObjectValueL(KMPXMediaColDetailNumberOfItems,
- iDbHandler->NumberOfItemsL(EMPXSong));
-
- }
MPX_PERF_END(CMPXDbPlugin_DoOpenBrowseAllL_All);
break;
}
@@ -1286,24 +1266,6 @@
SetMediaGeneralAttributesL(aEntries, EMPXGroup, EMPXAlbum,
iMusicLibraryTitles->MdcaPoint(EBrowseAlbum));
- // Add "Shuffle" item
- if (aArray->Count() > 2)
- {
- MPXDbCommonUtil::PrependMediaL(*aArray, *iShuffleAllText,
- EMPXItem, EMPXCommand, 0, 0, 0, 1);
- aArray->AtL(1)->SetTObjectValueL(KMPXMediaColDetailNumberOfItems, 0);
-
- TInt pPath(0);
- CMPXMedia* pMedia = aArray->AtL(0);
- if (pMedia->IsSupported(KMPXMediaGeneralValue))
- {
- pPath = pMedia->ValueTObjectL<TInt>(KMPXMediaGeneralValue);
- MPX_ASSERT(pPath);
- }
- //Update path to include the additional id.
- ((CMPXCollectionPath*)pPath)->InsertL(0,0);
- }
-
MPX_PERF_END(CMPXDbPlugin_DoOpenBrowseAlbumL_All);
break;
}
@@ -1311,21 +1273,26 @@
// All songs in one or multiple albums
case 3:
{
- iDbHandler->GetAllAlbumsL(aAttrs, aArray);
- CMPXMedia* album = aArray->AtL(aPath.Index());
- TMPXItemId albumId = aPath.Id(); // id of selected album
-
- CMPXMediaArray* songs = CMPXMediaArray::NewL();
- CleanupStack::PushL(songs);
- // get all the songs for the selected album
- iDbHandler->GetSongsMatchingAlbumL(albumId, aAttrs, songs);
- album->SetCObjectValueL(KMPXMediaArrayContents, songs);
- album->SetTObjectValueL<TInt>(KMPXMediaArrayCount, songs->Count());
- CleanupStack::PopAndDestroy(songs);
-
- //iDbHandler->GetAllAlbumsL(aAttrs, aArray);
- SetMediaGeneralAttributesL(aEntries, EMPXItem, EMPXAlbum,
- iMusicLibraryTitles->MdcaPoint(EBrowseAlbumSong));
+ MPX_PERF_START(CMPXDbPlugin_DoOpenBrowseAlbumL_AllSongs);
+ if (selections.Count())
+ {
+ // Multiple albums
+ const TInt count(aPath.Selection().Count());
+ for (TInt i = 0; i < count; ++i)
+ {
+ iDbHandler->GetSongsMatchingAlbumL(selections[i].iId2, aAttrs, aArray);
+ }
+ }
+ else
+ {
+ // One album
+ iDbHandler->GetSongsMatchingAlbumL(aPath.Id(idIndex).iId2, aAttrs, aArray);
+ }
+
+ // added for ganes
+ SetMediaGeneralAttributesL(aEntries, EMPXItem, EMPXAlbum, iMusicLibraryTitles->MdcaPoint(EBrowseAlbumSong));
+
+ MPX_PERF_END(CMPXDbPlugin_DoOpenBrowseAlbumL_AllSongs);
break;
}
@@ -1408,24 +1375,6 @@
}
- // Add "Shuffle" item
- if (aArray->Count() > 2)
- {
- MPXDbCommonUtil::PrependMediaL(*aArray, *iShuffleAllText,
- EMPXItem, EMPXCommand, 0, 0, 0, 1);
- aArray->AtL(1)->SetTObjectValueL(KMPXMediaColDetailNumberOfItems, aArray->Count()-2);
-
- TInt pPath(0);
- CMPXMedia* pMedia = aArray->AtL(0);
- if (pMedia->IsSupported(KMPXMediaGeneralValue))
- {
- pPath = pMedia->ValueTObjectL<TInt>(KMPXMediaGeneralValue);
- MPX_ASSERT(pPath);
- }
- //Update path to include the additional id.
- ((CMPXCollectionPath*)pPath)->InsertL(0,0);
- }
-
SetMediaGeneralAttributesL(aEntries, EMPXItem, EMPXPlaylist, aPath.Id(idIndex).iId2);
// populate EMPXMediaGeneralNonPermissibleActions
@@ -4086,17 +4035,6 @@
direction );
}
- // Add "Shuffle" item
- if (offset == 0 && array->Count() > 1)
- {
- //MPXDbCommonUtil::AppendMediaL(*array, *iShuffleAllText, EMPXItem, EMPXCommand,
- //0, 0, 0);
- MPXDbCommonUtil::PrependMediaL(*array, *iShuffleAllText,
- EMPXItem, EMPXCommand, 0, 0, 0, 0);
- array->AtL(0)->SetTObjectValueL(KMPXMediaColDetailNumberOfItems,
- iDbHandler->NumberOfItemsL(EMPXSong));
- }
-
TInt max( path->Count() );
TInt count(0);
TInt aryCount( array->Count() );
--- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbplugin/src/mpxdbalbum.cpp Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbplugin/src/mpxdbalbum.cpp Fri Mar 12 15:42:25 2010 +0200
@@ -258,8 +258,8 @@
if (aItemChangedMessages)
{
// add the item changed message
- MPXDbCommonUtil::AddItemChangedMessageL(*aItemChangedMessages, aId, EMPXItemModified,
- iCategory, KDBPluginUid);
+ MPXDbCommonUtil::AddItemAlbumChangedMessageL(*aItemChangedMessages, aId, EMPXItemModified,
+ EMPXAlbum, KDBPluginUid, ETrue, 0 );
}
}
@@ -316,9 +316,8 @@
{
// execute the query
iDbManager.ExecuteQueryL(aDriveId, KQueryAlbumUpdate, setStr, aId);
- TInt oldSongId = (aMedia.ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId)).iId2;
- MPXDbCommonUtil::AddItemChangedMessageL(*aItemChangedMessages, aId, EMPXItemModified,
- EMPXAlbum, KDBPluginUid, oldSongId );
+ MPXDbCommonUtil::AddItemAlbumChangedMessageL(*aItemChangedMessages, aId, EMPXItemModified,
+ EMPXAlbum, KDBPluginUid, ETrue, 0 );
}
CleanupStack::PopAndDestroy(setStr);
--- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbplugin/src/mpxdbartist.cpp Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbplugin/src/mpxdbartist.cpp Fri Mar 12 15:42:25 2010 +0200
@@ -338,9 +338,8 @@
{
// execute the query
iDbManager.ExecuteQueryL(aDriveId, KQueryArtistUpdate, setStr, aId);
- TInt oldSongId = (aMedia.ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId)).iId2;
- MPXDbCommonUtil::AddItemChangedMessageL(*aItemChangedMessages, aId, EMPXItemModified,
- EMPXArtist, KDBPluginUid, oldSongId );
+ MPXDbCommonUtil::AddItemAlbumChangedMessageL(*aItemChangedMessages, aId, EMPXItemModified,
+ EMPXArtist, KDBPluginUid, ETrue, 0 );
}
CleanupStack::PopAndDestroy(setStr);
--- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbplugin/src/mpxdbhandler.cpp Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbplugin/src/mpxdbhandler.cpp Fri Mar 12 15:42:25 2010 +0200
@@ -1815,6 +1815,11 @@
{
visibleChange = CMPXDbActiveTask::EAllVisible;
}
+ if ( aMedia.ValueTObjectL<TInt>( KMPXMediaMusicAlbumArtChanged )== 1 )
+ {
+ ( const_cast<CMPXMedia*>( &aMedia )
+ )->SetTObjectValueL<TInt>( KMPXMediaMusicAlbumArtChanged, 0 );
+ }
return visibleChange;
}
--- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbplugin/src/mpxdbplaylistsongs.cpp Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbplugin/src/mpxdbplaylistsongs.cpp Fri Mar 12 15:42:25 2010 +0200
@@ -23,6 +23,7 @@
#include <mpxmedia.h>
#include <mpxmediaarray.h>
#include <mpxmediageneraldefs.h>
+#include <mpxmediamusicdefs.h>
#include "mpxdbcommonutil.h"
#include "mpxcollectiondbdef.h"
@@ -300,6 +301,13 @@
} // end case
} // end switch
} // end for
+ if ( aMedia.IsSupported( KMPXMediaMusicAlbumArtChanged ) )
+ {
+ if ( aMedia.ValueTObjectL<TInt>( KMPXMediaMusicAlbumArtChanged )== 1 )
+ {
+ aUpdated = ETrue;
+ }
+ }
}
CleanupStack::PopAndDestroy(&recordset);
--- a/mpxplugins/viewplugins/inc/mpxmetadataeditordialog.h Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/viewplugins/inc/mpxmetadataeditordialog.h Fri Mar 12 15:42:25 2010 +0200
@@ -398,7 +398,20 @@
void MakeRestrictedDrmItemsL(
HBufC* aRights, TInt& aCurrentIndex,
CDesCArrayFlat* aHeadingsArray, CDesCArrayFlat* aDataArray );
+
+
+ /**
+ * Populates file details window for songs
+ */
+ void PopulateFileDetailsL();
+
+ /**
+ * Populates file details window for podcasts
+ */
+ void PopulatePodcastFileDetailsL();
+
+
/**
* Add parts Of time.
* @param aIntYrs year information
--- a/mpxplugins/viewplugins/views/albumarteditordialog/src/mpxalbumarteditordialog.cpp Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/viewplugins/views/albumarteditordialog/src/mpxalbumarteditordialog.cpp Fri Mar 12 15:42:25 2010 +0200
@@ -761,6 +761,8 @@
media->SetTextValueL(
KMPXMediaMusicAlbumArtFileName, aFileName );
+ media->SetTObjectValueL<TInt>(
+ KMPXMediaMusicAlbumArtChanged, 1 );
}
else // Broken link, cannot ben saved
--- a/mpxplugins/viewplugins/views/collectionviewhg/data/mpxcollectionviewhg.rss Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/viewplugins/views/collectionviewhg/data/mpxcollectionviewhg.rss Fri Mar 12 15:42:25 2010 +0200
@@ -155,9 +155,9 @@
},
MENU_ITEM
{
- command = EMPXCmdGoToAllSongs;
- txt = "Songs";
- },
+ command = EMPXCmdCreatePlaylist;
+ txt = qtn_mg_options_create_new_pl;
+ },
MENU_ITEM
{
command = EMPXCmdGoToArtistAlbums;
@@ -165,32 +165,51 @@
},
MENU_ITEM
{
+ command = EMPXCmdGoToAllSongs;
+ txt = "Songs";
+ },
+ MENU_ITEM
+ {
command = EMPXCmdGoToPlaylists;
txt = "Playlists";
},
MENU_ITEM
{
+ command = EMPXCmdGoToGenre;
+ txt = "Sort by genre";
+ },
+ MENU_ITEM
+ {
command = EMPXCmdGoToPodcasts;
txt = "Podcasts";
},
MENU_ITEM
{
- command = EMPXCmdGoToGenre;
- txt = "Sort by genre";
- },
+ command = EMPXCmdGoToMusicShop;
+ txt = qtn_nmp_options_go_to_shop;
+ },
+ MENU_ITEM
+ {
+ command = EMPXCmdGoToMultipleMusicShop;
+ txt = qtn_nmp_options_go_to_shop;
+ cascade = r_mpx_playback_collection_musicshop_sub_menu;
+ },
+ MENU_ITEM
+ {
+ command = EMPXCmdMusicLibraryDetails;
+ txt = qtn_mus_options_details_library;
+ },
MENU_ITEM
{
command = EMPXCmdRefreshLibrary;
txt = qtn_mus_options_update_collection1;
},
-#ifdef SINGLE_CLICK_INCLUDED
MENU_ITEM
{
command = EMPXCmdPlayItem;
txt = "Play";
flags = EEikMenuItemSpecific;
},
-#endif
MENU_ITEM
{
command = EMPXCmdFind;
@@ -198,17 +217,10 @@
},
MENU_ITEM
{
- command = EMPXCmdCreatePlaylist;
- txt = qtn_mg_options_create_new_pl;
- },
- MENU_ITEM
- {
command = EMPXCmdAddToPlaylist;
txt = qtn_mus_options_add_to_pl;
cascade = r_mpx_add_to_pl_sub_menu;
-#ifdef SINGLE_CLICK_INCLUDED
flags = EEikMenuItemSpecificListQuery;
-#endif
},
MENU_ITEM
{
@@ -230,9 +242,7 @@
{
command = EMPXCmdSend;
txt = qtn_options_send_via;
-#ifdef SINGLE_CLICK_INCLUDED
flags = EEikMenuItemSpecific;
-#endif
},
MENU_ITEM
{
@@ -243,17 +253,13 @@
{
command = EMPXCmdDelete;
txt = qtn_mus_options_delete;
-#ifdef SINGLE_CLICK_INCLUDED
flags = EEikMenuItemSpecific;
-#endif
},
MENU_ITEM
{
command = EMPXCmdRemove;
txt = qtn_mp_options_remove;
-#ifdef SINGLE_CLICK_INCLUDED
flags = EEikMenuItemSpecific;
-#endif
}
};
}
@@ -272,25 +278,19 @@
command = EMPXCmdUseAsCascade;
txt = qtn_mus_options_use_tone_as;
cascade = r_mpx_use_as_cascade;
-#ifdef SINGLE_CLICK_INCLUDED
flags = EEikMenuItemSpecificListQuery;
-#endif
},
MENU_ITEM
{
command = EMPXCmdSongDetails;
txt = qtn_mus_options_details_track;
-#ifdef SINGLE_CLICK_INCLUDED
flags = EEikMenuItemSpecific;
-#endif
},
MENU_ITEM
{
command = EMPXCmdRename;
txt = qtn_nmp_options_rename;
-#ifdef SINGLE_CLICK_INCLUDED
flags = EEikMenuItemSpecific;
-#endif
},
MENU_ITEM
{
@@ -301,14 +301,13 @@
{
command = EMPXCmdFindInMusicShop;
txt = qtn_nmp_find_in_musicshop;
-#ifdef SINGLE_CLICK_INCLUDED
flags = EEikMenuItemSpecific;
-#endif
},
MENU_ITEM
{
command = EMPXCmdPlaylistDetails;
txt = qtn_mus_options_details_pl;
+ flags = EEikMenuItemSpecific;
},
MENU_ITEM
{
--- a/mpxplugins/viewplugins/views/collectionviewhg/group/mpxcollectionviewhg.mmp Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/viewplugins/views/collectionviewhg/group/mpxcollectionviewhg.mmp Fri Mar 12 15:42:25 2010 +0200
@@ -37,9 +37,7 @@
MACRO __ENABLE_PODCAST_IN_MUSIC_MENU
#define __ENABLE_PODCAST_IN_MUSIC_MENU
MACRO __HG_COLLECTIONVIEW
-#ifdef IAD_INCLUDE_SINGLE_CLICK
-MACRO SINGLE_CLICK_INCLUDED
-#endif
+
SOURCEPATH ../src
SOURCE mpxcollectionviewhg.cpp
@@ -48,6 +46,7 @@
SOURCE mpxcollectionviewhglistboxarray.cpp
SOURCE mpxcollectionviewhgplaylisthelper.cpp
SOURCE mpxcollectionviewhgtnloader.cpp
+SOURCE mpxpopuplist.cpp
START RESOURCE ../data/mpxcollectionviewhg.rss
HEADER
@@ -115,6 +114,12 @@
LIBRARY aknskinsrv.lib
LIBRARY bitgdi.lib
+// Transition libs
+LIBRARY gfxtrans.lib
+
+ALWAYS_BUILD_AS_ARM
+OPTION ARMCC -O3 -Otime
+
#if defined(ARMCC)
deffile ../eabi/
#elif defined(WINSCW)
--- a/mpxplugins/viewplugins/views/collectionviewhg/inc/mpxcollectionviewhg.hrh Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/viewplugins/views/collectionviewhg/inc/mpxcollectionviewhg.hrh Fri Mar 12 15:42:25 2010 +0200
@@ -76,9 +76,7 @@
#ifdef __ENABLE_PODCAST_IN_MUSIC_MENU
,EMPXCmdRefreshLibrary
#endif
-#ifdef SINGLE_CLICK_INCLUDED
,EMPXCmdPlayItem
-#endif
};
--- a/mpxplugins/viewplugins/views/collectionviewhg/inc/mpxcollectionviewhgcontainer.h Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/viewplugins/views/collectionviewhg/inc/mpxcollectionviewhgcontainer.h Fri Mar 12 15:42:25 2010 +0200
@@ -53,6 +53,7 @@
class MMpxCbaHandler;
class TAknsItemID;
class CAsyncOneShot;
+class MMPXSelectedAlbumHandler;
// CLASS DECLARATION
@@ -87,6 +88,7 @@
static CMPXCollectionViewHgContainer* NewL(
MEikCommandObserver* aView,
MEikListBoxObserver* aObserver,
+ MMPXSelectedAlbumHandler* aSelectedAlbumHandler,
TBool aIsEmbedded );
/**
@@ -549,7 +551,25 @@
* @return ETrue if current view is TBoneview, EFalse otherwise
*/
TBool IsTBoneView();
-
+
+ TBool OfferCommandL(TInt aCommand);
+
+ /**
+ * Records begin state for the transition animation.
+ *
+ * @param aPrevViewWasPlayback ETrue if previous view was playback.
+ * This information used to decide animation direction.
+ */
+ void BeginFullScreenAnimation( TBool aPrevViewWasPlayback = EFalse );
+
+ /**
+ * Set the previous view Uid
+ *
+ * @param aViewUid UId of the previous view.
+ */
+ void SetPreviousViewId(TUid aViewUid);
+
+
private:
/**
@@ -558,6 +578,7 @@
CMPXCollectionViewHgContainer(
MEikCommandObserver* aView,
MEikListBoxObserver* aObserver,
+ MMPXSelectedAlbumHandler* aSelectedAlbumHandler,
TBool aIsEmbedded);
/**
@@ -659,47 +680,201 @@
void CleanAlbumArtReqQueue();
/**
- * Handle requests in visible area
+ * Handle data providing in requests in visible area
* @param aBufferStart the starting buffer index
* @param aBufferEnd the ending buffer index
*/
void ProvideDataIntersectL(TInt aBufferStart, TInt aBufferEnd);
/**
- * Refresh list as needed
+ * Handle data providing in requests in non visible area
* @param aBufferStart the starting buffer index
* @param aBufferEnd the ending buffer index
*/
void ProvideDataDifferenceL(TInt aBufferStart, TInt aBufferEnd);
+
+ /**
+ * Provide data without providing thumbnails to list
+ * @param aMediaArray the media array to pull data from
+ * @param aStartIndex the starting index index
+ */
void ProvideDataWithoutThumbnailsL(const CMPXMediaArray& aMediaArray, TInt aStartIndex = 0);
+
+ /**
+ * Provide data without providing thumbnails to media wall
+ * @param aMediaArray the media array to pull data from
+ * @param aStartIndex the starting index index
+ */
void ProvideDataWithoutThumbnailsMwL(const CMPXMediaArray& aMediaArray, TInt aStartIndex = 0);
+
+ /**
+ * Handle data providing in specified range.
+ * @param aBufferStart the starting buffer index
+ * @param aBufferEnd the ending buffer index
+ */
void ProvideDataForRangeL( TInt aBufferStart, TInt aBufferEnd );
+ /**
+ * Prepare media wall to be shown
+ * @param aMediaArray the media array to pull data from
+ * @param aCount Number of items in media wall
+ */
void PrepareMediaWallL(const CMPXMediaArray& aMediaArray, TInt aCount);
+
+ /**
+ * Prepare TBone view to be shown
+ * @param aMediaArray the media array to pull data from
+ * @param aCount Number of items in media wall portion of tbone.
+ */
void PrepareMediaWallWithListL(const CMPXMediaArray& aMediaArray, TInt aCount);
+
+ /**
+ * Prepare list to be shown
+ * @param aMediaArray the media array to pull data from
+ * @param aCount Number of items in list
+ */
void PrepareListL(const CMPXMediaArray& aMediaArray, TInt aCount);
+
+ /**
+ * Handle list resizing
+ * @param aMediaArray the media array to pull data from
+ * @param aCount Number of items in list
+ */
void ResizeListL(const CMPXMediaArray& aMediaArray, TInt aCount);
+ /**
+ * Get the current list instance
+ * @param aIndex Index from list control
+ * @return Instance of scroller object
+ */
CHgScroller* CurrentListWidget();
+
+ /**
+ * Resolve the type of view based on current browsing context
+ */
void ResolveCurrentViewType();
+
+ /**
+ * Clean up the previous view's resources.
+ */
void CleanPrevView();
+ /**
+ * Initiate shuffle play all operation
+ * @return ETrue if shuffle operation is started.
+ */
TBool ShufflePlayAllL(TInt aIndex);
+
+ /**
+ * Update the collection path and open it to start playback.
+ * @param aIndex The selected media array index to start playing.
+ * @param aSelectAll Indicate if all items should be selected.
+ */
void UpdatePathAndOpenL(TInt aIndex, TBool aSelectAll = EFalse);
+
+ /**
+ * Construct a collection path with the current selection and
+ * construct a playlist from path to start playback.
+ * @param aResults The media results from find operation.
+ */
void UpdatePathAndOpenPlaylistL( const CMPXMedia& aResults );
+
+ /**
+ * Find songs belonging to album.
+ * @param aIndex Index in media array of albums
+ */
void FindAlbumSongsL(TInt aIndex);
+
+ /**
+ * Find songs belonging to playlist.
+ * @param aIndex Index in media array of playlists
+ */
void FindPlaylistSongsL(TInt aIndex);
+
+ /**
+ * Find songs belonging to genre.
+ * @param aIndex Index in media array of genres
+ */
void FindGenreSongsL(TInt aIndex);
+
+ /**
+ * Check if the currently playing track is in path
+ * @param aPath Collection path of playlist
+ * @return ETrue if current track is playing
+ */
TBool IsPlayingCurrentIndexL(CMPXCollectionPath* aPath);
- void ShowAlbumSongsDialogL( const CMPXMedia& aResults );
+
+ /**
+ * Show list of songs in an album in a dialog popup.
+ * @param aAlbum Album container with list of songs
+ */
+ void ShowAlbumSongsDialogL( const CMPXMedia& aAlbum );
+
+ /**
+ * Show list of songs in an album
+ * @param aAlbum Album container with list of songs
+ */
void ShowAlbumSongsL( const CMPXMedia& aAlbum );
+
+ /**
+ * Open the album to show its contents
+ * @param aIndex Index of the album in media array
+ */
void OpenAlbumL(TInt aIndex);
+
+ /**
+ * Play the album
+ * @param aIndex Index of the album in media array
+ */
void PlayAlbumL(TInt aIndex);
+
+ /**
+ * Play the playlist
+ * @param aIndex Index of the album in media array
+ */
void PlayPlaylistL(TInt aIndex);
+
+ /**
+ * Play the genre
+ * @param aIndex Index of the album in media array
+ */
void PlayGenreL(TInt aIndex);
static TInt AsyncCallback( TAny* aPtr );
-
+
+ /**
+ * Prepare to show the TBone view.
+ */
+ void PrepareTboneViewL();
+
+ /**
+ * Check if shuffle item is present in the view.
+ * @return ETrue if shuffle item is present.
+ */
+ TBool ShuffleItemPresent();
+
+ /**
+ * Mapping function to convert from list index to media index.
+ * @param aIndex Index from list control
+ * @return media array index
+ */
+ TInt MediaIndex(TInt aIndex) const;
+
+ /**
+ * Load and set empty text.
+ */
+ void LoadAndSetEmptyTextL();
+
+ /**
+ * End fullscreen animation effects.
+ */
+ void EndFullScreenAnimation();
+
+ /**
+ * Resolve popup list rectangle size.
+ */
+ void ResolvePopupListSizeL();
+
private: // data member
/**
@@ -743,7 +918,7 @@
enum TViewType
{
EMPXViewUnknown,
- EMPXViewCoverFlow,
+ EMPXViewMediawall,
EMPXViewList,
EMPXViewTBone
};
@@ -814,6 +989,7 @@
TInt iAlbumIndex; // opened album index in mediawall
TInt iSelectedAlbumIndex; // selected album index in mediawall
TInt iRestoredAlbumIndex; // restored selected album index
+ MMPXSelectedAlbumHandler* iSelectedAlbumHandler;
TBool iDefaultIconSet;
MMpxCbaHandler* iCbaHandler;
TViewType iCurrentViewType;
@@ -822,6 +998,13 @@
TBool iIsForeground;
TBool iDelayedControlCreation;
CAsyncCallBack* iAsyncCallBack;
+ TBool iOpenAlbumTracks;
+ TInt iShuffleItem;
+ TBool iSetEmptyTextNeeded;
+ TTransitionType iTranstionType;
+ TBool iLayoutSwitch;
+ TRect iPopupListRect;
+ TUid iPreviousViewId;
};
#endif // CMPXCOLLECTIONVIEWHGCONTAINER_H
--- a/mpxplugins/viewplugins/views/collectionviewhg/inc/mpxcollectionviewhgimp.h Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/viewplugins/views/collectionviewhg/inc/mpxcollectionviewhgimp.h Fri Mar 12 15:42:25 2010 +0200
@@ -36,6 +36,7 @@
#include "mpxcollectionviewhg.h"
#include "mpxplaybackframeworkdefs.h" // TMPXPlaybackPlayerType
#include "mpxwaitnotedefs.h"
+#include "mpxselectedalbumhandler.h"
// FORWARD DECLARATIONS
class CAiwGenericParamList;
@@ -83,7 +84,8 @@
public MMPXViewActivationObserver,
public MCoeViewDeactivationObserver,
public MCoeViewActivationObserver,
- public MMpxCbaHandler
+ public MMpxCbaHandler,
+ public MMPXSelectedAlbumHandler
{
public:
@@ -115,6 +117,20 @@
*/
void LaunchMusicShopL();
+ /**
+ * Saves selected album.
+ *
+ * @param aMedia Album to be stored
+ */
+ void SaveSelectedAlbum (CMPXMedia &aMedia);
+
+ /**
+ * Restores selected album.
+ *
+ * @return media of restored album
+ */
+ const CMPXMedia* RestoreSelectedAlbum ();
+
private:
@@ -163,11 +179,6 @@
void HandleError( TInt aError );
/**
- * Updates the navi pane
- */
- void UpdateNaviPaneL();
-
- /**
* Updates the title pane
*/
void UpdateTitlePaneL();
@@ -842,8 +853,14 @@
void ChangeCbaVisibility( TBool aVisible );
void UpdateCba();
-
+
+ TBool NowPlayingOptionVisibilityL();
void HandleInitMusicMenuPaneL(CEikMenuPane* aMenuPane );
+ void DynInitMenuPaneAlbumL(TInt aResourceId, CEikMenuPane* aMenuPane );
+ void DynInitMenuPanePlaylistL(TInt aResourceId, CEikMenuPane* aMenuPane );
+ void DynInitMenuPaneGenreL(TInt aResourceId, CEikMenuPane* aMenuPane );
+ void DynInitMenuPaneSongsL(TInt aResourceId, CEikMenuPane* aMenuPane );
+ void DynInitMenuPanePlaylistSongsL(TInt aResourceId, CEikMenuPane* aMenuPane );
void OpenAllSongsL();
void OpenArtistAlbumsL();
@@ -851,8 +868,6 @@
void OpenGenreL();
void OpenPodcastsL();
- static TInt IADCheckTimerCallBack(TAny* aHgViewObject); //directly called
- void StartCheckingforIADUpdates(); //indirectly called
private: // Data
@@ -906,10 +921,6 @@
TInt iCachedCommand; // for incremental open
CListBoxView::CSelectionIndexArray* iCachedSelectionIndex;
- CAknNavigationDecorator* iNaviDecorator;
- CAknNaviLabel* iNaviLabel;
- CAknNavigationControlContainer* iNaviPane;
-
CEikButtonGroupContainer* iCurrentCba;
CAknQueryDialog* iConfirmationDlg;
@@ -980,8 +991,7 @@
TBool iOpeningNote; // Waitnote is opening
TBool iMarkedAll;
TBool iFirstIncrementalBatch;
-
- CPeriodic* iTimer;
+ CMPXMedia *iStoredAlbum; // owned
};
#endif // C_CMPXCOLLECTIONVIEWHGIMP_H
--- a/mpxplugins/viewplugins/views/collectionviewhg/inc/mpxcollectionviewhgtnloader.h Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/viewplugins/views/collectionviewhg/inc/mpxcollectionviewhgtnloader.h Fri Mar 12 15:42:25 2010 +0200
@@ -53,6 +53,8 @@
void CancelThumb( TInt aIndex );
void CancelAll();
void SetSizeL( TThumbnailSize aSize );
+ void Pause( TTimeIntervalMicroSeconds32 aDelay );
+ void Resume();
private: // From MThumbnailManagerObserver
@@ -74,6 +76,8 @@
static TInt LoadThumbnail( TAny* aSelf );
void LoadNextTN();
+ static TInt ResumeCallback(TAny* aPtr);
+
private: // DATA
MMpxTNLoaderObserver& iObserver;
@@ -96,6 +100,8 @@
RPointerArray<TLoadingTN> iLoading; // Loading Thubmbs
CAsyncCallBack* iAsyncCallBack;
TThumbnailSize iSize;
+ TBool iPaused;
+ CPeriodic* iPauseTimer;
};
#endif // MPXCOLLECTIONVIEWHGTNLOADER_H_
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mpxplugins/viewplugins/views/collectionviewhg/inc/mpxpopuplist.h Fri Mar 12 15:42:25 2010 +0200
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: MPX popuplist
+*
+*/
+
+
+
+#ifndef CMPXPOPUPLIST_H
+#define CMPXPOPUPLIST_H
+
+
+// INCLUDES
+
+#include <aknlists.h>
+#include <aknPopup.h>
+
+// CLASS DECLARATION
+
+/**
+ * Wrapper class for avkon popuplist.
+ *
+ * @lib mpxcollectionviewhg.lib
+ * @since S60 v5.0
+ */
+NONSHARABLE_CLASS( CMpxPopupList ) : public CAknPopupList
+ {
+public:
+
+ static CMpxPopupList* NewL(
+ CEikListBox* aListBox,
+ TInt aCbaResource,
+ AknPopupLayouts::TAknPopupLayouts aType = AknPopupLayouts::EMenuWindow );
+
+ TRect LayoutRect();
+
+ virtual ~CMpxPopupList();
+
+protected:
+ CMpxPopupList();
+
+ };
+#endif // CMPXPOPUPLIST_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mpxplugins/viewplugins/views/collectionviewhg/inc/mpxselectedalbumhandler.h Fri Mar 12 15:42:25 2010 +0200
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Selected album handler
+*
+*/
+
+#ifndef MPXSELECTEDALBUMHANDLER_H_
+#define MPXSELECTEDALBUMHANDLER_H_
+
+class CMPXMedia;
+
+
+NONSHARABLE_CLASS (MMPXSelectedAlbumHandler)
+ {
+public:
+
+ /**
+ * Saves selected album.
+ *
+ * @since S60 5.2
+ * @param aMedia Album to be stored
+ */
+ virtual void SaveSelectedAlbum (CMPXMedia &aMedia) = 0;
+
+ /**
+ * Restores selected album.
+ *
+ * @since S60 5.2
+ * @param aMedia Album to be restored
+ */
+ virtual const CMPXMedia* RestoreSelectedAlbum () = 0;
+ };
+
+
+#endif // MPXSELECTEDALBUMHANDLER_H_
+
+// End of File
--- a/mpxplugins/viewplugins/views/collectionviewhg/src/mpxcollectionviewhgcontainer.cpp Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/viewplugins/views/collectionviewhg/src/mpxcollectionviewhgcontainer.cpp Fri Mar 12 15:42:25 2010 +0200
@@ -55,6 +55,7 @@
#include <mpxcollectionviewhg.rsg>
#include <mpxcollectionviewhg.mbg>
#include <mpxappui.hrh>
+#include <mpxmusicplayerviewplugin.hrh>
#include <ganes/HgDoubleGraphicListFlat.h>
#include <ganes/HgSingleGraphicList.h>
@@ -65,6 +66,8 @@
#include <ganes/HgVgMediaWall.h>
#include <layoutmetadata.cdl.h>
+#include <akntranseffect.h> // For transition effects
+#include <gfxtranseffect\gfxtranseffect.h> // For transition effects
#include "mpxcommoncontainer.hrh"
#include "mpxcollectionviewhg.hrh"
@@ -74,6 +77,8 @@
#include "mpxcollectionviewhgplaylisthelper.h"
#include "mpxcollectionviewhgtnloader.h"
#include "mpxcbahandler.h"
+#include "mpxselectedalbumhandler.h"
+#include "mpxpopuplist.h"
// CONSTANTS
_LIT( KMPXCollectionViewRscPath, "mpxcollectionviewhg.rsc" );
@@ -96,6 +101,8 @@
const TInt KMPXMaxFileLength = 256;
const TReal KIconFactor = 0.7;
+const TInt KThumbLoadingPauseForTransition(500000);
+
_LIT( KMPXDash, " - " );
#ifdef HG_MP_LOC_AVAILABLE
_LIT( KMPXSpace, " ");
@@ -111,9 +118,6 @@
_LIT( KSongDash, " song - " );
_LIT( KSongsDash, " songs - " );
-_LIT( KMPXDriveC, "c:" );
-_LIT( KMPXSelectedAlbumItemFileName, "mpxalbumitem.dat");
-
// ======== MEMBER FUNCTIONS ========
// ---------------------------------------------------------------------------
@@ -123,11 +127,13 @@
CMPXCollectionViewHgContainer* CMPXCollectionViewHgContainer::NewL(
MEikCommandObserver* aView,
MEikListBoxObserver* aObserver,
+ MMPXSelectedAlbumHandler* aSelectedAlbumHandler,
TBool aIsEmbedded)
{
MPX_FUNC( "CMPXCollectionViewHgContainer::NewL" );
CMPXCollectionViewHgContainer* self =
- new ( ELeave ) CMPXCollectionViewHgContainer(aView, aObserver, aIsEmbedded);
+ new ( ELeave ) CMPXCollectionViewHgContainer(
+ aView, aObserver, aSelectedAlbumHandler, aIsEmbedded);
CleanupStack::PushL( self );
self->ConstructL();
CleanupStack::Pop( self );
@@ -141,6 +147,7 @@
CMPXCollectionViewHgContainer::CMPXCollectionViewHgContainer(
MEikCommandObserver* aView,
MEikListBoxObserver* aObserver,
+ MMPXSelectedAlbumHandler* aSelectedAlbumHandler,
TBool aIsEmbedded) :
iView( aView ),
iListBoxObserver( aObserver ),
@@ -152,7 +159,13 @@
iBottomIndex( KErrNotFound ),
iAlbumIndex(KErrNotFound),
iSelectedAlbumIndex(KErrNotFound),
- iRestoredAlbumIndex(KErrNotFound)
+ iRestoredAlbumIndex(KErrNotFound),
+ iSelectedAlbumHandler (aSelectedAlbumHandler),
+ iOpenAlbumTracks(EFalse),
+ iShuffleItem(0),
+ iSetEmptyTextNeeded(EFalse),
+ iPopupListRect(TRect(0,0,0,0)),
+ iPreviousViewId(TUid::Uid(0))
{
}
@@ -250,13 +263,6 @@
iThumbnailManager = CMpxTNLoader::NewL( *this, EAudioListThumbnailSize );
iImageSize = CHgDoubleGraphicListFlat::PreferredImageSize();
-
- TFileName pathWithoutDrive;
- iEikonEnv->FsSession().PrivatePath( pathWithoutDrive );
- iSelectedAlbumItemFileName.Copy( KMPXDriveC );
- iSelectedAlbumItemFileName.Append( pathWithoutDrive );
- iSelectedAlbumItemFileName.Append( KMPXSelectedAlbumItemFileName );
-
iListBoxArray = static_cast<CMPXCollectionViewListBoxArray*>(
CreateListBoxArrayL() );
@@ -269,6 +275,8 @@
iAsyncCallBack = new (ELeave) CAsyncCallBack( CActive::EPriorityStandard );
iAsyncCallBack->Set(callback);
+ GfxTransEffect::Enable();
+
CreateWindowL();
ActivateL();
}
@@ -714,7 +722,7 @@
iIconArray = NULL;
CreateIconArrayL();
- if( iCurrentViewType == EMPXViewCoverFlow || iCurrentViewType == EMPXViewTBone )
+ if( iCurrentViewType == EMPXViewMediawall || iCurrentViewType == EMPXViewTBone )
{
iMediaWall->SetDefaultIconL(NULL);
iMediaWall->EnableScrollBufferL(*this, KMPXListBufferSize, KMPXListBufferSize/4);
@@ -732,29 +740,25 @@
}
else if ( aType == KEikDynamicLayoutVariantSwitch )
{
- if ( iCurrentViewType == EMPXViewCoverFlow )
+ if ( iCurrentViewType == EMPXViewMediawall )
{
if ( iDialog )
{
iDialog->CancelPopup();
- iDialog = NULL;
}
}
- if( iCurrentViewType == EMPXViewTBone )
- {
- iCollectionUtility->Collection().BackL();
- }
- else
+ iSetEmptyTextNeeded = ETrue;
+
+ // Coe env is in middle if notifying observers (controls).
+ // Just to be safe, lets just create a small async callback and then
+ // call HandleLbxItemAdditionL
+ if( !iAsyncCallBack->IsActive() )
{
- // Coe env is in middle if notifying observers (controls).
- // Just to be save, lets just create a small async callback and then
- // call HandleLbxItemAdditionL
- if( !iAsyncCallBack->IsActive() )
- {
- iAsyncCallBack->CallBack();
- }
+ iAsyncCallBack->CallBack();
}
+ iLayoutSwitch = ETrue;
+
if( iCbaHandler )
iCbaHandler->UpdateCba();
@@ -763,6 +767,12 @@
iBgContext->SetRect(((CAknAppUi*)iCoeEnv->AppUi())->ApplicationRect());
}
);
+ if(iMediaWall)
+ iMediaWall->HandleResourceChange( aType );
+ if(iListWidget)
+ iListWidget->HandleResourceChange( aType );
+ if(iMwListWidget)
+ iMwListWidget->HandleResourceChange( aType );
}
@@ -791,7 +801,7 @@
{
switch( iCurrentViewType )
{
- case EMPXViewCoverFlow:
+ case EMPXViewMediawall:
case EMPXViewTBone:
{
return iMediaWall->InputCapabilities();
@@ -911,7 +921,7 @@
switch( iCurrentViewType )
{
- case EMPXViewCoverFlow:
+ case EMPXViewMediawall:
case EMPXViewTBone:
{
count = iMediaWall->ItemCount();
@@ -984,15 +994,15 @@
switch( iCurrentViewType )
{
- case EMPXViewCoverFlow:
+ case EMPXViewMediawall:
case EMPXViewTBone:
{
- index = iMediaWall->SelectedIndex();
+ index = MediaIndex(iMediaWall->SelectedIndex());
break;
}
case EMPXViewList:
{
- index = iListWidget->SelectedIndex();
+ index = MediaIndex(iListWidget->SelectedIndex());
break;
}
default:
@@ -1129,11 +1139,12 @@
CHgScroller* list = CurrentListWidget();
- if( list && aIndex < list->ItemCount() )
+ TInt listIndex = aIndex + iShuffleItem;
+ if( list && listIndex < list->ItemCount() )
{
- CHgItem* item = &list->ItemL(aIndex);
+ CHgItem* item = &list->ItemL(listIndex);
SetDetailIndicatorL(item, aIndex);
- list->RefreshScreen(aIndex);
+ list->RefreshScreen(listIndex);
}
}
@@ -1156,25 +1167,44 @@
{
MPX_FUNC( "CMPXCollectionViewHgContainer::HandleLbxItemAdditionL" );
SetCollectionContextL();
+
+ // When the collection is reopened after coming from playback view,
+ // it is reopened in Album-Tracks level (EContextItemAlbum).
+ // We don't display its content in that context but inturn reopen the
+ // collection at one level up (Albums) and display it in T-bone view.
+ // T-Bone view is just a list of albums presented differently.
+ if ( iContext == EContextItemAlbum )
+ {
+ iCollectionUtility->Collection().BackL();
+ iOpenAlbumTracks = ETrue;
+ return;
+ }
+
iLastValidMediaItemIndex = 0;
const CMPXMediaArray& mediaArray = iListBoxArray->MediaArray();
- const TInt count( mediaArray.Count() );
+ TInt count( mediaArray.Count() );
MPX_DEBUG2( "CMPXCollectionViewHgContainer::HandleLbxItemAdditionL count=%d", count);
+
HandleLbxItemRemovalL();
+ TViewType prevViewType = iCurrentViewType;
+ ResolveCurrentViewType();
iThumbnailReqMap.Reset();
- iThumbnailReqMap.ReserveL(count);
- for ( TInt i = 0; i < count; i++ )
+ if (ShuffleItemPresent())
+ iShuffleItem = 1;
+ else
+ iShuffleItem = 0;
+
+ count = count + iShuffleItem;
+ iThumbnailReqMap.ReserveL(count );
+ for ( TInt i = 0; i < count ; i++ )
{
iThumbnailReqMap.Append( EFalse );
}
iThumbnailManager->CancelAll();
- TViewType prevViewType = iCurrentViewType;
- ResolveCurrentViewType();
-
if( prevViewType == iCurrentViewType && iContext == iPrevContext )
{
ResizeListL( mediaArray, count );
@@ -1183,45 +1213,67 @@
{
// MediaWall sets the default icon in the construction phase.
iDefaultIconSet = EFalse;
+
+ if( !iLayoutSwitch )
+ {
+ // We only need to use this for one transition coming
+ // from playback view.
+ TBool pbv = (iPreviousViewId == TUid::Uid(KMPXPluginTypePlaybackUid)) ? ETrue : EFalse;
+ if ( pbv )
+ {
+ iPreviousViewId = TUid::Uid(0);
+ }
+ BeginFullScreenAnimation( pbv );
+ }
+
switch (iCurrentViewType)
{
- case EMPXViewCoverFlow:
+ case EMPXViewMediawall:
{
TMPXPlaybackState pbState( iPlaybackUtility->StateL() );
if ( pbState == EPbStatePlaying || pbState == EPbStatePaused )
RestoreSelectedAlbumItemL(mediaArray);
PrepareMediaWallL(mediaArray, count);
+ iOpenAlbumTracks = EFalse;
break;
}
case EMPXViewTBone:
{
RestoreSelectedAlbumItemL(mediaArray);
PrepareMediaWallWithListL( mediaArray, count );
+ // We need to adjust the CBA for this view.
+ if( iCbaHandler )
+ iCbaHandler->UpdateCba();
break;
}
case EMPXViewList:
{
PrepareListL(mediaArray, count);
+ iOpenAlbumTracks = EFalse;
break;
}
default:
User::Leave( KErrGeneral );
break;
}
-
}
DrawableWindow()->SetOrdinalPosition( -1 );
CleanPrevView();
-
iPrevViewType = iCurrentViewType;
iPrevContext = iContext;
+ if ( iSetEmptyTextNeeded )
+ {
+ LoadAndSetEmptyTextL();
+ iSetEmptyTextNeeded = EFalse;
+ }
if( !iDefaultIconSet )
{
SetDefaultIconL();
}
+ iLayoutSwitch = EFalse;
}
// -----------------------------------------------------------------------------
@@ -1434,7 +1486,10 @@
ProvideDataWithoutThumbnailsMwL(aMediaArray);
index = index >= 0 ? index : 0;
iMediaWall->SetSelectedIndex( index );
- OpenAlbumL( index );
+ if ( iCurrentViewType == EMPXViewTBone )
+ {
+ OpenAlbumL( index );
+ }
}
else
{
@@ -1487,13 +1542,13 @@
if( iContext == EContextGroupAlbum ||
iContext == EContextGroupArtist ||
iContext == EContextGroupSong ||
- iContext == EContextItemPlaylist ||
- iContext == EContextGroupGenre )
+ iContext == EContextItemPlaylist )
{
iListWidget->EnableScrollBufferL(*this, KMPXListBufferSize, KMPXListBufferSize/4);
}
else
{
+ EndFullScreenAnimation();
iListWidget->RefreshScreen(0);
}
iDefaultIconSet = EFalse;
@@ -1533,7 +1588,7 @@
CHgVgMediaWall::EHgVgMediaWallStyleCoverflowTBonePortrait,
EFalse,
this,
- DefaultIconL() );
+ NULL );
if( !iIsForeground )
iMediaWall->HandleLosingForeground();
@@ -1575,20 +1630,33 @@
}
}
+ if( iTranstionType != EMPXTranstionNotDefined )
+ {
+ iMediaWall->SetFlags( CHgVgMediaWall::EHgVgMediaWallDrawToWindowGC );
+ }
+
+ iMediaWall->SetOpeningAnimationType( CHgVgMediaWall::EHgVgOpeningAnimationNone );
+
if ( iAlbumIndex == KErrNotFound )
{
iMediaWall->SetSelectedIndex( iRestoredAlbumIndex );
- iMediaWall->RefreshScreen(iRestoredAlbumIndex);
+ // If we are about to start a transition animation we should draw only
+ // when we have received first screen of thumbs in Refresh function.
+ if( iTranstionType == EMPXTranstionNotDefined )
+ iMediaWall->RefreshScreen(iRestoredAlbumIndex);
OpenAlbumL(iRestoredAlbumIndex);
}
else
{
iMediaWall->SetSelectedIndex( iAlbumIndex );
- iMediaWall->RefreshScreen(iAlbumIndex);
+ // If we are about to start a transition animation we should draw only
+ // when we have received first screen of thumbs in Refresh function.
+ if( iTranstionType == EMPXTranstionNotDefined )
+ iMediaWall->RefreshScreen(iAlbumIndex);
OpenAlbumL(iAlbumIndex);
}
iMwListWidget->RefreshScreen(0);
- iDefaultIconSet = ETrue;
+
}
// ----------------------------------------------------------------------------
@@ -1625,7 +1693,6 @@
iMediaWall->SetMopParent(this);
iMediaWall->SetSelectionObserver(*this);
iMediaWall->SetObserver( this ); // softkey visibility event observer
- iMediaWall->SetOpeningAnimationType( CHgVgMediaWall::EHgVgOpeningAnimationFlipToFront );
iMediaWall->EnableScrollBufferL(
*this,
KMPXListBufferSizeWithMediaWall,
@@ -1634,15 +1701,12 @@
iMediaWall->DrawableWindow()->SetOrdinalPosition( -1 );
ProvideDataWithoutThumbnailsMwL(aMediaArray);
if( iAlbumIndex == KErrNotFound )
- iMediaWall->SetSelectedIndex( iRestoredAlbumIndex );
+ iMediaWall->SetSelectedIndex( iRestoredAlbumIndex + iShuffleItem );
else
- iMediaWall->SetSelectedIndex( iAlbumIndex );
+ iMediaWall->SetSelectedIndex( iAlbumIndex + iShuffleItem );
}
else
{
- // TODO, do we need to refill the data or are the items same in fullscreen coverflow and tbone coverflow????
- // David: Yes because there will be an extra shuffle item in the coverflow list but not in tbone coverflow.
- // Index will be off.
if( iMediaWall->Style() != CHgVgMediaWall::EHgVgMediaWallStyleCoverflowFullScreen )
iMediaWall->ChangeStyleL( CHgVgMediaWall::EHgVgMediaWallStyleCoverflowFullScreen, appRect, ETrue );
@@ -1653,13 +1717,24 @@
KMPXListBufferSizeWithMediaWall,
KMPXListBufferSizeWithMediaWall / 4);
if( iAlbumIndex == KErrNotFound )
- iMediaWall->SetSelectedIndex( iRestoredAlbumIndex );
+ iMediaWall->SetSelectedIndex( iRestoredAlbumIndex + iShuffleItem );
else
- iMediaWall->SetSelectedIndex( iAlbumIndex );
-
- iMediaWall->DrawDeferred();
+ iMediaWall->SetSelectedIndex( iAlbumIndex + iShuffleItem );
}
+ if( iTranstionType != EMPXTranstionNotDefined )
+ {
+ iMediaWall->SetFlags( CHgVgMediaWall::EHgVgMediaWallDrawToWindowGC );
+ }
+
+ if( iPopupListRect == TRect(0,0,0,0) )
+ {
+ ResolvePopupListSizeL();
+ }
+
+ iMediaWall->SetOpenedItemRect( iPopupListRect );
+ iMediaWall->SetOpeningAnimationType( CHgVgMediaWall::EHgVgOpeningAnimationZoomToFront );
+
iDefaultIconSet = ETrue;
}
@@ -1737,17 +1812,29 @@
case EContextGroupAlbum:
{
if( landscapeOrientation )
- iCurrentViewType = EMPXViewCoverFlow;
+ iCurrentViewType = EMPXViewMediawall;
else
- iCurrentViewType = EMPXViewList;
+ {
+ // In case we want to display the albums in T-Bone view
+ // we change the view type and context appropriately.
+ if ( iOpenAlbumTracks )
+ {
+ iCurrentViewType = EMPXViewTBone;
+ iContext = EContextItemAlbum;
+ iOpenAlbumTracks = EFalse;
+ }
+ else
+ {
+ iCurrentViewType = EMPXViewList;
+ }
+ }
break;
}
case EContextItemAlbum:
case EContextItemArtist:
{
- // TODO, Change by Harri. Is this correct?
if( landscapeOrientation )
- iCurrentViewType = EMPXViewCoverFlow;
+ iCurrentViewType = EMPXViewMediawall;
else
iCurrentViewType = EMPXViewTBone;
break;
@@ -1768,7 +1855,7 @@
switch (iPrevViewType)
{
- case EMPXViewCoverFlow:
+ case EMPXViewMediawall:
{
if( iCurrentViewType != EMPXViewTBone )
{
@@ -1779,7 +1866,7 @@
}
case EMPXViewTBone:
{
- if( iCurrentViewType != EMPXViewCoverFlow )
+ if( iCurrentViewType != EMPXViewMediawall )
{
delete iMediaWall;
iMediaWall = 0;
@@ -1808,9 +1895,15 @@
MPX_FUNC( "CMPXCollectionViewHgContainer::IsSelectedItemASong" );
TBool res(EFalse);
- if ( iContext == EContextItemAlbum || iContext == EContextGroupSong )
+ if ( iContext == EContextItemAlbum ||
+ iContext == EContextGroupSong ||
+ iContext == EContextItemGenre )
{
CHgScroller* listWidget = CurrentListWidget();
+ if ( !listWidget )
+ {
+ return EFalse;
+ }
if ( listWidget->SelectedIndex() == 0 &&
listWidget->ItemCount() > 1 )
{
@@ -1839,6 +1932,7 @@
CHgScroller* listWidget = CurrentListWidget();
if (listWidget && songs)
{
+ // Tracks list may have a shuffle item inserted so account for that.
if (listWidget->ItemCount() > 1)
{
song = songs->AtL(listWidget->SelectedIndex()-1);
@@ -1862,40 +1956,22 @@
if( aCommand == EMPXCmdPlay )
{
- switch( iCurrentViewType )
+ if ( iContext == EContextGroupAlbum )
{
- case EMPXViewCoverFlow:
- case EMPXViewTBone:
- {
- iSelectedAlbumIndex = iMediaWall->SelectedIndex();
- SaveSelectedAlbumItemL(iSelectedAlbumIndex);
- // Open first song of album & playlist for entire album is created.
- UpdatePathAndOpenL(0, ETrue);
- break;
- }
- case EMPXViewList:
- {
- if ( iContext == EContextGroupAlbum )
- {
- iSelectedAlbumIndex = iListWidget->SelectedIndex();
- SaveSelectedAlbumItemL(iSelectedAlbumIndex);
- // Open first song of album & playlist for entire album is created.
- PlayAlbumL(iSelectedAlbumIndex);
- }
- else if ( iContext == EContextGroupPlaylist )
- {
- TInt index = iListWidget->SelectedIndex();
- PlayPlaylistL(index);
- }
- else if ( iContext == EContextGroupGenre )
- {
- TInt index = iListWidget->SelectedIndex();
- PlayGenreL(index);
- }
- break;
- }
- default:
- break;
+ iSelectedAlbumIndex = MediaIndex(iListWidget->SelectedIndex());
+ SaveSelectedAlbumItemL(iSelectedAlbumIndex);
+ // Open first song of album & playlist for entire album is created.
+ PlayAlbumL(iSelectedAlbumIndex);
+ }
+ else if ( iContext == EContextGroupPlaylist )
+ {
+ TInt index = MediaIndex(iListWidget->SelectedIndex());
+ PlayPlaylistL(index);
+ }
+ else if ( iContext == EContextGroupGenre )
+ {
+ TInt index = MediaIndex(iListWidget->SelectedIndex());
+ PlayGenreL(index);
}
}
}
@@ -1919,17 +1995,20 @@
void CMPXCollectionViewHgContainer::HandleSelectL( TInt aIndex, CCoeControl* aControl )
{
MPX_FUNC( "CMPXCollectionViewHgContainer::HandleSelect" );
- if( iCurrentViewType == EMPXViewTBone && iSelectedAlbumIndex != aIndex )
+
+ TInt index(MediaIndex(aIndex));
+
+ if( iCurrentViewType == EMPXViewTBone && iSelectedAlbumIndex != index )
{
if ( aControl == iMediaWall )
{
- iSelectedAlbumIndex = aIndex;
- OpenAlbumL(aIndex);
+ iSelectedAlbumIndex = index;
+ OpenAlbumL(index);
}
}
- else if( iCurrentViewType == EMPXViewCoverFlow )
+ else if( iCurrentViewType == EMPXViewMediawall )
{
- iSelectedAlbumIndex = aIndex;
+ iSelectedAlbumIndex = index;
}
}
@@ -1943,27 +2022,29 @@
{
MPX_FUNC( "CMPXCollectionViewHgContainer::HandleOpenL" );
- // Mod by harri, had to enable this block since ganes list components still
- // uses this version of the HandleOpen
+ TInt index(MediaIndex(aIndex));
+
+ // ganes list components still uses this version of the HandleOpen
if ( iContext == EContextItemAlbum )
{
SaveSelectedAlbumItemL(iSelectedAlbumIndex);
- UpdatePathAndOpenL(aIndex);
+ UpdatePathAndOpenL(index);
}
else if ( iContext == EContextGroupAlbum )
{
- SaveSelectedAlbumItemL(aIndex);
+ SaveSelectedAlbumItemL(index);
+ iAlbumIndex = index;
// Check if shuffle play all was selected.
- if (!ShufflePlayAllL(aIndex))
+ if (!ShufflePlayAllL(index))
{
// To open the selected album.
- iView->ProcessCommandL( EMPXCmdCommonEnterKey );
+ PrepareTboneViewL();
}
}
- else if ( iContext == EContextGroupSong || iContext == EContextItemPlaylist )
+ else if ( iContext == EContextGroupSong || iContext == EContextItemPlaylist || iContext == EContextItemGenre )
{
// Check if shuffle play all was selected.
- if (!ShufflePlayAllL(aIndex))
+ if (!ShufflePlayAllL(index))
{
// To open the selected album.
iView->ProcessCommandL( EMPXCmdCommonEnterKey );
@@ -1984,19 +2065,26 @@
{
MPX_FUNC( "CMPXCollectionViewHgContainer::HandleOpenL" );
- if( iContext == EContextGroupAlbum )
+ TInt index(MediaIndex(aIndex));
+
+ if( iContext == EContextGroupAlbum && index >= 0 )
{
- iAlbumIndex = aIndex;
- iSelectedAlbumIndex = aIndex;
- SaveSelectedAlbumItemL(aIndex);
+ iAlbumIndex = index;
+ iSelectedAlbumIndex = index;
+ SaveSelectedAlbumItemL(index);
}
if ( iContext == EContextItemAlbum )
{
+ if( iCurrentViewType == EMPXViewTBone )
+ {
+ iMediaWall->SetFlags( CHgVgMediaWall::EHgVgMediaWallDrawToWindowGC );
+ iMediaWall->DrawNow();
+ }
if ( aControl == iMediaWall )
{
// If album was opened, we will play all tracks in the album.
- SaveSelectedAlbumItemL(aIndex);
+ SaveSelectedAlbumItemL(index);
// Open first song of album & playlist for entire album is created.
UpdatePathAndOpenL(0, ETrue);
}
@@ -2005,7 +2093,7 @@
// If item in list was opened, we only play the selected one.
SaveSelectedAlbumItemL(iSelectedAlbumIndex);
// Open the selected song of album
- UpdatePathAndOpenL(aIndex);
+ UpdatePathAndOpenL(index);
}
}
else if ( iContext == EContextGroupAlbum )
@@ -2013,9 +2101,9 @@
if ( aControl == iMediaWall )
{
// Check if shuffle play all was selected.
- if (!ShufflePlayAllL(aIndex))
+ if (!ShufflePlayAllL(index))
{
- OpenAlbumL(aIndex);
+ OpenAlbumL(index);
}
}
}
@@ -2068,8 +2156,8 @@
if ( aBufferStart < 0 || aBufferEnd < 0 )
return;
- // TODO, add support for last valid media item index later
- if ( aBufferStart > iLastValidMediaItemIndex || aBufferEnd > iLastValidMediaItemIndex )
+ if ( aBufferStart - iShuffleItem > iLastValidMediaItemIndex ||
+ aBufferEnd - iShuffleItem > iLastValidMediaItemIndex )
{
// We cannot provide data for the requested range at this time.
// Remember the request so we can handle it when there's enough data.
@@ -2135,7 +2223,6 @@
firstOnScreen = iListWidget->FirstIndexOnScreen();
lastOnScreen = firstOnScreen + iListWidget->ItemsOnScreen();
}
- const CMPXMediaArray& mediaArray = iListBoxArray->MediaArray();
TInt startIndex = Max( firstOnScreen, aBufferStart );
TInt endIndex = Min( lastOnScreen, aBufferEnd );
@@ -2182,6 +2269,7 @@
void CMPXCollectionViewHgContainer::ProvideDataForRangeL( TInt aBufferStart, TInt aBufferEnd )
{
const CMPXMediaArray& mediaArray = iListBoxArray->MediaArray();
+ TInt index(0);
for( TInt i = aBufferStart; i <= aBufferEnd; i++ )
{
// Just get the exiting item and update the fields + icon.
@@ -2191,8 +2279,20 @@
else
item = &iListWidget->ItemL(i);
- CMPXMedia* currentMedia( mediaArray.AtL( i ) );
- AddThumbnailToDisplayedItemL( item, currentMedia, i );
+ index = MediaIndex(i);
+ if ( index >= 0 )
+ {
+ CMPXMedia* currentMedia( mediaArray.AtL( index ) );
+ AddThumbnailToDisplayedItemL( item, currentMedia, index );
+ }
+ else
+ {
+ if ( iCurrentViewType == EMPXViewMediawall ||
+ iCurrentViewType == EMPXViewList && (i-iShuffleItem) == -1 )
+ SetDetailIconShuffleL();
+ iThumbnailReqMap[i] = ETrue;
+ RefreshNoThumbnailL(i);
+ }
}
}
@@ -2206,6 +2306,12 @@
{
MPX_FUNC( "CMPXCollectionViewHgContainer::ProvideDataWithoutThumbnailsL" );
+ if ( ShuffleItemPresent() )
+ {
+ CHgItem* item = &iListWidget->ItemL(0);
+ SetShuffleItemTextL(item, NULL);
+ }
+
TInt mediaCount = aMediaArray.Count();
for ( TInt i = aStartIndex; i < mediaCount ; i++ )
@@ -2217,21 +2323,10 @@
{
break;
}
-
// Just get the exiting item and update the fields + icon.
- CHgItem* item = &iListWidget->ItemL(i);
-
- TBool shuffleItem(EFalse);
- if ( i == 0 )
- {
- shuffleItem = SetShuffleItemTextL(item, currentMedia);
- }
-
- if (!shuffleItem)
- {
- SetTitleL( item, currentMedia );
- AddDetailToDisplayedItemL( item, currentMedia, i );
- }
+ CHgItem* item = &iListWidget->ItemL(i+iShuffleItem);
+ SetTitleL( item, currentMedia );
+ AddDetailToDisplayedItemL( item, currentMedia, i );
iLastValidMediaItemIndex = i;
}
}
@@ -2246,11 +2341,16 @@
{
MPX_FUNC( "CMPXCollectionViewHgContainer::ProvideDataWithoutThumbnailsMwL" );
+ if ( ShuffleItemPresent() )
+ {
+ CHgVgItem* item = &iMediaWall->ItemL(0);
+ SetShuffleItemTextL(item, NULL);
+ }
+
TInt mediaCount = aMediaArray.Count();
for ( TInt i = aStartIndex; i < mediaCount ; i++ )
{
- // Just get the exiting item and update the fields + icon.
CMPXMedia* currentMedia( aMediaArray.AtL( i ) );
if ( currentMedia->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId ) ==
@@ -2258,21 +2358,11 @@
{
break;
}
-
// Just get the exiting item and update the fields + icon.
-
- CHgVgItem* item = &iMediaWall->ItemL(i);
- TBool shuffleItem(EFalse);
- if ( i == 0 )
- {
- shuffleItem = SetShuffleItemTextL(item, currentMedia);
- }
-
- if (!shuffleItem)
- {
- SetTitleL( item, currentMedia );
- AddDetailToDisplayedItemL( item, currentMedia, i );
- }
+ CHgVgItem* item = &iMediaWall->ItemL(i+iShuffleItem);
+
+ SetTitleL( item, currentMedia );
+ AddDetailToDisplayedItemL( item, currentMedia, i );
iLastValidMediaItemIndex = i;
}
}
@@ -2288,22 +2378,27 @@
if ( aStart < 0 ) aStart = 0;
if ( aEnd < 0 ) aEnd = 0;
+ TInt index(0);
const CMPXMediaArray& mediaArray = iListBoxArray->MediaArray();
for ( TInt i = aStart; i <= aEnd ; i++ )
{
// Just get the exiting item and update the fields + icon.
CHgItem* item = NULL;
- if( iCurrentViewType == EMPXViewCoverFlow || iCurrentViewType == EMPXViewTBone )
+ if( iCurrentViewType == EMPXViewMediawall || iCurrentViewType == EMPXViewTBone )
item = &iMediaWall->ItemL(i);
else
item = &iListWidget->ItemL(i);
- CMPXMedia* currentMedia( mediaArray.AtL( i ) );
-
- AddThumbnailToDisplayedItemL( item, currentMedia, i );
+ index = MediaIndex(i);
+ if ( index >= 0 )
+ {
+ CMPXMedia* currentMedia( mediaArray.AtL( index ) );
+ AddThumbnailToDisplayedItemL( item, currentMedia, index );
+ }
}
}
+
// -----------------------------------------------------------------------------
// CMPXCollectionViewHgContainer::Release
// -----------------------------------------------------------------------------
@@ -2312,23 +2407,26 @@
{
MPX_FUNC( "CMPXCollectionViewHgContainer::Release" );
- for(; aReleaseStart <= aReleaseEnd; ++aReleaseStart)
+ TInt temp = aReleaseStart - iShuffleItem;
+ TInt start = temp >=0 ? temp : 0 ;
+ TInt end = aReleaseEnd - iShuffleItem;
+
+ for(; start <= end; ++start)
{
- MPX_DEBUG2( "-->CMPXCollectionViewHgContainer::Release aReleaseStart = %d", aReleaseStart );
- iThumbnailManager->CancelThumb( aReleaseStart );
+ MPX_DEBUG2( "-->CMPXCollectionViewHgContainer::Release aReleaseStart = %d", start );
+ iThumbnailManager->CancelThumb( start );
}
-
}
// ---------------------------------------------------------------------------
// Refresh for item without thumbnail
// ---------------------------------------------------------------------------
//
-void CMPXCollectionViewHgContainer::RefreshNoThumbnailL(TInt aIndex)
+void CMPXCollectionViewHgContainer::RefreshNoThumbnailL(TInt aDisplayIndex)
{
MPX_FUNC( "CMPXCollectionViewHgContainer::RefreshNoThumbnail" );
- RefreshL(aIndex);
+ RefreshL(aDisplayIndex);
}
// ---------------------------------------------------------------------------
// Refresh list as needed.
@@ -2336,7 +2434,7 @@
// avoid too many redraws. In some cases, multiple refresh is unavoidable.
// ---------------------------------------------------------------------------
//
-void CMPXCollectionViewHgContainer::RefreshL(TInt aIndex)
+void CMPXCollectionViewHgContainer::RefreshL(TInt aDisplayIndex)
{
if( !iIsForeground )
{
@@ -2346,6 +2444,7 @@
MPX_FUNC( "CMPXCollectionViewHgContainer::Refresh" );
TInt mediaCount = iListBoxArray->MediaArray().Count();
+ TInt displayCount = mediaCount + iShuffleItem;
TInt firstOnScreen = 0;
TInt lastOnScreen = 0;
@@ -2353,7 +2452,7 @@
TBool landscapeOrientation = Layout_Meta_Data::IsLandscapeOrientation();
CHgScroller* listWidget = CurrentListWidget();
- if( iCurrentViewType == EMPXViewTBone || iCurrentViewType == EMPXViewCoverFlow )
+ if( iCurrentViewType == EMPXViewTBone || iCurrentViewType == EMPXViewMediawall )
{
firstOnScreen = iMediaWall->FirstIndexOnScreen();
lastOnScreen = firstOnScreen + iMediaWall->ItemsOnScreen();
@@ -2364,14 +2463,13 @@
lastOnScreen = firstOnScreen + listWidget->ItemsOnScreen();
}
- // Added by Harri
if( firstOnScreen < 0 )
firstOnScreen = 0;
- if (lastOnScreen > (mediaCount - 1))
- lastOnScreen = mediaCount - 1;
+ if (lastOnScreen > (displayCount - 1))
+ lastOnScreen = displayCount - 1;
// Refresh screen if the item is within view and no more thumbnails expected.
- if ( aIndex >= firstOnScreen && aIndex <= lastOnScreen )
+ if ( aDisplayIndex >= firstOnScreen && aDisplayIndex <= lastOnScreen )
{
TBool canRefresh(ETrue);
for (TInt i= firstOnScreen; i <= lastOnScreen; i++)
@@ -2384,10 +2482,34 @@
}
if ( canRefresh )
{
- if( iCurrentViewType == EMPXViewTBone || iCurrentViewType == EMPXViewCoverFlow )
- iMediaWall->RefreshScreen( firstOnScreen );
+ if( iCurrentViewType == EMPXViewTBone || iCurrentViewType == EMPXViewMediawall )
+ {
+ if( iTranstionType != EMPXTranstionNotDefined )
+ {
+ // This will tricker the transtition animation
+ EndFullScreenAnimation();
+ iMediaWall->DrawNow();
+ }
+ else
+ {
+ iMediaWall->RefreshScreen( firstOnScreen );
+ }
+ }
else
- listWidget->RefreshScreen( firstOnScreen );
+ {
+ if( iTranstionType != EMPXTranstionNotDefined )
+ {
+ // This will tricker the transtition animation
+ // Use DrawNow since RefreshScreen uses DrawDeferred and we want to start
+ // the animation immediately.
+ EndFullScreenAnimation();
+ listWidget->DrawNow();
+ }
+ else
+ {
+ listWidget->RefreshScreen( firstOnScreen );
+ }
+ }
}
}
}
@@ -2411,7 +2533,6 @@
case EContextGroupAlbum:
case EContextItemAlbum:
{
- // Mod by Harri. Lampainen wanted to try default icon in album view.
iconIndex = EMPXClvIconAlbum;
break;
}
@@ -2485,7 +2606,6 @@
case EContextGroupAlbum:
case EContextItemAlbum:
{
- // Mod by Harri. Lampainen wanted to try default icon in album view.
defaultIcon = EMPXDefaultIconAlbum;
iconIndex = EMPXClvIconAlbum;
break;
@@ -3287,7 +3407,7 @@
{
//no albumart
// Default album art has already been set earlier.
- iThumbnailReqMap[aIndex] = ETrue;
+ iThumbnailReqMap[aIndex+iShuffleItem] = ETrue;
RefreshNoThumbnailL(aIndex);
}
}
@@ -3295,10 +3415,10 @@
{
// no album art supported
// Default album art has already been set earlier.
- if ( iCurrentViewType == EMPXViewCoverFlow ||
- iCurrentViewType == EMPXViewList && aIndex == 0 )
+ if ( iCurrentViewType == EMPXViewMediawall ||
+ iCurrentViewType == EMPXViewList && (aIndex-iShuffleItem) == -1 )
SetDetailIconShuffleL(); // BUG: temporarily called here because default icon is shown if SetDefaultIconL is called after.
- iThumbnailReqMap[aIndex] = ETrue;
+ iThumbnailReqMap[aIndex+iShuffleItem] = ETrue;
RefreshNoThumbnailL(aIndex);
}
}
@@ -3310,57 +3430,41 @@
void CMPXCollectionViewHgContainer::SetDetailIconShuffleL()
{
- const CMPXMediaArray& mediaArray = iListBoxArray->MediaArray();
- if (mediaArray.Count())
+ if (iShuffleItem)
{
- CMPXMedia* currentMedia( mediaArray.AtL( 0 ) );
-
- TMPXGeneralType type( EMPXNoType );
- if ( currentMedia->IsSupported( KMPXMediaGeneralType ) )
+ CGulIcon* icon = (*iIconArray)[EMPXClvIconShuffle];
+ CFbsBitmap* bitmap = icon->Bitmap();
+ CFbsBitmap* mask = icon->Mask();
+
+ TSize size(240,240);
+ CHgItem* item = NULL;
+ if( iCurrentViewType == EMPXViewMediawall || iCurrentViewType == EMPXViewTBone )
{
- type = currentMedia->ValueTObjectL<TMPXGeneralType>( KMPXMediaGeneralType );
+ item = &iMediaWall->ItemL(0);
}
-
- TMPXGeneralCategory category( EMPXNoCategory );
- if ( currentMedia->IsSupported( KMPXMediaGeneralCategory ) )
- {
- category = currentMedia->ValueTObjectL<TMPXGeneralCategory>( KMPXMediaGeneralCategory );
- }
-
- if ( type == EMPXItem && category == EMPXCommand )
+ else if( iCurrentViewType == EMPXViewList )
{
-
- CGulIcon* icon = (*iIconArray)[EMPXClvIconShuffle];
- CFbsBitmap* bitmap = icon->Bitmap();
- CFbsBitmap* mask = icon->Mask();
-
- TSize size(240,240);
- CHgItem* item = NULL;
- if( iCurrentViewType == EMPXViewCoverFlow || iCurrentViewType == EMPXViewTBone )
- {
- item = &iMediaWall->ItemL(0);
- }
- else if( iCurrentViewType == EMPXViewList )
- {
- item = &iListWidget->ItemL(0);
- size = CHgDoubleGraphicListFlat::PreferredImageSize();
- }
- else
- {
- User::Leave( KErrNotSupported );
- }
-
- if ( item )
- {
- AknIconUtils::SetSize( bitmap, size );
- AknIconUtils::SetSize( mask, size );
-
- CGulIcon* iconCopy = CGulIcon::NewL(bitmap, mask);
- iconCopy->SetBitmapsOwnedExternally(ETrue);
- item->SetIcon( iconCopy );
- }
+ item = &iListWidget->ItemL(0);
+ size = CHgDoubleGraphicListFlat::PreferredImageSize();
+ }
+ else
+ {
+ User::Leave( KErrNotSupported );
+ }
+
+ if ( item )
+ {
+ AknIconUtils::SetSize( bitmap, size );
+ AknIconUtils::SetSize( mask, size );
+
+ CGulIcon* iconCopy = CGulIcon::NewL(bitmap, mask);
+ iconCopy->SetBitmapsOwnedExternally(ETrue);
+ item->SetIcon( iconCopy );
}
}
+
+
+
}
// ----------------------------------------------------------------------------
@@ -3371,48 +3475,18 @@
{
TBool res(EFalse);
- TMPXGeneralType type( EMPXNoType );
- if ( aMedia->IsSupported( KMPXMediaGeneralType ) )
- {
- type = aMedia->ValueTObjectL<TMPXGeneralType>( KMPXMediaGeneralType );
- }
-
- TMPXGeneralCategory category( EMPXNoCategory );
- if ( aMedia->IsSupported( KMPXMediaGeneralCategory ) )
- {
- category = aMedia->ValueTObjectL<TMPXGeneralCategory>( KMPXMediaGeneralCategory );
- }
-
- if ( type == EMPXItem && category == EMPXCommand )
- {
-
- if ( aMedia->IsSupported( KMPXMediaGeneralTitle ) )
- {
-
- const TDesC& title = aMedia->ValueText( KMPXMediaGeneralTitle );
- if ( title.Compare( KNullDesC ) != 0 )
- {
- aItem->SetTitleL( title );
- }
- else
- {
- HBufC* unknownText =
- StringLoader::LoadLC( R_MPX_COLLECTION_UNKNOWN );
- aItem->SetTitleL( *unknownText );
- CleanupStack::PopAndDestroy( unknownText );
- }
- }
-
- if ( aMedia->IsSupported( KMPXMediaColDetailNumberOfItems ) )
- {
- TInt songsCount = aMedia->ValueTObjectL<TInt>( KMPXMediaColDetailNumberOfItems );
-
- HBufC* songsTitle = StringLoader::LoadLC( R_MPX_COLLECTION_DETAILS_NUMBER_OF_SONGS, songsCount );
- TPtr ptr = songsTitle->Des();
- AknTextUtils::LanguageSpecificNumberConversion( ptr );
- aItem->SetTextL( ptr );
- CleanupStack::PopAndDestroy( songsTitle );
- }
+
+ const CMPXMediaArray& mediaArray = iListBoxArray->MediaArray();
+ const TInt count( mediaArray.Count() );
+
+ if ( count > 1 && iContext == EContextGroupAlbum ||
+ iContext == EContextGroupSong ||
+ iContext == EContextGroupGenre ||
+ iContext == EContextItemPlaylist ||
+ iContext == EContextItemGenre ||
+ iContext == EContextItemSong )
+ {
+ aItem->SetTitleL( _L("Shuffle All") );
// We can try to set icon too.
SetDetailIconShuffleL();
@@ -3563,7 +3637,8 @@
void CMPXCollectionViewHgContainer::TNReadyL(TInt aError, CFbsBitmap* aBitmap, CFbsBitmap* /*aMask*/, TInt aIndex)
{
- if ( aError == KErrNone )
+ TInt displayIndex = aIndex+iShuffleItem;
+ if ( aError == KErrNone )
{
const CMPXMediaArray& mediaArray = iListBoxArray->MediaArray();
CMPXMedia* currentMedia( mediaArray.AtL( aIndex ) );
@@ -3575,33 +3650,36 @@
switch (iCurrentViewType)
{
- case EMPXViewCoverFlow:
+ case EMPXViewMediawall:
case EMPXViewTBone:
{
- iMediaWall->ItemL(aIndex).SetIcon(icon);
- iThumbnailReqMap[aIndex] = ETrue;
+ iMediaWall->ItemL(displayIndex).SetIcon(icon);
break;
}
case EMPXViewList:
{
- iListWidget->ItemL(aIndex).SetIcon(icon);
- iThumbnailReqMap[aIndex] = ETrue;
+ iListWidget->ItemL(displayIndex).SetIcon(icon);
break;
}
default:
break;
}
- RefreshL(aIndex);
+
}
}
}
else
{
//no albumart supported
- iThumbnailReqMap[aIndex] = ETrue;
- RefreshL(aIndex);
+ //iThumbnailReqMap[displayIndex] = ETrue;
+ //RefreshL(displayIndex);
}
+
+ iThumbnailReqMap[displayIndex] = ETrue;
+ RefreshL(displayIndex);
+
+
}
// ----------------------------------------------------------------------------
@@ -3714,24 +3792,23 @@
{
iPlaybackUtility->CommandL( EPbCmdPlay );
}
- iPlaybackUtility->SetL( EPbPropertyRandomMode, shuffle );
+ iPlaybackUtility->SetL( EPbPropertyRandomMode, EFalse );
iView->ProcessCommandL( EMPXCmdGoToNowPlaying );
}
else
{
- iPlaylistHelper->InitPlaylistL(*cpath, shuffle);
+ iPlaybackUtility->SetL( EPbPropertyRandomMode, shuffle );
+ iCollectionUtility->Collection().OpenL(*cpath);
}
}
else
{
- iPlaylistHelper->InitPlaylistL(*cpath, shuffle);
+ iPlaybackUtility->SetL( EPbPropertyRandomMode, shuffle );
+ iCollectionUtility->Collection().OpenL(*cpath);
}
CleanupStack::PopAndDestroy( cpath );
- // We need to restore the status pane before switching to playback view.
- if (!((CAknAppUi*)iCoeEnv->AppUi())->StatusPane()->IsVisible())
- ((CAknAppUi*)iCoeEnv->AppUi())->StatusPane()->MakeVisible(ETrue);
}
CleanupStack::PopAndDestroy(&ids);
@@ -3752,7 +3829,7 @@
if ( iContext == EContextGroupPlaylist ||
iContext == EContextGroupGenre && listWidget )
{
- selectedIndex = listWidget->SelectedIndex();
+ selectedIndex = MediaIndex(listWidget->SelectedIndex());
}
else
{
@@ -3848,7 +3925,7 @@
{
// We've previously fetched the songs for this album so
// all we do now is populate the list with the song titles.
- if( iCurrentViewType == EMPXViewCoverFlow )
+ if( iCurrentViewType == EMPXViewMediawall )
{
ShowAlbumSongsDialogL(*album);
}
@@ -3921,37 +3998,21 @@
MPX_FUNC("CMPXCollectionViewHgContainer::ShufflePlayAllL");
TBool shuffle(EFalse);
- const CMPXMediaArray& mediaArray = iListBoxArray->MediaArray();
-
- CMPXMedia* currentMedia( mediaArray.AtL( aIndex ) );
-
- TMPXGeneralType type( EMPXNoType );
- if ( currentMedia->IsSupported( KMPXMediaGeneralType ) )
- {
- type = currentMedia->ValueTObjectL<TMPXGeneralType>( KMPXMediaGeneralType );
- }
-
- TMPXGeneralCategory category( EMPXNoCategory );
- if ( currentMedia->IsSupported( KMPXMediaGeneralCategory ) )
+
+ if ( aIndex == -1 )
{
- category = currentMedia->ValueTObjectL<TMPXGeneralCategory>( KMPXMediaGeneralCategory );
- }
-
- if ( type == EMPXItem && category == EMPXCommand )
- {
- shuffle = ETrue;
- if ( iContext == EContextItemPlaylist )
- {
- CMPXCollectionPath* cpath = iCollectionUtility->Collection().PathL();
- CleanupStack::PushL( cpath );
- cpath->Remove(0); // we want to remove index 0 which is shuffle item
- iPlaylistHelper->InitPlaylistL(*cpath, shuffle);
- CleanupStack::PopAndDestroy( cpath );
- }
- else
- {
- iPlaylistHelper->InitPlaylistL(shuffle);
- }
+ shuffle = ETrue;
+ if ( iContext == EContextItemPlaylist || iContext == EContextItemGenre )
+ {
+ CMPXCollectionPath* cpath = iCollectionUtility->Collection().PathL();
+ CleanupStack::PushL( cpath );
+ iPlaylistHelper->InitPlaylistL(*cpath, shuffle);
+ CleanupStack::PopAndDestroy( cpath );
+ }
+ else
+ {
+ iPlaylistHelper->InitPlaylistL(shuffle);
+ }
}
return shuffle;
@@ -4096,7 +4157,7 @@
if ( iFindOp == EMPXOpenAlbum )
{
- if( iCurrentViewType == EMPXViewCoverFlow )
+ if( iCurrentViewType == EMPXViewMediawall )
{
ShowAlbumSongsDialogL( aResults );
}
@@ -4181,12 +4242,12 @@
CAknSinglePopupMenuStyleListBox* listBox = new ( ELeave ) CAknSinglePopupMenuStyleListBox;
CleanupStack::PushL( listBox );
- iDialog = CAknPopupList::NewL(listBox, R_MPX_COLLECTION_ALBUMSONGS_LIST_CBA,
+ CAknPopupList* dialog = CAknPopupList::NewL(listBox, R_MPX_COLLECTION_ALBUMSONGS_LIST_CBA,
AknPopupLayouts::EDynMenuWindow );
- CleanupStack::PushL( iDialog );
-
- listBox->ConstructL( iDialog,
+ CleanupStack::PushL( dialog );
+
+ listBox->ConstructL( dialog,
EAknListBoxSelectionList | EAknListBoxScrollBarSizeExcluded );
@@ -4200,7 +4261,7 @@
const TDesC& album = iSelectedMediaInAlbumView->ValueText( KMPXMediaMusicAlbum );
if ( album.Compare( KNullDesC ) != 0 )
{
- iDialog->SetTitleL( album );
+ dialog->SetTitleL( album );
}
}
@@ -4237,10 +4298,18 @@
CTextListBoxModel* model = listBox->Model();
model->SetItemTextArray( songList );
model->SetOwnershipType( ELbmOwnsItemArray );
- TBool play = iDialog->ExecuteLD();
- CleanupStack::Pop( iDialog );
+ CleanupStack::Pop( dialog );
+ iDialog = dialog;
+ TBool play( EFalse );
+ GfxTransEffect::Deregister( iDialog );
+ GfxTransEffect::Register( iDialog, KAppUidMusicPlayerX, EFalse );
+ // Trap ExecuteLD to make sure iDialog always get reset.
+ TRAP_IGNORE( play = iDialog->ExecuteLD() );
+ iDialog = NULL;
if( play )
{
+ iMediaWall->SetFlags( CHgVgMediaWall::EHgVgMediaWallDrawToWindowGC );
+ iMediaWall->DrawNow();
TInt index = listBox->CurrentItemIndex();
// If item in list was opened, we only play the selected one.
SaveSelectedAlbumItemL(iSelectedAlbumIndex);
@@ -4249,13 +4318,11 @@
}
else
{
- // Do nothing if cancel was pressed.
+ // Close mediawall "flip animation"
+ iMediaWall->StartOpeningAnimationL( EFalse );
}
CleanupStack::PopAndDestroy( listBox );
-
- // Close mediawall "flip animation"
- iMediaWall->StartOpeningAnimationL( EFalse );
}
@@ -4335,6 +4402,11 @@
iSelectedMediaInAlbumView = NULL;
}
+ if ( aIndex < 0 ) // We try to save a valid album otherwise restore will not work.
+ {
+ aIndex = 0;
+ }
+
iSelectedMediaInAlbumView = CMPXMedia::NewL( *mediaArray.AtL( aIndex ) );
if ( iSelectedMediaInAlbumView->IsSupported( KMPXMediaGeneralTitle ) )
@@ -4372,7 +4444,7 @@
CleanupStack::PopAndDestroy( unknownArtistText );
}
- WriteToStreamFileL( iSelectedMediaInAlbumView );
+ iSelectedAlbumHandler->SaveSelectedAlbum(*iSelectedMediaInAlbumView);
}
}
@@ -4387,27 +4459,26 @@
{
MPX_FUNC( "CMPXCollectionViewHgContainer::RestoreSelectedAlbumItemL" );
- CMPXMedia* restoredAlbum = CMPXMedia::NewL();
- CleanupStack::PushL( restoredAlbum );
- ReadFromStreamFileL(restoredAlbum);
- TMPXItemId id=restoredAlbum->ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId);
- iRestoredAlbumIndex = 0;
- iSelectedAlbumIndex = 0;
-
- for ( TInt i = 0; i < aMediaArray.Count() ; i++ )
- {
- CMPXMedia* currentMedia( aMediaArray.AtL( i ) );
-
- if ( (currentMedia->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId ) == id) ||
- (id.iId1 == 0 && currentMedia->ValueText(KMPXMediaGeneralTitle).Compare( restoredAlbum->ValueText(KMPXMediaGeneralTitle) ) == 0 ) )
- {
- iRestoredAlbumIndex = i;
- iSelectedAlbumIndex = i;
- break;
- }
- }
-
- CleanupStack::PopAndDestroy( restoredAlbum );
+ const CMPXMedia* restoredAlbum = iSelectedAlbumHandler->RestoreSelectedAlbum();
+ iRestoredAlbumIndex = 0;
+ iSelectedAlbumIndex = 0;
+ if ( restoredAlbum )
+ {
+ TMPXItemId id=restoredAlbum->ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId);
+
+ for ( TInt i = 0; i < aMediaArray.Count() ; i++ )
+ {
+ CMPXMedia* currentMedia( aMediaArray.AtL( i ) );
+
+ if ( (currentMedia->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId ) == id) ||
+ (id.iId1 == 0 && currentMedia->ValueText(KMPXMediaGeneralTitle).Compare( restoredAlbum->ValueText(KMPXMediaGeneralTitle) ) == 0 ) )
+ {
+ iRestoredAlbumIndex = i;
+ iSelectedAlbumIndex = i;
+ break;
+ }
+ }
+ }
}
// ----------------------------------------------------------------------------
@@ -4501,4 +4572,236 @@
return KErrNone;
}
+// -----------------------------------------------------------------------------
+// Prepare T-bone view
+// -----------------------------------------------------------------------------
+//
+void CMPXCollectionViewHgContainer::PrepareTboneViewL()
+ {
+ MPX_FUNC( "CMPXCollectionViewHgContainer::PrepareTboneViewL" );
+
+ const CMPXMediaArray& mediaArray = iListBoxArray->MediaArray();
+ TInt mediaCount( mediaArray.Count() );
+ HandleLbxItemRemovalL();
+
+ iPrevContext = EContextGroupAlbum;
+ iOpenAlbumTracks = ETrue;
+ iContext = EContextItemAlbum;
+ iCurrentViewType = EMPXViewTBone;
+
+ if (ShuffleItemPresent())
+ iShuffleItem = 1;
+ else
+ iShuffleItem = 0;
+
+ TInt listCount = mediaCount + iShuffleItem;
+ iThumbnailReqMap.Reset();
+ iThumbnailReqMap.ReserveL(listCount);
+ for ( TInt i = 0; i < listCount; i++ )
+ {
+ iThumbnailReqMap.Append( EFalse );
+ }
+
+ iThumbnailManager->CancelAll();
+
+ // MediaWall sets the default icon in the construction phase.
+ iDefaultIconSet = EFalse;
+
+ if( !iLayoutSwitch )
+ {
+ BeginFullScreenAnimation();
+ }
+
+ RestoreSelectedAlbumItemL(mediaArray);
+ PrepareMediaWallWithListL( mediaArray, mediaCount );
+
+ DrawableWindow()->SetOrdinalPosition( -1 );
+
+ CleanPrevView();
+
+ iPrevViewType = iCurrentViewType;
+
+ if( !iDefaultIconSet )
+ {
+ SetDefaultIconL();
+ }
+ // We need to adjust the CBA for this view.
+ if( iCbaHandler )
+ iCbaHandler->UpdateCba();
+
+ iLayoutSwitch = EFalse;
+ }
+
+// -----------------------------------------------------------------------------
+// Determine if adding shuffle command is needed
+// -----------------------------------------------------------------------------
+//
+TBool CMPXCollectionViewHgContainer::ShuffleItemPresent()
+ {
+ MPX_FUNC( "CMPXCollectionViewHgContainer::ShuffleItemNeeded" );
+
+ const CMPXMediaArray& mediaArray = iListBoxArray->MediaArray();
+
+ TBool res = EFalse;
+ if ( mediaArray.Count() > 1 &&
+ (iContext == EContextGroupAlbum ||
+ iContext == EContextGroupSong ||
+ iContext == EContextItemPlaylist ||
+ iContext == EContextItemGenre ||
+ iContext == EContextItemSong ))
+ {
+ res = ETrue;
+ }
+
+ return res;
+ }
+
+// -----------------------------------------------------------------------------
+// Handles translation from list index to media array index
+// -----------------------------------------------------------------------------
+//
+TInt CMPXCollectionViewHgContainer::MediaIndex(TInt aIndex) const
+ {
+ MPX_FUNC( "CMPXCollectionViewHgContainer::MediaIndex" );
+
+ TInt index(aIndex);
+
+ if ( iShuffleItem )
+ {
+ index = aIndex - 1;
+ }
+
+ return index;
+ }
+
+
+// ---------------------------------------------------------------------------
+// Offer command by view, if handled, return ETrue.
+// ---------------------------------------------------------------------------
+//
+TBool CMPXCollectionViewHgContainer::OfferCommandL( TInt aCommand )
+ {
+ MPX_FUNC( "CMPXCollectionViewHgContainer::OfferCommandL" );
+
+ if( aCommand == EAknSoftkeyBack && iContext == EContextItemAlbum )
+ {
+ iOpenAlbumTracks = EFalse;
+ HandleLbxItemAdditionL();
+ return ETrue;
+ }
+ else
+ {
+ return EFalse;
+ }
+ }
+
+// ---------------------------------------------------------------------------
+// Load and set empty text
+// ---------------------------------------------------------------------------
+//
+void CMPXCollectionViewHgContainer::LoadAndSetEmptyTextL()
+ {
+ MPX_FUNC( "CMPXCollectionViewHgContainer::LoadAndSetEmptyTextL" );
+
+ if ( iContext == EContextGroupAlbum )
+ {
+ TInt resId = R_MPX_COLLECTION_ALBUM_LBX_EMPTYTEXT;
+ HBufC* emptyText = StringLoader::LoadLC( resId );
+ SetLbxEmptyTextL( *emptyText );
+ CleanupStack::PopAndDestroy( emptyText );
+ }
+ }
+
+// ---------------------------------------------------------------------------
+// Set previous view Uid
+// ---------------------------------------------------------------------------
+//
+void CMPXCollectionViewHgContainer::SetPreviousViewId(TUid aViewUid)
+ {
+ MPX_FUNC( "CMPXCollectionViewHgContainer::SetPreviousViewId" );
+
+ iPreviousViewId = aViewUid;
+ }
+
+// ---------------------------------------------------------------------------
+// Prepare and begin fullscreen animation effects
+// ---------------------------------------------------------------------------
+//
+void CMPXCollectionViewHgContainer::BeginFullScreenAnimation(TBool aPrevViewWasPlayback)
+ {
+ if( iTranstionType != EMPXTranstionNotDefined )
+ return;
+
+ iTranstionType = EMPXTranstionToLeft;
+
+ if ( (iPrevContext == EContextUnknown ||
+ iPrevContext == EContextItemAlbum ) && aPrevViewWasPlayback )
+ {
+ iTranstionType = EMPXTranstionToLeft;
+ }
+ else if( iPrevContext == EContextUnknown )
+ {
+ // We aren't coming from playback view and prev context is unknown.
+ // Musicplayer is propably started so we shouldn't use any animation.
+ iTranstionType = EMPXTranstionNotDefined;
+ return;
+ }
+ else if( iCurrentViewType == EMPXViewTBone )
+ {
+ iTranstionType = EMPXTranstionToRight;
+ }
+
+ if( iPrevViewType == EMPXViewMediawall || iPrevViewType == EMPXViewTBone )
+ {
+ iMediaWall->SetFlags( CHgVgMediaWall::EHgVgMediaWallDrawToWindowGC );
+ iMediaWall->DrawNow();
+ }
+
+ const TInt flags = AknTransEffect::TParameter::EActivateExplicitCancel;
+ TRect appRect = ((CAknAppUi*)iCoeEnv->AppUi())->ApplicationRect();
+ GfxTransEffect::BeginFullScreen( iTranstionType, appRect,
+ AknTransEffect::EParameterType,
+ AknTransEffect::GfxTransParam(KAppUidMusicPlayerX, flags));
+ }
+
+// ---------------------------------------------------------------------------
+// End fullscreen animation effects
+// ---------------------------------------------------------------------------
+//
+void CMPXCollectionViewHgContainer::EndFullScreenAnimation()
+ {
+ if( iTranstionType != EMPXTranstionNotDefined )
+ {
+ GfxTransEffect::EndFullScreen();
+ iTranstionType = EMPXTranstionNotDefined;
+ // TODO: uncomment if really needed.
+ //iThumbnailManager->Pause(TTimeIntervalMicroSeconds32(KThumbLoadingPauseForTransition));
+ }
+ }
+
+// ---------------------------------------------------------------------------
+// Resolving the size of the popup list rectangle.
+// ---------------------------------------------------------------------------
+//
+void CMPXCollectionViewHgContainer::ResolvePopupListSizeL()
+ {
+ // Resolve popuplistbox rect that is used to show the album songs
+ CAknSinglePopupMenuStyleListBox* listBox = new ( ELeave ) CAknSinglePopupMenuStyleListBox;
+ CleanupStack::PushL( listBox );
+
+ CMpxPopupList* dialog = CMpxPopupList::NewL(listBox, R_MPX_COLLECTION_ALBUMSONGS_LIST_CBA,
+ AknPopupLayouts::EDynMenuWindow );
+
+ CleanupStack::PushL( dialog );
+
+ listBox->ConstructL( dialog,
+ EAknListBoxSelectionList | EAknListBoxScrollBarSizeExcluded );
+
+ // title can be hardcoded because it is not shown to user. Just for the calculations.
+ dialog->SetTitleL(_L("Foo"));
+ iPopupListRect = dialog->LayoutRect();
+
+ CleanupStack::PopAndDestroy( dialog );
+ CleanupStack::PopAndDestroy( listBox );
+ }
// End of File
--- a/mpxplugins/viewplugins/views/collectionviewhg/src/mpxcollectionviewhgimp.cpp Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/viewplugins/views/collectionviewhg/src/mpxcollectionviewhgimp.cpp Fri Mar 12 15:42:25 2010 +0200
@@ -163,7 +163,6 @@
const TInt KMPXCollectionArtistAlbum( 3 );
const TInt KMPXCollectionGenre( 5 );
-const TInt KMPXTimeoutTimer = 1000000; // 1 second
// ======== MEMBER FUNCTIONS ========
@@ -271,14 +270,6 @@
delete iMediaRecognizer;
}
- if ( iTimer )
- {
- if ( iTimer->IsActive() )
- iTimer->Cancel();
-
- delete iTimer;
- iTimer = NULL;
- }
#ifdef BACKSTEPPING_INCLUDED
if( iBackSteppingUtility )
{
@@ -297,7 +288,6 @@
delete iContainer;
}
- delete iNaviDecorator;
delete iUserPlaylists;
delete iCommonUiHelper;
delete iSendUi;
@@ -316,6 +306,8 @@
{
delete iOperatorMusicStoreURI;
}
+ if (iStoredAlbum)
+ delete iStoredAlbum;
}
// ---------------------------------------------------------------------------
@@ -324,7 +316,8 @@
// ---------------------------------------------------------------------------
//
CMPXCollectionViewHgImp::CMPXCollectionViewHgImp() :
- iLastDepth( 1 ), iPlayIndex( KErrNotFound ),
+ iLastDepth( 1 ),
+ iPlayIndex( KErrNotFound ),
iSetMediaLCount( KErrNotFound ),
iCurrentHighlightedIndex( KErrNotFound ),
iCachedCommand( KErrNotFound ),
@@ -401,8 +394,6 @@
iViewUtility->AddObserverL( this );
iBottomIndex = new (ELeave) CArrayFixFlat<TInt>( 1 );
- iTimer = CPeriodic::NewL( CActive::EPriorityIdle );
-
iCommonUiHelper = CMPXCommonUiHelper::NewL( iCollectionUtility );
iCollectionUiHelper = CMPXCollectionHelperFactory::NewCollectionUiHelperL();
@@ -441,14 +432,6 @@
MPX_TRAP( iErrorAttachAssignMenu, iServiceHandler->AttachMenuL( R_MPX_USE_AS_CASCADE,
R_MPX_AIW_ASSIGN_INTEREST ) );
- iNaviPane =
- static_cast<CAknNavigationControlContainer*>
- ( iAvkonViewAppUi->StatusPane()->ControlL(
- TUid::Uid( EEikStatusPaneUidNavi ) ) );
- iNaviDecorator = iNaviPane->CreateNavigationLabelL( KNullDesC );
- //Create label to change text in Navi pane
- iNaviLabel = static_cast<CAknNaviLabel*>
- ( iNaviDecorator->DecoratedControl() );
TInt flags( 0 );
CRepository* repository = CRepository::NewL( KCRUidMPXMPFeatures );
@@ -644,14 +627,7 @@
{
CMPXCommonListBoxArrayBase* listboxArray( iContainer->ListBoxArray() );
const CMPXMedia& containerMedia( listboxArray->ContainerMedia() );
-
- TMPXGeneralType containerType(
- containerMedia.ValueTObjectL<TMPXGeneralType>(
- KMPXMediaGeneralType ) );
- TMPXGeneralCategory containerCategory(
- containerMedia.ValueTObjectL<TMPXGeneralCategory>(
- KMPXMediaGeneralCategory ) );
-
+
const TMPXItemId containerId = containerMedia.ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId);
HBufC* promptTxt( NULL );
@@ -662,8 +638,8 @@
CMPXCollectionPath* path( iCollectionUtility->Collection().PathL() );
CleanupStack::PushL( path );
- if ( containerType == EMPXItem && containerCategory == EMPXAlbum )
- {
+ if ( iContainer->IsTBoneView() )
+ {
//get the media object of the selected track in TBone View
CMPXMedia* albumTrack = iContainer->SelectedItemMediaL();
@@ -680,8 +656,18 @@
TMPXItemId trackId = albumTrack->ValueTObjectL<TMPXItemId>(KMPXMediaGeneralId);
const TDesC& trackTitle( albumTrack->ValueText( KMPXMediaGeneralTitle ) );
// create the item path to delete
- path->Back();
- path->Back();
+
+ if ( path->Levels() == 3 )
+ {
+ path->Back();
+ }
+ else if (path->Levels() == 4)
+ {
+ path->Back();
+ path->Back();
+ }
+
+
path->AppendL(containerId);
path->AppendL(trackId);
@@ -717,9 +703,6 @@
if(iCachedCommand != aCommand)
{
iIsWaitNoteCanceled = EFalse;
- StartProgressNoteL();
- TPtr buf = waitNoteText->Des();
- UpdateProcessL(0, buf);
}
if ( !iIsWaitNoteCanceled )
{
@@ -820,6 +803,8 @@
TInt waitNoteCBA( R_AVKON_SOFTKEYS_EMPTY );
MPX_DEBUG2( "CMPXCollectionViewHgImp::DeleteSelectedItemsL delete array count = %d", arrayCount );
+ // delete single song, not show wait note
+ TBool singleSong( EFalse );
TMPXGeneralType containerType(
containerMedia.ValueTObjectL<TMPXGeneralType>(
KMPXMediaGeneralType ) );
@@ -921,6 +906,11 @@
if ( ( type == EMPXItem && category == EMPXSong ) ||
( type == EMPXItem && category == EMPXPlaylist ) )
{
+ // delete single song
+ if ( type == EMPXItem && category == EMPXSong )
+ {
+ singleSong = ETrue;
+ }
// tracks level, or deleting a playlist
waitNoteText = StringLoader::LoadLC(
R_MPX_QTN_ALBUM_WAITING_DELETING, title );
@@ -1039,9 +1029,13 @@
if(iCachedCommand != aCommand)
{
iIsWaitNoteCanceled = EFalse;
- StartProgressNoteL();
- TPtr buf = waitNoteText->Des();
- UpdateProcessL(0, buf);
+ // If delete one song, don't show progress note.
+ if ( !singleSong )
+ {
+ StartProgressNoteL();
+ TPtr buf = waitNoteText->Des();
+ UpdateProcessL(0, buf);
+ }
}
if ( !iIsWaitNoteCanceled )
@@ -1261,36 +1255,6 @@
}
// ---------------------------------------------------------------------------
-// Updates the navi pane
-// ---------------------------------------------------------------------------
-//
-void CMPXCollectionViewHgImp::UpdateNaviPaneL()
- {
- MPX_FUNC( "CMPXCollectionViewHgImp::UpdateNaviPaneL" );
- if ( iContainer &&
- (iViewUtility->ActiveViewType() !=
- TUid::Uid( KMPXPluginTypeAddSongsEditorUid )) &&
- (iViewUtility->ActiveViewType() !=
- TUid::Uid( KMPXPluginTypeAlbumArtEditorUid )) &&
- (iViewUtility->ActiveViewType() !=
- TUid::Uid( KMPXPluginTypeMetadataEditorUid ))
- )
- {
- MPX_DEBUG2("CMPXCollectionViewHgImp::UpdateNaviPaneL updating %d", iDuration);
- if ( iDuration )
- {
- iNaviLabel->SetTextL( *iDuration );
- iNaviPane->PushL( *iNaviDecorator );
- }
- else
- {
- iNaviPane->Pop( iNaviDecorator );
- }
- iNaviPane->DrawNow();
- }
- }
-
-// ---------------------------------------------------------------------------
// Updates the title pane
// ---------------------------------------------------------------------------
//
@@ -1496,7 +1460,6 @@
iDuration = StringLoader::LoadL(
R_MPX_CUI_POSITION_COUNTER_TXT, *params );
CleanupStack::PopAndDestroy( params );
- UpdateNaviPaneL();
}
// ---------------------------------------------------------------------------
@@ -1586,10 +1549,6 @@
delete iOriginalDuration;
iOriginalDuration = NULL;
}
- if ( iViewUtility->ActiveViewType() == TUid::Uid( KMPXPluginTypeCollectionUid ) )
- {
- UpdateNaviPaneL();
- }
iContainer->ActivateReorderMode( EFalse );
iContainer->EnableFindBox( ETrue );
}
@@ -1633,7 +1592,7 @@
list, R_AVKON_SOFTKEYS_OK_EMPTY,
AknPopupLayouts::EMenuGraphicHeadingWindow);
CleanupStack::PushL( popupList );
- list->ConstructL( popupList, CEikListBox::ELeftDownInViewRect );
+ list->ConstructL( popupList, EAknListBoxViewerFlags );
list->CreateScrollBarFrameL( ETrue );
list->ScrollBarFrame()->SetScrollBarVisibilityL(
CEikScrollBarFrame::EOff,
@@ -2897,17 +2856,26 @@
CMPXCollectionViewListBoxArray* array =
static_cast<CMPXCollectionViewListBoxArray*>(
iContainer->ListBoxArray() );
- const CMPXMedia& media = array->MediaL(
- iContainer->CurrentLbxItemIndex() );
-
- if ( media.IsSupported( KMPXMediaGeneralFlags ) )
- {
- TUint flags( media.ValueTObjectL<TUint>( KMPXMediaGeneralFlags ) );
- if ( ( flags ) & ( KMPXMediaGeneralFlagsIsMissingDetails ) )
- {
- isHidden = ETrue;
- }
- }
+
+ TInt currentItem = iContainer->CurrentLbxItemIndex();
+ if ( currentItem > KErrNotFound )
+ {
+ const CMPXMedia& media = array->MediaL( currentItem );
+
+ if ( media.IsSupported( KMPXMediaGeneralFlags ) )
+ {
+ TUint flags( media.ValueTObjectL<TUint>( KMPXMediaGeneralFlags ) );
+ if ( ( flags ) & ( KMPXMediaGeneralFlagsIsMissingDetails ) )
+ {
+ isHidden = ETrue;
+ }
+ }
+ }
+ else
+ {
+ isHidden = ETrue;
+ }
+
}
return isHidden;
}
@@ -3366,8 +3334,8 @@
CleanupStack::PopAndDestroy( path );
//support for TBone view add to playlist
- if ( aContainerCategory == EMPXAlbum && aContainerType == EMPXItem)
- {
+ if ( iContainer->IsTBoneView() )
+ {
CMPXMedia* media = iContainer->SelectedItemMediaL();
if ( media->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId ) == KMPXInvalidItemId )
{
@@ -4014,7 +3982,6 @@
// USB flags
//
CEikMenuBar* menuBar( MenuBar() );
-#ifdef SINGLE_CLICK_INCLUDED
if(iContainer)
{
iContainer->EnableMarking( EFalse );
@@ -4023,16 +3990,6 @@
{
menuBar->SetMenuTitleResourceId( R_MPX_COLLECTION_VIEW_MENUBAR_NO_MARKING );
}
-#else
- if(iContainer)
- {
- iContainer->EnableMarking( ETrue );
- }
- if(menuBar)
- {
- menuBar->SetMenuTitleResourceId( R_MPX_COLLECTION_VIEW_MENUBAR );
- }
-#endif
TBool IsUSBEvent( EFalse );
if( type == EMcMsgUSBMassStorageStart || type == EMcMsgUSBMTPStart )
{
@@ -4273,9 +4230,16 @@
}
else if ( cba )
{
- cba->SetCommandSetL(
- ( cpath->Levels() == 3 && !iIsEmbedded ) ?
- R_MPX_OPTIONS_HIDE_CBA : R_AVKON_SOFTKEYS_OPTIONS_BACK );
+ if ( iContainer->IsTBoneView() )
+ {
+ cba->SetCommandSetL( R_AVKON_SOFTKEYS_OPTIONS_BACK );
+ }
+ else
+ {
+ cba->SetCommandSetL(
+ ( cpath->Levels() == 3 && !iIsEmbedded ) ?
+ R_MPX_OPTIONS_HIDE_CBA : R_AVKON_SOFTKEYS_OPTIONS_BACK );
+ }
cba->MakeVisible( ETrue );
cba->DrawDeferred();
}
@@ -4416,13 +4380,8 @@
else
{
// tracks view
-#ifdef SINGLE_CLICK_INCLUDED
iContainer->EnableMarking( EFalse );
menuBar->SetMenuTitleResourceId( R_MPX_COLLECTION_VIEW_MENUBAR_NO_MARKING );
-#else
- iContainer->EnableMarking( ETrue );
- menuBar->SetMenuTitleResourceId( R_MPX_COLLECTION_VIEW_MENUBAR );
-#endif
resId = R_MPX_COLLECTION_SONG_LBX_EMPTYTEXT;
#ifdef __ENABLE_MSK
mskId = R_QTN_MSK_PLAY;
@@ -4608,13 +4567,6 @@
}
}
- MPX_DEBUG1( "HandleOpenL CheckingTimer" );
- if ( iTimer && !iTimer->IsActive() )
- {
- MPX_DEBUG1( "HandleOpenL Starting" );
- iTimer->Start( KMPXTimeoutTimer, KMPXTimeoutTimer, TCallBack( IADCheckTimerCallBack, this));
- }
-
MPX_PERF_CHECKPT("Collection View opened");
}
@@ -4662,7 +4614,6 @@
iDuration = iCommonUiHelper->DisplayableDurationInTextL( duration/KMilliSecondsToSeconds );
}
}
- UpdateNaviPaneL();
break;
}
case EMPXOpMediaLSend:
@@ -5245,13 +5196,11 @@
OpenPodcastsL();
break;
}
-#ifdef SINGLE_CLICK_INCLUDED
case EMPXCmdPlayItem:
{
iContainer->HandleItemCommandL(EMPXCmdPlay);
break;
}
-#endif
case EMPXCmdCreatePlaylist:
{
iCurrentPlaylistOp = EMPXOpPLCreating;
@@ -5298,9 +5247,9 @@
if ( containerMedia.IsSupported( KMPXMediaGeneralCategory ) )
{
containerCategory = containerMedia.ValueTObjectL<TMPXGeneralCategory>( KMPXMediaGeneralCategory );
- }
-
- if ( mediaCategory == EMPXSong || (containerCategory == EMPXAlbum && containerType== EMPXItem) )
+ }
+
+ if ( mediaCategory == EMPXSong || iContainer->IsTBoneView() )
{
CMPXMedia* tracks = CMPXMedia::NewL();
CleanupStack::PushL( tracks );
@@ -5576,6 +5525,18 @@
}
case EAknSoftkeyBack:
{
+ if (iContainer->OfferCommandL(EAknSoftkeyBack))
+ {
+ CEikButtonGroupContainer* cba = Cba();
+ if (cba)
+ {
+ cba->SetCommandSetL( R_MPX_OPTIONS_HIDE_CBA );
+ cba->MakeVisible( ETrue );
+ cba->DrawDeferred();
+ }
+ break;
+ }
+
iMarkedAll = EFalse;
if( iIsDeleting )
{
@@ -5880,7 +5841,7 @@
if ( !iContainer )
{
- iContainer = CMPXCollectionViewHgContainer::NewL( this, this, iIsEmbedded );
+ iContainer = CMPXCollectionViewHgContainer::NewL( this, this, this, iIsEmbedded );
iContainer->SetCbaHandler( this );
}
iContainer->SetMopParent( this );
@@ -5913,11 +5874,13 @@
#endif
UpdateTitlePaneL();
- UpdateNaviPaneL();
if ( iViewUtility->PreviousViewType().iUid == KMPXPluginTypePlaybackUid )
{
+ // Set the previous view for animatin purposes.
+ iContainer->SetPreviousViewId(TUid::Uid(KMPXPluginTypePlaybackUid));
+
#ifdef __ENABLE_PODCAST_IN_MUSIC_MENU
// If previous view is Playback view, it can only be normal playback view
// Podcast shouldn't be highlighted in any case.
@@ -6004,7 +5967,6 @@
{
delete iDuration;
iDuration = NULL;
- TRAP_IGNORE(UpdateNaviPaneL());
}
// Cleanup view deactivation observer
@@ -6062,6 +6024,32 @@
#endif // BACKSTEPPING_INCLUDED
}
+
+
+// -----------------------------------------------------------------------------
+// checks if Now Playing option should be shown
+// -----------------------------------------------------------------------------
+//
+TBool CMPXCollectionViewHgImp::NowPlayingOptionVisibilityL()
+ {
+ MPX_FUNC( "CMPXCollectionViewHgImp::SendOptionVisibilityL" );
+ TBool isHidden( iContainer->TotalListItemCount() < 1 );
+
+ // First check if there's a local playback source
+ MMPXSource* source( iPlaybackUtility->Source() );
+ if ( source == 0 )
+ {
+ // If no local playback, check if there's a progressive download playback source.
+ MMPXPlaybackUtility* pdPlaybackUtility;
+ pdPlaybackUtility = MMPXPlaybackUtility::UtilityL( TUid::Uid( KProgressDownloadUid ) );
+ isHidden = pdPlaybackUtility->Source() ? EFalse : ETrue;
+ pdPlaybackUtility->Close();
+ }
+
+ return isHidden;
+ }
+
+
// ---------------------------------------------------------------------------
// Handle initialing a music menu pane.
// ---------------------------------------------------------------------------
@@ -6077,6 +6065,9 @@
TMPXGeneralCategory containerCategory(
containerMedia.ValueTObjectL<TMPXGeneralCategory>(
KMPXMediaGeneralCategory ) );
+
+ TMPXGeneralType containerType(
+ containerMedia.ValueTObjectL<TMPXGeneralType>( KMPXMediaGeneralType ) );
switch ( containerCategory )
{
@@ -6084,8 +6075,18 @@
{
// playlist view
aMenuPane->SetItemDimmed( EMPXCmdGoToPlaylists, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdGoToGenre, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdRefreshLibrary, ETrue );
+ aMenuPane->SetItemDimmed(EMPXCmdGoToMusicShop, iGoToMusicShopOptionHidden );
+ if (containerType != EMPXGroup ) // EMPXItem -> playlist tracks level
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdGoToArtistAlbums, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdGoToAllSongs, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdGoToPodcasts, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdGoToGenre, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdRefreshLibrary, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdMusicLibraryDetails, ETrue);
+ aMenuPane->SetItemDimmed( EMPXCmdGoToMusicShop, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdGoToMultipleMusicShop, ETrue);
+ }
break;
}
case EMPXAlbum:
@@ -6093,20 +6094,42 @@
{
// Artists & Albums view
aMenuPane->SetItemDimmed( EMPXCmdGoToArtistAlbums, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdGoToGenre, ETrue );
+ aMenuPane->SetItemDimmed(EMPXCmdGoToMusicShop, iGoToMusicShopOptionHidden );
+ if ( iContainer->IsTBoneView() ) //TBone View
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdGoToAllSongs, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdGoToPlaylists, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdGoToPodcasts, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdGoToGenre, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdRefreshLibrary, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdMusicLibraryDetails, ETrue);
+ }
break;
}
case EMPXGenre:
{
// Genre view
- aMenuPane->SetItemDimmed( EMPXCmdGoToGenre, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdRefreshLibrary, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdGoToGenre, ETrue );
+ aMenuPane->SetItemDimmed(EMPXCmdGoToMusicShop, iGoToMusicShopOptionHidden );
+ if ( containerType != EMPXGroup ) // EMPXItem -> tracks level
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdGoToAllSongs, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdGoToArtistAlbums, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdGoToPlaylists, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdGoToPodcasts, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdRefreshLibrary, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdMusicLibraryDetails, ETrue);
+ aMenuPane->SetItemDimmed( EMPXCmdGoToMusicShop, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdGoToMultipleMusicShop, ETrue);
+ }
+
break;
}
case EMPXSong:
{
+ // Song view and Genre Track view
aMenuPane->SetItemDimmed( EMPXCmdGoToAllSongs, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdRefreshLibrary, ETrue );
+ aMenuPane->SetItemDimmed(EMPXCmdGoToMusicShop, iGoToMusicShopOptionHidden );
break;
}
default:
@@ -6116,6 +6139,678 @@
}
}
// ---------------------------------------------------------------------------
+// Dynamically initialises a menu pane for the Album context
+// ---------------------------------------------------------------------------
+//
+void CMPXCollectionViewHgImp::DynInitMenuPaneAlbumL(
+ TInt aResourceId,
+ CEikMenuPane* aMenuPane )
+ {
+ MPX_FUNC( "CMPXCollectionViewHgImp::DynInitMenuPaneAlbumL" );
+ ASSERT( iContainer && aMenuPane != NULL);
+ TBool isListEmpty( iContainer->TotalListItemCount() == 0 );
+
+ switch ( aResourceId )
+ {
+ case R_MPX_COLLECTION_VIEW_MENU_1:
+ {
+ HandleInitMusicMenuPaneL(aMenuPane);
+ if ( isListEmpty )
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdGoToNowPlaying, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdFind, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdUpnpPlayVia, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdUPnPAiwCmdCopyToExternalCriteria, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdReorder, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdSend, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdDelete, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdRemove, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdPlayItem, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdCreatePlaylist, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdAddSongs, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdGoToMultipleMusicShop, ETrue);
+ }
+ else
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdGoToNowPlaying, NowPlayingOptionVisibilityL() );
+ aMenuPane->SetItemDimmed( EMPXCmdFind, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdUpnpPlayVia, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdUPnPAiwCmdCopyToExternalCriteria, ETrue );
+
+ TBool landscapeOrientation = Layout_Meta_Data::IsLandscapeOrientation();
+ if ( landscapeOrientation )
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdCreatePlaylist, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdAddSongs, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdReorder, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdSend, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdDelete, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdRemove, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdPlayItem, ETrue );
+ }
+ else
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdCreatePlaylist, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdAddSongs, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdReorder, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdSend, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdDelete, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdRemove, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdPlayItem, ETrue );
+
+ TInt usbUnblockingStatus;
+ RProperty::Get( KMPXViewPSUid,
+ KMPXUSBUnblockingPSStatus,
+ usbUnblockingStatus);
+
+ if ( iContainer->CurrentLbxItemIndex() > KErrNotFound )
+ {
+ if ( usbUnblockingStatus == EMPXUSBUnblockingPSStatusActive )
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdDelete, ETrue );
+ }
+ else
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, EFalse );
+ aMenuPane->SetItemDimmed( EMPXCmdDelete, EFalse );
+ aMenuPane->SetItemDimmed( EMPXCmdSend, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdPlayItem,
+ iContainer->IsTBoneView() ? ETrue : EFalse );
+ }
+ }
+ if ( iContainer->IsSelectedItemASong() && iContainer->IsTBoneView() )
+ {
+ if ( usbUnblockingStatus == EMPXUSBUnblockingPSStatusActive )
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdDelete, ETrue );
+ }
+ else
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, EFalse );
+ aMenuPane->SetItemDimmed( EMPXCmdDelete, EFalse );
+ }
+ }
+
+ //If Operator Music store exist, show the cascade menu with Nokia and Operator music store.
+ if ( iOperatorMusicStore )
+ {
+ aMenuPane->SetItemDimmed(EMPXCmdGoToMusicShop, ETrue);
+ }
+ else
+ {
+ aMenuPane->SetItemDimmed(EMPXCmdGoToMultipleMusicShop, ETrue);
+ }
+ }
+ }
+
+ break;
+ }
+
+ case R_MPX_COLLECTION_VIEW_MENU_2:
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdRename, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdAlbumArt, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdSongDetails, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdUseAsCascade, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdPlaylistDetails, ETrue );
+ if( !iContainer->IsTBoneView()&& (iContainer->CurrentLbxItemIndex() > KErrNotFound))
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, !iUsingNokiaService );
+ }
+ break;
+ }
+ case R_MPX_ADD_TO_PL_SUB_MENU:
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdAddToSavedPlaylist, !FindPlaylistsL() );
+ break;
+ }
+ default:
+ {
+ // Do nothing
+ break;
+ }
+ }
+ }
+
+// ---------------------------------------------------------------------------
+// Dynamically initialises a menu pane for the Playlist context
+// ---------------------------------------------------------------------------
+//
+void CMPXCollectionViewHgImp::DynInitMenuPanePlaylistL(
+ TInt aResourceId,
+ CEikMenuPane* aMenuPane )
+ {
+ MPX_FUNC( "CMPXCollectionViewHgImp::DynInitMenuPanePlaylistL" );
+
+ TBool isListEmpty( (iContainer->TotalListItemCount()) == 0 );
+
+ switch ( aResourceId )
+ {
+ case R_MPX_COLLECTION_VIEW_MENU_1:
+ {
+ HandleInitMusicMenuPaneL(aMenuPane);
+
+ aMenuPane->SetItemDimmed( EMPXCmdGoToNowPlaying, NowPlayingOptionVisibilityL() );
+ aMenuPane->SetItemDimmed( EMPXCmdFind, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdUpnpPlayVia, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdUPnPAiwCmdCopyToExternalCriteria, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdAddSongs, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdReorder, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdSend, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdDelete, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdRemove, ETrue );
+
+ TInt usbUnblockingStatus;
+ RProperty::Get( KMPXViewPSUid,
+ KMPXUSBUnblockingPSStatus,
+ usbUnblockingStatus);
+ if ( usbUnblockingStatus == EMPXUSBUnblockingPSStatusActive )
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdCreatePlaylist, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdDelete, ETrue );
+ }
+ else
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdCreatePlaylist, EFalse );
+ aMenuPane->SetItemDimmed( EMPXCmdDelete, EFalse );
+ }
+
+ TInt currentItem( iContainer->CurrentLbxItemIndex() );
+
+ CMPXCollectionViewListBoxArray* array =
+ static_cast<CMPXCollectionViewListBoxArray*>(
+ iContainer->ListBoxArray() );
+ const CMPXMedia& media = array->MediaL( currentItem );
+
+ if ( media.IsSupported( KMPXMediaGeneralNonPermissibleActions ) )
+ {
+ // check for auto playlist, disable delete
+ TMPXGeneralNonPermissibleActions attr(
+ media.ValueTObjectL<TMPXGeneralNonPermissibleActions>(
+ KMPXMediaGeneralNonPermissibleActions ) );
+ if ( attr & EMPXWrite )
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdDelete, ETrue );
+ }
+ }
+
+ TInt trackCount (0);
+ if( media.IsSupported(KMPXMediaGeneralCount) )
+ {
+ trackCount = media.ValueTObjectL<TInt>( KMPXMediaGeneralCount );
+ }
+ if( trackCount < 1 )
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdPlayItem, ETrue );
+ }
+
+ if ( iOperatorMusicStore )
+ {
+ aMenuPane->SetItemDimmed(EMPXCmdGoToMusicShop, ETrue);
+ }
+ else
+ {
+ aMenuPane->SetItemDimmed(EMPXCmdGoToMultipleMusicShop, ETrue);
+ }
+
+ break;
+ }
+
+ case R_MPX_COLLECTION_VIEW_MENU_2:
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdUseAsCascade, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdSongDetails, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdAlbumArt, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdPlaylistDetails, ETrue );
+
+ TInt currentItem( iContainer->CurrentLbxItemIndex() );
+
+ CMPXCollectionViewListBoxArray* array =
+ static_cast<CMPXCollectionViewListBoxArray*>(
+ iContainer->ListBoxArray() );
+ const CMPXMedia& media = array->MediaL( currentItem );
+
+ TInt usbUnblockingStatus;
+ RProperty::Get( KMPXViewPSUid,
+ KMPXUSBUnblockingPSStatus,
+ usbUnblockingStatus);
+ if ( usbUnblockingStatus == EMPXUSBUnblockingPSStatusActive )
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdRename, ETrue );
+ }
+ else
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdRename, EFalse );
+ }
+
+ if ( media.IsSupported(
+ KMPXMediaGeneralNonPermissibleActions ) )
+ {
+ // check for auto playlist, disable delete
+ TMPXGeneralNonPermissibleActions attr(
+ media.ValueTObjectL<TMPXGeneralNonPermissibleActions>(
+ KMPXMediaGeneralNonPermissibleActions ) );
+ if ( attr & EMPXWrite )
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdRename, ETrue );
+ // TODO: this should be an item specific command.
+ aMenuPane->SetItemDimmed( EMPXCmdPlaylistDetails, ETrue );
+ }
+ }
+ if ( array->IsItemBrokenLinkL( currentItem ) ||
+ array->IsItemCorruptedL( currentItem ) )
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdRename, ETrue );
+ // TODO: this should be an item specific command.
+ aMenuPane->SetItemDimmed( EMPXCmdPlaylistDetails, ETrue );
+ }
+
+ break;
+ }
+ default:
+ {
+ // Do nothing
+ break;
+ }
+ }
+ }
+
+
+
+// ---------------------------------------------------------------------------
+// Dynamically initialises a menu pane for the Genre context
+// ---------------------------------------------------------------------------
+//
+void CMPXCollectionViewHgImp::DynInitMenuPaneGenreL(
+ TInt aResourceId,
+ CEikMenuPane* aMenuPane )
+ {
+ MPX_FUNC( "CMPXCollectionViewHgImp::DynInitMenuPanePlaylistL" );
+
+ switch ( aResourceId )
+ {
+ case R_MPX_COLLECTION_VIEW_MENU_1:
+ {
+ HandleInitMusicMenuPaneL(aMenuPane);
+
+ aMenuPane->SetItemDimmed( EMPXCmdGoToNowPlaying, NowPlayingOptionVisibilityL() );
+ aMenuPane->SetItemDimmed( EMPXCmdFind, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdUpnpPlayVia, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdUPnPAiwCmdCopyToExternalCriteria, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdCreatePlaylist, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdAddSongs, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdReorder, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdSend, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdRemove, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdDelete, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdPlayItem, ETrue );
+
+ if ( iContainer->CurrentLbxItemIndex() > KErrNotFound )
+ {
+ TInt usbUnblockingStatus;
+ RProperty::Get( KMPXViewPSUid,
+ KMPXUSBUnblockingPSStatus,
+ usbUnblockingStatus);
+ if ( usbUnblockingStatus == EMPXUSBUnblockingPSStatusActive )
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, ETrue );
+ }
+ else
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, EFalse );
+ aMenuPane->SetItemDimmed( EMPXCmdPlayItem, EFalse );
+ }
+ }
+
+ if ( iOperatorMusicStore )
+ {
+ aMenuPane->SetItemDimmed(EMPXCmdGoToMusicShop, ETrue);
+ }
+ else
+ {
+ aMenuPane->SetItemDimmed(EMPXCmdGoToMultipleMusicShop, ETrue);
+ }
+ break;
+ }
+
+ case R_MPX_COLLECTION_VIEW_MENU_2:
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdUseAsCascade, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdSongDetails, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdRename, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdAlbumArt, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdPlaylistDetails, ETrue );
+
+ aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, !iUsingNokiaService );
+ break;
+ }
+ case R_MPX_ADD_TO_PL_SUB_MENU:
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdAddToSavedPlaylist, !FindPlaylistsL() );
+ break;
+ }
+ default:
+ {
+ // Do nothing
+ break;
+ }
+ }
+ }
+
+
+// ---------------------------------------------------------------------------
+// Dynamically initialises a menu pane for the Songs context
+// Handling for any tracks view except playlist tracks.
+// ---------------------------------------------------------------------------
+//
+void CMPXCollectionViewHgImp::DynInitMenuPaneSongsL(
+ TInt aResourceId,
+ CEikMenuPane* aMenuPane )
+ {
+ MPX_FUNC( "CMPXCollectionViewHgImp::DynInitMenuPaneAllSongsL" );
+
+ TBool isListEmpty( iContainer->TotalListItemCount() == 0 );
+ TInt selectionCount( 0 );
+ iSelectionIndexCache = iContainer->CurrentSelectionIndicesL(); // not owned
+ switch ( aResourceId )
+ {
+ case R_MPX_COLLECTION_VIEW_MENU_1:
+ {
+ HandleInitMusicMenuPaneL(aMenuPane);
+ if ( isListEmpty )
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdGoToNowPlaying, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdFind, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdUpnpPlayVia, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdUPnPAiwCmdCopyToExternalCriteria, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdCreatePlaylist, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdAddSongs, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdReorder, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdSend, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdDelete, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdRemove, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdPlayItem, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdGoToMultipleMusicShop, ETrue);
+ }
+ else
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdGoToNowPlaying, NowPlayingOptionVisibilityL() );
+ aMenuPane->SetItemDimmed( EMPXCmdFind, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdUpnpPlayVia, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdUPnPAiwCmdCopyToExternalCriteria, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdCreatePlaylist, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdAddSongs, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdReorder, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdSend, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdRemove, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdDelete, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdPlayItem, ETrue );
+
+ TInt usbUnblockingStatus;
+ RProperty::Get( KMPXViewPSUid,
+ KMPXUSBUnblockingPSStatus,
+ usbUnblockingStatus);
+
+ if ( iContainer->IsSelectedItemASong() )
+ {
+ if ( usbUnblockingStatus == EMPXUSBUnblockingPSStatusActive )
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdSend, SendOptionVisibilityL() );
+ aMenuPane->SetItemDimmed( EMPXCmdDelete, ETrue );
+ }
+ else
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, EFalse );
+ aMenuPane->SetItemDimmed( EMPXCmdSend, SendOptionVisibilityL() );
+ aMenuPane->SetItemDimmed( EMPXCmdDelete, EFalse );
+ }
+ }
+ if ( iOperatorMusicStore )
+ {
+ aMenuPane->SetItemDimmed(EMPXCmdGoToMusicShop, ETrue);
+ }
+ else
+ {
+ aMenuPane->SetItemDimmed(EMPXCmdGoToMultipleMusicShop, ETrue);
+ }
+ }
+
+ break;
+ }
+
+ case R_MPX_COLLECTION_VIEW_MENU_2:
+ {
+
+
+ if ( iSelectionIndexCache)
+ {
+ selectionCount = iSelectionIndexCache->Count();
+ }
+ if ( selectionCount > 0 )
+ {
+ // multiple selection
+ aMenuPane->SetItemDimmed( EMPXCmdUseAsCascade, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdSongDetails, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdAlbumArt, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, ETrue );
+ }
+ else
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdSongDetails,
+ FileDetailsOptionVisibilityL() );
+ aMenuPane->SetItemDimmed( EMPXCmdAlbumArt, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdUseAsCascade, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, ETrue );
+
+ TInt currentItem( iContainer->CurrentLbxItemIndex() );
+ if ( currentItem > KErrNotFound )
+ {
+ CMPXCollectionViewListBoxArray* array =
+ static_cast<CMPXCollectionViewListBoxArray*>(
+ iContainer->ListBoxArray() );
+
+ if ( array->IsItemBrokenLinkL( currentItem ) ||
+ array->IsItemCorruptedL( currentItem ) )
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdUseAsCascade, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdSongDetails, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdAlbumArt, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, ETrue );
+ }
+ aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, !iUsingNokiaService );
+ }
+ }
+ aMenuPane->SetItemDimmed( EMPXCmdRename, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdPlaylistDetails, ETrue );
+ if (iServiceHandler->HandleSubmenuL(*aMenuPane))
+ {
+ return;
+ }
+
+ break;
+ }
+ case R_MPX_ADD_TO_PL_SUB_MENU:
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdAddToSavedPlaylist, !FindPlaylistsL() );
+ break;
+ }
+ default:
+ {
+ // Do nothing
+ break;
+ }
+ }
+ }
+
+
+
+// ---------------------------------------------------------------------------
+// Dynamically initialises a menu pane for the playlist Songs context
+// ---------------------------------------------------------------------------
+//
+void CMPXCollectionViewHgImp::DynInitMenuPanePlaylistSongsL(
+ TInt aResourceId,
+ CEikMenuPane* aMenuPane )
+ {
+ MPX_FUNC( "CMPXCollectionViewHgImp::DynInitMenuPanePlaylistSongsL" );
+
+ TBool isListEmpty( iContainer->TotalListItemCount() == 0 );
+
+ switch ( aResourceId )
+ {
+ case R_MPX_COLLECTION_VIEW_MENU_1:
+ {
+ HandleInitMusicMenuPaneL(aMenuPane);
+
+ if ( isListEmpty )
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdGoToNowPlaying, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdFind, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdUpnpPlayVia, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdUPnPAiwCmdCopyToExternalCriteria, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdCreatePlaylist, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdReorder, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdSend, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdDelete, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdRemove, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdPlayItem, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdAddSongs, EFalse );
+ }
+ else
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdGoToNowPlaying, NowPlayingOptionVisibilityL() );
+ aMenuPane->SetItemDimmed( EMPXCmdUpnpPlayVia, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdUPnPAiwCmdCopyToExternalCriteria, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdFind, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdCreatePlaylist, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdReorder, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdDelete, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdSend, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdRemove, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdPlayItem, ETrue );
+
+ TInt usbUnblockingStatus;
+ RProperty::Get( KMPXViewPSUid,
+ KMPXUSBUnblockingPSStatus,
+ usbUnblockingStatus);
+
+ if ( usbUnblockingStatus == EMPXUSBUnblockingPSStatusActive )
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdAddSongs, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdSend, SendOptionVisibilityL() );
+ aMenuPane->SetItemDimmed( EMPXCmdRemove, ETrue );
+ }
+ else
+ {
+ TInt selectionCount( 0 );
+ iSelectionIndexCache = iContainer->CurrentSelectionIndicesL(); // not owned
+ if ( iSelectionIndexCache)
+ {
+ selectionCount = iSelectionIndexCache->Count();
+ }
+ // do not display add songs option when marking is on
+ aMenuPane->SetItemDimmed( EMPXCmdAddSongs, selectionCount > 0 );
+
+ if ( iContainer->CurrentLbxItemIndex() > KErrNotFound )
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdSend, SendOptionVisibilityL() );
+ aMenuPane->SetItemDimmed( EMPXCmdRemove, EFalse );
+ }
+ }
+
+ CMPXCollectionViewListBoxArray* array =
+ static_cast<CMPXCollectionViewListBoxArray*>(
+ iContainer->ListBoxArray() );
+ const CMPXMedia& containerMedia = array->ContainerMedia();
+
+ if ( containerMedia.IsSupported( KMPXMediaGeneralNonPermissibleActions ) )
+ {
+ // check for auto playlist, disable add, remove and reorder
+ TMPXGeneralNonPermissibleActions attr(
+ containerMedia.ValueTObjectL<TMPXGeneralNonPermissibleActions>(
+ KMPXMediaGeneralNonPermissibleActions ) );
+ if ( attr & EMPXWrite )
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdAddSongs, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdReorder, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdRemove, ETrue );
+ }
+ }
+ }
+
+ break;
+ }
+
+ case R_MPX_COLLECTION_VIEW_MENU_2:
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdRename, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdPlaylistDetails, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdUseAsCascade, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdAlbumArt, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, ETrue );
+
+ TInt selectionCount( 0 );
+ iSelectionIndexCache = iContainer->CurrentSelectionIndicesL(); // not owned
+ if ( iSelectionIndexCache)
+ {
+ selectionCount = iSelectionIndexCache->Count();
+ }
+ if ( selectionCount > 0 )
+ {
+ // multiple selection
+ aMenuPane->SetItemDimmed( EMPXCmdSongDetails, ETrue );
+ aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, ETrue );
+ }
+ else
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdSongDetails,
+ FileDetailsOptionVisibilityL() );
+
+ TInt currentItem( iContainer->CurrentLbxItemIndex() );
+
+ if ( currentItem > KErrNotFound )
+ {
+ CMPXCollectionViewListBoxArray* array =
+ static_cast<CMPXCollectionViewListBoxArray*>(
+ iContainer->ListBoxArray() );
+ if ( array->IsItemBrokenLinkL( currentItem ) ||
+ array->IsItemCorruptedL( currentItem ) )
+ {
+ aMenuPane->SetItemDimmed( EMPXCmdSongDetails, ETrue );
+ }
+ aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, !iUsingNokiaService );
+ }
+ }
+ if (iServiceHandler->HandleSubmenuL(*aMenuPane))
+ {
+ return;
+ }
+
+ break;
+ }
+ default:
+ {
+ // Do nothing
+ break;
+ }
+ }
+ }
+
+// ---------------------------------------------------------------------------
// From MEikMenuObserver
// Dynamically initialises a menu pane.
// ---------------------------------------------------------------------------
@@ -6125,701 +6820,82 @@
CEikMenuPane* aMenuPane )
{
MPX_FUNC( "CMPXCollectionViewHgImp::DynInitMenuPaneL" );
+
CMPXCollectionViewListBoxArray* array =
static_cast<CMPXCollectionViewListBoxArray*>(
iContainer->ListBoxArray() );
- TInt currentItem( iContainer->CurrentLbxItemIndex() );
- TBool isListEmpty( currentItem < 0 );
- TInt selectionCount( 0 );
-
- iSelectionIndexCache = iContainer->CurrentSelectionIndicesL(); // not owned
- if ( iSelectionIndexCache)
- {
- selectionCount = iSelectionIndexCache->Count();
- }
+ const CMPXMedia& containerMedia = array->ContainerMedia();
+ TMPXGeneralType containerType(
+ containerMedia.ValueTObjectL<TMPXGeneralType>( KMPXMediaGeneralType ) );
+ TMPXGeneralCategory containerCategory(
+ containerMedia.ValueTObjectL<TMPXGeneralCategory>(
+ KMPXMediaGeneralCategory ) );
TInt usbUnblockingStatus;
RProperty::Get( KMPXViewPSUid,
KMPXUSBUnblockingPSStatus,
usbUnblockingStatus);
+ // We first construct options menu based on collection browsing context.
+ // For resource R_MPX_COLLECTION_VIEW_MENU_1, R_MPX_COLLECTION_VIEW_MENU_2.
+ if ( containerType == EMPXGroup )
+ {
+ switch (containerCategory)
+ {
+ case EMPXCollection:
+ break;
+ case EMPXArtist:
+ break;
+ case EMPXAlbum:
+ // Artist & Album view
+ DynInitMenuPaneAlbumL(aResourceId, aMenuPane);
+ break;
+ case EMPXPlaylist:
+ // Playlist view
+ DynInitMenuPanePlaylistL(aResourceId, aMenuPane);
+ break;
+ case EMPXSong:
+ // Songs (All Songs) View
+ DynInitMenuPaneSongsL(aResourceId, aMenuPane);
+ break;
+ case EMPXGenre:
+ // Genre View
+ DynInitMenuPaneGenreL(aResourceId, aMenuPane);
+ break;
+ case EMPXComposer:
+ break;
+ default:
+ User::Leave(KErrNotSupported);
+ break;
+ }
+ }
+ else if ( containerType == EMPXItem )
+ {
+ switch (containerCategory)
+ {
+ case EMPXSong:
+ break;
+ case EMPXArtist:
+ break;
+ case EMPXPlaylist:
+ // Playlist tracks view
+ DynInitMenuPanePlaylistSongsL(aResourceId, aMenuPane);
+ break;
+ case EMPXAlbum:
+ case EMPXGenre:
+ case EMPXComposer:
+ // Other tracks view
+ DynInitMenuPaneSongsL(aResourceId, aMenuPane);
+ break;
+ default:
+ User::Leave(KErrNotSupported);
+ break;
+ }
+ }
+
+ // Handle other menu resources.
switch ( aResourceId )
{
- case R_MPX_COLLECTION_VIEW_MENU_1:
- {
- const CMPXMedia& containerMedia = array->ContainerMedia();
- TMPXGeneralType containerType(
- containerMedia.ValueTObjectL<TMPXGeneralType>( KMPXMediaGeneralType ) );
- TMPXGeneralCategory containerCategory(
- containerMedia.ValueTObjectL<TMPXGeneralCategory>(
- KMPXMediaGeneralCategory ) );
-
- HandleInitMusicMenuPaneL(aMenuPane);
-
- MPX_DEBUG3( "CMPXCollectionViewHgImp::DynInitMenuPaneL container type = %d, category = %d", containerType, containerCategory );
-
- // Always dim the find in hg implementation
- aMenuPane->SetItemDimmed( EMPXCmdFind, ETrue );
-
- // Determine if we should hide "Goto now playing" option.
- TBool hideNowPlaying(EFalse);
- MMPXSource* source( iPlaybackUtility->Source() );
- if ( source == 0 )
- {
- MMPXPlaybackUtility* pdPlaybackUtility;
- pdPlaybackUtility = MMPXPlaybackUtility::UtilityL( TUid::Uid( KProgressDownloadUid ) );
- hideNowPlaying = pdPlaybackUtility->Source() ? EFalse : ETrue;
- pdPlaybackUtility->Close();
- }
- if (usbUnblockingStatus == EMPXUSBUnblockingPSStatusActive)
- {
- aMenuPane->SetItemDimmed( EMPXCmdRefreshLibrary, ETrue );
- }
-
- aMenuPane->SetItemDimmed( EMPXCmdGoToNowPlaying, hideNowPlaying );
-
- if ( !isListEmpty )
- {
- const CMPXMedia& media = array->MediaL( currentItem );
- TMPXGeneralType type(
- media.ValueTObjectL<TMPXGeneralType>( KMPXMediaGeneralType ) );
- TMPXGeneralCategory category(
- media.ValueTObjectL<TMPXGeneralCategory>(
- KMPXMediaGeneralCategory ) );
- MPX_DEBUG3( "CMPXCollectionViewHgImp::DynInitMenuPaneL item type = %d, category = %d", type, category );
-#ifdef SINGLE_CLICK_INCLUDED
- if ( containerType == EMPXGroup && containerCategory == EMPXAlbum )
- {
- // Artists & Albums view
- switch ( category )
- {
- case EMPXAlbum:
- {
- TBool landscapeOrientation = Layout_Meta_Data::IsLandscapeOrientation();
- if ( landscapeOrientation )
- {
- aMenuPane->SetItemDimmed( EMPXCmdCreatePlaylist, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdAddSongs, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdReorder, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdSend, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdDelete, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdRemove, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdPlayItem, ETrue );
- }
- else
- {
- if ( usbUnblockingStatus == EMPXUSBUnblockingPSStatusActive )
- {
- aMenuPane->SetItemDimmed( EMPXCmdCreatePlaylist, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdAddSongs, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdReorder, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdSend, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdDelete, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdRemove, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdPlayItem, EFalse );
- }
- else
- {
- aMenuPane->SetItemDimmed( EMPXCmdCreatePlaylist, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, EFalse );
- aMenuPane->SetItemDimmed( EMPXCmdAddSongs, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdReorder, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdSend, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdDelete, EFalse );
- aMenuPane->SetItemDimmed( EMPXCmdRemove, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdPlayItem, EFalse );
- }
- }
- break;
- }
- case EMPXCommand:
- {
- aMenuPane->SetItemDimmed( EMPXCmdCreatePlaylist, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdAddSongs, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdReorder, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdSend, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdDelete, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdRemove, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdPlayItem, ETrue );
- break;
- }
- }
- }
- else
-#endif
- if ( containerType == EMPXItem && containerCategory == EMPXPlaylist )
- {
- // in playlist tracks view
- // enable reordering and add songs in playlist view
- aMenuPane->SetItemDimmed( EMPXCmdCreatePlaylist, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, ETrue );
- if ( usbUnblockingStatus == EMPXUSBUnblockingPSStatusActive )
- {
- aMenuPane->SetItemDimmed( EMPXCmdAddSongs, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdReorder, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdSend, SendOptionVisibilityL() );
- aMenuPane->SetItemDimmed( EMPXCmdDelete, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdRemove, ETrue );
-#ifdef SINGLE_CLICK_INCLUDED
- aMenuPane->SetItemDimmed( EMPXCmdPlayItem, ETrue );
-#endif
-
- }
- else
- {
- // do not display add songs option when marking is on
- aMenuPane->SetItemDimmed( EMPXCmdAddSongs, selectionCount > 0 );
- TInt totalItemCount( iContainer->TotalListItemCount() );
- // display reorder option only when more than 1 item is visible
- // do not display reorder option when marking is on
-#ifdef SINGLE_CLICK_INCLUDED
- aMenuPane->SetItemDimmed( EMPXCmdReorder, ETrue );
-#else
- aMenuPane->SetItemDimmed( EMPXCmdReorder,
- ( totalItemCount > 1 && selectionCount == 0 ) ?
- EFalse : ETrue );
-#endif
- aMenuPane->SetItemDimmed( EMPXCmdSend, SendOptionVisibilityL() );
- aMenuPane->SetItemDimmed( EMPXCmdDelete, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdRemove, EFalse );
-#ifdef SINGLE_CLICK_INCLUDED
- aMenuPane->SetItemDimmed( EMPXCmdPlayItem, ETrue );
-#endif
- }
-
- if ( containerMedia.IsSupported(
- KMPXMediaGeneralNonPermissibleActions ) )
- {
- // check for auto playlist, disable add, remove and reorder
- TMPXGeneralNonPermissibleActions attr(
- containerMedia.ValueTObjectL<TMPXGeneralNonPermissibleActions>(
- KMPXMediaGeneralNonPermissibleActions ) );
- if ( attr & EMPXWrite )
- {
- aMenuPane->SetItemDimmed( EMPXCmdAddSongs, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdReorder, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdRemove, ETrue );
- }
- }
- }
- else if ( type == EMPXItem )
- {
- switch ( category )
- {
- case EMPXPlaylist:
- {
- // playlist view
- if ( usbUnblockingStatus == EMPXUSBUnblockingPSStatusActive )
- {
- aMenuPane->SetItemDimmed( EMPXCmdCreatePlaylist, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdAddSongs, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdReorder, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdSend, SendOptionVisibilityL() );
- aMenuPane->SetItemDimmed( EMPXCmdDelete, ETrue );
- }
- else
- {
- aMenuPane->SetItemDimmed( EMPXCmdCreatePlaylist, EFalse );
- aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdAddSongs, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdReorder, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdSend, SendOptionVisibilityL() );
- aMenuPane->SetItemDimmed( EMPXCmdDelete, EFalse );
- }
- if ( media.IsSupported(
- KMPXMediaGeneralNonPermissibleActions ) )
- {
- // check for auto playlist, disable delete
- TMPXGeneralNonPermissibleActions attr(
- media.ValueTObjectL<TMPXGeneralNonPermissibleActions>(
- KMPXMediaGeneralNonPermissibleActions ) );
- if ( attr & EMPXWrite )
- {
- aMenuPane->SetItemDimmed( EMPXCmdDelete, ETrue );
- }
- }
- aMenuPane->SetItemDimmed( EMPXCmdRemove, ETrue );
- TInt trackCount (0);
- if(media.IsSupported(KMPXMediaGeneralCount))
- {
- trackCount = media.ValueTObjectL<TInt>( KMPXMediaGeneralCount );
- }
- if( trackCount < 1 )
- {
- aMenuPane->SetItemDimmed( EMPXCmdPlayItem, ETrue );
- }
- break;
- }
-#ifdef SINGLE_CLICK_INCLUDED
- case EMPXAlbum:
- {
- // Album > Tracks view
- if ( iContainer->IsSelectedItemASong() )
- {
- if ( usbUnblockingStatus == EMPXUSBUnblockingPSStatusActive )
- {
- aMenuPane->SetItemDimmed( EMPXCmdCreatePlaylist, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdAddSongs, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdReorder, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdSend, SendOptionVisibilityL() );
- aMenuPane->SetItemDimmed( EMPXCmdDelete, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdRemove, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdPlayItem, ETrue );
- }
- else
- {
- aMenuPane->SetItemDimmed( EMPXCmdCreatePlaylist, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, EFalse );
- aMenuPane->SetItemDimmed( EMPXCmdAddSongs, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdReorder, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdSend, SendOptionVisibilityL() );
- aMenuPane->SetItemDimmed( EMPXCmdDelete, EFalse );
- aMenuPane->SetItemDimmed( EMPXCmdRemove, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdPlayItem, ETrue );
- }
- }
- else
- {
- aMenuPane->SetItemDimmed( EMPXCmdCreatePlaylist, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdAddSongs, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdReorder, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdSend, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdDelete, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdRemove, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdPlayItem, ETrue );
- }
- break;
- }
- case EMPXGenre:
- {
- // genre view
- if ( usbUnblockingStatus == EMPXUSBUnblockingPSStatusActive )
- {
- aMenuPane->SetItemDimmed( EMPXCmdCreatePlaylist, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdAddSongs, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdReorder, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdSend, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdDelete, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdRemove, ETrue );
- }
- else
- {
- aMenuPane->SetItemDimmed( EMPXCmdCreatePlaylist, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, EFalse );
- aMenuPane->SetItemDimmed( EMPXCmdAddSongs, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdReorder, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdSend, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdDelete, EFalse );
- aMenuPane->SetItemDimmed( EMPXCmdRemove, ETrue );
- }
- break;
- }
-#endif
-
-#ifdef SINGLE_CLICK_INCLUDED
- case EMPXArtist:
- case EMPXComposer:
-#else
- case EMPXAlbum:
- case EMPXArtist:
- case EMPXGenre:
- case EMPXComposer:
-#endif
- {
- // artist, album, genre, composer view
- if ( usbUnblockingStatus == EMPXUSBUnblockingPSStatusActive )
- {
- aMenuPane->SetItemDimmed( EMPXCmdCreatePlaylist, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdAddSongs, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdReorder, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdSend, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdDelete, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdRemove, ETrue );
- }
- else
- {
- aMenuPane->SetItemDimmed( EMPXCmdCreatePlaylist, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, EFalse );
- aMenuPane->SetItemDimmed( EMPXCmdAddSongs, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdReorder, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdSend, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdDelete, EFalse );
- aMenuPane->SetItemDimmed( EMPXCmdRemove, ETrue );
- }
- break;
- }
- case EMPXSong:
- {
- // any tracks view except playlist tracks
- if ( usbUnblockingStatus == EMPXUSBUnblockingPSStatusActive )
- {
- aMenuPane->SetItemDimmed( EMPXCmdCreatePlaylist, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdAddSongs, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdReorder, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdSend, SendOptionVisibilityL() );
- aMenuPane->SetItemDimmed( EMPXCmdDelete, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdRemove, ETrue );
-#ifdef SINGLE_CLICK_INCLUDED
- aMenuPane->SetItemDimmed( EMPXCmdPlayItem, ETrue );
-#endif
- }
- else
- {
- aMenuPane->SetItemDimmed( EMPXCmdCreatePlaylist, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, EFalse );
- aMenuPane->SetItemDimmed( EMPXCmdAddSongs, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdReorder, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdSend, SendOptionVisibilityL() );
- aMenuPane->SetItemDimmed( EMPXCmdDelete, EFalse );
- aMenuPane->SetItemDimmed( EMPXCmdRemove, ETrue );
-#ifdef SINGLE_CLICK_INCLUDED
- aMenuPane->SetItemDimmed( EMPXCmdPlayItem, ETrue );
-#endif
- }
- break;
- }
- case EMPXCommand:
- {
- aMenuPane->SetItemDimmed( EMPXCmdCreatePlaylist, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdAddSongs, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdReorder, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdSend, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdDelete, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdRemove, ETrue );
-#ifdef SINGLE_CLICK_INCLUDED
- aMenuPane->SetItemDimmed( EMPXCmdPlayItem, ETrue );
-#endif
-
- }
- break;
- default:
- {
- ASSERT( 0 );
- break;
- }
- }
- }
-
- if ( iUpnpFrameworkSupport )
- {
- HandleDynInitUpnpL( aResourceId, *aMenuPane );
- }
- else
- {
- aMenuPane->SetItemDimmed( EMPXCmdUpnpPlayVia, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdUPnPAiwCmdCopyToExternalCriteria, ETrue );
- }
- }
- else
- {
- // list empty
-
- aMenuPane->SetItemDimmed( EMPXCmdCreatePlaylist,
- ( containerType == EMPXGroup && containerCategory == EMPXPlaylist) ? // in playlist view?
- EFalse : ETrue );
- if ( containerType == EMPXItem && containerCategory == EMPXPlaylist)
- {
- // in playlist tracks view
- if ( containerMedia.IsSupported(
- KMPXMediaGeneralNonPermissibleActions ) )
- {
- // check for auto playlist, disable add songs
- TMPXGeneralNonPermissibleActions attr(
- containerMedia.ValueTObjectL<TMPXGeneralNonPermissibleActions>(
- KMPXMediaGeneralNonPermissibleActions ) );
- if ( attr & EMPXWrite )
- {
- aMenuPane->SetItemDimmed( EMPXCmdAddSongs, ETrue );
- }
- }
- }
- else
- {
- aMenuPane->SetItemDimmed( EMPXCmdAddSongs, ETrue );
- }
- aMenuPane->SetItemDimmed( EMPXCmdUpnpPlayVia, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdUPnPAiwCmdCopyToExternalCriteria, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdAddToPlaylist, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdReorder, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdSend, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdDelete, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdRemove, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdPlayItem, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdGoToNowPlaying, ETrue );
- }
- break;
- }
- case R_MPX_COLLECTION_VIEW_MENU_2:
- {
- if ( !isListEmpty )
- {
- const CMPXMedia& media = array->MediaL( currentItem );
- TMPXGeneralType type(
- media.ValueTObjectL<TMPXGeneralType>( KMPXMediaGeneralType ) );
- TMPXGeneralCategory category(
- media.ValueTObjectL<TMPXGeneralCategory>(
- KMPXMediaGeneralCategory ) );
- const CMPXMedia& containerMedia = array->ContainerMedia();
- TMPXGeneralType containerType(
- containerMedia.ValueTObjectL<TMPXGeneralType>(
- KMPXMediaGeneralType ) );
- TMPXGeneralCategory containerCategory(
- containerMedia.ValueTObjectL<TMPXGeneralCategory>(
- KMPXMediaGeneralCategory ) );
- MPX_DEBUG3( "CMPXCollectionViewHgImp::DynInitMenuPaneL container type = %d, category = %d", containerType, containerCategory );
- MPX_DEBUG3( "CMPXCollectionViewHgImp::DynInitMenuPaneL item type = %d, category = %d", type, category );
- if ( type == EMPXItem)
- {
- switch ( category )
- {
- case EMPXPlaylist:
- {
- // playlist view
- aMenuPane->SetItemDimmed( EMPXCmdUseAsCascade, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdSongDetails, ETrue );
- if ( usbUnblockingStatus == EMPXUSBUnblockingPSStatusActive )
- {
- aMenuPane->SetItemDimmed( EMPXCmdRename, ETrue );
- }
- else
- {
- aMenuPane->SetItemDimmed( EMPXCmdRename, EFalse );
- }
- aMenuPane->SetItemDimmed( EMPXCmdAlbumArt, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdPlaylistDetails, EFalse );
- if ( media.IsSupported(
- KMPXMediaGeneralNonPermissibleActions ) )
- {
- // check for auto playlist, disable delete
- TMPXGeneralNonPermissibleActions attr(
- media.ValueTObjectL<TMPXGeneralNonPermissibleActions>(
- KMPXMediaGeneralNonPermissibleActions ) );
- if ( attr & EMPXWrite )
- {
- aMenuPane->SetItemDimmed( EMPXCmdRename, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdPlaylistDetails, ETrue );
- }
- }
- if ( array->IsItemBrokenLinkL( currentItem ) ||
- array->IsItemCorruptedL( currentItem ) )
- {
- aMenuPane->SetItemDimmed( EMPXCmdRename, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdPlaylistDetails, ETrue );
- }
- break;
- }
- case EMPXAlbum:
- case EMPXArtist:
- case EMPXGenre:
- case EMPXComposer:
- {
- // artist, album, genre, composer view
- aMenuPane->SetItemDimmed( EMPXCmdUseAsCascade, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdSongDetails, ETrue );
- if ( usbUnblockingStatus == EMPXUSBUnblockingPSStatusActive )
- {
- aMenuPane->SetItemDimmed( EMPXCmdRename, ETrue );
- }
- else
- {
-#ifdef SINGLE_CLICK_INCLUDED
- aMenuPane->SetItemDimmed( EMPXCmdRename, ETrue );
-#else
- aMenuPane->SetItemDimmed( EMPXCmdRename, EFalse );
-#endif
- }
-#ifndef SINGLE_CLICK_INCLUDED
- if ( category == EMPXAlbum )
- {
- aMenuPane->SetItemDimmed( EMPXCmdAlbumArt, EFalse );
- // if unknown entry exist in album level, disable album art
- // for last item, if unknown exist it'll be at this
- // location
- if ( array->IsCategoryUnknownExist() &&
- category == EMPXAlbum &&
- currentItem == iContainer->TotalListItemCount() - 1 )
- {
- aMenuPane->SetItemDimmed( EMPXCmdAlbumArt, ETrue );
- }
- if ( containerCategory == EMPXArtist )
- {
- // in artist/album view, do not display album art/rename
- // option on All ( first item in list )
- if ( currentItem == 0 )
- {
- aMenuPane->SetItemDimmed( EMPXCmdRename, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdAlbumArt, ETrue );
- }
- }
- }
- else
-#endif
- {
- aMenuPane->SetItemDimmed( EMPXCmdAlbumArt, ETrue );
- }
-#ifdef SINGLE_CLICK_INCLUDED
- if ( category == EMPXComposer )
-#else
- if ( ( category == EMPXGenre ) || ( category == EMPXComposer ) )
-#endif
- {
- aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, ETrue );
- }
-#ifdef SINGLE_CLICK_INCLUDED
- else if ( category == EMPXGenre )
- {
- aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, EFalse );
- }
-#endif
- else
- {
- if ( array->IsCategoryUnknownExist() &&
- ( category == EMPXAlbum || category == EMPXArtist ) &&
- currentItem == iContainer->TotalListItemCount() - 1 )
- {
- // if unknown entry exist in artist or album level
- aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, ETrue );
- }
- else
- {
-#ifdef SINGLE_CLICK_INCLUDED
- aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, ETrue );
-#else
- aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, EFalse );
-#endif
- }
- }
- aMenuPane->SetItemDimmed( EMPXCmdPlaylistDetails, ETrue );
-
- if ( !iUsingNokiaService )
- {
- aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, ETrue );
- }
- break;
- }
- case EMPXSong:
- {
- // any tracks view
-#ifdef __ENABLE_MSK
- // show context menu if MSK selected and there are
- // multiple selections; otherwise, show options menu
- if ( ( selectionCount > 0 ) && iShowContextMenu )
- {
- MenuBar()->SetMenuType(CEikMenuBar::EMenuContext);
- iShowContextMenu = EFalse;
- }
- else
- {
- MenuBar()->SetMenuType(CEikMenuBar::EMenuOptions);
- }
-#endif //__ENABLE_MSK
-
- if ( selectionCount > 0 )
- {
- // multiple selection
- aMenuPane->SetItemDimmed( EMPXCmdUseAsCascade, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdSongDetails, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdAlbumArt, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, ETrue );
- }
- else
- {
- TBool fileDetailVisibility( FileDetailsOptionVisibilityL() );
- // use the same criteria for showing/hiding song details
- // and album art
- aMenuPane->SetItemDimmed( EMPXCmdSongDetails,
- fileDetailVisibility );
- aMenuPane->SetItemDimmed( EMPXCmdAlbumArt, ETrue );
-#ifdef SINGLE_CLICK_INCLUDED
- aMenuPane->SetItemDimmed( EMPXCmdUseAsCascade, ETrue );
-#else
- TBool vis = ETrue;
- TRAPD( err, vis = SetAsRingToneOptionVisibilityL() );
-
- if ( err )
- {
- aMenuPane->SetItemDimmed( EMPXCmdUseAsCascade,
- ETrue); // dim the option if any sql error.
- }
- else
- {
- aMenuPane->SetItemDimmed( EMPXCmdUseAsCascade,
- vis);
- }
-#endif
-
- if ( array->IsItemBrokenLinkL( currentItem ) ||
- array->IsItemCorruptedL( currentItem ) )
- {
- aMenuPane->SetItemDimmed( EMPXCmdUseAsCascade, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdSongDetails, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdAlbumArt, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, ETrue );
- }
- else // Show this option even when song is DRM protected
- {
-#ifdef SINGLE_CLICK_INCLUDED
- aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, ETrue );
-#else
- aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, EFalse );
-#endif
- }
- }
- aMenuPane->SetItemDimmed( EMPXCmdRename, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdPlaylistDetails, ETrue );
- if ( !iUsingNokiaService )
- {
- aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, ETrue );
- }
- if (iServiceHandler->HandleSubmenuL(*aMenuPane))
- {
- return;
- }
- break;
- }
- case EMPXCommand:
- {
- aMenuPane->SetItemDimmed( EMPXCmdUseAsCascade, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdSongDetails, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdRename, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdAlbumArt, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdPlaylistDetails, ETrue );
-
- }
- break;
- default:
- {
- // other types, not handled
- break;
- }
- }
- }
- }
- else
- {
- // list empty
- aMenuPane->SetItemDimmed( EMPXCmdUseAsCascade, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdSongDetails, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdRename, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdAlbumArt, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, ETrue );
- aMenuPane->SetItemDimmed( EMPXCmdPlaylistDetails, ETrue );
- }
- aMenuPane->SetItemDimmed( EAknCmdExit, iExitOptionHidden );
- break;
- }
case R_MPX_ADD_TO_PL_SUB_MENU:
{
aMenuPane->SetItemDimmed( EMPXCmdAddToSavedPlaylist, !FindPlaylistsL() );
@@ -6833,43 +6909,13 @@
}
break;
}
- case R_MPX_COLLECTION_VIEW_MUSIC_MENU:
- {
- MMPXPlaybackUtility* pdPlaybackUtility;
- pdPlaybackUtility = MMPXPlaybackUtility::UtilityL( TUid::Uid( KProgressDownloadUid ) );
- MMPXSource* pdsource( pdPlaybackUtility->Source() );
- MMPXSource* source( iPlaybackUtility->Source() );
- TBool hideNowPlaying;
- hideNowPlaying = ( (pdsource == 0)
- && (source == 0));
- pdPlaybackUtility->Close();
- if ( hideNowPlaying )
- {
- aMenuPane->SetItemDimmed( EMPXCmdGoToNowPlaying, ETrue );
- }
- if (usbUnblockingStatus == EMPXUSBUnblockingPSStatusActive)
- {
- aMenuPane->SetItemDimmed( EMPXCmdRefreshLibrary, ETrue );
- }
- aMenuPane->SetItemDimmed( EAknCmdExit, iExitOptionHidden );
- aMenuPane->SetItemDimmed(
- EMPXCmdGoToMusicShop, iGoToMusicShopOptionHidden );
- if (iOperatorMusicStore)
- {
- aMenuPane->SetItemDimmed(EMPXCmdGoToMusicShop, ETrue);
- }
- else
- {
- aMenuPane->SetItemDimmed(EMPXCmdGoToMultipleMusicShop, ETrue);
- }
- break;
- }
case R_MPX_COLLECTION_VIEW_EMBEDDED_PLAYLIST_VIEW:
{
// if it's from browser/messaging, display save option if
// it has not been saved
aMenuPane->SetItemDimmed( EMPXCmdSavePlaylist,
( !iCommonUiHelper->IsHostMessagingBrowserL() || !MPXTlsHelper::NeedSave() ) );
+ TBool isListEmpty( iContainer->TotalListItemCount() == 0 );
aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, isListEmpty );
break;
@@ -6896,20 +6942,6 @@
}
}
-#ifndef SINGLE_CLICK_INCLUDED
- if ( iServiceHandler->IsAiwMenu(aResourceId) && aResourceId == R_MPX_USE_AS_CASCADE )
- {
- MPX_DEBUG1( "CMPXCollectionViewHgImp::DynInitMenuPaneL(): Aiw menu for assign" );
- CAiwGenericParamList& paramList = iServiceHandler->InParamListL();
- FillAiwParametersL(paramList);
- iServiceHandler->InitializeMenuPaneL(*aMenuPane,
- aResourceId,
- EMPXCmdAiwCmdAssign,
- paramList);
- MPX_DEBUG1( "CMPXCollectionViewHgImp::DynInitMenuPaneL(): Aiw menu for assign end" );
- }
-#endif
-
if (!(aResourceId == R_AVKON_MENUPANE_MARKABLE_LIST && usbUnblockingStatus == EMPXUSBUnblockingPSStatusActive))
{
// Custom handling of menu pane for markable lists
@@ -6934,11 +6966,7 @@
if ( iContainer )
{
//to keep/change focus on right song in rename/remove
-#ifdef SINGLE_CLICK_INCLUDED
if ( aEventType == EEventItemSingleClicked )
-#else
- if ( aEventType == EEventItemClicked )
-#endif
{
if ( !iHandlingKeyEvent && iCollectionCacheReady )
{
@@ -6957,9 +6985,7 @@
}
if ( aEventType == EEventEnterKeyPressed || aEventType == EEventItemDoubleClicked
-#ifdef SINGLE_CLICK_INCLUDED
|| aEventType == EEventItemSingleClicked
-#endif
)
{
if ( iContainer->IsInReorderMode() )
@@ -7746,7 +7772,6 @@
{
iAddingSong = EFalse;
TRAP_IGNORE( GetDurationL() );
- TRAP_IGNORE( UpdateNaviPaneL() );
}
if( iInAlbumArtDialog )
{
@@ -7780,11 +7805,6 @@
void CMPXCollectionViewHgImp::HandleViewActivation(const TVwsViewId& aNewlyActivatedViewId,
const TVwsViewId& /*aViewIdToBeDeactivated */)
{
- if( aNewlyActivatedViewId.iAppUid == TUid::Uid(KMusicPlayerAppUidConstant) &&
- aNewlyActivatedViewId.iViewUid == Id() )
- {
- TRAP_IGNORE( UpdateNaviPaneL() );
- }
}
// -----------------------------------------------------------------------------
@@ -7794,18 +7814,6 @@
void CMPXCollectionViewHgImp::HandleViewDeactivation(const TVwsViewId& aViewIdToBeDeactivated,
const TVwsViewId& /*aNewlyActivatedViewId*/)
{
- if( aViewIdToBeDeactivated.iAppUid == TUid::Uid(KMusicPlayerAppUidConstant) &&
- aViewIdToBeDeactivated.iViewUid == Id() )
- {
- if( iContainer )
- {
- if ( iNaviPane && iNaviDecorator )
- {
- if (iNaviPane->Top() == iNaviDecorator) // Only pop if it's the top, don't pop when it's behind a dialog
- iNaviPane->Pop( iNaviDecorator );
- }
- }
- }
}
// -----------------------------------------------------------------------------
@@ -8048,9 +8056,16 @@
}
else if ( cba )
{
- cba->SetCommandSetL(
- ( cpath->Levels() == 3 && !iIsEmbedded ) ?
- R_MPX_OPTIONS_HIDE_CBA : R_AVKON_SOFTKEYS_OPTIONS_BACK );
+ if ( iContainer->IsTBoneView() )
+ {
+ cba->SetCommandSetL( R_AVKON_SOFTKEYS_OPTIONS_BACK );
+ }
+ else
+ {
+ cba->SetCommandSetL(
+ ( cpath->Levels() == 3 && !iIsEmbedded ) ?
+ R_MPX_OPTIONS_HIDE_CBA : R_AVKON_SOFTKEYS_OPTIONS_BACK );
+ }
cba->MakeVisible( ETrue );
cba->DrawDeferred();
}
@@ -8126,40 +8141,32 @@
CleanupStack::PopAndDestroy( path );
}
-// -----------------------------------------------------------------------------
-// CMPXCollectionViewHgImp::IADCheckTimerCallBack
-// -----------------------------------------------------------------------------
-//
-TInt CMPXCollectionViewHgImp::IADCheckTimerCallBack(TAny* aHgViewObject)
- {
- MPX_FUNC( "CMPXCollectionViewHgImp::IADCheckTimerCallBack" );
-
- if (aHgViewObject)
- {
- CMPXCollectionViewHgImp* hgViewObject = static_cast<CMPXCollectionViewHgImp*>(aHgViewObject);
- hgViewObject->StartCheckingforIADUpdates();
- }
-
- return KErrNone;
- }
+
// -----------------------------------------------------------------------------
-// CMPXCollectionViewHgImp::StartCheckingforIADUpdates
+// CMPXCollectionViewHgImp::SaveSelectedAlbum
// -----------------------------------------------------------------------------
//
-void CMPXCollectionViewHgImp::StartCheckingforIADUpdates()
- {
- MPX_FUNC( "CMPXCollectionViewHgImp::StartCheckingforIADUpdates" );
-
- if ( iTimer )
- {
- iTimer->Cancel();
- delete iTimer;
- iTimer = NULL;
- }
-
- AppUi()->HandleCommandL(EMPXCmdCheckIADUpdates);
- }
-
+void CMPXCollectionViewHgImp::SaveSelectedAlbum (CMPXMedia &aMedia)
+ {
+ MPX_FUNC( "CMPXCollectionViewHgImp::SaveSelectedAlbum" );
+ if (iStoredAlbum)
+ {
+ delete iStoredAlbum;
+ }
+ iStoredAlbum = CMPXMedia::NewL(aMedia);
+ }
+
+
+// -----------------------------------------------------------------------------
+// CMPXCollectionViewHgImp::RestoreSelectedAlbum
+// -----------------------------------------------------------------------------
+//
+const CMPXMedia* CMPXCollectionViewHgImp::RestoreSelectedAlbum ()
+ {
+ MPX_FUNC( "CMPXCollectionViewHgImp::RestoreSelectedAlbum" );
+
+ return iStoredAlbum;
+ }
// End of File
--- a/mpxplugins/viewplugins/views/collectionviewhg/src/mpxcollectionviewhgplaylisthelper.cpp Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/viewplugins/views/collectionviewhg/src/mpxcollectionviewhgplaylisthelper.cpp Fri Mar 12 15:42:25 2010 +0200
@@ -399,7 +399,6 @@
if( !iInitCanceled )
{
- aPath.Remove(0); // we want to remove index 0 which is shuffle item
TTime time;
time.UniversalTime();
TInt64 seed = time.Int64();
--- a/mpxplugins/viewplugins/views/collectionviewhg/src/mpxcollectionviewhgtnloader.cpp Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/viewplugins/views/collectionviewhg/src/mpxcollectionviewhgtnloader.cpp Fri Mar 12 15:42:25 2010 +0200
@@ -57,6 +57,11 @@
iAsyncCallBack->Cancel();
delete iAsyncCallBack;
+
+ if( iPauseTimer )
+ iPauseTimer->Cancel();
+
+ delete iPauseTimer;
}
TInt CMpxTNLoader::LoadThumbnail( TAny* aSelf )
@@ -68,6 +73,9 @@
void CMpxTNLoader::LoadNextTN()
{
+ if( iPaused )
+ return;
+
if( iLoading.Count() > 0 )
{
TInt index = iLoading[0]->iIndex;
@@ -138,6 +146,7 @@
TCallBack callback(CMpxTNLoader::LoadThumbnail, this);
iAsyncCallBack = new (ELeave) CAsyncCallBack( CActive::EPriorityStandard );
iAsyncCallBack->Set(callback);
+ iPauseTimer = CPeriodic::NewL( CActive::EPriorityStandard );
}
// -----------------------------------------------------------------------------
@@ -209,14 +218,11 @@
TInt loadingIndex = FindLoadingByIndex( aIndex );
if(loadingIndex != KErrNotFound)
{
- // Current thumbnail manager has bugs in thumbnail request cancelation.
- // There is a fix coming in near future but until that we cannot cancel requests
- // since after that we dont get any thumbnails from server.
-// if( iLoading[loadingIndex]->iId != 0 )
-// {
-// RDebug::Print(_L("!!CANCEL REQUEST!!"));
-// iTnEngine->CancelRequest( iLoading[loadingIndex]->iId );
-// }
+ if( iLoading[loadingIndex]->iId != 0 )
+ {
+ MPX_DEBUG2( "Cancel Thumb Request: %d", aIndex );
+ iTnEngine->CancelRequest( iLoading[loadingIndex]->iId );
+ }
delete iLoading[loadingIndex];
iLoading.Remove(loadingIndex);
}
@@ -224,11 +230,6 @@
void CMpxTNLoader::CancelAll()
{
- iLoading.ResetAndDestroy();
- return;
- // Current thumbnail manager has bugs in thumbnail request cancelation.
- // There is a fix coming in near future but until that we cannot cancel requests
- // since after that we dont get any thumbnails from server.
while ( iLoading.Count() > 0 )
{
if( iLoading[0]->iId != 0 )
@@ -242,3 +243,31 @@
{
iTnEngine->SetThumbnailSizeL( aSize );
}
+
+void CMpxTNLoader::Pause(TTimeIntervalMicroSeconds32 aDelay)
+ {
+ iAsyncCallBack->Cancel();
+ iPaused = ETrue;
+ iPauseTimer->Cancel();
+ iPauseTimer->Start(
+ aDelay, aDelay,
+ TCallBack(ResumeCallback, this));
+ }
+
+void CMpxTNLoader::Resume()
+ {
+ iPaused = EFalse;
+ if( !iAsyncCallBack->IsActive() )
+ iAsyncCallBack->CallBack();
+ iPauseTimer->Cancel();
+ }
+
+TInt CMpxTNLoader::ResumeCallback(TAny* aPtr)
+ {
+ CMpxTNLoader* self = (CMpxTNLoader*)aPtr;
+ if( self )
+ {
+ self->Resume();
+ }
+ return KErrNone;
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mpxplugins/viewplugins/views/collectionviewhg/src/mpxpopuplist.cpp Fri Mar 12 15:42:25 2010 +0200
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of Collection view container
+*
+*/
+
+
+// INCLUDE FILES
+
+#include "mpxpopuplist.h"
+
+CMpxPopupList::CMpxPopupList(): CAknPopupList()
+ {
+ }
+
+CMpxPopupList::~CMpxPopupList()
+ {
+ }
+
+CMpxPopupList* CMpxPopupList::NewL(
+ CEikListBox* aListBox,
+ TInt aCbaResource,
+ AknPopupLayouts::TAknPopupLayouts aType )
+ {
+ CMpxPopupList* self = new (ELeave) CMpxPopupList();
+ CleanupStack::PushL( self );
+ self->ConstructL( aListBox, aCbaResource, aType );
+ CleanupStack::Pop( self );
+ return self;
+ }
+
+TRect CMpxPopupList::LayoutRect()
+ {
+ SetupWindowLayout( iWindowType );
+ TRect rect = Rect();
+ rect.Move( PositionRelativeToScreen() );
+ return rect;
+ }
+
+// End of File
--- a/mpxplugins/viewplugins/views/commoncontainer/group/mpxcommoncontainer.mmp Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/viewplugins/views/commoncontainer/group/mpxcommoncontainer.mmp Fri Mar 12 15:42:25 2010 +0200
@@ -104,6 +104,9 @@
LIBRARY bitgdi.lib
#endif //__HG_COLLECTIONVIEW
+ALWAYS_BUILD_AS_ARM
+OPTION ARMCC -O3 -Otime
+
#if defined(ARMCC)
deffile ../eabi/
#elif defined(WINSCW)
--- a/mpxplugins/viewplugins/views/commonplaybackview/bwinscw/mpxcommonplaybackviewU.DEF Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/viewplugins/views/commonplaybackview/bwinscw/mpxcommonplaybackviewU.DEF Fri Mar 12 15:42:25 2010 +0200
@@ -108,4 +108,5 @@
?GetIndicatorVariant@CMPXCommonPlaybackViewLayout@@IAE?AW4TMPXPbvLayoutVariants@@W4TMPXPbvIndicator@@@Z @ 107 NONAME ; enum TMPXPbvLayoutVariants CMPXCommonPlaybackViewLayout::GetIndicatorVariant(enum TMPXPbvIndicator)
?HandleCollectionMediaL@CMPXCommonPlaybackViewImp@@MAEXABVCMPXMedia@@H@Z @ 108 NONAME ; void CMPXCommonPlaybackViewImp::HandleCollectionMediaL(class CMPXMedia const &, int)
?GetHelpContext@CMPXCommonPlaybackViewContainer@@UBEXAAVTCoeHelpContext@@@Z @ 109 NONAME ; void CMPXCommonPlaybackViewContainer::GetHelpContext(class TCoeHelpContext &) const
+ ?LightStatusChanged@CMPXCommonPlaybackViewContainer@@UAEXHW4TLightStatus@CHWRMLight@@@Z @ 110 NONAME ; void CMPXCommonPlaybackViewContainer::LightStatusChanged(int, enum CHWRMLight::TLightStatus)
--- a/mpxplugins/viewplugins/views/commonplaybackview/eabi/mpxcommonplaybackviewU.DEF Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/viewplugins/views/commonplaybackview/eabi/mpxcommonplaybackviewU.DEF Fri Mar 12 15:42:25 2010 +0200
@@ -146,4 +146,6 @@
_ZThn84_N25CMPXCommonPlaybackViewImp15HandlePropertyLE20TMPXPlaybackPropertyii @ 145 NONAME
_ZThn84_N25CMPXCommonPlaybackViewImp21HandleSubPlayerNamesLE4TUidPK12MDesC16Arrayii @ 146 NONAME
_ZThn96_N25CMPXCommonPlaybackViewImp18HandleLayoutChangeEv @ 147 NONAME
+ _ZN31CMPXCommonPlaybackViewContainer18LightStatusChangedEiN10CHWRMLight12TLightStatusE @ 148 NONAME
+ _ZThn60_N31CMPXCommonPlaybackViewContainer18LightStatusChangedEiN10CHWRMLight12TLightStatusE @ 149 NONAME
--- a/mpxplugins/viewplugins/views/commonplaybackview/group/mpxcommonplaybackview.mmp Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/viewplugins/views/commonplaybackview/group/mpxcommonplaybackview.mmp Fri Mar 12 15:42:25 2010 +0200
@@ -102,6 +102,8 @@
LIBRARY upnpcommand.lib
#endif
+LIBRARY gfxtrans.lib
+
LIBRARY eikdlg.lib
LIBRARY mpxplaybackutility.lib
@@ -113,6 +115,12 @@
LIBRARY servicehandler.lib // AIW
LIBRARY playbackhelper.lib // CMediaRecognizer
LIBRARY touchfeedback.lib
+
+LIBRARY HWRMLightClient.lib //light status
+
+ALWAYS_BUILD_AS_ARM
+OPTION ARMCC -O3 -Otime
+
#ifdef IAD_INCLUDE_BACKSTEPPING
LIBRARY mpxbacksteppingutility.lib
#endif // IAD_INCLUDE_BACKSTEPPING
--- a/mpxplugins/viewplugins/views/commonplaybackview/src/mpxcommonplaybackviewcontainer.cpp Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/viewplugins/views/commonplaybackview/src/mpxcommonplaybackviewcontainer.cpp Fri Mar 12 15:42:25 2010 +0200
@@ -53,6 +53,10 @@
#include <mpxconstants.h>
#include <mpxfmtx.rsg> // For FF_FMTX
#include <mpxappui.hrh>
+#include <mpxinternalcrkeys.h>
+#include <touchfeedback.h>
+#include <akntranseffect.h> // For transition effects
+#include <gfxtranseffect\gfxtranseffect.h> // For transition effects
#include "mpxcommonplaybackviewcontainer.h"
#include "mpxcommonplaybackviewlayout.h"
@@ -62,12 +66,9 @@
#include "mpxplaybackviewlayoutinterface.h"
#include "mpxlayoutswitchobserver.h"
#include "mpxcommonuihelper.h"
-#include <mpxinternalcrkeys.h>
#include "mpxbuttonmanager.h"
#include "mpxlog.h"
-#include <touchfeedback.h>
-
// CONSTANTS
const TInt KLabelCount = ETextCount;
const TInt KMPXMinSecSeparatorIndex = 2;
@@ -179,6 +180,10 @@
iActiveView = ETrue;
iPrerollCompleted = EFalse;
+ iLightStatus = CHWRMLight::ELightStatusUnknown;
+ iIsForeground = EFalse ;
+ iLight = CHWRMLight::NewL(this);
+
DrawableWindow()->SetPointerGrab( ETrue );
EnableDragEvents();
@@ -204,9 +209,11 @@
delete iShortFormatString;
delete iCommonUiHelper;
-
-
-
+ if ( iLight )
+ {
+ delete iLight;
+ iLight = NULL;
+ }
delete iButtonManager;
@@ -636,6 +643,9 @@
TBool aForeground )
{
MPX_FUNC( "CMPXCommonPlaybackViewContainer::HandleForegroundEventL" );
+
+ iIsForeground = aForeground;
+
if ( !aForeground && iEnableButtons )
{
// if losing foreground and buttons are enabled
@@ -1047,6 +1057,7 @@
//
EXPORT_C void CMPXCommonPlaybackViewContainer::UpdateProgressBarGraphics()
{
+ MPX_FUNC("CMPXCommonPlaybackViewContainer::UpdateProgressBarGraphics()");
TSize downloadBarSize = iDownloadSliderRect.Size();
TSize playbackBarSize = iPlaybackSliderRect.Size();
@@ -1065,12 +1076,24 @@
// ---------------------------------------------------------------------------
// Update progress bar graphics and redraw.
+// Refresh happens only when backlight is ON and
+// the UI is in foreground.
+// Note: Some display types may not need backlight. In that case
+// code may need to be adjusted accordingly.
// ---------------------------------------------------------------------------
//
EXPORT_C void CMPXCommonPlaybackViewContainer::RefreshProgressBar()
{
- UpdateProgressBarGraphics();
- Window().Invalidate( iSliderPaneRect );
+ MPX_FUNC( "CMPXCommonPlaybackViewContainer::RefreshProgressBar" );
+
+ MPX_DEBUG2(" iIsForeground : (%d)", iIsForeground);
+ MPX_DEBUG2(" iLightStatus : (%d)", iLightStatus);
+
+ if ( iIsForeground && (iLightStatus == CHWRMLight::ELightOn) )
+ {
+ UpdateProgressBarGraphics();
+ Window().Invalidate( iSliderPaneRect );
+ }
}
// ---------------------------------------------------------------------------
@@ -1086,7 +1109,7 @@
skin,
color,
KAknsIIDQsnTextColors,
- EAknsCIQsnTextColorsCG50 );
+ EAknsCIQsnTextColorsCG6 );
for ( TInt i = 0; i < iLabels.Count(); i++ )
{
@@ -1403,6 +1426,23 @@
return iNewSongPosition;
}
+// -----------------------------------------------------------------------------
+// CMPXCommonPlaybackViewContainer::LightStatusChanged
+// -----------------------------------------------------------------------------
+//
+EXPORT_C void CMPXCommonPlaybackViewContainer::LightStatusChanged( TInt aTarget, CHWRMLight::TLightStatus aStatus )
+ {
+ MPX_FUNC( "CMPXCommonPlaybackViewContainer::LightStatusChanged" );
+ if ( aTarget == CHWRMLight::EPrimaryDisplay )
+ {
+ MPX_DEBUG2(" LightStatusChanged: (%d)", aStatus);
+ if ( ( aStatus == CHWRMLight::ELightOn || aStatus == CHWRMLight::ELightOff ) && aStatus != iLightStatus )
+ {
+ iLightStatus = aStatus;
+ }
+ }
+ }
+
// ---------------------------------------------------------------------------
// CMPXCommonPlaybackViewContainer::SetNewSongPosition
// ---------------------------------------------------------------------------
@@ -1609,4 +1649,35 @@
{
return Window().SetOrdinalPosition( aNewOrdinalPosition );
}
+
+// -----------------------------------------------------------------------------
+// CMPXCommonPlaybackViewContainer::BeginTransition
+// -----------------------------------------------------------------------------
+//
+void CMPXCommonPlaybackViewContainer::BeginTransition()
+ {
+ iTransitionType = EMPXTranstionToRight;
+ const TInt flags = AknTransEffect::TParameter::EActivateExplicitCancel;
+ TRect appRect = ((CAknAppUi*)iCoeEnv->AppUi())->ApplicationRect();
+ GfxTransEffect::BeginFullScreen( iTransitionType, appRect,
+ AknTransEffect::EParameterType, AknTransEffect::GfxTransParam(KAppUidMusicPlayerX, flags));
+
+ // start transition immediately. Other option would be to start it when the album thumb has
+ // been received.
+ EndTransition();
+ }
+
+// -----------------------------------------------------------------------------
+// CMPXCommonPlaybackViewContainer::EndTransition
+// -----------------------------------------------------------------------------
+//
+void CMPXCommonPlaybackViewContainer::EndTransition()
+ {
+ if( iTransitionType != EMPXTranstionNotDefined )
+ {
+ GfxTransEffect::EndFullScreen();
+ iTransitionType = EMPXTranstionNotDefined;
+ }
+ }
+
// End of File
--- a/mpxplugins/viewplugins/views/commonplaybackview/src/mpxcommonplaybackviewimp.cpp Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/viewplugins/views/commonplaybackview/src/mpxcommonplaybackviewimp.cpp Fri Mar 12 15:42:25 2010 +0200
@@ -1321,7 +1321,8 @@
case EPbStateStopped:
case EPbStateNotInitialised:
{
- UpdateTrackPlaybackPositionL( 0, iDuration );
+ iPosition = 0;
+ UpdateTrackPlaybackPositionL( iPosition, iDuration );
break;
}
case EPbStateInitialising:
@@ -2489,12 +2490,18 @@
// ---------------------------------------------------------------------------
//
EXPORT_C void CMPXCommonPlaybackViewImp::DoActivateL(
- const TVwsViewId& /* aPrevViewId */,
+ const TVwsViewId& aPrevViewId,
TUid /* aCustomMessageId */,
const TDesC8& /* aCustomMessage */ )
{
MPX_FUNC_EX( "CMPXCommonPlaybackViewImp::DoActivateL()" );
+ if( aPrevViewId.iAppUid == KAppUidMusicPlayerX && iContainer )
+ {
+ // record the begin state for the transition animation.
+ iContainer->BeginTransition();
+ }
+
iSwitchingView = EFalse;
iDatabaseNotReady = EFalse;
iUnsupportedNoteDisabled = EFalse;
--- a/mpxplugins/viewplugins/views/inc/mpxcommonplaybackviewcontainer.h Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/viewplugins/views/inc/mpxcommonplaybackviewcontainer.h Fri Mar 12 15:42:25 2010 +0200
@@ -23,11 +23,13 @@
// INCLUDES
#include <coecntrl.h>
+#include <hwrmlight.h>
#include "mpxcommonplaybackviewdefs.h"
#include "mpxalbumartutilobserver.h"
#include "mpxbutton.h"
#include "mpxplaybackframeworkdefs.h"
+#include "mpxconstants.h"
// FORWARD DECLARATIONS
@@ -50,7 +52,8 @@
*/
class CMPXCommonPlaybackViewContainer : public CCoeControl,
public MMPXAlbumArtUtilObserver,
- public MMPXButtonCmdObserver
+ public MMPXButtonCmdObserver,
+ public MHWRMLightObserver
{
public:
@@ -274,6 +277,10 @@
/**
* Update progress bar graphics and redraw.
+ * Refresh happens only when backlight is ON and
+ * UI is in foreground.
+ * Note: Some display types may not need backlight. In that case
+ * code may need to be adjusted accordingly.
*/
IMPORT_C virtual void RefreshProgressBar();
@@ -362,6 +369,15 @@
void SetNewSongPosition( const TInt64& aPositon );
/**
+ * From MBacklightControlObserver.
+ * Callback for change in backlight status
+ *
+ * @param aTarget The target of light change event; keypad, screen or both
+ * @param aStatus New status of the target
+ */
+ IMPORT_C virtual void LightStatusChanged( TInt aTarget, CHWRMLight::TLightStatus aStatus );
+
+ /**
* Restore Buttons' state in some special case
*
* @since S60 3.0
@@ -381,6 +397,12 @@
*/
void AdjustOrdinalPosition( TInt aNewOrdinalPosition );
+ /**
+ * Records the transition animation begin state.
+ * Animation is started when albumart is fetched.
+ */
+ void BeginTransition();
+
private:
/**
@@ -388,6 +410,11 @@
*/
void DoUpdateLayoutL();
+ /**
+ * Trickers the transtition.
+ */
+ void EndTransition();
+
protected: // data
MEikCommandObserver* iCommandObserver; // not owned
@@ -471,9 +498,12 @@
TBool iTouchDown; // Flag indicating touch progress bar is in use
TBool iActiveView;
-
+ TBool iIsForeground;
+ CHWRMLight::TLightStatus iLightStatus;
+ CHWRMLight *iLight;
TBool iDragProgressBar; //Flag drag progress bar
+ TTransitionType iTransitionType; // Transition direction
};
#endif // CMPXCOMMONPLAYBACKVIEWCONTAINER_H
--- a/mpxplugins/viewplugins/views/metadataeditordialog/data/mpxmetadataeditordialog.rss Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/viewplugins/views/metadataeditordialog/data/mpxmetadataeditordialog.rss Fri Mar 12 15:42:25 2010 +0200
@@ -109,7 +109,22 @@
CBA_BUTTON {id=EAknSoftkeyForwardKeyEvent; txt=text_softkey_empty; }
};
}
-
+
+// ---------------------------------------------------------------------------
+// r_mpx_cui_song_details_softkeys_options_empty_back
+// CBA for Song Details view.
+// ---------------------------------------------------------------------------
+//
+RESOURCE CBA r_mpx_cui_song_details_softkeys_options_empty_back
+ {
+ buttons =
+ {
+ CBA_BUTTON {id=EAknSoftkeyOptions; txt=text_softkey_option;},
+ CBA_BUTTON {id=EAknSoftkeyBack; txt=text_softkey_back; },
+ CBA_BUTTON {id=EAknSoftkeyForwardKeyEvent; txt=text_softkey_empty; }
+ };
+ }
+
// ---------------------------------------------------------------------------
// r_mpx_cui_song_details_softkeys_options_change_done
// CBA for Song Details view.
@@ -149,7 +164,7 @@
RESOURCE DIALOG r_mpx_cui_song_details_dialog
{
flags = EAknDialogGenericFullScreen;
- buttons = r_mpx_cui_song_details_softkeys_options_empty_done;
+ buttons = r_mpx_cui_song_details_softkeys_options_empty_back;
form = r_mpx_cui_song_details_form;
}
@@ -357,6 +372,186 @@
// other = qtn_aknexpopfield_list_other;
};
tooltip = qtn_aknexpopfield_hint_text;
+ },
+ DLG_LINE
+ {
+ type = EEikCtEdwin;
+ prompt = qtn_mp_fd_filename;
+ id = EMPXMetadataEditorDlgCtrlIdFileName;
+ itemflags=EEikDlgItemTakesEnterKey| EEikDlgItemOfferAllHotKeys;
+ control = EDWIN
+ {
+ flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable| EEikEdwinReadOnly;
+ width = KMPXSongDetailsTextWidth;
+ lines = KMPXSongDetailsTextLines;
+ maxlength = KMPXSongDetailsTextMaxLen;
+ // added to limit expanding in forms.
+ // If you want full screen use 6 here
+ max_view_height_in_lines = 6;
+ // if you have the line above, you must have this.
+ // It is calculable from LAF
+ base_line_delta = 21;
+ };
+ },
+ DLG_LINE
+ {
+ type = EEikCtEdwin;
+ prompt = qtn_mp_details_format;
+ id = EMPXMetadataEditorDlgCtrlIdFileFormat;
+ itemflags=EEikDlgItemTakesEnterKey| EEikDlgItemOfferAllHotKeys;
+ control = EDWIN
+ {
+ flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable| EEikEdwinReadOnly;
+ width = KMPXSongDetailsTextWidth;
+ lines = KMPXSongDetailsTextLines;
+ maxlength = KMPXSongDetailsTextMaxLen;
+ // added to limit expanding in forms.
+ // If you want full screen use 6 here
+ max_view_height_in_lines = 6;
+ // if you have the line above, you must have this.
+ // It is calculable from LAF
+ base_line_delta = 21;
+ };
+ },
+ DLG_LINE
+ {
+ type = EEikCtEdwin;
+ prompt = qtn_mp_details_duration;
+ id = EMPXMetadataEditorDlgCtrlIdFileDuration;
+ itemflags=EEikDlgItemTakesEnterKey| EEikDlgItemOfferAllHotKeys;
+ control = EDWIN
+ {
+ flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable| EEikEdwinReadOnly;
+ width = KMPXSongDetailsTextWidth;
+ lines = KMPXSongDetailsTextLines;
+ maxlength = KMPXSongDetailsTextMaxLen;
+ // added to limit expanding in forms.
+ // If you want full screen use 6 here
+ max_view_height_in_lines = 6;
+ // if you have the line above, you must have this.
+ // It is calculable from LAF
+ base_line_delta = 21;
+ };
+ },
+ DLG_LINE
+ {
+ type = EEikCtEdwin;
+ prompt = qtn_mp_details_bitrate;
+ id = EMPXMetadataEditorDlgCtrlIdFileBitrate;
+ itemflags=EEikDlgItemTakesEnterKey| EEikDlgItemOfferAllHotKeys;
+ control = EDWIN
+ {
+ flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable| EEikEdwinReadOnly;
+ width = KMPXSongDetailsTextWidth;
+ lines = KMPXSongDetailsTextLines;
+ maxlength = KMPXSongDetailsTextMaxLen;
+ // added to limit expanding in forms.
+ // If you want full screen use 6 here
+ max_view_height_in_lines = 6;
+ // if you have the line above, you must have this.
+ // It is calculable from LAF
+ base_line_delta = 21;
+ };
+ },
+ DLG_LINE
+ {
+ type = EEikCtEdwin;
+ prompt = qtn_mp_details_samplerate;
+ id = EMPXMetadataEditorDlgCtrlIdSamplingrate;
+ itemflags=EEikDlgItemTakesEnterKey| EEikDlgItemOfferAllHotKeys;
+ control = EDWIN
+ {
+ flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable| EEikEdwinReadOnly;
+ width = KMPXSongDetailsTextWidth;
+ lines = KMPXSongDetailsTextLines;
+ maxlength = KMPXSongDetailsTextMaxLen;
+ // added to limit expanding in forms.
+ // If you want full screen use 6 here
+ max_view_height_in_lines = 6;
+ // if you have the line above, you must have this.
+ // It is calculable from LAF
+ base_line_delta = 21;
+ };
+ },
+ DLG_LINE
+ {
+ type = EEikCtEdwin;
+ prompt = qtn_mp_details_size;
+ id = EMPXMetadataEditorDlgCtrlIdSize;
+ itemflags=EEikDlgItemTakesEnterKey| EEikDlgItemOfferAllHotKeys;
+ control = EDWIN
+ {
+ flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable| EEikEdwinReadOnly;
+ width = KMPXSongDetailsTextWidth;
+ lines = KMPXSongDetailsTextLines;
+ maxlength = KMPXSongDetailsTextMaxLen;
+ // added to limit expanding in forms.
+ // If you want full screen use 6 here
+ max_view_height_in_lines = 6;
+ // if you have the line above, you must have this.
+ // It is calculable from LAF
+ base_line_delta = 21;
+ };
+ },
+ DLG_LINE
+ {
+ type = EEikCtEdwin;
+ prompt = qtn_mp_details_modified;
+ id = EMPXMetadataEditorDlgCtrlIdLastModified;
+ itemflags=EEikDlgItemTakesEnterKey| EEikDlgItemOfferAllHotKeys;
+ control = EDWIN
+ {
+ flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable| EEikEdwinReadOnly;
+ width = KMPXSongDetailsTextWidth;
+ lines = KMPXSongDetailsTextLines;
+ maxlength = KMPXSongDetailsTextMaxLen;
+ // added to limit expanding in forms.
+ // If you want full screen use 6 here
+ max_view_height_in_lines = 6;
+ // if you have the line above, you must have this.
+ // It is calculable from LAF
+ base_line_delta = 21;
+ };
+ },
+ DLG_LINE
+ {
+ type = EEikCtEdwin;
+ prompt = qtn_mp_details_copyright;
+ id = EMPXMetadataEditorDlgCtrlIdCopyright;
+ itemflags=EEikDlgItemTakesEnterKey| EEikDlgItemOfferAllHotKeys;
+ control = EDWIN
+ {
+ flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable| EEikEdwinReadOnly;
+ width = KMPXSongDetailsTextWidth;
+ lines = KMPXSongDetailsTextLines;
+ maxlength = KMPXSongDetailsTextMaxLen;
+ // added to limit expanding in forms.
+ // If you want full screen use 6 here
+ max_view_height_in_lines = 6;
+ // if you have the line above, you must have this.
+ // It is calculable from LAF
+ base_line_delta = 21;
+ };
+ },
+ DLG_LINE
+ {
+ type = EEikCtEdwin;
+ prompt = qtn_mp_details_url;
+ id = EMPXMetadataEditorDlgCtrlIdWebaddress;
+ itemflags=EEikDlgItemTakesEnterKey| EEikDlgItemOfferAllHotKeys;
+ control = EDWIN
+ {
+ flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable| EEikEdwinReadOnly;
+ width = KMPXSongDetailsTextWidth;
+ lines = KMPXSongDetailsTextLines;
+ maxlength = KMPXSongDetailsTextMaxLen;
+ // added to limit expanding in forms.
+ // If you want full screen use 6 here
+ max_view_height_in_lines = 6;
+ // if you have the line above, you must have this.
+ // It is calculable from LAF
+ base_line_delta = 21;
+ };
}
};
}
@@ -535,7 +730,7 @@
RESOURCE DIALOG r_mpx_cui_podcast_details_dialog
{
flags = EAknDialogGenericFullScreen;
- buttons = r_mpx_cui_song_details_softkeys_options_empty_done;
+ buttons = r_mpx_cui_song_details_softkeys_options_empty_back;
form = r_mpx_cui_podcast_details_form;
}
#else
@@ -694,7 +889,187 @@
// other = qtn_aknexpopfield_list_other;
};
tooltip = qtn_aknexpopfield_hint_text;
- }
+ },
+ DLG_LINE
+ {
+ type = EEikCtEdwin;
+ prompt = qtn_mp_fd_filename;
+ id = EMPXMetadataEditorDlgCtrlIdFileName;
+ itemflags=EEikDlgItemTakesEnterKey| EEikDlgItemOfferAllHotKeys;
+ control = EDWIN
+ {
+ flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
+ width = KMPXSongDetailsTextWidth;
+ lines = KMPXSongDetailsTextLines;
+ maxlength = KMPXSongDetailsTextMaxLen;
+ // added to limit expanding in forms.
+ // If you want full screen use 6 here
+ max_view_height_in_lines = 6;
+ // if you have the line above, you must have this.
+ // It is calculable from LAF
+ base_line_delta = 21;
+ };
+ },
+ DLG_LINE
+ {
+ type = EEikCtEdwin;
+ prompt = qtn_mp_details_format;
+ id = EMPXMetadataEditorDlgCtrlIdFileFormat;
+ itemflags=EEikDlgItemTakesEnterKey| EEikDlgItemOfferAllHotKeys;
+ control = EDWIN
+ {
+ flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable| EEikEdwinReadOnly;
+ width = KMPXSongDetailsTextWidth;
+ lines = KMPXSongDetailsTextLines;
+ maxlength = KMPXSongDetailsTextMaxLen;
+ // added to limit expanding in forms.
+ // If you want full screen use 6 here
+ max_view_height_in_lines = 6;
+ // if you have the line above, you must have this.
+ // It is calculable from LAF
+ base_line_delta = 21;
+ };
+ },
+ DLG_LINE
+ {
+ type = EEikCtEdwin;
+ prompt = qtn_mp_details_duration;
+ id = EMPXMetadataEditorDlgCtrlIdFileDuration;
+ itemflags=EEikDlgItemTakesEnterKey| EEikDlgItemOfferAllHotKeys;
+ control = EDWIN
+ {
+ flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable| EEikEdwinReadOnly;
+ width = KMPXSongDetailsTextWidth;
+ lines = KMPXSongDetailsTextLines;
+ maxlength = KMPXSongDetailsTextMaxLen;
+ // added to limit expanding in forms.
+ // If you want full screen use 6 here
+ max_view_height_in_lines = 6;
+ // if you have the line above, you must have this.
+ // It is calculable from LAF
+ base_line_delta = 21;
+ };
+ },
+ DLG_LINE
+ {
+ type = EEikCtEdwin;
+ prompt = qtn_mp_details_bitrate;
+ id = EMPXMetadataEditorDlgCtrlIdFileBitrate;
+ itemflags=EEikDlgItemTakesEnterKey| EEikDlgItemOfferAllHotKeys;
+ control = EDWIN
+ {
+ flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable| EEikEdwinReadOnly;
+ width = KMPXSongDetailsTextWidth;
+ lines = KMPXSongDetailsTextLines;
+ maxlength = KMPXSongDetailsTextMaxLen;
+ // added to limit expanding in forms.
+ // If you want full screen use 6 here
+ max_view_height_in_lines = 6;
+ // if you have the line above, you must have this.
+ // It is calculable from LAF
+ base_line_delta = 21;
+ };
+ },
+ DLG_LINE
+ {
+ type = EEikCtEdwin;
+ prompt = qtn_mp_details_samplerate;
+ id = EMPXMetadataEditorDlgCtrlIdSamplingrate;
+ itemflags=EEikDlgItemTakesEnterKey| EEikDlgItemOfferAllHotKeys;
+ control = EDWIN
+ {
+ flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable| EEikEdwinReadOnly;
+ width = KMPXSongDetailsTextWidth;
+ lines = KMPXSongDetailsTextLines;
+ maxlength = KMPXSongDetailsTextMaxLen;
+ // added to limit expanding in forms.
+ // If you want full screen use 6 here
+ max_view_height_in_lines = 6;
+ // if you have the line above, you must have this.
+ // It is calculable from LAF
+ base_line_delta = 21;
+ };
+ },
+ DLG_LINE
+ {
+ type = EEikCtEdwin;
+ prompt = qtn_mp_details_size;
+ id = EMPXMetadataEditorDlgCtrlIdSize;
+ itemflags=EEikDlgItemTakesEnterKey| EEikDlgItemOfferAllHotKeys;
+ control = EDWIN
+ {
+ flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable| EEikEdwinReadOnly;
+ width = KMPXSongDetailsTextWidth;
+ lines = KMPXSongDetailsTextLines;
+ maxlength = KMPXSongDetailsTextMaxLen;
+ // added to limit expanding in forms.
+ // If you want full screen use 6 here
+ max_view_height_in_lines = 6;
+ // if you have the line above, you must have this.
+ // It is calculable from LAF
+ base_line_delta = 21;
+ };
+ },
+ DLG_LINE
+ {
+ type = EEikCtEdwin;
+ prompt = qtn_mp_details_modified;
+ id = EMPXMetadataEditorDlgCtrlIdLastModified;
+ itemflags=EEikDlgItemTakesEnterKey| EEikDlgItemOfferAllHotKeys;
+ control = EDWIN
+ {
+ flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable| EEikEdwinReadOnly;
+ width = KMPXSongDetailsTextWidth;
+ lines = KMPXSongDetailsTextLines;
+ maxlength = KMPXSongDetailsTextMaxLen;
+ // added to limit expanding in forms.
+ // If you want full screen use 6 here
+ max_view_height_in_lines = 6;
+ // if you have the line above, you must have this.
+ // It is calculable from LAF
+ base_line_delta = 21;
+ };
+ },
+ DLG_LINE
+ {
+ type = EEikCtEdwin;
+ prompt = qtn_mp_details_copyright;
+ id = EMPXMetadataEditorDlgCtrlIdCopyright;
+ itemflags=EEikDlgItemTakesEnterKey| EEikDlgItemOfferAllHotKeys;
+ control = EDWIN
+ {
+ flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable| EEikEdwinReadOnly;
+ width = KMPXSongDetailsTextWidth;
+ lines = KMPXSongDetailsTextLines;
+ maxlength = KMPXSongDetailsTextMaxLen;
+ // added to limit expanding in forms.
+ // If you want full screen use 6 here
+ max_view_height_in_lines = 6;
+ // if you have the line above, you must have this.
+ // It is calculable from LAF
+ base_line_delta = 21;
+ };
+ },
+ DLG_LINE
+ {
+ type = EEikCtEdwin;
+ prompt = qtn_mp_details_url;
+ id = EMPXMetadataEditorDlgCtrlIdWebaddress;
+ itemflags=EEikDlgItemTakesEnterKey| EEikDlgItemOfferAllHotKeys;
+ control = EDWIN
+ {
+ flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable| EEikEdwinReadOnly;
+ width = KMPXSongDetailsTextWidth;
+ lines = KMPXSongDetailsTextLines;
+ maxlength = KMPXSongDetailsTextMaxLen;
+ // added to limit expanding in forms.
+ // If you want full screen use 6 here
+ max_view_height_in_lines = 6;
+ // if you have the line above, you must have this.
+ // It is calculable from LAF
+ base_line_delta = 21;
+ };
+ }
};
}
@@ -1127,5 +1502,47 @@
buf = qtn_mp_details_playback_complete;
}
-
+
+RESOURCE DLG_LINE r_mpx_cui_last_playback_position
+ {
+ type=EEikCtEdwin;
+ prompt = qtn_mp_details_last_playback_position ;
+ id= EMPXMetadataEditorDlgCtrlIdLastPlayedPosition ;
+ //control=EDWIN { flags= KMultiLineExpandingEditorFlags; maxlength=168; width=3; lines=1;};
+ control = EDWIN
+ {
+ flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
+ width = KMPXSongDetailsTextWidth;
+ lines = KMPXSongDetailsTextLines;
+ maxlength = KMPXSongDetailsTextMaxLen;
+ // added to limit expanding in forms.
+ // If you want full screen use 6 here
+ max_view_height_in_lines = 6;
+ // if you have the line above, you must have this.
+ // It is calculable from LAF
+ base_line_delta = 21;
+ };
+ }
+
+RESOURCE DLG_LINE r_mpx_cui_details_published
+ {
+ type=EEikCtEdwin;
+ prompt = qtn_mp_details_published ;
+ id= EMPXMetadataEditorDlgCtrlIdLastPublished ;
+ //control=EDWIN { flags= KMultiLineExpandingEditorFlags; maxlength=168; width=3; lines=1;};
+ control = EDWIN
+ {
+ flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
+ width = KMPXSongDetailsTextWidth;
+ lines = KMPXSongDetailsTextLines;
+ maxlength = KMPXSongDetailsTextMaxLen;
+ // added to limit expanding in forms.
+ // If you want full screen use 6 here
+ max_view_height_in_lines = 6;
+ // if you have the line above, you must have this.
+ // It is calculable from LAF
+ base_line_delta = 21;
+ };
+ }
+
// End of File
--- a/mpxplugins/viewplugins/views/metadataeditordialog/inc/mpxmetadataeditordialog.hrh Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/viewplugins/views/metadataeditordialog/inc/mpxmetadataeditordialog.hrh Fri Mar 12 15:42:25 2010 +0200
@@ -47,6 +47,17 @@
EMPXMetadataEditorDlgCtrlIdComposer,
EMPXMetadataEditorDlgCtrlIdComment,
EMPXMetadataEditorDlgCtrlIdLibrary,
+ EMPXMetadataEditorDlgCtrlIdFileName,
+ EMPXMetadataEditorDlgCtrlIdFileFormat,
+ EMPXMetadataEditorDlgCtrlIdFileDuration,
+ EMPXMetadataEditorDlgCtrlIdFileBitrate,
+ EMPXMetadataEditorDlgCtrlIdSamplingrate,
+ EMPXMetadataEditorDlgCtrlIdSize,
+ EMPXMetadataEditorDlgCtrlIdLastModified,
+ EMPXMetadataEditorDlgCtrlIdCopyright,
+ EMPXMetadataEditorDlgCtrlIdWebaddress,
+ EMPXMetadataEditorDlgCtrlIdLastPlayedPosition,
+ EMPXMetadataEditorDlgCtrlIdLastPublished,
EMPXMetadataEditorDlgCtrlIdGenre // Genre has to be the last item in this enum (for popup field items)
};
--- a/mpxplugins/viewplugins/views/metadataeditordialog/src/mpxmetadataeditordialog.cpp Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/viewplugins/views/metadataeditordialog/src/mpxmetadataeditordialog.cpp Fri Mar 12 15:42:25 2010 +0200
@@ -268,6 +268,7 @@
res = ETrue;
break;
}
+ case EAknSoftkeyBack:
case EAknSoftkeyExit:
{
RestoreNaviLabelL();
@@ -633,6 +634,8 @@
SetControlTextL( EMPXMetadataEditorDlgCtrlIdComposer,
iMedia->ValueText( KMPXMediaMusicComposer ), KNullDesC );
}
+
+ PopulateFileDetailsL();
DrawNow();
}
else
@@ -841,12 +844,15 @@
// store the latest navi pane
iNaviDecorator = iNaviPane->Top();
-
- // set the new navi label
- iEmptyNaviDecorator =
+
+ if(iNaviDecorator)
+ {
+ // set the new navi label
+ iEmptyNaviDecorator =
iNaviPane->CreateNavigationLabelL(KNullDesC);
- iNaviPane->PushL( *iEmptyNaviDecorator );
+ iNaviPane->PushL( *iEmptyNaviDecorator );
+ }
}
// -----------------------------------------------------------------------------
@@ -888,6 +894,8 @@
{
aMenuPane->SetItemDimmed( EMPXCmdSongDetailsChange, ETrue );
}
+ aMenuPane->SetItemDimmed( EMPXCmdSongDetails, ETrue );
+
// Dim out the Avkon menu items
aMenuPane->SetItemDimmed( EAknFormCmdEdit, ETrue );
aMenuPane->SetItemDimmed( EAknFormCmdAdd, ETrue );
@@ -2379,7 +2387,7 @@
}
else
{
- resId = R_MPX_CUI_SONG_DETAILS_SOFTKEYS_OPTIONS_EMPTY_DONE;
+ resId = R_MPX_CUI_SONG_DETAILS_SOFTKEYS_OPTIONS_EMPTY_BACK;
}
ButtonGroupContainer().SetCommandSetL( resId );
@@ -2820,4 +2828,292 @@
return ret;
}
+
+
+// -----------------------------------------------------------------------------
+// CMPXMetadataEditorDialog::PopulateFileDetailsL
+// -----------------------------------------------------------------------------
+//
+void CMPXMetadataEditorDialog::PopulateFileDetailsL()
+ {
+ MPX_FUNC( "CMPXMetadataEditorDialog::PopulateFileDetailsL" );
+
+ ASSERT(iMedia);
+ TBool drmProtected(iMedia->ValueTObjectL<TBool> (KMPXMediaDrmProtected));
+ MPX_DEBUG2( "CMPXMetadataEditorDialog::PopulateFileDetailsL drm protected: %d", drmProtected );
+
+ if (drmProtected)
+ {
+ //TODO: Pending for UI Spec and localisation
+ }
+
+ // Get filename
+ const TDesC& uri = iMedia->ValueText(KMPXMediaGeneralUri);
+ TParsePtrC parse(uri);
+
+ SetControlTextL(EMPXMetadataEditorDlgCtrlIdFileName, parse.Name(),
+ KNullDesC);
+
+ // Get mime type
+ SetControlTextL(EMPXMetadataEditorDlgCtrlIdFileFormat, iMedia->ValueText(
+ KMPXMediaGeneralMimeType), KNullDesC);
+
+ // Get duration
+ TInt duration(iMedia->ValueTObjectL<TInt> (KMPXMediaGeneralDuration));
+ if (duration > 0)
+ {
+ // convert milliseconds to seconds
+ duration = duration / KSecondInMilliseconds;
+ CMPXCommonUiHelper::TMPXDuratDisplayMode durationMode =
+ CMPXCommonUiHelper::EMPXDuratAuto;
+ if (duration > KOneHourInSeconds)
+ {
+ durationMode = CMPXCommonUiHelper::EMPXDuratHMS;
+ }
+ HBufC* stringBuf = iCommonUiHelper->DisplayableDurationL(duration,
+ durationMode);
+ CleanupStack::PushL(stringBuf);
+ SetControlTextL(EMPXMetadataEditorDlgCtrlIdFileDuration, *stringBuf,
+ KNullDesC);
+ CleanupStack::PopAndDestroy(stringBuf);
+ }
+ else
+ {
+ SetControlTextL(EMPXMetadataEditorDlgCtrlIdFileDuration, KNullDesC,
+ KNullDesC);
+ }
+
+ // Get bitrate
+ TInt bitrate(iMedia->ValueTObjectL<TInt> (KMPXMediaAudioBitrate));
+ if (bitrate > 0)
+ {
+ // convert bitrate to kpbs
+ bitrate = bitrate / KMPXBitrateFactor;
+ HBufC* bitrateText = StringLoader::LoadLC(
+ R_MPX_CUI_METADATAEDITOR_BITRATE_TXT, bitrate);
+ SetControlTextL(EMPXMetadataEditorDlgCtrlIdFileBitrate,
+ bitrateText->Des(), KNullDesC);
+ CleanupStack::PopAndDestroy(bitrateText);
+ }
+ else
+ {
+ SetControlTextL(EMPXMetadataEditorDlgCtrlIdFileBitrate, KNullDesC,
+ KNullDesC);
+ }
+
+ // Get sampling rate
+ TInt samplingRateNum((TInt) iMedia->ValueTObjectL<TInt> (
+ KMPXMediaAudioSamplerate));
+ if (samplingRateNum > 0)
+ {
+ HBufC* stringBuf = HBufC::NewLC(KMPXFileDetailsMaxBufferLen);
+ TPtr stringBufPtr = stringBuf->Des();
+ stringBufPtr.AppendNum(samplingRateNum);
+ HBufC* samplingrate = StringLoader::LoadLC(
+ R_MPX_CUI_METADATAEDITOR_SAMPLINGRATE_TXT, stringBufPtr);
+ SetControlTextL(EMPXMetadataEditorDlgCtrlIdSamplingrate,
+ samplingrate->Des(), KNullDesC);
+ CleanupStack::PopAndDestroy(samplingrate);
+ CleanupStack::PopAndDestroy(stringBuf);
+ }
+ else
+ {
+ SetControlTextL(EMPXMetadataEditorDlgCtrlIdSamplingrate, KNullDesC,
+ KNullDesC);
+ }
+
+ // Get size, not stored in collection, have to use RFile
+ //
+ RFs& fs = CEikonEnv::Static()->FsSession();
+ RFile file;
+ TInt sizeNum(0);
+ TInt err(file.Open(fs, uri, EFileRead | EFileShareReadersOrWriters));
+ if (err == KErrNone)
+ {
+ file.Size(sizeNum);
+ file.Close();
+ }
+
+ if (sizeNum > 0)
+ {
+ HBufC* stringBuf = iCommonUiHelper->UnitConversionL(sizeNum);
+ CleanupStack::PushL(stringBuf);
+ SetControlTextL(EMPXMetadataEditorDlgCtrlIdSize, *stringBuf,
+ KNullDesC);
+ CleanupStack::PopAndDestroy(stringBuf);
+ }
+ else
+ {
+ SetControlTextL(EMPXMetadataEditorDlgCtrlIdSize, KNullDesC, KNullDesC);
+ }
+
+ if (iCurrentLibrary == EMPXMetadataEditorDlgPodcast)
+ {
+ PopulatePodcastFileDetailsL();
+ }
+// Get modified
+if ( iMedia->IsSupported( KMPXMediaGeneralDate ) )
+ {
+ TInt64 timeInt( ( TInt64 )iMedia->ValueTObjectL<TInt64>(
+ KMPXMediaGeneralDate ) );
+ TTime time( timeInt );
+ ConvertToLocalTimeL(time);
+ HBufC* modDateTime = HBufC::NewLC(
+ KMPXMaxTimeLength + KMPXDurationDisplayResvLen );
+ HBufC* format = StringLoader::LoadLC(
+ R_QTN_DATE_USUAL_WITH_ZERO );
+ TPtr modDatePtr = modDateTime->Des();
+ MPX_TRAPD( err, time.FormatL( modDatePtr, *format ) );
+ CleanupStack::PopAndDestroy( format );
+ if (err != KErrNone)
+ {
+ SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastModified,
+ KNullDesC, KNullDesC);
+
+ }
+ else
+ {
+ format = StringLoader::LoadLC(
+ R_QTN_TIME_USUAL_WITH_ZERO );
+ HBufC* modTime = HBufC::NewLC(
+ format->Length() + KMPXDurationDisplayResvLen );
+ TPtr modTimePtr = modTime->Des();
+ MPX_TRAPD( err, time.FormatL( modTimePtr, *format ) );
+ if ( err != KErrNone )
+ {
+ SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastModified,
+ KNullDesC, KNullDesC);
+
+ }
+ else
+ {
+ modDatePtr.Append( KMPXSpace );
+ modDatePtr.Append( modTimePtr );
+ SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastModified,
+ modDatePtr,
+ KNullDesC);
+ }
+ CleanupStack::PopAndDestroy( modTime );
+ CleanupStack::PopAndDestroy( format );
+ }
+ CleanupStack::PopAndDestroy( modDateTime );
+ }
+else
+ {
+ SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastModified,
+ KNullDesC, KNullDesC);
+
+ }
+
+// Get filename
+SetControlTextL(EMPXMetadataEditorDlgCtrlIdCopyright,
+ iMedia->ValueText(
+ KMPXMediaGeneralCopyright ), KNullDesC);
+
+// Get URL
+SetControlTextL(EMPXMetadataEditorDlgCtrlIdWebaddress,
+ iMedia->ValueText(
+ KMPXMediaMusicURL ), KNullDesC);
+
+CAknForm::SetInitialCurrentLine();
+}
+
+// -----------------------------------------------------------------------------
+// CMPXMetadataEditorDialog::PopulatePodcastFileDetailsL
+// -----------------------------------------------------------------------------
+//
+void CMPXMetadataEditorDialog::PopulatePodcastFileDetailsL()
+ {
+ InsertLineL(13,R_MPX_CUI_LAST_PLAYBACK_POSITION,ActivePageId() );
+
+ TInt lastPbPosition((TInt) iMedia->ValueTObjectL<TInt> (
+ KMPXMediaGeneralLastPlaybackPosition));
+
+ if (lastPbPosition > 0)
+ {
+ // convert milliseconds to seconds
+ lastPbPosition = lastPbPosition / KSecondInMilliseconds;
+ CMPXCommonUiHelper::TMPXDuratDisplayMode lastPbPositionMode =
+ CMPXCommonUiHelper::EMPXDuratAuto;
+ if (lastPbPosition > KOneHourInSeconds)
+ {
+ lastPbPositionMode = CMPXCommonUiHelper::EMPXDuratHMS;
+ }
+ HBufC* stringBuf = iCommonUiHelper->DisplayableDurationL(
+ lastPbPosition, lastPbPositionMode);
+ CleanupStack::PushL(stringBuf);
+ SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastPlayedPosition,
+ *stringBuf, KNullDesC);
+ CleanupStack::PopAndDestroy(stringBuf);
+ }
+ else if (lastPbPosition == 0 && iMedia->IsSupported(
+ KMPXMediaGeneralPlayCount) && iMedia->ValueTObjectL<TInt> (
+ KMPXMediaGeneralPlayCount) > 0)
+ {
+ HBufC* stringBuf = StringLoader::LoadLC(
+ R_MPX_CUI_METADATAEDITOR_PLAYBACK_COMPLETE);
+ SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastPlayedPosition,
+ *stringBuf, KNullDesC);
+ CleanupStack::PopAndDestroy(stringBuf);
+
+ }
+ else
+ {
+ SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastPlayedPosition,
+ KNullDesC, KNullDesC);
+ }
+
+ InsertLineL(14,R_MPX_CUI_DETAILS_PUBLISHED,ActivePageId() );
+
+ // Get published
+ if (iMedia->IsSupported(TMPXAttribute(KMPXMediaIdPodcast,
+ EMPXMediaPodcastPubDate)))
+ {
+ TInt64 timeInt(
+ (TInt64) iMedia->ValueTObjectL<TInt64> (TMPXAttribute(
+ KMPXMediaIdPodcast, EMPXMediaPodcastPubDate)));
+ TTime time(timeInt);
+ ConvertToLocalTimeL(time);
+ HBufC* modDateTime = HBufC::NewLC(KMPXMaxTimeLength
+ + KMPXDurationDisplayResvLen);
+ HBufC* format = StringLoader::LoadLC(R_QTN_DATE_USUAL_WITH_ZERO);
+ TPtr modDatePtr = modDateTime->Des();
+ MPX_TRAPD( err, time.FormatL( modDatePtr, *format ) );
+ CleanupStack::PopAndDestroy(format);
+ if (err != KErrNone || time == 0)
+ {
+ SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastPublished,
+ KNullDesC, KNullDesC);
+ }
+ else
+ {
+ format = StringLoader::LoadLC(R_QTN_TIME_USUAL_WITH_ZERO);
+ HBufC* modTime = HBufC::NewLC(format->Length()
+ + KMPXDurationDisplayResvLen);
+ TPtr modTimePtr = modTime->Des();
+ MPX_TRAPD( err, time.FormatL( modTimePtr, *format ) );
+ if (err != KErrNone)
+ {
+ SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastPublished,
+ KNullDesC, KNullDesC);
+ }
+ else
+ {
+ modDatePtr.Append(KMPXSpace);
+ modDatePtr.Append(modTimePtr);
+ SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastPublished,
+ modTimePtr, KNullDesC);
+ }
+ CleanupStack::PopAndDestroy(modTime);
+ CleanupStack::PopAndDestroy(format);
+ }
+ CleanupStack::PopAndDestroy(modDateTime);
+ }
+ else
+ {
+ SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastPublished,
+ KNullDesC, KNullDesC);
+ }
+ }
+
// End of File
--- a/mpxplugins/viewplugins/views/podcastview/src/mpxpodcastcollectionviewimp.cpp Fri Feb 19 22:48:30 2010 +0200
+++ b/mpxplugins/viewplugins/views/podcastview/src/mpxpodcastcollectionviewimp.cpp Fri Mar 12 15:42:25 2010 +0200
@@ -3641,6 +3641,7 @@
case R_MPX_PODCAST_COLLECTION_VIEW_MENU_1:
{
aMenuPane->SetItemDimmed(EMPXCmdFind, ETrue);
+ aMenuPane->SetItemDimmed(EMPXCmdLibraryDetails, ETrue);
if ( !iPlaybackUtility->Source() )
{
aMenuPane->SetItemDimmed( EMPXCmdGoToNowPlaying, ETrue );
--- a/musichomescreen/mcpmusicplayer/inc/mcpmusicplayer.h Fri Feb 19 22:48:30 2010 +0200
+++ b/musichomescreen/mcpmusicplayer/inc/mcpmusicplayer.h Fri Mar 12 15:42:25 2010 +0200
@@ -373,7 +373,7 @@
/**
* Flag of Mass Storage mode or MTP mode
*/
- TBool iUSBOnGoing;
+ TBool iBlockingOperationOngoing;
/**
* collection utility
--- a/musichomescreen/mcpmusicplayer/src/mcpmusicplayer.cpp Fri Feb 19 22:48:30 2010 +0200
+++ b/musichomescreen/mcpmusicplayer/src/mcpmusicplayer.cpp Fri Mar 12 15:42:25 2010 +0200
@@ -676,7 +676,7 @@
case EMPlayerStateStopped:
{
MPX_DEBUG1("CMCPMusicPlayer::DoUpdatePlayerStateL EMPlayerStateStopped");
- if ( iUSBOnGoing )
+ if ( iBlockingOperationOngoing )
{
UpdateToolBarL( TBK::KSkeep_L_dimmed |
TBK::KPlay_dimmed |
@@ -1189,10 +1189,13 @@
MPX_DEBUG3("--->CMCPMusicPlayer::DoHandleGeneralMessageL(), event = %d, type = %d", event, type);
if ( event == TMPXCollectionMessage::EBroadcastEvent
- && ( type == EMcMsgUSBMassStorageStart || type == EMcMsgUSBMTPStart ))
+ && ( type == EMcMsgUSBMassStorageStart ||
+ type == EMcMsgUSBMTPStart ||
+ type == EMcMsgRefreshStart ))
{
- iUSBOnGoing = ETrue;
- MPX_DEBUG2("CMCPMusicPlayer::DoHandleGeneralMessageL(), iUSBOnGoing changed to: %d", iUSBOnGoing );
+ iBlockingOperationOngoing = ETrue;
+ MPX_DEBUG2("CMCPMusicPlayer::DoHandleGeneralMessageL(), iBlockingOperationOngoing changed to: %d",
+ iBlockingOperationOngoing );
UpdateToolBarL( TBK::KSkeep_L_dimmed |
TBK::KPlay_dimmed |
TBK::KSkeep_R_dimmed );
@@ -1202,10 +1205,13 @@
}
}
else if ( event == TMPXCollectionMessage::EBroadcastEvent
- && ( type == EMcMsgUSBMassStorageEnd || type == EMcMsgUSBMTPEnd ))
+ && ( type == EMcMsgUSBMassStorageEnd ||
+ type == EMcMsgUSBMTPEnd ||
+ type == EMcMsgRefreshEnd ))
{
- iUSBOnGoing = EFalse;
- MPX_DEBUG2("CMCPMusicPlayer::DoHandleGeneralMessageL(), iUSBOnGoing changed to: %d", iUSBOnGoing );
+ iBlockingOperationOngoing = EFalse;
+ MPX_DEBUG2("CMCPMusicPlayer::DoHandleGeneralMessageL(), iBlockingOperationOngoing changed to: %d",
+ iBlockingOperationOngoing );
DoUpdatePlayerStateL( iEngine->PlayerState() );
if ( IsOKToPublishData() )
{
--- a/musichomescreen_multiview/group/bld.inf Fri Feb 19 22:48:30 2010 +0200
+++ b/musichomescreen_multiview/group/bld.inf Fri Mar 12 15:42:25 2010 +0200
@@ -26,15 +26,9 @@
../rom/musichomescreen.iby CORE_APP_LAYER_IBY_EXPORT_PATH(musichomescreen.iby)
../rom/musichomescreenrsc.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(musichomescreenrsc.iby)
-../rom/musicmatrixmenu.iby CORE_APP_LAYER_IBY_EXPORT_PATH(musicmatrixmenu.iby)
-../data/suite.xml /epoc32/release/winscw/udeb/z/private/101F4CD2/import/suites/musicsuite/suite.xml
-../data/music_matrix_items.xml /epoc32/release/winscw/udeb/z/private/101F4CD2/import/suites/musicsuite/music_matrix_items.xml
-
-../data/suite.xml /epoc32/data/z/private/101F4CD2/import/suites/musicsuite/suite.xml
-../data/music_matrix_items.xml /epoc32/data/z/private/101F4CD2/import/suites/musicsuite/music_matrix_items.xml
PRJ_EXTENSIONS
@@ -52,18 +46,10 @@
OPTION SOURCEFILE musicwidgeticon.txt
END
-#if defined(SBSV2) && defined(WINSCW)
-START EXTENSION general/copyheaderfile
- SRCFILE musichomescreen.rsg
-END
-#endif
-
PRJ_MMPFILES
musicsuiteconf.mmp
-#ifndef SBSV2
-gnumakefile export_musicsuiteconf.mk
-#endif
-#include "../mpxcollectionpublisher/group/bld.inf"
+
+
#include "../musiccontentpublisher/group/bld.inf"
#include "../mcpmusicplayer/group/bld.inf"
#include "../musicplayeractionhandlerplugin/group/bld.inf"
--- a/musichomescreen_multiview/mcpmusicplayer/inc/mcpmusicplayer.h Fri Feb 19 22:48:30 2010 +0200
+++ b/musichomescreen_multiview/mcpmusicplayer/inc/mcpmusicplayer.h Fri Mar 12 15:42:25 2010 +0200
@@ -381,7 +381,7 @@
/**
* Flag of Mass Storage mode or MTP mode
*/
- TBool iUSBOnGoing;
+ TBool iBlockingOperationOngoing;
/**
* collection utility
--- a/musichomescreen_multiview/mcpmusicplayer/src/aiplayerpluginengine.cpp Fri Feb 19 22:48:30 2010 +0200
+++ b/musichomescreen_multiview/mcpmusicplayer/src/aiplayerpluginengine.cpp Fri Mar 12 15:42:25 2010 +0200
@@ -177,10 +177,13 @@
}
delete iArtist;
iArtist = NULL;
- iArtist = ( aMedia.ValueText( KMPXMediaMusicArtist ) ).AllocL();
-
- iObserver->TrackInfoChanged( *iTitle, *iArtist );
-
+ if ( aMedia.IsSupported( KMPXMediaMusicArtist ) )
+ {
+ iArtist = ( aMedia.ValueText( KMPXMediaMusicArtist ) ).AllocL();
+ }
+
+ iObserver->TrackInfoChanged(iTitle ? *iTitle : KNullDesC(), iArtist ? *iArtist : KNullDesC());
+
if (!iSkipping)
{
if (iExtractingAlbumArt)
--- a/musichomescreen_multiview/mcpmusicplayer/src/mcpmusicplayer.cpp Fri Feb 19 22:48:30 2010 +0200
+++ b/musichomescreen_multiview/mcpmusicplayer/src/mcpmusicplayer.cpp Fri Mar 12 15:42:25 2010 +0200
@@ -677,6 +677,7 @@
case EMPlayerStatePlaying:
{
MPX_DEBUG1("CMCPMusicPlayer::DoUpdatePlayerStateL EMPlayerStatePlaying");
+ iMusicPlayerOpeningTimer->Cancel();
UpdateToolBarL(TBK::KSkeep_L|TBK::KPause|TBK::KSkeep_R);
break;
}
@@ -697,7 +698,7 @@
case EMPlayerStateStopped:
{
MPX_DEBUG1("CMCPMusicPlayer::DoUpdatePlayerStateL EMPlayerStateStopped");
- if ( iUSBOnGoing )
+ if ( iBlockingOperationOngoing )
{
UpdateToolBarL( TBK::KSkeep_L_dimmed |
TBK::KPlay_dimmed |
@@ -1209,11 +1210,15 @@
TInt type = aMsg.ValueTObjectL<TInt> ( KMPXMessageGeneralType );
MPX_DEBUG3("--->CMCPMusicPlayer::DoHandleGeneralMessageL(), event = %d, type = %d", event, type);
+
if ( event == TMPXCollectionMessage::EBroadcastEvent
- && ( type == EMcMsgUSBMassStorageStart || type == EMcMsgUSBMTPStart ))
+ && ( type == EMcMsgUSBMassStorageStart ||
+ type == EMcMsgUSBMTPStart ||
+ type == EMcMsgRefreshStart ))
{
- iUSBOnGoing = ETrue;
- MPX_DEBUG2("CMCPMusicPlayer::DoHandleGeneralMessageL(), iUSBOnGoing changed to: %d", iUSBOnGoing );
+ iBlockingOperationOngoing = ETrue;
+ MPX_DEBUG2("CMCPMusicPlayer::DoHandleGeneralMessageL(), iBlockingOperationOngoing changed to: %d",
+ iBlockingOperationOngoing );
UpdateToolBarL( TBK::KSkeep_L_dimmed |
TBK::KPlay_dimmed |
TBK::KSkeep_R_dimmed );
@@ -1223,10 +1228,13 @@
}
}
else if ( event == TMPXCollectionMessage::EBroadcastEvent
- && ( type == EMcMsgUSBMassStorageEnd || type == EMcMsgUSBMTPEnd ))
+ && ( type == EMcMsgUSBMassStorageEnd ||
+ type == EMcMsgUSBMTPEnd ||
+ type == EMcMsgRefreshEnd ))
{
- iUSBOnGoing = EFalse;
- MPX_DEBUG2("CMCPMusicPlayer::DoHandleGeneralMessageL(), iUSBOnGoing changed to: %d", iUSBOnGoing );
+ iBlockingOperationOngoing = EFalse;
+ MPX_DEBUG2("CMCPMusicPlayer::DoHandleGeneralMessageL(), iBlockingOperationOngoing changed to: %d",
+ iBlockingOperationOngoing );
DoUpdatePlayerStateL( iEngine->PlayerState() );
if ( IsOKToPublishData() )
{
@@ -1297,31 +1305,12 @@
//
TInt CMCPMusicPlayer::MusicPlayerOpeningTimerCallback( TAny* aPtr )
{
- MPX_DEBUG1("CMCPMusicPlayer::MusicPlayerOpeningTimerCallback <---");
- RWsSession wsSession;
- TInt error = wsSession.Connect();
- if ( error != KErrNone )
- {
- return error;
- }
-
- TBool taskExists( EFalse );
- CAknTaskList* taskList( NULL );
- TRAPD( err, taskList = CAknTaskList::NewL( wsSession ) );
- if ( err == KErrNone )
+ MPX_DEBUG1("CMCPMusicPlayer::MusicPlayerOpeningTimerCallback <---");
+ if ( EMPlayerStatePlaying != static_cast<CMCPMusicPlayer*>(aPtr)->iEngine->PlayerState() )
{
- MPX_DEBUG2("CMCPMusicPlayer::MusicPlayerOpeningTimerCallback "
- "error = %d occur when creating CAknTaskList", err);
- TApaTask task = taskList->FindRootApp( TUid::Uid( KMusicPlayerAppUidAsTInt ) );
- delete taskList;
- taskExists = task.Exists();
- }
- wsSession.Close();
-
- if ( !taskExists )
- {
- MPX_DEBUG1("CMCPMusicPlayer::MusicPlayerOpeningTimerCallback Music Player not opened");
- //Reset the widget and menu, music player is not running
+ MPX_DEBUG1("CMCPMusicPlayer::MusicPlayerOpeningTimerCallback Music Player not Playing");
+ //Reset the widget and menu, music player is not running and playing.
+ static_cast<CMCPMusicPlayer*>(aPtr)->iActive = EFalse;
TRAP_IGNORE( static_cast<CMCPMusicPlayer*>(aPtr)->ResetL() );
}
static_cast<CMCPMusicPlayer*>(aPtr)->iMusicPlayerOpeningTimer->Cancel();
--- a/musicplayer_plat/mpx_music_player_app_api/inc/mpxappui.hrh Fri Feb 19 22:48:30 2010 +0200
+++ b/musicplayer_plat/mpx_music_player_app_api/inc/mpxappui.hrh Fri Mar 12 15:42:25 2010 +0200
@@ -54,8 +54,7 @@
EMPXCmdGotoCollection,
EMPXCmdVolumeMute,
EMPXCmdVolumeUnMute,
- EMPXCmdCancelReorder,
- EMPXCmdCheckIADUpdates
+ EMPXCmdCancelReorder
};
#endif // MPXAPPUI_HRH
--- a/musicplayer_plat/mpx_music_player_app_api/inc/mpxconstants.h Fri Feb 19 22:48:30 2010 +0200
+++ b/musicplayer_plat/mpx_music_player_app_api/inc/mpxconstants.h Fri Mar 12 15:42:25 2010 +0200
@@ -72,6 +72,14 @@
EMPXLaunchModeTempPlaylist
};
+// Trigger codes for MPX music player view transitions
+enum TTransitionType
+ {
+ EMPXTranstionNotDefined = 0,
+ EMPXTranstionToRight = 1001,
+ EMPXTranstionToLeft = 1002
+ };
+
// ERROR CODES
// Error code to note that the rights on a DRM file are about to expire