forked from Subtivals/subtivals
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwindow.h
71 lines (62 loc) · 1.49 KB
/
mainwindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QTimer>
#include <QList>
#include <QTime>
#include <QMap>
#include <QTableWidget>
#include <QModelIndex>
#include <QString>
#include "script.h"
#define COLUMN_START 0
#define COLUMN_END 1
#define COLUMN_STYLE 2
#define COLUMN_TEXT 3
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
enum State { NODATA, STOPPED, PLAYING, PAUSED};
void openFile (const QString &p_fileName);
signals:
void eventStart(Event *p_event);
void eventEnd(Event *p_event);
void configChanged();
void toggleHide(bool state);
public slots:
void actionOpen();
void actionPlay();
void actionStop();
void actionConfig();
void actionAdd1Sec();
void actionSub1Sec();
void actionPause();
void actionNext();
void actionToggleHide(bool);
void timeout();
void actionEventSelected(QModelIndex);
void updateCurrentEvent(qint64);
void updateCurrentEventAt(int);
protected:
void closeEvent(QCloseEvent *);
QString ts2tc(qint64 p_timestamp);
void setState(State p_state);
private:
State m_state;
Ui::MainWindow *ui;
Script *m_script;
QTimer m_timer;
qint64 m_msseStartTime;
qint64 m_pauseStart;
qint64 m_pauseTotal;
qint64 m_userDelay;
QList<Event *> m_lastEvents;
QMap<Event *, int> m_tableMapping;
};
#endif // MAINWINDOW_H