|
a/HelperStructs/MetaData.h |
|
b/HelperStructs/MetaData.h |
|
... |
|
... |
60 |
|
60 |
|
61 |
bool is_lib_selected;
|
61 |
bool is_lib_selected;
|
62 |
bool is_disabled;
|
62 |
bool is_disabled;
|
63 |
|
63 |
|
64 |
QString didl;
|
64 |
QString didl;
|
|
|
65 |
QString albumArtURI;
|
65 |
|
66 |
|
66 |
inline MetaData () {
|
67 |
inline MetaData () {
|
67 |
id = -1;
|
68 |
id = -1;
|
68 |
artist_id = -1;
|
69 |
artist_id = -1;
|
69 |
album_id = -1;
|
70 |
album_id = -1;
|
|
... |
|
... |
134 |
list.push_back( (pl_selected) ? "1" : "0" );
|
135 |
list.push_back( (pl_selected) ? "1" : "0" );
|
135 |
list.push_back( (pl_dragged) ? "1" : "0" );
|
136 |
list.push_back( (pl_dragged) ? "1" : "0" );
|
136 |
list.push_back( (is_lib_selected) ? "1" : "0" );
|
137 |
list.push_back( (is_lib_selected) ? "1" : "0" );
|
137 |
list.push_back( (is_disabled) ? "1" : "0");
|
138 |
list.push_back( (is_disabled) ? "1" : "0");
|
138 |
list.push_back(didl);
|
139 |
list.push_back(didl);
|
|
|
140 |
list.push_back(albumArtURI);
|
139 |
|
141 |
|
140 |
return list;
|
142 |
return list;
|
141 |
}
|
143 |
}
|
142 |
|
144 |
|
143 |
static bool fromVariant(QVariant v, MetaData& md){
|
145 |
static bool fromVariant(QVariant v, MetaData& md){
|
|
... |
|
... |
168 |
md.pl_selected = (list[idx++] == "1");
|
170 |
md.pl_selected = (list[idx++] == "1");
|
169 |
md.pl_dragged = (list[idx++] == "1");
|
171 |
md.pl_dragged = (list[idx++] == "1");
|
170 |
md.is_lib_selected = (list[idx++] == "1");
|
172 |
md.is_lib_selected = (list[idx++] == "1");
|
171 |
md.is_disabled = (list[idx++] == "1");
|
173 |
md.is_disabled = (list[idx++] == "1");
|
172 |
md.didl = list[idx++];
|
174 |
md.didl = list[idx++];
|
173 |
|
175 |
md.albumArtURI = list[idx++];
|
174 |
return true;
|
176 |
return true;
|
|
|
177 |
}
|
|
|
178 |
|
|
|
179 |
bool compare(const MetaData& other) {
|
|
|
180 |
bool same = title == other.title &&
|
|
|
181 |
artist == other.artist &&
|
|
|
182 |
album == other.album &&
|
|
|
183 |
rating == other.rating &&
|
|
|
184 |
length_ms == other.length_ms &&
|
|
|
185 |
year == other.year &&
|
|
|
186 |
filepath == other.filepath &&
|
|
|
187 |
track_num == other.track_num &&
|
|
|
188 |
bitrate == other.bitrate &&
|
|
|
189 |
id == other.id &&
|
|
|
190 |
album_id == other.album_id &&
|
|
|
191 |
artist_id == other.artist_id &&
|
|
|
192 |
filesize == other.filesize &&
|
|
|
193 |
comment == other.comment &&
|
|
|
194 |
discnumber == other.discnumber &&
|
|
|
195 |
n_discs == other.n_discs &&
|
|
|
196 |
genres == other.genres &&
|
|
|
197 |
is_extern == other.is_extern &&
|
|
|
198 |
pl_playing == other.pl_playing &&
|
|
|
199 |
pl_selected == other.pl_selected &&
|
|
|
200 |
pl_dragged == other.pl_dragged &&
|
|
|
201 |
is_lib_selected == other.is_lib_selected &&
|
|
|
202 |
is_disabled == other.is_disabled &&
|
|
|
203 |
didl == other.didl &&
|
|
|
204 |
albumArtURI == other.albumArtURI;
|
|
|
205 |
return !same;
|
175 |
}
|
206 |
}
|
176 |
|
207 |
|
177 |
bool serialize(QDataStream& strm) {
|
208 |
bool serialize(QDataStream& strm) {
|
178 |
strm <<
|
209 |
strm <<
|
179 |
title <<
|
210 |
title <<
|
|
... |
|
... |
197 |
pl_playing <<
|
228 |
pl_playing <<
|
198 |
pl_selected <<
|
229 |
pl_selected <<
|
199 |
pl_dragged <<
|
230 |
pl_dragged <<
|
200 |
is_lib_selected <<
|
231 |
is_lib_selected <<
|
201 |
is_disabled <<
|
232 |
is_disabled <<
|
202 |
didl;
|
233 |
didl <<
|
|
|
234 |
albumArtURI;
|
203 |
return true;
|
235 |
return true;
|
204 |
}
|
236 |
}
|
205 |
bool unSerialize(QDataStream& strm) {
|
237 |
bool unSerialize(QDataStream& strm) {
|
206 |
strm >>
|
238 |
strm >>
|
207 |
title >>
|
239 |
title >>
|
|
... |
|
... |
225 |
pl_playing >>
|
257 |
pl_playing >>
|
226 |
pl_selected >>
|
258 |
pl_selected >>
|
227 |
pl_dragged >>
|
259 |
pl_dragged >>
|
228 |
is_lib_selected >>
|
260 |
is_lib_selected >>
|
229 |
is_disabled >>
|
261 |
is_disabled >>
|
230 |
didl;
|
262 |
didl >>
|
|
|
263 |
albumArtURI;
|
231 |
return strm.status() == QDataStream::Ok;
|
264 |
return strm.status() == QDataStream::Ok;
|
232 |
}
|
265 |
}
|
233 |
|
266 |
|
234 |
};
|
267 |
};
|
235 |
|
268 |
|