]> git.sesse.net Git - pkanalytics/blob - mainwindow.h
9408436ae6e1e1e8a62f7f98fd62144a715d1202
[pkanalytics] / mainwindow.h
1 #include <QMediaPlayer>
2 #include <QMainWindow>
3 #include <QApplication>
4 #include <stdint.h>
5 #include <optional>
6 #include "ui_mainwindow.h"
7
8 class EventsModel;
9 class PlayersModel;
10 class FormationsModel;
11
12 class MainWindow : public QMainWindow
13 {
14         Q_OBJECT
15
16 public:
17         MainWindow(EventsModel *events, PlayersModel *players,
18                    FormationsModel *offensive_formations, FormationsModel *defensive_formations);
19
20 private:
21         void position_changed(uint64_t pos);
22         void seek(int64_t delta_ms);
23         void insert_player_event(int button_id);
24         void insert_noplayer_event(const std::string &type);
25         void set_current_event_type(const std::string &type);
26         void insert_or_change_formation(bool offense);
27         void delete_current_event();
28         void make_substitution();
29         void formation_double_clicked(bool offense, unsigned row);
30
31         void update_ui_from_time(uint64_t t);
32         void update_status(uint64_t t);
33         void update_player_buttons(uint64_t t);
34         void update_action_buttons(uint64_t t);
35
36         Ui::MainWindow *ui;
37         EventsModel *events;
38         PlayersModel *players;
39         FormationsModel *offensive_formations;
40         FormationsModel *defensive_formations;
41         bool seeking = false;
42         bool playing = true;
43         std::optional<uint64_t> buffered_seek;
44         QMediaPlayer *video;
45 };