From b7e7960855e8137eab98b1deede51d4eb526cc67 Mon Sep 17 00:00:00 2001 From: falkTX Date: Wed, 11 Feb 2015 12:00:24 +0000 Subject: [PATCH] Don't link the full plugin code in carla-utils; Misc plugin changes --- source/Makefile.mk | 7 +- source/backend/CarlaBackend.doxygen | 6 +- source/backend/CarlaUtils.cpp | 207 +---- source/backend/Makefile | 8 - source/backend/plugin/CarlaPluginNative.cpp | 66 +- source/bridges-plugin/Makefile | 6 +- source/includes/CarlaNative.h | 5 +- source/native-plugins/Makefile | 29 +- source/native-plugins/_all.c | 27 +- source/native-plugins/_data.cpp | 768 ++++++++++++++++++ source/native-plugins/audio-file.cpp | 3 +- source/native-plugins/distrho-3bandeq.cpp | 5 +- .../native-plugins/distrho-3bandsplitter.cpp | 5 +- source/native-plugins/distrho-mverb.cpp | 5 +- source/native-plugins/distrho-nekobi.cpp | 12 +- source/native-plugins/distrho-pingpongpan.cpp | 5 +- source/native-plugins/distrho-prom.cpp | 5 +- source/native-plugins/notes.cpp | 3 +- source/native-plugins/zynaddsubfx-fx.cpp | 24 +- source/native-plugins/zynaddsubfx-synth.cpp | 4 + source/plugin/carla-base.cpp | 4 +- source/tests/Print.cpp | 6 +- 22 files changed, 933 insertions(+), 277 deletions(-) create mode 100644 source/native-plugins/_data.cpp diff --git a/source/Makefile.mk b/source/Makefile.mk index 4983a254b..2cd49ac85 100644 --- a/source/Makefile.mk +++ b/source/Makefile.mk @@ -58,6 +58,7 @@ endif ifeq ($(MACOS_OR_WIN32),true) CARLA_VESTIGE_HEADER = false +EXPERIMENTAL_PLUGINS = false endif # -------------------------------------------------------------- @@ -384,16 +385,16 @@ endif endif ifeq ($(EXPERIMENTAL_PLUGINS),true) -NATIVE_PLUGINS_FLAGS += -DHAVE_EXPERIMENTAL_PLUGINS +BASE_FLAGS += -DHAVE_EXPERIMENTAL_PLUGINS NATIVE_PLUGINS_LIBS += -lclxclient -lclthreads -lzita-convolver -lzita-resampler NATIVE_PLUGINS_LIBS += $(shell pkg-config --libs cairo fftw3f libpng12 x11 xft) endif ifeq ($(HAVE_ZYN_DEPS),true) -NATIVE_PLUGINS_FLAGS += -DHAVE_ZYN_DEPS +BASE_FLAGS += -DHAVE_ZYN_DEPS NATIVE_PLUGINS_LIBS += $(shell pkg-config --libs fftw3 mxml zlib) ifeq ($(HAVE_ZYN_UI_DEPS),true) -NATIVE_PLUGINS_FLAGS += -DHAVE_ZYN_UI_DEPS +BASE_FLAGS += -DHAVE_ZYN_UI_DEPS NATIVE_PLUGINS_LIBS += $(shell pkg-config --libs ntk_images ntk) endif endif diff --git a/source/backend/CarlaBackend.doxygen b/source/backend/CarlaBackend.doxygen index 25a0a035f..94dc467fc 100644 --- a/source/backend/CarlaBackend.doxygen +++ b/source/backend/CarlaBackend.doxygen @@ -242,9 +242,9 @@ SEARCH_INCLUDES = YES INCLUDE_PATH = INCLUDE_FILE_PATTERNS = PREDEFINED = DOXYGEN \ - WANT_NATIVE WANT_LADSPA WANT_DSSI WANT_LV2 WANT_VST WANT_AU WANT_CSDOUND WANT_FLUIDSYNTH WANT_LINUXSAMPLER \ - WANT_OPENGL WANT_AUDIOFILE WANT_MIDIFILE WANT_ZYNADDSUBFX WANT_ZYNADDSUBFX_UI \ - CARLA_EXPORT SIZE_INT32 + BUILDING_CARLA REAL_BUILD \ + HAVE_DGL HAVE_LIBLO HAVE_LIBMAGIC HAVE_FLUIDSYNTH HAVE_LINUXSAMPLER HAVE_PROJECTM HAVE_X11 \ + HAVE_EXPERIMENTAL_PLUGINS HAVE_ZYN_DEPS HAVE_ZYN_UI_DEPS EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- diff --git a/source/backend/CarlaUtils.cpp b/source/backend/CarlaUtils.cpp index 979b3a6c2..b906baa31 100644 --- a/source/backend/CarlaUtils.cpp +++ b/source/backend/CarlaUtils.cpp @@ -31,6 +31,8 @@ # include "juce_audio_processors.h" #endif +#include "../native-plugins/_data.cpp" + namespace CB = CarlaBackend; static const char* const gNullCharPtr = ""; @@ -57,167 +59,6 @@ _CarlaCachedPluginInfo::_CarlaCachedPluginInfo() noexcept // ------------------------------------------------------------------------------------------------------------------- -static const NativePluginDescriptor carlaRackDesc = { - /* category */ NATIVE_PLUGIN_CATEGORY_OTHER, - /* hints */ static_cast(NATIVE_PLUGIN_IS_SYNTH - |NATIVE_PLUGIN_HAS_UI - |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS - |NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD - |NATIVE_PLUGIN_USES_STATE - |NATIVE_PLUGIN_USES_TIME), - /* supports */ static_cast(NATIVE_PLUGIN_SUPPORTS_EVERYTHING), - /* audioIns */ 2, - /* audioOuts */ 2, - /* midiIns */ 1, - /* midiOuts */ 1, - /* paramIns */ 0, - /* paramOuts */ 0, - /* name */ "Carla-Rack", - /* label */ "carlarack", - /* maker */ "falkTX", - /* copyright */ "GNU GPL v2+", - nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, - nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, - nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, - nullptr, nullptr, nullptr, nullptr -}; - -static const NativePluginDescriptor carlaPatchbayDesc = { - /* category */ NATIVE_PLUGIN_CATEGORY_OTHER, - /* hints */ static_cast(NATIVE_PLUGIN_IS_SYNTH - |NATIVE_PLUGIN_HAS_UI - |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS - |NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD - |NATIVE_PLUGIN_USES_STATE - |NATIVE_PLUGIN_USES_TIME), - /* supports */ static_cast(NATIVE_PLUGIN_SUPPORTS_EVERYTHING), - /* audioIns */ 2, - /* audioOuts */ 2, - /* midiIns */ 1, - /* midiOuts */ 1, - /* paramIns */ 0, - /* paramOuts */ 0, - /* name */ "Carla-Patchbay", - /* label */ "carlapatchbay", - /* maker */ "falkTX", - /* copyright */ "GNU GPL v2+", - nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, - nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, - nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, - nullptr, nullptr, nullptr, nullptr -}; - -static const NativePluginDescriptor carlaPatchbay3sDesc = { - /* category */ NATIVE_PLUGIN_CATEGORY_OTHER, - /* hints */ static_cast(NATIVE_PLUGIN_IS_SYNTH - |NATIVE_PLUGIN_HAS_UI - |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS - |NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD - |NATIVE_PLUGIN_USES_STATE - |NATIVE_PLUGIN_USES_TIME), - /* supports */ static_cast(NATIVE_PLUGIN_SUPPORTS_EVERYTHING), - /* audioIns */ 3, - /* audioOuts */ 2, - /* midiIns */ 1, - /* midiOuts */ 1, - /* paramIns */ 0, - /* paramOuts */ 0, - /* name */ "Carla-Patchbay (sidechain)", - /* label */ "carlapatchbay3s", - /* maker */ "falkTX", - /* copyright */ "GNU GPL v2+", - nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, - nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, - nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, - nullptr, nullptr, nullptr, nullptr -}; - -static const NativePluginDescriptor carlaPatchbay16Desc = { - /* category */ NATIVE_PLUGIN_CATEGORY_OTHER, - /* hints */ static_cast(NATIVE_PLUGIN_IS_SYNTH - |NATIVE_PLUGIN_HAS_UI - |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS - |NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD - |NATIVE_PLUGIN_USES_STATE - |NATIVE_PLUGIN_USES_TIME), - /* supports */ static_cast(NATIVE_PLUGIN_SUPPORTS_EVERYTHING), - /* audioIns */ 16, - /* audioOuts */ 16, - /* midiIns */ 1, - /* midiOuts */ 1, - /* paramIns */ 0, - /* paramOuts */ 0, - /* name */ "Carla-Patchbay (16chan)", - /* label */ "carlapatchbay16", - /* maker */ "falkTX", - /* copyright */ "GNU GPL v2+", - nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, - nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, - nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, - nullptr, nullptr, nullptr, nullptr -}; - -static const NativePluginDescriptor carlaPatchbay32Desc = { - /* category */ NATIVE_PLUGIN_CATEGORY_OTHER, - /* hints */ static_cast(NATIVE_PLUGIN_IS_SYNTH - |NATIVE_PLUGIN_HAS_UI - |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS - |NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD - |NATIVE_PLUGIN_USES_STATE - |NATIVE_PLUGIN_USES_TIME), - /* supports */ static_cast(NATIVE_PLUGIN_SUPPORTS_EVERYTHING), - /* audioIns */ 32, - /* audioOuts */ 32, - /* midiIns */ 1, - /* midiOuts */ 1, - /* paramIns */ 0, - /* paramOuts */ 0, - /* name */ "Carla-Patchbay (32chan)", - /* label */ "carlapatchbay32", - /* maker */ "falkTX", - /* copyright */ "GNU GPL v2+", - nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, - nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, - nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, - nullptr, nullptr, nullptr, nullptr -}; - -static LinkedList gPluginDescriptors; - -static const -struct ScopedInitializer { - ScopedInitializer() - { - carla_register_all_plugins(); - } - - ~ScopedInitializer() - { - gPluginDescriptors.clear(); - } -} _si; - -// ------------------------------------------------------------------------------------------------------------------- - -CARLA_EXTERN_C -void carla_register_native_plugin_carla(); - -void carla_register_native_plugin_carla() -{ - gPluginDescriptors.append(&carlaRackDesc); - gPluginDescriptors.append(&carlaPatchbayDesc); - gPluginDescriptors.append(&carlaPatchbay3sDesc); - gPluginDescriptors.append(&carlaPatchbay16Desc); - gPluginDescriptors.append(&carlaPatchbay32Desc); -} - -void carla_register_native_plugin(const NativePluginDescriptor* desc) -{ - gPluginDescriptors.append(desc); -} - -// ------------------------------------------------------------------------------------------------------------------- - const char* carla_get_complete_license_text() { carla_debug("carla_get_complete_license_text()"); @@ -375,7 +216,9 @@ uint carla_get_cached_plugin_count(CB::PluginType ptype, const char* pluginPath) switch (ptype) { case CB::PLUGIN_INTERNAL: { - return static_cast(gPluginDescriptors.count()); + uint32_t count = 0; + carla_get_native_plugins_data(&count); + return count; } case CB::PLUGIN_LV2: { @@ -417,33 +260,37 @@ const CarlaCachedPluginInfo* carla_get_cached_plugin_info(CB::PluginType ptype, switch (ptype) { case CB::PLUGIN_INTERNAL: { - const NativePluginDescriptor* const desc(gPluginDescriptors.getAt(index, nullptr)); - CARLA_SAFE_ASSERT_BREAK(desc != nullptr); + uint32_t count = 0; + const NativePluginDescriptor* const descs(carla_get_native_plugins_data(&count)); + CARLA_SAFE_ASSERT_BREAK(index < count); + CARLA_SAFE_ASSERT_BREAK(descs != nullptr); + + const NativePluginDescriptor& desc(descs[index]); - info.category = static_cast(desc->category); + info.category = static_cast(desc.category); info.hints = 0x0; - if (desc->hints & NATIVE_PLUGIN_IS_RTSAFE) + if (desc.hints & NATIVE_PLUGIN_IS_RTSAFE) info.hints |= CB::PLUGIN_IS_RTSAFE; - if (desc->hints & NATIVE_PLUGIN_IS_SYNTH) + if (desc.hints & NATIVE_PLUGIN_IS_SYNTH) info.hints |= CB::PLUGIN_IS_SYNTH; - if (desc->hints & NATIVE_PLUGIN_HAS_UI) + if (desc.hints & NATIVE_PLUGIN_HAS_UI) info.hints |= CB::PLUGIN_HAS_CUSTOM_UI; - if (desc->hints & NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS) + if (desc.hints & NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS) info.hints |= CB::PLUGIN_NEEDS_FIXED_BUFFERS; - if (desc->hints & NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD) + if (desc.hints & NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD) info.hints |= CB::PLUGIN_NEEDS_UI_MAIN_THREAD; - info.audioIns = desc->audioIns; - info.audioOuts = desc->audioOuts; - info.midiIns = desc->midiIns; - info.midiOuts = desc->midiOuts; - info.parameterIns = desc->paramIns; - info.parameterOuts = desc->paramOuts; - info.name = desc->name; - info.label = desc->label; - info.maker = desc->maker; - info.copyright = desc->copyright; + info.audioIns = desc.audioIns; + info.audioOuts = desc.audioOuts; + info.midiIns = desc.midiIns; + info.midiOuts = desc.midiOuts; + info.parameterIns = desc.paramIns; + info.parameterOuts = desc.paramOuts; + info.name = desc.name; + info.label = desc.label; + info.maker = desc.maker; + info.copyright = desc.copyright; return &info; } diff --git a/source/backend/Makefile b/source/backend/Makefile index e49fb9e97..33c3ed005 100644 --- a/source/backend/Makefile +++ b/source/backend/Makefile @@ -56,12 +56,6 @@ UTILS_LIBS = $(MODULEDIR)/juce_audio_basics.a UTILS_LIBS += $(MODULEDIR)/juce_audio_formats.a UTILS_LIBS += $(MODULEDIR)/juce_core.a UTILS_LIBS += $(MODULEDIR)/lilv.a -UTILS_LIBS += $(MODULEDIR)/native-plugins.a -UTILS_LIBS += $(MODULEDIR)/rtmempool.a - -ifeq ($(HAVE_DGL),true) -UTILS_LIBS += $(MODULEDIR)/dgl.a -endif # ---------------------------------------------------------------------------------------------------------------------------- @@ -112,8 +106,6 @@ UTILS_LINK_FLAGS = $(JUCE_AUDIO_BASICS_LIBS) UTILS_LINK_FLAGS += $(JUCE_AUDIO_FORMATS_LIBS) UTILS_LINK_FLAGS += $(JUCE_CORE_LIBS) UTILS_LINK_FLAGS += $(LILV_LIBS) -UTILS_LINK_FLAGS += $(NATIVE_PLUGINS_LIBS) -UTILS_LINK_FLAGS += $(RTMEMPOOL_LIBS) ifneq ($(HAIKU),true) UTILS_LINK_FLAGS += -lpthread diff --git a/source/backend/plugin/CarlaPluginNative.cpp b/source/backend/plugin/CarlaPluginNative.cpp index a73eca54a..048353f7a 100644 --- a/source/backend/plugin/CarlaPluginNative.cpp +++ b/source/backend/plugin/CarlaPluginNative.cpp @@ -26,13 +26,11 @@ using juce::String; using juce::StringArray; -// ----------------------------------------------------------------------- - CARLA_EXTERN_C -std::size_t carla_getNativePluginCount(); +std::size_t carla_getNativePluginCount() noexcept; CARLA_EXTERN_C -const NativePluginDescriptor* carla_getNativePluginDescriptor(const std::size_t index); +const NativePluginDescriptor* carla_getNativePluginDescriptor(const std::size_t index) noexcept; // ----------------------------------------------------------------------- @@ -43,21 +41,56 @@ void carla_register_native_plugin(const NativePluginDescriptor* desc) gPluginDescriptors.append(desc); } -std::size_t carla_getNativePluginCount() +// ----------------------------------------------------------------------- + +static +class NativePluginInitializer +{ +public: + NativePluginInitializer() noexcept + : fNeedsInit(true) {} + + ~NativePluginInitializer() noexcept + { + gPluginDescriptors.clear(); + } + + void initIfNeeded() noexcept + { + if (! fNeedsInit) + return; + + fNeedsInit = false; + + try { + carla_register_all_native_plugins(); + } CARLA_SAFE_EXCEPTION("carla_register_all_native_plugins") + } + +private: + bool fNeedsInit; + +} sPluginInitializer; + +// ----------------------------------------------------------------------- + +std::size_t carla_getNativePluginCount() noexcept { + sPluginInitializer.initIfNeeded(); return gPluginDescriptors.count(); } -const NativePluginDescriptor* carla_getNativePluginDescriptor(const std::size_t index) +const NativePluginDescriptor* carla_getNativePluginDescriptor(const std::size_t index) noexcept { + sPluginInitializer.initIfNeeded(); return gPluginDescriptors.getAt(index, nullptr); } -// ----------------------------------------------------- +// ----------------------------------------------------------------------- CARLA_BACKEND_START_NAMESPACE -// ----------------------------------------------------- +// ----------------------------------------------------------------------- struct NativePluginMidiData { uint32_t count; @@ -134,21 +167,6 @@ struct NativePluginMidiData { // ----------------------------------------------------- -static const -struct ScopedInitializer { - ScopedInitializer() - { - carla_register_all_plugins(); - } - - ~ScopedInitializer() noexcept - { - gPluginDescriptors.clear(); - } -} _si; - -// ----------------------------------------------------- - class CarlaPluginNative : public CarlaPlugin { public: @@ -2250,6 +2268,8 @@ public: // --------------------------------------------------------------- // get descriptor that matches label + sPluginInitializer.initIfNeeded(); + for (LinkedList::Itenerator it = gPluginDescriptors.begin(); it.valid(); it.next()) { fDescriptor = it.getValue(); diff --git a/source/bridges-plugin/Makefile b/source/bridges-plugin/Makefile index 4f1a78e64..06a54f20c 100644 --- a/source/bridges-plugin/Makefile +++ b/source/bridges-plugin/Makefile @@ -213,7 +213,11 @@ all: native # ---------------------------------------------------------------------------------------------------------------------------- clean: - rm -f $(OBJDIR)/*.o $(BINDIR)/$(MODULENAME)-* + rm -f $(OBJDIR)/*.o + rm -f $(BINDIR)/$(MODULENAME)-native + rm -f $(BINDIR)/$(MODULENAME)-posix32 + rm -f $(BINDIR)/$(MODULENAME)-posix64 + rm -f $(BINDIR)/$(MODULENAME)-win*.exe debug: $(MAKE) DEBUG=true diff --git a/source/includes/CarlaNative.h b/source/includes/CarlaNative.h index 518fea743..fc95281dc 100644 --- a/source/includes/CarlaNative.h +++ b/source/includes/CarlaNative.h @@ -258,7 +258,10 @@ typedef struct _NativePluginDescriptor { extern void carla_register_native_plugin(const NativePluginDescriptor* desc); /** Called once on host init */ -void carla_register_all_plugins(void); +void carla_register_all_native_plugins(void); + +/** Get meta-data only */ +const NativePluginDescriptor* carla_get_native_plugins_data(uint32_t* count); /* ------------------------------------------------------------------------------------------------------------ */ diff --git a/source/native-plugins/Makefile b/source/native-plugins/Makefile index 03d5f5350..8cca3ba2b 100644 --- a/source/native-plugins/Makefile +++ b/source/native-plugins/Makefile @@ -13,28 +13,6 @@ include ../modules/Makefile.mk BUILD_C_FLAGS += -I.. BUILD_CXX_FLAGS += -I.. -isystem $(CWD)/modules -I$(CWD)/modules/distrho -# ---------------------------------------------------------------------------------------------------------------------------- -# Flags for _all.c - -ALL_C_FLAGS = $(BUILD_C_FLAGS) - -# DISTRHO ProM -ifeq ($(HAVE_DGL),true) -ifeq ($(HAVE_PROJECTM),true) -ALL_C_FLAGS += -DWANT_DISTRHO_PROM -endif -endif - -# ZynAddSubFX -ifeq ($(HAVE_ZYN_DEPS),true) -ALL_C_FLAGS += -DWANT_ZYNADDSUBFX -endif - -# Experimental plugins -ifeq ($(EXPERIMENTAL_PLUGINS),true) -ALL_C_FLAGS += -DWANT_EXPERIMENTAL_PLUGINS -endif - # ---------------------------------------------------------------------------------------------------------------------------- # Flags for ZynAddSubFX @@ -45,7 +23,7 @@ ifneq ($(MACOS),true) ZYN_CXX_FLAGS += -DHAVE_SCHEDULER endif ifeq ($(HAVE_ZYN_UI_DEPS),true) -ZYN_CXX_FLAGS += -DNTK_GUI -DWANT_ZYNADDSUBFX_UI +ZYN_CXX_FLAGS += -DNTK_GUI ZYN_CXX_FLAGS += $(shell pkg-config --cflags ntk_images ntk) endif endif @@ -54,7 +32,8 @@ endif # Set objects OBJS = \ - $(OBJDIR)/_all.c.o + $(OBJDIR)/_all.c.o \ + $(OBJDIR)/_data.cpp.o # ---------------------------------------------------------------------------------------------------------------------------- # Simple plugins @@ -187,7 +166,7 @@ zynaddsubfx/UI/%.h: zynaddsubfx/UI/%.fl $(OBJDIR)/_all.c.o: _all.c -@mkdir -p $(OBJDIR) @echo "Compiling $<" - @$(CC) $< $(ALL_C_FLAGS) -c -o $@ + @$(CC) $< $(BUILD_C_FLAGS) -c -o $@ $(OBJDIR)/%.c.o: %.c -@mkdir -p $(OBJDIR) diff --git a/source/native-plugins/_all.c b/source/native-plugins/_all.c index b441ed3a0..73892f26b 100644 --- a/source/native-plugins/_all.c +++ b/source/native-plugins/_all.c @@ -1,6 +1,6 @@ /* * Carla Native Plugins - * Copyright (C) 2012-2014 Filipe Coelho + * Copyright (C) 2012-2015 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 @@ -15,6 +15,7 @@ * For a full copy of the GNU General Public License see the doc/GPL.txt file. */ +#include "CarlaDefines.h" #include "CarlaNative.h" // ----------------------------------------------------------------------- @@ -44,31 +45,24 @@ extern void carla_register_native_plugin_distrho_3bandsplitter(void); extern void carla_register_native_plugin_distrho_mverb(void); extern void carla_register_native_plugin_distrho_nekobi(void); extern void carla_register_native_plugin_distrho_pingpongpan(void); - -#ifdef WANT_DISTRHO_PROM extern void carla_register_native_plugin_distrho_prom(void); -#endif // External-UI plugins extern void carla_register_native_plugin_bigmeter(void); extern void carla_register_native_plugin_notes(void); -#ifdef WANT_ZYNADDSUBFX // ZynAddSubFX extern void carla_register_native_plugin_zynaddsubfx_fx(void); extern void carla_register_native_plugin_zynaddsubfx_synth(void); -#endif -#ifdef WANT_EXPERIMENTAL_PLUGINS // Experimental plugins extern void carla_register_native_plugin_zita_at1(void); extern void carla_register_native_plugin_zita_bls1(void); extern void carla_register_native_plugin_zita_rev1(void); -#endif // ----------------------------------------------------------------------- -void carla_register_all_plugins(void) +void carla_register_all_native_plugins(void) { // Simple plugins carla_register_native_plugin_bypass(); @@ -84,10 +78,14 @@ void carla_register_all_plugins(void) // MIDI file and sequencer carla_register_native_plugin_midifile(); +#ifndef CARLA_OS_WIN carla_register_native_plugin_midisequencer(); +#endif +#ifndef CARLA_OS_WIN // Carla carla_register_native_plugin_carla(); +#endif // DISTRHO Plugins carla_register_native_plugin_distrho_3bandeq(); @@ -95,22 +93,25 @@ void carla_register_all_plugins(void) carla_register_native_plugin_distrho_mverb(); carla_register_native_plugin_distrho_nekobi(); carla_register_native_plugin_distrho_pingpongpan(); - -#ifdef WANT_DISTRHO_PROM +#ifdef HAVE_DGL +#ifdef HAVE_PROJECTM carla_register_native_plugin_distrho_prom(); #endif +#endif +#ifndef CARLA_OS_WIN // External-UI plugins carla_register_native_plugin_bigmeter(); carla_register_native_plugin_notes(); +#endif -#ifdef WANT_ZYNADDSUBFX +#ifdef HAVE_ZYN_DEPS // ZynAddSubFX carla_register_native_plugin_zynaddsubfx_fx(); carla_register_native_plugin_zynaddsubfx_synth(); #endif -#ifdef WANT_EXPERIMENTAL_PLUGINS +#ifdef HAVE_EXPERIMENTAL_PLUGINS // Experimental plugins carla_register_native_plugin_zita_at1(); carla_register_native_plugin_zita_bls1(); diff --git a/source/native-plugins/_data.cpp b/source/native-plugins/_data.cpp new file mode 100644 index 000000000..e540624fd --- /dev/null +++ b/source/native-plugins/_data.cpp @@ -0,0 +1,768 @@ +/* + * Carla Native Plugins + * Copyright (C) 2012-2015 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 + * published by the Free Software Foundation; either version 2 of + * the License, or any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * For a full copy of the GNU General Public License see the doc/GPL.txt file. + */ + +#include "CarlaNative.h" +#include "CarlaUtils.hpp" + +#undef DESCFUNCS +#define DESCFUNCS \ + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, \ + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, \ + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, \ + nullptr, nullptr, nullptr, nullptr + +static const NativePluginDescriptor sNativePluginDescriptors[] = { + +// ----------------------------------------------------------------------- +// Simple plugins + +{ + /* category */ NATIVE_PLUGIN_CATEGORY_NONE, + /* hints */ NATIVE_PLUGIN_IS_RTSAFE, + /* supports */ static_cast(0x0), + /* audioIns */ 1, + /* audioOuts */ 1, + /* midiIns */ 0, + /* midiOuts */ 0, + /* paramIns */ 0, + /* paramOuts */ 0, + /* name */ "Bypass", + /* label */ "bypass", + /* maker */ "falkTX", + /* copyright */ "GNU GPL v2+", + DESCFUNCS +}, +{ + /* category */ NATIVE_PLUGIN_CATEGORY_UTILITY, + /* hints */ NATIVE_PLUGIN_IS_RTSAFE, + /* supports */ static_cast(0x0), + /* audioIns */ 0, + /* audioOuts */ 0, + /* midiIns */ 0, + /* midiOuts */ 0, + /* paramIns */ 5-1, + /* paramOuts */ 1, + /* name */ "LFO", + /* label */ "lfo", + /* maker */ "falkTX", + /* copyright */ "GNU GPL v2+", + DESCFUNCS +}, +{ + /* category */ NATIVE_PLUGIN_CATEGORY_UTILITY, + /* hints */ NATIVE_PLUGIN_IS_RTSAFE, + /* supports */ NATIVE_PLUGIN_SUPPORTS_EVERYTHING, + /* audioIns */ 0, + /* audioOuts */ 0, + /* midiIns */ 1, + /* midiOuts */ 1, + /* paramIns */ 0, + /* paramOuts */ 0, + /* name */ "MIDI Gain", + /* label */ "midigain", + /* maker */ "falkTX", + /* copyright */ "GNU GPL v2+", + DESCFUNCS +}, +{ + /* category */ NATIVE_PLUGIN_CATEGORY_UTILITY, + /* hints */ NATIVE_PLUGIN_IS_RTSAFE, + /* supports */ NATIVE_PLUGIN_SUPPORTS_EVERYTHING, + /* audioIns */ 0, + /* audioOuts */ 0, + /* midiIns */ 1, + /* midiOuts */ 16, + /* paramIns */ 0, + /* paramOuts */ 0, + /* name */ "MIDI Split", + /* label */ "midisplit", + /* maker */ "falkTX", + /* copyright */ "GNU GPL v2+", + DESCFUNCS +}, +{ + /* category */ NATIVE_PLUGIN_CATEGORY_UTILITY, + /* hints */ NATIVE_PLUGIN_IS_RTSAFE, + /* supports */ NATIVE_PLUGIN_SUPPORTS_EVERYTHING, + /* audioIns */ 0, + /* audioOuts */ 0, + /* midiIns */ 1, + /* midiOuts */ 1, + /* paramIns */ 0, + /* paramOuts */ 0, + /* name */ "MIDI Through", + /* label */ "midithrough", + /* maker */ "falkTX", + /* copyright */ "GNU GPL v2+", + DESCFUNCS +}, +{ + /* category */ NATIVE_PLUGIN_CATEGORY_UTILITY, + /* hints */ NATIVE_PLUGIN_IS_RTSAFE, + /* supports */ NATIVE_PLUGIN_SUPPORTS_EVERYTHING, + /* audioIns */ 0, + /* audioOuts */ 0, + /* midiIns */ 1, + /* midiOuts */ 1, + /* paramIns */ 1, + /* paramOuts */ 0, + /* name */ "MIDI Transpose", + /* label */ "miditranspose", + /* maker */ "falkTX", + /* copyright */ "GNU GPL v2+", + DESCFUNCS +}, +{ + /* category */ NATIVE_PLUGIN_CATEGORY_FILTER, +#if defined(__linux__) || defined(__linux) + /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE + |NATIVE_PLUGIN_HAS_UI), +#else + /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE), +#endif + /* supports */ static_cast(0x0), + /* audioIns */ 1, + /* audioOuts */ 1, + /* midiIns */ 0, + /* midiOuts */ 0, + /* paramIns */ 2 + 4*4, + /* paramOuts */ 0, + /* name */ "NekoFilter", + /* label */ "nekofilter", + /* maker */ "falkTX, Nedko, Fons Adriaensen", + /* copyright */ "GNU GPL v2+", + DESCFUNCS +}, + + +// ----------------------------------------------------------------------- +// Audio file + +{ + /* category */ NATIVE_PLUGIN_CATEGORY_UTILITY, + /* hints */ static_cast(NATIVE_PLUGIN_HAS_UI + |NATIVE_PLUGIN_NEEDS_UI_OPEN_SAVE), + /* supports */ static_cast(0x0), + /* audioIns */ 0, + /* audioOuts */ 2, + /* midiIns */ 0, + /* midiOuts */ 0, + /* paramIns */ 1, + /* paramOuts */ 0, + /* name */ "Audio File", + /* label */ "audiofile", + /* maker */ "falkTX", + /* copyright */ "GNU GPL v2+", + DESCFUNCS +}, + +// ----------------------------------------------------------------------- +// MIDI file and sequencer + +{ + /* category */ NATIVE_PLUGIN_CATEGORY_UTILITY, + /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE + |NATIVE_PLUGIN_HAS_UI + |NATIVE_PLUGIN_NEEDS_UI_OPEN_SAVE + |NATIVE_PLUGIN_USES_STATE + |NATIVE_PLUGIN_USES_TIME), + /* supports */ static_cast(0x0), + /* audioIns */ 0, + /* audioOuts */ 0, + /* midiIns */ 0, + /* midiOuts */ 1, + /* paramIns */ 0, + /* paramOuts */ 0, + /* name */ "MIDI File", + /* label */ "midifile", + /* maker */ "falkTX", + /* copyright */ "GNU GPL v2+", + DESCFUNCS +}, +#ifndef CARLA_OS_WIN +{ + /* category */ NATIVE_PLUGIN_CATEGORY_UTILITY, + /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE + |NATIVE_PLUGIN_HAS_UI + |NATIVE_PLUGIN_USES_STATE + |NATIVE_PLUGIN_USES_TIME), + /* supports */ NATIVE_PLUGIN_SUPPORTS_EVERYTHING, + /* audioIns */ 0, + /* audioOuts */ 0, + /* midiIns */ 1, + /* midiOuts */ 1, + /* paramIns */ 0, + /* paramOuts */ 0, + /* name */ "MIDI Sequencer", + /* label */ "midisequencer", + /* maker */ "falkTX, tatch", + /* copyright */ "GNU GPL v2+", + DESCFUNCS +}, +#endif + +// ----------------------------------------------------------------------- +// Carla + +#ifndef CARLA_OS_WIN +{ + /* category */ NATIVE_PLUGIN_CATEGORY_OTHER, + /* hints */ static_cast(NATIVE_PLUGIN_IS_SYNTH + |NATIVE_PLUGIN_HAS_UI + |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS + |NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD + |NATIVE_PLUGIN_USES_STATE + |NATIVE_PLUGIN_USES_TIME), + /* supports */ static_cast(NATIVE_PLUGIN_SUPPORTS_EVERYTHING), + /* audioIns */ 2, + /* audioOuts */ 2, + /* midiIns */ 1, + /* midiOuts */ 1, + /* paramIns */ 0, + /* paramOuts */ 0, + /* name */ "Carla-Rack", + /* label */ "carlarack", + /* maker */ "falkTX", + /* copyright */ "GNU GPL v2+", + DESCFUNCS +}, +{ + /* category */ NATIVE_PLUGIN_CATEGORY_OTHER, + /* hints */ static_cast(NATIVE_PLUGIN_IS_SYNTH + |NATIVE_PLUGIN_HAS_UI + |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS + |NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD + |NATIVE_PLUGIN_USES_STATE + |NATIVE_PLUGIN_USES_TIME), + /* supports */ static_cast(NATIVE_PLUGIN_SUPPORTS_EVERYTHING), + /* audioIns */ 2, + /* audioOuts */ 2, + /* midiIns */ 1, + /* midiOuts */ 1, + /* paramIns */ 0, + /* paramOuts */ 0, + /* name */ "Carla-Patchbay", + /* label */ "carlapatchbay", + /* maker */ "falkTX", + /* copyright */ "GNU GPL v2+", + DESCFUNCS +}, +{ + /* category */ NATIVE_PLUGIN_CATEGORY_OTHER, + /* hints */ static_cast(NATIVE_PLUGIN_IS_SYNTH + |NATIVE_PLUGIN_HAS_UI + |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS + |NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD + |NATIVE_PLUGIN_USES_STATE + |NATIVE_PLUGIN_USES_TIME), + /* supports */ static_cast(NATIVE_PLUGIN_SUPPORTS_EVERYTHING), + /* audioIns */ 3, + /* audioOuts */ 2, + /* midiIns */ 1, + /* midiOuts */ 1, + /* paramIns */ 0, + /* paramOuts */ 0, + /* name */ "Carla-Patchbay (sidechain)", + /* label */ "carlapatchbay3s", + /* maker */ "falkTX", + /* copyright */ "GNU GPL v2+", + DESCFUNCS +}, +{ + /* category */ NATIVE_PLUGIN_CATEGORY_OTHER, + /* hints */ static_cast(NATIVE_PLUGIN_IS_SYNTH + |NATIVE_PLUGIN_HAS_UI + |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS + |NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD + |NATIVE_PLUGIN_USES_STATE + |NATIVE_PLUGIN_USES_TIME), + /* supports */ static_cast(NATIVE_PLUGIN_SUPPORTS_EVERYTHING), + /* audioIns */ 16, + /* audioOuts */ 16, + /* midiIns */ 1, + /* midiOuts */ 1, + /* paramIns */ 0, + /* paramOuts */ 0, + /* name */ "Carla-Patchbay (16chan)", + /* label */ "carlapatchbay16", + /* maker */ "falkTX", + /* copyright */ "GNU GPL v2+", + DESCFUNCS +}, +{ + /* category */ NATIVE_PLUGIN_CATEGORY_OTHER, + /* hints */ static_cast(NATIVE_PLUGIN_IS_SYNTH + |NATIVE_PLUGIN_HAS_UI + |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS + |NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD + |NATIVE_PLUGIN_USES_STATE + |NATIVE_PLUGIN_USES_TIME), + /* supports */ static_cast(NATIVE_PLUGIN_SUPPORTS_EVERYTHING), + /* audioIns */ 32, + /* audioOuts */ 32, + /* midiIns */ 1, + /* midiOuts */ 1, + /* paramIns */ 0, + /* paramOuts */ 0, + /* name */ "Carla-Patchbay (32chan)", + /* label */ "carlapatchbay32", + /* maker */ "falkTX", + /* copyright */ "GNU GPL v2+", + DESCFUNCS +}, +#endif // CARLA_OS_WIN + +// ----------------------------------------------------------------------- +// DISTRHO Plugins + +{ + /* category */ NATIVE_PLUGIN_CATEGORY_EQ, +#ifdef HAVE_DGL + /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE + |NATIVE_PLUGIN_HAS_UI + |NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD + |NATIVE_PLUGIN_USES_PARENT_ID), +#else + /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE), +#endif + /* supports */ static_cast(0x0), + /* audioIns */ 2, + /* audioOuts */ 2, + /* midiIns */ 0, + /* midiOuts */ 0, + /* paramIns */ 6, + /* paramOuts */ 0, + /* name */ "3 Band EQ", + /* label */ "3bandeq", + /* maker */ "falkTX, Michael Gruhn", + /* copyright */ "LGPL", + DESCFUNCS +}, +{ + /* category */ NATIVE_PLUGIN_CATEGORY_EQ, +#ifdef HAVE_DGL + /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE + |NATIVE_PLUGIN_HAS_UI + |NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD + |NATIVE_PLUGIN_USES_PARENT_ID), +#else + /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE), +#endif + /* supports */ static_cast(0x0), + /* audioIns */ 2, + /* audioOuts */ 6, + /* midiIns */ 0, + /* midiOuts */ 0, + /* paramIns */ 6, + /* paramOuts */ 0, + /* name */ "3 Band Splitter", + /* label */ "3bandsplitter", + /* maker */ "falkTX, Michael Gruhn", + /* copyright */ "LGPL", + DESCFUNCS +}, +{ + /* category */ NATIVE_PLUGIN_CATEGORY_DELAY, +#ifdef HAVE_DGL + /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE + |NATIVE_PLUGIN_HAS_UI + |NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD + |NATIVE_PLUGIN_USES_PARENT_ID), +#else + /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE), +#endif + /* supports */ static_cast(0x0), + /* audioIns */ 2, + /* audioOuts */ 2, + /* midiIns */ 0, + /* midiOuts */ 0, + /* paramIns */ 9, + /* paramOuts */ 0, + /* name */ "MVerb", + /* label */ "mverb", + /* maker */ "falkTX, Martin Eastwood", + /* copyright */ "GPL v3+", + DESCFUNCS +}, +{ + /* category */ NATIVE_PLUGIN_CATEGORY_SYNTH, +#ifdef HAVE_DGL + /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE + |NATIVE_PLUGIN_IS_SYNTH + |NATIVE_PLUGIN_HAS_UI + |NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD + |NATIVE_PLUGIN_USES_PARENT_ID), +#else + /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE + |NATIVE_PLUGIN_IS_SYNTH), +#endif + /* supports */ static_cast(NATIVE_PLUGIN_SUPPORTS_CONTROL_CHANGES + |NATIVE_PLUGIN_SUPPORTS_ALL_SOUND_OFF), + /* audioIns */ 0, + /* audioOuts */ 1, + /* midiIns */ 1, + /* midiOuts */ 0, + /* paramIns */ 8, + /* paramOuts */ 0, + /* name */ "Nekobi", + /* label */ "nekobi", + /* maker */ "falkTX, Sean Bolton and others", + /* copyright */ "GPL v2+", + DESCFUNCS +}, +{ + /* category */ NATIVE_PLUGIN_CATEGORY_UTILITY, +#ifdef HAVE_DGL + /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE + |NATIVE_PLUGIN_HAS_UI + |NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD + |NATIVE_PLUGIN_USES_PARENT_ID), +#else + /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE), +#endif + /* supports */ static_cast(0x0), + /* audioIns */ 2, + /* audioOuts */ 2, + /* midiIns */ 0, + /* midiOuts */ 0, + /* paramIns */ 2, + /* paramOuts */ 0, + /* name */ "Ping Pong Pan", + /* label */ "pingpongpan", + /* maker */ "falkTX, Michael Gruhn", + /* copyright */ "LGPL", + DESCFUNCS +}, +#ifdef HAVE_DGL +#ifdef HAVE_PROJECTM +{ + /* category */ NATIVE_PLUGIN_CATEGORY_UTILITY, + /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE + |NATIVE_PLUGIN_HAS_UI + |NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD + |NATIVE_PLUGIN_USES_PARENT_ID), + /* supports */ static_cast(0x0), + /* audioIns */ 1, + /* audioOuts */ 1, + /* midiIns */ 0, + /* midiOuts */ 0, + /* paramIns */ 0, + /* paramOuts */ 0, + /* name */ "ProM", + /* label */ "prom", + /* maker */ "falkTX", + /* copyright */ "LGPL", + DESCFUNCS +}, +#endif // HAVE_PROJECTM +#endif // HAVE_DGL + +// ----------------------------------------------------------------------- +// External-UI plugins + +#ifndef CARLA_OS_WIN +{ + /* category */ NATIVE_PLUGIN_CATEGORY_UTILITY, + /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE + |NATIVE_PLUGIN_HAS_UI + |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS), + /* supports */ static_cast(0x0), + /* audioIns */ 2, + /* audioOuts */ 0, + /* midiIns */ 0, + /* midiOuts */ 0, + /* paramIns */ 1, + /* paramOuts */ 2, + /* name */ "Big Meter", + /* label */ "bigmeter", + /* maker */ "falkTX", + /* copyright */ "GNU GPL v2+", + DESCFUNCS +}, +{ + /* category */ NATIVE_PLUGIN_CATEGORY_UTILITY, + /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE + |NATIVE_PLUGIN_HAS_UI), + /* supports */ static_cast(0x0), + /* audioIns */ 0, + /* audioOuts */ 0, + /* midiIns */ 0, + /* midiOuts */ 0, + /* paramIns */ 1, + /* paramOuts */ 0, + /* name */ "Notes", + /* label */ "notes", + /* maker */ "falkTX", + /* copyright */ "GNU GPL v2+", + DESCFUNCS +}, +#endif + +// ----------------------------------------------------------------------- +// ZynAddSubFX + +#ifdef HAVE_ZYN_DEPS +{ + /* category */ NATIVE_PLUGIN_CATEGORY_MODULATOR, + /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE + |NATIVE_PLUGIN_USES_PANNING + |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS), + /* supports */ static_cast(0x0), + /* audioIns */ 2, + /* audioOuts */ 2, + /* midiIns */ 0, + /* midiOuts */ 0, + /* paramIns */ 11-2, + /* paramOuts */ 0, + /* name */ "ZynAlienWah", + /* label */ "zynalienwah", + /* maker */ "falkTX, Mark McCurry, Nasca Octavian Paul", + /* copyright */ "GNU GPL v2+", + DESCFUNCS +}, +{ + /* category */ NATIVE_PLUGIN_CATEGORY_MODULATOR, + /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE + |NATIVE_PLUGIN_USES_PANNING + |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS), + /* supports */ static_cast(0x0), + /* audioIns */ 2, + /* audioOuts */ 2, + /* midiIns */ 0, + /* midiOuts */ 0, + /* paramIns */ 12-2, + /* paramOuts */ 0, + /* name */ "ZynChorus", + /* label */ "zynchorus", + /* maker */ "falkTX, Mark McCurry, Nasca Octavian Paul", + /* copyright */ "GNU GPL v2+", + DESCFUNCS +}, +{ + /* category */ NATIVE_PLUGIN_CATEGORY_MODULATOR, + /* hints */ static_cast(NATIVE_PLUGIN_USES_PANNING + |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS), + /* supports */ static_cast(0x0), + /* audioIns */ 2, + /* audioOuts */ 2, + /* midiIns */ 0, + /* midiOuts */ 0, + /* paramIns */ 11-2, + /* paramOuts */ 0, + /* name */ "ZynDistortion", + /* label */ "zyndistortion", + /* maker */ "falkTX, Mark McCurry, Nasca Octavian Paul", + /* copyright */ "GNU GPL v2+", + DESCFUNCS +}, +{ + /* category */ NATIVE_PLUGIN_CATEGORY_FILTER, + /* hints */ static_cast(NATIVE_PLUGIN_USES_PANNING + |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS), + /* supports */ static_cast(0x0), + /* audioIns */ 2, + /* audioOuts */ 2, + /* midiIns */ 0, + /* midiOuts */ 0, + /* paramIns */ 10-2, + /* paramOuts */ 0, + /* name */ "ZynDynamicFilter", + /* label */ "zyndynamicfilter", + /* maker */ "falkTX, Mark McCurry, Nasca Octavian Paul", + /* copyright */ "GNU GPL v2+", + DESCFUNCS +}, +{ + /* category */ NATIVE_PLUGIN_CATEGORY_DELAY, + /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE + |NATIVE_PLUGIN_USES_PANNING + |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS), + /* supports */ static_cast(0x0), + /* audioIns */ 2, + /* audioOuts */ 2, + /* midiIns */ 0, + /* midiOuts */ 0, + /* paramIns */ 7-2, + /* paramOuts */ 0, + /* name */ "ZynEcho", + /* label */ "zynecho", + /* maker */ "falkTX, Mark McCurry, Nasca Octavian Paul", + /* copyright */ "GNU GPL v2+", + DESCFUNCS +}, +{ + /* category */ NATIVE_PLUGIN_CATEGORY_MODULATOR, + /* hints */ static_cast(NATIVE_PLUGIN_USES_PANNING + |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS), + /* supports */ static_cast(0x0), + /* audioIns */ 2, + /* audioOuts */ 2, + /* midiIns */ 0, + /* midiOuts */ 0, + /* paramIns */ 15-2, + /* paramOuts */ 0, + /* name */ "ZynPhaser", + /* label */ "zynphaser", + /* maker */ "falkTX, Mark McCurry, Nasca Octavian Paul", + /* copyright */ "GNU GPL v2+", + DESCFUNCS +}, +{ + /* category */ NATIVE_PLUGIN_CATEGORY_DELAY, + /* hints */ static_cast(NATIVE_PLUGIN_USES_PANNING + |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS), + /* supports */ static_cast(0x0), + /* audioIns */ 2, + /* audioOuts */ 2, + /* midiIns */ 0, + /* midiOuts */ 0, + /* paramIns */ 13-2, + /* paramOuts */ 0, + /* name */ "ZynReverb", + /* label */ "zynreverb", + /* maker */ "falkTX, Mark McCurry, Nasca Octavian Paul", + /* copyright */ "GNU GPL v2+", + DESCFUNCS +}, +{ + /* category */ NATIVE_PLUGIN_CATEGORY_SYNTH, + /* hints */ static_cast(NATIVE_PLUGIN_IS_SYNTH +#ifdef HAVE_ZYN_UI_DEPS + |NATIVE_PLUGIN_HAS_UI +#endif + |NATIVE_PLUGIN_USES_MULTI_PROGS + |NATIVE_PLUGIN_USES_STATE), + /* supports */ static_cast(NATIVE_PLUGIN_SUPPORTS_CONTROL_CHANGES + |NATIVE_PLUGIN_SUPPORTS_NOTE_AFTERTOUCH + |NATIVE_PLUGIN_SUPPORTS_PITCHBEND + |NATIVE_PLUGIN_SUPPORTS_ALL_SOUND_OFF), + /* audioIns */ 0, + /* audioOuts */ 2, + /* midiIns */ 1, + /* midiOuts */ 0, + /* paramIns */ 6, + /* paramOuts */ 0, + /* name */ "ZynAddSubFX", + /* label */ "zynaddsubfx", + /* maker */ "falkTX, Mark McCurry, Nasca Octavian Paul", + /* copyright */ "GNU GPL v2+", + DESCFUNCS +}, +#endif // HAVE_ZYN_DEPS + + +// ----------------------------------------------------------------------- +// Experimental plugins + +#ifdef HAVE_EXPERIMENTAL_PLUGINS +{ + /* category */ NATIVE_PLUGIN_CATEGORY_MODULATOR, + /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE + |NATIVE_PLUGIN_HAS_UI + |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS + |NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD + |NATIVE_PLUGIN_USES_PARENT_ID), + /* supports */ static_cast(0x0), + /* audioIns */ 1, + /* audioOuts */ 1, + /* midiIns */ 1, + /* midiOuts */ 0, + /* paramIns */ 6, + /* paramOuts */ 0, + /* name */ "AT1", + /* label */ "at1", + /* maker */ "falkTX, Fons Adriaensen", + /* copyright */ "GPL v2+", + DESCFUNCS +}, +{ + /* category */ NATIVE_PLUGIN_CATEGORY_FILTER, + /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE + |NATIVE_PLUGIN_HAS_UI + |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS + |NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD + |NATIVE_PLUGIN_USES_PARENT_ID), + /* supports */ static_cast(0x0), + /* audioIns */ 2, + /* audioOuts */ 2, + /* midiIns */ 0, + /* midiOuts */ 0, + /* paramIns */ 6, + /* paramOuts */ 0, + /* name */ "BLS1", + /* label */ "bls1", + /* maker */ "falkTX, Fons Adriaensen", + /* copyright */ "GPL v2+", + DESCFUNCS +}, +{ + /* category */ NATIVE_PLUGIN_CATEGORY_DELAY, + /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE + |NATIVE_PLUGIN_HAS_UI + |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS + |NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD + |NATIVE_PLUGIN_USES_PARENT_ID), + /* supports */ static_cast(0x0), + /* audioIns */ 2, + /* audioOuts */ 4, + /* midiIns */ 0, + /* midiOuts */ 0, + /* paramIns */ 10, + /* paramOuts */ 0, + /* name */ "REV1 (Ambisonic)", + /* label */ "rev1-ambisonic", + /* maker */ "falkTX, Fons Adriaensen", + /* copyright */ "GPL v2+", + DESCFUNCS +}, +{ + /* category */ NATIVE_PLUGIN_CATEGORY_DELAY, + /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE + |NATIVE_PLUGIN_HAS_UI + |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS + |NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD + |NATIVE_PLUGIN_USES_PARENT_ID), + /* supports */ static_cast(0x0), + /* audioIns */ 2, + /* audioOuts */ 2, + /* midiIns */ 0, + /* midiOuts */ 0, + /* paramIns */ 10, + /* paramOuts */ 0, + /* name */ "REV1 (Stereo)", + /* label */ "rev1-stereo", + /* maker */ "falkTX, Fons Adriaensen", + /* copyright */ "GPL v2+", + DESCFUNCS +}, +#endif // HAVE_EXPERIMENTAL_PLUGINS + +}; + +#undef DESCFUNCS + +// ----------------------------------------------------------------------- + +const NativePluginDescriptor* carla_get_native_plugins_data(uint32_t* count) +{ + CARLA_SAFE_ASSERT_RETURN(count != nullptr, nullptr); + + *count = static_cast(sizeof(sNativePluginDescriptors)/sizeof(NativePluginDescriptor)); + return sNativePluginDescriptors; +} + +// ----------------------------------------------------------------------- diff --git a/source/native-plugins/audio-file.cpp b/source/native-plugins/audio-file.cpp index 9ddd122b1..97d5eb47e 100644 --- a/source/native-plugins/audio-file.cpp +++ b/source/native-plugins/audio-file.cpp @@ -284,7 +284,8 @@ private: static const NativePluginDescriptor audiofileDesc = { /* category */ NATIVE_PLUGIN_CATEGORY_UTILITY, - /* hints */ static_cast(NATIVE_PLUGIN_HAS_UI|NATIVE_PLUGIN_NEEDS_UI_OPEN_SAVE), + /* hints */ static_cast(NATIVE_PLUGIN_HAS_UI + |NATIVE_PLUGIN_NEEDS_UI_OPEN_SAVE), /* supports */ static_cast(0x0), /* audioIns */ 0, /* audioOuts */ 2, diff --git a/source/native-plugins/distrho-3bandeq.cpp b/source/native-plugins/distrho-3bandeq.cpp index 3f3f1d646..7b58d4438 100644 --- a/source/native-plugins/distrho-3bandeq.cpp +++ b/source/native-plugins/distrho-3bandeq.cpp @@ -44,7 +44,10 @@ START_NAMESPACE_DISTRHO static const NativePluginDescriptor _3bandeqDesc = { /* category */ NATIVE_PLUGIN_CATEGORY_EQ, #ifdef HAVE_DGL - /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE|NATIVE_PLUGIN_HAS_UI|NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD|NATIVE_PLUGIN_USES_PARENT_ID), + /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE + |NATIVE_PLUGIN_HAS_UI + |NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD + |NATIVE_PLUGIN_USES_PARENT_ID), #else /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE), #endif diff --git a/source/native-plugins/distrho-3bandsplitter.cpp b/source/native-plugins/distrho-3bandsplitter.cpp index 0124fd05d..500c2b0ed 100644 --- a/source/native-plugins/distrho-3bandsplitter.cpp +++ b/source/native-plugins/distrho-3bandsplitter.cpp @@ -44,7 +44,10 @@ START_NAMESPACE_DISTRHO static const NativePluginDescriptor _3bandsplitterDesc = { /* category */ NATIVE_PLUGIN_CATEGORY_EQ, #ifdef HAVE_DGL - /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE|NATIVE_PLUGIN_HAS_UI|NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD|NATIVE_PLUGIN_USES_PARENT_ID), + /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE + |NATIVE_PLUGIN_HAS_UI + |NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD + |NATIVE_PLUGIN_USES_PARENT_ID), #else /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE), #endif diff --git a/source/native-plugins/distrho-mverb.cpp b/source/native-plugins/distrho-mverb.cpp index 8b69a595b..c81f920e2 100644 --- a/source/native-plugins/distrho-mverb.cpp +++ b/source/native-plugins/distrho-mverb.cpp @@ -45,7 +45,10 @@ START_NAMESPACE_DISTRHO static const NativePluginDescriptor _mverbDesc = { /* category */ NATIVE_PLUGIN_CATEGORY_DELAY, #ifdef HAVE_DGL - /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE|NATIVE_PLUGIN_HAS_UI|NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD|NATIVE_PLUGIN_USES_PARENT_ID), + /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE + |NATIVE_PLUGIN_HAS_UI + |NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD + |NATIVE_PLUGIN_USES_PARENT_ID), #else /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE), #endif diff --git a/source/native-plugins/distrho-nekobi.cpp b/source/native-plugins/distrho-nekobi.cpp index d99b00ab4..3c0629c26 100644 --- a/source/native-plugins/distrho-nekobi.cpp +++ b/source/native-plugins/distrho-nekobi.cpp @@ -44,11 +44,17 @@ START_NAMESPACE_DISTRHO static const NativePluginDescriptor nekobiDesc = { /* category */ NATIVE_PLUGIN_CATEGORY_SYNTH, #ifdef HAVE_DGL - /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE|NATIVE_PLUGIN_IS_SYNTH|NATIVE_PLUGIN_HAS_UI|NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD|NATIVE_PLUGIN_USES_PARENT_ID), + /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE + |NATIVE_PLUGIN_IS_SYNTH + |NATIVE_PLUGIN_HAS_UI + |NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD + |NATIVE_PLUGIN_USES_PARENT_ID), #else - /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE|NATIVE_PLUGIN_IS_SYNTH), + /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE + |NATIVE_PLUGIN_IS_SYNTH), #endif - /* supports */ static_cast(NATIVE_PLUGIN_SUPPORTS_CONTROL_CHANGES|NATIVE_PLUGIN_SUPPORTS_ALL_SOUND_OFF), + /* supports */ static_cast(NATIVE_PLUGIN_SUPPORTS_CONTROL_CHANGES + |NATIVE_PLUGIN_SUPPORTS_ALL_SOUND_OFF), /* audioIns */ DISTRHO_PLUGIN_NUM_INPUTS, /* audioOuts */ DISTRHO_PLUGIN_NUM_OUTPUTS, /* midiIns */ 1, diff --git a/source/native-plugins/distrho-pingpongpan.cpp b/source/native-plugins/distrho-pingpongpan.cpp index dbce2b392..c68e6bb0f 100644 --- a/source/native-plugins/distrho-pingpongpan.cpp +++ b/source/native-plugins/distrho-pingpongpan.cpp @@ -44,7 +44,10 @@ START_NAMESPACE_DISTRHO static const NativePluginDescriptor pingpongpanDesc = { /* category */ NATIVE_PLUGIN_CATEGORY_UTILITY, #ifdef HAVE_DGL - /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE|NATIVE_PLUGIN_HAS_UI|NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD|NATIVE_PLUGIN_USES_PARENT_ID), + /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE + |NATIVE_PLUGIN_HAS_UI + |NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD + |NATIVE_PLUGIN_USES_PARENT_ID), #else /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE), #endif diff --git a/source/native-plugins/distrho-prom.cpp b/source/native-plugins/distrho-prom.cpp index a74a0b958..4bc926bb2 100644 --- a/source/native-plugins/distrho-prom.cpp +++ b/source/native-plugins/distrho-prom.cpp @@ -31,7 +31,10 @@ START_NAMESPACE_DISTRHO static const NativePluginDescriptor promDesc = { /* category */ NATIVE_PLUGIN_CATEGORY_UTILITY, - /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE|NATIVE_PLUGIN_HAS_UI|NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD|NATIVE_PLUGIN_USES_PARENT_ID), + /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE + |NATIVE_PLUGIN_HAS_UI + |NATIVE_PLUGIN_NEEDS_UI_MAIN_THREAD + |NATIVE_PLUGIN_USES_PARENT_ID), /* supports */ static_cast(0x0), /* audioIns */ DISTRHO_PLUGIN_NUM_INPUTS, /* audioOuts */ DISTRHO_PLUGIN_NUM_OUTPUTS, diff --git a/source/native-plugins/notes.cpp b/source/native-plugins/notes.cpp index 8651cfec4..cd7985fd9 100644 --- a/source/native-plugins/notes.cpp +++ b/source/native-plugins/notes.cpp @@ -99,7 +99,8 @@ private: static const NativePluginDescriptor notesDesc = { /* category */ NATIVE_PLUGIN_CATEGORY_UTILITY, - /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE|NATIVE_PLUGIN_HAS_UI), + /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE + |NATIVE_PLUGIN_HAS_UI), /* supports */ static_cast(0x0), /* audioIns */ 0, /* audioOuts */ 0, diff --git a/source/native-plugins/zynaddsubfx-fx.cpp b/source/native-plugins/zynaddsubfx-fx.cpp index 5dc210946..738edf9f8 100644 --- a/source/native-plugins/zynaddsubfx-fx.cpp +++ b/source/native-plugins/zynaddsubfx-fx.cpp @@ -1334,7 +1334,9 @@ protected: static const NativePluginDescriptor fxAlienWahDesc = { /* category */ NATIVE_PLUGIN_CATEGORY_MODULATOR, - /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE|NATIVE_PLUGIN_USES_PANNING|NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS), + /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE + |NATIVE_PLUGIN_USES_PANNING + |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS), /* supports */ static_cast(0x0), /* audioIns */ 2, /* audioOuts */ 2, @@ -1351,7 +1353,9 @@ static const NativePluginDescriptor fxAlienWahDesc = { static const NativePluginDescriptor fxChorusDesc = { /* category */ NATIVE_PLUGIN_CATEGORY_MODULATOR, - /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE|NATIVE_PLUGIN_USES_PANNING|NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS), + /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE + |NATIVE_PLUGIN_USES_PANNING + |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS), /* supports */ static_cast(0x0), /* audioIns */ 2, /* audioOuts */ 2, @@ -1368,7 +1372,8 @@ static const NativePluginDescriptor fxChorusDesc = { static const NativePluginDescriptor fxDistortionDesc = { /* category */ NATIVE_PLUGIN_CATEGORY_MODULATOR, - /* hints */ static_cast(NATIVE_PLUGIN_USES_PANNING|NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS), + /* hints */ static_cast(NATIVE_PLUGIN_USES_PANNING + |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS), /* supports */ static_cast(0x0), /* audioIns */ 2, /* audioOuts */ 2, @@ -1385,7 +1390,8 @@ static const NativePluginDescriptor fxDistortionDesc = { static const NativePluginDescriptor fxDynamicFilterDesc = { /* category */ NATIVE_PLUGIN_CATEGORY_FILTER, - /* hints */ static_cast(NATIVE_PLUGIN_USES_PANNING|NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS), + /* hints */ static_cast(NATIVE_PLUGIN_USES_PANNING + |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS), /* supports */ static_cast(0x0), /* audioIns */ 2, /* audioOuts */ 2, @@ -1402,7 +1408,9 @@ static const NativePluginDescriptor fxDynamicFilterDesc = { static const NativePluginDescriptor fxEchoDesc = { /* category */ NATIVE_PLUGIN_CATEGORY_DELAY, - /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE|NATIVE_PLUGIN_USES_PANNING|NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS), + /* hints */ static_cast(NATIVE_PLUGIN_IS_RTSAFE + |NATIVE_PLUGIN_USES_PANNING + |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS), /* supports */ static_cast(0x0), /* audioIns */ 2, /* audioOuts */ 2, @@ -1419,7 +1427,8 @@ static const NativePluginDescriptor fxEchoDesc = { static const NativePluginDescriptor fxPhaserDesc = { /* category */ NATIVE_PLUGIN_CATEGORY_MODULATOR, - /* hints */ static_cast(NATIVE_PLUGIN_USES_PANNING|NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS), + /* hints */ static_cast(NATIVE_PLUGIN_USES_PANNING + |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS), /* supports */ static_cast(0x0), /* audioIns */ 2, /* audioOuts */ 2, @@ -1436,7 +1445,8 @@ static const NativePluginDescriptor fxPhaserDesc = { static const NativePluginDescriptor fxReverbDesc = { /* category */ NATIVE_PLUGIN_CATEGORY_DELAY, - /* hints */ static_cast(NATIVE_PLUGIN_USES_PANNING|NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS), + /* hints */ static_cast(NATIVE_PLUGIN_USES_PANNING + |NATIVE_PLUGIN_NEEDS_FIXED_BUFFERS), /* supports */ static_cast(0x0), /* audioIns */ 2, /* audioOuts */ 2, diff --git a/source/native-plugins/zynaddsubfx-synth.cpp b/source/native-plugins/zynaddsubfx-synth.cpp index 5ce7b6c05..b31867d24 100644 --- a/source/native-plugins/zynaddsubfx-synth.cpp +++ b/source/native-plugins/zynaddsubfx-synth.cpp @@ -27,6 +27,10 @@ #include "Misc/Part.h" #include "Misc/Util.h" +#ifdef HAVE_ZYN_UI_DEPS +# define WANT_ZYNADDSUBFX_UI +#endif + #ifdef WANT_ZYNADDSUBFX_UI # ifdef override # define override_hack diff --git a/source/plugin/carla-base.cpp b/source/plugin/carla-base.cpp index 119c6c6df..b143549e6 100644 --- a/source/plugin/carla-base.cpp +++ b/source/plugin/carla-base.cpp @@ -36,10 +36,10 @@ using CarlaBackend::CarlaPlugin; // ----------------------------------------------------------------------- CARLA_EXTERN_C -std::size_t carla_getNativePluginCount(); +std::size_t carla_getNativePluginCount() noexcept; CARLA_EXTERN_C -const NativePluginDescriptor* carla_getNativePluginDescriptor(const std::size_t index); +const NativePluginDescriptor* carla_getNativePluginDescriptor(const std::size_t index) noexcept; // ----------------------------------------------------------------------- // Plugin List diff --git a/source/tests/Print.cpp b/source/tests/Print.cpp index a2bc792aa..423b94ce0 100644 --- a/source/tests/Print.cpp +++ b/source/tests/Print.cpp @@ -17,7 +17,11 @@ #include "CarlaUtils.hpp" -#include +#ifdef CARLA_PROPER_CPP11_SUPPORT +# include +#else +# include +#endif // -----------------------------------------------------------------------