diff options
author | Morph <39850852+Morph1984@users.noreply.github.com> | 2021-07-08 18:09:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-08 18:09:21 +0200 |
commit | 91a4a924b13b50f5b86fac732575c22e40d21891 (patch) | |
tree | 6511301bcbebc5b9ed6c9a1c64b19b3a8b2179dd /src/audio_core/command_generator.h | |
parent | Merge pull request #6567 from Kelebek1/Audio2 (diff) | |
parent | audio_core: Preserve front channel volume after 6 to 2 downmix (diff) | |
download | yuzu-91a4a924b13b50f5b86fac732575c22e40d21891.tar yuzu-91a4a924b13b50f5b86fac732575c22e40d21891.tar.gz yuzu-91a4a924b13b50f5b86fac732575c22e40d21891.tar.bz2 yuzu-91a4a924b13b50f5b86fac732575c22e40d21891.tar.lz yuzu-91a4a924b13b50f5b86fac732575c22e40d21891.tar.xz yuzu-91a4a924b13b50f5b86fac732575c22e40d21891.tar.zst yuzu-91a4a924b13b50f5b86fac732575c22e40d21891.zip |
Diffstat (limited to 'src/audio_core/command_generator.h')
-rw-r--r-- | src/audio_core/command_generator.h | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/audio_core/command_generator.h b/src/audio_core/command_generator.h index 673e4fbef..ac034b0a5 100644 --- a/src/audio_core/command_generator.h +++ b/src/audio_core/command_generator.h @@ -5,6 +5,7 @@ #pragma once #include <array> +#include <span> #include "audio_core/common.h" #include "audio_core/voice_context.h" #include "common/common_types.h" @@ -41,10 +42,10 @@ public: void PreCommand(); void PostCommand(); - [[nodiscard]] s32* GetChannelMixBuffer(s32 channel); - [[nodiscard]] const s32* GetChannelMixBuffer(s32 channel) const; - [[nodiscard]] s32* GetMixBuffer(std::size_t index); - [[nodiscard]] const s32* GetMixBuffer(std::size_t index) const; + [[nodiscard]] std::span<s32> GetChannelMixBuffer(s32 channel); + [[nodiscard]] std::span<const s32> GetChannelMixBuffer(s32 channel) const; + [[nodiscard]] std::span<s32> GetMixBuffer(std::size_t index); + [[nodiscard]] std::span<const s32> GetMixBuffer(std::size_t index) const; [[nodiscard]] std::size_t GetMixChannelBufferOffset(s32 channel) const; [[nodiscard]] std::size_t GetTotalMixBufferCount() const; @@ -77,10 +78,11 @@ private: void GenerateAuxCommand(s32 mix_buffer_offset, EffectBase* info, bool enabled); [[nodiscard]] ServerSplitterDestinationData* GetDestinationData(s32 splitter_id, s32 index); - s32 WriteAuxBuffer(AuxInfoDSP& dsp_info, VAddr send_buffer, u32 max_samples, const s32* data, - u32 sample_count, u32 write_offset, u32 write_count); - s32 ReadAuxBuffer(AuxInfoDSP& recv_info, VAddr recv_buffer, u32 max_samples, s32* out_data, - u32 sample_count, u32 read_offset, u32 read_count); + s32 WriteAuxBuffer(AuxInfoDSP& dsp_info, VAddr send_buffer, u32 max_samples, + std::span<const s32> data, u32 sample_count, u32 write_offset, + u32 write_count); + s32 ReadAuxBuffer(AuxInfoDSP& recv_info, VAddr recv_buffer, u32 max_samples, + std::span<s32> out_data, u32 sample_count, u32 read_offset, u32 read_count); void InitializeI3dl2Reverb(I3dl2ReverbParams& info, I3dl2ReverbState& state, std::vector<u8>& work_buffer); @@ -90,8 +92,9 @@ private: s32 sample_end_offset, s32 sample_count, s32 channel, std::size_t mix_offset); s32 DecodeAdpcm(ServerVoiceInfo& voice_info, VoiceState& dsp_state, s32 sample_start_offset, s32 sample_end_offset, s32 sample_count, s32 channel, std::size_t mix_offset); - void DecodeFromWaveBuffers(ServerVoiceInfo& voice_info, s32* output, VoiceState& dsp_state, - s32 channel, s32 target_sample_rate, s32 sample_count, s32 node_id); + void DecodeFromWaveBuffers(ServerVoiceInfo& voice_info, std::span<s32> output, + VoiceState& dsp_state, s32 channel, s32 target_sample_rate, + s32 sample_count, s32 node_id); AudioCommon::AudioRendererParameter& worker_params; VoiceContext& voice_context; |