VST 3 SDK VST 3.7 SDK for developing VST plug-in

Macros
Macros for defining the class factory
Common SDK Implementation Helper Classes

Example - How to use the class factory macros: More...

Collaboration diagram for Macros for defining the class factory:

## Macros
#define | BEGIN_FACTORY_CLASS(FactoryClass, vendor, url, email, flags)
#define | BEGIN_FACTORY(vendor, url, email, flags)
#define | DEF_CLASS(cid, cardinality, category, name, createMethod)
#define | DEF_CLASS1(cid, cardinality, category, name, createMethod)
#define | DEF_CLASS2(cid, cardinality, category, name, classFlags, subCategories, version, sdkVersion, createMethod)
#define | DEF_CLASS_W(cid, cardinality, category, name, classFlags, subCategories, version, sdkVersion, createMethod)
#define | DEF_CLASS_W2(cid, cardinality, category, name, classFlags, subCategories, vendor, version, sdkVersion, createMethod)
#define | END_FACTORY
#define | DEF_VST3_CLASS(pluginName, pluginVst3Categories, classFlags, pluginVersion, processorCID, processorCreateFunc, controllerCID, controllerCreateFunc)

## Detailed Description

Example - How to use the class factory macros:

BEGIN_FACTORY ("Steinberg Technologies",
"http://www.steinberg.de",
"mailto:info@steinberg.de",
PFactoryInfo::kNoFlags)
DEF_CLASS (INLINE_UID (0x00000000, 0x00000000, 0x00000000, 0x00000000),
PClassInfo::kManyInstances,
"Service",
"Test Service",
TestService::newInstance)
END_FACTORY
BEGIN_FACTORY
#define BEGIN_FACTORY(vendor, url, email, flags)
Definition: pluginfactory.h:145
END_FACTORY
#define END_FACTORY
Definition: pluginfactory.h:171
DEF_CLASS
#define DEF_CLASS(cid, cardinality, category, name, createMethod)
Definition: pluginfactory.h:151

## Macro Definition Documentation

## ◆ BEGIN_FACTORY_CLASS

#define BEGIN_FACTORY_CLASS | ( |  | FactoryClass,
|  |  | vendor,
|  |  | url,
|  |  | email,
|  |  | flags
| ) |  |

Value:
using namespace Steinberg; \
SMTG_EXPORT_SYMBOL IPluginFactory* PLUGIN_API GetPluginFactory () { \
if (!gPluginFactory) \
{ static PFactoryInfo factoryInfo (vendor,url,email,flags); \
gPluginFactory = new FactoryClass (factoryInfo); \
Steinberg::IPluginFactory
GetPluginFactory
SMTG_EXPORT_SYMBOL Steinberg::IPluginFactory * GetPluginFactory()
Steinberg
Steinberg::gPluginFactory
CPluginFactory * gPluginFactory
Steinberg::PFactoryInfo

## ◆ BEGIN_FACTORY

#define BEGIN_FACTORY | ( |  | vendor,
|  |  | url,
|  |  | email,
|  |  | flags
| ) |  |

Value:
using namespace Steinberg; \
SMTG_EXPORT_SYMBOL IPluginFactory* PLUGIN_API GetPluginFactory () { \
if (!gPluginFactory) \
{ static PFactoryInfo factoryInfo (vendor,url,email,flags); \
gPluginFactory = new CPluginFactory (factoryInfo); \
Steinberg::CPluginFactory
Default Class Factory implementation.
Definition: pluginfactory.h:49

## ◆ DEF_CLASS

#define DEF_CLASS | ( |  | cid,
|  |  | cardinality,
|  |  | category,
|  |  | name,
|  |  | createMethod
| ) |  |

Value:
{ TUID lcid = cid; static PClassInfo componentClass (lcid,cardinality,category,name); \
gPluginFactory->registerClass (&componentClass,createMethod); }
TUID
char TUID[16]
Steinberg::PClassInfo

## ◆ DEF_CLASS1

#define DEF_CLASS1 | ( |  | cid,
|  |  | cardinality,
|  |  | category,
|  |  | name,
|  |  | createMethod
| ) |  |

Value:
{ static PClassInfo componentClass (cid,cardinality,category,name); \
gPluginFactory->registerClass (&componentClass,createMethod); }

## ◆ DEF_CLASS2

#define DEF_CLASS2 | ( |  | cid,
|  |  | cardinality,
|  |  | category,
|  |  | name,
|  |  | classFlags,
|  |  | subCategories,
|  |  | version,
|  |  | sdkVersion,
|  |  | createMethod
| ) |  |

Value:
{ TUID lcid = cid; static PClassInfo2 componentClass (lcid,cardinality,category,name,classFlags,subCategories,0,version,sdkVersion);\
gPluginFactory->registerClass (&componentClass,createMethod); }
Steinberg::PClassInfo2

## ◆ DEF_CLASS_W

#define DEF_CLASS_W | ( |  | cid,
|  |  | cardinality,
|  |  | category,
|  |  | name,
|  |  | classFlags,
|  |  | subCategories,
|  |  | version,
|  |  | sdkVersion,
|  |  | createMethod
| ) |  |

Value:
{ TUID lcid = cid; static PClassInfoW componentClass (lcid,cardinality,category,name,classFlags,subCategories,0,version,sdkVersion);\
gPluginFactory->registerClass (&componentClass,createMethod); }
Steinberg::PClassInfoW

## ◆ DEF_CLASS_W2

#define DEF_CLASS_W2 | ( |  | cid,
|  |  | cardinality,
|  |  | category,
|  |  | name,
|  |  | classFlags,
|  |  | subCategories,
|  |  | vendor,
|  |  | version,
|  |  | sdkVersion,
|  |  | createMethod
| ) |  |

Value:
{ TUID lcid = cid; static PClassInfoW componentClass (lcid,cardinality,category,name,classFlags,subCategories,vendor,version,sdkVersion);\
gPluginFactory->registerClass (&componentClass,createMethod); }

## ◆ END_FACTORY

#define END_FACTORY

Value:
} else gPluginFactory->addRef (); \
return gPluginFactory; }
Steinberg::FUnknown::addRef
virtual uint32 addRef()=0

## ◆ DEF_VST3_CLASS

#define DEF_VST3_CLASS | ( |  | pluginName,
|  |  | pluginVst3Categories,
|  |  | classFlags,
|  |  | pluginVersion,
|  |  | processorCID,
|  |  | processorCreateFunc,
|  |  | controllerCID,
|  |  | controllerCreateFunc
| ) |  |

Value:
{ \
{ \
const Steinberg::TUID lcid = processorCID; \
static Steinberg::PClassInfo2 processorClass ( \
lcid, Steinberg::PClassInfo::kManyInstances, kVstAudioEffectClass, pluginName, \
classFlags, pluginVst3Categories, 0, pluginVersion, kVstVersionString); \
gPluginFactory->registerClass (&processorClass, processorCreateFunc); \
} \
{ \
const Steinberg::TUID lcid = controllerCID; \
static Steinberg::PClassInfo2 controllerClass ( \
lcid, Steinberg::PClassInfo::kManyInstances, kVstComponentControllerClass, \
pluginName, 0, "", 0, pluginVersion, kVstVersionString); \
gPluginFactory->registerClass (&controllerClass, controllerCreateFunc); \
} \
}
Steinberg::PClassInfo::kManyInstances
kManyInstances
Empty

Copyright © Steinberg Media Technologies GmbH. All Rights Reserved. This documentation is under this license.