X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=mainwindow.h;h=95dfae78e3ae060eaf7745c041275d8a5a97a11b;hb=da70a59f7ed8e678117a463c28e6bea06e05431f;hp=d3f834c85025ffd049401d0ad31ab7582783ee50;hpb=26598f7dbeab8117834850888bbe236d25c2223c;p=pkanalytics diff --git a/mainwindow.h b/mainwindow.h index d3f834c..95dfae7 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -7,32 +7,43 @@ 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); + ~MainWindow() { + if (ui && ui->video) { + ui->video->stop(); + } + } private: void position_changed(uint64_t pos); void seek(int64_t delta_ms); - void insert_event(int button_id); + 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); void update_player_buttons(uint64_t t); + void update_action_buttons(uint64_t t); 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; };