aboutsummaryrefslogtreecommitdiffstats
path: root/al/effects/distortion.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'al/effects/distortion.cpp')
-rw-r--r--al/effects/distortion.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/al/effects/distortion.cpp b/al/effects/distortion.cpp
index 9142398b..bec2af53 100644
--- a/al/effects/distortion.cpp
+++ b/al/effects/distortion.cpp
@@ -204,19 +204,18 @@ template<>
throw Exception{message};
}
-bool EaxDistortionCommitter::commit(const EaxEffectProps &props)
+bool EaxDistortionCommitter::commit(const EAXDISTORTIONPROPERTIES &props)
{
- if(props == mEaxProps)
+ if(auto *cur = std::get_if<EAXDISTORTIONPROPERTIES>(&mEaxProps); cur && *cur == props)
return false;
mEaxProps = props;
- auto &eaxprops = std::get<EAXDISTORTIONPROPERTIES>(props);
- mAlProps.Distortion.Edge = eaxprops.flEdge;
- mAlProps.Distortion.Gain = level_mb_to_gain(static_cast<float>(eaxprops.lGain));
- mAlProps.Distortion.LowpassCutoff = eaxprops.flLowPassCutOff;
- mAlProps.Distortion.EQCenter = eaxprops.flEQCenter;
- mAlProps.Distortion.EQBandwidth = eaxprops.flEdge;
+ mAlProps.Distortion.Edge = props.flEdge;
+ mAlProps.Distortion.Gain = level_mb_to_gain(static_cast<float>(props.lGain));
+ mAlProps.Distortion.LowpassCutoff = props.flLowPassCutOff;
+ mAlProps.Distortion.EQCenter = props.flEQCenter;
+ mAlProps.Distortion.EQBandwidth = props.flEdge;
return true;
}
@@ -236,9 +235,8 @@ void EaxDistortionCommitter::SetDefaults(EaxEffectProps &props)
props = defprops;
}
-void EaxDistortionCommitter::Get(const EaxCall &call, const EaxEffectProps &props_)
+void EaxDistortionCommitter::Get(const EaxCall &call, const EAXDISTORTIONPROPERTIES &props)
{
- auto &props = std::get<EAXDISTORTIONPROPERTIES>(props_);
switch(call.get_property_id())
{
case EAXDISTORTION_NONE: break;
@@ -252,9 +250,8 @@ void EaxDistortionCommitter::Get(const EaxCall &call, const EaxEffectProps &prop
}
}
-void EaxDistortionCommitter::Set(const EaxCall &call, EaxEffectProps &props_)
+void EaxDistortionCommitter::Set(const EaxCall &call, EAXDISTORTIONPROPERTIES &props)
{
- auto &props = std::get<EAXDISTORTIONPROPERTIES>(props_);
switch(call.get_property_id())
{
case EAXDISTORTION_NONE: break;