From 29410e3992b0a8d895d12297c1975e129b2c35d5 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Fri, 22 Jan 2021 01:28:25 +0100 Subject: [PATCH] Add fixmes for incorrect byte orders As pointed out on the Discord. Fixing this will require a breaking change, but right we report incorrect plugin IDs meaning that projects saved under Windows cannot be opened under Linux with yabridge so this really needs a fix. --- .../vst3/host-context/plug-interface-support.h | 3 +++ src/common/serialization/vst3/plugin-factory.cpp | 7 +++++++ 2 files changed, 10 insertions(+) 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 11791af4..390ccdec 100644 --- a/src/common/serialization/vst3/host-context/plug-interface-support.h +++ b/src/common/serialization/vst3/host-context/plug-interface-support.h @@ -66,6 +66,9 @@ 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; diff --git a/src/common/serialization/vst3/plugin-factory.cpp b/src/common/serialization/vst3/plugin-factory.cpp index b973c9f0..453736d6 100644 --- a/src/common/serialization/vst3/plugin-factory.cpp +++ b/src/common/serialization/vst3/plugin-factory.cpp @@ -25,6 +25,13 @@ YaPluginFactory::ConstructArgs::ConstructArgs() {} YaPluginFactory::ConstructArgs::ConstructArgs( Steinberg::IPtr factory) { + // FIXME: The class IDs are incorrect! See the `INLINE_UID` macro. We need + // to shuffle the byte orders around for plugins to be compatible + // with projects saved under Windows and with native Linux versions + // of the same plugin. + // FIXME: We need to do similar translations everywhere where we encounter + // `ArrayUID`, such as `IComponent::getControllerClassId()` + // `IPluginFactory::getFactoryInfo` if (Steinberg::PFactoryInfo info; factory->getFactoryInfo(&info) == Steinberg::kResultOk) {