all repos — mgba @ 3c18fe162c2c76eca80692d37083f6809bae4c8d

mGBA Game Boy Advance Emulator

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

 1/* Copyright (c) 2013-2014 Jeffrey Pfau
 2 *
 3 * This Source Code Form is subject to the terms of the Mozilla Public
 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 6#ifndef QGBA_AUDIO_PROCESSOR
 7#define QGBA_AUDIO_PROCESSOR
 8#include <QObject>
 9
10struct GBAThread;
11
12namespace QGBA {
13
14class AudioProcessor : public QObject {
15Q_OBJECT
16
17public:
18	enum class Driver {
19#ifdef BUILD_QT_MULTIMEDIA
20		QT_MULTIMEDIA = 0,
21#endif
22#ifdef BUILD_SDL
23		SDL = 1,
24#endif
25	};
26
27	static AudioProcessor* create();
28	static void setDriver(Driver driver) { s_driver = driver; }
29
30	AudioProcessor(QObject* parent = nullptr);
31
32	virtual void setInput(GBAThread* input);
33	int getBufferSamples() const { return m_samples; }
34
35public slots:
36	virtual void start() = 0;
37	virtual void pause() = 0;
38
39	virtual void setBufferSamples(int samples) = 0;
40	virtual void inputParametersChanged() = 0;
41
42protected:
43	GBAThread* input() { return m_context; }
44
45private:
46	GBAThread* m_context;
47	int m_samples;
48	static Driver s_driver;
49};
50
51}
52
53#endif