mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-15 00:24:19 +00:00
Fixed a bug where the AudioProcessor would sometimes fail to call the numChannelsChanged() callback
This commit is contained in:
parent
b198fa4c2c
commit
daba498ef9
1 changed files with 7 additions and 1 deletions
|
|
@ -905,6 +905,8 @@ bool AudioProcessor::applyBusLayouts (const BusesLayout& layouts)
|
|||
|| layouts.outputBuses.size() != numOutputBuses)
|
||||
return false;
|
||||
|
||||
int newNumberOfIns = 0, newNumberOfOuts = 0;
|
||||
|
||||
for (int busIdx = 0; busIdx < numInputBuses; ++busIdx)
|
||||
{
|
||||
Bus& bus = *getBus (true, busIdx);
|
||||
|
|
@ -913,6 +915,8 @@ bool AudioProcessor::applyBusLayouts (const BusesLayout& layouts)
|
|||
bus.layout = set;
|
||||
if (! set.isDisabled())
|
||||
bus.lastLayout = set;
|
||||
|
||||
newNumberOfIns += set.size();
|
||||
}
|
||||
|
||||
for (int busIdx = 0; busIdx < numOutputBuses; ++busIdx)
|
||||
|
|
@ -923,9 +927,11 @@ bool AudioProcessor::applyBusLayouts (const BusesLayout& layouts)
|
|||
bus.layout = set;
|
||||
if (! set.isDisabled())
|
||||
bus.lastLayout = set;
|
||||
|
||||
newNumberOfOuts += set.size();
|
||||
}
|
||||
|
||||
const bool channelNumChanged = (oldNumberOfIns != getTotalNumInputChannels() || oldNumberOfOuts != getTotalNumOutputChannels());
|
||||
const bool channelNumChanged = (oldNumberOfIns != newNumberOfIns || oldNumberOfOuts != newNumberOfOuts);
|
||||
audioIOChanged (false, channelNumChanged);
|
||||
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue