diff options
Diffstat (limited to 'src/audio_core/sink_details.cpp')
| -rw-r--r-- | src/audio_core/sink_details.cpp | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/src/audio_core/sink_details.cpp b/src/audio_core/sink_details.cpp deleted file mode 100644 index 6972395af..000000000 --- a/src/audio_core/sink_details.cpp +++ /dev/null | |||
| @@ -1,42 +0,0 @@ | |||
| 1 | // Copyright 2016 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include <algorithm> | ||
| 6 | #include <memory> | ||
| 7 | #include <vector> | ||
| 8 | #include "audio_core/null_sink.h" | ||
| 9 | #include "audio_core/sink_details.h" | ||
| 10 | #ifdef HAVE_SDL2 | ||
| 11 | #include "audio_core/sdl2_sink.h" | ||
| 12 | #endif | ||
| 13 | #include "common/logging/log.h" | ||
| 14 | |||
| 15 | namespace AudioCore { | ||
| 16 | |||
| 17 | // g_sink_details is ordered in terms of desirability, with the best choice at the top. | ||
| 18 | const std::vector<SinkDetails> g_sink_details = { | ||
| 19 | #ifdef HAVE_SDL2 | ||
| 20 | {"sdl2", []() { return std::make_unique<SDL2Sink>(); }}, | ||
| 21 | #endif | ||
| 22 | {"null", []() { return std::make_unique<NullSink>(); }}, | ||
| 23 | }; | ||
| 24 | |||
| 25 | const SinkDetails& GetSinkDetails(std::string sink_id) { | ||
| 26 | auto iter = | ||
| 27 | std::find_if(g_sink_details.begin(), g_sink_details.end(), | ||
| 28 | [sink_id](const auto& sink_detail) { return sink_detail.id == sink_id; }); | ||
| 29 | |||
| 30 | if (sink_id == "auto" || iter == g_sink_details.end()) { | ||
| 31 | if (sink_id != "auto") { | ||
| 32 | LOG_ERROR(Audio, "AudioCore::SelectSink given invalid sink_id %s", sink_id.c_str()); | ||
| 33 | } | ||
| 34 | // Auto-select. | ||
| 35 | // g_sink_details is ordered in terms of desirability, with the best choice at the front. | ||
| 36 | iter = g_sink_details.begin(); | ||
| 37 | } | ||
| 38 | |||
| 39 | return *iter; | ||
| 40 | } | ||
| 41 | |||
| 42 | } // namespace AudioCore | ||