-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsnesclassicstatut.h
68 lines (55 loc) · 1.69 KB
/
snesclassicstatut.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
#ifndef SNESCLASSICSTATUT_H
#define SNESCLASSICSTATUT_H
#include <QSettings>
#include <QTcpSocket>
#include <QTimer>
#include <QWidget>
#include "snesclassicstuff/stuffclient/stuffclient.h"
namespace Ui {
class SNESClassicStatut;
}
class SNESClassicStatut : public QWidget
{
Q_OBJECT
public:
explicit SNESClassicStatut(QWidget *parent = nullptr);
~SNESClassicStatut();
void setStuff(StuffClient* co);
QString readyString() const;
QString unreadyString() const;
void stop();
void start();
enum MyState {
NONE,
CONNECTED, // Connected
CHECKING_CANOE, // checking if canoe is running
CANOE_RUNNING, // Canoe is running
CHECKING_READY, // Checking if canoe is ready
DOING_INIT, // Initialize canoe in the savestate mode for the first time
FINISHING_INIT, // When it's done
DOING_RESET, // When reseting an already ready canoe run
READY
};
Q_ENUM(MyState)
signals:
void readyForSaveState();
void unReadyForSaveState();
void shortcutsToggled(bool);
private slots:
void onTimerTick();
void on_iniButton_clicked();
void on_shortcutCheckBox_toggled(bool checked);
void onCommandFinished(bool success);
private:
Ui::SNESClassicStatut *ui;
StuffClient* controlCo;
StuffClient* inputCo;
QString firstCanoeRun;
QTimer timer;
bool canoeRunning;
QSettings* m_settings;
MyState m_state;
bool checkForReady();
void changeState(MyState state);
};
#endif // SNESCLASSICSTATUT_H