@@ -111,7 +111,7 @@ int main(int argc, char* argv[]) | |||||
if (close_now) break; | if (close_now) break; | ||||
msleep(50); | |||||
carla_msleep(50); | |||||
} | } | ||||
delete plugin; | delete plugin; | ||||
@@ -2942,6 +2942,8 @@ class CarlaMainW(QMainWindow, ui_carla.Ui_CarlaMainW): | |||||
self.m_bridge_info.unique_id = plugin['unique_id'] | self.m_bridge_info.unique_id = plugin['unique_id'] | ||||
self.m_bridge_info.ains = plugin['audio.ins'] | self.m_bridge_info.ains = plugin['audio.ins'] | ||||
self.m_bridge_info.aouts = plugin['audio.outs'] | self.m_bridge_info.aouts = plugin['audio.outs'] | ||||
self.m_bridge_info.mins = plugin['midi.ins'] | |||||
self.m_bridge_info.mouts = plugin['midi.outs'] | |||||
return pointer(self.m_bridge_info) | return pointer(self.m_bridge_info) | ||||
elif (ptype == PLUGIN_LADSPA): | elif (ptype == PLUGIN_LADSPA): | ||||
@@ -3340,7 +3342,21 @@ if __name__ == '__main__': | |||||
gui = CarlaMainW() | gui = CarlaMainW() | ||||
# Init backend | # Init backend | ||||
CarlaHost.set_option(OPTION_GLOBAL_JACK_CLIENT, 0, "") | |||||
CarlaHost.set_option(OPTION_GLOBAL_JACK_CLIENT, gui.settings.value("Engine/GlobalClient", False, type=bool), "") | |||||
CarlaHost.set_option(OPTION_USE_DSSI_CHUNKS, gui.settings.value("Engine/DSSIChunks", False, type=bool), "") | |||||
CarlaHost.set_option(OPTION_PREFER_UI_BRIDGES, gui.settings.value("Engine/PreferBridges", True, type=bool), "") | |||||
if (carla_bridge_unix32): | |||||
CarlaHost.set_option(OPTION_PATH_BRIDGE_UNIX32, 0, carla_bridge_unix32) | |||||
if (carla_bridge_unix32): | |||||
CarlaHost.set_option(OPTION_PATH_BRIDGE_UNIX64, 0, carla_bridge_unix64) | |||||
if (carla_bridge_win32): | |||||
CarlaHost.set_option(OPTION_PATH_BRIDGE_WIN32, 0, carla_bridge_win32) | |||||
if (carla_bridge_win64): | |||||
CarlaHost.set_option(OPTION_PATH_BRIDGE_WIN64, 0, carla_bridge_win64) | |||||
if (not CarlaHost.carla_init("Carla")): | if (not CarlaHost.carla_init("Carla")): | ||||
CustomMessageBox(None, QMessageBox.Critical, "Error", "Could not connect to JACK", | CustomMessageBox(None, QMessageBox.Critical, "Error", "Could not connect to JACK", | ||||
@@ -81,6 +81,18 @@ bool carla_close() | |||||
get_real_plugin_name(0); | get_real_plugin_name(0); | ||||
set_last_error(nullptr); | set_last_error(nullptr); | ||||
if (carla_options.bridge_unix32) | |||||
free((void*)carla_options.bridge_unix32); | |||||
if (carla_options.bridge_unix64) | |||||
free((void*)carla_options.bridge_unix64); | |||||
if (carla_options.bridge_win32) | |||||
free((void*)carla_options.bridge_win32); | |||||
if (carla_options.bridge_win64) | |||||
free((void*)carla_options.bridge_win64); | |||||
return closed; | return closed; | ||||
} | } | ||||
@@ -584,13 +596,27 @@ const char* get_program_name(unsigned short plugin_id, uint32_t program_id) | |||||
{ | { | ||||
qDebug("get_program_name(%i, %i)", plugin_id, program_id); | qDebug("get_program_name(%i, %i)", plugin_id, program_id); | ||||
static const char* program_name = nullptr; | |||||
if (program_name) | |||||
free((void*)program_name); | |||||
program_name = nullptr; | |||||
for (unsigned short i=0; i<MAX_PLUGINS; i++) | for (unsigned short i=0; i<MAX_PLUGINS; i++) | ||||
{ | { | ||||
CarlaPlugin* plugin = CarlaPlugins[i]; | CarlaPlugin* plugin = CarlaPlugins[i]; | ||||
if (plugin && plugin->id() == plugin_id) | if (plugin && plugin->id() == plugin_id) | ||||
{ | { | ||||
if (program_id < plugin->prog_count()) | if (program_id < plugin->prog_count()) | ||||
return plugin->prog_name(program_id); | |||||
{ | |||||
char buf_str[STR_MAX] = { 0 }; | |||||
plugin->get_program_name(program_id, buf_str); | |||||
program_name = strdup(buf_str); | |||||
return program_name; | |||||
} | |||||
else | else | ||||
qCritical("get_program_name(%i, %i) - program_id out of bounds", plugin_id, program_id); | qCritical("get_program_name(%i, %i) - program_id out of bounds", plugin_id, program_id); | ||||
@@ -606,13 +632,27 @@ const char* get_midi_program_name(unsigned short plugin_id, uint32_t midi_progra | |||||
{ | { | ||||
qDebug("get_midi_program_name(%i, %i)", plugin_id, midi_program_id); | qDebug("get_midi_program_name(%i, %i)", plugin_id, midi_program_id); | ||||
static const char* midi_program_name = nullptr; | |||||
if (midi_program_name) | |||||
free((void*)midi_program_name); | |||||
midi_program_name = nullptr; | |||||
for (unsigned short i=0; i<MAX_PLUGINS; i++) | for (unsigned short i=0; i<MAX_PLUGINS; i++) | ||||
{ | { | ||||
CarlaPlugin* plugin = CarlaPlugins[i]; | CarlaPlugin* plugin = CarlaPlugins[i]; | ||||
if (plugin && plugin->id() == plugin_id) | if (plugin && plugin->id() == plugin_id) | ||||
{ | { | ||||
if (midi_program_id < plugin->midiprog_count()) | if (midi_program_id < plugin->midiprog_count()) | ||||
return plugin->midiprog_name(midi_program_id); | |||||
{ | |||||
char buf_str[STR_MAX] = { 0 }; | |||||
plugin->get_midi_program_name(midi_program_id, buf_str); | |||||
midi_program_name = strdup(buf_str); | |||||
return midi_program_name; | |||||
} | |||||
else | else | ||||
qCritical("get_midi_program_name(%i, %i) - program_id out of bounds", plugin_id, midi_program_id); | qCritical("get_midi_program_name(%i, %i) - program_id out of bounds", plugin_id, midi_program_id); | ||||
@@ -695,7 +735,8 @@ double get_default_parameter_value(unsigned short plugin_id, uint32_t parameter_ | |||||
if (plugin && plugin->id() == plugin_id) | if (plugin && plugin->id() == plugin_id) | ||||
{ | { | ||||
if (parameter_id < plugin->param_count()) | if (parameter_id < plugin->param_count()) | ||||
return plugin->get_default_parameter_value(parameter_id); | |||||
return plugin->param_ranges(parameter_id)->def; | |||||
//return plugin->get_default_parameter_value(parameter_id); | |||||
else | else | ||||
qCritical("get_default_parameter_value(%i, %i) - parameter_id out of bounds", plugin_id, parameter_id); | qCritical("get_default_parameter_value(%i, %i) - parameter_id out of bounds", plugin_id, parameter_id); | ||||
@@ -1066,6 +1107,24 @@ void set_option(OptionsType option, int value, const char* value_str) | |||||
case OPTION_GLOBAL_JACK_CLIENT: | case OPTION_GLOBAL_JACK_CLIENT: | ||||
carla_options.global_jack_client = value; | carla_options.global_jack_client = value; | ||||
break; | break; | ||||
case OPTION_USE_DSSI_CHUNKS: | |||||
carla_options.use_dssi_chunks = value; | |||||
break; | |||||
case OPTION_PREFER_UI_BRIDGES: | |||||
carla_options.prefer_ui_bridges = value; | |||||
break; | |||||
case OPTION_PATH_BRIDGE_UNIX32: | |||||
carla_options.bridge_unix32 = strdup(value_str); | |||||
break; | |||||
case OPTION_PATH_BRIDGE_UNIX64: | |||||
carla_options.bridge_unix64 = strdup(value_str); | |||||
break; | |||||
case OPTION_PATH_BRIDGE_WIN32: | |||||
carla_options.bridge_win32 = strdup(value_str); | |||||
break; | |||||
case OPTION_PATH_BRIDGE_WIN64: | |||||
carla_options.bridge_win64 = strdup(value_str); | |||||
break; | |||||
default: | default: | ||||
break; | break; | ||||
} | } | ||||
@@ -111,7 +111,11 @@ enum GuiType { | |||||
enum OptionsType { | enum OptionsType { | ||||
OPTION_GLOBAL_JACK_CLIENT = 1, | OPTION_GLOBAL_JACK_CLIENT = 1, | ||||
OPTION_USE_DSSI_CHUNKS = 2, | OPTION_USE_DSSI_CHUNKS = 2, | ||||
OPTION_PREFER_UI_BRIDGES = 3 | |||||
OPTION_PREFER_UI_BRIDGES = 3, | |||||
OPTION_PATH_BRIDGE_UNIX32 = 4, | |||||
OPTION_PATH_BRIDGE_UNIX64 = 5, | |||||
OPTION_PATH_BRIDGE_WIN32 = 6, | |||||
OPTION_PATH_BRIDGE_WIN64 = 7 | |||||
}; | }; | ||||
enum CallbackType { | enum CallbackType { | ||||
@@ -208,6 +212,8 @@ struct PluginBridgeInfo { | |||||
long unique_id; | long unique_id; | ||||
uint32_t ains; | uint32_t ains; | ||||
uint32_t aouts; | uint32_t aouts; | ||||
uint32_t mins; | |||||
uint32_t mouts; | |||||
}; | }; | ||||
struct carla_options_t { | struct carla_options_t { | ||||
@@ -215,6 +221,10 @@ struct carla_options_t { | |||||
bool global_jack_client; | bool global_jack_client; | ||||
bool use_dssi_chunks; | bool use_dssi_chunks; | ||||
bool prefer_ui_bridges; | bool prefer_ui_bridges; | ||||
const char* bridge_unix32; | |||||
const char* bridge_unix64; | |||||
const char* bridge_win32; | |||||
const char* bridge_win64; | |||||
}; | }; | ||||
typedef void (*CallbackFunc)(CallbackType action, unsigned short plugin_id, int value1, int value2, double value3); | typedef void (*CallbackFunc)(CallbackType action, unsigned short plugin_id, int value1, int value2, double value3); | ||||
@@ -58,6 +58,7 @@ public: | |||||
delete m_thread; | delete m_thread; | ||||
} | } | ||||
#if 0 | |||||
virtual PluginCategory category() | virtual PluginCategory category() | ||||
{ | { | ||||
return m_info.category; | return m_info.category; | ||||
@@ -80,14 +81,12 @@ public: | |||||
virtual uint32_t min_count() | virtual uint32_t min_count() | ||||
{ | { | ||||
// TODO - add this to pluginbridgeinfo | |||||
return 0; //m_info.mins; | |||||
return m_info.mins; | |||||
} | } | ||||
virtual uint32_t mout_count() | virtual uint32_t mout_count() | ||||
{ | { | ||||
// TODO - add this to pluginbridgeinfo | |||||
return 0; //m_info.mouts; | |||||
return m_info.mouts; | |||||
} | } | ||||
virtual void get_label(char* buf_str) | virtual void get_label(char* buf_str) | ||||
@@ -110,13 +109,6 @@ public: | |||||
strncpy(buf_str, m_info.name, STR_MAX); | strncpy(buf_str, m_info.name, STR_MAX); | ||||
} | } | ||||
virtual void get_audio_port_count_info(PortCountInfo* info) | |||||
{ | |||||
info->ins = m_info.ains; | |||||
info->outs = m_info.aouts; | |||||
info->total = m_info.ains + m_info.aouts; | |||||
} | |||||
virtual void reload() | virtual void reload() | ||||
{ | { | ||||
// plugin checks | // plugin checks | ||||
@@ -133,6 +125,7 @@ public: | |||||
m_hints |= m_info.hints; | m_hints |= m_info.hints; | ||||
} | } | ||||
#endif | |||||
bool init(const char* filename, const char* label, void* extra_stuff) | bool init(const char* filename, const char* label, void* extra_stuff) | ||||
{ | { | ||||
@@ -356,10 +356,10 @@ public: | |||||
} | } | ||||
// FIXME - remove this? | // FIXME - remove this? | ||||
double get_default_parameter_value(uint32_t param_id) | |||||
{ | |||||
return param.ranges[param_id].def; | |||||
} | |||||
// double get_default_parameter_value(uint32_t param_id) | |||||
// { | |||||
// return param.ranges[param_id].def; | |||||
// } | |||||
virtual void get_label(char* buf_str) | virtual void get_label(char* buf_str) | ||||
{ | { | ||||
@@ -381,34 +381,34 @@ public: | |||||
*buf_str = 0; | *buf_str = 0; | ||||
} | } | ||||
virtual void get_parameter_name(uint32_t /*index*/, char* buf_str) | |||||
virtual void get_parameter_name(uint32_t /*param_id*/, char* buf_str) | |||||
{ | { | ||||
*buf_str = 0; | *buf_str = 0; | ||||
} | } | ||||
virtual void get_parameter_symbol(uint32_t /*index*/, char* buf_str) | |||||
virtual void get_parameter_symbol(uint32_t /*param_id*/, char* buf_str) | |||||
{ | { | ||||
*buf_str = 0; | *buf_str = 0; | ||||
} | } | ||||
virtual void get_parameter_label(uint32_t /*index*/, char* buf_str) | |||||
virtual void get_parameter_label(uint32_t /*param_id*/, char* buf_str) | |||||
{ | { | ||||
*buf_str = 0; | *buf_str = 0; | ||||
} | } | ||||
virtual void get_parameter_scalepoint_label(uint32_t /*pindex*/, uint32_t /*index*/, char* buf_str) | |||||
virtual void get_parameter_scalepoint_label(uint32_t /*param_id*/, uint32_t /*scalepoint_id*/, char* buf_str) | |||||
{ | { | ||||
*buf_str = 0; | *buf_str = 0; | ||||
} | } | ||||
const char* prog_name(uint32_t index) | |||||
void get_program_name(uint32_t program_id, char* buf_str) | |||||
{ | { | ||||
return prog.names[index]; | |||||
strncpy(buf_str, prog.names[program_id], STR_MAX); | |||||
} | } | ||||
const char* midiprog_name(uint32_t index) | |||||
void get_midi_program_name(uint32_t midiprogram_id, char* buf_str) | |||||
{ | { | ||||
return midiprog.data[index].name; | |||||
strncpy(buf_str, midiprog.data[midiprogram_id].name, STR_MAX); | |||||
} | } | ||||
void get_parameter_count_info(PortCountInfo* info) | void get_parameter_count_info(PortCountInfo* info) | ||||
@@ -606,11 +606,11 @@ public: | |||||
virtual void set_custom_data(CustomDataType dtype, const char* key, const char* value, bool) | virtual void set_custom_data(CustomDataType dtype, const char* key, const char* value, bool) | ||||
{ | { | ||||
qDebug("set_custom_data(%i, %s, %s)", dtype, key, value); | |||||
bool save_data = true; | bool save_data = true; | ||||
bool already_have = false; | bool already_have = false; | ||||
qDebug("set_custom_data(%i, %s, %s)", dtype, key, value); | |||||
switch (dtype) | switch (dtype) | ||||
{ | { | ||||
case CUSTOM_DATA_INVALID: | case CUSTOM_DATA_INVALID: | ||||
@@ -716,7 +716,7 @@ public: | |||||
callback_action(CALLBACK_MIDI_PROGRAM_CHANGED, m_id, midiprog.current, 0, 0.0); | callback_action(CALLBACK_MIDI_PROGRAM_CHANGED, m_id, midiprog.current, 0, 0.0); | ||||
} | } | ||||
virtual void send_midi_note(bool onoff, uint8_t note, uint8_t velo, bool, bool osc_send, bool callback_send) | |||||
void send_midi_note(bool onoff, uint8_t note, uint8_t velo, bool, bool osc_send, bool callback_send) | |||||
{ | { | ||||
carla_midi_lock(); | carla_midi_lock(); | ||||
for (unsigned int i=0; i<MAX_MIDI_EVENTS; i++) | for (unsigned int i=0; i<MAX_MIDI_EVENTS; i++) | ||||
@@ -820,6 +820,11 @@ public: | |||||
post_events.lock.unlock(); | post_events.lock.unlock(); | ||||
} | } | ||||
virtual int set_osc_bridge_info(PluginBridgeInfoType, lo_arg**) | |||||
{ | |||||
return 1; | |||||
} | |||||
#ifndef BUILD_BRIDGE | #ifndef BUILD_BRIDGE | ||||
void update_osc_data(lo_address source, const char* url) | void update_osc_data(lo_address source, const char* url) | ||||
{ | { | ||||
@@ -921,7 +926,7 @@ public: | |||||
qDebug("CarlaPlugin::remove_from_jack() - end"); | qDebug("CarlaPlugin::remove_from_jack() - end"); | ||||
} | } | ||||
void delete_buffers() | |||||
virtual void delete_buffers() | |||||
{ | { | ||||
qDebug("CarlaPlugin::delete_buffers() - start"); | qDebug("CarlaPlugin::delete_buffers() - start"); | ||||
@@ -955,11 +960,6 @@ public: | |||||
qDebug("CarlaPlugin::delete_buffers() - end"); | qDebug("CarlaPlugin::delete_buffers() - end"); | ||||
} | } | ||||
virtual int set_osc_bridge_info(PluginBridgeInfoType, lo_arg**) | |||||
{ | |||||
return 1; | |||||
} | |||||
bool lib_open(const char* filename) | bool lib_open(const char* filename) | ||||
{ | { | ||||
#ifdef Q_OS_WIN | #ifdef Q_OS_WIN | ||||
@@ -33,12 +33,16 @@ carla_options_t carla_options = { | |||||
#ifdef BUILD_BRIDGE | #ifdef BUILD_BRIDGE | ||||
/* global_jack_client */ false, | /* global_jack_client */ false, | ||||
/* use_dssi_chunks */ false, | /* use_dssi_chunks */ false, | ||||
/* prefer_ui_bridges */ false | |||||
/* prefer_ui_bridges */ false, | |||||
#else | #else | ||||
/* global_jack_client */ true, | /* global_jack_client */ true, | ||||
/* use_dssi_chunks */ false, | /* use_dssi_chunks */ false, | ||||
/* prefer_ui_bridges */ true | |||||
/* prefer_ui_bridges */ true, | |||||
#endif | #endif | ||||
/* bridge_unix32 */ nullptr, | |||||
/* bridge_unix64 */ nullptr, | |||||
/* bridge_win32 */ nullptr, | |||||
/* bridge_win64 */ nullptr | |||||
}; | }; | ||||
CallbackFunc Callback = nullptr; | CallbackFunc Callback = nullptr; | ||||
@@ -78,19 +82,18 @@ const char* bool2str(bool yesno) | |||||
const char* binarytype2str(BinaryType type) | const char* binarytype2str(BinaryType type) | ||||
{ | { | ||||
// TODO - use global options | |||||
switch (type) | switch (type) | ||||
{ | { | ||||
case BINARY_UNIX32: | case BINARY_UNIX32: | ||||
return "/home/falktx/Personal/FOSS/GIT/Cadence/src/carla-bridge/carla-bridge-win32.exe"; | |||||
return carla_options.bridge_unix32; | |||||
case BINARY_UNIX64: | case BINARY_UNIX64: | ||||
return "/home/falktx/Personal/FOSS/GIT/Cadence/src/carla-bridge/carla-bridge-win32.exe"; | |||||
return carla_options.bridge_unix64; | |||||
case BINARY_WIN32: | case BINARY_WIN32: | ||||
return "/home/falktx/Personal/FOSS/GIT/Cadence/src/carla-bridge/carla-bridge-win32.exe"; | |||||
return carla_options.bridge_win32; | |||||
case BINARY_WIN64: | case BINARY_WIN64: | ||||
return "/home/falktx/Personal/FOSS/GIT/Cadence/src/carla-bridge/carla-bridge-win32.exe"; | |||||
return carla_options.bridge_win64; | |||||
default: | default: | ||||
return ""; | |||||
return nullptr; | |||||
} | } | ||||
} | } | ||||
@@ -31,7 +31,10 @@ public: | |||||
descriptor = nullptr; | descriptor = nullptr; | ||||
ldescriptor = nullptr; | ldescriptor = nullptr; | ||||
// FIXME? | |||||
ain_rindexes = nullptr; | |||||
aout_rindexes = nullptr; | |||||
param_buffers = nullptr; | |||||
memset(midi_events, 0, sizeof(snd_seq_event_t)*MAX_MIDI_EVENTS); | memset(midi_events, 0, sizeof(snd_seq_event_t)*MAX_MIDI_EVENTS); | ||||
} | } | ||||
@@ -100,6 +103,11 @@ public: | |||||
return 0; | return 0; | ||||
} | } | ||||
virtual double get_parameter_value(uint32_t param_id) | |||||
{ | |||||
return param_buffers[param_id]; | |||||
} | |||||
virtual void get_label(char* buf_str) | virtual void get_label(char* buf_str) | ||||
{ | { | ||||
strncpy(buf_str, ldescriptor->Label, STR_MAX); | strncpy(buf_str, ldescriptor->Label, STR_MAX); | ||||
@@ -120,9 +128,9 @@ public: | |||||
strncpy(buf_str, ldescriptor->Name, STR_MAX); | strncpy(buf_str, ldescriptor->Name, STR_MAX); | ||||
} | } | ||||
virtual void get_parameter_name(uint32_t index, char* buf_str) | |||||
virtual void get_parameter_name(uint32_t param_id, char* buf_str) | |||||
{ | { | ||||
int32_t rindex = param.data[index].rindex; | |||||
int32_t rindex = param.data[param_id].rindex; | |||||
strncpy(buf_str, ldescriptor->PortNames[rindex], STR_MAX); | strncpy(buf_str, ldescriptor->PortNames[rindex], STR_MAX); | ||||
} | } | ||||
@@ -134,11 +142,6 @@ public: | |||||
info->type = GUI_NONE; | info->type = GUI_NONE; | ||||
} | } | ||||
virtual double get_current_parameter_value(uint32_t index) | |||||
{ | |||||
return param_buffers[index]; | |||||
} | |||||
virtual void set_parameter_value(uint32_t index, double value, bool gui_send, bool osc_send, bool callback_send) | virtual void set_parameter_value(uint32_t index, double value, bool gui_send, bool osc_send, bool callback_send) | ||||
{ | { | ||||
param_buffers[index] = value; | param_buffers[index] = value; | ||||
@@ -1093,6 +1096,26 @@ public: | |||||
m_active_before = m_active; | m_active_before = m_active; | ||||
} | } | ||||
virtual void delete_buffers() | |||||
{ | |||||
qDebug("DssiPlugin::delete_buffers() - start"); | |||||
if (ain.count > 0) | |||||
delete[] ain_rindexes; | |||||
if (aout.count > 0) | |||||
delete[] aout_rindexes; | |||||
if (param.count > 0) | |||||
delete[] param_buffers; | |||||
ain_rindexes = nullptr; | |||||
aout_rindexes = nullptr; | |||||
param_buffers = nullptr; | |||||
qDebug("DssiPlugin::delete_buffers() - end"); | |||||
} | |||||
bool init(const char* filename, const char* label, void* extra_stuff) | bool init(const char* filename, const char* label, void* extra_stuff) | ||||
{ | { | ||||
if (lib_open(filename)) | if (lib_open(filename)) | ||||
@@ -72,6 +72,10 @@ public: | |||||
handle = nullptr; | handle = nullptr; | ||||
descriptor = nullptr; | descriptor = nullptr; | ||||
rdf_descriptor = nullptr; | rdf_descriptor = nullptr; | ||||
ain_rindexes = nullptr; | |||||
aout_rindexes = nullptr; | |||||
param_buffers = nullptr; | |||||
} | } | ||||
virtual ~LadspaPlugin() | virtual ~LadspaPlugin() | ||||
@@ -147,6 +151,11 @@ public: | |||||
return 0; | return 0; | ||||
} | } | ||||
virtual double get_parameter_value(uint32_t param_id) | |||||
{ | |||||
return param_buffers[param_id]; | |||||
} | |||||
virtual double get_parameter_scalepoint_value(uint32_t param_id, uint32_t scalepoint_id) | virtual double get_parameter_scalepoint_value(uint32_t param_id, uint32_t scalepoint_id) | ||||
{ | { | ||||
int32_t param_rindex = param.data[param_id].rindex; | int32_t param_rindex = param.data[param_id].rindex; | ||||
@@ -181,15 +190,15 @@ public: | |||||
strncpy(buf_str, descriptor->Name, STR_MAX); | strncpy(buf_str, descriptor->Name, STR_MAX); | ||||
} | } | ||||
virtual void get_parameter_name(uint32_t index, char* buf_str) | |||||
virtual void get_parameter_name(uint32_t param_id, char* buf_str) | |||||
{ | { | ||||
int32_t rindex = param.data[index].rindex; | |||||
int32_t rindex = param.data[param_id].rindex; | |||||
strncpy(buf_str, descriptor->PortNames[rindex], STR_MAX); | strncpy(buf_str, descriptor->PortNames[rindex], STR_MAX); | ||||
} | } | ||||
virtual void get_parameter_symbol(uint32_t index, char* buf_str) | |||||
virtual void get_parameter_symbol(uint32_t param_id, char* buf_str) | |||||
{ | { | ||||
int32_t rindex = param.data[index].rindex; | |||||
int32_t rindex = param.data[param_id].rindex; | |||||
bool HasPortRDF = (rdf_descriptor && rindex < (int32_t)rdf_descriptor->PortCount); | bool HasPortRDF = (rdf_descriptor && rindex < (int32_t)rdf_descriptor->PortCount); | ||||
if (HasPortRDF) | if (HasPortRDF) | ||||
@@ -204,9 +213,9 @@ public: | |||||
*buf_str = 0; | *buf_str = 0; | ||||
} | } | ||||
virtual void get_parameter_label(uint32_t index, char* buf_str) | |||||
virtual void get_parameter_label(uint32_t param_id, char* buf_str) | |||||
{ | { | ||||
int32_t rindex = param.data[index].rindex; | |||||
int32_t rindex = param.data[param_id].rindex; | |||||
bool HasPortRDF = (rdf_descriptor && rindex < (int32_t)rdf_descriptor->PortCount); | bool HasPortRDF = (rdf_descriptor && rindex < (int32_t)rdf_descriptor->PortCount); | ||||
if (HasPortRDF) | if (HasPortRDF) | ||||
@@ -240,22 +249,17 @@ public: | |||||
*buf_str = 0; | *buf_str = 0; | ||||
} | } | ||||
virtual void get_parameter_scalepoint_label(uint32_t pindex, uint32_t index, char* buf_str) | |||||
virtual void get_parameter_scalepoint_label(uint32_t param_id, uint32_t scalepoint_id, char* buf_str) | |||||
{ | { | ||||
int32_t prindex = param.data[pindex].rindex; | |||||
int32_t param_rindex = param.data[param_id].rindex; | |||||
bool HasPortRDF = (rdf_descriptor && prindex < (int32_t)rdf_descriptor->PortCount); | |||||
bool HasPortRDF = (rdf_descriptor && param_rindex < (int32_t)rdf_descriptor->PortCount); | |||||
if (HasPortRDF) | if (HasPortRDF) | ||||
strncpy(buf_str, rdf_descriptor->Ports[prindex].ScalePoints[index].Label, STR_MAX); | |||||
strncpy(buf_str, rdf_descriptor->Ports[param_rindex].ScalePoints[scalepoint_id].Label, STR_MAX); | |||||
else | else | ||||
*buf_str = 0; | *buf_str = 0; | ||||
} | } | ||||
virtual double get_current_parameter_value(uint32_t index) | |||||
{ | |||||
return param_buffers[index]; | |||||
} | |||||
virtual void set_parameter_value(uint32_t index, double value, bool gui_send, bool osc_send, bool callback_send) | virtual void set_parameter_value(uint32_t index, double value, bool gui_send, bool osc_send, bool callback_send) | ||||
{ | { | ||||
param_buffers[index] = value; | param_buffers[index] = value; | ||||
@@ -866,6 +870,26 @@ public: | |||||
m_active_before = m_active; | m_active_before = m_active; | ||||
} | } | ||||
virtual void delete_buffers() | |||||
{ | |||||
qDebug("LadspaPlugin::delete_buffers() - start"); | |||||
if (ain.count > 0) | |||||
delete[] ain_rindexes; | |||||
if (aout.count > 0) | |||||
delete[] aout_rindexes; | |||||
if (param.count > 0) | |||||
delete[] param_buffers; | |||||
ain_rindexes = nullptr; | |||||
aout_rindexes = nullptr; | |||||
param_buffers = nullptr; | |||||
qDebug("LadspaPlugin::delete_buffers() - end"); | |||||
} | |||||
bool init(const char* filename, const char* label, void* extra_stuff) | bool init(const char* filename, const char* label, void* extra_stuff) | ||||
{ | { | ||||
if (lib_open(filename)) | if (lib_open(filename)) | ||||
@@ -120,6 +120,7 @@ public: | |||||
custom_uri_ids.clear(); | custom_uri_ids.clear(); | ||||
} | } | ||||
#if 0 | |||||
virtual PluginCategory category() | virtual PluginCategory category() | ||||
{ | { | ||||
LV2_Property Category = rdf_descriptor->Type; | LV2_Property Category = rdf_descriptor->Type; | ||||
@@ -287,6 +288,7 @@ public: | |||||
qDebug("Lv2Plugin::lv2_delete_buffers() - end"); | qDebug("Lv2Plugin::lv2_delete_buffers() - end"); | ||||
} | } | ||||
#endif | |||||
bool init(const char* filename, const char* URI, void* extra_stuff) | bool init(const char* filename, const char* URI, void* extra_stuff) | ||||
{ | { | ||||
@@ -48,6 +48,7 @@ public: | |||||
delete_fluid_settings(f_settings); | delete_fluid_settings(f_settings); | ||||
} | } | ||||
#if 0 | |||||
virtual PluginCategory category() | virtual PluginCategory category() | ||||
{ | { | ||||
return PLUGIN_CATEGORY_SYNTH; | return PLUGIN_CATEGORY_SYNTH; | ||||
@@ -1002,6 +1003,7 @@ public: | |||||
active_before = active; | active_before = active; | ||||
#endif | #endif | ||||
} | } | ||||
#endif | |||||
bool init(const char* filename, const char* label) | bool init(const char* filename, const char* label) | ||||
{ | { | ||||
@@ -78,6 +78,7 @@ public: | |||||
} | } | ||||
} | } | ||||
#if 0 | |||||
virtual PluginCategory category() | virtual PluginCategory category() | ||||
{ | { | ||||
intptr_t VstCategory = effect->dispatcher(effect, effGetPlugCategory, 0, 0, nullptr, 0.0f); | intptr_t VstCategory = effect->dispatcher(effect, effGetPlugCategory, 0, 0, nullptr, 0.0f); | ||||
@@ -129,6 +130,7 @@ public: | |||||
{ | { | ||||
effect->dispatcher(effect, effGetEffectName, 0, 0, buf_str, 0.0f); | effect->dispatcher(effect, effGetEffectName, 0, 0, buf_str, 0.0f); | ||||
} | } | ||||
#endif | |||||
private: | private: | ||||
AEffect* effect; | AEffect* effect; | ||||
@@ -191,6 +191,11 @@ carla_discovery_unix64 = "" | |||||
carla_discovery_win32 = "" | carla_discovery_win32 = "" | ||||
carla_discovery_win64 = "" | carla_discovery_win64 = "" | ||||
carla_bridge_unix32 = "" | |||||
carla_bridge_unix64 = "" | |||||
carla_bridge_win32 = "" | |||||
carla_bridge_win64 = "" | |||||
#carla_bridge_lv2_gtk2 = "" | #carla_bridge_lv2_gtk2 = "" | ||||
#carla_bridge_lv2_qt4 = "" | #carla_bridge_lv2_qt4 = "" | ||||
#carla_bridge_lv2_x11 = "" | #carla_bridge_lv2_x11 = "" | ||||
@@ -246,6 +251,42 @@ else: | |||||
carla_discovery_win64 = os.path.join(p, "carla-discovery-win64.exe") | carla_discovery_win64 = os.path.join(p, "carla-discovery-win64.exe") | ||||
break | break | ||||
# bridge-unix32 | |||||
if (os.path.exists(os.path.join(CWD, "carla-bridge", "carla-bridge-unix32"))): | |||||
carla_bridge_unix32 = os.path.join(CWD, "carla-bridge", "carla-bridge-unix32") | |||||
else: | |||||
for p in PATH: | |||||
if (os.path.exists(os.path.join(p, "carla-bridge-unix32"))): | |||||
carla_bridge_unix32 = os.path.join(p, "carla-bridge-unix32") | |||||
break | |||||
# bridge-unix64 | |||||
if (os.path.exists(os.path.join(CWD, "carla-bridge", "carla-bridge-unix64"))): | |||||
carla_bridge_unix64 = os.path.join(CWD, "carla-bridge", "carla-bridge-unix64") | |||||
else: | |||||
for p in PATH: | |||||
if (os.path.exists(os.path.join(p, "carla-bridge-unix64"))): | |||||
carla_bridge_unix64 = os.path.join(p, "carla-bridge-unix64") | |||||
break | |||||
# bridge-win32 | |||||
if (os.path.exists(os.path.join(CWD, "carla-bridge", "carla-bridge-win32.exe"))): | |||||
carla_bridge_win32 = os.path.join(CWD, "carla-bridge", "carla-bridge-win32.exe") | |||||
else: | |||||
for p in PATH: | |||||
if (os.path.exists(os.path.join(p, "carla-bridge-wine32.exe"))): | |||||
carla_bridge_win32 = os.path.join(p, "carla-bridge-win32.exe") | |||||
break | |||||
# bridge-win64 | |||||
if (os.path.exists(os.path.join(CWD, "carla-bridge", "carla-bridge-win64.exe"))): | |||||
carla_bridge_win64 = os.path.join(CWD, "carla-bridge", "carla-bridge-win64.exe") | |||||
else: | |||||
for p in PATH: | |||||
if (os.path.exists(os.path.join(p, "carla-bridge-win64.exe"))): | |||||
carla_bridge_win64 = os.path.join(p, "carla-bridge-win64.exe") | |||||
break | |||||
## lv2-gtk2 | ## lv2-gtk2 | ||||
#if (os.path.exists(os.path.join(CWD, "carla-bridges", "carla-bridge-lv2-gtk2"))): | #if (os.path.exists(os.path.join(CWD, "carla-bridges", "carla-bridge-lv2-gtk2"))): | ||||
#carla_bridge_lv2_gtk2 = os.path.join(CWD, "carla-bridges", "carla-bridge-lv2-gtk2") | #carla_bridge_lv2_gtk2 = os.path.join(CWD, "carla-bridges", "carla-bridge-lv2-gtk2") | ||||
@@ -295,12 +336,10 @@ print("carla_discovery_unix32 ->", carla_discovery_unix32) | |||||
print("carla_discovery_unix64 ->", carla_discovery_unix64) | print("carla_discovery_unix64 ->", carla_discovery_unix64) | ||||
print("carla_discovery_win32 ->", carla_discovery_win32) | print("carla_discovery_win32 ->", carla_discovery_win32) | ||||
print("carla_discovery_win64 ->", carla_discovery_win64) | print("carla_discovery_win64 ->", carla_discovery_win64) | ||||
print("LADSPA ->", DEFAULT_LADSPA_PATH) | |||||
print("DSSI ->", DEFAULT_DSSI_PATH) | |||||
print("LV2 ->", DEFAULT_LV2_PATH) | |||||
print("VST ->", DEFAULT_VST_PATH) | |||||
print("SF2 ->", DEFAULT_SF2_PATH) | |||||
print("carla_bridge_unix32 ->", carla_bridge_unix32) | |||||
print("carla_bridge_unix64 ->", carla_bridge_unix64) | |||||
print("carla_bridge_win32 ->", carla_bridge_win32) | |||||
print("carla_bridge_win64 ->", carla_bridge_win64) | |||||
# ------------------------------------------------------------------------------------------------ | # ------------------------------------------------------------------------------------------------ | ||||
# Plugin Query (helper functions) | # Plugin Query (helper functions) | ||||
@@ -657,6 +696,10 @@ GUI_EXTERNAL_LV2 = 4 | |||||
OPTION_GLOBAL_JACK_CLIENT = 1 | OPTION_GLOBAL_JACK_CLIENT = 1 | ||||
OPTION_USE_DSSI_CHUNKS = 2 | OPTION_USE_DSSI_CHUNKS = 2 | ||||
OPTION_PREFER_UI_BRIDGES = 3 | OPTION_PREFER_UI_BRIDGES = 3 | ||||
OPTION_PATH_BRIDGE_UNIX32 = 4 | |||||
OPTION_PATH_BRIDGE_UNIX64 = 5 | |||||
OPTION_PATH_BRIDGE_WIN32 = 6 | |||||
OPTION_PATH_BRIDGE_WIN64 = 7 | |||||
# enum CallbackType | # enum CallbackType | ||||
CALLBACK_DEBUG = 0 | CALLBACK_DEBUG = 0 | ||||
@@ -760,7 +803,9 @@ class PluginBridgeInfo(Structure): | |||||
("maker", c_char_p), | ("maker", c_char_p), | ||||
("unique_id", c_long), | ("unique_id", c_long), | ||||
("ains", c_uint32), | ("ains", c_uint32), | ||||
("aouts", c_uint32) | |||||
("aouts", c_uint32), | |||||
("mins", c_uint32), | |||||
("mouts", c_uint32) | |||||
] | ] | ||||
CallbackFunc = CFUNCTYPE(None, c_enum, c_ushort, c_int, c_int, c_double) | CallbackFunc = CFUNCTYPE(None, c_enum, c_ushort, c_int, c_int, c_double) | ||||