mpserviceplugins/mpxsqlitedbhgplugin/src/mpxdbmusic.cpp
changeset 29 8192e5b5c935
parent 25 3ec52facab4d
child 38 b93f525c9244
--- a/mpserviceplugins/mpxsqlitedbhgplugin/src/mpxdbmusic.cpp	Fri May 14 15:49:53 2010 +0300
+++ b/mpserviceplugins/mpxsqlitedbhgplugin/src/mpxdbmusic.cpp	Thu May 27 12:49:57 2010 +0300
@@ -448,7 +448,8 @@
 #ifdef ABSTRACTAUDIOALBUM_INCLUDED
     TUint32& aAbstractAlbumId,
 #endif // ABSTRACTAUDIOALBUM_INCLUDED
-    TInt& aDriveId)
+    TInt& aDriveId,
+    HBufC*& aArt)
     {
     MPX_FUNC("CMPXDbMusic::GetSongInfoL");
 
@@ -469,6 +470,7 @@
 #ifdef ABSTRACTAUDIOALBUM_INCLUDED
     aAbstractAlbumId = recordset.ColumnInt64(EMusicAbstractAlbum);
 #endif // ABSTRACTAUDIOALBUM_INCLUDED
+    aArt = MPXDbCommonUtil::GetColumnTextL(recordset, EMusicArt).AllocL();
     HBufC* uri = ConstructUriL(recordset, aSongId);
 
     CleanupStack::PopAndDestroy(&recordset);
@@ -1063,6 +1065,30 @@
     }
 
 // ----------------------------------------------------------------------------
+// CMPXDbMusic::AlbumartForAlbumL
+// ----------------------------------------------------------------------------
+//
+HBufC* CMPXDbMusic::AlbumartForAlbumL(const TUint32 aAlbumId, TPtrC aArt)
+    {
+    MPX_FUNC("CMPXDbMusic::AlbumartForAlbumL");
+    RSqlStatement recordset(iDbManager.ExecuteSelectQueryL(KQueryMusicGetAlbumartForAlbum, aAlbumId));
+    HBufC* albumart(NULL);
+   
+    CleanupClosePushL(recordset);
+    while ( recordset.Next() == KSqlAtRow )
+        {     
+        TPtrC art(MPXDbCommonUtil::GetColumnTextL(recordset, KMPXTableDefaultIndex));		
+        if (art.Length()>0 && art.Compare(KNullDesC)!=0 &&  art.CompareF(aArt)!=0 )
+            {
+            albumart = art.AllocL(); 
+            break;
+            }	
+        }
+       
+    CleanupStack::PopAndDestroy(&recordset);
+    return albumart;
+    }
+// ----------------------------------------------------------------------------
 // CMPXDbMusic::SongExistsL
 // ----------------------------------------------------------------------------
 //