aboutsummaryrefslogtreecommitdiffstats
path: root/al/effects/compressor.cpp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-11-28 12:51:46 +0100
committerSven Gothel <[email protected]>2023-11-28 12:51:46 +0100
commit1aaf4f070011490bcece50394b9b32dfa593fd9e (patch)
tree17d68284e401a35eea3d3a574d986d446a60763a /al/effects/compressor.cpp
parent6e7cee4fa9a8af03f28ca26cd89f8357390dfc90 (diff)
parent571b546f35eead77ce109f8d4dd6c3de3199d573 (diff)
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'al/effects/compressor.cpp')
-rw-r--r--al/effects/compressor.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/al/effects/compressor.cpp b/al/effects/compressor.cpp
index a4aa8e77..ca8af84f 100644
--- a/al/effects/compressor.cpp
+++ b/al/effects/compressor.cpp
@@ -118,43 +118,43 @@ template<>
template<>
bool CompressorCommitter::commit(const EaxEffectProps &props)
{
- if(props.mType == mEaxProps.mType
- && props.mCompressor.ulOnOff == mEaxProps.mCompressor.ulOnOff)
+ if(props == mEaxProps)
return false;
mEaxProps = props;
- mAlProps.Compressor.OnOff = (props.mCompressor.ulOnOff != 0);
+ mAlProps.Compressor.OnOff = (std::get<EAXAGCCOMPRESSORPROPERTIES>(props).ulOnOff != 0);
return true;
}
template<>
void CompressorCommitter::SetDefaults(EaxEffectProps &props)
{
- props.mType = EaxEffectType::Compressor;
- props.mCompressor.ulOnOff = EAXAGCCOMPRESSOR_DEFAULTONOFF;
+ props = EAXAGCCOMPRESSORPROPERTIES{EAXAGCCOMPRESSOR_DEFAULTONOFF};
}
template<>
-void CompressorCommitter::Get(const EaxCall &call, const EaxEffectProps &props)
+void CompressorCommitter::Get(const EaxCall &call, const EaxEffectProps &props_)
{
+ auto &props = std::get<EAXAGCCOMPRESSORPROPERTIES>(props_);
switch(call.get_property_id())
{
case EAXAGCCOMPRESSOR_NONE: break;
- case EAXAGCCOMPRESSOR_ALLPARAMETERS: call.set_value<Exception>(props.mCompressor); break;
- case EAXAGCCOMPRESSOR_ONOFF: call.set_value<Exception>(props.mCompressor.ulOnOff); break;
+ case EAXAGCCOMPRESSOR_ALLPARAMETERS: call.set_value<Exception>(props); break;
+ case EAXAGCCOMPRESSOR_ONOFF: call.set_value<Exception>(props.ulOnOff); break;
default: fail_unknown_property_id();
}
}
template<>
-void CompressorCommitter::Set(const EaxCall &call, EaxEffectProps &props)
+void CompressorCommitter::Set(const EaxCall &call, EaxEffectProps &props_)
{
+ auto &props = std::get<EAXAGCCOMPRESSORPROPERTIES>(props_);
switch(call.get_property_id())
{
case EAXAGCCOMPRESSOR_NONE: break;
- case EAXAGCCOMPRESSOR_ALLPARAMETERS: defer<AllValidator>(call, props.mCompressor); break;
- case EAXAGCCOMPRESSOR_ONOFF: defer<OnOffValidator>(call, props.mCompressor.ulOnOff); break;
+ case EAXAGCCOMPRESSOR_ALLPARAMETERS: defer<AllValidator>(call, props); break;
+ case EAXAGCCOMPRESSOR_ONOFF: defer<OnOffValidator>(call, props.ulOnOff); break;
default: fail_unknown_property_id();
}
}