From d7304c49a1d2cea2dae0ae38fdd9706dbcdb561f Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 23 Dec 2023 00:11:26 -0800 Subject: Pass the effect props directly to the eax committer functions Rather than the variant that was already checked for what it's holding. --- al/effects/compressor.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'al/effects/compressor.cpp') 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(&mEaxProps); cur && *cur == props) return false; mEaxProps = props; - mAlProps.Compressor.OnOff = (std::get(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(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(props_); switch(call.get_property_id()) { case EAXAGCCOMPRESSOR_NONE: break; -- cgit v1.2.3