- pqxx::work t(conn, "trx");
-
- // fetch all songs
- pqxx::result res( t.exec("SELECT * FROM songs WHERE title LIKE 'M%'") );
- unsigned y = 0;
- for (pqxx::result::const_iterator i = res.begin(); i != res.end(); ++i) {
- my_draw_text(i["title"].as(widestring()), framebuf, 0, y, 1, 255, 255, 255, fonts);
- y += 20;
-// std::fprintf(stderr, "%s\n", i["title"].c_str());
- }
- t.commit();
-
- ptc_update(framebuf);
- sleep(1);
-}
-
-void init_freetype()
-{
- FT_Library library;
- FT_Face face;
- if (FT_Init_FreeType(&library))
- throw std::runtime_error("FreeType init failed.");
-
- // Georgia
- if (FT_New_Face(library, "/usr/share/fonts/truetype/msttcorefonts/Georgia.ttf", 0, &face))
- throw std::runtime_error("Face opening failed.");
- if (FT_Set_Char_Size(face, 0, 12 * 64, 96, 96))
- throw std::runtime_error("Size set failed.");
- fonts.push_back(face);
-
- // FreeSerif
- if (FT_New_Face(library, "/usr/share/fonts/truetype/freefont/FreeSerif.ttf", 0, &face)) {
- std::fprintf(stderr, "Warning: Couldn't open FreeSerif, some glyphs might not be available\n");
- } else {
- if (FT_Set_Char_Size(face, 0, 12 * 64, 96, 96))
- throw std::runtime_error("Size set failed.");
- fonts.push_back(face);
+ conn.perform(FetchAuxilliaryScreens(&aux_screens));
+ for (std::vector<widestring>::const_iterator i = aux_screens.begin(); i != aux_screens.end(); ++i) {
+ if (*i == widestring("top10scores")) {
+ aux_screen->add_screen(new Top10ScoreScreen(conn, active_tournament.id));
+ continue;
+ }
+ if (*i == widestring("top5chosen")) {
+ aux_screen->add_screen(new Top5ChosenScreen(conn, active_tournament.id));
+ continue;
+ }
+ std::fprintf(stderr, "Foobarbaz?\n");