This change reshuffles the way that parameter updates and notifications
work for hosted VST3 plugins.
Previously:
- Parameter::setValue would update the processor and editor, but not the
host
- Parameter::setValueFromEditor would update the processor and host, but
not the editor
- MIDI CC events would be converted to events and added to the
processor's input event list, but were not forwarded to the
IEditController.
Now:
- Parameter::setValue updates the host's cachedParamValues, which is the
host's source of truth for parameter values. On each process callback,
changes will be added to the input parameter list. Then, for each item
in the parameter list, an update will be dispatched back to the
editor.
- Parameter::setValueFromEditor is removed. All parameter changes will
be sent back to the editor, even if they originated from the editor.
setValueNotifyingHost can be used to notify listeners that one of the
host's JUCE parameters has changed, e.g. in the host context's
performEdit.
- MIDI CC events trigger calls to setValueNotifyingHost on any mapped
parameters. The flow is very similar to a parameter change from the
editor: the cachedParamValues are updated immediately, and host
parameter listeners are notified. Then, for each changed
cachedParamValue an entry is added to the inputParameterChanges
(updating the processor), then for each item in the
inputParameterChanges an update is sent to the editor.
Previously, preparing an AudioProcessorGraph containing hosted LV2
plugins would recreate the plugins and then set their state. For plugins
without threadsafe restore, setting the state would take the
callbackLock to avoid races with processBlock. This meant that
- During prepare, the graph would take the processorLock, then the
processor would take its own callbackLock.
- During playback, the graph would take the processor's callbackLock,
and then would take the node's processorLock.
This is probably benign (prepare shouldn't be called concurrently with
processBlock at all), but to be on the safe side we now avoid taking the
callbackLock when setting new plugin state during prepareToPlay.
Previously it was possible to have a dangling resource map. In that case
opening an AU from a file that did not have a resource map would lead to
using the previously unclosed map and attempting to load the previous
plugin again.
fc378aaf9a introduced a regression where
plugins with no audio channels (such as MIDI FX plugins) would receive
an audio buffer with a length-in-samples of '0', rather than the actual
block length.
If the block size changes from block to block, then it's possible for
inputBuffer to be smaller than buffer, but for buffer to be smaller than
the initially-allocated size of inputBuffer.