aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/effects/chorus.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-05-29 21:58:37 -0700
committerChris Robinson <[email protected]>2019-05-29 21:58:37 -0700
commit893ffe9a84d497d38e6e472b0cffbd9c37e0c366 (patch)
treee86cb9f28857507a54aad958e8c4a9dd361c3e28 /Alc/effects/chorus.cpp
parent8af7b4c6e0ddaf4d66455702a7ede0c9036f3825 (diff)
Use span<FloatBufferLine> for MixSamples
Diffstat (limited to 'Alc/effects/chorus.cpp')
-rw-r--r--Alc/effects/chorus.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/Alc/effects/chorus.cpp b/Alc/effects/chorus.cpp
index e953d3e3..cdbb2036 100644
--- a/Alc/effects/chorus.cpp
+++ b/Alc/effects/chorus.cpp
@@ -205,10 +205,9 @@ void ChorusState::process(const ALsizei samplesToDo, const FloatBufferLine *REST
const ALsizei avgdelay{(mDelay + (FRACTIONONE>>1)) >> FRACTIONBITS};
ALfloat *RESTRICT delaybuf{mSampleBuffer.data()};
ALsizei offset{mOffset};
- ALsizei i, c;
- ALsizei base;
- for(base = 0;base < samplesToDo;)
+ const al::span<FloatBufferLine> output{samplesOut, samplesOut+numOutput};
+ for(ALsizei base{0};base < samplesToDo;)
{
const ALsizei todo = mini(256, samplesToDo-base);
ALint moddelays[2][256];
@@ -230,7 +229,7 @@ void ChorusState::process(const ALsizei samplesToDo, const FloatBufferLine *REST
}
mLfoOffset = (mLfoOffset+todo) % mLfoRange;
- for(i = 0;i < todo;i++)
+ for(ALsizei i{0};i < todo;i++)
{
// Feed the buffer's input first (necessary for delays < 1).
delaybuf[offset&bufmask] = samplesIn[0][base+i];
@@ -254,10 +253,9 @@ void ChorusState::process(const ALsizei samplesToDo, const FloatBufferLine *REST
offset++;
}
- for(c = 0;c < 2;c++)
- MixSamples(temps[c], numOutput,
- &reinterpret_cast<ALfloat(&)[BUFFERSIZE]>(samplesOut[0]), mGains[c].Current,
- mGains[c].Target, samplesToDo-base, base, todo);
+ for(ALsizei c{0};c < 2;c++)
+ MixSamples(temps[c], output, mGains[c].Current, mGains[c].Target, samplesToDo-base,
+ base, todo);
base += todo;
}