35
|
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 |
*
|
43
|
14 |
* Description: Detailed song data provider for Details View.
|
35
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include <thumbnailmanager_qt.h>
|
|
19 |
|
|
20 |
#include "mpsongdata.h"
|
43
|
21 |
#include "mpsongdata_p.h"
|
35
|
22 |
|
|
23 |
/*!
|
|
24 |
\class MpSongData
|
|
25 |
\brief Music Player song metadata.
|
|
26 |
|
43
|
27 |
Song data provide access to song metadata.
|
35
|
28 |
*/
|
43
|
29 |
|
35
|
30 |
/*!
|
|
31 |
\fn void albumArtReady()
|
|
32 |
|
43
|
33 |
This signal is emitted album art is ready.
|
35
|
34 |
*/
|
|
35 |
|
|
36 |
/*!
|
|
37 |
\fn void playbackInfoChanged()
|
|
38 |
|
43
|
39 |
This signal is emitted when basic information is available.
|
35
|
40 |
*/
|
43
|
41 |
|
35
|
42 |
/*!
|
|
43 |
\fn void songDetailInfoChanged()
|
|
44 |
|
43
|
45 |
This signal is emitted when detail information is available.
|
35
|
46 |
*/
|
43
|
47 |
|
35
|
48 |
|
|
49 |
/*!
|
43
|
50 |
Constructs a new song data.
|
35
|
51 |
*/
|
|
52 |
MpSongData::MpSongData( QObject *parent )
|
43
|
53 |
: QObject( parent )
|
35
|
54 |
{
|
|
55 |
mThumbnailManager = new ThumbnailManager( this );
|
|
56 |
mThumbnailManager->setQualityPreference( ThumbnailManager::OptimizeForQuality );
|
|
57 |
mThumbnailManager->setThumbnailSize( ThumbnailManager::ThumbnailMedium );
|
43
|
58 |
connect( mThumbnailManager, SIGNAL( thumbnailReady(QPixmap, void *, int, int) ),
|
|
59 |
this, SLOT( thumbnailReady(QPixmap, void *, int, int) ) );
|
|
60 |
d_ptr = new MpSongDataPrivate(this, mThumbnailManager);
|
35
|
61 |
}
|
|
62 |
|
|
63 |
/*!
|
43
|
64 |
Destructs the song data.
|
35
|
65 |
*/
|
|
66 |
MpSongData::~MpSongData()
|
|
67 |
{
|
43
|
68 |
delete mThumbnailManager;
|
|
69 |
delete d_ptr;
|
35
|
70 |
}
|
|
71 |
|
|
72 |
/*!
|
|
73 |
Returns the song title.
|
43
|
74 |
*/
|
35
|
75 |
QString MpSongData::title() const
|
|
76 |
{
|
43
|
77 |
return d_ptr->title();
|
35
|
78 |
}
|
|
79 |
|
|
80 |
/*!
|
|
81 |
Returns the song album.
|
43
|
82 |
*/
|
35
|
83 |
QString MpSongData::album() const
|
|
84 |
{
|
43
|
85 |
return d_ptr->album();
|
35
|
86 |
}
|
|
87 |
|
|
88 |
/*!
|
|
89 |
Returns the song artist.
|
43
|
90 |
*/
|
35
|
91 |
QString MpSongData::artist() const
|
|
92 |
{
|
43
|
93 |
return d_ptr->artist();
|
35
|
94 |
}
|
|
95 |
|
|
96 |
/*!
|
|
97 |
Returns comment
|
43
|
98 |
*/
|
35
|
99 |
QString MpSongData::comment() const
|
|
100 |
{
|
43
|
101 |
return d_ptr->comment();
|
|
102 |
}
|
|
103 |
|
|
104 |
/*!
|
|
105 |
Returns the song album art on \a icon.
|
|
106 |
*/
|
|
107 |
void MpSongData::albumArt( HbIcon& icon ) const
|
|
108 |
{
|
|
109 |
d_ptr->albumArt(icon);
|
|
110 |
}
|
|
111 |
|
|
112 |
/*!
|
|
113 |
Returns the release date.
|
|
114 |
*/
|
|
115 |
QString MpSongData::year() const
|
|
116 |
{
|
|
117 |
return d_ptr->year();
|
|
118 |
}
|
|
119 |
|
|
120 |
/*!
|
|
121 |
Returns the song genre.
|
|
122 |
*/
|
|
123 |
QString MpSongData::genre() const
|
|
124 |
{
|
|
125 |
return d_ptr->genre();
|
35
|
126 |
}
|
|
127 |
|
|
128 |
/*!
|
|
129 |
Returns the song composer.
|
43
|
130 |
*/
|
35
|
131 |
QString MpSongData::composer() const
|
|
132 |
{
|
43
|
133 |
return d_ptr->composer();
|
35
|
134 |
}
|
|
135 |
|
43
|
136 |
/*!
|
|
137 |
Returns the album track.
|
|
138 |
*/
|
|
139 |
QString MpSongData::albumTrack() const
|
|
140 |
{
|
|
141 |
return d_ptr->albumTrack();
|
|
142 |
}
|
35
|
143 |
|
|
144 |
/*!
|
43
|
145 |
Returns link
|
|
146 |
*/
|
|
147 |
QString MpSongData::link() const
|
35
|
148 |
{
|
43
|
149 |
return d_ptr->link();
|
35
|
150 |
}
|
|
151 |
|
|
152 |
|
|
153 |
/*!
|
|
154 |
Returns the file name
|
43
|
155 |
*/
|
35
|
156 |
QString MpSongData::fileName() const
|
|
157 |
{
|
43
|
158 |
return d_ptr->fileName();
|
35
|
159 |
}
|
|
160 |
|
|
161 |
/*!
|
|
162 |
Returns the MIME type
|
43
|
163 |
*/
|
35
|
164 |
QString MpSongData::mimeType() const
|
|
165 |
{
|
43
|
166 |
return d_ptr->mimeType();
|
35
|
167 |
}
|
|
168 |
|
|
169 |
/*!
|
|
170 |
Returns the duration
|
43
|
171 |
*/
|
35
|
172 |
QString MpSongData::duration() const
|
|
173 |
{
|
43
|
174 |
return d_ptr->duration();
|
35
|
175 |
}
|
|
176 |
|
|
177 |
/*!
|
|
178 |
Returns the bit rate
|
43
|
179 |
*/
|
35
|
180 |
QString MpSongData::bitRate() const
|
|
181 |
{
|
43
|
182 |
return d_ptr->bitRate();
|
35
|
183 |
}
|
|
184 |
|
|
185 |
/*!
|
|
186 |
Returns the sampling rate
|
43
|
187 |
*/
|
35
|
188 |
QString MpSongData::sampleRate() const
|
|
189 |
{
|
43
|
190 |
return d_ptr->sampleRate();
|
35
|
191 |
}
|
|
192 |
|
|
193 |
/*!
|
|
194 |
Returns the size
|
43
|
195 |
*/
|
35
|
196 |
QString MpSongData::size() const
|
|
197 |
{
|
43
|
198 |
return d_ptr->size();
|
35
|
199 |
}
|
|
200 |
|
|
201 |
/*!
|
43
|
202 |
Returns the modified time
|
|
203 |
*/
|
35
|
204 |
QString MpSongData::modified() const
|
|
205 |
{
|
43
|
206 |
return d_ptr->modified();
|
35
|
207 |
}
|
|
208 |
|
|
209 |
/*!
|
43
|
210 |
Returns the copyright
|
|
211 |
*/
|
35
|
212 |
QString MpSongData::copyright() const
|
|
213 |
{
|
43
|
214 |
return d_ptr->copyright();
|
35
|
215 |
}
|
|
216 |
|
|
217 |
/*!
|
|
218 |
Returns the music URL
|
43
|
219 |
*/
|
35
|
220 |
QString MpSongData::musicURL() const
|
|
221 |
{
|
43
|
222 |
return d_ptr->musicURL();
|
35
|
223 |
}
|
|
224 |
|
|
225 |
/*!
|
|
226 |
Returns whether the song is protected
|
43
|
227 |
*/
|
35
|
228 |
bool MpSongData::isDrmProtected() const
|
|
229 |
{
|
43
|
230 |
return d_ptr->isDrmProtected();
|
35
|
231 |
}
|
|
232 |
|
|
233 |
|
|
234 |
/*!
|
43
|
235 |
Retrieve the album art in base64 encoding suitable for inline HTML display for sharing player.
|
|
236 |
*/
|
|
237 |
QString MpSongData::albumArtBase64() const
|
35
|
238 |
{
|
43
|
239 |
return d_ptr->albumArtBase64();
|
35
|
240 |
}
|
|
241 |
|
|
242 |
/*!
|
43
|
243 |
Delete temporary album art file.
|
|
244 |
*/
|
|
245 |
void MpSongData::removeAlbumArtFile() const
|
35
|
246 |
{
|
43
|
247 |
d_ptr->removeAlbumArtFile();
|
35
|
248 |
}
|
|
249 |
|
|
250 |
/*!
|
|
251 |
Sets the \a link
|
|
252 |
*/
|
|
253 |
void MpSongData::setLink( const QString &link )
|
|
254 |
{
|
43
|
255 |
d_ptr->setLink(link);
|
35
|
256 |
}
|
|
257 |
|
|
258 |
/*!
|
43
|
259 |
Sets the media \a media from the MPX framework.
|
|
260 |
Internal usage only from MpEngine.
|
|
261 |
*/
|
|
262 |
void MpSongData::setMpxMedia( const CMPXMedia& media )
|
35
|
263 |
{
|
43
|
264 |
d_ptr->setMpxMedia(media);
|
35
|
265 |
}
|
|
266 |
|
|
267 |
/*!
|
43
|
268 |
Returns the reserved length.
|
|
269 |
*/
|
|
270 |
int MpSongData::reservedLength() const
|
35
|
271 |
{
|
43
|
272 |
return d_ptr->reservedLength();
|
35
|
273 |
}
|
|
274 |
|
|
275 |
/*!
|
|
276 |
Slot to handle the album art thumb.
|
43
|
277 |
*/
|
|
278 |
void MpSongData::thumbnailReady( QPixmap pixmap, void *data, int id, int error )
|
35
|
279 |
{
|
43
|
280 |
d_ptr->thumbnailReady(pixmap, data, id, error);
|
35
|
281 |
}
|
|
282 |
|