446 TUint32& aGenreId, |
446 TUint32& aGenreId, |
447 TUint32& aComposerId, |
447 TUint32& aComposerId, |
448 #ifdef ABSTRACTAUDIOALBUM_INCLUDED |
448 #ifdef ABSTRACTAUDIOALBUM_INCLUDED |
449 TUint32& aAbstractAlbumId, |
449 TUint32& aAbstractAlbumId, |
450 #endif // ABSTRACTAUDIOALBUM_INCLUDED |
450 #endif // ABSTRACTAUDIOALBUM_INCLUDED |
451 TInt& aDriveId) |
451 TInt& aDriveId, |
|
452 HBufC*& aArt) |
452 { |
453 { |
453 MPX_FUNC("CMPXDbMusic::GetSongInfoL"); |
454 MPX_FUNC("CMPXDbMusic::GetSongInfoL"); |
454 |
455 |
455 RSqlStatement recordset(iDbManager.ExecuteSelectQueryL(KQueryMusicInfo, aSongId)); |
456 RSqlStatement recordset(iDbManager.ExecuteSelectQueryL(KQueryMusicInfo, aSongId)); |
456 CleanupClosePushL(recordset); |
457 CleanupClosePushL(recordset); |
467 aGenreId = recordset.ColumnInt64(EMusicGenre); |
468 aGenreId = recordset.ColumnInt64(EMusicGenre); |
468 aComposerId = recordset.ColumnInt64(EMusicComposer); |
469 aComposerId = recordset.ColumnInt64(EMusicComposer); |
469 #ifdef ABSTRACTAUDIOALBUM_INCLUDED |
470 #ifdef ABSTRACTAUDIOALBUM_INCLUDED |
470 aAbstractAlbumId = recordset.ColumnInt64(EMusicAbstractAlbum); |
471 aAbstractAlbumId = recordset.ColumnInt64(EMusicAbstractAlbum); |
471 #endif // ABSTRACTAUDIOALBUM_INCLUDED |
472 #endif // ABSTRACTAUDIOALBUM_INCLUDED |
|
473 aArt = MPXDbCommonUtil::GetColumnTextL(recordset, EMusicArt).AllocL(); |
472 HBufC* uri = ConstructUriL(recordset); |
474 HBufC* uri = ConstructUriL(recordset); |
473 |
475 |
474 CleanupStack::PopAndDestroy(&recordset); |
476 CleanupStack::PopAndDestroy(&recordset); |
475 |
477 |
476 return uri; |
478 return uri; |
1061 |
1063 |
1062 return artistId; |
1064 return artistId; |
1063 } |
1065 } |
1064 |
1066 |
1065 // ---------------------------------------------------------------------------- |
1067 // ---------------------------------------------------------------------------- |
|
1068 // CMPXDbMusic::AlbumartForAlbumL |
|
1069 // ---------------------------------------------------------------------------- |
|
1070 // |
|
1071 HBufC* CMPXDbMusic::AlbumartForAlbumL(const TUint32 aAlbumId, TPtrC aArt) |
|
1072 { |
|
1073 MPX_FUNC("CMPXDbMusic::AlbumartForAlbumL"); |
|
1074 RSqlStatement recordset(iDbManager.ExecuteSelectQueryL(KQueryMusicGetAlbumartForAlbum, aAlbumId)); |
|
1075 HBufC* albumart(NULL); |
|
1076 |
|
1077 CleanupClosePushL(recordset); |
|
1078 TInt err(KErrNone); |
|
1079 while ((err = recordset.Next()) == KSqlAtRow) |
|
1080 { |
|
1081 TPtrC art(MPXDbCommonUtil::GetColumnTextL(recordset, KMPXTableDefaultIndex)); |
|
1082 if (art.Length()>0 && art.Compare(KNullDesC)!=0 && art.CompareF(aArt)!=0 ) |
|
1083 { |
|
1084 albumart = art.AllocL(); |
|
1085 break; |
|
1086 } |
|
1087 } |
|
1088 |
|
1089 CleanupStack::PopAndDestroy(&recordset); |
|
1090 return albumart; |
|
1091 } |
|
1092 // ---------------------------------------------------------------------------- |
1066 // CMPXDbMusic::SongExistsL |
1093 // CMPXDbMusic::SongExistsL |
1067 // ---------------------------------------------------------------------------- |
1094 // ---------------------------------------------------------------------------- |
1068 // |
1095 // |
1069 TBool CMPXDbMusic::SongExistsL( |
1096 TBool CMPXDbMusic::SongExistsL( |
1070 TUint32 aSongId) |
1097 TUint32 aSongId) |
1148 if (!aMedia.IsSupported(KMPXMediaGeneralId)) |
1175 if (!aMedia.IsSupported(KMPXMediaGeneralId)) |
1149 { |
1176 { |
1150 MPX_DEBUG1(" !aMedia.IsSupported(KMPXMediaGeneralId)"); |
1177 MPX_DEBUG1(" !aMedia.IsSupported(KMPXMediaGeneralId)"); |
1151 TUint32 songId(aMusicTable.ColumnInt64(EMusicUniqueId)); |
1178 TUint32 songId(aMusicTable.ColumnInt64(EMusicUniqueId)); |
1152 TInt columnCount(aMusicTable.ColumnCount()); |
1179 TInt columnCount(aMusicTable.ColumnCount()); |
|
1180 #ifdef ABSTRACTAUDIOALBUM_INCLUDED |
|
1181 if(columnCount == 40 && aMusicTable.ColumnIndex(_L("PlUId"))==38) |
|
1182 { |
|
1183 TUint32 pListUId(aMusicTable.ColumnInt64(38)); |
|
1184 aMedia.SetTObjectValueL<TMPXItemId>(KMPXMediaGeneralId, TMPXItemId(pListUId, songId)); |
|
1185 } |
|
1186 #else |
1153 if(columnCount == 37 && aMusicTable.ColumnIndex(_L("PlUId"))==35) |
1187 if(columnCount == 37 && aMusicTable.ColumnIndex(_L("PlUId"))==35) |
1154 { |
1188 { |
1155 TUint32 pListUId(aMusicTable.ColumnInt64(35)); |
1189 TUint32 pListUId(aMusicTable.ColumnInt64(35)); |
1156 aMedia.SetTObjectValueL<TMPXItemId>(KMPXMediaGeneralId, TMPXItemId(pListUId, songId)); |
1190 aMedia.SetTObjectValueL<TMPXItemId>(KMPXMediaGeneralId, TMPXItemId(pListUId, songId)); |
1157 } |
1191 } |
|
1192 #endif |
1158 else |
1193 else |
1159 { |
1194 { |
1160 aMedia.SetTObjectValueL<TMPXItemId>(KMPXMediaGeneralId, songId); |
1195 aMedia.SetTObjectValueL<TMPXItemId>(KMPXMediaGeneralId, songId); |
1161 } |
1196 } |
1162 MPX_DEBUG2(" SongId[%d]", songId); |
1197 MPX_DEBUG2(" SongId[%d]", songId); |