aboutsummaryrefslogtreecommitdiffstats
path: root/al/effects/compressor.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/compressor.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/compressor.cpp')
-rw-r--r--al/effects/compressor.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/al/effects/compressor.cpp b/al/effects/compressor.cpp
index 6dc96a20..9c4308f4 100644
--- a/al/effects/compressor.cpp
+++ b/al/effects/compressor.cpp
@@ -115,14 +115,14 @@ template<>
throw Exception{message};
}
-bool EaxCompressorCommitter::commit(const EaxEffectProps &props)
+bool EaxCompressorCommitter::commit(const EAXAGCCOMPRESSORPROPERTIES &props)
{
- if(props == mEaxProps)
+ if(auto *cur = std::get_if<EAXAGCCOMPRESSORPROPERTIES>(&mEaxProps); cur && *cur == props)
return false;
mEaxProps = props;
- mAlProps.Compressor.OnOff = (std::get<EAXAGCCOMPRESSORPROPERTIES>(props).ulOnOff != 0);
+ mAlProps.Compressor.OnOff = props.ulOnOff != 0;
return true;
}
@@ -131,9 +131,8 @@ void EaxCompressorCommitter::SetDefaults(EaxEffectProps &props)
props = EAXAGCCOMPRESSORPROPERTIES{EAXAGCCOMPRESSOR_DEFAULTONOFF};
}
-void EaxCompressorCommitter::Get(const EaxCall &call, const EaxEffectProps &props_)
+void EaxCompressorCommitter::Get(const EaxCall &call, const EAXAGCCOMPRESSORPROPERTIES &props)
{
- auto &props = std::get<EAXAGCCOMPRESSORPROPERTIES>(props_);
switch(call.get_property_id())
{
case EAXAGCCOMPRESSOR_NONE: break;
@@ -143,9 +142,8 @@ void EaxCompressorCommitter::Get(const EaxCall &call, const EaxEffectProps &prop
}
}
-void EaxCompressorCommitter::Set(const EaxCall &call, EaxEffectProps &props_)
+void EaxCompressorCommitter::Set(const EaxCall &call, EAXAGCCOMPRESSORPROPERTIES &props)
{
- auto &props = std::get<EAXAGCCOMPRESSORPROPERTIES>(props_);
switch(call.get_property_id())
{
case EAXAGCCOMPRESSOR_NONE: break;