This mostly reverts commit 6e89e61b89.
MIDI FX plugins are allowed to have audio channels, even if they only
produce silence. If a plugin requests a particular bus/channel layout,
the host should respect this request, or attempt to update the layout.
The host should fill all channels that the plugin expects to be filled.
The old commit also meant that we weren't correctly supplying the host
sample rate to MIDI FX plugins.
MIDI FX AudioUnits can retrieve their current sample rate from an output
bus. However, it's reasonable for a JUCE MIDI FX plugin to require 0
output buses, in which case the correct sample rate cannot be retrieved.
This patch modifies the AU wrapper to ensure that MIDI FX plugins will
always have at least one output bus. This bus does not necessarily
correspond to a matching bus in the AudioProcessor, and it will not be
passed to AudioProcessor::processBlock. With the output bus in place,
the correct sample rate is reported in `prepareToPlay`.
Some plugins, such as the 'AGain' demo from the VST3 SDK and Diginoiz
Subdivine segfault when setParamNormalized is called from a background
thread.
This patch attempts to ensure that calls to get/set parameter values can
be made safely from the audio or message threads.
It also adds some MessageManagerLocks around some other calls to the
EditController's member functions which should technically only be made
from the GUI thread.
Finally, it updates the parameter input queues to the IAudioProcessor so
that writing to the queue is wait-free. As part of this change, a new
queue type is introduced which holds up to a single point. This should
improve memory usage for plugins with many parameters.
This commit partially reverts the changes introduced in 455e08da as having an intermediate HWND and reparenting the plug-in window was causing issues when hosting certain plug-ins such as u-he's Diva and Arturia's Mini V3
Previously, the AU hosting code always computed the number of steps in
the parameter range as though the minimum parameter value was 0.
Now, we take the parameter's reported minimum into account when
computing the number of steps. We also use the parameter's range, rather
than its step number, when normalising/denormalising the parameter
value.