Taking a look through JUCE’s VST wrapper there seem to be a couple extensions handled by JUCE. Since extensions are non-standard it wouldn’t make much sense to try and start supporting them all out-of-the-box from JUCE.
It appears we do have the VSTCallbackHandler class available for handling specific vendor extensions. Would it be possible to extend it to also allow custom “pluginCanDo” returns as well?
struct VSTCallbackHandler
{
virtual ~VSTCallbackHandler() {}
virtual pointer_sized_int handleCanPluginDo (int32 index,
pointer_sized_int value,
void* ptr,
float opt) = 0;
/** This is called by the VST plug-in wrapper when it receives unhandled
vendor specific calls from the host.
*/
virtual pointer_sized_int handleVstManufacturerSpecific (int32 index,
pointer_sized_int value,
void* ptr,
float opt) = 0;
};
and in juce_audio_plugin_client/VST/juce_VSTWrapper.cpp:
pointer_sized_int handleCanPlugInDo (VstOpCodeArguments args)
{
...
if (matches ("hasCockosExtensions"))
return (int32) 0xbeef0000;
// similar to what dispatches handleManufacturerSpecific()
if (auto callbackHandler = dynamic_cast<VSTCallbackHandler*> (processor))
return callbackHandler->handleCanPluginDo (args.index, args.value, args.ptr, args.opt);
return 0;
}
Hi!
The callback handler appears to be a good solution for vendor specific vst host->plugin requests, so this is covered.
At the moment I’m trying to find an elegant solution for going the other way round, and send vendor specific data from my plugin to the vst host. So far I haven’t found a solution for that which doesn’t involve changing the JUCE code. I basically need access to the VstHostCallback object that is given to the plugin right at the vst plugin entry point. Apparently AudioProcessor is completely detached from the wrapper.
I need to a) get canDo information from the host and b) send arbitrary vendor specific data to the host.
Maybe I am overlooking something? Is modifying the JUCE code the only solution at the moment?
Thanks! I’ll figure something out. Since this might be an issue affecting several users at the moment, maybe the JUCE devs can figure something out for the future.
Would it be possible to add NKS support if the host callback was supplied to the plug-in after the plug-in’s constructor was called? I’m not familiar with what needs to be done.
In VST3, I have needed the FUnknown* hostContext pointer passed for the JuceVST3Component::initialize method. (That’s for using the Reaper API, I don’t know if that would be useful for NKS etc.)
I’m using JUCE 5.2.1 and I have cherry-picked the commit
Added a “plug-in can do” callback to the VSTCallbackHandler interface
so I can handle vendor specific vst host->plugin “can do” callbacks.
I have implemented (override) the virtual methods of the VSTCallbackHandler ( handleVstPluginCanDo and handleVstManufacturerSpecific ) as public methods of my PluginProcessor.
When the handleCanPlugInDo method of the JuceVSTWrapper class receives unhandled plug-in “can do” calls from the host, the
auto callbackHandler = dynamic_cast<VSTCallbackHandler*> (processor)
Any idea why? Maybe I’ve missed some other commits after the tag 5.2.1 that I need to cherry pick before the Added a "plug-in can do" callback to the VSTCallbackHandler interface commit?
That is awesome! When get we expect a new JUCE release? It has been a while now and a few things like this in the official release would be VERY welcome.
We’ve not got anything scheduled for the near future. There’s a significant HiDPI scaling improvement coming soon that we want to give a good long run on the develop branch before the next release.