mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/src/mpxdbhandler.cpp
branchRCL_3
changeset 66 1f1dad4af8f8
parent 56 2cbbefa9af78
equal deleted inserted replaced
60:bdd9da0d70fe 66:1f1dad4af8f8
   172 
   172 
   173     // Create the db infrastructure,
   173     // Create the db infrastructure,
   174     //
   174     //
   175     iDbMusic = CMPXDbMusic::NewL(*iDbManager, iResource, *this);
   175     iDbMusic = CMPXDbMusic::NewL(*iDbManager, iResource, *this);
   176     iDbPlaylist = CMPXDbPlaylist::NewL(*iDbManager, *this);
   176     iDbPlaylist = CMPXDbPlaylist::NewL(*iDbManager, *this);
   177     iDbArtist = CMPXDbArtist::NewL(*iDbManager, EMPXArtist);
   177     iDbArtist = CMPXDbArtist::NewL(*iDbManager, EMPXArtist, *this);
   178     iDbAlbum = CMPXDbAlbum::NewL(*iDbManager, EMPXAlbum, *this);
   178     iDbAlbum = CMPXDbAlbum::NewL(*iDbManager, EMPXAlbum, *this);
   179     iDbGenre = CMPXDbGenre::NewL(*iDbManager, EMPXGenre);
   179     iDbGenre = CMPXDbGenre::NewL(*iDbManager, EMPXGenre);
   180     iDbComposer = CMPXDbComposer::NewL(*iDbManager, EMPXComposer);
   180     iDbComposer = CMPXDbComposer::NewL(*iDbManager, EMPXComposer);
   181 #ifdef ABSTRACTAUDIOALBUM_INCLUDED
   181 #ifdef ABSTRACTAUDIOALBUM_INCLUDED
   182     iDbAbstractAlbum = CMPXDbAbstractAlbum::NewL(*iDbManager, EMPXAbstractAlbum, iFs);
   182     iDbAbstractAlbum = CMPXDbAbstractAlbum::NewL(*iDbManager, EMPXAbstractAlbum, iFs);
   985 
   985 
   986         if (contentId == KMPXMediaIdGeneral && attributeId & EMPXMediaGeneralCount)
   986         if (contentId == KMPXMediaIdGeneral && attributeId & EMPXMediaGeneralCount)
   987             {
   987             {
   988             MPX_DEBUG1("    EMPXMediaGeneralCount");
   988             MPX_DEBUG1("    EMPXMediaGeneralCount");
   989 
   989 
   990             attributes.AppendL(TMPXAttribute(KMPXMediaIdGeneral, attributeId & ~EMPXMediaGeneralCount));
   990             attributes.Append(TMPXAttribute(KMPXMediaIdGeneral, attributeId & ~EMPXMediaGeneralCount));
   991 
   991 
   992             tryGetSongCount = ETrue;
   992             tryGetSongCount = ETrue;
   993             break;
   993             break;
   994             }
   994             }
   995 
   995 
   996         attributes.AppendL(aAttrs[i]);
   996         attributes.Append(aAttrs[i]);
   997         }
   997         }
   998 
   998 
   999     for (TInt j = i+1; j < attrCount; j++)
   999     for (TInt j = i+1; j < attrCount; j++)
  1000         {
  1000         {
  1001         attributes.AppendL(aAttrs[j]);
  1001         attributes.Append(aAttrs[j]);
  1002         }
  1002         }
  1003     iDbAlbum->GetSubCategoryItemsL(EMPXArtist, aArtistId, attributes.Array(), aMediaArray);
  1003     iDbAlbum->GetSubCategoryItemsL(EMPXArtist, aArtistId, attributes.Array(), aMediaArray);
  1004     CleanupStack::PopAndDestroy(&attributes);
  1004     CleanupStack::PopAndDestroy(&attributes);
  1005 
  1005 
  1006     TInt pPath(0);
  1006     TInt pPath(0);
  1517     MPX_FUNC("CMPXDbHandler::ReCreateDatabasesL");
  1517     MPX_FUNC("CMPXDbHandler::ReCreateDatabasesL");
  1518     iDbManager->RecreateAllDatabasesL();
  1518     iDbManager->RecreateAllDatabasesL();
  1519     }
  1519     }
  1520 
  1520 
  1521 // ----------------------------------------------------------------------------
  1521 // ----------------------------------------------------------------------------
       
  1522 // Re-create a specified database file
       
  1523 // ----------------------------------------------------------------------------
       
  1524 //
       
  1525 void CMPXDbHandler::RecreateDatabaseFileL( TInt aDrive )
       
  1526     {
       
  1527     MPX_FUNC("CMPXDbHandler::RecreateDatabaseFileL");
       
  1528     MPX_DEBUG2( "CMPXDbHandler::RecreateDatabaseFileL drive: %i", aDrive );
       
  1529     iDbManager->RecreateDatabaseFileL( aDrive );  
       
  1530     }
       
  1531 
       
  1532 
       
  1533 // ----------------------------------------------------------------------------
  1522 // Set handler refresh status
  1534 // Set handler refresh status
  1523 // ----------------------------------------------------------------------------
  1535 // ----------------------------------------------------------------------------
  1524 //
  1536 //
  1525 void CMPXDbHandler::RefreshStartL()
  1537 void CMPXDbHandler::RefreshStartL()
  1526     {
  1538     {
  2146     CleanupStack::PopAndDestroy(uri);
  2158     CleanupStack::PopAndDestroy(uri);
  2147 
  2159 
  2148     // Update the category records
  2160     // Update the category records
  2149     TBool categoryExist( EFalse );
  2161     TBool categoryExist( EFalse );
  2150     iDbArtist->DecrementSongsForCategoryL(artistID, drive, &aItemChangedMessages, categoryExist);
  2162     iDbArtist->DecrementSongsForCategoryL(artistID, drive, &aItemChangedMessages, categoryExist);
  2151     iDbAlbum->DecrementSongsForAlbumL(albumID, drive, &aItemChangedMessages, categoryExist, *art);
  2163     iDbAlbum->DecrementSongsForCategoryL(albumID, drive, &aItemChangedMessages, categoryExist, artistID, *art);
  2152     iDbGenre->DecrementSongsForCategoryL(genreID, drive, &aItemChangedMessages, categoryExist);
  2164     iDbGenre->DecrementSongsForCategoryL(genreID, drive, &aItemChangedMessages, categoryExist);
  2153     iDbComposer->DecrementSongsForCategoryL(composerID, drive, &aItemChangedMessages, categoryExist);
  2165     iDbComposer->DecrementSongsForCategoryL(composerID, drive, &aItemChangedMessages, categoryExist);
  2154     CleanupStack::PopAndDestroy(art);
  2166     CleanupStack::PopAndDestroy(art);
  2155 #ifdef ABSTRACTAUDIOALBUM_INCLUDED
  2167 #ifdef ABSTRACTAUDIOALBUM_INCLUDED
  2156     if (abstractAlbumID)
  2168     if (abstractAlbumID)
  2549     // Find all songs, all songs in a particular album and/or artist, or
  2561     // Find all songs, all songs in a particular album and/or artist, or
  2550     // a particular song
  2562     // a particular song
  2551     //////////////////////////////////////////////////////////////////////
  2563     //////////////////////////////////////////////////////////////////////
  2552     else
  2564     else
  2553         {
  2565         {
  2554         TBool sortByTrackOrder = EFalse;
  2566         iDbMusic->FindSongsL(id, containerId, type, aCriteria, aAttrs, aMediaArray);
  2555 		
       
  2556         // construct the sort order depending on category. Albums are always sorted by track,
       
  2557         // then name, except for unknown album. Songs are sorted by name for unknown album.
       
  2558         // NULL track number is stored as KMaxTInt so that they will be sorted to the end
       
  2559         if ((type == EMPXGroup) && (MPX_ITEM_CATEGORY(id) == EMPXAlbum) && !iDbAlbum->IsUnknownAlbumL(id))
       
  2560             {
       
  2561             sortByTrackOrder = ETrue;
       
  2562             }
       
  2563         iDbMusic->FindSongsL(id, containerId, type, aCriteria, aAttrs, aMediaArray, sortByTrackOrder);
       
  2564         }
  2567         }
  2565     }
  2568     }
  2566 
  2569 
  2567 // ----------------------------------------------------------------------------
  2570 // ----------------------------------------------------------------------------
  2568 // Get song(s) in the specified playlist
  2571 // Get song(s) in the specified playlist
  3044     }
  3047     }
  3045 
  3048 
  3046 #endif // RD_MULTIPLE_DRIVE
  3049 #endif // RD_MULTIPLE_DRIVE
  3047 
  3050 
  3048 // ----------------------------------------------------------------------------
  3051 // ----------------------------------------------------------------------------
  3049 // CMPXDbHandler::AddAbstractAlbumItemL
  3052 // CMPXDbHandler::AddCategoryItemL
  3050 // ----------------------------------------------------------------------------
  3053 // ----------------------------------------------------------------------------
  3051 //
  3054 //
  3052 #ifdef ABSTRACTAUDIOALBUM_INCLUDED
  3055 TUint32 CMPXDbHandler::AddCategoryItemL(
  3053 TUint32 CMPXDbHandler::AddAbstractAlbumItemL(
  3056     TMPXGeneralCategory aCategory,
  3054     const TDesC& aName,
  3057     const TDesC& aName,
  3055     TInt aDriveId,
  3058     TInt aDriveId,
  3056     CMPXMessageArray* aItemChangedMessages,
  3059     CMPXMessageArray* aItemChangedMessages,
  3057     TBool& aItemExist,
  3060     TBool& aItemExist
  3058     const TDesC& aUri,
  3061 #ifdef ABSTRACTAUDIOALBUM_INCLUDED
  3059     const TDesC& aAlbumArtist
  3062     ,const TDesC& aUri
       
  3063     ,const TDesC& aAlbumArtist
       
  3064 #endif // ABSTRACTAUDIOALBUM_INCLUDED
  3060     )
  3065     )
  3061     {
  3066     {
  3062     MPX_FUNC("CMPXDbHandler::AddAbstractAlbumItemL()");
  3067     MPX_FUNC("CMPXDbHandler::AddCategoryItemL()");
  3063 
  3068 
  3064     MPX_PERF_START(CMPXDbHandler_AddAbstractAlbumItemL);
  3069     MPX_PERF_START(CMPXDbHandler_AddCategoryItemL);
  3065     
  3070 
  3066     TBool newRecord(EFalse);
  3071     TBool newRecord(EFalse);
       
  3072 #ifdef ABSTRACTAUDIOALBUM_INCLUDED
  3067     TUint32 id(0);
  3073     TUint32 id(0);
  3068 
  3074     //for AbstractAlbum, SetAbstractAlbum, associate songs with abstractalbum.
  3069     //AbstractAlbum is not case sensitive
  3075     //only called with newRecord as EFalse
  3070     id =  iDbAbstractAlbum->AddItemL(aUri, aName, aAlbumArtist, aDriveId, newRecord, EFalse);
  3076     //increment songCount if id exist in AbstractAlbum table, otherwise do nothing.
  3071     MPX_PERF_END(CMPXDbHandler_AddAbstractAlbumItemL);
  3077 
  3072     
  3078     //only Genre, AbstractAlbum are not case sensitive
  3073     return id;
  3079     TBool caseSensitive = ETrue;
  3074     }
  3080     if ((aCategory == EMPXGenre) || (aCategory == EMPXAbstractAlbum))
  3075 #endif
  3081         caseSensitive = EFalse;
  3076 
  3082 
  3077 // ----------------------------------------------------------------------------
  3083     if (aCategory == EMPXAbstractAlbum)
  3078 // CMPXDbHandler::AddCategoryItemL
  3084         {
  3079 // ----------------------------------------------------------------------------
  3085         id =  iDbAbstractAlbum->AddItemL(aUri, aName, aAlbumArtist, aDriveId, newRecord, caseSensitive);
  3080 //
  3086         }
  3081 TUint32 CMPXDbHandler::AddCategoryItemL(
  3087     else
  3082     TMPXGeneralCategory aCategory,
  3088         {
  3083     const CMPXMedia& aMedia,
  3089         id = DbCategoryL(aCategory)->AddItemL(aName, aDriveId, newRecord, caseSensitive);
  3084     TInt aDriveId,
  3090 #else
  3085     CMPXMessageArray* aItemChangedMessages,
  3091     TUint32 id(DbCategoryL(aCategory)->AddItemL(aName, aDriveId, newRecord, (aCategory != EMPXGenre)));
  3086     TBool& aItemExist)
  3092 #endif // ABSTRACTAUDIOALBUM_INCLUDED
  3087     {
       
  3088     MPX_FUNC("CMPXDbHandler::AddCategoryItemL()");
       
  3089     
       
  3090     MPX_PERF_START(CMPXDbHandler_AddCategoryItemL);
       
  3091 
       
  3092     ASSERT(aCategory != EMPXAbstractAlbum);
       
  3093 	
       
  3094     TBool newRecord(EFalse);
       
  3095 
       
  3096     TUint32 id = DbCategoryL(aCategory)->AddItemL(aCategory, aMedia, aDriveId, newRecord, aCategory != EMPXGenre);
       
  3097 
  3093 
  3098     if (newRecord && aItemChangedMessages)
  3094     if (newRecord && aItemChangedMessages)
  3099         {
  3095         {
  3100         MPXDbCommonUtil::AddItemChangedMessageL(*aItemChangedMessages, id, EMPXItemInserted,
  3096         MPXDbCommonUtil::AddItemChangedMessageL(*aItemChangedMessages, id, EMPXItemInserted,
  3101             aCategory, KDBPluginUid);
  3097             aCategory, KDBPluginUid);
  3102         }
  3098         }
  3103     // when the added item's category is Genre, Composer or Artist, and it is NOT a new record,
  3099     // when the added item's category is Genre or Composer,
       
  3100     // and it is NOT a new record,
  3104     // we should send the item number changed message
  3101     // we should send the item number changed message
  3105     else if ( ( aCategory == EMPXGenre || aCategory == EMPXComposer || aCategory == EMPXArtist) &&
  3102     else if ( ( aCategory == EMPXGenre || aCategory == EMPXComposer ) &&
  3106             !newRecord && aItemChangedMessages )
  3103             !newRecord && aItemChangedMessages )
  3107         {
  3104         {
  3108         MPXDbCommonUtil::AddItemChangedMessageL(*aItemChangedMessages, id, EMPXItemModified,
  3105         MPXDbCommonUtil::AddItemChangedMessageL(*aItemChangedMessages, id, EMPXItemModified,
  3109             aCategory, KDBPluginUid);
  3106             aCategory, KDBPluginUid);
  3110         }
  3107         }
  3111     aItemExist = !newRecord;
  3108     aItemExist = !newRecord;
       
  3109 #ifdef ABSTRACTAUDIOALBUM_INCLUDED      
       
  3110        }
       
  3111 #endif // ABSTRACTAUDIOALBUM_INCLUDED
  3112     MPX_PERF_END(CMPXDbHandler_AddCategoryItemL);
  3112     MPX_PERF_END(CMPXDbHandler_AddCategoryItemL);
  3113 
  3113     return id;
  3114     return id;    
  3114     }
  3115     }
  3115 
  3116 
  3116 TUint32 CMPXDbHandler::AddCategoryItemL(
  3117 // ----------------------------------------------------------------------------
  3117         TMPXGeneralCategory aCategory,
  3118 // CMPXDbHandler::UpdateCategoryItemL
  3118         const TDesC& aName,
  3119 // ----------------------------------------------------------------------------
  3119         const TDesC& aArtistName,
  3120 //
  3120         const TDesC& aArt,
       
  3121         TInt aDriveId,
       
  3122         CMPXMessageArray* aItemChangedMessages,
       
  3123         TBool& aItemExist)
       
  3124 	{
       
  3125     MPX_FUNC("CMPXDbHandler::AddCategoryItemL()");
       
  3126 
       
  3127     MPX_PERF_START(CMPXDbHandler_AddCategoryItemL);
       
  3128 
       
  3129     TBool newRecord(EFalse);
       
  3130 
       
  3131     TUint32 id = 0;
       
  3132     if(aCategory == EMPXAlbum)
       
  3133         {
       
  3134         id = iDbAlbum->AddItemL(aName, aArtistName, aArt, aDriveId, newRecord, (aCategory != EMPXGenre));
       
  3135         }
       
  3136     else
       
  3137         {
       
  3138         id = iDbArtist->AddItemL(aName, aArt, aDriveId, newRecord, (aCategory != EMPXGenre));
       
  3139         }
       
  3140 
       
  3141     if (newRecord && aItemChangedMessages)
       
  3142         {
       
  3143         MPXDbCommonUtil::AddItemChangedMessageL(*aItemChangedMessages, id, EMPXItemInserted,
       
  3144             aCategory, KDBPluginUid);
       
  3145         }
       
  3146     // when the added item's category is Artist, and it is NOT a new record,
       
  3147     // we should send the item number changed message
       
  3148     else if (  aCategory == EMPXArtist &&
       
  3149             !newRecord && aItemChangedMessages )
       
  3150         {
       
  3151         MPXDbCommonUtil::AddItemChangedMessageL(*aItemChangedMessages, id, EMPXItemModified,
       
  3152             aCategory, KDBPluginUid);
       
  3153         }
       
  3154     aItemExist = !newRecord;
       
  3155     MPX_PERF_END(CMPXDbHandler_AddCategoryItemL);
       
  3156 
       
  3157     return id;
       
  3158     }
       
  3159 
  3121 void CMPXDbHandler::UpdateCategoryItemL(
  3160 void CMPXDbHandler::UpdateCategoryItemL(
  3122     TMPXGeneralCategory aCategory,
  3161         TMPXGeneralCategory aCategory,
  3123     TUint32 aCategoryId,
  3162         TUint32 aCategoryId,
  3124     const CMPXMedia& aMedia,
  3163         const CMPXMedia& aMedia,
  3125     TInt aDrive,
  3164         TInt aDrive,
  3126     CMPXMessageArray* aItemChangedMessages)
  3165         CMPXMessageArray* aItemChangedMessages)
  3127     {
  3166     {
  3128     DbCategoryL(aCategory)->UpdateItemL(aCategoryId, aMedia, aDrive, aItemChangedMessages);
  3167     switch(aCategory)
  3129     }
  3168         {
  3130 
  3169         case EMPXAlbum:
       
  3170             iDbAlbum->UpdateItemL(aCategoryId, aMedia, aDrive, aItemChangedMessages);
       
  3171             break;
       
  3172 
       
  3173         case EMPXArtist:
       
  3174             iDbArtist->UpdateItemL(aCategoryId, aMedia, aDrive, aItemChangedMessages);
       
  3175             break;
       
  3176 
       
  3177         default:
       
  3178             DbCategoryL(aCategory)->UpdateItemL(aCategoryId, aMedia, aDrive, aItemChangedMessages);
       
  3179             break;
       
  3180         }
       
  3181     }
  3131 // ----------------------------------------------------------------------------
  3182 // ----------------------------------------------------------------------------
  3132 // CMPXDbHandler::DeleteSongForCategoryL
  3183 // CMPXDbHandler::DeleteSongForCategoryL
  3133 // ----------------------------------------------------------------------------
  3184 // ----------------------------------------------------------------------------
  3134 //
  3185 //
  3135 void CMPXDbHandler::DeleteSongForCategoryL(
  3186 void CMPXDbHandler::DeleteSongForCategoryL(
  3136     TMPXGeneralCategory aCategory,
  3187     TMPXGeneralCategory aCategory,
  3137     TUint32 aCategoryId,
  3188     TUint32 aCategoryId,
  3138     TInt aDriveId,
  3189     TInt aDriveId,
  3139     CMPXMessageArray* aItemChangedMessages,
  3190     CMPXMessageArray* aItemChangedMessages,
  3140     TBool& aItemExist,
  3191     TBool& aItemExist)
  3141     const TDesC& aArt   
       
  3142     )
       
  3143     {
  3192     {
  3144     MPX_FUNC("CMPXDbHandler::DeleteSongForCategoryL");
  3193     MPX_FUNC("CMPXDbHandler::DeleteSongForCategoryL");
  3145     switch(aCategory)
  3194     DbCategoryL(aCategory)->DecrementSongsForCategoryL(aCategoryId, aDriveId,
  3146         {
  3195         aItemChangedMessages, aItemExist);
  3147         case EMPXAlbum:
       
  3148             iDbAlbum->DecrementSongsForAlbumL(aCategoryId, aDriveId, aItemChangedMessages, aItemExist, aArt);
       
  3149             break;
       
  3150         default:
       
  3151             DbCategoryL(aCategory)->DecrementSongsForCategoryL(aCategoryId, aDriveId,
       
  3152                     aItemChangedMessages, aItemExist);
       
  3153             break;
       
  3154         }
       
  3155     }
  3196     }
  3156 
  3197 
  3157 // ----------------------------------------------------------------------------
  3198 // ----------------------------------------------------------------------------
  3158 // CMPXDbHandler::HandlePlayCountModifiedL
  3199 // CMPXDbHandler::HandlePlayCountModifiedL
  3159 // ----------------------------------------------------------------------------
  3200 // ----------------------------------------------------------------------------
  3189 
  3230 
  3190     // Force the deprecated ID attribute
  3231     // Force the deprecated ID attribute
  3191     aItemChangedMessages[aItemChangedMessages.Count() - 1]->
  3232     aItemChangedMessages[aItemChangedMessages.Count() - 1]->
  3192         SetTObjectValueL<TMPXItemId>(KMPXMessageMediaDeprecatedId, plId);
  3233         SetTObjectValueL<TMPXItemId>(KMPXMessageMediaDeprecatedId, plId);
  3193     }
  3234     }
       
  3235 
  3194 
  3236 
  3195 // ---------------------------------------------------------------------------
  3237 // ---------------------------------------------------------------------------
  3196 // CMPXDbHandler::IsRemoteDrive
  3238 // CMPXDbHandler::IsRemoteDrive
  3197 // ---------------------------------------------------------------------------
  3239 // ---------------------------------------------------------------------------
  3198 //
  3240 //
  3235 
  3277 
  3236     CleanupStack::PopAndDestroy(mediaArray);
  3278     CleanupStack::PopAndDestroy(mediaArray);
  3237     CleanupStack::PopAndDestroy(&attributes);        
  3279     CleanupStack::PopAndDestroy(&attributes);        
  3238     }
  3280     }
  3239 
  3281 
       
  3282 TInt CMPXDbHandler::HandleGetAlbumsCountForArtistL(TUint32 aArtistId)
       
  3283     {
       
  3284     return iDbAlbum->GetAlbumsCountForArtistL(aArtistId);
       
  3285     }
       
  3286 
       
  3287 TBool CMPXDbHandler::HandleIsUnknownArtistL(TUint32 aArtistId)
       
  3288     {
       
  3289     return iDbArtist->IsUnknownArtistL(aArtistId);
       
  3290     }
       
  3291 
       
  3292 // ---------------------------------------------------------------------------
       
  3293 // CMPXDbHandler::HandleArtistForAlbumL
       
  3294 // ---------------------------------------------------------------------------
       
  3295 //
       
  3296 HBufC* CMPXDbHandler::HandleArtistForAlbumL(const TUint32 aAlbumId)
       
  3297     {
       
  3298 
       
  3299     TUint32 artistId = iDbMusic->ArtistForAlbumL(aAlbumId);
       
  3300     HBufC* artistname = GetNameMatchingIdL(artistId);
       
  3301     return artistname;
       
  3302     }
       
  3303 
  3240 // ---------------------------------------------------------------------------
  3304 // ---------------------------------------------------------------------------
  3241 // CMPXDbHandler::HandleAlbumartForAlbumL
  3305 // CMPXDbHandler::HandleAlbumartForAlbumL
  3242 // ---------------------------------------------------------------------------
  3306 // ---------------------------------------------------------------------------
  3243 //
  3307 //
  3244 HBufC*  CMPXDbHandler::HandleAlbumartForAlbumL(const TUint32 aAlbumId, TPtrC aArt)
  3308 HBufC*  CMPXDbHandler::HandleAlbumartForAlbumL(const TUint32 aAlbumId, TPtrC aArt)
  3245     {
  3309     {
  3246     return iDbMusic->AlbumartForAlbumL(aAlbumId, aArt);
  3310     return iDbMusic->AlbumartForAlbumL(aAlbumId, aArt);
  3247     }
  3311     }
  3248 
       
  3249 #ifdef ABSTRACTAUDIOALBUM_INCLUDED   
  3312 #ifdef ABSTRACTAUDIOALBUM_INCLUDED   
  3250 // ----------------------------------------------------------------------------------------------------------
  3313 // ----------------------------------------------------------------------------------------------------------
  3251 // CMPXDbHandler::HandleGetAlbumNameForSongL
  3314 // CMPXDbHandler::HandleGetAlbumNameForSongL
  3252 // ----------------------------------------------------------------------------------------------------------
  3315 // ----------------------------------------------------------------------------------------------------------
  3253 //
  3316 //
  3254 HBufC* CMPXDbHandler::HandleGetAlbumNameFromIdL(TUint32 aId)
  3317 HBufC* CMPXDbHandler::HandleGetAlbumNameFromIdL(TUint32 aId)
  3255     {
  3318     {
  3256     return iDbAbstractAlbum->GetUriL(aId);
  3319     return iDbAbstractAlbum->GetUriL(aId);
  3257     }
  3320     }
  3258 #endif // ABSTRACTAUDIOALBUM_INCLUDED
  3321 #endif // ABSTRACTAUDIOALBUM_INCLUDED
  3259 
       
  3260 // ----------------------------------------------------------------------------
       
  3261 // CMPXDbHandler::DeleteAlbumForArtistL
       
  3262 // ----------------------------------------------------------------------------
       
  3263 //
       
  3264 void CMPXDbHandler::DeleteAlbumForArtistL(TUint32 aCategoryId,
       
  3265     TInt aDrive, CMPXMessageArray* aItemChangedMessages)
       
  3266     {
       
  3267     MPX_FUNC("CMPXDbHandler::DeleteAlbumForArtistL");
       
  3268     iDbArtist->DecrementAlbumsForArtistL(aCategoryId, aDrive, aItemChangedMessages);
       
  3269     }
       
  3270 
       
  3271 // ----------------------------------------------------------------------------
       
  3272 // CMPXDbHandler::AddAlbumArtistL
       
  3273 // ----------------------------------------------------------------------------
       
  3274 //
       
  3275 TUint32 CMPXDbHandler::AddAlbumArtistL(const TDesC& aName, const TDesC& aArt, TInt aDriveId)
       
  3276     {
       
  3277     MPX_FUNC("CMPXDbHandler::AddAlbumArtistL");
       
  3278     return iDbArtist->AddAlbumArtistL(aName, aArt, aDriveId);
       
  3279     }
       
  3280 
       
  3281 // ----------------------------------------------------------------------------
       
  3282 // CMPXDbHandler::GenerateUniqueIdForAlbumL
       
  3283 // ----------------------------------------------------------------------------
       
  3284 //
       
  3285 TUint32 CMPXDbHandler::GenerateUniqueIdForAlbumL(const CMPXMedia& aMedia)
       
  3286     {
       
  3287     return iDbAlbum->GenerateUniqueIdL(aMedia);
       
  3288     }
       
  3289 
       
  3290 // ----------------------------------------------------------------------------
       
  3291 // CMPXDbHandler::IsUnknownAlbumL
       
  3292 // ----------------------------------------------------------------------------
       
  3293 //
       
  3294 TBool CMPXDbHandler::IsUnknownAlbumL(const TUint32 aId)
       
  3295     {
       
  3296     return iDbAlbum->IsUnknownAlbumL(aId);
       
  3297     }
       
  3298 // End of file
  3322 // End of file