summaryrefslogtreecommitdiff
path: root/utils/themeeditor/graphics/rbviewport.cpp
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-08-15 02:04:06 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-08-15 02:04:06 +0000
commitb413169b2ef5d94b2574afe0122c476ad703f4ff (patch)
tree39b68f635f19a15fae36a77b542c310bc5849add /utils/themeeditor/graphics/rbviewport.cpp
parent18a6f42f2622d27967c3ad83b27a1de4f713dff2 (diff)
downloadrockbox-b413169b2ef5d94b2574afe0122c476ad703f4ff.zip
rockbox-b413169b2ef5d94b2574afe0122c476ad703f4ff.tar.gz
rockbox-b413169b2ef5d94b2574afe0122c476ad703f4ff.tar.bz2
rockbox-b413169b2ef5d94b2574afe0122c476ad703f4ff.tar.xz
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.cpp58
1 files changed, 2 insertions, 56 deletions
diff --git a/utils/themeeditor/graphics/rbviewport.cpp b/utils/themeeditor/graphics/rbviewport.cpp
index f646d83..fea1055 100644
--- a/utils/themeeditor/graphics/rbviewport.cpp
+++ b/utils/themeeditor/graphics/rbviewport.cpp
@@ -255,69 +255,15 @@ void RBViewport::write(QString text)
}
void RBViewport::showPlaylist(const RBRenderInfo &info, int start,
- skin_element *id3, skin_element *noId3)
+ ParseTreeNode* lines)
{
- /* Determining whether ID3 info is available */
- skin_element* root = id3;
-
- /* The line will be a linked list */
- if(root->children_count > 0)
- root = root->children[0];
int song = start + info.device()->data("pp").toInt();
int numSongs = info.device()->data("pe").toInt();
- int halfWay = (numSongs - song) / 2 + 1 + song;
while(song <= numSongs && textOffset.y() + lineHeight < size.height())
{
- if(song == halfWay)
- {
- root = noId3;
- if(root->children_count > 0)
- root = root->children[0];
- }
- skin_element* current = root;
- while(current)
- {
-
- if(current->type == TEXT)
- {
- write(QString((char*)current->data));
- }
-
- if(current->type == TAG)
- {
- QString tag(current->tag->name);
- if(tag == "pp")
- {
- write(QString::number(song));
- }
- else if(tag == "pt")
- {
- write(QObject::tr("00:00"));
- }
- else if(tag[0] == 'i' || tag[0] == 'f')
- {
- if(song == info.device()->data("pp").toInt())
- {
- write(info.device()->data(tag).toString());
- }
- else
- {
- /* If we're not on the current track, use the next
- * track info
- */
- if(tag[0] == 'i')
- tag = QString("I") + tag.right(1);
- else
- tag = QString("F") + tag.right(1);
- write(info.device()->data(tag).toString());
- }
- }
- }
-
- current = current->next;
- }
+ lines->render(info, this);
newLine();
song++;
}