From 87b270273f74ac28725dcb819b40d83273f1b920 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Tue, 12 Jan 2021 15:37:58 +0100 Subject: [PATCH] Fully implement IPrefetchableSupport --- src/common/serialization/vst3.h | 3 ++- src/plugin/bridges/vst3-impls/plugin-proxy.cpp | 12 ++++++++---- src/wine-host/bridges/vst3.cpp | 17 +++++++++++++++++ src/wine-host/bridges/vst3.h | 2 ++ 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/src/common/serialization/vst3.h b/src/common/serialization/vst3.h index 637af74f..f7d65878 100644 --- a/src/common/serialization/vst3.h +++ b/src/common/serialization/vst3.h @@ -163,7 +163,8 @@ using AudioProcessorRequest = YaComponent::GetBusInfo, YaComponent::GetRoutingInfo, YaComponent::ActivateBus, - YaComponent::SetActive>; + YaComponent::SetActive, + YaPrefetchableSupport::GetPrefetchableSupport>; template void serialize(S& s, AudioProcessorRequest& payload) { diff --git a/src/plugin/bridges/vst3-impls/plugin-proxy.cpp b/src/plugin/bridges/vst3-impls/plugin-proxy.cpp index 3b7c6a08..00d2d0ab 100644 --- a/src/plugin/bridges/vst3-impls/plugin-proxy.cpp +++ b/src/plugin/bridges/vst3-impls/plugin-proxy.cpp @@ -675,10 +675,14 @@ tresult PLUGIN_API Vst3PluginProxyImpl::terminate() { tresult PLUGIN_API Vst3PluginProxyImpl::getPrefetchableSupport( Steinberg::Vst::PrefetchableSupport& prefetchable /*out*/) { - // TODO: Implement - bridge.logger.log( - "TODO: Implement IPrefetchableSupport::getPrefetchableSupport()"); - return Steinberg::kNotImplemented; + const GetPrefetchableSupportResponse response = + bridge.send_audio_processor_message( + YaPrefetchableSupport::GetPrefetchableSupport{.instance_id = + instance_id()}); + + prefetchable = response.prefetchable; + + return response.result; } tresult PLUGIN_API Vst3PluginProxyImpl::programDataSupported( diff --git a/src/wine-host/bridges/vst3.cpp b/src/wine-host/bridges/vst3.cpp index 456b3e88..82f85a00 100644 --- a/src/wine-host/bridges/vst3.cpp +++ b/src/wine-host/bridges/vst3.cpp @@ -50,6 +50,7 @@ InstanceInterfaces::InstanceInterfaces( note_expression_controller(object), plugin_base(object), unit_data(object), + prefetchable_support(object), program_list_data(object), unit_info(object), xml_representation_controller(object) {} @@ -1103,6 +1104,22 @@ size_t Vst3Bridge::register_object_instance( return object_instances[request.instance_id] .component->setActive(request.state); }, + [&](const YaPrefetchableSupport::GetPrefetchableSupport& + request) + -> YaPrefetchableSupport::GetPrefetchableSupport:: + Response { + Steinberg::Vst::PrefetchableSupport + prefetchable; + const tresult result = + object_instances[request.instance_id] + .prefetchable_support + ->getPrefetchableSupport(prefetchable); + + return YaPrefetchableSupport:: + GetPrefetchableSupportResponse{ + .result = result, + .prefetchable = prefetchable}; + }, }); }); diff --git a/src/wine-host/bridges/vst3.h b/src/wine-host/bridges/vst3.h index af9af117..1137c580 100644 --- a/src/wine-host/bridges/vst3.h +++ b/src/wine-host/bridges/vst3.h @@ -162,6 +162,8 @@ struct InstanceInterfaces { note_expression_controller; Steinberg::FUnknownPtr plugin_base; Steinberg::FUnknownPtr unit_data; + Steinberg::FUnknownPtr + prefetchable_support; Steinberg::FUnknownPtr program_list_data; Steinberg::FUnknownPtr unit_info; Steinberg::FUnknownPtr