@@ -43,14 +43,8 @@ using juce::String; | |||
using juce::XmlDocument; | |||
using juce::XmlElement; | |||
// ----------------------------------------------------------------------- | |||
CARLA_BACKEND_START_NAMESPACE | |||
#if 0 | |||
} // Fix editor indentation | |||
#endif | |||
// ----------------------------------------------------------------------- | |||
// Carla Engine | |||
@@ -1478,6 +1472,11 @@ void CarlaEngine::bufferSizeChanged(const uint32_t newBufferSize) | |||
{ | |||
carla_debug("CarlaEngine::bufferSizeChanged(%i)", newBufferSize); | |||
#ifndef BUILD_BRIDGE | |||
if (pData->graph.graph != nullptr) | |||
pData->graph.setBufferSize(newBufferSize); | |||
#endif | |||
for (uint i=0; i < pData->curPluginCount; ++i) | |||
{ | |||
CarlaPlugin* const plugin(pData->plugins[i].plugin); | |||
@@ -1493,6 +1492,11 @@ void CarlaEngine::sampleRateChanged(const double newSampleRate) | |||
{ | |||
carla_debug("CarlaEngine::sampleRateChanged(%g)", newSampleRate); | |||
#ifndef BUILD_BRIDGE | |||
if (pData->graph.graph != nullptr) | |||
pData->graph.setSampleRate(newSampleRate); | |||
#endif | |||
for (uint i=0; i < pData->curPluginCount; ++i) | |||
{ | |||
CarlaPlugin* const plugin(pData->plugins[i].plugin); | |||
@@ -1541,684 +1545,6 @@ void CarlaEngine::setPluginPeaks(const uint pluginId, float const inPeaks[2], fl | |||
pluginData.outsPeak[1] = outPeaks[1]; | |||
} | |||
// ----------------------------------------------------------------------- | |||
// Bridge/Controller OSC stuff | |||
#ifdef BUILD_BRIDGE | |||
void CarlaEngine::oscSend_bridge_plugin_info1(const PluginCategory category, const uint hints, const int64_t uniqueId) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_plugin_info1(%i:%s, %X, " P_INT64 ")", category, PluginCategory2Str(category), hints, uniqueId); | |||
char targetPath[std::strlen(pData->oscData->path)+21]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_plugin_info1"); | |||
try_lo_send(pData->oscData->target, targetPath, "iih", static_cast<int32_t>(category), static_cast<int32_t>(hints), uniqueId); | |||
} | |||
void CarlaEngine::oscSend_bridge_plugin_info2(const char* const realName, const char* const label, const char* const maker, const char* const copyright) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(realName != nullptr && realName[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(label != nullptr && label[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(maker != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(copyright != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_plugin_info2(\"%s\", \"%s\", \"%s\", \"%s\")", realName, label, maker, copyright); | |||
char targetPath[std::strlen(pData->oscData->path)+21]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_plugin_info2"); | |||
try_lo_send(pData->oscData->target, targetPath, "ssss", realName, label, maker, copyright); | |||
} | |||
void CarlaEngine::oscSend_bridge_audio_count(const uint32_t ins, const uint32_t outs) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_audio_count(%i, %i)", ins, outs); | |||
char targetPath[std::strlen(pData->oscData->path)+20]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_audio_count"); | |||
try_lo_send(pData->oscData->target, targetPath, "ii", static_cast<int32_t>(ins), static_cast<int32_t>(outs)); | |||
} | |||
void CarlaEngine::oscSend_bridge_midi_count(const uint32_t ins, const uint32_t outs) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_midi_count(%i, %i)", ins, outs); | |||
char targetPath[std::strlen(pData->oscData->path)+19]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_midi_count"); | |||
try_lo_send(pData->oscData->target, targetPath, "ii", static_cast<int32_t>(ins), static_cast<int32_t>(outs)); | |||
} | |||
void CarlaEngine::oscSend_bridge_parameter_count(const uint32_t ins, const uint32_t outs) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_parameter_count(%i, %i)", ins, outs); | |||
char targetPath[std::strlen(pData->oscData->path)+24]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_parameter_count"); | |||
try_lo_send(pData->oscData->target, targetPath, "ii", static_cast<int32_t>(ins), static_cast<int32_t>(outs)); | |||
} | |||
void CarlaEngine::oscSend_bridge_program_count(const uint32_t count) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_program_count(%i)", count); | |||
char targetPath[std::strlen(pData->oscData->path)+23]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_program_count"); | |||
try_lo_send(pData->oscData->target, targetPath, "i", static_cast<int32_t>(count)); | |||
} | |||
void CarlaEngine::oscSend_bridge_midi_program_count(const uint32_t count) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_midi_program_count(%i)", count); | |||
char targetPath[std::strlen(pData->oscData->path)+27]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_midi_program_count"); | |||
try_lo_send(pData->oscData->target, targetPath, "i", static_cast<int32_t>(count)); | |||
} | |||
void CarlaEngine::oscSend_bridge_parameter_data(const uint32_t index, const int32_t rindex, const ParameterType type, const uint hints, const char* const name, const char* const unit) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(name != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(unit != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_parameter_data(%i, %i, %i:%s, %X, \"%s\", \"%s\")", index, rindex, type, ParameterType2Str(type), hints, name, unit); | |||
char targetPath[std::strlen(pData->oscData->path)+24]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_parameter_data"); | |||
try_lo_send(pData->oscData->target, targetPath, "iiiiss", static_cast<int32_t>(index), static_cast<int32_t>(rindex), static_cast<int32_t>(type), static_cast<int32_t>(hints), name, unit); | |||
} | |||
void CarlaEngine::oscSend_bridge_parameter_ranges1(const uint32_t index, const float def, const float min, const float max) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_parameter_ranges(%i, %f, %f, %f)", index, def, min, max); | |||
char targetPath[std::strlen(pData->oscData->path)+26]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_parameter_ranges1"); | |||
try_lo_send(pData->oscData->target, targetPath, "ifff", static_cast<int32_t>(index), def, min, max); | |||
} | |||
void CarlaEngine::oscSend_bridge_parameter_ranges2(const uint32_t index, const float step, const float stepSmall, const float stepLarge) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_parameter_ranges(%i, %f, %f, %f)", index, step, stepSmall, stepLarge); | |||
char targetPath[std::strlen(pData->oscData->path)+26]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_parameter_ranges2"); | |||
try_lo_send(pData->oscData->target, targetPath, "ifff", static_cast<int32_t>(index), step, stepSmall, stepLarge); | |||
} | |||
void CarlaEngine::oscSend_bridge_parameter_midi_cc(const uint32_t index, const int16_t cc) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_parameter_midi_cc(%i, %i)", index, cc); | |||
char targetPath[std::strlen(pData->oscData->path)+26]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_parameter_midi_cc"); | |||
try_lo_send(pData->oscData->target, targetPath, "ii", static_cast<int32_t>(index), static_cast<int32_t>(cc)); | |||
} | |||
void CarlaEngine::oscSend_bridge_parameter_midi_channel(const uint32_t index, const uint8_t channel) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_parameter_midi_channel(%i, %i)", index, channel); | |||
char targetPath[std::strlen(pData->oscData->path)+31]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_parameter_midi_channel"); | |||
try_lo_send(pData->oscData->target, targetPath, "ii", static_cast<int32_t>(index), static_cast<int32_t>(channel)); | |||
} | |||
void CarlaEngine::oscSend_bridge_parameter_value(const uint32_t index, const float value) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_parameter_value(%i, %f)", index, value); | |||
char targetPath[std::strlen(pData->oscData->path)+24]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_parameter_value"); | |||
try_lo_send(pData->oscData->target, targetPath, "if", static_cast<int32_t>(index), value); | |||
} | |||
void CarlaEngine::oscSend_bridge_default_value(const uint32_t index, const float value) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_default_value(%i, %f)", index, value); | |||
char targetPath[std::strlen(pData->oscData->path)+22]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_default_value"); | |||
try_lo_send(pData->oscData->target, targetPath, "if", static_cast<int32_t>(index), value); | |||
} | |||
void CarlaEngine::oscSend_bridge_current_program(const int32_t index) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_current_program(%i)", index); | |||
char targetPath[std::strlen(pData->oscData->path)+24]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_current_program"); | |||
try_lo_send(pData->oscData->target, targetPath, "i", index); | |||
} | |||
void CarlaEngine::oscSend_bridge_current_midi_program(const int32_t index) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_current_midi_program(%i)", index); | |||
char targetPath[std::strlen(pData->oscData->path)+30]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_current_midi_program"); | |||
try_lo_send(pData->oscData->target, targetPath, "i", index); | |||
} | |||
void CarlaEngine::oscSend_bridge_program_name(const uint32_t index, const char* const name) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(name != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_program_name(%i, \"%s\")", index, name); | |||
char targetPath[std::strlen(pData->oscData->path)+21]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_program_name"); | |||
try_lo_send(pData->oscData->target, targetPath, "is", static_cast<int32_t>(index), name); | |||
} | |||
void CarlaEngine::oscSend_bridge_midi_program_data(const uint32_t index, const uint32_t bank, const uint32_t program, const char* const name) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(name != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_midi_program_data(%i, %i, %i, \"%s\")", index, bank, program, name); | |||
char targetPath[std::strlen(pData->oscData->path)+26]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_midi_program_data"); | |||
try_lo_send(pData->oscData->target, targetPath, "iiis", static_cast<int32_t>(index), static_cast<int32_t>(bank), static_cast<int32_t>(program), name); | |||
} | |||
void CarlaEngine::oscSend_bridge_configure(const char* const key, const char* const value) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(key != nullptr && key[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(value != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_configure(\"%s\", \"%s\")", key, value); | |||
char targetPath[std::strlen(pData->oscData->path)+18]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_configure"); | |||
try_lo_send(pData->oscData->target, targetPath, "ss", key, value); | |||
} | |||
void CarlaEngine::oscSend_bridge_set_custom_data(const char* const type, const char* const key, const char* const value) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(type != nullptr && type[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(key != nullptr && key[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(value != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_set_custom_data(\"%s\", \"%s\", \"%s\")", type, key, value); | |||
char targetPath[std::strlen(pData->oscData->path)+24]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_set_custom_data"); | |||
try_lo_send(pData->oscData->target, targetPath, "sss", type, key, value); | |||
} | |||
void CarlaEngine::oscSend_bridge_set_chunk_data(const char* const chunkFile) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(chunkFile != nullptr && chunkFile[0] != '\0',); | |||
carla_debug("CarlaEngine::oscSend_bridge_set_chunk_data(\"%s\")", chunkFile); | |||
char targetPath[std::strlen(pData->oscData->path)+23]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_set_chunk_data"); | |||
try_lo_send(pData->oscData->target, targetPath, "s", chunkFile); | |||
} | |||
void CarlaEngine::oscSend_bridge_pong() const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
//carla_debug("CarlaEngine::oscSend_pong()"); | |||
char targetPath[std::strlen(pData->oscData->path)+13]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_pong"); | |||
try_lo_send(pData->oscData->target, targetPath, ""); | |||
} | |||
#else | |||
void CarlaEngine::oscSend_control_add_plugin_start(const uint pluginId, const char* const pluginName) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginName != nullptr && pluginName[0] != '\0',); | |||
carla_debug("CarlaEngine::oscSend_control_add_plugin_start(%i, \"%s\")", pluginId, pluginName); | |||
char targetPath[std::strlen(pData->oscData->path)+18]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/add_plugin_start"); | |||
try_lo_send(pData->oscData->target, targetPath, "is", static_cast<int32_t>(pluginId), pluginName); | |||
} | |||
void CarlaEngine::oscSend_control_add_plugin_end(const uint pluginId) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
carla_debug("CarlaEngine::oscSend_control_add_plugin_end(%i)", pluginId); | |||
char targetPath[std::strlen(pData->oscData->path)+16]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/add_plugin_end"); | |||
try_lo_send(pData->oscData->target, targetPath, "i", static_cast<int32_t>(pluginId)); | |||
} | |||
void CarlaEngine::oscSend_control_remove_plugin(const uint pluginId) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
carla_debug("CarlaEngine::oscSend_control_remove_plugin(%i)", pluginId); | |||
char targetPath[std::strlen(pData->oscData->path)+15]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/remove_plugin"); | |||
try_lo_send(pData->oscData->target, targetPath, "i", static_cast<int32_t>(pluginId)); | |||
} | |||
void CarlaEngine::oscSend_control_set_plugin_info1(const uint pluginId, const PluginType type, const PluginCategory category, const uint hints, const int64_t uniqueId) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
CARLA_SAFE_ASSERT_RETURN(type != PLUGIN_NONE,); | |||
carla_debug("CarlaEngine::oscSend_control_set_plugin_data(%i, %i:%s, %i:%s, %X, " P_INT64 ")", pluginId, type, PluginType2Str(type), category, PluginCategory2Str(category), hints, uniqueId); | |||
char targetPath[std::strlen(pData->oscData->path)+18]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/set_plugin_info1"); | |||
try_lo_send(pData->oscData->target, targetPath, "iiiih", static_cast<int32_t>(pluginId), static_cast<int32_t>(type), static_cast<int32_t>(category), static_cast<int32_t>(hints), static_cast<int64_t>(uniqueId)); | |||
} | |||
void CarlaEngine::oscSend_control_set_plugin_info2(const uint pluginId, const char* const realName, const char* const label, const char* const maker, const char* const copyright) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
CARLA_SAFE_ASSERT_RETURN(realName != nullptr && realName[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(label != nullptr && label[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(maker != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(copyright != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_control_set_plugin_data(%i, \"%s\", \"%s\", \"%s\", \"%s\")", pluginId, realName, label, maker, copyright); | |||
char targetPath[std::strlen(pData->oscData->path)+18]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/set_plugin_info2"); | |||
try_lo_send(pData->oscData->target, targetPath, "issss", static_cast<int32_t>(pluginId), realName, label, maker, copyright); | |||
} | |||
void CarlaEngine::oscSend_control_set_audio_count(const uint pluginId, const uint32_t ins, const uint32_t outs) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
carla_debug("CarlaEngine::oscSend_control_set_audio_count(%i, %i, %i)", pluginId, ins, outs); | |||
char targetPath[std::strlen(pData->oscData->path)+18]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/set_audio_count"); | |||
try_lo_send(pData->oscData->target, targetPath, "iii", static_cast<int32_t>(pluginId), static_cast<int32_t>(ins), static_cast<int32_t>(outs)); | |||
} | |||
void CarlaEngine::oscSend_control_set_midi_count(const uint pluginId, const uint32_t ins, const uint32_t outs) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
carla_debug("CarlaEngine::oscSend_control_set_midi_count(%i, %i, %i)", pluginId, ins, outs); | |||
char targetPath[std::strlen(pData->oscData->path)+18]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/set_midi_count"); | |||
try_lo_send(pData->oscData->target, targetPath, "iii", static_cast<int32_t>(pluginId), static_cast<int32_t>(ins), static_cast<int32_t>(outs)); | |||
} | |||
void CarlaEngine::oscSend_control_set_parameter_count(const uint pluginId, const uint32_t ins, const uint32_t outs) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
carla_debug("CarlaEngine::oscSend_control_set_parameter_count(%i, %i, %i)", pluginId, ins, outs); | |||
char targetPath[std::strlen(pData->oscData->path)+18]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/set_parameter_count"); | |||
try_lo_send(pData->oscData->target, targetPath, "iii", static_cast<int32_t>(pluginId), static_cast<int32_t>(ins), static_cast<int32_t>(outs)); | |||
} | |||
void CarlaEngine::oscSend_control_set_program_count(const uint pluginId, const uint32_t count) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
carla_debug("CarlaEngine::oscSend_control_set_program_count(%i, %i)", pluginId, count); | |||
char targetPath[std::strlen(pData->oscData->path)+19]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/set_program_count"); | |||
try_lo_send(pData->oscData->target, targetPath, "ii", static_cast<int32_t>(pluginId), static_cast<int32_t>(count)); | |||
} | |||
void CarlaEngine::oscSend_control_set_midi_program_count(const uint pluginId, const uint32_t count) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
carla_debug("CarlaEngine::oscSend_control_set_midi_program_count(%i, %i)", pluginId, count); | |||
char targetPath[std::strlen(pData->oscData->path)+24]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/set_midi_program_count"); | |||
try_lo_send(pData->oscData->target, targetPath, "ii", static_cast<int32_t>(pluginId), static_cast<int32_t>(count)); | |||
} | |||
void CarlaEngine::oscSend_control_set_parameter_data(const uint pluginId, const uint32_t index, const ParameterType type, const uint hints, const char* const name, const char* const unit) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
CARLA_SAFE_ASSERT_RETURN(name != nullptr && name[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(unit != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_control_set_parameter_data(%i, %i, %i:%s, %X, \"%s\", \"%s\")", pluginId, index, type, ParameterType2Str(type), hints, name, unit); | |||
char targetPath[std::strlen(pData->oscData->path)+20]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/set_parameter_data"); | |||
try_lo_send(pData->oscData->target, targetPath, "iiiiss", static_cast<int32_t>(pluginId), static_cast<int32_t>(index), static_cast<int32_t>(type), static_cast<int32_t>(hints), name, unit); | |||
} | |||
void CarlaEngine::oscSend_control_set_parameter_ranges1(const uint pluginId, const uint32_t index, const float def, const float min, const float max) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
CARLA_SAFE_ASSERT_RETURN(def <= min && def >= max,); | |||
CARLA_SAFE_ASSERT_RETURN(min < max,); | |||
carla_debug("CarlaEngine::oscSend_control_set_parameter_ranges1(%i, %i, %f, %f, %f)", pluginId, index, def, min, max, def); | |||
char targetPath[std::strlen(pData->oscData->path)+23]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/set_parameter_ranges1"); | |||
try_lo_send(pData->oscData->target, targetPath, "iifff", static_cast<int32_t>(pluginId), static_cast<int32_t>(index), def, min, max); | |||
} | |||
void CarlaEngine::oscSend_control_set_parameter_ranges2(const uint pluginId, const uint32_t index, const float step, const float stepSmall, const float stepLarge) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
CARLA_SAFE_ASSERT_RETURN(step <= stepSmall && step >= stepLarge,); | |||
CARLA_SAFE_ASSERT_RETURN(stepSmall <= stepLarge,); | |||
carla_debug("CarlaEngine::oscSend_control_set_parameter_ranges2(%i, %i, %f, %f, %f)", pluginId, index, step, stepSmall, stepLarge); | |||
char targetPath[std::strlen(pData->oscData->path)+23]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/set_parameter_ranges"); | |||
try_lo_send(pData->oscData->target, targetPath, "iifff", static_cast<int32_t>(pluginId), static_cast<int32_t>(index), step, stepSmall, stepLarge); | |||
} | |||
void CarlaEngine::oscSend_control_set_parameter_midi_cc(const uint pluginId, const uint32_t index, const int16_t cc) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
CARLA_SAFE_ASSERT_RETURN(cc <= 0x5F,); | |||
carla_debug("CarlaEngine::oscSend_control_set_parameter_midi_cc(%i, %i, %i)", pluginId, index, cc); | |||
char targetPath[std::strlen(pData->oscData->path)+23]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/set_parameter_midi_cc"); | |||
try_lo_send(pData->oscData->target, targetPath, "iii", static_cast<int32_t>(pluginId), static_cast<int32_t>(index), static_cast<int32_t>(cc)); | |||
} | |||
void CarlaEngine::oscSend_control_set_parameter_midi_channel(const uint pluginId, const uint32_t index, const uint8_t channel) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
CARLA_SAFE_ASSERT_RETURN(channel < MAX_MIDI_CHANNELS,); | |||
carla_debug("CarlaEngine::oscSend_control_set_parameter_midi_channel(%i, %i, %i)", pluginId, index, channel); | |||
char targetPath[std::strlen(pData->oscData->path)+28]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/set_parameter_midi_channel"); | |||
try_lo_send(pData->oscData->target, targetPath, "iii", static_cast<int32_t>(pluginId), static_cast<int32_t>(index), static_cast<int32_t>(channel)); | |||
} | |||
void CarlaEngine::oscSend_control_set_parameter_value(const uint pluginId, const int32_t index, const float value) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
CARLA_SAFE_ASSERT_RETURN(index != PARAMETER_NULL,); | |||
carla_debug("CarlaEngine::oscSend_control_set_parameter_value(%i, %i:%s, %f)", pluginId, index, (index < 0) ? InternalParameterIndex2Str(static_cast<InternalParameterIndex>(index)) : "(none)", value); | |||
char targetPath[std::strlen(pData->oscData->path)+21]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/set_parameter_value"); | |||
try_lo_send(pData->oscData->target, targetPath, "iif", static_cast<int32_t>(pluginId), index, value); | |||
} | |||
void CarlaEngine::oscSend_control_set_default_value(const uint pluginId, const uint32_t index, const float value) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
carla_debug("CarlaEngine::oscSend_control_set_default_value(%i, %i, %f)", pluginId, index, value); | |||
char targetPath[std::strlen(pData->oscData->path)+19]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/set_default_value"); | |||
try_lo_send(pData->oscData->target, targetPath, "iif", static_cast<int32_t>(pluginId), static_cast<int32_t>(index), value); | |||
} | |||
void CarlaEngine::oscSend_control_set_current_program(const uint pluginId, const int32_t index) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
carla_debug("CarlaEngine::oscSend_control_set_current_program(%i, %i)", pluginId, index); | |||
char targetPath[std::strlen(pData->oscData->path)+21]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/set_current_program"); | |||
try_lo_send(pData->oscData->target, targetPath, "ii", static_cast<int32_t>(pluginId), index); | |||
} | |||
void CarlaEngine::oscSend_control_set_current_midi_program(const uint pluginId, const int32_t index) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
carla_debug("CarlaEngine::oscSend_control_set_current_midi_program(%i, %i)", pluginId, index); | |||
char targetPath[std::strlen(pData->oscData->path)+26]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/set_current_midi_program"); | |||
try_lo_send(pData->oscData->target, targetPath, "ii", static_cast<int32_t>(pluginId), index); | |||
} | |||
void CarlaEngine::oscSend_control_set_program_name(const uint pluginId, const uint32_t index, const char* const name) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
CARLA_SAFE_ASSERT_RETURN(name != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_control_set_program_name(%i, %i, \"%s\")", pluginId, index, name); | |||
char targetPath[std::strlen(pData->oscData->path)+18]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/set_program_name"); | |||
try_lo_send(pData->oscData->target, targetPath, "iis", static_cast<int32_t>(pluginId), static_cast<int32_t>(index), name); | |||
} | |||
void CarlaEngine::oscSend_control_set_midi_program_data(const uint pluginId, const uint32_t index, const uint32_t bank, const uint32_t program, const char* const name) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
CARLA_SAFE_ASSERT_RETURN(name != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_control_set_midi_program_data(%i, %i, %i, %i, \"%s\")", pluginId, index, bank, program, name); | |||
char targetPath[std::strlen(pData->oscData->path)+23]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/set_midi_program_data"); | |||
try_lo_send(pData->oscData->target, targetPath, "iiiis", static_cast<int32_t>(pluginId), static_cast<int32_t>(index), static_cast<int32_t>(bank), static_cast<int32_t>(program), name); | |||
} | |||
void CarlaEngine::oscSend_control_note_on(const uint pluginId, const uint8_t channel, const uint8_t note, const uint8_t velo) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
CARLA_SAFE_ASSERT_RETURN(channel < MAX_MIDI_CHANNELS,); | |||
CARLA_SAFE_ASSERT_RETURN(note < MAX_MIDI_NOTE,); | |||
CARLA_SAFE_ASSERT_RETURN(velo < MAX_MIDI_VALUE,); | |||
carla_debug("CarlaEngine::oscSend_control_note_on(%i, %i, %i, %i)", pluginId, channel, note, velo); | |||
char targetPath[std::strlen(pData->oscData->path)+9]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/note_on"); | |||
try_lo_send(pData->oscData->target, targetPath, "iiii", static_cast<int32_t>(pluginId), static_cast<int32_t>(channel), static_cast<int32_t>(note), static_cast<int32_t>(velo)); | |||
} | |||
void CarlaEngine::oscSend_control_note_off(const uint pluginId, const uint8_t channel, const uint8_t note) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
CARLA_SAFE_ASSERT_RETURN(channel < MAX_MIDI_CHANNELS,); | |||
CARLA_SAFE_ASSERT_RETURN(note < MAX_MIDI_NOTE,); | |||
carla_debug("CarlaEngine::oscSend_control_note_off(%i, %i, %i)", pluginId, channel, note); | |||
char targetPath[std::strlen(pData->oscData->path)+10]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/note_off"); | |||
try_lo_send(pData->oscData->target, targetPath, "iii", static_cast<int32_t>(pluginId), static_cast<int32_t>(channel), static_cast<int32_t>(note)); | |||
} | |||
void CarlaEngine::oscSend_control_set_peaks(const uint pluginId) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
// TODO - try and see if we can get peaks[4] ref | |||
const EnginePluginData& epData(pData->plugins[pluginId]); | |||
char targetPath[std::strlen(pData->oscData->path)+11]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/set_peaks"); | |||
try_lo_send(pData->oscData->target, targetPath, "iffff", static_cast<int32_t>(pluginId), epData.insPeak[0], epData.insPeak[1], epData.outsPeak[0], epData.outsPeak[1]); | |||
} | |||
void CarlaEngine::oscSend_control_exit() const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_control_exit()"); | |||
char targetPath[std::strlen(pData->oscData->path)+6]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/exit"); | |||
try_lo_send(pData->oscData->target, targetPath, ""); | |||
} | |||
#endif | |||
// ----------------------------------------------------------------------- | |||
CARLA_BACKEND_END_NAMESPACE |
@@ -82,7 +82,8 @@ RackGraph::RackGraph(const uint32_t bufferSize) noexcept | |||
{ | |||
audio.inBuf[0] = audio.inBuf[1] = nullptr; | |||
audio.outBuf[0] = audio.outBuf[1] = nullptr; | |||
resize(bufferSize); | |||
setBufferSize(bufferSize); | |||
} | |||
RackGraph::~RackGraph() noexcept | |||
@@ -105,7 +106,7 @@ void RackGraph::clear() noexcept | |||
midi.outs.clear(); | |||
} | |||
void RackGraph::resize(const uint32_t bufferSize) noexcept | |||
void RackGraph::setBufferSize(const uint32_t bufferSize) noexcept | |||
{ | |||
if (audio.inBuf[0] != nullptr) | |||
{ | |||
@@ -164,6 +165,10 @@ void RackGraph::resize(const uint32_t bufferSize) noexcept | |||
FloatVectorOperations::clear(audio.outBuf[1], bufferSize); | |||
} | |||
void RackGraph::setSampleRate(const double) noexcept | |||
{ | |||
} | |||
bool RackGraph::connect(CarlaEngine* const engine, const uint groupA, const uint portA, const uint groupB, const uint portB) noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(engine != nullptr, false); | |||
@@ -491,6 +496,14 @@ void PatchbayGraph::clear() noexcept | |||
{ | |||
} | |||
void PatchbayGraph::setBufferSize(const uint32_t) noexcept | |||
{ | |||
} | |||
void PatchbayGraph::setSampleRate(const double) noexcept | |||
{ | |||
} | |||
bool PatchbayGraph::connect(CarlaEngine* const engine, const uint /*groupA*/, const uint /*portA*/, const uint /*groupB*/, const uint /*portB*/) noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(engine != nullptr, false); | |||
@@ -505,12 +518,12 @@ bool PatchbayGraph::disconnect(CarlaEngine* const engine, const uint /*connectio | |||
return false; | |||
} | |||
const char* const* PatchbayGraph::getConnections() const | |||
const char* const* PatchbayGraph::getConnections() const noexcept | |||
{ | |||
return nullptr; | |||
} | |||
bool PatchbayGraph::getPortIdFromFullName(const char* const /*fillPortName*/, uint& /*groupId*/, uint& /*portId*/) const | |||
bool PatchbayGraph::getPortIdFromFullName(const char* const /*fillPortName*/, uint& /*groupId*/, uint& /*portId*/) const noexcept | |||
{ | |||
return false; | |||
} | |||
@@ -528,7 +541,7 @@ EngineInternalGraph::~EngineInternalGraph() noexcept | |||
CARLA_SAFE_ASSERT(graph == nullptr); | |||
} | |||
void EngineInternalGraph::create(const uint32_t bufferSize) | |||
void EngineInternalGraph::create(const double /*sampleRate*/, const uint32_t bufferSize) | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(graph == nullptr,); | |||
@@ -536,24 +549,30 @@ void EngineInternalGraph::create(const uint32_t bufferSize) | |||
graph = new RackGraph(bufferSize); | |||
else | |||
graph = new PatchbayGraph(); | |||
} | |||
//isReady = true; | |||
void EngineInternalGraph::clear() noexcept | |||
{ | |||
//CARLA_SAFE_ASSERT_RETURN(graph != nullptr,); | |||
if (graph != nullptr) | |||
{ | |||
delete graph; | |||
graph = nullptr; | |||
} | |||
} | |||
void EngineInternalGraph::resize(const uint32_t bufferSize) noexcept | |||
void EngineInternalGraph::setBufferSize(const uint32_t bufferSize) | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(graph != nullptr,); | |||
if (isRack) | |||
((RackGraph*)graph)->resize(bufferSize); | |||
graph->setBufferSize(bufferSize); | |||
} | |||
void EngineInternalGraph::clear() noexcept | |||
void EngineInternalGraph::setSampleRate(const double sampleRate) | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(graph != nullptr,); | |||
delete graph; | |||
graph = nullptr; | |||
graph->setSampleRate(sampleRate); | |||
} | |||
// ----------------------------------------------------------------------- | |||
@@ -53,6 +53,8 @@ enum RackGraphCarlaPortIds { | |||
struct InternalGraph { | |||
virtual ~InternalGraph() noexcept {} | |||
virtual void clear() noexcept = 0; | |||
virtual void setBufferSize(const uint32_t bufferSize) = 0; | |||
virtual void setSampleRate(const double sampleRate) = 0; | |||
virtual bool connect(CarlaEngine* const engine, const uint groupA, const uint portA, const uint groupB, const uint portB) noexcept = 0; | |||
virtual bool disconnect(CarlaEngine* const engine, const uint connectionId) noexcept = 0; | |||
virtual const char* const* getConnections() const = 0; | |||
@@ -85,7 +87,8 @@ struct RackGraph : InternalGraph { | |||
RackGraph(const uint32_t bufferSize) noexcept; | |||
~RackGraph() noexcept override; | |||
void clear() noexcept override; | |||
void resize(const uint32_t bufferSize) noexcept; | |||
void setBufferSize(const uint32_t bufferSize) noexcept override; | |||
void setSampleRate(const double sampleRate) noexcept override; | |||
bool connect(CarlaEngine* const engine, const uint groupA, const uint portA, const uint groupB, const uint portB) noexcept override; | |||
bool disconnect(CarlaEngine* const engine, const uint connectionId) noexcept override; | |||
const char* const* getConnections() const override; | |||
@@ -101,10 +104,12 @@ struct PatchbayGraph : InternalGraph { | |||
PatchbayGraph() noexcept; | |||
~PatchbayGraph() noexcept override; | |||
void clear() noexcept override; | |||
void setBufferSize(const uint32_t bufferSize) noexcept override; | |||
void setSampleRate(const double sampleRate) noexcept override; | |||
bool connect(CarlaEngine* const engine, const uint groupA, const uint portA, const uint groupB, const uint portB) noexcept override; | |||
bool disconnect(CarlaEngine* const engine, const uint connectionId) noexcept override; | |||
const char* const* getConnections() const override; | |||
bool getPortIdFromFullName(const char* const fullPortName, uint& groupId, uint& portId) const override; | |||
const char* const* getConnections() const noexcept override; | |||
bool getPortIdFromFullName(const char* const fullPortName, uint& groupId, uint& portId) const noexcept override; | |||
}; | |||
// ----------------------------------------------------------------------- | |||
@@ -59,10 +59,12 @@ struct EngineInternalGraph { | |||
EngineInternalGraph() noexcept; | |||
~EngineInternalGraph() noexcept; | |||
void create(const uint32_t bufferSize); | |||
void resize(const uint32_t bufferSize) noexcept; | |||
void create(const double sampleRate, const uint32_t bufferSize); | |||
void clear() noexcept; | |||
void setBufferSize(const uint32_t bufferSize); | |||
void setSampleRate(const double sampleRate); | |||
CARLA_DECLARE_NON_COPY_STRUCT(EngineInternalGraph) | |||
}; | |||
#endif | |||
@@ -161,7 +161,7 @@ public: | |||
pData->sampleRate = fDevice->getCurrentSampleRate(); | |||
pData->graph.isRack = (pData->options.processMode == ENGINE_PROCESS_MODE_CONTINUOUS_RACK); | |||
pData->graph.create(pData->bufferSize); | |||
pData->graph.create(pData->sampleRate, pData->bufferSize); | |||
fDevice->start(this); | |||
@@ -0,0 +1,702 @@ | |||
/* | |||
* Carla Plugin Host | |||
* Copyright (C) 2011-2014 Filipe Coelho <falktx@falktx.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 doc/GPL.txt file. | |||
*/ | |||
#include "CarlaEngineInternal.hpp" | |||
#include "CarlaMIDI.h" | |||
CARLA_BACKEND_START_NAMESPACE | |||
// ----------------------------------------------------------------------- | |||
#ifdef BUILD_BRIDGE | |||
void CarlaEngine::oscSend_bridge_plugin_info1(const PluginCategory category, const uint hints, const int64_t uniqueId) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_plugin_info1(%i:%s, %X, " P_INT64 ")", category, PluginCategory2Str(category), hints, uniqueId); | |||
char targetPath[std::strlen(pData->oscData->path)+21]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_plugin_info1"); | |||
try_lo_send(pData->oscData->target, targetPath, "iih", static_cast<int32_t>(category), static_cast<int32_t>(hints), uniqueId); | |||
} | |||
void CarlaEngine::oscSend_bridge_plugin_info2(const char* const realName, const char* const label, const char* const maker, const char* const copyright) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(realName != nullptr && realName[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(label != nullptr && label[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(maker != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(copyright != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_plugin_info2(\"%s\", \"%s\", \"%s\", \"%s\")", realName, label, maker, copyright); | |||
char targetPath[std::strlen(pData->oscData->path)+21]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_plugin_info2"); | |||
try_lo_send(pData->oscData->target, targetPath, "ssss", realName, label, maker, copyright); | |||
} | |||
void CarlaEngine::oscSend_bridge_audio_count(const uint32_t ins, const uint32_t outs) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_audio_count(%i, %i)", ins, outs); | |||
char targetPath[std::strlen(pData->oscData->path)+20]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_audio_count"); | |||
try_lo_send(pData->oscData->target, targetPath, "ii", static_cast<int32_t>(ins), static_cast<int32_t>(outs)); | |||
} | |||
void CarlaEngine::oscSend_bridge_midi_count(const uint32_t ins, const uint32_t outs) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_midi_count(%i, %i)", ins, outs); | |||
char targetPath[std::strlen(pData->oscData->path)+19]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_midi_count"); | |||
try_lo_send(pData->oscData->target, targetPath, "ii", static_cast<int32_t>(ins), static_cast<int32_t>(outs)); | |||
} | |||
void CarlaEngine::oscSend_bridge_parameter_count(const uint32_t ins, const uint32_t outs) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_parameter_count(%i, %i)", ins, outs); | |||
char targetPath[std::strlen(pData->oscData->path)+24]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_parameter_count"); | |||
try_lo_send(pData->oscData->target, targetPath, "ii", static_cast<int32_t>(ins), static_cast<int32_t>(outs)); | |||
} | |||
void CarlaEngine::oscSend_bridge_program_count(const uint32_t count) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_program_count(%i)", count); | |||
char targetPath[std::strlen(pData->oscData->path)+23]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_program_count"); | |||
try_lo_send(pData->oscData->target, targetPath, "i", static_cast<int32_t>(count)); | |||
} | |||
void CarlaEngine::oscSend_bridge_midi_program_count(const uint32_t count) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_midi_program_count(%i)", count); | |||
char targetPath[std::strlen(pData->oscData->path)+27]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_midi_program_count"); | |||
try_lo_send(pData->oscData->target, targetPath, "i", static_cast<int32_t>(count)); | |||
} | |||
void CarlaEngine::oscSend_bridge_parameter_data(const uint32_t index, const int32_t rindex, const ParameterType type, const uint hints, const char* const name, const char* const unit) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(name != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(unit != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_parameter_data(%i, %i, %i:%s, %X, \"%s\", \"%s\")", index, rindex, type, ParameterType2Str(type), hints, name, unit); | |||
char targetPath[std::strlen(pData->oscData->path)+24]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_parameter_data"); | |||
try_lo_send(pData->oscData->target, targetPath, "iiiiss", static_cast<int32_t>(index), static_cast<int32_t>(rindex), static_cast<int32_t>(type), static_cast<int32_t>(hints), name, unit); | |||
} | |||
void CarlaEngine::oscSend_bridge_parameter_ranges1(const uint32_t index, const float def, const float min, const float max) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_parameter_ranges(%i, %f, %f, %f)", index, def, min, max); | |||
char targetPath[std::strlen(pData->oscData->path)+26]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_parameter_ranges1"); | |||
try_lo_send(pData->oscData->target, targetPath, "ifff", static_cast<int32_t>(index), def, min, max); | |||
} | |||
void CarlaEngine::oscSend_bridge_parameter_ranges2(const uint32_t index, const float step, const float stepSmall, const float stepLarge) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_parameter_ranges(%i, %f, %f, %f)", index, step, stepSmall, stepLarge); | |||
char targetPath[std::strlen(pData->oscData->path)+26]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_parameter_ranges2"); | |||
try_lo_send(pData->oscData->target, targetPath, "ifff", static_cast<int32_t>(index), step, stepSmall, stepLarge); | |||
} | |||
void CarlaEngine::oscSend_bridge_parameter_midi_cc(const uint32_t index, const int16_t cc) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_parameter_midi_cc(%i, %i)", index, cc); | |||
char targetPath[std::strlen(pData->oscData->path)+26]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_parameter_midi_cc"); | |||
try_lo_send(pData->oscData->target, targetPath, "ii", static_cast<int32_t>(index), static_cast<int32_t>(cc)); | |||
} | |||
void CarlaEngine::oscSend_bridge_parameter_midi_channel(const uint32_t index, const uint8_t channel) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_parameter_midi_channel(%i, %i)", index, channel); | |||
char targetPath[std::strlen(pData->oscData->path)+31]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_parameter_midi_channel"); | |||
try_lo_send(pData->oscData->target, targetPath, "ii", static_cast<int32_t>(index), static_cast<int32_t>(channel)); | |||
} | |||
void CarlaEngine::oscSend_bridge_parameter_value(const uint32_t index, const float value) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_parameter_value(%i, %f)", index, value); | |||
char targetPath[std::strlen(pData->oscData->path)+24]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_parameter_value"); | |||
try_lo_send(pData->oscData->target, targetPath, "if", static_cast<int32_t>(index), value); | |||
} | |||
void CarlaEngine::oscSend_bridge_default_value(const uint32_t index, const float value) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_default_value(%i, %f)", index, value); | |||
char targetPath[std::strlen(pData->oscData->path)+22]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_default_value"); | |||
try_lo_send(pData->oscData->target, targetPath, "if", static_cast<int32_t>(index), value); | |||
} | |||
void CarlaEngine::oscSend_bridge_current_program(const int32_t index) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_current_program(%i)", index); | |||
char targetPath[std::strlen(pData->oscData->path)+24]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_current_program"); | |||
try_lo_send(pData->oscData->target, targetPath, "i", index); | |||
} | |||
void CarlaEngine::oscSend_bridge_current_midi_program(const int32_t index) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_current_midi_program(%i)", index); | |||
char targetPath[std::strlen(pData->oscData->path)+30]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_current_midi_program"); | |||
try_lo_send(pData->oscData->target, targetPath, "i", index); | |||
} | |||
void CarlaEngine::oscSend_bridge_program_name(const uint32_t index, const char* const name) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(name != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_program_name(%i, \"%s\")", index, name); | |||
char targetPath[std::strlen(pData->oscData->path)+21]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_program_name"); | |||
try_lo_send(pData->oscData->target, targetPath, "is", static_cast<int32_t>(index), name); | |||
} | |||
void CarlaEngine::oscSend_bridge_midi_program_data(const uint32_t index, const uint32_t bank, const uint32_t program, const char* const name) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(name != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_midi_program_data(%i, %i, %i, \"%s\")", index, bank, program, name); | |||
char targetPath[std::strlen(pData->oscData->path)+26]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_midi_program_data"); | |||
try_lo_send(pData->oscData->target, targetPath, "iiis", static_cast<int32_t>(index), static_cast<int32_t>(bank), static_cast<int32_t>(program), name); | |||
} | |||
void CarlaEngine::oscSend_bridge_configure(const char* const key, const char* const value) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(key != nullptr && key[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(value != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_configure(\"%s\", \"%s\")", key, value); | |||
char targetPath[std::strlen(pData->oscData->path)+18]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_configure"); | |||
try_lo_send(pData->oscData->target, targetPath, "ss", key, value); | |||
} | |||
void CarlaEngine::oscSend_bridge_set_custom_data(const char* const type, const char* const key, const char* const value) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(type != nullptr && type[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(key != nullptr && key[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(value != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_bridge_set_custom_data(\"%s\", \"%s\", \"%s\")", type, key, value); | |||
char targetPath[std::strlen(pData->oscData->path)+24]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_set_custom_data"); | |||
try_lo_send(pData->oscData->target, targetPath, "sss", type, key, value); | |||
} | |||
void CarlaEngine::oscSend_bridge_set_chunk_data(const char* const chunkFile) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(chunkFile != nullptr && chunkFile[0] != '\0',); | |||
carla_debug("CarlaEngine::oscSend_bridge_set_chunk_data(\"%s\")", chunkFile); | |||
char targetPath[std::strlen(pData->oscData->path)+23]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_set_chunk_data"); | |||
try_lo_send(pData->oscData->target, targetPath, "s", chunkFile); | |||
} | |||
void CarlaEngine::oscSend_bridge_pong() const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
//carla_debug("CarlaEngine::oscSend_pong()"); | |||
char targetPath[std::strlen(pData->oscData->path)+13]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/bridge_pong"); | |||
try_lo_send(pData->oscData->target, targetPath, ""); | |||
} | |||
#else | |||
void CarlaEngine::oscSend_control_add_plugin_start(const uint pluginId, const char* const pluginName) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginName != nullptr && pluginName[0] != '\0',); | |||
carla_debug("CarlaEngine::oscSend_control_add_plugin_start(%i, \"%s\")", pluginId, pluginName); | |||
char targetPath[std::strlen(pData->oscData->path)+18]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/add_plugin_start"); | |||
try_lo_send(pData->oscData->target, targetPath, "is", static_cast<int32_t>(pluginId), pluginName); | |||
} | |||
void CarlaEngine::oscSend_control_add_plugin_end(const uint pluginId) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
carla_debug("CarlaEngine::oscSend_control_add_plugin_end(%i)", pluginId); | |||
char targetPath[std::strlen(pData->oscData->path)+16]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/add_plugin_end"); | |||
try_lo_send(pData->oscData->target, targetPath, "i", static_cast<int32_t>(pluginId)); | |||
} | |||
void CarlaEngine::oscSend_control_remove_plugin(const uint pluginId) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
carla_debug("CarlaEngine::oscSend_control_remove_plugin(%i)", pluginId); | |||
char targetPath[std::strlen(pData->oscData->path)+15]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/remove_plugin"); | |||
try_lo_send(pData->oscData->target, targetPath, "i", static_cast<int32_t>(pluginId)); | |||
} | |||
void CarlaEngine::oscSend_control_set_plugin_info1(const uint pluginId, const PluginType type, const PluginCategory category, const uint hints, const int64_t uniqueId) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
CARLA_SAFE_ASSERT_RETURN(type != PLUGIN_NONE,); | |||
carla_debug("CarlaEngine::oscSend_control_set_plugin_data(%i, %i:%s, %i:%s, %X, " P_INT64 ")", pluginId, type, PluginType2Str(type), category, PluginCategory2Str(category), hints, uniqueId); | |||
char targetPath[std::strlen(pData->oscData->path)+18]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/set_plugin_info1"); | |||
try_lo_send(pData->oscData->target, targetPath, "iiiih", static_cast<int32_t>(pluginId), static_cast<int32_t>(type), static_cast<int32_t>(category), static_cast<int32_t>(hints), static_cast<int64_t>(uniqueId)); | |||
} | |||
void CarlaEngine::oscSend_control_set_plugin_info2(const uint pluginId, const char* const realName, const char* const label, const char* const maker, const char* const copyright) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
CARLA_SAFE_ASSERT_RETURN(realName != nullptr && realName[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(label != nullptr && label[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(maker != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(copyright != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_control_set_plugin_data(%i, \"%s\", \"%s\", \"%s\", \"%s\")", pluginId, realName, label, maker, copyright); | |||
char targetPath[std::strlen(pData->oscData->path)+18]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/set_plugin_info2"); | |||
try_lo_send(pData->oscData->target, targetPath, "issss", static_cast<int32_t>(pluginId), realName, label, maker, copyright); | |||
} | |||
void CarlaEngine::oscSend_control_set_audio_count(const uint pluginId, const uint32_t ins, const uint32_t outs) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
carla_debug("CarlaEngine::oscSend_control_set_audio_count(%i, %i, %i)", pluginId, ins, outs); | |||
char targetPath[std::strlen(pData->oscData->path)+18]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/set_audio_count"); | |||
try_lo_send(pData->oscData->target, targetPath, "iii", static_cast<int32_t>(pluginId), static_cast<int32_t>(ins), static_cast<int32_t>(outs)); | |||
} | |||
void CarlaEngine::oscSend_control_set_midi_count(const uint pluginId, const uint32_t ins, const uint32_t outs) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
carla_debug("CarlaEngine::oscSend_control_set_midi_count(%i, %i, %i)", pluginId, ins, outs); | |||
char targetPath[std::strlen(pData->oscData->path)+18]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/set_midi_count"); | |||
try_lo_send(pData->oscData->target, targetPath, "iii", static_cast<int32_t>(pluginId), static_cast<int32_t>(ins), static_cast<int32_t>(outs)); | |||
} | |||
void CarlaEngine::oscSend_control_set_parameter_count(const uint pluginId, const uint32_t ins, const uint32_t outs) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
carla_debug("CarlaEngine::oscSend_control_set_parameter_count(%i, %i, %i)", pluginId, ins, outs); | |||
char targetPath[std::strlen(pData->oscData->path)+18]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/set_parameter_count"); | |||
try_lo_send(pData->oscData->target, targetPath, "iii", static_cast<int32_t>(pluginId), static_cast<int32_t>(ins), static_cast<int32_t>(outs)); | |||
} | |||
void CarlaEngine::oscSend_control_set_program_count(const uint pluginId, const uint32_t count) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
carla_debug("CarlaEngine::oscSend_control_set_program_count(%i, %i)", pluginId, count); | |||
char targetPath[std::strlen(pData->oscData->path)+19]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/set_program_count"); | |||
try_lo_send(pData->oscData->target, targetPath, "ii", static_cast<int32_t>(pluginId), static_cast<int32_t>(count)); | |||
} | |||
void CarlaEngine::oscSend_control_set_midi_program_count(const uint pluginId, const uint32_t count) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
carla_debug("CarlaEngine::oscSend_control_set_midi_program_count(%i, %i)", pluginId, count); | |||
char targetPath[std::strlen(pData->oscData->path)+24]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/set_midi_program_count"); | |||
try_lo_send(pData->oscData->target, targetPath, "ii", static_cast<int32_t>(pluginId), static_cast<int32_t>(count)); | |||
} | |||
void CarlaEngine::oscSend_control_set_parameter_data(const uint pluginId, const uint32_t index, const ParameterType type, const uint hints, const char* const name, const char* const unit) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
CARLA_SAFE_ASSERT_RETURN(name != nullptr && name[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(unit != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_control_set_parameter_data(%i, %i, %i:%s, %X, \"%s\", \"%s\")", pluginId, index, type, ParameterType2Str(type), hints, name, unit); | |||
char targetPath[std::strlen(pData->oscData->path)+20]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/set_parameter_data"); | |||
try_lo_send(pData->oscData->target, targetPath, "iiiiss", static_cast<int32_t>(pluginId), static_cast<int32_t>(index), static_cast<int32_t>(type), static_cast<int32_t>(hints), name, unit); | |||
} | |||
void CarlaEngine::oscSend_control_set_parameter_ranges1(const uint pluginId, const uint32_t index, const float def, const float min, const float max) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
CARLA_SAFE_ASSERT_RETURN(def <= min && def >= max,); | |||
CARLA_SAFE_ASSERT_RETURN(min < max,); | |||
carla_debug("CarlaEngine::oscSend_control_set_parameter_ranges1(%i, %i, %f, %f, %f)", pluginId, index, def, min, max, def); | |||
char targetPath[std::strlen(pData->oscData->path)+23]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/set_parameter_ranges1"); | |||
try_lo_send(pData->oscData->target, targetPath, "iifff", static_cast<int32_t>(pluginId), static_cast<int32_t>(index), def, min, max); | |||
} | |||
void CarlaEngine::oscSend_control_set_parameter_ranges2(const uint pluginId, const uint32_t index, const float step, const float stepSmall, const float stepLarge) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
CARLA_SAFE_ASSERT_RETURN(step <= stepSmall && step >= stepLarge,); | |||
CARLA_SAFE_ASSERT_RETURN(stepSmall <= stepLarge,); | |||
carla_debug("CarlaEngine::oscSend_control_set_parameter_ranges2(%i, %i, %f, %f, %f)", pluginId, index, step, stepSmall, stepLarge); | |||
char targetPath[std::strlen(pData->oscData->path)+23]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/set_parameter_ranges"); | |||
try_lo_send(pData->oscData->target, targetPath, "iifff", static_cast<int32_t>(pluginId), static_cast<int32_t>(index), step, stepSmall, stepLarge); | |||
} | |||
void CarlaEngine::oscSend_control_set_parameter_midi_cc(const uint pluginId, const uint32_t index, const int16_t cc) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
CARLA_SAFE_ASSERT_RETURN(cc <= 0x5F,); | |||
carla_debug("CarlaEngine::oscSend_control_set_parameter_midi_cc(%i, %i, %i)", pluginId, index, cc); | |||
char targetPath[std::strlen(pData->oscData->path)+23]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/set_parameter_midi_cc"); | |||
try_lo_send(pData->oscData->target, targetPath, "iii", static_cast<int32_t>(pluginId), static_cast<int32_t>(index), static_cast<int32_t>(cc)); | |||
} | |||
void CarlaEngine::oscSend_control_set_parameter_midi_channel(const uint pluginId, const uint32_t index, const uint8_t channel) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
CARLA_SAFE_ASSERT_RETURN(channel < MAX_MIDI_CHANNELS,); | |||
carla_debug("CarlaEngine::oscSend_control_set_parameter_midi_channel(%i, %i, %i)", pluginId, index, channel); | |||
char targetPath[std::strlen(pData->oscData->path)+28]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/set_parameter_midi_channel"); | |||
try_lo_send(pData->oscData->target, targetPath, "iii", static_cast<int32_t>(pluginId), static_cast<int32_t>(index), static_cast<int32_t>(channel)); | |||
} | |||
void CarlaEngine::oscSend_control_set_parameter_value(const uint pluginId, const int32_t index, const float value) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
CARLA_SAFE_ASSERT_RETURN(index != PARAMETER_NULL,); | |||
carla_debug("CarlaEngine::oscSend_control_set_parameter_value(%i, %i:%s, %f)", pluginId, index, (index < 0) ? InternalParameterIndex2Str(static_cast<InternalParameterIndex>(index)) : "(none)", value); | |||
char targetPath[std::strlen(pData->oscData->path)+21]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/set_parameter_value"); | |||
try_lo_send(pData->oscData->target, targetPath, "iif", static_cast<int32_t>(pluginId), index, value); | |||
} | |||
void CarlaEngine::oscSend_control_set_default_value(const uint pluginId, const uint32_t index, const float value) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
carla_debug("CarlaEngine::oscSend_control_set_default_value(%i, %i, %f)", pluginId, index, value); | |||
char targetPath[std::strlen(pData->oscData->path)+19]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/set_default_value"); | |||
try_lo_send(pData->oscData->target, targetPath, "iif", static_cast<int32_t>(pluginId), static_cast<int32_t>(index), value); | |||
} | |||
void CarlaEngine::oscSend_control_set_current_program(const uint pluginId, const int32_t index) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
carla_debug("CarlaEngine::oscSend_control_set_current_program(%i, %i)", pluginId, index); | |||
char targetPath[std::strlen(pData->oscData->path)+21]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/set_current_program"); | |||
try_lo_send(pData->oscData->target, targetPath, "ii", static_cast<int32_t>(pluginId), index); | |||
} | |||
void CarlaEngine::oscSend_control_set_current_midi_program(const uint pluginId, const int32_t index) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
carla_debug("CarlaEngine::oscSend_control_set_current_midi_program(%i, %i)", pluginId, index); | |||
char targetPath[std::strlen(pData->oscData->path)+26]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/set_current_midi_program"); | |||
try_lo_send(pData->oscData->target, targetPath, "ii", static_cast<int32_t>(pluginId), index); | |||
} | |||
void CarlaEngine::oscSend_control_set_program_name(const uint pluginId, const uint32_t index, const char* const name) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
CARLA_SAFE_ASSERT_RETURN(name != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_control_set_program_name(%i, %i, \"%s\")", pluginId, index, name); | |||
char targetPath[std::strlen(pData->oscData->path)+18]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/set_program_name"); | |||
try_lo_send(pData->oscData->target, targetPath, "iis", static_cast<int32_t>(pluginId), static_cast<int32_t>(index), name); | |||
} | |||
void CarlaEngine::oscSend_control_set_midi_program_data(const uint pluginId, const uint32_t index, const uint32_t bank, const uint32_t program, const char* const name) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
CARLA_SAFE_ASSERT_RETURN(name != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_control_set_midi_program_data(%i, %i, %i, %i, \"%s\")", pluginId, index, bank, program, name); | |||
char targetPath[std::strlen(pData->oscData->path)+23]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/set_midi_program_data"); | |||
try_lo_send(pData->oscData->target, targetPath, "iiiis", static_cast<int32_t>(pluginId), static_cast<int32_t>(index), static_cast<int32_t>(bank), static_cast<int32_t>(program), name); | |||
} | |||
void CarlaEngine::oscSend_control_note_on(const uint pluginId, const uint8_t channel, const uint8_t note, const uint8_t velo) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
CARLA_SAFE_ASSERT_RETURN(channel < MAX_MIDI_CHANNELS,); | |||
CARLA_SAFE_ASSERT_RETURN(note < MAX_MIDI_NOTE,); | |||
CARLA_SAFE_ASSERT_RETURN(velo < MAX_MIDI_VALUE,); | |||
carla_debug("CarlaEngine::oscSend_control_note_on(%i, %i, %i, %i)", pluginId, channel, note, velo); | |||
char targetPath[std::strlen(pData->oscData->path)+9]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/note_on"); | |||
try_lo_send(pData->oscData->target, targetPath, "iiii", static_cast<int32_t>(pluginId), static_cast<int32_t>(channel), static_cast<int32_t>(note), static_cast<int32_t>(velo)); | |||
} | |||
void CarlaEngine::oscSend_control_note_off(const uint pluginId, const uint8_t channel, const uint8_t note) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
CARLA_SAFE_ASSERT_RETURN(channel < MAX_MIDI_CHANNELS,); | |||
CARLA_SAFE_ASSERT_RETURN(note < MAX_MIDI_NOTE,); | |||
carla_debug("CarlaEngine::oscSend_control_note_off(%i, %i, %i)", pluginId, channel, note); | |||
char targetPath[std::strlen(pData->oscData->path)+10]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/note_off"); | |||
try_lo_send(pData->oscData->target, targetPath, "iii", static_cast<int32_t>(pluginId), static_cast<int32_t>(channel), static_cast<int32_t>(note)); | |||
} | |||
void CarlaEngine::oscSend_control_set_peaks(const uint pluginId) const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,); | |||
// TODO - try and see if we can get peaks[4] ref | |||
const EnginePluginData& epData(pData->plugins[pluginId]); | |||
char targetPath[std::strlen(pData->oscData->path)+11]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/set_peaks"); | |||
try_lo_send(pData->oscData->target, targetPath, "iffff", static_cast<int32_t>(pluginId), epData.insPeak[0], epData.insPeak[1], epData.outsPeak[0], epData.outsPeak[1]); | |||
} | |||
void CarlaEngine::oscSend_control_exit() const noexcept | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',); | |||
CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,); | |||
carla_debug("CarlaEngine::oscSend_control_exit()"); | |||
char targetPath[std::strlen(pData->oscData->path)+6]; | |||
std::strcpy(targetPath, pData->oscData->path); | |||
std::strcat(targetPath, "/exit"); | |||
try_lo_send(pData->oscData->target, targetPath, ""); | |||
} | |||
#endif | |||
// ----------------------------------------------------------------------- | |||
CARLA_BACKEND_END_NAMESPACE |
@@ -263,7 +263,7 @@ public: | |||
fLastEventTime = 0; | |||
pData->graph.isRack = (pData->options.processMode == ENGINE_PROCESS_MODE_CONTINUOUS_RACK); | |||
pData->graph.create(pData->bufferSize); | |||
pData->graph.create(pData->sampleRate, pData->bufferSize); | |||
try { | |||
fAudio.startStream(); | |||
@@ -15,6 +15,7 @@ OBJS = \ | |||
CarlaEngineGraph.cpp.o \ | |||
CarlaEngineInternal.cpp.o \ | |||
CarlaEngineOsc.cpp.o \ | |||
CarlaEngineOscSend.cpp.o \ | |||
CarlaEnginePorts.cpp.o \ | |||
CarlaEngineThread.cpp.o | |||
@@ -77,6 +78,9 @@ CarlaEngineInternal.cpp.o: CarlaEngineInternal.cpp $(CARLA_ENGINE_INTERNAL_CPP_D | |||
CarlaEngineOsc.cpp.o: CarlaEngineOsc.cpp $(CARLA_ENGINE_OSC_CPP_DEPS) | |||
$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@ | |||
CarlaEngineOscSend.cpp.o: CarlaEngineOscSend.cpp $(CARLA_ENGINE_OSC_SEND_CPP_DEPS) | |||
$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@ | |||
CarlaEnginePorts.cpp.o: CarlaEnginePorts.cpp $(CARLA_ENGINE_PORTS_CPP_DEPS) | |||
$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@ | |||
@@ -459,6 +459,7 @@ OBJS_NATIVE += \ | |||
../backend/engine/CarlaEngineData__native.o \ | |||
../backend/engine/CarlaEngineInternal__native.o \ | |||
../backend/engine/CarlaEngineOsc__native.o \ | |||
../backend/engine/CarlaEngineOscSend__native.o \ | |||
../backend/engine/CarlaEnginePorts__native.o \ | |||
../backend/engine/CarlaEngineThread__native.o \ | |||
../backend/engine/CarlaEngineJack__native.o \ | |||