-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconsoleswitcher.h
98 lines (80 loc) · 2.67 KB
/
consoleswitcher.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
#ifndef CONSOLESWITCHER_H
#define CONSOLESWITCHER_H
#include "usb2snes.h"
#include "handlestuff.h"
#include "handlestuffsnesclassic.h"
#include "handlestuffusb2snes.h"
#include "handlestuffnwaccess.h"
#include "snesclassicstuff/stuffclient/stuffclient.h"
#include "Button-Mash/localcontroller.h"
#include "emunwaccessclient.h"
#include <QWidget>
#include <Button-Mash/inputdecoder.h>
namespace Ui {
class ConsoleSwitcher;
}
class ConsoleSwitcher : public QWidget
{
Q_OBJECT
public:
enum Mode {
USB2Snes,
SNESClassic,
NWAccess
};
Q_ENUMS(Mode)
explicit ConsoleSwitcher(QWidget *parent = nullptr);
HandleStuff* getHandle();
void start();
Mode mode();
QString readyString() const;
QString unreadyString() const;
~ConsoleSwitcher();
public slots:
void refreshShortcuts();
signals:
void modeChanged(ConsoleSwitcher::Mode mode);
void readyForSaveState();
void unReadyForSaveState();
private slots:
void onLocalControllerChanged();
void onInputProviderButtonPressed(InputProvider::SNESButton);
void onInputProviderButtonReleased(InputProvider::SNESButton);
void on_snesClassicInputNewData(QByteArray data);
void on_snesClassicInputConnected();
void on_snesClassicShortcutsToggled(bool toggled);
void on_snesClassicReadyForSaveState();
void on_snesClassicUnReadyForSaveState();
void on_snesClassicButton_clicked();
void on_nwaReadyForSaveState();
void on_nwaUnReadyForSaveState();
void on_usb2snesButton_clicked();
void on_emunwaccessButton_clicked();
private:
Ui::ConsoleSwitcher *ui;
Mode m_mode;
USB2snes* usb2snes;
EmuNWAccessClient* nwaclient;
StuffClient* stuffControlCo;
StuffClient* stuffInput;
InputDecoder* snesClassicInputDecoder;
LocalController* localController;
HandleStuffSnesClassic* handleSNESClassic;
HandleStuffUsb2snes* handleUSB2Snes;
HandleStuffNWAccess* handleNWAccess;
QSettings* m_settings;
QList<int> inputProviderButtonPressed;
QMap<int, int> mapEnumToSNES;
bool usb2snesInit;
bool snesClassicInit;
bool nwaccessInit;
bool snesClassicShortcutActivated;
bool snesClassicReady;
void initUsb2snes();
void initSnesClassic();
void initNWAccess();
void cleanUpUSB2Snes();
void cleanUpSNESClassic();
void cleanUpNWAccess();
};
#endif // CONSOLESWITCHER_H