mpserviceplugins/mpxsqlitedbhgplugin/src/mpxdbhandler.cpp
changeset 29 8192e5b5c935
parent 25 3ec52facab4d
child 37 eb79a7c355bf
equal deleted inserted replaced
25:3ec52facab4d 29:8192e5b5c935
   961     MPX_FUNC("CMPXDbHandler::GetAllAlbumsL");
   961     MPX_FUNC("CMPXDbHandler::GetAllAlbumsL");
   962     iDbAlbum->GetAllCategoryItemsL(aAttrs, *aMediaArray);
   962     iDbAlbum->GetAllCategoryItemsL(aAttrs, *aMediaArray);
   963     }
   963     }
   964 
   964 
   965 // ----------------------------------------------------------------------------
   965 // ----------------------------------------------------------------------------
       
   966 // Get all albums for Media Wall
       
   967 // ----------------------------------------------------------------------------
       
   968 //
       
   969 void CMPXDbHandler::GetAllAlbumsMediaWallL(
       
   970     const TArray<TMPXAttribute>& aAttrs,
       
   971     CMPXMediaArray* aMediaArray)
       
   972     {
       
   973     MPX_FUNC("CMPXDbHandler::GetAllAlbumsL");
       
   974     iDbAlbum->GetAllCategoryItemsMediaWallL(aAttrs, *aMediaArray);
       
   975     }
       
   976 
       
   977 // ----------------------------------------------------------------------------
   966 // Get all albums for the given artist ID
   978 // Get all albums for the given artist ID
   967 // ----------------------------------------------------------------------------
   979 // ----------------------------------------------------------------------------
   968 //
   980 //
   969 void CMPXDbHandler::GetAlbumsMatchingArtistL(
   981 void CMPXDbHandler::GetAlbumsMatchingArtistL(
   970     TUint aArtistId,
   982     TUint aArtistId,
  2112     // Get the song drive
  2124     // Get the song drive
  2113     TUint32 artistID(0);
  2125     TUint32 artistID(0);
  2114     TUint32 albumID(0);
  2126     TUint32 albumID(0);
  2115     TUint32 genreID(0);
  2127     TUint32 genreID(0);
  2116     TUint32 composerID(0);
  2128     TUint32 composerID(0);
       
  2129     HBufC*  art(NULL);
  2117 #ifdef ABSTRACTAUDIOALBUM_INCLUDED
  2130 #ifdef ABSTRACTAUDIOALBUM_INCLUDED
  2118     TUint32 abstractAlbumID(0);
  2131     TUint32 abstractAlbumID(0);
  2119 #endif // ABSTRACTAUDIOALBUM_INCLUDED
  2132 #endif // ABSTRACTAUDIOALBUM_INCLUDED
  2120     TInt drive(0);
  2133     TInt drive(0);
  2121 
  2134 
  2122 // Get information from the Music table first
  2135 // Get information from the Music table first
  2123 #ifdef ABSTRACTAUDIOALBUM_INCLUDED
  2136 #ifdef ABSTRACTAUDIOALBUM_INCLUDED
  2124     HBufC* uri = iDbMusic->GetSongInfoL(aSongId, artistID, albumID, genreID, composerID, abstractAlbumID, drive);
  2137     HBufC* uri = iDbMusic->GetSongInfoL(aSongId, artistID, albumID, genreID, composerID, abstractAlbumID, drive, art);
  2125 #else
  2138 #else
  2126     HBufC* uri = iDbMusic->GetSongInfoL(aSongId, artistID, albumID, genreID, composerID, drive);
  2139     HBufC* uri = iDbMusic->GetSongInfoL(aSongId, artistID, albumID, genreID, composerID, drive, art);
  2127 #endif // ABSTRACTAUDIOALBUM_INCLUDED
  2140 #endif // ABSTRACTAUDIOALBUM_INCLUDED
  2128 
  2141 
       
  2142     CleanupStack::PushL(art);
  2129     // add the URI to the return array
  2143     // add the URI to the return array
  2130     CleanupStack::PushL(uri);
  2144     CleanupStack::PushL(uri);
  2131     aUriArray.AppendL(*uri);
  2145     aUriArray.AppendL(*uri);
  2132     CleanupStack::PopAndDestroy(uri);
  2146     CleanupStack::PopAndDestroy(uri);
  2133 
  2147 
  2134     // Update the category records
  2148     // Update the category records
  2135     TBool categoryExist( EFalse );
  2149     TBool categoryExist( EFalse );
  2136     iDbArtist->DecrementSongsForCategoryL(artistID, drive, &aItemChangedMessages, categoryExist);
  2150     iDbArtist->DecrementSongsForCategoryL(artistID, drive, &aItemChangedMessages, categoryExist);
  2137     iDbAlbum->DecrementSongsForCategoryL(albumID, drive, &aItemChangedMessages, categoryExist, artistID);
  2151     iDbAlbum->DecrementSongsForCategoryL(albumID, drive, &aItemChangedMessages, categoryExist, artistID, *art);
  2138     iDbGenre->DecrementSongsForCategoryL(genreID, drive, &aItemChangedMessages, categoryExist);
  2152     iDbGenre->DecrementSongsForCategoryL(genreID, drive, &aItemChangedMessages, categoryExist);
  2139     iDbComposer->DecrementSongsForCategoryL(composerID, drive, &aItemChangedMessages, categoryExist);
  2153     iDbComposer->DecrementSongsForCategoryL(composerID, drive, &aItemChangedMessages, categoryExist);
       
  2154     CleanupStack::PopAndDestroy(art);
  2140 #ifdef ABSTRACTAUDIOALBUM_INCLUDED
  2155 #ifdef ABSTRACTAUDIOALBUM_INCLUDED
  2141     if (abstractAlbumID)
  2156     if (abstractAlbumID)
  2142         {
  2157         {
  2143         iDbAbstractAlbum->DecrementSongsForCategoryL(abstractAlbumID, drive, &aItemChangedMessages, categoryExist, iMtpInUse);
  2158         iDbAbstractAlbum->DecrementSongsForCategoryL(abstractAlbumID, drive, &aItemChangedMessages, categoryExist, iMtpInUse);
  2144         }
  2159         }
  3353 TBool CMPXDbHandler::HandleIsUnknownArtistL(TUint32 aArtistId)
  3368 TBool CMPXDbHandler::HandleIsUnknownArtistL(TUint32 aArtistId)
  3354     {
  3369     {
  3355     return iDbArtist->IsUnknownArtistL(aArtistId);
  3370     return iDbArtist->IsUnknownArtistL(aArtistId);
  3356     }
  3371     }
  3357 
  3372 
       
  3373 // ---------------------------------------------------------------------------
       
  3374 // CMPXDbHandler::HandleArtistForAlbumL
       
  3375 // ---------------------------------------------------------------------------
       
  3376 //
  3358 TUint32 CMPXDbHandler::HandleArtistForAlbumL(const TUint32 aAlbumId)
  3377 TUint32 CMPXDbHandler::HandleArtistForAlbumL(const TUint32 aAlbumId)
  3359     {
  3378     {
  3360     return iDbMusic->ArtistForAlbumL(aAlbumId);
  3379     return iDbMusic->ArtistForAlbumL(aAlbumId);
       
  3380     }
       
  3381 
       
  3382 // ---------------------------------------------------------------------------
       
  3383 // CMPXDbHandler::HandleAlbumartForAlbumL
       
  3384 // ---------------------------------------------------------------------------
       
  3385 //
       
  3386 HBufC*  CMPXDbHandler::HandleAlbumartForAlbumL(const TUint32 aAlbumId, TPtrC aArt)
       
  3387     {
       
  3388     return iDbMusic->AlbumartForAlbumL(aAlbumId, aArt);
  3361     }
  3389     }
  3362 #ifdef ABSTRACTAUDIOALBUM_INCLUDED   
  3390 #ifdef ABSTRACTAUDIOALBUM_INCLUDED   
  3363 // ----------------------------------------------------------------------------------------------------------
  3391 // ----------------------------------------------------------------------------------------------------------
  3364 // CMPXDbHandler::HandleGetAlbumNameForSongL
  3392 // CMPXDbHandler::HandleGetAlbumNameForSongL
  3365 // ----------------------------------------------------------------------------------------------------------
  3393 // ----------------------------------------------------------------------------------------------------------