]> git.sesse.net Git - pkanalytics/blob - mainwindow.h
Count time on offense and on defense.
[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
11 class MainWindow : public QMainWindow
12 {
13         Q_OBJECT
14
15 public:
16         MainWindow(EventsModel *events, PlayersModel *players);
17
18 private:
19         void position_changed(uint64_t pos);
20         void seek(int64_t delta_ms);
21         void insert_player_event(int button_id);
22         void insert_noplayer_event(const std::string &type);
23         void set_current_event_type(const std::string &type);
24         void delete_current_event();
25         void make_substitution();
26
27         void update_ui_from_time(uint64_t t);
28         void update_status(uint64_t t);
29         void update_player_buttons(uint64_t t);
30         void update_action_buttons(uint64_t t);
31
32         Ui::MainWindow *ui;
33         EventsModel *events;
34         PlayersModel *players;
35         bool seeking = false;
36         bool playing = true;
37         std::optional<uint64_t> buffered_seek;
38         QMediaPlayer *video;
39 };