mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
VST3: Increased the instantiation speed of large shell plug-ins
This commit is contained in:
parent
92a9c37bac
commit
9c50bbde2b
1 changed files with 14 additions and 30 deletions
|
|
@ -792,29 +792,6 @@ private:
|
|||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DescriptionFactory)
|
||||
};
|
||||
|
||||
struct MatchingDescriptionFinder : public DescriptionFactory
|
||||
{
|
||||
MatchingDescriptionFinder (VST3HostContext* h, IPluginFactory* f, const PluginDescription& desc)
|
||||
: DescriptionFactory (h, f), description (desc)
|
||||
{
|
||||
}
|
||||
|
||||
static const char* getSuccessString() noexcept { return "Found Description"; }
|
||||
|
||||
Result performOnDescription (PluginDescription& desc)
|
||||
{
|
||||
if (description.isDuplicateOf (desc))
|
||||
return Result::fail (getSuccessString());
|
||||
|
||||
return Result::ok();
|
||||
}
|
||||
|
||||
private:
|
||||
const PluginDescription& description;
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MatchingDescriptionFinder)
|
||||
};
|
||||
|
||||
struct DescriptionLister : public DescriptionFactory
|
||||
{
|
||||
DescriptionLister (VST3HostContext* host, IPluginFactory* pluginFactory)
|
||||
|
|
@ -1088,15 +1065,22 @@ private:
|
|||
|
||||
if (pluginFactory != nullptr)
|
||||
{
|
||||
ComSmartPtr<VST3HostContext> host (new VST3HostContext());
|
||||
MatchingDescriptionFinder finder (host, pluginFactory, description);
|
||||
auto numClasses = pluginFactory->countClasses();
|
||||
|
||||
auto result = finder.findDescriptionsAndPerform (f);
|
||||
|
||||
if (result.getErrorMessage() == MatchingDescriptionFinder::getSuccessString())
|
||||
for (Steinberg::int32 i = 0; i < numClasses; ++i)
|
||||
{
|
||||
name = description.name;
|
||||
return true;
|
||||
PClassInfo info;
|
||||
pluginFactory->getClassInfo (i, &info);
|
||||
|
||||
if (std::strcmp (info.category, kVstAudioEffectClass) != 0)
|
||||
continue;
|
||||
|
||||
if (toString (info.name).trim() == description.name
|
||||
&& getHashForTUID (info.cid) == description.uid)
|
||||
{
|
||||
name = description.name;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue