diff options
author | Chris Robinson <[email protected]> | 2019-02-21 02:57:39 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-02-21 02:57:39 -0800 |
commit | 4b4041319d6e3b32529b901641166052e37d56d4 (patch) | |
tree | 1baaf7a07718283827a735998e87679b2893676e /Alc/effects/pshifter.cpp | |
parent | 7e00f646d9bd79bdeb9b9435288c273db55f7c41 (diff) |
Pass the number of input channels to EffectState::process
Diffstat (limited to 'Alc/effects/pshifter.cpp')
-rw-r--r-- | Alc/effects/pshifter.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Alc/effects/pshifter.cpp b/Alc/effects/pshifter.cpp index 31d40abc..c76cd6a8 100644 --- a/Alc/effects/pshifter.cpp +++ b/Alc/effects/pshifter.cpp @@ -145,7 +145,7 @@ struct ALpshifterState final : public EffectState { ALboolean deviceUpdate(const ALCdevice *device) override; void update(const ALCcontext *context, const ALeffectslot *slot, const ALeffectProps *props, const EffectTarget target) override; - void process(ALsizei samplesToDo, const ALfloat (*RESTRICT samplesIn)[BUFFERSIZE], ALfloat (*RESTRICT samplesOut)[BUFFERSIZE], ALsizei numChannels) override; + void process(ALsizei samplesToDo, const ALfloat (*RESTRICT samplesIn)[BUFFERSIZE], const ALsizei numInput, ALfloat (*RESTRICT samplesOut)[BUFFERSIZE], const ALsizei numOutput) override; DEF_NEWDEL(ALpshifterState) }; @@ -189,7 +189,7 @@ void ALpshifterState::update(const ALCcontext* UNUSED(context), const ALeffectsl ComputePanGains(target.Main, coeffs, slot->Params.Gain, mTargetGains); } -void ALpshifterState::process(ALsizei SamplesToDo, const ALfloat (*RESTRICT SamplesIn)[BUFFERSIZE], ALfloat (*RESTRICT SamplesOut)[BUFFERSIZE], ALsizei NumChannels) +void ALpshifterState::process(ALsizei samplesToDo, const ALfloat (*RESTRICT samplesIn)[BUFFERSIZE], const ALsizei /*numInput*/, ALfloat (*RESTRICT samplesOut)[BUFFERSIZE], const ALsizei numOutput) { /* Pitch shifter engine based on the work of Stephan Bernsee. * http://blogs.zynaptiq.com/bernsee/pitch-shifting-using-the-ft/ @@ -200,15 +200,15 @@ void ALpshifterState::process(ALsizei SamplesToDo, const ALfloat (*RESTRICT Samp ALfloat *RESTRICT bufferOut{mBufferOut}; ALsizei count{mCount}; - for(ALsizei i{0};i < SamplesToDo;) + for(ALsizei i{0};i < samplesToDo;) { do { /* Fill FIFO buffer with samples data */ - mInFIFO[count] = SamplesIn[0][i]; + mInFIFO[count] = samplesIn[0][i]; bufferOut[i] = mOutFIFO[count - FIFO_LATENCY]; count++; - } while(++i < SamplesToDo && count < STFT_SIZE); + } while(++i < samplesToDo && count < STFT_SIZE); /* Check whether FIFO buffer is filled */ if(count < STFT_SIZE) break; @@ -313,8 +313,8 @@ void ALpshifterState::process(ALsizei SamplesToDo, const ALfloat (*RESTRICT Samp mCount = count; /* Now, mix the processed sound data to the output. */ - MixSamples(bufferOut, NumChannels, SamplesOut, mCurrentGains, mTargetGains, - maxi(SamplesToDo, 512), 0, SamplesToDo); + MixSamples(bufferOut, numOutput, samplesOut, mCurrentGains, mTargetGains, + maxi(samplesToDo, 512), 0, samplesToDo); } } // namespace |