all repos — mgba @ 642b92fed3377ee94678f73e02f92d9a68fe3557

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;
17class LogView;
18
19class Window : public QMainWindow {
20Q_OBJECT
21
22public:
23	Window(QWidget* parent = nullptr);
24	virtual ~Window();
25
26	static GBAKey mapKey(int qtKey);
27
28signals:
29	void startDrawing(const uint32_t*, GBAThread*);
30	void shutdown();
31
32public slots:
33	void selectROM();
34
35#ifdef USE_GDB_STUB
36	void gdbOpen();
37#endif
38
39protected:
40	virtual void keyPressEvent(QKeyEvent* event) override;
41	virtual void keyReleaseEvent(QKeyEvent* event) override;
42	virtual void closeEvent(QCloseEvent*) override;
43
44signals:
45	void audioBufferSamplesChanged(int samples);
46	void fpsTargetChanged(float target);
47
48private slots:
49	void gameStarted(GBAThread*);
50	void gameStopped();
51
52private:
53	void setupMenu(QMenuBar*);
54	GameController* m_controller;
55	Display* m_display;
56	QList<QAction*> m_gameActions;
57	LogView* m_logView;
58
59#ifdef USE_GDB_STUB
60	GDBController* m_gdbController;
61#endif
62};
63
64}
65
66#endif