I am developing a JUCE based plugin, which gets its ID (magic, vendor etc.) in realtime at startup from outside (config file). I managed to do it pretty efficiently with AAX and AU wrappers, but i am stuck with VST3 wrapper.
Looking at the wrapper code and generally VST3 examples from SDK, i can see all needed IIDs are defined statically (processors, controller, component).
If these could be dynamically defined/assigned inside GetPluginFactory() function, the problem would be solved. But obviously it doesn’t work that way.
Anyne have an idea or hint, how this could be solved or if it’s even possible to do with VST3 SDK.
you can write your own DEF_CLASS implementation (do not use DEF_CLASS):
in you entry file:
BEGIN_FACTORY (stringSteinberg, stringSteinbergURL, stringSteinbergEmail, PFactoryInfo::kUnicode)
{
// check which classFlags (Vst::kDistributable..), subCategories, version and name you want
TUID lcid = cid; // read a cid from your config file
static PClassInfo2 componentClass (lcid, PClassInfo::kManyInstances,kVstAudioEffectClass,name,classFlags,subCategories,0,version,kVstVersionString)
gPluginFactory->registerClass (&componentClass,createMethod); // register the class
}
END_FACTORY
I don’t know how and where to assign my custom ID to JuceVST3Component::iid (which is provided as a parameter to componentClass). Currently, DEF_CLASS is used to set JuceVST3Component::iid, but it can be used only statically.
I hope i understood your answer properly and i hope my questions are clear enough.
Sorry for maybe trivial questions - i am not really good with VST3 SDK, JUCE is successfully hiding most of the details from me, but in this case i have to learn things better
Digging deeper into this, now i completely understand your answer and i see the solution is basically very simple.
But, unfortunately JUCE wrapper does it in its own specific, more complex way and that makes things harder for me (it sets component’s IDs directly, before anything happens in plugin - with DEF_CLASS_IID macro).