diff --git a/source/Makefile.mk b/source/Makefile.mk index f2971a78d..25f649bd0 100644 --- a/source/Makefile.mk +++ b/source/Makefile.mk @@ -53,10 +53,16 @@ BUILD_CXX_FLAGS += -DVESTIGE_HEADER # -------------------------------------------------------------- HAVE_JACK = $(shell pkg-config --exists jack && echo true) +HAVE_OPENGL = $(shell pkg-config --exists gl && echo true) HAVE_AF_DEPS = $(shell pkg-config --exists libavcodec libavformat sndfile && echo true) HAVE_ZYN_DEPS = $(shell pkg-config --exists fftw3 mxml && echo true) +ifeq ($(HAVE_JACK),true) +HAVE_JACK_LATENCY = $(shell pkg-config --atleast-version=0.121.0 jack && echo true) +HAVE_JACK2 = $(shell pkg-config --atleast-version=1.9.0 jack && echo true) +endif + ifeq ($(CARLA_PLUGIN_SUPPORT),true) HAVE_SUIL = $(shell pkg-config --exists suil-0 && echo true) endif diff --git a/source/backend/CarlaNative.h b/source/backend/CarlaNative.h index 429d70e46..6c877f311 100644 --- a/source/backend/CarlaNative.h +++ b/source/backend/CarlaNative.h @@ -204,10 +204,14 @@ void carla_register_native_plugin_midiThrough(); void carla_register_native_plugin_midiTranspose(); void carla_register_native_plugin_nekofilter(); -// DISTRHO plugins +// DISTRHO plugins (GL) +#ifdef WANT_OPENGL void carla_register_native_plugin_3BandEQ(); void carla_register_native_plugin_3BandSplitter(); void carla_register_native_plugin_PingPongPan(); +#endif + +// DISTRHO plugins (Qt) void carla_register_native_plugin_Notes(); #ifdef WANT_AUDIOFILE diff --git a/source/backend/Makefile.mk b/source/backend/Makefile.mk index 24661960d..c2ccd6ddb 100644 --- a/source/backend/Makefile.mk +++ b/source/backend/Makefile.mk @@ -31,6 +31,18 @@ ifeq ($(HAVE_JACK),true) BUILD_CXX_FLAGS += -DWANT_JACK endif +ifeq ($(HAVE_JACK_LATENCY),true) +BUILD_CXX_FLAGS += -DWANT_JACK_LATENCY +endif + +ifeq ($(HAVE_JACK2),true) +BUILD_CXX_FLAGS += -DWANT_JACK_PORT_RENAME +endif + +ifeq ($(HAVE_OPENGL),true) +BUILD_CXX_FLAGS += -DWANT_OPENGL +endif + ifeq ($(HAVE_FLUIDSYNTH),true) BUILD_CXX_FLAGS += -DWANT_FLUIDSYNTH endif diff --git a/source/backend/engine/CarlaEngineJack.cpp b/source/backend/engine/CarlaEngineJack.cpp index b012739c4..68fdc603e 100644 --- a/source/backend/engine/CarlaEngineJack.cpp +++ b/source/backend/engine/CarlaEngineJack.cpp @@ -431,6 +431,7 @@ public: return CarlaEngineClient::isOk(); } +#if WANT_JACK_LATENCY void setLatency(const uint32_t samples) { CarlaEngineClient::setLatency(samples); @@ -438,6 +439,7 @@ public: if (kUseClient) jackbridge_recompute_total_latencies(kClient); } +#endif CarlaEnginePort* addPort(const EnginePortType portType, const char* const name, const bool isInput) { @@ -576,8 +578,10 @@ public: jackbridge_set_sample_rate_callback(fClient, carla_jack_srate_callback, this); jackbridge_set_freewheel_callback(fClient, carla_jack_freewheel_callback, this); jackbridge_set_process_callback(fClient, carla_jack_process_callback, this); - jackbridge_set_latency_callback(fClient, carla_jack_latency_callback, this); jackbridge_on_shutdown(fClient, carla_jack_shutdown_callback, this); +# if WANT_JACK_LATENCY + jackbridge_set_latency_callback(fClient, carla_jack_latency_callback, this); +# endif const char* const jackClientName = jackbridge_get_client_name(fClient); @@ -588,8 +592,10 @@ public: jack_set_port_registration_callback(fClient, carla_jack_port_registration_callback, this); jack_set_port_connect_callback(fClient, carla_jack_port_connect_callback, this); +#ifdef WANT_JACK_PORT_RENAME if (jack_set_port_rename_callback) jack_set_port_rename_callback(fClient, carla_jack_port_rename_callback, this); +#endif if (fOptions.processMode == PROCESS_MODE_CONTINUOUS_RACK) { @@ -708,8 +714,10 @@ public: jackbridge_set_sample_rate_callback(client, carla_jack_srate_callback, this); jackbridge_set_freewheel_callback(client, carla_jack_freewheel_callback, this); jackbridge_set_process_callback(client, carla_jack_process_callback, this); - jackbridge_set_latency_callback(client, carla_jack_latency_callback, this); jackbridge_on_shutdown(client, carla_jack_shutdown_callback, this); +# if WANT_JACK_LATENCY + jackbridge_set_latency_callback(client, carla_jack_latency_callback, this); +# endif #else if (fOptions.processMode == PROCESS_MODE_SINGLE_CLIENT) { @@ -719,7 +727,9 @@ public: { client = jackbridge_client_open(plugin->name(), JackNullOption, nullptr); jackbridge_set_process_callback(client, carla_jack_process_callback_plugin, plugin); +# if WANT_JACK_LATENCY jackbridge_set_latency_callback(client, carla_jack_latency_callback_plugin, plugin); +# endif } #endif @@ -1098,6 +1108,7 @@ protected: proccessPendingEvents(); } +#if WANT_JACK_LATENCY void handleJackLatencyCallback(const jack_latency_callback_mode_t mode) { if (fOptions.processMode != PROCESS_MODE_SINGLE_CLIENT) @@ -1111,6 +1122,7 @@ protected: latencyPlugin(plugin, mode); } } +#endif #ifndef BUILD_BRIDGE void handleJackClientRegistrationCallback(const char* name, bool reg) @@ -1509,6 +1521,7 @@ private: setPeaks(plugin->id(), inPeaks, outPeaks); } +#if WANT_JACK_LATENCY void latencyPlugin(CarlaPlugin* const plugin, jack_latency_callback_mode_t mode) { const uint32_t inCount = plugin->audioInCount(); @@ -1549,6 +1562,7 @@ private: } } } +#endif // ------------------------------------- @@ -1577,10 +1591,12 @@ private: return 0; } +#if WANT_JACK_LATENCY static void carla_jack_latency_callback(jack_latency_callback_mode_t mode, void* arg) { handlePtr->handleJackLatencyCallback(mode); } +#endif #ifndef BUILD_BRIDGE static void carla_jack_client_registration_callback(const char* name, int reg, void* arg) @@ -1634,6 +1650,7 @@ private: return 0; } +# if WANT_JACK_LATENCY static void carla_jack_latency_callback_plugin(jack_latency_callback_mode_t mode, void* arg) { CarlaPlugin* const plugin = (CarlaPlugin*)arg; @@ -1645,6 +1662,7 @@ private: engine->latencyPlugin(plugin, mode); } } +# endif #endif CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(CarlaEngineJack) diff --git a/source/backend/native/Makefile b/source/backend/native/Makefile index de3141add..0e7d6bcc1 100644 --- a/source/backend/native/Makefile +++ b/source/backend/native/Makefile @@ -35,11 +35,16 @@ OBJS = \ midi-transpose.c.o \ nekofilter.c.o -# DISTRHO plugins +# DISTRHO plugins (GL) +ifeq ($(HAVE_OPENGL),true) OBJS += \ distrho-3bandeq.cpp.o \ distrho-3bandsplitter.cpp.o \ - distrho-pingpongpan.cpp.o \ + distrho-pingpongpan.cpp.o +endif + +# DISTRHO plugins (Qt) +OBJS += \ distrho-notes.cpp.o ifeq ($(HAVE_AF_DEPS),true) diff --git a/source/backend/plugin/NativePlugin.cpp b/source/backend/plugin/NativePlugin.cpp index b02ca026c..92e7fa84e 100644 --- a/source/backend/plugin/NativePlugin.cpp +++ b/source/backend/plugin/NativePlugin.cpp @@ -1976,9 +1976,11 @@ private: carla_register_native_plugin_midiTranspose(); carla_register_native_plugin_nekofilter(); +# ifdef WANT_OPENGL carla_register_native_plugin_3BandEQ(); carla_register_native_plugin_3BandSplitter(); carla_register_native_plugin_PingPongPan(); +# endif carla_register_native_plugin_Notes(); # ifdef WANT_AUDIOFILE diff --git a/source/bridges/CarlaBridgePlugin.cpp b/source/bridges/CarlaBridgePlugin.cpp index e8f5f3504..b07e78141 100644 --- a/source/bridges/CarlaBridgePlugin.cpp +++ b/source/bridges/CarlaBridgePlugin.cpp @@ -71,7 +71,7 @@ void initSignalHandler() { #ifdef CARLA_OS_WIN SetConsoleCtrlHandler(closeSignalHandler, TRUE); -#else +#elif defined(CARLA_OS_LINUX) || defined(CARLA_OS_HAIKU) struct sigaction sint; struct sigaction sterm; struct sigaction susr1; diff --git a/source/libs/lilv/config/serd_config.h b/source/libs/lilv/config/serd_config.h index 6e3c697a8..49201bb21 100644 --- a/source/libs/lilv/config/serd_config.h +++ b/source/libs/lilv/config/serd_config.h @@ -4,7 +4,10 @@ #define SERD_VERSION "0.18.2" -#if defined(__APPLE__) || defined(__HAIKU__) +#if defined(__APPLE__) + #define HAVE_FMAX 1 + #define HAVE_FILENO 1 +#elif defined(__HAIKU__) #define HAVE_FMAX 1 #define HAVE_FILENO 1 #define HAVE_POSIX_MEMALIGN 1