From a2d1a9730944c4a29d744561b891b361941433ce Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Sun, 10 Jan 2021 23:38:40 +0100 Subject: [PATCH] Fully implement IAutomationState --- src/common/serialization/vst3.h | 1 + src/plugin/bridges/vst3-impls/plugin-proxy.cpp | 6 ++---- src/wine-host/bridges/vst3.cpp | 6 ++++++ src/wine-host/bridges/vst3.h | 1 + 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/common/serialization/vst3.h b/src/common/serialization/vst3.h index f14fe5d9..76e6503b 100644 --- a/src/common/serialization/vst3.h +++ b/src/common/serialization/vst3.h @@ -71,6 +71,7 @@ using ControlRequest = Vst3PluginProxy::SetState, Vst3PluginProxy::GetState, YaAudioPresentationLatency::SetAudioPresentationLatencySamples, + YaAutomationState::SetAutomationState, YaConnectionPoint::Connect, YaConnectionPoint::Disconnect, YaConnectionPoint::Notify, diff --git a/src/plugin/bridges/vst3-impls/plugin-proxy.cpp b/src/plugin/bridges/vst3-impls/plugin-proxy.cpp index 54ca7fb6..2f068f49 100644 --- a/src/plugin/bridges/vst3-impls/plugin-proxy.cpp +++ b/src/plugin/bridges/vst3-impls/plugin-proxy.cpp @@ -157,10 +157,8 @@ uint32 PLUGIN_API Vst3PluginProxyImpl::getTailSamples() { } tresult PLUGIN_API Vst3PluginProxyImpl::setAutomationState(int32 state) { - // TODO: Implement - bridge.logger.log( - "TODO: Implyement IAutomationState::setAutomationState()"); - return Steinberg::kNotImplemented; + return bridge.send_message(YaAutomationState::SetAutomationState{ + .instance_id = instance_id(), .state = state}); } tresult PLUGIN_API diff --git a/src/wine-host/bridges/vst3.cpp b/src/wine-host/bridges/vst3.cpp index 9b3f2c36..452b728a 100644 --- a/src/wine-host/bridges/vst3.cpp +++ b/src/wine-host/bridges/vst3.cpp @@ -39,6 +39,7 @@ InstanceInterfaces::InstanceInterfaces( : object(object), audio_presentation_latency(object), audio_processor(object), + automation_state(object), component(object), connection_point(object), edit_controller(object), @@ -197,6 +198,11 @@ void Vst3Bridge::run() { request.dir, request.bus_index, request.latency_in_samples); }, + [&](YaAutomationState::SetAutomationState& request) + -> YaAutomationState::SetAutomationState::Response { + return object_instances[request.instance_id] + .automation_state->setAutomationState(request.state); + }, [&](YaConnectionPoint::Connect& request) -> YaConnectionPoint::Connect::Response { // If the host directly connected the underlying objects then we diff --git a/src/wine-host/bridges/vst3.h b/src/wine-host/bridges/vst3.h index 0766576e..af9af117 100644 --- a/src/wine-host/bridges/vst3.h +++ b/src/wine-host/bridges/vst3.h @@ -148,6 +148,7 @@ struct InstanceInterfaces { Steinberg::FUnknownPtr audio_presentation_latency; Steinberg::FUnknownPtr audio_processor; + Steinberg::FUnknownPtr automation_state; Steinberg::FUnknownPtr component; Steinberg::FUnknownPtr connection_point; Steinberg::FUnknownPtr edit_controller;