X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=bigscreen%2Ftop5chosenscreen.cpp;h=ccfbea9f4051e6297bfee4b43b42417b3eb49dfe;hb=7b8b747f037d2244ffd080e97d9d5e5c0e9114a7;hp=d63b724433cc70ac89f3e8fbc218044156b9ffc5;hpb=c9cf3358a292d988d5d50819bb2db4da3347284a;p=ccbs diff --git a/bigscreen/top5chosenscreen.cpp b/bigscreen/top5chosenscreen.cpp index d63b724..ccfbea9 100644 --- a/bigscreen/top5chosenscreen.cpp +++ b/bigscreen/top5chosenscreen.cpp @@ -64,29 +64,38 @@ void Top5ChosenScreen::draw(unsigned char *buf, unsigned width, unsigned height) unsigned row = 1, y = 140; for (std::vector::const_iterator i = scores.begin(); i != scores.end(); ++i) { + std::string suffix; + if (row % 2 == 1) { + suffix = ".odd"; + } else { + suffix = ".even"; + } + char str[16]; - std::string theme_element = "data"; - std::string heading_theme_element = "rowheading"; + std::string heading_theme_element = "top5chosensongs.rowheading" + suffix; + std::string songname_theme_element = "top5chosensongs.songname" + suffix; + std::string frequency_theme_element = "top5chosensongs.frequency" + suffix; // print new entries in red if (seen_topchosen.count(*i) == 0 && seen_topchosen.size() > 0) { - theme_element = "freshdata"; - heading_theme_element = "freshrowheading"; + heading_theme_element = "top5chosensongs.freshrowheading" + suffix; + songname_theme_element = "top5chosensongs.freshsongname" + suffix; + frequency_theme_element = "top5chosensongs.freshfrequency" + suffix; } std::sprintf(str, "%u", row++); unsigned width = my_draw_text(str, NULL, 24.0, heading_theme_element); my_draw_text(str, buf, 24.0, heading_theme_element, RANK_X - width/2, y); - if (my_draw_text(i->title, NULL, 24.0, theme_element) > SONG_MAX_WIDTH) { - my_draw_text(i->shorttitle, buf, 24.0, theme_element, SONG_X, y); + if (my_draw_text(i->title, NULL, 24.0, songname_theme_element) > SONG_MAX_WIDTH) { + my_draw_text(i->shorttitle, buf, 24.0, songname_theme_element, SONG_X, y); } else { - my_draw_text(i->title, buf, 24.0, theme_element, SONG_X, y); + my_draw_text(i->title, buf, 24.0, songname_theme_element, SONG_X, y); } std::sprintf(str, "%u", i->frequency); - width = my_draw_text(str, NULL, 24.0, theme_element); - my_draw_text(str, buf, 24.0, theme_element, FREQUENCY_X - width/2, y); + width = my_draw_text(str, NULL, 24.0, frequency_theme_element); + my_draw_text(str, buf, 24.0, frequency_theme_element, FREQUENCY_X - width/2, y); y += 40; }