Jamba C++ API  5.1.1
JambaPluginFactory Class Reference

The purpose of this class is to make it easier and safer to create the plugin factory. More...

#include <PluginFactory.h>

Static Public Member Functions

template<typename RTProcessorClass , typename GUIControllerClass >
static Steinberg::IPluginFactory * GetNonDistributableVST3PluginFactory (const std::string &iVendor, const std::string &iURL, const std::string &iEmail, const std::string &iPluginName, const std::string &iPluginVersion, const std::string &iSubCategories, void *iContext=nullptr)
 This flavor of this API lets you create a plugin that is not declared distributable. More...
 
template<typename RTProcessorClass , typename GUIControllerClass >
static Steinberg::IPluginFactory * GetVST3PluginFactory (const std::string &iVendor, const std::string &iURL, const std::string &iEmail, const std::string &iPluginName, const std::string &iPluginVersion, const std::string &iSubCategories, void *iContext=nullptr)
 Main method to create the factory for the plugin. More...
 

Static Private Member Functions

template<typename RTProcessorClass , typename GUIControllerClass >
static Steinberg::IPluginFactory * createFactory (const std::string &iVendor, const std::string &iURL, const std::string &iEmail, const std::string &iPluginName, const std::string &iPluginVersion, const std::string &iSubCategories, void *iContext, int32 iProcessorFlags)
 

Detailed Description

The purpose of this class is to make it easier and safer to create the plugin factory.

The implementation provided with the VST3 SDK relies on macros, comments (like "do not changed this" or "not used here") and ends up creating static instances which are never destroyed until the DAW quits (which is the normal behavior for static variables defined inside functions...) even if there are no more instances of the plugin (although it is not a big "leak", it is nonetheless one!).

You use this class in the following manner:

// this is the main entry point that every plugin must define
SMTG_EXPORT_SYMBOL Steinberg::IPluginFactory* PLUGIN_API GetPluginFactory()
{
pongasoft::test::jamba::RT::JambaTestPluginProcessor, // processor class (Real Time)
pongasoft::test::jamba::GUI::JambaTestPluginController // controller class (GUI)
>("pongasoft", // vendor
"https://www.pongasoft.com", // url
"support@pongasoft.com", // email
stringPluginName, // plugin name
FULL_VERSION_STR, // plugin version
Vst::PlugType::kFx // plugin category (can be changed to other like kInstrument, etc...)
);
}
Note
1. The GetPluginFactory() method takes an additional (optional) parameter not shown in this example which is provided to the factory method of the controller and processor (iContext) and can be used to provide additional information like a constructor argument for the parameters class or the parameters themselves or whatever else you want.
2. If you do not want to use this class, you can continue to use the macros provided with the SDK.

Member Function Documentation

◆ createFactory()

Steinberg::IPluginFactory * createFactory ( const std::string &  iVendor,
const std::string &  iURL,
const std::string &  iEmail,
const std::string &  iPluginName,
const std::string &  iPluginVersion,
const std::string &  iSubCategories,
void *  iContext,
int32  iProcessorFlags 
)
staticprivate

◆ GetNonDistributableVST3PluginFactory()

static Steinberg::IPluginFactory* GetNonDistributableVST3PluginFactory ( const std::string &  iVendor,
const std::string &  iURL,
const std::string &  iEmail,
const std::string &  iPluginName,
const std::string &  iPluginVersion,
const std::string &  iSubCategories,
void *  iContext = nullptr 
)
inlinestatic

This flavor of this API lets you create a plugin that is not declared distributable.

Note
This can be used in the rare cases when GUI and RT need to actually share data (for example large amounts of data) and using messaging is too expensive
See also
GetVST3PluginFactory

◆ GetVST3PluginFactory()

static Steinberg::IPluginFactory* GetVST3PluginFactory ( const std::string &  iVendor,
const std::string &  iURL,
const std::string &  iEmail,
const std::string &  iPluginName,
const std::string &  iPluginVersion,
const std::string &  iSubCategories,
void *  iContext = nullptr 
)
inlinestatic

Main method to create the factory for the plugin.

See example in the class comment. The optional iContext last arguments will be provided to the controller and processor factory methods (the macros provided with the SDK do not let you set this parameter).

Template Parameters
RTProcessorClassthe class for the processor (assumes existence of UUID() and createInstance(void *) static methods)
GUIControllerClassthe class for the controller (assumes existence of UUID() and createInstance(void *) static methods)

The documentation for this class was generated from the following file: