From d59230aeccadece5e311ab290abfa2febc30ab05 Mon Sep 17 00:00:00 2001 From: reuk Date: Tue, 12 Oct 2021 20:04:07 +0100 Subject: [PATCH] AudioPluginFormat: Remove canScanOnBackgroundThread(), as it is not generally useful --- .../juce_audio_processors/format/juce_AudioPluginFormat.h | 3 --- .../format_types/juce_VST3PluginFormat.h | 7 ------- .../scanning/juce_PluginListComponent.cpp | 4 ++-- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/modules/juce_audio_processors/format/juce_AudioPluginFormat.h b/modules/juce_audio_processors/format/juce_AudioPluginFormat.h index 7bd45452f2..f3bc826820 100644 --- a/modules/juce_audio_processors/format/juce_AudioPluginFormat.h +++ b/modules/juce_audio_processors/format/juce_AudioPluginFormat.h @@ -115,9 +115,6 @@ public: */ virtual bool isTrivialToScan() const = 0; - /** Should return true if plugins in this format can be scanned on a background thread. */ - virtual bool canScanOnBackgroundThread() const { return true; } - /** 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. diff --git a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.h b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.h index e58736d96c..9c2be59493 100644 --- a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.h +++ b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.h @@ -61,13 +61,6 @@ public: bool canScanForPlugins() const override { return true; } bool isTrivialToScan() const override { return false; } - /** Although there doesn't seem to be any official documentation on the matter, - Native Instruments Kontakt VST3 crashes on macOS when its bundleEntry is called on a - background thread. To allow this plugin (and other ones with similar problems) to be - discovered, it's a good idea to scan VST3 plugins on the main thread. - */ - bool canScanOnBackgroundThread() const override { return false; } - void findAllTypesForFile (OwnedArray&, const String& fileOrIdentifier) override; bool fileMightContainThisPluginType (const String& fileOrIdentifier) override; String getNameOfPluginFromIdentifier (const String& fileOrIdentifier) override; diff --git a/modules/juce_audio_processors/scanning/juce_PluginListComponent.cpp b/modules/juce_audio_processors/scanning/juce_PluginListComponent.cpp index 103a53546d..7b6265bd3f 100644 --- a/modules/juce_audio_processors/scanning/juce_PluginListComponent.cpp +++ b/modules/juce_audio_processors/scanning/juce_PluginListComponent.cpp @@ -393,8 +393,8 @@ public: propertiesToUse (properties), pathChooserWindow (TRANS("Select folders to scan..."), String(), MessageBoxIconType::NoIcon), progressWindow (title, text, MessageBoxIconType::NoIcon), - numThreads (format.canScanOnBackgroundThread() ? threads : 0), - allowAsync (format.canScanOnBackgroundThread() && allowPluginsWhichRequireAsynchronousInstantiation) + numThreads (threads), + allowAsync (allowPluginsWhichRequireAsynchronousInstantiation) { FileSearchPath path (formatToScan.getDefaultLocationsToSearch());