From ae0d7263b8fca003d6fd1f2063ae1674944041df Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Fri, 22 Jan 2021 13:50:06 +0100 Subject: [PATCH] Use UID conversion for IsPlugInterfaceSupported I assume that this would also be necessary here, right? --- src/common/logging/vst3.cpp | 3 +- .../host-context/plug-interface-support.h | 10 ++--- src/plugin/bridges/vst3.cpp | 41 +++++++++---------- .../bridges/vst3-impls/host-context-proxy.cpp | 3 +- 4 files changed, 28 insertions(+), 29 deletions(-) diff --git a/src/common/logging/vst3.cpp b/src/common/logging/vst3.cpp index b8cd9dc3..e19ad68f 100644 --- a/src/common/logging/vst3.cpp +++ b/src/common/logging/vst3.cpp @@ -1296,7 +1296,8 @@ bool Vst3Logger::log_request( } message << ": IPlugInterfaceSupport::isPlugInterfaceSupported(unitId = " - << format_uid(Steinberg::FUID::fromTUID(request.iid.data())) + << format_uid(Steinberg::FUID::fromTUID( + request.iid.get_native_uid().data())) << ")"; }); } diff --git a/src/common/serialization/vst3/host-context/plug-interface-support.h b/src/common/serialization/vst3/host-context/plug-interface-support.h index 390ccdec..1416fcad 100644 --- a/src/common/serialization/vst3/host-context/plug-interface-support.h +++ b/src/common/serialization/vst3/host-context/plug-interface-support.h @@ -66,9 +66,6 @@ class YaPlugInterfaceSupport : public Steinberg::Vst::IPlugInterfaceSupport { * Message to pass through a call to * `IPlugInterfaceSupport::isPlugInterfaceSupported(iid)` to the host * context provided by the host. - * - * TODO: Figure out if we should translate the UIDs from Windows COM to - * non-Windows COM. */ struct IsPlugInterfaceSupported { using Response = UniversalTResult; @@ -80,7 +77,10 @@ class YaPlugInterfaceSupport : public Steinberg::Vst::IPlugInterfaceSupport { */ std::optional owner_instance_id; - ArrayUID iid; + // TODO: Figure out if we should translate the UIDs from Windows COM to + // non-Windows COM here. I have not actually seen this interface + // used. + WineUID iid; template void serialize(S& s) { @@ -88,7 +88,7 @@ class YaPlugInterfaceSupport : public Steinberg::Vst::IPlugInterfaceSupport { [](S& s, native_size_t& instance_id) { s.value8b(instance_id); }); - s.container1b(iid); + s.object(iid); } }; diff --git a/src/plugin/bridges/vst3.cpp b/src/plugin/bridges/vst3.cpp index db9d95b5..dd08df46 100644 --- a/src/plugin/bridges/vst3.cpp +++ b/src/plugin/bridges/vst3.cpp @@ -271,27 +271,26 @@ Vst3PluginBridge::Vst3PluginBridge() }); }, [&](const YaPlugInterfaceSupport::IsPlugInterfaceSupported& - request) -> YaPlugInterfaceSupport:: - IsPlugInterfaceSupported::Response { - // TODO: For correctness' sake we - // should automatically reject - // queries for interfaces we - // don't yet or can't implement, - // like the ARA interfaces. - if (request.owner_instance_id) { - return plugin_proxies - .at(*request.owner_instance_id) - .get() - .plug_interface_support - ->isPlugInterfaceSupported( - request.iid.data()); - } else { - return plugin_factory - ->plug_interface_support - ->isPlugInterfaceSupported( - request.iid.data()); - } - }, + request) + -> YaPlugInterfaceSupport::IsPlugInterfaceSupported:: + Response { + // TODO: For correctness' sake we should + // automatically reject queries for interfaces + // we don't yet or can't implement, like the + // ARA interfaces. + if (request.owner_instance_id) { + return plugin_proxies + .at(*request.owner_instance_id) + .get() + .plug_interface_support + ->isPlugInterfaceSupported( + request.iid.get_native_uid().data()); + } else { + return plugin_factory->plug_interface_support + ->isPlugInterfaceSupported( + request.iid.get_native_uid().data()); + } + }, [&](const YaProgress::Start& request) -> YaProgress::Start::Response { Steinberg::Vst::IProgress::ID out_id; diff --git a/src/wine-host/bridges/vst3-impls/host-context-proxy.cpp b/src/wine-host/bridges/vst3-impls/host-context-proxy.cpp index e1f1b4f8..3a38e226 100644 --- a/src/wine-host/bridges/vst3-impls/host-context-proxy.cpp +++ b/src/wine-host/bridges/vst3-impls/host-context-proxy.cpp @@ -100,8 +100,7 @@ Vst3HostContextProxyImpl::isPlugInterfaceSupported(const Steinberg::TUID _iid) { return bridge.send_message( YaPlugInterfaceSupport::IsPlugInterfaceSupported{ .owner_instance_id = owner_instance_id(), - .iid = std::to_array( - *reinterpret_cast(&_iid))}); + .iid = *reinterpret_cast(&_iid)}); } else { bridge.logger.log( "WARNING: Null pointer passed to "