all repos — mgba @ 8f5145f4b82fc7ba69be424bd3585ac49b55f5c9

mGBA Game Boy Advance Emulator

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	void fpsTargetChanged(float target);
44
45private slots:
46	void gameStarted(GBAThread*);
47	void gameStopped();
48
49private:
50	void setupMenu(QMenuBar*);
51	GameController* m_controller;
52	Display* m_display;
53	QList<QAction*> m_gameActions;
54
55#ifdef USE_GDB_STUB
56	GDBController* m_gdbController;
57#endif
58};
59
60}
61
62#endif