diff --git a/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.cpp b/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.cpp index cb7b0a61ad..c4fa8a6919 100644 --- a/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.cpp +++ b/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.cpp @@ -61,29 +61,6 @@ void addHeadlessDefaultFormatsToManager ([[maybe_unused]] AudioPluginFormatManag #endif } -void addDefaultFormatsToManager ([[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 -} - int AudioPluginFormatManager::getNumFormats() const { return formats.size(); } AudioPluginFormat* AudioPluginFormatManager::getFormat (int index) const { return formats[index]; } diff --git a/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.h b/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.h index e8a2378cc1..7a761ddca0 100644 --- a/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.h +++ b/modules/juce_audio_processors/format/juce_AudioPluginFormatManager.h @@ -166,10 +166,4 @@ private: */ void addHeadlessDefaultFormatsToManager (AudioPluginFormatManager&); -/** Add all standard plugin formats to the AudioPluginFormatManager, *with* UI support. - - This function replaces AudioPluginFormatManager::addDefaultFormats(). -*/ -void addDefaultFormatsToManager (AudioPluginFormatManager&); - } // namespace juce diff --git a/modules/juce_audio_processors/format/juce_AudioPluginFormatManagerHelpers.cpp b/modules/juce_audio_processors/format/juce_AudioPluginFormatManagerHelpers.cpp new file mode 100644 index 0000000000..8fa16897e9 --- /dev/null +++ b/modules/juce_audio_processors/format/juce_AudioPluginFormatManagerHelpers.cpp @@ -0,0 +1,63 @@ +/* + ============================================================================== + + This file is part of the JUCE framework. + Copyright (c) Raw Material Software Limited + + JUCE is an open source framework subject to commercial or open source + licensing. + + By downloading, installing, or using the JUCE framework, or combining the + JUCE framework with any other source code, object code, content or any other + copyrightable work, you agree to the terms of the JUCE End User Licence + Agreement, and all incorporated terms including the JUCE Privacy Policy and + the JUCE Website Terms of Service, as applicable, which will bind you. If you + do not agree to the terms of these agreements, we will not license the JUCE + framework to you, and you must discontinue the installation or download + process and cease use of the JUCE framework. + + JUCE End User Licence Agreement: https://juce.com/legal/juce-8-licence/ + JUCE Privacy Policy: https://juce.com/juce-privacy-policy + JUCE Website Terms of Service: https://juce.com/juce-website-terms-of-service/ + + Or: + + You may also use this code under the terms of the AGPLv3: + https://www.gnu.org/licenses/agpl-3.0.en.html + + THE JUCE FRAMEWORK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL + WARRANTIES, WHETHER EXPRESSED OR IMPLIED, INCLUDING WARRANTY OF + MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, ARE DISCLAIMED. + + ============================================================================== +*/ + +#include + +namespace juce +{ + +void addDefaultFormatsToManager ([[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 +} + +} // namespace juce diff --git a/modules/juce_audio_processors/format/juce_AudioPluginFormatManagerHelpers.h b/modules/juce_audio_processors/format/juce_AudioPluginFormatManagerHelpers.h new file mode 100644 index 0000000000..113bf7658b --- /dev/null +++ b/modules/juce_audio_processors/format/juce_AudioPluginFormatManagerHelpers.h @@ -0,0 +1,44 @@ +/* + ============================================================================== + + This file is part of the JUCE framework. + Copyright (c) Raw Material Software Limited + + JUCE is an open source framework subject to commercial or open source + licensing. + + By downloading, installing, or using the JUCE framework, or combining the + JUCE framework with any other source code, object code, content or any other + copyrightable work, you agree to the terms of the JUCE End User Licence + Agreement, and all incorporated terms including the JUCE Privacy Policy and + the JUCE Website Terms of Service, as applicable, which will bind you. If you + do not agree to the terms of these agreements, we will not license the JUCE + framework to you, and you must discontinue the installation or download + process and cease use of the JUCE framework. + + JUCE End User Licence Agreement: https://juce.com/legal/juce-8-licence/ + JUCE Privacy Policy: https://juce.com/juce-privacy-policy + JUCE Website Terms of Service: https://juce.com/juce-website-terms-of-service/ + + Or: + + You may also use this code under the terms of the AGPLv3: + https://www.gnu.org/licenses/agpl-3.0.en.html + + THE JUCE FRAMEWORK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL + WARRANTIES, WHETHER EXPRESSED OR IMPLIED, INCLUDING WARRANTY OF + MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, ARE DISCLAIMED. + + ============================================================================== +*/ + +namespace juce +{ + +/** Add all standard plugin formats to the AudioPluginFormatManager, *with* UI support. + + This function replaces AudioPluginFormatManager::addDefaultFormats(). +*/ +void addDefaultFormatsToManager (AudioPluginFormatManager&); + +} // namespace juce diff --git a/modules/juce_audio_processors/juce_audio_processors.cpp b/modules/juce_audio_processors/juce_audio_processors.cpp index 7ba448ca5e..484c35dd22 100644 --- a/modules/juce_audio_processors/juce_audio_processors.cpp +++ b/modules/juce_audio_processors/juce_audio_processors.cpp @@ -167,6 +167,7 @@ private: } // namespace juce #include "format/juce_AudioPluginFormatManager.cpp" +#include "format/juce_AudioPluginFormatManagerHelpers.cpp" #include "processors/juce_AudioProcessorEditor.cpp" #include "processors/juce_GenericAudioProcessorEditor.cpp" #include "format_types/juce_VSTPluginFormat.cpp" diff --git a/modules/juce_audio_processors/juce_audio_processors.h b/modules/juce_audio_processors/juce_audio_processors.h index 9d28b8547c..aedcb2deb1 100644 --- a/modules/juce_audio_processors/juce_audio_processors.h +++ b/modules/juce_audio_processors/juce_audio_processors.h @@ -141,6 +141,7 @@ #include "processors/juce_AudioProcessorEditor.h" #include "processors/juce_GenericAudioProcessorEditor.h" #include "format/juce_AudioPluginFormatManager.h" +#include "format/juce_AudioPluginFormatManagerHelpers.h" #include "scanning/juce_KnownPluginList.h" #include "format_types/juce_AudioUnitPluginFormat.h" #include "format_types/juce_LADSPAPluginFormat.h"