@@ -0,0 +1,9 @@ | |||||
prefix=X-PREFIX-X | |||||
libdir=X-LIBDIR-X/carla | |||||
includedir=X-INCLUDEDIR-X/carla | |||||
Name: carla-native-plugin | |||||
Version: 1.9.11 | |||||
Description: Carla Native Plugin | |||||
Libs: -Wl,rpath=${libdir} -L${libdir} -lcarla_native-plugin | |||||
Cflags: -DREAL_BUILD -I${includedir} -I${includedir}/includes |
@@ -3,7 +3,7 @@ libdir=X-LIBDIR-X/carla | |||||
includedir=X-INCLUDEDIR-X/carla | includedir=X-INCLUDEDIR-X/carla | ||||
Name: carla-standalone | Name: carla-standalone | ||||
Version: 1.9.5 | |||||
Version: 1.9.11 | |||||
Description: Carla Host Standalone | Description: Carla Host Standalone | ||||
Libs: -Wl,rpath=${libdir} -L${libdir} -lcarla_standalone2 | Libs: -Wl,rpath=${libdir} -L${libdir} -lcarla_standalone2 | ||||
Cflags: -DREAL_BUILD -I${includedir} -I${includedir}/includes | Cflags: -DREAL_BUILD -I${includedir} -I${includedir}/includes |
@@ -3,7 +3,7 @@ libdir=X-LIBDIR-X/carla | |||||
includedir=X-INCLUDEDIR-X/carla | includedir=X-INCLUDEDIR-X/carla | ||||
Name: carla-utils | Name: carla-utils | ||||
Version: 1.9.5 | |||||
Version: 1.9.11 | |||||
Description: Carla Host Utilities | Description: Carla Host Utilities | ||||
Libs: -Wl,rpath=${libdir} -L${libdir} -lcarla_utils | Libs: -Wl,rpath=${libdir} -L${libdir} -lcarla_utils | ||||
Cflags: -DREAL_BUILD -I${includedir} -I${includedir}/includes -I${includedir}/utils | Cflags: -DREAL_BUILD -I${includedir} -I${includedir}/includes -I${includedir}/utils |
@@ -22,29 +22,40 @@ | |||||
#include "CarlaNative.h" | #include "CarlaNative.h" | ||||
#include "CarlaEngine.hpp" | #include "CarlaEngine.hpp" | ||||
/*! | |||||
* Get the absolute filename of this carla library. | |||||
*/ | |||||
CARLA_EXPORT const char* carla_get_library_filename(); | |||||
/*! | /*! | ||||
* Get the folder where this carla library resides. | * Get the folder where this carla library resides. | ||||
*/ | */ | ||||
CARLA_EXPORT const char* carla_get_library_folder(); | |||||
/*! | |||||
* Get the native plugin descriptor for the carla-rack plugin. | |||||
*/ | |||||
CARLA_EXPORT const NativePluginDescriptor* carla_get_native_rack_plugin(); | CARLA_EXPORT const NativePluginDescriptor* carla_get_native_rack_plugin(); | ||||
/*! | /*! | ||||
* Get the folder where this carla library resides. | |||||
* Get the native plugin descriptor for the carla-patchbay plugin. | |||||
*/ | */ | ||||
CARLA_EXPORT const NativePluginDescriptor* carla_get_native_patchbay_plugin(); | CARLA_EXPORT const NativePluginDescriptor* carla_get_native_patchbay_plugin(); | ||||
#ifdef __cplusplus | #ifdef __cplusplus | ||||
CARLA_BACKEND_USE_NAMESPACE | |||||
/*! | |||||
* Get the internal CarlaEngine instance. | |||||
*/ | |||||
static inline | static inline | ||||
CarlaEngine* carla_plugin_get_engine(const NativePluginDescriptor* desc, NativePluginHandle handle) | |||||
CarlaBackend::CarlaEngine* carla_plugin_get_engine(const NativePluginDescriptor* desc, NativePluginHandle handle) | |||||
{ | { | ||||
CARLA_SAFE_ASSERT_RETURN(desc != nullptr, nullptr); | CARLA_SAFE_ASSERT_RETURN(desc != nullptr, nullptr); | ||||
CARLA_SAFE_ASSERT_RETURN(handle != nullptr, nullptr); | CARLA_SAFE_ASSERT_RETURN(handle != nullptr, nullptr); | ||||
const intptr_t enginePtr = desc->dispatcher(handle, NATIVE_PLUGIN_OPCODE_GET_INTERNAL_HANDLE, 0, 0, nullptr, 0.0f); | |||||
CARLA_SAFE_ASSERT_RETURN(enginePtr != 0, nullptr); | |||||
return (CarlaEngine*)static_cast<uintptr_t>(enginePtr); | |||||
using CarlaBackend::CarlaEngine; | |||||
return (CarlaEngine*)static_cast<uintptr_t>(desc->dispatcher(handle, | |||||
NATIVE_PLUGIN_OPCODE_GET_INTERNAL_HANDLE, | |||||
0, 0, nullptr, 0.0f)); | |||||
} | } | ||||
#endif | #endif | ||||
@@ -74,10 +74,14 @@ LINK_FLAGS += $(MAGIC_LIBS) | |||||
LINK_FLAGS += $(X11_LIBS) | LINK_FLAGS += $(X11_LIBS) | ||||
ifeq ($(MACOS),true) | ifeq ($(MACOS),true) | ||||
SYMBOLS_NATIVE = -Wl,-exported_symbol,_carla_get_native_rack_plugin -Wl,-exported_symbol,_carla_get_native_patchbay_plugin | |||||
SYMBOLS_LV2 = -Wl,-exported_symbol,_lv2_descriptor -Wl,-exported_symbol,_lv2ui_descriptor | |||||
SYMBOLS_LV2_UI = -Wl,-exported_symbol,_lv2ui_descriptor | |||||
SYMBOLS_VST = # TODO | |||||
SYMBOLS_NATIVE = -Wl,-exported_symbol,_carla_get_native_rack_plugin | |||||
SYMBOLS_NATIVE += -Wl,-exported_symbol,_carla_get_native_patchbay_plugin | |||||
SYMBOLS_NATIVE += -Wl,-exported_symbol,_carla_get_library_filename | |||||
SYMBOLS_NATIVE += -Wl,-exported_symbol,_carla_get_library_folder | |||||
SYMBOLS_LV2 = -Wl,-exported_symbol,_lv2_descriptor | |||||
SYMBOLS_LV2 += -Wl,-exported_symbol,_lv2ui_descriptor | |||||
SYMBOLS_LV2_UI = -Wl,-exported_symbol,_lv2ui_descriptor | |||||
SYMBOLS_VST = # TODO | |||||
endif | endif | ||||
# --------------------------------------------------------------------------------------------------------------------- | # --------------------------------------------------------------------------------------------------------------------- | ||||
@@ -89,7 +93,7 @@ LIBS_ui = $(MODULEDIR)/water.a | |||||
TARGETS = \ | TARGETS = \ | ||||
$(BINDIR)/carla-native-plugin$(APP_EXT) \ | $(BINDIR)/carla-native-plugin$(APP_EXT) \ | ||||
$(BINDIR)/libcarla-native-plugin$(LIB_EXT) | |||||
$(BINDIR)/libcarla_native-plugin$(LIB_EXT) | |||||
TARGETS += \ | TARGETS += \ | ||||
$(BINDIR)/carla.lv2/carla$(LIB_EXT) | $(BINDIR)/carla.lv2/carla$(LIB_EXT) | ||||
@@ -140,7 +144,7 @@ $(BINDIR)/carla-native-plugin$(APP_EXT): $(OBJDIR)/carla-native-plugin.cpp.o $(L | |||||
@echo "Linking carla-native-plugin$(APP_EXT)" | @echo "Linking carla-native-plugin$(APP_EXT)" | ||||
@$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(LINK_FLAGS) -o $@ | @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(LINK_FLAGS) -o $@ | ||||
$(BINDIR)/libcarla-native-plugin$(LIB_EXT): $(OBJDIR)/carla-native-plugin.cpp.o $(LIBS) | |||||
$(BINDIR)/libcarla_native-plugin$(LIB_EXT): $(OBJDIR)/carla-native-plugin.cpp.o $(LIBS) | |||||
-@mkdir -p $(BINDIR) | -@mkdir -p $(BINDIR) | ||||
@echo "Linking libcarla-native-plugin$(LIB_EXT)" | @echo "Linking libcarla-native-plugin$(LIB_EXT)" | ||||
@$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(SYMBOLS_NATIVE) $(LINK_FLAGS) -o $@ | @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(SYMBOLS_NATIVE) $(LINK_FLAGS) -o $@ | ||||
@@ -18,6 +18,11 @@ | |||||
#include "CarlaUtils.hpp" | #include "CarlaUtils.hpp" | ||||
#include "CarlaNativePlugin.h" | #include "CarlaNativePlugin.h" | ||||
#include "CarlaString.hpp" | |||||
#include "water/files/File.h" | |||||
// -------------------------------------------------------------------------------------------------------------------- | |||||
static uint32_t get_buffer_size(NativeHostHandle) | static uint32_t get_buffer_size(NativeHostHandle) | ||||
{ | { | ||||
return 128; | return 128; | ||||
@@ -35,17 +40,21 @@ static bool is_offline(NativeHostHandle) | |||||
int main() | int main() | ||||
{ | { | ||||
const char* const filename = carla_get_library_filename(); | |||||
CARLA_SAFE_ASSERT_RETURN(filename != nullptr && filename[0] != '\0', 1); | |||||
const char* const folder = carla_get_library_folder(); | |||||
CARLA_SAFE_ASSERT_RETURN(folder != nullptr && folder[0] != '\0', 1); | |||||
const NativePluginDescriptor* const rack = carla_get_native_rack_plugin(); | const NativePluginDescriptor* const rack = carla_get_native_rack_plugin(); | ||||
CARLA_SAFE_ASSERT_RETURN(rack != nullptr, 1); | CARLA_SAFE_ASSERT_RETURN(rack != nullptr, 1); | ||||
const NativePluginDescriptor* const patchbay = carla_get_native_patchbay_plugin(); | const NativePluginDescriptor* const patchbay = carla_get_native_patchbay_plugin(); | ||||
CARLA_SAFE_ASSERT_RETURN(patchbay != nullptr, 1); | CARLA_SAFE_ASSERT_RETURN(patchbay != nullptr, 1); | ||||
const char* const resourceDir = get_current_dir_name(); | |||||
const NativeHostDescriptor host = { | const NativeHostDescriptor host = { | ||||
nullptr, | nullptr, | ||||
resourceDir, | |||||
"", // resourceDir | |||||
"Carla Plugin UI", | "Carla Plugin UI", | ||||
0, | 0, | ||||
@@ -65,12 +74,12 @@ int main() | |||||
nullptr, // ui_save_file | nullptr, // ui_save_file | ||||
nullptr, // dispatcher | nullptr, // dispatcher | ||||
}; | }; | ||||
const NativePluginHandle handle = rack->instantiate(&host); | const NativePluginHandle handle = rack->instantiate(&host); | ||||
CARLA_SAFE_ASSERT_RETURN(handle != nullptr, 1); | CARLA_SAFE_ASSERT_RETURN(handle != nullptr, 1); | ||||
CarlaEngine* const engine = carla_plugin_get_engine(rack, handle); | |||||
CarlaBackend::CarlaEngine* const engine = carla_plugin_get_engine(rack, handle); | |||||
CARLA_SAFE_ASSERT_RETURN(engine != nullptr, 1); | CARLA_SAFE_ASSERT_RETURN(engine != nullptr, 1); | ||||
carla_stdout("Got Engine %p, %s, %i, %f", | carla_stdout("Got Engine %p, %s, %i, %f", | ||||
@@ -79,3 +88,5 @@ int main() | |||||
rack->cleanup(handle); | rack->cleanup(handle); | ||||
return 0; | return 0; | ||||
} | } | ||||
// -------------------------------------------------------------------------------------------------------------------- |