mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Fixed some issues with IO channel counts in the StandaloneFilterWindow
This commit is contained in:
parent
75e6075474
commit
a2a3f32d8f
4 changed files with 40 additions and 17 deletions
|
|
@ -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...
|
||||
|
|
|
|||
|
|
@ -523,13 +523,17 @@ public:
|
|||
const MidiBuffer& inputMidi,
|
||||
int startSample,
|
||||
int numSamples)
|
||||
{ processNextBlock (outputAudio, inputMidi, startSample, numSamples); }
|
||||
{
|
||||
processNextBlock (outputAudio, inputMidi, startSample, numSamples);
|
||||
}
|
||||
|
||||
inline void renderNextBlock (AudioBuffer<double>& outputAudio,
|
||||
const MidiBuffer& inputMidi,
|
||||
int startSample,
|
||||
int numSamples)
|
||||
{ processNextBlock (outputAudio, inputMidi, startSample, numSamples); }
|
||||
{
|
||||
processNextBlock (outputAudio, inputMidi, startSample, numSamples);
|
||||
}
|
||||
|
||||
/** Returns the current target sample rate at which rendering is being done.
|
||||
Subclasses may need to know this so that they can pitch things correctly.
|
||||
|
|
|
|||
|
|
@ -247,21 +247,40 @@ public:
|
|||
{
|
||||
DialogWindow::LaunchOptions o;
|
||||
|
||||
auto totalInChannels = processor->getMainBusNumInputChannels();
|
||||
auto totalOutChannels = processor->getMainBusNumOutputChannels();
|
||||
int minNumInputs = std::numeric_limits<int>::max(), maxNumInputs = 0,
|
||||
minNumOutputs = std::numeric_limits<int>::max(), maxNumOutputs = 0;
|
||||
|
||||
if (channelConfiguration.size() > 0)
|
||||
{
|
||||
auto defaultConfig = channelConfiguration.getReference (0);
|
||||
totalInChannels = defaultConfig.numIns;
|
||||
totalOutChannels = defaultConfig.numOuts;
|
||||
minNumInputs = jmin (minNumInputs, (int) defaultConfig.numIns);
|
||||
maxNumInputs = jmax (maxNumInputs, (int) defaultConfig.numIns);
|
||||
minNumOutputs = jmin (minNumOutputs, (int) defaultConfig.numOuts);
|
||||
maxNumOutputs = jmax (maxNumOutputs, (int) defaultConfig.numOuts);
|
||||
}
|
||||
|
||||
if (auto* bus = processor->getBus (true, 0))
|
||||
{
|
||||
auto defaultNumChannels = bus->getDefaultLayout().size();
|
||||
minNumInputs = jmin (minNumInputs, defaultNumChannels);
|
||||
maxNumInputs = jmax (maxNumInputs, defaultNumChannels);
|
||||
}
|
||||
|
||||
if (auto* bus = processor->getBus (false, 0))
|
||||
{
|
||||
auto defaultNumChannels = bus->getDefaultLayout().size();
|
||||
minNumOutputs = jmin (minNumOutputs, defaultNumChannels);
|
||||
maxNumOutputs = jmax (maxNumOutputs, defaultNumChannels);
|
||||
}
|
||||
|
||||
minNumInputs = jmin (minNumInputs, maxNumInputs);
|
||||
minNumOutputs = jmin (minNumOutputs, maxNumOutputs);
|
||||
|
||||
o.content.setOwned (new SettingsComponent (*this, deviceManager,
|
||||
totalInChannels,
|
||||
totalInChannels,
|
||||
totalOutChannels,
|
||||
totalOutChannels));
|
||||
minNumInputs,
|
||||
maxNumInputs,
|
||||
minNumOutputs,
|
||||
maxNumOutputs));
|
||||
o.content->setSize (500, 550);
|
||||
|
||||
o.dialogTitle = TRANS("Audio/MIDI Settings");
|
||||
|
|
|
|||
|
|
@ -357,7 +357,7 @@ public:
|
|||
|
||||
//==============================================================================
|
||||
/** The bus's current layout. This will be AudioChannelSet::disabled() if the current
|
||||
layout is dfisabled.
|
||||
layout is disabled.
|
||||
@see AudioChannelSet
|
||||
*/
|
||||
const AudioChannelSet& getCurrentLayout() const noexcept { return layout; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue