X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=mainwindow.h;h=ea4ba37048a4e893280713276b6558a5eba82ae9;hb=f3e456ed250cb32c34e43d414f1f05887c355534;hp=2d702c75a4d8544b2d861ec25368e71547d6b607;hpb=3f9de8e0aae968c3c0a0dd55dd43107407a63e9b;p=pkanalytics diff --git a/mainwindow.h b/mainwindow.h index 2d702c7..ea4ba37 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -2,18 +2,27 @@ #include #include #include +#include #include #include "ui_mainwindow.h" class EventsModel; class PlayersModel; +class FormationsModel; class MainWindow : public QMainWindow { Q_OBJECT public: - MainWindow(EventsModel *events, PlayersModel *players); + MainWindow(EventsModel *events, PlayersModel *players, + 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); @@ -21,8 +30,10 @@ 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); void update_ui_from_time(uint64_t t); void update_status(uint64_t t); @@ -32,8 +43,11 @@ private: Ui::MainWindow *ui; EventsModel *events; PlayersModel *players; + 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; };