diff --git a/modules/juce_audio_plugin_client/juce_audio_plugin_client_VST3.cpp b/modules/juce_audio_plugin_client/juce_audio_plugin_client_VST3.cpp index 62703763d9..cd892164d7 100644 --- a/modules/juce_audio_plugin_client/juce_audio_plugin_client_VST3.cpp +++ b/modules/juce_audio_plugin_client/juce_audio_plugin_client_VST3.cpp @@ -3965,33 +3965,38 @@ public: auto filter = createPluginFilterOfType (AudioProcessor::WrapperType::wrapperType_VST3); auto* extensions = filter->getVST3ClientExtensions(); - if (extensions == nullptr || extensions->getCompatibleClasses().empty()) - return kResultFalse; - - DynamicObject::Ptr object { new DynamicObject }; - - // New iid is the ID of our Audio Effect class - object->setProperty ("New", String (VST3::UID (JuceVST3Component::iid).toString())); - object->setProperty ("Old", [&] + const auto compatibilityObjects = [&] { - Array oldArray; + if (extensions == nullptr || extensions->getCompatibleClasses().empty()) + return Array(); - for (const auto& uid : extensions->getCompatibleClasses()) + DynamicObject::Ptr object { new DynamicObject }; + + // New iid is the ID of our Audio Effect class + object->setProperty ("New", String (VST3::UID (JuceVST3Component::iid).toString())); + object->setProperty ("Old", [&] { - // All UIDs returned from getCompatibleClasses should be 32 characters long - jassert (uid.length() == 32); + Array oldArray; + + for (const auto& uid : extensions->getCompatibleClasses()) + { + // All UIDs returned from getCompatibleClasses should be 32 characters long + jassert (uid.length() == 32); - // All UIDs returned from getCompatibleClasses should be in hex notation - jassert (uid.containsOnly ("ABCDEF0123456789")); + // All UIDs returned from getCompatibleClasses should be in hex notation + jassert (uid.containsOnly ("ABCDEF0123456789")); - oldArray.add (uid); - } + oldArray.add (uid); + } - return oldArray; - }()); + return oldArray; + }()); + + return Array { object.get() }; + }(); MemoryOutputStream memory; - JSON::writeToStream (memory, var { Array { object.get() } }); + JSON::writeToStream (memory, var { compatibilityObjects }); return stream->write (memory.getMemoryBlock().getData(), (Steinberg::int32) memory.getDataSize()); }