diff -r 2c5162224003 -r fdb31ab341af mpdata/src/mpplaybackdata.cpp --- a/mpdata/src/mpplaybackdata.cpp Fri Apr 30 19:33:32 2010 -0500 +++ b/mpdata/src/mpplaybackdata.cpp Fri May 14 18:54:37 2010 -0500 @@ -15,10 +15,10 @@ * */ -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -74,23 +74,25 @@ Constructs a new MpPlaybackData. */ MpPlaybackData::MpPlaybackData( QObject *parent ) - : QObject(parent), - mThumbnailManager(0), - mReqId(KUndefined), + : QObject( parent ), + mThumbnailManager( new ThumbnailManager( this ) ), + mReqId( KUndefined ), mDuration(0), mPosition(0), - mAlbumArt(), - mPlaybackState(Stopped) + mAlbum( hbTrId ( "txt_mus_other_unknown4" ) ), + mArtist( hbTrId ( "txt_mus_other_unknown3") ), + mAlbumId(0), + mId(0), + mAlbumArt( "qtg_large_music_album" ), + mDefaultAlbumArt( "qtg_large_music_album" ), + mPlaybackState( NotPlaying ), + mRealAudio( false ) { TX_ENTRY - mThumbnailManager = new ThumbnailManager(this); - mThumbnailManager->setQualityPreference(ThumbnailManager::OptimizeForQuality); - mThumbnailManager->setThumbnailSize(ThumbnailManager::ThumbnailLarge); - connect( mThumbnailManager, SIGNAL(thumbnailReady(QPixmap, void *, int, int)), - this, SLOT(thumbnailReady(QPixmap, void *, int, int)) ); - - //TODO: Change to final resource when available - mDefaultAlbumArt = new HbIcon("qtg_large_music"); + mThumbnailManager->setQualityPreference( ThumbnailManager::OptimizeForQuality ); + mThumbnailManager->setThumbnailSize( ThumbnailManager::ThumbnailLarge ); + connect( mThumbnailManager, SIGNAL( thumbnailReady(QPixmap, void *, int, int ) ), + this, SLOT(thumbnailReady( QPixmap, void *, int, int ) ) ); TX_EXIT } @@ -177,7 +179,12 @@ bool change = false; if ( artist != mArtist ) { change = true; - mArtist = artist; + if ( artist.isEmpty() ){ + mArtist = hbTrId( "txt_mus_other_unknown3" ); + } + else { + mArtist = artist; + } } TX_EXIT return change; @@ -201,7 +208,12 @@ bool change = false; if ( album != mAlbum ) { change = true; - mAlbum = album; + if ( album.isEmpty() ){ + mAlbum = hbTrId( "txt_mus_other_unknown4" ); + } + else{ + mAlbum = album; + } } TX_EXIT return change; @@ -275,16 +287,75 @@ void MpPlaybackData::albumArt( HbIcon& icon ) const { TX_ENTRY - if ( mAlbumArt->isNull() ) { - icon = HbIcon(); - } - else { - icon = *mAlbumArt ; - } + icon = mAlbumArt ; TX_EXIT } /*! + Sets the song's album \a id, returns true if the value is new. +*/ +bool MpPlaybackData::setAlbumId( int id ) +{ + bool change = false; + if (mAlbumId != id) { + mAlbumId = id; + change = true; + } + return change; +} + +/*! + Returns the id of the album to which the song belongs. +*/ +int MpPlaybackData::albumId() +{ + return mAlbumId; +} + +/*! + Sets the song's \a id, returns true if the value is new. +*/ +bool MpPlaybackData::setId( int id ) +{ + bool change = false; + if (mId != id) { + mId = id; + change = true; + } + return change; +} + +/*! + Returns the id the song. +*/ +int MpPlaybackData::id() +{ + return mId; +} +/*! +Set Real Audio \a mode. +*/ +bool MpPlaybackData::setRealAudio( bool mode ) +{ + TX_ENTRY + bool change = false; + if (mRealAudio != mode) { + mRealAudio = mode; + change = true; + } + TX_EXIT + return change; +} + +/*! + Returns the mode of Real Audio. +*/ +bool MpPlaybackData::realAudio() +{ + return mRealAudio; +} + +/*! Sets the playback \a state. */ void MpPlaybackData::setPlaybackState( const SimplifiedState state ) @@ -316,6 +387,7 @@ TX_EXIT } + /*! Slot to handle the album art thumb. */ @@ -345,7 +417,7 @@ } - mAlbumArt = new HbIcon(qicon); + mAlbumArt = HbIcon(qicon); emit albumArtReady(); }