36 #include "mpxdbactivetask.h" |
36 #include "mpxdbactivetask.h" |
37 #include "mpxdbmusic.h" // for MMPXDbMusicObserver |
37 #include "mpxdbmusic.h" // for MMPXDbMusicObserver |
38 #include "mpxdbartist.h" // for MMPXDbArtistObserver |
38 #include "mpxdbartist.h" // for MMPXDbArtistObserver |
39 #include "mpxdbalbum.h" // for MMPXDbAlbumObserver |
39 #include "mpxdbalbum.h" // for MMPXDbAlbumObserver |
40 #include "mpxdbplaylist.h" // for MMPXDbPlaylistObserver |
40 #include "mpxdbplaylist.h" // for MMPXDbPlaylistObserver |
|
41 #ifdef ABSTRACTAUDIOALBUM_INCLUDED |
|
42 #include "mpxdbabstractalbum.h" |
|
43 #endif // ABSTRACTAUDIOALBUM_INCLUDED |
41 |
44 |
42 // FORWARD DECLARATIONS |
45 // FORWARD DECLARATIONS |
43 class CMPXMedia; |
46 class CMPXMedia; |
44 class CMPXMediaArray; |
47 class CMPXMediaArray; |
45 class CMPXCollectionDbManager; |
48 class CMPXCollectionDbManager; |
119 * Add songs to the specified playlist |
122 * Add songs to the specified playlist |
120 * @param aMedia playlist media object with playlist Id. |
123 * @param aMedia playlist media object with playlist Id. |
121 * @return playlist Id of the playlist |
124 * @return playlist Id of the playlist |
122 */ |
125 */ |
123 TUint32 AddSongToPlaylistL(const CMPXMedia& aMedia); |
126 TUint32 AddSongToPlaylistL(const CMPXMedia& aMedia); |
124 |
127 #ifdef ABSTRACTAUDIOALBUM_INCLUDED |
|
128 /** |
|
129 * Add an abstractalbum to the collection |
|
130 * @param aMedia abstractalbum media object with URI of the abstractalbum. |
|
131 * @return abstractalbum Id of the abstractalbum created |
|
132 */ |
|
133 TUint32 AddAbstractAlbumL(const CMPXMedia& aMedia, CMPXMessageArray* aMessageArray=NULL); |
|
134 #endif // ABSTRACTAUDIOALBUM_INCLUDED |
125 /** |
135 /** |
126 * Update song info for a song in the music collection database |
136 * Update song info for a song in the music collection database |
127 * @param aMedia songDetails object which contains file path, |
137 * @param aMedia songDetails object which contains file path, |
128 * artist, composer, name(title), track, etc... |
138 * artist, composer, name(title), track, etc... |
129 * @param aItemChangedMessages a list of change events as a result of the |
139 * @param aItemChangedMessages a list of change events as a result of the |
130 * song update |
140 * song update |
131 * @return ETrue if UI visible change else EFalse |
141 * @return ETrue if UI visible change else EFalse |
132 */ |
142 */ |
133 CMPXDbActiveTask::TChangeVisibility UpdateSongL(const CMPXMedia& aMedia, |
143 CMPXDbActiveTask::TChangeVisibility UpdateSongL(const CMPXMedia& aMedia, |
134 CMPXMessageArray& aItemChangedMessages); |
144 CMPXMessageArray& aItemChangedMessages); |
135 |
145 #ifdef ABSTRACTAUDIOALBUM_INCLUDED |
|
146 /** |
|
147 * Update songs info for songs associated with abstractalbum |
|
148 * in the music collection database |
|
149 * @param aMedia songDetails object which contains file path, |
|
150 * artist, composer, name(title), track, etc... |
|
151 * @param aItemChangedMessages a list of change events as a result of the |
|
152 * song update |
|
153 * @return ETrue if UI visible change else EFalse |
|
154 */ |
|
155 CMPXDbActiveTask::TChangeVisibility UpdateAbstractAlbumSongsL(const CMPXMedia& aMedia, |
|
156 CMPXMessageArray& aItemChangedMessages); |
|
157 #endif // ABSTRACTAUDIOALBUM_INCLUDED |
136 /** |
158 /** |
137 * Update playlist info in the music collection database |
159 * Update playlist info in the music collection database |
138 * @param aMedia playlist details object which contains file path, |
160 * @param aMedia playlist details object which contains file path, |
139 * timestamps etc. |
161 * timestamps etc. |
140 * @param aMessageArray change event messages for the playlist update |
162 * @param aMessageArray change event messages for the playlist update |
215 * @param aItemChangedMessages a list of change events as a result of the |
237 * @param aItemChangedMessages a list of change events as a result of the |
216 * playlist removal |
238 * playlist removal |
217 */ |
239 */ |
218 void RemovePlaylistL(TUint32 aPlaylistId, CDesCArray& aUriArray, |
240 void RemovePlaylistL(TUint32 aPlaylistId, CDesCArray& aUriArray, |
219 CMPXMessageArray& aItemChangedMessages); |
241 CMPXMessageArray& aItemChangedMessages); |
|
242 #ifdef ABSTRACTAUDIOALBUM_INCLUDED |
|
243 /** |
|
244 * Remove a abstractalbum This will remove all the songs from the abstractalbum |
|
245 * @param aAbstractAlbumId ID of the abstractalbum to remove |
|
246 * @param aUriArray a descriptor array to contain the URI of the deleted file |
|
247 * @param aItemChangedMessages a list of change events as a result of the |
|
248 * abstractalbum removal |
|
249 */ |
|
250 void RemoveAbstractAlbumL(TUint32 aAbstractAlbumId, CDesCArray& aUriArray, |
|
251 CMPXMessageArray& aItemChangedMessages); |
|
252 #endif // ABSTRACTAUDIOALBUM_INCLUDED |
220 |
253 |
221 /** |
254 /** |
222 * Remove a song from the specified playlist. |
255 * Remove a song from the specified playlist. |
223 * @param aPlaylistId ID of the playlist to remove the song from |
256 * @param aPlaylistId ID of the playlist to remove the song from |
224 * @param aSongId Id of the song in the playlist to be removed |
257 * @param aSongId Id of the song in the playlist to be removed |
390 * @param aUri URI to match |
423 * @param aUri URI to match |
391 * @return song ID |
424 * @return song ID |
392 */ |
425 */ |
393 TUint32 GetSongIdMatchingUriL(const TDesC& aUri); |
426 TUint32 GetSongIdMatchingUriL(const TDesC& aUri); |
394 |
427 |
|
428 #ifdef ABSTRACTAUDIOALBUM_INCLUDED |
|
429 /** |
|
430 * Get the abstractalbum ID of the abstractalbum that matches the given URI |
|
431 * @param aUri URI to match |
|
432 * @return abstractalbum ID |
|
433 */ |
|
434 TUint32 GetAbstractAlbumIdMatchingUriL(const TDesC& aUri); |
|
435 #endif // ABSTRACTAUDIOALBUM_INCLUDED |
395 /** |
436 /** |
396 * Get all the artist names from the music collection database sorted by name. |
437 * Get all the artist names from the music collection database sorted by name. |
397 * @param aAttrs required attributes |
438 * @param aAttrs required attributes |
398 * @param aMediaArray Array to place all the artists' required info |
439 * @param aMediaArray Array to place all the artists' required info |
399 */ |
440 */ |
845 * @param aItemChangedMessages on return contains changed messages for all |
886 * @param aItemChangedMessages on return contains changed messages for all |
846 * affected items |
887 * affected items |
847 */ |
888 */ |
848 void DoRemovePlaylistL(TUint32 aPlaylistId, CDesCArray& aUriArray, |
889 void DoRemovePlaylistL(TUint32 aPlaylistId, CDesCArray& aUriArray, |
849 CMPXMessageArray& aItemChangedMessages); |
890 CMPXMessageArray& aItemChangedMessages); |
850 |
891 #ifdef ABSTRACTAUDIOALBUM_INCLUDED |
|
892 /** |
|
893 * Deletes a specified abstractalbum. |
|
894 * @param aAbstractAlbumId the abstractalbum to be deleted. |
|
895 * @param aUriArray on return contains the URIs of the items deleted. |
|
896 * @param aItemChangedMessages on return contains changed messages for all |
|
897 * affected items |
|
898 */ |
|
899 void DoRemoveAbstractAlbumL(TUint32 aAbstractalbumId, CDesCArray& aUriArray, |
|
900 CMPXMessageArray& aItemChangedMessages); |
|
901 #endif // ABSTRACTAUDIOALBUM_INCLUDED |
851 /** |
902 /** |
852 * Deletes a song from a playlist. |
903 * Deletes a song from a playlist. |
853 * @param aPlaylistId identifies the playlist. |
904 * @param aPlaylistId identifies the playlist. |
854 * @param aSongId song to be deleted. |
905 * @param aSongId song to be deleted. |
855 * @param aOrdinal song ordinal in case there are multiple instances of the same |
906 * @param aOrdinal song ordinal in case there are multiple instances of the same |
960 CDesCArrayFlat* GetMusicFoldersL(); |
1011 CDesCArrayFlat* GetMusicFoldersL(); |
961 #endif // RD_MULTIPLE_DRIVE |
1012 #endif // RD_MULTIPLE_DRIVE |
962 |
1013 |
963 private: // From MMPXDbMusicObserver |
1014 private: // From MMPXDbMusicObserver |
964 |
1015 |
|
1016 #ifdef ABSTRACTAUDIOALBUM_INCLUDED |
|
1017 /** |
|
1018 * @see MMPXDbMusicObserver |
|
1019 */ |
|
1020 virtual TUint32 AddCategoryItemL(TMPXGeneralCategory aCategory, |
|
1021 const TDesC& aName, TInt aDriveId, |
|
1022 CMPXMessageArray* aItemChangedMessages, TBool& aItemExist, |
|
1023 const TDesC& aAlbumArtist=KNullDesC, |
|
1024 const TDesC& aGenre=KNullDesC); |
|
1025 #else |
|
1026 |
965 /** |
1027 /** |
966 * @see MMPXDbMusicObserver |
1028 * @see MMPXDbMusicObserver |
967 */ |
1029 */ |
968 virtual TUint32 AddCategoryItemL(TMPXGeneralCategory aCategory, |
1030 virtual TUint32 AddCategoryItemL(TMPXGeneralCategory aCategory, |
969 const TDesC& aName, TInt aDriveId, |
1031 const TDesC& aName, TInt aDriveId, |
970 CMPXMessageArray* aItemChangedMessages, TBool& aItemExist); |
1032 CMPXMessageArray* aItemChangedMessages, TBool& aItemExist); |
971 |
1033 #endif // ABSTRACTAUDIOALBUM_INCLUDED |
972 virtual TUint32 AddCategoryItemL(TMPXGeneralCategory aCategory, const TDesC& aName, |
1034 |
973 TUint32 aArtist, const TDesC& aArt, |
1035 virtual TUint32 AddCategoryItemL(TMPXGeneralCategory aCategory, const TDesC& aName, |
974 TInt aDrive, CMPXMessageArray* aItemChangedMessages, TBool& aItemExist); |
1036 TUint32 aArtist, const TDesC& aArt, |
975 |
1037 TInt aDrive, CMPXMessageArray* aItemChangedMessages, TBool& aItemExist); |
976 virtual void UpdateCategoryItemL(TMPXGeneralCategory aCategory, TUint32 aCategoryId, |
1038 |
977 const CMPXMedia& aMedia, TInt aDrive, CMPXMessageArray* aItemChangedMessages); |
1039 virtual void UpdateCategoryItemL(TMPXGeneralCategory aCategory, TUint32 aCategoryId, |
|
1040 const CMPXMedia& aMedia, TInt aDrive, CMPXMessageArray* aItemChangedMessages); |
978 |
1041 |
979 /** |
1042 /** |
980 * @see MMPXDbMusicObserver |
1043 * @see MMPXDbMusicObserver |
981 */ |
1044 */ |
982 virtual void DeleteSongForCategoryL(TMPXGeneralCategory aCategory, |
1045 virtual void DeleteSongForCategoryL(TMPXGeneralCategory aCategory, |
990 |
1053 |
991 /** |
1054 /** |
992 * @see MMPXDbMusicObserver |
1055 * @see MMPXDbMusicObserver |
993 */ |
1056 */ |
994 virtual void HandlePlaybackTimeModifiedL(CMPXMessageArray& aItemChangedMessages); |
1057 virtual void HandlePlaybackTimeModifiedL(CMPXMessageArray& aItemChangedMessages); |
|
1058 #ifdef ABSTRACTAUDIOALBUM_INCLUDED |
|
1059 /** |
|
1060 * @see MMPXDbMusicObserver |
|
1061 */ |
|
1062 virtual HBufC* HandleGetAlbumNameFromIdL(TUint32 aId); |
|
1063 #endif // ABSTRACTAUDIOALBUM_INCLUDED |
995 private: // From MMPXDbArtistObserver |
1064 private: // From MMPXDbArtistObserver |
996 /** |
1065 /** |
997 * @see MMPXDbArtistObser |
1066 * @see MMPXDbArtistObser |
998 */ |
1067 */ |
999 virtual TInt HandleGetAlbumsCountForArtistL(TUint32 aArtistId); |
1068 virtual TInt HandleGetAlbumsCountForArtistL(TUint32 aArtistId); |
1029 |
1098 |
1030 // owned member variables |
1099 // owned member variables |
1031 CMPXCollectionDbManager* iDbManager; |
1100 CMPXCollectionDbManager* iDbManager; |
1032 CMPXDbMusic* iDbMusic; |
1101 CMPXDbMusic* iDbMusic; |
1033 CMPXDbPlaylist* iDbPlaylist; |
1102 CMPXDbPlaylist* iDbPlaylist; |
|
1103 #ifdef ABSTRACTAUDIOALBUM_INCLUDED |
|
1104 CMPXDbAbstractAlbum* iDbAbstractAlbum; |
|
1105 #endif // ABSTRACTAUDIOALBUM_INCLUDED |
1034 CMPXDbArtist* iDbArtist; |
1106 CMPXDbArtist* iDbArtist; |
1035 CMPXDbAlbum* iDbAlbum; |
1107 CMPXDbAlbum* iDbAlbum; |
1036 CMPXDbGenre* iDbGenre; |
1108 CMPXDbGenre* iDbGenre; |
1037 CMPXDbComposer* iDbComposer; |
1109 CMPXDbComposer* iDbComposer; |
1038 CMPXDbAuxiliary* iDbAuxiliary; |
1110 CMPXDbAuxiliary* iDbAuxiliary; |