108 CMPXDbMusic::CMPXDbMusic( |
108 CMPXDbMusic::CMPXDbMusic( |
109 CMPXDbManager& aDbManager, |
109 CMPXDbManager& aDbManager, |
110 MMPXDbMusicObserver& aObserver) : |
110 MMPXDbMusicObserver& aObserver) : |
111 CMPXDbTable(aDbManager), |
111 CMPXDbTable(aDbManager), |
112 iObserver(aObserver) |
112 iObserver(aObserver) |
|
113 #ifdef ABSTRACTAUDIOALBUM_INCLUDED |
|
114 ,iArtNeedUpdated(ETrue) |
|
115 #endif |
113 { |
116 { |
114 MPX_FUNC("CMPXDbMusic::CMPXDbMusic"); |
117 MPX_FUNC("CMPXDbMusic::CMPXDbMusic"); |
115 } |
118 } |
116 |
119 |
117 // ---------------------------------------------------------------------------- |
120 // ---------------------------------------------------------------------------- |
251 TDriveUnit driveUnit(MPXDbCommonUtil::GetDriveIdMatchVolIdL(iDbManager.Fs(), |
254 TDriveUnit driveUnit(MPXDbCommonUtil::GetDriveIdMatchVolIdL(iDbManager.Fs(), |
252 recordset.ColumnInt64(EMusicVolumeId))); |
255 recordset.ColumnInt64(EMusicVolumeId))); |
253 visible = DoUpdateSongL(aSongId, aMedia, driveUnit, aItemChangedMessages, |
256 visible = DoUpdateSongL(aSongId, aMedia, driveUnit, aItemChangedMessages, |
254 recordset); |
257 recordset); |
255 |
258 |
256 // Update Album table |
259 #ifdef ABSTRACTAUDIOALBUM_INCLUDED |
257 if (aMedia.IsSupported(KMPXMediaMusicAlbumArtFileName) || aMedia.IsSupported(KMPXMediaMusicArtist)) |
260 if(iArtNeedUpdated) |
258 { |
261 { |
259 TUint32 albumId = recordset.ColumnInt64(EMusicAlbum); |
262 #endif // ABSTRACTAUDIOALBUM_INCLUDED |
260 iObserver.UpdateCategoryItemL(EMPXAlbum, albumId, aMedia, driveUnit, aItemChangedMessages); |
263 // Update Album table |
261 } |
264 if (aMedia.IsSupported(KMPXMediaMusicAlbumArtFileName) || aMedia.IsSupported(KMPXMediaMusicArtist)) |
262 |
265 { |
263 // Update Artist table |
266 TUint32 albumId = recordset.ColumnInt64(EMusicAlbum); |
264 if ( aMedia.IsSupported(KMPXMediaMusicAlbumArtFileName) ) |
267 iObserver.UpdateCategoryItemL(EMPXAlbum, albumId, aMedia, driveUnit, aItemChangedMessages); |
265 { |
268 } |
266 TUint32 artistId = recordset.ColumnInt64(EMusicArtist); |
269 |
267 iObserver.UpdateCategoryItemL(EMPXArtist, artistId, aMedia, driveUnit, aItemChangedMessages); |
270 // Update Artist table |
268 } |
271 if ( aMedia.IsSupported(KMPXMediaMusicAlbumArtFileName) ) |
269 |
272 { |
|
273 TUint32 artistId = recordset.ColumnInt64(EMusicArtist); |
|
274 iObserver.UpdateCategoryItemL(EMPXArtist, artistId, aMedia, driveUnit, aItemChangedMessages); |
|
275 } |
|
276 #ifdef ABSTRACTAUDIOALBUM_INCLUDED |
|
277 } |
|
278 iArtNeedUpdated = ETrue; //reset flag |
|
279 #endif // ABSTRACTAUDIOALBUM_INCLUDED |
270 CleanupStack::PopAndDestroy(&recordset); |
280 CleanupStack::PopAndDestroy(&recordset); |
271 } |
281 } |
272 |
282 |
273 return visible; |
283 return visible; |
274 } |
284 } |
1049 |
1059 |
1050 TUint32 artistId = recordset.ColumnInt64(KMPXTableDefaultIndex); |
1060 TUint32 artistId = recordset.ColumnInt64(KMPXTableDefaultIndex); |
1051 CleanupStack::PopAndDestroy(&recordset); |
1061 CleanupStack::PopAndDestroy(&recordset); |
1052 |
1062 |
1053 return artistId; |
1063 return artistId; |
1054 } |
|
1055 |
|
1056 // ---------------------------------------------------------------------------- |
|
1057 // CMPXDbMusic::RefreshStartL |
|
1058 // ---------------------------------------------------------------------------- |
|
1059 // |
|
1060 void CMPXDbMusic::RefreshStartL() |
|
1061 { |
|
1062 iRefresh = ETrue; |
|
1063 MPX_FUNC("CMPXDbMusic::RefreshStartL"); |
|
1064 } |
|
1065 |
|
1066 // ---------------------------------------------------------------------------- |
|
1067 // CMPXDbMusic::RefreshEndL |
|
1068 // ---------------------------------------------------------------------------- |
|
1069 // |
|
1070 void CMPXDbMusic::RefreshEndL() |
|
1071 { |
|
1072 MPX_FUNC("CMPXDbMusic::RefreshEndL"); |
|
1073 iRefresh = EFalse; |
|
1074 } |
1064 } |
1075 |
1065 |
1076 // ---------------------------------------------------------------------------- |
1066 // ---------------------------------------------------------------------------- |
1077 // CMPXDbMusic::SongExistsL |
1067 // CMPXDbMusic::SongExistsL |
1078 // ---------------------------------------------------------------------------- |
1068 // ---------------------------------------------------------------------------- |
1874 #endif // ABSTRACTAUDIOALBUM_INCLUDED |
1864 #endif // ABSTRACTAUDIOALBUM_INCLUDED |
1875 const TDesC& albumArtFilename = aMedia.ValueText(KMPXMediaMusicAlbumArtFileName).Left(KMCMaxTextLen); |
1865 const TDesC& albumArtFilename = aMedia.ValueText(KMPXMediaMusicAlbumArtFileName).Left(KMCMaxTextLen); |
1876 #ifdef ABSTRACTAUDIOALBUM_INCLUDED |
1866 #ifdef ABSTRACTAUDIOALBUM_INCLUDED |
1877 TParsePtrC parse(albumArtFilename); |
1867 TParsePtrC parse(albumArtFilename); |
1878 TPtrC ext(parse.Ext()); |
1868 TPtrC ext(parse.Ext()); |
|
1869 //set flag to false, so .alb will not overwrite art field in album, artist table |
|
1870 // when song with embedded art |
|
1871 if ((ext.CompareF(KAbstractAlbumExt)== 0) && containEmbeddedArt) |
|
1872 { |
|
1873 iArtNeedUpdated = EFalse; |
|
1874 } |
1879 |
1875 |
1880 if ( ((ext.CompareF(KAbstractAlbumExt)== 0) && !containEmbeddedArt) || (ext.CompareF(KAbstractAlbumExt)!= 0)) |
1876 if ( ((ext.CompareF(KAbstractAlbumExt)== 0) && !containEmbeddedArt) || (ext.CompareF(KAbstractAlbumExt)!= 0)) |
1881 { |
1877 { |
1882 #endif // ABSTRACTAUDIOALBUM_INCLUDED |
1878 #endif // ABSTRACTAUDIOALBUM_INCLUDED |
1883 if (!aMusicTable || (albumArtFilename != MPXDbCommonUtil::GetColumnTextL(*aMusicTable, EMusicArt))) |
1879 if (!aMusicTable || (albumArtFilename != MPXDbCommonUtil::GetColumnTextL(*aMusicTable, EMusicArt))) |