X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=mainwindow.h;h=83ed90957118262b443acb0eabbfb318926acb3b;hb=54bd286ed213509da23c43d0c80f731dd1bb7a18;hp=052e15d8b45cbc2b47491b46d87a4c67706c7c18;hpb=378547d7c18e75c2145af57afda2a8b96a609bfa;p=pkanalytics diff --git a/mainwindow.h b/mainwindow.h index 052e15d..83ed909 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -3,19 +3,42 @@ #include #include #include +#include "ui_mainwindow.h" + +class EventsModel; +class PlayersModel; +class FormationsModel; class MainWindow : public QMainWindow { Q_OBJECT public: - MainWindow(); - - QMediaPlayer *player; + MainWindow(EventsModel *events, PlayersModel *players, + FormationsModel *offensive_formations, FormationsModel *defensive_formations); private: + void position_changed(uint64_t pos); void seek(int64_t delta_ms); + 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 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::optional buffered_seek; + QMediaPlayer *video; };