X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=mainwindow.h;h=c47e9bf8a8213128606ec6ecaacd148eef1401fd;hb=90e245965090b9514e18b67d3e79edde1b2c711b;hp=83ed90957118262b443acb0eabbfb318926acb3b;hpb=67da94217a271b0b76d42c75d1a78ee5ba942825;p=pkanalytics diff --git a/mainwindow.h b/mainwindow.h index 83ed909..c47e9bf 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -2,6 +2,7 @@ #include #include #include +#include #include #include "ui_mainwindow.h" @@ -15,7 +16,13 @@ class MainWindow : public QMainWindow public: MainWindow(EventsModel *events, PlayersModel *players, - FormationsModel *offensive_formations, FormationsModel *defensive_formations); + FormationsModel *offensive_formations, FormationsModel *defensive_formations, + sqlite3 *db, int match_id); + ~MainWindow() { + if (ui && ui->video) { + ui->video->stop(); + } + } private: void position_changed(uint64_t pos); @@ -23,6 +30,7 @@ private: void insert_player_event(int button_id); void insert_noplayer_event(const std::string &type); void set_current_event_type(const std::string &type); + void insert_or_change_formation(bool offense); void delete_current_event(); void make_substitution(); void formation_double_clicked(bool offense, unsigned row); @@ -31,6 +39,7 @@ private: void update_status(uint64_t t); void update_player_buttons(uint64_t t); void update_action_buttons(uint64_t t); + void update_gender_ratio(uint64_t t); Ui::MainWindow *ui; EventsModel *events; @@ -38,7 +47,8 @@ private: FormationsModel *offensive_formations; FormationsModel *defensive_formations; bool seeking = false; - bool playing = true; + std::atomic playing{true}; std::optional buffered_seek; - QMediaPlayer *video; + sqlite3 *db; // TODO: Check threading + int match_id; };