From 3f78d74fc111c7633d06b302aa154e3433b926d8 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 9 Aug 2015 21:36:00 -0400 Subject: AudioCommon: Log to AUDIO, not DSPHLE This code is not related to DSPHLE. --- Source/Core/AudioCommon/Mixer.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'Source/Core/AudioCommon/Mixer.cpp') diff --git a/Source/Core/AudioCommon/Mixer.cpp b/Source/Core/AudioCommon/Mixer.cpp index dbf7167bb4..d582f5596f 100644 --- a/Source/Core/AudioCommon/Mixer.cpp +++ b/Source/Core/AudioCommon/Mixer.cpp @@ -210,11 +210,11 @@ void CMixer::StartLogDTKAudio(const std::string& filename) m_log_dtk_audio = true; m_wave_writer_dtk.Start(filename, 48000); m_wave_writer_dtk.SetSkipSilence(false); - NOTICE_LOG(DSPHLE, "Starting DTK Audio logging"); + NOTICE_LOG(AUDIO, "Starting DTK Audio logging"); } else { - WARN_LOG(DSPHLE, "DTK Audio logging has already been started"); + WARN_LOG(AUDIO, "DTK Audio logging has already been started"); } } @@ -224,11 +224,11 @@ void CMixer::StopLogDTKAudio() { m_log_dtk_audio = false; m_wave_writer_dtk.Stop(); - NOTICE_LOG(DSPHLE, "Stopping DTK Audio logging"); + NOTICE_LOG(AUDIO, "Stopping DTK Audio logging"); } else { - WARN_LOG(DSPHLE, "DTK Audio logging has already been stopped"); + WARN_LOG(AUDIO, "DTK Audio logging has already been stopped"); } } @@ -239,11 +239,11 @@ void CMixer::StartLogDSPAudio(const std::string& filename) m_log_dsp_audio = true; m_wave_writer_dsp.Start(filename, 32000); m_wave_writer_dsp.SetSkipSilence(false); - NOTICE_LOG(DSPHLE, "Starting DSP Audio logging"); + NOTICE_LOG(AUDIO, "Starting DSP Audio logging"); } else { - WARN_LOG(DSPHLE, "DSP Audio logging has already been started"); + WARN_LOG(AUDIO, "DSP Audio logging has already been started"); } } @@ -253,11 +253,11 @@ void CMixer::StopLogDSPAudio() { m_log_dsp_audio = false; m_wave_writer_dsp.Stop(); - NOTICE_LOG(DSPHLE, "Stopping DSP Audio logging"); + NOTICE_LOG(AUDIO, "Stopping DSP Audio logging"); } else { - WARN_LOG(DSPHLE, "DSP Audio logging has already been stopped"); + WARN_LOG(AUDIO, "DSP Audio logging has already been stopped"); } } -- cgit v1.2.3 From b9e360df7bcb8a1051d0f82d42cc6e9ae047d282 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 11 Sep 2015 23:43:17 -0400 Subject: MathUtil: Convert Clamp into a constexpr function --- Source/Core/AudioCommon/Mixer.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'Source/Core/AudioCommon/Mixer.cpp') diff --git a/Source/Core/AudioCommon/Mixer.cpp b/Source/Core/AudioCommon/Mixer.cpp index d582f5596f..1bebe88595 100644 --- a/Source/Core/AudioCommon/Mixer.cpp +++ b/Source/Core/AudioCommon/Mixer.cpp @@ -65,16 +65,14 @@ unsigned int CMixer::MixerFifo::Mix(short* samples, unsigned int numSamples, boo int sampleL = ((l1 << 16) + (l2 - l1) * (u16)m_frac) >> 16; sampleL = (sampleL * lvolume) >> 8; sampleL += samples[currentSample + 1]; - MathUtil::Clamp(&sampleL, -32767, 32767); - samples[currentSample + 1] = sampleL; + samples[currentSample + 1] = MathUtil::Clamp(sampleL, -32767, 32767); s16 r1 = Common::swap16(m_buffer[(indexR + 1) & INDEX_MASK]); //current s16 r2 = Common::swap16(m_buffer[(indexR2 + 1) & INDEX_MASK]); //next int sampleR = ((r1 << 16) + (r2 - r1) * (u16)m_frac) >> 16; sampleR = (sampleR * rvolume) >> 8; sampleR += samples[currentSample]; - MathUtil::Clamp(&sampleR, -32767, 32767); - samples[currentSample] = sampleR; + samples[currentSample] = MathUtil::Clamp(sampleR, -32767, 32767); m_frac += ratio; indexR += 2 * (u16)(m_frac >> 16); @@ -89,11 +87,10 @@ unsigned int CMixer::MixerFifo::Mix(short* samples, unsigned int numSamples, boo s[1] = (s[1] * lvolume) >> 8; for (; currentSample < numSamples * 2; currentSample += 2) { - int sampleR = s[0] + samples[currentSample]; - MathUtil::Clamp(&sampleR, -32767, 32767); - samples[currentSample] = sampleR; - int sampleL = s[1] + samples[currentSample + 1]; - MathUtil::Clamp(&sampleL, -32767, 32767); + int sampleR = MathUtil::Clamp(s[0] + samples[currentSample + 0], -32767, 32767); + int sampleL = MathUtil::Clamp(s[1] + samples[currentSample + 1], -32767, 32767); + + samples[currentSample + 0] = sampleR; samples[currentSample + 1] = sampleL; } -- cgit v1.2.3 From cc036ca86cdaf709e01221975da734cb64d54a94 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 26 Sep 2015 17:13:07 -0400 Subject: Common: Remove other Common prefixed headers from Common.h --- Source/Core/AudioCommon/Mixer.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Source/Core/AudioCommon/Mixer.cpp') diff --git a/Source/Core/AudioCommon/Mixer.cpp b/Source/Core/AudioCommon/Mixer.cpp index 1bebe88595..56370ed350 100644 --- a/Source/Core/AudioCommon/Mixer.cpp +++ b/Source/Core/AudioCommon/Mixer.cpp @@ -18,6 +18,18 @@ #include #endif +CMixer::CMixer(unsigned int BackendSampleRate) + : m_dma_mixer(this, 32000) + , m_streaming_mixer(this, 48000) + , m_wiimote_speaker_mixer(this, 3000) + , m_sampleRate(BackendSampleRate) + , m_log_dtk_audio(false) + , m_log_dsp_audio(false) + , m_speed(0) +{ + INFO_LOG(AUDIO_INTERFACE, "Mixer is initialized"); +} + // Executed from sound stream thread unsigned int CMixer::MixerFifo::Mix(short* samples, unsigned int numSamples, bool consider_framelimit) { -- cgit v1.2.3