summaryrefslogtreecommitdiff
path: root/utils/themeeditor/graphics/rbviewport.cpp
diff options
context:
space:
mode:
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 f646d830dd..fea1055935 100644
--- a/utils/themeeditor/graphics/rbviewport.cpp
+++ b/utils/themeeditor/graphics/rbviewport.cpp
@@ -255,69 +255,15 @@ void RBViewport::write(QString text)
255} 255}
256 256
257void RBViewport::showPlaylist(const RBRenderInfo &info, int start, 257void RBViewport::showPlaylist(const RBRenderInfo &info, int start,
258 skin_element *id3, skin_element *noId3) 258 ParseTreeNode* lines)
259{ 259{
260 /* Determining whether ID3 info is available */
261 skin_element* root = id3;
262
263 /* The line will be a linked list */
264 if(root->children_count > 0)
265 root = root->children[0];
266 260
267 int song = start + info.device()->data("pp").toInt(); 261 int song = start + info.device()->data("pp").toInt();
268 int numSongs = info.device()->data("pe").toInt(); 262 int numSongs = info.device()->data("pe").toInt();
269 int halfWay = (numSongs - song) / 2 + 1 + song;
270 263
271 while(song <= numSongs && textOffset.y() + lineHeight < size.height()) 264 while(song <= numSongs && textOffset.y() + lineHeight < size.height())
272 { 265 {
273 if(song == halfWay) 266 lines->render(info, this);
274 {
275 root = noId3;
276 if(root->children_count > 0)
277 root = root->children[0];
278 }
279 skin_element* current = root;
280 while(current)
281 {
282
283 if(current->type == TEXT)
284 {
285 write(QString((char*)current->data));
286 }
287
288 if(current->type == TAG)
289 {
290 QString tag(current->tag->name);
291 if(tag == "pp")
292 {
293 write(QString::number(song));
294 }
295 else if(tag == "pt")
296 {
297 write(QObject::tr("00:00"));
298 }
299 else if(tag[0] == 'i' || tag[0] == 'f')
300 {
301 if(song == info.device()->data("pp").toInt())
302 {
303 write(info.device()->data(tag).toString());
304 }
305 else
306 {
307 /* If we're not on the current track, use the next
308 * track info
309 */
310 if(tag[0] == 'i')
311 tag = QString("I") + tag.right(1);
312 else
313 tag = QString("F") + tag.right(1);
314 write(info.device()->data(tag).toString());
315 }
316 }
317 }
318
319 current = current->next;
320 }
321 newLine(); 267 newLine();
322 song++; 268 song++;
323 } 269 }