From 89111d2f5f3376d66f2a4173593e724b054c8d75 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Sun, 10 Jan 2021 23:49:58 +0100 Subject: [PATCH] Add stubs for IUnitHandler2 --- src/common/serialization/vst3/component-handler-proxy.cpp | 8 +++++++- src/common/serialization/vst3/component-handler-proxy.h | 6 +++++- .../bridges/vst3-impls/component-handler-proxy.cpp | 6 ++++++ .../bridges/vst3-impls/component-handler-proxy.h | 3 +++ 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/common/serialization/vst3/component-handler-proxy.cpp b/src/common/serialization/vst3/component-handler-proxy.cpp index 4331d978..b6cb04a0 100644 --- a/src/common/serialization/vst3/component-handler-proxy.cpp +++ b/src/common/serialization/vst3/component-handler-proxy.cpp @@ -25,13 +25,15 @@ Vst3ComponentHandlerProxy::ConstructArgs::ConstructArgs( component_handler_args(object), component_handler_2_args(object), component_handler_3_args(object), - unit_handler_args(object) {} + unit_handler_args(object), + unit_handler_2_args(object) {} Vst3ComponentHandlerProxy::Vst3ComponentHandlerProxy(const ConstructArgs&& args) : YaComponentHandler(std::move(args.component_handler_args)), YaComponentHandler2(std::move(args.component_handler_2_args)), YaComponentHandler3(std::move(args.component_handler_3_args)), YaUnitHandler(std::move(args.unit_handler_args)), + YaUnitHandler2(std::move(args.unit_handler_2_args)), arguments(std::move(args)){FUNKNOWN_CTOR} Vst3ComponentHandlerProxy::~Vst3ComponentHandlerProxy() { @@ -64,6 +66,10 @@ Vst3ComponentHandlerProxy::queryInterface(Steinberg::FIDString _iid, QUERY_INTERFACE(_iid, obj, Steinberg::Vst::IUnitHandler::iid, Steinberg::Vst::IUnitHandler) } + if (YaUnitHandler2::supported()) { + QUERY_INTERFACE(_iid, obj, Steinberg::Vst::IUnitHandler2::iid, + Steinberg::Vst::IUnitHandler2) + } *obj = nullptr; return Steinberg::kNoInterface; diff --git a/src/common/serialization/vst3/component-handler-proxy.h b/src/common/serialization/vst3/component-handler-proxy.h index ebc290ae..993ee6d3 100644 --- a/src/common/serialization/vst3/component-handler-proxy.h +++ b/src/common/serialization/vst3/component-handler-proxy.h @@ -20,6 +20,7 @@ #include "component-handler/component-handler-2.h" #include "component-handler/component-handler-3.h" #include "component-handler/component-handler.h" +#include "component-handler/unit-handler-2.h" #include "component-handler/unit-handler.h" #pragma GCC diagnostic push @@ -36,7 +37,8 @@ class Vst3ComponentHandlerProxy : public YaComponentHandler, public YaComponentHandler2, public YaComponentHandler3, - public YaUnitHandler { + public YaUnitHandler, + public YaUnitHandler2 { public: /** * These are the arguments for constructing a @@ -64,6 +66,7 @@ class Vst3ComponentHandlerProxy : public YaComponentHandler, YaComponentHandler2::ConstructArgs component_handler_2_args; YaComponentHandler3::ConstructArgs component_handler_3_args; YaUnitHandler::ConstructArgs unit_handler_args; + YaUnitHandler2::ConstructArgs unit_handler_2_args; template void serialize(S& s) { @@ -72,6 +75,7 @@ class Vst3ComponentHandlerProxy : public YaComponentHandler, s.object(component_handler_2_args); s.object(component_handler_3_args); s.object(unit_handler_args); + s.object(unit_handler_2_args); } }; diff --git a/src/wine-host/bridges/vst3-impls/component-handler-proxy.cpp b/src/wine-host/bridges/vst3-impls/component-handler-proxy.cpp index f1f5c496..2443a674 100644 --- a/src/wine-host/bridges/vst3-impls/component-handler-proxy.cpp +++ b/src/wine-host/bridges/vst3-impls/component-handler-proxy.cpp @@ -128,3 +128,9 @@ tresult PLUGIN_API Vst3ComponentHandlerProxyImpl::notifyProgramListChange( .list_id = listId, .program_index = programIndex}); } + +tresult PLUGIN_API Vst3ComponentHandlerProxyImpl::notifyUnitByBusChange() { + // TODO: Implement + std::cerr << "TODO: IUnitHandler2::notifyUnitSelection()" << std::endl; + return Steinberg::kNotImplemented; +} diff --git a/src/wine-host/bridges/vst3-impls/component-handler-proxy.h b/src/wine-host/bridges/vst3-impls/component-handler-proxy.h index 932ef465..38c5d4a1 100644 --- a/src/wine-host/bridges/vst3-impls/component-handler-proxy.h +++ b/src/wine-host/bridges/vst3-impls/component-handler-proxy.h @@ -57,6 +57,9 @@ class Vst3ComponentHandlerProxyImpl : public Vst3ComponentHandlerProxy { notifyProgramListChange(Steinberg::Vst::ProgramListID listId, int32 programIndex) override; + // From `IUnitHandler2` + tresult PLUGIN_API notifyUnitByBusChange() override; + private: Vst3Bridge& bridge; };