Signed-off-by: falkTX <falktx@falktx.com>tags/v2.1-rc1
@@ -146,6 +146,9 @@ endif | |||
$(MODULEDIR)/dgl.wine.a: .FORCE | |||
@$(MAKE) -C source/modules/dgl wine | |||
$(MODULEDIR)/water.files.a: .FORCE | |||
@$(MAKE) -C source/modules/water files | |||
$(MODULEDIR)/%.a: .FORCE | |||
@$(MAKE) -C source/modules/$* | |||
@@ -176,6 +179,9 @@ endif | |||
libjack: libs | |||
@$(MAKE) -C source/libjack | |||
lv2-bundles: $(MODULEDIR)/native-plugins.a $(MODULEDIR)/audio_decoder.a $(MODULEDIR)/water.a | |||
@$(MAKE) -C source/plugin bundles | |||
plugin: backend bridges-plugin bridges-ui discovery | |||
@$(MAKE) -C source/plugin | |||
@@ -539,6 +539,9 @@ endif | |||
# --------------------------------------------------------------------------------------------------------------------- | |||
AUDIO_DECODER_LIBS = $(FFMPEG_LIBS) | |||
AUDIO_DECODER_LIBS += $(SNDFILE_LIBS) | |||
NATIVE_PLUGINS_LIBS += $(DGL_LIBS) | |||
NATIVE_PLUGINS_LIBS += $(FFMPEG_LIBS) | |||
NATIVE_PLUGINS_LIBS += $(SNDFILE_LIBS) | |||
@@ -32,6 +32,7 @@ OBJS_win64 = $(OBJDIR)/$(MODULENAME).cpp.win64.o | |||
# --------------------------------------------------------------------------------------------------------------------- | |||
all: $(MODULEDIR)/$(MODULENAME).a $(MODULEDIR)/$(MODULENAME).files.a | |||
files: $(MODULEDIR)/$(MODULENAME).files.a | |||
arm32: $(MODULEDIR)/$(MODULENAME).arm32.a | |||
posix32: $(MODULEDIR)/$(MODULENAME).posix32.a | |||
posix64: $(MODULEDIR)/$(MODULENAME).posix64.a | |||
@@ -21,9 +21,11 @@ BINDIR := $(CWD)/../bin | |||
ifeq ($(DEBUG),true) | |||
OBJDIR := $(CWD)/../build/plugin/Debug | |||
MODULEDIR := $(CWD)/../build/modules/Debug | |||
NPOBJDIR := $(CWD)/../build/native-plugins/Debug | |||
else | |||
OBJDIR := $(CWD)/../build/plugin/Release | |||
MODULEDIR := $(CWD)/../build/modules/Release | |||
NPOBJDIR := $(CWD)/../build/native-plugins/Release | |||
endif | |||
# --------------------------------------------------------------------------------------------------------------------- | |||
@@ -183,6 +185,23 @@ endif | |||
# --------------------------------------------------------------------------------------------------------------------- | |||
BUNDLES = audiogain files miditools | |||
bundles: \ | |||
$(BINDIR)/carla-audiogain.lv2/carla$(LIB_EXT) \ | |||
$(BINDIR)/carla-files.lv2/carla$(LIB_EXT) \ | |||
$(BINDIR)/carla-miditools.lv2/carla$(LIB_EXT) | |||
BUNDLE_LIBS += $(MODULEDIR)/water.files.a | |||
BUNDLE_LIBS += $(WATER_LIBS) | |||
BUNDLE_FILES_LIBS += $(MODULEDIR)/audio_decoder.a | |||
BUNDLE_FILES_LIBS += $(MODULEDIR)/water.a | |||
BUNDLE_FILES_LIBS += $(AUDIO_DECODER_LIBS) | |||
BUNDLE_FILES_LIBS += $(WATER_LIBS) | |||
# --------------------------------------------------------------------------------------------------------------------- | |||
clean: | |||
rm -f $(OBJDIR)/*.o $(TARGETS) | |||
rm -f $(BINDIR)/carla.lv2/*.* | |||
@@ -217,6 +236,33 @@ $(BINDIR)/carla.lv2/carla-ui$(LIB_EXT): $(OBJDIR)/carla-lv2-ui.cpp.o $(LIBS_ui) | |||
# --------------------------------------------------------------------------------------------------------------------- | |||
$(BINDIR)/carla-audiogain.lv2/carla$(LIB_EXT): $(OBJDIR)/carla-lv2-bundles.cpp.audiogain.o \ | |||
$(NPOBJDIR)/audio-gain.c.o | |||
-@mkdir -p $(BINDIR)/carla-audiogain.lv2 | |||
@echo "Linking carla-audiogain.lv2/carla$(LIB_EXT)" | |||
@$(CXX) $^ $(SHARED) $(SYMBOLS_LV2) $(BUNDLE_LIBS) $(LINK_FLAGS) -ldl -o $@ | |||
$(BINDIR)/carla-files.lv2/carla$(LIB_EXT): $(OBJDIR)/carla-lv2-bundles.cpp.files.o \ | |||
$(NPOBJDIR)/audio-file.cpp.o \ | |||
$(NPOBJDIR)/midi-file.cpp.o | |||
-@mkdir -p $(BINDIR)/carla-files.lv2 | |||
@echo "Linking carla-files.lv2/carla$(LIB_EXT)" | |||
@$(CXX) $^ $(SHARED) $(SYMBOLS_LV2) $(BUNDLE_FILES_LIBS) $(LINK_FLAGS) -o $@ | |||
$(BINDIR)/carla-miditools.lv2/carla$(LIB_EXT): $(OBJDIR)/carla-lv2-bundles.cpp.miditools.o \ | |||
$(NPOBJDIR)/midi-channel-ab.c.o \ | |||
$(NPOBJDIR)/midi-channel-filter.c.o \ | |||
$(NPOBJDIR)/midi-channelize.c.o \ | |||
$(NPOBJDIR)/midi-gain.c.o \ | |||
$(NPOBJDIR)/midi-join.c.o \ | |||
$(NPOBJDIR)/midi-split.c.o \ | |||
$(NPOBJDIR)/midi-transpose.c.o | |||
-@mkdir -p $(BINDIR)/carla-miditools.lv2 | |||
@echo "Linking carla-miditools.lv2/carla$(LIB_EXT)" | |||
@$(CXX) $^ $(SHARED) $(SYMBOLS_LV2) $(BUNDLE_LIBS) $(LINK_FLAGS) -o $@ | |||
# --------------------------------------------------------------------------------------------------------------------- | |||
$(BINDIR)/CarlaRack$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.rack-syn.o $(OBJDIR)/carla-vst-export.cpp.o | |||
-@mkdir -p $(BINDIR) | |||
@echo "Linking CarlaRack$(LIB_EXT)" | |||
@@ -307,6 +353,23 @@ $(OBJDIR)/carla-lv2-ui.cpp.o: carla-lv2-ui.cpp | |||
# --------------------------------------------------------------------------------------------------------------------- | |||
$(OBJDIR)/carla-lv2-bundles.cpp.audiogain.o: carla-lv2-bundles.cpp | |||
-@mkdir -p $(OBJDIR) | |||
@echo "Compiling $< (audiogain)" | |||
@$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_BUNDLE_TYPE=1 -c -o $@ | |||
$(OBJDIR)/carla-lv2-bundles.cpp.files.o: carla-lv2-bundles.cpp | |||
-@mkdir -p $(OBJDIR) | |||
@echo "Compiling $< (files)" | |||
@$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_BUNDLE_TYPE=2 -c -o $@ | |||
$(OBJDIR)/carla-lv2-bundles.cpp.miditools.o: carla-lv2-bundles.cpp | |||
-@mkdir -p $(OBJDIR) | |||
@echo "Compiling $< (miditools)" | |||
@$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_BUNDLE_TYPE=3 -c -o $@ | |||
# --------------------------------------------------------------------------------------------------------------------- | |||
$(OBJDIR)/carla-vst.cpp.rack-fx.o: carla-vst.cpp | |||
-@mkdir -p $(OBJDIR) | |||
@echo "Compiling $< (RackFX)" | |||
@@ -44,6 +44,7 @@ struct PluginListManager { | |||
for (std::size_t i=0, count = carla_getNativePluginCount(); i < count; ++i) | |||
{ | |||
const NativePluginDescriptor* const desc(carla_getNativePluginDescriptor(i)); | |||
CARLA_SAFE_ASSERT_BREAK(desc != nullptr); | |||
if (std::strcmp(desc->label, "audiofile" ) == 0 || | |||
std::strcmp(desc->label, "audiogain" ) == 0 || | |||
@@ -0,0 +1,116 @@ | |||
/* | |||
* Carla Native Plugins | |||
* Copyright (C) 2013-2019 Filipe Coelho <falktx@falktx.com> | |||
* | |||
* 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. | |||
*/ | |||
#ifndef CARLA_BUNDLE_TYPE | |||
# error CARLA_BUNDLE_TYPE undefined | |||
#endif | |||
// -------------------------------------------------------------------------------------------------------------------- | |||
#include "carla-lv2.cpp" | |||
// -------------------------------------------------------------------------------------------------------------------- | |||
#define MAX_PLUGIN_DESCRIPTORS 8 | |||
static const NativePluginDescriptor* sDescs[MAX_PLUGIN_DESCRIPTORS]; | |||
static std::size_t sDescsUsed = 0; | |||
std::size_t carla_getNativePluginCount() noexcept | |||
{ | |||
return sDescsUsed; | |||
} | |||
const NativePluginDescriptor* carla_getNativePluginDescriptor(const std::size_t index) noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(index < sDescsUsed, nullptr); | |||
return sDescs[index]; | |||
} | |||
void carla_register_native_plugin(const NativePluginDescriptor* desc) | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(sDescsUsed < MAX_PLUGIN_DESCRIPTORS,); | |||
sDescs[sDescsUsed++] = desc; | |||
} | |||
// -------------------------------------------------------------------------------------------------------------------- | |||
static void carla_register_bundled_native_plugins(void); | |||
static const struct PluginRegisterer { | |||
PluginRegisterer() { | |||
carla_register_bundled_native_plugins(); | |||
} | |||
} sPluginRegisterer; | |||
// -------------------------------------------------------------------------------------------------------------------- | |||
extern "C" { | |||
// Simple plugins | |||
void carla_register_native_plugin_audiogain(void); | |||
void carla_register_native_plugin_bypass(void); | |||
void carla_register_native_plugin_lfo(void); | |||
void carla_register_native_plugin_midichanab(void); | |||
void carla_register_native_plugin_midichanfilter(void); | |||
void carla_register_native_plugin_midichannelize(void); | |||
void carla_register_native_plugin_midigain(void); | |||
void carla_register_native_plugin_midijoin(void); | |||
void carla_register_native_plugin_midisplit(void); | |||
void carla_register_native_plugin_midithrough(void); | |||
void carla_register_native_plugin_miditranspose(void); | |||
// Audio file | |||
void carla_register_native_plugin_audiofile(void); | |||
// MIDI file and sequencer | |||
void carla_register_native_plugin_midifile(void); | |||
void carla_register_native_plugin_midipattern(void); | |||
// Carla | |||
void carla_register_native_plugin_carla(void); | |||
// External-UI plugins | |||
void carla_register_native_plugin_bigmeter(void); | |||
void carla_register_native_plugin_notes(void); | |||
#ifdef HAVE_EXTERNAL_PLUGINS | |||
void carla_register_all_native_external_plugins(void); | |||
#endif | |||
} | |||
static void carla_register_bundled_native_plugins(void) | |||
{ | |||
#if CARLA_BUNDLE_TYPE == 1 | |||
carla_register_native_plugin_audiogain(); | |||
#elif CARLA_BUNDLE_TYPE == 2 | |||
carla_register_native_plugin_audiofile(); | |||
carla_register_native_plugin_midifile(); | |||
#elif CARLA_BUNDLE_TYPE == 3 | |||
carla_register_native_plugin_midichanab(); | |||
carla_register_native_plugin_midichannelize(); | |||
carla_register_native_plugin_midichanfilter(); | |||
carla_register_native_plugin_midigain(); | |||
carla_register_native_plugin_midijoin(); | |||
carla_register_native_plugin_midisplit(); | |||
carla_register_native_plugin_miditranspose(); | |||
#endif | |||
} | |||
// -------------------------------------------------------------------------------------------------------------------- |