sink_details: Listing available devices should be separate from sink construction

This commit is contained in:
MerryMage 2018-07-02 14:03:14 +01:00
parent ce5a5412ae
commit d269beab0d
13 changed files with 84 additions and 70 deletions

View file

@ -21,12 +21,13 @@ namespace AudioCore {
// g_sink_details is ordered in terms of desirability, with the best choice at the top.
const std::vector<SinkDetails> g_sink_details = {
#ifdef HAVE_CUBEB
{"cubeb", &std::make_unique<CubebSink>},
SinkDetails{"cubeb", &std::make_unique<CubebSink, std::string>, &ListCubebSinkDevices},
#endif
#ifdef HAVE_SDL2
{"sdl2", &std::make_unique<SDL2Sink>},
SinkDetails{"sdl2", &std::make_unique<SDL2Sink, std::string>, &ListSDL2SinkDevices},
#endif
{"null", &std::make_unique<NullSink>},
SinkDetails{"null", &std::make_unique<NullSink, std::string>,
[] { return std::vector<std::string>{"null"}; }},
};
const SinkDetails& GetSinkDetails(std::string sink_id) {