all repos — mgba @ 3d339b13279bea84a6fe86b731933c1466396f83

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
31public slots:
32	bool loadGame(const QString& path);
33	void keyPressed(int key);
34	void keyReleased(int key);
35
36private:
37	void setupAudio(GBAAudio* audio);
38
39	QImage m_drawContext;
40	AudioDevice* m_audioContext;
41	GBAThread m_threadContext;
42	GBAVideoSoftwareRenderer* m_renderer;
43
44	QFile* m_rom;
45	QFile* m_bios;
46};
47
48}
49
50#endif