all repos — mgba @ 12d77b62098031bb03e78fa9b686e8378e60816f

mGBA Game Boy Advance Emulator

src/platform/qt/AudioDevice.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#pragma once
 7
 8#include <QAudioFormat>
 9#include <QIODevice>
10
11struct mCoreThread;
12
13namespace QGBA {
14
15class AudioDevice : public QIODevice {
16Q_OBJECT
17
18public:
19	AudioDevice(QObject* parent = nullptr);
20
21	void setInput(mCoreThread* input);
22	void setFormat(const QAudioFormat& format);
23
24protected:
25	virtual qint64 readData(char* data, qint64 maxSize) override;
26	virtual qint64 writeData(const char* data, qint64 maxSize) override;
27
28private:
29	mCoreThread* m_context;
30};
31
32}