From 934aea386052f8fdb83ef9a35f093a25a763346c Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Sat, 26 Dec 2020 14:17:10 +0100 Subject: [PATCH] Add IUnitHandler stubs to component handler proxy --- .../vst3/component-handler-proxy.cpp | 5 ++++- .../serialization/vst3/component-handler-proxy.h | 6 +++++- .../vst3-impls/component-handler-proxy.cpp | 15 +++++++++++++++ .../bridges/vst3-impls/component-handler-proxy.h | 7 +++++++ 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/common/serialization/vst3/component-handler-proxy.cpp b/src/common/serialization/vst3/component-handler-proxy.cpp index 3961b91b..c134a39c 100644 --- a/src/common/serialization/vst3/component-handler-proxy.cpp +++ b/src/common/serialization/vst3/component-handler-proxy.cpp @@ -21,10 +21,13 @@ Vst3ComponentHandlerProxy::ConstructArgs::ConstructArgs() {} Vst3ComponentHandlerProxy::ConstructArgs::ConstructArgs( Steinberg::IPtr object, size_t owner_instance_id) - : owner_instance_id(owner_instance_id), component_handler_args(object) {} + : owner_instance_id(owner_instance_id), + component_handler_args(object), + unit_handler_args(object) {} Vst3ComponentHandlerProxy::Vst3ComponentHandlerProxy(const ConstructArgs&& args) : YaComponentHandler(std::move(args.component_handler_args)), + YaUnitHandler(std::move(args.unit_handler_args)), arguments(std::move(args)){FUNKNOWN_CTOR} Vst3ComponentHandlerProxy::~Vst3ComponentHandlerProxy() { diff --git a/src/common/serialization/vst3/component-handler-proxy.h b/src/common/serialization/vst3/component-handler-proxy.h index eced256b..0c82cea4 100644 --- a/src/common/serialization/vst3/component-handler-proxy.h +++ b/src/common/serialization/vst3/component-handler-proxy.h @@ -18,6 +18,7 @@ #include "../common.h" #include "component-handler/component-handler.h" +#include "component-handler/unit-handler.h" #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wnon-virtual-dtor" @@ -30,7 +31,8 @@ * by the plugin we are proxying for the `IComponentHandler*` argument passed to * plugin by the host. */ -class Vst3ComponentHandlerProxy : public YaComponentHandler { +class Vst3ComponentHandlerProxy : public YaComponentHandler, + public YaUnitHandler { public: /** * These are the arguments for constructing a @@ -55,11 +57,13 @@ class Vst3ComponentHandlerProxy : public YaComponentHandler { native_size_t owner_instance_id; YaComponentHandler::ConstructArgs component_handler_args; + YaUnitHandler::ConstructArgs unit_handler_args; template void serialize(S& s) { s.value8b(owner_instance_id); s.object(component_handler_args); + s.object(unit_handler_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 ecdb4384..690501e1 100644 --- a/src/wine-host/bridges/vst3-impls/component-handler-proxy.cpp +++ b/src/wine-host/bridges/vst3-impls/component-handler-proxy.cpp @@ -66,3 +66,18 @@ Vst3ComponentHandlerProxyImpl::restartComponent(int32 flags) { return bridge.send_message(YaComponentHandler::RestartComponent{ .owner_instance_id = owner_instance_id(), .flags = flags}); } + +tresult PLUGIN_API Vst3ComponentHandlerProxyImpl::notifyUnitSelection( + Steinberg::Vst::UnitID unitId) { + // TODO: Implement + std::cerr << "TODO: IUnitHandler::notifyUnitSelection" << std::endl; + return Steinberg::kNotImplemented; +} + +tresult PLUGIN_API Vst3ComponentHandlerProxyImpl::notifyProgramListChange( + Steinberg::Vst::ProgramListID listId, + int32 programIndex) { + // TODO: Implement + std::cerr << "TODO: IUnitHandler::notifyProgramListChange" << 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 a4433891..fcf0edf9 100644 --- a/src/wine-host/bridges/vst3-impls/component-handler-proxy.h +++ b/src/wine-host/bridges/vst3-impls/component-handler-proxy.h @@ -39,6 +39,13 @@ class Vst3ComponentHandlerProxyImpl : public Vst3ComponentHandlerProxy { tresult PLUGIN_API endEdit(Steinberg::Vst::ParamID id) override; tresult PLUGIN_API restartComponent(int32 flags) override; + // From `IUnitHandler` + tresult PLUGIN_API + notifyUnitSelection(Steinberg::Vst::UnitID unitId) override; + tresult PLUGIN_API + notifyProgramListChange(Steinberg::Vst::ProgramListID listId, + int32 programIndex) override; + private: Vst3Bridge& bridge; };