]> git.sesse.net Git - pkanalytics/blob - mainwindow.h
Make it possible to seek to an event by clicking on it.
[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
10 class MainWindow : public QMainWindow
11 {
12         Q_OBJECT
13
14 public:
15         MainWindow();
16         void setModel(EventsModel *model);
17
18 private:
19         void position_changed(uint64_t pos);
20         void seek(int64_t delta_ms);
21         void insert_event(int button_id);
22         void set_current_event_type(const std::string &type);
23         void delete_current_event();
24         void update_status();
25
26         Ui::MainWindow *ui;
27         EventsModel *model;
28         bool seeking = false;
29         bool playing = true;
30         std::optional<uint64_t> buffered_seek;
31         QMediaPlayer *player;
32 };