diff options
| author | Florent Castelli <florent.castelli@gmail.com> | 2017-02-05 02:15:38 +0100 |
|---|---|---|
| committer | Florent Castelli <florent.castelli@gmail.com> | 2017-02-05 02:55:04 +0100 |
| commit | 9ebfaa93249929acb5a31affa75d090fd0dcb734 (patch) | |
| tree | 4b68ae923eb0e87b1ac3959aa601d4c2e88aa465 /Source/Core/AudioCommon/AudioCommon.cpp | |
| parent | 31dfaafe0b2b99e7724f4c9c6b40e7021554ef11 (diff) | |
AudioCommon: Move logic for default sound backend there from ConfigManager
This way, we don't have to leak the HAVE_ALSA define there.
Diffstat (limited to 'Source/Core/AudioCommon/AudioCommon.cpp')
| -rw-r--r-- | Source/Core/AudioCommon/AudioCommon.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/Core/AudioCommon/AudioCommon.cpp b/Source/Core/AudioCommon/AudioCommon.cpp index 1ffb323a3f..86d3d5943e 100644 --- a/Source/Core/AudioCommon/AudioCommon.cpp +++ b/Source/Core/AudioCommon/AudioCommon.cpp @@ -92,6 +92,22 @@ void ShutdownSoundStream() INFO_LOG(AUDIO, "Done shutting down sound stream"); } +std::string GetDefaultSoundBackend() +{ + std::string backend = BACKEND_NULLSOUND; +#if defined __linux__ + if (AlsaSound::isValid()) + backend = BACKEND_ALSA; +#elif defined __APPLE__ + backend = BACKEND_COREAUDIO; +#elif defined _WIN32 + backend = BACKEND_XAUDIO2; +#elif defined ANDROID + backend = BACKEND_OPENSLES; +#endif + return backend; +} + std::vector<std::string> GetSoundBackends() { std::vector<std::string> backends; |
