Signed-off-by: falkTX <falktx@falktx.com>tags/v2.1-alpha2
| @@ -1330,7 +1330,6 @@ void CarlaEngine::callback(const bool sendHost, const bool sendOsc, | |||||
| #if defined(HAVE_LIBLO) && ! defined(BUILD_BRIDGE) | #if defined(HAVE_LIBLO) && ! defined(BUILD_BRIDGE) | ||||
| if (pData->osc.isControlRegistered()) | if (pData->osc.isControlRegistered()) | ||||
| { | { | ||||
| #if defined(HAVE_LIBLO) && ! defined(BUILD_BRIDGE) | |||||
| switch (action) | switch (action) | ||||
| { | { | ||||
| case ENGINE_CALLBACK_PLUGIN_ADDED: | case ENGINE_CALLBACK_PLUGIN_ADDED: | ||||
| @@ -1349,7 +1348,6 @@ void CarlaEngine::callback(const bool sendHost, const bool sendOsc, | |||||
| default: | default: | ||||
| break; | break; | ||||
| } | } | ||||
| #endif | |||||
| oscSend_control_callback(action, pluginId, value1, value2, value3, valuef, valueStr); | oscSend_control_callback(action, pluginId, value1, value2, value3, valuef, valueStr); | ||||
| } | } | ||||
| @@ -220,7 +220,9 @@ bool ExternalGraph::connect(const uint groupA, const uint portA, const uint grou | |||||
| strBuf[STR_MAX] = '\0'; | strBuf[STR_MAX] = '\0'; | ||||
| std::snprintf(strBuf, STR_MAX, "%u:%u:%u:%u", groupA, portA, groupB, portB); | std::snprintf(strBuf, STR_MAX, "%u:%u:%u:%u", groupA, portA, groupB, portB); | ||||
| kEngine->callback(sendCallback, true, ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, connectionToId.id, 0, 0, 0, 0.0f, strBuf); | |||||
| if (sendCallback) | |||||
| kEngine->callback(true, true, | |||||
| ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, connectionToId.id, 0, 0, 0, 0.0f, strBuf); | |||||
| connections.list.append(connectionToId); | connections.list.append(connectionToId); | ||||
| return true; | return true; | ||||
| @@ -556,11 +556,13 @@ public: | |||||
| extGraph.connections.list.append(connectionToId); | extGraph.connections.list.append(connectionToId); | ||||
| callback(sendCallback, true, | |||||
| ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, | |||||
| connectionToId.id, | |||||
| 0, 0, 0, 0.0f, | |||||
| strBuf); | |||||
| if (sendCallback) { | |||||
| callback(true, true, | |||||
| ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, | |||||
| connectionToId.id, | |||||
| 0, 0, 0, 0.0f, | |||||
| strBuf); | |||||
| } | |||||
| } | } | ||||
| fMidiOutMutex.lock(); | fMidiOutMutex.lock(); | ||||
| @@ -582,11 +584,13 @@ public: | |||||
| extGraph.connections.list.append(connectionToId); | extGraph.connections.list.append(connectionToId); | ||||
| callback(sendCallback, true, | |||||
| ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, | |||||
| connectionToId.id, | |||||
| 0, 0, 0, 0.0f, | |||||
| strBuf); | |||||
| if (sendCallback) { | |||||
| callback(true, true, | |||||
| ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, | |||||
| connectionToId.id, | |||||
| 0, 0, 0, 0.0f, | |||||
| strBuf); | |||||
| } | |||||
| } | } | ||||
| fMidiOutMutex.unlock(); | fMidiOutMutex.unlock(); | ||||
| @@ -1733,7 +1733,8 @@ void CarlaPlugin::setChunkData(const void* const data, const std::size_t dataSiz | |||||
| CARLA_SAFE_ASSERT(false); // this should never happen | CARLA_SAFE_ASSERT(false); // this should never happen | ||||
| } | } | ||||
| void CarlaPlugin::setProgram(const int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback, const bool) noexcept | |||||
| void CarlaPlugin::setProgram(const int32_t index, | |||||
| const bool sendGui, const bool sendOsc, const bool sendCallback, const bool) noexcept | |||||
| { | { | ||||
| CARLA_SAFE_ASSERT_RETURN(index >= -1 && index < static_cast<int32_t>(pData->prog.count),); | CARLA_SAFE_ASSERT_RETURN(index >= -1 && index < static_cast<int32_t>(pData->prog.count),); | ||||
| @@ -1758,13 +1759,14 @@ void CarlaPlugin::setProgram(const int32_t index, const bool sendGui, const bool | |||||
| break; | break; | ||||
| default: | default: | ||||
| pData->updateParameterValues(this, sendOsc, sendCallback, true); | |||||
| pData->updateParameterValues(this, sendCallback, sendOsc, true); | |||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| void CarlaPlugin::setMidiProgram(const int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback, const bool) noexcept | |||||
| void CarlaPlugin::setMidiProgram(const int32_t index, | |||||
| const bool sendGui, const bool sendOsc, const bool sendCallback, const bool) noexcept | |||||
| { | { | ||||
| CARLA_SAFE_ASSERT_RETURN(index >= -1 && index < static_cast<int32_t>(pData->midiprog.count),); | CARLA_SAFE_ASSERT_RETURN(index >= -1 && index < static_cast<int32_t>(pData->midiprog.count),); | ||||
| @@ -1789,7 +1791,7 @@ void CarlaPlugin::setMidiProgram(const int32_t index, const bool sendGui, const | |||||
| break; | break; | ||||
| default: | default: | ||||
| pData->updateParameterValues(this, sendOsc, sendCallback, true); | |||||
| pData->updateParameterValues(this, sendCallback, sendOsc, true); | |||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| @@ -640,12 +640,7 @@ public: | |||||
| } | } | ||||
| } | } | ||||
| #if defined(HAVE_LIBLO) && !defined(BUILD_BRIDGE) | |||||
| const bool sendOsc(pData->engine->isOscControlRegistered()); | |||||
| #else | |||||
| const bool sendOsc(false); | |||||
| #endif | |||||
| pData->updateParameterValues(this, sendOsc, true, false); | |||||
| pData->updateParameterValues(this, true, true, false); | |||||
| } | } | ||||
| void setMidiProgram(const int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback, const bool doingInit) noexcept override | void setMidiProgram(const int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback, const bool doingInit) noexcept override | ||||
| @@ -808,7 +808,10 @@ void CarlaPlugin::ProtectedData::tryTransient() noexcept | |||||
| } | } | ||||
| #endif | #endif | ||||
| void CarlaPlugin::ProtectedData::updateParameterValues(CarlaPlugin* const plugin, const bool sendOsc, const bool sendCallback, const bool useDefault) noexcept | |||||
| void CarlaPlugin::ProtectedData::updateParameterValues(CarlaPlugin* const plugin, | |||||
| const bool sendCallback, | |||||
| const bool sendOsc, | |||||
| const bool useDefault) noexcept | |||||
| { | { | ||||
| CARLA_SAFE_ASSERT_RETURN(sendOsc || sendCallback || useDefault,); | CARLA_SAFE_ASSERT_RETURN(sendOsc || sendCallback || useDefault,); | ||||
| @@ -821,25 +824,22 @@ void CarlaPlugin::ProtectedData::updateParameterValues(CarlaPlugin* const plugin | |||||
| if (useDefault) { | if (useDefault) { | ||||
| engine->callback(sendCallback, sendOsc, | engine->callback(sendCallback, sendOsc, | ||||
| ENGINE_CALLBACK_PARAMETER_DEFAULT_CHANGED, | |||||
| id, | |||||
| static_cast<int>(i), | |||||
| 0, 0, | |||||
| value, | |||||
| nullptr); | |||||
| ENGINE_CALLBACK_PARAMETER_DEFAULT_CHANGED, | |||||
| id, | |||||
| static_cast<int>(i), | |||||
| 0, 0, | |||||
| value, | |||||
| nullptr); | |||||
| } | } | ||||
| engine->callback(sendCallback, sendOsc, | engine->callback(sendCallback, sendOsc, | ||||
| ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED, | |||||
| id, | |||||
| static_cast<int>(i), | |||||
| 0, 0, | |||||
| value, | |||||
| nullptr); | |||||
| ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED, | |||||
| id, | |||||
| static_cast<int>(i), | |||||
| 0, 0, | |||||
| value, | |||||
| nullptr); | |||||
| } | } | ||||
| // may be unused | |||||
| return; (void)sendOsc; | |||||
| } | } | ||||
| void CarlaPlugin::ProtectedData::updateDefaultParameterValues(CarlaPlugin* const plugin) noexcept | void CarlaPlugin::ProtectedData::updateDefaultParameterValues(CarlaPlugin* const plugin) noexcept | ||||
| @@ -392,7 +392,8 @@ struct CarlaPlugin::ProtectedData { | |||||
| #ifndef BUILD_BRIDGE_ALTERNATIVE_ARCH | #ifndef BUILD_BRIDGE_ALTERNATIVE_ARCH | ||||
| void tryTransient() noexcept; | void tryTransient() noexcept; | ||||
| #endif | #endif | ||||
| void updateParameterValues(CarlaPlugin* const plugin, const bool sendOsc, const bool sendCallback, const bool useDefault) noexcept; | |||||
| void updateParameterValues(CarlaPlugin* const plugin, | |||||
| const bool sendCallback, const bool sendOsc, const bool useDefault) noexcept; | |||||
| void updateDefaultParameterValues(CarlaPlugin* const plugin) noexcept; | void updateDefaultParameterValues(CarlaPlugin* const plugin) noexcept; | ||||
| // ------------------------------------------------------------------- | // ------------------------------------------------------------------- | ||||
| @@ -326,12 +326,7 @@ public: | |||||
| std::free(dataCompat); | std::free(dataCompat); | ||||
| } | } | ||||
| #if defined(HAVE_LIBLO) && ! defined(BUILD_BRIDGE) | |||||
| const bool sendOsc(pData->engine->isOscControlRegistered()); | |||||
| #else | |||||
| const bool sendOsc(false); | |||||
| #endif | |||||
| pData->updateParameterValues(this, sendOsc, true, false); | |||||
| pData->updateParameterValues(this, true, true, false); | |||||
| } | } | ||||
| void setProgram(const int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback, const bool doingInit) noexcept override | void setProgram(const int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback, const bool doingInit) noexcept override | ||||
| @@ -420,12 +420,7 @@ public: | |||||
| // simulate an updateDisplay callback | // simulate an updateDisplay callback | ||||
| handleAudioMasterCallback(audioMasterUpdateDisplay, 0, 0, nullptr, 0.0f); | handleAudioMasterCallback(audioMasterUpdateDisplay, 0, 0, nullptr, 0.0f); | ||||
| #if defined(HAVE_LIBLO) && ! defined(BUILD_BRIDGE) | |||||
| const bool sendOsc(pData->engine->isOscControlRegistered()); | |||||
| #else | |||||
| const bool sendOsc(false); | |||||
| #endif | |||||
| pData->updateParameterValues(this, sendOsc, true, false); | |||||
| pData->updateParameterValues(this, true, true, false); | |||||
| } | } | ||||
| void setProgram(const int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback, const bool doingInit) noexcept override | void setProgram(const int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback, const bool doingInit) noexcept override | ||||