diff options
| author | Michael Maltese <michaeljosephmaltese@gmail.com> | 2016-10-09 19:18:16 -0700 |
|---|---|---|
| committer | Michael Maltese <michaeljosephmaltese@gmail.com> | 2016-10-09 19:18:16 -0700 |
| commit | 45903b7b4de4a0e6f64eebde0fdedd648b1be87a (patch) | |
| tree | 091f5b68c8e45472418e01bae8b17fd83ad28d50 /Source/Core/AudioCommon | |
| parent | 4834a90e63c3b173784f1e93ff6d21a065499047 (diff) | |
AudioCommon: SupportsDPL2Decoder, SupportsLatencyControl, SupportsVolumeChanges
Diffstat (limited to 'Source/Core/AudioCommon')
| -rw-r--r-- | Source/Core/AudioCommon/AudioCommon.cpp | 24 | ||||
| -rw-r--r-- | Source/Core/AudioCommon/AudioCommon.h | 3 |
2 files changed, 27 insertions, 0 deletions
diff --git a/Source/Core/AudioCommon/AudioCommon.cpp b/Source/Core/AudioCommon/AudioCommon.cpp index dd0b31b916..642051f166 100644 --- a/Source/Core/AudioCommon/AudioCommon.cpp +++ b/Source/Core/AudioCommon/AudioCommon.cpp @@ -117,6 +117,30 @@ std::vector<std::string> GetSoundBackends() return backends; } +bool SupportsDPL2Decoder(const std::string& backend) +{ +#ifndef __APPLE__ + if (backend == BACKEND_OPENAL) + return true; +#endif + if (backend == BACKEND_PULSEAUDIO) + return true; + return false; +} + +bool SupportsLatencyControl(const std::string& backend) +{ + return backend == BACKEND_OPENAL; +} + +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; +} + void UpdateSoundStream() { if (g_sound_stream) diff --git a/Source/Core/AudioCommon/AudioCommon.h b/Source/Core/AudioCommon/AudioCommon.h index 9b70a3ce4b..1d6bf5fc56 100644 --- a/Source/Core/AudioCommon/AudioCommon.h +++ b/Source/Core/AudioCommon/AudioCommon.h @@ -18,6 +18,9 @@ namespace AudioCommon void InitSoundStream(); void ShutdownSoundStream(); std::vector<std::string> GetSoundBackends(); +bool SupportsDPL2Decoder(const std::string& backend); +bool SupportsLatencyControl(const std::string& backend); +bool SupportsVolumeChanges(const std::string& backend); void UpdateSoundStream(); void ClearAudioBuffer(bool mute); void SendAIBuffer(const short* samples, unsigned int num_samples); |
