summaryrefslogtreecommitdiffstats
path: root/utils/themeeditor/graphics/rbviewport.cpp
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-07-01 21:49:55 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-07-01 21:49:55 +0000
commit26a2f810f1432d4013b6ac321c8f2d4b6dc32454 (patch)
treea34b4d4985ac13c2c3b1974de4680e3bb4465368 /utils/themeeditor/graphics/rbviewport.cpp
parentc794c1feae25eadca68da15606051922b2bb364d (diff)
downloadrockbox-26a2f810f1432d4013b6ac321c8f2d4b6dc32454.tar.gz
rockbox-26a2f810f1432d4013b6ac321c8f2d4b6dc32454.zip
Theme Editor: Fixed line numbering bug in parser. Implemented playlist display in renderer: playlist will use info for next track for all tracks other than the current track
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27227 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/themeeditor/graphics/rbviewport.cpp')
-rw-r--r--utils/themeeditor/graphics/rbviewport.cpp62
1 files changed, 62 insertions, 0 deletions
diff --git a/utils/themeeditor/graphics/rbviewport.cpp b/utils/themeeditor/graphics/rbviewport.cpp
index d4a8ede090..70c50f21c1 100644
--- a/utils/themeeditor/graphics/rbviewport.cpp
+++ b/utils/themeeditor/graphics/rbviewport.cpp
@@ -183,6 +183,68 @@ void RBViewport::write(QString text)
}
}
+void RBViewport::showPlaylist(const RBRenderInfo &info, int start,
+ skin_element *id3, skin_element *noId3)
+{
+ /* Determining whether ID3 info is available */
+ skin_element* root = info.device()->data("id3available").toBool()
+ ? id3 : noId3;
+
+ /* The line will be a linked list */
+ root = root->children[0];
+
+ int song = start + info.device()->data("pp").toInt();
+ int numSongs = info.device()->data("pe").toInt();
+
+ while(song <= numSongs && textOffset.y() + lineHeight < size.height())
+ {
+ 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;
+ }
+ newLine();
+ song++;
+ }
+}
+
void RBViewport::alignLeft()
{
int y = textOffset.y();