mpserviceplugins/mpxsqlitedbhgplugin/inc/mpxdbmusic.h
branchGCC_SURGE
changeset 44 eff9df3d9c98
parent 42 79c49924ae23
child 51 560ce2306a17
equal deleted inserted replaced
30:b95ddb5a0d10 44:eff9df3d9c98
    78         virtual TUint32 AddCategoryItemL(TMPXGeneralCategory aCategory, const TDesC& aName,
    78         virtual TUint32 AddCategoryItemL(TMPXGeneralCategory aCategory, const TDesC& aName,
    79             TInt aDrive, CMPXMessageArray* aItemChangedMessages, TBool& aItemExist) = 0;
    79             TInt aDrive, CMPXMessageArray* aItemChangedMessages, TBool& aItemExist) = 0;
    80 #endif // ABSTRACTAUDIOALBUM_INCLUDED
    80 #endif // ABSTRACTAUDIOALBUM_INCLUDED
    81        // for Album and Artist table
    81        // for Album and Artist table
    82         virtual TUint32 AddCategoryItemL(TMPXGeneralCategory aCategory, const TDesC& aName,
    82         virtual TUint32 AddCategoryItemL(TMPXGeneralCategory aCategory, const TDesC& aName,
    83             TUint32 aArtistId, const TDesC& aArt,
    83             const TDesC& aArtistName, const TDesC& aArt,
    84             TInt aDrive, CMPXMessageArray* aItemChangedMessages, TBool& aItemExist) = 0;
    84             TInt aDrive, CMPXMessageArray* aItemChangedMessages, TBool& aItemExist) = 0;
    85         /**
    85         /**
    86         * Called when the ID of a category item changed for a Music record, for example when
    86         * Called when the ID of a category item changed for a Music record, for example when
    87         * the artist name changed for a song. The implementation is supposed to update the
    87         * the artist name changed for a song. The implementation is supposed to update the
    88         * category record and add corresponding item changed messages to the array parameter.
    88         * category record and add corresponding item changed messages to the array parameter.
   243         * @param aAlbumId returns the artist ID
   243         * @param aAlbumId returns the artist ID
   244         * @param aGenreId returns the artist ID
   244         * @param aGenreId returns the artist ID
   245         * @param aComposerId returns the artist ID
   245         * @param aComposerId returns the artist ID
   246         * @param aAbstractAlbumId returns the AbstractAlbum ID
   246         * @param aAbstractAlbumId returns the AbstractAlbum ID
   247         * @param aDriveId returns the song drive
   247         * @param aDriveId returns the song drive
       
   248         * @param aArt returns the albumart uri
   248         * @return song URI. The ownership is transferred.
   249         * @return song URI. The ownership is transferred.
   249         */
   250         */
   250         HBufC* GetSongInfoL(TUint32 aSongId, TUint32& aArtistId, TUint32& aAlbumId,
   251         HBufC* GetSongInfoL(TUint32 aSongId, TUint32& aArtistId, TUint32& aAlbumId,
   251             TUint32& aGenreId, TUint32& aComposerId, TUint32& aAbstractAlbumId, TInt& aDriveId);
   252             TUint32& aGenreId, TUint32& aComposerId, TUint32& aAbstractAlbumId, TInt& aDriveId, HBufC*& aArt);
   252 #else 
   253 #else 
   253         /**
   254         /**
   254         * Get the drive and category IDs for a specified song
   255         * Get the drive and category IDs for a specified song
   255         * @param aSongId song to be retrieved
   256         * @param aSongId song to be retrieved
   256         * @param aArtistId returns the artist ID
   257         * @param aArtistId returns the artist ID
   257         * @param aAlbumId returns the artist ID
   258         * @param aAlbumId returns the artist ID
   258         * @param aGenreId returns the artist ID
   259         * @param aGenreId returns the artist ID
   259         * @param aComposerId returns the artist ID
   260         * @param aComposerId returns the artist ID
   260         * @param aDriveId returns the song drive
   261         * @param aDriveId returns the song drive
       
   262         * @param aArt returns the albumart uri
   261         * @return song URI. The ownership is transferred.
   263         * @return song URI. The ownership is transferred.
   262         */
   264         */
   263         HBufC* GetSongInfoL(TUint32 aSongId, TUint32& aArtistId, TUint32& aAlbumId,
   265         HBufC* GetSongInfoL(TUint32 aSongId, TUint32& aArtistId, TUint32& aAlbumId,
   264             TUint32& aGenreId, TUint32& aComposerId, TInt& aDriveId);
   266             TUint32& aGenreId, TUint32& aComposerId, TInt& aDriveId, HBufC*& aArt);
   265 #endif // ABSTRACTAUDIOALBUM_INCLUDED
   267 #endif // ABSTRACTAUDIOALBUM_INCLUDED
   266         /**
   268         /**
   267         * Get the song Id, title, URI, and general flags from the given song Id and/or URI
   269         * Get the song Id, title, URI, and general flags from the given song Id and/or URI
   268         * @param aCriteria search the media by song Id and/or URI
   270         * @param aCriteria search the media by song Id and/or URI
   269         * @param aMedia returns the song details
   271         * @param aMedia returns the song details
   524 
   526 
   525         /**
   527         /**
   526          * Get the ID of Artist which belongs to the specified Album
   528          * Get the ID of Artist which belongs to the specified Album
   527          * @param aId, the ID of Album
   529          * @param aId, the ID of Album
   528          */
   530          */
   529         TUint32 CMPXDbMusic::ArtistForAlbumL(const TUint32 aId);
   531         TUint32 ArtistForAlbumL(const TUint32 aId);
       
   532             
       
   533         /**
       
   534         * Get the Albumart of song which belongs to the specified Album
       
   535         * @param aId, the ID of Album
       
   536         * @param aArt, AlbumArt uri
       
   537 		* @returns alternative albumart retrieved in the specified Album.
       
   538         */
       
   539         HBufC* AlbumartForAlbumL(const TUint32 aAlbumId, TPtrC aArt);
       
   540         
   530 
   541 
   531         /*
   542         /*
   532         * Check the integrity of the music basic table
   543         * Check the integrity of the music basic table
   533         */
   544         */
   534         void CheckMusicBasicTableL();
   545         void CheckMusicBasicTableL();
   675         */
   686         */
   676         TBool UpdateCategoryFieldL(TMPXGeneralCategory aCategory, const CMPXMedia& aMedia,
   687         TBool UpdateCategoryFieldL(TMPXGeneralCategory aCategory, const CMPXMedia& aMedia,
   677             const TMPXAttribute& aAttribute, TUint32 aOldId, TInt aDriveId,
   688             const TMPXAttribute& aAttribute, TUint32 aOldId, TInt aDriveId,
   678             CMPXMessageArray* aItemChangedMessages, TUint32& aItemId);
   689             CMPXMessageArray* aItemChangedMessages, TUint32& aItemId);
   679 
   690 
   680         TBool UpdateCategoryFieldL(TMPXGeneralCategory aCategory, const CMPXMedia& aMedia,
       
   681           const TMPXAttribute& aAttribute, TUint32 aOldId, TInt aDriveId,
       
   682           CMPXMessageArray* aItemChangedMessages, TUint32& aItemId, TUint32 aArtistId);
       
   683         /**
   691         /**
   684         * Checks if extra attributes are required. The "standard attribute set includes:
   692         * Checks if extra attributes are required. The "standard attribute set includes:
   685         * EMPXMediaGeneralId, EMPXMediaGeneralType, EMPXMediaGeneralCategory,
   693         * EMPXMediaGeneralId, EMPXMediaGeneralType, EMPXMediaGeneralCategory,
   686         * EMPXMediaGeneralTitle, EMPXMediaGeneralUri, and EMPXMediaGeneralFlags
   694         * EMPXMediaGeneralTitle, EMPXMediaGeneralUri, and EMPXMediaGeneralFlags
   687         * @param aAttrs attributes to be checked
   695         * @param aAttrs attributes to be checked
   694         * @param aMedia media to be tested
   702         * @param aMedia media to be tested
   695         * @return ETrue if the media contains one or more supported attribute;
   703         * @return ETrue if the media contains one or more supported attribute;
   696         *  otherwise EFalse.
   704         *  otherwise EFalse.
   697         */
   705         */
   698         TBool IsSupported(const CMPXMedia& aMedia);
   706         TBool IsSupported(const CMPXMedia& aMedia);
       
   707         
       
   708         /**
       
   709          * Query all songs from the database and add results to the 
       
   710          * iAllSongsQueryResult cache array.
       
   711          */
       
   712         void ExecuteQueryAllSongsL(const TArray<TMPXAttribute>& aAttrs);
   699 
   713 
   700     private:    // from MMPXTable
   714     private:    // from MMPXTable
   701 
   715 
   702         /**
   716         /**
   703         * @see MMPXTable
   717         * @see MMPXTable
   796         CDesCArrayFlat* iExtensionsDrm;
   810         CDesCArrayFlat* iExtensionsDrm;
   797         MMPXDbMusicObserver& iObserver;
   811         MMPXDbMusicObserver& iObserver;
   798 #ifdef ABSTRACTAUDIOALBUM_INCLUDED 
   812 #ifdef ABSTRACTAUDIOALBUM_INCLUDED 
   799         TBool iArtNeedUpdated;
   813         TBool iArtNeedUpdated;
   800 #endif // ABSTRACTAUDIOALBUM_INCLUDED
   814 #endif // ABSTRACTAUDIOALBUM_INCLUDED
       
   815         RPointerArray<CMPXMedia> iAllSongsQueryResult;
   801     };
   816     };
   802 
   817 
   803 #endif // MPXDBMUSIC_H
   818 #endif // MPXDBMUSIC_H
   804 
   819 
   805 // End of File
   820 // End of File