]> git.sesse.net Git - pkanalytics/blobdiff - mainwindow.h
Rename the executable (it's about time)
[pkanalytics] / mainwindow.h
index 9408436ae6e1e1e8a62f7f98fd62144a715d1202..5298eba3609dc5a4d718ccc23c5c666ede484898 100644 (file)
@@ -1,7 +1,7 @@
-#include <QMediaPlayer>
 #include <QMainWindow>
 #include <QApplication>
 #include <stdint.h>
+#include <sqlite3.h>
 #include <optional>
 #include "ui_mainwindow.h"
 
@@ -15,7 +15,13 @@ class MainWindow : public QMainWindow
 
 public:
        MainWindow(EventsModel *events, PlayersModel *players,
-                  FormationsModel *offensive_formations, FormationsModel *defensive_formations);
+                  FormationsModel *offensive_formations, FormationsModel *defensive_formations,
+                  sqlite3 *db, int match_id);
+       ~MainWindow() {
+               if (ui && ui->video) {
+                       ui->video->stop();
+               }
+       }
 
 private:
        void position_changed(uint64_t pos);
@@ -32,6 +38,7 @@ private:
        void update_status(uint64_t t);
        void update_player_buttons(uint64_t t);
        void update_action_buttons(uint64_t t);
+       void update_gender_ratio(uint64_t t);
 
        Ui::MainWindow *ui;
        EventsModel *events;
@@ -39,7 +46,8 @@ private:
        FormationsModel *offensive_formations;
        FormationsModel *defensive_formations;
        bool seeking = false;
-       bool playing = true;
+       std::atomic<bool> playing{true};
        std::optional<uint64_t> buffered_seek;
-       QMediaPlayer *video;
+       sqlite3 *db;  // TODO: Check threading
+       int match_id;
 };