diff options
| author | 2016-04-28 14:28:59 +0100 | |
|---|---|---|
| committer | 2016-04-30 07:39:48 +0100 | |
| commit | 8b94422e3e51d29171c7e8cc02bec1fbec9b29ea (patch) | |
| tree | 2a81a3f8172611c8b9d01ec0ca7bf56f78ac126f /src | |
| parent | AudioCore: Implement NullSink (diff) | |
| download | yuzu-8b94422e3e51d29171c7e8cc02bec1fbec9b29ea.tar.gz yuzu-8b94422e3e51d29171c7e8cc02bec1fbec9b29ea.tar.xz yuzu-8b94422e3e51d29171c7e8cc02bec1fbec9b29ea.zip | |
AudioCore: List of sink types
Diffstat (limited to 'src')
| -rw-r--r-- | src/audio_core/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/audio_core/sink_details.cpp | 17 | ||||
| -rw-r--r-- | src/audio_core/sink_details.h | 27 |
3 files changed, 46 insertions, 0 deletions
diff --git a/src/audio_core/CMakeLists.txt b/src/audio_core/CMakeLists.txt index 46d3de578..5a2747e78 100644 --- a/src/audio_core/CMakeLists.txt +++ b/src/audio_core/CMakeLists.txt | |||
| @@ -5,6 +5,7 @@ set(SRCS | |||
| 5 | hle/filter.cpp | 5 | hle/filter.cpp |
| 6 | hle/pipe.cpp | 6 | hle/pipe.cpp |
| 7 | interpolate.cpp | 7 | interpolate.cpp |
| 8 | sink_details.cpp | ||
| 8 | ) | 9 | ) |
| 9 | 10 | ||
| 10 | set(HEADERS | 11 | set(HEADERS |
| @@ -17,6 +18,7 @@ set(HEADERS | |||
| 17 | interpolate.h | 18 | interpolate.h |
| 18 | null_sink.h | 19 | null_sink.h |
| 19 | sink.h | 20 | sink.h |
| 21 | sink_details.h | ||
| 20 | ) | 22 | ) |
| 21 | 23 | ||
| 22 | include_directories(../../externals/soundtouch/include) | 24 | include_directories(../../externals/soundtouch/include) |
diff --git a/src/audio_core/sink_details.cpp b/src/audio_core/sink_details.cpp new file mode 100644 index 000000000..20412daaf --- /dev/null +++ b/src/audio_core/sink_details.cpp | |||
| @@ -0,0 +1,17 @@ | |||
| 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 <memory> | ||
| 6 | #include <vector> | ||
| 7 | |||
| 8 | #include "audio_core/null_sink.h" | ||
| 9 | #include "audio_core/sink_details.h" | ||
| 10 | |||
| 11 | namespace AudioCore { | ||
| 12 | |||
| 13 | const std::vector<SinkDetails> g_sink_details = { | ||
| 14 | { "null", []() { return std::make_unique<NullSink>(); } }, | ||
| 15 | }; | ||
| 16 | |||
| 17 | } // namespace AudioCore | ||
diff --git a/src/audio_core/sink_details.h b/src/audio_core/sink_details.h new file mode 100644 index 000000000..4b30cf835 --- /dev/null +++ b/src/audio_core/sink_details.h | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | // Copyright 2016 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include <functional> | ||
| 8 | #include <memory> | ||
| 9 | #include <vector> | ||
| 10 | |||
| 11 | namespace AudioCore { | ||
| 12 | |||
| 13 | class Sink; | ||
| 14 | |||
| 15 | struct SinkDetails { | ||
| 16 | SinkDetails(const char* id_, std::function<std::unique_ptr<Sink>()> factory_) | ||
| 17 | : id(id_), factory(factory_) {} | ||
| 18 | |||
| 19 | /// Name for this sink. | ||
| 20 | const char* id; | ||
| 21 | /// A method to call to construct an instance of this type of sink. | ||
| 22 | std::function<std::unique_ptr<Sink>()> factory; | ||
| 23 | }; | ||
| 24 | |||
| 25 | extern const std::vector<SinkDetails> g_sink_details; | ||
| 26 | |||
| 27 | } // namespace AudioCore | ||