18
|
1 |
/**
|
|
2 |
* Copyright (c) 2010 Sasken Communication Technologies Ltd.
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of the "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 |
* Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
* Manasij Roy, Nalina Hariharan
|
|
14 |
*
|
|
15 |
* Description:
|
|
16 |
* The SmfArtists class represents the artists in a track or an album
|
|
17 |
*
|
|
18 |
*/
|
|
19 |
|
|
20 |
#include <smfartists.h>
|
|
21 |
#include <smfartists_p.h>
|
|
22 |
|
|
23 |
/**
|
|
24 |
* Constructor with default argument
|
|
25 |
*/
|
|
26 |
SmfArtists::SmfArtists( )
|
|
27 |
{
|
|
28 |
d = new SmfArtistsPrivate;
|
|
29 |
}
|
|
30 |
|
|
31 |
/**
|
|
32 |
* Copy Constructor
|
|
33 |
* @param aOther The reference object
|
|
34 |
*/
|
|
35 |
SmfArtists::SmfArtists( const SmfArtists &aOther )
|
|
36 |
:d( aOther.d )
|
|
37 |
{
|
|
38 |
}
|
|
39 |
|
|
40 |
/**
|
|
41 |
* Overloaded = operator
|
|
42 |
* @param aOther The reference object
|
|
43 |
* @return The target reference value
|
|
44 |
*/
|
|
45 |
SmfArtists& SmfArtists::operator=( const SmfArtists &aOther )
|
|
46 |
{
|
|
47 |
d->m_names = aOther.d->m_names;
|
|
48 |
d->m_image = aOther.d->m_image;
|
|
49 |
d->m_url = aOther.d->m_url;
|
25
|
50 |
d->m_tags = aOther.d->m_tags;
|
|
51 |
d->m_id = aOther.d->m_id;
|
18
|
52 |
return *this;
|
|
53 |
}
|
|
54 |
|
|
55 |
/**
|
|
56 |
* Destructor
|
|
57 |
*/
|
|
58 |
SmfArtists::~SmfArtists( )
|
|
59 |
{
|
|
60 |
}
|
|
61 |
|
|
62 |
/**
|
|
63 |
* Method to get the artists names
|
|
64 |
* @return The list of artists
|
|
65 |
*/
|
|
66 |
QStringList SmfArtists::names( ) const
|
|
67 |
{
|
|
68 |
return d->m_names;
|
|
69 |
}
|
|
70 |
|
|
71 |
/**
|
|
72 |
* Method to get the image of the artists
|
|
73 |
* @return The image of te artists
|
|
74 |
*/
|
|
75 |
QImage SmfArtists::image( ) const
|
|
76 |
{
|
|
77 |
return d->m_image;
|
|
78 |
}
|
|
79 |
|
|
80 |
/**
|
|
81 |
* Method to get the url of the artists
|
|
82 |
* @return The url of the artists
|
|
83 |
*/
|
|
84 |
QUrl SmfArtists::url( ) const
|
|
85 |
{
|
|
86 |
return d->m_url;
|
|
87 |
}
|
|
88 |
|
|
89 |
/**
|
25
|
90 |
* Method to get the tags applied for artist(s)
|
|
91 |
* @return list of tags, NULL if not supported
|
|
92 |
*/
|
|
93 |
QStringList SmfArtists::tags( ) const
|
|
94 |
{
|
|
95 |
return d->m_tags;
|
|
96 |
}
|
|
97 |
|
|
98 |
/**
|
|
99 |
* Service specific Id for this artist(s), e.g. could be musicbrainz id for this artist
|
|
100 |
* @return service specific id of the artists, NULL if not supported
|
|
101 |
*/
|
|
102 |
QString SmfArtists::id( ) const
|
|
103 |
{
|
|
104 |
return d->m_id;
|
|
105 |
}
|
|
106 |
|
|
107 |
/**
|
18
|
108 |
* Method to set the artists names
|
|
109 |
* @param aList The list of artists names
|
|
110 |
*/
|
|
111 |
void SmfArtists::setNames( const QStringList &aList )
|
|
112 |
{
|
|
113 |
d->m_names = aList;
|
|
114 |
}
|
|
115 |
|
|
116 |
/**
|
|
117 |
* Method to set the image of the artists
|
|
118 |
* @param aImage The image of the artists
|
|
119 |
*/
|
|
120 |
void SmfArtists::setImage( const QImage &aImage )
|
|
121 |
{
|
|
122 |
d->m_image = aImage;
|
|
123 |
}
|
|
124 |
|
|
125 |
/**
|
|
126 |
* Method to set the url of the artists
|
|
127 |
* @param aUrl The url of the artists
|
|
128 |
*/
|
|
129 |
void SmfArtists::setUrl( const QUrl &aUrl )
|
|
130 |
{
|
|
131 |
d->m_url = aUrl;
|
|
132 |
}
|
25
|
133 |
|
|
134 |
/**
|
|
135 |
* Method to set tags of the artists
|
|
136 |
* @param aTags tags for the artists
|
|
137 |
*/
|
|
138 |
void SmfArtists::setTags( const QStringList &aTags )
|
|
139 |
{
|
|
140 |
d->m_tags = aTags;
|
|
141 |
}
|
|
142 |
|
|
143 |
/**
|
|
144 |
* Method to set the service specific ID of the artists
|
|
145 |
* @param aId The id of the artists
|
|
146 |
*/
|
|
147 |
void SmfArtists::setId( const QString &aId )
|
|
148 |
{
|
|
149 |
d->m_id = aId;
|
|
150 |
}
|
|
151 |
|
18
|
152 |
/**
|
|
153 |
* Method for Externalization. Writes the SmfArtists object to
|
|
154 |
* the stream and returns a reference to the stream.
|
|
155 |
* @param aDataStream Stream to be written
|
|
156 |
* @param aArtists The SmfArtists object to be externalized
|
|
157 |
* @return reference to the written stream
|
|
158 |
*/
|
|
159 |
QDataStream &operator<<( QDataStream &aDataStream,
|
|
160 |
const SmfArtists &aArtists )
|
|
161 |
{
|
|
162 |
// Serialize d->m_image
|
|
163 |
aDataStream<<aArtists.d->m_image;
|
|
164 |
|
|
165 |
// Serialize d->m_names
|
|
166 |
aDataStream<<aArtists.d->m_names;
|
|
167 |
|
|
168 |
// Serialize d->m_url
|
|
169 |
aDataStream<<aArtists.d->m_url;
|
|
170 |
|
25
|
171 |
// Serialize d->m_tags
|
|
172 |
aDataStream<<aArtists.d->m_tags;
|
|
173 |
|
|
174 |
// Serialize d->m_id
|
|
175 |
aDataStream<<aArtists.d->m_id;
|
|
176 |
|
18
|
177 |
return aDataStream;
|
|
178 |
}
|
|
179 |
|
|
180 |
/**
|
|
181 |
* Method for Internalization. Reads a SmfArtists object from
|
|
182 |
* the stream and returns a reference to the stream.
|
|
183 |
* @param aDataStream Stream to be read
|
|
184 |
* @param aArtists The SmfArtists object to be internalized
|
|
185 |
* @return reference to the stream
|
|
186 |
*/
|
|
187 |
QDataStream &operator>>( QDataStream &aDataStream,
|
|
188 |
SmfArtists &aArtists)
|
|
189 |
{
|
|
190 |
// Deserialize d->m_image
|
|
191 |
aDataStream>>aArtists.d->m_image;
|
|
192 |
|
|
193 |
// Deserialize d->m_names
|
|
194 |
aDataStream>>aArtists.d->m_names;
|
|
195 |
|
|
196 |
// Deserialize d->m_url
|
|
197 |
aDataStream>>aArtists.d->m_url;
|
|
198 |
|
25
|
199 |
// Deserialize d->m_tags
|
|
200 |
aDataStream>>aArtists.d->m_tags;
|
|
201 |
|
|
202 |
// Deserialize d->m_id
|
|
203 |
aDataStream>>aArtists.d->m_id;
|
|
204 |
|
18
|
205 |
return aDataStream;
|
|
206 |
}
|
|
207 |
|