Browse Source

Added a method AudioPluginFormat::isTrivialToScan(). Also removed the 'noexcept' flag from the AudioPluginFormat::requiresUnblockedMessageThreadDuringCreation() method

tags/2021-05-28
jules 6 years ago
parent
commit
7c65ea7e0b
9 changed files with 35 additions and 32 deletions
  1. +8
    -1
      modules/juce_audio_processors/format/juce_AudioPluginFormat.h
  2. +7
    -8
      modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.h
  3. +1
    -1
      modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm
  4. +1
    -1
      modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp
  5. +5
    -6
      modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.h
  6. +1
    -1
      modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp
  7. +6
    -7
      modules/juce_audio_processors/format_types/juce_VST3PluginFormat.h
  8. +1
    -1
      modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp
  9. +5
    -6
      modules/juce_audio_processors/format_types/juce_VSTPluginFormat.h

+ 8
- 1
modules/juce_audio_processors/format/juce_AudioPluginFormat.h View File

@@ -110,6 +110,12 @@ public:
/** Returns true if this format needs to run a scan to find its list of plugins. */
virtual bool canScanForPlugins() const = 0;
/** Should return true if this format is both safe and quick to scan - i.e. if a file
can be scanned within a few milliseconds on a background thread, without actually
needing to load an executable.
*/
virtual bool isTrivialToScan() const = 0;
/** Searches a suggested set of directories for any plugins in this format.
The path might be ignored, e.g. by AUs, which are found by the OS rather
than manually.
@@ -144,7 +150,8 @@ protected:
virtual void createPluginInstance (const PluginDescription&, double initialSampleRate,
int initialBufferSize, PluginCreationCallback) = 0;
virtual bool requiresUnblockedMessageThreadDuringCreation (const PluginDescription&) const noexcept = 0;
/** Returns true if instantiation of this plugin type must be done from a non-message thread. */
virtual bool requiresUnblockedMessageThreadDuringCreation (const PluginDescription&) const = 0;
private:
struct AsyncCreateMessage;


+ 7
- 8
modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.h View File

@@ -43,7 +43,10 @@ public:
~AudioUnitPluginFormat() override;
//==============================================================================
String getName() const override { return "AudioUnit"; }
String getName() const override { return "AudioUnit"; }
bool canScanForPlugins() const override { return true; }
bool isTrivialToScan() const override { return false; }
void findAllTypesForFile (OwnedArray<PluginDescription>&, const String& fileOrIdentifier) override;
bool fileMightContainThisPluginType (const String& fileOrIdentifier) override;
String getNameOfPluginFromIdentifier (const String& fileOrIdentifier) override;
@@ -51,17 +54,13 @@ public:
StringArray searchPathsForPlugins (const FileSearchPath&, bool recursive, bool) override;
bool doesPluginStillExist (const PluginDescription&) override;
FileSearchPath getDefaultLocationsToSearch() override;
bool canScanForPlugins() const override { return true; }
private:
//==============================================================================
void createPluginInstance (const PluginDescription&,
double initialSampleRate, int initialBufferSize,
PluginCreationCallback) override;
bool requiresUnblockedMessageThreadDuringCreation (const PluginDescription&) const noexcept override;
void createPluginInstance (const PluginDescription&, double initialSampleRate,
int initialBufferSize, PluginCreationCallback) override;
bool requiresUnblockedMessageThreadDuringCreation (const PluginDescription&) const override;
//==============================================================================
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioUnitPluginFormat)
};


+ 1
- 1
modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm View File

@@ -2754,7 +2754,7 @@ void AudioUnitPluginFormat::createPluginInstance (const PluginDescription& desc,
}
}
bool AudioUnitPluginFormat::requiresUnblockedMessageThreadDuringCreation (const PluginDescription& desc) const noexcept
bool AudioUnitPluginFormat::requiresUnblockedMessageThreadDuringCreation (const PluginDescription& desc) const
{
#if JUCE_SUPPORTS_AUv3
String pluginName, version, manufacturer;


+ 1
- 1
modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp View File

@@ -653,7 +653,7 @@ void LADSPAPluginFormat::createPluginInstance (const PluginDescription& desc,
callback (std::move (result), errorMsg);
}
bool LADSPAPluginFormat::requiresUnblockedMessageThreadDuringCreation (const PluginDescription&) const noexcept
bool LADSPAPluginFormat::requiresUnblockedMessageThreadDuringCreation (const PluginDescription&) const
{
return false;
}


+ 5
- 6
modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.h View File

@@ -42,7 +42,10 @@ public:
~LADSPAPluginFormat() override;
//==============================================================================
String getName() const override { return "LADSPA"; }
String getName() const override { return "LADSPA"; }
bool canScanForPlugins() const override { return true; }
bool isTrivialToScan() const override { return false; }
void findAllTypesForFile (OwnedArray<PluginDescription>&, const String& fileOrIdentifier) override;
bool fileMightContainThisPluginType (const String& fileOrIdentifier) override;
String getNameOfPluginFromIdentifier (const String& fileOrIdentifier) override;
@@ -50,16 +53,12 @@ public:
StringArray searchPathsForPlugins (const FileSearchPath&, bool recursive, bool) override;
bool doesPluginStillExist (const PluginDescription&) override;
FileSearchPath getDefaultLocationsToSearch() override;
bool canScanForPlugins() const override { return true; }
private:
//==============================================================================
void createPluginInstance (const PluginDescription&, double initialSampleRate,
int initialBufferSize, PluginCreationCallback) override;
bool requiresUnblockedMessageThreadDuringCreation (const PluginDescription&) const noexcept override;
private:
bool requiresUnblockedMessageThreadDuringCreation (const PluginDescription&) const override;
void recursiveFileSearch (StringArray&, const File&, bool recursive);
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LADSPAPluginFormat)


+ 1
- 1
modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp View File

@@ -3114,7 +3114,7 @@ void VST3PluginFormat::createPluginInstance (const PluginDescription& descriptio
callback (std::move (result), errorMsg);
}
bool VST3PluginFormat::requiresUnblockedMessageThreadDuringCreation (const PluginDescription&) const noexcept
bool VST3PluginFormat::requiresUnblockedMessageThreadDuringCreation (const PluginDescription&) const
{
return false;
}


+ 6
- 7
modules/juce_audio_processors/format_types/juce_VST3PluginFormat.h View File

@@ -51,7 +51,10 @@ public:
static bool setStateFromVSTPresetFile (AudioPluginInstance*, const MemoryBlock&);
//==============================================================================
String getName() const override { return "VST3"; }
String getName() const override { return "VST3"; }
bool canScanForPlugins() const override { return true; }
bool isTrivialToScan() const override { return false; }
void findAllTypesForFile (OwnedArray<PluginDescription>&, const String& fileOrIdentifier) override;
bool fileMightContainThisPluginType (const String& fileOrIdentifier) override;
String getNameOfPluginFromIdentifier (const String& fileOrIdentifier) override;
@@ -59,16 +62,12 @@ public:
StringArray searchPathsForPlugins (const FileSearchPath&, bool recursive, bool) override;
bool doesPluginStillExist (const PluginDescription&) override;
FileSearchPath getDefaultLocationsToSearch() override;
bool canScanForPlugins() const override { return true; }
private:
//==============================================================================
void createPluginInstance (const PluginDescription&, double initialSampleRate,
int initialBufferSize, PluginCreationCallback) override;
bool requiresUnblockedMessageThreadDuringCreation (const PluginDescription&) const noexcept override;
private:
//==============================================================================
bool requiresUnblockedMessageThreadDuringCreation (const PluginDescription&) const override;
void recursiveFileSearch (StringArray&, const File&, bool recursive);
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (VST3PluginFormat)


+ 1
- 1
modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp View File

@@ -3611,7 +3611,7 @@ void VSTPluginFormat::createPluginInstance (const PluginDescription& desc,
callback (std::move (result), errorMsg);
}
bool VSTPluginFormat::requiresUnblockedMessageThreadDuringCreation (const PluginDescription&) const noexcept
bool VSTPluginFormat::requiresUnblockedMessageThreadDuringCreation (const PluginDescription&) const
{
return false;
}


+ 5
- 6
modules/juce_audio_processors/format_types/juce_VSTPluginFormat.h View File

@@ -98,7 +98,10 @@ public:
static AudioPluginInstance* getPluginInstanceFromVstEffectInterface (void* aEffect);
//==============================================================================
String getName() const override { return "VST"; }
String getName() const override { return "VST"; }
bool canScanForPlugins() const override { return true; }
bool isTrivialToScan() const override { return false; }
void findAllTypesForFile (OwnedArray<PluginDescription>&, const String& fileOrIdentifier) override;
bool fileMightContainThisPluginType (const String& fileOrIdentifier) override;
String getNameOfPluginFromIdentifier (const String& fileOrIdentifier) override;
@@ -106,7 +109,6 @@ public:
StringArray searchPathsForPlugins (const FileSearchPath&, bool recursive, bool) override;
bool doesPluginStillExist (const PluginDescription&) override;
FileSearchPath getDefaultLocationsToSearch() override;
bool canScanForPlugins() const override { return true; }
/** Can be overridden to receive a callback when each member of a shell plugin is about to be
tested during a call to findAllTypesForFile().
@@ -119,10 +121,7 @@ private:
//==============================================================================
void createPluginInstance (const PluginDescription&, double initialSampleRate,
int initialBufferSize, PluginCreationCallback) override;
bool requiresUnblockedMessageThreadDuringCreation (const PluginDescription&) const noexcept override;
private:
bool requiresUnblockedMessageThreadDuringCreation (const PluginDescription&) const override;
void recursiveFileSearch (StringArray&, const File&, bool recursive);
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (VSTPluginFormat)


Loading…
Cancel
Save