-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmainwindow.h
175 lines (144 loc) · 3.66 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QGridLayout>
#include <QMenuBar>
#include <QMenu>
#include <QFile>
#include <QMessageBox>
#include <QSettings>
#include <QApplication>
#include <QSplitter>
#include <QHeaderView>
#include <QThreadPool>
#include <QTabWidget>
#include <QStandardPaths>
#include <QStatusBar>
#include <QGroupBox>
#include <QTimer>
#include <QMutex>
#include <QRunnable>
#include <QShortcut>
#include <QToolTip>
#include <QFileDialog>
#include <QColorDialog>
#include <QScrollBar>
#include <iostream>
#include <string>
#include <fstream>
#include <iomanip>
#include <cuda.h>
#include <cuda_runtime.h>
#include "npp.h"
#include "nppi.h"
#include "npps.h"
#include "Ffplay/Display.h"
#include "Ffplay/CommandOptions.h"
#include "Ffplay/EventHandler.h"
#include "Utilities/avexception.h"
#include "Utilities/cudaexception.h"
#include "Utilities/filepanel.h"
#include "Utilities/messagedialog.h"
#include "Filters/filterpanel.h"
#include "Filters/filterchain.h"
#include "Cameras/camerapanel.h"
#include "mainpanel.h"
#include "parameterpanel.h"
#include "optionpanel.h"
#include "countpanel.h"
#include "configpanel.h"
enum CustomEventCode {
FILE_POSITION_UPDATE,
FLUSH
};
#define APP_DEFAULT_WIDTH 1200
#define APP_DEFAULT_HEIGHT 600
using namespace std;
#define MW dynamic_cast<MainWindow*>(mainWindow)
#define TS QTime::currentTime().toString("hh:mm:ss.zzz").toStdString()
class Quitter : public QObject, public QRunnable
{
Q_OBJECT
public:
Quitter(QMainWindow *parent);
void run() override;
QMainWindow *mainWindow;
signals:
void done();
};
class Launcher : public QObject, public QRunnable
{
Q_OBJECT
public:
Launcher(QMainWindow *parent);
void run() override;
QMainWindow *mainWindow;
signals:
void done();
};
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(CommandOptions *co, QWidget *parent = nullptr);
~MainWindow();
void closeEvent(QCloseEvent *event) override;
void resizeEvent(QResizeEvent *event) override;
void moveEvent(QMoveEvent *event) override;
void paintEvent(QPaintEvent *event) override;
void showEvent(QShowEvent *event) override;
void initializeSDL();
void openFile();
void applyStyle(const ColorProfile& profile);
ConfigPanel *config();
ControlPanel *control();
FilterPanel *filter();
ParameterPanel *parameter();
CountPanel *count();
QLabel *display();
DisplayContainer *dc();
QString filename;
CommandOptions *co;
MainPanel *mainPanel;
Display ffDisplay;
AVPacket flush_pkt;
EventHandler *e;
VideoState *is = nullptr;
AVExceptionHandler av;
QSettings *settings;
QSplitter *splitter;
FilePanel *videoPanel;
FilePanel *picturePanel;
FilePanel *audioPanel;
CameraPanel *cameraPanel;
QTabWidget *tabWidget;
MessageDialog *messageDialog;
ParameterDialog *parameterDialog;
ConfigDialog *configDialog;
FilterDialog *filterDialog;
FilterChain *filterChain;
OptionDialog *optionDialog;
CountDialog *countDialog;
Quitter *quitter = nullptr;
Launcher *launcher;
QString style;
Uint32 sdlCustomEventType;
QTimer *timer;
QTimer *autoSaveTimer;
QScreen *screen;
bool changed = false;
const QString geometryKey = "MainWindow/geometry";
const QString splitterKey = "MainWindow/splitter";
bool clearSettings = false;
public slots:
void runLoop();
void poll();
void menuAction(QAction*);
void showHelp(const QString&);
void msg(const QString&);
void test();
void start();
void splitterMoved(int, int);
void autoSave();
};
#endif // MAINWINDOW_H