diff options
author | David Marcec <dmarcecguzman@gmail.com> | 2020-07-12 13:59:14 +0200 |
---|---|---|
committer | David Marcec <dmarcecguzman@gmail.com> | 2020-07-25 04:39:34 +0200 |
commit | 380658c21d39cf05ac765a9284da246388cca2a4 (patch) | |
tree | 1416cd7e9aee96ec40675078d16a8240d410d04b /src/audio_core/sink_context.cpp | |
parent | Merge pull request #4377 from Morph1984/dark-themes (diff) | |
download | yuzu-380658c21d39cf05ac765a9284da246388cca2a4.tar yuzu-380658c21d39cf05ac765a9284da246388cca2a4.tar.gz yuzu-380658c21d39cf05ac765a9284da246388cca2a4.tar.bz2 yuzu-380658c21d39cf05ac765a9284da246388cca2a4.tar.lz yuzu-380658c21d39cf05ac765a9284da246388cca2a4.tar.xz yuzu-380658c21d39cf05ac765a9284da246388cca2a4.tar.zst yuzu-380658c21d39cf05ac765a9284da246388cca2a4.zip |
Diffstat (limited to '')
-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 @@ +// Copyright 2020 yuzu Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include "audio_core/sink_context.h" + +namespace AudioCore { +SinkContext::SinkContext(std::size_t sink_count) : sink_count(sink_count) {} +SinkContext::~SinkContext() = default; + +std::size_t SinkContext::GetCount() const { + return sink_count; +} + +void SinkContext::UpdateMainSink(SinkInfo::InParams& in) { + in_use = in.in_use; + use_count = in.device.input_count; + std::memcpy(buffers.data(), in.device.input.data(), AudioCommon::MAX_CHANNEL_COUNT); +} + +bool SinkContext::InUse() const { + return in_use; +} + +std::vector<u8> SinkContext::OutputBuffers() const { + std::vector<u8> buffer_ret(use_count); + std::memcpy(buffer_ret.data(), buffers.data(), use_count); + return buffer_ret; +} + +} // namespace AudioCore |