From 51c4a484ee15d43bd7fc45d11cc462380f953a0c Mon Sep 17 00:00:00 2001 From: reuk Date: Mon, 22 Sep 2025 13:44:33 +0100 Subject: [PATCH] juce_audio_processors: Exclusively use JUCE_INTERNAL_HAS_* macros in place of JUCE_PLUGINHOST_* macros This change also moves the PLUGINHOST config flags to the juce_audio_processors_headless module header, as this is now the lowest-level module that uses these flags. This change shouldn't require any Projucer/CMake changes. --- examples/Plugins/HostPluginDemo.h | 8 +-- .../Projucer/Source/Project/jucer_Project.cpp | 8 +-- .../juce_audio_plugin_client_VST3.cpp | 2 +- .../juce_AudioPluginFormatManagerHelpers.cpp | 2 - .../format_types/juce_AudioUnitPluginFormat.h | 2 +- .../juce_AudioUnitPluginFormat.mm | 2 +- .../format_types/juce_LADSPAPluginFormat.h | 2 +- .../format_types/juce_LV2PluginFormat.cpp | 2 +- .../format_types/juce_LV2PluginFormat.h | 2 +- .../format_types/juce_VST3PluginFormat.cpp | 4 +- .../format_types/juce_VST3PluginFormat.h | 4 +- .../format_types/juce_VSTPluginFormat.cpp | 2 +- .../format_types/juce_VSTPluginFormat.h | 2 +- .../juce_audio_processors.cpp | 15 ++-- .../juce_audio_processors.h | 72 ------------------- .../format/juce_AudioPluginFormatManager.cpp | 2 - .../format/juce_PluginFormatDefs.h | 6 ++ .../format_types/juce_ARACommonInternal.h | 2 +- .../format_types/juce_ARAHosting.cpp | 4 +- .../format_types/juce_ARAHosting.h | 2 +- .../juce_AudioUnitPluginFormatHeadless.h | 2 +- .../juce_AudioUnitPluginFormatHeadless.mm | 2 +- .../juce_AudioUnitPluginFormatImpl.h | 12 ++-- .../juce_LADSPAPluginFormatHeadless.cpp | 2 +- .../juce_LADSPAPluginFormatHeadless.h | 2 +- .../juce_LV2PluginFormatHeadless.cpp | 2 +- .../juce_LV2PluginFormatHeadless.h | 2 +- .../format_types/juce_LV2PluginFormatImpl.h | 2 +- .../format_types/juce_VST3Headers.h | 6 +- .../juce_VST3PluginFormatHeadless.cpp | 4 +- .../juce_VST3PluginFormatHeadless.h | 4 +- .../format_types/juce_VST3PluginFormatImpl.h | 12 ++-- .../juce_VSTPluginFormatHeadless.cpp | 2 +- .../juce_VSTPluginFormatHeadless.h | 2 +- .../format_types/juce_VSTPluginFormatImpl.h | 2 +- .../juce_audio_processors_headless.h | 66 +++++++++++++++++ .../juce_audio_processors_headless_ara.cpp | 4 +- ...uce_audio_processors_headless_lv2_libs.cpp | 8 ++- .../utilities/ARA/juce_ARADebug.h | 2 +- .../utilities/ARA/juce_ARA_utils.cpp | 2 +- 40 files changed, 140 insertions(+), 145 deletions(-) diff --git a/examples/Plugins/HostPluginDemo.h b/examples/Plugins/HostPluginDemo.h index b741587b60..8ba79ee0f5 100644 --- a/examples/Plugins/HostPluginDemo.h +++ b/examples/Plugins/HostPluginDemo.h @@ -40,10 +40,10 @@ juce_audio_processors_headless exporters: xcode_mac, vs2022, vs2026, linux_make - moduleFlags: JUCE_STRICT_REFCOUNTEDPOINTER=1 - JUCE_PLUGINHOST_LV2=1 - JUCE_PLUGINHOST_VST3=1 - JUCE_PLUGINHOST_VST=0 + moduleFlags: JUCE_STRICT_REFCOUNTEDPOINTER=1, + JUCE_PLUGINHOST_LV2=1, + JUCE_PLUGINHOST_VST3=1, + JUCE_PLUGINHOST_VST=0, JUCE_PLUGINHOST_AU=1 type: AudioProcessor diff --git a/extras/Projucer/Source/Project/jucer_Project.cpp b/extras/Projucer/Source/Project/jucer_Project.cpp index 24c93b7e84..5975cdca4e 100644 --- a/extras/Projucer/Source/Project/jucer_Project.cpp +++ b/extras/Projucer/Source/Project/jucer_Project.cpp @@ -2320,22 +2320,22 @@ int Project::getARATransformationFlags() const noexcept //============================================================================== bool Project::isAUPluginHost() const { - return getEnabledModules().isModuleEnabled ("juce_audio_processors") && isConfigFlagEnabled ("JUCE_PLUGINHOST_AU", false); + return getEnabledModules().isModuleEnabled ("juce_audio_processors_headless") && isConfigFlagEnabled ("JUCE_PLUGINHOST_AU", false); } bool Project::isVSTPluginHost() const { - return getEnabledModules().isModuleEnabled ("juce_audio_processors") && isConfigFlagEnabled ("JUCE_PLUGINHOST_VST", false); + return getEnabledModules().isModuleEnabled ("juce_audio_processors_headless") && isConfigFlagEnabled ("JUCE_PLUGINHOST_VST", false); } bool Project::isVST3PluginHost() const { - return getEnabledModules().isModuleEnabled ("juce_audio_processors") && isConfigFlagEnabled ("JUCE_PLUGINHOST_VST3", false); + return getEnabledModules().isModuleEnabled ("juce_audio_processors_headless") && isConfigFlagEnabled ("JUCE_PLUGINHOST_VST3", false); } bool Project::isLV2PluginHost() const { - return getEnabledModules().isModuleEnabled ("juce_audio_processors") && isConfigFlagEnabled ("JUCE_PLUGINHOST_LV2", false); + return getEnabledModules().isModuleEnabled ("juce_audio_processors_headless") && isConfigFlagEnabled ("JUCE_PLUGINHOST_LV2", false); } bool Project::isARAPluginHost() const diff --git a/modules/juce_audio_plugin_client/juce_audio_plugin_client_VST3.cpp b/modules/juce_audio_plugin_client/juce_audio_plugin_client_VST3.cpp index 6301bec135..ae78c30408 100644 --- a/modules/juce_audio_plugin_client/juce_audio_plugin_client_VST3.cpp +++ b/modules/juce_audio_plugin_client/juce_audio_plugin_client_VST3.cpp @@ -40,7 +40,7 @@ JUCE_BEGIN_NO_SANITIZE ("vptr") -#if JUCE_PLUGINHOST_VST3 +#if JUCE_INTERNAL_HAS_VST3 #if JUCE_MAC #include #endif diff --git a/modules/juce_audio_processors/format/juce_AudioPluginFormatManagerHelpers.cpp b/modules/juce_audio_processors/format/juce_AudioPluginFormatManagerHelpers.cpp index 8fa16897e9..e254059fae 100644 --- a/modules/juce_audio_processors/format/juce_AudioPluginFormatManagerHelpers.cpp +++ b/modules/juce_audio_processors/format/juce_AudioPluginFormatManagerHelpers.cpp @@ -32,8 +32,6 @@ ============================================================================== */ -#include - namespace juce { diff --git a/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.h b/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.h index cef4de1077..703d2e29cc 100644 --- a/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.h +++ b/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.h @@ -35,7 +35,7 @@ namespace juce { -#if (JUCE_PLUGINHOST_AU && (JUCE_MAC || JUCE_IOS)) || DOXYGEN +#if JUCE_INTERNAL_HAS_AU || DOXYGEN //============================================================================== /** diff --git a/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm b/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm index c2815bc72c..2801f2bcc2 100644 --- a/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm +++ b/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm @@ -32,7 +32,7 @@ ============================================================================== */ -#if JUCE_PLUGINHOST_AU && (JUCE_MAC || JUCE_IOS) +#if JUCE_INTERNAL_HAS_AU #include diff --git a/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.h b/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.h index 67b1cb896f..2f86f4bc91 100644 --- a/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.h +++ b/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.h @@ -35,7 +35,7 @@ namespace juce { -#if (JUCE_PLUGINHOST_LADSPA && (JUCE_LINUX || JUCE_BSD)) || DOXYGEN +#if JUCE_INTERNAL_HAS_LADSPA || DOXYGEN //============================================================================== /** Provided for backwards compatibility; LADSPA plugins are always headless. diff --git a/modules/juce_audio_processors/format_types/juce_LV2PluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_LV2PluginFormat.cpp index ab4c4f220e..5d5ade4b4a 100644 --- a/modules/juce_audio_processors/format_types/juce_LV2PluginFormat.cpp +++ b/modules/juce_audio_processors/format_types/juce_LV2PluginFormat.cpp @@ -32,7 +32,7 @@ ============================================================================== */ -#if JUCE_PLUGINHOST_LV2 && (! (JUCE_ANDROID || JUCE_IOS)) +#if JUCE_INTERNAL_HAS_LV2 #include #include diff --git a/modules/juce_audio_processors/format_types/juce_LV2PluginFormat.h b/modules/juce_audio_processors/format_types/juce_LV2PluginFormat.h index 44ef7a78a5..b5b60c3e65 100644 --- a/modules/juce_audio_processors/format_types/juce_LV2PluginFormat.h +++ b/modules/juce_audio_processors/format_types/juce_LV2PluginFormat.h @@ -35,7 +35,7 @@ namespace juce { -#if (JUCE_PLUGINHOST_LV2 && (! (JUCE_ANDROID || JUCE_IOS))) || DOXYGEN +#if JUCE_INTERNAL_HAS_LV2 || DOXYGEN /** Implements a plugin format for LV2 plugins. diff --git a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp index cf2ca496e3..f040b64e42 100644 --- a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp +++ b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp @@ -32,7 +32,7 @@ ============================================================================== */ -#if JUCE_PLUGINHOST_VST3 && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD) +#if JUCE_INTERNAL_HAS_VST3 #include #include @@ -646,4 +646,4 @@ JUCE_END_NO_SANITIZE } // namespace juce -#endif // JUCE_PLUGINHOST_VST3 +#endif diff --git a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.h b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.h index 7dd04be6de..db678268fd 100644 --- a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.h +++ b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.h @@ -35,7 +35,7 @@ namespace juce { -#if (JUCE_PLUGINHOST_VST3 && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD)) || DOXYGEN +#if JUCE_INTERNAL_HAS_VST3 /** Implements a plugin format for VST3s. @@ -47,6 +47,6 @@ class JUCE_API VST3PluginFormat : public VST3PluginFormatHeadless void createPluginInstance (const PluginDescription&, double, int, PluginCreationCallback) override; }; -#endif // JUCE_PLUGINHOST_VST3 +#endif } // namespace juce diff --git a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp index 4849054dcc..ff8070bf41 100644 --- a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp +++ b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp @@ -32,7 +32,7 @@ ============================================================================== */ -#if JUCE_PLUGINHOST_VST +#if JUCE_INTERNAL_HAS_VST #include #include diff --git a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.h b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.h index 160471f2b0..0a4ee0448a 100644 --- a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.h +++ b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.h @@ -32,7 +32,7 @@ ============================================================================== */ -#if (JUCE_PLUGINHOST_VST || DOXYGEN) +#if JUCE_INTERNAL_HAS_VST || DOXYGEN namespace juce { diff --git a/modules/juce_audio_processors/juce_audio_processors.cpp b/modules/juce_audio_processors/juce_audio_processors.cpp index a099cc9e68..02310d825e 100644 --- a/modules/juce_audio_processors/juce_audio_processors.cpp +++ b/modules/juce_audio_processors/juce_audio_processors.cpp @@ -52,7 +52,7 @@ #include //============================================================================== -#if JUCE_PLUGINHOST_VST && (JUCE_LINUX || JUCE_BSD) +#if JUCE_INTERNAL_HAS_VST && (JUCE_LINUX || JUCE_BSD) JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wvariadic-macros") #include JUCE_END_IGNORE_WARNINGS_GCC_LIKE @@ -60,12 +60,7 @@ #undef KeyPress #endif -#if ! JUCE_WINDOWS && ! JUCE_MAC && ! JUCE_LINUX - #undef JUCE_PLUGINHOST_VST3 - #define JUCE_PLUGINHOST_VST3 0 -#endif - -#if JUCE_PLUGINHOST_AU && (JUCE_MAC || JUCE_IOS) +#if JUCE_INTERNAL_HAS_AU #include #endif @@ -85,15 +80,15 @@ #include "format_types/juce_LV2PluginFormat.cpp" #if JUCE_UNIT_TESTS - #if JUCE_PLUGINHOST_VST3 + #if JUCE_INTERNAL_HAS_VST3 #include "format_types/juce_VST3PluginFormat_test.cpp" #endif - #if JUCE_PLUGINHOST_AU && (JUCE_MAC || JUCE_IOS) + #if JUCE_INTERNAL_HAS_AU #include "format_types/juce_AudioUnitPluginFormat_test.cpp" #endif - #if JUCE_PLUGINHOST_LV2 && (! (JUCE_ANDROID || JUCE_IOS)) + #if JUCE_INTERNAL_HAS_LV2 #include "format_types/juce_LV2PluginFormat_test.cpp" #endif #endif diff --git a/modules/juce_audio_processors/juce_audio_processors.h b/modules/juce_audio_processors/juce_audio_processors.h index 282d275ecc..5e5d4e1a14 100644 --- a/modules/juce_audio_processors/juce_audio_processors.h +++ b/modules/juce_audio_processors/juce_audio_processors.h @@ -64,78 +64,6 @@ #include #include -//============================================================================== -/** Config: JUCE_PLUGINHOST_VST - Enables the VST audio plugin hosting classes. You will need to have the VST2 SDK files in your header search paths. You can obtain the VST2 SDK files from on older version of the VST3 SDK. - - @see VSTPluginFormat, VST3PluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU, JUCE_PLUGINHOST_VST3, JUCE_PLUGINHOST_LADSPA -*/ -#ifndef JUCE_PLUGINHOST_VST - #define JUCE_PLUGINHOST_VST 0 -#endif - -/** Config: JUCE_PLUGINHOST_VST3 - Enables the VST3 audio plugin hosting classes. - - @see VSTPluginFormat, VST3PluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST, JUCE_PLUGINHOST_AU, JUCE_PLUGINHOST_LADSPA -*/ -#ifndef JUCE_PLUGINHOST_VST3 - #define JUCE_PLUGINHOST_VST3 0 -#endif - -/** Config: JUCE_PLUGINHOST_AU - Enables the AudioUnit plugin hosting classes. This is Mac-only, of course. - - @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST, JUCE_PLUGINHOST_VST3, JUCE_PLUGINHOST_LADSPA -*/ -#ifndef JUCE_PLUGINHOST_AU - #define JUCE_PLUGINHOST_AU 0 -#endif - -/** Config: JUCE_PLUGINHOST_LADSPA - Enables the LADSPA plugin hosting classes. This is Linux-only, of course. - - @see LADSPAPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST, JUCE_PLUGINHOST_VST3, JUCE_PLUGINHOST_AU - */ -#ifndef JUCE_PLUGINHOST_LADSPA - #define JUCE_PLUGINHOST_LADSPA 0 -#endif - -/** Config: JUCE_PLUGINHOST_LV2 - Enables the LV2 plugin hosting classes. - */ -#ifndef JUCE_PLUGINHOST_LV2 - #define JUCE_PLUGINHOST_LV2 0 -#endif - -/** Config: JUCE_PLUGINHOST_ARA - Enables the ARA plugin extension hosting classes. You will need to download the ARA SDK and specify the - path to it either in the Projucer, using juce_set_ara_sdk_path() in your CMake project file. - - The directory can be obtained by recursively cloning https://github.com/Celemony/ARA_SDK and checking out - the tag releases/2.1.0. -*/ -#ifndef JUCE_PLUGINHOST_ARA - #define JUCE_PLUGINHOST_ARA 0 -#endif - -/** Config: JUCE_CUSTOM_VST3_SDK - If enabled, the embedded VST3 SDK in JUCE will not be added to the project and instead you should - add the path to your custom VST3 SDK to the project's header search paths. Most users shouldn't - need to enable this and should just use the version of the SDK included with JUCE. -*/ -#ifndef JUCE_CUSTOM_VST3_SDK - #define JUCE_CUSTOM_VST3_SDK 0 -#endif - -#if ! (JUCE_PLUGINHOST_AU || JUCE_PLUGINHOST_VST || JUCE_PLUGINHOST_VST3 || JUCE_PLUGINHOST_LADSPA) -// #error "You need to set either the JUCE_PLUGINHOST_AU and/or JUCE_PLUGINHOST_VST and/or JUCE_PLUGINHOST_VST3 and/or JUCE_PLUGINHOST_LADSPA flags if you're using this module!" -#endif - -#ifndef JUCE_SUPPORT_LEGACY_AUDIOPROCESSOR - #define JUCE_SUPPORT_LEGACY_AUDIOPROCESSOR 1 -#endif - //============================================================================== #include "processors/juce_AudioProcessorEditorHostContext.h" #include "processors/juce_AudioProcessorEditor.h" diff --git a/modules/juce_audio_processors_headless/format/juce_AudioPluginFormatManager.cpp b/modules/juce_audio_processors_headless/format/juce_AudioPluginFormatManager.cpp index c4fa8a6919..ec9a0227f0 100644 --- a/modules/juce_audio_processors_headless/format/juce_AudioPluginFormatManager.cpp +++ b/modules/juce_audio_processors_headless/format/juce_AudioPluginFormatManager.cpp @@ -32,8 +32,6 @@ ============================================================================== */ -#include - namespace juce { diff --git a/modules/juce_audio_processors_headless/format/juce_PluginFormatDefs.h b/modules/juce_audio_processors_headless/format/juce_PluginFormatDefs.h index 108d28df51..162a9e2b4d 100644 --- a/modules/juce_audio_processors_headless/format/juce_PluginFormatDefs.h +++ b/modules/juce_audio_processors_headless/format/juce_PluginFormatDefs.h @@ -75,3 +75,9 @@ #else #define JUCE_INTERNAL_HAS_LV2 0 #endif + +#if JUCE_PLUGINHOST_ARA && (JUCE_INTERNAL_HAS_VST3 || JUCE_INTERNAL_HAS_AU) && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX) + #define JUCE_INTERNAL_HAS_ARA 1 +#else + #define JUCE_INTERNAL_HAS_ARA 0 +#endif diff --git a/modules/juce_audio_processors_headless/format_types/juce_ARACommonInternal.h b/modules/juce_audio_processors_headless/format_types/juce_ARACommonInternal.h index 5d195c93f4..5c85e527c4 100644 --- a/modules/juce_audio_processors_headless/format_types/juce_ARACommonInternal.h +++ b/modules/juce_audio_processors_headless/format_types/juce_ARACommonInternal.h @@ -34,7 +34,7 @@ #pragma once -#if (JUCE_PLUGINHOST_ARA && (JUCE_PLUGINHOST_VST3 || JUCE_PLUGINHOST_AU) && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX)) +#if JUCE_INTERNAL_HAS_ARA #include diff --git a/modules/juce_audio_processors_headless/format_types/juce_ARAHosting.cpp b/modules/juce_audio_processors_headless/format_types/juce_ARAHosting.cpp index 3e0af4b689..433d5c02c5 100644 --- a/modules/juce_audio_processors_headless/format_types/juce_ARAHosting.cpp +++ b/modules/juce_audio_processors_headless/format_types/juce_ARAHosting.cpp @@ -32,7 +32,7 @@ ============================================================================== */ -#if (JUCE_PLUGINHOST_ARA && (JUCE_PLUGINHOST_VST3 || JUCE_PLUGINHOST_AU) && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX)) +#if JUCE_INTERNAL_HAS_ARA #include @@ -366,7 +366,7 @@ public: if (araEntryPoint.loadFrom (iComponentPtr)) pei = araEntryPoint->bindToDocumentControllerWithRoles (documentController.getRef(), knownRoles, assignedRoles); }, - #if JUCE_PLUGINHOST_AU && JUCE_MAC + #if JUCE_INTERNAL_HAS_AU [this, &pei, knownRoles, assignedRoles] (const ExtensionsVisitor::AudioUnitClient& auClient) { auto audioUnit = auClient.getAudioUnitHandle(); diff --git a/modules/juce_audio_processors_headless/format_types/juce_ARAHosting.h b/modules/juce_audio_processors_headless/format_types/juce_ARAHosting.h index 9a3d57cd0b..7528219878 100644 --- a/modules/juce_audio_processors_headless/format_types/juce_ARAHosting.h +++ b/modules/juce_audio_processors_headless/format_types/juce_ARAHosting.h @@ -34,7 +34,7 @@ #pragma once -#if (JUCE_PLUGINHOST_ARA && (JUCE_PLUGINHOST_VST3 || JUCE_PLUGINHOST_AU) && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX)) || DOXYGEN +#if JUCE_INTERNAL_HAS_ARA || DOXYGEN // Include ARA SDK headers JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wgnu-zero-variadic-macro-arguments") diff --git a/modules/juce_audio_processors_headless/format_types/juce_AudioUnitPluginFormatHeadless.h b/modules/juce_audio_processors_headless/format_types/juce_AudioUnitPluginFormatHeadless.h index 66dc02259c..3074a98da3 100644 --- a/modules/juce_audio_processors_headless/format_types/juce_AudioUnitPluginFormatHeadless.h +++ b/modules/juce_audio_processors_headless/format_types/juce_AudioUnitPluginFormatHeadless.h @@ -35,7 +35,7 @@ namespace juce { -#if (JUCE_PLUGINHOST_AU && (JUCE_MAC || JUCE_IOS)) || DOXYGEN +#if JUCE_INTERNAL_HAS_AU || DOXYGEN //============================================================================== /** diff --git a/modules/juce_audio_processors_headless/format_types/juce_AudioUnitPluginFormatHeadless.mm b/modules/juce_audio_processors_headless/format_types/juce_AudioUnitPluginFormatHeadless.mm index 68ef5da102..9945928f5c 100644 --- a/modules/juce_audio_processors_headless/format_types/juce_AudioUnitPluginFormatHeadless.mm +++ b/modules/juce_audio_processors_headless/format_types/juce_AudioUnitPluginFormatHeadless.mm @@ -32,7 +32,7 @@ ============================================================================== */ -#if JUCE_PLUGINHOST_AU && (JUCE_MAC || JUCE_IOS) +#if JUCE_INTERNAL_HAS_AU #include diff --git a/modules/juce_audio_processors_headless/format_types/juce_AudioUnitPluginFormatImpl.h b/modules/juce_audio_processors_headless/format_types/juce_AudioUnitPluginFormatImpl.h index 3ddaf01f27..d7920b0ec6 100644 --- a/modules/juce_audio_processors_headless/format_types/juce_AudioUnitPluginFormatImpl.h +++ b/modules/juce_audio_processors_headless/format_types/juce_AudioUnitPluginFormatImpl.h @@ -34,14 +34,14 @@ #pragma once -#if JUCE_PLUGINHOST_AU && (JUCE_MAC || JUCE_IOS) +#if JUCE_INTERNAL_HAS_AU #if JUCE_MAC #include #include #include -#if JUCE_PLUGINHOST_ARA +#if JUCE_INTERNAL_HAS_ARA #include #endif @@ -412,7 +412,7 @@ namespace AudioUnitFormatHelpers static inline bool hasARAExtension ([[maybe_unused]] AudioUnit audioUnit) { - #if JUCE_PLUGINHOST_ARA + #if JUCE_INTERNAL_HAS_ARA UInt32 propertySize = sizeof (ARA::ARAAudioUnitFactory); Boolean isWriteable = FALSE; @@ -441,7 +441,7 @@ using AudioUnitWeakPtr = std::weak_ptr>; static std::shared_ptr getARAFactory ([[maybe_unused]] AudioUnitSharedPtr audioUnit) { - #if JUCE_PLUGINHOST_ARA + #if JUCE_INTERNAL_HAS_ARA jassert (audioUnit != nullptr); UInt32 propertySize = sizeof (ARA::ARAAudioUnitFactory); @@ -1123,7 +1123,7 @@ public: desc.numOutputChannels = getTotalNumOutputChannels(); desc.isInstrument = (componentDesc.componentType == kAudioUnitType_MusicDevice); - #if JUCE_PLUGINHOST_ARA + #if JUCE_INTERNAL_HAS_ARA desc.hasARAExtension = [&] { UInt32 propertySize = sizeof (ARA::ARAAudioUnitFactory); @@ -1154,7 +1154,7 @@ public: visitor.visitAudioUnitClient (Extensions { this }); - #ifdef JUCE_PLUGINHOST_ARA + #ifdef JUCE_INTERNAL_HAS_ARA struct ARAExtensions final : public ExtensionsVisitor::ARAClient { explicit ARAExtensions (const AudioUnitPluginInstanceHeadless* instanceIn) : instance (instanceIn) {} diff --git a/modules/juce_audio_processors_headless/format_types/juce_LADSPAPluginFormatHeadless.cpp b/modules/juce_audio_processors_headless/format_types/juce_LADSPAPluginFormatHeadless.cpp index 427b9dd790..a7c92fc6c6 100644 --- a/modules/juce_audio_processors_headless/format_types/juce_LADSPAPluginFormatHeadless.cpp +++ b/modules/juce_audio_processors_headless/format_types/juce_LADSPAPluginFormatHeadless.cpp @@ -32,7 +32,7 @@ ============================================================================== */ -#if JUCE_PLUGINHOST_LADSPA && (JUCE_LINUX || JUCE_BSD) +#if JUCE_INTERNAL_HAS_LADSPA #include diff --git a/modules/juce_audio_processors_headless/format_types/juce_LADSPAPluginFormatHeadless.h b/modules/juce_audio_processors_headless/format_types/juce_LADSPAPluginFormatHeadless.h index 43f727f906..7aa8ab15f5 100644 --- a/modules/juce_audio_processors_headless/format_types/juce_LADSPAPluginFormatHeadless.h +++ b/modules/juce_audio_processors_headless/format_types/juce_LADSPAPluginFormatHeadless.h @@ -35,7 +35,7 @@ namespace juce { -#if (JUCE_PLUGINHOST_LADSPA && (JUCE_LINUX || JUCE_BSD)) || DOXYGEN +#if JUCE_INTERNAL_HAS_LADSPA || DOXYGEN //============================================================================== /** diff --git a/modules/juce_audio_processors_headless/format_types/juce_LV2PluginFormatHeadless.cpp b/modules/juce_audio_processors_headless/format_types/juce_LV2PluginFormatHeadless.cpp index d7e8354cc3..7cc31e684c 100644 --- a/modules/juce_audio_processors_headless/format_types/juce_LV2PluginFormatHeadless.cpp +++ b/modules/juce_audio_processors_headless/format_types/juce_LV2PluginFormatHeadless.cpp @@ -32,7 +32,7 @@ ============================================================================== */ -#if JUCE_PLUGINHOST_LV2 && (! (JUCE_ANDROID || JUCE_IOS)) +#if JUCE_INTERNAL_HAS_LV2 #include diff --git a/modules/juce_audio_processors_headless/format_types/juce_LV2PluginFormatHeadless.h b/modules/juce_audio_processors_headless/format_types/juce_LV2PluginFormatHeadless.h index cd8c89dcf2..b6ef60f3df 100644 --- a/modules/juce_audio_processors_headless/format_types/juce_LV2PluginFormatHeadless.h +++ b/modules/juce_audio_processors_headless/format_types/juce_LV2PluginFormatHeadless.h @@ -35,7 +35,7 @@ namespace juce { -#if (JUCE_PLUGINHOST_LV2 && (! (JUCE_ANDROID || JUCE_IOS))) || DOXYGEN +#if JUCE_INTERNAL_HAS_LV2 || DOXYGEN /** Implements a plugin format for LV2 plugins. diff --git a/modules/juce_audio_processors_headless/format_types/juce_LV2PluginFormatImpl.h b/modules/juce_audio_processors_headless/format_types/juce_LV2PluginFormatImpl.h index f21381e047..df33f87673 100644 --- a/modules/juce_audio_processors_headless/format_types/juce_LV2PluginFormatImpl.h +++ b/modules/juce_audio_processors_headless/format_types/juce_LV2PluginFormatImpl.h @@ -34,7 +34,7 @@ #pragma once -#if JUCE_PLUGINHOST_LV2 && (! (JUCE_ANDROID || JUCE_IOS)) +#if JUCE_INTERNAL_HAS_LV2 #include #include diff --git a/modules/juce_audio_processors_headless/format_types/juce_VST3Headers.h b/modules/juce_audio_processors_headless/format_types/juce_VST3Headers.h index e6701997fe..29a68c01eb 100644 --- a/modules/juce_audio_processors_headless/format_types/juce_VST3Headers.h +++ b/modules/juce_audio_processors_headless/format_types/juce_VST3Headers.h @@ -35,7 +35,7 @@ #pragma once #if JUCE_BSD && ! JUCE_CUSTOM_VST3_SDK - #error To build JUCE VST3 plug-ins on BSD you must use an external BSD-compatible VST3 SDK with JUCE_CUSTOM_VST3_SDK=1 + #error To build JUCE VST3 plug-ins or hosts on BSD you must use an external BSD-compatible VST3 SDK with JUCE_CUSTOM_VST3_SDK=1 #endif // It's important to include this *before* any of the Steinberg headers. @@ -247,7 +247,7 @@ JUCE_END_IGNORE_WARNINGS_MSVC JUCE_END_IGNORE_WARNINGS_GCC_LIKE //============================================================================== -#if JucePlugin_Enable_ARA || JUCE_PLUGINHOST_ARA +#if JucePlugin_Enable_ARA || JUCE_INTERNAL_HAS_ARA JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wpragma-pack") #include JUCE_END_IGNORE_WARNINGS_GCC_LIKE @@ -261,7 +261,7 @@ JUCE_END_IGNORE_WARNINGS_GCC_LIKE DEF_CLASS_IID (ARA::IPlugInEntryPoint2) DEF_CLASS_IID (ARA::IMainFactory) #endif -#endif // JucePlugin_Enable_ARA || JUCE_PLUGINHOST_ARA +#endif // JucePlugin_Enable_ARA || JUCE_INTERNAL_HAS_ARA //============================================================================== #if JUCE_WINDOWS diff --git a/modules/juce_audio_processors_headless/format_types/juce_VST3PluginFormatHeadless.cpp b/modules/juce_audio_processors_headless/format_types/juce_VST3PluginFormatHeadless.cpp index 774b46130c..b03f8cb120 100644 --- a/modules/juce_audio_processors_headless/format_types/juce_VST3PluginFormatHeadless.cpp +++ b/modules/juce_audio_processors_headless/format_types/juce_VST3PluginFormatHeadless.cpp @@ -32,7 +32,7 @@ ============================================================================== */ -#if JUCE_PLUGINHOST_VST3 && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD) +#if JUCE_INTERNAL_HAS_VST3 #include @@ -170,4 +170,4 @@ JUCE_END_NO_SANITIZE } // namespace juce -#endif // JUCE_PLUGINHOST_VST3 +#endif diff --git a/modules/juce_audio_processors_headless/format_types/juce_VST3PluginFormatHeadless.h b/modules/juce_audio_processors_headless/format_types/juce_VST3PluginFormatHeadless.h index 718f135565..29b388b108 100644 --- a/modules/juce_audio_processors_headless/format_types/juce_VST3PluginFormatHeadless.h +++ b/modules/juce_audio_processors_headless/format_types/juce_VST3PluginFormatHeadless.h @@ -35,7 +35,7 @@ namespace juce { -#if (JUCE_PLUGINHOST_VST3 && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD)) || DOXYGEN +#if JUCE_INTERNAL_HAS_VST3 || DOXYGEN /** Implements a plugin format for VST3s. @@ -85,6 +85,6 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (VST3PluginFormatHeadless) }; -#endif // JUCE_PLUGINHOST_VST3 +#endif } // namespace juce diff --git a/modules/juce_audio_processors_headless/format_types/juce_VST3PluginFormatImpl.h b/modules/juce_audio_processors_headless/format_types/juce_VST3PluginFormatImpl.h index e9a0563d1b..7e2231007d 100644 --- a/modules/juce_audio_processors_headless/format_types/juce_VST3PluginFormatImpl.h +++ b/modules/juce_audio_processors_headless/format_types/juce_VST3PluginFormatImpl.h @@ -34,7 +34,7 @@ #pragma once -#if JUCE_PLUGINHOST_VST3 && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD) +#if JUCE_INTERNAL_HAS_VST3 #if (JUCE_LINUX || JUCE_BSD) #include @@ -202,7 +202,7 @@ static std::vector createPluginDescriptions (const File& plug { std::unordered_set factories; - #if JUCE_PLUGINHOST_ARA && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX) + #if JUCE_INTERNAL_HAS_ARA for (const auto& c : info.classes) if (c.category == kARAMainFactoryClass) factories.insert (CharPointer_UTF8 (c.name.c_str())); @@ -979,7 +979,7 @@ struct DescriptionLister // The match is determined by the two classes having the same name. std::unordered_set araMainFactoryClassNames; - #if JUCE_PLUGINHOST_ARA && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX) + #if JUCE_INTERNAL_HAS_ARA for (Steinberg::int32 i = 0; i < numClasses; ++i) { PClassInfo info; @@ -1401,7 +1401,7 @@ static int compareWithString (Type (&charArray)[N], const String& str) template static void forEachARAFactory ([[maybe_unused]] IPluginFactory* pluginFactory, [[maybe_unused]] Callback&& cb) { - #if JUCE_PLUGINHOST_ARA && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX) + #if JUCE_INTERNAL_HAS_ARA const auto numClasses = pluginFactory->countClasses(); for (Steinberg::int32 i = 0; i < numClasses; ++i) { @@ -1423,7 +1423,7 @@ static std::shared_ptr getARAFactory ([[maybe_unused]] IP { std::shared_ptr factory; - #if JUCE_PLUGINHOST_ARA && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX) + #if JUCE_INTERNAL_HAS_ARA forEachARAFactory (pluginFactory, [&pluginFactory, &pluginName, &factory] (const auto& pcClassInfo) { @@ -3661,4 +3661,4 @@ JUCE_END_NO_SANITIZE } // namespace juce -#endif // JUCE_PLUGINHOST_VST3 +#endif diff --git a/modules/juce_audio_processors_headless/format_types/juce_VSTPluginFormatHeadless.cpp b/modules/juce_audio_processors_headless/format_types/juce_VSTPluginFormatHeadless.cpp index 66fa7dd474..c877ed86fd 100644 --- a/modules/juce_audio_processors_headless/format_types/juce_VSTPluginFormatHeadless.cpp +++ b/modules/juce_audio_processors_headless/format_types/juce_VSTPluginFormatHeadless.cpp @@ -32,7 +32,7 @@ ============================================================================== */ -#if JUCE_PLUGINHOST_VST +#if JUCE_INTERNAL_HAS_VST #include #include diff --git a/modules/juce_audio_processors_headless/format_types/juce_VSTPluginFormatHeadless.h b/modules/juce_audio_processors_headless/format_types/juce_VSTPluginFormatHeadless.h index 3319a03e09..35201ff552 100644 --- a/modules/juce_audio_processors_headless/format_types/juce_VSTPluginFormatHeadless.h +++ b/modules/juce_audio_processors_headless/format_types/juce_VSTPluginFormatHeadless.h @@ -32,7 +32,7 @@ ============================================================================== */ -#if (JUCE_PLUGINHOST_VST || DOXYGEN) +#if JUCE_INTERNAL_HAS_VST || DOXYGEN namespace juce { diff --git a/modules/juce_audio_processors_headless/format_types/juce_VSTPluginFormatImpl.h b/modules/juce_audio_processors_headless/format_types/juce_VSTPluginFormatImpl.h index 9e3f89d309..8cdfb78262 100644 --- a/modules/juce_audio_processors_headless/format_types/juce_VSTPluginFormatImpl.h +++ b/modules/juce_audio_processors_headless/format_types/juce_VSTPluginFormatImpl.h @@ -34,7 +34,7 @@ #pragma once -#if JUCE_PLUGINHOST_VST +#if JUCE_INTERNAL_HAS_VST //============================================================================== #undef PRAGMA_ALIGN_SUPPORTED diff --git a/modules/juce_audio_processors_headless/juce_audio_processors_headless.h b/modules/juce_audio_processors_headless/juce_audio_processors_headless.h index 777cf0ef69..3589e02659 100644 --- a/modules/juce_audio_processors_headless/juce_audio_processors_headless.h +++ b/modules/juce_audio_processors_headless/juce_audio_processors_headless.h @@ -66,6 +66,72 @@ #include #include +//============================================================================== +/** Config: JUCE_PLUGINHOST_VST + Enables the VST audio plugin hosting classes. You will need to have the VST2 SDK files in your header search paths. You can obtain the VST2 SDK files from on older version of the VST3 SDK. + + @see VSTPluginFormat, VST3PluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU, JUCE_PLUGINHOST_VST3, JUCE_PLUGINHOST_LADSPA +*/ +#ifndef JUCE_PLUGINHOST_VST + #define JUCE_PLUGINHOST_VST 0 +#endif + +/** Config: JUCE_PLUGINHOST_VST3 + Enables the VST3 audio plugin hosting classes. + + @see VSTPluginFormat, VST3PluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST, JUCE_PLUGINHOST_AU, JUCE_PLUGINHOST_LADSPA +*/ +#ifndef JUCE_PLUGINHOST_VST3 + #define JUCE_PLUGINHOST_VST3 0 +#endif + +/** Config: JUCE_PLUGINHOST_AU + Enables the AudioUnit plugin hosting classes. This is Mac-only, of course. + + @see AudioUnitPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST, JUCE_PLUGINHOST_VST3, JUCE_PLUGINHOST_LADSPA +*/ +#ifndef JUCE_PLUGINHOST_AU + #define JUCE_PLUGINHOST_AU 0 +#endif + +/** Config: JUCE_PLUGINHOST_LADSPA + Enables the LADSPA plugin hosting classes. This is Linux-only, of course. + + @see LADSPAPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_VST, JUCE_PLUGINHOST_VST3, JUCE_PLUGINHOST_AU + */ +#ifndef JUCE_PLUGINHOST_LADSPA + #define JUCE_PLUGINHOST_LADSPA 0 +#endif + +/** Config: JUCE_PLUGINHOST_LV2 + Enables the LV2 plugin hosting classes. + */ +#ifndef JUCE_PLUGINHOST_LV2 + #define JUCE_PLUGINHOST_LV2 0 +#endif + +/** Config: JUCE_PLUGINHOST_ARA + Enables the ARA plugin extension hosting classes. You will need to download the ARA SDK and specify the + path to it either in the Projucer, using juce_set_ara_sdk_path() in your CMake project file. + + The directory can be obtained by recursively cloning https://github.com/Celemony/ARA_SDK and checking out + the tag releases/2.1.0. +*/ +#ifndef JUCE_PLUGINHOST_ARA + #define JUCE_PLUGINHOST_ARA 0 +#endif + +/** Config: JUCE_CUSTOM_VST3_SDK + If enabled, the embedded VST3 SDK in JUCE will not be added to the project and instead you should + add the path to your custom VST3 SDK to the project's header search paths. Most users shouldn't + need to enable this and should just use the version of the SDK included with JUCE. +*/ +#ifndef JUCE_CUSTOM_VST3_SDK + #define JUCE_CUSTOM_VST3_SDK 0 +#endif + +//============================================================================== +#include #include #include #include diff --git a/modules/juce_audio_processors_headless/juce_audio_processors_headless_ara.cpp b/modules/juce_audio_processors_headless/juce_audio_processors_headless_ara.cpp index c15836f868..eea80611c6 100644 --- a/modules/juce_audio_processors_headless/juce_audio_processors_headless_ara.cpp +++ b/modules/juce_audio_processors_headless/juce_audio_processors_headless_ara.cpp @@ -35,6 +35,8 @@ #include #include +#include + #include /* Having WIN32_LEAN_AND_MEAN defined at the point of including ARADebug.c will produce warnings. @@ -42,7 +44,7 @@ To prevent such problems it's easiest to have it in its own translation unit. */ -#if (JucePlugin_Enable_ARA || (JUCE_PLUGINHOST_ARA && (JUCE_PLUGINHOST_VST3 || JUCE_PLUGINHOST_AU))) && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX) +#if (JucePlugin_Enable_ARA || JUCE_INTERNAL_HAS_ARA) && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX) JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wgnu-zero-variadic-macro-arguments", "-Wmissing-prototypes") #include diff --git a/modules/juce_audio_processors_headless/juce_audio_processors_headless_lv2_libs.cpp b/modules/juce_audio_processors_headless/juce_audio_processors_headless_lv2_libs.cpp index 7e1f74627f..23ec55c29b 100644 --- a/modules/juce_audio_processors_headless/juce_audio_processors_headless_lv2_libs.cpp +++ b/modules/juce_audio_processors_headless/juce_audio_processors_headless_lv2_libs.cpp @@ -32,13 +32,15 @@ ============================================================================== */ -#if JUCE_PLUGINHOST_LV2 && (! (JUCE_ANDROID || JUCE_IOS)) #ifndef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS #endif - #include - #include +#include +#include +#include + +#if JUCE_INTERNAL_HAS_LV2 #include #endif diff --git a/modules/juce_audio_processors_headless/utilities/ARA/juce_ARADebug.h b/modules/juce_audio_processors_headless/utilities/ARA/juce_ARADebug.h index 43231d96ef..29af3521e5 100644 --- a/modules/juce_audio_processors_headless/utilities/ARA/juce_ARADebug.h +++ b/modules/juce_audio_processors_headless/utilities/ARA/juce_ARADebug.h @@ -42,7 +42,7 @@ #endif /** @endcond */ -#if (JucePlugin_Enable_ARA || (JUCE_PLUGINHOST_ARA && (JUCE_PLUGINHOST_VST3 || JUCE_PLUGINHOST_AU))) && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX) +#if JUCE_INTERNAL_HAS_ARA || (JucePlugin_Enable_ARA && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX)) namespace juce { diff --git a/modules/juce_audio_processors_headless/utilities/ARA/juce_ARA_utils.cpp b/modules/juce_audio_processors_headless/utilities/ARA/juce_ARA_utils.cpp index f1881358b7..93eedcacec 100644 --- a/modules/juce_audio_processors_headless/utilities/ARA/juce_ARA_utils.cpp +++ b/modules/juce_audio_processors_headless/utilities/ARA/juce_ARA_utils.cpp @@ -32,7 +32,7 @@ ============================================================================== */ -#if (JucePlugin_Enable_ARA || (JUCE_PLUGINHOST_ARA && (JUCE_PLUGINHOST_VST3 || JUCE_PLUGINHOST_AU))) && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX) +#if (JucePlugin_Enable_ARA || JUCE_INTERNAL_HAS_ARA) && (JUCE_MAC || JUCE_WINDOWS || JUCE_LINUX) namespace juce { #if ARA_ENABLE_INTERNAL_ASSERTS