all repos — mgba @ d0771b78e22e89b5523badee256ec6e15467dc54

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#ifndef QGBA_AUDIO_DEVICE
 7#define QGBA_AUDIO_DEVICE
 8
 9#include <QAudioFormat>
10#include <QIODevice>
11
12struct mCoreThread;
13
14namespace QGBA {
15
16class AudioDevice : public QIODevice {
17Q_OBJECT
18
19public:
20	AudioDevice(QObject* parent = nullptr);
21
22	void setInput(mCoreThread* input);
23	void setFormat(const QAudioFormat& format);
24
25protected:
26	virtual qint64 readData(char* data, qint64 maxSize) override;
27	virtual qint64 writeData(const char* data, qint64 maxSize) override;
28
29private:
30	mCoreThread* m_context;
31	float m_drift;
32	float m_ratio;
33};
34
35}
36
37#endif