aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
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
parent935f386982f9d0d94fdf569b0cb1aa43fbfadefa (diff)
Implement getDefaultProps for effect state factories
Diffstat (limited to 'Alc')
-rw-r--r--Alc/effects/autowah.cpp15
-rw-r--r--Alc/effects/chorus.cpp49
-rw-r--r--Alc/effects/compressor.cpp12
-rw-r--r--Alc/effects/dedicated.cpp12
-rw-r--r--Alc/effects/distortion.cpp16
-rw-r--r--Alc/effects/echo.cpp16
-rw-r--r--Alc/effects/equalizer.cpp20
-rw-r--r--Alc/effects/fshifter.cpp13
-rw-r--r--Alc/effects/modulator.cpp24
-rw-r--r--Alc/effects/null.cpp14
-rw-r--r--Alc/effects/pshifter.cpp12
-rw-r--r--Alc/effects/reverb.cpp81
12 files changed, 267 insertions, 17 deletions
diff --git a/Alc/effects/autowah.cpp b/Alc/effects/autowah.cpp
index 06628e25..03747796 100644
--- a/Alc/effects/autowah.cpp
+++ b/Alc/effects/autowah.cpp
@@ -33,6 +33,8 @@
#include "filters/biquad.h"
#include "vecmat.h"
+namespace {
+
#define MIN_FREQ 20.0f
#define MAX_FREQ 2500.0f
#define Q_FACTOR 5.0f
@@ -199,11 +201,24 @@ void ALautowahState::process(ALsizei samplesToDo, const ALfloat (*RESTRICT sampl
struct AutowahStateFactory final : public EffectStateFactory {
EffectState *create() override;
+ ALeffectProps getDefaultProps() const noexcept override;
};
EffectState *AutowahStateFactory::create()
{ return new ALautowahState{}; }
+ALeffectProps AutowahStateFactory::getDefaultProps() const noexcept
+{
+ ALeffectProps props{};
+ props.Autowah.AttackTime = AL_AUTOWAH_DEFAULT_ATTACK_TIME;
+ props.Autowah.ReleaseTime = AL_AUTOWAH_DEFAULT_RELEASE_TIME;
+ props.Autowah.Resonance = AL_AUTOWAH_DEFAULT_RESONANCE;
+ props.Autowah.PeakGain = AL_AUTOWAH_DEFAULT_PEAK_GAIN;
+ return props;
+}
+
+} // namespace
+
EffectStateFactory *AutowahStateFactory_getFactory()
{
static AutowahStateFactory AutowahFactory{};
diff --git a/Alc/effects/chorus.cpp b/Alc/effects/chorus.cpp
index 758d521c..bd32a3d1 100644
--- a/Alc/effects/chorus.cpp
+++ b/Alc/effects/chorus.cpp
@@ -258,11 +258,47 @@ void ChorusState::process(ALsizei samplesToDo, const ALfloat (*RESTRICT samplesI
struct ChorusStateFactory final : public EffectStateFactory {
EffectState *create() override;
+ ALeffectProps getDefaultProps() const noexcept override;
};
EffectState *ChorusStateFactory::create()
{ return new ChorusState{}; }
+ALeffectProps ChorusStateFactory::getDefaultProps() const noexcept
+{
+ ALeffectProps props{};
+ props.Chorus.Waveform = AL_CHORUS_DEFAULT_WAVEFORM;
+ props.Chorus.Phase = AL_CHORUS_DEFAULT_PHASE;
+ props.Chorus.Rate = AL_CHORUS_DEFAULT_RATE;
+ props.Chorus.Depth = AL_CHORUS_DEFAULT_DEPTH;
+ props.Chorus.Feedback = AL_CHORUS_DEFAULT_FEEDBACK;
+ props.Chorus.Delay = AL_CHORUS_DEFAULT_DELAY;
+ return props;
+}
+
+/* Flanger is basically a chorus with a really short delay. They can both use
+ * the same processing functions, so piggyback flanger on the chorus functions.
+ */
+struct FlangerStateFactory final : public EffectStateFactory {
+ EffectState *create() override;
+ ALeffectProps getDefaultProps() const noexcept override;
+};
+
+EffectState *FlangerStateFactory::create()
+{ return new ChorusState{}; }
+
+ALeffectProps FlangerStateFactory::getDefaultProps() const noexcept
+{
+ ALeffectProps props{};
+ props.Chorus.Waveform = AL_FLANGER_DEFAULT_WAVEFORM;
+ props.Chorus.Phase = AL_FLANGER_DEFAULT_PHASE;
+ props.Chorus.Rate = AL_FLANGER_DEFAULT_RATE;
+ props.Chorus.Depth = AL_FLANGER_DEFAULT_DEPTH;
+ props.Chorus.Feedback = AL_FLANGER_DEFAULT_FEEDBACK;
+ props.Chorus.Delay = AL_FLANGER_DEFAULT_DELAY;
+ return props;
+}
+
} // namespace
EffectStateFactory *ChorusStateFactory_getFactory()
@@ -271,6 +307,12 @@ EffectStateFactory *ChorusStateFactory_getFactory()
return &ChorusFactory;
}
+EffectStateFactory *FlangerStateFactory_getFactory()
+{
+ static FlangerStateFactory FlangerFactory{};
+ return &FlangerFactory;
+}
+
void ALchorus_setParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val)
{
@@ -381,13 +423,6 @@ void ALchorus_getParamfv(const ALeffect *effect, ALCcontext *context, ALenum par
DEFINE_ALEFFECT_VTABLE(ALchorus);
-/* Flanger is basically a chorus with a really short delay. They can both use
- * the same processing functions, so piggyback flanger on the chorus functions.
- */
-EffectStateFactory *FlangerStateFactory_getFactory()
-{ return ChorusStateFactory_getFactory(); }
-
-
void ALflanger_setParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val)
{
ALeffectProps *props = &effect->Props;
diff --git a/Alc/effects/compressor.cpp b/Alc/effects/compressor.cpp
index 12a8c886..d6cb3f4a 100644
--- a/Alc/effects/compressor.cpp
+++ b/Alc/effects/compressor.cpp
@@ -30,6 +30,8 @@
#include "vecmat.h"
+namespace {
+
#define AMP_ENVELOPE_MIN 0.5f
#define AMP_ENVELOPE_MAX 2.0f
@@ -159,11 +161,21 @@ void ALcompressorState::process(ALsizei samplesToDo, const ALfloat (*RESTRICT sa
struct CompressorStateFactory final : public EffectStateFactory {
EffectState *create() override;
+ ALeffectProps getDefaultProps() const noexcept override;
};
EffectState *CompressorStateFactory::create()
{ return new ALcompressorState{}; }
+ALeffectProps CompressorStateFactory::getDefaultProps() const noexcept
+{
+ ALeffectProps props{};
+ props.Compressor.OnOff = AL_COMPRESSOR_DEFAULT_ONOFF;
+ return props;
+}
+
+} // namespace
+
EffectStateFactory *CompressorStateFactory_getFactory()
{
static CompressorStateFactory CompressorFactory{};
diff --git a/Alc/effects/dedicated.cpp b/Alc/effects/dedicated.cpp
index 8cc4b936..041e951b 100644
--- a/Alc/effects/dedicated.cpp
+++ b/Alc/effects/dedicated.cpp
@@ -31,6 +31,8 @@
#include "alu.h"
+namespace {
+
struct ALdedicatedState final : public EffectState {
ALfloat mCurrentGains[MAX_OUTPUT_CHANNELS];
ALfloat mTargetGains[MAX_OUTPUT_CHANNELS];
@@ -97,11 +99,21 @@ void ALdedicatedState::process(ALsizei samplesToDo, const ALfloat (*RESTRICT sam
struct DedicatedStateFactory final : public EffectStateFactory {
EffectState *create() override;
+ ALeffectProps getDefaultProps() const noexcept override;
};
EffectState *DedicatedStateFactory::create()
{ return new ALdedicatedState{}; }
+ALeffectProps DedicatedStateFactory::getDefaultProps() const noexcept
+{
+ ALeffectProps props{};
+ props.Dedicated.Gain = 1.0f;
+ return props;
+}
+
+} // namespace
+
EffectStateFactory *DedicatedStateFactory_getFactory()
{
static DedicatedStateFactory DedicatedFactory{};
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{};
diff --git a/Alc/effects/echo.cpp b/Alc/effects/echo.cpp
index 1325e015..e866181d 100644
--- a/Alc/effects/echo.cpp
+++ b/Alc/effects/echo.cpp
@@ -35,6 +35,8 @@
#include "vector.h"
+namespace {
+
struct ALechoState final : public EffectState {
al::vector<ALfloat,16> mSampleBuffer;
@@ -175,11 +177,25 @@ void ALechoState::process(ALsizei samplesToDo, const ALfloat (*RESTRICT samplesI
struct EchoStateFactory final : public EffectStateFactory {
EffectState *create() override;
+ ALeffectProps getDefaultProps() const noexcept override;
};
EffectState *EchoStateFactory::create()
{ return new ALechoState{}; }
+ALeffectProps EchoStateFactory::getDefaultProps() const noexcept
+{
+ ALeffectProps props{};
+ props.Echo.Delay = AL_ECHO_DEFAULT_DELAY;
+ props.Echo.LRDelay = AL_ECHO_DEFAULT_LRDELAY;
+ props.Echo.Damping = AL_ECHO_DEFAULT_DAMPING;
+ props.Echo.Feedback = AL_ECHO_DEFAULT_FEEDBACK;
+ props.Echo.Spread = AL_ECHO_DEFAULT_SPREAD;
+ return props;
+}
+
+} // namespace
+
EffectStateFactory *EchoStateFactory_getFactory()
{
static EchoStateFactory EchoFactory{};
diff --git a/Alc/effects/equalizer.cpp b/Alc/effects/equalizer.cpp
index c4d2e53f..27a5539c 100644
--- a/Alc/effects/equalizer.cpp
+++ b/Alc/effects/equalizer.cpp
@@ -173,15 +173,33 @@ void ALequalizerState::process(ALsizei samplesToDo, const ALfloat (*RESTRICT sam
}
}
-} // namespace
struct EqualizerStateFactory final : public EffectStateFactory {
EffectState *create() override;
+ ALeffectProps getDefaultProps() const noexcept override;
};
EffectState *EqualizerStateFactory::create()
{ return new ALequalizerState{}; }
+ALeffectProps EqualizerStateFactory::getDefaultProps() const noexcept
+{
+ ALeffectProps props{};
+ props.Equalizer.LowCutoff = AL_EQUALIZER_DEFAULT_LOW_CUTOFF;
+ props.Equalizer.LowGain = AL_EQUALIZER_DEFAULT_LOW_GAIN;
+ props.Equalizer.Mid1Center = AL_EQUALIZER_DEFAULT_MID1_CENTER;
+ props.Equalizer.Mid1Gain = AL_EQUALIZER_DEFAULT_MID1_GAIN;
+ props.Equalizer.Mid1Width = AL_EQUALIZER_DEFAULT_MID1_WIDTH;
+ props.Equalizer.Mid2Center = AL_EQUALIZER_DEFAULT_MID2_CENTER;
+ props.Equalizer.Mid2Gain = AL_EQUALIZER_DEFAULT_MID2_GAIN;
+ props.Equalizer.Mid2Width = AL_EQUALIZER_DEFAULT_MID2_WIDTH;
+ props.Equalizer.HighCutoff = AL_EQUALIZER_DEFAULT_HIGH_CUTOFF;
+ props.Equalizer.HighGain = AL_EQUALIZER_DEFAULT_HIGH_GAIN;
+ return props;
+}
+
+} // namespace
+
EffectStateFactory *EqualizerStateFactory_getFactory()
{
static EqualizerStateFactory EqualizerFactory{};
diff --git a/Alc/effects/fshifter.cpp b/Alc/effects/fshifter.cpp
index 21d3a706..ea24b477 100644
--- a/Alc/effects/fshifter.cpp
+++ b/Alc/effects/fshifter.cpp
@@ -202,15 +202,26 @@ void ALfshifterState::process(ALsizei samplesToDo, const ALfloat (*RESTRICT samp
maxi(samplesToDo, 512), 0, samplesToDo);
}
-} // namespace
struct FshifterStateFactory final : public EffectStateFactory {
EffectState *create() override;
+ ALeffectProps getDefaultProps() const noexcept override;
};
EffectState *FshifterStateFactory::create()
{ return new ALfshifterState{}; }
+ALeffectProps FshifterStateFactory::getDefaultProps() const noexcept
+{
+ ALeffectProps props{};
+ props.Fshifter.Frequency = AL_FREQUENCY_SHIFTER_DEFAULT_FREQUENCY;
+ props.Fshifter.LeftDirection = AL_FREQUENCY_SHIFTER_DEFAULT_LEFT_DIRECTION;
+ props.Fshifter.RightDirection = AL_FREQUENCY_SHIFTER_DEFAULT_RIGHT_DIRECTION;
+ return props;
+}
+
+} // namespace
+
EffectStateFactory *FshifterStateFactory_getFactory()
{
static FshifterStateFactory FshifterFactory{};
diff --git a/Alc/effects/modulator.cpp b/Alc/effects/modulator.cpp
index 6bfab546..f0c43d17 100644
--- a/Alc/effects/modulator.cpp
+++ b/Alc/effects/modulator.cpp
@@ -35,34 +35,36 @@
#include "vecmat.h"
+namespace {
+
#define MAX_UPDATE_SAMPLES 128
#define WAVEFORM_FRACBITS 24
#define WAVEFORM_FRACONE (1<<WAVEFORM_FRACBITS)
#define WAVEFORM_FRACMASK (WAVEFORM_FRACONE-1)
-static inline ALfloat Sin(ALsizei index)
+inline ALfloat Sin(ALsizei index)
{
return std::sin(static_cast<ALfloat>(index) * (al::MathDefs<float>::Tau() / static_cast<ALfloat>WAVEFORM_FRACONE));
}
-static inline ALfloat Saw(ALsizei index)
+inline ALfloat Saw(ALsizei index)
{
return static_cast<ALfloat>(index)*(2.0f/WAVEFORM_FRACONE) - 1.0f;
}
-static inline ALfloat Square(ALsizei index)
+inline ALfloat Square(ALsizei index)
{
return static_cast<ALfloat>(((index>>(WAVEFORM_FRACBITS-2))&2) - 1);
}
-static inline ALfloat One(ALsizei UNUSED(index))
+inline ALfloat One(ALsizei UNUSED(index))
{
return 1.0f;
}
template<ALfloat func(ALsizei)>
-static void Modulate(ALfloat *RESTRICT dst, ALsizei index, const ALsizei step, ALsizei todo)
+void Modulate(ALfloat *RESTRICT dst, ALsizei index, const ALsizei step, ALsizei todo)
{
ALsizei i;
for(i = 0;i < todo;i++)
@@ -173,11 +175,23 @@ void ALmodulatorState::process(ALsizei samplesToDo, const ALfloat (*RESTRICT sam
struct ModulatorStateFactory final : public EffectStateFactory {
EffectState *create() override;
+ ALeffectProps getDefaultProps() const noexcept override;
};
EffectState *ModulatorStateFactory::create()
{ return new ALmodulatorState{}; }
+ALeffectProps ModulatorStateFactory::getDefaultProps() const noexcept
+{
+ ALeffectProps props{};
+ props.Modulator.Frequency = AL_RING_MODULATOR_DEFAULT_FREQUENCY;
+ props.Modulator.HighPassCutoff = AL_RING_MODULATOR_DEFAULT_HIGHPASS_CUTOFF;
+ props.Modulator.Waveform = AL_RING_MODULATOR_DEFAULT_WAVEFORM;
+ return props;
+}
+
+} // namespace
+
EffectStateFactory *ModulatorStateFactory_getFactory()
{
static ModulatorStateFactory ModulatorFactory{};
diff --git a/Alc/effects/null.cpp b/Alc/effects/null.cpp
index 6c9e3008..0e9c982d 100644
--- a/Alc/effects/null.cpp
+++ b/Alc/effects/null.cpp
@@ -11,6 +11,8 @@
#include "alError.h"
+namespace {
+
struct ALnullState final : public EffectState {
ALnullState();
~ALnullState() override;
@@ -59,12 +61,22 @@ void ALnullState::process(ALsizei /*samplesToDo*/, const ALfloat (*RESTRICT /*sa
struct NullStateFactory final : public EffectStateFactory {
EffectState *create() override;
+ ALeffectProps getDefaultProps() const noexcept override;
};
-/* Creates ALeffectState objects of the appropriate type. */
+/* Creates EffectState objects of the appropriate type. */
EffectState *NullStateFactory::create()
{ return new ALnullState{}; }
+/* Returns an ALeffectProps initialized with this effect's default properties. */
+ALeffectProps NullStateFactory::getDefaultProps() const noexcept
+{
+ ALeffectProps props{};
+ return props;
+}
+
+} // namespace
+
EffectStateFactory *NullStateFactory_getFactory()
{
static NullStateFactory NullFactory{};
diff --git a/Alc/effects/pshifter.cpp b/Alc/effects/pshifter.cpp
index aa7dae87..05add42a 100644
--- a/Alc/effects/pshifter.cpp
+++ b/Alc/effects/pshifter.cpp
@@ -325,15 +325,25 @@ void ALpshifterState::process(ALsizei samplesToDo, const ALfloat (*RESTRICT samp
maxi(samplesToDo, 512), 0, samplesToDo);
}
-} // namespace
struct PshifterStateFactory final : public EffectStateFactory {
EffectState *create() override;
+ ALeffectProps getDefaultProps() const noexcept override;
};
EffectState *PshifterStateFactory::create()
{ return new ALpshifterState{}; }
+ALeffectProps PshifterStateFactory::getDefaultProps() const noexcept
+{
+ ALeffectProps props{};
+ props.Pshifter.CoarseTune = AL_PITCH_SHIFTER_DEFAULT_COARSE_TUNE;
+ props.Pshifter.FineTune = AL_PITCH_SHIFTER_DEFAULT_FINE_TUNE;
+ return props;
+}
+
+} // namespace
+
EffectStateFactory *PshifterStateFactory_getFactory()
{
static PshifterStateFactory PshifterFactory{};
diff --git a/Alc/effects/reverb.cpp b/Alc/effects/reverb.cpp
index b963c2d5..da28a2ce 100644
--- a/Alc/effects/reverb.cpp
+++ b/Alc/effects/reverb.cpp
@@ -1464,11 +1464,87 @@ void ReverbState::process(ALsizei samplesToDo, const ALfloat (*RESTRICT samplesI
struct ReverbStateFactory final : public EffectStateFactory {
EffectState *create() override;
+ ALeffectProps getDefaultProps() const noexcept override;
};
EffectState *ReverbStateFactory::create()
{ return new ReverbState{}; }
+ALeffectProps ReverbStateFactory::getDefaultProps() const noexcept
+{
+ ALeffectProps props{};
+ props.Reverb.Density = AL_EAXREVERB_DEFAULT_DENSITY;
+ props.Reverb.Diffusion = AL_EAXREVERB_DEFAULT_DIFFUSION;
+ props.Reverb.Gain = AL_EAXREVERB_DEFAULT_GAIN;
+ props.Reverb.GainHF = AL_EAXREVERB_DEFAULT_GAINHF;
+ props.Reverb.GainLF = AL_EAXREVERB_DEFAULT_GAINLF;
+ props.Reverb.DecayTime = AL_EAXREVERB_DEFAULT_DECAY_TIME;
+ props.Reverb.DecayHFRatio = AL_EAXREVERB_DEFAULT_DECAY_HFRATIO;
+ props.Reverb.DecayLFRatio = AL_EAXREVERB_DEFAULT_DECAY_LFRATIO;
+ props.Reverb.ReflectionsGain = AL_EAXREVERB_DEFAULT_REFLECTIONS_GAIN;
+ props.Reverb.ReflectionsDelay = AL_EAXREVERB_DEFAULT_REFLECTIONS_DELAY;
+ props.Reverb.ReflectionsPan[0] = AL_EAXREVERB_DEFAULT_REFLECTIONS_PAN_XYZ;
+ props.Reverb.ReflectionsPan[1] = AL_EAXREVERB_DEFAULT_REFLECTIONS_PAN_XYZ;
+ props.Reverb.ReflectionsPan[2] = AL_EAXREVERB_DEFAULT_REFLECTIONS_PAN_XYZ;
+ props.Reverb.LateReverbGain = AL_EAXREVERB_DEFAULT_LATE_REVERB_GAIN;
+ props.Reverb.LateReverbDelay = AL_EAXREVERB_DEFAULT_LATE_REVERB_DELAY;
+ props.Reverb.LateReverbPan[0] = AL_EAXREVERB_DEFAULT_LATE_REVERB_PAN_XYZ;
+ props.Reverb.LateReverbPan[1] = AL_EAXREVERB_DEFAULT_LATE_REVERB_PAN_XYZ;
+ props.Reverb.LateReverbPan[2] = AL_EAXREVERB_DEFAULT_LATE_REVERB_PAN_XYZ;
+ props.Reverb.EchoTime = AL_EAXREVERB_DEFAULT_ECHO_TIME;
+ props.Reverb.EchoDepth = AL_EAXREVERB_DEFAULT_ECHO_DEPTH;
+ props.Reverb.ModulationTime = AL_EAXREVERB_DEFAULT_MODULATION_TIME;
+ props.Reverb.ModulationDepth = AL_EAXREVERB_DEFAULT_MODULATION_DEPTH;
+ props.Reverb.AirAbsorptionGainHF = AL_EAXREVERB_DEFAULT_AIR_ABSORPTION_GAINHF;
+ props.Reverb.HFReference = AL_EAXREVERB_DEFAULT_HFREFERENCE;
+ props.Reverb.LFReference = AL_EAXREVERB_DEFAULT_LFREFERENCE;
+ props.Reverb.RoomRolloffFactor = AL_EAXREVERB_DEFAULT_ROOM_ROLLOFF_FACTOR;
+ props.Reverb.DecayHFLimit = AL_EAXREVERB_DEFAULT_DECAY_HFLIMIT;
+ return props;
+}
+
+
+struct StdReverbStateFactory final : public EffectStateFactory {
+ EffectState *create() override;
+ ALeffectProps getDefaultProps() const noexcept override;
+};
+
+EffectState *StdReverbStateFactory::create()
+{ return new ReverbState{}; }
+
+ALeffectProps StdReverbStateFactory::getDefaultProps() const noexcept
+{
+ ALeffectProps props{};
+ props.Reverb.Density = AL_REVERB_DEFAULT_DENSITY;
+ props.Reverb.Diffusion = AL_REVERB_DEFAULT_DIFFUSION;
+ props.Reverb.Gain = AL_REVERB_DEFAULT_GAIN;
+ props.Reverb.GainHF = AL_REVERB_DEFAULT_GAINHF;
+ props.Reverb.GainLF = 1.0f;
+ props.Reverb.DecayTime = AL_REVERB_DEFAULT_DECAY_TIME;
+ props.Reverb.DecayHFRatio = AL_REVERB_DEFAULT_DECAY_HFRATIO;
+ props.Reverb.DecayLFRatio = 1.0f;
+ props.Reverb.ReflectionsGain = AL_REVERB_DEFAULT_REFLECTIONS_GAIN;
+ props.Reverb.ReflectionsDelay = AL_REVERB_DEFAULT_REFLECTIONS_DELAY;
+ props.Reverb.ReflectionsPan[0] = 0.0f;
+ props.Reverb.ReflectionsPan[1] = 0.0f;
+ props.Reverb.ReflectionsPan[2] = 0.0f;
+ props.Reverb.LateReverbGain = AL_REVERB_DEFAULT_LATE_REVERB_GAIN;
+ props.Reverb.LateReverbDelay = AL_REVERB_DEFAULT_LATE_REVERB_DELAY;
+ props.Reverb.LateReverbPan[0] = 0.0f;
+ props.Reverb.LateReverbPan[1] = 0.0f;
+ props.Reverb.LateReverbPan[2] = 0.0f;
+ props.Reverb.EchoTime = 0.25f;
+ props.Reverb.EchoDepth = 0.0f;
+ props.Reverb.ModulationTime = 0.25f;
+ props.Reverb.ModulationDepth = 0.0f;
+ props.Reverb.AirAbsorptionGainHF = AL_REVERB_DEFAULT_AIR_ABSORPTION_GAINHF;
+ props.Reverb.HFReference = 5000.0f;
+ props.Reverb.LFReference = 250.0f;
+ props.Reverb.RoomRolloffFactor = AL_REVERB_DEFAULT_ROOM_ROLLOFF_FACTOR;
+ props.Reverb.DecayHFLimit = AL_REVERB_DEFAULT_DECAY_HFLIMIT;
+ return props;
+}
+
} // namespace
EffectStateFactory *ReverbStateFactory_getFactory()
@@ -1478,7 +1554,10 @@ EffectStateFactory *ReverbStateFactory_getFactory()
}
EffectStateFactory *StdReverbStateFactory_getFactory()
-{ return ReverbStateFactory_getFactory(); }
+{
+ static StdReverbStateFactory ReverbFactory{};
+ return &ReverbFactory;
+}
void ALeaxreverb_setParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val)