all repos — mgba @ e6ea94d2296eae963a48a18d009217a38d92bf9b

mGBA Game Boy Advance Emulator

src/platform/qt/AudioProcessorSDL.cpp (view raw)

 1#include "AudioProcessorSDL.h"
 2
 3extern "C" {
 4#include "gba-thread.h"
 5}
 6
 7using namespace QGBA;
 8
 9AudioProcessorSDL::AudioProcessorSDL(QObject* parent)
10	: AudioProcessor(parent)
11	, m_audio()
12{
13}
14
15AudioProcessorSDL::~AudioProcessorSDL() {
16	GBASDLDeinitAudio(&m_audio);
17}
18
19void AudioProcessorSDL::start() {
20	if (m_audio.thread) {
21		GBASDLResumeAudio(&m_audio);
22	} else {
23		m_audio.samples = input()->audioBuffers;
24		GBASDLInitAudio(&m_audio, input());
25	}
26}
27
28void AudioProcessorSDL::pause() {
29	GBASDLPauseAudio(&m_audio);
30}
31
32void AudioProcessorSDL::setBufferSamples(int samples) {
33	if (m_audio.thread) {
34		GBASDLDeinitAudio(&m_audio);
35		m_audio.samples = samples;
36		GBASDLInitAudio(&m_audio, input());
37	}
38}
39
40void AudioProcessorSDL::inputParametersChanged() {
41}