From 698ad071b77642818fd030cedaad3f460f4ad026 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 13 Jun 2024 17:00:24 +0200 Subject: [PATCH] VST3: prepare to provide a runloop to IAudioProcessor Currently _run_loop is NULL (which is valid) until the GUI is opened at least once. Next step is to move the [static] runloop into libpbd. --- libs/ardour/vst3_host.cc | 1 + libs/ardour/vst3_plugin.cc | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/libs/ardour/vst3_host.cc b/libs/ardour/vst3_host.cc index 748832e241..0ba39bc82f 100644 --- a/libs/ardour/vst3_host.cc +++ b/libs/ardour/vst3_host.cc @@ -36,6 +36,7 @@ DEF_CLASS_IID (IBStream) DEF_CLASS_IID (IPluginBase) DEF_CLASS_IID (IPluginFactory) DEF_CLASS_IID (IPluginFactory2) +DEF_CLASS_IID (IPluginFactory3) DEF_CLASS_IID (IPlugFrame) DEF_CLASS_IID (IPlugView) DEF_CLASS_IID (ISizeableStream) diff --git a/libs/ardour/vst3_plugin.cc b/libs/ardour/vst3_plugin.cc index 313751f659..48cc24e09c 100644 --- a/libs/ardour/vst3_plugin.cc +++ b/libs/ardour/vst3_plugin.cc @@ -1277,6 +1277,14 @@ VST3PI::VST3PI (std::shared_ptr m, std::string unique_ throw failed_constructor (); } +#if SMTG_OS_LINUX + IPtr factory3 = FUnknownPtr (factory); + if (factory3) { + Vst::IComponentHandler* ctx = this; + factory3->setHostContext ((FUnknown*) ctx); + } +#endif + /* prepare process context */ memset (&_context, 0, sizeof (Vst::ProcessContext));