diff options
| author | 2022-07-16 23:48:45 +0100 | |
|---|---|---|
| committer | 2022-07-22 01:11:32 +0100 | |
| commit | 458da8a94877677f086f06cdeecf959ec4283a33 (patch) | |
| tree | 583166d77602ad90a0d552f37de8729ad80fd6c1 /src/audio_core/sink_context.cpp | |
| parent | Merge pull request #8598 from Link4565/recv-dontwait (diff) | |
| download | yuzu-458da8a94877677f086f06cdeecf959ec4283a33.tar.gz yuzu-458da8a94877677f086f06cdeecf959ec4283a33.tar.xz yuzu-458da8a94877677f086f06cdeecf959ec4283a33.zip | |
Project Andio
Diffstat (limited to 'src/audio_core/sink_context.cpp')
| -rw-r--r-- | src/audio_core/sink_context.cpp | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/src/audio_core/sink_context.cpp b/src/audio_core/sink_context.cpp deleted file mode 100644 index 835e12f67..000000000 --- a/src/audio_core/sink_context.cpp +++ /dev/null | |||
| @@ -1,47 +0,0 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #include "audio_core/sink_context.h" | ||
| 5 | |||
| 6 | namespace AudioCore { | ||
| 7 | SinkContext::SinkContext(std::size_t sink_count_) : sink_count{sink_count_} {} | ||
| 8 | SinkContext::~SinkContext() = default; | ||
| 9 | |||
| 10 | std::size_t SinkContext::GetCount() const { | ||
| 11 | return sink_count; | ||
| 12 | } | ||
| 13 | |||
| 14 | void SinkContext::UpdateMainSink(const SinkInfo::InParams& in) { | ||
| 15 | ASSERT(in.type == SinkTypes::Device); | ||
| 16 | |||
| 17 | if (in.device.down_matrix_enabled) { | ||
| 18 | downmix_coefficients = in.device.down_matrix_coef; | ||
| 19 | } else { | ||
| 20 | downmix_coefficients = { | ||
| 21 | 1.0f, // front | ||
| 22 | 0.707f, // center | ||
| 23 | 0.0f, // lfe | ||
| 24 | 0.707f, // back | ||
| 25 | }; | ||
| 26 | } | ||
| 27 | |||
| 28 | in_use = in.in_use; | ||
| 29 | use_count = in.device.input_count; | ||
| 30 | buffers = in.device.input; | ||
| 31 | } | ||
| 32 | |||
| 33 | bool SinkContext::InUse() const { | ||
| 34 | return in_use; | ||
| 35 | } | ||
| 36 | |||
| 37 | std::vector<u8> SinkContext::OutputBuffers() const { | ||
| 38 | std::vector<u8> buffer_ret(use_count); | ||
| 39 | std::memcpy(buffer_ret.data(), buffers.data(), use_count); | ||
| 40 | return buffer_ret; | ||
| 41 | } | ||
| 42 | |||
| 43 | const DownmixCoefficients& SinkContext::GetDownmixCoefficients() const { | ||
| 44 | return downmix_coefficients; | ||
| 45 | } | ||
| 46 | |||
| 47 | } // namespace AudioCore | ||