aboutsummaryrefslogtreecommitdiffstats
path: root/al/effects/echo.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/echo.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/echo.cpp')
-rw-r--r--al/effects/echo.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/al/effects/echo.cpp b/al/effects/echo.cpp
index bfec6885..90f109da 100644
--- a/al/effects/echo.cpp
+++ b/al/effects/echo.cpp
@@ -201,19 +201,18 @@ template<>
throw Exception{message};
}
-bool EaxEchoCommitter::commit(const EaxEffectProps &props)
+bool EaxEchoCommitter::commit(const EAXECHOPROPERTIES &props)
{
- if(props == mEaxProps)
+ if(auto *cur = std::get_if<EAXECHOPROPERTIES>(&mEaxProps); cur && *cur == props)
return false;
mEaxProps = props;
- auto &eaxprops = std::get<EAXECHOPROPERTIES>(props);
- mAlProps.Echo.Delay = eaxprops.flDelay;
- mAlProps.Echo.LRDelay = eaxprops.flLRDelay;
- mAlProps.Echo.Damping = eaxprops.flDamping;
- mAlProps.Echo.Feedback = eaxprops.flFeedback;
- mAlProps.Echo.Spread = eaxprops.flSpread;
+ mAlProps.Echo.Delay = props.flDelay;
+ mAlProps.Echo.LRDelay = props.flLRDelay;
+ mAlProps.Echo.Damping = props.flDamping;
+ mAlProps.Echo.Feedback = props.flFeedback;
+ mAlProps.Echo.Spread = props.flSpread;
return true;
}
@@ -233,9 +232,8 @@ void EaxEchoCommitter::SetDefaults(EaxEffectProps &props)
props = defprops;
}
-void EaxEchoCommitter::Get(const EaxCall &call, const EaxEffectProps &props_)
+void EaxEchoCommitter::Get(const EaxCall &call, const EAXECHOPROPERTIES &props)
{
- auto &props = std::get<EAXECHOPROPERTIES>(props_);
switch(call.get_property_id())
{
case EAXECHO_NONE: break;
@@ -249,9 +247,8 @@ void EaxEchoCommitter::Get(const EaxCall &call, const EaxEffectProps &props_)
}
}
-void EaxEchoCommitter::Set(const EaxCall &call, EaxEffectProps &props_)
+void EaxEchoCommitter::Set(const EaxCall &call, EAXECHOPROPERTIES &props)
{
- auto &props = std::get<EAXECHOPROPERTIES>(props_);
switch(call.get_property_id())
{
case EAXECHO_NONE: break;