all repos — mgba @ 1eeeb360155fd3783da8584b8ecf11a352ff89cd

mGBA Game Boy Advance Emulator

src/platform/qt/GameController.h (view raw)

 1#ifndef QGBA_GAME_CONTROLLER
 2#define QGBA_GAME_CONTROLLER
 3
 4#include <QFile>
 5#include <QImage>
 6#include <QObject>
 7#include <QString>
 8
 9#include "AudioDevice.h"
10
11extern "C" {
12#include "gba-thread.h"
13}
14
15struct GBAAudio;
16struct GBAVideoSoftwareRenderer;
17
18namespace QGBA {
19
20class GameController : public QObject {
21Q_OBJECT
22
23public:
24	GameController(QObject* parent = 0);
25	~GameController();
26
27signals:
28	void frameAvailable(const QImage&);
29	void audioDeviceAvailable(GBAAudio*);
30	void gameStarted();
31
32public slots:
33	void loadGame(const QString& path);
34	void setPaused(bool paused);
35	void keyPressed(int key);
36	void keyReleased(int key);
37
38private:
39	void setupAudio(GBAAudio* audio);
40
41	QImage m_drawContext;
42	AudioDevice* m_audioContext;
43	GBAThread m_threadContext;
44	GBAVideoSoftwareRenderer* m_renderer;
45
46	QFile* m_rom;
47	QFile* m_bios;
48};
49
50}
51
52#endif