diff options
author | Robert Bieber <robby@bieberphoto.com> | 2010-08-15 02:04:06 +0000 |
---|---|---|
committer | Robert Bieber <robby@bieberphoto.com> | 2010-08-15 02:04:06 +0000 |
commit | b413169b2ef5d94b2574afe0122c476ad703f4ff (patch) | |
tree | 39b68f635f19a15fae36a77b542c310bc5849add /utils/themeeditor/graphics/rbviewport.cpp | |
parent | 18a6f42f2622d27967c3ad83b27a1de4f713dff2 (diff) | |
download | rockbox-b413169b2ef5d94b2574afe0122c476ad703f4ff.tar.gz rockbox-b413169b2ef5d94b2574afe0122c476ad703f4ff.zip |
Theme Editor: Changed playlist rendering to match new syntax
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27819 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/themeeditor/graphics/rbviewport.cpp')
-rw-r--r-- | utils/themeeditor/graphics/rbviewport.cpp | 58 |
1 files changed, 2 insertions, 56 deletions
diff --git a/utils/themeeditor/graphics/rbviewport.cpp b/utils/themeeditor/graphics/rbviewport.cpp index f646d830dd..fea1055935 100644 --- a/utils/themeeditor/graphics/rbviewport.cpp +++ b/utils/themeeditor/graphics/rbviewport.cpp | |||
@@ -255,69 +255,15 @@ void RBViewport::write(QString text) | |||
255 | } | 255 | } |
256 | 256 | ||
257 | void RBViewport::showPlaylist(const RBRenderInfo &info, int start, | 257 | void RBViewport::showPlaylist(const RBRenderInfo &info, int start, |
258 | skin_element *id3, skin_element *noId3) | 258 | ParseTreeNode* lines) |
259 | { | 259 | { |
260 | /* Determining whether ID3 info is available */ | ||
261 | skin_element* root = id3; | ||
262 | |||
263 | /* The line will be a linked list */ | ||
264 | if(root->children_count > 0) | ||
265 | root = root->children[0]; | ||
266 | 260 | ||
267 | int song = start + info.device()->data("pp").toInt(); | 261 | int song = start + info.device()->data("pp").toInt(); |
268 | int numSongs = info.device()->data("pe").toInt(); | 262 | int numSongs = info.device()->data("pe").toInt(); |
269 | int halfWay = (numSongs - song) / 2 + 1 + song; | ||
270 | 263 | ||
271 | while(song <= numSongs && textOffset.y() + lineHeight < size.height()) | 264 | while(song <= numSongs && textOffset.y() + lineHeight < size.height()) |
272 | { | 265 | { |
273 | if(song == halfWay) | 266 | lines->render(info, this); |
274 | { | ||
275 | root = noId3; | ||
276 | if(root->children_count > 0) | ||
277 | root = root->children[0]; | ||
278 | } | ||
279 | skin_element* current = root; | ||
280 | while(current) | ||
281 | { | ||
282 | |||
283 | if(current->type == TEXT) | ||
284 | { | ||
285 | write(QString((char*)current->data)); | ||
286 | } | ||
287 | |||
288 | if(current->type == TAG) | ||
289 | { | ||
290 | QString tag(current->tag->name); | ||
291 | if(tag == "pp") | ||
292 | { | ||
293 | write(QString::number(song)); | ||
294 | } | ||
295 | else if(tag == "pt") | ||
296 | { | ||
297 | write(QObject::tr("00:00")); | ||
298 | } | ||
299 | else if(tag[0] == 'i' || tag[0] == 'f') | ||
300 | { | ||
301 | if(song == info.device()->data("pp").toInt()) | ||
302 | { | ||
303 | write(info.device()->data(tag).toString()); | ||
304 | } | ||
305 | else | ||
306 | { | ||
307 | /* If we're not on the current track, use the next | ||
308 | * track info | ||
309 | */ | ||
310 | if(tag[0] == 'i') | ||
311 | tag = QString("I") + tag.right(1); | ||
312 | else | ||
313 | tag = QString("F") + tag.right(1); | ||
314 | write(info.device()->data(tag).toString()); | ||
315 | } | ||
316 | } | ||
317 | } | ||
318 | |||
319 | current = current->next; | ||
320 | } | ||
321 | newLine(); | 267 | newLine(); |
322 | song++; | 268 | song++; |
323 | } | 269 | } |