1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-28 02:30:05 +00:00

Replaced some uses of the now-deprecated AudioProcessor::getTotalNumInputChannels()

This commit is contained in:
jules 2015-12-23 09:43:10 +00:00
parent f7524d0d09
commit baab7546f4
8 changed files with 54 additions and 51 deletions

View file

@ -93,18 +93,21 @@ void FILTERCLASSNAME::releaseResources()
void FILTERCLASSNAME::processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages)
{
const int totalNumInputChannels = getTotalNumInputChannels();
const int totalNumOutputChannels = getTotalNumOutputChannels();
// In case we have more outputs than inputs, this code clears any output
// channels that didn't contain input data, (because these aren't
// guaranteed to be empty - they may contain garbage).
// I've added this to avoid people getting screaming feedback
// when they first compile the plugin, but obviously you don't need to
// this code if your algorithm already fills all the output channels.
for (int i = getNumInputChannels(); i < getNumOutputChannels(); ++i)
// This is here to avoid people getting screaming feedback
// when they first compile a plugin, but obviously you don't need to keep
// this code if your algorithm always overwrites all the output channels.
for (int i = totalNumInputChannels; i < totalNumOutputChannels; ++i)
buffer.clear (i, 0, buffer.getNumSamples());
// This is the place where you'd normally do the guts of your plugin's
// audio processing...
for (int channel = 0; channel < getNumInputChannels(); ++channel)
for (int channel = 0; channel < totalNumInputChannels; ++channel)
{
float* channelData = buffer.getWritePointer (channel);