aboutsummaryrefslogtreecommitdiffstats
path: root/al/effects/fshifter.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/fshifter.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/fshifter.cpp')
-rw-r--r--al/effects/fshifter.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/al/effects/fshifter.cpp b/al/effects/fshifter.cpp
index 45253563..a6b3c86c 100644
--- a/al/effects/fshifter.cpp
+++ b/al/effects/fshifter.cpp
@@ -197,9 +197,9 @@ template<>
throw Exception{message};
}
-bool EaxFrequencyShifterCommitter::commit(const EaxEffectProps &props)
+bool EaxFrequencyShifterCommitter::commit(const EAXFREQUENCYSHIFTERPROPERTIES &props)
{
- if(props == mEaxProps)
+ if(auto *cur = std::get_if<EAXFREQUENCYSHIFTERPROPERTIES>(&mEaxProps); cur && *cur == props)
return false;
mEaxProps = props;
@@ -213,10 +213,9 @@ bool EaxFrequencyShifterCommitter::commit(const EaxEffectProps &props)
return FShifterDirection::Off;
};
- auto &eaxprops = std::get<EAXFREQUENCYSHIFTERPROPERTIES>(props);
- mAlProps.Fshifter.Frequency = eaxprops.flFrequency;
- mAlProps.Fshifter.LeftDirection = get_direction(eaxprops.ulLeftDirection);
- mAlProps.Fshifter.RightDirection = get_direction(eaxprops.ulRightDirection);
+ mAlProps.Fshifter.Frequency = props.flFrequency;
+ mAlProps.Fshifter.LeftDirection = get_direction(props.ulLeftDirection);
+ mAlProps.Fshifter.RightDirection = get_direction(props.ulRightDirection);
return true;
}
@@ -234,9 +233,8 @@ void EaxFrequencyShifterCommitter::SetDefaults(EaxEffectProps &props)
props = defprops;
}
-void EaxFrequencyShifterCommitter::Get(const EaxCall &call, const EaxEffectProps &props_)
+void EaxFrequencyShifterCommitter::Get(const EaxCall &call, const EAXFREQUENCYSHIFTERPROPERTIES &props)
{
- auto &props = std::get<EAXFREQUENCYSHIFTERPROPERTIES>(props_);
switch(call.get_property_id())
{
case EAXFREQUENCYSHIFTER_NONE: break;
@@ -248,9 +246,8 @@ void EaxFrequencyShifterCommitter::Get(const EaxCall &call, const EaxEffectProps
}
}
-void EaxFrequencyShifterCommitter::Set(const EaxCall &call, EaxEffectProps &props_)
+void EaxFrequencyShifterCommitter::Set(const EaxCall &call, EAXFREQUENCYSHIFTERPROPERTIES &props)
{
- auto &props = std::get<EAXFREQUENCYSHIFTERPROPERTIES>(props_);
switch(call.get_property_id())
{
case EAXFREQUENCYSHIFTER_NONE: break;