diff options
author | Chris Robinson <[email protected]> | 2023-03-11 17:03:51 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-03-11 17:03:51 -0800 |
commit | 86d4a77e62857205586caf95580980f29e06eb9f (patch) | |
tree | 108359e7f948fdba9a0bd825f6c67eabccb1fe06 | |
parent | 028e7eff52a4d0b7b7c023832d2792bb56fef0d1 (diff) |
Rename some struct members for clarity
-rw-r--r-- | al/eax/effect.h | 12 | ||||
-rw-r--r-- | al/effects/autowah.cpp | 23 | ||||
-rw-r--r-- | al/effects/chorus.cpp | 4 | ||||
-rw-r--r-- | al/effects/compressor.cpp | 8 | ||||
-rw-r--r-- | al/effects/distortion.cpp | 26 | ||||
-rw-r--r-- | al/effects/echo.cpp | 26 | ||||
-rw-r--r-- | al/effects/equalizer.cpp | 46 | ||||
-rw-r--r-- | al/effects/fshifter.cpp | 18 | ||||
-rw-r--r-- | al/effects/modulator.cpp | 17 | ||||
-rw-r--r-- | al/effects/null.cpp | 4 | ||||
-rw-r--r-- | al/effects/pshifter.cpp | 14 | ||||
-rw-r--r-- | al/effects/reverb.cpp | 74 | ||||
-rw-r--r-- | al/effects/vmorpher.cpp | 32 |
13 files changed, 153 insertions, 151 deletions
diff --git a/al/eax/effect.h b/al/eax/effect.h index 2de768b7..c90ccbe6 100644 --- a/al/eax/effect.h +++ b/al/eax/effect.h @@ -64,11 +64,11 @@ struct EaxReverbCommitter { struct Exception; EaxReverbCommitter(EaxEffectProps &eaxprops, EffectProps &alprops) - : props_{eaxprops}, al_effect_props_{alprops} + : mEaxProps{eaxprops}, mAlProps{alprops} { } - EaxEffectProps &props_; - EffectProps &al_effect_props_; + EaxEffectProps &mEaxProps; + EffectProps &mAlProps; [[noreturn]] static void fail(const char* message); [[noreturn]] static void fail_unknown_property_id() @@ -132,11 +132,11 @@ struct EaxCommitter { struct Exception; EaxCommitter(EaxEffectProps &eaxprops, EffectProps &alprops) - : props_{eaxprops}, al_effect_props_{alprops} + : mEaxProps{eaxprops}, mAlProps{alprops} { } - EaxEffectProps &props_; - EffectProps &al_effect_props_; + EaxEffectProps &mEaxProps; + EffectProps &mAlProps; template<typename TValidator, typename TProperty> static void defer(const EaxCall& call, TProperty& property) diff --git a/al/effects/autowah.cpp b/al/effects/autowah.cpp index 7434b62c..596157f0 100644 --- a/al/effects/autowah.cpp +++ b/al/effects/autowah.cpp @@ -192,19 +192,20 @@ template<> template<> bool AutowahCommitter::commit(const EaxEffectProps &props) { - const auto orig = props_; - props_ = props; - - if(orig.mType == props_.mType && props_.mAutowah.flAttackTime == props.mAutowah.flAttackTime - && props_.mAutowah.flReleaseTime == props.mAutowah.flReleaseTime - && props_.mAutowah.lResonance == props.mAutowah.lResonance - && props_.mAutowah.lPeakLevel == props.mAutowah.lPeakLevel) + const auto orig = mEaxProps; + mEaxProps = props; + + if(orig.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; - al_effect_props_.Autowah.AttackTime = props_.mAutowah.flAttackTime; - al_effect_props_.Autowah.ReleaseTime = props_.mAutowah.flReleaseTime; - al_effect_props_.Autowah.Resonance = level_mb_to_gain(static_cast<float>(props_.mAutowah.lResonance)); - al_effect_props_.Autowah.PeakGain = level_mb_to_gain(static_cast<float>(props_.mAutowah.lPeakLevel)); + 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)); return true; } diff --git a/al/effects/chorus.cpp b/al/effects/chorus.cpp index a6845ee8..c8b32aed 100644 --- a/al/effects/chorus.cpp +++ b/al/effects/chorus.cpp @@ -654,7 +654,7 @@ template<> bool ChorusCommitter::commit(const EaxEffectProps &props) { using Committer = ChorusFlangerEffect<EaxChorusTraits>; - return Committer::Commit(props, props_, al_effect_props_); + return Committer::Commit(props, mEaxProps, mAlProps); } template<> @@ -695,7 +695,7 @@ template<> bool FlangerCommitter::commit(const EaxEffectProps &props) { using Committer = ChorusFlangerEffect<EaxFlangerTraits>; - return Committer::Commit(props, props_, al_effect_props_); + return Committer::Commit(props, mEaxProps, mAlProps); } template<> diff --git a/al/effects/compressor.cpp b/al/effects/compressor.cpp index ecd43f2f..2d219df6 100644 --- a/al/effects/compressor.cpp +++ b/al/effects/compressor.cpp @@ -118,12 +118,12 @@ template<> template<> bool CompressorCommitter::commit(const EaxEffectProps &props) { - const auto orig = props_; - props_ = props; - if(orig.mType == props_.mType && orig.mCompressor.ulOnOff == props_.mCompressor.ulOnOff) + const auto orig = mEaxProps; + mEaxProps = props; + if(orig.mType == mEaxProps.mType && orig.mCompressor.ulOnOff == mEaxProps.mCompressor.ulOnOff) return false; - al_effect_props_.Compressor.OnOff = (props_.mCompressor.ulOnOff != 0); + mAlProps.Compressor.OnOff = (mEaxProps.mCompressor.ulOnOff != 0); return true; } diff --git a/al/effects/distortion.cpp b/al/effects/distortion.cpp index a0f4d924..6125c2a4 100644 --- a/al/effects/distortion.cpp +++ b/al/effects/distortion.cpp @@ -207,21 +207,21 @@ template<> template<> bool DistortionCommitter::commit(const EaxEffectProps &props) { - const auto orig = props_; - props_ = props; - - if(orig.mType == props_.mType && props_.mDistortion.flEdge == props.mDistortion.flEdge - && props_.mDistortion.lGain == props.mDistortion.lGain - && props_.mDistortion.flLowPassCutOff == props.mDistortion.flLowPassCutOff - && props_.mDistortion.flEQCenter == props.mDistortion.flEQCenter - && props_.mDistortion.flEQBandwidth == props.mDistortion.flEQBandwidth) + const auto orig = mEaxProps; + mEaxProps = props; + + if(orig.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; - al_effect_props_.Distortion.Edge = props_.mDistortion.flEdge; - al_effect_props_.Distortion.Gain = level_mb_to_gain(static_cast<float>(props_.mDistortion.lGain)); - al_effect_props_.Distortion.LowpassCutoff = props_.mDistortion.flLowPassCutOff; - al_effect_props_.Distortion.EQCenter = props_.mDistortion.flEQCenter; - al_effect_props_.Distortion.EQBandwidth = props_.mDistortion.flEdge; + 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; return true; } diff --git a/al/effects/echo.cpp b/al/effects/echo.cpp index 3a83b24f..be12c621 100644 --- a/al/effects/echo.cpp +++ b/al/effects/echo.cpp @@ -204,21 +204,21 @@ template<> template<> bool EchoCommitter::commit(const EaxEffectProps &props) { - const auto orig = props_; - props_ = props; - - if(orig.mType == props_.mType && props_.mEcho.flDelay == props.mEcho.flDelay - && props_.mEcho.flLRDelay == props.mEcho.flLRDelay - && props_.mEcho.flDamping == props.mEcho.flDamping - && props_.mEcho.flFeedback == props.mEcho.flFeedback - && props_.mEcho.flSpread == props.mEcho.flSpread) + const auto orig = mEaxProps; + mEaxProps = props; + + if(orig.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; - al_effect_props_.Echo.Delay = props_.mEcho.flDelay; - al_effect_props_.Echo.LRDelay = props_.mEcho.flLRDelay; - al_effect_props_.Echo.Damping = props_.mEcho.flDamping; - al_effect_props_.Echo.Feedback = props_.mEcho.flFeedback; - al_effect_props_.Echo.Spread = props_.mEcho.flSpread; + 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; return true; } diff --git a/al/effects/equalizer.cpp b/al/effects/equalizer.cpp index 2ef048f9..5eea9e6d 100644 --- a/al/effects/equalizer.cpp +++ b/al/effects/equalizer.cpp @@ -322,31 +322,31 @@ template<> template<> bool EqualizerCommitter::commit(const EaxEffectProps &props) { - const auto orig = props_; - props_ = props; - - if(orig.mType == props_.mType && props_.mEqualizer.lLowGain == props.mEqualizer.lLowGain - && props_.mEqualizer.flLowCutOff == props.mEqualizer.flLowCutOff - && props_.mEqualizer.lMid1Gain == props.mEqualizer.lMid1Gain - && props_.mEqualizer.flMid1Center == props.mEqualizer.flMid1Center - && props_.mEqualizer.flMid1Width == props.mEqualizer.flMid1Width - && props_.mEqualizer.lMid2Gain == props.mEqualizer.lMid2Gain - && props_.mEqualizer.flMid2Center == props.mEqualizer.flMid2Center - && props_.mEqualizer.flMid2Width == props.mEqualizer.flMid2Width - && props_.mEqualizer.lHighGain == props.mEqualizer.lHighGain - && props_.mEqualizer.flHighCutOff == props.mEqualizer.flHighCutOff) + const auto orig = mEaxProps; + mEaxProps = props; + + if(orig.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 + && mEaxProps.mEqualizer.flMid1Width == props.mEqualizer.flMid1Width + && mEaxProps.mEqualizer.lMid2Gain == props.mEqualizer.lMid2Gain + && mEaxProps.mEqualizer.flMid2Center == props.mEqualizer.flMid2Center + && mEaxProps.mEqualizer.flMid2Width == props.mEqualizer.flMid2Width + && mEaxProps.mEqualizer.lHighGain == props.mEqualizer.lHighGain + && mEaxProps.mEqualizer.flHighCutOff == props.mEqualizer.flHighCutOff) return false; - al_effect_props_.Equalizer.LowGain = level_mb_to_gain(static_cast<float>(props_.mEqualizer.lLowGain)); - al_effect_props_.Equalizer.LowCutoff = props_.mEqualizer.flLowCutOff; - al_effect_props_.Equalizer.Mid1Gain = level_mb_to_gain(static_cast<float>(props_.mEqualizer.lMid1Gain)); - al_effect_props_.Equalizer.Mid1Center = props_.mEqualizer.flMid1Center; - al_effect_props_.Equalizer.Mid1Width = props_.mEqualizer.flMid1Width; - al_effect_props_.Equalizer.Mid2Gain = level_mb_to_gain(static_cast<float>(props_.mEqualizer.lMid2Gain)); - al_effect_props_.Equalizer.Mid2Center = props_.mEqualizer.flMid2Center; - al_effect_props_.Equalizer.Mid2Width = props_.mEqualizer.flMid2Width; - al_effect_props_.Equalizer.HighGain = level_mb_to_gain(static_cast<float>(props_.mEqualizer.lHighGain)); - al_effect_props_.Equalizer.HighCutoff = props_.mEqualizer.flHighCutOff; + 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; return true; } diff --git a/al/effects/fshifter.cpp b/al/effects/fshifter.cpp index f4c42bf7..983e83ee 100644 --- a/al/effects/fshifter.cpp +++ b/al/effects/fshifter.cpp @@ -200,13 +200,13 @@ template<> template<> bool FrequencyShifterCommitter::commit(const EaxEffectProps &props) { - const auto orig = props_; - props_ = props; + const auto orig = mEaxProps; + mEaxProps = props; - if(orig.mType == props_.mType - && props_.mFrequencyShifter.flFrequency == props.mFrequencyShifter.flFrequency - && props_.mFrequencyShifter.ulLeftDirection == props.mFrequencyShifter.ulLeftDirection - && props_.mFrequencyShifter.ulRightDirection == props.mFrequencyShifter.ulRightDirection) + if(orig.mType == mEaxProps.mType + && mEaxProps.mFrequencyShifter.flFrequency == props.mFrequencyShifter.flFrequency + && mEaxProps.mFrequencyShifter.ulLeftDirection == props.mFrequencyShifter.ulLeftDirection + && mEaxProps.mFrequencyShifter.ulRightDirection == props.mFrequencyShifter.ulRightDirection) return false; auto get_direction = [](unsigned long dir) noexcept @@ -218,9 +218,9 @@ bool FrequencyShifterCommitter::commit(const EaxEffectProps &props) return FShifterDirection::Off; }; - al_effect_props_.Fshifter.Frequency = props_.mFrequencyShifter.flFrequency; - al_effect_props_.Fshifter.LeftDirection = get_direction(props_.mFrequencyShifter.ulLeftDirection); - al_effect_props_.Fshifter.RightDirection = get_direction(props_.mFrequencyShifter.ulRightDirection); + mAlProps.Fshifter.Frequency = mEaxProps.mFrequencyShifter.flFrequency; + mAlProps.Fshifter.LeftDirection = get_direction(mEaxProps.mFrequencyShifter.ulLeftDirection); + mAlProps.Fshifter.RightDirection = get_direction(mEaxProps.mFrequencyShifter.ulRightDirection); return true; } diff --git a/al/effects/modulator.cpp b/al/effects/modulator.cpp index f3e43c52..8b6b1045 100644 --- a/al/effects/modulator.cpp +++ b/al/effects/modulator.cpp @@ -206,12 +206,13 @@ template<> template<> bool ModulatorCommitter::commit(const EaxEffectProps &props) { - const auto orig = props_; - props_ = props; + const auto orig = mEaxProps; + mEaxProps = props; - if(orig.mType == props_.mType && props_.mModulator.flFrequency == props.mModulator.flFrequency - && props_.mModulator.flHighPassCutOff == props.mModulator.flHighPassCutOff - && props_.mModulator.ulWaveform == props.mModulator.ulWaveform) + if(orig.mType == mEaxProps.mType + && mEaxProps.mModulator.flFrequency == props.mModulator.flFrequency + && mEaxProps.mModulator.flHighPassCutOff == props.mModulator.flHighPassCutOff + && mEaxProps.mModulator.ulWaveform == props.mModulator.ulWaveform) return false; auto get_waveform = [](unsigned long form) @@ -225,9 +226,9 @@ bool ModulatorCommitter::commit(const EaxEffectProps &props) return ModulatorWaveform::Sinusoid; }; - al_effect_props_.Modulator.Frequency = props_.mModulator.flFrequency; - al_effect_props_.Modulator.HighPassCutoff = props_.mModulator.flHighPassCutOff; - al_effect_props_.Modulator.Waveform = get_waveform(props_.mModulator.ulWaveform); + mAlProps.Modulator.Frequency = mEaxProps.mModulator.flFrequency; + mAlProps.Modulator.HighPassCutoff = mEaxProps.mModulator.flHighPassCutOff; + mAlProps.Modulator.Waveform = get_waveform(mEaxProps.mModulator.ulWaveform); return true; } diff --git a/al/effects/null.cpp b/al/effects/null.cpp index e80ab9f8..0bbc183a 100644 --- a/al/effects/null.cpp +++ b/al/effects/null.cpp @@ -120,8 +120,8 @@ template<> template<> bool NullCommitter::commit(const EaxEffectProps &props) { - const bool ret{props.mType != props_.mType}; - props_ = props; + const bool ret{props.mType != mEaxProps.mType}; + mEaxProps = props; return ret; } diff --git a/al/effects/pshifter.cpp b/al/effects/pshifter.cpp index 53115edb..7c9f0b0e 100644 --- a/al/effects/pshifter.cpp +++ b/al/effects/pshifter.cpp @@ -141,16 +141,16 @@ template<> template<> bool PitchShifterCommitter::commit(const EaxEffectProps &props) { - const auto orig = props_; - props_ = props; + const auto orig = mEaxProps; + mEaxProps = props; - if(orig.mType == props_.mType - && props_.mPitchShifter.lCoarseTune == props.mPitchShifter.lCoarseTune - && props_.mPitchShifter.lFineTune == props.mPitchShifter.lFineTune) + if(orig.mType == mEaxProps.mType + && mEaxProps.mPitchShifter.lCoarseTune == props.mPitchShifter.lCoarseTune + && mEaxProps.mPitchShifter.lFineTune == props.mPitchShifter.lFineTune) return false; - al_effect_props_.Pshifter.CoarseTune = static_cast<ALint>(props_.mPitchShifter.lCoarseTune); - al_effect_props_.Pshifter.FineTune = static_cast<ALint>(props_.mPitchShifter.lFineTune); + mAlProps.Pshifter.CoarseTune = static_cast<ALint>(mEaxProps.mPitchShifter.lCoarseTune); + mAlProps.Pshifter.FineTune = static_cast<ALint>(mEaxProps.mPitchShifter.lFineTune); return true; } diff --git a/al/effects/reverb.cpp b/al/effects/reverb.cpp index b154e3ff..3b04d86c 100644 --- a/al/effects/reverb.cpp +++ b/al/effects/reverb.cpp @@ -1156,66 +1156,66 @@ bool EaxReverbCommitter::commit(const EAXREVERBPROPERTIES &props) bool EaxReverbCommitter::commit(const EaxEffectProps &props) { - const auto orig = props_; - props_ = props; - if(orig.mType == props_.mType && memcmp(&orig.mReverb, &props_.mReverb, sizeof(props_.mReverb)) == 0) + const auto orig = mEaxProps; + mEaxProps = props; + if(orig.mType == mEaxProps.mType && memcmp(&orig.mReverb, &mEaxProps.mReverb, sizeof(mEaxProps.mReverb)) == 0) return false; - const auto size = props_.mReverb.flEnvironmentSize; + const auto size = mEaxProps.mReverb.flEnvironmentSize; const auto density = (size * size * size) / 16.0F; - al_effect_props_.Reverb.Density = clamp(density, + mAlProps.Reverb.Density = clamp(density, AL_EAXREVERB_MIN_DENSITY, AL_EAXREVERB_MAX_DENSITY); - al_effect_props_.Reverb.Diffusion = clamp(props_.mReverb.flEnvironmentDiffusion, + mAlProps.Reverb.Diffusion = clamp(mEaxProps.mReverb.flEnvironmentDiffusion, AL_EAXREVERB_MIN_DIFFUSION, AL_EAXREVERB_MAX_DIFFUSION); - al_effect_props_.Reverb.Gain = clamp( - level_mb_to_gain(static_cast<float>(props_.mReverb.lRoom)), + mAlProps.Reverb.Gain = clamp( + level_mb_to_gain(static_cast<float>(mEaxProps.mReverb.lRoom)), AL_EAXREVERB_MIN_GAIN, AL_EAXREVERB_MAX_GAIN); - al_effect_props_.Reverb.GainHF = clamp( - level_mb_to_gain(static_cast<float>(props_.mReverb.lRoomHF)), + mAlProps.Reverb.GainHF = clamp( + level_mb_to_gain(static_cast<float>(mEaxProps.mReverb.lRoomHF)), AL_EAXREVERB_MIN_GAINHF, AL_EAXREVERB_MAX_GAINHF); - al_effect_props_.Reverb.GainLF = clamp( - level_mb_to_gain(static_cast<float>(props_.mReverb.lRoomLF)), + mAlProps.Reverb.GainLF = clamp( + level_mb_to_gain(static_cast<float>(mEaxProps.mReverb.lRoomLF)), AL_EAXREVERB_MIN_GAINLF, AL_EAXREVERB_MAX_GAINLF); - al_effect_props_.Reverb.DecayTime = clamp(props_.mReverb.flDecayTime, + mAlProps.Reverb.DecayTime = clamp(mEaxProps.mReverb.flDecayTime, AL_EAXREVERB_MIN_DECAY_TIME, AL_EAXREVERB_MAX_DECAY_TIME); - al_effect_props_.Reverb.DecayHFRatio = clamp(props_.mReverb.flDecayHFRatio, + mAlProps.Reverb.DecayHFRatio = clamp(mEaxProps.mReverb.flDecayHFRatio, AL_EAXREVERB_MIN_DECAY_HFRATIO, AL_EAXREVERB_MAX_DECAY_HFRATIO); - al_effect_props_.Reverb.DecayLFRatio = clamp(props_.mReverb.flDecayLFRatio, + mAlProps.Reverb.DecayLFRatio = clamp(mEaxProps.mReverb.flDecayLFRatio, AL_EAXREVERB_MIN_DECAY_LFRATIO, AL_EAXREVERB_MAX_DECAY_LFRATIO); - al_effect_props_.Reverb.ReflectionsGain = clamp( - level_mb_to_gain(static_cast<float>(props_.mReverb.lReflections)), + mAlProps.Reverb.ReflectionsGain = clamp( + level_mb_to_gain(static_cast<float>(mEaxProps.mReverb.lReflections)), AL_EAXREVERB_MIN_REFLECTIONS_GAIN, AL_EAXREVERB_MAX_REFLECTIONS_GAIN); - al_effect_props_.Reverb.ReflectionsDelay = clamp(props_.mReverb.flReflectionsDelay, + mAlProps.Reverb.ReflectionsDelay = clamp(mEaxProps.mReverb.flReflectionsDelay, AL_EAXREVERB_MIN_REFLECTIONS_DELAY, AL_EAXREVERB_MAX_REFLECTIONS_DELAY); - al_effect_props_.Reverb.ReflectionsPan[0] = props_.mReverb.vReflectionsPan.x; - al_effect_props_.Reverb.ReflectionsPan[1] = props_.mReverb.vReflectionsPan.y; - al_effect_props_.Reverb.ReflectionsPan[2] = props_.mReverb.vReflectionsPan.z; - al_effect_props_.Reverb.LateReverbGain = clamp( - level_mb_to_gain(static_cast<float>(props_.mReverb.lReverb)), + 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 = clamp( + level_mb_to_gain(static_cast<float>(mEaxProps.mReverb.lReverb)), AL_EAXREVERB_MIN_LATE_REVERB_GAIN, AL_EAXREVERB_MAX_LATE_REVERB_GAIN); - al_effect_props_.Reverb.LateReverbDelay = clamp(props_.mReverb.flReverbDelay, + mAlProps.Reverb.LateReverbDelay = clamp(mEaxProps.mReverb.flReverbDelay, AL_EAXREVERB_MIN_LATE_REVERB_DELAY, AL_EAXREVERB_MAX_LATE_REVERB_DELAY); - al_effect_props_.Reverb.LateReverbPan[0] = props_.mReverb.vReverbPan.x; - al_effect_props_.Reverb.LateReverbPan[1] = props_.mReverb.vReverbPan.y; - al_effect_props_.Reverb.LateReverbPan[2] = props_.mReverb.vReverbPan.z; - al_effect_props_.Reverb.EchoTime = clamp(props_.mReverb.flEchoTime, + 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 = clamp(mEaxProps.mReverb.flEchoTime, AL_EAXREVERB_MIN_ECHO_TIME, AL_EAXREVERB_MAX_ECHO_TIME); - al_effect_props_.Reverb.EchoDepth = clamp(props_.mReverb.flEchoDepth, + mAlProps.Reverb.EchoDepth = clamp(mEaxProps.mReverb.flEchoDepth, AL_EAXREVERB_MIN_ECHO_DEPTH, AL_EAXREVERB_MAX_ECHO_DEPTH); - al_effect_props_.Reverb.ModulationTime = clamp(props_.mReverb.flModulationTime, + mAlProps.Reverb.ModulationTime = clamp(mEaxProps.mReverb.flModulationTime, AL_EAXREVERB_MIN_MODULATION_TIME, AL_EAXREVERB_MAX_MODULATION_TIME); - al_effect_props_.Reverb.ModulationDepth = clamp(props_.mReverb.flModulationDepth, + mAlProps.Reverb.ModulationDepth = clamp(mEaxProps.mReverb.flModulationDepth, AL_EAXREVERB_MIN_MODULATION_DEPTH, AL_EAXREVERB_MAX_MODULATION_DEPTH); - al_effect_props_.Reverb.AirAbsorptionGainHF = clamp( - level_mb_to_gain(props_.mReverb.flAirAbsorptionHF), + mAlProps.Reverb.AirAbsorptionGainHF = clamp( + level_mb_to_gain(mEaxProps.mReverb.flAirAbsorptionHF), AL_EAXREVERB_MIN_AIR_ABSORPTION_GAINHF, AL_EAXREVERB_MAX_AIR_ABSORPTION_GAINHF); - al_effect_props_.Reverb.HFReference = clamp(props_.mReverb.flHFReference, + mAlProps.Reverb.HFReference = clamp(mEaxProps.mReverb.flHFReference, AL_EAXREVERB_MIN_HFREFERENCE, AL_EAXREVERB_MAX_HFREFERENCE); - al_effect_props_.Reverb.LFReference = clamp(props_.mReverb.flLFReference, + mAlProps.Reverb.LFReference = clamp(mEaxProps.mReverb.flLFReference, AL_EAXREVERB_MIN_LFREFERENCE, AL_EAXREVERB_MAX_LFREFERENCE); - al_effect_props_.Reverb.RoomRolloffFactor = clamp(props_.mReverb.flRoomRolloffFactor, + mAlProps.Reverb.RoomRolloffFactor = clamp(mEaxProps.mReverb.flRoomRolloffFactor, AL_EAXREVERB_MIN_ROOM_ROLLOFF_FACTOR, AL_EAXREVERB_MAX_ROOM_ROLLOFF_FACTOR); - al_effect_props_.Reverb.DecayHFLimit = ((props_.mReverb.ulFlags & EAXREVERBFLAGS_DECAYHFLIMIT) != 0); + mAlProps.Reverb.DecayHFLimit = ((mEaxProps.mReverb.ulFlags & EAXREVERBFLAGS_DECAYHFLIMIT) != 0); return true; } diff --git a/al/effects/vmorpher.cpp b/al/effects/vmorpher.cpp index f8be5856..856fc6b3 100644 --- a/al/effects/vmorpher.cpp +++ b/al/effects/vmorpher.cpp @@ -355,16 +355,16 @@ template<> template<> bool VocalMorpherCommitter::commit(const EaxEffectProps &props) { - const auto orig = props_; - props_ = props; - - if(orig.mType == props_.mType - && props_.mVocalMorpher.ulPhonemeA == props.mVocalMorpher.ulPhonemeA - && props_.mVocalMorpher.lPhonemeACoarseTuning == props.mVocalMorpher.lPhonemeACoarseTuning - && props_.mVocalMorpher.ulPhonemeB == props.mVocalMorpher.ulPhonemeB - && props_.mVocalMorpher.lPhonemeBCoarseTuning == props.mVocalMorpher.lPhonemeBCoarseTuning - && props_.mVocalMorpher.ulWaveform == props.mVocalMorpher.ulWaveform - && props_.mVocalMorpher.flRate == props.mVocalMorpher.flRate) + const auto orig = mEaxProps; + mEaxProps = props; + + if(orig.mType == mEaxProps.mType + && mEaxProps.mVocalMorpher.ulPhonemeA == props.mVocalMorpher.ulPhonemeA + && mEaxProps.mVocalMorpher.lPhonemeACoarseTuning == props.mVocalMorpher.lPhonemeACoarseTuning + && mEaxProps.mVocalMorpher.ulPhonemeB == props.mVocalMorpher.ulPhonemeB + && mEaxProps.mVocalMorpher.lPhonemeBCoarseTuning == props.mVocalMorpher.lPhonemeBCoarseTuning + && mEaxProps.mVocalMorpher.ulWaveform == props.mVocalMorpher.ulWaveform + && mEaxProps.mVocalMorpher.flRate == props.mVocalMorpher.flRate) return false; auto get_phoneme = [](unsigned long phoneme) noexcept @@ -414,12 +414,12 @@ bool VocalMorpherCommitter::commit(const EaxEffectProps &props) return VMorpherWaveform::Sinusoid; }; - al_effect_props_.Vmorpher.PhonemeA = get_phoneme(props_.mVocalMorpher.ulPhonemeA); - al_effect_props_.Vmorpher.PhonemeACoarseTuning = static_cast<ALint>(props_.mVocalMorpher.lPhonemeACoarseTuning); - al_effect_props_.Vmorpher.PhonemeB = get_phoneme(props_.mVocalMorpher.ulPhonemeB); - al_effect_props_.Vmorpher.PhonemeBCoarseTuning = static_cast<ALint>(props_.mVocalMorpher.lPhonemeBCoarseTuning); - al_effect_props_.Vmorpher.Waveform = get_waveform(props_.mVocalMorpher.ulWaveform); - al_effect_props_.Vmorpher.Rate = props_.mVocalMorpher.flRate; + 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; return true; } |