Previously, the AudioProcessorPlayer would attempt to find a supported
layout that matched the audio device's output channel count, and would
force the processor to use the audio device's i/o channel counts if no
better and compatible alternative could be found.
This change allows the AudioProcessor to retain its current i/o
configuration if no better alternative can be found. This may lead to
the AudioProcessor having different numbers of inputs and outputs to the
audio device.
If there's only one audio device input, this will be copied to all of
the AudioProcessor's inputs. Otherwise, each audio device input channel
will be copied to the corresponding AudioProcessor input channel. If
there are more device inputs than AudioProcessor inputs, then some
device inputs will be discarded. AudioProcessor inputs without a
corresponding device input will be cleared/silenced.
Similar rules apply to the output channels. If there are more device
outputs than AudioProcessor outputs, then device outputs without a
corresponding AudioProcessor output will be cleared. If there are more
AudioProcessor outputs than device outputs, some AudioProcessor outputs
will be discarded.
This change improves the initialiseIoBuffers function so that it can
handle the situation where the number of processor outputs does not
match the number of system outputs, and/or when the number of system
inputs is not 0, 1, or equal to the number of processor inputs.
Previously, the AudioProcessorPlayer would always match the
AudioProcessor's bus configuration to the requested bus configuration,
even if the processor did not explicitly support the requested
configuration.
Now, if the requested configuration has one or fewer input channels, the
AudioProcessorPlayer will attempt to find a multi-input channel layout
for which `checkBusesLayoutSupported` returns true, and will use such a
layout if it exists. Otherwise, as a last resort, it will fall back to
using the channel layout requested by the AudioProcessorPlayer.
If the AudioProcessorPlayer has no input channels, but the wrapped
processor is initialised with multiple input channels, each of these
inputs will be fed with silence.
If the AudioProcessorPlayer has a single input channel, but the wrapped
processor is initialised with multiple input channels, each input
channel will be fed with a copy of the AudioProcessorPlayer's mono
input.