From 63c2e32e207d31ecadd9022e1d7cd705c9febac8 Mon Sep 17 00:00:00 2001 From: fearlessTobi Date: Sat, 15 Sep 2018 15:21:06 +0200 Subject: Port #4182 from Citra: "Prefix all size_t with std::" --- src/audio_core/audio_renderer.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/audio_core/audio_renderer.h') diff --git a/src/audio_core/audio_renderer.h b/src/audio_core/audio_renderer.h index 6d069d693..c8d2cd188 100644 --- a/src/audio_core/audio_renderer.h +++ b/src/audio_core/audio_renderer.h @@ -184,16 +184,16 @@ private: return info; } - void SetWaveIndex(size_t index); - std::vector DequeueSamples(size_t sample_count); + void SetWaveIndex(std::size_t index); + std::vector DequeueSamples(std::size_t sample_count); void UpdateState(); void RefreshBuffer(); private: bool is_in_use{}; bool is_refresh_pending{}; - size_t wave_index{}; - size_t offset{}; + std::size_t wave_index{}; + std::size_t offset{}; Codec::ADPCMState adpcm_state{}; InterpolationState interp_state{}; std::vector samples; -- cgit v1.2.3 From 1adbcd54fe0d5d75c487c86640fed263251867ea Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 14 Sep 2018 11:54:17 -0400 Subject: audio_renderer: Replace includes with forward declarations where applicable Avoids including unnecessary headers within the audio_renderer.h header, lessening the likelihood of needing to rebuild source files including this header if they ever change. Given std::vector allows forward declaring contained types, we can move VoiceState to the cpp file and hide the implementation entirely. --- src/audio_core/audio_renderer.h | 51 ++++++++++------------------------------- 1 file changed, 12 insertions(+), 39 deletions(-) (limited to 'src/audio_core/audio_renderer.h') diff --git a/src/audio_core/audio_renderer.h b/src/audio_core/audio_renderer.h index c8d2cd188..2c4f5ab75 100644 --- a/src/audio_core/audio_renderer.h +++ b/src/audio_core/audio_renderer.h @@ -8,16 +8,20 @@ #include #include -#include "audio_core/algorithm/interpolate.h" -#include "audio_core/audio_out.h" -#include "audio_core/codec.h" #include "audio_core/stream.h" +#include "common/common_funcs.h" #include "common/common_types.h" #include "common/swap.h" -#include "core/hle/kernel/event.h" +#include "core/hle/kernel/object.h" + +namespace Kernel { +class Event; +} namespace AudioCore { +class AudioOut; + enum class PlayState : u8 { Started = 0, Stopped = 1, @@ -158,6 +162,8 @@ static_assert(sizeof(UpdateDataHeader) == 0x40, "UpdateDataHeader has wrong size class AudioRenderer { public: AudioRenderer(AudioRendererParameter params, Kernel::SharedPtr buffer_event); + ~AudioRenderer(); + std::vector UpdateAudioRenderer(const std::vector& input_params); void QueueMixedBuffer(Buffer::Tag tag); void ReleaseAndQueueBuffers(); @@ -166,45 +172,12 @@ public: u32 GetMixBufferCount() const; private: - class VoiceState { - public: - bool IsPlaying() const { - return is_in_use && info.play_state == PlayState::Started; - } - - const VoiceOutStatus& GetOutStatus() const { - return out_status; - } - - const VoiceInfo& GetInfo() const { - return info; - } - - VoiceInfo& Info() { - return info; - } - - void SetWaveIndex(std::size_t index); - std::vector DequeueSamples(std::size_t sample_count); - void UpdateState(); - void RefreshBuffer(); - - private: - bool is_in_use{}; - bool is_refresh_pending{}; - std::size_t wave_index{}; - std::size_t offset{}; - Codec::ADPCMState adpcm_state{}; - InterpolationState interp_state{}; - std::vector samples; - VoiceOutStatus out_status{}; - VoiceInfo info{}; - }; + class VoiceState; AudioRendererParameter worker_params; Kernel::SharedPtr buffer_event; std::vector voices; - std::unique_ptr audio_out; + std::unique_ptr audio_out; AudioCore::StreamPtr stream; }; -- cgit v1.2.3