diff options
Diffstat (limited to 'src')
29 files changed, 163 insertions, 154 deletions
diff --git a/src/audio_core/CMakeLists.txt b/src/audio_core/CMakeLists.txt index 68c67507b..d1d177b51 100644 --- a/src/audio_core/CMakeLists.txt +++ b/src/audio_core/CMakeLists.txt | |||
| @@ -51,6 +51,8 @@ if (NOT MSVC) | |||
| 51 | -Werror=implicit-fallthrough | 51 | -Werror=implicit-fallthrough |
| 52 | -Werror=reorder | 52 | -Werror=reorder |
| 53 | -Werror=sign-compare | 53 | -Werror=sign-compare |
| 54 | -Werror=shadow | ||
| 55 | -Werror=unused-parameter | ||
| 54 | -Werror=unused-variable | 56 | -Werror=unused-variable |
| 55 | 57 | ||
| 56 | $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-parameter> | 58 | $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-parameter> |
diff --git a/src/audio_core/algorithm/filter.cpp b/src/audio_core/algorithm/filter.cpp index f34a5b9f3..01b8dff6b 100644 --- a/src/audio_core/algorithm/filter.cpp +++ b/src/audio_core/algorithm/filter.cpp | |||
| @@ -31,8 +31,8 @@ Filter Filter::LowPass(double cutoff, double Q) { | |||
| 31 | 31 | ||
| 32 | Filter::Filter() : Filter(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) {} | 32 | Filter::Filter() : Filter(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) {} |
| 33 | 33 | ||
| 34 | Filter::Filter(double a0, double a1, double a2, double b0, double b1, double b2) | 34 | Filter::Filter(double a0_, double a1_, double a2_, double b0_, double b1_, double b2_) |
| 35 | : a1(a1 / a0), a2(a2 / a0), b0(b0 / a0), b1(b1 / a0), b2(b2 / a0) {} | 35 | : a1(a1_ / a0_), a2(a2_ / a0_), b0(b0_ / a0_), b1(b1_ / a0_), b2(b2_ / a0_) {} |
| 36 | 36 | ||
| 37 | void Filter::Process(std::vector<s16>& signal) { | 37 | void Filter::Process(std::vector<s16>& signal) { |
| 38 | const std::size_t num_frames = signal.size() / 2; | 38 | const std::size_t num_frames = signal.size() / 2; |
| @@ -69,7 +69,7 @@ CascadingFilter CascadingFilter::LowPass(double cutoff, std::size_t cascade_size | |||
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | CascadingFilter::CascadingFilter() = default; | 71 | CascadingFilter::CascadingFilter() = default; |
| 72 | CascadingFilter::CascadingFilter(std::vector<Filter> filters) : filters(std::move(filters)) {} | 72 | CascadingFilter::CascadingFilter(std::vector<Filter> filters_) : filters(std::move(filters_)) {} |
| 73 | 73 | ||
| 74 | void CascadingFilter::Process(std::vector<s16>& signal) { | 74 | void CascadingFilter::Process(std::vector<s16>& signal) { |
| 75 | for (auto& filter : filters) { | 75 | for (auto& filter : filters) { |
diff --git a/src/audio_core/algorithm/filter.h b/src/audio_core/algorithm/filter.h index 3546d149b..a291fe79b 100644 --- a/src/audio_core/algorithm/filter.h +++ b/src/audio_core/algorithm/filter.h | |||
| @@ -25,7 +25,7 @@ public: | |||
| 25 | /// Passthrough filter. | 25 | /// Passthrough filter. |
| 26 | Filter(); | 26 | Filter(); |
| 27 | 27 | ||
| 28 | Filter(double a0, double a1, double a2, double b0, double b1, double b2); | 28 | Filter(double a0_, double a1_, double a2_, double b0_, double b1_, double b2_); |
| 29 | 29 | ||
| 30 | void Process(std::vector<s16>& signal); | 30 | void Process(std::vector<s16>& signal); |
| 31 | 31 | ||
| @@ -51,7 +51,7 @@ public: | |||
| 51 | /// Passthrough. | 51 | /// Passthrough. |
| 52 | CascadingFilter(); | 52 | CascadingFilter(); |
| 53 | 53 | ||
| 54 | explicit CascadingFilter(std::vector<Filter> filters); | 54 | explicit CascadingFilter(std::vector<Filter> filters_); |
| 55 | 55 | ||
| 56 | void Process(std::vector<s16>& signal); | 56 | void Process(std::vector<s16>& signal); |
| 57 | 57 | ||
diff --git a/src/audio_core/audio_renderer.cpp b/src/audio_core/audio_renderer.cpp index e1ded84e0..75ab9ea0b 100644 --- a/src/audio_core/audio_renderer.cpp +++ b/src/audio_core/audio_renderer.cpp | |||
| @@ -71,9 +71,9 @@ namespace { | |||
| 71 | namespace AudioCore { | 71 | namespace AudioCore { |
| 72 | AudioRenderer::AudioRenderer(Core::Timing::CoreTiming& core_timing, Core::Memory::Memory& memory_, | 72 | AudioRenderer::AudioRenderer(Core::Timing::CoreTiming& core_timing, Core::Memory::Memory& memory_, |
| 73 | AudioCommon::AudioRendererParameter params, | 73 | AudioCommon::AudioRendererParameter params, |
| 74 | std::shared_ptr<Kernel::WritableEvent> buffer_event, | 74 | std::shared_ptr<Kernel::WritableEvent> buffer_event_, |
| 75 | std::size_t instance_number) | 75 | std::size_t instance_number) |
| 76 | : worker_params{params}, buffer_event{buffer_event}, | 76 | : worker_params{params}, buffer_event{buffer_event_}, |
| 77 | memory_pool_info(params.effect_count + params.voice_count * 4), | 77 | memory_pool_info(params.effect_count + params.voice_count * 4), |
| 78 | voice_context(params.voice_count), effect_context(params.effect_count), mix_context(), | 78 | voice_context(params.voice_count), effect_context(params.effect_count), mix_context(), |
| 79 | sink_context(params.sink_count), splitter_context(), | 79 | sink_context(params.sink_count), splitter_context(), |
| @@ -89,7 +89,7 @@ AudioRenderer::AudioRenderer(Core::Timing::CoreTiming& core_timing, Core::Memory | |||
| 89 | stream = | 89 | stream = |
| 90 | audio_out->OpenStream(core_timing, params.sample_rate, AudioCommon::STREAM_NUM_CHANNELS, | 90 | audio_out->OpenStream(core_timing, params.sample_rate, AudioCommon::STREAM_NUM_CHANNELS, |
| 91 | fmt::format("AudioRenderer-Instance{}", instance_number), | 91 | fmt::format("AudioRenderer-Instance{}", instance_number), |
| 92 | [=]() { buffer_event->Signal(); }); | 92 | [=]() { buffer_event_->Signal(); }); |
| 93 | audio_out->StartStream(stream); | 93 | audio_out->StartStream(stream); |
| 94 | 94 | ||
| 95 | QueueMixedBuffer(0); | 95 | QueueMixedBuffer(0); |
diff --git a/src/audio_core/audio_renderer.h b/src/audio_core/audio_renderer.h index a85219045..1f96013f7 100644 --- a/src/audio_core/audio_renderer.h +++ b/src/audio_core/audio_renderer.h | |||
| @@ -44,7 +44,8 @@ class AudioRenderer { | |||
| 44 | public: | 44 | public: |
| 45 | AudioRenderer(Core::Timing::CoreTiming& core_timing, Core::Memory::Memory& memory_, | 45 | AudioRenderer(Core::Timing::CoreTiming& core_timing, Core::Memory::Memory& memory_, |
| 46 | AudioCommon::AudioRendererParameter params, | 46 | AudioCommon::AudioRendererParameter params, |
| 47 | std::shared_ptr<Kernel::WritableEvent> buffer_event, std::size_t instance_number); | 47 | std::shared_ptr<Kernel::WritableEvent> buffer_event_, |
| 48 | std::size_t instance_number); | ||
| 48 | ~AudioRenderer(); | 49 | ~AudioRenderer(); |
| 49 | 50 | ||
| 50 | [[nodiscard]] ResultCode UpdateAudioRenderer(const std::vector<u8>& input_params, | 51 | [[nodiscard]] ResultCode UpdateAudioRenderer(const std::vector<u8>& input_params, |
diff --git a/src/audio_core/buffer.h b/src/audio_core/buffer.h index 5ee09e9aa..ccc46ef82 100644 --- a/src/audio_core/buffer.h +++ b/src/audio_core/buffer.h | |||
| @@ -18,7 +18,7 @@ class Buffer { | |||
| 18 | public: | 18 | public: |
| 19 | using Tag = u64; | 19 | using Tag = u64; |
| 20 | 20 | ||
| 21 | Buffer(Tag tag, std::vector<s16>&& samples) : tag{tag}, samples{std::move(samples)} {} | 21 | Buffer(Tag tag_, std::vector<s16>&& samples_) : tag{tag_}, samples{std::move(samples_)} {} |
| 22 | 22 | ||
| 23 | /// Returns the raw audio data for the buffer | 23 | /// Returns the raw audio data for the buffer |
| 24 | std::vector<s16>& GetSamples() { | 24 | std::vector<s16>& GetSamples() { |
diff --git a/src/audio_core/command_generator.cpp b/src/audio_core/command_generator.cpp index fb8700ccf..a4a9a757d 100644 --- a/src/audio_core/command_generator.cpp +++ b/src/audio_core/command_generator.cpp | |||
| @@ -67,12 +67,12 @@ s32 ApplyMixDepop(s32* output, s32 first_sample, s32 delta, s32 sample_count) { | |||
| 67 | 67 | ||
| 68 | } // namespace | 68 | } // namespace |
| 69 | 69 | ||
| 70 | CommandGenerator::CommandGenerator(AudioCommon::AudioRendererParameter& worker_params, | 70 | CommandGenerator::CommandGenerator(AudioCommon::AudioRendererParameter& worker_params_, |
| 71 | VoiceContext& voice_context, MixContext& mix_context, | 71 | VoiceContext& voice_context_, MixContext& mix_context_, |
| 72 | SplitterContext& splitter_context, EffectContext& effect_context, | 72 | SplitterContext& splitter_context_, |
| 73 | Core::Memory::Memory& memory) | 73 | EffectContext& effect_context_, Core::Memory::Memory& memory_) |
| 74 | : worker_params(worker_params), voice_context(voice_context), mix_context(mix_context), | 74 | : worker_params(worker_params_), voice_context(voice_context_), mix_context(mix_context_), |
| 75 | splitter_context(splitter_context), effect_context(effect_context), memory(memory), | 75 | splitter_context(splitter_context_), effect_context(effect_context_), memory(memory_), |
| 76 | mix_buffer((worker_params.mix_buffer_count + AudioCommon::MAX_CHANNEL_COUNT) * | 76 | mix_buffer((worker_params.mix_buffer_count + AudioCommon::MAX_CHANNEL_COUNT) * |
| 77 | worker_params.sample_count), | 77 | worker_params.sample_count), |
| 78 | sample_buffer(MIX_BUFFER_SIZE), | 78 | sample_buffer(MIX_BUFFER_SIZE), |
| @@ -255,7 +255,8 @@ void CommandGenerator::GenerateDataSourceCommand(ServerVoiceInfo& voice_info, Vo | |||
| 255 | 255 | ||
| 256 | void CommandGenerator::GenerateBiquadFilterCommandForVoice(ServerVoiceInfo& voice_info, | 256 | void CommandGenerator::GenerateBiquadFilterCommandForVoice(ServerVoiceInfo& voice_info, |
| 257 | VoiceState& dsp_state, | 257 | VoiceState& dsp_state, |
| 258 | s32 mix_buffer_count, s32 channel) { | 258 | [[maybe_unused]] s32 mix_buffer_count, |
| 259 | [[maybe_unused]] s32 channel) { | ||
| 259 | for (std::size_t i = 0; i < AudioCommon::MAX_BIQUAD_FILTERS; i++) { | 260 | for (std::size_t i = 0; i < AudioCommon::MAX_BIQUAD_FILTERS; i++) { |
| 260 | const auto& in_params = voice_info.GetInParams(); | 261 | const auto& in_params = voice_info.GetInParams(); |
| 261 | auto& biquad_filter = in_params.biquad_filter[i]; | 262 | auto& biquad_filter = in_params.biquad_filter[i]; |
| @@ -278,9 +279,12 @@ void CommandGenerator::GenerateBiquadFilterCommandForVoice(ServerVoiceInfo& voic | |||
| 278 | } | 279 | } |
| 279 | } | 280 | } |
| 280 | 281 | ||
| 281 | void AudioCore::CommandGenerator::GenerateBiquadFilterCommand( | 282 | void CommandGenerator::GenerateBiquadFilterCommand([[maybe_unused]] s32 mix_buffer_id, |
| 282 | s32 mix_buffer, const BiquadFilterParameter& params, std::array<s64, 2>& state, | 283 | const BiquadFilterParameter& params, |
| 283 | std::size_t input_offset, std::size_t output_offset, s32 sample_count, s32 node_id) { | 284 | std::array<s64, 2>& state, |
| 285 | std::size_t input_offset, | ||
| 286 | std::size_t output_offset, s32 sample_count, | ||
| 287 | s32 node_id) { | ||
| 284 | if (dumping_frame) { | 288 | if (dumping_frame) { |
| 285 | LOG_DEBUG(Audio, | 289 | LOG_DEBUG(Audio, |
| 286 | "(DSP_TRACE) GenerateBiquadFilterCommand node_id={}, " | 290 | "(DSP_TRACE) GenerateBiquadFilterCommand node_id={}, " |
| @@ -714,7 +718,8 @@ s32 CommandGenerator::DecodePcm16(ServerVoiceInfo& voice_info, VoiceState& dsp_s | |||
| 714 | } | 718 | } |
| 715 | 719 | ||
| 716 | s32 CommandGenerator::DecodeAdpcm(ServerVoiceInfo& voice_info, VoiceState& dsp_state, | 720 | s32 CommandGenerator::DecodeAdpcm(ServerVoiceInfo& voice_info, VoiceState& dsp_state, |
| 717 | s32 sample_count, s32 channel, std::size_t mix_offset) { | 721 | s32 sample_count, [[maybe_unused]] s32 channel, |
| 722 | std::size_t mix_offset) { | ||
| 718 | const auto& in_params = voice_info.GetInParams(); | 723 | const auto& in_params = voice_info.GetInParams(); |
| 719 | const auto& wave_buffer = in_params.wave_buffer[dsp_state.wave_buffer_index]; | 724 | const auto& wave_buffer = in_params.wave_buffer[dsp_state.wave_buffer_index]; |
| 720 | if (wave_buffer.buffer_address == 0) { | 725 | if (wave_buffer.buffer_address == 0) { |
diff --git a/src/audio_core/command_generator.h b/src/audio_core/command_generator.h index 87ece00c4..b937350b1 100644 --- a/src/audio_core/command_generator.h +++ b/src/audio_core/command_generator.h | |||
| @@ -25,10 +25,10 @@ using MixVolumeBuffer = std::array<float, AudioCommon::MAX_MIX_BUFFERS>; | |||
| 25 | 25 | ||
| 26 | class CommandGenerator { | 26 | class CommandGenerator { |
| 27 | public: | 27 | public: |
| 28 | explicit CommandGenerator(AudioCommon::AudioRendererParameter& worker_params, | 28 | explicit CommandGenerator(AudioCommon::AudioRendererParameter& worker_params_, |
| 29 | VoiceContext& voice_context, MixContext& mix_context, | 29 | VoiceContext& voice_context_, MixContext& mix_context_, |
| 30 | SplitterContext& splitter_context, EffectContext& effect_context, | 30 | SplitterContext& splitter_context_, EffectContext& effect_context_, |
| 31 | Core::Memory::Memory& memory); | 31 | Core::Memory::Memory& memory_); |
| 32 | ~CommandGenerator(); | 32 | ~CommandGenerator(); |
| 33 | 33 | ||
| 34 | void ClearMixBuffers(); | 34 | void ClearMixBuffers(); |
diff --git a/src/audio_core/cubeb_sink.cpp b/src/audio_core/cubeb_sink.cpp index 6eaa60815..cf7b186e4 100644 --- a/src/audio_core/cubeb_sink.cpp +++ b/src/audio_core/cubeb_sink.cpp | |||
| @@ -21,10 +21,10 @@ namespace AudioCore { | |||
| 21 | 21 | ||
| 22 | class CubebSinkStream final : public SinkStream { | 22 | class CubebSinkStream final : public SinkStream { |
| 23 | public: | 23 | public: |
| 24 | CubebSinkStream(cubeb* ctx, u32 sample_rate, u32 num_channels_, cubeb_devid output_device, | 24 | CubebSinkStream(cubeb* ctx_, u32 sample_rate, u32 num_channels_, cubeb_devid output_device, |
| 25 | const std::string& name) | 25 | const std::string& name) |
| 26 | : ctx{ctx}, num_channels{std::min(num_channels_, 6u)}, time_stretch{sample_rate, | 26 | : ctx{ctx_}, num_channels{std::min(num_channels_, 6u)}, time_stretch{sample_rate, |
| 27 | num_channels} { | 27 | num_channels} { |
| 28 | 28 | ||
| 29 | cubeb_stream_params params{}; | 29 | cubeb_stream_params params{}; |
| 30 | params.rate = sample_rate; | 30 | params.rate = sample_rate; |
| @@ -192,8 +192,9 @@ SinkStream& CubebSink::AcquireSinkStream(u32 sample_rate, u32 num_channels, | |||
| 192 | return *sink_streams.back(); | 192 | return *sink_streams.back(); |
| 193 | } | 193 | } |
| 194 | 194 | ||
| 195 | long CubebSinkStream::DataCallback(cubeb_stream* stream, void* user_data, const void* input_buffer, | 195 | long CubebSinkStream::DataCallback([[maybe_unused]] cubeb_stream* stream, void* user_data, |
| 196 | void* output_buffer, long num_frames) { | 196 | [[maybe_unused]] const void* input_buffer, void* output_buffer, |
| 197 | long num_frames) { | ||
| 197 | auto* impl = static_cast<CubebSinkStream*>(user_data); | 198 | auto* impl = static_cast<CubebSinkStream*>(user_data); |
| 198 | auto* buffer = static_cast<u8*>(output_buffer); | 199 | auto* buffer = static_cast<u8*>(output_buffer); |
| 199 | 200 | ||
| @@ -236,7 +237,9 @@ long CubebSinkStream::DataCallback(cubeb_stream* stream, void* user_data, const | |||
| 236 | return num_frames; | 237 | return num_frames; |
| 237 | } | 238 | } |
| 238 | 239 | ||
| 239 | void CubebSinkStream::StateCallback(cubeb_stream* stream, void* user_data, cubeb_state state) {} | 240 | void CubebSinkStream::StateCallback([[maybe_unused]] cubeb_stream* stream, |
| 241 | [[maybe_unused]] void* user_data, | ||
| 242 | [[maybe_unused]] cubeb_state state) {} | ||
| 240 | 243 | ||
| 241 | std::vector<std::string> ListCubebSinkDevices() { | 244 | std::vector<std::string> ListCubebSinkDevices() { |
| 242 | std::vector<std::string> device_list; | 245 | std::vector<std::string> device_list; |
diff --git a/src/audio_core/effect_context.cpp b/src/audio_core/effect_context.cpp index 4d9cdf524..f770b9608 100644 --- a/src/audio_core/effect_context.cpp +++ b/src/audio_core/effect_context.cpp | |||
| @@ -12,7 +12,7 @@ bool ValidChannelCountForEffect(s32 channel_count) { | |||
| 12 | } | 12 | } |
| 13 | } // namespace | 13 | } // namespace |
| 14 | 14 | ||
| 15 | EffectContext::EffectContext(std::size_t effect_count) : effect_count(effect_count) { | 15 | EffectContext::EffectContext(std::size_t effect_count_) : effect_count(effect_count_) { |
| 16 | effects.reserve(effect_count); | 16 | effects.reserve(effect_count); |
| 17 | std::generate_n(std::back_inserter(effects), effect_count, | 17 | std::generate_n(std::back_inserter(effects), effect_count, |
| 18 | [] { return std::make_unique<EffectStubbed>(); }); | 18 | [] { return std::make_unique<EffectStubbed>(); }); |
| @@ -61,13 +61,13 @@ const EffectBase* EffectContext::GetInfo(std::size_t i) const { | |||
| 61 | return effects.at(i).get(); | 61 | return effects.at(i).get(); |
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | EffectStubbed::EffectStubbed() : EffectBase::EffectBase(EffectType::Invalid) {} | 64 | EffectStubbed::EffectStubbed() : EffectBase(EffectType::Invalid) {} |
| 65 | EffectStubbed::~EffectStubbed() = default; | 65 | EffectStubbed::~EffectStubbed() = default; |
| 66 | 66 | ||
| 67 | void EffectStubbed::Update(EffectInfo::InParams& in_params) {} | 67 | void EffectStubbed::Update([[maybe_unused]] EffectInfo::InParams& in_params) {} |
| 68 | void EffectStubbed::UpdateForCommandGeneration() {} | 68 | void EffectStubbed::UpdateForCommandGeneration() {} |
| 69 | 69 | ||
| 70 | EffectBase::EffectBase(EffectType effect_type) : effect_type(effect_type) {} | 70 | EffectBase::EffectBase(EffectType effect_type_) : effect_type(effect_type_) {} |
| 71 | EffectBase::~EffectBase() = default; | 71 | EffectBase::~EffectBase() = default; |
| 72 | 72 | ||
| 73 | UsageState EffectBase::GetUsage() const { | 73 | UsageState EffectBase::GetUsage() const { |
| @@ -90,32 +90,32 @@ s32 EffectBase::GetProcessingOrder() const { | |||
| 90 | return processing_order; | 90 | return processing_order; |
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | EffectI3dl2Reverb::EffectI3dl2Reverb() : EffectGeneric::EffectGeneric(EffectType::I3dl2Reverb) {} | 93 | EffectI3dl2Reverb::EffectI3dl2Reverb() : EffectGeneric(EffectType::I3dl2Reverb) {} |
| 94 | EffectI3dl2Reverb::~EffectI3dl2Reverb() = default; | 94 | EffectI3dl2Reverb::~EffectI3dl2Reverb() = default; |
| 95 | 95 | ||
| 96 | void EffectI3dl2Reverb::Update(EffectInfo::InParams& in_params) { | 96 | void EffectI3dl2Reverb::Update(EffectInfo::InParams& in_params) { |
| 97 | auto& internal_params = GetParams(); | 97 | auto& params = GetParams(); |
| 98 | const auto* reverb_params = reinterpret_cast<I3dl2ReverbParams*>(in_params.raw.data()); | 98 | const auto* reverb_params = reinterpret_cast<I3dl2ReverbParams*>(in_params.raw.data()); |
| 99 | if (!ValidChannelCountForEffect(reverb_params->max_channels)) { | 99 | if (!ValidChannelCountForEffect(reverb_params->max_channels)) { |
| 100 | UNREACHABLE_MSG("Invalid reverb max channel count {}", reverb_params->max_channels); | 100 | UNREACHABLE_MSG("Invalid reverb max channel count {}", reverb_params->max_channels); |
| 101 | return; | 101 | return; |
| 102 | } | 102 | } |
| 103 | 103 | ||
| 104 | const auto last_status = internal_params.status; | 104 | const auto last_status = params.status; |
| 105 | mix_id = in_params.mix_id; | 105 | mix_id = in_params.mix_id; |
| 106 | processing_order = in_params.processing_order; | 106 | processing_order = in_params.processing_order; |
| 107 | internal_params = *reverb_params; | 107 | params = *reverb_params; |
| 108 | if (!ValidChannelCountForEffect(reverb_params->channel_count)) { | 108 | if (!ValidChannelCountForEffect(reverb_params->channel_count)) { |
| 109 | internal_params.channel_count = internal_params.max_channels; | 109 | params.channel_count = params.max_channels; |
| 110 | } | 110 | } |
| 111 | enabled = in_params.is_enabled; | 111 | enabled = in_params.is_enabled; |
| 112 | if (last_status != ParameterStatus::Updated) { | 112 | if (last_status != ParameterStatus::Updated) { |
| 113 | internal_params.status = last_status; | 113 | params.status = last_status; |
| 114 | } | 114 | } |
| 115 | 115 | ||
| 116 | if (in_params.is_new || skipped) { | 116 | if (in_params.is_new || skipped) { |
| 117 | usage = UsageState::Initialized; | 117 | usage = UsageState::Initialized; |
| 118 | internal_params.status = ParameterStatus::Initialized; | 118 | params.status = ParameterStatus::Initialized; |
| 119 | skipped = in_params.buffer_address == 0 || in_params.buffer_size == 0; | 119 | skipped = in_params.buffer_address == 0 || in_params.buffer_size == 0; |
| 120 | } | 120 | } |
| 121 | } | 121 | } |
| @@ -129,15 +129,15 @@ void EffectI3dl2Reverb::UpdateForCommandGeneration() { | |||
| 129 | GetParams().status = ParameterStatus::Updated; | 129 | GetParams().status = ParameterStatus::Updated; |
| 130 | } | 130 | } |
| 131 | 131 | ||
| 132 | EffectBiquadFilter::EffectBiquadFilter() : EffectGeneric::EffectGeneric(EffectType::BiquadFilter) {} | 132 | EffectBiquadFilter::EffectBiquadFilter() : EffectGeneric(EffectType::BiquadFilter) {} |
| 133 | EffectBiquadFilter::~EffectBiquadFilter() = default; | 133 | EffectBiquadFilter::~EffectBiquadFilter() = default; |
| 134 | 134 | ||
| 135 | void EffectBiquadFilter::Update(EffectInfo::InParams& in_params) { | 135 | void EffectBiquadFilter::Update(EffectInfo::InParams& in_params) { |
| 136 | auto& internal_params = GetParams(); | 136 | auto& params = GetParams(); |
| 137 | const auto* biquad_params = reinterpret_cast<BiquadFilterParams*>(in_params.raw.data()); | 137 | const auto* biquad_params = reinterpret_cast<BiquadFilterParams*>(in_params.raw.data()); |
| 138 | mix_id = in_params.mix_id; | 138 | mix_id = in_params.mix_id; |
| 139 | processing_order = in_params.processing_order; | 139 | processing_order = in_params.processing_order; |
| 140 | internal_params = *biquad_params; | 140 | params = *biquad_params; |
| 141 | enabled = in_params.is_enabled; | 141 | enabled = in_params.is_enabled; |
| 142 | } | 142 | } |
| 143 | 143 | ||
| @@ -150,7 +150,7 @@ void EffectBiquadFilter::UpdateForCommandGeneration() { | |||
| 150 | GetParams().status = ParameterStatus::Updated; | 150 | GetParams().status = ParameterStatus::Updated; |
| 151 | } | 151 | } |
| 152 | 152 | ||
| 153 | EffectAuxInfo::EffectAuxInfo() : EffectGeneric::EffectGeneric(EffectType::Aux) {} | 153 | EffectAuxInfo::EffectAuxInfo() : EffectGeneric(EffectType::Aux) {} |
| 154 | EffectAuxInfo::~EffectAuxInfo() = default; | 154 | EffectAuxInfo::~EffectAuxInfo() = default; |
| 155 | 155 | ||
| 156 | void EffectAuxInfo::Update(EffectInfo::InParams& in_params) { | 156 | void EffectAuxInfo::Update(EffectInfo::InParams& in_params) { |
| @@ -200,32 +200,32 @@ VAddr EffectAuxInfo::GetRecvBuffer() const { | |||
| 200 | return recv_buffer; | 200 | return recv_buffer; |
| 201 | } | 201 | } |
| 202 | 202 | ||
| 203 | EffectDelay::EffectDelay() : EffectGeneric::EffectGeneric(EffectType::Delay) {} | 203 | EffectDelay::EffectDelay() : EffectGeneric(EffectType::Delay) {} |
| 204 | EffectDelay::~EffectDelay() = default; | 204 | EffectDelay::~EffectDelay() = default; |
| 205 | 205 | ||
| 206 | void EffectDelay::Update(EffectInfo::InParams& in_params) { | 206 | void EffectDelay::Update(EffectInfo::InParams& in_params) { |
| 207 | const auto* delay_params = reinterpret_cast<DelayParams*>(in_params.raw.data()); | 207 | const auto* delay_params = reinterpret_cast<DelayParams*>(in_params.raw.data()); |
| 208 | auto& internal_params = GetParams(); | 208 | auto& params = GetParams(); |
| 209 | if (!ValidChannelCountForEffect(delay_params->max_channels)) { | 209 | if (!ValidChannelCountForEffect(delay_params->max_channels)) { |
| 210 | return; | 210 | return; |
| 211 | } | 211 | } |
| 212 | 212 | ||
| 213 | const auto last_status = internal_params.status; | 213 | const auto last_status = params.status; |
| 214 | mix_id = in_params.mix_id; | 214 | mix_id = in_params.mix_id; |
| 215 | processing_order = in_params.processing_order; | 215 | processing_order = in_params.processing_order; |
| 216 | internal_params = *delay_params; | 216 | params = *delay_params; |
| 217 | if (!ValidChannelCountForEffect(delay_params->channels)) { | 217 | if (!ValidChannelCountForEffect(delay_params->channels)) { |
| 218 | internal_params.channels = internal_params.max_channels; | 218 | params.channels = params.max_channels; |
| 219 | } | 219 | } |
| 220 | enabled = in_params.is_enabled; | 220 | enabled = in_params.is_enabled; |
| 221 | 221 | ||
| 222 | if (last_status != ParameterStatus::Updated) { | 222 | if (last_status != ParameterStatus::Updated) { |
| 223 | internal_params.status = last_status; | 223 | params.status = last_status; |
| 224 | } | 224 | } |
| 225 | 225 | ||
| 226 | if (in_params.is_new || skipped) { | 226 | if (in_params.is_new || skipped) { |
| 227 | usage = UsageState::Initialized; | 227 | usage = UsageState::Initialized; |
| 228 | internal_params.status = ParameterStatus::Initialized; | 228 | params.status = ParameterStatus::Initialized; |
| 229 | skipped = in_params.buffer_address == 0 || in_params.buffer_size == 0; | 229 | skipped = in_params.buffer_address == 0 || in_params.buffer_size == 0; |
| 230 | } | 230 | } |
| 231 | } | 231 | } |
| @@ -239,7 +239,7 @@ void EffectDelay::UpdateForCommandGeneration() { | |||
| 239 | GetParams().status = ParameterStatus::Updated; | 239 | GetParams().status = ParameterStatus::Updated; |
| 240 | } | 240 | } |
| 241 | 241 | ||
| 242 | EffectBufferMixer::EffectBufferMixer() : EffectGeneric::EffectGeneric(EffectType::BufferMixer) {} | 242 | EffectBufferMixer::EffectBufferMixer() : EffectGeneric(EffectType::BufferMixer) {} |
| 243 | EffectBufferMixer::~EffectBufferMixer() = default; | 243 | EffectBufferMixer::~EffectBufferMixer() = default; |
| 244 | 244 | ||
| 245 | void EffectBufferMixer::Update(EffectInfo::InParams& in_params) { | 245 | void EffectBufferMixer::Update(EffectInfo::InParams& in_params) { |
| @@ -257,32 +257,32 @@ void EffectBufferMixer::UpdateForCommandGeneration() { | |||
| 257 | } | 257 | } |
| 258 | } | 258 | } |
| 259 | 259 | ||
| 260 | EffectReverb::EffectReverb() : EffectGeneric::EffectGeneric(EffectType::Reverb) {} | 260 | EffectReverb::EffectReverb() : EffectGeneric(EffectType::Reverb) {} |
| 261 | EffectReverb::~EffectReverb() = default; | 261 | EffectReverb::~EffectReverb() = default; |
| 262 | 262 | ||
| 263 | void EffectReverb::Update(EffectInfo::InParams& in_params) { | 263 | void EffectReverb::Update(EffectInfo::InParams& in_params) { |
| 264 | const auto* reverb_params = reinterpret_cast<ReverbParams*>(in_params.raw.data()); | 264 | const auto* reverb_params = reinterpret_cast<ReverbParams*>(in_params.raw.data()); |
| 265 | auto& internal_params = GetParams(); | 265 | auto& params = GetParams(); |
| 266 | if (!ValidChannelCountForEffect(reverb_params->max_channels)) { | 266 | if (!ValidChannelCountForEffect(reverb_params->max_channels)) { |
| 267 | return; | 267 | return; |
| 268 | } | 268 | } |
| 269 | 269 | ||
| 270 | const auto last_status = internal_params.status; | 270 | const auto last_status = params.status; |
| 271 | mix_id = in_params.mix_id; | 271 | mix_id = in_params.mix_id; |
| 272 | processing_order = in_params.processing_order; | 272 | processing_order = in_params.processing_order; |
| 273 | internal_params = *reverb_params; | 273 | params = *reverb_params; |
| 274 | if (!ValidChannelCountForEffect(reverb_params->channels)) { | 274 | if (!ValidChannelCountForEffect(reverb_params->channels)) { |
| 275 | internal_params.channels = internal_params.max_channels; | 275 | params.channels = params.max_channels; |
| 276 | } | 276 | } |
| 277 | enabled = in_params.is_enabled; | 277 | enabled = in_params.is_enabled; |
| 278 | 278 | ||
| 279 | if (last_status != ParameterStatus::Updated) { | 279 | if (last_status != ParameterStatus::Updated) { |
| 280 | internal_params.status = last_status; | 280 | params.status = last_status; |
| 281 | } | 281 | } |
| 282 | 282 | ||
| 283 | if (in_params.is_new || skipped) { | 283 | if (in_params.is_new || skipped) { |
| 284 | usage = UsageState::Initialized; | 284 | usage = UsageState::Initialized; |
| 285 | internal_params.status = ParameterStatus::Initialized; | 285 | params.status = ParameterStatus::Initialized; |
| 286 | skipped = in_params.buffer_address == 0 || in_params.buffer_size == 0; | 286 | skipped = in_params.buffer_address == 0 || in_params.buffer_size == 0; |
| 287 | } | 287 | } |
| 288 | } | 288 | } |
diff --git a/src/audio_core/effect_context.h b/src/audio_core/effect_context.h index 03c5a0f04..c5e0b398c 100644 --- a/src/audio_core/effect_context.h +++ b/src/audio_core/effect_context.h | |||
| @@ -184,7 +184,7 @@ struct AuxAddress { | |||
| 184 | 184 | ||
| 185 | class EffectBase { | 185 | class EffectBase { |
| 186 | public: | 186 | public: |
| 187 | explicit EffectBase(EffectType effect_type); | 187 | explicit EffectBase(EffectType effect_type_); |
| 188 | virtual ~EffectBase(); | 188 | virtual ~EffectBase(); |
| 189 | 189 | ||
| 190 | virtual void Update(EffectInfo::InParams& in_params) = 0; | 190 | virtual void Update(EffectInfo::InParams& in_params) = 0; |
| @@ -206,7 +206,7 @@ protected: | |||
| 206 | template <typename T> | 206 | template <typename T> |
| 207 | class EffectGeneric : public EffectBase { | 207 | class EffectGeneric : public EffectBase { |
| 208 | public: | 208 | public: |
| 209 | explicit EffectGeneric(EffectType effect_type) : EffectBase(effect_type) {} | 209 | explicit EffectGeneric(EffectType effect_type_) : EffectBase(effect_type_) {} |
| 210 | 210 | ||
| 211 | T& GetParams() { | 211 | T& GetParams() { |
| 212 | return internal_params; | 212 | return internal_params; |
| @@ -306,7 +306,7 @@ private: | |||
| 306 | 306 | ||
| 307 | class EffectContext { | 307 | class EffectContext { |
| 308 | public: | 308 | public: |
| 309 | explicit EffectContext(std::size_t effect_count); | 309 | explicit EffectContext(std::size_t effect_count_); |
| 310 | ~EffectContext(); | 310 | ~EffectContext(); |
| 311 | 311 | ||
| 312 | [[nodiscard]] std::size_t GetCount() const; | 312 | [[nodiscard]] std::size_t GetCount() const; |
diff --git a/src/audio_core/info_updater.cpp b/src/audio_core/info_updater.cpp index 2940e53a9..d3ac90827 100644 --- a/src/audio_core/info_updater.cpp +++ b/src/audio_core/info_updater.cpp | |||
| @@ -14,9 +14,9 @@ | |||
| 14 | 14 | ||
| 15 | namespace AudioCore { | 15 | namespace AudioCore { |
| 16 | 16 | ||
| 17 | InfoUpdater::InfoUpdater(const std::vector<u8>& in_params, std::vector<u8>& out_params, | 17 | InfoUpdater::InfoUpdater(const std::vector<u8>& in_params_, std::vector<u8>& out_params_, |
| 18 | BehaviorInfo& behavior_info) | 18 | BehaviorInfo& behavior_info_) |
| 19 | : in_params(in_params), out_params(out_params), behavior_info(behavior_info) { | 19 | : in_params(in_params_), out_params(out_params_), behavior_info(behavior_info_) { |
| 20 | ASSERT( | 20 | ASSERT( |
| 21 | AudioCommon::CanConsumeBuffer(in_params.size(), 0, sizeof(AudioCommon::UpdateDataHeader))); | 21 | AudioCommon::CanConsumeBuffer(in_params.size(), 0, sizeof(AudioCommon::UpdateDataHeader))); |
| 22 | std::memcpy(&input_header, in_params.data(), sizeof(AudioCommon::UpdateDataHeader)); | 22 | std::memcpy(&input_header, in_params.data(), sizeof(AudioCommon::UpdateDataHeader)); |
| @@ -135,8 +135,8 @@ bool InfoUpdater::UpdateVoiceChannelResources(VoiceContext& voice_context) { | |||
| 135 | } | 135 | } |
| 136 | 136 | ||
| 137 | bool InfoUpdater::UpdateVoices(VoiceContext& voice_context, | 137 | bool InfoUpdater::UpdateVoices(VoiceContext& voice_context, |
| 138 | std::vector<ServerMemoryPoolInfo>& memory_pool_info, | 138 | [[maybe_unused]] std::vector<ServerMemoryPoolInfo>& memory_pool_info, |
| 139 | VAddr audio_codec_dsp_addr) { | 139 | [[maybe_unused]] VAddr audio_codec_dsp_addr) { |
| 140 | const auto voice_count = voice_context.GetVoiceCount(); | 140 | const auto voice_count = voice_context.GetVoiceCount(); |
| 141 | std::vector<VoiceInfo::InParams> voice_in(voice_count); | 141 | std::vector<VoiceInfo::InParams> voice_in(voice_count); |
| 142 | std::vector<VoiceInfo::OutParams> voice_out(voice_count); | 142 | std::vector<VoiceInfo::OutParams> voice_out(voice_count); |
| @@ -165,28 +165,28 @@ bool InfoUpdater::UpdateVoices(VoiceContext& voice_context, | |||
| 165 | 165 | ||
| 166 | // Update our voices | 166 | // Update our voices |
| 167 | for (std::size_t i = 0; i < voice_count; i++) { | 167 | for (std::size_t i = 0; i < voice_count; i++) { |
| 168 | auto& in_params = voice_in[i]; | 168 | auto& voice_in_params = voice_in[i]; |
| 169 | const auto channel_count = static_cast<std::size_t>(in_params.channel_count); | 169 | const auto channel_count = static_cast<std::size_t>(voice_in_params.channel_count); |
| 170 | // Skip if it's not currently in use | 170 | // Skip if it's not currently in use |
| 171 | if (!in_params.is_in_use) { | 171 | if (!voice_in_params.is_in_use) { |
| 172 | continue; | 172 | continue; |
| 173 | } | 173 | } |
| 174 | // Voice states for each channel | 174 | // Voice states for each channel |
| 175 | std::array<VoiceState*, AudioCommon::MAX_CHANNEL_COUNT> voice_states{}; | 175 | std::array<VoiceState*, AudioCommon::MAX_CHANNEL_COUNT> voice_states{}; |
| 176 | ASSERT(static_cast<std::size_t>(in_params.id) < voice_count); | 176 | ASSERT(static_cast<std::size_t>(voice_in_params.id) < voice_count); |
| 177 | 177 | ||
| 178 | // Grab our current voice info | 178 | // Grab our current voice info |
| 179 | auto& voice_info = voice_context.GetInfo(static_cast<std::size_t>(in_params.id)); | 179 | auto& voice_info = voice_context.GetInfo(static_cast<std::size_t>(voice_in_params.id)); |
| 180 | 180 | ||
| 181 | ASSERT(channel_count <= AudioCommon::MAX_CHANNEL_COUNT); | 181 | ASSERT(channel_count <= AudioCommon::MAX_CHANNEL_COUNT); |
| 182 | 182 | ||
| 183 | // Get all our channel voice states | 183 | // Get all our channel voice states |
| 184 | for (std::size_t channel = 0; channel < channel_count; channel++) { | 184 | for (std::size_t channel = 0; channel < channel_count; channel++) { |
| 185 | voice_states[channel] = | 185 | voice_states[channel] = |
| 186 | &voice_context.GetState(in_params.voice_channel_resource_ids[channel]); | 186 | &voice_context.GetState(voice_in_params.voice_channel_resource_ids[channel]); |
| 187 | } | 187 | } |
| 188 | 188 | ||
| 189 | if (in_params.is_new) { | 189 | if (voice_in_params.is_new) { |
| 190 | // Default our values for our voice | 190 | // Default our values for our voice |
| 191 | voice_info.Initialize(); | 191 | voice_info.Initialize(); |
| 192 | if (channel_count == 0 || channel_count > AudioCommon::MAX_CHANNEL_COUNT) { | 192 | if (channel_count == 0 || channel_count > AudioCommon::MAX_CHANNEL_COUNT) { |
| @@ -200,12 +200,12 @@ bool InfoUpdater::UpdateVoices(VoiceContext& voice_context, | |||
| 200 | } | 200 | } |
| 201 | 201 | ||
| 202 | // Update our voice | 202 | // Update our voice |
| 203 | voice_info.UpdateParameters(in_params, behavior_info); | 203 | voice_info.UpdateParameters(voice_in_params, behavior_info); |
| 204 | // TODO(ogniK): Handle mapping errors with behavior info based on in params response | 204 | // TODO(ogniK): Handle mapping errors with behavior info based on in params response |
| 205 | 205 | ||
| 206 | // Update our wave buffers | 206 | // Update our wave buffers |
| 207 | voice_info.UpdateWaveBuffers(in_params, voice_states, behavior_info); | 207 | voice_info.UpdateWaveBuffers(voice_in_params, voice_states, behavior_info); |
| 208 | voice_info.WriteOutStatus(voice_out[i], in_params, voice_states); | 208 | voice_info.WriteOutStatus(voice_out[i], voice_in_params, voice_states); |
| 209 | } | 209 | } |
| 210 | 210 | ||
| 211 | if (!AudioCommon::CanConsumeBuffer(out_params.size(), output_offset, voice_out_size)) { | 211 | if (!AudioCommon::CanConsumeBuffer(out_params.size(), output_offset, voice_out_size)) { |
| @@ -445,7 +445,7 @@ bool InfoUpdater::UpdatePerformanceBuffer() { | |||
| 445 | return true; | 445 | return true; |
| 446 | } | 446 | } |
| 447 | 447 | ||
| 448 | bool InfoUpdater::UpdateErrorInfo(BehaviorInfo& in_behavior_info) { | 448 | bool InfoUpdater::UpdateErrorInfo([[maybe_unused]] BehaviorInfo& in_behavior_info) { |
| 449 | const auto total_beahvior_info_out = sizeof(BehaviorInfo::OutParams); | 449 | const auto total_beahvior_info_out = sizeof(BehaviorInfo::OutParams); |
| 450 | 450 | ||
| 451 | if (!AudioCommon::CanConsumeBuffer(out_params.size(), output_offset, total_beahvior_info_out)) { | 451 | if (!AudioCommon::CanConsumeBuffer(out_params.size(), output_offset, total_beahvior_info_out)) { |
diff --git a/src/audio_core/info_updater.h b/src/audio_core/info_updater.h index 06f9d770f..d315c91ed 100644 --- a/src/audio_core/info_updater.h +++ b/src/audio_core/info_updater.h | |||
| @@ -21,8 +21,8 @@ class SplitterContext; | |||
| 21 | class InfoUpdater { | 21 | class InfoUpdater { |
| 22 | public: | 22 | public: |
| 23 | // TODO(ogniK): Pass process handle when we support it | 23 | // TODO(ogniK): Pass process handle when we support it |
| 24 | InfoUpdater(const std::vector<u8>& in_params, std::vector<u8>& out_params, | 24 | InfoUpdater(const std::vector<u8>& in_params_, std::vector<u8>& out_params_, |
| 25 | BehaviorInfo& behavior_info); | 25 | BehaviorInfo& behavior_info_); |
| 26 | ~InfoUpdater(); | 26 | ~InfoUpdater(); |
| 27 | 27 | ||
| 28 | bool UpdateBehaviorInfo(BehaviorInfo& in_behavior_info); | 28 | bool UpdateBehaviorInfo(BehaviorInfo& in_behavior_info); |
diff --git a/src/audio_core/memory_pool.cpp b/src/audio_core/memory_pool.cpp index 5a3453063..6b6908d26 100644 --- a/src/audio_core/memory_pool.cpp +++ b/src/audio_core/memory_pool.cpp | |||
| @@ -10,11 +10,10 @@ namespace AudioCore { | |||
| 10 | 10 | ||
| 11 | ServerMemoryPoolInfo::ServerMemoryPoolInfo() = default; | 11 | ServerMemoryPoolInfo::ServerMemoryPoolInfo() = default; |
| 12 | ServerMemoryPoolInfo::~ServerMemoryPoolInfo() = default; | 12 | ServerMemoryPoolInfo::~ServerMemoryPoolInfo() = default; |
| 13 | bool ServerMemoryPoolInfo::Update(const ServerMemoryPoolInfo::InParams& in_params, | 13 | |
| 14 | ServerMemoryPoolInfo::OutParams& out_params) { | 14 | bool ServerMemoryPoolInfo::Update(const InParams& in_params, OutParams& out_params) { |
| 15 | // Our state does not need to be changed | 15 | // Our state does not need to be changed |
| 16 | if (in_params.state != ServerMemoryPoolInfo::State::RequestAttach && | 16 | if (in_params.state != State::RequestAttach && in_params.state != State::RequestDetach) { |
| 17 | in_params.state != ServerMemoryPoolInfo::State::RequestDetach) { | ||
| 18 | return true; | 17 | return true; |
| 19 | } | 18 | } |
| 20 | 19 | ||
| @@ -32,11 +31,11 @@ bool ServerMemoryPoolInfo::Update(const ServerMemoryPoolInfo::InParams& in_param | |||
| 32 | return false; | 31 | return false; |
| 33 | } | 32 | } |
| 34 | 33 | ||
| 35 | if (in_params.state == ServerMemoryPoolInfo::State::RequestAttach) { | 34 | if (in_params.state == State::RequestAttach) { |
| 36 | cpu_address = in_params.address; | 35 | cpu_address = in_params.address; |
| 37 | size = in_params.size; | 36 | size = in_params.size; |
| 38 | used = true; | 37 | used = true; |
| 39 | out_params.state = ServerMemoryPoolInfo::State::Attached; | 38 | out_params.state = State::Attached; |
| 40 | } else { | 39 | } else { |
| 41 | // Unexpected address | 40 | // Unexpected address |
| 42 | if (cpu_address != in_params.address) { | 41 | if (cpu_address != in_params.address) { |
| @@ -54,7 +53,7 @@ bool ServerMemoryPoolInfo::Update(const ServerMemoryPoolInfo::InParams& in_param | |||
| 54 | cpu_address = 0; | 53 | cpu_address = 0; |
| 55 | size = 0; | 54 | size = 0; |
| 56 | used = false; | 55 | used = false; |
| 57 | out_params.state = ServerMemoryPoolInfo::State::Detached; | 56 | out_params.state = State::Detached; |
| 58 | } | 57 | } |
| 59 | return true; | 58 | return true; |
| 60 | } | 59 | } |
diff --git a/src/audio_core/memory_pool.h b/src/audio_core/memory_pool.h index 8ac503f1c..3e9e777ae 100644 --- a/src/audio_core/memory_pool.h +++ b/src/audio_core/memory_pool.h | |||
| @@ -28,19 +28,18 @@ public: | |||
| 28 | struct InParams { | 28 | struct InParams { |
| 29 | u64_le address{}; | 29 | u64_le address{}; |
| 30 | u64_le size{}; | 30 | u64_le size{}; |
| 31 | ServerMemoryPoolInfo::State state{}; | 31 | State state{}; |
| 32 | INSERT_PADDING_WORDS(3); | 32 | INSERT_PADDING_WORDS(3); |
| 33 | }; | 33 | }; |
| 34 | static_assert(sizeof(ServerMemoryPoolInfo::InParams) == 0x20, "InParams are an invalid size"); | 34 | static_assert(sizeof(InParams) == 0x20, "InParams are an invalid size"); |
| 35 | 35 | ||
| 36 | struct OutParams { | 36 | struct OutParams { |
| 37 | ServerMemoryPoolInfo::State state{}; | 37 | State state{}; |
| 38 | INSERT_PADDING_WORDS(3); | 38 | INSERT_PADDING_WORDS(3); |
| 39 | }; | 39 | }; |
| 40 | static_assert(sizeof(ServerMemoryPoolInfo::OutParams) == 0x10, "OutParams are an invalid size"); | 40 | static_assert(sizeof(OutParams) == 0x10, "OutParams are an invalid size"); |
| 41 | 41 | ||
| 42 | bool Update(const ServerMemoryPoolInfo::InParams& in_params, | 42 | bool Update(const InParams& in_params, OutParams& out_params); |
| 43 | ServerMemoryPoolInfo::OutParams& out_params); | ||
| 44 | 43 | ||
| 45 | private: | 44 | private: |
| 46 | // There's another entry here which is the DSP address, however since we're not talking to the | 45 | // There's another entry here which is the DSP address, however since we're not talking to the |
diff --git a/src/audio_core/sink_context.cpp b/src/audio_core/sink_context.cpp index b29b47890..a69543696 100644 --- a/src/audio_core/sink_context.cpp +++ b/src/audio_core/sink_context.cpp | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | #include "audio_core/sink_context.h" | 5 | #include "audio_core/sink_context.h" |
| 6 | 6 | ||
| 7 | namespace AudioCore { | 7 | namespace AudioCore { |
| 8 | SinkContext::SinkContext(std::size_t sink_count) : sink_count(sink_count) {} | 8 | SinkContext::SinkContext(std::size_t sink_count_) : sink_count{sink_count_} {} |
| 9 | SinkContext::~SinkContext() = default; | 9 | SinkContext::~SinkContext() = default; |
| 10 | 10 | ||
| 11 | std::size_t SinkContext::GetCount() const { | 11 | std::size_t SinkContext::GetCount() const { |
diff --git a/src/audio_core/sink_context.h b/src/audio_core/sink_context.h index e2e7880b7..05541becb 100644 --- a/src/audio_core/sink_context.h +++ b/src/audio_core/sink_context.h | |||
| @@ -42,7 +42,7 @@ public: | |||
| 42 | bool in_use; | 42 | bool in_use; |
| 43 | INSERT_UNION_PADDING_BYTES(5); | 43 | INSERT_UNION_PADDING_BYTES(5); |
| 44 | }; | 44 | }; |
| 45 | static_assert(sizeof(SinkInfo::CircularBufferIn) == 0x28, | 45 | static_assert(sizeof(CircularBufferIn) == 0x28, |
| 46 | "SinkInfo::CircularBufferIn is in invalid size"); | 46 | "SinkInfo::CircularBufferIn is in invalid size"); |
| 47 | 47 | ||
| 48 | struct DeviceIn { | 48 | struct DeviceIn { |
| @@ -54,7 +54,7 @@ public: | |||
| 54 | bool down_matrix_enabled; | 54 | bool down_matrix_enabled; |
| 55 | DownmixCoefficients down_matrix_coef; | 55 | DownmixCoefficients down_matrix_coef; |
| 56 | }; | 56 | }; |
| 57 | static_assert(sizeof(SinkInfo::DeviceIn) == 0x11c, "SinkInfo::DeviceIn is an invalid size"); | 57 | static_assert(sizeof(DeviceIn) == 0x11c, "SinkInfo::DeviceIn is an invalid size"); |
| 58 | 58 | ||
| 59 | struct InParams { | 59 | struct InParams { |
| 60 | SinkTypes type{}; | 60 | SinkTypes type{}; |
| @@ -64,16 +64,16 @@ public: | |||
| 64 | INSERT_PADDING_WORDS(6); | 64 | INSERT_PADDING_WORDS(6); |
| 65 | union { | 65 | union { |
| 66 | // std::array<u8, 0x120> raw{}; | 66 | // std::array<u8, 0x120> raw{}; |
| 67 | SinkInfo::DeviceIn device; | 67 | DeviceIn device; |
| 68 | SinkInfo::CircularBufferIn circular_buffer; | 68 | CircularBufferIn circular_buffer; |
| 69 | }; | 69 | }; |
| 70 | }; | 70 | }; |
| 71 | static_assert(sizeof(SinkInfo::InParams) == 0x140, "SinkInfo::InParams are an invalid size!"); | 71 | static_assert(sizeof(InParams) == 0x140, "SinkInfo::InParams are an invalid size!"); |
| 72 | }; | 72 | }; |
| 73 | 73 | ||
| 74 | class SinkContext { | 74 | class SinkContext { |
| 75 | public: | 75 | public: |
| 76 | explicit SinkContext(std::size_t sink_count); | 76 | explicit SinkContext(std::size_t sink_count_); |
| 77 | ~SinkContext(); | 77 | ~SinkContext(); |
| 78 | 78 | ||
| 79 | [[nodiscard]] std::size_t GetCount() const; | 79 | [[nodiscard]] std::size_t GetCount() const; |
diff --git a/src/audio_core/splitter_context.cpp b/src/audio_core/splitter_context.cpp index f21b53147..f4bcd0391 100644 --- a/src/audio_core/splitter_context.cpp +++ b/src/audio_core/splitter_context.cpp | |||
| @@ -10,7 +10,7 @@ | |||
| 10 | 10 | ||
| 11 | namespace AudioCore { | 11 | namespace AudioCore { |
| 12 | 12 | ||
| 13 | ServerSplitterDestinationData::ServerSplitterDestinationData(s32 id) : id(id) {} | 13 | ServerSplitterDestinationData::ServerSplitterDestinationData(s32 id_) : id{id_} {} |
| 14 | ServerSplitterDestinationData::~ServerSplitterDestinationData() = default; | 14 | ServerSplitterDestinationData::~ServerSplitterDestinationData() = default; |
| 15 | 15 | ||
| 16 | void ServerSplitterDestinationData::Update(SplitterInfo::InDestinationParams& header) { | 16 | void ServerSplitterDestinationData::Update(SplitterInfo::InDestinationParams& header) { |
| @@ -87,7 +87,7 @@ void ServerSplitterDestinationData::UpdateInternalState() { | |||
| 87 | needs_update = false; | 87 | needs_update = false; |
| 88 | } | 88 | } |
| 89 | 89 | ||
| 90 | ServerSplitterInfo::ServerSplitterInfo(s32 id) : id(id) {} | 90 | ServerSplitterInfo::ServerSplitterInfo(s32 id_) : id(id_) {} |
| 91 | ServerSplitterInfo::~ServerSplitterInfo() = default; | 91 | ServerSplitterInfo::~ServerSplitterInfo() = default; |
| 92 | 92 | ||
| 93 | void ServerSplitterInfo::InitializeInfos() { | 93 | void ServerSplitterInfo::InitializeInfos() { |
| @@ -121,7 +121,7 @@ const ServerSplitterDestinationData* ServerSplitterInfo::GetHead() const { | |||
| 121 | } | 121 | } |
| 122 | 122 | ||
| 123 | ServerSplitterDestinationData* ServerSplitterInfo::GetData(std::size_t depth) { | 123 | ServerSplitterDestinationData* ServerSplitterInfo::GetData(std::size_t depth) { |
| 124 | auto current_head = head; | 124 | auto* current_head = head; |
| 125 | for (std::size_t i = 0; i < depth; i++) { | 125 | for (std::size_t i = 0; i < depth; i++) { |
| 126 | if (current_head == nullptr) { | 126 | if (current_head == nullptr) { |
| 127 | return nullptr; | 127 | return nullptr; |
| @@ -132,7 +132,7 @@ ServerSplitterDestinationData* ServerSplitterInfo::GetData(std::size_t depth) { | |||
| 132 | } | 132 | } |
| 133 | 133 | ||
| 134 | const ServerSplitterDestinationData* ServerSplitterInfo::GetData(std::size_t depth) const { | 134 | const ServerSplitterDestinationData* ServerSplitterInfo::GetData(std::size_t depth) const { |
| 135 | auto current_head = head; | 135 | auto* current_head = head; |
| 136 | for (std::size_t i = 0; i < depth; i++) { | 136 | for (std::size_t i = 0; i < depth; i++) { |
| 137 | if (current_head == nullptr) { | 137 | if (current_head == nullptr) { |
| 138 | return nullptr; | 138 | return nullptr; |
| @@ -245,7 +245,7 @@ ServerSplitterDestinationData* SplitterContext::GetDestinationData(std::size_t i | |||
| 245 | const ServerSplitterDestinationData* SplitterContext::GetDestinationData(std::size_t info, | 245 | const ServerSplitterDestinationData* SplitterContext::GetDestinationData(std::size_t info, |
| 246 | std::size_t data) const { | 246 | std::size_t data) const { |
| 247 | ASSERT(info < info_count); | 247 | ASSERT(info < info_count); |
| 248 | auto& cur_info = GetInfo(info); | 248 | const auto& cur_info = GetInfo(info); |
| 249 | return cur_info.GetData(data); | 249 | return cur_info.GetData(data); |
| 250 | } | 250 | } |
| 251 | 251 | ||
| @@ -267,11 +267,11 @@ std::size_t SplitterContext::GetDataCount() const { | |||
| 267 | return data_count; | 267 | return data_count; |
| 268 | } | 268 | } |
| 269 | 269 | ||
| 270 | void SplitterContext::Setup(std::size_t _info_count, std::size_t _data_count, | 270 | void SplitterContext::Setup(std::size_t info_count_, std::size_t data_count_, |
| 271 | bool is_splitter_bug_fixed) { | 271 | bool is_splitter_bug_fixed) { |
| 272 | 272 | ||
| 273 | info_count = _info_count; | 273 | info_count = info_count_; |
| 274 | data_count = _data_count; | 274 | data_count = data_count_; |
| 275 | 275 | ||
| 276 | for (std::size_t i = 0; i < info_count; i++) { | 276 | for (std::size_t i = 0; i < info_count; i++) { |
| 277 | auto& splitter = infos.emplace_back(static_cast<s32>(i)); | 277 | auto& splitter = infos.emplace_back(static_cast<s32>(i)); |
| @@ -364,7 +364,7 @@ bool SplitterContext::RecomposeDestination(ServerSplitterInfo& info, | |||
| 364 | // Clear our current destinations | 364 | // Clear our current destinations |
| 365 | auto* current_head = info.GetHead(); | 365 | auto* current_head = info.GetHead(); |
| 366 | while (current_head != nullptr) { | 366 | while (current_head != nullptr) { |
| 367 | auto next_head = current_head->GetNextDestination(); | 367 | auto* next_head = current_head->GetNextDestination(); |
| 368 | current_head->SetNextDestination(nullptr); | 368 | current_head->SetNextDestination(nullptr); |
| 369 | current_head = next_head; | 369 | current_head = next_head; |
| 370 | } | 370 | } |
| @@ -471,8 +471,8 @@ bool NodeStates::DepthFirstSearch(EdgeMatrix& edge_matrix) { | |||
| 471 | continue; | 471 | continue; |
| 472 | } | 472 | } |
| 473 | 473 | ||
| 474 | const auto node_count = edge_matrix.GetNodeCount(); | 474 | const auto edge_node_count = edge_matrix.GetNodeCount(); |
| 475 | for (s32 j = 0; j < static_cast<s32>(node_count); j++) { | 475 | for (s32 j = 0; j < static_cast<s32>(edge_node_count); j++) { |
| 476 | // Check if our node is connected to our edge matrix | 476 | // Check if our node is connected to our edge matrix |
| 477 | if (!edge_matrix.Connected(current_stack_index, j)) { | 477 | if (!edge_matrix.Connected(current_stack_index, j)) { |
| 478 | continue; | 478 | continue; |
diff --git a/src/audio_core/splitter_context.h b/src/audio_core/splitter_context.h index ea6239fdb..b490627f5 100644 --- a/src/audio_core/splitter_context.h +++ b/src/audio_core/splitter_context.h | |||
| @@ -63,7 +63,7 @@ public: | |||
| 63 | NodeStates(); | 63 | NodeStates(); |
| 64 | ~NodeStates(); | 64 | ~NodeStates(); |
| 65 | 65 | ||
| 66 | void Initialize(std::size_t _node_count); | 66 | void Initialize(std::size_t node_count_); |
| 67 | bool Tsort(EdgeMatrix& edge_matrix); | 67 | bool Tsort(EdgeMatrix& edge_matrix); |
| 68 | std::size_t GetIndexPos() const; | 68 | std::size_t GetIndexPos() const; |
| 69 | const std::vector<s32>& GetIndexList() const; | 69 | const std::vector<s32>& GetIndexList() const; |
| @@ -72,15 +72,15 @@ private: | |||
| 72 | void PushTsortResult(s32 index); | 72 | void PushTsortResult(s32 index); |
| 73 | bool DepthFirstSearch(EdgeMatrix& edge_matrix); | 73 | bool DepthFirstSearch(EdgeMatrix& edge_matrix); |
| 74 | void ResetState(); | 74 | void ResetState(); |
| 75 | void UpdateState(NodeStates::State state, std::size_t i); | 75 | void UpdateState(State state, std::size_t i); |
| 76 | NodeStates::State GetState(std::size_t i); | 76 | State GetState(std::size_t i); |
| 77 | 77 | ||
| 78 | std::size_t node_count{}; | 78 | std::size_t node_count{}; |
| 79 | std::vector<bool> was_node_found{}; | 79 | std::vector<bool> was_node_found{}; |
| 80 | std::vector<bool> was_node_completed{}; | 80 | std::vector<bool> was_node_completed{}; |
| 81 | std::size_t index_pos{}; | 81 | std::size_t index_pos{}; |
| 82 | std::vector<s32> index_list{}; | 82 | std::vector<s32> index_list{}; |
| 83 | NodeStates::Stack index_stack{}; | 83 | Stack index_stack{}; |
| 84 | }; | 84 | }; |
| 85 | 85 | ||
| 86 | enum class SplitterMagic : u32_le { | 86 | enum class SplitterMagic : u32_le { |
| @@ -97,8 +97,7 @@ public: | |||
| 97 | s32_le data_count{}; | 97 | s32_le data_count{}; |
| 98 | INSERT_PADDING_WORDS(5); | 98 | INSERT_PADDING_WORDS(5); |
| 99 | }; | 99 | }; |
| 100 | static_assert(sizeof(SplitterInfo::InHeader) == 0x20, | 100 | static_assert(sizeof(InHeader) == 0x20, "SplitterInfo::InHeader is an invalid size"); |
| 101 | "SplitterInfo::InHeader is an invalid size"); | ||
| 102 | 101 | ||
| 103 | struct InInfoPrams { | 102 | struct InInfoPrams { |
| 104 | SplitterMagic magic{}; | 103 | SplitterMagic magic{}; |
| @@ -107,8 +106,7 @@ public: | |||
| 107 | s32_le length{}; | 106 | s32_le length{}; |
| 108 | s32_le resource_id_base{}; | 107 | s32_le resource_id_base{}; |
| 109 | }; | 108 | }; |
| 110 | static_assert(sizeof(SplitterInfo::InInfoPrams) == 0x14, | 109 | static_assert(sizeof(InInfoPrams) == 0x14, "SplitterInfo::InInfoPrams is an invalid size"); |
| 111 | "SplitterInfo::InInfoPrams is an invalid size"); | ||
| 112 | 110 | ||
| 113 | struct InDestinationParams { | 111 | struct InDestinationParams { |
| 114 | SplitterMagic magic{}; | 112 | SplitterMagic magic{}; |
| @@ -118,13 +116,13 @@ public: | |||
| 118 | bool in_use{}; | 116 | bool in_use{}; |
| 119 | INSERT_PADDING_BYTES(3); | 117 | INSERT_PADDING_BYTES(3); |
| 120 | }; | 118 | }; |
| 121 | static_assert(sizeof(SplitterInfo::InDestinationParams) == 0x70, | 119 | static_assert(sizeof(InDestinationParams) == 0x70, |
| 122 | "SplitterInfo::InDestinationParams is an invalid size"); | 120 | "SplitterInfo::InDestinationParams is an invalid size"); |
| 123 | }; | 121 | }; |
| 124 | 122 | ||
| 125 | class ServerSplitterDestinationData { | 123 | class ServerSplitterDestinationData { |
| 126 | public: | 124 | public: |
| 127 | explicit ServerSplitterDestinationData(s32 id); | 125 | explicit ServerSplitterDestinationData(s32 id_); |
| 128 | ~ServerSplitterDestinationData(); | 126 | ~ServerSplitterDestinationData(); |
| 129 | 127 | ||
| 130 | void Update(SplitterInfo::InDestinationParams& header); | 128 | void Update(SplitterInfo::InDestinationParams& header); |
| @@ -153,7 +151,7 @@ private: | |||
| 153 | 151 | ||
| 154 | class ServerSplitterInfo { | 152 | class ServerSplitterInfo { |
| 155 | public: | 153 | public: |
| 156 | explicit ServerSplitterInfo(s32 id); | 154 | explicit ServerSplitterInfo(s32 id_); |
| 157 | ~ServerSplitterInfo(); | 155 | ~ServerSplitterInfo(); |
| 158 | 156 | ||
| 159 | void InitializeInfos(); | 157 | void InitializeInfos(); |
diff --git a/src/audio_core/stream.cpp b/src/audio_core/stream.cpp index 41bc2f4d6..eca296589 100644 --- a/src/audio_core/stream.cpp +++ b/src/audio_core/stream.cpp | |||
| @@ -31,10 +31,10 @@ u32 Stream::GetNumChannels() const { | |||
| 31 | return {}; | 31 | return {}; |
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | Stream::Stream(Core::Timing::CoreTiming& core_timing, u32 sample_rate, Format format, | 34 | Stream::Stream(Core::Timing::CoreTiming& core_timing_, u32 sample_rate_, Format format_, |
| 35 | ReleaseCallback&& release_callback, SinkStream& sink_stream, std::string&& name_) | 35 | ReleaseCallback&& release_callback_, SinkStream& sink_stream_, std::string&& name_) |
| 36 | : sample_rate{sample_rate}, format{format}, release_callback{std::move(release_callback)}, | 36 | : sample_rate{sample_rate_}, format{format_}, release_callback{std::move(release_callback_)}, |
| 37 | sink_stream{sink_stream}, core_timing{core_timing}, name{std::move(name_)} { | 37 | sink_stream{sink_stream_}, core_timing{core_timing_}, name{std::move(name_)} { |
| 38 | release_event = | 38 | release_event = |
| 39 | Core::Timing::CreateEvent(name, [this](std::uintptr_t, std::chrono::nanoseconds ns_late) { | 39 | Core::Timing::CreateEvent(name, [this](std::uintptr_t, std::chrono::nanoseconds ns_late) { |
| 40 | ReleaseActiveBuffer(ns_late); | 40 | ReleaseActiveBuffer(ns_late); |
| @@ -122,7 +122,7 @@ bool Stream::QueueBuffer(BufferPtr&& buffer) { | |||
| 122 | return false; | 122 | return false; |
| 123 | } | 123 | } |
| 124 | 124 | ||
| 125 | bool Stream::ContainsBuffer(Buffer::Tag tag) const { | 125 | bool Stream::ContainsBuffer([[maybe_unused]] Buffer::Tag tag) const { |
| 126 | UNIMPLEMENTED(); | 126 | UNIMPLEMENTED(); |
| 127 | return {}; | 127 | return {}; |
| 128 | } | 128 | } |
diff --git a/src/audio_core/stream.h b/src/audio_core/stream.h index 71c2d0b4f..506ac536b 100644 --- a/src/audio_core/stream.h +++ b/src/audio_core/stream.h | |||
| @@ -44,8 +44,8 @@ public: | |||
| 44 | /// Callback function type, used to change guest state on a buffer being released | 44 | /// Callback function type, used to change guest state on a buffer being released |
| 45 | using ReleaseCallback = std::function<void()>; | 45 | using ReleaseCallback = std::function<void()>; |
| 46 | 46 | ||
| 47 | Stream(Core::Timing::CoreTiming& core_timing, u32 sample_rate, Format format, | 47 | Stream(Core::Timing::CoreTiming& core_timing_, u32 sample_rate_, Format format_, |
| 48 | ReleaseCallback&& release_callback, SinkStream& sink_stream, std::string&& name_); | 48 | ReleaseCallback&& release_callback_, SinkStream& sink_stream_, std::string&& name_); |
| 49 | 49 | ||
| 50 | /// Plays the audio stream | 50 | /// Plays the audio stream |
| 51 | void Play(); | 51 | void Play(); |
diff --git a/src/audio_core/voice_context.cpp b/src/audio_core/voice_context.cpp index c46ee55f1..867b8fc6b 100644 --- a/src/audio_core/voice_context.cpp +++ b/src/audio_core/voice_context.cpp | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | 8 | ||
| 9 | namespace AudioCore { | 9 | namespace AudioCore { |
| 10 | 10 | ||
| 11 | ServerVoiceChannelResource::ServerVoiceChannelResource(s32 id) : id(id) {} | 11 | ServerVoiceChannelResource::ServerVoiceChannelResource(s32 id_) : id(id_) {} |
| 12 | ServerVoiceChannelResource::~ServerVoiceChannelResource() = default; | 12 | ServerVoiceChannelResource::~ServerVoiceChannelResource() = default; |
| 13 | 13 | ||
| 14 | bool ServerVoiceChannelResource::InUse() const { | 14 | bool ServerVoiceChannelResource::InUse() const { |
| @@ -209,7 +209,8 @@ void ServerVoiceInfo::UpdateWaveBuffers( | |||
| 209 | 209 | ||
| 210 | void ServerVoiceInfo::UpdateWaveBuffer(ServerWaveBuffer& out_wavebuffer, | 210 | void ServerVoiceInfo::UpdateWaveBuffer(ServerWaveBuffer& out_wavebuffer, |
| 211 | const WaveBuffer& in_wave_buffer, SampleFormat sample_format, | 211 | const WaveBuffer& in_wave_buffer, SampleFormat sample_format, |
| 212 | bool is_buffer_valid, BehaviorInfo& behavior_info) { | 212 | bool is_buffer_valid, |
| 213 | [[maybe_unused]] BehaviorInfo& behavior_info) { | ||
| 213 | if (!is_buffer_valid && out_wavebuffer.sent_to_dsp) { | 214 | if (!is_buffer_valid && out_wavebuffer.sent_to_dsp) { |
| 214 | out_wavebuffer.buffer_address = 0; | 215 | out_wavebuffer.buffer_address = 0; |
| 215 | out_wavebuffer.buffer_size = 0; | 216 | out_wavebuffer.buffer_size = 0; |
| @@ -400,7 +401,7 @@ bool ServerVoiceInfo::HasValidWaveBuffer(const VoiceState* state) const { | |||
| 400 | return std::find(valid_wb.begin(), valid_wb.end(), true) != valid_wb.end(); | 401 | return std::find(valid_wb.begin(), valid_wb.end(), true) != valid_wb.end(); |
| 401 | } | 402 | } |
| 402 | 403 | ||
| 403 | VoiceContext::VoiceContext(std::size_t voice_count) : voice_count(voice_count) { | 404 | VoiceContext::VoiceContext(std::size_t voice_count_) : voice_count{voice_count_} { |
| 404 | for (std::size_t i = 0; i < voice_count; i++) { | 405 | for (std::size_t i = 0; i < voice_count; i++) { |
| 405 | voice_channel_resources.emplace_back(static_cast<s32>(i)); | 406 | voice_channel_resources.emplace_back(static_cast<s32>(i)); |
| 406 | sorted_voice_info.push_back(&voice_info.emplace_back()); | 407 | sorted_voice_info.push_back(&voice_info.emplace_back()); |
diff --git a/src/audio_core/voice_context.h b/src/audio_core/voice_context.h index 59d3d7dfb..863248761 100644 --- a/src/audio_core/voice_context.h +++ b/src/audio_core/voice_context.h | |||
| @@ -118,12 +118,12 @@ public: | |||
| 118 | bool in_use{}; | 118 | bool in_use{}; |
| 119 | INSERT_PADDING_BYTES(11); | 119 | INSERT_PADDING_BYTES(11); |
| 120 | }; | 120 | }; |
| 121 | static_assert(sizeof(VoiceChannelResource::InParams) == 0x70, "InParams is an invalid size"); | 121 | static_assert(sizeof(InParams) == 0x70, "InParams is an invalid size"); |
| 122 | }; | 122 | }; |
| 123 | 123 | ||
| 124 | class ServerVoiceChannelResource { | 124 | class ServerVoiceChannelResource { |
| 125 | public: | 125 | public: |
| 126 | explicit ServerVoiceChannelResource(s32 id); | 126 | explicit ServerVoiceChannelResource(s32 id_); |
| 127 | ~ServerVoiceChannelResource(); | 127 | ~ServerVoiceChannelResource(); |
| 128 | 128 | ||
| 129 | bool InUse() const; | 129 | bool InUse() const; |
| @@ -174,7 +174,7 @@ public: | |||
| 174 | BehaviorFlags behavior_flags{}; | 174 | BehaviorFlags behavior_flags{}; |
| 175 | INSERT_PADDING_BYTES(16); | 175 | INSERT_PADDING_BYTES(16); |
| 176 | }; | 176 | }; |
| 177 | static_assert(sizeof(VoiceInfo::InParams) == 0x170, "InParams is an invalid size"); | 177 | static_assert(sizeof(InParams) == 0x170, "InParams is an invalid size"); |
| 178 | 178 | ||
| 179 | struct OutParams { | 179 | struct OutParams { |
| 180 | u64_le played_sample_count{}; | 180 | u64_le played_sample_count{}; |
| @@ -182,7 +182,7 @@ public: | |||
| 182 | u8 voice_dropped{}; | 182 | u8 voice_dropped{}; |
| 183 | INSERT_PADDING_BYTES(3); | 183 | INSERT_PADDING_BYTES(3); |
| 184 | }; | 184 | }; |
| 185 | static_assert(sizeof(VoiceInfo::OutParams) == 0x10, "OutParams is an invalid size"); | 185 | static_assert(sizeof(OutParams) == 0x10, "OutParams is an invalid size"); |
| 186 | }; | 186 | }; |
| 187 | 187 | ||
| 188 | class ServerVoiceInfo { | 188 | class ServerVoiceInfo { |
| @@ -263,7 +263,7 @@ private: | |||
| 263 | 263 | ||
| 264 | class VoiceContext { | 264 | class VoiceContext { |
| 265 | public: | 265 | public: |
| 266 | VoiceContext(std::size_t voice_count); | 266 | explicit VoiceContext(std::size_t voice_count_); |
| 267 | ~VoiceContext(); | 267 | ~VoiceContext(); |
| 268 | 268 | ||
| 269 | std::size_t GetVoiceCount() const; | 269 | std::size_t GetVoiceCount() const; |
diff --git a/src/common/wall_clock.cpp b/src/common/wall_clock.cpp index 452a2837e..a8c143f85 100644 --- a/src/common/wall_clock.cpp +++ b/src/common/wall_clock.cpp | |||
| @@ -17,8 +17,8 @@ using base_time_point = std::chrono::time_point<base_timer>; | |||
| 17 | 17 | ||
| 18 | class StandardWallClock final : public WallClock { | 18 | class StandardWallClock final : public WallClock { |
| 19 | public: | 19 | public: |
| 20 | StandardWallClock(u64 emulated_cpu_frequency, u64 emulated_clock_frequency) | 20 | explicit StandardWallClock(u64 emulated_cpu_frequency_, u64 emulated_clock_frequency_) |
| 21 | : WallClock(emulated_cpu_frequency, emulated_clock_frequency, false) { | 21 | : WallClock(emulated_cpu_frequency_, emulated_clock_frequency_, false) { |
| 22 | start_time = base_timer::now(); | 22 | start_time = base_timer::now(); |
| 23 | } | 23 | } |
| 24 | 24 | ||
diff --git a/src/common/wall_clock.h b/src/common/wall_clock.h index bc7adfbf8..cef3e9499 100644 --- a/src/common/wall_clock.h +++ b/src/common/wall_clock.h | |||
| @@ -38,9 +38,9 @@ public: | |||
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | protected: | 40 | protected: |
| 41 | WallClock(u64 emulated_cpu_frequency, u64 emulated_clock_frequency, bool is_native) | 41 | explicit WallClock(u64 emulated_cpu_frequency_, u64 emulated_clock_frequency_, bool is_native_) |
| 42 | : emulated_cpu_frequency{emulated_cpu_frequency}, | 42 | : emulated_cpu_frequency{emulated_cpu_frequency_}, |
| 43 | emulated_clock_frequency{emulated_clock_frequency}, is_native{is_native} {} | 43 | emulated_clock_frequency{emulated_clock_frequency_}, is_native{is_native_} {} |
| 44 | 44 | ||
| 45 | u64 emulated_cpu_frequency; | 45 | u64 emulated_cpu_frequency; |
| 46 | u64 emulated_clock_frequency; | 46 | u64 emulated_clock_frequency; |
diff --git a/src/common/x64/native_clock.cpp b/src/common/x64/native_clock.cpp index 424b39b1f..eb8a7782f 100644 --- a/src/common/x64/native_clock.cpp +++ b/src/common/x64/native_clock.cpp | |||
| @@ -43,10 +43,10 @@ u64 EstimateRDTSCFrequency() { | |||
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | namespace X64 { | 45 | namespace X64 { |
| 46 | NativeClock::NativeClock(u64 emulated_cpu_frequency, u64 emulated_clock_frequency, | 46 | NativeClock::NativeClock(u64 emulated_cpu_frequency_, u64 emulated_clock_frequency_, |
| 47 | u64 rtsc_frequency) | 47 | u64 rtsc_frequency_) |
| 48 | : WallClock(emulated_cpu_frequency, emulated_clock_frequency, true), rtsc_frequency{ | 48 | : WallClock(emulated_cpu_frequency_, emulated_clock_frequency_, true), rtsc_frequency{ |
| 49 | rtsc_frequency} { | 49 | rtsc_frequency_} { |
| 50 | _mm_mfence(); | 50 | _mm_mfence(); |
| 51 | last_measure = __rdtsc(); | 51 | last_measure = __rdtsc(); |
| 52 | accumulated_ticks = 0U; | 52 | accumulated_ticks = 0U; |
diff --git a/src/common/x64/native_clock.h b/src/common/x64/native_clock.h index 97aab6ac9..6d1e32ac8 100644 --- a/src/common/x64/native_clock.h +++ b/src/common/x64/native_clock.h | |||
| @@ -14,7 +14,8 @@ namespace Common { | |||
| 14 | namespace X64 { | 14 | namespace X64 { |
| 15 | class NativeClock final : public WallClock { | 15 | class NativeClock final : public WallClock { |
| 16 | public: | 16 | public: |
| 17 | NativeClock(u64 emulated_cpu_frequency, u64 emulated_clock_frequency, u64 rtsc_frequency); | 17 | explicit NativeClock(u64 emulated_cpu_frequency_, u64 emulated_clock_frequency_, |
| 18 | u64 rtsc_frequency_); | ||
| 18 | 19 | ||
| 19 | std::chrono::nanoseconds GetTimeNS() override; | 20 | std::chrono::nanoseconds GetTimeNS() override; |
| 20 | 21 | ||
diff --git a/src/core/core_timing.h b/src/core/core_timing.h index b0b6036e4..77ff4c6fe 100644 --- a/src/core/core_timing.h +++ b/src/core/core_timing.h | |||
| @@ -27,8 +27,8 @@ using TimedCallback = | |||
| 27 | 27 | ||
| 28 | /// Contains the characteristics of a particular event. | 28 | /// Contains the characteristics of a particular event. |
| 29 | struct EventType { | 29 | struct EventType { |
| 30 | EventType(TimedCallback&& callback, std::string&& name) | 30 | explicit EventType(TimedCallback&& callback_, std::string&& name_) |
| 31 | : callback{std::move(callback)}, name{std::move(name)} {} | 31 | : callback{std::move(callback_)}, name{std::move(name_)} {} |
| 32 | 32 | ||
| 33 | /// The event's callback function. | 33 | /// The event's callback function. |
| 34 | TimedCallback callback; | 34 | TimedCallback callback; |
| @@ -67,8 +67,8 @@ public: | |||
| 67 | void Shutdown(); | 67 | void Shutdown(); |
| 68 | 68 | ||
| 69 | /// Sets if emulation is multicore or single core, must be set before Initialize | 69 | /// Sets if emulation is multicore or single core, must be set before Initialize |
| 70 | void SetMulticore(bool is_multicore) { | 70 | void SetMulticore(bool is_multicore_) { |
| 71 | this->is_multicore = is_multicore; | 71 | is_multicore = is_multicore_; |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | /// Check if it's using host timing. | 74 | /// Check if it's using host timing. |
diff --git a/src/core/hle/result.h b/src/core/hle/result.h index b6bdbd988..8feda7ad7 100644 --- a/src/core/hle/result.h +++ b/src/core/hle/result.h | |||
| @@ -119,7 +119,7 @@ union ResultCode { | |||
| 119 | BitField<0, 9, ErrorModule> module; | 119 | BitField<0, 9, ErrorModule> module; |
| 120 | BitField<9, 13, u32> description; | 120 | BitField<9, 13, u32> description; |
| 121 | 121 | ||
| 122 | constexpr explicit ResultCode(u32 raw) : raw(raw) {} | 122 | constexpr explicit ResultCode(u32 raw_) : raw(raw_) {} |
| 123 | 123 | ||
| 124 | constexpr ResultCode(ErrorModule module_, u32 description_) | 124 | constexpr ResultCode(ErrorModule module_, u32 description_) |
| 125 | : raw(module.FormatValue(module_) | description.FormatValue(description_)) {} | 125 | : raw(module.FormatValue(module_) | description.FormatValue(description_)) {} |