1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-16 00:34:19 +00:00

Fixed some issues with IO channel counts in the StandaloneFilterWindow

This commit is contained in:
Tom Poole 2017-12-21 17:54:53 +00:00
parent 75e6075474
commit a2a3f32d8f
4 changed files with 40 additions and 17 deletions

View file

@ -134,6 +134,12 @@ void JuceDemoPluginAudioProcessor::process (AudioBuffer<FloatType>& buffer,
{
const int numSamples = buffer.getNumSamples();
// In case we have more outputs than inputs, we'll clear any output
// channels that didn't contain input data, (because these aren't
// guaranteed to be empty - they may contain garbage).
for (int i = getTotalNumInputChannels(); i < getTotalNumOutputChannels(); ++i)
buffer.clear (i, 0, numSamples);
// Now pass any incoming midi messages to our keyboard state object, and let it
// add messages to the buffer if the user is clicking on the on-screen keys
keyboardState.processNextMidiBuffer (midiMessages, 0, numSamples, true);
@ -144,12 +150,6 @@ void JuceDemoPluginAudioProcessor::process (AudioBuffer<FloatType>& buffer,
// Apply our delay effect to the new output..
applyDelay (buffer, delayBuffer);
// In case we have more outputs than inputs, we'll clear any output
// channels that didn't contain input data, (because these aren't
// guaranteed to be empty - they may contain garbage).
for (int i = getTotalNumInputChannels(); i < getTotalNumOutputChannels(); ++i)
buffer.clear (i, 0, numSamples);
applyGain (buffer, delayBuffer); // apply our gain-change to the outgoing data..
// Now ask the host for the current time so we can store it to be displayed later...