diff options
| author | 2020-09-11 10:57:27 -0400 | |
|---|---|---|
| committer | 2020-09-11 10:57:27 -0400 | |
| commit | 324029d4f9fd2381f474e608a2859360324161e5 (patch) | |
| tree | d2dc348235f05f20686c526f7092590f596f65c2 /src/audio_core/sink_context.cpp | |
| parent | Merge pull request #4597 from Morph1984/mjolnir-p2 (diff) | |
| parent | Preliminary effects (diff) | |
| download | yuzu-324029d4f9fd2381f474e608a2859360324161e5.tar.gz yuzu-324029d4f9fd2381f474e608a2859360324161e5.tar.xz yuzu-324029d4f9fd2381f474e608a2859360324161e5.zip | |
Merge pull request #4310 from ogniK5377/apollo-1-prod
audio_core: Apollo Part 1, AudioRenderer refactor
Diffstat (limited to 'src/audio_core/sink_context.cpp')
| -rw-r--r-- | src/audio_core/sink_context.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/audio_core/sink_context.cpp b/src/audio_core/sink_context.cpp new file mode 100644 index 000000000..0882b411a --- /dev/null +++ b/src/audio_core/sink_context.cpp | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | // Copyright 2020 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "audio_core/sink_context.h" | ||
| 6 | |||
| 7 | namespace AudioCore { | ||
| 8 | SinkContext::SinkContext(std::size_t sink_count) : sink_count(sink_count) {} | ||
| 9 | SinkContext::~SinkContext() = default; | ||
| 10 | |||
| 11 | std::size_t SinkContext::GetCount() const { | ||
| 12 | return sink_count; | ||
| 13 | } | ||
| 14 | |||
| 15 | void SinkContext::UpdateMainSink(SinkInfo::InParams& in) { | ||
| 16 | in_use = in.in_use; | ||
| 17 | use_count = in.device.input_count; | ||
| 18 | std::memcpy(buffers.data(), in.device.input.data(), AudioCommon::MAX_CHANNEL_COUNT); | ||
| 19 | } | ||
| 20 | |||
| 21 | bool SinkContext::InUse() const { | ||
| 22 | return in_use; | ||
| 23 | } | ||
| 24 | |||
| 25 | std::vector<u8> SinkContext::OutputBuffers() const { | ||
| 26 | std::vector<u8> buffer_ret(use_count); | ||
| 27 | std::memcpy(buffer_ret.data(), buffers.data(), use_count); | ||
| 28 | return buffer_ret; | ||
| 29 | } | ||
| 30 | |||
| 31 | } // namespace AudioCore | ||