diff options
author | Chris Robinson <[email protected]> | 2023-03-11 18:15:59 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-03-11 18:15:59 -0800 |
commit | 3f45b3c0c900a6b513d8917cc4df00ca100a7c09 (patch) | |
tree | 372224c950b7fc1be7efc70bff9dea5129297c55 /al/effects | |
parent | 368b3db4ebf0284ef9a069bbb1c1387aa1800e82 (diff) |
Avoid copying to a temporary
Diffstat (limited to 'al/effects')
-rw-r--r-- | al/effects/autowah.cpp | 15 | ||||
-rw-r--r-- | al/effects/chorus.cpp | 36 | ||||
-rw-r--r-- | al/effects/compressor.cpp | 9 | ||||
-rw-r--r-- | al/effects/distortion.cpp | 17 | ||||
-rw-r--r-- | al/effects/echo.cpp | 17 | ||||
-rw-r--r-- | al/effects/equalizer.cpp | 27 | ||||
-rw-r--r-- | al/effects/fshifter.cpp | 13 | ||||
-rw-r--r-- | al/effects/modulator.cpp | 13 | ||||
-rw-r--r-- | al/effects/pshifter.cpp | 11 | ||||
-rw-r--r-- | al/effects/reverb.cpp | 59 | ||||
-rw-r--r-- | al/effects/vmorpher.cpp | 19 |
11 files changed, 116 insertions, 120 deletions
diff --git a/al/effects/autowah.cpp b/al/effects/autowah.cpp index 596157f0..129318f4 100644 --- a/al/effects/autowah.cpp +++ b/al/effects/autowah.cpp @@ -192,20 +192,19 @@ template<> template<> bool AutowahCommitter::commit(const EaxEffectProps &props) { - const auto orig = mEaxProps; - mEaxProps = props; - - if(orig.mType == mEaxProps.mType + if(props.mType == mEaxProps.mType && mEaxProps.mAutowah.flAttackTime == props.mAutowah.flAttackTime && mEaxProps.mAutowah.flReleaseTime == props.mAutowah.flReleaseTime && mEaxProps.mAutowah.lResonance == props.mAutowah.lResonance && mEaxProps.mAutowah.lPeakLevel == props.mAutowah.lPeakLevel) return false; - mAlProps.Autowah.AttackTime = mEaxProps.mAutowah.flAttackTime; - mAlProps.Autowah.ReleaseTime = mEaxProps.mAutowah.flReleaseTime; - mAlProps.Autowah.Resonance = level_mb_to_gain(static_cast<float>(mEaxProps.mAutowah.lResonance)); - mAlProps.Autowah.PeakGain = level_mb_to_gain(static_cast<float>(mEaxProps.mAutowah.lPeakLevel)); + mEaxProps = props; + + mAlProps.Autowah.AttackTime = props.mAutowah.flAttackTime; + mAlProps.Autowah.ReleaseTime = props.mAutowah.flReleaseTime; + mAlProps.Autowah.Resonance = level_mb_to_gain(static_cast<float>(props.mAutowah.lResonance)); + mAlProps.Autowah.PeakGain = level_mb_to_gain(static_cast<float>(props.mAutowah.lPeakLevel)); return true; } diff --git a/al/effects/chorus.cpp b/al/effects/chorus.cpp index c8b32aed..305259a4 100644 --- a/al/effects/chorus.cpp +++ b/al/effects/chorus.cpp @@ -607,25 +607,27 @@ public: } } - static bool Commit(const EaxEffectProps &props, EaxEffectProps &props_, - EffectProps &al_effect_props_) + static bool Commit(const EaxEffectProps &props, EaxEffectProps &props_, EffectProps &al_props_) { - const auto orig = props_; - props_ = props; + if(props.mType == props_.mType) + { + auto&& src = props_.*Field; + auto&& dst = props.*Field; + if(dst.ulWaveform == src.ulWaveform && dst.lPhase == src.lPhase + && dst.flRate == src.flRate && dst.flDepth == src.flDepth + && dst.flFeedback == src.flFeedback && dst.flDelay == src.flDelay) + return false; + } - auto&& src = orig.*Field; - auto&& dst = props_.*Field; - if(orig.mType == props_.mType && dst.ulWaveform == src.ulWaveform - && dst.lPhase == src.lPhase && dst.flRate == src.flRate && dst.flDepth == src.flDepth - && dst.flFeedback == src.flFeedback && dst.flDelay == src.flDelay) - return false; - - al_effect_props_.Chorus.Waveform = Traits::eax_waveform(dst.ulWaveform); - al_effect_props_.Chorus.Phase = static_cast<ALint>(dst.lPhase); - al_effect_props_.Chorus.Rate = dst.flRate; - al_effect_props_.Chorus.Depth = dst.flDepth; - al_effect_props_.Chorus.Feedback = dst.flFeedback; - al_effect_props_.Chorus.Delay = dst.flDelay; + props_ = props; + auto&& dst = props.*Field; + + al_props_.Chorus.Waveform = Traits::eax_waveform(dst.ulWaveform); + al_props_.Chorus.Phase = static_cast<int>(dst.lPhase); + al_props_.Chorus.Rate = dst.flRate; + al_props_.Chorus.Depth = dst.flDepth; + al_props_.Chorus.Feedback = dst.flFeedback; + al_props_.Chorus.Delay = dst.flDelay; return true; } diff --git a/al/effects/compressor.cpp b/al/effects/compressor.cpp index 2d219df6..a4aa8e77 100644 --- a/al/effects/compressor.cpp +++ b/al/effects/compressor.cpp @@ -118,12 +118,13 @@ template<> template<> bool CompressorCommitter::commit(const EaxEffectProps &props) { - const auto orig = mEaxProps; - mEaxProps = props; - if(orig.mType == mEaxProps.mType && orig.mCompressor.ulOnOff == mEaxProps.mCompressor.ulOnOff) + if(props.mType == mEaxProps.mType + && props.mCompressor.ulOnOff == mEaxProps.mCompressor.ulOnOff) return false; - mAlProps.Compressor.OnOff = (mEaxProps.mCompressor.ulOnOff != 0); + mEaxProps = props; + + mAlProps.Compressor.OnOff = (props.mCompressor.ulOnOff != 0); return true; } diff --git a/al/effects/distortion.cpp b/al/effects/distortion.cpp index 6125c2a4..ee298ddf 100644 --- a/al/effects/distortion.cpp +++ b/al/effects/distortion.cpp @@ -207,21 +207,20 @@ template<> template<> bool DistortionCommitter::commit(const EaxEffectProps &props) { - const auto orig = mEaxProps; - mEaxProps = props; - - if(orig.mType == mEaxProps.mType && mEaxProps.mDistortion.flEdge == props.mDistortion.flEdge + if(props.mType == mEaxProps.mType && mEaxProps.mDistortion.flEdge == props.mDistortion.flEdge && mEaxProps.mDistortion.lGain == props.mDistortion.lGain && mEaxProps.mDistortion.flLowPassCutOff == props.mDistortion.flLowPassCutOff && mEaxProps.mDistortion.flEQCenter == props.mDistortion.flEQCenter && mEaxProps.mDistortion.flEQBandwidth == props.mDistortion.flEQBandwidth) return false; - mAlProps.Distortion.Edge = mEaxProps.mDistortion.flEdge; - mAlProps.Distortion.Gain = level_mb_to_gain(static_cast<float>(mEaxProps.mDistortion.lGain)); - mAlProps.Distortion.LowpassCutoff = mEaxProps.mDistortion.flLowPassCutOff; - mAlProps.Distortion.EQCenter = mEaxProps.mDistortion.flEQCenter; - mAlProps.Distortion.EQBandwidth = mEaxProps.mDistortion.flEdge; + mEaxProps = props; + + mAlProps.Distortion.Edge = props.mDistortion.flEdge; + mAlProps.Distortion.Gain = level_mb_to_gain(static_cast<float>(props.mDistortion.lGain)); + mAlProps.Distortion.LowpassCutoff = props.mDistortion.flLowPassCutOff; + mAlProps.Distortion.EQCenter = props.mDistortion.flEQCenter; + mAlProps.Distortion.EQBandwidth = props.mDistortion.flEdge; return true; } diff --git a/al/effects/echo.cpp b/al/effects/echo.cpp index be12c621..2eb37603 100644 --- a/al/effects/echo.cpp +++ b/al/effects/echo.cpp @@ -204,21 +204,20 @@ template<> template<> bool EchoCommitter::commit(const EaxEffectProps &props) { - const auto orig = mEaxProps; - mEaxProps = props; - - if(orig.mType == mEaxProps.mType && mEaxProps.mEcho.flDelay == props.mEcho.flDelay + if(props.mType == mEaxProps.mType && mEaxProps.mEcho.flDelay == props.mEcho.flDelay && mEaxProps.mEcho.flLRDelay == props.mEcho.flLRDelay && mEaxProps.mEcho.flDamping == props.mEcho.flDamping && mEaxProps.mEcho.flFeedback == props.mEcho.flFeedback && mEaxProps.mEcho.flSpread == props.mEcho.flSpread) return false; - mAlProps.Echo.Delay = mEaxProps.mEcho.flDelay; - mAlProps.Echo.LRDelay = mEaxProps.mEcho.flLRDelay; - mAlProps.Echo.Damping = mEaxProps.mEcho.flDamping; - mAlProps.Echo.Feedback = mEaxProps.mEcho.flFeedback; - mAlProps.Echo.Spread = mEaxProps.mEcho.flSpread; + mEaxProps = props; + + mAlProps.Echo.Delay = props.mEcho.flDelay; + mAlProps.Echo.LRDelay = props.mEcho.flLRDelay; + mAlProps.Echo.Damping = props.mEcho.flDamping; + mAlProps.Echo.Feedback = props.mEcho.flFeedback; + mAlProps.Echo.Spread = props.mEcho.flSpread; return true; } diff --git a/al/effects/equalizer.cpp b/al/effects/equalizer.cpp index 5eea9e6d..7dc703db 100644 --- a/al/effects/equalizer.cpp +++ b/al/effects/equalizer.cpp @@ -322,10 +322,7 @@ template<> template<> bool EqualizerCommitter::commit(const EaxEffectProps &props) { - const auto orig = mEaxProps; - mEaxProps = props; - - if(orig.mType == mEaxProps.mType && mEaxProps.mEqualizer.lLowGain == props.mEqualizer.lLowGain + if(props.mType == mEaxProps.mType && mEaxProps.mEqualizer.lLowGain == props.mEqualizer.lLowGain && mEaxProps.mEqualizer.flLowCutOff == props.mEqualizer.flLowCutOff && mEaxProps.mEqualizer.lMid1Gain == props.mEqualizer.lMid1Gain && mEaxProps.mEqualizer.flMid1Center == props.mEqualizer.flMid1Center @@ -337,16 +334,18 @@ bool EqualizerCommitter::commit(const EaxEffectProps &props) && mEaxProps.mEqualizer.flHighCutOff == props.mEqualizer.flHighCutOff) return false; - mAlProps.Equalizer.LowGain = level_mb_to_gain(static_cast<float>(mEaxProps.mEqualizer.lLowGain)); - mAlProps.Equalizer.LowCutoff = mEaxProps.mEqualizer.flLowCutOff; - mAlProps.Equalizer.Mid1Gain = level_mb_to_gain(static_cast<float>(mEaxProps.mEqualizer.lMid1Gain)); - mAlProps.Equalizer.Mid1Center = mEaxProps.mEqualizer.flMid1Center; - mAlProps.Equalizer.Mid1Width = mEaxProps.mEqualizer.flMid1Width; - mAlProps.Equalizer.Mid2Gain = level_mb_to_gain(static_cast<float>(mEaxProps.mEqualizer.lMid2Gain)); - mAlProps.Equalizer.Mid2Center = mEaxProps.mEqualizer.flMid2Center; - mAlProps.Equalizer.Mid2Width = mEaxProps.mEqualizer.flMid2Width; - mAlProps.Equalizer.HighGain = level_mb_to_gain(static_cast<float>(mEaxProps.mEqualizer.lHighGain)); - mAlProps.Equalizer.HighCutoff = mEaxProps.mEqualizer.flHighCutOff; + mEaxProps = props; + + mAlProps.Equalizer.LowGain = level_mb_to_gain(static_cast<float>(props.mEqualizer.lLowGain)); + mAlProps.Equalizer.LowCutoff = props.mEqualizer.flLowCutOff; + mAlProps.Equalizer.Mid1Gain = level_mb_to_gain(static_cast<float>(props.mEqualizer.lMid1Gain)); + mAlProps.Equalizer.Mid1Center = props.mEqualizer.flMid1Center; + mAlProps.Equalizer.Mid1Width = props.mEqualizer.flMid1Width; + mAlProps.Equalizer.Mid2Gain = level_mb_to_gain(static_cast<float>(props.mEqualizer.lMid2Gain)); + mAlProps.Equalizer.Mid2Center = props.mEqualizer.flMid2Center; + mAlProps.Equalizer.Mid2Width = props.mEqualizer.flMid2Width; + mAlProps.Equalizer.HighGain = level_mb_to_gain(static_cast<float>(props.mEqualizer.lHighGain)); + mAlProps.Equalizer.HighCutoff = props.mEqualizer.flHighCutOff; return true; } diff --git a/al/effects/fshifter.cpp b/al/effects/fshifter.cpp index 983e83ee..949db203 100644 --- a/al/effects/fshifter.cpp +++ b/al/effects/fshifter.cpp @@ -200,15 +200,14 @@ template<> template<> bool FrequencyShifterCommitter::commit(const EaxEffectProps &props) { - const auto orig = mEaxProps; - mEaxProps = props; - - if(orig.mType == mEaxProps.mType + if(props.mType == mEaxProps.mType && mEaxProps.mFrequencyShifter.flFrequency == props.mFrequencyShifter.flFrequency && mEaxProps.mFrequencyShifter.ulLeftDirection == props.mFrequencyShifter.ulLeftDirection && mEaxProps.mFrequencyShifter.ulRightDirection == props.mFrequencyShifter.ulRightDirection) return false; + mEaxProps = props; + auto get_direction = [](unsigned long dir) noexcept { if(dir == EAX_FREQUENCYSHIFTER_DOWN) @@ -218,9 +217,9 @@ bool FrequencyShifterCommitter::commit(const EaxEffectProps &props) return FShifterDirection::Off; }; - mAlProps.Fshifter.Frequency = mEaxProps.mFrequencyShifter.flFrequency; - mAlProps.Fshifter.LeftDirection = get_direction(mEaxProps.mFrequencyShifter.ulLeftDirection); - mAlProps.Fshifter.RightDirection = get_direction(mEaxProps.mFrequencyShifter.ulRightDirection); + mAlProps.Fshifter.Frequency = props.mFrequencyShifter.flFrequency; + mAlProps.Fshifter.LeftDirection = get_direction(props.mFrequencyShifter.ulLeftDirection); + mAlProps.Fshifter.RightDirection = get_direction(props.mFrequencyShifter.ulRightDirection); return true; } diff --git a/al/effects/modulator.cpp b/al/effects/modulator.cpp index 8b6b1045..5f37d08f 100644 --- a/al/effects/modulator.cpp +++ b/al/effects/modulator.cpp @@ -206,15 +206,14 @@ template<> template<> bool ModulatorCommitter::commit(const EaxEffectProps &props) { - const auto orig = mEaxProps; - mEaxProps = props; - - if(orig.mType == mEaxProps.mType + if(props.mType == mEaxProps.mType && mEaxProps.mModulator.flFrequency == props.mModulator.flFrequency && mEaxProps.mModulator.flHighPassCutOff == props.mModulator.flHighPassCutOff && mEaxProps.mModulator.ulWaveform == props.mModulator.ulWaveform) return false; + mEaxProps = props; + auto get_waveform = [](unsigned long form) { if(form == EAX_RINGMODULATOR_SINUSOID) @@ -226,9 +225,9 @@ bool ModulatorCommitter::commit(const EaxEffectProps &props) return ModulatorWaveform::Sinusoid; }; - mAlProps.Modulator.Frequency = mEaxProps.mModulator.flFrequency; - mAlProps.Modulator.HighPassCutoff = mEaxProps.mModulator.flHighPassCutOff; - mAlProps.Modulator.Waveform = get_waveform(mEaxProps.mModulator.ulWaveform); + mAlProps.Modulator.Frequency = props.mModulator.flFrequency; + mAlProps.Modulator.HighPassCutoff = props.mModulator.flHighPassCutOff; + mAlProps.Modulator.Waveform = get_waveform(props.mModulator.ulWaveform); return true; } diff --git a/al/effects/pshifter.cpp b/al/effects/pshifter.cpp index 7c9f0b0e..634eb186 100644 --- a/al/effects/pshifter.cpp +++ b/al/effects/pshifter.cpp @@ -141,16 +141,15 @@ template<> template<> bool PitchShifterCommitter::commit(const EaxEffectProps &props) { - const auto orig = mEaxProps; - mEaxProps = props; - - if(orig.mType == mEaxProps.mType + if(props.mType == mEaxProps.mType && mEaxProps.mPitchShifter.lCoarseTune == props.mPitchShifter.lCoarseTune && mEaxProps.mPitchShifter.lFineTune == props.mPitchShifter.lFineTune) return false; - mAlProps.Pshifter.CoarseTune = static_cast<ALint>(mEaxProps.mPitchShifter.lCoarseTune); - mAlProps.Pshifter.FineTune = static_cast<ALint>(mEaxProps.mPitchShifter.lFineTune); + mEaxProps = props; + + mAlProps.Pshifter.CoarseTune = static_cast<int>(mEaxProps.mPitchShifter.lCoarseTune); + mAlProps.Pshifter.FineTune = static_cast<int>(mEaxProps.mPitchShifter.lFineTune); return true; } diff --git a/al/effects/reverb.cpp b/al/effects/reverb.cpp index 2ba16ebd..7f0be980 100644 --- a/al/effects/reverb.cpp +++ b/al/effects/reverb.cpp @@ -1156,40 +1156,41 @@ bool EaxReverbCommitter::commit(const EAXREVERBPROPERTIES &props) bool EaxReverbCommitter::commit(const EaxEffectProps &props) { - const auto orig = mEaxProps; - mEaxProps = props; - if(orig.mType == mEaxProps.mType && memcmp(&orig.mReverb, &mEaxProps.mReverb, sizeof(mEaxProps.mReverb)) == 0) + if(props.mType == mEaxProps.mType + && memcmp(&props.mReverb, &mEaxProps.mReverb, sizeof(mEaxProps.mReverb)) == 0) return false; - const auto size = mEaxProps.mReverb.flEnvironmentSize; + mEaxProps = props; + + const auto size = props.mReverb.flEnvironmentSize; const auto density = (size * size * size) / 16.0F; mAlProps.Reverb.Density = std::min(density, AL_EAXREVERB_MAX_DENSITY); - mAlProps.Reverb.Diffusion = mEaxProps.mReverb.flEnvironmentDiffusion; - mAlProps.Reverb.Gain = level_mb_to_gain(static_cast<float>(mEaxProps.mReverb.lRoom)); - mAlProps.Reverb.GainHF = level_mb_to_gain(static_cast<float>(mEaxProps.mReverb.lRoomHF)); - mAlProps.Reverb.GainLF = level_mb_to_gain(static_cast<float>(mEaxProps.mReverb.lRoomLF)); - mAlProps.Reverb.DecayTime = mEaxProps.mReverb.flDecayTime; - mAlProps.Reverb.DecayHFRatio = mEaxProps.mReverb.flDecayHFRatio; + mAlProps.Reverb.Diffusion = props.mReverb.flEnvironmentDiffusion; + mAlProps.Reverb.Gain = level_mb_to_gain(static_cast<float>(props.mReverb.lRoom)); + mAlProps.Reverb.GainHF = level_mb_to_gain(static_cast<float>(props.mReverb.lRoomHF)); + mAlProps.Reverb.GainLF = level_mb_to_gain(static_cast<float>(props.mReverb.lRoomLF)); + mAlProps.Reverb.DecayTime = props.mReverb.flDecayTime; + mAlProps.Reverb.DecayHFRatio = props.mReverb.flDecayHFRatio; mAlProps.Reverb.DecayLFRatio = mEaxProps.mReverb.flDecayLFRatio; - mAlProps.Reverb.ReflectionsGain = level_mb_to_gain(static_cast<float>(mEaxProps.mReverb.lReflections)); - mAlProps.Reverb.ReflectionsDelay = mEaxProps.mReverb.flReflectionsDelay; - mAlProps.Reverb.ReflectionsPan[0] = mEaxProps.mReverb.vReflectionsPan.x; - mAlProps.Reverb.ReflectionsPan[1] = mEaxProps.mReverb.vReflectionsPan.y; - mAlProps.Reverb.ReflectionsPan[2] = mEaxProps.mReverb.vReflectionsPan.z; - mAlProps.Reverb.LateReverbGain = level_mb_to_gain(static_cast<float>(mEaxProps.mReverb.lReverb)); - mAlProps.Reverb.LateReverbDelay = mEaxProps.mReverb.flReverbDelay; - mAlProps.Reverb.LateReverbPan[0] = mEaxProps.mReverb.vReverbPan.x; - mAlProps.Reverb.LateReverbPan[1] = mEaxProps.mReverb.vReverbPan.y; - mAlProps.Reverb.LateReverbPan[2] = mEaxProps.mReverb.vReverbPan.z; - mAlProps.Reverb.EchoTime = mEaxProps.mReverb.flEchoTime; - mAlProps.Reverb.EchoDepth = mEaxProps.mReverb.flEchoDepth; - mAlProps.Reverb.ModulationTime = mEaxProps.mReverb.flModulationTime; - mAlProps.Reverb.ModulationDepth = mEaxProps.mReverb.flModulationDepth; - mAlProps.Reverb.AirAbsorptionGainHF = level_mb_to_gain(mEaxProps.mReverb.flAirAbsorptionHF); - mAlProps.Reverb.HFReference = mEaxProps.mReverb.flHFReference; - mAlProps.Reverb.LFReference = mEaxProps.mReverb.flLFReference; - mAlProps.Reverb.RoomRolloffFactor = mEaxProps.mReverb.flRoomRolloffFactor; - mAlProps.Reverb.DecayHFLimit = ((mEaxProps.mReverb.ulFlags & EAXREVERBFLAGS_DECAYHFLIMIT) != 0); + mAlProps.Reverb.ReflectionsGain = level_mb_to_gain(static_cast<float>(props.mReverb.lReflections)); + mAlProps.Reverb.ReflectionsDelay = props.mReverb.flReflectionsDelay; + mAlProps.Reverb.ReflectionsPan[0] = props.mReverb.vReflectionsPan.x; + mAlProps.Reverb.ReflectionsPan[1] = props.mReverb.vReflectionsPan.y; + mAlProps.Reverb.ReflectionsPan[2] = props.mReverb.vReflectionsPan.z; + mAlProps.Reverb.LateReverbGain = level_mb_to_gain(static_cast<float>(props.mReverb.lReverb)); + mAlProps.Reverb.LateReverbDelay = props.mReverb.flReverbDelay; + mAlProps.Reverb.LateReverbPan[0] = props.mReverb.vReverbPan.x; + mAlProps.Reverb.LateReverbPan[1] = props.mReverb.vReverbPan.y; + mAlProps.Reverb.LateReverbPan[2] = props.mReverb.vReverbPan.z; + mAlProps.Reverb.EchoTime = props.mReverb.flEchoTime; + mAlProps.Reverb.EchoDepth = props.mReverb.flEchoDepth; + mAlProps.Reverb.ModulationTime = props.mReverb.flModulationTime; + mAlProps.Reverb.ModulationDepth = props.mReverb.flModulationDepth; + mAlProps.Reverb.AirAbsorptionGainHF = level_mb_to_gain(props.mReverb.flAirAbsorptionHF); + mAlProps.Reverb.HFReference = props.mReverb.flHFReference; + mAlProps.Reverb.LFReference = props.mReverb.flLFReference; + mAlProps.Reverb.RoomRolloffFactor = props.mReverb.flRoomRolloffFactor; + mAlProps.Reverb.DecayHFLimit = ((props.mReverb.ulFlags & EAXREVERBFLAGS_DECAYHFLIMIT) != 0); return true; } diff --git a/al/effects/vmorpher.cpp b/al/effects/vmorpher.cpp index 856fc6b3..21ea3680 100644 --- a/al/effects/vmorpher.cpp +++ b/al/effects/vmorpher.cpp @@ -355,10 +355,7 @@ template<> template<> bool VocalMorpherCommitter::commit(const EaxEffectProps &props) { - const auto orig = mEaxProps; - mEaxProps = props; - - if(orig.mType == mEaxProps.mType + if(props.mType == mEaxProps.mType && mEaxProps.mVocalMorpher.ulPhonemeA == props.mVocalMorpher.ulPhonemeA && mEaxProps.mVocalMorpher.lPhonemeACoarseTuning == props.mVocalMorpher.lPhonemeACoarseTuning && mEaxProps.mVocalMorpher.ulPhonemeB == props.mVocalMorpher.ulPhonemeB @@ -367,6 +364,8 @@ bool VocalMorpherCommitter::commit(const EaxEffectProps &props) && mEaxProps.mVocalMorpher.flRate == props.mVocalMorpher.flRate) return false; + mEaxProps = props; + auto get_phoneme = [](unsigned long phoneme) noexcept { #define HANDLE_PHENOME(x) case x: return VMorpherPhenome::x @@ -414,12 +413,12 @@ bool VocalMorpherCommitter::commit(const EaxEffectProps &props) return VMorpherWaveform::Sinusoid; }; - mAlProps.Vmorpher.PhonemeA = get_phoneme(mEaxProps.mVocalMorpher.ulPhonemeA); - mAlProps.Vmorpher.PhonemeACoarseTuning = static_cast<ALint>(mEaxProps.mVocalMorpher.lPhonemeACoarseTuning); - mAlProps.Vmorpher.PhonemeB = get_phoneme(mEaxProps.mVocalMorpher.ulPhonemeB); - mAlProps.Vmorpher.PhonemeBCoarseTuning = static_cast<ALint>(mEaxProps.mVocalMorpher.lPhonemeBCoarseTuning); - mAlProps.Vmorpher.Waveform = get_waveform(mEaxProps.mVocalMorpher.ulWaveform); - mAlProps.Vmorpher.Rate = mEaxProps.mVocalMorpher.flRate; + mAlProps.Vmorpher.PhonemeA = get_phoneme(props.mVocalMorpher.ulPhonemeA); + mAlProps.Vmorpher.PhonemeACoarseTuning = static_cast<int>(props.mVocalMorpher.lPhonemeACoarseTuning); + mAlProps.Vmorpher.PhonemeB = get_phoneme(props.mVocalMorpher.ulPhonemeB); + mAlProps.Vmorpher.PhonemeBCoarseTuning = static_cast<int>(props.mVocalMorpher.lPhonemeBCoarseTuning); + mAlProps.Vmorpher.Waveform = get_waveform(props.mVocalMorpher.ulWaveform); + mAlProps.Vmorpher.Rate = props.mVocalMorpher.flRate; return true; } |