From f75a4803db667ad94870fcf62ccdb513251c1c14 Mon Sep 17 00:00:00 2001 From: falkTX Date: Wed, 16 Jan 2019 16:48:24 +0100 Subject: [PATCH] More juce tweaks Signed-off-by: falkTX --- Makefile | 47 +++++++++++++++++- source/Makefile.mk | 27 +++++++++++ source/backend/CarlaStandalone.cpp | 38 +++++++++++++++ source/backend/Makefile | 34 +++++++++++-- source/backend/engine/CarlaEngine.cpp | 6 +++ source/backend/engine/CarlaEngineJuce.cpp | 2 +- source/backend/plugin/Makefile | 3 ++ source/bridges-plugin/Makefile | 59 +++++++++++++++++++++++ source/modules/AppConfig.h | 19 +++++--- source/modules/water/xml/XmlElement.h | 4 +- source/plugin/Makefile | 24 +++++++++ 11 files changed, 249 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 39093d4c2..ad223f340 100644 --- a/Makefile +++ b/Makefile @@ -62,14 +62,13 @@ endif ifeq ($(USING_JUCE),true) ALL_LIBS += $(MODULEDIR)/juce_audio_basics.a ALL_LIBS += $(MODULEDIR)/juce_audio_devices.a +ALL_LIBS += $(MODULEDIR)/juce_audio_processors.a ALL_LIBS += $(MODULEDIR)/juce_core.a ALL_LIBS += $(MODULEDIR)/juce_data_structures.a ALL_LIBS += $(MODULEDIR)/juce_events.a ifeq ($(MACOS_OR_WIN32),true) -ALL_LIBS += $(MODULEDIR)/juce_audio_processors.a ALL_LIBS += $(MODULEDIR)/juce_graphics.a ALL_LIBS += $(MODULEDIR)/juce_gui_basics.a -# ALL_LIBS += $(MODULEDIR)/juce_gui_extra.a endif endif @@ -220,6 +219,18 @@ LIBS_POSIX32 += $(MODULEDIR)/lilv.posix32.a LIBS_POSIX32 += $(MODULEDIR)/rtmempool.posix32.a LIBS_POSIX32 += $(MODULEDIR)/water.posix32.a +ifeq ($(USING_JUCE),true) +LIBS_POSIX32 += $(MODULEDIR)/juce_audio_basics.posix32.a +LIBS_POSIX32 += $(MODULEDIR)/juce_audio_processors.posix32.a +LIBS_POSIX32 += $(MODULEDIR)/juce_data_structures.posix32.a +LIBS_POSIX32 += $(MODULEDIR)/juce_core.posix32.a +LIBS_POSIX32 += $(MODULEDIR)/juce_events.posix32.a +ifeq ($(MACOS_OR_WIN32),true) +LIBS_POSIX32 += $(MODULEDIR)/juce_graphics.posix32.a +LIBS_POSIX32 += $(MODULEDIR)/juce_gui_basics.posix32.a +endif +endif + posix32: $(LIBS_POSIX32) $(MAKE) -C source/bridges-plugin posix32 $(MAKE) -C source/discovery posix32 @@ -232,6 +243,18 @@ LIBS_POSIX64 += $(MODULEDIR)/lilv.posix64.a LIBS_POSIX64 += $(MODULEDIR)/rtmempool.posix64.a LIBS_POSIX64 += $(MODULEDIR)/water.posix64.a +ifeq ($(USING_JUCE),true) +LIBS_POSIX64 += $(MODULEDIR)/juce_audio_basics.posix64.a +LIBS_POSIX64 += $(MODULEDIR)/juce_audio_processors.posix64.a +LIBS_POSIX64 += $(MODULEDIR)/juce_data_structures.posix64.a +LIBS_POSIX64 += $(MODULEDIR)/juce_core.posix64.a +LIBS_POSIX64 += $(MODULEDIR)/juce_events.posix64.a +ifeq ($(MACOS_OR_WIN32),true) +LIBS_POSIX64 += $(MODULEDIR)/juce_graphics.posix64.a +LIBS_POSIX64 += $(MODULEDIR)/juce_gui_basics.posix64.a +endif +endif + posix64: $(LIBS_POSIX64) $(MAKE) -C source/bridges-plugin posix64 $(MAKE) -C source/discovery posix64 @@ -248,6 +271,16 @@ LIBS_WIN32 += $(MODULEDIR)/lilv.win32.a LIBS_WIN32 += $(MODULEDIR)/rtmempool.win32.a LIBS_WIN32 += $(MODULEDIR)/water.win32.a +ifeq ($(USING_JUCE),true) +LIBS_WIN32 += $(MODULEDIR)/juce_audio_basics.win32.a +LIBS_WIN32 += $(MODULEDIR)/juce_audio_processors.win32.a +LIBS_WIN32 += $(MODULEDIR)/juce_data_structures.win32.a +LIBS_WIN32 += $(MODULEDIR)/juce_core.win32.a +LIBS_WIN32 += $(MODULEDIR)/juce_events.win32.a +LIBS_WIN32 += $(MODULEDIR)/juce_graphics.win32.a +LIBS_WIN32 += $(MODULEDIR)/juce_gui_basics.win32.a +endif + win32: $(LIBS_WIN32) $(MAKE) -C source/bridges-plugin win32 $(MAKE) -C source/discovery win32 @@ -264,6 +297,16 @@ LIBS_WIN64 += $(MODULEDIR)/lilv.win64.a LIBS_WIN64 += $(MODULEDIR)/rtmempool.win64.a LIBS_WIN64 += $(MODULEDIR)/water.win64.a +ifeq ($(USING_JUCE),true) +LIBS_WIN64 += $(MODULEDIR)/juce_audio_basics.win64.a +LIBS_WIN64 += $(MODULEDIR)/juce_audio_processors.win64.a +LIBS_WIN64 += $(MODULEDIR)/juce_data_structures.win64.a +LIBS_WIN64 += $(MODULEDIR)/juce_core.win64.a +LIBS_WIN64 += $(MODULEDIR)/juce_events.win64.a +LIBS_WIN64 += $(MODULEDIR)/juce_graphics.win64.a +LIBS_WIN64 += $(MODULEDIR)/juce_gui_basics.win64.a +endif + win64: $(LIBS_WIN64) $(MAKE) -C source/bridges-plugin win64 $(MAKE) -C source/discovery win64 diff --git a/source/Makefile.mk b/source/Makefile.mk index f65bf4f5e..951f9cac9 100644 --- a/source/Makefile.mk +++ b/source/Makefile.mk @@ -405,6 +405,8 @@ endif # --------------------------------------------------------------------------------------------------------------------- # Set libs stuff (part 2) +ifneq ($(USING_JUCE),true) + RTAUDIO_FLAGS = -DHAVE_GETTIMEOFDAY RTMIDI_FLAGS = @@ -421,6 +423,8 @@ RTAUDIO_LIBS += $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs libpulse-simple endif endif +endif # USING_JUCE + ifeq ($(BSD),true) JACKBRIDGE_LIBS = -lpthread -lrt LILV_LIBS = -lm -lrt @@ -448,6 +452,10 @@ JACKBRIDGE_LIBS = -ldl -lpthread -lrt LILV_LIBS = -ldl -lm -lrt RTMEMPOOL_LIBS = -lpthread -lrt WATER_LIBS = -ldl -lpthread -lrt +ifeq ($(USING_JUCE),true) +JUCE_CORE_LIBS = -ldl -lpthread -lrt +JUCE_AUDIO_DEVICES_LIBS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs alsa) +else ifeq ($(HAVE_ALSA),true) RTAUDIO_FLAGS += $(shell pkg-config $(PKG_CONFIG_FLAGS) --cflags alsa) -D__LINUX_ALSA__ RTAUDIO_LIBS += $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs alsa) -lpthread @@ -455,6 +463,7 @@ RTMIDI_FLAGS += $(shell pkg-config $(PKG_CONFIG_FLAGS) --cflags alsa) -D__LIN RTMIDI_LIBS += $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs alsa) endif endif +endif ifeq ($(MACOS),true) HYLIA_FLAGS = -DLINK_PLATFORM_MACOSX=1 @@ -462,11 +471,22 @@ JACKBRIDGE_LIBS = -ldl -lpthread LILV_LIBS = -ldl -lm RTMEMPOOL_LIBS = -lpthread WATER_LIBS = -framework AppKit +ifeq ($(USING_JUCE),true) +JUCE_AUDIO_BASICS_LIBS = -framework Accelerate +JUCE_AUDIO_DEVICES_LIBS = -framework AppKit -framework AudioToolbox -framework CoreAudio -framework CoreMIDI +JUCE_AUDIO_FORMATS_LIBS = -framework AudioToolbox -framework CoreFoundation +JUCE_AUDIO_PROCESSORS_LIBS = -framework AudioToolbox -framework AudioUnit -framework CoreAudio -framework CoreAudioKit -framework Cocoa -framework Carbon +JUCE_CORE_LIBS = -framework AppKit +JUCE_EVENTS_LIBS = -framework AppKit +JUCE_GRAPHICS_LIBS = -framework Cocoa -framework QuartzCore +JUCE_GUI_BASICS_LIBS = -framework Cocoa +else RTAUDIO_FLAGS += -D__MACOSX_CORE__ RTAUDIO_LIBS += -framework CoreAudio RTMIDI_FLAGS += -D__MACOSX_CORE__ RTMIDI_LIBS += -framework CoreMIDI endif +endif ifeq ($(WIN32),true) HYLIA_FLAGS = -DLINK_PLATFORM_WINDOWS=1 @@ -474,10 +494,17 @@ JACKBRIDGE_LIBS = -lpthread LILV_LIBS = -lm RTMEMPOOL_LIBS = -lpthread WATER_LIBS = -luuid -lwsock32 -lwininet -lversion -lole32 -lws2_32 -loleaut32 -limm32 -lcomdlg32 -lshlwapi -lrpcrt4 -lwinmm +ifeq ($(USING_JUCE),true) +JUCE_AUDIO_DEVICES_LIBS = -lwinmm -lole32 +JUCE_CORE_LIBS = -luuid -lwsock32 -lwininet -lversion -lole32 -lws2_32 -loleaut32 -limm32 -lcomdlg32 -lshlwapi -lrpcrt4 -lwinmm +JUCE_GRAPHICS_LIBS = -lgdi32 +JUCE_GUI_BASICS_LIBS = -lgdi32 -limm32 -lcomdlg32 -lole32 +else RTAUDIO_FLAGS += -D__WINDOWS_ASIO__ -D__WINDOWS_DS__ -D__WINDOWS_WASAPI__ RTAUDIO_LIBS += -ldsound -luuid -lksuser -lwinmm RTMIDI_FLAGS += -D__WINDOWS_MM__ endif +endif # --------------------------------------------------------------------------------------------------------------------- diff --git a/source/backend/CarlaStandalone.cpp b/source/backend/CarlaStandalone.cpp index 5f765e525..668e3f941 100644 --- a/source/backend/CarlaStandalone.cpp +++ b/source/backend/CarlaStandalone.cpp @@ -37,6 +37,16 @@ # include "CarlaLogThread.hpp" #endif +#ifdef USING_JUCE +// # include "AppConfig.h" +# if defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN) +# include "juce_gui_basics/juce_gui_basics.h" +# else +# include "juce_events/juce_events.h" +# endif +# include "juce_core/juce_core.h" +#endif + #define CARLA_SAFE_ASSERT_WITH_LAST_ERROR_RETURN(cond, msg, ret) \ if (! (cond)) { \ carla_stderr2("%s: " msg, __FUNCTION__); \ @@ -287,6 +297,9 @@ static void carla_engine_init_common(CarlaEngine* const engine) if (const char* const pathVST2 = std::getenv("ENGINE_OPTION_PLUGIN_PATH_VST2")) engine->setOption(CB::ENGINE_OPTION_PLUGIN_PATH, CB::PLUGIN_VST2, pathVST2); + if (const char* const pathVST3 = std::getenv("ENGINE_OPTION_PLUGIN_PATH_VST3")) + engine->setOption(CB::ENGINE_OPTION_PLUGIN_PATH, CB::PLUGIN_VST3, pathVST3); + if (const char* const pathSF2 = std::getenv("ENGINE_OPTION_PLUGIN_PATH_SF2")) engine->setOption(CB::ENGINE_OPTION_PLUGIN_PATH, CB::PLUGIN_SF2, pathSF2); @@ -334,6 +347,9 @@ static void carla_engine_init_common(CarlaEngine* const engine) if (gStandalone.engineOptions.pathVST2 != nullptr) engine->setOption(CB::ENGINE_OPTION_PLUGIN_PATH, CB::PLUGIN_VST2, gStandalone.engineOptions.pathVST2); + if (gStandalone.engineOptions.pathVST3 != nullptr) + engine->setOption(CB::ENGINE_OPTION_PLUGIN_PATH, CB::PLUGIN_VST3, gStandalone.engineOptions.pathVST3); + if (gStandalone.engineOptions.pathSF2 != nullptr) engine->setOption(CB::ENGINE_OPTION_PLUGIN_PATH, CB::PLUGIN_SF2, gStandalone.engineOptions.pathSF2); @@ -403,6 +419,10 @@ bool carla_engine_init(const char* driverName, const char* clientName) engine->setOption(CB::ENGINE_OPTION_TRANSPORT_MODE, static_cast(gStandalone.engineOptions.transportMode), gStandalone.engineOptions.transportExtra); #endif +#ifdef USING_JUCE + juce::initialiseJuce_GUI(); +#endif + carla_engine_init_common(engine); if (engine->init(clientName)) @@ -421,6 +441,9 @@ bool carla_engine_init(const char* driverName, const char* clientName) else { gStandalone.lastError = engine->getLastError(); +#ifdef USING_JUCE + juce::shutdownJuce_GUI(); +#endif return false; } } @@ -487,6 +510,9 @@ bool carla_engine_close() #ifndef BUILD_BRIDGE gStandalone.logThread.stop(); +# ifdef USING_JUCE + juce::shutdownJuce_GUI(); +# endif #endif return closed; @@ -497,6 +523,13 @@ void carla_engine_idle() CARLA_SAFE_ASSERT_RETURN(gStandalone.engine != nullptr,); gStandalone.engine->idle(); + +#if defined(USING_JUCE) && !(defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN)) + const juce::MessageManager* const msgMgr(juce::MessageManager::getInstanceWithoutCreating()); + CARLA_SAFE_ASSERT_RETURN(msgMgr != nullptr,); + + for (; msgMgr->dispatchNextMessageOnSystemQueue(true);) {} +#endif } bool carla_is_engine_running() @@ -645,6 +678,11 @@ void carla_set_engine_option(EngineOption option, int value, const char* valueSt delete[] gStandalone.engineOptions.pathVST2; gStandalone.engineOptions.pathVST2 = carla_strdup_safe(valueStr); break; + case CB::PLUGIN_VST3: + if (gStandalone.engineOptions.pathVST3 != nullptr) + delete[] gStandalone.engineOptions.pathVST3; + gStandalone.engineOptions.pathVST3 = carla_strdup_safe(valueStr); + break; case CB::PLUGIN_SF2: if (gStandalone.engineOptions.pathSF2 != nullptr) delete[] gStandalone.engineOptions.pathSF2; diff --git a/source/backend/Makefile b/source/backend/Makefile index 1c66b0e62..9330c09eb 100644 --- a/source/backend/Makefile +++ b/source/backend/Makefile @@ -37,8 +37,23 @@ ifeq ($(HAVE_HYLIA),true) STANDALONE_LIBS += $(MODULEDIR)/hylia.a endif +ifeq ($(USING_JUCE),true) +STANDALONE_LIBS += $(MODULEDIR)/juce_audio_basics.a +STANDALONE_LIBS += $(MODULEDIR)/juce_audio_devices.a +STANDALONE_LIBS += $(MODULEDIR)/juce_audio_processors.a +STANDALONE_LIBS += $(MODULEDIR)/juce_core.a +STANDALONE_LIBS += $(MODULEDIR)/juce_data_structures.a +STANDALONE_LIBS += $(MODULEDIR)/juce_events.a +ifeq ($(MACOS_OR_WIN32),true) +STANDALONE_LIBS += $(MODULEDIR)/juce_graphics.a +STANDALONE_LIBS += $(MODULEDIR)/juce_gui_basics.a +# ifeq ($(MACOS),true) +# STANDALONE_LIBS += $(MODULEDIR)/juce_gui_extra.a +endif +else STANDALONE_LIBS += $(MODULEDIR)/rtaudio.a STANDALONE_LIBS += $(MODULEDIR)/rtmidi.a +endif # ---------------------------------------------------------------------------------------------------------------------------- @@ -48,14 +63,27 @@ STANDALONE_LINK_FLAGS += $(NATIVE_PLUGINS_LIBS) STANDALONE_LINK_FLAGS += $(RTMEMPOOL_LIBS) STANDALONE_LINK_FLAGS += $(WATER_LIBS) -STANDALONE_LINK_FLAGS += $(RTAUDIO_LIBS) -STANDALONE_LINK_FLAGS += $(RTMIDI_LIBS) - STANDALONE_LINK_FLAGS += $(LIBLO_LIBS) STANDALONE_LINK_FLAGS += $(MAGIC_LIBS) STANDALONE_LINK_FLAGS += $(FLUIDSYNTH_LIBS) STANDALONE_LINK_FLAGS += $(X11_LIBS) +ifeq ($(USING_JUCE),true) +STANDALONE_LINK_FLAGS += $(JUCE_AUDIO_BASICS_LIBS) +STANDALONE_LINK_FLAGS += $(JUCE_AUDIO_DEVICES_LIBS) +STANDALONE_LINK_FLAGS += $(JUCE_AUDIO_PROCESSORS_LIBS) +STANDALONE_LINK_FLAGS += $(JUCE_CORE_LIBS) +STANDALONE_LINK_FLAGS += $(JUCE_DATA_STRUCTURES_LIBS) +STANDALONE_LINK_FLAGS += $(JUCE_EVENTS_LIBS) +ifeq ($(MACOS_OR_WIN32),true) +STANDALONE_LINK_FLAGS += $(JUCE_GRAPHICS_LIBS) +STANDALONE_LINK_FLAGS += $(JUCE_GUI_BASICS_LIBS) +endif +else +STANDALONE_LINK_FLAGS += $(RTAUDIO_LIBS) +STANDALONE_LINK_FLAGS += $(RTMIDI_LIBS) +endif + # ---------------------------------------------------------------------------------------------------------------------------- all: $(TARGETS) diff --git a/source/backend/engine/CarlaEngine.cpp b/source/backend/engine/CarlaEngine.cpp index 8798c8ec1..90647614e 100644 --- a/source/backend/engine/CarlaEngine.cpp +++ b/source/backend/engine/CarlaEngine.cpp @@ -202,6 +202,12 @@ CarlaEngine* CarlaEngine::newDriverByName(const char* const driverName) #ifndef BUILD_BRIDGE # ifdef USING_JUCE + // ------------------------------------------------------------------- + // linux + + if (std::strcmp(driverName, "ALSA") == 0) + return newJuce(AUDIO_API_ALSA); + // ------------------------------------------------------------------- // macos diff --git a/source/backend/engine/CarlaEngineJuce.cpp b/source/backend/engine/CarlaEngineJuce.cpp index efa124f14..bc83f02b4 100644 --- a/source/backend/engine/CarlaEngineJuce.cpp +++ b/source/backend/engine/CarlaEngineJuce.cpp @@ -1,6 +1,6 @@ /* * Carla Plugin Host - * Copyright (C) 2011-2017 Filipe Coelho + * Copyright (C) 2011-2019 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff --git a/source/backend/plugin/Makefile b/source/backend/plugin/Makefile index 742e89f68..e0980a433 100644 --- a/source/backend/plugin/Makefile +++ b/source/backend/plugin/Makefile @@ -18,6 +18,9 @@ OBJS = \ $(OBJDIR)/CarlaPluginDSSI.cpp.o \ $(OBJDIR)/CarlaPluginLV2.cpp.o \ $(OBJDIR)/CarlaPluginVST2.cpp.o \ + $(OBJDIR)/CarlaPluginVST3.cpp.o \ + $(OBJDIR)/CarlaPluginAU.cpp.o \ + $(OBJDIR)/CarlaPluginJuce.cpp.o \ $(OBJDIR)/CarlaPluginFluidSynth.cpp.o \ $(OBJDIR)/CarlaPluginSFZero.cpp.o \ $(OBJDIR)/CarlaPluginJack.cpp.o diff --git a/source/bridges-plugin/Makefile b/source/bridges-plugin/Makefile index da318f2dc..5645c2ce3 100644 --- a/source/bridges-plugin/Makefile +++ b/source/bridges-plugin/Makefile @@ -63,6 +63,59 @@ LIBS_win32 += $(MODULEDIR)/water.win32.a LIBS_win64 += $(MODULEDIR)/water.win64.a LINK_FLAGS += $(WATER_LIBS) +ifeq ($(USING_JUCE),true) +LIBS_native += $(MODULEDIR)/juce_audio_basics.a +LIBS_posix32 += $(MODULEDIR)/juce_audio_basics.posix32.a +LIBS_posix64 += $(MODULEDIR)/juce_audio_basics.posix64.a +LIBS_win32 += $(MODULEDIR)/juce_audio_basics.win32.a +LIBS_win64 += $(MODULEDIR)/juce_audio_basics.win64.a +LINK_FLAGS += $(JUCE_AUDIO_BASICS_LIBS) + +LIBS_native += $(MODULEDIR)/juce_audio_processors.a +LIBS_posix32 += $(MODULEDIR)/juce_audio_processors.posix32.a +LIBS_posix64 += $(MODULEDIR)/juce_audio_processors.posix64.a +LIBS_win32 += $(MODULEDIR)/juce_audio_processors.win32.a +LIBS_win64 += $(MODULEDIR)/juce_audio_processors.win64.a +LINK_FLAGS += $(JUCE_AUDIO_PROCESSORS_LIBS) + +LIBS_native += $(MODULEDIR)/juce_core.a +LIBS_posix32 += $(MODULEDIR)/juce_core.posix32.a +LIBS_posix64 += $(MODULEDIR)/juce_core.posix64.a +LIBS_win32 += $(MODULEDIR)/juce_core.win32.a +LIBS_win64 += $(MODULEDIR)/juce_core.win64.a +LINK_FLAGS += $(JUCE_CORE_LIBS) + +LIBS_native += $(MODULEDIR)/juce_data_structures.a +LIBS_posix32 += $(MODULEDIR)/juce_data_structures.posix32.a +LIBS_posix64 += $(MODULEDIR)/juce_data_structures.posix64.a +LIBS_win32 += $(MODULEDIR)/juce_data_structures.win32.a +LIBS_win64 += $(MODULEDIR)/juce_data_structures.win64.a +LINK_FLAGS += $(JUCE_DATA_STRUCTURES_LIBS) + +LIBS_native += $(MODULEDIR)/juce_events.a +LIBS_posix32 += $(MODULEDIR)/juce_events.posix32.a +LIBS_posix64 += $(MODULEDIR)/juce_events.posix64.a +LIBS_win32 += $(MODULEDIR)/juce_events.win32.a +LIBS_win64 += $(MODULEDIR)/juce_events.win64.a +LINK_FLAGS += $(JUCE_EVENTS_LIBS) + +ifeq ($(MACOS_OR_WIN32),true) +LIBS_native += $(MODULEDIR)/juce_graphics.a +LIBS_posix32 += $(MODULEDIR)/juce_graphics.posix32.a +LIBS_posix64 += $(MODULEDIR)/juce_graphics.posix64.a +LIBS_win32 += $(MODULEDIR)/juce_graphics.win32.a +LIBS_win64 += $(MODULEDIR)/juce_graphics.win64.a +LINK_FLAGS += $(JUCE_GRAPHICS_LIBS) + +LIBS_native += $(MODULEDIR)/juce_gui_basics.a +LIBS_posix32 += $(MODULEDIR)/juce_gui_basics.posix32.a +LIBS_posix64 += $(MODULEDIR)/juce_gui_basics.posix64.a +LIBS_win32 += $(MODULEDIR)/juce_gui_basics.win32.a +LIBS_win64 += $(MODULEDIR)/juce_gui_basics.win64.a +LINK_FLAGS += $(JUCE_GUI_BASICS_LIBS) +endif +endif + LINK_FLAGS += $(X11_LIBS) # ---------------------------------------------------------------------------------------------------------------------- @@ -114,6 +167,9 @@ OBJS_native = \ $(OBJDIR)/CarlaPluginDSSI.cpp.o \ $(OBJDIR)/CarlaPluginLV2.cpp.o \ $(OBJDIR)/CarlaPluginVST2.cpp.o \ + $(OBJDIR)/CarlaPluginVST3.cpp.o \ + $(OBJDIR)/CarlaPluginAU.cpp.o \ + $(OBJDIR)/CarlaPluginJuce.cpp.o \ $(OBJDIR)/CarlaPluginFluidSynth.cpp.o \ $(OBJDIR)/CarlaPluginSFZero.cpp.o \ $(OBJDIR)/CarlaStandalone.cpp.o @@ -138,6 +194,9 @@ OBJS_arch = \ $(OBJDIR)/CarlaPluginDSSI.cpp.arch.o \ $(OBJDIR)/CarlaPluginLV2.cpp.arch.o \ $(OBJDIR)/CarlaPluginVST2.cpp.arch.o \ + $(OBJDIR)/CarlaPluginVST3.cpp.arch.o \ + $(OBJDIR)/CarlaPluginAU.cpp.arch.o \ + $(OBJDIR)/CarlaPluginJuce.cpp.arch.o \ $(OBJDIR)/CarlaStandalone.cpp.arch.o OBJS_posix32 = $(OBJS_arch:%.arch.o=%.posix32.o) diff --git a/source/modules/AppConfig.h b/source/modules/AppConfig.h index 4cc1ac898..b163db525 100644 --- a/source/modules/AppConfig.h +++ b/source/modules/AppConfig.h @@ -27,7 +27,7 @@ // always enabled #define JUCE_MODULE_AVAILABLE_juce_audio_basics 1 -#define JUCE_MODULE_AVAILABLE_juce_audio_devices 1 +#define JUCE_MODULE_AVAILABLE_juce_audio_processors 1 #define JUCE_MODULE_AVAILABLE_juce_core 1 #define JUCE_MODULE_AVAILABLE_juce_data_structures 1 #define JUCE_MODULE_AVAILABLE_juce_events 1 @@ -38,19 +38,22 @@ #define JUCE_MODULE_AVAILABLE_juce_audio_utils 0 #define JUCE_MODULE_AVAILABLE_juce_cryptography 0 #define JUCE_MODULE_AVAILABLE_juce_opengl 0 +#define JUCE_MODULE_AVAILABLE_juce_gui_extra 0 #define JUCE_MODULE_AVAILABLE_juce_video 0 // conditional #if defined(APPCONFIG_OS_MAC) || defined(APPCONFIG_OS_WIN) -# define JUCE_MODULE_AVAILABLE_juce_audio_processors 1 # define JUCE_MODULE_AVAILABLE_juce_graphics 1 # define JUCE_MODULE_AVAILABLE_juce_gui_basics 1 -# define JUCE_MODULE_AVAILABLE_juce_gui_extra 1 #else -# define JUCE_MODULE_AVAILABLE_juce_audio_processors 0 # define JUCE_MODULE_AVAILABLE_juce_graphics 0 # define JUCE_MODULE_AVAILABLE_juce_gui_basics 0 -# define JUCE_MODULE_AVAILABLE_juce_gui_extra 0 +#endif + +#ifndef BUILD_BRIDGE +# define JUCE_MODULE_AVAILABLE_juce_audio_devices 1 +#else +# define JUCE_MODULE_AVAILABLE_juce_audio_devices 0 #endif // misc @@ -191,7 +194,11 @@ @see VSTPluginFormat, AudioPluginFormat, AudioPluginFormatManager, JUCE_PLUGINHOST_AU */ -#define JUCE_PLUGINHOST_VST 1 +#if defined(APPCONFIG_OS_MAC) || defined(APPCONFIG_OS_WIN) +# define JUCE_PLUGINHOST_VST 1 +#else +# define JUCE_PLUGINHOST_VST 0 +#endif /** Config: JUCE_PLUGINHOST_VST3 Enables the VST3 audio plugin hosting classes. This requires the Steinberg VST3 SDK to be diff --git a/source/modules/water/xml/XmlElement.h b/source/modules/water/xml/XmlElement.h index b2c8972db..611f40877 100644 --- a/source/modules/water/xml/XmlElement.h +++ b/source/modules/water/xml/XmlElement.h @@ -51,7 +51,7 @@ namespace water { @see forEachXmlChildElementWithTagName */ -#define forEachXmlChildElement(parentXmlElement, childElementVariableName) \ +#define __forEachXmlChildElement(parentXmlElement, childElementVariableName) \ \ for (water::XmlElement* childElementVariableName = (parentXmlElement).getFirstChildElement(); \ childElementVariableName != nullptr; \ @@ -80,7 +80,7 @@ namespace water { @see forEachXmlChildElement */ -#define forEachXmlChildElementWithTagName(parentXmlElement, childElementVariableName, requiredTagName) \ +#define __forEachXmlChildElementWithTagName(parentXmlElement, childElementVariableName, requiredTagName) \ \ for (water::XmlElement* childElementVariableName = (parentXmlElement).getChildByName (requiredTagName); \ childElementVariableName != nullptr; \ diff --git a/source/plugin/Makefile b/source/plugin/Makefile index 4656249b7..5c467969f 100644 --- a/source/plugin/Makefile +++ b/source/plugin/Makefile @@ -59,6 +59,18 @@ ifeq ($(HAVE_HYLIA),true) LIBS += $(MODULEDIR)/hylia.a endif +ifeq ($(USING_JUCE),true) +LIBS += $(MODULEDIR)/juce_audio_basics.a +LIBS += $(MODULEDIR)/juce_audio_processors.a +LIBS += $(MODULEDIR)/juce_core.a +LIBS += $(MODULEDIR)/juce_data_structures.a +LIBS += $(MODULEDIR)/juce_events.a +ifeq ($(MACOS_OR_WIN32),true) +LIBS += $(MODULEDIR)/juce_graphics.a +LIBS += $(MODULEDIR)/juce_gui_basics.a +endif +endif + # --------------------------------------------------------------------------------------------------------------------- # Link flags @@ -74,6 +86,18 @@ NATIVE_LINK_FLAGS += $(LIBLO_LIBS) NATIVE_LINK_FLAGS += $(MAGIC_LIBS) NATIVE_LINK_FLAGS += $(X11_LIBS) +ifeq ($(USING_JUCE),true) +LINK_FLAGS += $(JUCE_AUDIO_BASICS_LIBS) +LINK_FLAGS += $(JUCE_AUDIO_PROCESSORS_LIBS) +LINK_FLAGS += $(JUCE_CORE_LIBS) +LINK_FLAGS += $(JUCE_DATA_STRUCTURES_LIBS) +LINK_FLAGS += $(JUCE_EVENTS_LIBS) +ifeq ($(MACOS_OR_WIN32),true) +LINK_FLAGS += $(JUCE_GRAPHICS_LIBS) +LINK_FLAGS += $(JUCE_GUI_BASICS_LIBS) +endif +endif + ifeq ($(MACOS),true) SYMBOLS_NATIVE = -Wl,-exported_symbol,_carla_get_native_rack_plugin SYMBOLS_NATIVE += -Wl,-exported_symbol,_carla_get_native_patchbay_plugin