Browse Source

Import the super experimental libjack code

tags/1.9.8
falkTX 7 years ago
parent
commit
0584579c16
4 changed files with 3114 additions and 25 deletions
  1. +1591
    -14
      source/backend/plugin/CarlaPluginJack.cpp
  2. +29
    -10
      source/interposer/Makefile
  3. +1490
    -0
      source/interposer/libjack.cpp
  4. +4
    -1
      source/tests/carla-plugin-jack.py

+ 1591
- 14
source/backend/plugin/CarlaPluginJack.cpp
File diff suppressed because it is too large
View File


+ 29
- 10
source/interposer/Makefile View File

@@ -21,8 +21,12 @@ endif


# ---------------------------------------------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------------------------------------------


BUILD_CXX_FLAGS += -I$(CWD)/includes -I$(CWD)/utils
LINK_FLAGS += -ldl
BUILD_CXX_FLAGS += -I$(CWD) -I$(CWD)/backend -I$(CWD)/includes -I$(CWD)/modules -I$(CWD)/utils

INTERPOSER_SAFE_LIBS = -ldl
INTERPOSER_X11_LIBS = $(X11_LIBS) -ldl
LIBJACK_LIBS = $(MODULEDIR)/juce_core.a
LIBJACK_LIBS += $(JUCE_CORE_LIBS)


# ---------------------------------------------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------------------------------------------


@@ -31,10 +35,14 @@ TARGETS =


ifeq ($(LINUX),true) ifeq ($(LINUX),true)
OBJS += $(OBJDIR)/interposer-safe.cpp.o OBJS += $(OBJDIR)/interposer-safe.cpp.o
TARGETS += $(BINDIR)/libcarla_interposer-safe$(LIB_EXT)
TARGETS += $(BINDIR)/libcarla_interposer-safe.so

OBJS += $(OBJDIR)/libjack.cpp.o
TARGETS += $(BINDIR)/jack/libjack.so.0

ifeq ($(HAVE_X11),true) ifeq ($(HAVE_X11),true)
OBJS += $(OBJDIR)/interposer-x11.cpp.o OBJS += $(OBJDIR)/interposer-x11.cpp.o
TARGETS += $(BINDIR)/libcarla_interposer-x11$(LIB_EXT)
TARGETS += $(BINDIR)/libcarla_interposer-x11.so
endif endif
endif endif


@@ -52,15 +60,20 @@ debug:


# ---------------------------------------------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------------------------------------------


$(BINDIR)/libcarla_interposer-safe$(LIB_EXT): $(OBJDIR)/interposer-safe.cpp.o
$(BINDIR)/libcarla_interposer-safe.so: $(OBJDIR)/interposer-safe.cpp.o
-@mkdir -p $(BINDIR) -@mkdir -p $(BINDIR)
@echo "Linking libcarla_interposer-safe$(LIB_EXT)"
@$(CXX) $< $(SHARED) $(LINK_FLAGS) -o $@
@echo "Linking libcarla_interposer-safe.so"
@$(CXX) $< $(SHARED) $(LINK_FLAGS) $(INTERPOSER_SAFE_LIBS) -o $@


$(BINDIR)/libcarla_interposer-x11$(LIB_EXT): $(OBJDIR)/interposer-x11.cpp.o
$(BINDIR)/libcarla_interposer-x11.so: $(OBJDIR)/interposer-x11.cpp.o
-@mkdir -p $(BINDIR) -@mkdir -p $(BINDIR)
@echo "Linking libcarla_interposer-x11$(LIB_EXT)"
@$(CXX) $< $(SHARED) $(LINK_FLAGS) $(X11_LIBS) -o $@
@echo "Linking libcarla_interposer-x11.so"
@$(CXX) $< $(SHARED) $(LINK_FLAGS) $(INTERPOSER_X11_LIBS) -o $@

$(BINDIR)/jack/libjack.so.0: $(OBJDIR)/libjack.cpp.o
-@mkdir -p $(BINDIR)/jack
@echo "Linking libjack.so.0"
@$(CXX) $< $(SHARED) $(LINK_FLAGS) $(LIBJACK_LIBS) -o $@


# ---------------------------------------------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------------------------------------------


@@ -74,6 +87,12 @@ $(OBJDIR)/interposer-x11.cpp.o: interposer-x11.cpp
@echo "Compiling $<" @echo "Compiling $<"
@$(CXX) $< $(BUILD_CXX_FLAGS) $(X11_FLAGS) -c -o $@ @$(CXX) $< $(BUILD_CXX_FLAGS) $(X11_FLAGS) -c -o $@


$(OBJDIR)/libjack.cpp.o: libjack.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling $<"
@$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
# -Wno-missing-declarations

-include $(OBJS:%.o=%.d) -include $(OBJS:%.o=%.d)


# ---------------------------------------------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------------------------------------------

+ 1490
- 0
source/interposer/libjack.cpp
File diff suppressed because it is too large
View File


+ 4
- 1
source/tests/carla-plugin-jack.py View File

@@ -32,7 +32,10 @@ if not host.engine_init("JACK", "Carla-Plugin-JACK"):
print("Engine failed to initialize, possible reasons:\n%s" % host.get_last_error()) print("Engine failed to initialize, possible reasons:\n%s" % host.get_last_error())
exit(1) exit(1)


if not host.add_plugin(BINARY_NATIVE, PLUGIN_JACK, "/usr/bin/lmms", "", "", 0, None, 0):
fname = "/usr/bin/pulseaudio"
label = "--high-priority --realtime --exit-idle-time=-1 --file=/usr/share/cadence/pulse2jack/play.pa -n"

if not host.add_plugin(BINARY_NATIVE, PLUGIN_JACK, fname, "", label, 0, None, 0):
print("Failed to load plugin, possible reasons:\n%s" % host.get_last_error()) print("Failed to load plugin, possible reasons:\n%s" % host.get_last_error())
host.engine_close() host.engine_close()
exit(1) exit(1)


Loading…
Cancel
Save