Add a (nonfunctional) VST3 entry point

This commit is contained in:
Robbert van der Helm
2020-11-29 22:15:01 +01:00
parent 6c26168303
commit 5b2221b251
2 changed files with 88 additions and 0 deletions
+23
View File
@@ -196,6 +196,29 @@ if with_vst3
link_with : vst3_sdk_hosting_wine,
include_directories : vst3_include_dir,
)
# This is the VST3 equivalent of `libyabridge-vst2.so`. The Wine host
# applications can handle both VST2 and VST3 plugins.
shared_library(
'yabridge-vst3',
[
'src/common/logging.cpp',
'src/plugin/vst3-plugin.cpp',
version_header,
],
native : true,
include_directories : include_dir,
dependencies : [
boost_dep,
boost_filesystem_dep,
bitsery_dep,
threads_dep,
tomlplusplus_dep,
vst3_sdk_native_dep,
],
cpp_args : compiler_options,
link_args : ['-ldl'],
)
else
message('VST3 support has been disabled')
endif
+65
View File
@@ -0,0 +1,65 @@
#include <public.sdk/source/main/pluginfactory.h>
// TODO: Should you include this implementation file or copy everything over?
#include <public.sdk/source/main/linuxmain.cpp>
using Steinberg::gPluginFactory;
// TODO: What should we do here? Also, note to self, don't forget to call these
// on the Wine host side if the host SDK doesn't already do that for us.
bool InitModule() {
return true;
}
bool DeinitModule() {
return true;
}
/**
* Our VST3 plugin's entry point. When building the plugin factory we'll host
* the plugin in our Wine application, retrieve its information and supported
* classes, and then recreate it here.
*/
SMTG_EXPORT_SYMBOL Steinberg::IPluginFactory* PLUGIN_API GetPluginFactory() {
// TODO: So from this I can imagine that the host is supposed to keep this
// module loaded into memory and reuse it for multiple plugins? How
// should Wine host instances be tied to native plugin instances?
if (!gPluginFactory) {
// TODO: Here we want to:
// 1) Load the plugin on the Wine host
// 2) Create a factory using the plugins PFactoryInfo
// 3) Get all PClassInfo{,2,W} objects from the plugin, register
// those classes.
//
// We should wrap this in our `Vst3PluginBridge`
// static Steinberg::PFactoryInfo factoryInfo(vendor, url, email,
// flags); gPluginFactory = new Steinberg::CPluginFactory(factoryInfo);
//
// {
// Steinberg::TUID lcid = cid;
// static Steinberg::PClassInfo componentClass(lcid, cardinality,
// category, name);
// gPluginFactory->registerClass(&componentClass, createMethod);
// }
// {
// Steinberg::TUID lcid = cid;
// static Steinberg::PClassInfo2 componentClass(
// lcid, cardinality, category, name, classFlags, subCategories,
// 0, version, sdkVersion);
// gPluginFactory->registerClass(&componentClass, createMethod);
// }
// {
// TUID lcid = cid;
// static Steinberg::PClassInfoW componentClass(
// lcid, cardinality, category, name, classFlags, subCategories,
// 0, version, sdkVersion);
// gPluginFactory->registerClass(&componentClass, createMethod);
// }
} else {
gPluginFactory->addRef();
}
return gPluginFactory;
}