I'm experimenting with the SDK but having some issues grasping some of the fundamentals without many realworld examples. My main question at the moment is how a scripted event within VDJ can somehow raise an event within the plugin.
From my current understanding DeclareParameter* is used and then OnPrarmerter in some situations to monitor GUI elements created by the plugin. For example, if a slider is changed within the GUI OnPrarmerter will be raised within the plugin. But can this custom slider be controlled via VDJ script called within other areas of VDJ? (such as volume or fader for example). In other words, if a pad is pressed you can use VDJ script to effect fader levels. Can you do the same with elements created via the SDK? And if so, will the changes applied by VDJ script raise the OnParameter event within my plugin?
From my current understanding DeclareParameter* is used and then OnPrarmerter in some situations to monitor GUI elements created by the plugin. For example, if a slider is changed within the GUI OnPrarmerter will be raised within the plugin. But can this custom slider be controlled via VDJ script called within other areas of VDJ? (such as volume or fader for example). In other words, if a pad is pressed you can use VDJ script to effect fader levels. Can you do the same with elements created via the SDK? And if so, will the changes applied by VDJ script raise the OnParameter event within my plugin?
Posté Mon 26 Jun 23 @ 7:06 pm
OnParameter is only called when a parameter of your plugin changes.
From vdj script, you can use effect_slider, effect_button or effect_string to make this happen.
You can't get notifications for other events, so if you depend on other parameters, you need to check those yourself.
There's two ways you might do this.
You can use a repeat_start script, which could use variables and param_equal to check if something changed, and then call effect_slider to trigger your own plugin.
Another way is to call GetInfo or GetStringInfo from your plugin regularly (could be from a thread you create, or from OnProcessSamples in the case of a dsp plugin) and then compare it with the last value.
From vdj script, you can use effect_slider, effect_button or effect_string to make this happen.
You can't get notifications for other events, so if you depend on other parameters, you need to check those yourself.
There's two ways you might do this.
You can use a repeat_start script, which could use variables and param_equal to check if something changed, and then call effect_slider to trigger your own plugin.
Another way is to call GetInfo or GetStringInfo from your plugin regularly (could be from a thread you create, or from OnProcessSamples in the case of a dsp plugin) and then compare it with the last value.
Posté Mon 26 Jun 23 @ 7:20 pm
Thanks for the quick reply, that makes perfect sense.
That led me to a quick search of the verbs reference to check out 'effect_string' where I then found 'effects_command', and after some google-fu I found https://www.virtualdj.com/forums/233464/VirtualDJ_Plugins/Help_with_calling_plugin_functions_from_vdjScript.html and my head just about exploded. I'm gonna have some fun with this for sure👍
That led me to a quick search of the verbs reference to check out 'effect_string' where I then found 'effects_command', and after some google-fu I found https://www.virtualdj.com/forums/233464/VirtualDJ_Plugins/Help_with_calling_plugin_functions_from_vdjScript.html and my head just about exploded. I'm gonna have some fun with this for sure👍
Posté Mon 26 Jun 23 @ 7:35 pm