From 5fa73f6a4f7800c3802940a74b3296a76c7abbcf Mon Sep 17 00:00:00 2001 From: falkTX Date: Wed, 5 Feb 2014 19:10:43 +0000 Subject: [PATCH] Fix discovery with juce --- source/discovery/Makefile | 2 +- source/discovery/carla-discovery.cpp | 46 +++++++++++++++++++------- source/modules/juce_audio_processors.h | 6 ++-- source/modules/juce_core/AppConfig.h | 2 +- 4 files changed, 39 insertions(+), 17 deletions(-) diff --git a/source/discovery/Makefile b/source/discovery/Makefile index 20c4810c9..31db0ca7f 100644 --- a/source/discovery/Makefile +++ b/source/discovery/Makefile @@ -23,7 +23,7 @@ LINK_FLAGS += $(QTCORE_LIBS) BUILD_CXX_FLAGS += -DWANT_NATIVE ifeq ($(CARLA_PLUGIN_SUPPORT),true) -BUILD_CXX_FLAGS += -DWANT_LADSPA -DWANT_DSSI -DWANT_LV2 -DWANT_VST +BUILD_CXX_FLAGS += -DWANT_LADSPA -DWANT_DSSI -DWANT_LV2 -DWANT_VST -DWANT_VST3 -DWANT_AU ifeq ($(CARLA_VESTIGE_HEADER),true) BUILD_CXX_FLAGS += -DVESTIGE_HEADER endif diff --git a/source/discovery/carla-discovery.cpp b/source/discovery/carla-discovery.cpp index cfc2dbdd4..2cf3c118a 100644 --- a/source/discovery/carla-discovery.cpp +++ b/source/discovery/carla-discovery.cpp @@ -15,8 +15,6 @@ * For a full copy of the GNU General Public License see the doc/GPL.txt file. */ -#undef HAVE_JUCE // FIXME - #include "CarlaBackendUtils.hpp" #include "CarlaLibUtils.hpp" #include "CarlaMathUtils.hpp" @@ -1464,22 +1462,39 @@ static void do_juce_check(const char* const filename, const char* const stype, c if (stype == nullptr) return; -#if JUCE_PLUGINHOST_AU && defined(JUCE_MAC) - else if (std::strcmp(stype, "AU") == 0) - pluginFormat = new AudioUnitPluginFormat(); -#endif -#if JUCE_PLUGINHOST_LADSPA && defined(JUCE_LINUX) + else if (std::strcmp(stype, "LADSPA") == 0) + { +#if defined(WANT_LADSPA) && JUCE_PLUGINHOST_LADSPA && defined(JUCE_LINUX) pluginFormat = new LADSPAPluginFormat(); +#else + DISCOVERY_OUT("error", "LADSPA support not available"); #endif -#if JUCE_PLUGINHOST_VST // && ! defined(VESTIGE_HEADER) + } else if (std::strcmp(stype, "VST") == 0) + { +#if defined(WANT_VST) && JUCE_PLUGINHOST_VST && ! defined(VESTIGE_HEADER) pluginFormat = new VSTPluginFormat(); +#else + DISCOVERY_OUT("error", "VST support not available"); #endif -#if JUCE_PLUGINHOST_VST3 + } else if (std::strcmp(stype, "VST3") == 0) + { +#if defined(WANT_VST3) && JUCE_PLUGINHOST_VST3 pluginFormat = new VSTPluginFormat(); +#else + DISCOVERY_OUT("error", "VST3 support not available"); #endif + } + else if (std::strcmp(stype, "AU") == 0) + { +#if defined(WANT_AU) && JUCE_PLUGINHOST_AU && defined(JUCE_MAC) + pluginFormat = new AudioUnitPluginFormat(); +#else + DISCOVERY_OUT("error", "AU support not available"); +#endif + } if (pluginFormat == nullptr) { @@ -1496,7 +1511,7 @@ static void do_juce_check(const char* const filename, const char* const stype, c carla_stderr2("LOOKING FOR PLUGIN %i", iv++); PluginDescription* const desc(*it); - int hints = 0x0; + uint hints = 0x0; int audioIns = desc->numInputChannels; int audioOuts = desc->numOutputChannels; int midiIns = 0; @@ -1960,11 +1975,18 @@ bool arrayContainsPlugin(const OwnedArray& list, const Plugin #include "juce_audio_processors/processors/juce_AudioProcessor.cpp" #include "juce_audio_processors/processors/juce_PluginDescription.cpp" -#ifndef CARLA_OS_MAC // FIXME later -# include "juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm" +#ifdef WANT_LADSPA # include "juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp" +#endif +#if defined(WANT_VST) && ! defined(VESTIGE_HEADER) # include "juce_audio_processors/format_types/juce_VSTPluginFormat.cpp" #endif +#ifdef WANT_VST3 +# include "juce_audio_processors/format_types/juce_VST3PluginFormat.cpp" +#endif +#ifdef WANT_AU +# include "juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm" +#endif } #endif diff --git a/source/modules/juce_audio_processors.h b/source/modules/juce_audio_processors.h index 9e442161b..a754ceafa 100644 --- a/source/modules/juce_audio_processors.h +++ b/source/modules/juce_audio_processors.h @@ -15,8 +15,8 @@ * For a full copy of the GNU General Public License see the doc/GPL.txt file. */ -#ifndef CARLA_JUCE_AUDIO_BASICS_H_INCLUDED -#define CARLA_JUCE_AUDIO_BASICS_H_INCLUDED +#ifndef CARLA_JUCE_AUDIO_PROCESSORS_H_INCLUDED +#define CARLA_JUCE_AUDIO_PROCESSORS_H_INCLUDED #include "juce_gui_basics.h" #include "juce_audio_basics.h" @@ -24,4 +24,4 @@ #include "juce_audio_processors/AppConfig.h" #include "juce_audio_processors/juce_audio_processors.h" -#endif // CARLA_JUCE_AUDIO_BASICS_H_INCLUDED +#endif // CARLA_JUCE_AUDIO_PROCESSORS_H_INCLUDED diff --git a/source/modules/juce_core/AppConfig.h b/source/modules/juce_core/AppConfig.h index bb02b8e0f..fa085417e 100755 --- a/source/modules/juce_core/AppConfig.h +++ b/source/modules/juce_core/AppConfig.h @@ -78,7 +78,7 @@ #define JUCE_MODULE_AVAILABLE_juce_events 1 #define JUCE_MODULE_AVAILABLE_juce_graphics 1 #define JUCE_MODULE_AVAILABLE_juce_gui_basics 1 -#define JUCE_MODULE_AVAILABLE_juce_gui_extra 0 +#define JUCE_MODULE_AVAILABLE_juce_gui_extra 1 #define JUCE_MODULE_AVAILABLE_juce_opengl 0 #define JUCE_MODULE_AVAILABLE_juce_video 0