From 23c9d1b7324a7f22f8a31ae684f755bf0ff3db48 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 25 Jun 2021 18:11:38 +0200 Subject: [PATCH] AU: Support loading sessions using numeric AU IDs --- libs/ardour/plugin.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libs/ardour/plugin.cc b/libs/ardour/plugin.cc index f075674ad6..7c57c2a22d 100644 --- a/libs/ardour/plugin.cc +++ b/libs/ardour/plugin.cc @@ -271,6 +271,18 @@ ARDOUR::find_plugin(Session& session, string identifier, PluginType type) } #endif +#ifdef AUDIOUNIT_SUPPORT + if (type == ARDOUR::AudioUnit) { + /* old versions saved three 32bit (really OSType) integers + * e.g. 112233-445566-778899 (due to stringstream misinterpreting OSType) + * instead of using Apple's UTCreateStringForOSType, which results in + * "aaaa - bbbb - cccc" + */ + identifier = AUPluginInfo::convert_old_unique_id (identifier); + for (i = plugs.begin(); i != plugs.end(); ++i) { + if (identifier == (*i)->unique_id){ + return (*i)->load (session); + } #ifdef LXVST_SUPPORT /* hmm, we didn't find it. could be because in older versions of Ardour. we used to store the name of a VST plugin, not its unique ID. so try @@ -282,6 +294,7 @@ ARDOUR::find_plugin(Session& session, string identifier, PluginType type) return (*i)->load (session); } } + #endif return PluginPtr ();