aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/effects/distortion.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-03-22 12:58:24 -0700
committerChris Robinson <[email protected]>2019-03-22 12:58:24 -0700
commitf951f4a66b3e9cc8db7ab190b8443fa6c834fee7 (patch)
treeae4f1a19e93810d42f5b2b98446fe83b8cc2b1b2 /Alc/effects/distortion.cpp
parent935f386982f9d0d94fdf569b0cb1aa43fbfadefa (diff)
Implement getDefaultProps for effect state factories
Diffstat (limited to 'Alc/effects/distortion.cpp')
-rw-r--r--Alc/effects/distortion.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/Alc/effects/distortion.cpp b/Alc/effects/distortion.cpp
index ce403e8e..3b1df2d5 100644
--- a/Alc/effects/distortion.cpp
+++ b/Alc/effects/distortion.cpp
@@ -33,6 +33,8 @@
#include "filters/biquad.h"
+namespace {
+
struct ALdistortionState final : public EffectState {
/* Effect gains for each channel */
ALfloat mGain[MAX_OUTPUT_CHANNELS]{};
@@ -164,11 +166,25 @@ void ALdistortionState::process(ALsizei samplesToDo, const ALfloat (*RESTRICT sa
struct DistortionStateFactory final : public EffectStateFactory {
EffectState *create() override;
+ ALeffectProps getDefaultProps() const noexcept override;
};
EffectState *DistortionStateFactory::create()
{ return new ALdistortionState{}; }
+ALeffectProps DistortionStateFactory::getDefaultProps() const noexcept
+{
+ ALeffectProps props{};
+ props.Distortion.Edge = AL_DISTORTION_DEFAULT_EDGE;
+ props.Distortion.Gain = AL_DISTORTION_DEFAULT_GAIN;
+ props.Distortion.LowpassCutoff = AL_DISTORTION_DEFAULT_LOWPASS_CUTOFF;
+ props.Distortion.EQCenter = AL_DISTORTION_DEFAULT_EQCENTER;
+ props.Distortion.EQBandwidth = AL_DISTORTION_DEFAULT_EQBANDWIDTH;
+ return props;
+}
+
+} // namespace
+
EffectStateFactory *DistortionStateFactory_getFactory()
{
static DistortionStateFactory DistortionFactory{};