From 6137680d186945c04c807100f1e6b80b1af9ef66 Mon Sep 17 00:00:00 2001 From: falkTX Date: Wed, 24 May 2023 02:33:51 +0200 Subject: [PATCH] Make bridge and mac utils public, add to utils lib Signed-off-by: falkTX --- source/backend/utils/CarlaUtils.cpp | 22 ++++++++++++++++++++++ source/backend/utils/Makefile | 16 ++++++---------- source/utils/CarlaBridgeUtils.hpp | 8 ++++---- source/utils/CarlaMacUtils.hpp | 14 ++++++++------ 4 files changed, 40 insertions(+), 20 deletions(-) create mode 100644 source/backend/utils/CarlaUtils.cpp diff --git a/source/backend/utils/CarlaUtils.cpp b/source/backend/utils/CarlaUtils.cpp new file mode 100644 index 000000000..f3005e63d --- /dev/null +++ b/source/backend/utils/CarlaUtils.cpp @@ -0,0 +1,22 @@ +/* + * Carla Plugin Host + * Copyright (C) 2011-2023 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 "CarlaBridgeUtils.cpp" + +#ifdef CARLA_OS_MAC +# include "CarlaMacUtils.cpp" +#endif diff --git a/source/backend/utils/Makefile b/source/backend/utils/Makefile index 238274bf0..de822207f 100644 --- a/source/backend/utils/Makefile +++ b/source/backend/utils/Makefile @@ -16,6 +16,7 @@ BUILD_CXX_FLAGS += $(YSFX_FLAGS) OBJS = \ $(OBJDIR)/CachedPlugins.cpp.o \ + $(OBJDIR)/CarlaUtils.cpp.o \ $(OBJDIR)/Information.cpp.o \ $(OBJDIR)/JUCE.cpp.o \ $(OBJDIR)/PipeClient.cpp.o \ @@ -26,7 +27,8 @@ TARGETS = $(BINDIR)/libcarla_utils$(LIB_EXT) # --------------------------------------------------------------------------------------------------------------------- -LIBS = $(MODULEDIR)/lilv.a +LIBS = $(MODULEDIR)/jackbridge.a +LIBS += $(MODULEDIR)/lilv.a LIBS += $(MODULEDIR)/water.files.a LIBS += $(MODULEDIR)/ysfx.a @@ -42,6 +44,7 @@ LIBS += $(MODULEDIR)/juce_gui_basics.a LIBS += $(MODULEDIR)/juce_gui_extra.a endif +LINK_FLAGS += $(JACKBRIDGE_LIBS) LINK_FLAGS += $(LILV_LIBS) LINK_FLAGS += $(WATER_LIBS) LINK_FLAGS += $(YSFX_GRAPHICS_LIBS) @@ -90,16 +93,9 @@ $(BINDIR)/libcarla_utils$(LIB_EXT): $(OBJS) $(LIBS) ifeq ($(MACOS),true) ifeq ($(USING_JUCE),true) -$(OBJDIR)/CachedPlugins.cpp.o: CachedPlugins.cpp - -@mkdir -p $(OBJDIR) - @echo "Compiling $<" - $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -std=gnu++14 -c -o $@ +$(OBJDIR)/CachedPlugins.cpp.o: BUILD_CXX_FLAGS += -std=gnu++14 endif - -$(OBJDIR)/Windows.cpp.o: Windows.cpp - -@mkdir -p $(OBJDIR) - @echo "Compiling $<" - $(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -ObjC++ -c -o $@ +$(OBJDIR)/Windows.cpp.o: BUILD_CXX_FLAGS += -ObjC++ endif $(OBJDIR)/%.cpp.o: %.cpp diff --git a/source/utils/CarlaBridgeUtils.hpp b/source/utils/CarlaBridgeUtils.hpp index fb4be9732..15bc54af4 100644 --- a/source/utils/CarlaBridgeUtils.hpp +++ b/source/utils/CarlaBridgeUtils.hpp @@ -240,7 +240,7 @@ struct BridgeNonRtServerData { // ------------------------------------------------------------------------------------------------------------------- -struct BridgeAudioPool { +struct CARLA_API BridgeAudioPool { float* data; std::size_t dataSize; CarlaString filename; @@ -263,7 +263,7 @@ struct BridgeAudioPool { // ------------------------------------------------------------------------------------------------------------------- -struct BridgeRtClientControl : public CarlaRingBufferControl { +struct CARLA_API BridgeRtClientControl : public CarlaRingBufferControl { BridgeRtClientData* data; CarlaString filename; bool needsSemDestroy; // client only @@ -303,7 +303,7 @@ struct BridgeRtClientControl : public CarlaRingBufferControl { // ------------------------------------------------------------------------------------------------------------------- -struct BridgeNonRtClientControl : public CarlaRingBufferControl { +struct CARLA_API BridgeNonRtClientControl : public CarlaRingBufferControl { BridgeNonRtClientData* data; CarlaString filename; CarlaMutex mutex; @@ -332,7 +332,7 @@ struct BridgeNonRtClientControl : public CarlaRingBufferControl // ------------------------------------------------------------------------------------------------------------------- -struct BridgeNonRtServerControl : public CarlaRingBufferControl { +struct CARLA_API BridgeNonRtServerControl : public CarlaRingBufferControl { BridgeNonRtServerData* data; CarlaString filename; CarlaMutex mutex; diff --git a/source/utils/CarlaMacUtils.hpp b/source/utils/CarlaMacUtils.hpp index cf12508c1..6f5a027bb 100644 --- a/source/utils/CarlaMacUtils.hpp +++ b/source/utils/CarlaMacUtils.hpp @@ -1,6 +1,6 @@ /* * Carla macOS utils - * Copyright (C) 2018-2022 Filipe Coelho + * Copyright (C) 2018-2023 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 @@ -27,26 +27,28 @@ // don't include Foundation.h here typedef struct __CFBundle* CFBundleRef; -CARLA_BACKEND_START_NAMESPACE - // -------------------------------------------------------------------------------------------------------------------- +// a few public functions /* * ... */ -void initStandaloneApplication(); +CARLA_PLUGIN_EXPORT void initStandaloneApplication(); /* * ... */ -const char* findBinaryInBundle(const char* const bundleDir); +CARLA_PLUGIN_EXPORT const char* findBinaryInBundle(const char* const bundleDir); /* * ... */ -bool removeFileFromQuarantine(const char* const filename); +CARLA_PLUGIN_EXPORT bool removeFileFromQuarantine(const char* const filename); // -------------------------------------------------------------------------------------------------------------------- +// and now then private stuff + +CARLA_BACKEND_START_NAMESPACE /* * ...