BR: Standalone: the audio settings dialog offers the bus's default layout, not what the bus supports

JUCE 9.0.1, macOS 26, the standalone wrapper. Effect plugin whose main busses accept any channel count.

StandalonePluginHolder::showAudioSettingsDialog(), juce_StandaloneFilterWindow.h:

if (auto* bus = processor->getBus (true, 0))
    maxNumInputs = jmax (0, bus->getDefaultLayout().size());

if (auto* bus = processor->getBus (false, 0))
    maxNumOutputs = jmax (0, bus->getDefaultLayout().size());

auto content = std::make_unique<SettingsComponent> (*this, deviceManager, maxNumInputs, maxNumOutputs);

The two numbers reach AudioDeviceSelectorComponent (deviceManagerToUse, 0, maxAudioInputChannels, 0, maxAudioOutputChannels, ...) and are what limits the channel list the device panel shows. The default layout is the layout the plugin is constructed with, so a standalone can never open more channels of a device than that - the widest layout the plugin actually supports plays no part, and the user has no way to reach the remaining channels of the interface.

Our plugin declares .withInput ("Input", AudioChannelSet::discreteChannels (16), true) and accepts every layout (no isBusesLayoutSupported override, so the base returns true): getBus (true, 0)->getMaxSupportedChannels() is 64 while getDefaultLayout().size() is 16, and a 32-channel interface shows 16 inputs in the dialog. A plugin that is constructed stereo and supports more is capped at two.

Fix: ask the bus what it supports.

if (auto* bus = processor->getBus (true, 0))
    maxNumInputs = jmax (0, bus->getMaxSupportedChannels());

AudioProcessor::Bus::getMaxSupportedChannels() counts down from AudioChannelSet::maxChannelsOfNamedLayout (64) to the widest count isNumberOfChannelsSupported accepts, so a plugin with a fixed stereo bus keeps the number it has today and only a plugin that supports more sees a difference.

Open: only bus 0 is asked, although the standalone lays the device’s channels over every bus of the processor - a plugin whose second input bus carries channels of its own is still capped at the first one’s count. The channelConfiguration branch above has the same shape, but is overwritten wherever a bus exists.

The patch:

diff --git a/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h b/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h
index fce785171f..0a7ce44696 100644
--- a/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h
+++ b/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h
@@ -296,10 +296,10 @@ public:
         }
 
         if (auto* bus = processor->getBus (true, 0))
-            maxNumInputs = jmax (0, bus->getDefaultLayout().size());
+            maxNumInputs = jmax (0, bus->getMaxSupportedChannels());
 
         if (auto* bus = processor->getBus (false, 0))
-            maxNumOutputs = jmax (0, bus->getDefaultLayout().size());
+            maxNumOutputs = jmax (0, bus->getMaxSupportedChannels());
 
         auto content = std::make_unique<SettingsComponent> (*this, deviceManager, maxNumInputs, maxNumOutputs);
         content->setSize (500, 550);