summaryrefslogtreecommitdiff
path: root/utils
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
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')
-rw-r--r--utils/themeeditor/graphics/rbviewport.cpp62
-rw-r--r--utils/themeeditor/graphics/rbviewport.h3
-rw-r--r--utils/themeeditor/models/parsetreenode.cpp7
-rw-r--r--utils/themeeditor/resources/deviceoptions1
4 files changed, 73 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)
183 } 183 }
184} 184}
185 185
186void RBViewport::showPlaylist(const RBRenderInfo &info, int start,
187 skin_element *id3, skin_element *noId3)
188{
189 /* Determining whether ID3 info is available */
190 skin_element* root = info.device()->data("id3available").toBool()
191 ? id3 : noId3;
192
193 /* The line will be a linked list */
194 root = root->children[0];
195
196 int song = start + info.device()->data("pp").toInt();
197 int numSongs = info.device()->data("pe").toInt();
198
199 while(song <= numSongs && textOffset.y() + lineHeight < size.height())
200 {
201 skin_element* current = root;
202 while(current)
203 {
204
205 if(current->type == TEXT)
206 {
207 write(QString((char*)current->data));
208 }
209
210 if(current->type == TAG)
211 {
212 QString tag(current->tag->name);
213 if(tag == "pp")
214 {
215 write(QString::number(song));
216 }
217 else if(tag == "pt")
218 {
219 write(QObject::tr("00:00"));
220 }
221 else if(tag[0] == 'i' || tag[0] == 'f')
222 {
223 if(song == info.device()->data("pp").toInt())
224 {
225 write(info.device()->data(tag).toString());
226 }
227 else
228 {
229 /* If we're not on the current track, use the next
230 * track info
231 */
232 if(tag[0] == 'i')
233 tag = QString("I") + tag.right(1);
234 else
235 tag = QString("F") + tag.right(1);
236 write(info.device()->data(tag).toString());
237 }
238 }
239 }
240
241 current = current->next;
242 }
243 newLine();
244 song++;
245 }
246}
247
186void RBViewport::alignLeft() 248void RBViewport::alignLeft()
187{ 249{
188 int y = textOffset.y(); 250 int y = textOffset.y();
diff --git a/utils/themeeditor/graphics/rbviewport.h b/utils/themeeditor/graphics/rbviewport.h
index 2aff315873..70f52232af 100644
--- a/utils/themeeditor/graphics/rbviewport.h
+++ b/utils/themeeditor/graphics/rbviewport.h
@@ -59,6 +59,9 @@ public:
59 59
60 void enableStatusBar(){ showStatusBar = true; } 60 void enableStatusBar(){ showStatusBar = true; }
61 61
62 void showPlaylist(const RBRenderInfo& info, int start, skin_element* id3,
63 skin_element* noId3);
64
62private: 65private:
63 66
64 void alignLeft(); 67 void alignLeft();
diff --git a/utils/themeeditor/models/parsetreenode.cpp b/utils/themeeditor/models/parsetreenode.cpp
index d10bb08936..e61c6552e2 100644
--- a/utils/themeeditor/models/parsetreenode.cpp
+++ b/utils/themeeditor/models/parsetreenode.cpp
@@ -765,6 +765,13 @@ bool ParseTreeNode::execTag(const RBRenderInfo& info, RBViewport* viewport)
765 Qt::black)); 765 Qt::black));
766 return true; 766 return true;
767 767
768 case 'p':
769 /* %Vp */
770 viewport->showPlaylist(info, element->params[0].data.numeric,
771 element->params[1].data.code,
772 element->params[2].data.code);
773 return true;
774
768 case 'I': 775 case 'I':
769 /* %VI */ 776 /* %VI */
770 info.screen()->makeCustomUI(element->params[0].data.text); 777 info.screen()->makeCustomUI(element->params[0].data.text);
diff --git a/utils/themeeditor/resources/deviceoptions b/utils/themeeditor/resources/deviceoptions
index 10a1a89d75..5417ca6b2d 100644
--- a/utils/themeeditor/resources/deviceoptions
+++ b/utils/themeeditor/resources/deviceoptions
@@ -114,6 +114,7 @@ ra ; Autoscore ; spin(0,10) ; 7
114?C ; Album Art Available ; check ; true 114?C ; Album Art Available ; check ; true
115artwidth ; Album Art Width ; spin(0,500) ; 100 115artwidth ; Album Art Width ; spin(0,500) ; 100
116artheight; Album Art Height ; spin(0,500) ; 100 116artheight; Album Art Height ; spin(0,500) ; 100
117id3available ; ID3 Info Available ; check ; true
117 118
118[Hardware Status] 119[Hardware Status]
119bl ; Battery Level (-1 for unknown) ; spin(-1,100) ; 50 120bl ; Battery Level (-1 for unknown) ; spin(-1,100) ; 50