src/platform/qt/AudioProcessorQt.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 "AudioProcessor.h"
9
10class QAudioOutput;
11
12namespace QGBA {
13
14class AudioDevice;
15
16class AudioProcessorQt : public AudioProcessor {
17Q_OBJECT
18
19public:
20 AudioProcessorQt(QObject* parent = nullptr);
21
22 virtual unsigned sampleRate() const override;
23
24public slots:
25 virtual void setInput(std::shared_ptr<CoreController> input) override;
26 virtual void stop() override;
27 virtual bool start() override;
28 virtual void pause() override;
29
30 virtual void setBufferSamples(int samples) override;
31 virtual void inputParametersChanged() override;
32
33 virtual void requestSampleRate(unsigned) override;
34
35private:
36 QAudioOutput* m_audioOutput = nullptr;
37 std::unique_ptr<AudioDevice> m_device;
38 unsigned m_sampleRate = 44100;
39};
40
41}