X-Git-Url: https://git.sesse.net/?p=ccbs;a=blobdiff_plain;f=bigscreen%2Fgroupscreen.h;h=a2b0db111335f64d2cba8917778ab6385de1e5f9;hp=72979750cd254550013d288a6125f952b79124a2;hb=8e632531fde7c8197a7cdba1842838fa50a44626;hpb=32d2a098bec8a1ace0f86f28110da45d060f8447;ds=sidebyside diff --git a/bigscreen/groupscreen.h b/bigscreen/groupscreen.h index 7297975..a2b0db1 100644 --- a/bigscreen/groupscreen.h +++ b/bigscreen/groupscreen.h @@ -1,6 +1,7 @@ #ifndef _GROUPSCREEN_H #define _GROUPSCREEN_H 1 +#include #include #include #include @@ -8,22 +9,39 @@ #include "screen.h" #include "flagtrigger.h" #include "group.h" +#include "fonts.h" /* A screen class showing a group in the tournament */ class GroupScreen : public GenericScreen { private: - unsigned tournament, round, parallel; + unsigned tournament, round, parallel, machine, num_machines, players_per_machine; FlagTrigger scores_changed; pqxx::connection &conn; bool valid; struct timeval last_updated; + std::vector last_text; + unsigned get_show_players(const Group &group); + void draw_main_heading(std::vector &td); + void draw_column_headings(std::vector &td, const Group &group, const std::vector &colwidth); + void draw_scores(std::vector &td, const Group &group, const std::vector &colwidth); + const Player *get_next_player(const Group &group); + void draw_next_up_player(unsigned char *buf, const Group &group, const Player &player, const Score &song, bool last_song, + std::map &song_scores, std::map &player_scores, + const std::vector &max_score, const std::vector &min_score); + void draw_next_up_single(unsigned char *buf, const Group &group, + std::map &song_scores, std::map &player_scores, + const std::vector &max_score, const std::vector &min_score); + void find_column_widths(const Group &group, std::vector &colwidth); + public: - GroupScreen(pqxx::connection &conn, unsigned tournament, unsigned round, unsigned parallel); + // the last two parameters should probably not be there, but fetched from GroupScreen itself + GroupScreen(pqxx::connection &conn, unsigned tournament, unsigned round, unsigned parallel, unsigned machine, unsigned num_machines, unsigned players_per_machine); virtual ~GroupScreen(); bool check_invalidated(); - void draw(unsigned char *buf); + void draw(unsigned char *buf, unsigned width, unsigned height); + int get_priority(); }; #endif /* !defined(_GROUPSCREEN_H) */