all repos — mgba @ 4a9ab53231e03d464c097a652f8f1decd789c57a

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