diff options
| author | Michael Maltese <michaeljosephmaltese@gmail.com> | 2017-03-22 16:09:59 -0700 |
|---|---|---|
| committer | Michael Maltese <michaeljosephmaltese@gmail.com> | 2017-05-27 18:28:56 -0700 |
| commit | f6e1da0dc00dc3437dfc8dd4a963e648fd6584a1 (patch) | |
| tree | 6e3fbaf3712368d96873f32376e05e401931b50b /Source/Core/AudioCommon/AudioCommon.cpp | |
| parent | 17f4413143af44927b702267ae7d35af2eb357ec (diff) | |
AudioCommon: add Cubeb backend
Diffstat (limited to 'Source/Core/AudioCommon/AudioCommon.cpp')
| -rw-r--r-- | Source/Core/AudioCommon/AudioCommon.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Source/Core/AudioCommon/AudioCommon.cpp b/Source/Core/AudioCommon/AudioCommon.cpp index fea933e582..6fc5a70c84 100644 --- a/Source/Core/AudioCommon/AudioCommon.cpp +++ b/Source/Core/AudioCommon/AudioCommon.cpp @@ -5,6 +5,7 @@ #include "AudioCommon/AudioCommon.h" #include "AudioCommon/AlsaSoundStream.h" #include "AudioCommon/CoreAudioSoundStream.h" +#include "AudioCommon/CubebStream.h" #include "AudioCommon/Mixer.h" #include "AudioCommon/NullSoundStream.h" #include "AudioCommon/OpenALStream.h" @@ -30,7 +31,9 @@ static const int AUDIO_VOLUME_MAX = 100; void InitSoundStream() { std::string backend = SConfig::GetInstance().sBackend; - if (backend == BACKEND_OPENAL && OpenALStream::isValid()) + if (backend == BACKEND_CUBEB) + g_sound_stream = std::make_unique<CubebStream>(); + else if (backend == BACKEND_OPENAL && OpenALStream::isValid()) g_sound_stream = std::make_unique<OpenALStream>(); else if (backend == BACKEND_NULLSOUND) g_sound_stream = std::make_unique<NullSound>(); @@ -110,6 +113,7 @@ std::vector<std::string> GetSoundBackends() std::vector<std::string> backends; backends.push_back(BACKEND_NULLSOUND); + backends.push_back(BACKEND_CUBEB); if (XAudio2_7::isValid() || XAudio2::isValid()) backends.push_back(BACKEND_XAUDIO2); if (AlsaSound::isValid()) @@ -131,6 +135,8 @@ bool SupportsDPL2Decoder(const std::string& backend) if (backend == BACKEND_OPENAL) return true; #endif + if (backend == BACKEND_CUBEB) + return true; if (backend == BACKEND_PULSEAUDIO) return true; return false; @@ -146,7 +152,8 @@ bool SupportsVolumeChanges(const std::string& backend) // FIXME: this one should ask the backend whether it supports it. // but getting the backend from string etc. is probably // too much just to enable/disable a stupid slider... - return backend == BACKEND_COREAUDIO || backend == BACKEND_OPENAL || backend == BACKEND_XAUDIO2; + return backend == BACKEND_COREAUDIO || backend == BACKEND_CUBEB || backend == BACKEND_OPENAL || + backend == BACKEND_XAUDIO2; } void UpdateSoundStream() |
