/ VST Home / Technical Documentation

[3.7.5] Module Info and Plug-in Compatibility

On this page:

Introduction

A new moduleinfo.json file added to the plug-in bundle describes the contents of the plug-in in a JSON5 compatible format. This includes a compatibility list which allows, for example, that a VST 3 plug-in could replace a given VST 2 plug-in (check here to learn how to create UID for old VST 2 plug-in).

  • [plug imp]
  • [released: 3.7.5]

Plug-in’s module info file: moduleinfo.json

Check moduleinfo.json for more information about the content of this file.

IPluginCompatibility

If the plug-in could not deliver the moduleinfo.json because it does not support bundle, it is possible to add to the plug-in factory this new interface IPluginCompatibility.

Example

In plugentry.cpp

//------------------------------------------------------------------------
class PluginCompatibility : public FObject, public IPluginCompatibility
{
  public:
    //...
    tresult PLUGIN_API getCompatibilityJSON (IBStream* stream) override
    {
      /* write in the stream the JSON compatibility array
      {
          "Compatibility": [
          {
              "New": "BD58B550F9E5634E9D2EFF39EA0927B1",
              "Old": [
                  "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
                  "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB",
              ],
          }
      }
      */
	    return kResultTrue;
    }
    //... 
};

//------------------------------------------------------------------------
static FUnknown* createCompatibilityInstance (void* context)
{
	return (IPluginCompatibility*)new PluginCompatibility;
}

//------------------------------------------------------------------------
BEGIN_FACTORY_DEF (stringCompanyName, stringCompanyWeb, stringCompanyEmail)

    //...
    DEF_CLASS2 (INLINE_UID_FROM_FUID(PluginCompatibilityUID),
				PClassInfo::kManyInstances,
				kPluginCompatibilityClass,
				stringPluginName,
				Vst::kDistributable,
				"",
				FULL_VERSION_STR,
				kVstVersionString,
				createCompatibilityInstance)

Example of host implementation

Check function void Validator::testModule in public.sdk/samples/vst-hosting/validator/source/validator.cpp

plugCompatibility = factory.createInstance<IPluginCompatibility> (classInfo.ID ());