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/renderer/effect/compressor.cpp | |
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 'src/audio_core/renderer/effect/compressor.cpp')
-rw-r--r-- | src/audio_core/renderer/effect/compressor.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/audio_core/renderer/effect/compressor.cpp b/src/audio_core/renderer/effect/compressor.cpp new file mode 100644 index 000000000..220ae02f9 --- /dev/null +++ b/src/audio_core/renderer/effect/compressor.cpp @@ -0,0 +1,40 @@ +// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "audio_core/renderer/effect/compressor.h" + +namespace AudioCore::AudioRenderer { + +void CompressorInfo::Update(BehaviorInfo::ErrorInfo& error_info, + const InParameterVersion1& in_params, const PoolMapper& pool_mapper) {} + +void CompressorInfo::Update(BehaviorInfo::ErrorInfo& error_info, + const InParameterVersion2& in_params, const PoolMapper& pool_mapper) { + auto in_specific{reinterpret_cast<const ParameterVersion1*>(in_params.specific.data())}; + auto params{reinterpret_cast<ParameterVersion1*>(parameter.data())}; + + std::memcpy(params, in_specific, sizeof(ParameterVersion1)); + mix_id = in_params.mix_id; + process_order = in_params.process_order; + enabled = in_params.enabled; + + error_info.error_code = ResultSuccess; + error_info.address = CpuAddr(0); +} + +void CompressorInfo::UpdateForCommandGeneration() { + if (enabled) { + usage_state = UsageState::Enabled; + } else { + usage_state = UsageState::Disabled; + } + + auto params{reinterpret_cast<ParameterVersion1*>(parameter.data())}; + params->state = ParameterState::Updated; +} + +CpuAddr CompressorInfo::GetWorkbuffer(s32 index) { + return GetSingleBuffer(index); +} + +} // namespace AudioCore::AudioRenderer |