72 |
72 |
73 /*! |
73 /*! |
74 Constructs a new MpPlaybackData. |
74 Constructs a new MpPlaybackData. |
75 */ |
75 */ |
76 MpPlaybackData::MpPlaybackData( QObject *parent ) |
76 MpPlaybackData::MpPlaybackData( QObject *parent ) |
77 : QObject(parent), |
77 : QObject( parent ), |
78 mThumbnailManager(0), |
78 mThumbnailManager( new ThumbnailManager( this ) ), |
79 mReqId(KUndefined), |
79 mReqId( KUndefined ), |
80 mDuration(0), |
80 mDuration(0), |
81 mPosition(0), |
81 mPosition(0), |
82 mAlbumArt(), |
82 mAlbum( hbTrId ( "txt_mus_other_unknown4" ) ), |
83 mPlaybackState(Stopped) |
83 mArtist( hbTrId ( "txt_mus_other_unknown3") ), |
|
84 mAlbumId(0), |
|
85 mId(0), |
|
86 mAlbumArt( "qtg_large_music_album" ), |
|
87 mDefaultAlbumArt( "qtg_large_music_album" ), |
|
88 mPlaybackState( NotPlaying ), |
|
89 mRealAudio( false ) |
84 { |
90 { |
85 TX_ENTRY |
91 TX_ENTRY |
86 mThumbnailManager = new ThumbnailManager(this); |
92 mThumbnailManager->setQualityPreference( ThumbnailManager::OptimizeForQuality ); |
87 mThumbnailManager->setQualityPreference(ThumbnailManager::OptimizeForQuality); |
93 mThumbnailManager->setThumbnailSize( ThumbnailManager::ThumbnailLarge ); |
88 mThumbnailManager->setThumbnailSize(ThumbnailManager::ThumbnailLarge); |
94 connect( mThumbnailManager, SIGNAL( thumbnailReady(QPixmap, void *, int, int ) ), |
89 connect( mThumbnailManager, SIGNAL(thumbnailReady(QPixmap, void *, int, int)), |
95 this, SLOT(thumbnailReady( QPixmap, void *, int, int ) ) ); |
90 this, SLOT(thumbnailReady(QPixmap, void *, int, int)) ); |
|
91 |
|
92 //TODO: Change to final resource when available |
|
93 mDefaultAlbumArt = new HbIcon("qtg_large_music"); |
|
94 TX_EXIT |
96 TX_EXIT |
95 } |
97 } |
96 |
98 |
97 /*! |
99 /*! |
98 Constructs a new MpPlaybackData. |
100 Constructs a new MpPlaybackData. |
273 Returns the song album art on \a icon. |
285 Returns the song album art on \a icon. |
274 */ |
286 */ |
275 void MpPlaybackData::albumArt( HbIcon& icon ) const |
287 void MpPlaybackData::albumArt( HbIcon& icon ) const |
276 { |
288 { |
277 TX_ENTRY |
289 TX_ENTRY |
278 if ( mAlbumArt->isNull() ) { |
290 icon = mAlbumArt ; |
279 icon = HbIcon(); |
291 TX_EXIT |
280 } |
292 } |
281 else { |
293 |
282 icon = *mAlbumArt ; |
294 /*! |
283 } |
295 Sets the song's album \a id, returns true if the value is new. |
284 TX_EXIT |
296 */ |
|
297 bool MpPlaybackData::setAlbumId( int id ) |
|
298 { |
|
299 bool change = false; |
|
300 if (mAlbumId != id) { |
|
301 mAlbumId = id; |
|
302 change = true; |
|
303 } |
|
304 return change; |
|
305 } |
|
306 |
|
307 /*! |
|
308 Returns the id of the album to which the song belongs. |
|
309 */ |
|
310 int MpPlaybackData::albumId() |
|
311 { |
|
312 return mAlbumId; |
|
313 } |
|
314 |
|
315 /*! |
|
316 Sets the song's \a id, returns true if the value is new. |
|
317 */ |
|
318 bool MpPlaybackData::setId( int id ) |
|
319 { |
|
320 bool change = false; |
|
321 if (mId != id) { |
|
322 mId = id; |
|
323 change = true; |
|
324 } |
|
325 return change; |
|
326 } |
|
327 |
|
328 /*! |
|
329 Returns the id the song. |
|
330 */ |
|
331 int MpPlaybackData::id() |
|
332 { |
|
333 return mId; |
|
334 } |
|
335 /*! |
|
336 Set Real Audio \a mode. |
|
337 */ |
|
338 bool MpPlaybackData::setRealAudio( bool mode ) |
|
339 { |
|
340 TX_ENTRY |
|
341 bool change = false; |
|
342 if (mRealAudio != mode) { |
|
343 mRealAudio = mode; |
|
344 change = true; |
|
345 } |
|
346 TX_EXIT |
|
347 return change; |
|
348 } |
|
349 |
|
350 /*! |
|
351 Returns the mode of Real Audio. |
|
352 */ |
|
353 bool MpPlaybackData::realAudio() |
|
354 { |
|
355 return mRealAudio; |
285 } |
356 } |
286 |
357 |
287 /*! |
358 /*! |
288 Sets the playback \a state. |
359 Sets the playback \a state. |
289 */ |
360 */ |