Browse Source

Carla: Update standalone code, fixing

tags/v0.9.0
falkTX 12 years ago
parent
commit
d63d2f4894
4 changed files with 294 additions and 233 deletions
  1. +11
    -1
      c++/carla-backend/Makefile
  2. +5
    -0
      c++/carla-backend/carla-backend.pro
  3. +261
    -217
      c++/carla-backend/carla_backend_standalone.cpp
  4. +17
    -15
      c++/carla-backend/carla_backend_standalone.hpp

+ 11
- 1
c++/carla-backend/Makefile View File

@@ -27,13 +27,21 @@ HAVE_ZYN_GUI_DEPS = $(shell which ntk-config)


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


BUILD_CXX_FLAGS += -I. -I../carla-engine -I../carla-includes -I../carla-plugin -I../carla-utils
BUILD_CXX_FLAGS += -I. -I../carla-engine -I../carla-includes -I../carla-native -I../carla-plugin -I../carla-utils
BUILD_CXX_FLAGS += -fvisibility=hidden -fPIC BUILD_CXX_FLAGS += -fvisibility=hidden -fPIC
BUILD_CXX_FLAGS += $(shell pkg-config --cflags liblo QtCore) BUILD_CXX_FLAGS += $(shell pkg-config --cflags liblo QtCore)


LINK_FLAGS += -fPIC -shared -ldl -lm LINK_FLAGS += -fPIC -shared -ldl -lm
LINK_FLAGS += $(shell pkg-config --libs liblo QtCore QtGui) LINK_FLAGS += $(shell pkg-config --libs liblo QtCore QtGui)


ifeq ($(CARLA_PLUGIN_SUPPORT),true)
BUILD_CXX_FLAGS += -DWANT_LADSPA -DWANT_DSSI -DWANT_LV2 -DWANT_VST
endif

ifeq ($(CARLA_RTAUDIO_SUPPORT),true)
BUILD_CXX_FLAGS += -DCARLA_ENGINE_RTAUDIO
endif

ifeq ($(HAVE_JACK),true) ifeq ($(HAVE_JACK),true)
LINK_FLAGS += $(shell pkg-config --libs jack) LINK_FLAGS += $(shell pkg-config --libs jack)
endif endif
@@ -51,10 +59,12 @@ LINK_FLAGS += $(shell pkg-config --libs suil-0)
endif endif


ifeq ($(HAVE_FLUIDSYNTH),true) ifeq ($(HAVE_FLUIDSYNTH),true)
BUILD_CXX_FLAGS += -DWANT_FLUIDSYNTH
LINK_FLAGS += $(shell pkg-config --libs fluidsynth) LINK_FLAGS += $(shell pkg-config --libs fluidsynth)
endif endif


ifeq ($(HAVE_LINUXSAMPLER),true) ifeq ($(HAVE_LINUXSAMPLER),true)
BUILD_CXX_FLAGS += -DWANT_LINUXSAMPLER
LINK_FLAGS += $(shell pkg-config --libs linuxsampler) LINK_FLAGS += $(shell pkg-config --libs linuxsampler)
endif endif




+ 5
- 0
c++/carla-backend/carla-backend.pro View File

@@ -8,6 +8,10 @@ CONFIG += link_pkgconfig qt warn_on # plugin shared
DEFINES = DEBUG DEFINES = DEBUG
DEFINES += QTCREATOR_TEST DEFINES += QTCREATOR_TEST


DEFINES += CARLA_ENGINE_RTAUDIO
DEFINES += WANT_LADSPA WANT_DSSI WANT_LV2 WANT_VST
DEFINES += WANT_FLUIDSYNTH WANT_LINUXSAMPLER

PKGCONFIG = liblo PKGCONFIG = liblo
PKGCONFIG += jack PKGCONFIG += jack
PKGCONFIG += alsa libpulse-simple PKGCONFIG += alsa libpulse-simple
@@ -29,6 +33,7 @@ HEADERS = \
INCLUDEPATH = . \ INCLUDEPATH = . \
../carla-engine \ ../carla-engine \
../carla-includes \ ../carla-includes \
../carla-native \
../carla-plugin \ ../carla-plugin \
../carla-utils ../carla-utils




+ 261
- 217
c++/carla-backend/carla_backend_standalone.cpp
File diff suppressed because it is too large
View File


+ 17
- 15
c++/carla-backend/carla_backend_standalone.hpp View File

@@ -22,7 +22,9 @@


#include "carla_backend.hpp" #include "carla_backend.hpp"


CARLA_BACKEND_USE_NAMESPACE
// TODO - create struct for internal plugin info
// TODO - dont strdup() on const-char* returns
// TODO - set_option caching values


/*! /*!
* @defgroup CarlaBackendStandalone Carla Backend Standalone * @defgroup CarlaBackendStandalone Carla Backend Standalone
@@ -33,8 +35,8 @@ CARLA_BACKEND_USE_NAMESPACE
*/ */


struct PluginInfo { struct PluginInfo {
PluginType type;
PluginCategory category;
CarlaBackend::PluginType type;
CarlaBackend::PluginCategory category;
unsigned int hints; unsigned int hints;
const char* binary; const char* binary;
const char* name; const char* name;
@@ -44,8 +46,8 @@ struct PluginInfo {
long uniqueId; long uniqueId;


PluginInfo() PluginInfo()
: type(PLUGIN_NONE),
category(PLUGIN_CATEGORY_NONE),
: type(CarlaBackend::PLUGIN_NONE),
category(CarlaBackend::PLUGIN_CATEGORY_NONE),
hints(0x0), hints(0x0),
binary(nullptr), binary(nullptr),
name(nullptr), name(nullptr),
@@ -89,11 +91,11 @@ struct ScalePointInfo {
}; };


struct GuiInfo { struct GuiInfo {
GuiType type;
CarlaBackend::GuiType type;
bool resizable; bool resizable;


GuiInfo() GuiInfo()
: type(GUI_NONE),
: type(CarlaBackend::GUI_NONE),
resizable(false) {} resizable(false) {}
}; };


@@ -109,7 +111,7 @@ CARLA_EXPORT bool engine_init(const char* driver_name, const char* client_name);
CARLA_EXPORT bool engine_close(); CARLA_EXPORT bool engine_close();
CARLA_EXPORT bool is_engine_running(); CARLA_EXPORT bool is_engine_running();


CARLA_EXPORT short add_plugin(BinaryType btype, PluginType ptype, const char* filename, const char* name, const char* label, void* extra_stuff);
CARLA_EXPORT short add_plugin(CarlaBackend::BinaryType btype, CarlaBackend::PluginType ptype, const char* filename, const char* name, const char* label, void* extra_stuff);
CARLA_EXPORT bool remove_plugin(unsigned short plugin_id); CARLA_EXPORT bool remove_plugin(unsigned short plugin_id);


CARLA_EXPORT const PluginInfo* get_plugin_info(unsigned short plugin_id); CARLA_EXPORT const PluginInfo* get_plugin_info(unsigned short plugin_id);
@@ -120,10 +122,10 @@ CARLA_EXPORT const ParameterInfo* get_parameter_info(unsigned short plugin_id, u
CARLA_EXPORT const ScalePointInfo* get_parameter_scalepoint_info(unsigned short plugin_id, uint32_t parameter_id, uint32_t scalepoint_id); CARLA_EXPORT const ScalePointInfo* get_parameter_scalepoint_info(unsigned short plugin_id, uint32_t parameter_id, uint32_t scalepoint_id);
CARLA_EXPORT const GuiInfo* get_gui_info(unsigned short plugin_id); CARLA_EXPORT const GuiInfo* get_gui_info(unsigned short plugin_id);


CARLA_EXPORT const ParameterData* get_parameter_data(unsigned short plugin_id, uint32_t parameter_id);
CARLA_EXPORT const ParameterRanges* get_parameter_ranges(unsigned short plugin_id, uint32_t parameter_id);
CARLA_EXPORT const MidiProgramData* get_midi_program_data(unsigned short plugin_id, uint32_t midi_program_id);
CARLA_EXPORT const CustomData* get_custom_data(unsigned short plugin_id, uint32_t custom_data_id);
CARLA_EXPORT const CarlaBackend::ParameterData* get_parameter_data(unsigned short plugin_id, uint32_t parameter_id);
CARLA_EXPORT const CarlaBackend::ParameterRanges* get_parameter_ranges(unsigned short plugin_id, uint32_t parameter_id);
CARLA_EXPORT const CarlaBackend::MidiProgramData* get_midi_program_data(unsigned short plugin_id, uint32_t midi_program_id);
CARLA_EXPORT const CarlaBackend::CustomData* get_custom_data(unsigned short plugin_id, uint32_t custom_data_id);
CARLA_EXPORT const char* get_chunk_data(unsigned short plugin_id); CARLA_EXPORT const char* get_chunk_data(unsigned short plugin_id);


CARLA_EXPORT uint32_t get_parameter_count(unsigned short plugin_id); CARLA_EXPORT uint32_t get_parameter_count(unsigned short plugin_id);
@@ -157,7 +159,7 @@ CARLA_EXPORT void set_parameter_midi_cc(unsigned short plugin_id, uint32_t param
CARLA_EXPORT void set_program(unsigned short plugin_id, uint32_t program_id); CARLA_EXPORT void set_program(unsigned short plugin_id, uint32_t program_id);
CARLA_EXPORT void set_midi_program(unsigned short plugin_id, uint32_t midi_program_id); CARLA_EXPORT void set_midi_program(unsigned short plugin_id, uint32_t midi_program_id);


CARLA_EXPORT void set_custom_data(unsigned short plugin_id, CustomDataType dtype, const char* key, const char* value);
CARLA_EXPORT void set_custom_data(unsigned short plugin_id, CarlaBackend::CustomDataType dtype, const char* key, const char* value);
CARLA_EXPORT void set_chunk_data(unsigned short plugin_id, const char* chunk_data); CARLA_EXPORT void set_chunk_data(unsigned short plugin_id, const char* chunk_data);
CARLA_EXPORT void set_gui_container(unsigned short plugin_id, uintptr_t gui_addr); CARLA_EXPORT void set_gui_container(unsigned short plugin_id, uintptr_t gui_addr);


@@ -173,8 +175,8 @@ CARLA_EXPORT double get_sample_rate();
CARLA_EXPORT const char* get_last_error(); CARLA_EXPORT const char* get_last_error();
CARLA_EXPORT const char* get_host_osc_url(); CARLA_EXPORT const char* get_host_osc_url();


CARLA_EXPORT void set_callback_function(CallbackFunc func);
CARLA_EXPORT void set_option(OptionsType option, int value, const char* value_str);
CARLA_EXPORT void set_callback_function(CarlaBackend::CallbackFunc func);
CARLA_EXPORT void set_option(CarlaBackend::OptionsType option, int value, const char* value_str);


CARLA_EXPORT void nsm_announce(const char* url, int pid); CARLA_EXPORT void nsm_announce(const char* url, int pid);
CARLA_EXPORT void nsm_reply_open(); CARLA_EXPORT void nsm_reply_open();


Loading…
Cancel
Save