diff --git a/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.cpp b/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.cpp index 7e57507992..cb7b0a61ad 100644 --- a/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.cpp +++ b/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.cpp @@ -38,6 +38,29 @@ namespace juce { //============================================================================== +void addHeadlessDefaultFormatsToManager ([[maybe_unused]] AudioPluginFormatManager& manager) +{ + #if JUCE_INTERNAL_HAS_AU + manager.addFormat (std::make_unique()); + #endif + + #if JUCE_INTERNAL_HAS_VST + manager.addFormat (std::make_unique()); + #endif + + #if JUCE_INTERNAL_HAS_VST3 + manager.addFormat (std::make_unique()); + #endif + + #if JUCE_INTERNAL_HAS_LADSPA + manager.addFormat (std::make_unique()); + #endif + + #if JUCE_INTERNAL_HAS_LV2 + manager.addFormat (std::make_unique()); + #endif +} + void addDefaultFormatsToManager ([[maybe_unused]] AudioPluginFormatManager& manager) { #if JUCE_INTERNAL_HAS_AU diff --git a/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.h b/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.h index 1175c81767..e8a2378cc1 100644 --- a/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.h +++ b/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.h @@ -154,6 +154,18 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioPluginFormatManager) }; +/** Add all standard plugin formats to the AudioPluginFormatManager, *without* UI support. + + If you use one of these formats to load a plugin, the resulting plugin will always return + false from hasEditor(), and return nullptr from createEditor(). + + This function is intended for use in commandline projects that never need to load plugin UIs. + In such cases, build times can be improved by omitting UI code from the project. + + This is a cut-down version of the old AudioPluginFormatManager::addDefaultFormats(). +*/ +void addHeadlessDefaultFormatsToManager (AudioPluginFormatManager&); + /** Add all standard plugin formats to the AudioPluginFormatManager, *with* UI support. This function replaces AudioPluginFormatManager::addDefaultFormats().