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.
Previously, if `AudioProcessorGraph::prepareToPlay` was called twice,
interspersed with calls to `setProcessingPrecision`, the graph would
consider the nodes 'prepared' on the second call, and wouldn't
re-prepare the inner nodes with the new precision setting.
graph.setProcessingPrecision (juce::AudioProcessor::singlePrecision);
graph.prepareToPlay (44100, 512);
graph.setProcessingPrecision (juce::AudioProcessor::doublePrecision);
graph.prepareToPlay (44100, 512); // this wouldn't update the nodes
Now, we always explicitly unprepare all nodes at the beginning of
prepareToPlay, so that they'll always receive the newest settings.