aboutsummaryrefslogtreecommitdiffstats
path: root/alc/effects
diff options
context:
space:
mode:
Diffstat (limited to 'alc/effects')
-rw-r--r--alc/effects/chorus.cpp21
-rw-r--r--alc/effects/dedicated.cpp5
-rw-r--r--alc/effects/distortion.cpp5
-rw-r--r--alc/effects/echo.cpp9
-rw-r--r--alc/effects/fshifter.cpp9
-rw-r--r--alc/effects/pshifter.cpp5
6 files changed, 24 insertions, 30 deletions
diff --git a/alc/effects/chorus.cpp b/alc/effects/chorus.cpp
index 97ab85d1..418c5d2d 100644
--- a/alc/effects/chorus.cpp
+++ b/alc/effects/chorus.cpp
@@ -110,12 +110,12 @@ void ChorusState::update(const ALCcontext *Context, const ALeffectslot *Slot, co
switch(props->Chorus.Waveform)
{
- case AL_CHORUS_WAVEFORM_TRIANGLE:
- mWaveform = WaveForm::Triangle;
- break;
- case AL_CHORUS_WAVEFORM_SINUSOID:
- mWaveform = WaveForm::Sinusoid;
- break;
+ case AL_CHORUS_WAVEFORM_TRIANGLE:
+ mWaveform = WaveForm::Triangle;
+ break;
+ case AL_CHORUS_WAVEFORM_SINUSOID:
+ mWaveform = WaveForm::Sinusoid;
+ break;
}
/* The LFO depth is scaled to be relative to the sample delay. Clamp the
@@ -131,13 +131,12 @@ void ChorusState::update(const ALCcontext *Context, const ALeffectslot *Slot, co
mFeedback = props->Chorus.Feedback;
/* Gains for left and right sides */
- float coeffs[2][MAX_AMBI_CHANNELS];
- CalcDirectionCoeffs({-1.0f, 0.0f, 0.0f}, 0.0f, coeffs[0]);
- CalcDirectionCoeffs({ 1.0f, 0.0f, 0.0f}, 0.0f, coeffs[1]);
+ const auto lcoeffs = CalcDirectionCoeffs({-1.0f, 0.0f, 0.0f}, 0.0f);
+ const auto rcoeffs = CalcDirectionCoeffs({ 1.0f, 0.0f, 0.0f}, 0.0f);
mOutTarget = target.Main->Buffer;
- ComputePanGains(target.Main, coeffs[0], Slot->Params.Gain, mGains[0].Target);
- ComputePanGains(target.Main, coeffs[1], Slot->Params.Gain, mGains[1].Target);
+ ComputePanGains(target.Main, lcoeffs.data(), Slot->Params.Gain, mGains[0].Target);
+ ComputePanGains(target.Main, rcoeffs.data(), Slot->Params.Gain, mGains[1].Target);
float rate{props->Chorus.Rate};
if(!(rate > 0.0f))
diff --git a/alc/effects/dedicated.cpp b/alc/effects/dedicated.cpp
index c1741f64..2f985412 100644
--- a/alc/effects/dedicated.cpp
+++ b/alc/effects/dedicated.cpp
@@ -78,11 +78,10 @@ void DedicatedState::update(const ALCcontext*, const ALeffectslot *slot, const E
}
else
{
- float coeffs[MAX_AMBI_CHANNELS];
- CalcDirectionCoeffs({0.0f, 0.0f, -1.0f}, 0.0f, coeffs);
+ const auto coeffs = CalcDirectionCoeffs({0.0f, 0.0f, -1.0f}, 0.0f);
mOutTarget = target.Main->Buffer;
- ComputePanGains(target.Main, coeffs, Gain, mTargetGains);
+ ComputePanGains(target.Main, coeffs.data(), Gain, mTargetGains);
}
}
}
diff --git a/alc/effects/distortion.cpp b/alc/effects/distortion.cpp
index 565c5bbd..93f0e006 100644
--- a/alc/effects/distortion.cpp
+++ b/alc/effects/distortion.cpp
@@ -82,11 +82,10 @@ void DistortionState::update(const ALCcontext *context, const ALeffectslot *slot
bandwidth = props->Distortion.EQBandwidth / (cutoff * 0.67f);
mBandpass.setParamsFromBandwidth(BiquadType::BandPass, cutoff/frequency/4.0f, 1.0f, bandwidth);
- float coeffs[MAX_AMBI_CHANNELS];
- CalcDirectionCoeffs({0.0f, 0.0f, -1.0f}, 0.0f, coeffs);
+ const auto coeffs = CalcDirectionCoeffs({0.0f, 0.0f, -1.0f}, 0.0f);
mOutTarget = target.Main->Buffer;
- ComputePanGains(target.Main, coeffs, slot->Params.Gain*props->Distortion.Gain, mGain);
+ ComputePanGains(target.Main, coeffs.data(), slot->Params.Gain*props->Distortion.Gain, mGain);
}
void DistortionState::process(const size_t samplesToDo, const al::span<const FloatBufferLine> samplesIn, const al::span<FloatBufferLine> samplesOut)
diff --git a/alc/effects/echo.cpp b/alc/effects/echo.cpp
index e14dc5cb..b53f4f30 100644
--- a/alc/effects/echo.cpp
+++ b/alc/effects/echo.cpp
@@ -99,13 +99,12 @@ void EchoState::update(const ALCcontext *context, const ALeffectslot *slot, cons
/* Convert echo spread (where 0 = center, +/-1 = sides) to angle. */
const float angle{std::asin(props->Echo.Spread)};
- float coeffs[2][MAX_AMBI_CHANNELS];
- CalcAngleCoeffs(-angle, 0.0f, 0.0f, coeffs[0]);
- CalcAngleCoeffs( angle, 0.0f, 0.0f, coeffs[1]);
+ const auto coeffs0 = CalcAngleCoeffs(-angle, 0.0f, 0.0f);
+ const auto coeffs1 = CalcAngleCoeffs( angle, 0.0f, 0.0f);
mOutTarget = target.Main->Buffer;
- ComputePanGains(target.Main, coeffs[0], slot->Params.Gain, mGains[0].Target);
- ComputePanGains(target.Main, coeffs[1], slot->Params.Gain, mGains[1].Target);
+ ComputePanGains(target.Main, coeffs0.data(), slot->Params.Gain, mGains[0].Target);
+ ComputePanGains(target.Main, coeffs1.data(), slot->Params.Gain, mGains[1].Target);
}
void EchoState::process(const size_t samplesToDo, const al::span<const FloatBufferLine> samplesIn, const al::span<FloatBufferLine> samplesOut)
diff --git a/alc/effects/fshifter.cpp b/alc/effects/fshifter.cpp
index c2ed5fb2..1e7d1962 100644
--- a/alc/effects/fshifter.cpp
+++ b/alc/effects/fshifter.cpp
@@ -148,13 +148,12 @@ void FshifterState::update(const ALCcontext *context, const ALeffectslot *slot,
break;
}
- float coeffs[2][MAX_AMBI_CHANNELS];
- CalcDirectionCoeffs({-1.0f, 0.0f, 0.0f}, 0.0f, coeffs[0]);
- CalcDirectionCoeffs({ 1.0f, 0.0f, 0.0f}, 0.0f, coeffs[1]);
+ const auto lcoeffs = CalcDirectionCoeffs({-1.0f, 0.0f, 0.0f}, 0.0f);
+ const auto rcoeffs = CalcDirectionCoeffs({ 1.0f, 0.0f, 0.0f}, 0.0f);
mOutTarget = target.Main->Buffer;
- ComputePanGains(target.Main, coeffs[0], slot->Params.Gain, mGains[0].Target);
- ComputePanGains(target.Main, coeffs[1], slot->Params.Gain, mGains[1].Target);
+ ComputePanGains(target.Main, lcoeffs.data(), slot->Params.Gain, mGains[0].Target);
+ ComputePanGains(target.Main, rcoeffs.data(), slot->Params.Gain, mGains[1].Target);
}
void FshifterState::process(const size_t samplesToDo, const al::span<const FloatBufferLine> samplesIn, const al::span<FloatBufferLine> samplesOut)
diff --git a/alc/effects/pshifter.cpp b/alc/effects/pshifter.cpp
index 136558d5..375681df 100644
--- a/alc/effects/pshifter.cpp
+++ b/alc/effects/pshifter.cpp
@@ -130,11 +130,10 @@ void PshifterState::update(const ALCcontext*, const ALeffectslot *slot, const Ef
mPitchShiftI = fastf2u(pitch*FRACTIONONE);
mPitchShift = mPitchShiftI * double{1.0/FRACTIONONE};
- float coeffs[MAX_AMBI_CHANNELS];
- CalcDirectionCoeffs({0.0f, 0.0f, -1.0f}, 0.0f, coeffs);
+ const auto coeffs = CalcDirectionCoeffs({0.0f, 0.0f, -1.0f}, 0.0f);
mOutTarget = target.Main->Buffer;
- ComputePanGains(target.Main, coeffs, slot->Params.Gain, mTargetGains);
+ ComputePanGains(target.Main, coeffs.data(), slot->Params.Gain, mTargetGains);
}
void PshifterState::process(const size_t samplesToDo, const al::span<const FloatBufferLine> samplesIn, const al::span<FloatBufferLine> samplesOut)