summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/skin_parser/skin_parser.c2
-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
5 files changed, 75 insertions, 0 deletions
diff --git a/lib/skin_parser/skin_parser.c b/lib/skin_parser/skin_parser.c
index 2d439710d9..5e4ef49074 100644
--- a/lib/skin_parser/skin_parser.c
+++ b/lib/skin_parser/skin_parser.c
@@ -463,6 +463,7 @@ static int skin_parse_tag(struct skin_element* element, char** document)
463 cursor++; 463 cursor++;
464 if (*cursor) 464 if (*cursor)
465 cursor++; 465 cursor++;
466 skin_line++;
466 *document = cursor; 467 *document = cursor;
467 return 1; 468 return 1;
468 } 469 }
@@ -628,6 +629,7 @@ static int skin_parse_tag(struct skin_element* element, char** document)
628 cursor++; 629 cursor++;
629 if (*cursor) 630 if (*cursor)
630 cursor++; 631 cursor++;
632 skin_line++;
631 } 633 }
632 634
633 *document = cursor; 635 *document = cursor;
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