Login / Register 0 items | $0.00 New @ KVR
Wild Hades
KVRist
 
170 posts since 6 Sep, 2007

Postby Wild Hades; Wed May 09, 2018 6:22 am Inform the host that the plug-in state has changed (parameter not exposed)

Hello devs,

I'd like to know if there is a simple way to inform the host that the plug-in state has changed, when a "meta-parameter" (not exposed to the host) changes.

Basically, my convolution plug-in saves the path of the loaded .wav files in its internal state, in order to reload them upon state recall.
The problem is that the file path is obviously not an exposed parameter, so, during a session, if I just load a new file and then close the project, the DAW (Reaper in this case) does not "see" the change in the plug-in state and doesn't ask me if I want to save the project, causing the change to get lost.

Is there any way to tell the host that the plug-in state has changed to force it to retrieve the update and consider the plug-in state as "dirty"?
(Formats are VST2.4, VST3 and AU)

Regards,
Federico
User avatar
luzifer
KVRer
 
22 posts since 18 Apr, 2018, from Berlin

Postby luzifer; Wed May 09, 2018 7:25 am Re: Inform the host that the plug-in state has changed (parameter not exposed)

unfortunately i don't believe that a specific function in VST2 exists to do that. i'd love to be proven wrong though! closest i found is AudioEffectX::updateDisplay. this is what we are calling crossing our fingers that it sets a dirty state. if you are using JUCE call AudioProcessor::updateHostDisplay if not grep for audioProcessorChanged in JUCE' modules/juce_audio_plugin_client to see how other plugin types are handling that
quikquak
KVRist
 
375 posts since 6 Aug, 2005, from England

Postby quikquak; Wed May 09, 2018 8:22 am Re: Inform the host that the plug-in state has changed (parameter not exposed)

Why not use a parameter called ‘null’ or ‘none’, it does matter if someone changes it anyway.
arne
KVRist
 
141 posts since 21 Aug, 2004

Postby arne; Wed May 09, 2018 10:05 am Re: Inform the host that the plug-in state has changed (parameter not exposed)

VST3 has IComponentHandler2::setDirty(..) for this case.
User avatar
Youlean
KVRist
 
182 posts since 11 May, 2016, from Serbia

Postby Youlean; Wed May 09, 2018 12:14 pm Re: Inform the host that the plug-in state has changed (parameter not exposed)

quikquak wrote:Why not use a parameter called ‘null’ or ‘none’, it does matter if someone changes it anyway.

This will be the most reliable method.

Other methods will work in some DAWs and in some not.

Example to tell host that it needs to save project:

VST2
https://github.com/Youlean/IPlug-Youlea ... T.cpp#L110

VST3
https://github.com/Youlean/IPlug-Youlea ... .cpp#L1081

AU
https://github.com/Youlean/IPlug-Youlea ... .cpp#L1937
Wild Hades
KVRist
 
170 posts since 6 Sep, 2007

Postby Wild Hades; Wed May 09, 2018 11:49 pm Re: Inform the host that the plug-in state has changed (parameter not exposed)

luzifer wrote:unfortunately i don't believe that a specific function in VST2 exists to do that. i'd love to be proven wrong though! closest i found is AudioEffectX::updateDisplay. this is what we are calling crossing our fingers that it sets a dirty state. if you are using JUCE call AudioProcessor::updateHostDisplay if not grep for audioProcessorChanged in JUCE' modules/juce_audio_plugin_client to see how other plugin types are handling that

Thanks for the tip!
Apparently, JUCE does the same for VST2.4, while for VST3 things are a bit overkill for my use case, so I'll stick with the setDirty(true) as suggested by Arne and Youlean.

quikquak wrote:Why not use a parameter called ‘null’ or ‘none’, it does matter if someone changes it anyway.

I thought about this or about forcing a small update to the first available parameter (like setting the same value again or just adding and then subtracting a very small value, like 0.001), but my programming OCD doesn't agree yet :ud:

Thanks everybody :tu:
Wild Hades
KVRist
 
170 posts since 6 Sep, 2007

Postby Wild Hades; Thu May 10, 2018 4:46 am Re: Inform the host that the plug-in state has changed (parameter not exposed)

Guess what? Reaper ignores both setDirty() for VST3 (even though it returns "true", so it's supported) and updateDisplay() for VST2.4.
I had to add the darn "Reserved" dummy parameter.

I hate this sh*t. :oops:
quikquak
KVRist
 
375 posts since 6 Aug, 2005, from England

Postby quikquak; Thu May 10, 2018 7:55 am Re: Inform the host that the plug-in state has changed (parameter not exposed)

Yeah just see it as a Boolean flag, and calm down a little, drink some water and put that sugary caffeine in the bin! That’s what I would do, anyway.
Ivan_C
KVRian
 
1061 posts since 11 Aug, 2004, from Marcoussis, France

Postby Ivan_C; Fri May 11, 2018 7:11 am Re: Inform the host that the plug-in state has changed (parameter not exposed)

I had that kind of reaction when I discover that 50% of the DAWs don't care about the isParameterAutomatable property :lol:
Wild Hades
KVRist
 
170 posts since 6 Sep, 2007

Postby Wild Hades; Fri May 11, 2018 7:50 am Re: Inform the host that the plug-in state has changed (parameter not exposed)

Ivan_C wrote:I had that kind of reaction when I discover that 50% of the DAWs don't care about the isParameterAutomatable property :lol:

Ha! Don't even get me started on that :x
The only way is not exposing it at all.

Moderator: Moderators (Main)

Return to DSP and Plug-in Development