It seems that setCurrentProgram() is to handle program changes from the DAW.
How should changes from the AudioProcessorEditor be promoted to the DAW?
updateHostDisplay() seems a bit too heavy to notify about simple program changes as the AudioProcessor expets that anything could have changed, consequently it tears down streaming, stops and resumes audio processing.
This is probably kind of OK for native plugins, but for DSP based plugins this is catastrophic!
Initiating the whole DSP setup, with large coeff pages, etc. might take a noticible time.Glitch free audio processing is not achiviabale, because the DSP is disconected and another audio route is created, previous memory, i.e. delay lines is also not accesible anymore (though its arguable if keeping delay lines, etc. is desired at all). But it simply takes to mutch time for automation.
What would be the right way to notifiy the DAW that the program has changed?
sure, my Browser has the JUCE API docu burnt-in... ;)
but - I probably overlook something here - I don't get how this anwer glues to my "how to inform the host DAW about a program change initiated from the plugin UI"?
I use setParameterNotifyingHost(..) to set all parameters in the overwritten setCurrentProgram(..) function. This should notify the host about changes.
You should be carefully when you call this function from within the processing thread. This maybe happens when you support MIDI Prg Change or MIDI controllers.
After my reply, I felt a bit insecure about it, because I only took a quick glance at my working code. I know from debugging that the host can call the getStateInformation quite often, but maybe indeed setParameterNotifyingHost is really the one to use (which I also use).
Most commercial plug-ins do have their own preset system and there is only one default preset in the hosts vst standard presets list. Users often want preset files today and that does not work very well with the standard vst preset list / manager…
You also have to save all the presets within the state when you do that. Some hosts load the whole preset list and select the preset the user have loaded when saving the arrangement.
I used to call updateHostDisplay() in our older free plugins that had no own preset system.
Thanks @kunz, yes we also have our own preset handling. Nevertheless when used in film production people seem to be used to switch preset scenes. A prerequisite is that the preset name is also switched, which can’t be easily achieved with any kind of proprietary workaround. So we need to be able inform the host and I don’t know what makes it so difficult to provide an interface which can handle such a basic plugin feature without disturbing streaming?
Yes, it would be nice to show the preset name also in the VST standard preset browser without interrupting audio processing. I gave up on this.
It looks like updateHostDisplay() is too general for such a small change like the preset name.
We can only create wrappers around functionality that the plugin APIs support - AFAIK there’s nothing in them to do what you need and updateHostDisplay() is the only option.
Would it be possible to provide a light wight way of informing the DAW about the plugins state change? How about a bool parameter for updateHostDisplay(bool latencyChanged=false)?
Hmmm, most of the plugins I use support the vst program list, and seem to be able to report program names to the host without any processing issues. And the hosts I use support it… I’m curious how this is possible!