1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Metadata of song for details view. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef MPSONGDATA_H |
|
19 #define MPSONGDATA_H |
|
20 |
|
21 #include <QObject> |
|
22 #include <QString> |
|
23 #include <QPixmap> |
|
24 |
|
25 //forward declartions |
|
26 class HbIcon; |
|
27 |
|
28 //class declaration |
|
29 class MpSongData : public QObject |
|
30 { |
|
31 Q_OBJECT |
|
32 |
|
33 public: |
|
34 explicit MpSongData( QObject *parent=0 ); |
|
35 virtual ~MpSongData(); |
|
36 |
|
37 bool setTitle( const QString &title ); |
|
38 bool setAlbum( const QString &album ); |
|
39 bool setArtist( const QString &artist ); |
|
40 bool setComment( const QString &comment ); |
|
41 void setAlbumArtUri( const QString &albumArtUri ); |
|
42 bool setYear( int date ); |
|
43 bool setGenre( const QString &genre ); |
|
44 bool setComposer( const QString &compoer ); |
|
45 bool setAlbumTrack( const QString &albumtrack ); |
|
46 void setLink( const QString &link ); |
|
47 bool setFileName( const QString &fileName ); |
|
48 bool setMimeType( const QString &mimeType ); |
|
49 bool setDuration( int duration ); |
|
50 bool setBitRate( int bitRate); |
|
51 bool setSampleRate( int sampleRate ); |
|
52 bool setSize( int size ); |
|
53 bool setModified( const QString &modified ); |
|
54 bool setCopyright( const QString ©right ); |
|
55 bool setMusicURL( const QString &musicURL ); |
|
56 bool setDrmProtected( bool drmProtected ); |
|
57 |
|
58 // inform details view when basic information is ready to accelerate UI update |
|
59 void commitPlaybackInfo(); |
|
60 // inform details view when details information is ready |
|
61 void commitSongDetailInfo(); |
|
62 |
|
63 public slots: |
|
64 void thumbnailReady( const QPixmap& pixmap, void *data, int id, int error ); |
|
65 |
|
66 int reservedLength() const { return mLink.length() + mTitle.length() + mArtist.length(); } |
|
67 |
|
68 QString title() const; |
|
69 QString album() const; |
|
70 QString artist() const; |
|
71 QString comment() const; |
|
72 void albumArt( HbIcon& icon ) const; |
|
73 QString year() const; |
|
74 QString genre() const; |
|
75 QString composer() const; |
|
76 QString albumTrack() const; |
|
77 QString link() const; |
|
78 |
|
79 QString fileName() const; |
|
80 QString mimeType() const; |
|
81 QString duration() const; |
|
82 QString bitRate() const; |
|
83 QString sampleRate() const; |
|
84 QString size() const; |
|
85 QString modified() const; |
|
86 QString copyright() const; |
|
87 QString musicURL() const; |
|
88 bool isDrmProtected() const; |
|
89 |
|
90 QString albumArtBase64() const; |
|
91 |
|
92 signals: |
|
93 void albumArtReady(); |
|
94 void playbackInfoChanged(); |
|
95 void songDetailInfoChanged(); |
|
96 |
|
97 private: |
|
98 QString mTitle; |
|
99 QString mAlbum; |
|
100 QString mArtist; |
|
101 QString mComment; |
|
102 QString mComposer; |
|
103 QString mGenre; |
|
104 QString mYear; |
|
105 QString mAlbumTrack; |
|
106 HbIcon *mAlbumArt; |
|
107 TInt mReqId; |
|
108 QString currentAAUri; |
|
109 HbIcon *mDefaultAlbumArt; |
|
110 QString mLink; |
|
111 QString mFileName; |
|
112 QString mMimeType; |
|
113 QString mDuration; |
|
114 QString mBitRate; |
|
115 QString mSampleRate; |
|
116 QString mSize; |
|
117 QString mModified; |
|
118 QString mCopyright; |
|
119 QString mMusicURL; |
|
120 bool mDrmProtected; |
|
121 |
|
122 Q_DISABLE_COPY(MpSongData) |
|
123 }; |
|
124 |
|
125 #endif // MPSONGDATA_H |
|