# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1270059993 -10800 # Node ID c8156a91d13cdde74cf5dd95f0ce12248ea7b12b # Parent 171e07ac910ff476b002ef409e63a2af82468d2b Revision: 201011 Kit: 201013 diff -r 171e07ac910f -r c8156a91d13c inc/musicplayerbldvariant.hrh --- a/inc/musicplayerbldvariant.hrh Mon Mar 15 12:40:11 2010 +0200 +++ b/inc/musicplayerbldvariant.hrh Wed Mar 31 21:26:33 2010 +0300 @@ -25,6 +25,7 @@ #define IAD_INCLUDE_ENHANCED_HOMESCREEN #define IAD_INCLUDE_UPNP #define IAD_INCLUDE_SINGLE_CLICK +#define IAD_INCLUDE_ABSTRACTAUDIOALBUM #endif // MUSICPLAYERBLDVARIANT_HRH diff -r 171e07ac910f -r c8156a91d13c mpxmusicplayer/sis/mpxmusicplayer.pkg --- a/mpxmusicplayer/sis/mpxmusicplayer.pkg Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxmusicplayer/sis/mpxmusicplayer.pkg Wed Mar 31 21:26:33 2010 +0300 @@ -121,7 +121,6 @@ ;"\epoc32\release\armv5\urel\camesedrmhandler.dll" -"!:\sys\bin\camesedrmhandler.dll" "\epoc32\release\armv5\urel\mcpmusicplayer.dll" -"!:\sys\bin\mcpmusicplayer.dll" -"\epoc32\release\armv5\urel\mpxcollectionpublisher.dll" -"!:\sys\bin\mpxcollectionpublisher.dll" "\epoc32\release\armv5\urel\musiccontentpublisher.dll" -"!:\sys\bin\musiccontentpublisher.dll" "\epoc32\release\armv5\urel\musicplayeractionhandlerplugin.dll" -"!:\sys\bin\musicplayeractionhandlerplugin.dll" "\epoc32\release\armv5\urel\dummyMusic.dll" -"!:\sys\bin\dummyMusic.dll" @@ -162,10 +161,8 @@ "\epoc32\data\Z\resource\apps\mpx_aif.mif" -"!:\resource\apps\mpx_aif.mif" "\epoc32\data\Z\resource\apps\mpxpodcastcollectionview.mif" -"!:\resource\apps\mpxpodcastcollectionview.mif" -; Music Suite Matrix Menu +; Music Homescreen "\epoc32\include\musichomescreen.rsg" -"!:\resource\apps\musichomescreen.rsg" -"\epoc32\data\z\private\101F4CD2\import\suites\musicsuite\suite.xml" -"!:\private\101F4CD2\import\suites\musicsuite\suite.xml" -"\epoc32\data\z\private\101F4CD2\import\suites\musicsuite\music_matrix_items.xml" -"!:\private\101F4CD2\import\suites\musicsuite\music_matrix_items.xml" ; cenrep files "101ffcd0.cre" -"!:\private\10202BE9\101ffcd0.cre" @@ -202,7 +199,6 @@ "\epoc32\data\Z\resource\plugins\mpxprogressdownload.rsc" -"!:\resource\plugins\mpxprogressdownload.rsc" "\epoc32\data\Z\resource\plugins\mpxprogressdownloadsb.rsc" -"!:\resource\plugins\mpxprogressdownloadsb.rsc" "\epoc32\data\Z\resource\plugins\mcpmusicplayer.rsc" -"!:\resource\apps\mcpmusicplayer.rsc" -"\epoc32\data\Z\resource\plugins\mpxcollectionpublisher.rsc" -"!:\resource\apps\mpxcollectionpublisher.rsc" "\epoc32\data\Z\resource\plugins\musiccontentpublisher.rsc" -"!:\resource\apps\musiccontentpublisher.rsc" "\epoc32\data\Z\resource\plugins\mpxscreensaverplugin.rsc" -"!:\resource\plugins\mpxscreensaverplugin.rsc" "\epoc32\data\Z\private\10003a3f\apps\mpx_reg.rsc" -"!:\private\10003a3f\import\apps\mpx_reg.rsc" diff -r 171e07ac910f -r c8156a91d13c mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/data/mpxcollectiondbhgres.rss --- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/data/mpxcollectiondbhgres.rss Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/data/mpxcollectiondbhgres.rss Wed Mar 31 21:26:33 2010 +0300 @@ -78,10 +78,10 @@ { array_of_menu_items = { - MENU_ITEM {id = EBrowseAll; name = LBUF {txt = qtn_mus_title_all_tracks;};}, + MENU_ITEM {id = EBrowseAll; name = LBUF {txt = qtn_mus_title_tracks;};}, MENU_ITEM {id = EBrowsePlaylist; name = LBUF {txt = qtn_mus_title_pls;};}, MENU_ITEM {id = EBrowseArtist; name = LBUF {txt = qtn_mus_title_artists;};}, - MENU_ITEM {id = EBrowseAlbum; name = LBUF {txt = qtn_mus_title_albums;};}, + MENU_ITEM {id = EBrowseAlbum; name = LBUF {txt = qtn_mus_title_artists_and_albums;};}, #ifdef __ENABLE_PODCAST_IN_MUSIC_MENU MENU_ITEM {id = EBrowsePodcasts; name = LBUF {txt = qtn_mus_podcasts;};}, #endif @@ -289,4 +289,34 @@ } #endif //__ENABLE_MUSIC_TEXT_ALIGNMENT +// --------------------------------------------------------------------------- +// r_mc_title_most_played +// Title for Most Played item in the playlists menu +// --------------------------------------------------------------------------- +// +RESOURCE LBUF r_mc_title_most_played + { + txt = qtn_mus_title_most_played; + } + +// --------------------------------------------------------------------------- +// r_mpx_qtn_mus_title_music_menu +// Title for Recently Played item in the playlists menu +// --------------------------------------------------------------------------- +// +RESOURCE LBUF r_mc_title_recently_played + { + txt = qtn_mus_title_recently_played; + } + +// --------------------------------------------------------------------------- +// r_mpx_qtn_mus_title_music_menu +// Title for Recently Added item in the playlists menu +// --------------------------------------------------------------------------- +// +RESOURCE LBUF r_mc_title_recently_downloaded + { + txt = qtn_mus_title_recently_downloaded; + } + // End of File diff -r 171e07ac910f -r c8156a91d13c mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/group/mpxsqlitedbhgplugin.mmp --- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/group/mpxsqlitedbhgplugin.mmp Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/group/mpxsqlitedbhgplugin.mmp Wed Mar 31 21:26:33 2010 +0300 @@ -19,6 +19,7 @@ #include #include #include +#include "../../../../../inc/musicplayerbldvariant.hrh" TARGET mpxsqlitedbhgplugin.dll TARGETTYPE PLUGIN @@ -35,6 +36,12 @@ MACRO __RAMDISK_PERF_ENABLE #define __RAMDISK_PERF_ENABLE +#ifdef IAD_INCLUDE_ABSTRACTAUDIOALBUM +MACRO ABSTRACTAUDIOALBUM_INCLUDED +MACRO RD_MPX_TNM_INTEGRATION +#define RD_MPX_TNM_INTEGRATION +#endif // IAD_INCLUDE_ABSTRACTAUDIOALBUM + SOURCEPATH ../src SOURCE mpxdbplugin.cpp SOURCE mpxdbpluginproxy.cpp @@ -53,6 +60,9 @@ SOURCE mpxdbalbum.cpp SOURCE mpxdbgenre.cpp SOURCE mpxdbcomposer.cpp +#ifdef IAD_INCLUDE_ABSTRACTAUDIOALBUM +SOURCE mpxdbabstractalbum.cpp +#endif // IAD_INCLUDE_ABSTRACTAUDIOALBUM SOURCEPATH ../data START RESOURCE mpxcollectiondbhgres.rss @@ -90,7 +100,9 @@ LIBRARY mpxsqlitedbcommon.lib LIBRARY mpxcommon.lib - +#ifdef RD_MPX_TNM_INTEGRATION +LIBRARY thumbnailmanager.lib +#endif ALWAYS_BUILD_AS_ARM OPTION ARMCC -O3 -Otime diff -r 171e07ac910f -r c8156a91d13c mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/inc/mpxcollectiondbdef.h --- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/inc/mpxcollectiondbdef.h Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/inc/mpxcollectiondbdef.h Wed Mar 31 21:26:33 2010 +0300 @@ -27,8 +27,11 @@ // ================================== DATABASE ================================ // Db filename +#ifdef ABSTRACTAUDIOALBUM_INCLUDED +_LIT(KMCDbFile, "mpxv2_6.db"); +#else _LIT(KMCDbFile, "mpxv2_5.db"); - +#endif // ABSTRACTAUDIOALBUM_INCLUDED // Collection Db resource file _LIT(KMPXCollectionDbResourceFile, "mpxcollectiondbhgres.rsc"); @@ -51,7 +54,10 @@ _LIT(KMCGenreTable, "Genre"); // The Composer table stores composers information _LIT(KMCComposerTable, "Composer"); - +#ifdef ABSTRACTAUDIOALBUM_INCLUDED +// The AbstractAlbum table stores Abstract Album Art information +_LIT(KMCAbstractAlbumTable, "AbstractAlbum"); +#endif // ABSTRACTAUDIOALBUM_INCLUDED // == Music TABLE FIELDS ====================================================== _LIT(KMCMusicUniqueId, "UniqueId"); @@ -94,6 +100,11 @@ _LIT(KMCMusicCodec, "Codec"); _LIT(KMCMusicMimeType, "MimeType"); _LIT(KMCMusicMTPDrmStatus, "MTPDrmStatus"); +#ifdef ABSTRACTAUDIOALBUM_INCLUDED +_LIT(KMCMusicAlbumArtist, "AlbumArtist"); +_LIT(KMCMusicContainEmbeddedArt, "ContainEmbeddedArt"); +_LIT(KMCMusicAbstractAlbum, "AbstractAlbum"); +#endif // ABSTRACTAUDIOALBUM_INCLUDED // == Category TABLE FIELDS =================================================== _LIT(KMCCategoryUniqueId, "UniqueId"); diff -r 171e07ac910f -r c8156a91d13c mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/inc/mpxdbabstractalbum.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/inc/mpxdbabstractalbum.h Wed Mar 31 21:26:33 2010 +0300 @@ -0,0 +1,208 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "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: This class is responsible for all category tables (Artist, +* Album, Genre, Composer, AbstractAlbum). +* +* +*/ + + +#ifndef MPXDBABSTRACTALBUM_H +#define MPXDBABSTRACTALBUM_H + +// INCLUDES +#include +#include +#include "mpxdbcategory.h" + + +// CLASS FORWARDS + +// CLASS DECLARATION + +/** +* Responsible for managing all music databases +* +* @lib MPXDbPlugin.lib +*/ + +class CMPXDbAbstractAlbum : + public CMPXDbCategory, + public MThumbnailManagerObserver + { + public: + + /** + * Two-phased constructor. + * @param aDbManager database manager to use for database interactions + * @param aCategory identifies the category + * @return New CMPXDbCategory instance. + */ + static CMPXDbAbstractAlbum* NewL(CMPXDbManager& aDbManager, + TMPXGeneralCategory aCategory); + + /** + * Two-phased constructor. + * @param aDbManager database manager to use for database interactions + * @param aCategory identifies the category + * @return New CMPXDbCategory instance on the cleanup stack. + */ + static CMPXDbAbstractAlbum* NewLC(CMPXDbManager& aDbManager, + TMPXGeneralCategory aCategory); + + /** + * Destructor + */ + virtual ~CMPXDbAbstractAlbum(); + + /** + * Find the drive Id for a abstractalbum + * @param aAbstractAlbumId identifies the abstractalbum + * @return corresponding drive id + */ + TInt GetDriveIdL(TUint32 aAbstractAlbumId); + + /** + * Add a category item. If the record already exists, its counter will + * be incremented. + * @param aName: This is the name to be entered into the row + * @param aDriveId: The Drive Id the name (category) belongs + * @param aNewRecord: indicates to the caller if a new record is created. + * ETrue if a new row is created in the table; otherwise EFalse. + * @param aCaseSensitive indicates whether case sensitivity should be taken + * into consideration when generating the unique row id + * @return The unique id of the row added. + */ + TUint32 AddItemL( const TDesC& aName, const TDesC& aAlbumArtist, const TDesC& aGenre, TInt aDriveId, TBool& aNewRecord, + TBool aCaseSensitive = ETrue); + + /** + * Decrement the number of songs for the item. If the count gets to 0, remove + * the item. + * @param aId: The ID of the category to delete. + * @param aDriveId: The drive Id the name (category) belongs to. Songs on different + * drives may belong to the same album or artist; consequently, one + * row for each artist/album id and drive ID pair will exist in the + * lookup table with a count existing for each row that tracks the + * number number of songs on that drive with that album/artist. + * @param aItemChangedMessages if valid on return contains a deleted message if the + * category was deleted + * @param aItemExist Out parameter, ETrue if the category is not deleted after the delete, + * EFalse otherwise + */ + void DecrementSongsForCategoryL(TUint32 aId, TInt aDriveId, + CMPXMessageArray* aItemChangedMessages, TBool& aItemExist, TBool aMtpInUse); + + /** + * Remove a abstractalbum and return its URI + * @param aAbstractAlbumId identifies the abstractalbum + * @return HBufC containing the URI. Ownership is transferred. + */ + HBufC* DeleteAbstractAlbumL(TUint32 aAbstractAlbumId, TInt aDriveId = 0); + + /** + * Update a category item. + * @param aId: The ID of the category to update + * @param aMedia: The media data + * @param aDriveId: The Drive Id the name (category) belongs + * @param aItemChangedMessages: if valid on return contains a updated message if the + * category was updated + */ + void UpdateItemL(TUint32 aId, const CMPXMedia& aMedia, TInt aDriveId, CMPXMessageArray* aItemChangedMessages); + + private: + + + /** + * Updates the media with information from the table + * @param aRecord record containing the source fields + * @param aAttrs attributes to be returned + * @param aMedia returns the requested attributes + */ + void UpdateMediaL(RSqlStatement& aRecord, const TArray& aAttrs, + CMPXMedia& aMedia); + + /** + * Generate searching criteria for album table from the given criteria + * @param aMedia media data + * @param aFields fields of Album table + * @param aValues values of each field of Album table + * @return a string containing the selection criteria. The ownership is passed to the caller. + */ + void GenerateAbstractAlbumFieldsValuesL(const CMPXMedia& aMedia, + CDesCArray& aFields, CDesCArray& aValues); + + + /** + * @see MMPXTable + */ + virtual void CreateTableL(RSqlDatabase& aDatabase, TBool aCorruptTable); + + + + /** + * @see MMPXTable + */ + virtual TBool CheckTableL(RSqlDatabase& aDatabase); + + + + /** + * C++ constructor. + * @param aDbManager database manager to use for database interactions + * @param aCategory identifies the category + */ + CMPXDbAbstractAlbum(CMPXDbManager& aDbManager, TMPXGeneralCategory aCategory); + + /** + * Second phase constructor. + */ + void ConstructL(); + + + /** + * MThumbnailManagerObserver + */ + void ThumbnailPreviewReady( + MThumbnailData& aThumbnail, TThumbnailRequestId aId ); + /** + * MThumbnailManagerObserver + */ + void ThumbnailReady( + TInt aError, + MThumbnailData& aThumbnail, TThumbnailRequestId aId ); + + public: + + /** + * Column indexes in the category tables + */ + enum TAbstractAlbumColumns + { + EAbstractAlbumUniqueId = KMPXTableDefaultIndex, + EAbstractAlbumName, + EAbstractAlbumArtist, + EAbstractAlbumGenre, + EAbstractAlbumSongCount, + EAbstractAlbumVolumeId, + EAbstractAlbumFieldCount + }; + + private: // Data + CThumbnailManager* iTNManager; + + }; +#endif // MPXDBAbstractAlbum_H + +// End of File diff -r 171e07ac910f -r c8156a91d13c mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/inc/mpxdbautoplaylist.h --- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/inc/mpxdbautoplaylist.h Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/inc/mpxdbautoplaylist.h Wed Mar 31 21:26:33 2010 +0300 @@ -139,6 +139,11 @@ HBufC* iRecentlyPlayedPlaylist; // recently played playlist name HBufC* iMostPlayedPlaylist; // most played playlist name HBufC* iRecentlyAddedPlaylist; // recently added playlist name + + HBufC* iTitleRecentlyPlayed; // title of recently played playlist name + HBufC* iTitleMostPlayed; // title of most played playlist name + HBufC* iTitleRecentlyAdded; // title of recently added playlist name + CMPXDbManager& iDbManager; }; diff -r 171e07ac910f -r c8156a91d13c mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/inc/mpxdbcategory.h --- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/inc/mpxdbcategory.h Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/inc/mpxdbcategory.h Wed Mar 31 21:26:33 2010 +0300 @@ -61,8 +61,13 @@ * into consideration when generating the unique row id * @return The unique id of the row added. */ +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + virtual TUint32 AddItemL(const TDesC& aName, TInt aDriveId, TBool& aNewRecord, + TBool aCaseSensitive = ETrue); +#else TUint32 AddItemL(const TDesC& aName, TInt aDriveId, TBool& aNewRecord, TBool aCaseSensitive = ETrue); +#endif // ABSTRACTAUDIOALBUM_INCLUDED /** * Get the name field for a given ID. @@ -100,9 +105,13 @@ * @param aItemExist Out parameter, ETrue if the category is not deleted after the delete, * EFalse otherwise */ +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + virtual void DecrementSongsForCategoryL(TUint32 aId, TInt aDriveId, + CMPXMessageArray* aItemChangedMessages, TBool& aItemExist, TBool aMtpInUse = EFalse); +#else void DecrementSongsForCategoryL(TUint32 aId, TInt aDriveId, CMPXMessageArray* aItemChangedMessages, TBool& aItemExist); - +#endif // ABSTRACTAUDIOALBUM_INCLUDED /** * Deletes a category. * @param aId identifies the category @@ -167,15 +176,15 @@ */ TInt GetSongsCountL(TInt aDriveId, TUint32 aId); - /** - * Update a category item. - * @param aId: The ID of the category to update - * @param aMedia: The media data - * @param aDriveId: The Drive Id the name (category) belongs - * @param aItemChangedMessages: if valid on return contains a updated message if the + /** + * Update a category item. + * @param aId: The ID of the category to update + * @param aMedia: The media data + * @param aDriveId: The Drive Id the name (category) belongs + * @param aItemChangedMessages: if valid on return contains a updated message if the * category was updated */ - void UpdateItemL(TUint32 aId, const CMPXMedia& aMedia, TInt aDriveId, CMPXMessageArray* aItemChangedMessages); + void UpdateItemL(TUint32 aId, const CMPXMedia& aMedia, TInt aDriveId, CMPXMessageArray* aItemChangedMessages); protected: diff -r 171e07ac910f -r c8156a91d13c mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/inc/mpxdbhandler.h --- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/inc/mpxdbhandler.h Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/inc/mpxdbhandler.h Wed Mar 31 21:26:33 2010 +0300 @@ -38,6 +38,9 @@ #include "mpxdbartist.h" // for MMPXDbArtistObserver #include "mpxdbalbum.h" // for MMPXDbAlbumObserver #include "mpxdbplaylist.h" // for MMPXDbPlaylistObserver +#ifdef ABSTRACTAUDIOALBUM_INCLUDED +#include "mpxdbabstractalbum.h" +#endif // ABSTRACTAUDIOALBUM_INCLUDED // FORWARD DECLARATIONS class CMPXMedia; @@ -121,7 +124,14 @@ * @return playlist Id of the playlist */ TUint32 AddSongToPlaylistL(const CMPXMedia& aMedia); - +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + /** + * Add an abstractalbum to the collection + * @param aMedia abstractalbum media object with URI of the abstractalbum. + * @return abstractalbum Id of the abstractalbum created + */ + TUint32 AddAbstractAlbumL(const CMPXMedia& aMedia, CMPXMessageArray* aMessageArray=NULL); +#endif // ABSTRACTAUDIOALBUM_INCLUDED /** * Update song info for a song in the music collection database * @param aMedia songDetails object which contains file path, @@ -132,7 +142,19 @@ */ CMPXDbActiveTask::TChangeVisibility UpdateSongL(const CMPXMedia& aMedia, CMPXMessageArray& aItemChangedMessages); - +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + /** + * Update songs info for songs associated with abstractalbum + * in the music collection database + * @param aMedia songDetails object which contains file path, + * artist, composer, name(title), track, etc... + * @param aItemChangedMessages a list of change events as a result of the + * song update + * @return ETrue if UI visible change else EFalse + */ + CMPXDbActiveTask::TChangeVisibility UpdateAbstractAlbumSongsL(const CMPXMedia& aMedia, + CMPXMessageArray& aItemChangedMessages); +#endif // ABSTRACTAUDIOALBUM_INCLUDED /** * Update playlist info in the music collection database * @param aMedia playlist details object which contains file path, @@ -217,6 +239,17 @@ */ void RemovePlaylistL(TUint32 aPlaylistId, CDesCArray& aUriArray, CMPXMessageArray& aItemChangedMessages); +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + /** + * Remove a abstractalbum This will remove all the songs from the abstractalbum + * @param aAbstractAlbumId ID of the abstractalbum to remove + * @param aUriArray a descriptor array to contain the URI of the deleted file + * @param aItemChangedMessages a list of change events as a result of the + * abstractalbum removal + */ + void RemoveAbstractAlbumL(TUint32 aAbstractAlbumId, CDesCArray& aUriArray, + CMPXMessageArray& aItemChangedMessages); +#endif // ABSTRACTAUDIOALBUM_INCLUDED /** * Remove a song from the specified playlist. @@ -392,6 +425,14 @@ */ TUint32 GetSongIdMatchingUriL(const TDesC& aUri); +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + /** + * Get the abstractalbum ID of the abstractalbum that matches the given URI + * @param aUri URI to match + * @return abstractalbum ID + */ + TUint32 GetAbstractAlbumIdMatchingUriL(const TDesC& aUri); +#endif // ABSTRACTAUDIOALBUM_INCLUDED /** * Get all the artist names from the music collection database sorted by name. * @param aAttrs required attributes @@ -847,7 +888,17 @@ */ void DoRemovePlaylistL(TUint32 aPlaylistId, CDesCArray& aUriArray, CMPXMessageArray& aItemChangedMessages); - +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + /** + * Deletes a specified abstractalbum. + * @param aAbstractAlbumId the abstractalbum to be deleted. + * @param aUriArray on return contains the URIs of the items deleted. + * @param aItemChangedMessages on return contains changed messages for all + * affected items + */ + void DoRemoveAbstractAlbumL(TUint32 aAbstractalbumId, CDesCArray& aUriArray, + CMPXMessageArray& aItemChangedMessages); +#endif // ABSTRACTAUDIOALBUM_INCLUDED /** * Deletes a song from a playlist. * @param aPlaylistId identifies the playlist. @@ -962,19 +1013,31 @@ private: // From MMPXDbMusicObserver +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + /** + * @see MMPXDbMusicObserver + */ + virtual TUint32 AddCategoryItemL(TMPXGeneralCategory aCategory, + const TDesC& aName, TInt aDriveId, + CMPXMessageArray* aItemChangedMessages, TBool& aItemExist, + const TDesC& aAlbumArtist=KNullDesC, + const TDesC& aGenre=KNullDesC); +#else + /** * @see MMPXDbMusicObserver */ virtual TUint32 AddCategoryItemL(TMPXGeneralCategory aCategory, const TDesC& aName, TInt aDriveId, CMPXMessageArray* aItemChangedMessages, TBool& aItemExist); +#endif // ABSTRACTAUDIOALBUM_INCLUDED - virtual TUint32 AddCategoryItemL(TMPXGeneralCategory aCategory, const TDesC& aName, - TUint32 aArtist, const TDesC& aArt, - TInt aDrive, CMPXMessageArray* aItemChangedMessages, TBool& aItemExist); + virtual TUint32 AddCategoryItemL(TMPXGeneralCategory aCategory, const TDesC& aName, + TUint32 aArtist, const TDesC& aArt, + TInt aDrive, CMPXMessageArray* aItemChangedMessages, TBool& aItemExist); - virtual void UpdateCategoryItemL(TMPXGeneralCategory aCategory, TUint32 aCategoryId, - const CMPXMedia& aMedia, TInt aDrive, CMPXMessageArray* aItemChangedMessages); + virtual void UpdateCategoryItemL(TMPXGeneralCategory aCategory, TUint32 aCategoryId, + const CMPXMedia& aMedia, TInt aDrive, CMPXMessageArray* aItemChangedMessages); /** * @see MMPXDbMusicObserver @@ -992,6 +1055,12 @@ * @see MMPXDbMusicObserver */ virtual void HandlePlaybackTimeModifiedL(CMPXMessageArray& aItemChangedMessages); +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + /** + * @see MMPXDbMusicObserver + */ + virtual HBufC* HandleGetAlbumNameFromIdL(TUint32 aId); +#endif // ABSTRACTAUDIOALBUM_INCLUDED private: // From MMPXDbArtistObserver /** * @see MMPXDbArtistObser @@ -1031,6 +1100,9 @@ CMPXCollectionDbManager* iDbManager; CMPXDbMusic* iDbMusic; CMPXDbPlaylist* iDbPlaylist; +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + CMPXDbAbstractAlbum* iDbAbstractAlbum; +#endif // ABSTRACTAUDIOALBUM_INCLUDED CMPXDbArtist* iDbArtist; CMPXDbAlbum* iDbAlbum; CMPXDbGenre* iDbGenre; diff -r 171e07ac910f -r c8156a91d13c mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/inc/mpxdbmusic.h --- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/inc/mpxdbmusic.h Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/inc/mpxdbmusic.h Wed Mar 31 21:26:33 2010 +0300 @@ -48,6 +48,23 @@ class MMPXDbMusicObserver { public: +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + /** + * Called when a new category item has to be added to a category table. + * @param aCategory category type + * @param aName name string + * @param aDrive drive to add the category to + * @param aItemChangedMessages changed mesages array to be updated or NULL + * @param aItemExist Out parameter, ETrue if the item already exist before the add, + * EFalse otherwise + * @param aAlbumArtist AlbumArtist string + * @param aGenre Genre string + * @return the ID of the category item (new or existing) + */ + virtual TUint32 AddCategoryItemL(TMPXGeneralCategory aCategory, const TDesC& aName, + TInt aDrive, CMPXMessageArray* aItemChangedMessages, TBool& aItemExist, const TDesC& aAlbumArtist=KNullDesC, + const TDesC& aGenre=KNullDesC) = 0; +#else /** * Called when a new category item has to be added to a category table. * @param aCategory category type @@ -60,11 +77,11 @@ */ virtual TUint32 AddCategoryItemL(TMPXGeneralCategory aCategory, const TDesC& aName, TInt aDrive, CMPXMessageArray* aItemChangedMessages, TBool& aItemExist) = 0; - - // for Album and Artist table - virtual TUint32 AddCategoryItemL(TMPXGeneralCategory aCategory, const TDesC& aName, - TUint32 aArtistId, const TDesC& aArt, - TInt aDrive, CMPXMessageArray* aItemChangedMessages, TBool& aItemExist) = 0; +#endif // ABSTRACTAUDIOALBUM_INCLUDED + // for Album and Artist table + virtual TUint32 AddCategoryItemL(TMPXGeneralCategory aCategory, const TDesC& aName, + TUint32 aArtistId, const TDesC& aArt, + TInt aDrive, CMPXMessageArray* aItemChangedMessages, TBool& aItemExist) = 0; /** * Called when the ID of a category item changed for a Music record, for example when * the artist name changed for a song. The implementation is supposed to update the @@ -102,9 +119,17 @@ * @param aMedia media data * @param aItemChangedMessages changed mesages array to be updated or NULL */ - virtual void UpdateCategoryItemL(TMPXGeneralCategory aCategory, TUint32 aCategoryId, - const CMPXMedia& aMedia, TInt aDrive, CMPXMessageArray* aItemChangedMessages) = 0; - }; + virtual void UpdateCategoryItemL(TMPXGeneralCategory aCategory, TUint32 aCategoryId, + const CMPXMedia& aMedia, TInt aDrive, CMPXMessageArray* aItemChangedMessages) = 0; +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + /** + * Get title from the Id + * @param Id to search for + * @return name matching the ID + */ + virtual HBufC* HandleGetAlbumNameFromIdL( TUint32 aId ) = 0; +#endif // ABSTRACTAUDIOALBUM_INCLUDED + }; /** * Responsible for managing the Music table @@ -210,6 +235,21 @@ */ TInt GetDriveL(TUint32 aSongId); +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + /** + * Get the drive and category IDs for a specified song + * @param aSongId song to be retrieved + * @param aArtistId returns the artist ID + * @param aAlbumId returns the artist ID + * @param aGenreId returns the artist ID + * @param aComposerId returns the artist ID + * @param aAbstractAlbumId returns the AbstractAlbum ID + * @param aDriveId returns the song drive + * @return song URI. The ownership is transferred. + */ + HBufC* GetSongInfoL(TUint32 aSongId, TUint32& aArtistId, TUint32& aAlbumId, + TUint32& aGenreId, TUint32& aComposerId, TUint32& aAbstractAlbumId, TInt& aDriveId); +#else /** * Get the drive and category IDs for a specified song * @param aSongId song to be retrieved @@ -222,7 +262,7 @@ */ HBufC* GetSongInfoL(TUint32 aSongId, TUint32& aArtistId, TUint32& aAlbumId, TUint32& aGenreId, TUint32& aComposerId, TInt& aDriveId); - +#endif // ABSTRACTAUDIOALBUM_INCLUDED /** * Get the song Id, title, URI, and general flags from the given song Id and/or URI * @param aCriteria search the media by song Id and/or URI @@ -379,6 +419,18 @@ void GetSongsForComposerL(TUint aComposerId, const TArray& aAttrs, CMPXMediaArray& aMediaArray); + +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + /** + * Returns all songs for a given abstractalbum. + * @param aDrive drive ID AbstractAlbum stored + * @param aAbstractAlbumId abstractalbum to get the songs for + * @param aAttrs attributes to be retrieved + * @param aMediaArray returns the song attributes. + */ + void GetAllSongsForAbstractAlbumL(TInt aDrive, TInt aAbstractAlbumId, + const TArray& aAttrs, CMPXMediaArray& aMediaArray); +#endif // ABSTRACTAUDIOALBUM_INCLUDED /** * Returns the duration of all songs. * @return the duration value @@ -473,7 +525,7 @@ /** * Get the ID of Artist which belongs to the specified Album - * @param aId, the ID of Album + * @param aId, the ID of Album */ TUint32 CMPXDbMusic::ArtistForAlbumL(const TUint32 aId); @@ -641,9 +693,9 @@ const TMPXAttribute& aAttribute, TUint32 aOldId, TInt aDriveId, CMPXMessageArray* aItemChangedMessages, TUint32& aItemId); - TBool UpdateCategoryFieldL(TMPXGeneralCategory aCategory, const CMPXMedia& aMedia, - const TMPXAttribute& aAttribute, TUint32 aOldId, TInt aDriveId, - CMPXMessageArray* aItemChangedMessages, TUint32& aItemId, TUint32 aArtistId); + TBool UpdateCategoryFieldL(TMPXGeneralCategory aCategory, const CMPXMedia& aMedia, + const TMPXAttribute& aAttribute, TUint32 aOldId, TInt aDriveId, + CMPXMessageArray* aItemChangedMessages, TUint32& aItemId, TUint32 aArtistId); /** * Checks if extra attributes are required. The "standard attribute set includes: * EMPXMediaGeneralId, EMPXMediaGeneralType, EMPXMediaGeneralCategory, @@ -696,45 +748,50 @@ /** * Column indexes in the music table */ - enum TMusicColumns - { - EMusicUniqueId = KMPXTableDefaultIndex, - EMusicDbFlag, - EMusicVolumeId, - EMusicTitle, - EMusicArtist, - EMusicArt, - EMusicDeleted, - EMusicLocation, - EMusicAlbumTrack, - EMusicPlayCount, - EMusicTimeAdded, - EMusicTimePlayed, - EMusicDuration, - EMusicSync, - EMusicModified, - EMusicAlbum, - EMusicGenre, - EMusicComposer, - EMusicReleaseDate, - EMusicRating, - EMusicComment, - EMusicCopyright, - EMusicUrl, - EMusicDRM, - EMusicLastPlayPosition, - EMusicSampleRate, - EMusicBitRate, - EMusicNumChannels, - EMusicCodec, - EMusicMimeType, - EMusicMTPDrmStatus, - EMusicArtistName, - EMusicAlbumName, - EMusicGenreName, - EMusicComposerName, - EMusicFieldCount - }; + enum TMusicColumns + { + EMusicUniqueId = KMPXTableDefaultIndex, + EMusicDbFlag, + EMusicVolumeId, + EMusicTitle, + EMusicArtist, + EMusicArt, + EMusicDeleted, + EMusicLocation, + EMusicAlbumTrack, + EMusicPlayCount, + EMusicTimeAdded, + EMusicTimePlayed, + EMusicDuration, + EMusicSync, + EMusicModified, + EMusicAlbum, + EMusicGenre, + EMusicComposer, + EMusicReleaseDate, + EMusicRating, + EMusicComment, + EMusicCopyright, + EMusicUrl, + EMusicDRM, + EMusicLastPlayPosition, + EMusicSampleRate, + EMusicBitRate, + EMusicNumChannels, + EMusicCodec, + EMusicMimeType, + EMusicMTPDrmStatus, +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + EMusicAlbumArtist, + EMusicContainEmbeddedArt, + EMusicAbstractAlbum, +#endif // ABSTRACTAUDIOALBUM_INCLUDED + EMusicArtistName, + EMusicAlbumName, + EMusicGenreName, + EMusicComposerName, + EMusicFieldCount + }; /* * Unique ID for Queries with a lifetime diff -r 171e07ac910f -r c8156a91d13c mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/inc/mpxdbpluginqueries.h --- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/inc/mpxdbpluginqueries.h Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/inc/mpxdbpluginqueries.h Wed Mar 31 21:26:33 2010 +0300 @@ -23,6 +23,44 @@ // == Music table queries ===================================================== // +#ifdef ABSTRACTAUDIOALBUM_INCLUDED +_LIT(KMusicCreateTable, "CREATE TABLE Music(" + L"UniqueId INTEGER PRIMARY KEY," + L"DbFlag INTEGER," + L"VolumeId INTEGER," + L"Title TEXT COLLATE NOCASE," + L"Artist INTEGER," + L"Art TEXT," + L"Deleted INTEGER DEFAULT 0," + L"Location TEXT," + L"AlbumTrack INTEGER," + L"PlayCount INTEGER DEFAULT 0," + L"TimeAdded TEXT," + L"TimePlayed TEXT DEFAULT ''," + L"Duration INTEGER," + L"Sync INTEGER DEFAULT 0," + L"Modified INTEGER DEFAULT 0," + L"Album INTEGER," + L"Genre INTEGER," + L"Composer INTEGER," + L"ReleaseDate TEXT DEFAULT ''," + L"Rating INTEGER," + L"Comment TEXT," + L"Copyright TEXT," + L"Url TEXT," + L"DRM INTEGER," + L"LastPlayPosition INTEGER DEFAULT 0," + L"SampleRate INTEGER," + L"BitRate INTEGER," + L"NumChannels INTEGER," + L"Codec INTEGER," + L"MimeType TEXT," + L"MTPDrmStatus INTEGER," + L"AlbumArtist TEXT," + L"ContainEmbeddedArt INTEGER DEFAULT 0," + L"AbstractAlbum INTEGER)"); + +#else _LIT(KMusicCreateTable, "CREATE TABLE Music(" L"UniqueId INTEGER PRIMARY KEY," L"DbFlag INTEGER," @@ -55,10 +93,14 @@ L"Codec INTEGER," L"MimeType TEXT," L"MTPDrmStatus INTEGER)"); +#endif // ABSTRACTAUDIOALBUM_INCLUDED _LIT(KMusicDropTable,"DROP TABLE Music"); +#ifdef ABSTRACTAUDIOALBUM_INCLUDED +_LIT(KMusicCheckTable,"SELECT UniqueId,Title,Location,Artist,Album,AlbumTrack,Genre,Composer,Duration,ReleaseDate,TimeAdded,PlayCount,TimePlayed,Rating,Comment,Copyright,Art,DbFlag,Sync,Modified,Deleted,Url,DRM,LastPlayPosition,SampleRate,BitRate,VolumeId,NumChannels,Codec,MimeType,MTPDrmStatus,AlbumArtist,ContainEmbeddedArt,AbstractAlbum FROM Music"); +#else _LIT(KMusicCheckTable,"SELECT UniqueId,Title,Location,Artist,Album,AlbumTrack,Genre,Composer,Duration,ReleaseDate,TimeAdded,PlayCount,TimePlayed,Rating,Comment,Copyright,Art,DbFlag,Sync,Modified,Deleted,Url,DRM,LastPlayPosition,SampleRate,BitRate,VolumeId,NumChannels,Codec,MimeType,MTPDrmStatus FROM Music"); - +#endif // ABSTRACTAUDIOALBUM_INCLUDED // indexes _LIT(KMusicDeletedIdIndex,"CREATE INDEX IndexMusicDeletedId ON Music(Deleted,UniqueId)"); _LIT(KMusicDeletedTitleIndex,"CREATE INDEX IndexMusicDeletedTitle ON Music(Deleted,Title)"); @@ -112,7 +154,9 @@ _LIT(KQueryMusicGetRecentlyPlayed, "SELECT Music.*,Artist.Name,Album.Name,Genre.Name,Composer.Name FROM :dbname.Music,:dbname.Artist,:dbname.Album,:dbname.Genre,:dbname.Composer WHERE Music.Deleted=0 AND Music.TimePlayed<>'' AND Music.Album=Album.UniqueId AND Music.Artist=Artist.UniqueId AND Music.Genre=Genre.UniqueId AND Music.Composer=Composer.UniqueId ORDER BY 12 DESC LIMIT %u"); _LIT(KQueryMusicGetMostPlayed, "SELECT Music.*,Artist.Name,Album.Name,Genre.Name,Composer.Name FROM :dbname.Music,:dbname.Artist,:dbname.Album,:dbname.Genre,:dbname.Composer WHERE Music.Deleted=0 AND Music.PlayCount<>0 AND Music.Album=Album.UniqueId AND Music.Artist=Artist.UniqueId AND Music.Genre=Genre.UniqueId AND Music.Composer=Composer.UniqueId ORDER BY PlayCount DESC, TimePlayed DESC LIMIT %u"); _LIT(KQueryMusicGetRecentlyAdded, "SELECT Music.*,Artist.Name,Album.Name,Genre.Name,Composer.Name FROM :dbname.Music,:dbname.Artist,:dbname.Album,:dbname.Genre,:dbname.Composer WHERE Music.Deleted=0 AND (julianday(Music.TimeAdded)>julianday('now','-7 days')) AND Music.Album=Album.UniqueId AND Music.Artist=Artist.UniqueId AND Music.Genre=Genre.UniqueId AND Music.Composer=Composer.UniqueId ORDER BY 11 DESC"); - +#ifdef ABSTRACTAUDIOALBUM_INCLUDED +_LIT(KQueryMusicGetSongsForAbstractAlbum,"SELECT Music.*,AbstractAlbum.Name FROM :dbname.Music,:dbname.AbstractAlbum WHERE Music.Deleted=0 AND Music.AbstractAlbum=AbstractAlbum.UniqueId AND AbstractAlbum.UniqueId=%u"); +#endif // ABSTRACTAUDIOALBUM_INCLUDED _LIT(KQueryMusicSong, "SELECT UniqueId,DbFlag,VolumeId,Title,0,'',0,Location FROM :dbname.Music WHERE %S"); _LIT(KQueryMusicFindAll, "SELECT Music.*,Artist.Name,Album.Name,Genre.Name,Composer.Name FROM :dbname.Music,:dbname.Artist,:dbname.Album,:dbname.Genre,:dbname.Composer WHERE %S AND Music.Album=Album.UniqueId AND Music.Artist=Artist.UniqueId AND Music.Genre=Genre.UniqueId AND Music.Composer=Composer.UniqueId %S"); @@ -139,11 +183,17 @@ _LIT(KQueryMusicGetMostPlayedNoCategories, "SELECT UniqueId,DbFlag,VolumeId,Title,0,'',0,Location,PlayCount,TimePlayed FROM :dbname.Music WHERE Deleted=0 AND PlayCount<>0 ORDER BY PlayCount DESC, TimePlayed DESC LIMIT %u"); _LIT(KQueryMusicGetRecentlyAddedNoCategories, "SELECT UniqueId,DbFlag,VolumeId,Title,0,'',0,Location,TimeAdded FROM :dbname.Music WHERE Deleted=0 AND (julianday(TimeAdded)>julianday('now','-7 days')) ORDER BY TimeAdded DESC"); +#ifdef ABSTRACTAUDIOALBUM_INCLUDED +_LIT(KQueryMusicGetSongsInBlockAsc, "SELECT Music.UniqueId,Music.DbFlag,Music.VolumeId,Music.Title,Music.Artist,Music.Art,0,'',0,0,'','',0,0,0,0,0,0,0,0,'','','',0,0,0,0,0,0,'',0,'',0,0,Artist.Name FROM :dbname.Music,:dbname.Artist WHERE Deleted=0 AND Music.Artist=Artist.UniqueId AND Title > :title ORDER BY 4 ASC LIMIT :limit"); +_LIT(KQueryMusicGetSongsInBlockDsc, "SELECT Music.UniqueId,Music.DbFlag,Music.VolumeId,Music.Title,Music.Artist,Music.Art,0,'',0,0,'','',0,0,0,0,0,0,0,0,'','','',0,0,0,0,0,0,'',0,'',0,0,Artist.Name FROM :dbname.Music,:dbname.Artist WHERE Deleted=0 AND Music.Artist=Artist.UniqueId AND Title < :title ORDER BY 4 DESC LIMIT :limit"); +_LIT(KQueryMusicGetSongsAtOffset, "SELECT Music.UniqueId,Music.DbFlag,Music.VolumeId,Music.Title,Music.Artist,Music.Art,0,'',0,0,'','',0,0,0,0,0,0,0,0,'','','',0,0,0,0,0,0,'',0,'',0,0,Artist.Name FROM :dbname.Music,:dbname.Artist WHERE Deleted=0 AND Music.Artist=Artist.UniqueId ORDER BY 4 LIMIT :limit OFFSET :offset"); +_LIT(KQueryMusicGetSongsLimited, "Select Music.UniqueId,Music.DbFlag,Music.VolumeId,Music.Title,Music.Artist,Music.Art,0,'',0,0,'','',0,0,0,0,0,0,0,0,'','','',0,0,0,0,0,0,'',0,'',0,0,Artist.Name FROM :dbname.Music,:dbname.Artist WHERE Deleted=0 AND Music.Artist=Artist.UniqueId ORDER BY 4 LIMIT %u"); +#else _LIT(KQueryMusicGetSongsInBlockAsc, "SELECT Music.UniqueId,Music.DbFlag,Music.VolumeId,Music.Title,Music.Artist,Music.Art,0,'',0,0,'','',0,0,0,0,0,0,0,0,'','','',0,0,0,0,0,0,'',0,Artist.Name FROM :dbname.Music,:dbname.Artist WHERE Deleted=0 AND Music.Artist=Artist.UniqueId AND Title > :title ORDER BY 4 ASC LIMIT :limit"); _LIT(KQueryMusicGetSongsInBlockDsc, "SELECT Music.UniqueId,Music.DbFlag,Music.VolumeId,Music.Title,Music.Artist,Music.Art,0,'',0,0,'','',0,0,0,0,0,0,0,0,'','','',0,0,0,0,0,0,'',0,Artist.Name FROM :dbname.Music,:dbname.Artist WHERE Deleted=0 AND Music.Artist=Artist.UniqueId AND Title < :title ORDER BY 4 DESC LIMIT :limit"); _LIT(KQueryMusicGetSongsAtOffset, "SELECT Music.UniqueId,Music.DbFlag,Music.VolumeId,Music.Title,Music.Artist,Music.Art,0,'',0,0,'','',0,0,0,0,0,0,0,0,'','','',0,0,0,0,0,0,'',0,Artist.Name FROM :dbname.Music,:dbname.Artist WHERE Deleted=0 AND Music.Artist=Artist.UniqueId ORDER BY 4 LIMIT :limit OFFSET :offset"); _LIT(KQueryMusicGetSongsLimited, "Select Music.UniqueId,Music.DbFlag,Music.VolumeId,Music.Title,Music.Artist,Music.Art,0,'',0,0,'','',0,0,0,0,0,0,0,0,'','','',0,0,0,0,0,0,'',0,Artist.Name FROM :dbname.Music,:dbname.Artist WHERE Deleted=0 AND Music.Artist=Artist.UniqueId ORDER BY 4 LIMIT %u"); - +#endif // ABSTRACTAUDIOALBUM_INCLUDED _LIT(KQueryMusicGetUri, "SELECT Location,VolumeId FROM :dbname.Music WHERE Deleted=0 AND UniqueId=%u"); _LIT(KQueryMusicGetTitle, "SELECT Title FROM :dbname.Music WHERE Deleted=0 AND UniqueId=%u"); _LIT(KQueryMusicGetMusicUris, "SELECT UniqueId,Location FROM :dbname.Music WHERE Deleted=0 ORDER BY UniqueId ASC LIMIT %u"); @@ -216,8 +266,11 @@ L"SaveDeletedRecordCount INTEGER DEFAULT 0)"); _LIT(KAuxiliaryDropTable,"DROP TABLE Auxiliary"); _LIT(KAuxiliaryCheckTable, "SELECT Id,Version,TimeRefreshed,TimeSynced,Corrupt,SaveDeletedRecordCount FROM AUXILIARY"); +#ifdef ABSTRACTAUDIOALBUM_INCLUDED +_LIT(KQueryAuxiliaryInsert, "INSERT INTO Auxiliary(Id,Version,Corrupt) VALUES(0,'6.5.0',%u)"); +#else _LIT(KQueryAuxiliaryInsert, "INSERT INTO Auxiliary(Id,Version,Corrupt) VALUES(0,'6.4.0',%u)"); - +#endif // ABSTRACTAUDIOALBUM_INCLUDED _LIT(KQueryAuxiliarySetTime, "UPDATE :dbname.Auxiliary SET TimeRefreshed='%S', Corrupt=0"); _LIT(KQueryAuxiliaryGetTime, "SELECT TimeRefreshed FROM :dbname.Auxiliary"); _LIT(KQueryAuxiliarySetCorrupt, "UPDATE :dbname.Auxiliary SET Corrupt=%u"); @@ -400,4 +453,21 @@ _LIT(KQueryArtistAll, "SELECT Artist.* FROM :dbname.Artist ORDER BY 2"); _LIT(KQueryArtistName, "SELECT Artist.Name FROM :dbname.Artist WHERE UniqueId=%u"); +#ifdef ABSTRACTAUDIOALBUM_INCLUDED +// == AbstractAlbum table queries ========================================== +// +_LIT(KAbstractAlbumCreateTable,"CREATE TABLE AbstractAlbum(" + L"UniqueId INTEGER PRIMARY KEY," + L"Name TEXT COLLATE NOCASE," + L"AlbumArtist TEXT," + L"Genre TEXT," + L"SongCount INTEGER," + L"VolumeId INTEGER)"); + +_LIT(KAbstractAlbumCheckTable,"SELECT UniqueId,Name,SongCount,VolumeId FROM AbstractAlbum"); +_LIT(KCriterionAbstractAlbumVolumeId, "VolumeId=%u"); +_LIT(KQueryAbstractAlbumInsert, "INSERT INTO :dbname.AbstractAlbum(UniqueId,Name,AlbumArtist,Genre,SongCount,VolumeId) VALUES(%u,'%S','%S','%S',%u,%u)"); +_LIT(KQueryAbstractAlbumUpdate, "UPDATE :dbname.AbstractAlbum SET %S WHERE UniqueId=%u"); +_LIT(KCriterionCategoryVolumeId, "SELECT VolumeId FROM :dbname.AbstractAlbum WHERE UniqueId=%u"); +#endif // ABSTRACTAUDIOALBUM_INCLUDED #endif // MPXDBPLUGINQUERIES_H diff -r 171e07ac910f -r c8156a91d13c mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/loc/mpxcollectiondbhg.loc --- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/loc/mpxcollectiondbhg.loc Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/loc/mpxcollectiondbhg.loc Wed Mar 31 21:26:33 2010 +0300 @@ -178,10 +178,34 @@ // #define qtn_mus_title_music_menu "Music Menu" -// d:Text for music library menu. -// l:list_logical_template_1_title -// r:10.0 +// d:Title for Artists & Albums view in portrait mode +// l:title_pane_t2/opt9 +// r:5.2 +// +#define qtn_mus_title_artists_and_albums "Artists & Albums" + +// d:Text shown if there is more than one song in the playlist. +// d:where %N is the number of songs within the playlist +// d:and %U is the duration time for the total playlist, +// d:in the format hh:mm:ss or mm:ss is displayed. +// d:if the playlist is empty, the duration is displayed as dashes (-- : --) +// l:list_double_large_graphic_pane_t2 +// r:5.2 // -#define qtn_mp_title_my_music_menu_nseries "My Music" +#define qtn_mus_music_num_songs_duration "%N songs - %U" + +// d:Text shown if there is only one song in the playlist +// d:%U is the duration time for the total playlist, +// d:in the format hh:mm:ss or mm:ss is displayed. +// l:list_double_large_graphic_pane_t2 +// r:5.2 +// +#define qtn_mus_music_one_song_duration "1 song - %U" + +// d:Title for Songs view +// l:title_pane_t2/opt9 +// r:5.2 +// +#define qtn_mus_title_tracks "Songs" // End of File diff -r 171e07ac910f -r c8156a91d13c mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/src/mpxdbabstractalbum.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/src/mpxdbabstractalbum.cpp Wed Mar 31 21:26:33 2010 +0300 @@ -0,0 +1,463 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "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: Responsible for interation with the category tables: +* Artist, Album, Genre, Composer and AbstractAlbum +* +*/ + + +// INCLUDE FILES +#include +#include +#include +#include "mpxdbabstractalbum.h" +#include "mpxdbpluginqueries.h" +#include "mpxdbmanager.h" +#include "mpxdbcommonutil.h" +#include "mpxcollectiondbstd.h" +#include "mpxdbcommondef.h" +#include "mpxcollectiondbdef.h" + +#ifdef RD_MPX_TNM_INTEGRATION +_LIT( KImageFileType, "image/jpeg" ); +#endif //RD_MPX_TNM_INTEGRATION + + +// CONSTANTS + + + + +// ============================ MEMBER FUNCTIONS ============================== + +// ---------------------------------------------------------------------------- +// Two-phased constructor. +// ---------------------------------------------------------------------------- +// +CMPXDbAbstractAlbum* CMPXDbAbstractAlbum::NewL( + CMPXDbManager& aDbManager, + TMPXGeneralCategory aCategory) + { + MPX_FUNC("CMPXDbAbstractAlbum::NewL"); + + CMPXDbAbstractAlbum* self = CMPXDbAbstractAlbum::NewLC(aDbManager, aCategory); + CleanupStack::Pop(self); + return self; + } + +// ---------------------------------------------------------------------------- +// Two-phased constructor. +// ---------------------------------------------------------------------------- +// +CMPXDbAbstractAlbum* CMPXDbAbstractAlbum::NewLC( + CMPXDbManager& aDbManager, + TMPXGeneralCategory aCategory) + { + MPX_FUNC("CMPXDbAbstractAlbum::NewLC"); + + CMPXDbAbstractAlbum* self = new (ELeave) CMPXDbAbstractAlbum(aDbManager, aCategory); + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +// ---------------------------------------------------------------------------- +// Destructor +// ---------------------------------------------------------------------------- +// +CMPXDbAbstractAlbum::~CMPXDbAbstractAlbum() + { + MPX_FUNC("CMPXDbAbstractAlbum::~CMPXDbAbstractAlbum"); +#ifdef RD_MPX_TNM_INTEGRATION + delete iTNManager; +#endif //RD_MPX_TNM_INTEGRATION + } + +// ---------------------------------------------------------------------------- +// CMPXDbAbstractAlbum::GetDriveIdL +// ---------------------------------------------------------------------------- +// +TInt CMPXDbAbstractAlbum::GetDriveIdL( + TUint32 aAbstractAlbumId) + { + MPX_FUNC("CMPXDbAbstractAlbum::GetDriveIdL"); + return MPXDbCommonUtil::GetDriveIdMatchVolIdL(iDbManager.Fs(), + ExecuteIntQueryL(KCriterionCategoryVolumeId, aAbstractAlbumId)); + } + + +// ---------------------------------------------------------------------------- +// CMPXDbAbstractAlbum::AddItemL +// ---------------------------------------------------------------------------- +// +TUint32 CMPXDbAbstractAlbum::AddItemL( + const TDesC& aName, + const TDesC& aAlbumArtist, + const TDesC& aGenre, + TInt aDriveId, + TBool& aNewRecord, + TBool aCaseSensitive) + { + MPX_FUNC("CMPXDbAbstractAlbum::AddItemL"); + + TUint32 rowId(MPXDbCommonUtil::GenerateUniqueIdL(iDbManager.Fs(), EMPXAbstractAlbum, + aName, aCaseSensitive)); + + if ( aNewRecord ) + { + HBufC* name = MPXDbCommonUtil::ProcessSingleQuotesLC(aName); + HBufC* albumartist = MPXDbCommonUtil::ProcessSingleQuotesLC(aAlbumArtist); + HBufC* genre = MPXDbCommonUtil::ProcessSingleQuotesLC(aGenre); + + iDbManager.ExecuteQueryL(aDriveId, KQueryAbstractAlbumInsert, rowId, name, albumartist, genre, 0, MPXDbCommonUtil::GetVolIdMatchDriveIdL(iDbManager.Fs(), aDriveId)); + CleanupStack::PopAndDestroy(3, name); + } + else + { + // increment the number of songs for the category + HBufC* query = PreProcessStringLC(KQueryCategoryIncrementSongCount); + iDbManager.ExecuteQueryL(aDriveId, *query, rowId); + CleanupStack::PopAndDestroy(query); + } + + return rowId; + } + + + +// ---------------------------------------------------------------------------- +// CMPXDbAbstractAlbum::DecrementSongsForCategoryL +// ---------------------------------------------------------------------------- +// +void CMPXDbAbstractAlbum::DecrementSongsForCategoryL( + const TUint32 aId, + TInt aDriveId, + CMPXMessageArray* aItemChangedMessages, + TBool& aItemExist, + TBool aMtpInUse) + { + MPX_FUNC("CMPXDbAbstractAlbum::DecrementSongsForCategoryL"); + + TInt songCount = GetSongsCountL(aDriveId, aId); + // if just one song uses this category. Use <= just in case + //while MTP connection, just decrease songCount in DB, do not do deletion. + if ( songCount > 0 ) + { + aItemExist = ETrue; + // decrement the number of songs for the category + HBufC* query = PreProcessStringLC(KQueryCategoryDecrementSongCount); + iDbManager.ExecuteQueryL(aDriveId, *query, aId); + CleanupStack::PopAndDestroy(query); + songCount--; + } + + if ((songCount == 0) && !aMtpInUse) + { + HBufC* uri = DeleteAbstractAlbumL(aId, aDriveId); + MPX_DEBUG1("CMPXDbAbstractAlbum::DeleteAbstractAlbumL,implicitly delete AbstractAlbum Object when it has 0 references"); + aItemExist = EFalse; + if (aItemChangedMessages) + { + // add the item changed message + MPXDbCommonUtil::AddItemChangedMessageL(*aItemChangedMessages, aId, EMPXItemDeleted, + EMPXAbstractAlbum, KDBPluginUid); + } + delete uri; + } + } + + +// ---------------------------------------------------------------------------- +// CMPXDbAbstractAlbum::DeleteAbstractAlbumL +// ---------------------------------------------------------------------------- +// +HBufC* CMPXDbAbstractAlbum::DeleteAbstractAlbumL( + TUint32 aAbstractAlbumId, TInt aDriveId) + { + MPX_FUNC("CMPXDbAbstractAlbum::DeleteAbstractAlbumL"); + + //before delete category, get the abstract album path + HBufC* uri = GetNameL(aAbstractAlbumId); + // delete the category + if (uri) + { + CleanupStack::PushL(uri); + + if (aDriveId) + DeleteCategoryL(aAbstractAlbumId, aDriveId); + else + { + TInt drive = MPXDbCommonUtil::GetDriveIdMatchVolIdL(iDbManager.Fs(), + ExecuteIntQueryL(KCriterionCategoryVolumeId, aAbstractAlbumId)); + DeleteCategoryL(aAbstractAlbumId, drive); + } +//delete abstract album .alb from TN table +#ifdef RD_MPX_TNM_INTEGRATION + // remove from thumbnail database table + CThumbnailObjectSource* source = CThumbnailObjectSource::NewLC( + *uri, KImageFileType ); + iTNManager->DeleteThumbnails( *source ); + CleanupStack::PopAndDestroy( source ); +#endif //RD_MPX_TNM_INTEGRATION + + + //delete abstract album .alb file from file system + RFs rFs; + User::LeaveIfError( rFs.Connect() ); + CleanupClosePushL( rFs ); + + TInt err = BaflUtils::DeleteFile(rFs, *uri); + if(KErrNone != err) + { + MPX_DEBUG2("CMPXDbAbstractAlbum::DeleteAbstractAlbumL,File not deleted from file system with err=%d", err); + } + + CleanupStack::PopAndDestroy( &rFs ); + } + + CleanupStack::Pop(uri); + return uri; + } + + +// ---------------------------------------------------------------------------- +// CMPXDbAbstractAlbum::UpdateItemL +// ---------------------------------------------------------------------------- +// +void CMPXDbAbstractAlbum::UpdateItemL( + TUint32 aId, + const CMPXMedia& aMedia, + TInt aDriveId, + CMPXMessageArray* aItemChangedMessages) + { + MPX_FUNC("CMPXDbAbstractAlbum::UpdateItemL"); + + CDesCArrayFlat* fields = new (ELeave) CDesCArrayFlat(EAbstractAlbumFieldCount); + CleanupStack::PushL(fields); + CDesCArrayFlat* values = new (ELeave) CDesCArrayFlat(EAbstractAlbumFieldCount); + CleanupStack::PushL(values); + + // process the media parameter and construct the fields and values array + GenerateAbstractAlbumFieldsValuesL(aMedia, *fields, *values); + + // construct the SET string + HBufC* setStr = MPXDbCommonUtil::StringFromArraysLC(*fields, *values, KMCEqualSign, KMCCommaSign); + + if (setStr->Length()) + { + // execute the query + iDbManager.ExecuteQueryL(aDriveId, KQueryAbstractAlbumUpdate, setStr, aId); + MPXDbCommonUtil::AddItemAlbumChangedMessageL(*aItemChangedMessages, aId, EMPXItemModified, + EMPXAbstractAlbum, KDBPluginUid, ETrue, 0 ); + } + + CleanupStack::PopAndDestroy(setStr); + CleanupStack::PopAndDestroy(values); + CleanupStack::PopAndDestroy(fields); + } + +// ---------------------------------------------------------------------------- +// CMPXDbAbstractAlbum::UpdateMediaL +// ---------------------------------------------------------------------------- +// +void CMPXDbAbstractAlbum::UpdateMediaL( + RSqlStatement& aRecord, + const TArray& aAttrs, + CMPXMedia& aMedia) + { + MPX_FUNC("CMPXDbAbstractAlbum::UpdateMediaL"); + + TInt count(aAttrs.Count()); + for (TInt i = 0; i < count; ++i) + { + TInt contentId(aAttrs[i].ContentId()); + TUint attributeId(aAttrs[i].AttributeId()); + + if (contentId == KMPXMediaIdGeneral) + { + if (attributeId & EMPXMediaGeneralId) + { + aMedia.SetTObjectValueL(KMPXMediaGeneralId, + aRecord.ColumnInt64(EAbstractAlbumUniqueId)); + } + if (attributeId & EMPXMediaGeneralTitle) + { + TPtrC title(MPXDbCommonUtil::GetColumnTextL(aRecord, EAbstractAlbumName)); + aMedia.SetTextValueL(KMPXMediaGeneralTitle, title); + MPX_DEBUG2(" AbstractAlbumName[%S]", &title); + } + if (attributeId & EMPXMediaGeneralCount) + { + TInt songCount = GetSongsCountL(KDbManagerAllDrives, + aRecord.ColumnInt64(EAbstractAlbumUniqueId)); + aMedia.SetTObjectValueL(KMPXMediaGeneralCount, songCount ); + } + if (attributeId & EMPXMediaGeneralDrive) + { + TUint32 volId(aRecord.ColumnInt64(EAbstractAlbumVolumeId)); + TInt driveId = MPXDbCommonUtil::GetDriveIdMatchVolIdL(iDbManager.Fs(), volId); + + // LTAN-7GH6BZ, crash if eject memory card when adding song to existing AbstractAlbum + // due to special timing issue, it is possible drive number is -1 and create a + // panic when use for TDriveUnit + MPX_DEBUG3("volId = %d, driveId = %d", volId, driveId); + + // handle possibly delay from framework notification + if (driveId < 0) + { + MPX_DEBUG1("invalid driveId, leave with KErrNotReady"); + User::Leave(KErrNotReady); + } + TDriveUnit driveUnit(driveId); + + aMedia.SetTextValueL(KMPXMediaGeneralDrive, driveUnit.Name()); + + } + } // end if contentId == KMPXMediaIdGeneral + else if ( contentId == KMPXMediaIdMusic) + { + if (attributeId & EMPXMediaMusicAlbumArtist) + { + TPtrC albumartist(MPXDbCommonUtil::GetColumnTextL(aRecord, EAbstractAlbumArtist)); + aMedia.SetTextValueL(KMPXMediaMusicAlbumArtist, albumartist); + + + + MPX_DEBUG2(" albumartist[%S]", &albumartist); + } + if (attributeId & EMPXMediaMusicGenre) + { + TPtrC genre(MPXDbCommonUtil::GetColumnTextL(aRecord, EAbstractAlbumGenre)); + aMedia.SetTextValueL(KMPXMediaMusicGenre, genre); + MPX_DEBUG2(" Genre[%S]", &genre); + } + } + + } // end for + aMedia.SetTObjectValueL(KMPXMediaGeneralType, EMPXItem); + aMedia.SetTObjectValueL(KMPXMediaGeneralCategory, EMPXAbstractAlbum); + } + + +// ---------------------------------------------------------------------------- +// CMPXDbAbstractAlbum::GenerateAlbumFieldsValuesL +// ---------------------------------------------------------------------------- +// +void CMPXDbAbstractAlbum::GenerateAbstractAlbumFieldsValuesL(const CMPXMedia& aMedia, CDesCArray& aFields, CDesCArray& aValues) + { + MPX_FUNC("CMPXDbAbstractAlbum::GenerateAbstractAlbumFieldsValuesL"); +//support Winlogo use case + if (aMedia.IsSupported(KMPXMediaGeneralTitle)) + { + TPtrC truncatedName(aMedia.ValueText(KMPXMediaGeneralTitle).Left(KMCMaxTextLen)); + MPXDbCommonUtil::AppendValueL(aFields, aValues, KMCCategoryName, truncatedName); + } +//support Winlogo use case + if (aMedia.IsSupported(KMPXMediaMusicAlbumArtist)) + { + TPtrC truncatedAlbumArtist(aMedia.ValueText(KMPXMediaMusicAlbumArtist).Left(KMCMaxTextLen)); + MPXDbCommonUtil::AppendValueL(aFields, aValues, KMCMusicAlbumArtist, truncatedAlbumArtist); + } + if (aMedia.IsSupported(KMPXMediaMusicGenre)) + { + TPtrC truncatedGenre(aMedia.ValueText(KMPXMediaMusicGenre).Left(KMCMaxTextLen)); + MPXDbCommonUtil::AppendValueL(aFields, aValues, KMCMusicGenre, truncatedGenre); + } + } + + +// ---------------------------------------------------------------------------- +// CMPXDbAlbum::CreateTableL +// ---------------------------------------------------------------------------- +// +void CMPXDbAbstractAlbum::CreateTableL( + RSqlDatabase& aDatabase, + TBool /* aCorruptTable */) + { + MPX_FUNC("CMPXDbAbstractAlbum::CreateTableL"); + + // create the table + HBufC* query = PreProcessStringLC(KAbstractAlbumCreateTable); + User::LeaveIfError(aDatabase.Exec(*query)); + CleanupStack::PopAndDestroy(query); + + // do not create an index on the Name field + // as it only slows down the insert/update queries overall + } + +// ---------------------------------------------------------------------------- +// CMPXDbAlbum::CheckTableL +// ---------------------------------------------------------------------------- +// +TBool CMPXDbAbstractAlbum::CheckTableL( + RSqlDatabase& aDatabase) + { + MPX_FUNC("CMPXDbAbstractAlbum::CheckTableL"); + + HBufC* query = PreProcessStringLC(KAbstractAlbumCheckTable); + TBool check(DoCheckTable(aDatabase, *query)); + CleanupStack::PopAndDestroy(query); + + return check; + } + + +// ---------------------------------------------------------------------------- +// Constructor +// ---------------------------------------------------------------------------- +// +CMPXDbAbstractAlbum::CMPXDbAbstractAlbum( + CMPXDbManager& aDbManager, + TMPXGeneralCategory aCategory) : + CMPXDbCategory(aDbManager, aCategory) + { + MPX_FUNC("CMPXDbAbstractAlbum::CMPXDbAbstractAlbum"); + } + +// ---------------------------------------------------------------------------- +// Second phase constructor. +// ---------------------------------------------------------------------------- +// +void CMPXDbAbstractAlbum::ConstructL() + { + MPX_FUNC("CMPXDbAbstractAlbum::ConstructL"); + + BaseConstructL(); +#ifdef RD_MPX_TNM_INTEGRATION + // Create Thumbnail Manager instance. This object is the observer. + iTNManager = CThumbnailManager::NewL( *this ); +#endif //RD_MPX_TNM_INTEGRATION + } + + + +// --------------------------------------------------------------------------- +// CMPXDbAbstractAlbum::ThumbnailReady +// Callback but not used here +// --------------------------------------------------------------------------- +void CMPXDbAbstractAlbum::ThumbnailPreviewReady( + MThumbnailData& /*aThumbnail*/, TThumbnailRequestId /*aId*/ ) + { + } + + +// --------------------------------------------------------------------------- +// CMPXDbAbstractAlbum::ThumbnailReady +// Callback but not used here +// --------------------------------------------------------------------------- +void CMPXDbAbstractAlbum::ThumbnailReady( TInt /*aError*/, + MThumbnailData& /*aThumbnail*/, TThumbnailRequestId /*aId*/ ) + { + } +// End of File diff -r 171e07ac910f -r c8156a91d13c mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/src/mpxdbautoplaylist.cpp --- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/src/mpxdbautoplaylist.cpp Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/src/mpxdbautoplaylist.cpp Wed Mar 31 21:26:33 2010 +0300 @@ -80,6 +80,11 @@ delete iRecentlyPlayedPlaylist; delete iMostPlayedPlaylist; delete iRecentlyAddedPlaylist; + + delete iTitleRecentlyPlayed; + delete iTitleMostPlayed; + delete iTitleRecentlyAdded; + } // ---------------------------------------------------------------------------- @@ -106,6 +111,10 @@ iMostPlayedPlaylist = aResource.ReadHBufCL(R_MC_MOST_PLAYED_PLAYLIST); iRecentlyAddedPlaylist = aResource.ReadHBufCL(R_MC_RECENTLY_ADDED_PLAYLIST); + iTitleRecentlyPlayed = aResource.ReadHBufCL(R_MC_TITLE_RECENTLY_PLAYED ); + iTitleMostPlayed = aResource.ReadHBufCL(R_MC_TITLE_MOST_PLAYED ); + iTitleRecentlyAdded = aResource.ReadHBufCL(R_MC_TITLE_RECENTLY_DOWNLOADED ); + iRecentlyPlayedPlaylistId = KMPXRecentlyPlayedPlaylistId; iMostPlayedPlaylistId = KMPXMostPlayedPlaylistId; iRecentlyAddedPlaylistId = KMPXRecentlyAddedPlaylistId; @@ -160,15 +169,15 @@ TPtrC ptr; if (aPlaylistId == iRecentlyPlayedPlaylistId) { - ptr.Set(*iRecentlyPlayedPlaylist); + ptr.Set(*iTitleRecentlyPlayed); } else if (aPlaylistId == iMostPlayedPlaylistId) { - ptr.Set(*iMostPlayedPlaylist); + ptr.Set(*iTitleMostPlayed); } else if (aPlaylistId == iRecentlyAddedPlaylistId) { - ptr.Set(*iRecentlyAddedPlaylist); + ptr.Set(*iTitleRecentlyAdded); } else { diff -r 171e07ac910f -r c8156a91d13c mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/src/mpxdbcategory.cpp --- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/src/mpxdbcategory.cpp Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/src/mpxdbcategory.cpp Wed Mar 31 21:26:33 2010 +0300 @@ -211,6 +211,23 @@ } #endif //RD_MPX_COLLECTION_CACHE } +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + else if (criterion == KMPXMediaGeneralUri) + { + TUint32 itemId(MPXDbCommonUtil::GenerateUniqueIdL(iDbManager.Fs(), iCategory, + aCriteria.ValueText(KMPXMediaGeneralUri), (iCategory != EMPXGenre))); + HBufC* critStr = PreProcessStringLC(KCriterionCategoryUniqueId); + MPXDbCommonUtil::AddSqlCriterionL(*criteriaArray, *critStr, itemId); + CleanupStack::PopAndDestroy(critStr); + } + else if (criterion == KMPXMediaGeneralDrive) + { + const TDesC& drive(aCriteria.ValueText(KMPXMediaGeneralDrive)); + TDriveUnit driveUnit(drive); + MPXDbCommonUtil::AddSqlCriterionL(*criteriaArray, KCriterionAbstractAlbumVolumeId, + MPXDbCommonUtil::GetVolIdMatchDriveIdL(iDbManager.Fs(), driveUnit)); + } +#endif // ABSTRACTAUDIOALBUM_INCLUDED else { // ignore attribute @@ -240,7 +257,8 @@ const TUint32 aId, TInt aDriveId, CMPXMessageArray* aItemChangedMessages, - TBool& aItemExist) + TBool& aItemExist, + TBool /*aMTPInUse*/) { MPX_FUNC("CMPXDbCategory::DecrementSongsForCategoryL"); diff -r 171e07ac910f -r c8156a91d13c mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/src/mpxdbhandler.cpp --- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/src/mpxdbhandler.cpp Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/src/mpxdbhandler.cpp Wed Mar 31 21:26:33 2010 +0300 @@ -118,7 +118,9 @@ delete iDbComposer; delete iDbAuxiliary; delete iDbManager; - +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + delete iDbAbstractAlbum; +#endif // ABSTRACTAUDIOALBUM_INCLUDED delete iMimeTypes; delete iExtensions; delete iExtensionsMime; @@ -173,9 +175,12 @@ iDbMusic = CMPXDbMusic::NewL(*iDbManager, iResource, *this); iDbPlaylist = CMPXDbPlaylist::NewL(*iDbManager, *this); iDbArtist = CMPXDbArtist::NewL(*iDbManager, EMPXArtist, *this); - iDbAlbum = CMPXDbAlbum::NewL(*iDbManager, EMPXAlbum, *this); + iDbAlbum = CMPXDbAlbum::NewL(*iDbManager, EMPXAlbum, *this); iDbGenre = CMPXDbGenre::NewL(*iDbManager, EMPXGenre); iDbComposer = CMPXDbComposer::NewL(*iDbManager, EMPXComposer); +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + iDbAbstractAlbum = CMPXDbAbstractAlbum::NewL(*iDbManager, EMPXAbstractAlbum); +#endif // ABSTRACTAUDIOALBUM_INCLUDED iAutoPlaylist = CMPXDbAutoPlaylist::NewL(*iDbManager, iFs, iResource); iDbAuxiliary = CMPXDbAuxiliary::NewL(*iDbManager); @@ -299,6 +304,99 @@ return playlistId; } +#ifdef ABSTRACTAUDIOALBUM_INCLUDED +// ---------------------------------------------------------------------------- +// Add AbstractAlbum to collection +// ---------------------------------------------------------------------------- +// +TUint32 CMPXDbHandler::AddAbstractAlbumL( + const CMPXMedia& aMedia, + CMPXMessageArray* aMessageArray) + { + MPX_FUNC("CMPXDbHandler::AddAbstractAlbumL"); + + BeginTransactionL(); + // TUint32 abstractAlbumId(0); + TBool newRecord(EFalse); + TInt err(KErrNone); + + TDriveUnit drive(aMedia.ValueText(KMPXMediaGeneralUri)); + TPtrC name(aMedia.ValueText(KMPXMediaGeneralUri).Left(KMCMaxTextLen)); + TPtrC albumartist(aMedia.ValueText(KMPXMediaMusicAlbumArtist).Left(KMCMaxTextLen)); + TPtrC genre(aMedia.ValueText(KMPXMediaMusicGenre).Left(KMCMaxTextLen)); + + //only insert to AbstractAlbum table when it is new item + TUint32 abstractAlbumId(MPXDbCommonUtil::GenerateUniqueIdL(iFs, EMPXAbstractAlbum, name, (EMPXAbstractAlbum!=EMPXGenre))); + + newRecord = !iDbAbstractAlbum->CategoryItemExistsL(drive, abstractAlbumId); + + + if (newRecord) + { + MPX_TRAP(err, abstractAlbumId = iDbAbstractAlbum->AddItemL( name, albumartist, genre, drive, newRecord, (EMPXAbstractAlbum != EMPXGenre))); + if (iOutOfDisk && (err == KErrNotFound)) + { + err = KErrDiskFull; + } + if (aMessageArray) + { + MPXDbCommonUtil::AddItemChangedMessageL(*aMessageArray, abstractAlbumId, EMPXItemInserted, + EMPXAbstractAlbum, KDBPluginUid); + } + } + EndTransactionL(err); + + return abstractAlbumId; + } + +// ---------------------------------------------------------------------------- +// Update all songs which associate with AbstractAlbum in the collection +// ---------------------------------------------------------------------------- +// +CMPXDbActiveTask::TChangeVisibility CMPXDbHandler::UpdateAbstractAlbumSongsL( + const CMPXMedia& aMedia, + CMPXMessageArray& aItemChangedMessages) + { + MPX_FUNC("CMPXDbHandler::UpdateAbstractAlbumSongsL"); + + CMPXDbActiveTask::TChangeVisibility visibleChange(CMPXDbActiveTask::ENotVisibile); + + if (aMedia.IsSupported(KMPXMediaGeneralUri)) + { + const TDesC& art(aMedia.ValueText (KMPXMediaGeneralUri)); + + TBool existRecord(EFalse); + TDriveUnit drive(aMedia.ValueText(KMPXMediaGeneralUri)); + TUint32 rowId(MPXDbCommonUtil::GenerateUniqueIdL(iFs, EMPXAbstractAlbum, art, (EMPXAbstractAlbum != EMPXGenre))); + //check if abstractAlbum in ABSTRACTALBUM table before update songs + existRecord = iDbAbstractAlbum->CategoryItemExistsL(drive, rowId); + + //update songs associated with abstractalbum only when abstractalbum associated already + //in the AbstractAlbum table + if (existRecord) + { + if (aMedia.IsSupported(KMPXMediaArrayContents)) + { + + CMPXMediaArray* mediaArray = aMedia.Value(KMPXMediaArrayContents); + User::LeaveIfNull(mediaArray); + TInt count(mediaArray->Count()); + for (TInt i = 0; i < count; i++) + { + CMPXMedia* element = mediaArray->AtL(i); + element->SetTextValueL(KMPXMediaMusicAlbumArtFileName, art ); + visibleChange = UpdateSongL(*element, aItemChangedMessages); + } + } + else + { + iDbAbstractAlbum->UpdateItemL(rowId, aMedia, drive, &aItemChangedMessages); + } + } + } + return visibleChange; +} +#endif // ABSTRACTAUDIOALBUM_INCLUDED // ---------------------------------------------------------------------------- // Update a song in the collection // ---------------------------------------------------------------------------- @@ -485,6 +583,50 @@ } } +#ifdef ABSTRACTAUDIOALBUM_INCLUDED +// ---------------------------------------------------------------------------- +// Remove specified abstractalbum +// ---------------------------------------------------------------------------- +// +void CMPXDbHandler::RemoveAbstractAlbumL( + TUint32 aAbstractAlbumId, + CDesCArray& aUriArray, + CMPXMessageArray& aItemChangedMessages) + { + MPX_FUNC("CMPXDbHandler::RemoveAbstractAlbumL"); + + BeginTransactionL(); + MPX_TRAPD(err, DoRemoveAbstractAlbumL(aAbstractAlbumId, aUriArray, aItemChangedMessages)); + EndTransactionL(err); + } + +// ---------------------------------------------------------------------------- +// Remove specified abstractalbum +// ---------------------------------------------------------------------------- +// +void CMPXDbHandler::DoRemoveAbstractAlbumL( + TUint32 aAbstractAlbumId, + CDesCArray& aUriArray, + CMPXMessageArray& aItemChangedMessages) + { + MPX_FUNC("CMPXDbHandler::DoRemoveAbstractAlbumL"); + + + HBufC* uri(iDbAbstractAlbum->DeleteAbstractAlbumL(aAbstractAlbumId)); + if (uri) + { + CleanupStack::PushL(uri); + aUriArray.AppendL(*uri); + CleanupStack::PopAndDestroy(uri); + } + + MPXDbCommonUtil::AddItemChangedMessageL(aItemChangedMessages, aAbstractAlbumId, EMPXItemDeleted, + EMPXAbstractAlbum, KDBPluginUid); + + + } +#endif // ABSTRACTAUDIOALBUM_INCLUDED + // ---------------------------------------------------------------------------- // Cleanup records marked as deleted. This is designated for MTP to clean up records marked as deleted // at the end of its session. @@ -739,6 +881,19 @@ return MPXDbCommonUtil::GenerateUniqueIdL(iFs, EMPXCollection, aUri, EFalse); } +#ifdef ABSTRACTAUDIOALBUM_INCLUDED +// ---------------------------------------------------------------------------- +// Get abstractalbum Id matching the given URI +// ---------------------------------------------------------------------------- +// +TUint32 CMPXDbHandler::GetAbstractAlbumIdMatchingUriL( + const TDesC& aUri) + { + MPX_FUNC("CMPXDbHandler::GetAbstractAlbumIdMatchingUriL"); + return MPXDbCommonUtil::GenerateUniqueIdL(iFs, EMPXAbstractAlbum, aUri, ETrue); + } +#endif // ABSTRACTAUDIOALBUM_INCLUDED + // ---------------------------------------------------------------------------- // Get all artists // ---------------------------------------------------------------------------- @@ -827,10 +982,10 @@ CMPXMedia* media = aMediaArray[i]; TUint32 albumId((media->ValueTObjectL(KMPXMediaGeneralId))); - TInt songCount = iDbAlbum->GetSongsCountInAlbumMatchingArtistL(aArtistId, albumId); + TInt songCount = iDbAlbum->GetSongsCountInAlbumMatchingArtistL(aArtistId, albumId); media->SetTObjectValueL(KMPXMediaGeneralCount, songCount ); - MPX_DEBUG2(" SongCount[%d]", songCount ); + MPX_DEBUG2(" SongCount[%d]", songCount ); } } } @@ -1357,7 +1512,7 @@ } #ifdef __RAMDISK_PERF_ENABLE - iDbManager->CopyDBsToRamL(); + iDbManager->CopyDBsToRamL(); #endif //__RAMDISK_PERF_ENABLE iDbMusic->RefreshStartL(); @@ -1433,10 +1588,10 @@ #ifdef __RAMDISK_PERF_ENABLE TRAPD(err, iDbManager->CopyDBsFromRamL()); - if ( err != KErrNone ) - { + if ( err != KErrNone ) + { MPX_DEBUG2("CMPXDbHandler::MtpEndL error=%d", err); - } + } #endif //__RAMDISK_PERF_ENABLE MPX_DEBUG1("<--CMPXDbHandler::MtpEndL"); @@ -1946,10 +2101,17 @@ TUint32 albumID(0); TUint32 genreID(0); TUint32 composerID(0); +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + TUint32 abstractAlbumID(0); +#endif // ABSTRACTAUDIOALBUM_INCLUDED TInt drive(0); - // Get information from the Music table first +// Get information from the Music table first +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + HBufC* uri = iDbMusic->GetSongInfoL(aSongId, artistID, albumID, genreID, composerID, abstractAlbumID, drive); +#else HBufC* uri = iDbMusic->GetSongInfoL(aSongId, artistID, albumID, genreID, composerID, drive); +#endif // ABSTRACTAUDIOALBUM_INCLUDED // add the URI to the return array CleanupStack::PushL(uri); @@ -1962,7 +2124,12 @@ iDbAlbum->DecrementSongsForCategoryL(albumID, drive, &aItemChangedMessages, categoryExist, artistID); iDbGenre->DecrementSongsForCategoryL(genreID, drive, &aItemChangedMessages, categoryExist); iDbComposer->DecrementSongsForCategoryL(composerID, drive, &aItemChangedMessages, categoryExist); - +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + if (abstractAlbumID) + { + iDbAbstractAlbum->DecrementSongsForCategoryL(abstractAlbumID, drive, &aItemChangedMessages, categoryExist, iMtpInUse); + } +#endif // ABSTRACTAUDIOALBUM_INCLUDED // Update the music table TBool deleteRecord(ETrue); @@ -2295,7 +2462,32 @@ GetPlaylistSongsL(playlistId, aAttrs, aMediaArray); } - +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + else if (type == EMPXGroup && + (cat == EMPXAbstractAlbum || + MPX_ITEM_CATEGORY(containerId) == EMPXAbstractAlbum)) + { + TUint32 abstractAlbumId = (cat == EMPXAbstractAlbum) ? + id : (containerId & KMCCategoryMask); + TInt attrCount(aAttrs.Count()); + if ( attrCount > 1 || (attrCount == 1 && !(aAttrs[0] == KMPXMediaGeneralId)) ) + { + TInt abstractAlbumDrive(iDbAbstractAlbum->GetDriveIdL(abstractAlbumId)); + MPX_TRAPD(err, iDbMusic->GetAllSongsForAbstractAlbumL(abstractAlbumDrive, abstractAlbumId, aAttrs, aMediaArray)); + if (err == KErrNotFound) + { + // + // Leave with KErrNotFound + User::Leave(KErrNotFound); + } + else + { + // Leave if error + User::LeaveIfError(err); + } + } + } +#endif // ABSTRACTAUDIOALBUM_INCLUDED ////////////////////////////////////////////////////////////////////// // Find a particular song in the specified playlist. This fills the // song with info from Playlist table first then overwrites it with @@ -2660,6 +2852,13 @@ dbCategory = (CMPXDbCategory*)iDbComposer; break; } +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + case EMPXAbstractAlbum: + { + dbCategory = (CMPXDbCategory*)iDbAbstractAlbum; + break; + } +#endif // ABSTRACTAUDIOALBUM_INCLUDED default: User::Leave(KErrNotSupported); } @@ -2834,14 +3033,33 @@ const TDesC& aName, TInt aDriveId, CMPXMessageArray* aItemChangedMessages, - TBool& aItemExist) + TBool& aItemExist +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + ,const TDesC& aAlbumArtist, + const TDesC& aGenre +#endif // ABSTRACTAUDIOALBUM_INCLUDED + ) { MPX_FUNC("CMPXDbHandler::AddCategoryItemL()"); MPX_PERF_START(CMPXDbHandler_AddCategoryItemL); TBool newRecord(EFalse); +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + TUint32 id(0); + //for AbstractAlbum, SetAbstractAlbum, associate songs with abstractalbum. + //only called with newRecord as EFalse + //increment songCount if id exist in AbstractAlbum table, otherwise do nothing. + if (aCategory == EMPXAbstractAlbum) + { + id = iDbAbstractAlbum->AddItemL( aName, aAlbumArtist, aGenre, aDriveId, newRecord, (aCategory != EMPXGenre)); + } + else + { + id = DbCategoryL(aCategory)->AddItemL(aName, aDriveId, newRecord, (aCategory != EMPXGenre)); +#else TUint32 id(DbCategoryL(aCategory)->AddItemL(aName, aDriveId, newRecord, (aCategory != EMPXGenre))); +#endif // ABSTRACTAUDIOALBUM_INCLUDED if (newRecord && aItemChangedMessages) { MPXDbCommonUtil::AddItemChangedMessageL(*aItemChangedMessages, id, EMPXItemInserted, @@ -2857,6 +3075,9 @@ aCategory, KDBPluginUid); } aItemExist = !newRecord; +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + } +#endif // ABSTRACTAUDIOALBUM_INCLUDED MPX_PERF_END(CMPXDbHandler_AddCategoryItemL); return id; @@ -2895,7 +3116,7 @@ // when the added item's category is Artist, and it is NOT a new record, // we should send the item number changed message else if ( aCategory == EMPXArtist && - !newRecord && aItemChangedMessages ) + !newRecord && aItemChangedMessages ) { MPXDbCommonUtil::AddItemChangedMessageL(*aItemChangedMessages, id, EMPXItemModified, aCategory, KDBPluginUid); @@ -2904,30 +3125,30 @@ MPX_PERF_END(CMPXDbHandler_AddCategoryItemL); return id; - } + } void CMPXDbHandler::UpdateCategoryItemL( - TMPXGeneralCategory aCategory, - TUint32 aCategoryId, - const CMPXMedia& aMedia, - TInt aDrive, - CMPXMessageArray* aItemChangedMessages) - { - switch(aCategory) - { - case EMPXAlbum: + TMPXGeneralCategory aCategory, + TUint32 aCategoryId, + const CMPXMedia& aMedia, + TInt aDrive, + CMPXMessageArray* aItemChangedMessages) + { + switch(aCategory) + { + case EMPXAlbum: iDbAlbum->UpdateItemL(aCategoryId, aMedia, aDrive, aItemChangedMessages); - break; - - case EMPXArtist: - iDbArtist->UpdateItemL(aCategoryId, aMedia, aDrive, aItemChangedMessages); - break; - - default: + break; + + case EMPXArtist: + iDbArtist->UpdateItemL(aCategoryId, aMedia, aDrive, aItemChangedMessages); + break; + + default: DbCategoryL(aCategory)->UpdateItemL(aCategoryId, aMedia, aDrive, aItemChangedMessages); - break; - } - } + break; + } + } // ---------------------------------------------------------------------------- // CMPXDbHandler::DeleteSongForCategoryL // ---------------------------------------------------------------------------- @@ -2993,9 +3214,9 @@ } TInt CMPXDbHandler::HandlePlaylistDurationL(TUint32 aPlaylistId) - { - return GetPlaylistDurationL(aPlaylistId); - } + { + return GetPlaylistDurationL(aPlaylistId); + } void CMPXDbHandler::HandlePlaylistInfoL( TUint32 aPlaylistId, TInt& aCount, @@ -3029,9 +3250,9 @@ } TInt CMPXDbHandler::HandleGetAlbumsCountForArtistL(TUint32 aArtistId) - { - return iDbAlbum->GetAlbumsCountForArtistL(aArtistId); - } + { + return iDbAlbum->GetAlbumsCountForArtistL(aArtistId); + } TBool CMPXDbHandler::HandleIsUnknownArtistL(TUint32 aArtistId) { @@ -3042,4 +3263,14 @@ { return iDbMusic->ArtistForAlbumL(aAlbumId); } +#ifdef ABSTRACTAUDIOALBUM_INCLUDED +// ---------------------------------------------------------------------------------------------------------- +// CMPXDbHandler::HandleGetAlbumNameForSongL +// ---------------------------------------------------------------------------------------------------------- +// +HBufC* CMPXDbHandler::HandleGetAlbumNameFromIdL(TUint32 aId) + { + return iDbAbstractAlbum->GetNameL(aId); + } +#endif // ABSTRACTAUDIOALBUM_INCLUDED // End of file diff -r 171e07ac910f -r c8156a91d13c mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/src/mpxdbmusic.cpp --- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/src/mpxdbmusic.cpp Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/src/mpxdbmusic.cpp Wed Mar 31 21:26:33 2010 +0300 @@ -52,6 +52,10 @@ const TInt KColUniqueID = 0; // URI column in Uris requests const TInt KColUri = 1; +#ifdef ABSTRACTAUDIOALBUM_INCLUDED +_LIT( KAbstractAlbumExt, ".alb" ); +#endif // ABSTRACTAUDIOALBUM_INCLUDED + // ============================ MEMBER FUNCTIONS ============================== @@ -175,6 +179,14 @@ MPXDbCommonUtil::AppendValueL(*fields, *values, KMCMusicTimeAdded, *timeAdded); CleanupStack::PopAndDestroy(timeAdded); +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + //update ContainEmbeddedArt + const TDesC& albumArtFilename = aMedia.ValueText(KMPXMediaMusicAlbumArtFileName).Left(KMCMaxTextLen); + if (albumArtFilename.Length() > 0) + { + MPXDbCommonUtil::AppendValueL(*fields, *values, KMCMusicContainEmbeddedArt, 1); + } +#endif // ABSTRACTAUDIOALBUM_INCLUDED // process the media parameter and construct the fields and values array TBool visible(GenerateMusicFieldsValuesL(aSongId, aMedia, aItemChangedMessages, NULL, *fields, *values, aDrive)); @@ -242,11 +254,11 @@ recordset); // Update Album table - if (aMedia.IsSupported(KMPXMediaMusicAlbumArtFileName) || aMedia.IsSupported(KMPXMediaMusicArtist)) - { - TUint32 albumId = recordset.ColumnInt64(EMusicAlbum); - iObserver.UpdateCategoryItemL(EMPXAlbum, albumId, aMedia, driveUnit, aItemChangedMessages); - } + if (aMedia.IsSupported(KMPXMediaMusicAlbumArtFileName) || aMedia.IsSupported(KMPXMediaMusicArtist)) + { + TUint32 albumId = recordset.ColumnInt64(EMusicAlbum); + iObserver.UpdateCategoryItemL(EMPXAlbum, albumId, aMedia, driveUnit, aItemChangedMessages); + } // Update Artist table if ( aMedia.IsSupported(KMPXMediaMusicAlbumArtFileName) ) @@ -423,6 +435,9 @@ TUint32& aAlbumId, TUint32& aGenreId, TUint32& aComposerId, +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + TUint32& aAbstractAlbumId, +#endif // ABSTRACTAUDIOALBUM_INCLUDED TInt& aDriveId) { MPX_FUNC("CMPXDbMusic::GetSongInfoL"); @@ -441,6 +456,9 @@ aAlbumId = recordset.ColumnInt64(EMusicAlbum); aGenreId = recordset.ColumnInt64(EMusicGenre); aComposerId = recordset.ColumnInt64(EMusicComposer); +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + aAbstractAlbumId = recordset.ColumnInt64(EMusicAbstractAlbum); +#endif // ABSTRACTAUDIOALBUM_INCLUDED HBufC* uri = ConstructUriL(recordset); CleanupStack::PopAndDestroy(&recordset); @@ -788,6 +806,22 @@ aComposerId); } +#ifdef ABSTRACTAUDIOALBUM_INCLUDED +// ---------------------------------------------------------------------------- +// CMPXDbMusic::GetAllSongsForAbstractAlbumL +// ---------------------------------------------------------------------------- +// +void CMPXDbMusic::GetAllSongsForAbstractAlbumL( + TInt aDrive, + TInt aAbstractAlbumId, + const TArray& aAttrs, + CMPXMediaArray& aMediaArray) + { + MPX_FUNC("CMPXDbMusic::GetAllSongsL"); + ExecuteMediaQueryL(aDrive, aAttrs, aMediaArray, KQueryMusicGetSongsForAbstractAlbum(), aAbstractAlbumId); + } +#endif // ABSTRACTAUDIOALBUM_INCLUDED + // ---------------------------------------------------------------------------- // CMPXDbMusic::AllSongsDurationL // ---------------------------------------------------------------------------- @@ -1131,11 +1165,11 @@ { TUint32 pListUId(aMusicTable.ColumnInt64(35)); aMedia.SetTObjectValueL(KMPXMediaGeneralId, TMPXItemId(pListUId, songId)); - } + } else - { - aMedia.SetTObjectValueL(KMPXMediaGeneralId, songId); - } + { + aMedia.SetTObjectValueL(KMPXMediaGeneralId, songId); + } MPX_DEBUG2(" SongId[%d]", songId); } // FIX ME temporary always fetch URI @@ -1190,18 +1224,18 @@ MPX_DEBUG2(" Title[%S]", &title); } if ( aAttrId & EMPXMediaGeneralDate) - { - MPX_DEBUG1(" EMPXMediaGeneralDate"); - const TDesC& dateStr(MPXDbCommonUtil::GetColumnTextL (aMusicTable, - EMusicTimeAdded)); - if ( dateStr.Compare (KNullDesC)!= 0) - { - TTime dateTime(MPXDbCommonUtil::DesToTTimeL (dateStr)); - aMedia.SetTObjectValueL (KMPXMediaGeneralDate, - dateTime.Int64 ()); - } - MPX_DEBUG2(" Date[%S]", &dateStr); - } + { + MPX_DEBUG1(" EMPXMediaGeneralDate"); + const TDesC& dateStr(MPXDbCommonUtil::GetColumnTextL (aMusicTable, + EMusicTimeAdded)); + if ( dateStr.Compare (KNullDesC)!= 0) + { + TTime dateTime(MPXDbCommonUtil::DesToTTimeL (dateStr)); + aMedia.SetTObjectValueL (KMPXMediaGeneralDate, + dateTime.Int64 ()); + } + MPX_DEBUG2(" Date[%S]", &dateStr); + } if (aAttrId & EMPXMediaGeneralComment) { MPX_DEBUG1(" EMPXMediaGeneralComment"); @@ -1331,18 +1365,18 @@ MPX_DEBUG2(" Album[%S]", &album); } if ( aAttrId & EMPXMediaMusicYear) - { - const TDesC& dateStr(MPXDbCommonUtil::GetColumnTextL (aMusicTable, - EMusicReleaseDate)); - if ( dateStr.Compare (KNullDesC)!= 0) - { - TTime dateTime(MPXDbCommonUtil::DesToTTimeL (dateStr)); - aMedia.SetTObjectValueL (KMPXMediaMusicYear, - dateTime.Int64 ()); - MPX_DEBUG2(" Year[%d]", dateTime.Int64()); - } - MPX_DEBUG2(" ReleaseDate[%S]", &dateStr); - } + { + const TDesC& dateStr(MPXDbCommonUtil::GetColumnTextL (aMusicTable, + EMusicReleaseDate)); + if ( dateStr.Compare (KNullDesC)!= 0) + { + TTime dateTime(MPXDbCommonUtil::DesToTTimeL (dateStr)); + aMedia.SetTObjectValueL (KMPXMediaMusicYear, + dateTime.Int64 ()); + MPX_DEBUG2(" Year[%d]", dateTime.Int64()); + } + MPX_DEBUG2(" ReleaseDate[%S]", &dateStr); + } if (aAttrId & EMPXMediaMusicAlbumTrack) { TInt32 track(aMusicTable.ColumnInt(EMusicAlbumTrack)); @@ -1384,20 +1418,51 @@ // Always set original album art to be file path // Maybe add a new column to db for future if services like rhapsody pushes jpgs to us if (aMedia.IsSupported(KMPXMediaGeneralUri)) +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + { + TUint32 abstractAlbumId(aMusicTable.ColumnInt64(EMusicAbstractAlbum)); + TInt containEmbeddedArt = aMusicTable.ColumnInt( EMusicContainEmbeddedArt); + //embedded with art, no art + if (containEmbeddedArt || (!containEmbeddedArt && !abstractAlbumId)) //embedded with art case, no art + { + const TDesC& art(aMedia.ValueText(KMPXMediaGeneralUri)); + aMedia.SetTextValueL(KMPXMediaMusicOriginalAlbumArtFileName, art); + MPX_DEBUG2(" Music Original Album Art FullPath[%S]", &art); + } + //for abstractalbum case, originalAlbumArt from AbstractAlbum table + else if ( abstractAlbumId ) + { + HBufC* art = iObserver.HandleGetAlbumNameFromIdL(abstractAlbumId); + CleanupStack::PushL(art); + aMedia.SetTextValueL(KMPXMediaMusicOriginalAlbumArtFileName, *art); + MPX_DEBUG2(" Music Original Album Art FullPath[%S]", art); + CleanupStack::PopAndDestroy(art); + } + } +#else { const TDesC& uri(aMedia.ValueText(KMPXMediaGeneralUri)); aMedia.SetTextValueL(KMPXMediaMusicOriginalAlbumArtFileName, uri); MPX_DEBUG2(" Music Original Album Art FullPath[%S]", &uri); } - else - { - HBufC* fullPath = ConstructUriL(aMusicTable); - CleanupStack::PushL(fullPath); - aMedia.SetTextValueL(KMPXMediaMusicOriginalAlbumArtFileName, *fullPath); - MPX_DEBUG2(" Music Original Album Art FullPath[%S]", fullPath); - CleanupStack::PopAndDestroy(fullPath); - } +#endif // ABSTRACTAUDIOALBUM_INCLUDED + else + { + HBufC* fullPath = ConstructUriL(aMusicTable); + CleanupStack::PushL(fullPath); + aMedia.SetTextValueL(KMPXMediaMusicOriginalAlbumArtFileName, *fullPath); + MPX_DEBUG2(" Music Original Album Art FullPath[%S]", fullPath); + CleanupStack::PopAndDestroy(fullPath); + } + } +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + if (aAttrId & EMPXMediaMusicAlbumArtist) + { + TPtrC albumartist(MPXDbCommonUtil::GetColumnTextL(aMusicTable, EMusicAlbumArtist)); + aMedia.SetTextValueL(KMPXMediaMusicAlbumArtist, albumartist); + MPX_DEBUG2(" Music AlbumArtist[%S]", &albumartist); } +#endif // ABSTRACTAUDIOALBUM_INCLUDED } // ---------------------------------------------------------------------------- @@ -1800,14 +1865,30 @@ if (attributeId & EMPXMediaMusicAlbumArtFileName) { +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + TInt containEmbeddedArt(0); + if (aMusicTable ) + { + containEmbeddedArt = aMusicTable->ColumnInt(EMusicContainEmbeddedArt); + } +#endif // ABSTRACTAUDIOALBUM_INCLUDED const TDesC& albumArtFilename = aMedia.ValueText(KMPXMediaMusicAlbumArtFileName).Left(KMCMaxTextLen); - if (!aMusicTable || (albumArtFilename != MPXDbCommonUtil::GetColumnTextL(*aMusicTable, EMusicArt))) +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + TParsePtrC parse(albumArtFilename); + TPtrC ext(parse.Ext()); + + if ( ((ext.CompareF(KAbstractAlbumExt)== 0) && !containEmbeddedArt) || (ext.CompareF(KAbstractAlbumExt)!= 0)) { - MPXDbCommonUtil::AppendValueL(aFields, aValues, KMCMusicArt, albumArtFilename); - visibleChange = CMPXDbActiveTask::EAllVisible; - metaDataModified = ETrue; +#endif // ABSTRACTAUDIOALBUM_INCLUDED + if (!aMusicTable || (albumArtFilename != MPXDbCommonUtil::GetColumnTextL(*aMusicTable, EMusicArt))) + { + MPXDbCommonUtil::AppendValueL(aFields, aValues, KMCMusicArt, albumArtFilename); + visibleChange = CMPXDbActiveTask::EAllVisible; + metaDataModified = ETrue; + } +#ifdef ABSTRACTAUDIOALBUM_INCLUDED } - +#endif // ABSTRACTAUDIOALBUM_INCLUDED MPX_DEBUG2(" Album Art Filename[%S]", &albumArtFilename); } @@ -1822,6 +1903,20 @@ MPX_DEBUG2(" Music URL[%S]", &url); } +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + if (attributeId & EMPXMediaMusicAlbumArtist) + { + const TDesC& albumartist = aMedia.ValueText(KMPXMediaMusicAlbumArtist); + TPtrC truncatedAlbumartist(albumartist.Left(KMCMaxTextLen)); + + if (!aMusicTable || (truncatedAlbumartist.Compare(MPXDbCommonUtil::GetColumnTextL(*aMusicTable, EMusicAlbumArtist)) != 0)) + { + MPXDbCommonUtil::AppendValueL(aFields, aValues, KMCMusicAlbumArtist, truncatedAlbumartist); + visibleChange = CMPXDbActiveTask::EAllVisible; + metaDataModified = ETrue; + } + } +#endif // ABSTRACTAUDIOALBUM_INCLUDED } break; @@ -1935,12 +2030,18 @@ TUint32 albumId(0); TUint32 genreId(0); TUint32 composerId(0); +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + TUint32 abstractAlbumId(0); +#endif // ABSTRACTAUDIOALBUM_INCLUDED if (aMusicTable) { artistId = aMusicTable->ColumnInt64(EMusicArtist); albumId = aMusicTable->ColumnInt64(EMusicAlbum); genreId = aMusicTable->ColumnInt64(EMusicGenre); composerId = aMusicTable->ColumnInt64(EMusicComposer); +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + abstractAlbumId = aMusicTable->ColumnInt64(EMusicAbstractAlbum); +#endif // ABSTRACTAUDIOALBUM_INCLUDED } // update the artist field @@ -1956,8 +2057,8 @@ } // update the album field - if (UpdateCategoryFieldL(EMPXAlbum, aMedia, KMPXMediaMusicAlbum, albumId, - aDrive, aItemChangedMessages, id, artistIdForAlbum)) + if (UpdateCategoryFieldL(EMPXAlbum, aMedia, KMPXMediaMusicAlbum, albumId, + aDrive, aItemChangedMessages, id, artistIdForAlbum)) { MPXDbCommonUtil::AppendValueL(aFields, aValues, KMCMusicAlbum, id); metaDataModified = (aMusicTable != NULL); @@ -1997,7 +2098,24 @@ metaDataModified = (aMusicTable != NULL); visibleChange = CMPXDbActiveTask::EAllVisible; } - +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + if ( aMedia.IsSupported (KMPXMediaMusicAlbumArtFileName)) + { + const TDesC& albumArtFilename = aMedia.ValueText(KMPXMediaMusicAlbumArtFileName).Left(KMCMaxTextLen); + TParsePtrC parse( albumArtFilename ); + TPtrC ext( parse.Ext() ); + if (ext.CompareF(KAbstractAlbumExt)== 0) + { + if (UpdateCategoryFieldL(EMPXAbstractAlbum, aMedia, KMPXMediaMusicAlbumArtFileName, abstractAlbumId, + aDrive, aItemChangedMessages, id)) + { + MPXDbCommonUtil::AppendValueL(aFields, aValues, KMCMusicAbstractAlbum, id); + metaDataModified = (aMusicTable != NULL); + visibleChange = CMPXDbActiveTask::EAllVisible; + } + } + } +#endif // ABSTRACTAUDIOALBUM_INCLUDED #if defined (__MTP_PROTOCOL_SUPPORT) // Set Mod bit to ETrue if metadata has been updated and caller hasn't explicitly // set/reset it @@ -2282,10 +2400,34 @@ { // only add if the ID changed, // otherwise the song was updated but the artist name was not - - // ignore the return value - iObserver.AddCategoryItemL(aCategory, name, aDriveId, - aItemChangedMessages, itemAdded); +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + if(aCategory == EMPXAbstractAlbum) + { + if (aMedia.ValueTObjectL(KMPXMediaGeneralCategory) == EMPXSong ) + { + iObserver.AddCategoryItemL(aCategory, name, aDriveId, + aItemChangedMessages, itemAdded, KNullDesC, KNullDesC); + } + else + { + TPtrC albumartist(aMedia.ValueText(KMPXMediaMusicAlbumArtist).Left(KMCMaxTextLen)); + //get AlbumArt, Genre for AbstractAlbum + MPX_DEBUG2(" Music albumartist[%S]", &albumartist); + TPtrC genre(aMedia.ValueText(KMPXMediaMusicGenre).Left(KMCMaxTextLen)); + MPX_DEBUG2(" Music Genre[%S]", &genre); + + // ignore the return value + iObserver.AddCategoryItemL(aCategory, name, aDriveId, + aItemChangedMessages, itemAdded, albumartist, genre); + } + } + else +#endif // ABSTRACTAUDIOALBUM_INCLUDED + { + // ignore the return value + iObserver.AddCategoryItemL(aCategory, name, aDriveId, + aItemChangedMessages, itemAdded); + } updated = ETrue; } } @@ -2296,14 +2438,35 @@ (aCategory != EMPXGenre)); if (!aOldId || (aOldId != aItemId)) { - // ignore the return value - iObserver.AddCategoryItemL(aCategory, KNullDesC, aDriveId, - aItemChangedMessages, itemAdded); - updated = ETrue; - } +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + if(aCategory == EMPXAbstractAlbum) + { + //get AlbumArt, Genre for AbstractAlbum + TPtrC albumartist(aMedia.ValueText(KMPXMediaMusicAlbumArtist).Left(KMCMaxTextLen)); + MPX_DEBUG2(" Music albumartist[%S]", &albumartist); + TPtrC genre(aMedia.ValueText(KMPXMediaMusicGenre).Left(KMCMaxTextLen)); + MPX_DEBUG2(" Music Genre[%S]", &genre); + + // ignore the return value + iObserver.AddCategoryItemL(aCategory, KNullDesC, aDriveId, + aItemChangedMessages, itemAdded, albumartist, genre); + } + else +#endif // ABSTRACTAUDIOALBUM_INCLUDED + { + // ignore the return value + iObserver.AddCategoryItemL(aCategory, KNullDesC, aDriveId, + aItemChangedMessages, itemAdded); + } + updated = ETrue; + } } - - if (aOldId && (aOldId != aItemId)) +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + //no need to delete old item for abstractalbum + if (aOldId && (aOldId != aItemId) && (aCategory != EMPXAbstractAlbum)) +#else + if (aOldId && (aOldId != aItemId)) +#endif // ABSTRACTAUDIOALBUM_INCLUDED { iObserver.DeleteSongForCategoryL(aCategory, aOldId, aDriveId, aItemChangedMessages, itemNotRemoved); @@ -2401,13 +2564,13 @@ { // only add if the ID changed, // otherwise the song was updated but the artist name was not - TPtrC art(KNullDesC); - if (aMedia.IsSupported(KMPXMediaMusicAlbumArtFileName)) - { - art.Set(aMedia.ValueText(KMPXMediaMusicAlbumArtFileName).Left(KMCMaxTextLen)); - } + TPtrC art(KNullDesC); + if (aMedia.IsSupported(KMPXMediaMusicAlbumArtFileName)) + { + art.Set(aMedia.ValueText(KMPXMediaMusicAlbumArtFileName).Left(KMCMaxTextLen)); + } - iObserver.AddCategoryItemL(aCategory, name, aArtistId, art, aDriveId, aItemChangedMessages, itemAdded); + iObserver.AddCategoryItemL(aCategory, name, aArtistId, art, aDriveId, aItemChangedMessages, itemAdded); updated = ETrue; } } @@ -2565,7 +2728,11 @@ aMedia.IsSupported(KMPXMediaAudioNumberOfChannels) || aMedia.IsSupported(KMPXMediaDrmType) || aMedia.IsSupported(KMPXMediaDrmRightsStatus) || - aMedia.IsSupported(KMPXMediaMTPDrmStatus); + aMedia.IsSupported(KMPXMediaMTPDrmStatus) +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + ||aMedia.IsSupported(KMPXMediaMusicAlbumArtist) +#endif // ABSTRACTAUDIOALBUM_INCLUDED + ; } // End of File diff -r 171e07ac910f -r c8156a91d13c mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/src/mpxdbplugin.cpp --- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/src/mpxdbplugin.cpp Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/src/mpxdbplugin.cpp Wed Mar 31 21:26:33 2010 +0300 @@ -1263,7 +1263,33 @@ { MPX_PERF_START(CMPXDbPlugin_DoOpenBrowseAlbumL_All); - iDbHandler->GetAllAlbumsL(aAttrs, aArray); + TRAPD(err, iDbHandler->GetAllAlbumsL(aAttrs, aArray) ); + // in error case, return empty list and append empty id to path + // in order to increase one level + if ( err != KErrNone ) + { + TInt pPath(0); + if (aArray->Count()) + { + CMPXMedia* pMedia = (*aArray)[0]; + if (pMedia->IsSupported(KMPXMediaGeneralValue)) + { + pPath = pMedia->ValueTObjectL(KMPXMediaGeneralValue); + MPX_ASSERT(pPath); + } + } + + RArray ids; + CleanupClosePushL(ids); + + // Append ids to the returned path + if (pPath) + { + ((CMPXCollectionPath*)pPath)->AppendL(ids.Array()); + } + CleanupStack::PopAndDestroy(&ids); + } + SetMediaGeneralAttributesL(aEntries, EMPXGroup, EMPXAlbum, iMusicLibraryTitles->MdcaPoint(EBrowseAlbum)); @@ -2565,6 +2591,13 @@ mediaId = iDbHandler->GetPlaylistIdMatchingUriL(uri); iDbHandler->RemovePlaylistL(mediaId, *fp, *itemChangedMessages); } +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + else if (category == EMPXAbstractAlbum ) + { + mediaId = iDbHandler->GetAbstractAlbumIdMatchingUriL(uri); + iDbHandler->RemoveAbstractAlbumL(mediaId, *fp, *itemChangedMessages); + } +#endif // ABSTRACTAUDIOALBUM_INCLUDED else { // otherwise unable to process this item @@ -3414,11 +3447,11 @@ CMPXMessageArray* changeMsgAry = CMPXMessageArray::NewL(); CleanupStack::PushL(changeMsgAry); - // start a transaction here - if (!iDbHandler->InTransaction()) - { - iDbHandler->BeginTransactionL(); - } + // start a transaction here + if (!iDbHandler->InTransaction()) + { + iDbHandler->BeginTransactionL(); + } // Group of items if (aMedia.ValueTObjectL(KMPXMediaGeneralType) == EMPXGroup) @@ -3440,8 +3473,8 @@ itemId = DoAddItemL(aMedia, *changeMsgAry); } - // end transaction here. - iDbHandler->EndTransactionL(KErrNone); + // end transaction here. + iDbHandler->EndTransactionL(KErrNone); iActiveTask->SetVisibleChange(CMPXDbActiveTask::EAllVisible); DoHandleChangeL(changeMsgAry); @@ -3494,7 +3527,31 @@ } } break; - +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + case EMPXAbstractAlbum: + { + if (aMedia.IsSupported(KMPXMediaGeneralUri)) + { + + itemId = iDbHandler->AddAbstractAlbumL(aMedia, &aMessageArray); + + if ( aMedia.IsSupported(KMPXMediaArrayContents)) + { + //need to update songs information to music table + CMPXMediaArray* array = aMedia.Value(KMPXMediaArrayContents); + if (array->Count()) + { + iDbHandler->UpdateAbstractAlbumSongsL(aMedia, aMessageArray); + } + } + } + else + { + User::Leave(KErrArgument); + } + } + break; +#endif // ABSTRACTAUDIOALBUM_INCLUDED case EMPXSong: { // For the use case of adding thousands of songs at once, @@ -3660,7 +3717,13 @@ visibleChange = CMPXDbActiveTask::ESingleVisible; } break; - +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + case EMPXAbstractAlbum: + { + visibleChange = iDbHandler->UpdateAbstractAlbumSongsL(aMedia, aMessageArray); + } + break; +#endif // ABSTRACTAUDIOALBUM_INCLUDED case EMPXSong: { // a list of changed messages as a result of the song being updated @@ -4309,13 +4372,13 @@ break; } case EBrowseAlbum: - { + { aAttrs.AppendL( TMPXAttribute(KMPXMediaIdMusic, EMPXMediaMusicArtist | EMPXMediaMusicAlbum | EMPXMediaMusicAlbumArtFileName ) ); aSupportedIds.AppendL( KMPXMediaIdMusic ); break; - } + } case EBrowsePlaylist: case EBrowseGenre: case EBrowseComposer: diff -r 171e07ac910f -r c8156a91d13c mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/src/mpxdbutil.cpp --- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/src/mpxdbutil.cpp Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/src/mpxdbutil.cpp Wed Mar 31 21:26:33 2010 +0300 @@ -72,6 +72,11 @@ case EMPXComposer: ptr.Set(KMCComposerTable); break; +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + case EMPXAbstractAlbum: + ptr.Set(KMCAbstractAlbumTable); + break; +#endif // ABSTRACTAUDIOALBUM_INCLUDED default: User::Leave(KErrNotSupported); } @@ -103,6 +108,11 @@ case EMPXComposer: ptr.Set(KMCMusicComposer); break; +#ifdef ABSTRACTAUDIOALBUM_INCLUDED + case EMPXAbstractAlbum: + ptr.Set(KMCMusicAbstractAlbum); + break; +#endif // ABSTRACTAUDIOALBUM_INCLUDED default: User::Leave(KErrNotSupported); } diff -r 171e07ac910f -r c8156a91d13c mpxplugins/serviceplugins/playbackplugins/progressdownloadsb/src/mpxprogressdownloadsb.cpp --- a/mpxplugins/serviceplugins/playbackplugins/progressdownloadsb/src/mpxprogressdownloadsb.cpp Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/serviceplugins/playbackplugins/progressdownloadsb/src/mpxprogressdownloadsb.cpp Wed Mar 31 21:26:33 2010 +0300 @@ -331,10 +331,13 @@ iMStreamControl->Stop(); iObs->HandlePluginEvent(MMPXPlaybackPluginObserver::EPStopped, 0, KErrNone); - if ( EPbDlStateDownloadCompleted == iDownloadState && iConsumeStarted ) + if ( EPbDlStateDownloadCompleted == iDownloadState ) { - ConsumeRights( ContentAccess::EStop ); - iConsumeStarted = EFalse; + if ( iConsumeStarted ) + { + ConsumeRights( ContentAccess::EStop ); + iConsumeStarted = EFalse; + } if ( !iFileSaved ) { iDrmMediaUtility->Close(); // release file handle so we can move file. @@ -344,10 +347,13 @@ iDrmMediaUtility->Close(); break; case EPbCmdClose: - if ( EPbDlStateDownloadCompleted == iDownloadState && iConsumeStarted ) + if ( EPbDlStateDownloadCompleted == iDownloadState ) { - ConsumeRights( ContentAccess::EStop ); - iConsumeStarted = EFalse; + if ( iConsumeStarted ) + { + ConsumeRights( ContentAccess::EStop ); + iConsumeStarted = EFalse; + } if ( !iFileSaved ) { iDrmMediaUtility->Close(); // release file handle so we can move file. diff -r 171e07ac910f -r c8156a91d13c mpxplugins/viewplugins/inc/mpxcommonplaybackviewimp.h --- a/mpxplugins/viewplugins/inc/mpxcommonplaybackviewimp.h Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/viewplugins/inc/mpxcommonplaybackviewimp.h Wed Mar 31 21:26:33 2010 +0300 @@ -12,7 +12,7 @@ * Contributors: * * Description: MPX common playback view implementation -* Version : %version: da1mmcf#41.1.6.1.1.1.10 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: da1mmcf#41.1.6.1.1.1.12 % << Don't touch! Updated by Synergy at check-out. * */ @@ -38,6 +38,7 @@ #include "mpxplaybackframeworkdefs.h" // TMPXPlaybackPlayerType #include "../../../inc/musicplayerbldvariant.hrh" +#include // FORWARD DECLARATIONS class CMPXCommonPlaybackViewContainer; @@ -612,6 +613,12 @@ * Updates the middle (play/pause) toolbar control key icon based on playback state */ IMPORT_C void UpdateToolbar(); + + /** + * Launch Metadata Dialog to show the file details + */ + IMPORT_C virtual void LaunchFileDetailsDialogL(); + protected: static TInt DeferredAlbumArtExtractCallback( TAny* aPtr ); @@ -760,7 +767,7 @@ TInt iOldPosition; // in seconds TBool iIsTapped; TCommandSender iCommandSender; - + CTvOutConfig* iTvOutConfig; TSize iFullScreenImageSize; CPeriodic* iTNRequestTimer; }; diff -r 171e07ac910f -r c8156a91d13c mpxplugins/viewplugins/inc/mpxmetadataeditordialog.h --- a/mpxplugins/viewplugins/inc/mpxmetadataeditordialog.h Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/viewplugins/inc/mpxmetadataeditordialog.h Wed Mar 31 21:26:33 2010 +0300 @@ -43,6 +43,10 @@ class MMPXCollectionUiHelper; class CAknPopupField; class CIdle; +namespace DRM + { + class CDrmUiHandling; + } // CLASS DECLARATION /* @@ -411,6 +415,12 @@ */ void PopulatePodcastFileDetailsL(); + + /** + * Launch DRM information popup + */ + void LaunchDrmInfoL(); + /** * Add parts Of time. @@ -610,6 +620,7 @@ TBool iDisablePodcasting; CIdle* iIdle; TBool iTryingExit; + DRM::CDrmUiHandling* iDrmUiHandler; }; #endif // MPXMETADATAEDITORDIALOG_H diff -r 171e07ac910f -r c8156a91d13c mpxplugins/viewplugins/inc/mpxwaitnotedialog.h --- a/mpxplugins/viewplugins/inc/mpxwaitnotedialog.h Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/viewplugins/inc/mpxwaitnotedialog.h Wed Mar 31 21:26:33 2010 +0300 @@ -189,6 +189,20 @@ CAknNoteDialog::TTone aTone = CAknNoteDialog::ENoTone ); //#endif // __COVER_DISPLAY // Cover UI end + + /** + * Display a process wait dialog + * @param aDlgRsc, dialog resource + * @param aLabel, text + */ + void DisplayProcessWaitDialogL( TInt aDlgRsc, const TDesC& aLabel, + CAknWaitDialog::TTone aTone = CAknWaitDialog::ENoTone ); + + /** + * Cancel the process wait dialog + */ + void CancelProcessWaitDialogL(); + protected: @@ -214,6 +228,7 @@ TInt iResourceOffset; CAknQueryDialog* iQueryDialog; // Not Owned CAknNoteDialog* iNoteDialog; // Not Owned + CAknWaitDialog* iProcessWaitDialog; // Owned }; #endif // C_MPXWAITNOTEDIALOG_H diff -r 171e07ac910f -r c8156a91d13c mpxplugins/viewplugins/views/audioeffectsview/data/mpxaudioeffectsview.rss --- a/mpxplugins/viewplugins/views/audioeffectsview/data/mpxaudioeffectsview.rss Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/viewplugins/views/audioeffectsview/data/mpxaudioeffectsview.rss Wed Mar 31 21:26:33 2010 +0300 @@ -66,8 +66,7 @@ // RESOURCE AVKON_VIEW r_audioeffects_settingslist_view { - menubar = r_audioeffects_settingslist_menu_bar; - cba = r_audioeffects_softkeys_options_change_back; + cba = R_AVKON_SOFTKEYS_BACK; } #else // --------------------------------------------------------------------------- @@ -77,8 +76,7 @@ // RESOURCE AVKON_VIEW r_audioeffects_settingslist_view { - menubar = r_audioeffects_settingslist_menu_bar; - cba = R_AVKON_SOFTKEYS_OPTIONS_BACK; + cba = R_AVKON_SOFTKEYS_BACK; } #endif // __ENABLE_MSK @@ -160,7 +158,7 @@ { identifier = ELoudnessItem; setting_page_resource = r_loudness_setting_page; - associated_resource = r_settingslist_hints_popup_setting_texts; + associated_resource = r_loudness_settingslist_hints_popup_setting_texts; name = qtn_nmp_loudness; }, //stereo widening @@ -168,7 +166,7 @@ { identifier = EStereoWideningSettingItem; setting_page_resource = r_stereowidening_setting_page; - associated_resource = r_settingslist_hints_popup_setting_texts; + associated_resource = r_stereowidening_settingslist_hints_popup_setting_texts; name = qtn_nmp_stereowidening; } }; @@ -219,6 +217,58 @@ editor_resource_id = r_settingslist_common_use_popup_setting_list; } +// --------------------------------------------------------------------------- +// r_loudness_settingslist_hints_popup_setting_texts +// Audio Effects view hints popup setting texts. +// --------------------------------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_loudness_settingslist_hints_popup_setting_texts + { + setting_texts_resource = r_loudness_settingslist_hints_texts; + popped_up_texts_resource = r_loudness_settingslist_hints_popup_texts; + } + +// --------------------------------------------------------------------------- +// r_loudness_settingslist_hints_texts +// Audio Effects view hints texts. +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_loudness_settingslist_hints_texts + { + items = + { + AVKON_ENUMERATED_TEXT + { + value = 1; + text = qtn_nmp_loudness_on; + }, + AVKON_ENUMERATED_TEXT + { + value = 0; + text = qtn_nmp_loudness_off; + } + }; + } + +// --------------------------------------------------------------------------- +// r_loudness_settingslist_hints_popup_texts +// Audio Effects view hints popup texts. +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_loudness_settingslist_hints_popup_texts + { + items = + { + LBUF + { + txt = qtn_nmp_loudness_on; + }, + LBUF + { + txt = qtn_nmp_loudness_off; + } + }; + } // STEREO WIDENING @@ -235,6 +285,59 @@ } // --------------------------------------------------------------------------- +// r_stereowidening_settingslist_hints_popup_setting_texts +// Audio Effects view hints popup setting texts. +// --------------------------------------------------------------------------- +// +RESOURCE AVKON_POPUP_SETTING_TEXTS r_stereowidening_settingslist_hints_popup_setting_texts + { + setting_texts_resource = r_stereowidening_settingslist_hints_texts; + popped_up_texts_resource = r_stereowidening_settingslist_hints_popup_texts; + } + +// --------------------------------------------------------------------------- +// r_stereowidening_settingslist_hints_texts +// Audio Effects view hints texts. +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_stereowidening_settingslist_hints_texts + { + items = + { + AVKON_ENUMERATED_TEXT + { + value = 1; + text = qtn_nmp_stereowidening_on; + }, + AVKON_ENUMERATED_TEXT + { + value = 0; + text = qtn_nmp_stereowidening_off; + } + }; + } + +// --------------------------------------------------------------------------- +// r_stereowidening_settingslist_hints_popup_texts +// Audio Effects view hints popup texts. +// --------------------------------------------------------------------------- +// +RESOURCE ARRAY r_stereowidening_settingslist_hints_popup_texts + { + items = + { + LBUF + { + txt = qtn_nmp_stereowidening_on; + }, + LBUF + { + txt = qtn_nmp_stereowidening_off; + } + }; + } + +// --------------------------------------------------------------------------- // r_settingslist_common_use_popup_setting_list // Audio Effects view common use popup setting list. // --------------------------------------------------------------------------- @@ -243,60 +346,6 @@ { } -// --------------------------------------------------------------------------- -// r_settingslist_hints_popup_setting_texts -// Audio Effects view hints popup setting texts. -// --------------------------------------------------------------------------- -// -RESOURCE AVKON_POPUP_SETTING_TEXTS r_settingslist_hints_popup_setting_texts - { - setting_texts_resource = r_settingslist_hints_texts; - popped_up_texts_resource = r_settingslist_hints_popup_texts; - } - -// --------------------------------------------------------------------------- -// r_settingslist_hints_texts -// Audio Effects view hints texts. -// --------------------------------------------------------------------------- -// -RESOURCE ARRAY r_settingslist_hints_texts - { - items = - { - AVKON_ENUMERATED_TEXT - { - value = 1; - text = qtn_nmp_on; - }, - AVKON_ENUMERATED_TEXT - { - value = 0; - text = qtn_nmp_off; - } - }; - } - -// --------------------------------------------------------------------------- -// r_settingslist_hints_popup_texts -// Audio Effects view hints popup texts. -// --------------------------------------------------------------------------- -// -RESOURCE ARRAY r_settingslist_hints_popup_texts - { - items = - { - LBUF - { - txt = qtn_nmp_on; - }, - LBUF - { - txt = qtn_nmp_off; - } - }; - } - - // BALANCE // Balance settings page text @@ -390,3 +439,6 @@ { buf = qtn_nmp_balance_right100; } + +// End of file + diff -r 171e07ac910f -r c8156a91d13c mpxplugins/viewplugins/views/audioeffectsview/loc/mpxaudioeffects.loc --- a/mpxplugins/viewplugins/views/audioeffectsview/loc/mpxaudioeffects.loc Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/viewplugins/views/audioeffectsview/loc/mpxaudioeffects.loc Wed Mar 31 21:26:33 2010 +0300 @@ -60,25 +60,7 @@ // l:title_pane_t2/opt9 // r:3.1 // -#define qtn_nmp_audioeffects "Audio settings" - -// d:Used in Sound check view. -// d:Name of an option to switch off bassboost and stereo -// d:widening effect for audio. -// d:Series_60_Music_settings_UI_Specification_v2.0.doc, Figure 4.5-3 -// l:list_set_graphic_pane_t1 -// r:3.1 -// -#define qtn_nmp_off "Off" - -// d:Used in Sound check view. -// d:Name of an option to switch on bassboost and stereo -// d:widening effect for audio. -// d:Series_60_Music_settings_UI_Specification_v2.0.doc, Figure 4.5-3 -// l:list_set_graphic_pane_t1 -// r:3.1 -// -#define qtn_nmp_on "On" +#define qtn_nmp_audioeffects "Settings" // d:Used in Sound check view. // d:Name of a component that will change stereo widening @@ -171,4 +153,28 @@ // #define qtn_nmp_balance_left100 "Balance - Left 100" +// d:On as setting item in Loudness +// l:list_set_graphic_pane_t1 +// r:5.2 +// +#define qtn_nmp_loudness_on "On" + +// d:Off as setting item in Loudness +// l:list_set_graphic_pane_t1 +// r:5.2 +// +#define qtn_nmp_loudness_off "Off" + +// d:On as setting item in Stereo widening +// l:list_set_graphic_pane_t1 +// r:5.2 +// +#define qtn_nmp_stereowidening_on "On" + +// d:Off as setting item in Stereo widening +// l:list_set_graphic_pane_t1 +// r:5.2 +// +#define qtn_nmp_stereowidening_off "Off" + // End of File diff -r 171e07ac910f -r c8156a91d13c mpxplugins/viewplugins/views/collectionviewhg/data/mpxcollectionviewhg.rss --- a/mpxplugins/viewplugins/views/collectionviewhg/data/mpxcollectionviewhg.rss Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/viewplugins/views/collectionviewhg/data/mpxcollectionviewhg.rss Wed Mar 31 21:26:33 2010 +0300 @@ -151,7 +151,7 @@ MENU_ITEM { command = EMPXCmdGoToNowPlaying; - txt = qtn_nmp_options_go_to_nowplaying; + txt = qtn_mus_options_nowplaying; }, MENU_ITEM { @@ -161,27 +161,27 @@ MENU_ITEM { command = EMPXCmdGoToArtistAlbums; - txt = "Artists & Albums"; + txt = qtn_mus_options_artists_and_albums; }, MENU_ITEM { command = EMPXCmdGoToAllSongs; - txt = "Songs"; + txt = qtn_mus_options_songs; }, MENU_ITEM { command = EMPXCmdGoToPlaylists; - txt = "Playlists"; + txt = qtn_mus_options_playlists; }, MENU_ITEM { command = EMPXCmdGoToGenre; - txt = "Sort by genre"; + txt = qtn_mus_options_genres; }, MENU_ITEM { command = EMPXCmdGoToPodcasts; - txt = "Podcasts"; + txt = qtn_mus_options_podcasts; }, MENU_ITEM { @@ -207,7 +207,7 @@ MENU_ITEM { command = EMPXCmdPlayItem; - txt = "Play"; + txt = qtn_mus_options_play; flags = EEikMenuItemSpecific; }, MENU_ITEM @@ -467,7 +467,7 @@ MENU_ITEM { command = EMPXCmdGoToNokiaMusicShop; - txt = "Nokia Music Store"; + txt = qtn_mus_options_ovi_music; } }; } @@ -1568,5 +1568,122 @@ } }; } - + +// --------------------------------------------------------------------------- +// r_mpx_shuffle +// Shuffle item in the list. First item in list with more than one item. +// --------------------------------------------------------------------------- +// +RESOURCE TBUF r_mpx_shuffle + { + buf = qtn_mus_shuffle; + } + +// --------------------------------------------------------------------------- +// r_mpx_mediawall_title_shuffle_all +// Shuffle item in the media wall. First item in media wall when there's more than one item. +// --------------------------------------------------------------------------- +// +RESOURCE TBUF r_mpx_mediawall_title_shuffle_all + { + buf = qtn_mus_mediawall_title_shuffle_all; + } + +// --------------------------------------------------------------------------- +// r_mpx_shuffle_single +// Shuffle item in the list. First item in list with more than one item. +// --------------------------------------------------------------------------- +// +RESOURCE TBUF r_mpx_tbone_shuffle + { + buf = qtn_mus_tbone_shuffle; + } + +// --------------------------------------------------------------------------- +// r_mpx_shuffle_popuplist +// Shuffle item in the popuplist. First item in list with more than one item. +// --------------------------------------------------------------------------- +// +RESOURCE TBUF r_mpx_mediawall_dialog_shuffle + { + buf = qtn_mus_mediawall_dialog_shuffle; + } + +// --------------------------------------------------------------------------- +// r_mpx_mp_list_artist_unknown +// Text shown if there is at least one artist for which the artist name is not available. +// --------------------------------------------------------------------------- +// +RESOURCE TBUF r_mpx_mp_list_artist_unknown + { + buf = qtn_mp_unknown; + } + +// --------------------------------------------------------------------------- +// r_mpx_mp_list_album_unknown +// Text shown if the album name is not available +// --------------------------------------------------------------------------- +// +RESOURCE TBUF r_mpx_mp_list_album_unknown + { + buf = qtn_vmp_unknown; + } + +// --------------------------------------------------------------------------- +// r_mpx_mediawall_artist_unknown +// Text shown if the artist name is not available in media wall +// --------------------------------------------------------------------------- +// +RESOURCE TBUF r_mpx_mediawall_artist_unknown + { + buf = qtn_mus_mediawall_artist_unknown; + } + +// --------------------------------------------------------------------------- +// r_mpx_mediawall_album_unknown +// Text shown if the artist name is not available in media wall +// --------------------------------------------------------------------------- +// +RESOURCE TBUF r_mpx_mediawall_album_unknown + { + buf = qtn_mus_mediawall_album_unknown; + } + +// --------------------------------------------------------------------------- +// r_mpx_mediawall_popup_title_unknown +// Text shown if the album name is not available in media wall +// --------------------------------------------------------------------------- +// +RESOURCE TBUF r_mpx_mediawall_popup_title_unknown + { + buf = qtn_mus_mediawall_popup_title_unknown; + } + +// --------------------------------------------------------------------------- +// r_mpx_songs_artist_unknown +// Text shown if the artist name is not available in tracks level view +// --------------------------------------------------------------------------- +// +RESOURCE TBUF r_mpx_songs_artist_unknown + { + buf = qtn_mus_songs_artist_unknown; + } + +// --------------------------------------------------------------------------- +// Text shown if there is no content to display for Artists & Albums. +// --------------------------------------------------------------------------- +// +RESOURCE TBUF r_mpx_vmp_no_albums + { + buf = qtn_vmp_no_albums; + } + +// --------------------------------------------------------------------------- +// Text shown when there is no content to display in tracks level view. +// --------------------------------------------------------------------------- +// +RESOURCE TBUF r_mpx_vmp_no_songs + { + buf = qtn_vmp_no_songs; + } // End of File diff -r 171e07ac910f -r c8156a91d13c mpxplugins/viewplugins/views/collectionviewhg/group/iconlist.txt --- a/mpxplugins/viewplugins/views/collectionviewhg/group/iconlist.txt Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/viewplugins/views/collectionviewhg/group/iconlist.txt Wed Mar 31 21:26:33 2010 +0300 @@ -24,3 +24,4 @@ -c8,8 qgn_graf_mup_lst_drm_exp -c8,8 qgn_graf_mup_dlst_podcast -c8,8 qgn_graf_mup_npv_icon_shuffle.svg +-c8,8 qgn_prop_albumart_large.svg diff -r 171e07ac910f -r c8156a91d13c mpxplugins/viewplugins/views/collectionviewhg/group/mpxcollectionviewhg.mmp --- a/mpxplugins/viewplugins/views/collectionviewhg/group/mpxcollectionviewhg.mmp Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/viewplugins/views/collectionviewhg/group/mpxcollectionviewhg.mmp Wed Mar 31 21:26:33 2010 +0300 @@ -104,10 +104,10 @@ LIBRARY mpxbacksteppingutility.lib #endif // IAD_INCLUDE_BACKSTEPPING -// Added by Harri for Hurriganes MediaWall mod LIBRARY ws32.lib LIBRARY ecom.lib LIBRARY aknlayout2scalable.lib +LIBRARY AknLayout2.lib LIBRARY thumbnailmanager.lib // Album art LIBRARY ganes.lib diff -r 171e07ac910f -r c8156a91d13c mpxplugins/viewplugins/views/collectionviewhg/inc/mpxcollectionviewhg.hrh --- a/mpxplugins/viewplugins/views/collectionviewhg/inc/mpxcollectionviewhg.hrh Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/viewplugins/views/collectionviewhg/inc/mpxcollectionviewhg.hrh Wed Mar 31 21:26:33 2010 +0300 @@ -77,7 +77,7 @@ ,EMPXCmdRefreshLibrary #endif ,EMPXCmdPlayItem - + ,EMPXCmdAbout }; // current MediaL operation diff -r 171e07ac910f -r c8156a91d13c mpxplugins/viewplugins/views/collectionviewhg/inc/mpxcollectionviewhgcontainer.h --- a/mpxplugins/viewplugins/views/collectionviewhg/inc/mpxcollectionviewhgcontainer.h Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/viewplugins/views/collectionviewhg/inc/mpxcollectionviewhgcontainer.h Wed Mar 31 21:26:33 2010 +0300 @@ -751,8 +751,9 @@ /** * Resolve the type of view based on current browsing context + * @param aCount Count from media array */ - void ResolveCurrentViewType(); + void ResolveCurrentViewType(TInt aCount); /** * Clean up the previous view's resources. diff -r 171e07ac910f -r c8156a91d13c mpxplugins/viewplugins/views/collectionviewhg/loc/mpxcollectionviewhg.loc --- a/mpxplugins/viewplugins/views/collectionviewhg/loc/mpxcollectionviewhg.loc Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/viewplugins/views/collectionviewhg/loc/mpxcollectionviewhg.loc Wed Mar 31 21:26:33 2010 +0300 @@ -513,4 +513,185 @@ // #define qtn_nmp_del_batch_songs_wait_note "Deleting: %N%" +// d:Options menu item for Ovi music. +// l:list_single_pane_t1_cp2/opt1 +// r:5.2 +// +#define qtn_mus_options_ovi_music "Ovi Music" + +// d:Options menu item for about. +// l:list_single_pane_t1_cp2/opt1 +// r:5.2 +// +#define qtn_mus_options_about "About" + +// d:Options menu item for songs. +// l:list_single_pane_t1_cp2/opt1 +// r:5.2 +// +#define qtn_mus_options_songs "Songs" + +// d:Options menu item for artists & albums. +// l:list_single_pane_t1_cp2/opt1 +// r:5.2 +// +#define qtn_mus_options_artists_and_albums "Artists & Albums" + +// d:Options menu item for playlists. +// l:list_single_pane_t1_cp2/opt1 +// r:5.2 +// +#define qtn_mus_options_playlists "Playlists" + +// d:Options menu item for podcasts. +// l:list_single_pane_t1_cp2/opt1 +// r:5.2 +// +#define qtn_mus_options_podcasts "Podcasts" + +// d:Options menu item for Genres. +// l:list_single_pane_t1_cp2/opt1 +// r:5.2 +// +#define qtn_mus_options_genres "Genres" + +// d:Shuffle item in the list. First item in list with more than one item. +// l:list_double_large_graphic_pane_t1 +// r:5.2 +// +#define qtn_mus_shuffle "Shuffle" + +// d:Options menu item for play. +// l:list_single_pane_t1_cp2/opt1 +// r:5.2 +// +#define qtn_mus_options_play "Play" + +// d:Shuffle item in the media wall. First item in media wall. +// d:when there's more than one item. +// l:main_cf0_pane_t2 +// r:5.2 +// +#define qtn_mus_mediawall_title_shuffle_all "Shuffle" + +// d:Text shown if there is no content to display for Artists & Albums. +// l:main_pane_empty_t1 +// r:5.2 +// +#define qtn_vmp_no_albums "(no albums)" + +// d:Text shown if there is at least one artist for which the artist name is not available. +// l:list_double_large_graphic_pane_t1 +// r:5.2 +// +#define qtn_mp_unknown "Unknown" + +// d:Text shown if the artist name is not available in media wall +// l:main_cf0_pane_t1 +// r:5.2 +// +#define qtn_mus_mediawall_artist_unknown "Unknown" + +// d:Text shown if the album name is not available in media wall +// l:main_cf0_pane_t2 +// r:5.2 +// +#define qtn_mus_mediawall_album_unknown "Unknown" + +// d:Shuffle item in the list. First item in list with more than one item. +// l:list_single_pane_t1 +// r:5.2 +// +#define qtn_mus_tbone_shuffle "Shuffle" + +// d:Shuffle item in the popup list. First item in the popup list. +// d:when there's more than one item. +// l:list_single_pane_t1_cp2 +// r:5.2 +// +#define qtn_mus_mediawall_dialog_shuffle "Shuffle" + +// d:Text shown if the album name is not available in media wall +// l:heading_pane_t1/opt2 +// r:5.2 +// +#define qtn_mus_mediawall_popup_title_unknown "Unknown" + +// d:Text shown if the artist name is not available in tracks level view +// l:list_double_large_graphic_pane_t2 +// r:5.2 +// +#define qtn_mus_songs_artist_unknown "Unknown" + +// d:Text shown when there is no content to display in tracks level view +// l:main_pane_empty_t1 +// r:5.2 +// +#define qtn_vmp_no_songs "(no songs)" + +// d:Information and a query note text +// d:Display when Music Player launch first time or at manual refresh(if new song added) +// d:%U is the educating user URI +// l:popup_info_list_pane_t1 +// r:5.2 +// +#define qtn_nmp_note_educating_the_user "Please note that using Media Transfer mode to transfer your music will optimize your music experience. To learn more, please go to %U. Remind me later?" + +// d:Heading "About" for verions info of musicplayer +// l:heading_pane_t1 +// r:5.2 +// +#define qtn_mus_about_note "About" + +// d:Information about music player version +// d:%U is version number +// l:popup_info_list_pane_t1 +// r:5.2 +// +#define qtn_mus_about_version "Music Player for Symbian^3 version %U\nCopyright © 2010 Nokia. All rights reserved." + +// d:Options menu item for now playing. +// l:list_single_pane_t1_cp2/opt1 +// r:5.2 +// +#define qtn_mus_options_nowplaying "Now Playing" + +// d:Text shown if there is more than one song in the playlist. +// d:where %N is the number of songs within the playlist +// d:and %U is the duration time for the total playlist, +// d:in the format hh:mm is displayed. +// d:if the playlist is empty, the duration is displayed as dashes (-- : --) +// l:list_double_large_graphic_pane_t2 +// r:5.2 +// +#define qtn_mus_music_num_songs_duration "%N songs - %U" + +// d:Text shown if there is only one song in the playlist +// d:%U is the duration time for the total playlist, +// d:in the format hh:mm is displayed. +// l:list_double_large_graphic_pane_t2 +// r:5.2 +// +#define qtn_mus_music_one_song_duration "1 song - %U" + +// d:List box text to show the number of items in the collection +// d:For the case there're 0 or more than 1 song in the collection +// l:list_double_large_graphic_pane_t2 +// r:5.0 +// +#define qtn_mus_music_num_songs "%N songs" + +// d:List box text to show the number of items in the collection +// d:For the case there's only 1 song in the collection +// l:list_double_large_graphic_pane_t2 +// r:5.0 +// +#define qtn_mus_music_one_song "1 song" + +// d:Text shown when the genre name is not available. +// l:list_double_large_graphic_pane_t1 +// r:5.2 +// +#define qtn_mus_genre_unknown "Unknown" + // End of File diff -r 171e07ac910f -r c8156a91d13c mpxplugins/viewplugins/views/collectionviewhg/src/mpxcollectionviewhgcontainer.cpp --- a/mpxplugins/viewplugins/views/collectionviewhg/src/mpxcollectionviewhgcontainer.cpp Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/viewplugins/views/collectionviewhg/src/mpxcollectionviewhgcontainer.cpp Wed Mar 31 21:26:33 2010 +0300 @@ -66,6 +66,8 @@ #include #include +#include +#include #include // For transition effects #include // For transition effects @@ -934,7 +936,7 @@ break; } - return count; + return count - iShuffleItem; } @@ -1077,9 +1079,11 @@ // TODO, check if we need to support this with other view types also // David: This needs to be supported for Mediawall and Tbone - if ( iListWidget ) + if ( iListWidget && iCurrentViewType == EMPXViewList ) { - iListWidget->SetSelectedIndex( aIndex ); + // aIndex is the song index, so need take "ShuffleAll" item + // into account + iListWidget->SetSelectedIndex( aIndex + iShuffleItem ); } } @@ -1186,20 +1190,9 @@ HandleLbxItemRemovalL(); TViewType prevViewType = iCurrentViewType; - //no songs and no allbums, then its list view - if ( count > 0 ) - { - ResolveCurrentViewType(); - } - else - { - TBool landscapeOrientation = Layout_Meta_Data::IsLandscapeOrientation(); - if( landscapeOrientation ) - iCurrentViewType = EMPXViewMediawall; - else - iCurrentViewType = EMPXViewList; - } - + + ResolveCurrentViewType( count ); + iThumbnailReqMap.Reset(); if (ShuffleItemPresent()) iShuffleItem = 1; @@ -1467,17 +1460,22 @@ // void CMPXCollectionViewHgContainer::ResizeListL(const CMPXMediaArray& aMediaArray, TInt aCount) { + MPX_FUNC( "CMPXCollectionViewHgContainer::ResizeListL" ); + TInt mediaCount = aMediaArray.Count(); + if( iListWidget ) { - TRect clientRect = ((CAknView*)iView)->ClientRect(); - TInt index = iListWidget->SelectedIndex(); + TRect clientRect = ((CAknView*)iView)->ClientRect(); + TInt mediaIndex = MediaIndex(iListWidget->SelectedIndex()); + mediaIndex = ( mediaIndex >= 0 && (mediaIndex < (mediaCount)) ) ? mediaIndex : (mediaCount - 1); + iListWidget->InitScreenL( clientRect ); iListWidget->Reset(); if ( aCount ) { iListWidget->ResizeL( aCount ); ProvideDataWithoutThumbnailsL(aMediaArray); - iListWidget->SetSelectedIndex( index ); + iListWidget->SetSelectedIndex( mediaIndex + iShuffleItem ); } else { @@ -1488,17 +1486,28 @@ { // In case of mediawall components we switch to different view type if orientation changes // so there is no need to set new client rect for mediawall. - TInt index = iMediaWall->SelectedIndex(); + TInt mediaIndex = MediaIndex(iMediaWall->SelectedIndex()); + + // Correct the array index if it is out of range + // This case may happen when last album or album beside selected album is deleted + mediaIndex = ( mediaIndex >= 0 && ( mediaIndex < mediaCount ) ) ? mediaIndex : (mediaCount - 1); + + if( iSelectedAlbumIndex != mediaIndex ) + { + iSelectedAlbumIndex = mediaIndex; + SaveSelectedAlbumItemL( iSelectedAlbumIndex ); + } + iMediaWall->Reset(); if ( aCount ) { iMediaWall->ResizeL( aCount ); ProvideDataWithoutThumbnailsMwL(aMediaArray); - index = index >= 0 ? index : 0; - iMediaWall->SetSelectedIndex( index ); + + iMediaWall->SetSelectedIndex( mediaIndex + iShuffleItem); if ( iCurrentViewType == EMPXViewTBone ) { - OpenAlbumL( index ); + OpenAlbumL( mediaIndex ); } } else @@ -1520,6 +1529,7 @@ TRect clientRect = ((CAknView*)iView)->ClientRect(); iThumbnailManager->SetSizeL( EAudioListThumbnailSize ); + iImageSize = CHgDoubleGraphicListFlat::PreferredImageSize(); if( !iListWidget ) { @@ -1547,12 +1557,16 @@ iListWidget->InitScreenL(clientRect); } - + if ( (iAlbumIndex > 0) && (iAlbumIndex < aCount) ) + { + iListWidget->SetSelectedIndex( iAlbumIndex + iShuffleItem ); + } + // TODO. Define here in which views we need to have buffering enabled in the list - if( iContext == EContextGroupAlbum || + if( ( iContext == EContextGroupAlbum || iContext == EContextGroupArtist || iContext == EContextGroupSong || - iContext == EContextItemPlaylist ) + iContext == EContextItemPlaylist ) && ( aCount > 0) ) { iListWidget->EnableScrollBufferL(*this, KMPXListBufferSize, KMPXListBufferSize/4); } @@ -1578,9 +1592,19 @@ TRect clientRect = ((CAknView*)iView)->ClientRect(); - // Temporary until we have real layout data - TRect mediaWallRect = TRect(clientRect.iTl, TPoint(clientRect.iBr.iX, 250)); - TRect mwListRect = TRect(TPoint(clientRect.iTl.iX, 250), clientRect.iBr); + TAknLayoutRect mediawallLayout; + mediawallLayout.LayoutRect( clientRect, AknLayoutScalable_Apps::cf0_flow_pane(0) ); + + TAknLayoutRect listLayout; + listLayout.LayoutRect( clientRect, AknLayoutScalable_Apps::listscroll_cf0_pane(0) ); + + TRect mediaWallRect = mediawallLayout.Rect(); + TRect mwListRect = listLayout.Rect(); + + // get front rectange from layout + TAknLayoutRect frontRect; + frontRect.LayoutRect( mediaWallRect, AknLayoutScalable_Apps::cf0_flow_pane_g1(0) ); + iImageSize = frontRect.Rect().Size(); if( iMediaWall ) { @@ -1598,7 +1622,7 @@ CHgVgMediaWall::EHgVgMediaWallStyleCoverflowTBonePortrait, EFalse, this, - NULL ); + DefaultIconL() ); if( !iIsForeground ) iMediaWall->HandleLosingForeground(); @@ -1666,7 +1690,7 @@ OpenAlbumL(iAlbumIndex); } iMwListWidget->RefreshScreen(0); - + iDefaultIconSet = ETrue; } // ---------------------------------------------------------------------------- @@ -1678,6 +1702,10 @@ TRect appRect = ((CAknAppUi*)iCoeEnv->AppUi())->ApplicationRect(); ((CAknAppUi*)iCoeEnv->AppUi())->StatusPane()->MakeVisible(EFalse); iThumbnailManager->SetSizeL( EAudioFullScreenThumbnailSize ); + // get front rectange from layout + TAknLayoutRect frontRect; + frontRect.LayoutRect( appRect, AknLayoutScalable_Apps::cf0_flow_pane_g1(0) ); + iImageSize = frontRect.Rect().Size(); if( iMediaWall ) { @@ -1754,8 +1782,10 @@ void CMPXCollectionViewHgContainer::SetShuffleItemToListL(CHgScroller* aScroller ) { CHgItem* item = CHgItem::NewL(); - // Todo: Localize - item->SetTitleL( _L("Shuffle All") ); + HBufC* shuffleText = StringLoader::LoadLC( + R_MPX_TBONE_SHUFFLE ); + item->SetTitleL( *shuffleText ); + CleanupStack::PopAndDestroy( shuffleText ); CGulIcon* icon = (*iIconArray)[EMPXClvIconShuffle]; CFbsBitmap* bitmap = icon->Bitmap(); @@ -1813,7 +1843,7 @@ // ---------------------------------------------------------------------------- // Resolve the current view type based on the browsing context // ---------------------------------------------------------------------------- -void CMPXCollectionViewHgContainer::ResolveCurrentViewType() +void CMPXCollectionViewHgContainer::ResolveCurrentViewType( TInt aCount ) { iCurrentViewType = EMPXViewUnknown; TBool landscapeOrientation = Layout_Meta_Data::IsLandscapeOrientation(); @@ -1852,6 +1882,16 @@ iCurrentViewType = EMPXViewList; break; } + + // if tbone view is empty, switch back to Albums list or meidawall view + if( ( iCurrentViewType == EMPXViewTBone ) && ( aCount < 1 ) ) + { + if( landscapeOrientation ) + iCurrentViewType = EMPXViewMediawall; + else + iCurrentViewType = EMPXViewList; + } + } // ---------------------------------------------------------------------------- @@ -1961,26 +2001,37 @@ // void CMPXCollectionViewHgContainer::HandleItemCommandL( TInt aCommand ) { - MPX_FUNC( "CMPXCollectionViewHgContainer::HandleItemCommanddL" ); - + MPX_FUNC( "CMPXCollectionViewHgContainer::HandleItemCommandL" ); + MPX_DEBUG3("CMPXCollectionViewHgContainer::HandleItemCommandL iCurrentViewType = %d, iContext = %d", iCurrentViewType, iContext); if( aCommand == EMPXCmdPlay ) { - if ( iContext == EContextGroupAlbum ) + TInt index = CurrentLbxItemIndex(); + if (!ShufflePlayAllL(index)) { - 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); + switch( iContext ) + { + case EContextGroupAlbum: + case EContextItemAlbum: + { + iSelectedAlbumIndex = index; + SaveSelectedAlbumItemL(index); + // Open first song of album & playlist for entire album is created. + PlayAlbumL(index); + break; + } + case EContextGroupPlaylist: + { + PlayPlaylistL(index); + break; + } + case EContextGroupGenre: + { + PlayGenreL(index); + break; + } + default: + break; + } } } } @@ -2012,12 +2063,14 @@ if ( aControl == iMediaWall ) { iSelectedAlbumIndex = index; + iAlbumIndex = index; OpenAlbumL(index); } } else if( iCurrentViewType == EMPXViewMediawall ) { iSelectedAlbumIndex = index; + iAlbumIndex = index; } } @@ -2573,7 +2626,7 @@ case EContextGroupAlbum: case EContextItemAlbum: { - iconIndex = EMPXClvIconAlbum; + iconIndex = 27; // default album art in mediawall break; } case EContextGroupPodcast: @@ -2931,43 +2984,60 @@ MPX_FUNC( "CMPXCollectionViewHgContainer::SetTitleL" ); - if ( iContext == EContextGroupAlbum || iContext == EContextItemAlbum ) - { - - if ( aMedia->IsSupported( KMPXMediaMusicArtist ) ) - { - const TDesC& title = aMedia->ValueText( KMPXMediaMusicArtist ); - if ( title.Compare( KNullDesC ) != 0 ) - { - aVisualItem->SetTitleL( title ); - } - else - { - HBufC* unknownText = - StringLoader::LoadLC( R_MPX_COLLECTION_UNKNOWN ); - aVisualItem->SetTitleL( *unknownText ); - CleanupStack::PopAndDestroy( unknownText ); - } - } - } - else - { - if ( aMedia->IsSupported( KMPXMediaGeneralTitle ) ) - { - const TDesC& title = aMedia->ValueText( KMPXMediaGeneralTitle ); - if ( title.Compare( KNullDesC ) != 0 ) - { - aVisualItem->SetTitleL( title ); - } - else - { - HBufC* unknownText = - StringLoader::LoadLC( R_MPX_COLLECTION_UNKNOWN ); - aVisualItem->SetTitleL( *unknownText ); - CleanupStack::PopAndDestroy( unknownText ); - } - } - } + if ( iContext == EContextGroupAlbum || iContext == EContextItemAlbum ) + { + if ( aMedia->IsSupported( KMPXMediaMusicArtist ) ) + { + const TDesC& title = aMedia->ValueText( KMPXMediaMusicArtist ); + if ( title.Compare( KNullDesC ) != 0 ) + { + aVisualItem->SetTitleL( title ); + } + else + { + HBufC* unknownText = NULL; + if ( iContext == EContextGroupAlbum ) + { + TBool landscapeOrientation = Layout_Meta_Data::IsLandscapeOrientation(); + if ( landscapeOrientation ) + { + unknownText = + StringLoader::LoadLC( R_MPX_MEDIAWALL_ARTIST_UNKNOWN ); + } + else + { + unknownText = + StringLoader::LoadLC( R_MPX_MP_LIST_ARTIST_UNKNOWN ); + } + } + else + { + unknownText = + StringLoader::LoadLC( R_MPX_MEDIAWALL_ARTIST_UNKNOWN ); + } + aVisualItem->SetTitleL( *unknownText ); + CleanupStack::PopAndDestroy( unknownText ); + } + } + } + else + { + if ( aMedia->IsSupported( KMPXMediaGeneralTitle ) ) + { + const TDesC& title = aMedia->ValueText( KMPXMediaGeneralTitle ); + if ( title.Compare( KNullDesC ) != 0 ) + { + aVisualItem->SetTitleL( title ); + } + else + { + HBufC* unknownText = + StringLoader::LoadLC( R_MPX_COLLECTION_UNKNOWN ); + aVisualItem->SetTitleL( *unknownText ); + CleanupStack::PopAndDestroy( unknownText ); + } + } + } } // ----------------------------------------------------------------------------- @@ -2980,22 +3050,21 @@ { MPX_FUNC( "CMPXCollectionViewHgContainer::SetSongTitleL" ); - - if ( aMedia->IsSupported( KMPXMediaGeneralTitle ) ) - { - const TDesC& title = aMedia->ValueText( KMPXMediaGeneralTitle ); - if ( title.Compare( KNullDesC ) != 0 ) - { - aVisualItem->SetTitleL( title ); - } - else - { - HBufC* unknownText = - StringLoader::LoadLC( R_MPX_COLLECTION_UNKNOWN ); - aVisualItem->SetTitleL( *unknownText ); - CleanupStack::PopAndDestroy( unknownText ); - } - } + if ( aMedia->IsSupported( KMPXMediaGeneralTitle ) ) + { + const TDesC& title = aMedia->ValueText( KMPXMediaGeneralTitle ); + if ( title.Compare( KNullDesC ) != 0 ) + { + aVisualItem->SetTitleL( title ); + } + else + { + HBufC* unknownText = + StringLoader::LoadLC( R_MPX_COLLECTION_UNKNOWN ); + aVisualItem->SetTitleL( *unknownText ); + CleanupStack::PopAndDestroy( unknownText ); + } + } } // ----------------------------------------------------------------------------- @@ -3079,24 +3148,25 @@ CMPXMedia* aMedia ) { MPX_FUNC( "CMPXCollectionViewHgContainer::SetDetailArtistL" ); - if ( aMedia->IsSupported( KMPXMediaMusicArtist ) ) - { - // AK - Needs to be localized - TBuf detailText; - const TDesC& artist = aMedia->ValueText( KMPXMediaMusicArtist ); - if ( artist.Compare( KNullDesC ) != 0 ) - { - detailText.Copy(artist.Left(detailText.MaxLength())); - aVisualItem->SetTextL( detailText ); - } - else - { + + if ( aMedia->IsSupported( KMPXMediaMusicArtist ) ) + { + // AK - Needs to be localized + TBuf detailText; + const TDesC& artist = aMedia->ValueText( KMPXMediaMusicArtist ); + if ( artist.Compare( KNullDesC ) != 0 ) + { + detailText.Copy(artist.Left(detailText.MaxLength())); + aVisualItem->SetTextL( detailText ); + } + else + { HBufC* unknownText = - StringLoader::LoadLC( R_MPX_COLLECTION_UNKNOWN ); - aVisualItem->SetTextL( *unknownText ); + StringLoader::LoadLC( R_MPX_SONGS_ARTIST_UNKNOWN ); + aVisualItem->SetTextL( *unknownText ); CleanupStack::PopAndDestroy( unknownText ); } - } + } } // ----------------------------------------------------------------------------- @@ -3125,9 +3195,27 @@ aVisualItem->SetTextL( detailText ); } else - { - HBufC* unknownText = - StringLoader::LoadLC( R_MPX_COLLECTION_UNKNOWN ); + { + HBufC* unknownText = NULL; + if ( iContext == EContextGroupAlbum ) + { + TBool landscapeOrientation = Layout_Meta_Data::IsLandscapeOrientation(); + if ( landscapeOrientation ) + { + unknownText = + StringLoader::LoadLC( R_MPX_MEDIAWALL_ALBUM_UNKNOWN ); + } + else + { + unknownText = + StringLoader::LoadLC( R_MPX_MP_LIST_ALBUM_UNKNOWN ); + } + } + else + { + unknownText = + StringLoader::LoadLC( R_MPX_MEDIAWALL_ALBUM_UNKNOWN ); + } aVisualItem->SetTextL( *unknownText ); CleanupStack::PopAndDestroy( unknownText ); } @@ -3476,16 +3564,20 @@ CFbsBitmap* bitmap = icon->Bitmap(); CFbsBitmap* mask = icon->Mask(); - TSize size(240,240); + TSize size(CHgDoubleGraphicListFlat::PreferredImageSize()); CHgItem* item = NULL; if( iCurrentViewType == EMPXViewMediawall || iCurrentViewType == EMPXViewTBone ) { item = &iMediaWall->ItemL(0); + TRect appRect = ((CAknAppUi*)iCoeEnv->AppUi())->ApplicationRect(); + // get front rectange from layout + TAknLayoutRect frontRect; + frontRect.LayoutRect( appRect, AknLayoutScalable_Apps::cf0_flow_pane_g1(0) ); + size = frontRect.Rect().Size(); } else if( iCurrentViewType == EMPXViewList ) { item = &iListWidget->ItemL(0); - size = CHgDoubleGraphicListFlat::PreferredImageSize(); } else { @@ -3519,21 +3611,47 @@ 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(); - res = ETrue; - } - - return res; + if ( count > 1 && iContext == EContextGroupAlbum ) + { + TBool landscapeOrientation = Layout_Meta_Data::IsLandscapeOrientation(); + if ( landscapeOrientation ) + { + HBufC* shuffleText = StringLoader::LoadLC( + R_MPX_MEDIAWALL_TITLE_SHUFFLE_ALL ); + aItem->SetTitleL( *shuffleText ); + CleanupStack::PopAndDestroy( shuffleText ); + } + else + { + HBufC* shuffleText = StringLoader::LoadLC( + R_MPX_SHUFFLE ); + aItem->SetTitleL( *shuffleText ); + CleanupStack::PopAndDestroy( shuffleText ); + } + + // We can try to set icon too. + SetDetailIconShuffleL(); + res = ETrue; + } + + if ( count > 1 && + iContext == EContextGroupSong || + iContext == EContextGroupGenre || + iContext == EContextItemPlaylist || + iContext == EContextItemGenre || + iContext == EContextItemSong ) + { + HBufC* shuffleText = StringLoader::LoadLC( + R_MPX_SHUFFLE ); + aItem->SetTitleL( *shuffleText ); + CleanupStack::PopAndDestroy( shuffleText ); + + // We can try to set icon too. + SetDetailIconShuffleL(); + res = ETrue; + } + + return res; } // ----------------------------------------------------------------------------- @@ -3796,8 +3914,6 @@ cpath->AppendL(ids.Array()); // top level items - TBool shuffle(EFalse); - if ( aSelectAll ) // Plays all songs without shuffle { cpath->Set(0); @@ -3808,12 +3924,12 @@ { if ( aIndex == 0 ) // Plays all songs shuffled { - shuffle = ETrue; TTime time; time.UniversalTime(); TInt64 seed = time.Int64(); TInt randIndex = Math::Rand(seed) % count; cpath->Set(randIndex); + iPlaybackUtility->SetL( EPbPropertyRandomMode, ETrue ); } else { @@ -3831,24 +3947,21 @@ TMPXPlaybackState pbState( iPlaybackUtility->StateL() ); if ( pbState == EPbStatePlaying || pbState == EPbStatePaused ) { - if ( IsPlayingCurrentIndexL(cpath) && !shuffle ) + if ( IsPlayingCurrentIndexL(cpath) ) { if ( pbState == EPbStatePaused ) { iPlaybackUtility->CommandL( EPbCmdPlay ); } - iPlaybackUtility->SetL( EPbPropertyRandomMode, EFalse ); - iView->ProcessCommandL( EMPXCmdGoToNowPlaying ); + iView->ProcessCommandL( EMPXCmdGoToNowPlaying ); } else { - iPlaybackUtility->SetL( EPbPropertyRandomMode, shuffle ); - iCollectionUtility->Collection().OpenL(*cpath); + iCollectionUtility->Collection().OpenL(*cpath); } } else { - iPlaybackUtility->SetL( EPbPropertyRandomMode, shuffle ); iCollectionUtility->Collection().OpenL(*cpath); } @@ -3940,7 +4053,6 @@ { iPlaybackUtility->CommandL( EPbCmdPlay ); } - iPlaybackUtility->SetL( EPbPropertyRandomMode, EFalse ); iView->ProcessCommandL( EMPXCmdGoToNowPlaying ); } else @@ -4314,6 +4426,13 @@ { dialog->SetTitleL( album ); } + else + { + HBufC* unknownText = + StringLoader::LoadLC( R_MPX_MEDIAWALL_POPUP_TITLE_UNKNOWN ); + dialog->SetTitleL( *unknownText ); + CleanupStack::PopAndDestroy( unknownText ); + } } CMPXMediaArray* songArray(const_cast( aResults.Value( @@ -4325,8 +4444,10 @@ if ( songCount > 1 ) { - // Todo: Use localized string. - songList->AppendL( _L("Shuffle All") ); + HBufC* shuffleText = StringLoader::LoadLC( + R_MPX_MEDIAWALL_DIALOG_SHUFFLE ); + songList->AppendL( *shuffleText ); + CleanupStack::PopAndDestroy( shuffleText ); } for ( TInt i = 0; i < songCount; i++ ) @@ -4730,7 +4851,7 @@ TInt index(aIndex); - if ( iShuffleItem ) + if ( iShuffleItem && aIndex != KErrNotFound ) { index = aIndex - 1; } @@ -4769,8 +4890,7 @@ if ( iContext == EContextGroupAlbum ) { - TInt resId = R_MPX_COLLECTION_ALBUM_LBX_EMPTYTEXT; - HBufC* emptyText = StringLoader::LoadLC( resId ); + HBufC* emptyText = StringLoader::LoadLC( R_MPX_VMP_NO_ALBUMS ); SetLbxEmptyTextL( *emptyText ); CleanupStack::PopAndDestroy( emptyText ); } diff -r 171e07ac910f -r c8156a91d13c mpxplugins/viewplugins/views/collectionviewhg/src/mpxcollectionviewhgimp.cpp --- a/mpxplugins/viewplugins/views/collectionviewhg/src/mpxcollectionviewhgimp.cpp Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/viewplugins/views/collectionviewhg/src/mpxcollectionviewhgimp.cpp Wed Mar 31 21:26:33 2010 +0300 @@ -586,13 +586,12 @@ // } CleanupStack::PopAndDestroy(musicStoreJavaName); - TInt retval2(KErrNone); // P/S key for usb unblocking - retval2 = RProperty::Define( KMPXViewPSUid, - KMPXUSBUnblockingPSStatus, - RProperty::EInt, - KMPlayerRemoteReadPolicy, - KMPlayerRemoteWritePolicy ); + RProperty::Define( KMPXViewPSUid, + KMPXUSBUnblockingPSStatus, + RProperty::EInt, + KMPlayerRemoteReadPolicy, + KMPlayerRemoteWritePolicy ); TInt usbStatus; RProperty::Get(KPSUidUsbWatcher, KUsbWatcherSelectedPersonality, usbStatus); @@ -2747,7 +2746,8 @@ CMPXCollectionViewListBoxArray* array = static_cast( baseArray ); TInt selectionCount( 0 ); - if ( iSelectionIndexCache) + iSelectionIndexCache = iContainer->CurrentSelectionIndicesL(); + if ( iSelectionIndexCache ) { selectionCount = iSelectionIndexCache->Count(); } @@ -4376,7 +4376,7 @@ // embedded playlist view iContainer->EnableMarking( ETrue ); menuBar->SetMenuTitleResourceId( R_MPX_COLLECTION_VIEW_MENUBAR_EMBEDDED_PLAYLIST_VIEW ); - resId = R_MPX_COLLECTION_SONG_LBX_EMPTYTEXT; + resId = R_MPX_VMP_NO_SONGS; #ifdef __ENABLE_MSK mskId = R_QTN_MSK_PLAY; #endif // __ENABLE_MSK @@ -4422,7 +4422,7 @@ case EMPXAlbum: { // album view - resId = R_MPX_COLLECTION_ALBUM_LBX_EMPTYTEXT; + resId = R_MPX_VMP_NO_ALBUMS; break; } case EMPXGenre: @@ -4455,7 +4455,7 @@ // tracks view iContainer->EnableMarking( EFalse ); menuBar->SetMenuTitleResourceId( R_MPX_COLLECTION_VIEW_MENUBAR_NO_MARKING ); - resId = R_MPX_COLLECTION_SONG_LBX_EMPTYTEXT; + resId = R_MPX_VMP_NO_SONGS; #ifdef __ENABLE_MSK mskId = R_QTN_MSK_PLAY; #endif // __ENABLE_MSK @@ -5565,7 +5565,7 @@ case EMPXCmdMusicLibraryDetails: { iCurrentMediaLOp = EMPXOpMediaLCollectionDetails; - CMPXCollectionPath* path = iCollectionUtility->Collection().PathL(); + CMPXCollectionPath* path = iCollectionUiHelper->MusicMenuPathL(); CleanupStack::PushL( path ); RArray attrs; CleanupClosePushL( attrs ); @@ -5742,35 +5742,49 @@ iContainer->ListBoxArray(); if ( iContainer->CurrentListItemCount() > 0 ) { - TInt currentItem( - iContainer->CurrentLbxItemIndex() ); - const CMPXMedia& media = listboxArray->MediaL( currentItem ); - TMPXGeneralType type( - media.ValueTObjectL( KMPXMediaGeneralType ) ); - TMPXGeneralCategory category( - media.ValueTObjectL( KMPXMediaGeneralCategory ) ); - if ( category == EMPXPlaylist && type == EMPXItem ) + TInt currentItem( iContainer->CurrentLbxItemIndex() ); + MPX_DEBUG2( "CMPXCollectionViewHgImp::HandleCommandL currentItem %d", currentItem ); + if (currentItem == KErrNotFound) { - MPX_DEBUG1( "CMPXCollectionViewHgImp::HandleCommandL checking item count in playlist" ); + // no item selected + // start playing previous playlist + if ( iPlaybackUtility->Source() ) + { + iPlaybackUtility->CommandL( EPbCmdPlay ); + HandleCommandL( EMPXCmdGoToNowPlaying ); + } isReady = EFalse; - TMPXItemId id( - media.ValueTObjectL( KMPXMediaGeneralId ) ); - CMPXMedia* entry = CMPXMedia::NewL(); - CleanupStack::PushL( entry ); - entry->SetTObjectValueL( - KMPXMediaGeneralType, EMPXGroup ); - entry->SetTObjectValueL( - KMPXMediaGeneralCategory, EMPXSong ); - entry->SetTObjectValueL( - KMPXMediaGeneralId, id ); - iCurrentFindAllLOp = EMPXOpFindAllLPlaylistTracksCount; - RArray attrs; - CleanupClosePushL( attrs ); - attrs.Append( KMPXMediaGeneralId ); - iCollectionUtility->Collection().FindAllL( - *entry, attrs.Array(), *this ); - CleanupStack::PopAndDestroy( &attrs ); - CleanupStack::PopAndDestroy( entry ); + } + else + { + const CMPXMedia& media = listboxArray->MediaL( currentItem ); + TMPXGeneralType type( + media.ValueTObjectL( KMPXMediaGeneralType ) ); + TMPXGeneralCategory category( + media.ValueTObjectL( KMPXMediaGeneralCategory ) ); + if ( category == EMPXPlaylist && type == EMPXItem ) + { + MPX_DEBUG1( "CMPXCollectionViewHgImp::HandleCommandL checking item count in playlist" ); + isReady = EFalse; + TMPXItemId id( + media.ValueTObjectL( KMPXMediaGeneralId ) ); + CMPXMedia* entry = CMPXMedia::NewL(); + CleanupStack::PushL( entry ); + entry->SetTObjectValueL( + KMPXMediaGeneralType, EMPXGroup ); + entry->SetTObjectValueL( + KMPXMediaGeneralCategory, EMPXSong ); + entry->SetTObjectValueL( + KMPXMediaGeneralId, id ); + iCurrentFindAllLOp = EMPXOpFindAllLPlaylistTracksCount; + RArray attrs; + CleanupClosePushL( attrs ); + attrs.Append( KMPXMediaGeneralId ); + iCollectionUtility->Collection().FindAllL( + *entry, attrs.Array(), *this ); + CleanupStack::PopAndDestroy( &attrs ); + CleanupStack::PopAndDestroy( entry ); + } } } else @@ -6119,6 +6133,10 @@ isHidden = pdPlaybackUtility->Source() ? EFalse : ETrue; pdPlaybackUtility->Close(); } + else + { + isHidden = EFalse; + } return isHidden; } @@ -6239,9 +6257,9 @@ case R_MPX_COLLECTION_VIEW_MENU_1: { HandleInitMusicMenuPaneL(aMenuPane); + aMenuPane->SetItemDimmed( EMPXCmdGoToNowPlaying, NowPlayingOptionVisibilityL() ); if ( isListEmpty ) { - aMenuPane->SetItemDimmed( EMPXCmdGoToNowPlaying, ETrue ); aMenuPane->SetItemDimmed( EMPXCmdFind, ETrue ); aMenuPane->SetItemDimmed( EMPXCmdUpnpPlayVia, ETrue ); aMenuPane->SetItemDimmed( EMPXCmdUPnPAiwCmdCopyToExternalCriteria, ETrue ); @@ -6257,7 +6275,6 @@ } else { - aMenuPane->SetItemDimmed( EMPXCmdGoToNowPlaying, NowPlayingOptionVisibilityL() ); aMenuPane->SetItemDimmed( EMPXCmdFind, ETrue ); aMenuPane->SetItemDimmed( EMPXCmdUpnpPlayVia, ETrue ); aMenuPane->SetItemDimmed( EMPXCmdUPnPAiwCmdCopyToExternalCriteria, ETrue ); @@ -6563,8 +6580,7 @@ aMenuPane->SetItemDimmed( EMPXCmdRename, ETrue ); aMenuPane->SetItemDimmed( EMPXCmdAlbumArt, ETrue ); aMenuPane->SetItemDimmed( EMPXCmdPlaylistDetails, ETrue ); - - aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, !iUsingNokiaService ); + aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, ETrue ); break; } case R_MPX_ADD_TO_PL_SUB_MENU: @@ -6600,9 +6616,9 @@ case R_MPX_COLLECTION_VIEW_MENU_1: { HandleInitMusicMenuPaneL(aMenuPane); + aMenuPane->SetItemDimmed( EMPXCmdGoToNowPlaying, NowPlayingOptionVisibilityL() ); if ( isListEmpty ) { - aMenuPane->SetItemDimmed( EMPXCmdGoToNowPlaying, ETrue ); aMenuPane->SetItemDimmed( EMPXCmdFind, ETrue ); aMenuPane->SetItemDimmed( EMPXCmdUpnpPlayVia, ETrue ); aMenuPane->SetItemDimmed( EMPXCmdUPnPAiwCmdCopyToExternalCriteria, ETrue ); @@ -6618,7 +6634,6 @@ } else { - aMenuPane->SetItemDimmed( EMPXCmdGoToNowPlaying, NowPlayingOptionVisibilityL() ); aMenuPane->SetItemDimmed( EMPXCmdFind, ETrue ); aMenuPane->SetItemDimmed( EMPXCmdUpnpPlayVia, ETrue ); aMenuPane->SetItemDimmed( EMPXCmdUPnPAiwCmdCopyToExternalCriteria, ETrue ); @@ -6747,10 +6762,9 @@ case R_MPX_COLLECTION_VIEW_MENU_1: { HandleInitMusicMenuPaneL(aMenuPane); - + aMenuPane->SetItemDimmed( EMPXCmdGoToNowPlaying, NowPlayingOptionVisibilityL() ); if ( isListEmpty ) { - aMenuPane->SetItemDimmed( EMPXCmdGoToNowPlaying, ETrue ); aMenuPane->SetItemDimmed( EMPXCmdFind, ETrue ); aMenuPane->SetItemDimmed( EMPXCmdUpnpPlayVia, ETrue ); aMenuPane->SetItemDimmed( EMPXCmdUPnPAiwCmdCopyToExternalCriteria, ETrue ); @@ -6765,7 +6779,6 @@ } else { - aMenuPane->SetItemDimmed( EMPXCmdGoToNowPlaying, NowPlayingOptionVisibilityL() ); aMenuPane->SetItemDimmed( EMPXCmdUpnpPlayVia, ETrue ); aMenuPane->SetItemDimmed( EMPXCmdUPnPAiwCmdCopyToExternalCriteria, ETrue ); aMenuPane->SetItemDimmed( EMPXCmdFind, ETrue ); diff -r 171e07ac910f -r c8156a91d13c mpxplugins/viewplugins/views/collectionviewhg/src/mpxcollectionviewhglistboxarray.cpp --- a/mpxplugins/viewplugins/views/collectionviewhg/src/mpxcollectionviewhglistboxarray.cpp Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/viewplugins/views/collectionviewhg/src/mpxcollectionviewhglistboxarray.cpp Wed Mar 31 21:26:33 2010 +0300 @@ -477,7 +477,7 @@ #ifdef __ENABLE_PODCAST_IN_MUSIC_MENU // Prepare icon array for listbox - CAknIconArray* iconArray = new ( ELeave ) CAknIconArray( 27 ); // magic: array granularity + CAknIconArray* iconArray = new ( ELeave ) CAknIconArray( 28 ); // magic: array granularity #else // Prepare icon array for listbox CAknIconArray* iconArray = new ( ELeave ) CAknIconArray( 26 ); // magic: array granularity @@ -675,6 +675,13 @@ iconFile, EMbmMpxcollectionviewhgQgn_graf_mup_npv_icon_shuffle, EMbmMpxcollectionviewhgQgn_graf_mup_npv_icon_shuffle_mask ); + AppendColorIconToArrayL( iconArray, + KAknsIIDNone, + KAknsIIDNone, + EAknsMinorNone, + iconFile, + EMbmMpxcollectionviewhgQgn_prop_albumart_large, + EMbmMpxcollectionviewhgQgn_prop_albumart_large_mask ); return iconArray; } diff -r 171e07ac910f -r c8156a91d13c mpxplugins/viewplugins/views/collectionviewhg/src/mpxcollectionviewhgplaylisthelper.cpp --- a/mpxplugins/viewplugins/views/collectionviewhg/src/mpxcollectionviewhgplaylisthelper.cpp Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/viewplugins/views/collectionviewhg/src/mpxcollectionviewhgplaylisthelper.cpp Wed Mar 31 21:26:33 2010 +0300 @@ -172,20 +172,20 @@ if (!iIsInitializing) { + if (aEnableShuffle) + { + TTime time; + time.UniversalTime(); + TInt64 seed = time.Int64(); + TInt randIndex = Math::Rand(seed) % aPath.Count(); + aPath.Set(randIndex); + } + CMPXCollectionPlaylist* playlist = CMPXCollectionPlaylist::NewL( aPath ); CleanupStack::PushL( playlist ); - - if (aEnableShuffle) - { - TTime time; - time.UniversalTime(); - TInt64 seed = time.Int64(); - TInt randIndex = Math::Rand(seed) % aPath.Count(); - aPath.Set(randIndex); - playlist->SetShuffleEnabledL( aEnableShuffle ); - iPlaybackUtility->SetL( EPbPropertyRandomMode, aEnableShuffle ); - } + playlist->SetShuffleEnabledL( aEnableShuffle ); + iPlaybackUtility->SetL( EPbPropertyRandomMode, aEnableShuffle ); iPlaybackUtility->InitL( *playlist, ETrue ); CleanupStack::PopAndDestroy( playlist ); diff -r 171e07ac910f -r c8156a91d13c mpxplugins/viewplugins/views/commonplaybackview/bwinscw/mpxcommonplaybackviewU.DEF --- a/mpxplugins/viewplugins/views/commonplaybackview/bwinscw/mpxcommonplaybackviewU.DEF Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/viewplugins/views/commonplaybackview/bwinscw/mpxcommonplaybackviewU.DEF Wed Mar 31 21:26:33 2010 +0300 @@ -109,4 +109,5 @@ ?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) + ?LaunchFileDetailsDialogL@CMPXCommonPlaybackViewImp@@MAEXXZ @ 111 NONAME ; void CMPXCommonPlaybackViewImp::LaunchFileDetailsDialogL(void) diff -r 171e07ac910f -r c8156a91d13c mpxplugins/viewplugins/views/commonplaybackview/data/mpxcommonplaybackview.rss --- a/mpxplugins/viewplugins/views/commonplaybackview/data/mpxcommonplaybackview.rss Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/viewplugins/views/commonplaybackview/data/mpxcommonplaybackview.rss Wed Mar 31 21:26:33 2010 +0300 @@ -107,6 +107,11 @@ }, MENU_ITEM { + command = EMPXPbvCmdSongDetails; + txt = qtn_mus_options_details_track; + }, + MENU_ITEM + { command = EMPXPbvCmdFMTransmitter; txt = qtn_nmp_go_to_fm_transmitter; }, diff -r 171e07ac910f -r c8156a91d13c mpxplugins/viewplugins/views/commonplaybackview/eabi/mpxcommonplaybackviewU.DEF --- a/mpxplugins/viewplugins/views/commonplaybackview/eabi/mpxcommonplaybackviewU.DEF Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/viewplugins/views/commonplaybackview/eabi/mpxcommonplaybackviewU.DEF Wed Mar 31 21:26:33 2010 +0300 @@ -148,4 +148,4 @@ _ZThn96_N25CMPXCommonPlaybackViewImp18HandleLayoutChangeEv @ 147 NONAME _ZN31CMPXCommonPlaybackViewContainer18LightStatusChangedEiN10CHWRMLight12TLightStatusE @ 148 NONAME _ZThn60_N31CMPXCommonPlaybackViewContainer18LightStatusChangedEiN10CHWRMLight12TLightStatusE @ 149 NONAME - + _ZN25CMPXCommonPlaybackViewImp24LaunchFileDetailsDialogLEv @ 150 NONAME diff -r 171e07ac910f -r c8156a91d13c mpxplugins/viewplugins/views/commonplaybackview/group/mpxcommonplaybackview.mmp --- a/mpxplugins/viewplugins/views/commonplaybackview/group/mpxcommonplaybackview.mmp Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/viewplugins/views/commonplaybackview/group/mpxcommonplaybackview.mmp Wed Mar 31 21:26:33 2010 +0300 @@ -117,6 +117,7 @@ LIBRARY touchfeedback.lib LIBRARY HWRMLightClient.lib //light status +LIBRARY tvoutconfig.lib ALWAYS_BUILD_AS_ARM OPTION ARMCC -O3 -Otime diff -r 171e07ac910f -r c8156a91d13c mpxplugins/viewplugins/views/commonplaybackview/loc/mpxcommonplaybackview.loc --- a/mpxplugins/viewplugins/views/commonplaybackview/loc/mpxcommonplaybackview.loc Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/viewplugins/views/commonplaybackview/loc/mpxcommonplaybackview.loc Wed Mar 31 21:26:33 2010 +0300 @@ -228,4 +228,16 @@ // #define qtn_mus_options_go_to_podcast_menu "Go to Podcast Menu" +// d:Options menu item for opening Track details popup. +// l:list_single_pane_t1_cp2/opt1 +// r:5.0 +// +#define qtn_mus_options_details_track "Song details" + +// d:Options menu item for opening Episode details popup. +// l:list_single_pane_t1_cp2/opt1 +// r:5.0 +// +#define qtn_mus_options_details_episode "Episode details" + // End of File diff -r 171e07ac910f -r c8156a91d13c mpxplugins/viewplugins/views/commonplaybackview/src/mpxcommonplaybackviewcontainer.cpp --- a/mpxplugins/viewplugins/views/commonplaybackview/src/mpxcommonplaybackviewcontainer.cpp Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/viewplugins/views/commonplaybackview/src/mpxcommonplaybackviewcontainer.cpp Wed Mar 31 21:26:33 2010 +0300 @@ -168,7 +168,8 @@ UpdateProgressBarGraphics(); iMode = EUninitialized; - iLabels[ETextDownloadState]->MakeVisible( ETrue ); + // suppress download text per UI spec + iLabels[ETextDownloadState]->MakeVisible( EFalse ); iLabels[ETextArtist]->MakeVisible( EFalse ); iLabels[ETextTrack]->MakeVisible( EFalse ); iLabels[ETextElapsedTime]->MakeVisible( EFalse ); @@ -331,6 +332,7 @@ CMPXPlaybackViewInfoLabel* label = iLabels[aLabel]; if(aLabel == ETextDownloadState) { + /* iSliderPaneRect = iLayout->IndicatorLayout( Rect(), ESliderPane ); iLayout->LayoutLabel( iLabels[ETextDownloadState], iSliderPaneRect, ETextDownloadState ); @@ -348,6 +350,9 @@ *iLabels[ETextDownloadState], EColorLabelText, color ); + */ + // suppress download text per UI spec. + return; } if ( label ) { @@ -381,7 +386,7 @@ case EUninitialized: { // Set label visibility - iLabels[ETextDownloadState]->MakeVisible( ETrue ); + //iLabels[ETextDownloadState]->MakeVisible( EFalse ); iLabels[ETextArtist]->MakeVisible( ETrue ); iLabels[ETextTrack]->MakeVisible( ETrue ); //iLabels[ETextEmpty]->MakeVisible( EFalse ); @@ -392,7 +397,7 @@ case ENoTracksMode: { // Set label visibility - iLabels[ETextDownloadState]->MakeVisible( ETrue ); + //iLabels[ETextDownloadState]->MakeVisible( ETrue ); iLabels[ETextArtist]->MakeVisible( EFalse ); iLabels[ETextTrack]->MakeVisible( EFalse ); //iLabels[ETextEmpty]->MakeVisible( ETrue ); @@ -404,7 +409,7 @@ case EStopMode: { // Fixed the layout for Download label and time label are overlaped in position - iLabels[ETextDownloadState]->MakeVisible( EFalse ); + //iLabels[ETextDownloadState]->MakeVisible( EFalse ); iLabels[ETextTrack]->MakeVisible( ETrue ); iLabels[ETextArtist]->MakeVisible( ETrue ); //iLabels[ETextEmpty]->MakeVisible( EFalse ); @@ -414,7 +419,7 @@ } case EInitialising: { - iLabels[ETextDownloadState]->MakeVisible( ETrue ); + //iLabels[ETextDownloadState]->MakeVisible( ETrue ); iLabels[ETextTrack]->MakeVisible( ETrue ); iLabels[ETextArtist]->MakeVisible( ETrue ); //iLabels[ETextEmpty]->MakeVisible( EFalse ); @@ -424,7 +429,7 @@ } case EMediaKeySkipping: { - iLabels[ETextDownloadState]->MakeVisible( ETrue ); + //iLabels[ETextDownloadState]->MakeVisible( ETrue ); iLabels[ETextTrack]->MakeVisible( ETrue ); iLabels[ETextArtist]->MakeVisible( ETrue ); //iLabels[ETextEmpty]->MakeVisible( EFalse ); @@ -434,7 +439,7 @@ } case EInvalidMode: { - iLabels[ETextDownloadState]->MakeVisible( EFalse ); + //iLabels[ETextDownloadState]->MakeVisible( EFalse ); iLabels[ETextTrack]->MakeVisible( EFalse ); iLabels[ETextArtist]->MakeVisible( EFalse ); //iLabels[ETextEmpty]->MakeVisible( EFalse ); @@ -446,7 +451,7 @@ case EBufferingMode: { // Set label visibility - iLabels[ETextDownloadState]->MakeVisible( EFalse ); + //iLabels[ETextDownloadState]->MakeVisible( EFalse ); iLabels[ETextArtist]->MakeVisible( ETrue ); iLabels[ETextTrack]->MakeVisible( ETrue ); //iLabels[ETextEmpty]->MakeVisible( EFalse ); @@ -457,7 +462,7 @@ default: { // Set label visibility - iLabels[ETextDownloadState]->MakeVisible( EFalse ); + //iLabels[ETextDownloadState]->MakeVisible( EFalse ); iLabels[ETextArtist]->MakeVisible( ETrue ); iLabels[ETextTrack]->MakeVisible( ETrue ); //iLabels[ETextEmpty]->MakeVisible( EFalse ); @@ -1473,8 +1478,9 @@ iLabels[ETextPlaylistCount], myRect, ETextPlaylistCount ); //iLayout->LayoutLabel( // iLabels[ETextEmpty], myRect, ETextEmpty ); - iLayout->LayoutLabel( - iLabels[ETextDownloadState], iSliderPaneRect, ETextDownloadState ); + // suppress download text per UI spec + //iLayout->LayoutLabel( + // iLabels[ETextDownloadState], iSliderPaneRect, ETextDownloadState ); if ( iFMTXMode ) { diff -r 171e07ac910f -r c8156a91d13c mpxplugins/viewplugins/views/commonplaybackview/src/mpxcommonplaybackviewimp.cpp --- a/mpxplugins/viewplugins/views/commonplaybackview/src/mpxcommonplaybackviewimp.cpp Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/viewplugins/views/commonplaybackview/src/mpxcommonplaybackviewimp.cpp Wed Mar 31 21:26:33 2010 +0300 @@ -182,7 +182,7 @@ User::LeaveIfError( MPXUser::CompleteWithDllPath( resourceFile ) ); BaflUtils::NearestLanguageFile( coeEnv->FsSession(), resourceFile ); iResourceOffset = coeEnv->AddResourceFileL( resourceFile ); - + iTvOutConfig = CTvOutConfig::NewL() ; if ( FeatureManager::FeatureSupported( KFeatureIdFmtx ) ) { parse.Set( KMPXFMTXRscPath, &KDC_APP_RESOURCE_DIR, NULL ); @@ -483,6 +483,10 @@ iTNRequestTimer->Cancel(); delete iTNRequestTimer; } + if(iTvOutConfig) + { + delete iTvOutConfig; + } MPX_DEBUG1( "CMPXCommonPlaybackViewImp::~CMPXCommonPlaybackViewImp exiting" ); } @@ -2164,6 +2168,11 @@ // Status pane has to be modified before view gets deactivated break; } + case EMPXPbvCmdSongDetails: + { + LaunchFileDetailsDialogL(); + break; + } case EMPXPbvCmdPlay: { if ( iEmbedded ) @@ -2759,6 +2768,8 @@ iContainer->RestoreButtons( iPlaybackState ); iPlaybackUtility->CommandL( EPbCmdStopSeeking ); } + + aMenuPane->SetItemDimmed( EMPXPbvCmdAddToPlaylist, ETrue ); if ( !iMedia ) { aMenuPane->SetItemDimmed( @@ -2780,9 +2791,6 @@ EMPXPbvCmdOpenMusicSettings, ETrue ); aMenuPane->SetItemDimmed( - EMPXPbvCmdAddToPlaylist, - ETrue ); - aMenuPane->SetItemDimmed( EMPXPbvCmdUseAsCascade, ETrue ); } @@ -2817,14 +2825,6 @@ CleanupStack::PopAndDestroy( playlist ); } } - if ( usbUnblockingStatus == EMPXUSBUnblockingPSStatusActive ) - { - aMenuPane->SetItemDimmed( EMPXPbvCmdAddToPlaylist, ETrue ); - } - else - { - aMenuPane->SetItemDimmed( EMPXPbvCmdAddToPlaylist, addToPlDimmed ); - } TBool isOfflineMode( EFalse ); TBool isFormatNotSupported( EFalse ); if ( !isOfflineMode && iMedia ) @@ -2885,6 +2885,7 @@ { return; } + aMenuPane->SetItemDimmed( EMPXPbvCmdOpenMusicSettings, iTvOutConfig->HdmiCableConnected()); } break; } @@ -4053,5 +4054,33 @@ return KErrNone; } + +// --------------------------------------------------------------------------- +// Launch Metadata Dialog to show the file details +// --------------------------------------------------------------------------- +// +EXPORT_C void CMPXCommonPlaybackViewImp::LaunchFileDetailsDialogL() + { + MMPXSource* s = iPlaybackUtility->Source(); + TInt count (0); + TInt index (0); + if ( s ) + { + CMPXCollectionPlaylist* playlist = s->PlaylistL(); + if ( playlist ) + { + count = playlist->Count(); + index = playlist->PathIndex( playlist->Index() ); + delete playlist; + playlist = NULL; + } + } + HBufC* buf = HBufC::NewLC( 5 ); // magic number, array granularity + buf->Des().AppendNum( index); + + // Activate Metadata dialog via View Framework + iViewUtility->ActivateViewL( TUid::Uid(KMPXPluginTypeMetadataEditorUid), buf ); + CleanupStack::PopAndDestroy(buf); + } // End of File diff -r 171e07ac910f -r c8156a91d13c mpxplugins/viewplugins/views/inc/mpxcommonplaybackview.hrh --- a/mpxplugins/viewplugins/views/inc/mpxcommonplaybackview.hrh Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/viewplugins/views/inc/mpxcommonplaybackview.hrh Wed Mar 31 21:26:33 2010 +0300 @@ -43,6 +43,7 @@ EMPXPbvCmdRandom, EMPXPbvCmdRandomOn, EMPXPbvCmdRandomOff, + EMPXPbvCmdSongDetails, EMPXPbvCmdPosition, EMPXPbvCmdSetAsRngTone, EMPXPbvCmdAiwCmdAssign, diff -r 171e07ac910f -r c8156a91d13c mpxplugins/viewplugins/views/metadataeditordialog/data/mpxmetadataeditordialog.rss --- a/mpxplugins/viewplugins/views/metadataeditordialog/data/mpxmetadataeditordialog.rss Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/viewplugins/views/metadataeditordialog/data/mpxmetadataeditordialog.rss Wed Mar 31 21:26:33 2010 +0300 @@ -1545,4 +1545,22 @@ }; } +RESOURCE DLG_LINE r_mpx_cui_licence_info + { + type=EEikCtEdwin; + prompt = qtn_nmp_song_details_licences ; + id= EMPXMetadataEditorDlgCtrlIdDRMDetail ; + control = EDWIN + { + flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable ; + width = KMPXSongDetailsTextWidth; + lines = KMPXSongDetailsTextLines; + maxlength = KMPXSongDetailsTextMaxLen; + max_view_height_in_lines = 6; + base_line_delta = 21; + }; + } + +RESOURCE TBUF r_mpx_cui_licence_det_link { buf = qtn_nmp_song_details_licences_details; } + // End of File diff -r 171e07ac910f -r c8156a91d13c mpxplugins/viewplugins/views/metadataeditordialog/group/mpxmetadataeditordialog.mmp --- a/mpxplugins/viewplugins/views/metadataeditordialog/group/mpxmetadataeditordialog.mmp Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/viewplugins/views/metadataeditordialog/group/mpxmetadataeditordialog.mmp Wed Mar 31 21:26:33 2010 +0300 @@ -75,4 +75,6 @@ LIBRARY mpxcommon.lib LIBRARY centralrepository.lib +LIBRARY drmuihandling.lib + // End of File diff -r 171e07ac910f -r c8156a91d13c mpxplugins/viewplugins/views/metadataeditordialog/inc/mpxmetadataeditordialog.hrh --- a/mpxplugins/viewplugins/views/metadataeditordialog/inc/mpxmetadataeditordialog.hrh Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/viewplugins/views/metadataeditordialog/inc/mpxmetadataeditordialog.hrh Wed Mar 31 21:26:33 2010 +0300 @@ -56,6 +56,7 @@ EMPXMetadataEditorDlgCtrlIdLastModified, EMPXMetadataEditorDlgCtrlIdCopyright, EMPXMetadataEditorDlgCtrlIdWebaddress, + EMPXMetadataEditorDlgCtrlIdDRMDetail, EMPXMetadataEditorDlgCtrlIdLastPlayedPosition, EMPXMetadataEditorDlgCtrlIdLastPublished, EMPXMetadataEditorDlgCtrlIdGenre // Genre has to be the last item in this enum (for popup field items) diff -r 171e07ac910f -r c8156a91d13c mpxplugins/viewplugins/views/metadataeditordialog/loc/mpxmetadataeditordialog.loc --- a/mpxplugins/viewplugins/views/metadataeditordialog/loc/mpxmetadataeditordialog.loc Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/viewplugins/views/metadataeditordialog/loc/mpxmetadataeditordialog.loc Wed Mar 31 21:26:33 2010 +0300 @@ -569,4 +569,18 @@ // r:3.1 // #define qtn_mp_details_playback_complete "Playback complete" + +// d:Metadata editing prompt text. +// d:Licence name prompt. +// l:form_field_data_wide_pane_t1 +// r:5.2 +// +#define qtn_nmp_song_details_licences "Licences" + +// d:Text shown in File Details to launch DRM file detail popup +// l:list_form_graphic_pane_t1 +// r:5.2 +// +#define qtn_nmp_song_details_licences_details "Click for details" + // End of File diff -r 171e07ac910f -r c8156a91d13c mpxplugins/viewplugins/views/metadataeditordialog/src/mpxmetadataeditordialog.cpp --- a/mpxplugins/viewplugins/views/metadataeditordialog/src/mpxmetadataeditordialog.cpp Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/viewplugins/views/metadataeditordialog/src/mpxmetadataeditordialog.cpp Wed Mar 31 21:26:33 2010 +0300 @@ -74,6 +74,8 @@ #include "mpxmetadataeditordialog.hrh" #include "mpxmetadataeditordialog.hlp.hrh" #include "mpxlog.h" +#include + // CONSTANTS const TInt KMPXFileDetailsMaxTitleLen = 32; @@ -233,6 +235,10 @@ { iEikonEnv->DeleteResourceFile( iDrmResourceOffset ); } + if(iDrmUiHandler) + { + delete iDrmUiHandler; + } } // ---------------------------------------------------------------------------- @@ -513,6 +519,9 @@ repository->Get( KMPXMPLocalVariation, val ); iDisablePodcasting = val&KMPXDisablePodcastingOption ? ETrue : EFalse; delete repository; + + //DRM information popup + iDrmUiHandler = DRM::CDrmUiHandling::NewL(); } // ----------------------------------------------------------------------------- @@ -2409,18 +2418,16 @@ if ( aType == EEventKey ) { - switch ( aKeyEvent.iScanCode ) + if (aKeyEvent.iScanCode && (aKeyEvent.iScanCode == EStdKeyUpArrow + || aKeyEvent.iScanCode == EStdKeyDownArrow)) { - case EStdKeyUpArrow: - case EStdKeyDownArrow: - { - UpdateSoftkeyL(); - break; - } - default: - { - break; - } + UpdateSoftkeyL(); + } + + else if ((aKeyEvent.iCode == EKeyOK || aKeyEvent.iCode == EKeyEnter) + && (IdOfFocusControl() == EMPXMetadataEditorDlgCtrlIdDRMDetail)) + { + LaunchDrmInfoL(); } } @@ -2844,7 +2851,11 @@ if (drmProtected) { - //TODO: Pending for UI Spec and localisation + HBufC* detail = StringLoader::LoadLC( R_MPX_CUI_LICENCE_DET_LINK ); + InsertLineL(9,R_MPX_CUI_LICENCE_INFO,ActivePageId() ); + SetControlTextL(EMPXMetadataEditorDlgCtrlIdDRMDetail, detail->Des(), + KNullDesC); + CleanupStack::PopAndDestroy( detail ); } // Get filename @@ -3116,4 +3127,24 @@ } } +// ----------------------------------------------------------------------------- +// CMPXMetadataEditorDialog::LaunchDrmInfoL +// ----------------------------------------------------------------------------- +// +void CMPXMetadataEditorDialog::LaunchDrmInfoL() + + { + MPX_FUNC( "CMPXMetadataEditorDialog::LaunchDrmInfoL" ); + const TDesC& aFileName = iMedia->ValueText(KMPXMediaGeneralUri); + RFs fs; + User::LeaveIfError( fs.Connect() ); + CleanupClosePushL( fs ); + RFile64 drmFile; + User::LeaveIfError( drmFile.Open( + fs, aFileName, EFileRead | EFileShareReadersOrWriters ) ); + CleanupClosePushL( drmFile ); + iDrmUiHandler->ShowDetailsViewL( drmFile ); + CleanupStack::PopAndDestroy( &drmFile ); + CleanupStack::PopAndDestroy( &fs ); + } // End of File diff -r 171e07ac910f -r c8156a91d13c mpxplugins/viewplugins/views/podcastplaybackview/data/mpxpodcastplaybackview.rss --- a/mpxplugins/viewplugins/views/podcastplaybackview/data/mpxpodcastplaybackview.rss Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/viewplugins/views/podcastplaybackview/data/mpxpodcastplaybackview.rss Wed Mar 31 21:26:33 2010 +0300 @@ -91,6 +91,11 @@ { command = EMPXPbvCmdGoToPodcastMenu; txt = qtn_mus_options_go_to_podcast_menu; + }, + MENU_ITEM + { + command = EMPXPbvCmdPodcastDetails; + txt = qtn_mus_options_details_episode; } }; } diff -r 171e07ac910f -r c8156a91d13c mpxplugins/viewplugins/views/podcastplaybackview/inc/mpxpodcastplaybackview.hrh --- a/mpxplugins/viewplugins/views/podcastplaybackview/inc/mpxpodcastplaybackview.hrh Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/viewplugins/views/podcastplaybackview/inc/mpxpodcastplaybackview.hrh Wed Mar 31 21:26:33 2010 +0300 @@ -25,7 +25,8 @@ /** Command ID's. */ enum TMPXPodcastPlaybackViewCommandIds { - EMPXPbvCmdGoToPodcastMenu = 0x1A00 + EMPXPbvCmdGoToPodcastMenu = 0x1A00, + EMPXPbvCmdPodcastDetails }; #define KMPXPodcastPlaybackViewId 0x101FFCB8 diff -r 171e07ac910f -r c8156a91d13c mpxplugins/viewplugins/views/podcastplaybackview/src/mpxpodcastplaybackviewimp.cpp --- a/mpxplugins/viewplugins/views/podcastplaybackview/src/mpxpodcastplaybackviewimp.cpp Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/viewplugins/views/podcastplaybackview/src/mpxpodcastplaybackviewimp.cpp Wed Mar 31 21:26:33 2010 +0300 @@ -292,6 +292,9 @@ aMenuPane->SetItemDimmed( EMPXPbvCmdRandom, ETrue ); + aMenuPane->SetItemDimmed( + EMPXPbvCmdSongDetails, + ETrue ); // Check if FM Transmitter is supported if ( !FeatureManager::FeatureSupported( KFeatureIdFmtx ) ) @@ -378,6 +381,11 @@ } break; } + case EMPXPbvCmdPodcastDetails: + { + CMPXCommonPlaybackViewImp::LaunchFileDetailsDialogL(); + break; + } default: { CMPXCommonPlaybackViewImp::HandleCommandL( aCommand ); diff -r 171e07ac910f -r c8156a91d13c mpxplugins/viewplugins/views/podcastview/data/mpxpodcastcollectionview.rss --- a/mpxplugins/viewplugins/views/podcastview/data/mpxpodcastcollectionview.rss Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/viewplugins/views/podcastview/data/mpxpodcastcollectionview.rss Wed Mar 31 21:26:33 2010 +0300 @@ -89,7 +89,7 @@ MENU_ITEM { command = EMPXCmdGoToNowPlaying; - txt = qtn_nmp_options_go_to_nowplaying; + txt = qtn_mus_options_nowplaying; }, MENU_ITEM { @@ -158,7 +158,7 @@ MENU_ITEM { command = EMPXCmdGoToNowPlaying; - txt = qtn_nmp_options_go_to_nowplaying; + txt = qtn_mus_options_nowplaying; }, MENU_ITEM { @@ -265,7 +265,7 @@ MENU_ITEM { command = EMPXCmdGoToNowPlaying; - txt = qtn_nmp_options_go_to_nowplaying; + txt = qtn_mus_options_nowplaying; }, MENU_ITEM { @@ -909,4 +909,24 @@ }; } +//------------------------------------------------------------------------------ +// r_mpx_podcast_unknown +// Text shown if there is at least one episode for which podcast title information is missing +//------------------------------------------------------------------------------ +// +RESOURCE TBUF r_mpx_podcast_unknown + { + buf = qtn_mus_podcast_unknown; + } + +//------------------------------------------------------------------------------ +// r_mpx_title_unknown_podcast +// Text shown if title is not known +//------------------------------------------------------------------------------ +// +RESOURCE TBUF r_mpx_title_unknown_podcast + { + buf = qtn_mus_title_unknown_podcast; + } + // End of File diff -r 171e07ac910f -r c8156a91d13c mpxplugins/viewplugins/views/podcastview/loc/mpxpodcastcollectionview.loc --- a/mpxplugins/viewplugins/views/podcastview/loc/mpxpodcastcollectionview.loc Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/viewplugins/views/podcastview/loc/mpxpodcastcollectionview.loc Wed Mar 31 21:26:33 2010 +0300 @@ -306,4 +306,22 @@ // #define qtn_nmp_del_batch_songs_wait_note "Deleting: %N%" +// d:Text shown if there is at least one episode for which podcast title information is missing +// l:list_double_large_graphic_pane_t1 +// r:5.2 +// +#define qtn_mus_podcast_unknown "Unknown" + +// d:Text shown if title is not known +// l:title_pane_t2/opt9 +// r:5.2 +// +#define qtn_mus_title_unknown_podcast "Unknown" + +// d:Options menu item for now playing. +// l:list_single_pane_t1_cp2/opt1 +// r:5.0 +// +#define qtn_mus_options_nowplaying "Now Playing" + // End of File diff -r 171e07ac910f -r c8156a91d13c mpxplugins/viewplugins/views/podcastview/src/mpxpodcastcollectionviewlistboxarray.cpp --- a/mpxplugins/viewplugins/views/podcastview/src/mpxpodcastcollectionviewlistboxarray.cpp Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/viewplugins/views/podcastview/src/mpxpodcastcollectionviewlistboxarray.cpp Wed Mar 31 21:26:33 2010 +0300 @@ -479,7 +479,7 @@ if ( origMedia->ValueText(KMPXMediaGeneralTitle ).Length() == 0 ) { HBufC* text = StringLoader::LoadLC( - R_MPX_QTN_NMP_UNKNOWN_TITLE ); + R_MPX_PODCAST_UNKNOWN ); origMedia->SetTextValueL(KMPXMediaGeneralTitle, *text ); CleanupStack::PopAndDestroy( text ); @@ -493,7 +493,7 @@ if ( iContainerMedia->ValueText(KMPXMediaGeneralTitle).Length() == 0 ) { HBufC* text = StringLoader::LoadLC( - R_MPX_QTN_NMP_UNKNOWN_TITLE ); + R_MPX_TITLE_UNKNOWN_PODCAST ); iContainerMedia->SetTextValueL(KMPXMediaGeneralTitle, *text ); CleanupStack::PopAndDestroy( text ); diff -r 171e07ac910f -r c8156a91d13c mpxplugins/viewplugins/views/waitnotedialog/data/mpxwaitnotedialog.rss --- a/mpxplugins/viewplugins/views/waitnotedialog/data/mpxwaitnotedialog.rss Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/viewplugins/views/waitnotedialog/data/mpxwaitnotedialog.rss Wed Mar 31 21:26:33 2010 +0300 @@ -263,3 +263,27 @@ { buf = qtn_nmp_note_mp_unavailable_mmc; } + +// ----------------------------------------------------------------------------- +// +// r_mpx_updating_library_txt +// Text for updating library wait note. +// +// ----------------------------------------------------------------------------- +// +RESOURCE TBUF r_mpx_updating_library_txt + { + buf = qtn_mus_note_updating_library; + } + +// ----------------------------------------------------------------------------- +// +// r_mpx_uptodate_txt +// Text for update music library complete. +// +// ----------------------------------------------------------------------------- +// +RESOURCE TBUF r_mpx_uptodate_txt + { + buf = qtn_mus_note_uptodate; + } diff -r 171e07ac910f -r c8156a91d13c mpxplugins/viewplugins/views/waitnotedialog/inc/mpxscanningdialog.h --- a/mpxplugins/viewplugins/views/waitnotedialog/inc/mpxscanningdialog.h Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/viewplugins/views/waitnotedialog/inc/mpxscanningdialog.h Wed Mar 31 21:26:33 2010 +0300 @@ -92,14 +92,29 @@ * @param aMessage collection message */ void DoHandleCollectionMessageL( const CMPXMessage& aMessage ); - + + /** + * Helper function used inside DoHandleCollectionMessageL + */ + inline TInt GetTrackCountL(TInt aDrive,TInt aColDbId, TInt aColTable); + private: // data MMPXHarvesterUtility* iHarvesterUtil; TInt iNumItemsAdded; TInt iScanningError; - TInt iInitialMMCCount; TInt iTotalNewTracks; + /** + * The total songs in (Mass Storage + MMC) CollectionDB before refresh + */ + TInt iInitialCount; + /** + * Flag of music library + * ETrue when total songs in CollectionDB changed + * or new songs added to CollectionDB + * EFalse when CollectionDB has no change + */ + TBool isCollectionDBChanged; }; diff -r 171e07ac910f -r c8156a91d13c mpxplugins/viewplugins/views/waitnotedialog/loc/mpxwaitnotedialog.loc --- a/mpxplugins/viewplugins/views/waitnotedialog/loc/mpxwaitnotedialog.loc Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/viewplugins/views/waitnotedialog/loc/mpxwaitnotedialog.loc Wed Mar 31 21:26:33 2010 +0300 @@ -26,11 +26,11 @@ #define qtn_nmp_note_scanning_db "Searching for music" // d:Search complete text shown after scanning is complete -// d:and some songs are found +// d:showing number of items found. // l:popup_note_window/opt2 -// r:3.1 +// r:5.2 // -#define qtn_mus_note_search_complete1 "Search complete \nAdded: %N" +#define qtn_mus_note_search_complete1 "Search complete \nFound: %N" // d:Search stopped text shown after scanning is complete // d:and some songs are found @@ -102,4 +102,16 @@ // #define qtn_nmp_note_mp_unavailable_mmc "Music Player unable to access memory card. Memory card operation underway." +// d:Search complete text shown after scanning is completed +// l:popup_note_window/opt2 +// r:5.2 +// +#define qtn_mus_note_uptodate "Library is up to date." + +// d:Wait note shown when it takes long time to stop to refresh +// l:popup_note_wait_window +// r:5.2 +// +#define qtn_mus_note_updating_library "Updating Library. \n Please wait." + // End of File diff -r 171e07ac910f -r c8156a91d13c mpxplugins/viewplugins/views/waitnotedialog/src/mpxscanningdialog.cpp --- a/mpxplugins/viewplugins/views/waitnotedialog/src/mpxscanningdialog.cpp Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/viewplugins/views/waitnotedialog/src/mpxscanningdialog.cpp Wed Mar 31 21:26:33 2010 +0300 @@ -51,8 +51,9 @@ CMPXWaitNoteDialog( aObs, aType ) { iNumItemsAdded = 0; - iInitialMMCCount = 0; iTotalNewTracks = 0; + iInitialCount = 0; + isCollectionDBChanged = EFalse; } @@ -162,6 +163,12 @@ iHarvesterUtil = NULL; iHarvesterUtil = CMPXHarvesterFactory::NewL(); } + + // When stop refreshing library, prompt a process waiting dialog. + // Inform user to wait for the updating library. + HBufC* waitText = StringLoader::LoadLC( R_MPX_UPDATING_LIBRARY_TXT ); + DisplayProcessWaitDialogL( R_MPX_GENERIC_WAIT_NOTE, *waitText ); + CleanupStack::PopAndDestroy( waitText ); } else if( iScanningError >= KErrNone ) { @@ -170,15 +177,31 @@ if( iWaitNoteType == EMPXScanningNote || iWaitNoteType == EMPXCorruptScanningNote ) { - text = StringLoader::LoadLC( R_MPX_SCANNING_COMPLETE_TXT, - iNumItemsAdded ); - textRsc = R_MPX_SCANNING_COMPLETE_TXT; + if ( isCollectionDBChanged ) + { + text = StringLoader::LoadLC( R_MPX_SCANNING_COMPLETE_TXT, + iNumItemsAdded ); + textRsc = R_MPX_SCANNING_COMPLETE_TXT; + } + else + { + text = StringLoader::LoadLC( R_MPX_UPTODATE_TXT ); + textRsc = R_MPX_UPTODATE_TXT; + } } else // iWaitNoteType == EMPXRefreshNote { - text = StringLoader::LoadLC( R_MPX_REFRESHING_DB_COMPLETE_TXT, + if ( isCollectionDBChanged ) + { + text = StringLoader::LoadLC( R_MPX_REFRESHING_DB_COMPLETE_TXT, iNumItemsAdded ); - textRsc = R_MPX_REFRESHING_DB_COMPLETE_TXT; + textRsc = R_MPX_REFRESHING_DB_COMPLETE_TXT; + } + else + { + text = StringLoader::LoadLC( R_MPX_UPTODATE_TXT ); + textRsc = R_MPX_UPTODATE_TXT; + } } } else if( iScanningError == KErrDiskFull ) @@ -217,6 +240,9 @@ } else { + // When finish updating library, cancle the process waiting + // dialog and then prompt the refreshing completion dialog. + CancelProcessWaitDialogL(); DisplayNoteDialogL( R_MPX_EMPTY_CLOSE_NOTE, *text, CAknNoteDialog::EConfirmationTone ); } @@ -267,66 +293,47 @@ if(event == TMPXCollectionMessage::EBroadcastEvent && ((op == EMcMsgRefreshStart) || (op == EMcMsgRefreshEnd))) { - TInt mmcCount = 0; - if ( iWaitNoteType == EMPXScanningNote) - { - //get removable drive number - TInt removableDrive( EDriveF ); + TInt songTotal = 0; + + if ( iWaitNoteType == EMPXScanningNote ) + { + RArray ary; + CleanupClosePushL( ary ); + ary.AppendL(TUid::Uid( EMPXCollectionPluginPodCast ) ); + TUid podcastCollectionId = iCollection->CollectionIDL( ary.Array() ); + ary.Reset(); + ary.AppendL(TUid::Uid(EMPXCollectionPluginMusic)); + TUid musicCollectionId = iCollection->CollectionIDL( ary.Array() ); + CleanupStack::PopAndDestroy(&ary); + + TInt removableDrive( EDriveF ); #ifdef RD_MULTIPLE_DRIVE User::LeaveIfError( DriveInfo::GetDefaultDrive( DriveInfo::EDefaultRemovableMassStorage, removableDrive ) ); - #endif // RD_MULTIPLE_DRIVE - - //get count from music db - - CMPXCommand* cmdCount = CMPXMedia::NewL(); - CleanupStack::PushL( cmdCount ); - cmdCount->SetTObjectValueL( - KMPXCommandGeneralId, - KMPXCommandCollectionGetCount ); - cmdCount->SetTObjectValueL( - KMPXCommandGeneralDoSync, - ETrue ); - cmdCount->SetTObjectValueL( - KMPXCommandCollectionCountDrive, - removableDrive); + #endif // RD_MULTIPLE_DRIVE + + TInt massStorageDrive( EDriveE ); + User::LeaveIfError( DriveInfo::GetDefaultDrive( + DriveInfo::EDefaultMassStorage, + massStorageDrive ) ); - cmdCount->SetTObjectValueL( - KMPXCommandCollectionCountTable, - EMPXCollectionCountTotal ); - - // Get the collection UIDs - RArray ary; - CleanupClosePushL( ary ); - ary.AppendL( TUid::Uid(EMPXCollectionPluginMusic) ); - TUid musicCollectionId = - iCollection->CollectionIDL( ary.Array() ); - CleanupStack::PopAndDestroy( &ary ); - cmdCount->SetTObjectValueL( - KMPXCommandGeneralCollectionId, - musicCollectionId.iUid ); - - TRAPD(err, iCollection->Collection().CommandL( *cmdCount ) ); + songTotal = GetTrackCountL( removableDrive, + podcastCollectionId.iUid, EMPXCollectionCountTrack ); + songTotal += GetTrackCountL( massStorageDrive, + podcastCollectionId.iUid, EMPXCollectionCountTrack ); - if ( KErrNotFound != err ) - { - User::LeaveIfError( err ); - } - - // returned command should contain count - if ( cmdCount->IsSupported( KMPXCommandCollectionCountValue ) ) - { - mmcCount = - cmdCount->ValueTObjectL( - KMPXCommandCollectionCountValue ); - } - CleanupStack::PopAndDestroy( cmdCount ); + songTotal += GetTrackCountL( removableDrive, + musicCollectionId.iUid, EMPXCollectionCountTotal ); + songTotal += GetTrackCountL( massStorageDrive, + musicCollectionId.iUid, EMPXCollectionCountTotal ); + } if( op == EMcMsgRefreshStart ) { + isCollectionDBChanged = EFalse; MPX_DEBUG1("refreshStart store the initial count"); - iInitialMMCCount = mmcCount; + iInitialCount = songTotal; } if( op == EMcMsgRefreshEnd ) @@ -335,21 +342,21 @@ // Do not reset iNumItemsAdded while KErrLocked or KErrDiskFull. if( data != KErrLocked && data != KErrDiskFull ) { - iNumItemsAdded = mmcCount; + iNumItemsAdded = songTotal ; } switch ( iWaitNoteType ) { case EMPXScanningNote: { - //total new tracks on external memory - TInt totalNewOnMMC = iNumItemsAdded - iInitialMMCCount; - - //total new tracks on internal memory - TInt newOnPhone = iTotalNewTracks - totalNewOnMMC; - - //total new tracks to dispaly - iNumItemsAdded += newOnPhone; - + if ( iTotalNewTracks || ( iNumItemsAdded != iInitialCount ) ) + { + isCollectionDBChanged = ETrue; + iNumItemsAdded = songTotal ; + } + else + { + isCollectionDBChanged = EFalse; + } break; } @@ -366,10 +373,15 @@ { // Synchronize the number of items added if we had no errors // - if( data >= KErrNone ) + if( data > KErrNone || iTotalNewTracks ) { - iNumItemsAdded = data; + isCollectionDBChanged = ETrue; + iNumItemsAdded = iTotalNewTracks; } + else + { + isCollectionDBChanged = EFalse; + } break; } }; @@ -448,6 +460,46 @@ } } } +// --------------------------------------------------------------------------- +// Get track count for given table in the db +// --------------------------------------------------------------------------- +// +TInt CMPXScanningWaitDialog::GetTrackCountL(TInt aDrive,TInt aColDbId, TInt aColTable) + { + MPX_DEBUG2("--->CMPXScanningWaitDialog::GetTrackCountL() aDrive = %d", aDrive ); + TInt count(0); + + //get count from db + CMPXCommand* cmdCountM = CMPXMedia::NewL(); + CleanupStack::PushL(cmdCountM); + cmdCountM->SetTObjectValueL( + KMPXCommandGeneralId, + KMPXCommandCollectionGetCount ); + cmdCountM->SetTObjectValueL( + KMPXCommandGeneralDoSync, + ETrue ); + cmdCountM->SetTObjectValueL( + KMPXCommandGeneralCollectionId, + aColDbId ); + cmdCountM->SetTObjectValueL( + KMPXCommandCollectionCountDrive, + aDrive ); + cmdCountM->SetTObjectValueL( + KMPXCommandCollectionCountTable, + aColTable ); + + TRAPD( err, iCollection->Collection().CommandL( *cmdCountM ) ); + + // returned command should contain count + if ( err == KErrNone && cmdCountM->IsSupported(KMPXCommandCollectionCountValue ) ) + { + count = cmdCountM->ValueTObjectL(KMPXCommandCollectionCountValue); + } + CleanupStack::PopAndDestroy(cmdCountM); + MPX_DEBUG2("--->CMPXScanningWaitDialog::GetTrackCountL() count = %d", count ); + + return count; + } // END OF FILE diff -r 171e07ac910f -r c8156a91d13c mpxplugins/viewplugins/views/waitnotedialog/src/mpxwaitnotedialog.cpp --- a/mpxplugins/viewplugins/views/waitnotedialog/src/mpxwaitnotedialog.cpp Mon Mar 15 12:40:11 2010 +0200 +++ b/mpxplugins/viewplugins/views/waitnotedialog/src/mpxwaitnotedialog.cpp Wed Mar 31 21:26:33 2010 +0300 @@ -90,6 +90,10 @@ iWaitDialog->SetCallback( NULL ); TRAP_IGNORE( iWaitDialog->ProcessFinishedL() ); } + if( iProcessWaitDialog ) + { + TRAP_IGNORE( iProcessWaitDialog->ProcessFinishedL() ); + } if( iResourceOffset ) { @@ -473,4 +477,38 @@ MPX_DEBUG1("<--CMPXWaitNoteDialog::DisplayNoteDialogL for COVER DISPLAY End"); } +// --------------------------------------------------------------------------- +// Display a generic process wait dialog +// --------------------------------------------------------------------------- +// +void CMPXWaitNoteDialog::DisplayProcessWaitDialogL( TInt aDlgRsc, + const TDesC& aLabel, + CAknWaitDialog::TTone aTone ) + { + if(iProcessWaitDialog ) + { + iProcessWaitDialog->ProcessFinishedL(); + iProcessWaitDialog = NULL; + } + + iProcessWaitDialog = new ( ELeave ) CAknWaitDialog( + ( CEikDialog** )&iProcessWaitDialog, + iVisDelayOff ); + + iProcessWaitDialog->PrepareLC( aDlgRsc ); + iProcessWaitDialog->SetTextL( aLabel ); + iProcessWaitDialog->RunLD(); + } + +// --------------------------------------------------------------------------- +// Cancel the process wait dialog +// --------------------------------------------------------------------------- +// +void CMPXWaitNoteDialog::CancelProcessWaitDialogL() + { + if( iProcessWaitDialog ) + { + iProcessWaitDialog->ProcessFinishedL(); + } + } // End of file diff -r 171e07ac910f -r c8156a91d13c musichomescreen_multiview/data/music_matrix_items.xml --- a/musichomescreen_multiview/data/music_matrix_items.xml Mon Mar 15 12:40:11 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,221 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 171e07ac910f -r c8156a91d13c musichomescreen_multiview/data/musichomescreen.rss --- a/musichomescreen_multiview/data/musichomescreen.rss Mon Mar 15 12:40:11 2010 +0200 +++ b/musichomescreen_multiview/data/musichomescreen.rss Wed Mar 31 21:26:33 2010 +0300 @@ -37,125 +37,6 @@ RESOURCE TBUF { buf=""; } // --------------------------------------------------------------------------- -// r_musichomescreen_suite_title -// Title for the music suite in the matrix menu -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_musichomescreen_suite_title - { - buf = qtn_vmp_title_suite; - } - -// --------------------------------------------------------------------------- -// r_musichomescreen_fm_radio -// Text for the title of the FM radio application -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_musichomescreen_fm_radio - { - buf = qtn_vmp_title_fm_radio; - } - -// --------------------------------------------------------------------------- -// r_musichomescreen_fm_radio_ad -// Text for the description of the FM radio -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_musichomescreen_fm_radio_ad - { - buf = qtn_vmp_title_fm_radio_ad; - } - -// --------------------------------------------------------------------------- -// r_musichomescreen_last_played -// Text for the most recently played song or track -// --------------------------------------------------------------------------- -// -RESOURCE LBUF r_musichomescreen_last_played - { - txt = qtn_vmp_title_last_played; - } - -// --------------------------------------------------------------------------- -// r_musichomescreen_music_no_music -// Text to indicate that that there are NO songs in the collection -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_musichomescreen_music_no_music - { - buf = qtn_vmp_title_music_no_music; - } - -// --------------------------------------------------------------------------- -// r_musichomescreen_my_music -// Text for title of the music collection item -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_musichomescreen_my_music - { - buf = qtn_vmp_title_my_music; - } - -// --------------------------------------------------------------------------- -// r_musichomescreen_nokia_music_store -// Text for nokia music store web service -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_musichomescreen_nokia_music_store - { - buf = qtn_vmp_title_nokia_music_store; - } - -// --------------------------------------------------------------------------- -// r_musichomescreen_nokia_store_ad -// Text for store description -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_musichomescreen_nokia_store_ad - { - buf = qtn_vmp_title_nokia_store_ad; - } -// --------------------------------------------------------------------------- -// r_musichomescreen_now_playing -// Text for currently playing song or track -// --------------------------------------------------------------------------- -// -RESOURCE LBUF r_musichomescreen_now_playing - { - txt = qtn_vmp_title_now_playing; - } - -// --------------------------------------------------------------------------- -// r_musichomescreen_my_music_1_song -// Text to indicate that there is ONE song in the collection -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_musichomescreen_my_music_1_song - { - buf = qtn_vmp_title_my_music_1_song; - } - -// --------------------------------------------------------------------------- -// r_musichomescreen_my_music_n_songs -// Text to indicate that there are n songs in the collection -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_musichomescreen_my_music_n_songs - { - buf = qtn_vmp_title_my_music_n_songs; - } - -// --------------------------------------------------------------------------- -// r_musichomescreen_my_music_no_songs -// Text to indicate that there are no songs in the collection -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_musichomescreen_my_music_no_songs - { - buf = qtn_vmp_title_my_music_no_songs; - } - -// --------------------------------------------------------------------------- // r_musichomescreen_go_to_music // Text to be displayed on the music widget when there is no played Music. // --------------------------------------------------------------------------- @@ -175,23 +56,5 @@ txt = qtn_vmp_music_widget_opening; } -// --------------------------------------------------------------------------- -// r_musichomescreen_options_open -// -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_musichomescreen_options_open - { - buf = qtn_options_open; - } -// --------------------------------------------------------------------------- -// r_musichomescreen_options_help -// -// --------------------------------------------------------------------------- -// -RESOURCE TBUF r_musichomescreen_options_help - { - buf = qtn_options_help; - } // End of File diff -r 171e07ac910f -r c8156a91d13c musichomescreen_multiview/data/suite.xml --- a/musichomescreen_multiview/data/suite.xml Mon Mar 15 12:40:11 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 171e07ac910f -r c8156a91d13c musichomescreen_multiview/data/themes/default/install/musicwidget_10207c18/xuikon/00/MusicWidget.xml --- a/musichomescreen_multiview/data/themes/default/install/musicwidget_10207c18/xuikon/00/MusicWidget.xml Mon Mar 15 12:40:11 2010 +0200 +++ b/musichomescreen_multiview/data/themes/default/install/musicwidget_10207c18/xuikon/00/MusicWidget.xml Wed Mar 31 21:26:33 2010 +0300 @@ -14,13 +14,13 @@ - + - + @@ -34,7 +34,7 @@ - + @@ -45,7 +45,7 @@ - + @@ -61,7 +61,7 @@ - + @@ -72,7 +72,7 @@ - + @@ -82,7 +82,7 @@ - + @@ -91,7 +91,7 @@ - + @@ -101,7 +101,7 @@ - + @@ -113,7 +113,7 @@ - + @@ -123,7 +123,7 @@ - + diff -r 171e07ac910f -r c8156a91d13c musichomescreen_multiview/loc/musichomescreen.loc --- a/musichomescreen_multiview/loc/musichomescreen.loc Mon Mar 15 12:40:11 2010 +0200 +++ b/musichomescreen_multiview/loc/musichomescreen.loc Wed Mar 31 21:26:33 2010 +0300 @@ -54,82 +54,6 @@ // LOCALISATION STRINGS CHARACTER_SET UTF8 -// d: Title of the Music suite in the matrix menu main screen -// l: title_pane_t2/opt9 -// r: S60 v5.1 -// -#define qtn_vmp_title_suite "Music" - -// d: The title for the most recently played track or song -// d: this is when the music player is in stopped state -// l: list_logical_template_3_title -// r: S60 v5.1 -// -#define qtn_vmp_title_last_played "Last Played" - -// d: The title for the currently playing track or song -// d: this is when the music player is in playing state -// l: list_logical_template_3_title -// r: S60 v5.1 -// -#define qtn_vmp_title_now_playing "Now Playing" - -// d: The detail when music player was never launched -// l: list_logical_template_3_detail -// r: S60 v5.1 -// -#define qtn_vmp_title_music_no_music "No Music Played" - -// d: The music the user has in his terminal -// l: list_logical_template_3_title -// r: S60 v5.1 -// -#define qtn_vmp_title_my_music "My Music" - -// d: The text indicating that the user has only ONE song in his terminal -// l: list_logical_template_3_detail -// r: S60 v5.1 -// -#define qtn_vmp_title_my_music_1_song "1 Song" - -// d: The text indicating that the number of songs the -// d: user has in his terminal -// d: %N is total number of songs in My Music -// l: list_logical_template_3_detail -// r: S60 v5.1 -// -#define qtn_vmp_title_my_music_n_songs "%N Songs" - -// d: The text indicating that the user has NO songs in his terminal -// l: list_logical_template_3_detail -// r: S60 v5.1 -// -#define qtn_vmp_title_my_music_no_songs "No Songs" - -// d: The name of the Nokia music store web service -// l: list_logical_template_3_title -// r: S60 v5.1 -// -#define qtn_vmp_title_nokia_music_store "Nokia Music Store" - -// d: The description ad for the Nokia music store -// l: list_logical_template_3_detail -// r: S60 v5.1 -// -#define qtn_vmp_title_nokia_store_ad "Explore millions of songs and download music" - -// d: The name for the radio application -// l: list_logical_template_3_title -// r: S60 v5.1 -// -#define qtn_vmp_title_fm_radio "FM Radio" - -// d: The Ad for the Radio application -// l: list_logical_template_3_detail -// r: S60 v5.1 -// -#define qtn_vmp_title_fm_radio_ad "Radio with RDS" - // d: The Text to be displayed when the device intially // d: powers up or when the user returns to the homescreen // d: and has not played any Music or Podcast diff -r 171e07ac910f -r c8156a91d13c musichomescreen_multiview/mcpmusicplayer/inc/mcpmusicplayer.h --- a/musichomescreen_multiview/mcpmusicplayer/inc/mcpmusicplayer.h Mon Mar 15 12:40:11 2010 +0200 +++ b/musichomescreen_multiview/mcpmusicplayer/inc/mcpmusicplayer.h Wed Mar 31 21:26:33 2010 +0300 @@ -228,9 +228,8 @@ * Installs Go To Last Played action, the puppose of this is to improve * readability. */ - void InstallGoToLastPlayedL( TMCPTriggerDestination aDestination, - TBool aMinimized ); - + void InstallGoToLastPlayedL( TMCPTriggerDestination aDestination ); + /** * Installs an action, mainly for readability purposes. * diff -r 171e07ac910f -r c8156a91d13c musichomescreen_multiview/mcpmusicplayer/src/mcpmusicplayer.cpp --- a/musichomescreen_multiview/mcpmusicplayer/src/mcpmusicplayer.cpp Mon Mar 15 12:40:11 2010 +0200 +++ b/musichomescreen_multiview/mcpmusicplayer/src/mcpmusicplayer.cpp Wed Mar 31 21:26:33 2010 +0300 @@ -65,8 +65,6 @@ } _LIT( KEmpty, "" ); -_LIT( KNowPlaying, "LOC:NOW PLAYING" ); -_LIT( KLastPlayed, "LOC:LAST PLAYED" ); _LIT( KMIF, "z:\\resource\\apps\\musichomescreenicons.mif"); @@ -80,7 +78,6 @@ //for music player action handler - message to music player _LIT( KactionMessageToMusicPlayer, "MessageToMusicPlayer" ); _LIT( KGoToNowPlaying, "GoToNowPlaying" ); -_LIT( KGoToLastPlayed, "GoToLastPlayed" ); _LIT( KGoToLastPlayedMinimized, "GoToLastPlayedMinimized" ); _LIT( KGoToAlbumView, "GoToAlbumView" ); @@ -307,7 +304,7 @@ // --------------------------------------------------------------------------- // void CMCPMusicPlayer::InstallGoToLastPlayedL( - TMCPTriggerDestination aDestination, TBool aMinimized ) + TMCPTriggerDestination aDestination ) { MPX_DEBUG1("CMCPMusicPlayer::InstallGoToLastPlayedL <---"); CLiwDefaultMap* mapTrigger = CLiwDefaultMap::NewLC(); @@ -315,14 +312,7 @@ mapTrigger->InsertL( KPluginUid, TLiwVariant( TUid::Uid( 0x10207C16 ) ) ); mapData->InsertL( KType, TLiwVariant( KactionMessageToMusicPlayer ) ); - if (aMinimized) - { - mapData->InsertL( KMessage, TLiwVariant( KGoToLastPlayedMinimized ) ); - } - else - { - mapData->InsertL( KMessage, TLiwVariant( KGoToLastPlayed ) ); - } + mapData->InsertL( KMessage, TLiwVariant( KGoToLastPlayedMinimized ) ); mapTrigger->InsertL( KData , TLiwVariant( mapData ) ); iMHObserver->PublishActionL( this, aDestination, mapTrigger ); @@ -475,7 +465,7 @@ iMHObserver->PublishImageL( this, EMusicWidgetToolbarB2, iconId, KMIF, EMbmMusichomescreeniconsQgn_prop_image_tb_play2, EMbmMusichomescreeniconsQgn_prop_image_tb_play2_mask); - InstallGoToLastPlayedL(EMusicWidgetTB2Trigger, ETrue); + InstallGoToLastPlayedL(EMusicWidgetTB2Trigger); iToolBarState |= TBK::KPlay_last_played; MPX_DEBUG1("CMCPMusicPlayer::UpdateToolBarL KPlay_last_played"); } @@ -570,19 +560,7 @@ InstallEmptyActionL(EMusicWidgetTB2Trigger); InstallEmptyActionL(EMusicWidgetTB3Trigger); InstallGoToAlbumL(EMusicWidgetTrigger2); - - //Reset the music menu info - InstallEmptyActionL(EMusicMenuMusicInfoTrigger); - iMHObserver->PublishTextL( this, EMusicMenuMusicInfoLine1, - KLastPlayed ); - iMHObserver->PublishTextL( this, EMusicMenuMusicInfoLine2, - KEmpty ); - iMHObserver->PublishImageL( this, EMusicMenuMusicInfoImage1, - KAknsIIDQgnIndiMupDefaultAlbum, - KMIF, - EMbmMusichomescreeniconsQgn_indi_mup_default_album, - EMbmMusichomescreeniconsQgn_indi_mup_default_album_mask); MPX_DEBUG1("CMCPMusicPlayer::ResetL --->"); } @@ -612,7 +590,7 @@ if ( iPNSMonitor ) { delete iPNSMonitor; - iFileMonitor = NULL; + iPNSMonitor = NULL; MPX_DEBUG1("CMCPMusicPlayer::ActivateL pns monitor deleted"); } iPNSMonitor = CPNSMonitor::NewL(*this); @@ -657,9 +635,6 @@ iMHObserver->PublishTextL( this, EMusicWidgetDefaultText, KEmpty ); InstallGoToNowPlayingL(EMusicWidgetTrigger1); - InstallGoToLastPlayedL(EMusicMenuMusicInfoTrigger, EFalse); - iMHObserver->PublishTextL(this, EMusicMenuMusicInfoLine1, - KNowPlaying); DoUpdateTrackInfoL(iEngine->TitleL(), iEngine->Artist()); iToolBarState = 0; DoUpdatePlayerStateL( iEngine->PlayerState() ); @@ -735,8 +710,6 @@ nowPlayingForMMPtr.Append(aArtist); } iMHObserver->PublishTextL( this,EMusicWidgetText1, *nowPlayingForMM ); - iMHObserver->PublishTextL(this, EMusicMenuMusicInfoLine2, - *nowPlayingForMM); CleanupStack::PopAndDestroy( nowPlayingForMM ); MPX_DEBUG1("CMCPMusicPlayer::DoUpdatePlayerStateL deliting file monitor"); if (iFileMonitor) @@ -875,15 +848,9 @@ { iMHObserver->PublishImageL(this,EMusicWidgetImage1,handle); } - iMHObserver->PublishImageL( this, EMusicMenuMusicInfoImage1, - handle ); } else { - iMHObserver->PublishImageL( this, EMusicMenuMusicInfoImage1, - KAknsIIDQgnIndiMupDefaultAlbum, - KMIF, EMbmMusichomescreeniconsQgn_indi_mup_default_album, - EMbmMusichomescreeniconsQgn_indi_mup_default_album_mask); iMHObserver->PublishImageL( this, EMusicWidgetImage1, KAknsIIDQgnIndiMupDefaultAlbum, KMIF, EMbmMusichomescreeniconsQgn_indi_mup_default_album, @@ -958,10 +925,6 @@ } else { - iMHObserver->PublishImageL( this, EMusicMenuMusicInfoImage1, - KAknsIIDQgnIndiMupDefaultAlbum, - KMIF, EMbmMusichomescreeniconsQgn_indi_mup_default_album, - EMbmMusichomescreeniconsQgn_indi_mup_default_album_mask); iMHObserver->PublishImageL( this, EMusicWidgetImage1, KAknsIIDQgnIndiMupDefaultAlbum, KMIF, EMbmMusichomescreeniconsQgn_indi_mup_default_album, @@ -1083,6 +1046,11 @@ MPX_DEBUG1("CMCPMusicPlayer::AlbumArtChanged <---"); if (!iActive) { + if (iCachedArtBitmap) + { + MPX_DEBUG2("CMCPMusicPlayer::AlbumArtChanged dropping bitmap %x", iCachedArtBitmap); + delete iCachedArtBitmap; + } iCachedArtBitmap = aBitmap; iArtCached = ETrue; } @@ -1149,9 +1117,6 @@ if (IsOKToPublishData() ) { iMHObserver->PublishTextL( this, EMusicWidgetDefaultText, KEmpty ); - InstallGoToLastPlayedL(EMusicMenuMusicInfoTrigger, EFalse); - iMHObserver->PublishTextL(this, EMusicMenuMusicInfoLine1, - KLastPlayed); DoUpdateTrackInfoL(iEngine->TitleL(), iEngine->Artist()); DoUpdateAlbumArtL(iArtCached ? iCachedArtBitmap : iArtBitmap); } @@ -1222,10 +1187,6 @@ UpdateToolBarL( TBK::KSkeep_L_dimmed | TBK::KPlay_dimmed | TBK::KSkeep_R_dimmed ); - if ( IsOKToPublishData() ) - { - InstallGoToAlbumL(EMusicMenuMusicInfoTrigger); - } } else if ( event == TMPXCollectionMessage::EBroadcastEvent && ( type == EMcMsgUSBMassStorageEnd || @@ -1240,9 +1201,6 @@ { iMHObserver->PublishTextL( this, EMusicWidgetDefaultText, KEmpty ); - InstallGoToLastPlayedL( EMusicMenuMusicInfoTrigger, ETrue ); - iMHObserver->PublishTextL( this, EMusicMenuMusicInfoLine1, - KLastPlayed ); DoUpdateTrackInfoL( iEngine->TitleL(), iEngine->Artist() ); DoUpdateAlbumArtL( iArtCached ? iCachedArtBitmap : iArtBitmap ); } diff -r 171e07ac910f -r c8156a91d13c musichomescreen_multiview/mpxcollectionpublisher/data/mpxcollectionpublisher.rss --- a/musichomescreen_multiview/mpxcollectionpublisher/data/mpxcollectionpublisher.rss Mon Mar 15 12:40:11 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -/* -* Copyright (c) 2008-2008 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: ECOM registration for Music Content Publisher -* -*/ - - -#include -#include -#include "mpxcollectionpublisheruids.hrh" - -// --------------------------------------------------------------------------- -// MpxCollectionPublisherPluginInfo -// Declares info for implementation of the plugin -// --------------------------------------------------------------------------- -// -RESOURCE REGISTRY_INFO MpxCollectionPublisherPluginInfo - { - // UID for the DLL - dll_uid = KMpxCollectionPublisherDLL; - // Declare array of interface info - interfaces = - { - INTERFACE_INFO - { - // UID of interface that is implemented - interface_uid = KContentHarvesterPluginUid; - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = KMpxCollectionPublisherUID; - version_no = 1; - display_name = ""; - default_data = ""; - opaque_data = ""; - } - }; - } - }; - } - -// End of File diff -r 171e07ac910f -r c8156a91d13c musichomescreen_multiview/mpxcollectionpublisher/group/bld.inf --- a/musichomescreen_multiview/mpxcollectionpublisher/group/bld.inf Mon Mar 15 12:40:11 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -/* -* Copyright (c) 2008-2008 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: Build information file for Music Content Publisher. -* -*/ - - - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS -../rom/mpxcollectionpublisher.iby CORE_APP_LAYER_IBY_EXPORT_PATH(mpxcollectionpublisher.iby) - -PRJ_MMPFILES -mpxcollectionpublisher.mmp - -PRJ_TESTMMPFILES -PRJ_TESTEXPORTS - -// End of File diff -r 171e07ac910f -r c8156a91d13c musichomescreen_multiview/mpxcollectionpublisher/group/mpxcollectionpublisher.mmp --- a/musichomescreen_multiview/mpxcollectionpublisher/group/mpxcollectionpublisher.mmp Mon Mar 15 12:40:11 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -/* -* Copyright (c) 2008 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: Project definition file for Music Content Publisher. -* -*/ - - - -#include -#include "../inc/mpxcollectionpublisheruids.hrh" - -TARGET mpxcollectionpublisher.dll -TARGETTYPE PLUGIN -UID 0x10009D8D KMpxCollectionPublisherDLL - -CAPABILITY CAP_ECOM_PLUGIN -VENDORID VID_DEFAULT - -SOURCEPATH ../src -SOURCE proxy.cpp -SOURCE mpxcollectionpublisher.cpp - -USERINCLUDE ../inc - -APP_LAYER_SYSTEMINCLUDE -SYSTEMINCLUDE /epoc32/include/ecom -USERINCLUDE ../../inc - -SOURCEPATH ../data -START RESOURCE mpxcollectionpublisher.rss -HEADER -TARGET mpxcollectionpublisher.rsc -TARGETPATH resource/plugins -END - -LIBRARY ecom.lib -LIBRARY euser.lib -LIBRARY liwservicehandler.lib // TLiwVariant -LIBRARY mpxcollectionutility.lib -LIBRARY mpxcommon.lib -LIBRARY mpxcollectionhelper.lib - -// End of File - - diff -r 171e07ac910f -r c8156a91d13c musichomescreen_multiview/mpxcollectionpublisher/inc/mpxcollectionpublisher.h --- a/musichomescreen_multiview/mpxcollectionpublisher/inc/mpxcollectionpublisher.h Mon Mar 15 12:40:11 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,177 +0,0 @@ -/* -* Copyright (c) 2008-2008 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: Manages MCP plugins, and content publishing. -* -*/ - - -#ifndef C_MUSICCONTENTPUBLISHER_H -#define C_MUSICCONTENTPUBLISHER_H - -#include -#include - -class MLiwInterface; -class CLiwGenericParamList; - -// FORWARD DECLARATIONS -class MMPXCollectionUtility; -class MMPXCollectionUiHelper; -class CMPXCollectionPath; - -/** - * Music Content Publisher (a Content Harvester plugin) - * - * @lib musiccontentpublisher.dll - * @since S60 S60 v5.0 - */ -class CMpxCollectionPublisher : public CContentHarvesterPlugin - ,public MMPXCollectionObserver - { - -public: - - /** - * Two-phased constructor. - */ - static CMpxCollectionPublisher* NewL( MLiwInterface* aCPSInterface ); - - /** - * Destructor. - */ - virtual ~CMpxCollectionPublisher(); - - // from base class CContentHarvesterPlugin - /** - * From CContentHarvesterPlugin - * This is called by the Content Harvester Server to signal an update. - */ - void UpdateL(); - - //From Base class MMPXCollectionMediaObserver - /** - * From MMPXCollectionMediaObserver - * It handles open collection event. - */ - void HandleOpenL( const CMPXMedia& aEntries, TInt aIndex, - TBool aComplete, TInt aError ); - - /** - * From MMPXCollectionMediaObserver - * It handles open collection event. - */ - void HandleOpenL( const CMPXCollectionPlaylist& aPlaylist, - TInt aError ); - - /** - * From MMPXCollectionMediaObserver - * It handles MediaL event. - * - * @param aMedia object containing collection's informations - * @param aError error code - */ - void HandleCollectionMediaL( const CMPXMedia& aMedia, - TInt aError ); - - /** - * Handle collection message - * - * @param aMsg collection message, ownership not transferred. - * Please check aMsg is not NULL before using it. - * If aErr is not KErrNone, plugin might still call back with more - * info in the aMsg. - * @param aErr system error code. - */ - void HandleCollectionMessage( CMPXMessage* aMsg, TInt /*aErr*/); - - - -private: - - /** - * Default constructor. - */ - CMpxCollectionPublisher( MLiwInterface* aCPSInterface ); - - /** - * Perform the second phase construction - */ - void ConstructL(); - - /** - * Logic of HandleCollectionMessage, to avoid the function leaves - */ - void DoHandleGeneralMessageL(const CMPXMessage& aMsg); - - /** - * Logic of HandleCollectionMessage, to avoid the function leaves - * it handles item change operation - */ - void DoHandleItemChangedMessageL(const CMPXMessage& aMsg); - - /** - * Logic of HandleCollectionMessageL, to avoid the function leaves - */ - void HandleCollectionMessageL(CMPXMessage* aMsg); - - /** - * Called when a number needs to be updated. - * - * @since S60 5.0 - * @param aNum containing the number. - */ - void PublishNumberL( const TInt aNumb ); - -private: // data - - /** - * Instance of CPS interface used for update with CPS. - * Not own - */ - MLiwInterface* iCPSInterface; - - /** - * MPX Collection utility - * Own. - */ - MMPXCollectionUtility* iCollectionUtility; - - /** - * MPX Collection helper - * Own. - */ - MMPXCollectionUiHelper* iCollectionUiHelper; - - /** - * Path to Music collection - * Own. - */ - CMPXCollectionPath* iAllSongsPath; - - /** - * Indicates whether we're in a massive refresh operation - */ - TBool iRefreshOperation; - - /** - * Array containig wanted collection attributes - * Own. - */ - RArray iDefaultAttrs; - - }; - -#endif // C_MUSICCONTENTPUBLISHER_H - -// End of File diff -r 171e07ac910f -r c8156a91d13c musichomescreen_multiview/mpxcollectionpublisher/inc/mpxcollectionpublisheruids.hrh --- a/musichomescreen_multiview/mpxcollectionpublisher/inc/mpxcollectionpublisheruids.hrh Mon Mar 15 12:40:11 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* -* Copyright (c) 2008-2008 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: Resource headers for Music Content Publisher -* -*/ - - -#ifndef MPXCOLLECTIONPUBLISHERUIDS_H_ -#define MPXCOLLECTIONPUBLISHERUIDS_H_ - -/** Ecom implementation uid for Music Player Action Handler Plugin */ -#define KMpxCollectionPublisherUID 0x10207C1A - -/** Ecom dll uid for Music Player Action Handler Plugin */ -#define KMpxCollectionPublisherDLL 0x10207C1D - -#endif /*MPXCOLLECTIONPUBLISHERUIDS_H_*/ - -// End of File diff -r 171e07ac910f -r c8156a91d13c musichomescreen_multiview/mpxcollectionpublisher/rom/mpxcollectionpublisher.iby --- a/musichomescreen_multiview/mpxcollectionpublisher/rom/mpxcollectionpublisher.iby Mon Mar 15 12:40:11 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* Copyright (c) 2008-2008 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: IBY file for the Mpx Collection Publisher -* -*/ - - -#ifndef MPXCOLLECTIONPUBLISHER_IBY -#define MPXCOLLECTIONPUBLISHER_IBY - -ECOM_PLUGIN(mpxcollectionpublisher.dll, mpxcollectionpublisher.rss) - -#endif // MPXCOLLECTIONPUBLISHER_IBY - -// End of File diff -r 171e07ac910f -r c8156a91d13c musichomescreen_multiview/mpxcollectionpublisher/src/mpxcollectionpublisher.cpp --- a/musichomescreen_multiview/mpxcollectionpublisher/src/mpxcollectionpublisher.cpp Mon Mar 15 12:40:11 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,299 +0,0 @@ -/* -* Copyright (c) 2008-2008 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: Manages MCP plugins, and content publishing. -* -*/ - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "cpglobals.h" //This will be moved to domain API (HSFW) -#include "mpxcollectionpublisher.h" - - - -_LIT8( KMCPDataKey,"musicmenu_collectioninfo_numb1data" ); -_LIT( KMCPublisher, "MpxCollectionPublisher" ); -_LIT( KMCPType,"integer" ); -_LIT( KMCPContent,"musicmenu_collectioninfo_numb1" ); - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// Constructor -// --------------------------------------------------------------------------- -// -CMpxCollectionPublisher::CMpxCollectionPublisher( - MLiwInterface* aCPSInterface ) : iRefreshOperation( EFalse ) - { - iCPSInterface = aCPSInterface; - - } - -// --------------------------------------------------------------------------- -// Symbian 2nd phase constructor can leave. -// --------------------------------------------------------------------------- -// -void CMpxCollectionPublisher::ConstructL() - { - iDefaultAttrs.Append( KMPXMediaColDetailNumberOfItems ); - iCollectionUiHelper = - CMPXCollectionHelperFactory:: NewCollectionUiHelperL(); - iCollectionUtility = - MMPXCollectionUtility::NewL( this, KMcModeIsolated ); - - TUid collection = KLocalCollection; - collection = iCollectionUtility-> - Collection().CollectionIDL( collection ); - iCollectionUtility->Collection().CommandL( EMcCmdCollectionInit, - collection.iUid ); - //music - iAllSongsPath = iCollectionUiHelper->MusicAllSongsPathL(); - iCollectionUtility->Collection().CancelRequest(); - iCollectionUtility->Collection().MediaL( *iAllSongsPath , - iDefaultAttrs.Array()); - } - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -CMpxCollectionPublisher* CMpxCollectionPublisher::NewL( - MLiwInterface* aCPSInterface ) - { - CMpxCollectionPublisher* self = - new ( ELeave ) CMpxCollectionPublisher( aCPSInterface ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// Destructor -// --------------------------------------------------------------------------- -// -CMpxCollectionPublisher::~CMpxCollectionPublisher() - { - if ( iCollectionUiHelper ) - { - iCollectionUiHelper->Close(); - } - - if ( iCollectionUtility ) - { - iCollectionUtility->Close(); - } - iDefaultAttrs.Close(); - delete iAllSongsPath; - } - - -void CMpxCollectionPublisher::UpdateL() - { - - } - -// --------------------------------------------------------------------------- -// From MMPXCollectionObserver -// empty -// --------------------------------------------------------------------------- -// -void CMpxCollectionPublisher::HandleOpenL( const CMPXMedia& /* aMedia */, - TInt /* aIndex */, - TBool /* aComplete */,TInt /* aError */ ) - { - } - -// --------------------------------------------------------------------------- -// From MMPXCollectionObserver -// empty -// --------------------------------------------------------------------------- -// -void CMpxCollectionPublisher::HandleOpenL( - const CMPXCollectionPlaylist& /* aPlaylist */, - TInt /* aError */) - { - } - -// --------------------------------------------------------------------------- -// From MMPXCollectionObserver -// Handles MediaL -// --------------------------------------------------------------------------- -// -void CMpxCollectionPublisher::HandleCollectionMediaL( const CMPXMedia& aMedia, - TInt aError ) - { - if (KErrNone == aError && - aMedia.IsSupported( KMPXMediaColDetailNumberOfItems ) ) - { - TInt numberOfSongs = - aMedia.ValueTObjectL( KMPXMediaColDetailNumberOfItems ); - PublishNumberL( numberOfSongs ); - } - } - -// --------------------------------------------------------------------------- -// Handle collection messages. -// --------------------------------------------------------------------------- -// -void CMpxCollectionPublisher::HandleCollectionMessageL( CMPXMessage* aMsg ) - { - TMPXMessageId messageId = - aMsg->ValueTObjectL( KMPXMessageGeneralId ); - if ( messageId == KMPXMessageGeneral ) - { - DoHandleGeneralMessageL( *aMsg ); - } - else if( messageId == KMPXMessageIdItemChanged ) - { - // Loop through messages for arrays. - // - if ( aMsg->IsSupported( KMPXMessageArrayContents ) ) - { - CMPXMessageArray* messageArray = - aMsg->Value( KMPXMessageArrayContents ); - - User::LeaveIfNull( messageArray ); - for( TInt i=0; iCount(); ++i ) - { - HandleCollectionMessage( (*messageArray)[i], KErrNone); - } - } - else // Single item - { - DoHandleItemChangedMessageL( *aMsg ) ; - } - } - } - -// --------------------------------------------------------------------------- -// From MMPXCollectionObserver -// Handle collection messages. -// --------------------------------------------------------------------------- -// -void CMpxCollectionPublisher::HandleCollectionMessage( CMPXMessage* aMsg, - TInt aError ) - { - if ( aError == KErrNone && aMsg ) - { - TRAP_IGNORE( HandleCollectionMessageL( aMsg ) ); - } - } - -// --------------------------------------------------------------------------- -// Handle item change message. -// --------------------------------------------------------------------------- -// -void CMpxCollectionPublisher::DoHandleItemChangedMessageL( - const CMPXMessage& aMsg ) - { - TMPXChangeEventType eventType( - aMsg.ValueTObjectL( - KMPXMessageChangeEventType ) ); - TMPXItemId itemId( - aMsg.ValueTObjectL(KMPXMessageMediaGeneralId ) ); - - if ( !iRefreshOperation && - ( eventType == EMPXItemDeleted || eventType == EMPXItemInserted ) ) - { - //everytime an item is changed we need to refresh data - iCollectionUtility->Collection().CancelRequest(); - iCollectionUtility->Collection().MediaL( *iAllSongsPath , - iDefaultAttrs.Array() ); - } - - } - -// --------------------------------------------------------------------------- -// Handle collection general message. -// --------------------------------------------------------------------------- -// -void CMpxCollectionPublisher::DoHandleGeneralMessageL( - const CMPXMessage& aMsg ) - { - TInt event = aMsg.ValueTObjectL( KMPXMessageGeneralEvent ); - TInt type = aMsg.ValueTObjectL( KMPXMessageGeneralType ); - - - if ( event == TMPXCollectionMessage::EBroadcastEvent && - ( type == EMcMsgRefreshStart || type == EMcMsgFormatStart || - type == EMcMsgUSBMassStorageStart || type == EMcMsgUSBMTPStart ) - ) - { - //if refresh operation starts we block until refresh ends - iRefreshOperation = ETrue; - iCollectionUtility->Collection().CancelRequest(); - } - else if ( event == TMPXCollectionMessage::EBroadcastEvent && - ( type == EMcMsgRefreshEnd || type == EMcMsgFormatEnd || - type == EMcMsgDiskRemoved || type == EMcMsgDiskInserted || - type == EMcMsgUSBMassStorageEnd || type == EMcMsgUSBMTPEnd ) - ) - { - iRefreshOperation = EFalse; - iCollectionUtility->Collection().CancelRequest(); - iCollectionUtility->Collection().MediaL( *iAllSongsPath , - iDefaultAttrs.Array() ); - } - } - -// --------------------------------------------------------------------------- -// Publishes a number to the required destination -// --------------------------------------------------------------------------- -// - -void CMpxCollectionPublisher::PublishNumberL( const TInt aNumb ) - { - if ( iCPSInterface ) - { - CLiwGenericParamList * inParam = CLiwGenericParamList::NewLC(); - CLiwGenericParamList * outParam = CLiwGenericParamList::NewLC(); - - TLiwGenericParam cptype( KType, TLiwVariant( KCpData ) ); - inParam->AppendL( cptype ); - CLiwDefaultMap * cpdatamap = CLiwDefaultMap::NewLC(); - CLiwDefaultMap * map = CLiwDefaultMap::NewLC(); - - map->InsertL( KMCPDataKey, TLiwVariant( TInt32( aNumb ) ) ); - - cpdatamap->InsertL( KPublisherId, TLiwVariant( KMCPublisher ) ); - cpdatamap->InsertL( KContentType, TLiwVariant( KMCPType ) ); - cpdatamap->InsertL( KContentId, TLiwVariant( KMCPContent ) ); - cpdatamap->InsertL( KDataMap, TLiwVariant( map ) ); - - TLiwGenericParam item( KItem, TLiwVariant( cpdatamap ) ); - inParam->AppendL( item ); - - iCPSInterface->ExecuteCmdL( KAdd, *inParam, *outParam ); - - CleanupStack::PopAndDestroy( map ); - CleanupStack::PopAndDestroy( cpdatamap ); - CleanupStack::PopAndDestroy( outParam ); - CleanupStack::PopAndDestroy( inParam ); - } - } - - -// End of File - diff -r 171e07ac910f -r c8156a91d13c musichomescreen_multiview/mpxcollectionpublisher/src/proxy.cpp --- a/musichomescreen_multiview/mpxcollectionpublisher/src/proxy.cpp Mon Mar 15 12:40:11 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/* -* Copyright (c) 2008-2008 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: Music Content Publisher Implementation Proxy -* -*/ - - -#include -#include -#include "mpxcollectionpublisher.h" -#include "mpxcollectionpublisheruids.hrh" - -// --------------------------------------------------------------------------- -// Map the interface UIDs to implementation factory functions -// --------------------------------------------------------------------------- -// -const TImplementationProxy ImplementationTable[] = - { - IMPLEMENTATION_PROXY_ENTRY( KMpxCollectionPublisherUID, - CMpxCollectionPublisher::NewL ) - }; - -// --------------------------------------------------------------------------- -// Exported proxy for instantiation method resolution -// --------------------------------------------------------------------------- -// -EXPORT_C const TImplementationProxy* ImplementationGroupProxy( - TInt& aTableCount ) - { - aTableCount = - sizeof( ImplementationTable ) / sizeof( TImplementationProxy ); - - return ImplementationTable; - } - -// End of File diff -r 171e07ac910f -r c8156a91d13c musichomescreen_multiview/musiccontentpublisher/group/musiccontentpublisher.mmp --- a/musichomescreen_multiview/musiccontentpublisher/group/musiccontentpublisher.mmp Mon Mar 15 12:40:11 2010 +0200 +++ b/musichomescreen_multiview/musiccontentpublisher/group/musiccontentpublisher.mmp Wed Mar 31 21:26:33 2010 +0300 @@ -29,6 +29,7 @@ SOURCEPATH ../src SOURCE musiccontentpublisher.cpp +SOURCE musiccontentmap.cpp SOURCE proxy.cpp SOURCE pluginmanager.cpp SOURCE mcpharvesterpublisherobserver.cpp diff -r 171e07ac910f -r c8156a91d13c musichomescreen_multiview/musiccontentpublisher/inc/musiccontentmap.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/musichomescreen_multiview/musiccontentpublisher/inc/musiccontentmap.h Wed Mar 31 21:26:33 2010 +0300 @@ -0,0 +1,188 @@ +/* +* Copyright (c) 2008-2008 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: Manages MCP plugins, and content publishing. +* +*/ + +#ifndef C_MUSICCONTENTMAP_H +#define C_MUSICCONTENTMAP_H + +#include +#include + +// CLASS DECLARATION + +/** +* Data class to construct and hold variant values persistently. +*/ +class RMusicContentVariant { + public: + + /** + * Constructor + * + * Constructs a null variant value. + */ + RMusicContentVariant(); + + /** + * Reset variant to null value. + * Frees content. + */ + void Reset(); + + /** + * Set variant to integer value. + * @param New value. + * @return Whether the value was changed. + * Frees content of previous value. + */ + TBool SetL( TInt aInt); + + /** + * Set variant to string value. + * @param New value. An internal copy of the string is made. + * @return Whether the value was changed. + * Frees content of previous value. + */ + TBool SetL( const TDesC& aDesc ); + + /** + * Set variant to map value. + * @param New value. Reference counter of the map is increased. + * @return Whether the value was changed. + * Frees content of previous value. + */ + TBool SetL( CLiwMap * aMap ); + + /** + * Check whether value has been modified since the last ResetModified. + * @return ETrue if value has been modified. + */ + TBool IsModified() const; + + /** + * Reset modified flag. + * After calling this method IsModified returns EFalse. + */ + void ResetModified(); + + /** + * Return whether the value is null. + * @return ETrue if value is null. + */ + TBool IsNull() const; + + /** + * Return the value as TLiwVariant + * @return Value encapsulated in TLiwVariant. + */ + TLiwVariant LiwVariant() const; + + private: + + enum TType {ETypeNull, ETypeInt, ETypeBufC, ETypeMap}; + + TType iType; // type of the value + TBool iModified; // whether value has been modified + + // Data area + union { + TInt iInt; + HBufC * iBufC; // owned + CLiwMap * iMap; // reference counted + } iValue; + +}; + +// CLASS DECLARATION + +/** + * Persistent map of variable content + * + * @lib musiccontentpublisher.dll + * @since S60 S60 v5.0 + */ + +class RMusicContentMap { + public: + + /** + * Constructs an empty map + */ + RMusicContentMap(); + + /** + * Resets a single value in the map in case it exists + * @param aKey The key of the value to be reset + * Does nothing if the value does not exist + */ + void Reset( TPtrC8 aKey ); + + /** + * Sets a string value in the map + * @param aKey The key of the value + * @param aValue The value for the key. The string is copied. + */ + void SetL( TPtrC8 aKey, const TDesC& aValue ); + + /** + * Sets an integer value in the map + * @param aKey The key of the value + * @param aValue The value for the key. + */ + void SetL( TPtrC8 aKey, const TInt& aValue ); + + /** + * Sets an map value in the map + * @param aKey The key of the value + * @param aValue The value for the key. The reference count of the map is increased. + */ + void SetL( TPtrC8 aKey, CLiwMap * aMap ); + + /** + * Check whether value has been modified since last reading the values. + * @return ETrue if value has been modified. + */ + TBool IsModified() const; + + /** + * Reads all those entries from the map that have been modified + * since previous reading of values. Null values are not read. + * + * @return A freshly allocated map with modified values. Null is returned if there are no modifications. + */ + CLiwMap * GetModifiedLC (); + + /** + * Reads all non-null entries from the map. + * + * @return aMap A freshly allocated map with entries. Null is returned if map is empty. + */ + CLiwMap * GetAllLC(); + + /** + * Closes the map discarding all its content. + */ + void Close(); + + private: + + RMusicContentVariant& AtL (TPtrC8 aKey); + + RHashMap iMap; + TBool iModified; +}; + +#endif diff -r 171e07ac910f -r c8156a91d13c musichomescreen_multiview/musiccontentpublisher/inc/musiccontentpublisher.h --- a/musichomescreen_multiview/musiccontentpublisher/inc/musiccontentpublisher.h Mon Mar 15 12:40:11 2010 +0200 +++ b/musichomescreen_multiview/musiccontentpublisher/inc/musiccontentpublisher.h Wed Mar 31 21:26:33 2010 +0300 @@ -25,8 +25,9 @@ #include #include +#include "musiccontentmap.h" + class MLiwInterface; -class CLiwGenericParamList; class CPluginManager; class CFbsBitmap; class CCoeEnv; @@ -39,7 +40,7 @@ const TInt id; const wchar_t* type; const char* dataKey; - const wchar_t* content; + const char* maskKey; }; struct TMCPImageDestinationInfoItem @@ -56,47 +57,35 @@ CFbsBitmap *mask; }; -struct TMyBufferItem - { - TAny* buf; - TInt size; - }; - const TMCPDestinationItem KMCPDestinationInfo[] = { - { EMusicWidgetImage1, L"area1_image1", "area1_image1_data", L"*" } - ,{ EMusicWidgetText1, L"area2_text1", "area2_text1_data", L"*" } - ,{ EMusicWidgetToolbarB1, L"toolbar_b1", "toolbar_b1_data", L"*" } - ,{ EMusicWidgetToolbarB2, L"toolbar_b2", "toolbar_b2_data", L"*" } - ,{ EMusicWidgetToolbarB3, L"toolbar_b3", "toolbar_b3_data", L"*" } - ,{ EMusicWidgetDefaultText, L"default_text", "default_text_data", L"*" } + { EMusicWidgetImage1, L"area1_image1", "area1_image1_data", "area1_image1_data_mask" } + ,{ EMusicWidgetText1, L"area2_text1", "area2_text1_data", ""} + ,{ EMusicWidgetToolbarB1, L"toolbar_b1", "toolbar_b1_data", "toolbar_b1_data_mask" } + ,{ EMusicWidgetToolbarB2, L"toolbar_b2", "toolbar_b2_data", "toolbar_b2_data_mask" } + ,{ EMusicWidgetToolbarB3, L"toolbar_b3", "toolbar_b3_data", "toolbar_b3_data_mask" } + ,{ EMusicWidgetDefaultText, L"default_text", "default_text_data", "" } - ,{ EMusicWidgetTrigger1, L"area1_image1", "MWTrigger1", L"*" } - ,{ EMusicWidgetTrigger2, L"default_text", "MWTrigger2", L"*" } - ,{ EMusicWidgetTB1Trigger, L"toolbar_b1", "TB1Trigger", L"*" } - ,{ EMusicWidgetTB2Trigger, L"toolbar_b2", "TB2Trigger", L"*" } - ,{ EMusicWidgetTB3Trigger, L"toolbar_b3", "TB3Trigger", L"*" } - - ,{ EMusicMenuMusicInfoImage1, L"image", "musicmenu_musicinfo_imagedata", L"musicmenu_musicinfo_image" } - ,{ EMusicMenuMusicInfoLine1, L"text", "musicmenu_musicinfo_text1data", L"musicmenu_musicinfo_text1" } - ,{ EMusicMenuMusicInfoLine2, L"text", "musicmenu_musicinfo_text2data", L"musicmenu_musicinfo_text2" } - ,{ EMusicMenuMusicInfoTrigger, L"text", "MMInfoTrigger", L"musicmenu_musicinfo_text1" } + ,{ EMusicWidgetTrigger1, L"area1_image1", "MWTrigger1", "" } + ,{ EMusicWidgetTrigger2, L"default_text", "MWTrigger2", "" } + ,{ EMusicWidgetTB1Trigger, L"toolbar_b1", "TB1Trigger", "" } + ,{ EMusicWidgetTB2Trigger, L"toolbar_b2", "TB2Trigger", "" } + ,{ EMusicWidgetTB3Trigger, L"toolbar_b3", "TB3Trigger", "" } }; const TMCPImageDestinationInfoItem KMCPImageDestinationInfo[] = { - {EMusicWidgetImage1, 70,70} + {EMusicWidgetImage1, 70, 70} , {EMusicWidgetToolbarB1, 41,41} , {EMusicWidgetToolbarB2, 41,41} , {EMusicWidgetToolbarB3, 41,41} - , - {EMusicMenuMusicInfoImage1, 70,70} + }; /** @@ -274,6 +263,11 @@ void ConstructL(); /** + * Publish default content + */ + void PublishDefaultL(); + + /** * Installs an action, mainly for readability purposes. * * @since S60 5.0 @@ -296,21 +290,7 @@ * @param aDestination Destination trigger that should launch the action. */ void InstallEmptyActionL(TMCPTriggerDestination aDestination); - - - /** - * Maps an enum from TMCPImageDestination, TMCPTextDestination and - * TMCPTriggerDestination to it's keys on CPS. - * @param aEnum the enum/destination - * @param aType the type key is loaded here - * @param aDataKey the data key is loaded here - * @param aContent the content key is loaded here - * - * @since S60 5.0 - */ - void MapEnumToDestinationInfoL(TInt aEnum,TPtrC& aType, TPtrC8& aDataKey, - TPtrC& aContent); - + /** * Resets the Bitmap cache. * @@ -318,22 +298,13 @@ */ void ResetBitmapCache(); - /** - * Resets the publishing buffers. - * - * @since S60 5.0 - */ - void ResetPublishingBuffers(); - TUint RegisterPublisherL( const TDesC& aPublisherId, const TDesC& aContentId, const TDesC& aContentType ); - TUint CMusicContentPublisher::ExtractItemId( const CLiwGenericParamList& aInParamList ); - - void RemoveL( TInt aDestination ); - + TUint ExtractItemId( const CLiwGenericParamList& aInParamList ); + /** * Get a heap descriptor from the resource file * @@ -341,8 +312,14 @@ */ void GetLocalizedStringL(RResourceFile& aResourceFile, HBufC*& aRetBuf, TInt aResourceId); - - void DoPublishL(); + + void PublishDeferred(); + static TInt DoPublish(TAny * aMusicContentPublisher); + void DoPublishAllL(); + void DoPublishModifiedL(); + void DoPublishDeleteAllL(); + void DoPublishCmdL(const TDesC8& aCmd, const TDesC8& aKey, const CLiwMap * aValue); + private: // data @@ -368,7 +345,13 @@ /** * mapping for the destination translation. */ - RHashMap iDestinationMap; + struct TDestinationItem { + explicit TDestinationItem(const TMCPDestinationItem& aItem); + TPtrC iType; + TPtrC8 iDataKey; + TPtrC8 iMaskKey; + }; + RHashMap iDestinationMap; /** * mapping for the destination image info translation. @@ -381,14 +364,15 @@ RHashMap iBitmapCache; /** - * To keep the unpublished data. + * The published data */ - RHashMap iPublishingDataBuffers; + RMusicContentMap iPublishingDataMap; + RMusicContentMap iPublishingActionMap; /** - * To keep the unpublished actions. - */ - RHashMap iPublishingActionBuffers; + * Deferred callback to DoPublishL + */ + CAsyncCallBack * iDeferredPublish; /** * Skin server session. @@ -404,7 +388,6 @@ CMCPHarvesterPublisherObserver* iHPObserver; TBool iWidgetForeground; - TBool iWidgetActivated; HBufC* iInstanceId; diff -r 171e07ac910f -r c8156a91d13c musichomescreen_multiview/musiccontentpublisher/src/musiccontentmap.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/musichomescreen_multiview/musiccontentpublisher/src/musiccontentmap.cpp Wed Mar 31 21:26:33 2010 +0300 @@ -0,0 +1,344 @@ +/* +* Copyright (c) 2008-2008 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: Manages MCP plugins, and content publishing. +* +*/ + +#include "musiccontentmap.h" + +#include + +// ======== TRACING MACROS ======== + +// These extend macros in + +#ifdef _DEBUG +#define MPX_DEBUG2_8(cstr, p) RDebug::Printf(cstr, p) +#else +#define MPX_DEBUG2_8(cstr, p) +#endif + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// Constructor +// --------------------------------------------------------------------------- +// +RMusicContentVariant::RMusicContentVariant():iType(ETypeNull),iModified(EFalse){} + +// --------------------------------------------------------------------------- +// Reset value to null +// --------------------------------------------------------------------------- +// +void RMusicContentVariant::Reset() + { + switch (iType) + { + case ETypeNull: + return; + case ETypeInt: + break; + case ETypeBufC: + delete iValue.iBufC; + iValue.iBufC = 0; + break; + case ETypeMap: + if ( iValue.iMap ) + { + iValue.iMap->Close(); + iValue.iMap = 0; + } + break; + } + iType = ETypeNull; + iModified = ETrue; + }; + +// --------------------------------------------------------------------------- +// Set value +// --------------------------------------------------------------------------- +// +TBool RMusicContentVariant::SetL( TInt aInt) + { + if (iType != ETypeInt || iValue.iInt != aInt) + { + Reset(); + iValue.iInt = aInt; + iType = ETypeInt; + iModified = ETrue; + return ETrue; + } + else + { + return EFalse; + } + } + +// --------------------------------------------------------------------------- +// Set value +// --------------------------------------------------------------------------- +// +TBool RMusicContentVariant::SetL( const TDesC& aDesc ) + { + if (iType != ETypeBufC || iValue.iBufC->Compare(aDesc) ) + { + Reset(); + iValue.iBufC = aDesc.AllocL(); + iType = ETypeBufC; + iModified = ETrue; + return ETrue; + } + else + { + return EFalse; + } + } + +// --------------------------------------------------------------------------- +// Set value +// --------------------------------------------------------------------------- +// +TBool RMusicContentVariant::SetL( CLiwMap * aMap ) + { + if (iType != ETypeMap || ! ( *iValue.iMap == *aMap ) ) + { + Reset(); + TLiwVariant variant; + variant.SetL ( TLiwVariant (aMap) ); // increase CLiwMap reference counter + iValue.iMap = aMap; + iType = ETypeMap; + iModified = ETrue; + return ETrue; + } + else + { + return EFalse; + } + } + +// --------------------------------------------------------------------------- +// Return whether value has been modified +// --------------------------------------------------------------------------- +// +TBool RMusicContentVariant::IsModified() const + { + return iModified; + } + +// --------------------------------------------------------------------------- +// Reset modified flag +// --------------------------------------------------------------------------- +// +void RMusicContentVariant::ResetModified() + { + iModified = EFalse; + } + +// --------------------------------------------------------------------------- +// Return whether value is null +// --------------------------------------------------------------------------- +// +TBool RMusicContentVariant::IsNull() const + { + return iType == ETypeNull; + } + +// --------------------------------------------------------------------------- +// Return variant value +// --------------------------------------------------------------------------- +// +TLiwVariant RMusicContentVariant::LiwVariant() const + { + switch (iType) + { + case ETypeNull: + return TLiwVariant(); + case ETypeInt: + return TLiwVariant( iValue.iInt ); + case ETypeBufC: + return TLiwVariant( iValue.iBufC ); + case ETypeMap: + return TLiwVariant( iValue.iMap ); + } + return TLiwVariant(); + } + +// --------------------------------------------------------------------------- +// Hash function for the map +// --------------------------------------------------------------------------- +// +static inline TUint32 HashFunction(const TPtrC8& aKey) + { + return DefaultHash::Des8(aKey); + } + +// --------------------------------------------------------------------------- +// Identity relation for the map +// --------------------------------------------------------------------------- +// +static inline TBool IdentityRelation(const TPtrC8& aLeft, const TPtrC8& aRight) + { + return DefaultIdentity::Des8(aLeft, aRight); + } + +// --------------------------------------------------------------------------- +// Constructor +// --------------------------------------------------------------------------- +// +RMusicContentMap::RMusicContentMap(): + iMap( + THashFunction32< TPtrC8 >(&HashFunction), + TIdentityRelation< TPtrC8 >(&IdentityRelation) ), + iModified( EFalse ) + {} + +// --------------------------------------------------------------------------- +// Reset a value in the map +// --------------------------------------------------------------------------- +// +void RMusicContentMap::Reset( TPtrC8 aKey ) + { + MPX_DEBUG2_8("RMusicContentMap::Reset %S", &aKey); + RMusicContentVariant * value = iMap.Find( aKey ); + if ( value ) + { + iModified |= !value->IsNull(); + value->Reset(); + } + } + +// --------------------------------------------------------------------------- +// Set a value in the map +// --------------------------------------------------------------------------- +// +void RMusicContentMap::SetL( TPtrC8 aKey, const TDesC& aValue ) + { + MPX_DEBUG2_8("RMusicContentMap::SetL %S", &aKey); + iModified |= AtL( aKey ).SetL( aValue ); + } + +// --------------------------------------------------------------------------- +// Set a value in the map +// --------------------------------------------------------------------------- +// +void RMusicContentMap::SetL( TPtrC8 aKey, const TInt& aValue ) + { + MPX_DEBUG2_8("RMusicContentMap::SetL %S", &aKey); + iModified |= AtL( aKey ).SetL( aValue ); + } + +// --------------------------------------------------------------------------- +// Set a value in the map +// --------------------------------------------------------------------------- +// +void RMusicContentMap::SetL( TPtrC8 aKey, CLiwMap * aMap ) + { + MPX_DEBUG2_8("RMusicContentMap::SetL %S", &aKey); + iModified |= AtL( aKey ).SetL( aMap ); + } + +// --------------------------------------------------------------------------- +// Return whether map has been modified +// --------------------------------------------------------------------------- +// +TBool RMusicContentMap::IsModified() const + { + return iModified; + } + +// --------------------------------------------------------------------------- +// Get modified values +// --------------------------------------------------------------------------- +// +CLiwMap * RMusicContentMap::GetModifiedLC() + { + MPX_FUNC("RMusicContentMap::GetModifiedLC"); + CLiwMap * result = NULL; + if (iModified) + { + result = CLiwDefaultMap::NewLC(); + THashMapIter iter( iMap ); + while( const RMusicContentVariant * ptr = iter.NextValue() ) + { + if ( ! ptr->IsModified() ) continue; +/* + if ( ptr->IsNull() ) + { + MPX_DEBUG2_8("RMusicContentMap::GetModifiedL skipping %S (is null)", iter.CurrentKey()); + } + else +*/ + { + MPX_DEBUG2_8("RMusicContentMap::GetModifiedL publishing %S", iter.CurrentKey()); + result->InsertL( *iter.CurrentKey(), ptr->LiwVariant() ); + } + iter.CurrentValue()->ResetModified(); + } + iModified = EFalse; + } + return result; + } + +// --------------------------------------------------------------------------- +// Get all values +// --------------------------------------------------------------------------- +// +CLiwMap * RMusicContentMap::GetAllLC() + { + MPX_FUNC("RMusicContentMap::GetAllL"); + CLiwMap * result = NULL; + result = CLiwDefaultMap::NewLC(); + THashMapIter iter( iMap ); + while( const RMusicContentVariant * ptr = iter.NextValue() ) + { +/* if ( ptr->IsNull() ) + { + MPX_DEBUG2_8("RMusicContentMap::GetAllL skipping %S (is null)", iter.CurrentKey()); + } + else +*/ { + MPX_DEBUG2_8("RMusicContentMap::GetAllL publishing %S", iter.CurrentKey()); + result->InsertL( *iter.CurrentKey(), ptr->LiwVariant() ); + } + iter.CurrentValue()->ResetModified(); + } + iModified = EFalse; + return result; + } + +// --------------------------------------------------------------------------- +// Close map +// --------------------------------------------------------------------------- +// +void RMusicContentMap::Close() + { + MPX_FUNC("RMusicContentMap::Close"); + THashMapIter iter( iMap ); + while( iter.NextValue() ) + { + iter.CurrentValue()->Reset(); + } + iMap.Close(); + } + +RMusicContentVariant& RMusicContentMap::AtL (TPtrC8 aKey) + { + RMusicContentVariant * value = iMap.Find( aKey ); + if (! value ) + { + iMap.InsertL ( aKey, RMusicContentVariant() ); + value = iMap.Find( aKey ); + } + return *value; + } diff -r 171e07ac910f -r c8156a91d13c musichomescreen_multiview/musiccontentpublisher/src/musiccontentpublisher.cpp --- a/musichomescreen_multiview/musiccontentpublisher/src/musiccontentpublisher.cpp Mon Mar 15 12:40:11 2010 +0200 +++ b/musichomescreen_multiview/musiccontentpublisher/src/musiccontentpublisher.cpp Wed Mar 31 21:26:33 2010 +0300 @@ -37,9 +37,16 @@ #include "pluginmanager.h" #include "mcpharvesterpublisherobserver.h" +// These extend macros in + +#ifdef _DEBUG +#define MPX_DEBUG2_8(cstr, p) RDebug::Printf(cstr, p) +#else +#define MPX_DEBUG2_8(cstr, p) +#endif + _LIT( KPubData, "publisher" ); - _LIT8( KMyActive, "active" ); _LIT8( KMyDeActive, "deactive"); _LIT8( KMySuspend, "suspend"); @@ -47,16 +54,12 @@ _LIT8( KMyActionMap, "action_map" ); _LIT8( KMyItem, "item" ); _LIT8( KMyAdd, "Add" ); +_LIT8( KMyMusic, "music"); _LIT8( KMyItemId, "item_id" ); _LIT( KMyActionName, "data" ); _LIT( KEmpty, "" ); -_LIT( KLoc, "LOC:"); -_LIT( KWildCard, "*"); -_LIT( KNowPlaying, "LOC:NOW PLAYING" ); -_LIT( KLastPlayed, "LOC:LAST PLAYED" ); -_LIT( KMask, "_mask"); _LIT( KMWPublisher, "MWPublisher"); _LIT( KactionMessageToMusicPlayer, "MessageToMusicPlayer" ); _LIT( KGoToAlbumView, "GoToAlbumView" ); @@ -74,6 +77,13 @@ // ======== MEMBER FUNCTIONS ======== +CMusicContentPublisher::TDestinationItem::TDestinationItem(const TMCPDestinationItem& aItem): + iType( reinterpret_cast(aItem.type) ), + iDataKey ( reinterpret_cast(aItem.dataKey ) ), + iMaskKey ( reinterpret_cast(aItem.maskKey ) ) + {} + + // --------------------------------------------------------------------------- // Constructor // --------------------------------------------------------------------------- @@ -95,7 +105,7 @@ for (TInt i = 0; i < dstl; i++) { iDestinationMap.InsertL(KMCPDestinationInfo[i].id, - KMCPDestinationInfo[i]); + TDestinationItem(KMCPDestinationInfo[i])); } dstl = (sizeof(KMCPImageDestinationInfo)/sizeof( @@ -131,8 +141,6 @@ resourceFile.OpenL(fs,fileName); CleanupClosePushL(resourceFile); resourceFile.ConfirmSignatureL(); - GetLocalizedStringL(resourceFile, iLastPlayedBuffer, R_MUSICHOMESCREEN_LAST_PLAYED); - GetLocalizedStringL(resourceFile, iNowPlayingBuffer, R_MUSICHOMESCREEN_NOW_PLAYING); GetLocalizedStringL(resourceFile, iGoToMusicBuffer, R_MUSICHOMESCREEN_GO_TO_MUSIC); CleanupStack::PopAndDestroy(&resourceFile); CleanupStack::PopAndDestroy(&fs); @@ -143,6 +151,9 @@ // enable skin. AknsUtils::InitSkinSupportL(); + + iDeferredPublish = new (ELeave) CAsyncCallBack(TCallBack(DoPublish, this), + CActive::EPriorityLow); MPX_DEBUG1("CMusicContentPublisher::ConstructL subscribing to observer"); @@ -153,21 +164,19 @@ if( id != 0 ) { - CLiwDefaultMap* filter = CLiwDefaultMap::NewLC(); + CLiwDefaultMap* filter = CLiwDefaultMap::NewLC(); - filter->InsertL( KPublisherId, TLiwVariant( KMWPublisher ) ); - filter->InsertL( KContentId, TLiwVariant( KAll) ); - filter->InsertL( KContentType, TLiwVariant( KAll ) ); + filter->InsertL( KPublisherId, TLiwVariant( KMWPublisher ) ); + filter->InsertL( KContentId, TLiwVariant( KAll) ); + filter->InsertL( KContentType, TLiwVariant( KAll ) ); - iHPObserver = CMCPHarvesterPublisherObserver::NewL(this); - iHPObserver->RegisterL(filter); - CleanupStack::PopAndDestroy(filter); + iHPObserver = CMCPHarvesterPublisherObserver::NewL(this); + iHPObserver->RegisterL(filter); + CleanupStack::PopAndDestroy(filter); } - //Reset the music menu info - InstallEmptyActionL(EMusicMenuMusicInfoTrigger); - PublishTextL( NULL, EMusicMenuMusicInfoLine1, iLastPlayedBuffer->Des() ); - PublishTextL( NULL, EMusicMenuMusicInfoLine2, KEmpty ); - PublishImageL( NULL, EMusicMenuMusicInfoImage1, KEmpty ); + + MPX_DEBUG1("CMusicContentPublisher::ConstructL initializing content"); + PublishDefaultL(); MPX_DEBUG1("CMusicContentPublisher::ConstructL --->"); } @@ -195,13 +204,12 @@ { MPX_DEBUG1("CMusicContentPublisher::~CMusicContentPublisher <---"); + delete iDeferredPublish; if(iHPObserver) { MPX_DEBUG1("CMusicContentPublisher::~CMusicContentPublisher deleting observer"); delete iHPObserver; } - delete iNowPlayingBuffer; - delete iLastPlayedBuffer; delete iGoToMusicBuffer; MPX_DEBUG1("CMusicContentPublisher::~CMusicContentPublisher closing destination maps"); iImageDestinationSizeMap.Close(); @@ -212,8 +220,9 @@ iAknsSrvSession.Close(); MPX_DEBUG1("CMusicContentPublisher::~CMusicContentPublisher deleting plugin manager"); delete iPluginManager; - MPX_DEBUG1("CMusicContentPublisher::~CMusicContentPublisher resetting publishing buffers"); - ResetPublishingBuffers(); + MPX_DEBUG1("CMusicContentPublisher::~CMusicContentPublisher resetting publishing maps"); + iPublishingDataMap.Close(); + iPublishingActionMap.Close(); MPX_DEBUG1("CMusicContentPublisher::~CMusicContentPublisher --->"); if ( iInstanceId ) { @@ -225,6 +234,26 @@ // // --------------------------------------------------------------------------- // +void CMusicContentPublisher::PublishDefaultL() + { + MPX_FUNC("CMusicContentPublisher::PublishDefaultL"); + PublishImageL(NULL,EMusicWidgetImage1,KEmpty); + InstallGoToAlbumL( EMusicWidgetTrigger1 ); + PublishTextL( NULL,EMusicWidgetDefaultText, *iGoToMusicBuffer ); + PublishTextL( NULL,EMusicWidgetText1, KEmpty ); + PublishImageL(NULL,EMusicWidgetToolbarB1,KEmpty); + PublishImageL(NULL,EMusicWidgetToolbarB2,KEmpty); + PublishImageL(NULL,EMusicWidgetToolbarB3,KEmpty); + InstallEmptyActionL(EMusicWidgetTB1Trigger); + InstallEmptyActionL(EMusicWidgetTB2Trigger); + InstallEmptyActionL(EMusicWidgetTB3Trigger); + InstallGoToAlbumL( EMusicWidgetTrigger2 ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// void CMusicContentPublisher::InstallGoToMusicL( TMCPTriggerDestination aDestination ) { @@ -286,46 +315,6 @@ CleanupStack::PopAndDestroy( mapTrigger ); MPX_DEBUG1("CMusicContentPublisher::InstallEmptyActionL --->"); } -// --------------------------------------------------------------------------- -// -// --------------------------------------------------------------------------- -// -void CMusicContentPublisher::MapEnumToDestinationInfoL(TInt aEnum, - TPtrC& aType, TPtrC8& aDataKey, TPtrC& aContent) - { - MPX_DEBUG1("CMusicContentPublisher::MapEnumToDestinationInfoL <---"); - TMCPDestinationItem* tmpdstitemp; - tmpdstitemp = iDestinationMap.Find(aEnum); - - if (tmpdstitemp) - { - TPtrC type ( reinterpret_cast( - tmpdstitemp->type) ); - TPtrC8 dataKey ( reinterpret_cast( - tmpdstitemp->dataKey ) ); - TPtrC content ( reinterpret_cast( - tmpdstitemp->content) ); - - aType.Set(type); - aDataKey.Set(dataKey); - - if ( !content.Compare( KWildCard ) ) - { - aContent.Set(iInstanceId ? iInstanceId->Des(): KNullDesC() ); - } - else - { - aContent.Set(content); - } - } - else - { - //API user provided an invalid destination or the destination is not - //defined properly. - __ASSERT_DEBUG(EFalse,User::Invariant()); - } - MPX_DEBUG1("CMusicContentPublisher::MapEnumToDestinationInfoL --->"); - } // ---------------------------------------------------------------------------- // Get a heap descriptor from the resource file @@ -344,96 +333,158 @@ } // ---------------------------------------------------------------------------- -// Publishes buffered data and actions. +// Trigger deferred publishing through an active object +// ---------------------------------------------------------------------------- +// +void CMusicContentPublisher::PublishDeferred() + { + MPX_FUNC("CMusicContentPublisher::PublishDeferred"); + if ( iWidgetForeground ) + { + iDeferredPublish->CallBack(); + } + } + +// ---------------------------------------------------------------------------- +// Run deferred publishing +// ---------------------------------------------------------------------------- +// + TInt CMusicContentPublisher::DoPublish(TAny * aMusicContentPublisher) + { + MPX_FUNC("CMusicContentPublisher::DoPublish"); + CMusicContentPublisher * self = static_cast(aMusicContentPublisher); + if ( self->iWidgetForeground ) + { + TRAPD(err, self->DoPublishModifiedL()); + if (err != KErrNone) + { + MPX_DEBUG2("CMusicContentPublisher::DoPublish failed, err=%d", err); + } + } + return KErrNone; + } + +// ---------------------------------------------------------------------------- +// Publish all content +// ---------------------------------------------------------------------------- +// +void CMusicContentPublisher::DoPublishAllL() + { + MPX_FUNC("CMusicContentPublisher::DoPublishAllL"); + if (iCPSInterface && iInstanceId) + { + CLiwMap * datamap = iPublishingDataMap.GetAllLC(); + CLiwMap * actionmap = iPublishingActionMap.GetAllLC(); + + CLiwDefaultMap * cpdata = CLiwDefaultMap::NewLC( ); + cpdata->InsertL( KPublisherId , TLiwVariant( KMWPublisher ) ); + cpdata->InsertL( KContentType , TLiwVariant( KMyMusic ) ); + cpdata->InsertL( KContentId , TLiwVariant( iInstanceId ) ); + cpdata->InsertL( KDataMap , TLiwVariant( datamap ) ); + cpdata->InsertL( KActionMap , TLiwVariant( actionmap ) ); + + MPX_DEBUG2("CMusicContentPublisher::DoPublishAllL Add in %S", iInstanceId); + DoPublishCmdL( KAdd, KItem, cpdata ); + + CleanupStack::PopAndDestroy( cpdata ); + CleanupStack::PopAndDestroy( actionmap ); + CleanupStack::PopAndDestroy( datamap ); + } + } + +// ---------------------------------------------------------------------------- +// Publish modified content // ---------------------------------------------------------------------------- // -void CMusicContentPublisher::DoPublishL() +void CMusicContentPublisher::DoPublishModifiedL() { - MPX_DEBUG1("CMusicContentPublisher::DoPublishL <---"); - THashMapIter dataIter( iPublishingDataBuffers ); - MPX_DEBUG1("CMusicContentPublisher::DoPublishL publishing data"); - - TMyBufferItem const* itemptr; - itemptr = dataIter.NextValue(); - while (itemptr) + MPX_FUNC("CMusicContentPublisher::DoPublishModifiedL"); + if (iCPSInterface && iInstanceId ) { - CLiwGenericParamList* inParam = CLiwGenericParamList::NewLC(); - CLiwGenericParamList* outParam = CLiwGenericParamList::NewLC(); - - TPtrC8 dataKey; - TPtrC type; - TPtrC content; - MapEnumToDestinationInfoL(*dataIter.CurrentKey(), type, dataKey, content); + CLiwMap * datamap = iPublishingDataMap.GetModifiedLC(); + // Must re-publish all actions even if only one of them has changed, + // otherwise non-modified actions won't work any more + CLiwMap * actionmap = NULL; + if ( iPublishingActionMap.IsModified() ) + { + actionmap = iPublishingActionMap.GetAllLC(); + } + if ( datamap || actionmap ) + { + CLiwMap * cpdata = CLiwDefaultMap::NewLC( ); + cpdata->InsertL( KPublisherId , TLiwVariant( KMWPublisher ) ); + cpdata->InsertL( KContentType , TLiwVariant( KMyMusic ) ); + cpdata->InsertL( KContentId , TLiwVariant( iInstanceId ) ); + if ( datamap && datamap->Count() ) + { + cpdata->InsertL( KDataMap , TLiwVariant( datamap ) ); + } + if ( actionmap && actionmap->Count() ) + { + cpdata->InsertL( KActionMap , TLiwVariant( actionmap ) ); + } + + MPX_DEBUG2("CMusicContentPublisher::DoPublishModifiedL Add in %S", iInstanceId); + DoPublishCmdL( KAdd, KItem, cpdata ); - TLiwGenericParam cptype( KType , TLiwVariant( KCpData ) ); - inParam->AppendL( cptype ); - CLiwDefaultMap* cpdatamap = CLiwDefaultMap::NewLC( ); - - - RMemReadStream rs( itemptr->buf, itemptr->size ); - CLiwDefaultMap* map = CLiwDefaultMap::NewLC( rs ); - - cpdatamap->InsertL( KPublisherId , TLiwVariant( KMWPublisher ) ); - cpdatamap->InsertL( KContentType , TLiwVariant( type ) ); - cpdatamap->InsertL( KContentId , TLiwVariant( content ) ); - cpdatamap->InsertL( KDataMap , TLiwVariant( map ) ); - - TLiwGenericParam item( KItem, TLiwVariant( cpdatamap ) ); - inParam->AppendL( item ); - - iCPSInterface->ExecuteCmdL( KAdd , *inParam, *outParam ); - CleanupStack::PopAndDestroy( map ); - CleanupStack::PopAndDestroy( cpdatamap ); - CleanupStack::PopAndDestroy( outParam ); - CleanupStack::PopAndDestroy( inParam ); - - itemptr = dataIter.NextValue(); + CleanupStack::PopAndDestroy( cpdata ); + } + if (actionmap) + { + CleanupStack::PopAndDestroy( actionmap ); + } + if (datamap) + { + CleanupStack::PopAndDestroy( datamap ); + } } - - //The order in wich we publish is important, actions should be published after the data contents. - THashMapIter actionIter( iPublishingActionBuffers ); - MPX_DEBUG1("CMusicContentPublisher::DoPublishL publishing actions"); - - itemptr = NULL; - itemptr = actionIter.NextValue(); - while (itemptr) - { - CLiwGenericParamList* inParam = CLiwGenericParamList::NewLC(); - CLiwGenericParamList* outParam = CLiwGenericParamList::NewLC(); - - TPtrC8 dataKey; - TPtrC type; - TPtrC content; - MapEnumToDestinationInfoL( *actionIter.CurrentKey(), type, dataKey, content ); - - TLiwGenericParam cptype( KType , TLiwVariant( KCpData ) ); - inParam->AppendL( cptype ); - CLiwDefaultMap* cpdatamap = CLiwDefaultMap::NewLC( ); - - - RMemReadStream rs( itemptr->buf, itemptr->size ); - CLiwDefaultMap* map = CLiwDefaultMap::NewLC( rs ); - - cpdatamap->InsertL( KPublisherId , TLiwVariant( KMWPublisher ) ); - cpdatamap->InsertL( KContentType , TLiwVariant( type ) ); - cpdatamap->InsertL( KContentId , TLiwVariant( content ) ); - cpdatamap->InsertL( KMyActionMap , TLiwVariant( map ) ); - - TLiwGenericParam item( KItem, TLiwVariant( cpdatamap ) ); - inParam->AppendL( item ); - - iCPSInterface->ExecuteCmdL( KAdd , *inParam, *outParam ); - CleanupStack::PopAndDestroy( map ); - CleanupStack::PopAndDestroy( cpdatamap ); - CleanupStack::PopAndDestroy( outParam ); - CleanupStack::PopAndDestroy( inParam ); - - itemptr = actionIter.NextValue(); - } - MPX_DEBUG1("CMusicContentPublisher::CMusicContentPublisher::DoPublishL --->"); } // --------------------------------------------------------------------------- +// Remove all content +// --------------------------------------------------------------------------- +// +void CMusicContentPublisher::DoPublishDeleteAllL() + { + MPX_FUNC("CMusicContentPublisher::DoPublishDeleteAllL"); + if( iCPSInterface && iInstanceId) + { + CLiwDefaultMap * cpdata = CLiwDefaultMap::NewLC( ); + cpdata->InsertL( KPublisherId , TLiwVariant( KMWPublisher ) ); + cpdata->InsertL( KContentType , TLiwVariant( KAll ) ); + cpdata->InsertL( KContentId , TLiwVariant( iInstanceId ) ); + + MPX_DEBUG2("CMusicContentPublisher::DoPublishDeleteAllL Delete All in %S", iInstanceId); + DoPublishCmdL( KDelete, KFilter, cpdata ); + + CleanupStack::PopAndDestroy( cpdata ); + } + } + +// --------------------------------------------------------------------------- +// Execute a CMD to iCPSInterface +// --------------------------------------------------------------------------- +// +void CMusicContentPublisher::DoPublishCmdL(const TDesC8& aCmd, + const TDesC8& aKey, + const CLiwMap * aValue) + { + MPX_FUNC("CMusicContentPublisher::DoPublishCmdL"); + CLiwGenericParamList * inParam = CLiwGenericParamList::NewLC(); + TLiwGenericParam cptype( KType , TLiwVariant( KCpData ) ); + inParam->AppendL( cptype ); + TLiwGenericParam item( aKey, TLiwVariant( aValue ) ); + inParam->AppendL( item ); + + CLiwGenericParamList * outParam = CLiwGenericParamList::NewLC(); + + iCPSInterface->ExecuteCmdL( aCmd , *inParam, *outParam); + + CleanupStack::PopAndDestroy( outParam ); + CleanupStack::PopAndDestroy( inParam ); + } + +// --------------------------------------------------------------------------- // Resets all the graphical elements. // --------------------------------------------------------------------------- // @@ -443,23 +494,7 @@ //Plugin deletion is handled by the pluginmanager. iActivePlugin = NULL; //Reset The Widget - PublishImageL(NULL,EMusicWidgetImage1,KEmpty); - InstallGoToAlbumL(EMusicWidgetTrigger1); - PublishTextL( NULL,EMusicWidgetText1, KEmpty ); - PublishImageL(NULL,EMusicWidgetToolbarB1,KEmpty); - PublishImageL(NULL,EMusicWidgetToolbarB2,KEmpty); - PublishImageL(NULL,EMusicWidgetToolbarB3,KEmpty); - InstallEmptyActionL(EMusicWidgetTB1Trigger); - InstallEmptyActionL(EMusicWidgetTB2Trigger); - InstallEmptyActionL(EMusicWidgetTB3Trigger); - PublishTextL( NULL,EMusicWidgetDefaultText, iGoToMusicBuffer->Des() ); - InstallGoToAlbumL(EMusicWidgetTrigger2); - - //Reset the music menu info - InstallEmptyActionL(EMusicMenuMusicInfoTrigger); - PublishTextL( NULL, EMusicMenuMusicInfoLine1, iLastPlayedBuffer->Des() ); - PublishTextL( NULL, EMusicMenuMusicInfoLine2, KEmpty ); - PublishImageL( NULL, EMusicMenuMusicInfoImage1, KEmpty ); + PublishDefaultL(); MPX_DEBUG1("CMusicContentPublisher::Reset --->"); } // --------------------------------------------------------------------------- @@ -511,34 +546,9 @@ } // --------------------------------------------------------------------------- -// Destroys the publishing buffers. +// // --------------------------------------------------------------------------- // -void CMusicContentPublisher::ResetPublishingBuffers() - { - THashMapIter dataIter( iPublishingDataBuffers ); - THashMapIter actionIter( iPublishingActionBuffers ); - - TMyBufferItem const* itemptr; - itemptr = dataIter.NextValue(); - while (itemptr) - { - User::Free(itemptr->buf); - dataIter.RemoveCurrent(); - itemptr = dataIter.NextValue(); - } - iPublishingDataBuffers.Close(); - itemptr = NULL; - itemptr = actionIter.NextValue(); - while (itemptr) - { - User::Free(itemptr->buf); - actionIter.RemoveCurrent(); - itemptr = actionIter.NextValue(); - } - iPublishingActionBuffers.Close(); - } - TUint CMusicContentPublisher::RegisterPublisherL( const TDesC& aPublisherId, const TDesC& aContentId, @@ -605,36 +615,6 @@ return result; } - // --------------------------------------------------------------------------- -// removes CPS entry for the required destination -// --------------------------------------------------------------------------- -// -void CMusicContentPublisher::RemoveL( TInt aDestination ) - { - MPX_DEBUG1("CMusicContentPublisher::RemoveL <---"); - if( iCPSInterface ) - { - CLiwGenericParamList * inParam = CLiwGenericParamList::NewLC(); - CLiwGenericParamList * outParam = CLiwGenericParamList::NewLC(); - TPtrC8 dataKey; - TPtrC type; - TPtrC content; - MapEnumToDestinationInfoL(aDestination, type, dataKey, content); - TLiwGenericParam cptype( KType , TLiwVariant( KCpData ) ); - inParam->AppendL( cptype ); - CLiwDefaultMap * cpdatamap = CLiwDefaultMap::NewLC( ); - cpdatamap->InsertL( KPublisherId , TLiwVariant( KMWPublisher ) ); - cpdatamap->InsertL( KContentType , TLiwVariant( type ) ); - cpdatamap->InsertL( KContentId , TLiwVariant( content ) ); - TLiwGenericParam item( KFilter, TLiwVariant( cpdatamap ) ); - inParam->AppendL( item ); - iCPSInterface->ExecuteCmdL( KDelete , *inParam, *outParam); - CleanupStack::PopAndDestroy( cpdatamap ); - CleanupStack::PopAndDestroy( outParam ); - CleanupStack::PopAndDestroy( inParam ); - } - MPX_DEBUG1("CMusicContentPublisher::RemoveL --->"); - } // --------------------------------------------------------------------------- // Publishes an image from path to the required destination @@ -644,64 +624,20 @@ TMCPImageDestination aDestination, const TDesC& aImagePath ) { - MPX_DEBUG1("CMusicContentPublisher::PublishImageL <---"); + MPX_FUNC("CMusicContentPublisher::PublishImageL"); + if ( aDestination >= EMusicMenuMusicInfoImage1 ) + { + MPX_DEBUG2("CMusicContentPublisher::PublishImageL deprecated aDestination=%d", aDestination); + return; + } + if( iCPSInterface && iActivePlugin == aPlugin ) { - CLiwGenericParamList * inParam = CLiwGenericParamList::NewLC(); - CLiwGenericParamList * outParam = CLiwGenericParamList::NewLC(); - - TPtrC8 dataKey; - TPtrC type; - TPtrC content; - MapEnumToDestinationInfoL(aDestination, type, dataKey, content); - - TLiwGenericParam cptype( KType , TLiwVariant( KCpData ) ); - inParam->AppendL( cptype ); - CLiwDefaultMap * cpdatamap = CLiwDefaultMap::NewLC( ); - CLiwDefaultMap * map = CLiwDefaultMap::NewLC( ); - - - map->InsertL(dataKey, TLiwVariant( aImagePath ) ); - - cpdatamap->InsertL( KPublisherId , TLiwVariant( KMWPublisher ) ); - cpdatamap->InsertL( KContentType , TLiwVariant( type ) ); - cpdatamap->InsertL( KContentId , TLiwVariant( content ) ); - cpdatamap->InsertL( KDataMap , TLiwVariant( map ) ); - - TLiwGenericParam item( KItem, TLiwVariant( cpdatamap ) ); - inParam->AppendL( item ); - - if ( aDestination >= EMusicMenuMusicInfoImage1 ) - { - iCPSInterface->ExecuteCmdL( KAdd , *inParam, *outParam ); - } - else - { - if ( iWidgetForeground ) - { - iCPSInterface->ExecuteCmdL( KAdd , *inParam, *outParam ); - } - TMyBufferItem* ptr; - ptr = iPublishingDataBuffers.Find(aDestination); - if (ptr) //remove the old one - { - User::Free(ptr->buf); - iPublishingDataBuffers.Remove(aDestination); - } - TInt sz = map->Size(); - TMyBufferItem bufferitem; - bufferitem.size = map->Size(); - bufferitem.buf = User::AllocL(map->Size()); - RMemWriteStream ws(bufferitem.buf, bufferitem.size); - map->ExternalizeL(ws); - iPublishingDataBuffers.Insert(aDestination, bufferitem); - } - CleanupStack::PopAndDestroy( map ); - CleanupStack::PopAndDestroy( cpdatamap ); - CleanupStack::PopAndDestroy( outParam ); - CleanupStack::PopAndDestroy( inParam ); - } - MPX_DEBUG1("CMusicContentPublisher::PublishImageL --->"); + TDestinationItem & destination (iDestinationMap.FindL( aDestination )); + iPublishingDataMap.SetL( destination.iDataKey, aImagePath ); + iPublishingDataMap.Reset( destination.iMaskKey ); + PublishDeferred(); + } } // --------------------------------------------------------------------------- @@ -713,95 +649,28 @@ TInt aBitmapHandle, TInt aMaskBitmapHandle) { - MPX_DEBUG1("CMusicContentPublisher::PublishImageL <---"); + MPX_FUNC("CMusicContentPublisher::PublishImageL"); + if ( aDestination >= EMusicMenuMusicInfoImage1 ) + { + MPX_DEBUG2("CMusicContentPublisher::PublishImageL deprecated aDestination=%d", aDestination); + return; + } if( iCPSInterface && iActivePlugin == aPlugin ) { - CLiwGenericParamList * inParam = CLiwGenericParamList::NewLC(); - CLiwGenericParamList * outParam = CLiwGenericParamList::NewLC(); - - TPtrC8 dataKey; - TPtrC type; - TPtrC content; - MapEnumToDestinationInfoL(aDestination, type, dataKey, content); - - TLiwGenericParam cptype( KType , TLiwVariant( KCpData ) ); - inParam->AppendL( cptype ); - CLiwDefaultMap * cpdatamap = CLiwDefaultMap::NewLC( ); - CLiwDefaultMap * map = CLiwDefaultMap::NewLC( ); + TDestinationItem & destination (iDestinationMap.FindL( aDestination )); - - if (aDestination == EMusicMenuMusicInfoImage1) - { - //Matrix Menu expects a Tint32 (TVariantTypeId::EVariantTypeTInt32) - map->InsertL(dataKey, TLiwVariant( TInt32( aBitmapHandle ) ) ); - } - else - { - //Homescreen expects a TBool/TInt - //(TVariantTypeId::EVariantTypeTBool) - map->InsertL(dataKey, TLiwVariant( aBitmapHandle ) ); - } + iPublishingDataMap.SetL( destination.iDataKey, aBitmapHandle ); if (aMaskBitmapHandle) { - HBufC8* maskResult = HBufC8::NewLC( - dataKey.Length() + KMask().Length() ); - TPtr8 maskResultPtr = maskResult->Des(); - maskResultPtr.Append( dataKey ); - maskResultPtr.Append( KMask ); - if (aDestination == EMusicMenuMusicInfoImage1) - { - //Matrix Menu expects a Tint32 (TVariantTypeId::EVariantTypeTInt32) - map->InsertL(maskResultPtr, TLiwVariant( (TInt32)aMaskBitmapHandle ) ); - } - else - { - //Homescreen expects a TBool/TInt - //(TVariantTypeId::EVariantTypeTBool) - map->InsertL(maskResultPtr, TLiwVariant( aMaskBitmapHandle ) ); - } - CleanupStack::PopAndDestroy( maskResult ); - } - - cpdatamap->InsertL( KPublisherId , TLiwVariant( KMWPublisher ) ); - cpdatamap->InsertL( KContentType , TLiwVariant( type ) ); - cpdatamap->InsertL( KContentId , TLiwVariant( content ) ); - cpdatamap->InsertL( KDataMap , TLiwVariant( map ) ); - - TLiwGenericParam item( KItem, TLiwVariant( cpdatamap ) ); - inParam->AppendL( item ); - - if ( aDestination >= EMusicMenuMusicInfoImage1 ) - { - iCPSInterface->ExecuteCmdL( KAdd , *inParam, *outParam ); + iPublishingDataMap.SetL( destination.iMaskKey, aMaskBitmapHandle ); } else { - if ( iWidgetForeground ) - { - iCPSInterface->ExecuteCmdL( KAdd , *inParam, *outParam ); - } - TMyBufferItem* ptr; - ptr = iPublishingDataBuffers.Find(aDestination); - if (ptr) //remove the old one - { - User::Free(ptr->buf); - iPublishingDataBuffers.Remove(aDestination); - } - TInt sz = map->Size(); - TMyBufferItem bufferitem; - bufferitem.size = map->Size(); - bufferitem.buf = User::AllocL(map->Size()); - RMemWriteStream ws(bufferitem.buf, bufferitem.size); - map->ExternalizeL(ws); - iPublishingDataBuffers.Insert(aDestination, bufferitem); + iPublishingDataMap.Reset( destination.iMaskKey ); } - CleanupStack::PopAndDestroy( map ); - CleanupStack::PopAndDestroy( cpdatamap ); - CleanupStack::PopAndDestroy( outParam ); - CleanupStack::PopAndDestroy( inParam ); + PublishDeferred(); } - MPX_DEBUG1("CMusicContentPublisher::PublishImageL --->"); } // --------------------------------------------------------------------------- @@ -815,7 +684,13 @@ const TInt aFileBitmapId, const TInt aFileMaskId ) { - MPX_DEBUG1("CMusicContentPublisher::PublishImageL <---"); + MPX_FUNC("CMusicContentPublisher::PublishImageL"); + if ( aDestination >= EMusicMenuMusicInfoImage1 ) + { + MPX_DEBUG2("CMusicContentPublisher::PublishImageL deprecated aDestination=%d", aDestination); + return; + } + TBmpMsk* bitmapandmask; bitmapandmask = iBitmapCache.Find(aID.iMajor+aID.iMinor); CFbsBitmap* bitmap = NULL; @@ -850,7 +725,6 @@ mask = bitmapandmask->mask; PublishImageL( aPlugin, aDestination, bitmap->Handle() , mask->Handle()); - MPX_DEBUG1("CMusicContentPublisher::PublishImageL --->"); } // --------------------------------------------------------------------------- @@ -861,88 +735,21 @@ TMCPTextDestination aDestination, const TDesC& aText ) { - MPX_DEBUG1("CMusicContentPublisher::PublishTextL <---"); + MPX_FUNC("CMusicContentPublisher::PublishTextL"); + if ( aDestination >= EMusicMenuMusicInfoLine1 ) + { + MPX_DEBUG2("CMusicContentPublisher::PublishTextL deprecated aDestination=%d", aDestination); + return; + } + if( iCPSInterface && iActivePlugin == aPlugin) { - CLiwGenericParamList * inParam = CLiwGenericParamList::NewLC(); - CLiwGenericParamList * outParam = CLiwGenericParamList::NewLC(); - - TPtrC8 dataKey; - TPtrC type; - TPtrC content; - MapEnumToDestinationInfoL(aDestination, type, dataKey, content); - - TLiwGenericParam cptype( KType , TLiwVariant( KCpData ) ); - inParam->AppendL( cptype ); - CLiwDefaultMap * cpdatamap = CLiwDefaultMap::NewLC( ); - CLiwDefaultMap * map = CLiwDefaultMap::NewLC( ); - - if (KErrNotFound == aText.Find(KLoc)) - { - map->InsertL( dataKey , TLiwVariant( aText ) ); - } - else - { - if ( ! aText.Compare( KNowPlaying ) ) - { - map->InsertL( dataKey , TLiwVariant( iNowPlayingBuffer ) ); - } - else if ( ! aText.Compare( KLastPlayed ) ) - { - map->InsertL( dataKey , TLiwVariant( iLastPlayedBuffer ) ); - } - else - { - map->InsertL( dataKey , TLiwVariant( aText ) ); - } - } - - cpdatamap->InsertL( KPublisherId , TLiwVariant( KMWPublisher ) ); - cpdatamap->InsertL( KContentType , TLiwVariant( type ) ); - cpdatamap->InsertL( KContentId , TLiwVariant( content ) ); - cpdatamap->InsertL( KDataMap , TLiwVariant( map ) ); - - TLiwGenericParam item( KItem, TLiwVariant( cpdatamap ) ); - inParam->AppendL( item ); - - if ( aDestination >= EMusicMenuMusicInfoLine1 ) - { - if (aText != KEmpty) - { - iCPSInterface->ExecuteCmdL( KAdd , *inParam, *outParam ); - } - else - { - iCPSInterface->ExecuteCmdL( KDelete , *inParam, *outParam); - } - } - else - { - if ( iWidgetForeground ) - { - iCPSInterface->ExecuteCmdL( KAdd , *inParam, *outParam ); - } - TMyBufferItem* ptr; - ptr = iPublishingDataBuffers.Find(aDestination); - if (ptr) //remove the old one - { - User::Free(ptr->buf); - iPublishingDataBuffers.Remove(aDestination); - } - TInt sz = map->Size(); - TMyBufferItem bufferitem; - bufferitem.size = map->Size(); - bufferitem.buf = User::AllocL(map->Size()); - RMemWriteStream ws(bufferitem.buf, bufferitem.size); - map->ExternalizeL(ws); - iPublishingDataBuffers.Insert(aDestination, bufferitem); - } - CleanupStack::PopAndDestroy( map ); - CleanupStack::PopAndDestroy( cpdatamap ); - CleanupStack::PopAndDestroy( outParam ); - CleanupStack::PopAndDestroy( inParam ); + TPtrC8 dataKey (iDestinationMap.FindL(aDestination).iDataKey); + TPtrC text; + text.Set( aText ); + iPublishingDataMap.SetL ( dataKey, text ); + PublishDeferred(); } - MPX_DEBUG1("CMusicContentPublisher::PublishTextL --->"); } // --------------------------------------------------------------------------- @@ -953,65 +760,19 @@ TMCPTriggerDestination aDestination, CLiwDefaultMap* aTriggerMap ) { - MPX_DEBUG1("CMusicContentPublisher::PublishActionL <---"); - if( iCPSInterface && iActivePlugin == aPlugin) + MPX_FUNC("CMusicContentPublisher::PublishActionL"); + if ( aDestination >= EMusicMenuMusicInfoTrigger ) { - CLiwGenericParamList * inParam = CLiwGenericParamList::NewLC(); - CLiwGenericParamList * outParam = CLiwGenericParamList::NewLC(); - - TPtrC8 triggerKey; - TPtrC hostType; - TPtrC hostContent; - - MapEnumToDestinationInfoL(aDestination, hostType, triggerKey, - hostContent); - - TLiwGenericParam cptype( KType , TLiwVariant( KCpData ) ); - inParam->AppendL( cptype ); - - CLiwDefaultMap * cpdatamap = CLiwDefaultMap::NewLC( ); - cpdatamap->InsertL( KPublisherId , TLiwVariant( KMWPublisher ) ); - cpdatamap->InsertL( KContentType , TLiwVariant( hostType ) ); - cpdatamap->InsertL( KContentId , TLiwVariant( hostContent ) ); - - CLiwDefaultMap * actionmap = CLiwDefaultMap::NewLC( ); - actionmap->InsertL( triggerKey , TLiwVariant( aTriggerMap ) ); - cpdatamap->InsertL( KActionMap , TLiwVariant( actionmap ) ); - - TLiwGenericParam item( KItem, TLiwVariant( cpdatamap ) ); - inParam->AppendL( item ); - - if ( aDestination >= EMusicMenuMusicInfoTrigger ) - { - iCPSInterface->ExecuteCmdL( KAdd , *inParam, *outParam ); - } - else - { - if ( iWidgetForeground ) - { - iCPSInterface->ExecuteCmdL( KAdd , *inParam, *outParam ); - } - TMyBufferItem* ptr; - ptr = iPublishingActionBuffers.Find(aDestination); - if (ptr) //remove the old one - { - User::Free(ptr->buf); - iPublishingActionBuffers.Remove(aDestination); - } - TInt sz = actionmap->Size(); - TMyBufferItem bufferitem; - bufferitem.size = actionmap->Size(); - bufferitem.buf = User::AllocL(actionmap->Size()); - RMemWriteStream ws(bufferitem.buf, bufferitem.size); - actionmap->ExternalizeL(ws); - iPublishingActionBuffers.Insert(aDestination, bufferitem); - } - CleanupStack::PopAndDestroy( actionmap ); - CleanupStack::PopAndDestroy( cpdatamap ); - CleanupStack::PopAndDestroy( outParam ); - CleanupStack::PopAndDestroy( inParam ); + MPX_DEBUG2("CMusicContentPublisher::PublishActionL deprecated aDestination=%d", aDestination); + return; } - MPX_DEBUG1("CMusicContentPublisher::PublishActionL --->"); + + if( iCPSInterface && iActivePlugin == aPlugin) + { + TDestinationItem & destination ( iDestinationMap.FindL( aDestination ) ); + iPublishingActionMap.SetL( destination.iDataKey , aTriggerMap ); + PublishDeferred(); + } } // --------------------------------------------------------------------------- @@ -1020,19 +781,19 @@ // void CMusicContentPublisher::BecameActiveL( CMCPPlugin* aPlugin ) { - MPX_DEBUG1("CMusicContentPublisher::BecameActiveL <---"); + MPX_FUNC("CMusicContentPublisher::BecameActiveL"); if ( iActivePlugin != aPlugin ) { if ( iActivePlugin ) { MPX_DEBUG1("CMusicContentPublisher::BecameActiveL deactivating old plugin"); + DoPublishDeleteAllL(); iActivePlugin->Deactivate(); - MPX_DEBUG1("CMusicContentPublisher::BecameActiveL plugin deactivated"); - PublishImageL( iActivePlugin, EMusicMenuMusicInfoImage1, KEmpty ); + iPublishingDataMap.Close(); + iPublishingActionMap.Close(); } iActivePlugin = aPlugin; } - MPX_DEBUG1("CMusicContentPublisher::BecameActiveL --->"); } // --------------------------------------------------------------------------- // From CContentHarvesterPlugin @@ -1041,7 +802,7 @@ // void CMusicContentPublisher::UpdateL() { - MPX_DEBUG1("CMusicContentPublisher::UpdateL <---"); + MPX_FUNC("CMusicContentPublisher::UpdateL"); if ( !iPluginManager ) { MPX_DEBUG1("CMusicContentPublisher::UpdateL creating the plugin manager"); @@ -1050,7 +811,6 @@ static_cast( this ), this ); } - MPX_DEBUG1("CMusicContentPublisher::UpdateL --->"); } // --------------------------------------------------------------------------- @@ -1070,62 +830,42 @@ MPX_DEBUG1("CMusicContentPublisher::SkinContentChanged --->"); } -void CMusicContentPublisher::HandlePublisherNotificationL( const TDesC& aContentId, const TDesC8& aTrigger ) +void CMusicContentPublisher::HandlePublisherNotificationL( const TDesC& aContentId, + const TDesC8& aTrigger ) { - MPX_DEBUG1("CMusicContentPublisher::HandlePublisherNotificationL <---"); - if ( aTrigger == KMyActive && !iWidgetActivated) + MPX_DEBUG2_8("-->CMusicContentPublisher::HandlePublisherNotificationL %S", &aTrigger); + if ( aTrigger == KMyActive ) + { + delete iInstanceId; + iInstanceId = NULL; + iInstanceId = aContentId.AllocL(); + DoPublishAllL(); + } + else if ( aTrigger == KMyDeActive ) { - iWidgetActivated = ETrue; - MPX_DEBUG1("CMusicContentPublisher::HandlePublisherNotificationL activate"); + DoPublishDeleteAllL(); + delete iInstanceId; + iInstanceId = NULL; + } + else if ( aTrigger == KMySuspend && iWidgetForeground) + { + iWidgetForeground = EFalse; + } + else if ( aTrigger == KMyResume && !iWidgetForeground) + { + iWidgetForeground = ETrue; if ( !iInstanceId ) { + // CPS framework does not always send 'active' message during boot iInstanceId = aContentId.AllocL(); - //Reset The Widget - MPX_DEBUG1("CMusicContentPublisher::HandlePublisherNotificationL activate --> Reset Widget"); - RDebug::Print(aContentId); - PublishImageL(NULL,EMusicWidgetImage1,KEmpty); - InstallGoToAlbumL( EMusicWidgetTrigger1 ); - PublishTextL( NULL,EMusicWidgetText1, KEmpty ); - PublishImageL(NULL,EMusicWidgetToolbarB1,KEmpty); - PublishImageL(NULL,EMusicWidgetToolbarB2,KEmpty); - PublishImageL(NULL,EMusicWidgetToolbarB3,KEmpty); - InstallEmptyActionL(EMusicWidgetTB1Trigger); - InstallEmptyActionL(EMusicWidgetTB2Trigger); - InstallEmptyActionL(EMusicWidgetTB3Trigger); - PublishTextL( NULL,EMusicWidgetDefaultText, iGoToMusicBuffer->Des() ); - InstallGoToAlbumL( EMusicWidgetTrigger2 ); + DoPublishAllL(); } else { - delete iInstanceId; - iInstanceId = NULL; - iInstanceId = aContentId.AllocL(); + DoPublishModifiedL(); } } - else if ( aTrigger == KMyDeActive && iWidgetActivated) - { - iWidgetActivated = EFalse; - MPX_DEBUG1("CMusicContentPublisher::HandlePublisherNotificationL deactivate"); - //Removing al the CPS entrys to prevent flicker of old text and unwanted images (old/expired handles). - RemoveL( EMusicWidgetImage1 ); - RemoveL( EMusicWidgetText1 ); - RemoveL( EMusicWidgetToolbarB1 ); - RemoveL( EMusicWidgetToolbarB2 ); - RemoveL( EMusicWidgetToolbarB3 ); - RemoveL( EMusicWidgetDefaultText ); - } - else if ( aTrigger == KMySuspend && iWidgetActivated && iWidgetForeground) - { - MPX_DEBUG1("CMusicContentPublisher::HandlePublisherNotificationL suspend"); - iWidgetForeground = EFalse; - } - else if ( aTrigger == KMyResume && iWidgetActivated && !iWidgetForeground) - { - MPX_DEBUG1("CMusicContentPublisher::HandlePublisherNotificationL resume"); - iWidgetForeground = ETrue; - DoPublishL(); - } - MPX_DEBUG1("CMusicContentPublisher::HandlePublisherNotificationL --->"); + MPX_DEBUG1("<--CMusicContentPublisher::HandlePublisherNotificationL"); } diff -r 171e07ac910f -r c8156a91d13c musichomescreen_multiview/musiccontentpublisher/src/pluginmanager.cpp --- a/musichomescreen_multiview/musiccontentpublisher/src/pluginmanager.cpp Mon Mar 15 12:40:11 2010 +0200 +++ b/musichomescreen_multiview/musiccontentpublisher/src/pluginmanager.cpp Wed Mar 31 21:26:33 2010 +0300 @@ -103,18 +103,24 @@ } // --------------------------------------------------------------------------- -// Retuns a plugin by UID +// Retuns a plugin by Implementation UID // --------------------------------------------------------------------------- // TAny* CPluginManager::GetImplementation( TUid aUid ) { - TInt32 key = aUid.iUid; TAny* ret= NULL; - TAny** imp= NULL; - imp = iPluginMap.Find( key ); - if ( imp ) + THashMapIter iter( iPluginMap ); + const TInt32* pluginInstanceKey( NULL ); + TAny*const* ptr = iter.NextValue(); + while ( ptr ) { - ret = *imp; + pluginInstanceKey = iter.CurrentKey(); + if (REComSession::GetImplementationUidL( TUid::Uid( *pluginInstanceKey ) ) == aUid) + { + ret = *ptr; + break; + } + ptr = iter.NextValue(); } return ret; } @@ -165,16 +171,16 @@ { TUid current_plugin = infoArray[i]->ImplementationUid(); TAny* plug( NULL ); - TUid temp; + TUid instanceKey; TInt err( KErrNone ); TRAP( err, plug = REComSession::CreateImplementationL( current_plugin, - temp, + instanceKey, iParameter ) ); if ( err == KErrNone && plug ) { CleanupStack::PushL( plug ); - TInt32 key = current_plugin.iUid; + TInt32 key = instanceKey.iUid; iPluginMap.InsertL( key, plug ); CleanupStack::Pop( plug ); } @@ -194,16 +200,16 @@ THashMapIter iter( iPluginMap ); TAny*const* ptr = iter.NextValue(); CBase* plug( NULL ); - const TInt32* pluginUid( NULL ); + const TInt32* pluginInstanceKey( NULL ); while ( ptr ) { plug = static_cast( *ptr ); delete plug; plug = NULL; - pluginUid = iter.CurrentKey(); - REComSession::DestroyedImplementation( TUid::Uid( *pluginUid ) ); + pluginInstanceKey = iter.CurrentKey(); + REComSession::DestroyedImplementation( TUid::Uid( *pluginInstanceKey ) ); ptr = iter.NextValue(); - pluginUid = NULL; + pluginInstanceKey = NULL; } MPX_DEBUG1("CPluginManager::CleanPluginsTable --->"); } diff -r 171e07ac910f -r c8156a91d13c musichomescreen_multiview/rom/musichomescreen.iby --- a/musichomescreen_multiview/rom/musichomescreen.iby Mon Mar 15 12:40:11 2010 +0200 +++ b/musichomescreen_multiview/rom/musichomescreen.iby Wed Mar 31 21:26:33 2010 +0300 @@ -21,23 +21,8 @@ #include - - -//Music Widget with xuikon resource -//data=\epoc32\release\winscw\udeb\Z\private\200159c0\themes\2456\270513751\270564376\1.0\mw.o0000 private\200159c0\themes\2456\270513751\270564376\1.0\mw.o0000 -//data=\epoc32\release\winscw\udeb\Z\private\200159c0\themes\2456\270513751\270564376\1.0\sources\musicwidget.o0000 private\200159c0\themes\2456\270513751\270564376\1.0\sources\musicwidget.o0000 -//data=\epoc32\release\winscw\udeb\Z\private\200159c0\themes\2456\270513751\270564376\1.0\sources\box_bg_1x1.svg private\200159c0\themes\2456\270513751\270564376\1.0\sources\box_bg_1x1.svg - -//TEMP IMAGES -//data=\epoc32\release\winscw\udeb\Z\resource\apps\qgn_prop_image_tb_pause_dimmed2.png resource\apps\qgn_prop_image_tb_pause_dimmed2.png -//data=\epoc32\release\winscw\udeb\Z\resource\apps\qgn_prop_image_tb_play2_dimmed2.png resource\apps\qgn_prop_image_tb_play2_dimmed2.png -//data=\epoc32\release\winscw\udeb\Z\resource\apps\qgn_prop_image_tb_stop_dimmed2.png resource\apps\qgn_prop_image_tb_stop_dimmed2.png - -//data=\epoc32\release\winscw\udeb\Z\resource\apps\qgn_indi_mup_home_pause.png resource\apps\qgn_indi_mup_home_pause.png -//data=\epoc32\release\winscw\udeb\Z\resource\apps\qgn_indi_mup_home_play.png resource\apps\qgn_indi_mup_home_play.png -//data=\epoc32\release\winscw\udeb\Z\resource\apps\qgn_indi_mup_home_no_music.png resource\apps\qgn_indi_mup_home_no_music.png - data=ZRESOURCE\apps\musichomescreenicons.mif APP_RESOURCE_DIR\musichomescreenicons.mif +data=\epoc32\include\musichomescreen.rsg resource\apps\musichomescreen.rsg #endif // MUSICHOMESCREEN_IBY diff -r 171e07ac910f -r c8156a91d13c musichomescreen_multiview/rom/musicmatrixmenu.iby --- a/musichomescreen_multiview/rom/musicmatrixmenu.iby Mon Mar 15 12:40:11 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* Copyright (c) 2008-2008 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: IBY file for the Music Suite for Matrix Menu -* -*/ - - -#ifndef MUSICMATRIXMENU_IBY -#define MUSICMATRIXMENU_IBY - -data=\epoc32\include\musichomescreen.rsg resource\apps\musichomescreen.rsg -data=\epoc32\data\z\private\101F4CD2\import\suites\musicsuite\suite.xml private\101F4CD2\import\suites\musicsuite\suite.xml -data=\epoc32\data\z\private\101F4CD2\import\suites\musicsuite\music_matrix_items.xml private\101F4CD2\import\suites\musicsuite\music_matrix_items.xml - -#endif // MUSICMATRIXMENU_IBY - -// End of File diff -r 171e07ac910f -r c8156a91d13c musichomescreen_multiview/src/mpxresource.cpp --- a/musichomescreen_multiview/src/mpxresource.cpp Mon Mar 15 12:40:11 2010 +0200 +++ b/musichomescreen_multiview/src/mpxresource.cpp Wed Mar 31 21:26:33 2010 +0300 @@ -161,12 +161,12 @@ TInt count(resReader.ReadInt16()); CDesCArrayFlat* descArray = new (ELeave) CDesCArrayFlat(count); ; for (TInt k = 0; k < count; k++) - { - aIdArray.AppendL (resReader.ReadInt32()); - HBufC* hbuf = resReader.ReadHBufCL(); - CleanupStack::PushL(hbuf); - descArray->AppendL (*hbuf); - CleanupStack::PopAndDestroy(hbuf); + { + aIdArray.AppendL (resReader.ReadInt32()); + HBufC* hbuf = resReader.ReadHBufCL(); + CleanupStack::PushL(hbuf); + descArray->AppendL (*hbuf); + CleanupStack::PopAndDestroy(hbuf); } CleanupStack::PopAndDestroy(readBuffer); //MPX_DEBUG1("CMPXResource::ReadDesCArrayLC End"); diff -r 171e07ac910f -r c8156a91d13c package_definition.xml --- a/package_definition.xml Mon Mar 15 12:40:11 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,85 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -