src/platform/qt/Window.h (view raw)
1#ifndef QGBA_WINDOW
2#define QGBA_WINDOW
3
4#include <QAudioOutput>
5#include <QMainWindow>
6
7extern "C" {
8#include "gba.h"
9}
10
11#include "Display.h"
12
13namespace QGBA {
14
15class GameController;
16class GDBController;
17
18class Window : public QMainWindow {
19Q_OBJECT
20
21public:
22 Window(QWidget* parent = nullptr);
23 static GBAKey mapKey(int qtKey);
24
25signals:
26 void startDrawing(const uint32_t*, GBAThread*);
27 void shutdown();
28
29public slots:
30 void selectROM();
31
32#ifdef USE_GDB_STUB
33 void gdbOpen();
34#endif
35
36protected:
37 virtual void keyPressEvent(QKeyEvent* event) override;
38 virtual void keyReleaseEvent(QKeyEvent* event) override;
39 virtual void closeEvent(QCloseEvent*) override;
40
41signals:
42 void audioBufferSamplesChanged(int samples);
43
44private slots:
45 void gameStarted(GBAThread*);
46 void gameStopped();
47
48 void setBuffers512();
49 void setBuffers1024();
50 void setBuffers2048();
51 void setBuffers4096();
52
53private:
54 void setupMenu(QMenuBar*);
55 GameController* m_controller;
56 Display* m_display;
57 QList<QAction*> m_gameActions;
58
59#ifdef USE_GDB_STUB
60 GDBController* m_gdbController;
61#endif
62};
63
64}
65
66#endif