That might be even better.
It is only in one plugin where we did something like this:
void processBlock([...])
{
[...]
if (latencychanged)
{
// setLatencySamples(newLatency); [OLD, caused crashes]
internalLatency = newLatency;
triggerAsyncUpdate();
}
}
void handleAsyncUpdate()
{
setLatencySamples(internalLatency);
}
But it should be fairly easy to make JuceVSTWrapper inherit from AsyncUpdater and put ioChanged inside handleAsyncUpdate.
Chris