summaryrefslogtreecommitdiff
path: root/utils/themeeditor/graphics
diff options
context:
space:
mode:
Diffstat (limited to 'utils/themeeditor/graphics')
-rw-r--r--utils/themeeditor/graphics/rbviewport.cpp62
-rw-r--r--utils/themeeditor/graphics/rbviewport.h3
2 files changed, 65 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();