diff options
author | Kelebek1 <eeeedddccc@hotmail.co.uk> | 2022-07-17 00:48:45 +0200 |
---|---|---|
committer | Kelebek1 <eeeedddccc@hotmail.co.uk> | 2022-07-22 02:11:32 +0200 |
commit | 458da8a94877677f086f06cdeecf959ec4283a33 (patch) | |
tree | 583166d77602ad90a0d552f37de8729ad80fd6c1 /src/audio_core/sink_context.h | |
parent | Merge pull request #8598 from Link4565/recv-dontwait (diff) | |
download | yuzu-458da8a94877677f086f06cdeecf959ec4283a33.tar yuzu-458da8a94877677f086f06cdeecf959ec4283a33.tar.gz yuzu-458da8a94877677f086f06cdeecf959ec4283a33.tar.bz2 yuzu-458da8a94877677f086f06cdeecf959ec4283a33.tar.lz yuzu-458da8a94877677f086f06cdeecf959ec4283a33.tar.xz yuzu-458da8a94877677f086f06cdeecf959ec4283a33.tar.zst yuzu-458da8a94877677f086f06cdeecf959ec4283a33.zip |
Diffstat (limited to '')
-rw-r--r-- | src/audio_core/sink_context.h | 95 |
1 files changed, 0 insertions, 95 deletions
diff --git a/src/audio_core/sink_context.h b/src/audio_core/sink_context.h deleted file mode 100644 index cc5a90d80..000000000 --- a/src/audio_core/sink_context.h +++ /dev/null @@ -1,95 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include <array> -#include <vector> -#include "audio_core/common.h" -#include "common/common_funcs.h" -#include "common/common_types.h" -#include "common/swap.h" - -namespace AudioCore { - -using DownmixCoefficients = std::array<float_le, 4>; - -enum class SinkTypes : u8 { - Invalid = 0, - Device = 1, - Circular = 2, -}; - -enum class SinkSampleFormat : u32_le { - None = 0, - Pcm8 = 1, - Pcm16 = 2, - Pcm24 = 3, - Pcm32 = 4, - PcmFloat = 5, - Adpcm = 6, -}; - -class SinkInfo { -public: - struct CircularBufferIn { - u64_le address; - u32_le size; - u32_le input_count; - u32_le sample_count; - u32_le previous_position; - SinkSampleFormat sample_format; - std::array<u8, AudioCommon::MAX_CHANNEL_COUNT> input; - bool in_use; - INSERT_PADDING_BYTES_NOINIT(5); - }; - static_assert(sizeof(CircularBufferIn) == 0x28, - "SinkInfo::CircularBufferIn is in invalid size"); - - struct DeviceIn { - std::array<u8, 255> device_name; - INSERT_PADDING_BYTES_NOINIT(1); - s32_le input_count; - std::array<u8, AudioCommon::MAX_CHANNEL_COUNT> input; - INSERT_PADDING_BYTES_NOINIT(1); - bool down_matrix_enabled; - DownmixCoefficients down_matrix_coef; - }; - static_assert(sizeof(DeviceIn) == 0x11c, "SinkInfo::DeviceIn is an invalid size"); - - struct InParams { - SinkTypes type{}; - bool in_use{}; - INSERT_PADDING_BYTES(2); - u32_le node_id{}; - INSERT_PADDING_WORDS(6); - union { - // std::array<u8, 0x120> raw{}; - DeviceIn device; - CircularBufferIn circular_buffer; - }; - }; - static_assert(sizeof(InParams) == 0x140, "SinkInfo::InParams are an invalid size!"); -}; - -class SinkContext { -public: - explicit SinkContext(std::size_t sink_count_); - ~SinkContext(); - - [[nodiscard]] std::size_t GetCount() const; - - void UpdateMainSink(const SinkInfo::InParams& in); - [[nodiscard]] bool InUse() const; - [[nodiscard]] std::vector<u8> OutputBuffers() const; - - [[nodiscard]] const DownmixCoefficients& GetDownmixCoefficients() const; - -private: - bool in_use{false}; - s32 use_count{}; - std::array<u8, AudioCommon::MAX_CHANNEL_COUNT> buffers{}; - std::size_t sink_count{}; - DownmixCoefficients downmix_coefficients{}; -}; -} // namespace AudioCore |