#include <QMainWindow>
#include <QApplication>
#include <stdint.h>
+#include <sqlite3.h>
#include <optional>
#include "ui_mainwindow.h"
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);
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;
};