diff --git a/src/plugin/vst3-plugin.cpp b/src/plugin/vst3-plugin.cpp index cd12d108..0e12f3fe 100644 --- a/src/plugin/vst3-plugin.cpp +++ b/src/plugin/vst3-plugin.cpp @@ -16,10 +16,10 @@ #include -#include - #include "bridges/vst3.h" +#include + using Steinberg::gPluginFactory; // Because VST3 plugins consist of completely independent components that have @@ -70,11 +70,27 @@ bool DeinitModule() { * classes, and then recreate it here. */ SMTG_EXPORT_SYMBOL Steinberg::IPluginFactory* PLUGIN_API GetPluginFactory() { - // TODO: Check the VST3::Hosting module loading source to see if - // gPluginFactory is used directly by the host or not. - // TODO: We can do all of our allocations and things indie of - // `Vst3PluginBridge`, so this function should call some function on - // Vst3Bridge that does the initialization + // The host should have called `InitModule()` first + assert(bridge); + + // TODO: Instead of using gPluginFactory we'll use a field in + // `Vst3PluginBridge` + // TODO: First thing we should do is query the factory on the Wine side and + // preset a copy of it to the host. The important bits there are that + // we use the same interface version as the one presented the plugin. + // TODO: We have two options for the implementation: + // 1. We can query the interface version, and then have three + // different implementations for the interface version. + // 2. We can implement version 3, but copy the iid from the plugin so + // it always uses the correct version. + + // TODO: Remove, this is just for type checking + if (false) { + boost::asio::local::stream_protocol::socket* socket; + YaPluginFactory* object; + write_object(*socket, *object); + } + if (!gPluginFactory) { // TODO: Here we want to: // 1) Load the plugin on the Wine host diff --git a/src/wine-host/bridges/vst3.cpp b/src/wine-host/bridges/vst3.cpp index d9ea7513..a905d94f 100644 --- a/src/wine-host/bridges/vst3.cpp +++ b/src/wine-host/bridges/vst3.cpp @@ -42,6 +42,13 @@ Vst3Bridge::Vst3Bridge(MainContext& main_context, } void Vst3Bridge::run() { + // TODO: Remove, this is just for type checking + if (false) { + boost::asio::local::stream_protocol::socket* socket; + YaPluginFactory* object; + write_object(*socket, *object); + } + // TODO: Handle events // sockets.host_vst_control.receive_messages( // std::nullopt, [&](ControlRequest request) -> ControlResponse {