aboutsummaryrefslogtreecommitdiffstats
path: root/al/effects/equalizer.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-12-23 00:11:26 -0800
committerChris Robinson <[email protected]>2023-12-23 00:11:26 -0800
commitd7304c49a1d2cea2dae0ae38fdd9706dbcdb561f (patch)
tree251aede4876ca8d143fb1d1e6aedb4e3cc4f2818 /al/effects/equalizer.cpp
parentc253a4353227be00ecd7995b8c7443ebfcd6d5a9 (diff)
Pass the effect props directly to the eax committer functions
Rather than the variant that was already checked for what it's holding.
Diffstat (limited to 'al/effects/equalizer.cpp')
-rw-r--r--al/effects/equalizer.cpp31
1 files changed, 14 insertions, 17 deletions
diff --git a/al/effects/equalizer.cpp b/al/effects/equalizer.cpp
index b16be2a5..921d1090 100644
--- a/al/effects/equalizer.cpp
+++ b/al/effects/equalizer.cpp
@@ -319,24 +319,23 @@ template<>
throw Exception{message};
}
-bool EaxEqualizerCommitter::commit(const EaxEffectProps &props)
+bool EaxEqualizerCommitter::commit(const EAXEQUALIZERPROPERTIES &props)
{
- if(props == mEaxProps)
+ if(auto *cur = std::get_if<EAXEQUALIZERPROPERTIES>(&mEaxProps); cur && *cur == props)
return false;
mEaxProps = props;
- auto &eaxprops = std::get<EAXEQUALIZERPROPERTIES>(props);
- mAlProps.Equalizer.LowGain = level_mb_to_gain(static_cast<float>(eaxprops.lLowGain));
- mAlProps.Equalizer.LowCutoff = eaxprops.flLowCutOff;
- mAlProps.Equalizer.Mid1Gain = level_mb_to_gain(static_cast<float>(eaxprops.lMid1Gain));
- mAlProps.Equalizer.Mid1Center = eaxprops.flMid1Center;
- mAlProps.Equalizer.Mid1Width = eaxprops.flMid1Width;
- mAlProps.Equalizer.Mid2Gain = level_mb_to_gain(static_cast<float>(eaxprops.lMid2Gain));
- mAlProps.Equalizer.Mid2Center = eaxprops.flMid2Center;
- mAlProps.Equalizer.Mid2Width = eaxprops.flMid2Width;
- mAlProps.Equalizer.HighGain = level_mb_to_gain(static_cast<float>(eaxprops.lHighGain));
- mAlProps.Equalizer.HighCutoff = eaxprops.flHighCutOff;
+ mAlProps.Equalizer.LowGain = level_mb_to_gain(static_cast<float>(props.lLowGain));
+ mAlProps.Equalizer.LowCutoff = props.flLowCutOff;
+ mAlProps.Equalizer.Mid1Gain = level_mb_to_gain(static_cast<float>(props.lMid1Gain));
+ mAlProps.Equalizer.Mid1Center = props.flMid1Center;
+ mAlProps.Equalizer.Mid1Width = props.flMid1Width;
+ mAlProps.Equalizer.Mid2Gain = level_mb_to_gain(static_cast<float>(props.lMid2Gain));
+ mAlProps.Equalizer.Mid2Center = props.flMid2Center;
+ mAlProps.Equalizer.Mid2Width = props.flMid2Width;
+ mAlProps.Equalizer.HighGain = level_mb_to_gain(static_cast<float>(props.lHighGain));
+ mAlProps.Equalizer.HighCutoff = props.flHighCutOff;
return true;
}
@@ -361,9 +360,8 @@ void EaxEqualizerCommitter::SetDefaults(EaxEffectProps &props)
props = defprops;
}
-void EaxEqualizerCommitter::Get(const EaxCall &call, const EaxEffectProps &props_)
+void EaxEqualizerCommitter::Get(const EaxCall &call, const EAXEQUALIZERPROPERTIES &props)
{
- auto &props = std::get<EAXEQUALIZERPROPERTIES>(props_);
switch(call.get_property_id())
{
case EAXEQUALIZER_NONE: break;
@@ -382,9 +380,8 @@ void EaxEqualizerCommitter::Get(const EaxCall &call, const EaxEffectProps &props
}
}
-void EaxEqualizerCommitter::Set(const EaxCall &call, EaxEffectProps &props_)
+void EaxEqualizerCommitter::Set(const EaxCall &call, EAXEQUALIZERPROPERTIES &props)
{
- auto &props = std::get<EAXEQUALIZERPROPERTIES>(props_);
switch(call.get_property_id())
{
case EAXEQUALIZER_NONE: break;