@@ -176,7 +176,7 @@ bool remove_plugin(unsigned short plugin_id) | |||
osc_global_send_remove_plugin(plugin->id()); | |||
carla_proc_lock(); | |||
plugin->set_enabled(false); | |||
plugin->setEnabled(false); | |||
carla_proc_unlock(); | |||
if (is_engine_running() && carla_check_thread.isRunning()) | |||
@@ -221,21 +221,21 @@ PluginInfo* get_plugin_info(unsigned short plugin_id) | |||
{ | |||
char buf_str[STR_MAX] = { 0 }; | |||
info.valid = true; | |||
info.type = plugin->type(); | |||
info.category = plugin->category(); | |||
info.hints = plugin->hints(); | |||
info.binary = plugin->filename(); | |||
info.name = plugin->name(); | |||
info.unique_id = plugin->unique_id(); | |||
info.valid = true; | |||
info.type = plugin->type(); | |||
info.category = plugin->category(); | |||
info.hints = plugin->hints(); | |||
info.binary = plugin->filename(); | |||
info.name = plugin->name(); | |||
info.uniqueId = plugin->uniqueId(); | |||
plugin->get_label(buf_str); | |||
plugin->getLabel(buf_str); | |||
info.label = strdup(buf_str); | |||
plugin->get_maker(buf_str); | |||
plugin->getMaker(buf_str); | |||
info.maker = strdup(buf_str); | |||
plugin->get_copyright(buf_str); | |||
plugin->getCopyright(buf_str); | |||
info.copyright = strdup(buf_str); | |||
return &info; | |||
@@ -261,8 +261,8 @@ PortCountInfo* get_audio_port_count_info(unsigned short plugin_id) | |||
if (plugin && plugin->id() == plugin_id) | |||
{ | |||
info.valid = true; | |||
info.ins = plugin->ain_count(); | |||
info.outs = plugin->aout_count(); | |||
info.ins = plugin->audioInCount(); | |||
info.outs = plugin->audioOutCount(); | |||
info.total = info.ins + info.outs; | |||
return &info; | |||
} | |||
@@ -285,8 +285,8 @@ PortCountInfo* get_midi_port_count_info(unsigned short plugin_id) | |||
if (plugin && plugin->id() == plugin_id) | |||
{ | |||
info.valid = true; | |||
info.ins = plugin->min_count(); | |||
info.outs = plugin->mout_count(); | |||
info.ins = plugin->midiInCount(); | |||
info.outs = plugin->midiOutCount(); | |||
info.total = info.ins + info.outs; | |||
return &info; | |||
} | |||
@@ -309,7 +309,7 @@ PortCountInfo* get_parameter_count_info(unsigned short plugin_id) | |||
if (plugin && plugin->id() == plugin_id) | |||
{ | |||
info.valid = true; | |||
plugin->get_parameter_count_info(&info); | |||
plugin->getParameterCountInfo(&info); | |||
return &info; | |||
} | |||
} | |||
@@ -338,20 +338,20 @@ ParameterInfo* get_parameter_info(unsigned short plugin_id, uint32_t parameter_i | |||
CarlaPlugin* plugin = CarlaPlugins[i]; | |||
if (plugin && plugin->id() == plugin_id) | |||
{ | |||
if (parameter_id < plugin->param_count()) | |||
if (parameter_id < plugin->parameterCount()) | |||
{ | |||
char buf_str[STR_MAX] = { 0 }; | |||
info.valid = true; | |||
info.scalepoint_count = plugin->param_scalepoint_count(parameter_id); | |||
info.scalePointCount = plugin->parameterScalePointCount(parameter_id); | |||
plugin->get_parameter_name(parameter_id, buf_str); | |||
plugin->getParameterName(parameter_id, buf_str); | |||
info.name = strdup(buf_str); | |||
plugin->get_parameter_symbol(parameter_id, buf_str); | |||
plugin->getParameterSymbol(parameter_id, buf_str); | |||
info.symbol = strdup(buf_str); | |||
plugin->get_parameter_unit(parameter_id, buf_str); | |||
plugin->getParameterUnit(parameter_id, buf_str); | |||
info.unit = strdup(buf_str); | |||
} | |||
else | |||
@@ -383,16 +383,16 @@ ScalePointInfo* get_scalepoint_info(unsigned short plugin_id, uint32_t parameter | |||
CarlaPlugin* plugin = CarlaPlugins[i]; | |||
if (plugin && plugin->id() == plugin_id) | |||
{ | |||
if (parameter_id < plugin->param_count()) | |||
if (parameter_id < plugin->parameterCount()) | |||
{ | |||
if (scalepoint_id < plugin->param_scalepoint_count(parameter_id)) | |||
if (scalepoint_id < plugin->parameterScalePointCount(parameter_id)) | |||
{ | |||
char buf_str[STR_MAX] = { 0 }; | |||
info.valid = true; | |||
info.value = plugin->get_parameter_scalepoint_value(parameter_id, scalepoint_id); | |||
info.value = plugin->getParameterScalePointValue(parameter_id, scalepoint_id); | |||
plugin->get_parameter_scalepoint_label(parameter_id, scalepoint_id, buf_str); | |||
plugin->getParameterScalePointLabel(parameter_id, scalepoint_id, buf_str); | |||
info.label = strdup(buf_str); | |||
} | |||
else | |||
@@ -423,10 +423,10 @@ MidiProgramInfo* get_midi_program_info(unsigned short plugin_id, uint32_t midi_p | |||
CarlaPlugin* plugin = CarlaPlugins[i]; | |||
if (plugin && plugin->id() == plugin_id) | |||
{ | |||
if (midi_program_id < plugin->midiprog_count()) | |||
if (midi_program_id < plugin->midiProgramCount()) | |||
{ | |||
info.valid = true; | |||
plugin->get_midi_program_info(&info, midi_program_id); | |||
plugin->getMidiProgramInfo(&info, midi_program_id); | |||
} | |||
else | |||
qCritical("get_midi_program_info(%i, %i) - midi_program_id out of bounds", plugin_id, midi_program_id); | |||
@@ -451,7 +451,7 @@ GuiInfo* get_gui_info(unsigned short plugin_id) | |||
CarlaPlugin* plugin = CarlaPlugins[i]; | |||
if (plugin && plugin->id() == plugin_id) | |||
{ | |||
plugin->get_gui_info(&info); | |||
plugin->getGuiInfo(&info); | |||
return &info; | |||
} | |||
} | |||
@@ -471,8 +471,8 @@ const ParameterData* get_parameter_data(unsigned short plugin_id, uint32_t param | |||
CarlaPlugin* plugin = CarlaPlugins[i]; | |||
if (plugin && plugin->id() == plugin_id) | |||
{ | |||
if (parameter_id < plugin->param_count()) | |||
return plugin->param_data(parameter_id); | |||
if (parameter_id < plugin->parameterCount()) | |||
return plugin->parameterData(parameter_id); | |||
else | |||
qCritical("get_parameter_data(%i, %i) - parameter_id out of bounds", plugin_id, parameter_id); | |||
@@ -495,8 +495,8 @@ const ParameterRanges* get_parameter_ranges(unsigned short plugin_id, uint32_t p | |||
CarlaPlugin* plugin = CarlaPlugins[i]; | |||
if (plugin && plugin->id() == plugin_id) | |||
{ | |||
if (parameter_id < plugin->param_count()) | |||
return plugin->param_ranges(parameter_id); | |||
if (parameter_id < plugin->parameterCount()) | |||
return plugin->parameterRanges(parameter_id); | |||
else | |||
qCritical("get_parameter_ranges(%i, %i) - parameter_id out of bounds", plugin_id, parameter_id); | |||
@@ -519,8 +519,8 @@ const CustomData* get_custom_data(unsigned short plugin_id, uint32_t custom_data | |||
CarlaPlugin* plugin = CarlaPlugins[i]; | |||
if (plugin && plugin->id() == plugin_id) | |||
{ | |||
if (custom_data_id < plugin->custom_count()) | |||
return plugin->custom_data(custom_data_id); | |||
if (custom_data_id < plugin->customDataCount()) | |||
return plugin->customData(custom_data_id); | |||
else | |||
qCritical("get_custom_data(%i, %i) - custom_data_id out of bounds", plugin_id, custom_data_id); | |||
@@ -551,7 +551,7 @@ const char* get_chunk_data(unsigned short plugin_id) | |||
if (plugin->hints() & PLUGIN_USES_CHUNKS) | |||
{ | |||
void* data = nullptr; | |||
int32_t data_size = plugin->chunk_data(&data); | |||
int32_t data_size = plugin->chunkData(&data); | |||
if (data && data_size >= 4) | |||
{ | |||
@@ -582,7 +582,7 @@ uint32_t get_parameter_count(unsigned short plugin_id) | |||
{ | |||
CarlaPlugin* plugin = CarlaPlugins[i]; | |||
if (plugin && plugin->id() == plugin_id) | |||
return plugin->param_count(); | |||
return plugin->parameterCount(); | |||
} | |||
qCritical("get_parameter_count(%i) - could not find plugin", plugin_id); | |||
@@ -597,7 +597,7 @@ uint32_t get_program_count(unsigned short plugin_id) | |||
{ | |||
CarlaPlugin* plugin = CarlaPlugins[i]; | |||
if (plugin && plugin->id() == plugin_id) | |||
return plugin->prog_count(); | |||
return plugin->programCount(); | |||
} | |||
qCritical("get_program_count(%i) - could not find plugin", plugin_id); | |||
@@ -612,7 +612,7 @@ uint32_t get_midi_program_count(unsigned short plugin_id) | |||
{ | |||
CarlaPlugin* plugin = CarlaPlugins[i]; | |||
if (plugin && plugin->id() == plugin_id) | |||
return plugin->midiprog_count(); | |||
return plugin->midiProgramCount(); | |||
} | |||
qCritical("get_midi_program_count(%i) - could not find plugin", plugin_id); | |||
@@ -627,7 +627,7 @@ uint32_t get_custom_data_count(unsigned short plugin_id) | |||
{ | |||
CarlaPlugin* plugin = CarlaPlugins[i]; | |||
if (plugin && plugin->id() == plugin_id) | |||
return plugin->custom_count(); | |||
return plugin->customDataCount(); | |||
} | |||
qCritical("get_custom_data_count(%i) - could not find plugin", plugin_id); | |||
@@ -646,8 +646,8 @@ const char* get_parameter_text(unsigned short plugin_id, quint32 parameter_id) | |||
CarlaPlugin* plugin = CarlaPlugins[i]; | |||
if (plugin && plugin->id() == plugin_id) | |||
{ | |||
if (parameter_id < plugin->param_count()) | |||
plugin->get_parameter_text(parameter_id, buf_text); | |||
if (parameter_id < plugin->parameterCount()) | |||
plugin->getParameterText(parameter_id, buf_text); | |||
else | |||
qCritical("get_parameter_text(%i, %i) - parameter_id out of bounds", plugin_id, parameter_id); | |||
@@ -674,11 +674,11 @@ const char* get_program_name(unsigned short plugin_id, uint32_t program_id) | |||
CarlaPlugin* plugin = CarlaPlugins[i]; | |||
if (plugin && plugin->id() == plugin_id) | |||
{ | |||
if (program_id < plugin->prog_count()) | |||
if (program_id < plugin->programCount()) | |||
{ | |||
char buf_str[STR_MAX] = { 0 }; | |||
plugin->get_program_name(program_id, buf_str); | |||
plugin->getProgramName(program_id, buf_str); | |||
program_name = strdup(buf_str); | |||
return program_name; | |||
@@ -712,11 +712,11 @@ const char* get_midi_program_name(unsigned short plugin_id, uint32_t midi_progra | |||
CarlaPlugin* plugin = CarlaPlugins[i]; | |||
if (plugin && plugin->id() == plugin_id) | |||
{ | |||
if (midi_program_id < plugin->midiprog_count()) | |||
if (midi_program_id < plugin->midiProgramCount()) | |||
{ | |||
char buf_str[STR_MAX] = { 0 }; | |||
plugin->get_midi_program_name(midi_program_id, buf_str); | |||
plugin->getMidiProgramName(midi_program_id, buf_str); | |||
midi_program_name = strdup(buf_str); | |||
return midi_program_name; | |||
@@ -752,7 +752,7 @@ const char* get_real_plugin_name(unsigned short plugin_id) | |||
{ | |||
char buf_str[STR_MAX] = { 0 }; | |||
plugin->get_real_name(buf_str); | |||
plugin->getRealName(buf_str); | |||
real_plugin_name = strdup(buf_str); | |||
return real_plugin_name; | |||
@@ -773,7 +773,7 @@ qint32 get_current_program_index(unsigned short plugin_id) | |||
{ | |||
CarlaPlugin* plugin = CarlaPlugins[i]; | |||
if (plugin && plugin->id() == plugin_id) | |||
return plugin->prog_current(); | |||
return plugin->currentProgram(); | |||
} | |||
qCritical("get_current_program_index(%i) - could not find plugin", plugin_id); | |||
@@ -788,7 +788,7 @@ qint32 get_current_midi_program_index(unsigned short plugin_id) | |||
{ | |||
CarlaPlugin* plugin = CarlaPlugins[i]; | |||
if (plugin && plugin->id() == plugin_id) | |||
return plugin->midiprog_current(); | |||
return plugin->currentMidiProgram(); | |||
} | |||
qCritical("get_current_midi_program_index(%i) - could not find plugin", plugin_id); | |||
@@ -804,9 +804,8 @@ double get_default_parameter_value(unsigned short plugin_id, uint32_t parameter_ | |||
CarlaPlugin* plugin = CarlaPlugins[i]; | |||
if (plugin && plugin->id() == plugin_id) | |||
{ | |||
if (parameter_id < plugin->param_count()) | |||
return plugin->param_ranges(parameter_id)->def; | |||
//return plugin->get_default_parameter_value(parameter_id); | |||
if (parameter_id < plugin->parameterCount()) | |||
return plugin->parameterRanges(parameter_id)->def; | |||
else | |||
qCritical("get_default_parameter_value(%i, %i) - parameter_id out of bounds", plugin_id, parameter_id); | |||
@@ -827,8 +826,8 @@ double get_current_parameter_value(unsigned short plugin_id, uint32_t parameter_ | |||
CarlaPlugin* plugin = CarlaPlugins[i]; | |||
if (plugin && plugin->id() == plugin_id) | |||
{ | |||
if (parameter_id < plugin->param_count()) | |||
return plugin->get_parameter_value(parameter_id); | |||
if (parameter_id < plugin->parameterCount()) | |||
return plugin->getParameterValue(parameter_id); | |||
else | |||
qCritical("get_current_parameter_value(%i, %i) - parameter_id out of bounds", plugin_id, parameter_id); | |||
@@ -864,7 +863,7 @@ void set_active(unsigned short plugin_id, bool onoff) | |||
{ | |||
CarlaPlugin* plugin = CarlaPlugins[i]; | |||
if (plugin && plugin->id() == plugin_id) | |||
return plugin->set_active(onoff, true, false); | |||
return plugin->setActive(onoff, true, false); | |||
} | |||
qCritical("set_active(%i, %s) - could not find plugin", plugin_id, bool2str(onoff)); | |||
@@ -878,7 +877,7 @@ void set_drywet(unsigned short plugin_id, double value) | |||
{ | |||
CarlaPlugin* plugin = CarlaPlugins[i]; | |||
if (plugin && plugin->id() == plugin_id) | |||
return plugin->set_drywet(value, true, false); | |||
return plugin->setDryWet(value, true, false); | |||
} | |||
qCritical("set_drywet(%i, %f) - could not find plugin", plugin_id, value); | |||
@@ -892,7 +891,7 @@ void set_volume(unsigned short plugin_id, double value) | |||
{ | |||
CarlaPlugin* plugin = CarlaPlugins[i]; | |||
if (plugin && plugin->id() == plugin_id) | |||
return plugin->set_volume(value, true, false); | |||
return plugin->setVolume(value, true, false); | |||
} | |||
qCritical("set_vol(%i, %f) - could not find plugin", plugin_id, value); | |||
@@ -906,7 +905,7 @@ void set_balance_left(unsigned short plugin_id, double value) | |||
{ | |||
CarlaPlugin* plugin = CarlaPlugins[i]; | |||
if (plugin && plugin->id() == plugin_id) | |||
return plugin->set_balance_left(value, true, false); | |||
return plugin->setBalanceLeft(value, true, false); | |||
} | |||
qCritical("set_balance_left(%i, %f) - could not find plugin", plugin_id, value); | |||
@@ -920,7 +919,7 @@ void set_balance_right(unsigned short plugin_id, double value) | |||
{ | |||
CarlaPlugin* plugin = CarlaPlugins[i]; | |||
if (plugin && plugin->id() == plugin_id) | |||
return plugin->set_balance_right(value, true, false); | |||
return plugin->setBalanceRight(value, true, false); | |||
} | |||
qCritical("set_balance_right(%i, %f) - could not find plugin", plugin_id, value); | |||
@@ -935,8 +934,8 @@ void set_parameter_value(unsigned short plugin_id, uint32_t parameter_id, double | |||
CarlaPlugin* plugin = CarlaPlugins[i]; | |||
if (plugin && plugin->id() == plugin_id) | |||
{ | |||
if (parameter_id < plugin->param_count()) | |||
plugin->set_parameter_value(parameter_id, value, true, true, false); | |||
if (parameter_id < plugin->parameterCount()) | |||
plugin->setParameterValue(parameter_id, value, true, true, false); | |||
else | |||
qCritical("set_parameter_value(%i, %i, %f) - parameter_id out of bounds", plugin_id, parameter_id, value); | |||
return; | |||
@@ -961,8 +960,8 @@ void set_parameter_midi_channel(unsigned short plugin_id, uint32_t parameter_id, | |||
CarlaPlugin* plugin = CarlaPlugins[i]; | |||
if (plugin && plugin->id() == plugin_id) | |||
{ | |||
if (parameter_id < plugin->param_count()) | |||
plugin->set_parameter_midi_channel(parameter_id, channel); | |||
if (parameter_id < plugin->parameterCount()) | |||
plugin->setParameterMidiChannel(parameter_id, channel); | |||
else | |||
qCritical("set_parameter_midi_channel(%i, %i, %i) - parameter_id out of bounds", plugin_id, parameter_id, channel); | |||
return; | |||
@@ -991,8 +990,8 @@ void set_parameter_midi_cc(unsigned short plugin_id, uint32_t parameter_id, int1 | |||
CarlaPlugin* plugin = CarlaPlugins[i]; | |||
if (plugin && plugin->id() == plugin_id) | |||
{ | |||
if (parameter_id < plugin->param_count()) | |||
plugin->set_parameter_midi_cc(parameter_id, midi_cc); | |||
if (parameter_id < plugin->parameterCount()) | |||
plugin->setParameterMidiCC(parameter_id, midi_cc); | |||
else | |||
qCritical("set_parameter_midi_cc(%i, %i, %i) - parameter_id out of bounds", plugin_id, parameter_id, midi_cc); | |||
return; | |||
@@ -1011,8 +1010,8 @@ void set_program(unsigned short plugin_id, uint32_t program_id) | |||
CarlaPlugin* plugin = CarlaPlugins[i]; | |||
if (plugin && plugin->id() == plugin_id) | |||
{ | |||
if (program_id < plugin->prog_count()) | |||
plugin->set_program(program_id, true, true, false, true); | |||
if (program_id < plugin->programCount()) | |||
plugin->setProgram(program_id, true, true, false, true); | |||
else | |||
qCritical("set_program(%i, %i) - program_id out of bounds", plugin_id, program_id); | |||
@@ -1032,8 +1031,8 @@ void set_midi_program(unsigned short plugin_id, uint32_t midi_program_id) | |||
CarlaPlugin* plugin = CarlaPlugins[i]; | |||
if (plugin && plugin->id() == plugin_id) | |||
{ | |||
if (midi_program_id < plugin->midiprog_count()) | |||
plugin->set_midi_program(midi_program_id, true, true, false, true); | |||
if (midi_program_id < plugin->midiProgramCount()) | |||
plugin->setMidiProgram(midi_program_id, true, true, false, true); | |||
else | |||
qCritical("set_midi_program(%i, %i) - program_id out of bounds", plugin_id, midi_program_id); | |||
@@ -1052,7 +1051,7 @@ void set_custom_data(unsigned short plugin_id, CustomDataType type, const char* | |||
{ | |||
CarlaPlugin* plugin = CarlaPlugins[i]; | |||
if (plugin && plugin->id() == plugin_id) | |||
return plugin->set_custom_data(type, key, value, true); | |||
return plugin->setCustomData(type, key, value, true); | |||
} | |||
qCritical("set_custom_data(%i, %i, %s, %s) - could not find plugin", plugin_id, type, key, value); | |||
@@ -1068,7 +1067,7 @@ void set_chunk_data(unsigned short plugin_id, const char* chunk_data) | |||
if (plugin && plugin->id() == plugin_id) | |||
{ | |||
if (plugin->hints() & PLUGIN_USES_CHUNKS) | |||
plugin->set_chunk_data(chunk_data); | |||
plugin->setChunkData(chunk_data); | |||
else | |||
qCritical("set_chunk_data(%i, %s) - plugin does not support chunks", plugin_id, chunk_data); | |||
@@ -1088,7 +1087,7 @@ void set_gui_data(unsigned short plugin_id, int data, quintptr gui_addr) | |||
CarlaPlugin* plugin = CarlaPlugins[i]; | |||
if (plugin && plugin->id() == plugin_id) | |||
{ | |||
plugin->set_gui_data(data, (QDialog*)get_pointer(gui_addr)); | |||
plugin->setGuiData(data, (QDialog*)get_pointer(gui_addr)); | |||
return; | |||
} | |||
} | |||
@@ -1096,20 +1095,6 @@ void set_gui_data(unsigned short plugin_id, int data, quintptr gui_addr) | |||
qCritical("set_gui_data(%i, %i, " P_UINTPTR ") - could not find plugin", plugin_id, data, gui_addr); | |||
} | |||
// TESTING | |||
//void set_name(unsigned short plugin_id, const char* name) | |||
//{ | |||
// for (unsigned short i=0; i<MAX_PLUGINS; i++) | |||
// { | |||
// CarlaPlugin* plugin = CarlaPlugins[i]; | |||
// if (plugin && plugin->id() == plugin_id) | |||
// { | |||
// plugin->set_name(name); | |||
// } | |||
// } | |||
//} | |||
void show_gui(unsigned short plugin_id, bool yesno) | |||
{ | |||
qDebug("show_gui(%i, %s)", plugin_id, bool2str(yesno)); | |||
@@ -1119,7 +1104,7 @@ void show_gui(unsigned short plugin_id, bool yesno) | |||
CarlaPlugin* plugin = CarlaPlugins[i]; | |||
if (plugin && plugin->id() == plugin_id) | |||
{ | |||
plugin->show_gui(yesno); | |||
plugin->showGui(yesno); | |||
return; | |||
} | |||
} | |||
@@ -1133,7 +1118,7 @@ void idle_guis() | |||
{ | |||
CarlaPlugin* plugin = CarlaPlugins[i]; | |||
if (plugin && plugin->enabled()) | |||
plugin->idle_gui(); | |||
plugin->idleGui(); | |||
} | |||
} | |||
@@ -1146,7 +1131,7 @@ void send_midi_note(unsigned short plugin_id, uint8_t note, uint8_t velocity) | |||
CarlaPlugin* plugin = CarlaPlugins[i]; | |||
if (plugin && plugin->id() == plugin_id) | |||
{ | |||
plugin->send_midi_note(note, velocity, true, true, false); | |||
plugin->sendMidiSingleNote(note, velocity, true, true, false); | |||
return; | |||
} | |||
} | |||
@@ -1162,7 +1147,7 @@ void prepare_for_save(unsigned short plugin_id) | |||
{ | |||
CarlaPlugin* plugin = CarlaPlugins[i]; | |||
if (plugin && plugin->id() == plugin_id) | |||
return plugin->prepare_for_save(); | |||
return plugin->prepareForSave(); | |||
} | |||
qCritical("prepare_for_save(%i) - could not find plugin", plugin_id); | |||
@@ -36,62 +36,90 @@ CARLA_BACKEND_START_NAMESPACE | |||
#define STR_MAX 256 | |||
// static max values | |||
/*! | |||
* @defgroup CarlaBackendAPI Carla Backend API | |||
* | |||
* The Carla Backend API | |||
* @{ | |||
*/ | |||
#ifdef BUILD_BRIDGE | |||
const unsigned short MAX_PLUGINS = 1; | |||
#else | |||
const unsigned short MAX_PLUGINS = 99; | |||
const unsigned short MAX_PLUGINS = 99; //!< Maximum number of plugins | |||
#endif | |||
const unsigned int MAX_PARAMETERS = 200; | |||
// plugin hints | |||
const unsigned int PLUGIN_IS_BRIDGE = 0x01; | |||
const unsigned int PLUGIN_IS_SYNTH = 0x02; | |||
const unsigned int PLUGIN_HAS_GUI = 0x04; | |||
const unsigned int PLUGIN_USES_CHUNKS = 0x08; | |||
const unsigned int PLUGIN_CAN_DRYWET = 0x10; | |||
const unsigned int PLUGIN_CAN_VOLUME = 0x20; | |||
const unsigned int PLUGIN_CAN_BALANCE = 0x40; | |||
// parameter hints | |||
const unsigned int PARAMETER_IS_BOOLEAN = 0x01; | |||
const unsigned int PARAMETER_IS_INTEGER = 0x02; | |||
const unsigned int PARAMETER_IS_LOGARITHMIC = 0x04; | |||
const unsigned int PARAMETER_IS_ENABLED = 0x08; | |||
const unsigned int PARAMETER_IS_AUTOMABLE = 0x10; | |||
const unsigned int PARAMETER_USES_SAMPLERATE = 0x20; | |||
const unsigned int PARAMETER_USES_SCALEPOINTS = 0x40; | |||
const unsigned int PARAMETER_USES_CUSTOM_TEXT = 0x80; | |||
const unsigned int MAX_PARAMETERS = 200; //!< Default value for maximum number of parameters the callback can handle.\see OPTION_MAX_PARAMETERS | |||
/*! | |||
* @defgroup PluginHints Plugin Hints | |||
* | |||
* Various plugin hints. | |||
* \see CarlaPlugin::hints | |||
* @{ | |||
*/ | |||
const unsigned int PLUGIN_IS_BRIDGE = 0x01; //!< Plugin is a bridge (ie, BridgePlugin). This hint is required because "bridge" itself is not a PluginType. | |||
const unsigned int PLUGIN_IS_SYNTH = 0x02; //!< Plugin is a synthesizer (produces sound). | |||
const unsigned int PLUGIN_HAS_GUI = 0x04; //!< Plugin has its own custom GUI. | |||
const unsigned int PLUGIN_USES_CHUNKS = 0x08; //!< Plugin uses chunks to save internal data.\see CarlaPlugin::chunkData() | |||
const unsigned int PLUGIN_CAN_DRYWET = 0x10; //!< Plugin can make use of Dry/Wet controls. | |||
const unsigned int PLUGIN_CAN_VOLUME = 0x20; //!< Plugin can make use of Volume controls. | |||
const unsigned int PLUGIN_CAN_BALANCE = 0x40; //!< Plugin can make use of Left & Right Balance controls. | |||
/**@}*/ | |||
/*! | |||
* @defgroup ParameterHints Parameter Hints | |||
* | |||
* Various parameter hints. | |||
* \see CarlaPlugin::paramData() | |||
* @{ | |||
*/ | |||
const unsigned int PARAMETER_IS_BOOLEAN = 0x01; //!< Parameter value is of boolean type (always at minimum or maximum). | |||
const unsigned int PARAMETER_IS_INTEGER = 0x02; //!< Parameter values are always integer. | |||
const unsigned int PARAMETER_IS_LOGARITHMIC = 0x04; //!< Parameter is logarithmic (informative only, not really implemented). | |||
const unsigned int PARAMETER_IS_ENABLED = 0x08; //!< Parameter is enabled and will be shown in the host built-in editor. | |||
const unsigned int PARAMETER_IS_AUTOMABLE = 0x10; //!< Parameter is automable (realtime safe) | |||
const unsigned int PARAMETER_USES_SAMPLERATE = 0x20; //!< Parameter needs sample rate to work (value and ranges are multiplied by SR, and divided by SR on save). | |||
const unsigned int PARAMETER_USES_SCALEPOINTS = 0x40; //!< Parameter uses scalepoints to define internal values in a meaninful way. | |||
const unsigned int PARAMETER_USES_CUSTOM_TEXT = 0x80; //!< Parameter uses custom text for displaying its value.\see CarlaPlugin::getParameterText() | |||
/**@}*/ | |||
/*! | |||
* The binary type of a plugin.\n | |||
* If a plugin binary type is loaded that doesn't match the system's native type, a bridge will be used (see BridgePlugin). | |||
*/ | |||
enum BinaryType { | |||
BINARY_NONE = 0, | |||
BINARY_UNIX32 = 1, | |||
BINARY_UNIX64 = 2, | |||
BINARY_WIN32 = 3, | |||
BINARY_WIN64 = 4 | |||
BINARY_NONE = 0, //!< Null binary type. | |||
BINARY_UNIX32 = 1, //!< Unix 32bit. | |||
BINARY_UNIX64 = 2, //!< Unix 64bit. | |||
BINARY_WIN32 = 3, //!< Windows 32bit. | |||
BINARY_WIN64 = 4 //!< Windows 64bit. | |||
}; | |||
/*! | |||
* All the available plugin types, provided by subclasses of CarlaPlugin.\n | |||
* \note Some plugin classes might provide more than 1 plugin type. | |||
*/ | |||
enum PluginType { | |||
PLUGIN_NONE = 0, | |||
PLUGIN_LADSPA = 1, | |||
PLUGIN_DSSI = 2, | |||
PLUGIN_LV2 = 3, | |||
PLUGIN_VST = 4, | |||
PLUGIN_GIG = 5, | |||
PLUGIN_SF2 = 6, | |||
PLUGIN_SFZ = 7 | |||
PLUGIN_NONE = 0, //!< Null plugin type. | |||
PLUGIN_LADSPA = 1, //!< LADSPA plugin.\see LadspaPlugin | |||
PLUGIN_DSSI = 2, //!< DSSI plugin.\see DssiPlugin | |||
PLUGIN_LV2 = 3, //!< LV2 plugin.\see Lv2Plugin | |||
PLUGIN_VST = 4, //!< VST plugin.\see VstPlugin | |||
PLUGIN_GIG = 5, //!< GIG sound kit, provided by LinuxSampler.\see LinuxSamplerPlugin | |||
PLUGIN_SF2 = 6, //!< SF2 sound kit (aka SoundFont), provided by FluidSynth.\see FluidSynthPlugin | |||
PLUGIN_SFZ = 7 //!< SFZ sound kit, provided by LinuxSampler.\see LinuxSamplerPlugin | |||
}; | |||
enum PluginCategory { | |||
PLUGIN_CATEGORY_NONE = 0, | |||
PLUGIN_CATEGORY_SYNTH = 1, | |||
PLUGIN_CATEGORY_DELAY = 2, // also Reverb | |||
PLUGIN_CATEGORY_EQ = 3, | |||
PLUGIN_CATEGORY_FILTER = 4, | |||
PLUGIN_CATEGORY_DYNAMICS = 5, // Amplifier, Compressor, Gate | |||
PLUGIN_CATEGORY_MODULATOR = 6, // Chorus, Flanger, Phaser | |||
PLUGIN_CATEGORY_UTILITY = 7, // Analyzer, Converter, Mixer | |||
PLUGIN_CATEGORY_OTHER = 8 // used to check if a plugin has a category | |||
PLUGIN_CATEGORY_NONE = 0, //!< Unknown or undefined plugin category | |||
PLUGIN_CATEGORY_SYNTH = 1, //!< A synthesizer or generator | |||
PLUGIN_CATEGORY_DELAY = 2, //!< A delay or reverberator | |||
PLUGIN_CATEGORY_EQ = 3, //!< An equalizer | |||
PLUGIN_CATEGORY_FILTER = 4, //!< A filter | |||
PLUGIN_CATEGORY_DYNAMICS = 5, //!< A "dynamic" plugin (amplifier, compressor, gate, etc) | |||
PLUGIN_CATEGORY_MODULATOR = 6, //!< A "modulator" plugin (chorus, flanger, phaser, etc) | |||
PLUGIN_CATEGORY_UTILITY = 7, //!< An utility plugin (analyzer, converter, mixer, etc) | |||
PLUGIN_CATEGORY_OTHER = 8 //!< Misc plugin (used to check if plugin has a category) | |||
}; | |||
enum ParameterType { | |||
@@ -126,9 +154,10 @@ enum GuiType { | |||
GUI_EXTERNAL_OSC = 5 | |||
}; | |||
// TODO - fill desc | |||
enum OptionsType { | |||
OPTION_PROCESS_MODE = 1, | |||
OPTION_MAX_PARAMETERS = 2, | |||
OPTION_PROCESS_MODE = 1, //!< ...\see ProcessModeType | |||
OPTION_MAX_PARAMETERS = 2, //!< Maximum number of parameters the callback can handle, defaults to MAX_PARAMETERS | |||
OPTION_PREFER_UI_BRIDGES = 3, | |||
OPTION_PROCESS_HQ = 4, | |||
OPTION_OSC_GUI_TIMEOUT = 5, | |||
@@ -168,9 +197,9 @@ enum CallbackType { | |||
}; | |||
enum ProcessModeType { | |||
PROCESS_MODE_SINGLE_CLIENT = 0, | |||
PROCESS_MODE_MULTIPLE_CLIENTS = 1, | |||
PROCESS_MODE_CONTINUOUS_RACK = 2 | |||
PROCESS_MODE_SINGLE_CLIENT = 0, //!< Single client mode (dynamic input/outputs as needed by plugins) | |||
PROCESS_MODE_MULTIPLE_CLIENTS = 1, //!< Multiple client mode | |||
PROCESS_MODE_CONTINUOUS_RACK = 2 //!< Single client "rack" mode. Processes plugins in order of it's id, with forced stereo input/output. | |||
}; | |||
struct ParameterData { | |||
@@ -178,8 +207,8 @@ struct ParameterData { | |||
qint32 index; | |||
qint32 rindex; | |||
qint32 hints; | |||
quint8 midi_channel; | |||
qint16 midi_cc; | |||
quint8 midiChannel; | |||
qint16 midiCC; | |||
}; | |||
struct ParameterRanges { | |||
@@ -187,8 +216,8 @@ struct ParameterRanges { | |||
double min; | |||
double max; | |||
double step; | |||
double step_small; | |||
double step_large; | |||
double stepSmall; | |||
double stepLarge; | |||
}; | |||
struct CustomData { | |||
@@ -222,7 +251,7 @@ struct ParameterInfo { | |||
const char* name; | |||
const char* symbol; | |||
const char* unit; | |||
quint32 scalepoint_count; | |||
quint32 scalePointCount; | |||
}; | |||
struct ScalePointInfo { | |||
@@ -247,11 +276,10 @@ class CarlaPlugin; | |||
typedef void (*CallbackFunc)(CallbackType action, unsigned short plugin_id, int value1, int value2, double value3); | |||
#ifndef CARLA_BACKEND_NO_EXPORTS | |||
// ----------------------------------------------------- | |||
// Exported symbols (API) | |||
#ifndef CARLA_BACKEND_NO_EXPORTS | |||
CARLA_EXPORT bool engine_init(const char* client_name); | |||
CARLA_EXPORT bool engine_close(); | |||
CARLA_EXPORT bool is_engine_running(); | |||
@@ -307,7 +335,6 @@ CARLA_EXPORT void set_midi_program(unsigned short plugin_id, quint32 midi_progra | |||
CARLA_EXPORT void set_custom_data(unsigned short plugin_id, 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_gui_data(unsigned short plugin_id, int data, quintptr gui_addr); | |||
//CARLA_EXPORT void set_name(unsigned short plugin_id, const char* name); // TESTING | |||
CARLA_EXPORT void show_gui(unsigned short plugin_id, bool yesno); | |||
CARLA_EXPORT void idle_guis(); | |||
@@ -315,8 +342,10 @@ CARLA_EXPORT void idle_guis(); | |||
CARLA_EXPORT void send_midi_note(unsigned short plugin_id, quint8 note, quint8 velocity); | |||
CARLA_EXPORT void prepare_for_save(unsigned short plugin_id); | |||
CARLA_EXPORT void set_callback_function(CallbackFunc func); | |||
CARLA_EXPORT void set_option(OptionsType option, int value, const char* value_str); | |||
#endif | |||
CARLA_EXPORT void set_callback_function(CallbackFunc func); | |||
CARLA_EXPORT const char* get_last_error(); | |||
CARLA_EXPORT const char* get_host_client_name(); | |||
@@ -329,23 +358,12 @@ CARLA_EXPORT double get_latency(); | |||
// End of exported symbols | |||
// ----------------------------------------------------- | |||
#else | |||
void set_callback_function(CallbackFunc func); | |||
const char* get_last_error(); | |||
const char* get_host_client_name(); | |||
quint32 get_buffer_size(); | |||
double get_sample_rate(); | |||
double get_latency(); | |||
#endif // CARLA_BACKEND_NO_EXPORTS | |||
CARLA_BACKEND_END_NAMESPACE | |||
#ifndef CARLA_BACKEND_NO_NAMESPACE | |||
typedef CarlaBackend::CarlaPlugin CarlaPlugin; | |||
#endif | |||
/**@}*/ | |||
#endif // CARLA_BACKEND_H |
@@ -268,15 +268,15 @@ public: | |||
param.data[i].index = -1; | |||
param.data[i].rindex = -1; | |||
param.data[i].hints = 0; | |||
param.data[i].midi_channel = 0; | |||
param.data[i].midi_cc = -1; | |||
param.data[i].midiChannel = 0; | |||
param.data[i].midiCC = -1; | |||
param.ranges[i].def = 0.0; | |||
param.ranges[i].min = 0.0; | |||
param.ranges[i].max = 1.0; | |||
param.ranges[i].step = 0.01; | |||
param.ranges[i].step_small = 0.0001; | |||
param.ranges[i].step_large = 0.1; | |||
param.ranges[i].stepSmall = 0.0001; | |||
param.ranges[i].stepLarge = 0.1; | |||
params[i].value = 0.0; | |||
params[i].name = QString(); | |||
@@ -395,8 +395,8 @@ public: | |||
param.data[index].index = index; | |||
param.data[index].rindex = argv[2]->i; | |||
param.data[index].hints = argv[3]->i; | |||
param.data[index].midi_channel = argv[4]->i; | |||
param.data[index].midi_cc = argv[5]->i; | |||
param.data[index].midiChannel = argv[4]->i; | |||
param.data[index].midiCC = argv[5]->i; | |||
} | |||
break; | |||
} | |||
@@ -410,8 +410,8 @@ public: | |||
param.ranges[index].min = argv[2]->f; | |||
param.ranges[index].max = argv[3]->f; | |||
param.ranges[index].step = argv[4]->f; | |||
param.ranges[index].step_small = argv[5]->f; | |||
param.ranges[index].step_large = argv[6]->f; | |||
param.ranges[index].stepSmall = argv[5]->f; | |||
param.ranges[index].stepLarge = argv[6]->f; | |||
} | |||
break; | |||
} | |||
@@ -444,7 +444,7 @@ public: | |||
const char* key = (const char*)&argv[1]->s; | |||
const char* value = (const char*)&argv[2]->s; | |||
set_custom_data(customdatastr2type(stype), key, value, false); | |||
setCustomData(customdatastr2type(stype), key, value, false); | |||
break; | |||
} | |||
@@ -475,12 +475,12 @@ public: | |||
void set_parameter_value(uint32_t param_id, double value, bool gui_send, bool osc_send, bool callback_send) | |||
{ | |||
params[param_id].value = fix_parameter_value(value, param.ranges[param_id]); | |||
params[param_id].value = fixParameterValue(value, param.ranges[param_id]); | |||
if (gui_send) | |||
osc_send_control(&osc.data, param.data[param_id].rindex, value); | |||
CarlaPlugin::set_parameter_value(param_id, value, gui_send, osc_send, callback_send); | |||
CarlaPlugin::setParameterValue(param_id, value, gui_send, osc_send, callback_send); | |||
} | |||
void set_chunk_data(const char* string_data) | |||
@@ -609,7 +609,7 @@ short add_plugin_bridge(BinaryType btype, PluginType ptype, const char* filename | |||
unique_names[id] = plugin->name(); | |||
CarlaPlugins[id] = plugin; | |||
plugin->osc_register_new(); | |||
plugin->registerToOsc(); | |||
} | |||
else | |||
{ | |||
@@ -1,32 +0,0 @@ | |||
/* | |||
* JACK Backend code for Carla | |||
* Copyright (C) 2011-2012 Filipe Coelho <falktx@gmail.com> | |||
* | |||
* 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 COPYING file | |||
*/ | |||
#ifndef CARLA_JACK_H | |||
#define CARLA_JACK_H | |||
//#include "carla_includes.h" | |||
//class CarlaPlugin; | |||
//bool carla_jack_init(const char* client_name); | |||
//bool carla_jack_close(); | |||
//bool carla_jack_register_plugin(CarlaPlugin* plugin, jack_client_t** client); | |||
//bool carla_jack_transport_query(jack_position_t** pos); | |||
//bool carla_jack_on_audio_thread(); | |||
//bool carla_jack_on_freewheel(); | |||
#endif // CARLA_JACK_H |
@@ -199,33 +199,33 @@ int osc_message_handler(const char* path, const char* types, lo_arg** argv, int | |||
if (strcmp(method, "/bridge_aouts_peak") == 0) | |||
return osc_handle_bridge_aouts_peak(plugin, argv); | |||
if (strcmp(method, "/bridge_audio_count") == 0) | |||
return plugin->set_osc_bridge_info(PluginBridgeAudioCount, argv); | |||
return plugin->setOscBridgeInfo(PluginBridgeAudioCount, argv); | |||
if (strcmp(method, "/bridge_midi_count") == 0) | |||
return plugin->set_osc_bridge_info(PluginBridgeMidiCount, argv); | |||
return plugin->setOscBridgeInfo(PluginBridgeMidiCount, argv); | |||
if (strcmp(method, "/bridge_param_count") == 0) | |||
return plugin->set_osc_bridge_info(PluginBridgeParameterCount, argv); | |||
return plugin->setOscBridgeInfo(PluginBridgeParameterCount, argv); | |||
if (strcmp(method, "/bridge_program_count") == 0) | |||
return plugin->set_osc_bridge_info(PluginBridgeProgramCount, argv); | |||
return plugin->setOscBridgeInfo(PluginBridgeProgramCount, argv); | |||
if (strcmp(method, "/bridge_midi_program_count") == 0) | |||
return plugin->set_osc_bridge_info(PluginBridgeMidiProgramCount, argv); | |||
return plugin->setOscBridgeInfo(PluginBridgeMidiProgramCount, argv); | |||
if (strcmp(method, "/bridge_plugin_info") == 0) | |||
return plugin->set_osc_bridge_info(PluginBridgePluginInfo, argv); | |||
return plugin->setOscBridgeInfo(PluginBridgePluginInfo, argv); | |||
if (strcmp(method, "/bridge_param_info") == 0) | |||
return plugin->set_osc_bridge_info(PluginBridgeParameterInfo, argv); | |||
return plugin->setOscBridgeInfo(PluginBridgeParameterInfo, argv); | |||
if (strcmp(method, "/bridge_param_data") == 0) | |||
return plugin->set_osc_bridge_info(PluginBridgeParameterDataInfo, argv); | |||
return plugin->setOscBridgeInfo(PluginBridgeParameterDataInfo, argv); | |||
if (strcmp(method, "/bridge_param_ranges") == 0) | |||
return plugin->set_osc_bridge_info(PluginBridgeParameterRangesInfo, argv); | |||
return plugin->setOscBridgeInfo(PluginBridgeParameterRangesInfo, argv); | |||
if (strcmp(method, "/bridge_program_info") == 0) | |||
return plugin->set_osc_bridge_info(PluginBridgeProgramInfo, argv); | |||
return plugin->setOscBridgeInfo(PluginBridgeProgramInfo, argv); | |||
if (strcmp(method, "/bridge_midi_program_info") == 0) | |||
return plugin->set_osc_bridge_info(PluginBridgeMidiProgramInfo, argv); | |||
return plugin->setOscBridgeInfo(PluginBridgeMidiProgramInfo, argv); | |||
if (strcmp(method, "/bridge_custom_data") == 0) | |||
return plugin->set_osc_bridge_info(PluginBridgeCustomData, argv); | |||
return plugin->setOscBridgeInfo(PluginBridgeCustomData, argv); | |||
if (strcmp(method, "/bridge_chunk_data") == 0) | |||
return plugin->set_osc_bridge_info(PluginBridgeChunkData, argv); | |||
return plugin->setOscBridgeInfo(PluginBridgeChunkData, argv); | |||
if (strcmp(method, "/bridge_update") == 0) | |||
return plugin->set_osc_bridge_info(PluginBridgeUpdateNow, argv); | |||
return plugin->setOscBridgeInfo(PluginBridgeUpdateNow, argv); | |||
} | |||
// Internal OSC Stuff | |||
@@ -269,12 +269,15 @@ int osc_handle_configure(CarlaPlugin* plugin, lo_arg** argv) | |||
const char* key = (const char*)&argv[0]->s; | |||
const char* value = (const char*)&argv[1]->s; | |||
if (strcmp(key, "CarlaBridgeHideGUI") == 0) | |||
callback_action(CALLBACK_SHOW_GUI, plugin->id(), 0, 0, 0.0); | |||
else if (strcmp(key, "CarlaBridgeSaveNowDone") == 0) | |||
plugin->set_osc_bridge_info(PluginBridgeSaved, nullptr); | |||
else | |||
plugin->set_custom_data(CUSTOM_DATA_STRING, key, value, false); | |||
if (plugin->hints() & PLUGIN_IS_BRIDGE) | |||
{ | |||
if (strcmp(key, "CarlaBridgeHideGUI") == 0) | |||
callback_action(CALLBACK_SHOW_GUI, plugin->id(), 0, 0, 0.0); | |||
else if (strcmp(key, "CarlaBridgeSaveNowDone") == 0) | |||
return plugin->setOscBridgeInfo(PluginBridgeSaved, nullptr); | |||
} | |||
plugin->setCustomData(CUSTOM_DATA_STRING, key, value, false); | |||
return 0; | |||
} | |||
@@ -286,7 +289,7 @@ int osc_handle_control(CarlaPlugin* plugin, lo_arg** argv) | |||
int rindex = argv[0]->i; | |||
float value = argv[1]->f; | |||
plugin->set_parameter_value_by_rindex(rindex, value, false, true, true); | |||
plugin->setParameterValueByRIndex(rindex, value, false, true, true); | |||
return 0; | |||
} | |||
@@ -300,15 +303,15 @@ int osc_handle_program(CarlaPlugin* plugin, lo_arg** argv) | |||
uint32_t bank_id = argv[0]->i; | |||
uint32_t program_id = argv[1]->i; | |||
plugin->set_midi_program_by_id(bank_id, program_id, false, true, true, true); | |||
plugin->setMidiProgramById(bank_id, program_id, false, true, true, true); | |||
} | |||
else | |||
{ | |||
uint32_t program_id = argv[0]->i; | |||
if (program_id < plugin->prog_count()) | |||
if (program_id < plugin->programCount()) | |||
{ | |||
plugin->set_program(program_id, false, true, true, true); | |||
plugin->setProgram(program_id, false, true, true, true); | |||
return 0; | |||
} | |||
@@ -322,7 +325,7 @@ int osc_handle_midi(CarlaPlugin* plugin, lo_arg **argv) | |||
{ | |||
qDebug("osc_handle_midi()"); | |||
if (plugin->min_count() > 0) | |||
if (plugin->midiInCount() > 0) | |||
{ | |||
uint8_t* data = argv[0]->m; | |||
uint8_t status = data[1]; | |||
@@ -334,13 +337,13 @@ int osc_handle_midi(CarlaPlugin* plugin, lo_arg **argv) | |||
if (MIDI_IS_STATUS_NOTE_OFF(status)) | |||
{ | |||
uint8_t note = data[2]; | |||
plugin->send_midi_note(note, 0, false, true, true); | |||
plugin->sendMidiSingleNote(note, 0, false, true, true); | |||
} | |||
else if (MIDI_IS_STATUS_NOTE_ON(status)) | |||
{ | |||
uint8_t note = data[2]; | |||
uint8_t velo = data[3]; | |||
plugin->send_midi_note(note, velo, false, true, true); | |||
plugin->sendMidiSingleNote(note, velo, false, true, true); | |||
} | |||
return 0; | |||
@@ -380,7 +383,7 @@ int osc_handle_register(lo_arg** argv, lo_address source) | |||
{ | |||
CarlaPlugin* plugin = CarlaPlugins[i]; | |||
if (plugin && plugin->enabled()) | |||
plugin->osc_register_new(); | |||
plugin->registerToOsc(); | |||
} | |||
return 0; | |||
@@ -413,7 +416,7 @@ int osc_handle_update(CarlaPlugin* plugin, lo_arg** argv, lo_address source) | |||
qDebug("osc_handle_update()"); | |||
const char* url = (const char*)&argv[0]->s; | |||
plugin->update_osc_data(source, url); | |||
plugin->updateOscData(source, url); | |||
return 0; | |||
} | |||
@@ -424,7 +427,7 @@ int osc_handle_exiting(CarlaPlugin* plugin) | |||
// TODO - check for non-UIs (dssi-vst) and set to -1 instead | |||
callback_action(CALLBACK_SHOW_GUI, plugin->id(), 0, 0, 0.0); | |||
plugin->clear_osc_data(); | |||
plugin->clearOscData(); | |||
return 0; | |||
} | |||
@@ -436,7 +439,7 @@ int osc_handle_set_active(CarlaPlugin* plugin, lo_arg** argv) | |||
qDebug("osc_handle_set_active()"); | |||
bool value = (bool)argv[0]->i; | |||
plugin->set_active(value, false, true); | |||
plugin->setActive(value, false, true); | |||
return 0; | |||
} | |||
@@ -446,7 +449,7 @@ int osc_handle_set_drywet(CarlaPlugin* plugin, lo_arg** argv) | |||
qDebug("osc_handle_set_drywet()"); | |||
double value = argv[0]->f; | |||
plugin->set_drywet(value, false, true); | |||
plugin->setDryWet(value, false, true); | |||
return 0; | |||
} | |||
@@ -456,7 +459,7 @@ int osc_handle_set_volume(CarlaPlugin* plugin, lo_arg** argv) | |||
qDebug("osc_handle_set_volume()"); | |||
double value = argv[0]->f; | |||
plugin->set_volume(value, false, true); | |||
plugin->setVolume(value, false, true); | |||
return 0; | |||
} | |||
@@ -466,7 +469,7 @@ int osc_handle_set_balance_left(CarlaPlugin* plugin, lo_arg** argv) | |||
qDebug("osc_handle_set_balance_left()"); | |||
double value = argv[0]->f; | |||
plugin->set_balance_left(value, false, true); | |||
plugin->setBalanceLeft(value, false, true); | |||
return 0; | |||
} | |||
@@ -476,7 +479,7 @@ int osc_handle_set_balance_right(CarlaPlugin* plugin, lo_arg** argv) | |||
qDebug("osc_handle_set_balance_right()"); | |||
double value = argv[0]->f; | |||
plugin->set_balance_right(value, false, true); | |||
plugin->setBalanceRight(value, false, true); | |||
return 0; | |||
} | |||
@@ -487,7 +490,7 @@ int osc_handle_set_parameter(CarlaPlugin* plugin, lo_arg** argv) | |||
uint32_t parameter_id = argv[0]->i; | |||
double value = argv[1]->f; | |||
plugin->set_parameter_value(parameter_id, value, true, false, true); | |||
plugin->setParameterValue(parameter_id, value, true, false, true); | |||
return 0; | |||
} | |||
@@ -497,7 +500,7 @@ int osc_handle_set_program(CarlaPlugin* plugin, lo_arg** argv) | |||
qDebug("osc_handle_set_program()"); | |||
uint32_t program_id = argv[0]->i; | |||
plugin->set_program(program_id, true, false, true, true); | |||
plugin->setProgram(program_id, true, false, true, true); | |||
return 0; | |||
} | |||
@@ -508,7 +511,7 @@ int osc_handle_note_on(CarlaPlugin* plugin, lo_arg** argv) | |||
int note = argv[0]->i; | |||
int velo = argv[1]->i; | |||
plugin->send_midi_note(note, velo, true, false, true); | |||
plugin->sendMidiSingleNote(note, velo, true, false, true); | |||
return 0; | |||
} | |||
@@ -518,8 +521,7 @@ int osc_handle_note_off(CarlaPlugin* plugin, lo_arg** argv) | |||
qDebug("osc_handle_note_off()"); | |||
int note = argv[0]->i; | |||
int velo = argv[1]->i; | |||
plugin->send_midi_note(note, velo, true, false, true); | |||
plugin->sendMidiSingleNote(note, 0, true, false, true); | |||
return 0; | |||
} | |||
@@ -65,9 +65,9 @@ void CarlaCheckThread::run() | |||
// Process postponed events | |||
// Make a safe copy of events, and clear them | |||
plugin->post_events_copy(postEvents); | |||
plugin->postEventsCopy(postEvents); | |||
const OscData* const osc_data = plugin->osc_data(); | |||
const OscData* const osc_data = plugin->oscData(); | |||
// Process events now | |||
for (j=0; j < MAX_POST_EVENTS; j++) | |||
@@ -100,8 +100,8 @@ void CarlaCheckThread::run() | |||
// Update OSC control client | |||
osc_global_send_set_program(plugin->id(), postEvents[j].index); | |||
for (k=0; k < plugin->param_count(); k++) | |||
osc_global_send_set_default_value(plugin->id(), k, plugin->param_ranges(k)->def); | |||
for (k=0; k < plugin->parameterCount(); k++) | |||
osc_global_send_set_default_value(plugin->id(), k, plugin->parameterRanges(k)->def); | |||
// Update Host | |||
callback_action(CALLBACK_PROGRAM_CHANGED, plugin->id(), postEvents[j].index, 0, 0.0); | |||
@@ -109,10 +109,10 @@ void CarlaCheckThread::run() | |||
break; | |||
case PluginPostEventMidiProgramChange: | |||
if (postEvents[j].index < (int32_t)plugin->midiprog_count()) | |||
if (postEvents[j].index < (int32_t)plugin->midiProgramCount()) | |||
{ | |||
MidiProgramInfo midiprog = { false, 0, 0, nullptr }; | |||
plugin->get_midi_program_info(&midiprog, postEvents[j].index); | |||
plugin->getMidiProgramInfo(&midiprog, postEvents[j].index); | |||
// Update OSC based UIs | |||
osc_send_midi_program(osc_data, midiprog.bank, midiprog.program, (plugin->type() == PLUGIN_DSSI)); | |||
@@ -120,8 +120,8 @@ void CarlaCheckThread::run() | |||
// Update OSC control client | |||
osc_global_send_set_midi_program(plugin->id(), postEvents[j].index); | |||
for (k=0; k < plugin->param_count(); k++) | |||
osc_global_send_set_default_value(plugin->id(), k, plugin->param_ranges(k)->def); | |||
for (k=0; k < plugin->parameterCount(); k++) | |||
osc_global_send_set_default_value(plugin->id(), k, plugin->parameterRanges(k)->def); | |||
// Update Host | |||
callback_action(CALLBACK_MIDI_PROGRAM_CHANGED, plugin->id(), postEvents[j].index, 0, 0.0); | |||
@@ -155,10 +155,6 @@ void CarlaCheckThread::run() | |||
break; | |||
case PluginPostEventCustom: | |||
plugin->run_custom_event(&postEvents[j]); | |||
break; | |||
default: | |||
break; | |||
} | |||
@@ -174,13 +170,13 @@ void CarlaCheckThread::run() | |||
continue; | |||
// Update | |||
for (j=0; j < plugin->param_count(); j++) | |||
for (j=0; j < plugin->parameterCount(); j++) | |||
{ | |||
paramData = plugin->param_data(j); | |||
paramData = plugin->parameterData(j); | |||
if (paramData->type == PARAMETER_OUTPUT && (paramData->hints & PARAMETER_IS_AUTOMABLE) > 0) | |||
{ | |||
value = plugin->get_parameter_value(j); | |||
value = plugin->getParameterValue(j); | |||
if (update_ports_gui) | |||
osc_send_control(osc_data, paramData->rindex, value); | |||
@@ -194,12 +190,12 @@ void CarlaCheckThread::run() | |||
if (osc_global_registered()) | |||
{ | |||
if (plugin->ain_count() > 0) | |||
if (plugin->audioInCount() > 0) | |||
{ | |||
osc_global_send_set_input_peak_value(plugin->id(), 1, ains_peak[ (plugin->id() * 2) + 0 ]); | |||
osc_global_send_set_input_peak_value(plugin->id(), 2, ains_peak[ (plugin->id() * 2) + 1 ]); | |||
} | |||
if (plugin->aout_count() > 0) | |||
if (plugin->audioOutCount() > 0) | |||
{ | |||
osc_global_send_set_output_peak_value(plugin->id(), 1, aouts_peak[ (plugin->id() * 2) + 0 ]); | |||
osc_global_send_set_output_peak_value(plugin->id(), 2, aouts_peak[ (plugin->id() * 2) + 1 ]); | |||
@@ -287,7 +283,7 @@ void CarlaPluginThread::run() | |||
{ | |||
case PLUGIN_THREAD_DSSI_GUI: | |||
case PLUGIN_THREAD_LV2_GUI: | |||
if (m_plugin->show_osc_gui()) | |||
if (m_plugin->showOscGui()) | |||
{ | |||
m_process->waitForFinished(-1); | |||
@@ -163,11 +163,11 @@ public: | |||
void setParameterValue(uint32_t paramId, double value, bool sendGui, bool sendOsc, bool sendCallback) | |||
{ | |||
assert(paramId < param.count); | |||
param_buffers[paramId] = fix_parameter_value(value, param.ranges[paramId]); | |||
param_buffers[paramId] = fixParameterValue(value, param.ranges[paramId]); | |||
#ifndef BUILD_BRIDGE | |||
if (sendGui) | |||
osc_send_control(&osc.data, param.data[param_id].rindex, value); | |||
osc_send_control(&osc.data, param.data[paramId].rindex, value); | |||
#endif | |||
CarlaPlugin::setParameterValue(paramId, value, sendGui, sendOsc, sendCallback); | |||
@@ -259,10 +259,10 @@ public: | |||
x_client->deactivate(); | |||
// Remove client ports | |||
remove_client_ports(); | |||
removeClientPorts(); | |||
// Delete old data | |||
delete_buffers(); | |||
deleteBuffers(); | |||
uint32_t ains, aouts, mins, params, j; | |||
ains = aouts = mins = params = 0; | |||
@@ -350,8 +350,8 @@ public: | |||
param.data[j].index = j; | |||
param.data[j].rindex = i; | |||
param.data[j].hints = 0; | |||
param.data[j].midi_channel = 0; | |||
param.data[j].midi_cc = -1; | |||
param.data[j].midiChannel = 0; | |||
param.data[j].midiCC = -1; | |||
double min, max, def, step, step_small, step_large; | |||
@@ -487,7 +487,7 @@ public: | |||
{ | |||
int16_t cc = DSSI_CC_NUMBER(controller); | |||
if (! MIDI_IS_CONTROL_BANK_SELECT(cc)) | |||
param.data[j].midi_cc = cc; | |||
param.data[j].midiCC = cc; | |||
} | |||
} | |||
} | |||
@@ -527,8 +527,8 @@ public: | |||
param.ranges[j].max = max; | |||
param.ranges[j].def = def; | |||
param.ranges[j].step = step; | |||
param.ranges[j].step_small = step_small; | |||
param.ranges[j].step_large = step_large; | |||
param.ranges[j].stepSmall = step_small; | |||
param.ranges[j].stepLarge = step_large; | |||
// Start parameters in their default values | |||
param_buffers[j] = def; | |||
@@ -733,19 +733,19 @@ public: | |||
{ | |||
for (k=0; k < nframes; k++) | |||
{ | |||
if (abs_d(ains_buffer[0][k]) > ains_peak_tmp[0]) | |||
ains_peak_tmp[0] = abs_d(ains_buffer[0][k]); | |||
if (abs(ains_buffer[0][k]) > ains_peak_tmp[0]) | |||
ains_peak_tmp[0] = abs(ains_buffer[0][k]); | |||
} | |||
} | |||
else if (ain.count >= 1) | |||
{ | |||
for (k=0; k < nframes; k++) | |||
{ | |||
if (abs_d(ains_buffer[0][k]) > ains_peak_tmp[0]) | |||
ains_peak_tmp[0] = abs_d(ains_buffer[0][k]); | |||
if (abs(ains_buffer[0][k]) > ains_peak_tmp[0]) | |||
ains_peak_tmp[0] = abs(ains_buffer[0][k]); | |||
if (abs_d(ains_buffer[1][k]) > ains_peak_tmp[1]) | |||
ains_peak_tmp[1] = abs_d(ains_buffer[1][k]); | |||
if (abs(ains_buffer[1][k]) > ains_peak_tmp[1]) | |||
ains_peak_tmp[1] = abs(ains_buffer[1][k]); | |||
} | |||
} | |||
} | |||
@@ -792,14 +792,14 @@ public: | |||
{ | |||
value = cin_event->value; | |||
setDryWet(value, false, false); | |||
postpone_event(PluginPostEventParameterChange, PARAMETER_DRYWET, value); | |||
postponeEvent(PluginPostEventParameterChange, PARAMETER_DRYWET, value); | |||
continue; | |||
} | |||
else if (MIDI_IS_CONTROL_CHANNEL_VOLUME(cin_event->controller) && (m_hints & PLUGIN_CAN_VOLUME) > 0) | |||
{ | |||
value = cin_event->value*127/100; | |||
setVolume(value, false, false); | |||
postpone_event(PluginPostEventParameterChange, PARAMETER_VOLUME, value); | |||
postponeEvent(PluginPostEventParameterChange, PARAMETER_VOLUME, value); | |||
continue; | |||
} | |||
else if (MIDI_IS_CONTROL_BALANCE(cin_event->controller) && (m_hints & PLUGIN_CAN_BALANCE) > 0) | |||
@@ -825,8 +825,8 @@ public: | |||
setBalanceLeft(left, false, false); | |||
setBalanceRight(right, false, false); | |||
postpone_event(PluginPostEventParameterChange, PARAMETER_BALANCE_LEFT, left); | |||
postpone_event(PluginPostEventParameterChange, PARAMETER_BALANCE_RIGHT, right); | |||
postponeEvent(PluginPostEventParameterChange, PARAMETER_BALANCE_LEFT, left); | |||
postponeEvent(PluginPostEventParameterChange, PARAMETER_BALANCE_RIGHT, right); | |||
continue; | |||
} | |||
} | |||
@@ -834,9 +834,9 @@ public: | |||
// Control plugin parameters | |||
for (k=0; k < param.count; k++) | |||
{ | |||
if (param.data[k].midi_channel != cin_event->channel) | |||
if (param.data[k].midiChannel != cin_event->channel) | |||
continue; | |||
if (param.data[k].midi_cc != cin_event->controller) | |||
if (param.data[k].midiCC != cin_event->controller) | |||
continue; | |||
if (param.data[k].type != PARAMETER_INPUT) | |||
continue; | |||
@@ -856,7 +856,7 @@ public: | |||
} | |||
setParameterValue(k, value, false, false, false); | |||
postpone_event(PluginPostEventParameterChange, k, value); | |||
postponeEvent(PluginPostEventParameterChange, k, value); | |||
} | |||
} | |||
@@ -879,7 +879,7 @@ public: | |||
if (midiprog.data[k].bank == mbank_id && midiprog.data[k].program == mprog_id) | |||
{ | |||
setMidiProgram(k, false, false, false, false); | |||
postpone_event(PluginPostEventMidiProgramChange, k, 0.0); | |||
postponeEvent(PluginPostEventMidiProgramChange, k, 0.0); | |||
break; | |||
} | |||
} | |||
@@ -890,10 +890,7 @@ public: | |||
if (cin_event->channel == cin_channel) | |||
{ | |||
if (midi.portMin) | |||
{ | |||
send_midi_all_notes_off(); | |||
midi_event_count += 128; | |||
} | |||
sendMidiAllNotesOff(); | |||
if (ldescriptor->deactivate) | |||
ldescriptor->deactivate(handle); | |||
@@ -907,10 +904,7 @@ public: | |||
if (cin_event->channel == cin_channel) | |||
{ | |||
if (midi.portMin) | |||
{ | |||
send_midi_all_notes_off(); | |||
midi_event_count += 128; | |||
} | |||
sendMidiAllNotesOff(); | |||
} | |||
break; | |||
} | |||
@@ -995,7 +989,7 @@ public: | |||
midi_event->data.note.note = note; | |||
if (channel == cin_channel) | |||
postpone_event(PluginPostEventNoteOff, note, 0.0); | |||
postponeEvent(PluginPostEventNoteOff, note, 0.0); | |||
} | |||
else if (MIDI_IS_STATUS_NOTE_ON(status)) | |||
{ | |||
@@ -1008,7 +1002,7 @@ public: | |||
midi_event->data.note.velocity = velo; | |||
if (channel == cin_channel) | |||
postpone_event(PluginPostEventNoteOn, note, velo); | |||
postponeEvent(PluginPostEventNoteOn, note, velo); | |||
} | |||
else if (MIDI_IS_STATUS_POLYPHONIC_AFTERTOUCH(status)) | |||
{ | |||
@@ -1176,8 +1170,8 @@ public: | |||
// Output VU | |||
for (k=0; k < nframes && i < 2; k++) | |||
{ | |||
if (abs_d(aouts_buffer[i][k]) > aouts_peak_tmp[i]) | |||
aouts_peak_tmp[i] = abs_d(aouts_buffer[i][k]); | |||
if (abs(aouts_buffer[i][k]) > aouts_peak_tmp[i]) | |||
aouts_peak_tmp[i] = abs(aouts_buffer[i][k]); | |||
} | |||
} | |||
} | |||
@@ -1210,12 +1204,12 @@ public: | |||
{ | |||
if (param.data[k].type == PARAMETER_OUTPUT) | |||
{ | |||
fix_parameter_value(param_buffers[k], param.ranges[k]); | |||
fixParameterValue(param_buffers[k], param.ranges[k]); | |||
if (param.data[k].midi_cc > 0) | |||
if (param.data[k].midiCC > 0) | |||
{ | |||
value = (param_buffers[k] - param.ranges[k].min) / (param.ranges[k].max - param.ranges[k].min); | |||
param.portCout->writeEvent(cout_buffer, CarlaEngineEventControlChange, nframesOffset, param.data[k].midi_channel, param.data[k].midi_cc, value); | |||
param.portCout->writeEvent(cout_buffer, CarlaEngineEventControlChange, nframesOffset, param.data[k].midiChannel, param.data[k].midiCC, value); | |||
} | |||
} | |||
} | |||
@@ -1237,16 +1231,16 @@ public: | |||
// ------------------------------------------------------------------- | |||
// Cleanup | |||
void delete_buffers() | |||
void deleteBuffers() | |||
{ | |||
qDebug("DssiPlugin::delete_buffers() - start"); | |||
qDebug("DssiPlugin::deleteBuffers() - start"); | |||
if (param.count > 0) | |||
delete[] param_buffers; | |||
param_buffers = nullptr; | |||
qDebug("DssiPlugin::delete_buffers() - end"); | |||
qDebug("DssiPlugin::deleteBuffers() - end"); | |||
} | |||
// ------------------------------------------------------------------- | |||
@@ -1256,16 +1250,16 @@ public: | |||
// --------------------------------------------------------------- | |||
// open DLL | |||
if (! lib_open(filename)) | |||
if (! libOpen(filename)) | |||
{ | |||
set_last_error(lib_error(filename)); | |||
set_last_error(libError(filename)); | |||
return false; | |||
} | |||
// --------------------------------------------------------------- | |||
// get DLL main entry | |||
DSSI_Descriptor_Function descfn = (DSSI_Descriptor_Function)lib_symbol("dssi_descriptor"); | |||
DSSI_Descriptor_Function descfn = (DSSI_Descriptor_Function)libSymbol("dssi_descriptor"); | |||
if (! descfn) | |||
{ | |||
@@ -1361,7 +1355,7 @@ short add_plugin_dssi(const char* filename, const char* label, const void* extra | |||
unique_names[id] = plugin->name(); | |||
CarlaPlugins[id] = plugin; | |||
plugin->osc_register_new(); | |||
plugin->registerToOsc(); | |||
} | |||
else | |||
{ | |||
@@ -269,7 +269,7 @@ public: | |||
void set_parameter_value(uint32_t param_id, double value, bool gui_send, bool osc_send, bool callback_send) | |||
{ | |||
assert(param_id < param.count); | |||
param_buffers[param_id] = fix_parameter_value(value, param.ranges[param_id]); | |||
param_buffers[param_id] = fixParameterValue(value, param.ranges[param_id]); | |||
switch(param_id) | |||
{ | |||
@@ -323,7 +323,7 @@ public: | |||
break; | |||
} | |||
CarlaPlugin::set_parameter_value(param_id, value, gui_send, osc_send, callback_send); | |||
CarlaPlugin::setParameterValue(param_id, value, gui_send, osc_send, callback_send); | |||
} | |||
void set_midi_program(int32_t index, bool gui_send, bool osc_send, bool callback_send, bool block) | |||
@@ -347,7 +347,7 @@ public: | |||
} | |||
} | |||
CarlaPlugin::set_midi_program(index, gui_send, osc_send, callback_send, block); | |||
CarlaPlugin::setMidiProgram(index, gui_send, osc_send, callback_send, block); | |||
} | |||
// ------------------------------------------------------------------- | |||
@@ -364,10 +364,10 @@ public: | |||
x_client->deactivate(); | |||
// Remove client ports | |||
remove_client_ports(); | |||
removeClientPorts(); | |||
// Delete old data | |||
delete_buffers(); | |||
deleteBuffers(); | |||
uint32_t aouts, params, j; | |||
aouts = 2; | |||
@@ -424,7 +424,7 @@ public: | |||
#endif | |||
strcpy(port_name, "midi-in"); | |||
midi.port_min = (CarlaEngineMidiPort*)x_client->addPort(port_name, CarlaEnginePortTypeMIDI, true); | |||
midi.portMin = (CarlaEngineMidiPort*)x_client->addPort(port_name, CarlaEnginePortTypeMIDI, true); | |||
// --------------------------------------- | |||
// Parameters | |||
@@ -439,7 +439,7 @@ public: | |||
#endif | |||
strcpy(port_name, "control-in"); | |||
param.port_cin = (CarlaEngineControlPort*)x_client->addPort(port_name, CarlaEnginePortTypeControl, true); | |||
param.portCin = (CarlaEngineControlPort*)x_client->addPort(port_name, CarlaEnginePortTypeControl, true); | |||
#ifndef BUILD_BRIDGE | |||
if (carla_options.process_mode != PROCESS_MODE_MULTIPLE_CLIENTS) | |||
@@ -451,7 +451,7 @@ public: | |||
#endif | |||
strcpy(port_name, "control-out"); | |||
param.port_cout = (CarlaEngineControlPort*)x_client->addPort(port_name, CarlaEnginePortTypeControl, false); | |||
param.portCout = (CarlaEngineControlPort*)x_client->addPort(port_name, CarlaEnginePortTypeControl, false); | |||
// ---------------------- | |||
j = FluidSynthReverbOnOff; | |||
@@ -459,14 +459,14 @@ public: | |||
param.data[j].rindex = j; | |||
param.data[j].type = PARAMETER_INPUT; | |||
param.data[j].hints = PARAMETER_IS_ENABLED | PARAMETER_IS_AUTOMABLE | PARAMETER_IS_BOOLEAN; | |||
param.data[j].midi_channel = 0; | |||
param.data[j].midi_cc = -1; | |||
param.data[j].midiChannel = 0; | |||
param.data[j].midiCC = -1; | |||
param.ranges[j].min = 0.0; | |||
param.ranges[j].max = 1.0; | |||
param.ranges[j].def = 0.0; | |||
param.ranges[j].step = 1.0; | |||
param.ranges[j].step_small = 1.0; | |||
param.ranges[j].step_large = 1.0; | |||
param.ranges[j].stepSmall = 1.0; | |||
param.ranges[j].stepLarge = 1.0; | |||
param_buffers[j] = param.ranges[j].def; | |||
// ---------------------- | |||
@@ -475,14 +475,14 @@ public: | |||
param.data[j].rindex = j; | |||
param.data[j].type = PARAMETER_INPUT; | |||
param.data[j].hints = PARAMETER_IS_ENABLED | PARAMETER_IS_AUTOMABLE; | |||
param.data[j].midi_channel = 0; | |||
param.data[j].midi_cc = -1; | |||
param.data[j].midiChannel = 0; | |||
param.data[j].midiCC = -1; | |||
param.ranges[j].min = 0.0; | |||
param.ranges[j].max = 1.2; | |||
param.ranges[j].def = FLUID_REVERB_DEFAULT_ROOMSIZE; | |||
param.ranges[j].step = 0.01; | |||
param.ranges[j].step_small = 0.0001; | |||
param.ranges[j].step_large = 0.1; | |||
param.ranges[j].stepSmall = 0.0001; | |||
param.ranges[j].stepLarge = 0.1; | |||
param_buffers[j] = param.ranges[j].def; | |||
// ---------------------- | |||
@@ -491,14 +491,14 @@ public: | |||
param.data[j].rindex = j; | |||
param.data[j].type = PARAMETER_INPUT; | |||
param.data[j].hints = PARAMETER_IS_ENABLED | PARAMETER_IS_AUTOMABLE; | |||
param.data[j].midi_channel = 0; | |||
param.data[j].midi_cc = -1; | |||
param.data[j].midiChannel = 0; | |||
param.data[j].midiCC = -1; | |||
param.ranges[j].min = 0.0; | |||
param.ranges[j].max = 1.0; | |||
param.ranges[j].def = FLUID_REVERB_DEFAULT_DAMP; | |||
param.ranges[j].step = 0.01; | |||
param.ranges[j].step_small = 0.0001; | |||
param.ranges[j].step_large = 0.1; | |||
param.ranges[j].stepSmall = 0.0001; | |||
param.ranges[j].stepLarge = 0.1; | |||
param_buffers[j] = param.ranges[j].def; | |||
// ---------------------- | |||
@@ -507,14 +507,14 @@ public: | |||
param.data[j].rindex = j; | |||
param.data[j].type = PARAMETER_INPUT; | |||
param.data[j].hints = PARAMETER_IS_ENABLED | PARAMETER_IS_AUTOMABLE; | |||
param.data[j].midi_channel = 0; | |||
param.data[j].midi_cc = MIDI_CONTROL_REVERB_SEND_LEVEL; | |||
param.data[j].midiChannel = 0; | |||
param.data[j].midiCC = MIDI_CONTROL_REVERB_SEND_LEVEL; | |||
param.ranges[j].min = 0.0; | |||
param.ranges[j].max = 1.0; | |||
param.ranges[j].def = FLUID_REVERB_DEFAULT_LEVEL; | |||
param.ranges[j].step = 0.01; | |||
param.ranges[j].step_small = 0.0001; | |||
param.ranges[j].step_large = 0.1; | |||
param.ranges[j].stepSmall = 0.0001; | |||
param.ranges[j].stepLarge = 0.1; | |||
param_buffers[j] = param.ranges[j].def; | |||
// ---------------------- | |||
@@ -523,14 +523,14 @@ public: | |||
param.data[j].rindex = j; | |||
param.data[j].type = PARAMETER_INPUT; | |||
param.data[j].hints = PARAMETER_IS_ENABLED | PARAMETER_IS_AUTOMABLE; | |||
param.data[j].midi_channel = 0; | |||
param.data[j].midi_cc = -1; | |||
param.data[j].midiChannel = 0; | |||
param.data[j].midiCC = -1; | |||
param.ranges[j].min = 0.0; | |||
param.ranges[j].max = 10.0; // should be 100, but that sounds too much | |||
param.ranges[j].def = FLUID_REVERB_DEFAULT_WIDTH; | |||
param.ranges[j].step = 0.01; | |||
param.ranges[j].step_small = 0.0001; | |||
param.ranges[j].step_large = 0.1; | |||
param.ranges[j].stepSmall = 0.0001; | |||
param.ranges[j].stepLarge = 0.1; | |||
param_buffers[j] = param.ranges[j].def; | |||
// ---------------------- | |||
@@ -539,14 +539,14 @@ public: | |||
param.data[j].rindex = j; | |||
param.data[j].type = PARAMETER_INPUT; | |||
param.data[j].hints = PARAMETER_IS_ENABLED | PARAMETER_IS_BOOLEAN; | |||
param.data[j].midi_channel = 0; | |||
param.data[j].midi_cc = -1; | |||
param.data[j].midiChannel = 0; | |||
param.data[j].midiCC = -1; | |||
param.ranges[j].min = 0.0; | |||
param.ranges[j].max = 1.0; | |||
param.ranges[j].def = 0.0; | |||
param.ranges[j].step = 1.0; | |||
param.ranges[j].step_small = 1.0; | |||
param.ranges[j].step_large = 1.0; | |||
param.ranges[j].stepSmall = 1.0; | |||
param.ranges[j].stepLarge = 1.0; | |||
param_buffers[j] = param.ranges[j].def; | |||
// ---------------------- | |||
@@ -555,14 +555,14 @@ public: | |||
param.data[j].rindex = j; | |||
param.data[j].type = PARAMETER_INPUT; | |||
param.data[j].hints = PARAMETER_IS_ENABLED | PARAMETER_IS_INTEGER; | |||
param.data[j].midi_channel = 0; | |||
param.data[j].midi_cc = -1; | |||
param.data[j].midiChannel = 0; | |||
param.data[j].midiCC = -1; | |||
param.ranges[j].min = 0.0; | |||
param.ranges[j].max = 99.0; | |||
param.ranges[j].def = FLUID_CHORUS_DEFAULT_N; | |||
param.ranges[j].step = 1.0; | |||
param.ranges[j].step_small = 1.0; | |||
param.ranges[j].step_large = 10.0; | |||
param.ranges[j].stepSmall = 1.0; | |||
param.ranges[j].stepLarge = 10.0; | |||
param_buffers[j] = param.ranges[j].def; | |||
// ---------------------- | |||
@@ -571,14 +571,14 @@ public: | |||
param.data[j].rindex = j; | |||
param.data[j].type = PARAMETER_INPUT; | |||
param.data[j].hints = PARAMETER_IS_ENABLED; | |||
param.data[j].midi_channel = 0; | |||
param.data[j].midi_cc = 0; //MIDI_CONTROL_CHORUS_SEND_LEVEL; | |||
param.data[j].midiChannel = 0; | |||
param.data[j].midiCC = 0; //MIDI_CONTROL_CHORUS_SEND_LEVEL; | |||
param.ranges[j].min = 0.0; | |||
param.ranges[j].max = 10.0; | |||
param.ranges[j].def = FLUID_CHORUS_DEFAULT_LEVEL; | |||
param.ranges[j].step = 0.01; | |||
param.ranges[j].step_small = 0.0001; | |||
param.ranges[j].step_large = 0.1; | |||
param.ranges[j].stepSmall = 0.0001; | |||
param.ranges[j].stepLarge = 0.1; | |||
param_buffers[j] = param.ranges[j].def; | |||
// ---------------------- | |||
@@ -587,14 +587,14 @@ public: | |||
param.data[j].rindex = j; | |||
param.data[j].type = PARAMETER_INPUT; | |||
param.data[j].hints = PARAMETER_IS_ENABLED; | |||
param.data[j].midi_channel = 0; | |||
param.data[j].midi_cc = -1; | |||
param.data[j].midiChannel = 0; | |||
param.data[j].midiCC = -1; | |||
param.ranges[j].min = 0.29; | |||
param.ranges[j].max = 5.0; | |||
param.ranges[j].def = FLUID_CHORUS_DEFAULT_SPEED; | |||
param.ranges[j].step = 0.01; | |||
param.ranges[j].step_small = 0.0001; | |||
param.ranges[j].step_large = 0.1; | |||
param.ranges[j].stepSmall = 0.0001; | |||
param.ranges[j].stepLarge = 0.1; | |||
param_buffers[j] = param.ranges[j].def; | |||
// ---------------------- | |||
@@ -603,14 +603,14 @@ public: | |||
param.data[j].rindex = j; | |||
param.data[j].type = PARAMETER_INPUT; | |||
param.data[j].hints = PARAMETER_IS_ENABLED; | |||
param.data[j].midi_channel = 0; | |||
param.data[j].midi_cc = -1; | |||
param.data[j].midiChannel = 0; | |||
param.data[j].midiCC = -1; | |||
param.ranges[j].min = 0.0; | |||
param.ranges[j].max = 2048000.0 / get_sample_rate(); | |||
param.ranges[j].def = FLUID_CHORUS_DEFAULT_DEPTH; | |||
param.ranges[j].step = 0.01; | |||
param.ranges[j].step_small = 0.0001; | |||
param.ranges[j].step_large = 0.1; | |||
param.ranges[j].stepSmall = 0.0001; | |||
param.ranges[j].stepLarge = 0.1; | |||
param_buffers[j] = param.ranges[j].def; | |||
// ---------------------- | |||
@@ -619,14 +619,14 @@ public: | |||
param.data[j].rindex = j; | |||
param.data[j].type = PARAMETER_INPUT; | |||
param.data[j].hints = PARAMETER_IS_ENABLED | PARAMETER_IS_INTEGER | PARAMETER_USES_SCALEPOINTS; | |||
param.data[j].midi_channel = 0; | |||
param.data[j].midi_cc = -1; | |||
param.data[j].midiChannel = 0; | |||
param.data[j].midiCC = -1; | |||
param.ranges[j].min = FLUID_CHORUS_MOD_SINE; | |||
param.ranges[j].max = FLUID_CHORUS_MOD_TRIANGLE; | |||
param.ranges[j].def = FLUID_CHORUS_DEFAULT_TYPE; | |||
param.ranges[j].step = 1; | |||
param.ranges[j].step_small = 1; | |||
param.ranges[j].step_large = 1; | |||
param.ranges[j].stepSmall = 1; | |||
param.ranges[j].stepLarge = 1; | |||
param_buffers[j] = param.ranges[j].def; | |||
// ---------------------- | |||
@@ -635,14 +635,14 @@ public: | |||
param.data[j].rindex = j; | |||
param.data[j].type = PARAMETER_INPUT; | |||
param.data[j].hints = PARAMETER_IS_ENABLED | PARAMETER_IS_INTEGER; | |||
param.data[j].midi_channel = 0; | |||
param.data[j].midi_cc = -1; | |||
param.data[j].midiChannel = 0; | |||
param.data[j].midiCC = -1; | |||
param.ranges[j].min = 1; | |||
param.ranges[j].max = 512; // max theoric is 65535 | |||
param.ranges[j].def = fluid_synth_get_polyphony(f_synth); | |||
param.ranges[j].step = 1; | |||
param.ranges[j].step_small = 1; | |||
param.ranges[j].step_large = 10; | |||
param.ranges[j].stepSmall = 1; | |||
param.ranges[j].stepLarge = 10; | |||
param_buffers[j] = param.ranges[j].def; | |||
// ---------------------- | |||
@@ -651,14 +651,14 @@ public: | |||
param.data[j].rindex = j; | |||
param.data[j].type = PARAMETER_INPUT; | |||
param.data[j].hints = PARAMETER_IS_ENABLED | PARAMETER_IS_INTEGER | PARAMETER_USES_SCALEPOINTS; | |||
param.data[j].midi_channel = 0; | |||
param.data[j].midi_cc = -1; | |||
param.data[j].midiChannel = 0; | |||
param.data[j].midiCC = -1; | |||
param.ranges[j].min = FLUID_INTERP_NONE; | |||
param.ranges[j].max = FLUID_INTERP_HIGHEST; | |||
param.ranges[j].def = FLUID_INTERP_DEFAULT; | |||
param.ranges[j].step = 1; | |||
param.ranges[j].step_small = 1; | |||
param.ranges[j].step_large = 1; | |||
param.ranges[j].stepSmall = 1; | |||
param.ranges[j].stepLarge = 1; | |||
param_buffers[j] = param.ranges[j].def; | |||
// ---------------------- | |||
@@ -667,14 +667,14 @@ public: | |||
param.data[j].rindex = j; | |||
param.data[j].type = PARAMETER_OUTPUT; | |||
param.data[j].hints = PARAMETER_IS_ENABLED | PARAMETER_IS_AUTOMABLE | PARAMETER_IS_INTEGER; | |||
param.data[j].midi_channel = 0; | |||
param.data[j].midi_cc = -1; | |||
param.data[j].midiChannel = 0; | |||
param.data[j].midiCC = -1; | |||
param.ranges[j].min = 0; | |||
param.ranges[j].max = 65535; | |||
param.ranges[j].def = 0; | |||
param.ranges[j].step = 1; | |||
param.ranges[j].step_small = 1; | |||
param.ranges[j].step_large = 1; | |||
param.ranges[j].stepSmall = 1; | |||
param.ranges[j].stepLarge = 1; | |||
param_buffers[j] = param.ranges[j].def; | |||
// --------------------------------------- | |||
@@ -790,12 +790,12 @@ public: | |||
// -------------------------------------------------------------------------------------------------------- | |||
// Parameters Input [Automation] | |||
if (m_active && m_active_before) | |||
if (m_active && m_activeBefore) | |||
{ | |||
void* cin_buffer = param.port_cin->getBuffer(); | |||
void* cin_buffer = param.portCin->getBuffer(); | |||
const CarlaEngineControlEvent* cin_event; | |||
uint32_t time, n_cin_events = param.port_cin->getEventCount(cin_buffer); | |||
uint32_t time, n_cin_events = param.portCin->getEventCount(cin_buffer); | |||
unsigned char next_bank_ids[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 0, 0, 0, 0, 0 }; | |||
@@ -804,7 +804,7 @@ public: | |||
for (i=0; i < n_cin_events; i++) | |||
{ | |||
cin_event = param.port_cin->getEvent(cin_buffer, i); | |||
cin_event = param.portCin->getEvent(cin_buffer, i); | |||
if (! cin_event) | |||
continue; | |||
@@ -827,15 +827,15 @@ public: | |||
if (MIDI_IS_CONTROL_BREATH_CONTROLLER(cin_event->controller) && (m_hints & PLUGIN_CAN_DRYWET) > 0) | |||
{ | |||
value = cin_event->value; | |||
set_drywet(value, false, false); | |||
postpone_event(PluginPostEventParameterChange, PARAMETER_DRYWET, value); | |||
setDryWet(value, false, false); | |||
postponeEvent(PluginPostEventParameterChange, PARAMETER_DRYWET, value); | |||
continue; | |||
} | |||
else if (MIDI_IS_CONTROL_CHANNEL_VOLUME(cin_event->controller) && (m_hints & PLUGIN_CAN_VOLUME) > 0) | |||
{ | |||
value = cin_event->value*127/100; | |||
set_volume(value, false, false); | |||
postpone_event(PluginPostEventParameterChange, PARAMETER_VOLUME, value); | |||
setVolume(value, false, false); | |||
postponeEvent(PluginPostEventParameterChange, PARAMETER_VOLUME, value); | |||
continue; | |||
} | |||
else if (MIDI_IS_CONTROL_BALANCE(cin_event->controller) && (m_hints & PLUGIN_CAN_BALANCE) > 0) | |||
@@ -859,10 +859,10 @@ public: | |||
right = 1.0; | |||
} | |||
set_balance_left(left, false, false); | |||
set_balance_right(right, false, false); | |||
postpone_event(PluginPostEventParameterChange, PARAMETER_BALANCE_LEFT, left); | |||
postpone_event(PluginPostEventParameterChange, PARAMETER_BALANCE_RIGHT, right); | |||
setBalanceLeft(left, false, false); | |||
setBalanceRight(right, false, false); | |||
postponeEvent(PluginPostEventParameterChange, PARAMETER_BALANCE_LEFT, left); | |||
postponeEvent(PluginPostEventParameterChange, PARAMETER_BALANCE_RIGHT, right); | |||
continue; | |||
} | |||
} | |||
@@ -870,9 +870,9 @@ public: | |||
// Control plugin parameters | |||
for (k=0; k < param.count; k++) | |||
{ | |||
if (param.data[k].midi_channel != cin_event->channel) | |||
if (param.data[k].midiChannel != cin_event->channel) | |||
continue; | |||
if (param.data[k].midi_cc != cin_event->controller) | |||
if (param.data[k].midiCC != cin_event->controller) | |||
continue; | |||
if (param.data[k].type != PARAMETER_INPUT) | |||
continue; | |||
@@ -892,7 +892,7 @@ public: | |||
} | |||
set_parameter_value(k, value, false, false, false); | |||
postpone_event(PluginPostEventParameterChange, k, value); | |||
postponeEvent(PluginPostEventParameterChange, k, value); | |||
} | |||
} | |||
@@ -916,8 +916,8 @@ public: | |||
{ | |||
if (cin_event->channel == cin_channel) | |||
{ | |||
set_midi_program(k, false, false, false, false); | |||
postpone_event(PluginPostEventMidiProgramChange, k, 0.0); | |||
setMidiProgram(k, false, false, false, false); | |||
postponeEvent(PluginPostEventMidiProgramChange, k, 0.0); | |||
} | |||
else | |||
fluid_synth_program_select(f_synth, cin_event->channel, f_id, mbank_id, mprog_id); | |||
@@ -931,8 +931,7 @@ public: | |||
case CarlaEngineEventAllSoundOff: | |||
if (cin_event->channel == cin_channel) | |||
{ | |||
send_midi_all_notes_off(); | |||
midi_event_count += 128; | |||
sendMidiAllNotesOff(); | |||
#ifdef FLUIDSYNTH_VERSION_NEW_API | |||
fluid_synth_all_notes_off(f_synth, cin_channel); | |||
@@ -951,8 +950,7 @@ public: | |||
case CarlaEngineEventAllNotesOff: | |||
if (cin_event->channel == cin_channel) | |||
{ | |||
send_midi_all_notes_off(); | |||
midi_event_count += 128; | |||
sendMidiAllNotesOff(); | |||
#ifdef FLUIDSYNTH_VERSION_NEW_API | |||
fluid_synth_all_notes_off(f_synth, cin_channel); | |||
@@ -974,7 +972,7 @@ public: | |||
// -------------------------------------------------------------------------------------------------------- | |||
// MIDI Input (External) | |||
if (cin_channel >= 0 && cin_channel < 16 && m_active && m_active_before) | |||
if (cin_channel >= 0 && cin_channel < 16 && m_active && m_activeBefore) | |||
{ | |||
carla_midi_lock(); | |||
@@ -1003,16 +1001,16 @@ public: | |||
// -------------------------------------------------------------------------------------------------------- | |||
// MIDI Input (System) | |||
if (m_active && m_active_before) | |||
if (m_active && m_activeBefore) | |||
{ | |||
void* min_buffer = midi.port_min->getBuffer(); | |||
void* min_buffer = midi.portMin->getBuffer(); | |||
const CarlaEngineMidiEvent* min_event; | |||
uint32_t time, n_min_events = midi.port_min->getEventCount(min_buffer); | |||
uint32_t time, n_min_events = midi.portMin->getEventCount(min_buffer); | |||
for (i=0; i < n_min_events && midi_event_count < MAX_MIDI_EVENTS; i++) | |||
{ | |||
min_event = midi.port_min->getEvent(min_buffer, i); | |||
min_event = midi.portMin->getEvent(min_buffer, i); | |||
if (! min_event) | |||
continue; | |||
@@ -1036,7 +1034,7 @@ public: | |||
fluid_synth_noteoff(f_synth, channel, note); | |||
if (channel == cin_channel) | |||
postpone_event(PluginPostEventNoteOff, note, 0.0); | |||
postponeEvent(PluginPostEventNoteOff, note, 0.0); | |||
} | |||
else if (MIDI_IS_STATUS_NOTE_ON(status)) | |||
{ | |||
@@ -1046,7 +1044,7 @@ public: | |||
fluid_synth_noteon(f_synth, channel, note, velo); | |||
if (channel == cin_channel) | |||
postpone_event(PluginPostEventNoteOn, note, velo); | |||
postponeEvent(PluginPostEventNoteOn, note, velo); | |||
} | |||
else if (MIDI_IS_STATUS_AFTERTOUCH(status)) | |||
{ | |||
@@ -1075,7 +1073,7 @@ public: | |||
if (m_active) | |||
{ | |||
if (! m_active_before) | |||
if (! m_activeBefore) | |||
{ | |||
if (cin_channel >= 0 && cin_channel < 16) | |||
{ | |||
@@ -1141,8 +1139,8 @@ public: | |||
// Output VU | |||
for (k=0; k < nframes && i < 2; k++) | |||
{ | |||
if (abs_d(aouts_buffer[i][k]) > aouts_peak_tmp[i]) | |||
aouts_peak_tmp[i] = abs_d(aouts_buffer[i][k]); | |||
if (abs(aouts_buffer[i][k]) > aouts_peak_tmp[i]) | |||
aouts_peak_tmp[i] = abs(aouts_buffer[i][k]); | |||
} | |||
} | |||
} | |||
@@ -1164,19 +1162,19 @@ public: | |||
if (m_active) | |||
{ | |||
void* cout_buffer = param.port_cout->getBuffer(); | |||
void* cout_buffer = param.portCout->getBuffer(); | |||
if (nframesOffset == 0 || ! m_active_before) | |||
param.port_cout->initBuffer(cout_buffer); | |||
if (nframesOffset == 0 || ! m_activeBefore) | |||
param.portCout->initBuffer(cout_buffer); | |||
k = FluidSynthVoiceCount; | |||
param_buffers[k] = rint(fluid_synth_get_active_voice_count(f_synth)); | |||
fix_parameter_value(param_buffers[k], param.ranges[k]); | |||
fixParameterValue(param_buffers[k], param.ranges[k]); | |||
if (param.data[k].midi_cc > 0) | |||
if (param.data[k].midiCC > 0) | |||
{ | |||
double value = (param_buffers[k] - param.ranges[k].min) / (param.ranges[k].max - param.ranges[k].min); | |||
param.port_cout->writeEvent(cout_buffer, CarlaEngineEventControlChange, nframesOffset, param.data[k].midi_channel, param.data[k].midi_cc, value); | |||
param.portCout->writeEvent(cout_buffer, CarlaEngineEventControlChange, nframesOffset, param.data[k].midiChannel, param.data[k].midiCC, value); | |||
} | |||
} // End of Control Output | |||
@@ -1188,7 +1186,7 @@ public: | |||
aouts_peak[(m_id*2)+0] = aouts_peak_tmp[0]; | |||
aouts_peak[(m_id*2)+1] = aouts_peak_tmp[1]; | |||
m_active_before = m_active; | |||
m_activeBefore = m_active; | |||
} | |||
bool init(const char* filename, const char* label) | |||
@@ -1273,7 +1271,7 @@ short add_plugin_sf2(const char* filename, const char* label) | |||
unique_names[id] = plugin->name(); | |||
CarlaPlugins[id] = plugin; | |||
plugin->osc_register_new(); | |||
plugin->registerToOsc(); | |||
} | |||
else | |||
{ | |||
@@ -271,7 +271,7 @@ public: | |||
void setParameterValue(uint32_t paramId, double value, bool sendGui, bool sendOsc, bool sendCallback) | |||
{ | |||
assert(paramId < param.count); | |||
param_buffers[paramId] = fix_parameter_value(value, param.ranges[paramId]); | |||
param_buffers[paramId] = fixParameterValue(value, param.ranges[paramId]); | |||
CarlaPlugin::setParameterValue(paramId, value, sendGui, sendOsc, sendCallback); | |||
} | |||
@@ -289,10 +289,10 @@ public: | |||
x_client->deactivate(); | |||
// Remove client ports | |||
remove_client_ports(); | |||
removeClientPorts(); | |||
// Delete old data | |||
delete_buffers(); | |||
deleteBuffers(); | |||
uint32_t ains, aouts, params, j; | |||
ains = aouts = params = 0; | |||
@@ -378,8 +378,8 @@ public: | |||
param.data[j].index = j; | |||
param.data[j].rindex = i; | |||
param.data[j].hints = 0; | |||
param.data[j].midi_channel = 0; | |||
param.data[j].midi_cc = -1; | |||
param.data[j].midiChannel = 0; | |||
param.data[j].midiCC = -1; | |||
double min, max, def, step, step_small, step_large; | |||
@@ -550,8 +550,8 @@ public: | |||
param.ranges[j].max = max; | |||
param.ranges[j].def = def; | |||
param.ranges[j].step = step; | |||
param.ranges[j].step_small = step_small; | |||
param.ranges[j].step_large = step_large; | |||
param.ranges[j].stepSmall = step_small; | |||
param.ranges[j].stepLarge = step_large; | |||
// Start parameters in their default values | |||
param_buffers[j] = def; | |||
@@ -638,19 +638,19 @@ public: | |||
{ | |||
for (k=0; k < nframes; k++) | |||
{ | |||
if (abs_d(ains_buffer[0][k]) > ains_peak_tmp[0]) | |||
ains_peak_tmp[0] = abs_d(ains_buffer[0][k]); | |||
if (abs(ains_buffer[0][k]) > ains_peak_tmp[0]) | |||
ains_peak_tmp[0] = abs(ains_buffer[0][k]); | |||
} | |||
} | |||
else if (ain.count >= 1) | |||
{ | |||
for (k=0; k < nframes; k++) | |||
{ | |||
if (abs_d(ains_buffer[0][k]) > ains_peak_tmp[0]) | |||
ains_peak_tmp[0] = abs_d(ains_buffer[0][k]); | |||
if (abs(ains_buffer[0][k]) > ains_peak_tmp[0]) | |||
ains_peak_tmp[0] = abs(ains_buffer[0][k]); | |||
if (abs_d(ains_buffer[1][k]) > ains_peak_tmp[1]) | |||
ains_peak_tmp[1] = abs_d(ains_buffer[1][k]); | |||
if (abs(ains_buffer[1][k]) > ains_peak_tmp[1]) | |||
ains_peak_tmp[1] = abs(ains_buffer[1][k]); | |||
} | |||
} | |||
} | |||
@@ -693,14 +693,14 @@ public: | |||
{ | |||
value = cin_event->value; | |||
setDryWet(value, false, false); | |||
postpone_event(PluginPostEventParameterChange, PARAMETER_DRYWET, value); | |||
postponeEvent(PluginPostEventParameterChange, PARAMETER_DRYWET, value); | |||
continue; | |||
} | |||
else if (MIDI_IS_CONTROL_CHANNEL_VOLUME(cin_event->controller) && (m_hints & PLUGIN_CAN_VOLUME) > 0) | |||
{ | |||
value = cin_event->value*127/100; | |||
setVolume(value, false, false); | |||
postpone_event(PluginPostEventParameterChange, PARAMETER_VOLUME, value); | |||
postponeEvent(PluginPostEventParameterChange, PARAMETER_VOLUME, value); | |||
continue; | |||
} | |||
else if (MIDI_IS_CONTROL_BALANCE(cin_event->controller) && (m_hints & PLUGIN_CAN_BALANCE) > 0) | |||
@@ -726,8 +726,8 @@ public: | |||
setBalanceLeft(left, false, false); | |||
setBalanceRight(right, false, false); | |||
postpone_event(PluginPostEventParameterChange, PARAMETER_BALANCE_LEFT, left); | |||
postpone_event(PluginPostEventParameterChange, PARAMETER_BALANCE_RIGHT, right); | |||
postponeEvent(PluginPostEventParameterChange, PARAMETER_BALANCE_LEFT, left); | |||
postponeEvent(PluginPostEventParameterChange, PARAMETER_BALANCE_RIGHT, right); | |||
continue; | |||
} | |||
} | |||
@@ -735,9 +735,9 @@ public: | |||
// Control plugin parameters | |||
for (k=0; k < param.count; k++) | |||
{ | |||
if (param.data[k].midi_channel != cin_event->channel) | |||
if (param.data[k].midiChannel != cin_event->channel) | |||
continue; | |||
if (param.data[k].midi_cc != cin_event->controller) | |||
if (param.data[k].midiCC != cin_event->controller) | |||
continue; | |||
if (param.data[k].type != PARAMETER_INPUT) | |||
continue; | |||
@@ -757,7 +757,7 @@ public: | |||
} | |||
setParameterValue(k, value, false, false, false); | |||
postpone_event(PluginPostEventParameterChange, k, value); | |||
postponeEvent(PluginPostEventParameterChange, k, value); | |||
} | |||
} | |||
@@ -890,8 +890,8 @@ public: | |||
// Output VU | |||
for (k=0; k < nframes && i < 2; k++) | |||
{ | |||
if (abs_d(aouts_buffer[i][k]) > aouts_peak_tmp[i]) | |||
aouts_peak_tmp[i] = abs_d(aouts_buffer[i][k]); | |||
if (abs(aouts_buffer[i][k]) > aouts_peak_tmp[i]) | |||
aouts_peak_tmp[i] = abs(aouts_buffer[i][k]); | |||
} | |||
} | |||
} | |||
@@ -924,12 +924,12 @@ public: | |||
{ | |||
if (param.data[k].type == PARAMETER_OUTPUT) | |||
{ | |||
fix_parameter_value(param_buffers[k], param.ranges[k]); | |||
fixParameterValue(param_buffers[k], param.ranges[k]); | |||
if (param.data[k].midi_cc > 0) | |||
if (param.data[k].midiCC > 0) | |||
{ | |||
value = (param_buffers[k] - param.ranges[k].min) / (param.ranges[k].max - param.ranges[k].min); | |||
param.portCout->writeEvent(cout_buffer, CarlaEngineEventControlChange, nframesOffset, param.data[k].midi_channel, param.data[k].midi_cc, value); | |||
param.portCout->writeEvent(cout_buffer, CarlaEngineEventControlChange, nframesOffset, param.data[k].midiChannel, param.data[k].midiCC, value); | |||
} | |||
} | |||
} | |||
@@ -951,16 +951,16 @@ public: | |||
// ------------------------------------------------------------------- | |||
// Cleanup | |||
void delete_buffers() | |||
void deleteBuffers() | |||
{ | |||
qDebug("LadspaPlugin::delete_buffers() - start"); | |||
qDebug("LadspaPlugin::deleteBuffers() - start"); | |||
if (param.count > 0) | |||
delete[] param_buffers; | |||
param_buffers = nullptr; | |||
qDebug("LadspaPlugin::delete_buffers() - end"); | |||
qDebug("LadspaPlugin::deleteBuffers() - end"); | |||
} | |||
// ------------------------------------------------------------------- | |||
@@ -970,16 +970,16 @@ public: | |||
// --------------------------------------------------------------- | |||
// open DLL | |||
if (! lib_open(filename)) | |||
if (! libOpen(filename)) | |||
{ | |||
set_last_error(lib_error(filename)); | |||
set_last_error(libError(filename)); | |||
return false; | |||
} | |||
// --------------------------------------------------------------- | |||
// get DLL main entry | |||
LADSPA_Descriptor_Function descfn = (LADSPA_Descriptor_Function)lib_symbol("ladspa_descriptor"); | |||
LADSPA_Descriptor_Function descfn = (LADSPA_Descriptor_Function)libSymbol("ladspa_descriptor"); | |||
if (! descfn) | |||
{ | |||
@@ -1066,7 +1066,7 @@ short add_plugin_ladspa(const char* filename, const char* label, const void* ext | |||
unique_names[id] = plugin->name(); | |||
CarlaPlugins[id] = plugin; | |||
plugin->osc_register_new(); | |||
plugin->registerToOsc(); | |||
} | |||
else | |||
{ | |||
@@ -227,10 +227,10 @@ public: | |||
x_client->deactivate(); | |||
// Remove client ports | |||
remove_client_ports(); | |||
removeClientPorts(); | |||
// Delete old data | |||
delete_buffers(); | |||
deleteBuffers(); | |||
uint32_t aouts; | |||
aouts = 2; | |||
@@ -283,7 +283,7 @@ public: | |||
#endif | |||
strcpy(port_name, "midi-in"); | |||
midi.port_min = (CarlaEngineMidiPort*)x_client->addPort(port_name, CarlaEnginePortTypeMIDI, true); | |||
midi.portMin = (CarlaEngineMidiPort*)x_client->addPort(port_name, CarlaEnginePortTypeMIDI, true); | |||
// --------------------------------------- | |||
@@ -348,7 +348,7 @@ public: | |||
if (init && midiprog.count > 0) | |||
{ | |||
set_midi_program(0, false, false, false, true); | |||
setMidiProgram(0, false, false, false, true); | |||
} | |||
} | |||
@@ -367,7 +367,7 @@ public: | |||
// -------------------------------------------------------------------------------------------------------- | |||
// MIDI Input (External) | |||
if (cin_channel >= 0 && cin_channel < 16 && m_active && m_active_before) | |||
if (cin_channel >= 0 && cin_channel < 16 && m_active && m_activeBefore) | |||
{ | |||
carla_midi_lock(); | |||
@@ -396,16 +396,16 @@ public: | |||
// -------------------------------------------------------------------------------------------------------- | |||
// MIDI Input (System) | |||
if (m_active && m_active_before) | |||
if (m_active && m_activeBefore) | |||
{ | |||
void* min_buffer = midi.port_min->getBuffer(); | |||
void* min_buffer = midi.portMin->getBuffer(); | |||
const CarlaEngineMidiEvent* min_event; | |||
uint32_t time, n_min_events = midi.port_min->getEventCount(min_buffer); | |||
uint32_t time, n_min_events = midi.portMin->getEventCount(min_buffer); | |||
for (i=0; i < n_min_events && midi_event_count < MAX_MIDI_EVENTS; i++) | |||
{ | |||
min_event = midi.port_min->getEvent(min_buffer, i); | |||
min_event = midi.portMin->getEvent(min_buffer, i); | |||
if (! min_event) | |||
continue; | |||
@@ -429,7 +429,7 @@ public: | |||
midiInputPort->DispatchNoteOff(note, 0, channel, time); | |||
if (channel == cin_channel) | |||
postpone_event(PluginPostEventNoteOff, note, 0.0); | |||
postponeEvent(PluginPostEventNoteOff, note, 0.0); | |||
} | |||
else if (MIDI_IS_STATUS_NOTE_ON(status)) | |||
{ | |||
@@ -439,7 +439,7 @@ public: | |||
midiInputPort->DispatchNoteOn(note, velo, channel, time); | |||
if (channel == cin_channel) | |||
postpone_event(PluginPostEventNoteOn, note, velo); | |||
postponeEvent(PluginPostEventNoteOn, note, velo); | |||
} | |||
else if (MIDI_IS_STATUS_AFTERTOUCH(status)) | |||
{ | |||
@@ -468,7 +468,7 @@ public: | |||
if (m_active) | |||
{ | |||
if (! m_active_before) | |||
if (! m_activeBefore) | |||
{ | |||
if (cin_channel >= 0 && cin_channel < 16) | |||
{ | |||
@@ -532,8 +532,8 @@ public: | |||
// Output VU | |||
for (k=0; k < nframes && i < 2; k++) | |||
{ | |||
if (abs_d(aouts_buffer[i][k]) > aouts_peak_tmp[i]) | |||
aouts_peak_tmp[i] = abs_d(aouts_buffer[i][k]); | |||
if (abs(aouts_buffer[i][k]) > aouts_peak_tmp[i]) | |||
aouts_peak_tmp[i] = abs(aouts_buffer[i][k]); | |||
} | |||
} | |||
} | |||
@@ -556,7 +556,7 @@ public: | |||
aouts_peak[(m_id*2)+0] = aouts_peak_tmp[0]; | |||
aouts_peak[(m_id*2)+1] = aouts_peak_tmp[1]; | |||
m_active_before = m_active; | |||
m_activeBefore = m_active; | |||
} | |||
// ------------------------------------------------------------------- | |||
@@ -670,7 +670,7 @@ short add_plugin_linuxsampler(const char* filename, const char* label, bool isGI | |||
unique_names[id] = plugin->name(); | |||
CarlaPlugins[id] = plugin; | |||
plugin->osc_register_new(); | |||
plugin->registerToOsc(); | |||
} | |||
else | |||
{ | |||
@@ -254,7 +254,7 @@ public: | |||
delete (lv2_external_ui_host*)features[lv2_feature_id_external_ui]->data; | |||
} | |||
ui_lib_close(); | |||
uiLibClose(); | |||
} | |||
if (handle && descriptor && descriptor->deactivate && m_activeBefore) | |||
@@ -573,7 +573,7 @@ public: | |||
switch (lv2param[paramId].type) | |||
{ | |||
case LV2_PARAMETER_TYPE_CONTROL: | |||
lv2param[paramId].control = fix_parameter_value(value, param.ranges[paramId]); | |||
lv2param[paramId].control = fixParameterValue(value, param.ranges[paramId]); | |||
break; | |||
default: | |||
break; | |||
@@ -851,10 +851,10 @@ public: | |||
x_client->deactivate(); | |||
// Remove client ports | |||
remove_client_ports(); | |||
removeClientPorts(); | |||
// Delete old data | |||
delete_buffers(); | |||
deleteBuffers(); | |||
uint32_t ains, aouts, cv_ins, cv_outs, ev_ins, ev_outs, params, j; | |||
ains = aouts = cv_ins = cv_outs = ev_ins = ev_outs = params = 0; | |||
@@ -1140,8 +1140,8 @@ public: | |||
param.data[j].index = j; | |||
param.data[j].rindex = i; | |||
param.data[j].hints = 0; | |||
param.data[j].midi_channel = 0; | |||
param.data[j].midi_cc = -1; | |||
param.data[j].midiChannel = 0; | |||
param.data[j].midiCC = -1; | |||
double min, max, def, step, step_small, step_large; | |||
@@ -1234,7 +1234,7 @@ public: | |||
if (LV2_IS_PORT_MIDI_MAP_CC(PortMidiMap->Type)) | |||
{ | |||
if (! MIDI_IS_CONTROL_BANK_SELECT(PortMidiMap->Number)) | |||
param.data[j].midi_cc = PortMidiMap->Number; | |||
param.data[j].midiCC = PortMidiMap->Number; | |||
} | |||
} | |||
else if (LV2_IS_PORT_OUTPUT(PortType)) | |||
@@ -1289,8 +1289,8 @@ public: | |||
param.ranges[j].max = max; | |||
param.ranges[j].def = def; | |||
param.ranges[j].step = step; | |||
param.ranges[j].step_small = step_small; | |||
param.ranges[j].step_large = step_large; | |||
param.ranges[j].stepSmall = step_small; | |||
param.ranges[j].stepLarge = step_large; | |||
// Set LV2 params as needed | |||
lv2param[j].type = LV2_PARAMETER_TYPE_CONTROL; | |||
@@ -1573,19 +1573,19 @@ public: | |||
{ | |||
for (k=0; k < nframes; k++) | |||
{ | |||
if (abs_d(ains_buffer[0][k]) > ains_peak_tmp[0]) | |||
ains_peak_tmp[0] = abs_d(ains_buffer[0][k]); | |||
if (abs(ains_buffer[0][k]) > ains_peak_tmp[0]) | |||
ains_peak_tmp[0] = abs(ains_buffer[0][k]); | |||
} | |||
} | |||
else if (ain.count >= 1) | |||
{ | |||
for (k=0; k < nframes; k++) | |||
{ | |||
if (abs_d(ains_buffer[0][k]) > ains_peak_tmp[0]) | |||
ains_peak_tmp[0] = abs_d(ains_buffer[0][k]); | |||
if (abs(ains_buffer[0][k]) > ains_peak_tmp[0]) | |||
ains_peak_tmp[0] = abs(ains_buffer[0][k]); | |||
if (abs_d(ains_buffer[1][k]) > ains_peak_tmp[1]) | |||
ains_peak_tmp[1] = abs_d(ains_buffer[1][k]); | |||
if (abs(ains_buffer[1][k]) > ains_peak_tmp[1]) | |||
ains_peak_tmp[1] = abs(ains_buffer[1][k]); | |||
} | |||
} | |||
} | |||
@@ -1632,14 +1632,14 @@ public: | |||
{ | |||
value = cin_event->value; | |||
setDryWet(value, false, false); | |||
postpone_event(PluginPostEventParameterChange, PARAMETER_DRYWET, value); | |||
postponeEvent(PluginPostEventParameterChange, PARAMETER_DRYWET, value); | |||
continue; | |||
} | |||
else if (MIDI_IS_CONTROL_CHANNEL_VOLUME(cin_event->controller) && (m_hints & PLUGIN_CAN_VOLUME) > 0) | |||
{ | |||
value = cin_event->value*127/100; | |||
setVolume(value, false, false); | |||
postpone_event(PluginPostEventParameterChange, PARAMETER_VOLUME, value); | |||
postponeEvent(PluginPostEventParameterChange, PARAMETER_VOLUME, value); | |||
continue; | |||
} | |||
else if (MIDI_IS_CONTROL_BALANCE(cin_event->controller) && (m_hints & PLUGIN_CAN_BALANCE) > 0) | |||
@@ -1665,8 +1665,8 @@ public: | |||
setBalanceLeft(left, false, false); | |||
setBalanceRight(right, false, false); | |||
postpone_event(PluginPostEventParameterChange, PARAMETER_BALANCE_LEFT, left); | |||
postpone_event(PluginPostEventParameterChange, PARAMETER_BALANCE_RIGHT, right); | |||
postponeEvent(PluginPostEventParameterChange, PARAMETER_BALANCE_LEFT, left); | |||
postponeEvent(PluginPostEventParameterChange, PARAMETER_BALANCE_RIGHT, right); | |||
continue; | |||
} | |||
} | |||
@@ -1674,9 +1674,9 @@ public: | |||
// Control plugin parameters | |||
for (k=0; k < param.count; k++) | |||
{ | |||
if (param.data[k].midi_channel != cin_event->channel) | |||
if (param.data[k].midiChannel != cin_event->channel) | |||
continue; | |||
if (param.data[k].midi_cc != cin_event->controller) | |||
if (param.data[k].midiCC != cin_event->controller) | |||
continue; | |||
if (param.data[k].type != PARAMETER_INPUT) | |||
continue; | |||
@@ -1696,7 +1696,7 @@ public: | |||
} | |||
setParameterValue(k, value, false, false, false); | |||
postpone_event(PluginPostEventParameterChange, k, value); | |||
postponeEvent(PluginPostEventParameterChange, k, value); | |||
} | |||
} | |||
@@ -1719,7 +1719,7 @@ public: | |||
if (midiprog.data[k].bank == mbank_id && midiprog.data[k].program == mprog_id) | |||
{ | |||
setMidiProgram(k, false, false, false, false); | |||
postpone_event(PluginPostEventMidiProgramChange, k, 0.0); | |||
postponeEvent(PluginPostEventMidiProgramChange, k, 0.0); | |||
break; | |||
} | |||
} | |||
@@ -1730,10 +1730,7 @@ public: | |||
if (cin_event->channel == cin_channel) | |||
{ | |||
if (midi.portMin) | |||
{ | |||
send_midi_all_notes_off(); | |||
midi_event_count += 128; | |||
} | |||
sendMidiAllNotesOff(); | |||
if (descriptor->deactivate) | |||
descriptor->deactivate(handle); | |||
@@ -1747,10 +1744,7 @@ public: | |||
if (cin_event->channel == cin_channel) | |||
{ | |||
if (midi.portMin) | |||
{ | |||
send_midi_all_notes_off(); | |||
midi_event_count += 128; | |||
} | |||
sendMidiAllNotesOff(); | |||
} | |||
break; | |||
} | |||
@@ -1873,9 +1867,9 @@ public: | |||
if (channel == cin_channel) | |||
{ | |||
if (MIDI_IS_STATUS_NOTE_OFF(status)) | |||
postpone_event(PluginPostEventNoteOff, min_event->data[1], 0.0); | |||
postponeEvent(PluginPostEventNoteOff, min_event->data[1], 0.0); | |||
else if (MIDI_IS_STATUS_NOTE_ON(status)) | |||
postpone_event(PluginPostEventNoteOn, min_event->data[1], min_event->data[2]); | |||
postponeEvent(PluginPostEventNoteOn, min_event->data[1], min_event->data[2]); | |||
} | |||
} | |||
@@ -1906,41 +1900,41 @@ public: | |||
{ | |||
case LV2_PORT_TIME_BAR: | |||
setParameterValue(k, timeInfo->bbt.bar, false, false, false); | |||
postpone_event(PluginPostEventParameterChange, k, timeInfo->bbt.bar); | |||
postponeEvent(PluginPostEventParameterChange, k, timeInfo->bbt.bar); | |||
break; | |||
case LV2_PORT_TIME_BAR_BEAT: | |||
setParameterValue(k, timeInfo->bbt.tick, false, false, false); | |||
postpone_event(PluginPostEventParameterChange, k, timeInfo->bbt.tick); | |||
postponeEvent(PluginPostEventParameterChange, k, timeInfo->bbt.tick); | |||
break; | |||
case LV2_PORT_TIME_BEAT: | |||
setParameterValue(k, timeInfo->bbt.beat, false, false, false); | |||
postpone_event(PluginPostEventParameterChange, k, timeInfo->bbt.beat); | |||
postponeEvent(PluginPostEventParameterChange, k, timeInfo->bbt.beat); | |||
break; | |||
case LV2_PORT_TIME_BEAT_UNIT: | |||
setParameterValue(k, timeInfo->bbt.beat_type, false, false, false); | |||
postpone_event(PluginPostEventParameterChange, k, timeInfo->bbt.beat_type); | |||
postponeEvent(PluginPostEventParameterChange, k, timeInfo->bbt.beat_type); | |||
break; | |||
case LV2_PORT_TIME_BEATS_PER_BAR: | |||
setParameterValue(k, timeInfo->bbt.beats_per_bar, false, false, false); | |||
postpone_event(PluginPostEventParameterChange, k, timeInfo->bbt.beats_per_bar); | |||
postponeEvent(PluginPostEventParameterChange, k, timeInfo->bbt.beats_per_bar); | |||
break; | |||
case LV2_PORT_TIME_BEATS_PER_MINUTE: | |||
setParameterValue(k, timeInfo->bbt.beats_per_minute, false, false, false); | |||
postpone_event(PluginPostEventParameterChange, k, timeInfo->bbt.beats_per_minute); | |||
postponeEvent(PluginPostEventParameterChange, k, timeInfo->bbt.beats_per_minute); | |||
break; | |||
case LV2_PORT_TIME_FRAME: | |||
setParameterValue(k, timeInfo->frame, false, false, false); | |||
postpone_event(PluginPostEventParameterChange, k, timeInfo->frame); | |||
postponeEvent(PluginPostEventParameterChange, k, timeInfo->frame); | |||
break; | |||
case LV2_PORT_TIME_FRAMES_PER_SECOND: | |||
break; | |||
case LV2_PORT_TIME_POSITION: | |||
setParameterValue(k, timeInfo->time, false, false, false); | |||
postpone_event(PluginPostEventParameterChange, k, timeInfo->time); | |||
postponeEvent(PluginPostEventParameterChange, k, timeInfo->time); | |||
break; | |||
case LV2_PORT_TIME_SPEED: | |||
setParameterValue(k, timeInfo->playing ? 1.0 : 0.0, false, false, false); | |||
postpone_event(PluginPostEventParameterChange, k, timeInfo->playing ? 1.0 : 0.0); | |||
postponeEvent(PluginPostEventParameterChange, k, timeInfo->playing ? 1.0 : 0.0); | |||
break; | |||
} | |||
} | |||
@@ -2041,8 +2035,8 @@ public: | |||
// Output VU | |||
for (k=0; k < nframes && i < 2; k++) | |||
{ | |||
if (abs_d(aouts_buffer[i][k]) > aouts_peak_tmp[i]) | |||
aouts_peak_tmp[i] = abs_d(aouts_buffer[i][k]); | |||
if (abs(aouts_buffer[i][k]) > aouts_peak_tmp[i]) | |||
aouts_peak_tmp[i] = abs(aouts_buffer[i][k]); | |||
} | |||
} | |||
} | |||
@@ -2076,14 +2070,14 @@ public: | |||
if (param.data[k].type == PARAMETER_OUTPUT) | |||
{ | |||
if (lv2param[k].type == LV2_PARAMETER_TYPE_CONTROL) | |||
fix_parameter_value(lv2param[k].control, param.ranges[k]); | |||
fixParameterValue(lv2param[k].control, param.ranges[k]); | |||
if (param.data[k].midi_cc > 0) | |||
if (param.data[k].midiCC > 0) | |||
{ | |||
switch (lv2param[k].type) | |||
{ | |||
case LV2_PARAMETER_TYPE_CONTROL: | |||
fix_parameter_value(lv2param[k].control, param.ranges[k]); | |||
//fixParameterValue(lv2param[k].control, param.ranges[k]); | |||
value = lv2param[k].control; | |||
break; | |||
default: | |||
@@ -2092,7 +2086,7 @@ public: | |||
} | |||
rvalue = (value - param.ranges[k].min) / (param.ranges[k].max - param.ranges[k].min); | |||
param.portCout->writeEvent(cout_buffer, CarlaEngineEventControlChange, nframesOffset, param.data[k].midi_channel, param.data[k].midi_cc, rvalue); | |||
param.portCout->writeEvent(cout_buffer, CarlaEngineEventControlChange, nframesOffset, param.data[k].midiChannel, param.data[k].midiCC, rvalue); | |||
} | |||
} | |||
} | |||
@@ -2171,11 +2165,9 @@ public: | |||
// ------------------------------------------------------------------- | |||
// Cleanup | |||
void remove_client_ports() | |||
void removeClientPorts() | |||
{ | |||
qDebug("Lv2Plugin::remove_from_jack() - start"); | |||
CarlaPlugin::remove_client_ports(); | |||
qDebug("Lv2Plugin::removeClientPorts() - start"); | |||
for (uint32_t i=0; i < evin.count; i++) | |||
{ | |||
@@ -2195,12 +2187,13 @@ public: | |||
} | |||
} | |||
qDebug("Lv2Plugin::remove_from_jack() - end"); | |||
CarlaPlugin::removeClientPorts(); | |||
qDebug("Lv2Plugin::removeClientPorts() - end"); | |||
} | |||
void delete_buffers() | |||
void deleteBuffers() | |||
{ | |||
qDebug("Lv2Plugin::delete_buffers() - start"); | |||
qDebug("Lv2Plugin::deleteBuffers() - start"); | |||
if (param.count > 0) | |||
delete[] lv2param; | |||
@@ -2257,21 +2250,11 @@ public: | |||
evout.count = 0; | |||
evout.data = nullptr; | |||
qDebug("Lv2Plugin::delete_buffers() - end"); | |||
qDebug("Lv2Plugin::deleteBuffers() - end"); | |||
} | |||
// ------------------------------------------------------------------- | |||
void run_custom_event(PluginPostEvent* event) | |||
{ | |||
//if (ext.worker) | |||
//{ | |||
// ext.worker->work(handle, carla_lv2_worker_respond, this, event->index, event->cdata); | |||
// ext.worker->end_run(handle); | |||
//} | |||
Q_UNUSED(event); | |||
} | |||
void handle_event_transfer(const char* type, const char* key, const char* string_data) | |||
{ | |||
qDebug("Lv2Plugin::handle_event_transfer() - %s | %s | %s", type, key, string_data); | |||
@@ -2527,16 +2510,16 @@ public: | |||
// --------------------------------------------------------------- | |||
// open DLL | |||
if (! lib_open(rdf_descriptor->Binary)) | |||
if (! libOpen(rdf_descriptor->Binary)) | |||
{ | |||
set_last_error(lib_error(rdf_descriptor->Binary)); | |||
set_last_error(libError(rdf_descriptor->Binary)); | |||
return false; | |||
} | |||
// --------------------------------------------------------------- | |||
// get DLL main entry | |||
LV2_Descriptor_Function descfn = (LV2_Descriptor_Function)lib_symbol("lv2_descriptor"); | |||
LV2_Descriptor_Function descfn = (LV2_Descriptor_Function)libSymbol("lv2_descriptor"); | |||
if (! descfn) | |||
{ | |||
@@ -2830,9 +2813,9 @@ public: | |||
// ----------------------------------------------------------- | |||
// open DLL | |||
if (! ui_lib_open(ui.rdf_descriptor->Binary)) | |||
if (! uiLibOpen(ui.rdf_descriptor->Binary)) | |||
{ | |||
qCritical("Could not load UI library, error was:\n%s", lib_error(ui.rdf_descriptor->Binary)); | |||
qCritical("Could not load UI library, error was:\n%s", libError(ui.rdf_descriptor->Binary)); | |||
ui.rdf_descriptor = nullptr; | |||
return true; | |||
} | |||
@@ -2840,12 +2823,12 @@ public: | |||
// ----------------------------------------------------------- | |||
// get DLL main entry | |||
LV2UI_DescriptorFunction ui_descfn = (LV2UI_DescriptorFunction)ui_lib_symbol("lv2ui_descriptor"); | |||
LV2UI_DescriptorFunction ui_descfn = (LV2UI_DescriptorFunction)uiLibSymbol("lv2ui_descriptor"); | |||
if (! ui_descfn) | |||
{ | |||
qCritical("Could not find the LV2UI Descriptor in the UI library"); | |||
ui_lib_close(); | |||
uiLibClose(); | |||
ui.lib = nullptr; | |||
ui.rdf_descriptor = nullptr; | |||
return true; | |||
@@ -2864,7 +2847,7 @@ public: | |||
if (! ui.descriptor) | |||
{ | |||
qCritical("Could not find the requested GUI in the plugin UI library"); | |||
ui_lib_close(); | |||
uiLibClose(); | |||
ui.lib = nullptr; | |||
ui.rdf_descriptor = nullptr; | |||
return true; | |||
@@ -2984,23 +2967,23 @@ public: | |||
return true; | |||
} | |||
bool ui_lib_open(const char* filename) | |||
bool uiLibOpen(const char* filename) | |||
{ | |||
ui.lib = ::lib_open(filename); | |||
ui.lib = lib_open(filename); | |||
return bool(ui.lib); | |||
} | |||
bool ui_lib_close() | |||
bool uiLibClose() | |||
{ | |||
if (ui.lib) | |||
return ::lib_close(ui.lib); | |||
return lib_close(ui.lib); | |||
return false; | |||
} | |||
void* ui_lib_symbol(const char* symbol) | |||
void* uiLibSymbol(const char* symbol) | |||
{ | |||
if (ui.lib) | |||
return ::lib_symbol(ui.lib, symbol); | |||
return lib_symbol(ui.lib, symbol); | |||
return nullptr; | |||
} | |||
@@ -3463,13 +3446,13 @@ public: | |||
if (MIDI_IS_STATUS_NOTE_OFF(status)) | |||
{ | |||
uint8_t note = data[2]; | |||
plugin->send_midi_note(note, 0, false, true, true); | |||
plugin->sendMidiSingleNote(note, 0, false, true, true); | |||
} | |||
else if (MIDI_IS_STATUS_NOTE_ON(status)) | |||
{ | |||
uint8_t note = data[2]; | |||
uint8_t velo = data[3]; | |||
plugin->send_midi_note(note, velo, false, true, true); | |||
plugin->sendMidiSingleNote(note, velo, false, true, true); | |||
} | |||
} | |||
else if (format == CARLA_URI_MAP_ID_ATOM_TRANSFER_ATOM) | |||
@@ -3540,7 +3523,7 @@ short add_plugin_lv2(const char* filename, const char* label) | |||
unique_names[id] = plugin->name(); | |||
CarlaPlugins[id] = plugin; | |||
plugin->osc_register_new(); | |||
plugin->registerToOsc(); | |||
} | |||
else | |||
{ | |||
@@ -189,8 +189,7 @@ public: | |||
void setParameterValue(uint32_t paramId, double value, bool sendGui, bool sendOsc, bool sendCallback) | |||
{ | |||
assert(paramId < param.count); | |||
fix_parameter_value(value, param.ranges[paramId]); | |||
effect->setParameter(effect, paramId, value); | |||
effect->setParameter(effect, paramId, fixParameterValue(value, param.ranges[paramId])); | |||
CarlaPlugin::setParameterValue(paramId, value, sendGui, sendOsc, sendCallback); | |||
} | |||
@@ -310,10 +309,10 @@ public: | |||
x_client->deactivate(); | |||
// Remove client ports | |||
remove_client_ports(); | |||
removeClientPorts(); | |||
// Delete old data | |||
delete_buffers(); | |||
deleteBuffers(); | |||
uint32_t ains, aouts, mins, mouts, params, j; | |||
ains = aouts = mins = mouts = params = 0; | |||
@@ -382,8 +381,8 @@ public: | |||
param.data[j].index = j; | |||
param.data[j].rindex = j; | |||
param.data[j].hints = 0; | |||
param.data[j].midi_channel = 0; | |||
param.data[j].midi_cc = -1; | |||
param.data[j].midiChannel = 0; | |||
param.data[j].midiCC = -1; | |||
double min, max, def, step, step_small, step_large; | |||
@@ -466,8 +465,8 @@ public: | |||
param.ranges[j].max = max; | |||
param.ranges[j].def = def; | |||
param.ranges[j].step = step; | |||
param.ranges[j].step_small = step_small; | |||
param.ranges[j].step_large = step_large; | |||
param.ranges[j].stepSmall = step_small; | |||
param.ranges[j].stepLarge = step_large; | |||
param.data[j].hints |= PARAMETER_IS_ENABLED; | |||
#ifndef BUILD_BRIDGE | |||
@@ -676,19 +675,19 @@ public: | |||
{ | |||
for (k=0; k < nframes; k++) | |||
{ | |||
if (abs_d(ains_buffer[0][k]) > ains_peak_tmp[0]) | |||
ains_peak_tmp[0] = abs_d(ains_buffer[0][k]); | |||
if (abs(ains_buffer[0][k]) > ains_peak_tmp[0]) | |||
ains_peak_tmp[0] = abs(ains_buffer[0][k]); | |||
} | |||
} | |||
else if (ain.count >= 1) | |||
{ | |||
for (k=0; k < nframes; k++) | |||
{ | |||
if (abs_d(ains_buffer[0][k]) > ains_peak_tmp[0]) | |||
ains_peak_tmp[0] = abs_d(ains_buffer[0][k]); | |||
if (abs(ains_buffer[0][k]) > ains_peak_tmp[0]) | |||
ains_peak_tmp[0] = abs(ains_buffer[0][k]); | |||
if (abs_d(ains_buffer[1][k]) > ains_peak_tmp[1]) | |||
ains_peak_tmp[1] = abs_d(ains_buffer[1][k]); | |||
if (abs(ains_buffer[1][k]) > ains_peak_tmp[1]) | |||
ains_peak_tmp[1] = abs(ains_buffer[1][k]); | |||
} | |||
} | |||
} | |||
@@ -731,14 +730,14 @@ public: | |||
{ | |||
value = cin_event->value; | |||
setDryWet(value, false, false); | |||
postpone_event(PluginPostEventParameterChange, PARAMETER_DRYWET, value); | |||
postponeEvent(PluginPostEventParameterChange, PARAMETER_DRYWET, value); | |||
continue; | |||
} | |||
else if (MIDI_IS_CONTROL_CHANNEL_VOLUME(cin_event->controller) && (m_hints & PLUGIN_CAN_VOLUME) > 0) | |||
{ | |||
value = cin_event->value*127/100; | |||
setVolume(value, false, false); | |||
postpone_event(PluginPostEventParameterChange, PARAMETER_VOLUME, value); | |||
postponeEvent(PluginPostEventParameterChange, PARAMETER_VOLUME, value); | |||
continue; | |||
} | |||
else if (MIDI_IS_CONTROL_BALANCE(cin_event->controller) && (m_hints & PLUGIN_CAN_BALANCE) > 0) | |||
@@ -764,8 +763,8 @@ public: | |||
setBalanceLeft(left, false, false); | |||
setBalanceRight(right, false, false); | |||
postpone_event(PluginPostEventParameterChange, PARAMETER_BALANCE_LEFT, left); | |||
postpone_event(PluginPostEventParameterChange, PARAMETER_BALANCE_RIGHT, right); | |||
postponeEvent(PluginPostEventParameterChange, PARAMETER_BALANCE_LEFT, left); | |||
postponeEvent(PluginPostEventParameterChange, PARAMETER_BALANCE_RIGHT, right); | |||
continue; | |||
} | |||
} | |||
@@ -773,9 +772,9 @@ public: | |||
// Control plugin parameters | |||
for (k=0; k < param.count; k++) | |||
{ | |||
if (param.data[k].midi_channel != cin_event->channel) | |||
if (param.data[k].midiChannel != cin_event->channel) | |||
continue; | |||
if (param.data[k].midi_cc != cin_event->controller) | |||
if (param.data[k].midiCC != cin_event->controller) | |||
continue; | |||
if (param.data[k].type != PARAMETER_INPUT) | |||
continue; | |||
@@ -795,7 +794,7 @@ public: | |||
} | |||
setParameterValue(k, value, false, false, false); | |||
postpone_event(PluginPostEventParameterChange, k, value); | |||
postponeEvent(PluginPostEventParameterChange, k, value); | |||
} | |||
} | |||
@@ -813,7 +812,7 @@ public: | |||
if (prog_id < prog.count) | |||
{ | |||
setProgram(prog_id, false, false, false, false); | |||
postpone_event(PluginPostEventMidiProgramChange, prog_id, 0.0); | |||
postponeEvent(PluginPostEventMidiProgramChange, prog_id, 0.0); | |||
} | |||
} | |||
break; | |||
@@ -822,10 +821,7 @@ public: | |||
if (cin_event->channel == cin_channel) | |||
{ | |||
if (midi.portMin) | |||
{ | |||
send_midi_all_notes_off(); | |||
midi_event_count += 128; | |||
} | |||
sendMidiAllNotesOff(); | |||
effect->dispatcher(effect, effStopProcess, 0, 0, nullptr, 0.0f); | |||
effect->dispatcher(effect, effMainsChanged, 0, 0, nullptr, 0.0f); | |||
@@ -839,10 +835,7 @@ public: | |||
if (cin_event->channel == cin_channel) | |||
{ | |||
if (midi.portMin) | |||
{ | |||
send_midi_all_notes_off(); | |||
midi_event_count += 128; | |||
} | |||
sendMidiAllNotesOff(); | |||
} | |||
break; | |||
} | |||
@@ -928,7 +921,7 @@ public: | |||
midi_event->midiData[1] = note; | |||
if (channel == cin_channel) | |||
postpone_event(PluginPostEventNoteOff, note, 0.0); | |||
postponeEvent(PluginPostEventNoteOff, note, 0.0); | |||
} | |||
else if (MIDI_IS_STATUS_NOTE_ON(status)) | |||
{ | |||
@@ -940,7 +933,7 @@ public: | |||
midi_event->midiData[2] = velo; | |||
if (channel == cin_channel) | |||
postpone_event(PluginPostEventNoteOn, note, velo); | |||
postponeEvent(PluginPostEventNoteOn, note, velo); | |||
} | |||
else if (MIDI_IS_STATUS_POLYPHONIC_AFTERTOUCH(status)) | |||
{ | |||
@@ -1087,8 +1080,8 @@ public: | |||
// Output VU | |||
for (k=0; k < nframes && i < 2; k++) | |||
{ | |||
if (abs_d(aouts_buffer[i][k]) > aouts_peak_tmp[i]) | |||
aouts_peak_tmp[i] = abs_d(aouts_buffer[i][k]); | |||
if (abs(aouts_buffer[i][k]) > aouts_peak_tmp[i]) | |||
aouts_peak_tmp[i] = abs(aouts_buffer[i][k]); | |||
} | |||
} | |||
} | |||
@@ -1174,24 +1167,26 @@ public: | |||
// --------------------------------------------------------------- | |||
// open DLL | |||
if (! lib_open(filename)) | |||
if (! libOpen(filename)) | |||
{ | |||
set_last_error(lib_error(filename)); | |||
set_last_error(libError(filename)); | |||
return false; | |||
} | |||
// --------------------------------------------------------------- | |||
// get DLL main entry | |||
VST_Function vstfn = (VST_Function)lib_symbol("VSTPluginMain"); | |||
if (! vstfn) | |||
vstfn = (VST_Function)lib_symbol("main"); | |||
VST_Function vstfn = (VST_Function)libSymbol("VSTPluginMain"); | |||
if (! vstfn) | |||
{ | |||
set_last_error("Could not find the VST main entry in the plugin library"); | |||
return false; | |||
vstfn = (VST_Function)libSymbol("main"); | |||
if (! vstfn) | |||
{ | |||
set_last_error("Could not find the VST main entry in the plugin library"); | |||
return false; | |||
} | |||
} | |||
// --------------------------------------------------------------- | |||
@@ -1287,7 +1282,7 @@ public: | |||
if (CarlaEngine::isOnAudioThread()) | |||
{ | |||
self->setParameterValue(index, opt, false, false, false); | |||
self->postpone_event(PluginPostEventParameterChange, index, opt); | |||
self->postponeEvent(PluginPostEventParameterChange, index, opt); | |||
} | |||
else | |||
self->setParameterValue(index, opt, false, true, true); | |||
@@ -1715,7 +1710,7 @@ short add_plugin_vst(const char* filename, const char* label) | |||
unique_names[id] = plugin->name(); | |||
CarlaPlugins[id] = plugin; | |||
plugin->osc_register_new(); | |||
plugin->registerToOsc(); | |||
} | |||
else | |||
{ | |||
@@ -1619,7 +1619,7 @@ class PluginEdit(QDialog, ui_carla_edit.Ui_PluginEdit): | |||
'current': CarlaHost.get_current_parameter_value(self.plugin_id, i) | |||
} | |||
for j in range(param_info['scalepoint_count']): | |||
for j in range(param_info['scalePointCount']): | |||
scalepoint = CarlaHost.get_scalepoint_info(self.plugin_id, i, j) | |||
parameter['scalepoints'].append({ | |||
'value': scalepoint['value'], | |||
@@ -729,7 +729,7 @@ class ParameterInfo(Structure): | |||
("name", c_char_p), | |||
("symbol", c_char_p), | |||
("unit", c_char_p), | |||
("scalepoint_count", c_uint32) | |||
("scalePointCount", c_uint32) | |||
] | |||
class ScalePointInfo(Structure): | |||