Signed-off-by: falkTX <falktx@falktx.com>tags/v2.1-alpha2
| @@ -999,7 +999,8 @@ public: | |||
| * Call the main engine callback, if set. | |||
| * May be called by plugins. | |||
| */ | |||
| virtual void callback(const EngineCallbackOpcode action, const uint pluginId, | |||
| virtual void callback(const bool sendHost, const bool sendOsc, | |||
| const EngineCallbackOpcode action, const uint pluginId, | |||
| const int value1, const int value2, const int value3, | |||
| const float valuef, const char* const valueStr) noexcept; | |||
| @@ -1285,9 +1286,12 @@ public: | |||
| // ------------------------------------------------------------------- | |||
| // OSC Controller stuff | |||
| void oscSend_control_callback(const EngineCallbackOpcode action, const uint pluginId, | |||
| const int value1, const int value2, const int value3, | |||
| const float valuef, const char* const valueStr) const noexcept; | |||
| void oscSend_control_add_plugin_start(const uint pluginId, const char* const pluginName) const noexcept; | |||
| void oscSend_control_add_plugin_end(const uint pluginId) const noexcept; | |||
| void oscSend_control_remove_plugin(const uint pluginId) const noexcept; | |||
| // void oscSend_control_add_plugin_end(const uint pluginId) const noexcept; | |||
| // void oscSend_control_remove_plugin(const uint pluginId) const noexcept; | |||
| void oscSend_control_set_plugin_info1(const uint pluginId, const PluginType type, const PluginCategory category, const uint hints, const int64_t uniqueId) const noexcept; | |||
| void 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; | |||
| void oscSend_control_set_audio_count(const uint pluginId, const uint32_t ins, const uint32_t outs) const noexcept; | |||
| @@ -1298,18 +1302,18 @@ public: | |||
| void 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; | |||
| void oscSend_control_set_parameter_ranges1(const uint pluginId, const uint32_t index, const float def, const float min, const float max) const noexcept; | |||
| void oscSend_control_set_parameter_ranges2(const uint pluginId, const uint32_t index, const float step, const float stepSmall, const float stepLarge) const noexcept; | |||
| void oscSend_control_set_parameter_midi_cc(const uint pluginId, const uint32_t index, const int16_t cc) const noexcept; | |||
| void oscSend_control_set_parameter_midi_channel(const uint pluginId, const uint32_t index, const uint8_t channel) const noexcept; | |||
| void oscSend_control_set_parameter_value(const uint pluginId, const int32_t index, const float value) const noexcept; // may be used for internal params (< 0) | |||
| void oscSend_control_set_default_value(const uint pluginId, const uint32_t index, const float value) const noexcept; | |||
| void oscSend_control_set_current_program(const uint pluginId, const int32_t index) const noexcept; | |||
| void oscSend_control_set_current_midi_program(const uint pluginId, const int32_t index) const noexcept; | |||
| // void oscSend_control_set_parameter_midi_cc(const uint pluginId, const uint32_t index, const int16_t cc) const noexcept; | |||
| // void oscSend_control_set_parameter_midi_channel(const uint pluginId, const uint32_t index, const uint8_t channel) const noexcept; | |||
| void oscSend_control_set_output_parameter_value(const uint pluginId, const int32_t index, const float value) const noexcept; | |||
| // void oscSend_control_set_default_value(const uint pluginId, const uint32_t index, const float value) const noexcept; | |||
| // void oscSend_control_set_current_program(const uint pluginId, const int32_t index) const noexcept; | |||
| // void oscSend_control_set_current_midi_program(const uint pluginId, const int32_t index) const noexcept; | |||
| void oscSend_control_set_program_name(const uint pluginId, const uint32_t index, const char* const name) const noexcept; | |||
| void 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; | |||
| void oscSend_control_note_on(const uint pluginId, const uint8_t channel, const uint8_t note, const uint8_t velo) const noexcept; | |||
| void oscSend_control_note_off(const uint pluginId, const uint8_t channel, const uint8_t note) const noexcept; | |||
| // void oscSend_control_note_on(const uint pluginId, const uint8_t channel, const uint8_t note, const uint8_t velo) const noexcept; | |||
| // void oscSend_control_note_off(const uint pluginId, const uint8_t channel, const uint8_t note) const noexcept; | |||
| void oscSend_control_set_peaks(const uint pluginId) const noexcept; | |||
| void oscSend_control_exit() const noexcept; | |||
| // void oscSend_control_exit() const noexcept; | |||
| #endif | |||
| CARLA_DECLARE_NON_COPY_CLASS(CarlaEngine) | |||
| @@ -523,7 +523,7 @@ public: | |||
| void setBalanceLeftRT(const float value) noexcept; | |||
| void setBalanceRightRT(const float value) noexcept; | |||
| void setPanningRT(const float value) noexcept; | |||
| #endif | |||
| #endif // ! BUILD_BRIDGE_ALTERNATIVE_ARCH | |||
| /*! | |||
| * Set the plugin's midi control channel. | |||
| @@ -299,14 +299,9 @@ bool CarlaEngine::close() | |||
| removeAllPlugins(); | |||
| } | |||
| #if defined(HAVE_LIBLO) && ! defined(BUILD_BRIDGE) | |||
| if (pData->osc.isControlRegistered()) | |||
| oscSend_control_exit(); | |||
| #endif | |||
| pData->close(); | |||
| callback(ENGINE_CALLBACK_ENGINE_STOPPED, 0, 0, 0, 0, 0.0f, nullptr); | |||
| callback(true, true, ENGINE_CALLBACK_ENGINE_STOPPED, 0, 0, 0, 0, 0.0f, nullptr); | |||
| return true; | |||
| } | |||
| @@ -640,7 +635,7 @@ bool CarlaEngine::addPlugin(const BinaryType btype, const PluginType ptype, | |||
| plugin->setActive(wasActive, true, true); | |||
| plugin->setEnabled(true); | |||
| callback(ENGINE_CALLBACK_RELOAD_ALL, id, 0, 0, 0, 0.0f, nullptr); | |||
| callback(true, true, ENGINE_CALLBACK_RELOAD_ALL, id, 0, 0, 0, 0.0f, nullptr); | |||
| } | |||
| else if (! pData->loadingProject) | |||
| #endif | |||
| @@ -648,7 +643,7 @@ bool CarlaEngine::addPlugin(const BinaryType btype, const PluginType ptype, | |||
| plugin->setEnabled(true); | |||
| ++pData->curPluginCount; | |||
| callback(ENGINE_CALLBACK_PLUGIN_ADDED, id, 0, 0, 0, 0.0f, plugin->getName()); | |||
| callback(true, true, ENGINE_CALLBACK_PLUGIN_ADDED, id, 0, 0, 0, 0.0f, plugin->getName()); | |||
| if (getType() != kEngineTypeBridge) | |||
| plugin->setActive(true, false, true); | |||
| @@ -659,10 +654,6 @@ bool CarlaEngine::addPlugin(const BinaryType btype, const PluginType ptype, | |||
| #endif | |||
| } | |||
| #if defined(HAVE_LIBLO) && ! defined(BUILD_BRIDGE) | |||
| plugin->registerToOscClient(); | |||
| #endif | |||
| return true; | |||
| } | |||
| @@ -703,11 +694,6 @@ bool CarlaEngine::removePlugin(const uint id) | |||
| plugin2->updateOscURL(); | |||
| } | |||
| */ | |||
| # if defined(HAVE_LIBLO) && !defined(BUILD_BRIDGE) | |||
| if (isOscControlRegistered()) | |||
| oscSend_control_remove_plugin(id); | |||
| # endif | |||
| #else | |||
| pData->curPluginCount = 0; | |||
| carla_zeroStructs(pData->plugins, 1); | |||
| @@ -715,7 +701,7 @@ bool CarlaEngine::removePlugin(const uint id) | |||
| delete plugin; | |||
| callback(ENGINE_CALLBACK_PLUGIN_REMOVED, id, 0, 0, 0, 0.0f, nullptr); | |||
| callback(true, true, ENGINE_CALLBACK_PLUGIN_REMOVED, id, 0, 0, 0, 0.0f, nullptr); | |||
| return true; | |||
| } | |||
| @@ -739,19 +725,11 @@ bool CarlaEngine::removeAllPlugins() | |||
| #ifndef BUILD_BRIDGE_ALTERNATIVE_ARCH | |||
| if (pData->options.processMode == ENGINE_PROCESS_MODE_PATCHBAY) | |||
| pData->graph.removeAllPlugins(); | |||
| # if defined(HAVE_LIBLO) && !defined(BUILD_BRIDGE) | |||
| if (isOscControlRegistered()) | |||
| { | |||
| for (uint i=0; i < curPluginCount; ++i) | |||
| oscSend_control_remove_plugin(curPluginCount-i-1); | |||
| } | |||
| # endif | |||
| #endif | |||
| const ScopedActionLock sal(this, kEnginePostActionZeroCount, 0, 0); | |||
| callback(ENGINE_CALLBACK_IDLE, 0, 0, 0, 0, 0.0f, nullptr); | |||
| callback(true, false, ENGINE_CALLBACK_IDLE, 0, 0, 0, 0, 0.0f, nullptr); | |||
| for (uint i=0; i < curPluginCount; ++i) | |||
| { | |||
| @@ -766,8 +744,8 @@ bool CarlaEngine::removeAllPlugins() | |||
| carla_zeroFloats(pluginData.peaks, 4); | |||
| callback(ENGINE_CALLBACK_PLUGIN_REMOVED, id, 0, 0, 0, 0.0f, nullptr); | |||
| callback(ENGINE_CALLBACK_IDLE, 0, 0, 0, 0, 0.0f, nullptr); | |||
| callback(true, true, ENGINE_CALLBACK_PLUGIN_REMOVED, id, 0, 0, 0, 0.0f, nullptr); | |||
| callback(true, false, ENGINE_CALLBACK_IDLE, 0, 0, 0, 0, 0.0f, nullptr); | |||
| } | |||
| return true; | |||
| @@ -1123,7 +1101,7 @@ bool CarlaEngine::loadFile(const char* const filename) | |||
| //nicerName | |||
| if (addPlugin(PLUGIN_INTERNAL, nullptr, nicerName, "zynaddsubfx", 0, nullptr)) | |||
| { | |||
| callback(ENGINE_CALLBACK_UI_STATE_CHANGED, curPluginId, 0, 0, 0, 0.0f, nullptr); | |||
| callback(true, true, ENGINE_CALLBACK_UI_STATE_CHANGED, curPluginId, 0, 0, 0, 0.0f, nullptr); | |||
| if (CarlaPlugin* const plugin = getPlugin(curPluginId)) | |||
| plugin->setCustomData(CUSTOM_DATA_TYPE_STRING, (extension == "xmz") ? "CarlaAlternateFile1" : "CarlaAlternateFile2", filename, true); | |||
| @@ -1313,7 +1291,8 @@ float CarlaEngine::getOutputPeak(const uint pluginId, const bool isLeft) const n | |||
| // ----------------------------------------------------------------------- | |||
| // Callback | |||
| void CarlaEngine::callback(const EngineCallbackOpcode action, const uint pluginId, | |||
| void CarlaEngine::callback(const bool sendHost, const bool sendOsc, | |||
| const EngineCallbackOpcode action, const uint pluginId, | |||
| const int value1, const int value2, const int value3, | |||
| const float valuef, const char* const valueStr) noexcept | |||
| { | |||
| @@ -1326,7 +1305,7 @@ void CarlaEngine::callback(const EngineCallbackOpcode action, const uint pluginI | |||
| action, EngineCallbackOpcode2Str(action), pluginId, value1, value2, value3, valuef, valueStr); | |||
| #endif | |||
| if (pData->callback != nullptr) | |||
| if (sendHost && pData->callback != nullptr) | |||
| { | |||
| if (action == ENGINE_CALLBACK_IDLE) | |||
| ++pData->isIdling; | |||
| @@ -1345,6 +1324,37 @@ void CarlaEngine::callback(const EngineCallbackOpcode action, const uint pluginI | |||
| if (action == ENGINE_CALLBACK_IDLE) | |||
| --pData->isIdling; | |||
| } | |||
| if (sendOsc) | |||
| { | |||
| #if defined(HAVE_LIBLO) && ! defined(BUILD_BRIDGE) | |||
| if (pData->osc.isControlRegistered()) | |||
| { | |||
| #if defined(HAVE_LIBLO) && ! defined(BUILD_BRIDGE) | |||
| switch (action) | |||
| { | |||
| case ENGINE_CALLBACK_PLUGIN_ADDED: | |||
| case ENGINE_CALLBACK_RELOAD_ALL: | |||
| { | |||
| CarlaPlugin* const plugin = pData->plugins[pluginId].plugin; | |||
| CARLA_SAFE_ASSERT_BREAK(plugin != nullptr); | |||
| plugin->registerToOscClient(); | |||
| break; | |||
| } | |||
| case ENGINE_CALLBACK_IDLE: | |||
| return; | |||
| default: | |||
| break; | |||
| } | |||
| #endif | |||
| oscSend_control_callback(action, pluginId, value1, value2, value3, valuef, valueStr); | |||
| } | |||
| #endif | |||
| } | |||
| } | |||
| void CarlaEngine::setCallback(const EngineCallbackFunc func, void* const ptr) noexcept | |||
| @@ -1827,7 +1837,7 @@ void CarlaEngine::bufferSizeChanged(const uint32_t newBufferSize) | |||
| } | |||
| } | |||
| callback(ENGINE_CALLBACK_BUFFER_SIZE_CHANGED, 0, static_cast<int>(newBufferSize), 0, 0, 0.0f, nullptr); | |||
| callback(true, true, ENGINE_CALLBACK_BUFFER_SIZE_CHANGED, 0, static_cast<int>(newBufferSize), 0, 0, 0.0f, nullptr); | |||
| } | |||
| void CarlaEngine::sampleRateChanged(const double newSampleRate) | |||
| @@ -1856,7 +1866,7 @@ void CarlaEngine::sampleRateChanged(const double newSampleRate) | |||
| } | |||
| } | |||
| callback(ENGINE_CALLBACK_SAMPLE_RATE_CHANGED, 0, 0, 0, 0, static_cast<float>(newSampleRate), nullptr); | |||
| callback(true, true, ENGINE_CALLBACK_SAMPLE_RATE_CHANGED, 0, 0, 0, 0, static_cast<float>(newSampleRate), nullptr); | |||
| } | |||
| void CarlaEngine::offlineModeChanged(const bool isOfflineNow) | |||
| @@ -2139,13 +2149,13 @@ bool CarlaEngine::loadProjectInternal(water::XmlDocument& xmlDoc) | |||
| if (! (xmlType.equalsIgnoreCase("carla-project") || isPreset)) | |||
| { | |||
| callback(ENGINE_CALLBACK_PROJECT_LOAD_FINISHED, 0, 0, 0, 0, 0.0f, nullptr); | |||
| callback(true, true, ENGINE_CALLBACK_PROJECT_LOAD_FINISHED, 0, 0, 0, 0, 0.0f, nullptr); | |||
| setLastError("Not a valid Carla project or preset file"); | |||
| return false; | |||
| } | |||
| pData->actionCanceled = false; | |||
| callback(ENGINE_CALLBACK_CANCELABLE_ACTION, 0, 1, 0, 0, 0.0f, "Loading project"); | |||
| callback(true, true, ENGINE_CALLBACK_CANCELABLE_ACTION, 0, 1, 0, 0, 0.0f, "Loading project"); | |||
| #ifndef BUILD_BRIDGE_ALTERNATIVE_ARCH | |||
| const ScopedValueSetter<bool> _svs2(pData->loadingProject, true, false); | |||
| @@ -2155,7 +2165,7 @@ bool CarlaEngine::loadProjectInternal(water::XmlDocument& xmlDoc) | |||
| xmlElement = xmlDoc.getDocumentElement(false); | |||
| CARLA_SAFE_ASSERT_RETURN_ERR(xmlElement != nullptr, "Failed to completely parse project file"); | |||
| callback(ENGINE_CALLBACK_IDLE, 0, 0, 0, 0, 0.0f, nullptr); | |||
| callback(true, false, ENGINE_CALLBACK_IDLE, 0, 0, 0, 0, 0.0f, nullptr); | |||
| if (pData->aboutToClose) | |||
| return true; | |||
| @@ -2280,7 +2290,7 @@ bool CarlaEngine::loadProjectInternal(water::XmlDocument& xmlDoc) | |||
| setOption(static_cast<EngineOption>(option), value, valueStr); | |||
| } | |||
| callback(ENGINE_CALLBACK_IDLE, 0, 0, 0, 0, 0.0f, nullptr); | |||
| callback(true, true, ENGINE_CALLBACK_IDLE, 0, 0, 0, 0, 0.0f, nullptr); | |||
| if (pData->aboutToClose) | |||
| return true; | |||
| @@ -2304,7 +2314,7 @@ bool CarlaEngine::loadProjectInternal(water::XmlDocument& xmlDoc) | |||
| if (bpm >= 20.0 && bpm < 400.0) | |||
| pData->time.setBPM(bpm); | |||
| callback(ENGINE_CALLBACK_IDLE, 0, 0, 0, 0, 0.0f, nullptr); | |||
| callback(true, true, ENGINE_CALLBACK_IDLE, 0, 0, 0, 0, 0.0f, nullptr); | |||
| if (pData->aboutToClose) | |||
| return true; | |||
| @@ -2327,7 +2337,7 @@ bool CarlaEngine::loadProjectInternal(water::XmlDocument& xmlDoc) | |||
| CarlaStateSave stateSave; | |||
| stateSave.fillFromXmlElement(isPreset ? xmlElement.get() : elem); | |||
| callback(ENGINE_CALLBACK_IDLE, 0, 0, 0, 0, 0.0f, nullptr); | |||
| callback(true, true, ENGINE_CALLBACK_IDLE, 0, 0, 0, 0, 0.0f, nullptr); | |||
| if (pData->aboutToClose) | |||
| return true; | |||
| @@ -2351,7 +2361,7 @@ bool CarlaEngine::loadProjectInternal(water::XmlDocument& xmlDoc) | |||
| if (CarlaPlugin* const plugin = pData->plugins[pluginId].plugin) | |||
| { | |||
| callback(ENGINE_CALLBACK_IDLE, 0, 0, 0, 0, 0.0f, nullptr); | |||
| callback(true, true, ENGINE_CALLBACK_IDLE, 0, 0, 0, 0, 0.0f, nullptr); | |||
| if (pData->aboutToClose) | |||
| return true; | |||
| @@ -2380,11 +2390,10 @@ bool CarlaEngine::loadProjectInternal(water::XmlDocument& xmlDoc) | |||
| plugin->setPanning(stateSave.panning, true, true); | |||
| plugin->setCtrlChannel(stateSave.ctrlChannel, true, true); | |||
| plugin->setActive(stateSave.active, true, true); | |||
| plugin->setEnabled(true); | |||
| ++pData->curPluginCount; | |||
| plugin->setEnabled(true); | |||
| callback(ENGINE_CALLBACK_PLUGIN_ADDED, pluginId, 0, 0, 0, 0.0f, plugin->getName()); | |||
| callback(true, true, ENGINE_CALLBACK_PLUGIN_ADDED, pluginId, 0, 0, 0, 0.0f, plugin->getName()); | |||
| if (pData->options.processMode == ENGINE_PROCESS_MODE_PATCHBAY) | |||
| pData->graph.addPlugin(plugin); | |||
| @@ -2502,7 +2511,7 @@ bool CarlaEngine::loadProjectInternal(water::XmlDocument& xmlDoc) | |||
| if (CarlaPlugin* const plugin = pData->plugins[pluginId].plugin) | |||
| { | |||
| callback(ENGINE_CALLBACK_IDLE, 0, 0, 0, 0, 0.0f, nullptr); | |||
| callback(true, true, ENGINE_CALLBACK_IDLE, 0, 0, 0, 0, 0.0f, nullptr); | |||
| if (pData->aboutToClose) | |||
| return true; | |||
| @@ -2526,7 +2535,7 @@ bool CarlaEngine::loadProjectInternal(water::XmlDocument& xmlDoc) | |||
| plugin->setEnabled(true); | |||
| ++pData->curPluginCount; | |||
| callback(ENGINE_CALLBACK_PLUGIN_ADDED, pluginId, 0, 0, 0, 0.0f, plugin->getName()); | |||
| callback(true, true, ENGINE_CALLBACK_PLUGIN_ADDED, pluginId, 0, 0, 0, 0.0f, plugin->getName()); | |||
| #ifndef BUILD_BRIDGE_ALTERNATIVE_ARCH | |||
| if (pData->options.processMode == ENGINE_PROCESS_MODE_PATCHBAY) | |||
| @@ -2546,8 +2555,8 @@ bool CarlaEngine::loadProjectInternal(water::XmlDocument& xmlDoc) | |||
| if (isPreset) | |||
| { | |||
| callback(ENGINE_CALLBACK_PROJECT_LOAD_FINISHED, 0, 0, 0, 0, 0.0f, nullptr); | |||
| callback(ENGINE_CALLBACK_CANCELABLE_ACTION, 0, 0, 0, 0, 0.0f, "Loading project"); | |||
| callback(true, true, ENGINE_CALLBACK_PROJECT_LOAD_FINISHED, 0, 0, 0, 0, 0.0f, nullptr); | |||
| callback(true, true, ENGINE_CALLBACK_CANCELABLE_ACTION, 0, 0, 0, 0, 0.0f, "Loading project"); | |||
| return true; | |||
| } | |||
| } | |||
| @@ -2562,7 +2571,7 @@ bool CarlaEngine::loadProjectInternal(water::XmlDocument& xmlDoc) | |||
| plugin->setCustomData(CUSTOM_DATA_TYPE_STRING, "__CarlaPingOnOff__", "true", false); | |||
| } | |||
| callback(ENGINE_CALLBACK_IDLE, 0, 0, 0, 0, 0.0f, nullptr); | |||
| callback(true, true, ENGINE_CALLBACK_IDLE, 0, 0, 0, 0, 0.0f, nullptr); | |||
| if (pData->aboutToClose) | |||
| return true; | |||
| @@ -2610,7 +2619,7 @@ bool CarlaEngine::loadProjectInternal(water::XmlDocument& xmlDoc) | |||
| restorePatchbayConnection(false, sourcePort, targetPort, !isUsingExternal); | |||
| } | |||
| callback(ENGINE_CALLBACK_IDLE, 0, 0, 0, 0, 0.0f, nullptr); | |||
| callback(true, true, ENGINE_CALLBACK_IDLE, 0, 0, 0, 0, 0.0f, nullptr); | |||
| if (pData->aboutToClose) | |||
| return true; | |||
| @@ -2692,8 +2701,8 @@ bool CarlaEngine::loadProjectInternal(water::XmlDocument& xmlDoc) | |||
| } | |||
| #endif | |||
| callback(ENGINE_CALLBACK_PROJECT_LOAD_FINISHED, 0, 0, 0, 0, 0.0f, nullptr); | |||
| callback(ENGINE_CALLBACK_CANCELABLE_ACTION, 0, 0, 0, 0, 0.0f, "Loading project"); | |||
| callback(true, true, ENGINE_CALLBACK_PROJECT_LOAD_FINISHED, 0, 0, 0, 0, 0.0f, nullptr); | |||
| callback(true, true, ENGINE_CALLBACK_CANCELABLE_ACTION, 0, 0, 0, 0, 0.0f, "Loading project"); | |||
| return true; | |||
| } | |||
| @@ -576,15 +576,16 @@ public: | |||
| { | |||
| carla_stderr("Did not receive ping message from server for 30 secs, closing..."); | |||
| signalThreadShouldExit(); | |||
| callback(ENGINE_CALLBACK_QUIT, 0, 0, 0, 0, 0.0f, nullptr); | |||
| callback(true, true, ENGINE_CALLBACK_QUIT, 0, 0, 0, 0, 0.0f, nullptr); | |||
| } | |||
| } | |||
| void callback(const EngineCallbackOpcode action, const uint pluginId, | |||
| void callback(const bool sendHost, const bool sendOsc, | |||
| const EngineCallbackOpcode action, const uint pluginId, | |||
| const int value1, const int value2, const int value3, | |||
| const float valuef, const char* const valueStr) noexcept override | |||
| { | |||
| CarlaEngine::callback(action, pluginId, value1, value2, value3, valuef, valueStr); | |||
| CarlaEngine::callback(sendHost, sendOsc, action, pluginId, value1, value2, value3, valuef, valueStr); | |||
| if (fClosingDown) | |||
| return; | |||
| @@ -1022,7 +1023,7 @@ public: | |||
| case kPluginBridgeNonRtClientQuit: | |||
| fClosingDown = true; | |||
| signalThreadShouldExit(); | |||
| callback(ENGINE_CALLBACK_QUIT, 0, 0, 0, 0, 0.0f, nullptr); | |||
| callback(true, true, ENGINE_CALLBACK_QUIT, 0, 0, 0, 0, 0.0f, nullptr); | |||
| break; | |||
| } | |||
| } | |||
| @@ -1369,7 +1370,7 @@ protected: | |||
| } | |||
| } | |||
| callback(ENGINE_CALLBACK_ENGINE_STOPPED, 0, 0, 0, 0, 0.0f, nullptr); | |||
| callback(true, true, ENGINE_CALLBACK_ENGINE_STOPPED, 0, 0, 0, 0, 0.0f, nullptr); | |||
| if (! quitReceived) | |||
| { | |||
| @@ -220,8 +220,7 @@ bool ExternalGraph::connect(const uint groupA, const uint portA, const uint grou | |||
| strBuf[STR_MAX] = '\0'; | |||
| std::snprintf(strBuf, STR_MAX, "%u:%u:%u:%u", groupA, portA, groupB, portB); | |||
| if (sendCallback) | |||
| kEngine->callback(ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, connectionToId.id, 0, 0, 0, 0.0f, strBuf); | |||
| kEngine->callback(sendCallback, true, ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, connectionToId.id, 0, 0, 0, 0.0f, strBuf); | |||
| connections.list.append(connectionToId); | |||
| return true; | |||
| @@ -300,7 +299,7 @@ bool ExternalGraph::disconnect(const uint connectionId) noexcept | |||
| return false; | |||
| } | |||
| kEngine->callback(ENGINE_CALLBACK_PATCHBAY_CONNECTION_REMOVED, connectionToId.id, 0, 0, 0, 0.0f, nullptr); | |||
| kEngine->callback(true, true, ENGINE_CALLBACK_PATCHBAY_CONNECTION_REMOVED, connectionToId.id, 0, 0, 0, 0.0f, nullptr); | |||
| connections.list.remove(it); | |||
| return true; | |||
| @@ -318,7 +317,8 @@ void ExternalGraph::refresh(const char* const deviceName) | |||
| // Main | |||
| { | |||
| kEngine->callback(ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED, | |||
| kEngine->callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED, | |||
| kExternalGraphGroupCarla, | |||
| PATCHBAY_ICON_CARLA, | |||
| MAIN_CARLA_PLUGIN_ID, | |||
| @@ -327,28 +327,32 @@ void ExternalGraph::refresh(const char* const deviceName) | |||
| if (isRack) | |||
| { | |||
| kEngine->callback(ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, | |||
| kEngine->callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, | |||
| kExternalGraphGroupCarla, | |||
| kExternalGraphCarlaPortAudioIn1, | |||
| PATCHBAY_PORT_TYPE_AUDIO|PATCHBAY_PORT_IS_INPUT, | |||
| 0, 0.0f, | |||
| "audio-in1"); | |||
| kEngine->callback(ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, | |||
| kEngine->callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, | |||
| kExternalGraphGroupCarla, | |||
| kExternalGraphCarlaPortAudioIn2, | |||
| PATCHBAY_PORT_TYPE_AUDIO|PATCHBAY_PORT_IS_INPUT, | |||
| 0, 0.0f, | |||
| "audio-in2"); | |||
| kEngine->callback(ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, | |||
| kEngine->callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, | |||
| kExternalGraphGroupCarla, | |||
| kExternalGraphCarlaPortAudioOut1, | |||
| PATCHBAY_PORT_TYPE_AUDIO, | |||
| 0, 0.0f, | |||
| "audio-out1"); | |||
| kEngine->callback(ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, | |||
| kEngine->callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, | |||
| kExternalGraphGroupCarla, | |||
| kExternalGraphCarlaPortAudioOut2, | |||
| PATCHBAY_PORT_TYPE_AUDIO, | |||
| @@ -356,14 +360,16 @@ void ExternalGraph::refresh(const char* const deviceName) | |||
| "audio-out2"); | |||
| } | |||
| kEngine->callback(ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, | |||
| kEngine->callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, | |||
| kExternalGraphGroupCarla, | |||
| kExternalGraphCarlaPortMidiIn, | |||
| PATCHBAY_PORT_TYPE_MIDI|PATCHBAY_PORT_IS_INPUT, | |||
| 0, 0.0f, | |||
| "midi-in"); | |||
| kEngine->callback(ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, | |||
| kEngine->callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, | |||
| kExternalGraphGroupCarla, | |||
| kExternalGraphCarlaPortMidiOut, | |||
| PATCHBAY_PORT_TYPE_MIDI, | |||
| @@ -382,7 +388,8 @@ void ExternalGraph::refresh(const char* const deviceName) | |||
| else | |||
| std::strncpy(strBuf, "Capture", STR_MAX); | |||
| kEngine->callback(ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED, | |||
| kEngine->callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED, | |||
| kExternalGraphGroupAudioIn, | |||
| PATCHBAY_ICON_HARDWARE, | |||
| -1, | |||
| @@ -399,7 +406,8 @@ void ExternalGraph::refresh(const char* const deviceName) | |||
| portNameToId.setFullName(groupNameIn + portNameToId.name); | |||
| kEngine->callback(ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, | |||
| kEngine->callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, | |||
| kExternalGraphGroupAudioIn, | |||
| ++h, | |||
| PATCHBAY_PORT_TYPE_AUDIO, | |||
| @@ -413,7 +421,8 @@ void ExternalGraph::refresh(const char* const deviceName) | |||
| else | |||
| std::strncpy(strBuf, "Playback", STR_MAX); | |||
| kEngine->callback(ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED, | |||
| kEngine->callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED, | |||
| kExternalGraphGroupAudioOut, | |||
| PATCHBAY_ICON_HARDWARE, | |||
| -1, | |||
| @@ -430,7 +439,8 @@ void ExternalGraph::refresh(const char* const deviceName) | |||
| portNameToId.setFullName(groupNameOut + portNameToId.name); | |||
| kEngine->callback(ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, | |||
| kEngine->callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, | |||
| kExternalGraphGroupAudioOut, | |||
| ++h, | |||
| PATCHBAY_PORT_TYPE_AUDIO|PATCHBAY_PORT_IS_INPUT, | |||
| @@ -441,7 +451,8 @@ void ExternalGraph::refresh(const char* const deviceName) | |||
| // MIDI In | |||
| { | |||
| kEngine->callback(ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED, | |||
| kEngine->callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED, | |||
| kExternalGraphGroupMidiIn, | |||
| PATCHBAY_ICON_HARDWARE, | |||
| -1, | |||
| @@ -458,7 +469,8 @@ void ExternalGraph::refresh(const char* const deviceName) | |||
| portNameToId.setFullName(groupNamePlus + portNameToId.name); | |||
| kEngine->callback(ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, | |||
| kEngine->callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, | |||
| kExternalGraphGroupMidiIn, | |||
| ++h, | |||
| PATCHBAY_PORT_TYPE_MIDI, | |||
| @@ -469,7 +481,8 @@ void ExternalGraph::refresh(const char* const deviceName) | |||
| // MIDI Out | |||
| { | |||
| kEngine->callback(ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED, | |||
| kEngine->callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED, | |||
| kExternalGraphGroupMidiOut, | |||
| PATCHBAY_ICON_HARDWARE, | |||
| -1, | |||
| @@ -486,7 +499,8 @@ void ExternalGraph::refresh(const char* const deviceName) | |||
| portNameToId.setFullName(groupNamePlus + portNameToId.name); | |||
| kEngine->callback(ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, | |||
| kEngine->callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, | |||
| kExternalGraphGroupMidiOut, | |||
| ++h, | |||
| PATCHBAY_PORT_TYPE_MIDI|PATCHBAY_PORT_IS_INPUT, | |||
| @@ -788,7 +802,8 @@ void RackGraph::refresh(const char* const deviceName) | |||
| std::snprintf(strBuf, STR_MAX, "%i:%i:%i:%i", connectionToId.groupA, connectionToId.portA, connectionToId.groupB, connectionToId.portB); | |||
| kEngine->callback(ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, | |||
| kEngine->callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, | |||
| connectionToId.id, | |||
| 0, 0, 0, 0.0f, | |||
| strBuf); | |||
| @@ -807,7 +822,8 @@ void RackGraph::refresh(const char* const deviceName) | |||
| std::snprintf(strBuf, STR_MAX, "%i:%i:%i:%i", connectionToId.groupA, connectionToId.portA, connectionToId.groupB, connectionToId.portB); | |||
| kEngine->callback(ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, | |||
| kEngine->callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, | |||
| connectionToId.id, | |||
| 0, 0, 0, 0.0f, | |||
| strBuf); | |||
| @@ -826,7 +842,8 @@ void RackGraph::refresh(const char* const deviceName) | |||
| std::snprintf(strBuf, STR_MAX, "%i:%i:%i:%i", connectionToId.groupA, connectionToId.portA, connectionToId.groupB, connectionToId.portB); | |||
| kEngine->callback(ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, | |||
| kEngine->callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, | |||
| connectionToId.id, | |||
| 0, 0, 0, 0.0f, | |||
| strBuf); | |||
| @@ -845,7 +862,8 @@ void RackGraph::refresh(const char* const deviceName) | |||
| std::snprintf(strBuf, STR_MAX, "%i:%i:%i:%i", connectionToId.groupA, connectionToId.portA, connectionToId.groupB, connectionToId.portB); | |||
| kEngine->callback(ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, | |||
| kEngine->callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, | |||
| connectionToId.id, | |||
| 0, 0, 0, 0.0f, | |||
| strBuf); | |||
| @@ -1176,7 +1194,8 @@ void addNodeToPatchbay(CarlaEngine* const engine, const uint32_t groupId, const | |||
| CARLA_SAFE_ASSERT_RETURN(engine != nullptr,); | |||
| CARLA_SAFE_ASSERT_RETURN(proc != nullptr,); | |||
| engine->callback(ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED, | |||
| engine->callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED, | |||
| groupId, | |||
| clientId >= 0 ? PATCHBAY_ICON_PLUGIN : PATCHBAY_ICON_HARDWARE, | |||
| clientId, | |||
| @@ -1185,7 +1204,8 @@ void addNodeToPatchbay(CarlaEngine* const engine, const uint32_t groupId, const | |||
| for (int i=0, numInputs=proc->getTotalNumInputChannels(); i<numInputs; ++i) | |||
| { | |||
| engine->callback(ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, | |||
| engine->callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, | |||
| groupId, | |||
| static_cast<int>(kAudioInputPortOffset)+i, | |||
| PATCHBAY_PORT_TYPE_AUDIO|PATCHBAY_PORT_IS_INPUT, | |||
| @@ -1195,7 +1215,8 @@ void addNodeToPatchbay(CarlaEngine* const engine, const uint32_t groupId, const | |||
| for (int i=0, numOutputs=proc->getTotalNumOutputChannels(); i<numOutputs; ++i) | |||
| { | |||
| engine->callback(ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, | |||
| engine->callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, | |||
| groupId, | |||
| static_cast<int>(kAudioOutputPortOffset)+i, | |||
| PATCHBAY_PORT_TYPE_AUDIO, | |||
| @@ -1205,7 +1226,8 @@ void addNodeToPatchbay(CarlaEngine* const engine, const uint32_t groupId, const | |||
| if (proc->acceptsMidi()) | |||
| { | |||
| engine->callback(ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, | |||
| engine->callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, | |||
| groupId, | |||
| static_cast<int>(kMidiInputPortOffset), | |||
| PATCHBAY_PORT_TYPE_MIDI|PATCHBAY_PORT_IS_INPUT, | |||
| @@ -1215,7 +1237,8 @@ void addNodeToPatchbay(CarlaEngine* const engine, const uint32_t groupId, const | |||
| if (proc->producesMidi()) | |||
| { | |||
| engine->callback(ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, | |||
| engine->callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, | |||
| groupId, | |||
| static_cast<int>(kMidiOutputPortOffset), | |||
| PATCHBAY_PORT_TYPE_MIDI, | |||
| @@ -1232,7 +1255,8 @@ void removeNodeFromPatchbay(CarlaEngine* const engine, const uint32_t groupId, c | |||
| for (int i=0, numInputs=proc->getTotalNumInputChannels(); i<numInputs; ++i) | |||
| { | |||
| engine->callback(ENGINE_CALLBACK_PATCHBAY_PORT_REMOVED, | |||
| engine->callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_PORT_REMOVED, | |||
| groupId, | |||
| static_cast<int>(kAudioInputPortOffset)+i, | |||
| 0, 0, 0.0f, nullptr); | |||
| @@ -1240,7 +1264,8 @@ void removeNodeFromPatchbay(CarlaEngine* const engine, const uint32_t groupId, c | |||
| for (int i=0, numOutputs=proc->getTotalNumOutputChannels(); i<numOutputs; ++i) | |||
| { | |||
| engine->callback(ENGINE_CALLBACK_PATCHBAY_PORT_REMOVED, | |||
| engine->callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_PORT_REMOVED, | |||
| groupId, | |||
| static_cast<int>(kAudioOutputPortOffset)+i, | |||
| 0, 0, 0.0f, | |||
| @@ -1249,7 +1274,8 @@ void removeNodeFromPatchbay(CarlaEngine* const engine, const uint32_t groupId, c | |||
| if (proc->acceptsMidi()) | |||
| { | |||
| engine->callback(ENGINE_CALLBACK_PATCHBAY_PORT_REMOVED, | |||
| engine->callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_PORT_REMOVED, | |||
| groupId, | |||
| static_cast<int>(kMidiInputPortOffset), | |||
| 0, 0, 0.0f, nullptr); | |||
| @@ -1257,13 +1283,15 @@ void removeNodeFromPatchbay(CarlaEngine* const engine, const uint32_t groupId, c | |||
| if (proc->producesMidi()) | |||
| { | |||
| engine->callback(ENGINE_CALLBACK_PATCHBAY_PORT_REMOVED, | |||
| engine->callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_PORT_REMOVED, | |||
| groupId, | |||
| static_cast<int>(kMidiOutputPortOffset), | |||
| 0, 0, 0.0f, nullptr); | |||
| } | |||
| engine->callback(ENGINE_CALLBACK_PATCHBAY_CLIENT_REMOVED, | |||
| engine->callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_CLIENT_REMOVED, | |||
| groupId, | |||
| 0, 0, 0, 0.0f, nullptr); | |||
| } | |||
| @@ -1621,7 +1649,8 @@ void PatchbayGraph::renamePlugin(CarlaPlugin* const plugin, const char* const ne | |||
| CARLA_SAFE_ASSERT_RETURN(node != nullptr,); | |||
| if (! usingExternal) | |||
| kEngine->callback(ENGINE_CALLBACK_PATCHBAY_CLIENT_RENAMED, | |||
| kEngine->callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_CLIENT_RENAMED, | |||
| node->nodeId, | |||
| 0, 0, 0, 0.0f, | |||
| newName); | |||
| @@ -1710,7 +1739,8 @@ bool PatchbayGraph::connect(const bool external, const uint groupA, const uint p | |||
| std::snprintf(strBuf, STR_MAX, "%u:%u:%u:%u", groupA, portA, groupB, portB); | |||
| if (sendCallback) | |||
| kEngine->callback(ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, | |||
| kEngine->callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, | |||
| connectionToId.id, | |||
| 0, 0, 0, 0.0f, | |||
| strBuf); | |||
| @@ -1746,7 +1776,8 @@ bool PatchbayGraph::disconnect(const uint connectionId) | |||
| connectionToId.groupB, static_cast<int>(adjustedPortB))) | |||
| return false; | |||
| kEngine->callback(ENGINE_CALLBACK_PATCHBAY_CONNECTION_REMOVED, | |||
| kEngine->callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_CONNECTION_REMOVED, | |||
| connectionToId.id, | |||
| 0, 0, 0, 0.0f, | |||
| nullptr); | |||
| @@ -1787,7 +1818,8 @@ void PatchbayGraph::disconnectInternalGroup(const uint groupId) noexcept | |||
| */ | |||
| if (! usingExternal) | |||
| kEngine->callback(ENGINE_CALLBACK_PATCHBAY_CONNECTION_REMOVED, | |||
| kEngine->callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_CONNECTION_REMOVED, | |||
| connectionToId.id, | |||
| 0, 0, 0, 0.0f, | |||
| nullptr); | |||
| @@ -1854,7 +1886,8 @@ void PatchbayGraph::refresh(const char* const deviceName) | |||
| std::snprintf(strBuf, STR_MAX, "%i:%i:%i:%i", groupA, portA, groupB, portB); | |||
| kEngine->callback(ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, | |||
| kEngine->callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, | |||
| connectionToId.id, | |||
| 0, 0, 0, 0.0f, | |||
| strBuf); | |||
| @@ -1032,7 +1032,8 @@ public: | |||
| } | |||
| startThread(); | |||
| callback(ENGINE_CALLBACK_ENGINE_STARTED, 0, | |||
| callback(true, true, | |||
| ENGINE_CALLBACK_ENGINE_STARTED, 0, | |||
| opts.processMode, | |||
| opts.transportMode, | |||
| static_cast<int>(pData->bufferSize), | |||
| @@ -1193,7 +1194,8 @@ public: | |||
| else | |||
| { | |||
| // jack transport cannot be disabled in multi-client | |||
| callback(ENGINE_CALLBACK_TRANSPORT_MODE_CHANGED, 0, | |||
| callback(true, true, | |||
| ENGINE_CALLBACK_TRANSPORT_MODE_CHANGED, 0, | |||
| ENGINE_TRANSPORT_MODE_JACK, | |||
| 0, 0, 0.0f, | |||
| pData->options.transportExtra); | |||
| @@ -1360,7 +1362,8 @@ public: | |||
| if (connectionToId.groupA != groupId && connectionToId.groupB != groupId) | |||
| continue; | |||
| callback(ENGINE_CALLBACK_PATCHBAY_CONNECTION_REMOVED, | |||
| callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_CONNECTION_REMOVED, | |||
| connectionToId.id, | |||
| 0, 0, 0, 0.0f, nullptr); | |||
| fUsedConnections.list.remove(it2); | |||
| @@ -1374,7 +1377,8 @@ public: | |||
| if (portNameToId.group != groupId) | |||
| continue; | |||
| callback(ENGINE_CALLBACK_PATCHBAY_PORT_REMOVED, | |||
| callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_PORT_REMOVED, | |||
| portNameToId.group, | |||
| static_cast<int>(portNameToId.port), | |||
| 0, 0, 0.0f, nullptr); | |||
| @@ -1971,7 +1975,7 @@ protected: | |||
| GroupNameToId groupNameToId; | |||
| groupNameToId.setData(groupId, name); | |||
| callback(ENGINE_CALLBACK_PATCHBAY_CLIENT_REMOVED, groupNameToId.group, 0, 0, 0, 0.0f, nullptr); | |||
| callback(true, true, ENGINE_CALLBACK_PATCHBAY_CLIENT_REMOVED, groupNameToId.group, 0, 0, 0, 0.0f, nullptr); | |||
| fUsedGroups.list.removeOne(groupNameToId); | |||
| } | |||
| @@ -2008,7 +2012,8 @@ protected: | |||
| GroupNameToId groupNameToId; | |||
| groupNameToId.setData(groupId, groupName); | |||
| callback(ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED, | |||
| callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED, | |||
| groupNameToId.group, | |||
| (jackPortFlags & JackPortIsPhysical) ? PATCHBAY_ICON_HARDWARE : PATCHBAY_ICON_APPLICATION, | |||
| -1, | |||
| @@ -2029,7 +2034,8 @@ protected: | |||
| See the comment on CarlaEngineJack::renamePlugin() for more information. */ | |||
| if (portNameToId.group <= 0 || portNameToId.port <= 0) return; | |||
| callback(ENGINE_CALLBACK_PATCHBAY_PORT_REMOVED, | |||
| callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_PORT_REMOVED, | |||
| portNameToId.group, | |||
| static_cast<int>(portNameToId.port), | |||
| 0, 0, 0.0f, nullptr); | |||
| @@ -2071,7 +2077,8 @@ protected: | |||
| ConnectionToId connectionToId; | |||
| connectionToId.setData(++fUsedConnections.lastId, portNameToIdA.group, portNameToIdA.port, portNameToIdB.group, portNameToIdB.port); | |||
| callback(ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, | |||
| callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, | |||
| connectionToId.id, | |||
| 0, 0, 0, 0.0f, | |||
| strBuf); | |||
| @@ -2101,7 +2108,8 @@ protected: | |||
| } | |||
| if (found) { | |||
| callback(ENGINE_CALLBACK_PATCHBAY_CONNECTION_REMOVED, | |||
| callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_CONNECTION_REMOVED, | |||
| connectionToId.id, | |||
| 0, 0, 0, 0.0f, nullptr); | |||
| } | |||
| @@ -2143,7 +2151,8 @@ protected: | |||
| CARLA_SAFE_ASSERT_CONTINUE(portNameToId.group == groupId); | |||
| portNameToId.rename(shortPortName, newFullName); | |||
| callback(ENGINE_CALLBACK_PATCHBAY_PORT_RENAMED, | |||
| callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_PORT_RENAMED, | |||
| portNameToId.group, | |||
| static_cast<int>(portNameToId.port), | |||
| 0, 0, 0.0f, | |||
| @@ -2180,7 +2189,7 @@ protected: | |||
| carla_zeroPointers(fRackPorts, kRackPortCount); | |||
| #endif | |||
| callback(ENGINE_CALLBACK_QUIT, 0, 0, 0, 0, 0.0f, nullptr); | |||
| callback(true, true, ENGINE_CALLBACK_QUIT, 0, 0, 0, 0, 0.0f, nullptr); | |||
| } | |||
| // ------------------------------------------------------------------- | |||
| @@ -2197,7 +2206,7 @@ protected: | |||
| //if (pData->nextAction.pluginId == plugin->getId()) | |||
| // pData->nextAction.clearAndReset(); | |||
| callback(ENGINE_CALLBACK_PLUGIN_UNAVAILABLE, plugin->getId(), 0, 0, 0, 0.0f, "Killed by JACK"); | |||
| callback(true, true, ENGINE_CALLBACK_PLUGIN_UNAVAILABLE, plugin->getId(), 0, 0, 0, 0.0f, "Killed by JACK"); | |||
| } | |||
| // ------------------------------------------------------------------- | |||
| @@ -2301,7 +2310,8 @@ private: | |||
| GroupNameToId groupNameToId; | |||
| groupNameToId.setData(++fUsedGroups.lastId, ourName); | |||
| callback(ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED, | |||
| callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED, | |||
| groupNameToId.group, | |||
| PATCHBAY_ICON_CARLA, | |||
| -1, | |||
| @@ -2352,7 +2362,8 @@ private: | |||
| GroupNameToId groupNameToId; | |||
| groupNameToId.setData(groupId, groupName); | |||
| callback(ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED, | |||
| callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED, | |||
| groupNameToId.group, | |||
| icon, | |||
| pluginId, | |||
| @@ -2403,7 +2414,8 @@ private: | |||
| ConnectionToId connectionToId; | |||
| connectionToId.setData(++fUsedConnections.lastId, thisPort.group, thisPort.port, targetPort.group, targetPort.port); | |||
| callback(ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, | |||
| callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, | |||
| connectionToId.id, | |||
| 0, 0, 0, 0.0f, | |||
| strBuf); | |||
| @@ -2456,7 +2468,8 @@ private: | |||
| PortNameToId portNameToId; | |||
| portNameToId.setData(groupId, ++fUsedPorts.lastId, shortPortName, fullPortName); | |||
| callback(ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, | |||
| callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_PORT_ADDED, | |||
| portNameToId.group, | |||
| static_cast<int>(portNameToId.port), | |||
| static_cast<int>(canvasPortFlags), | |||
| @@ -2628,7 +2641,8 @@ private: | |||
| PatchbayIcon icon = PATCHBAY_ICON_PLUGIN; | |||
| if (findPluginIdAndIcon(groupName, pluginId, icon)) { | |||
| callback(ENGINE_CALLBACK_PATCHBAY_CLIENT_DATA_CHANGED, | |||
| callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_CLIENT_DATA_CHANGED, | |||
| groupId, | |||
| icon, | |||
| pluginId, | |||
| @@ -227,7 +227,8 @@ public: | |||
| if (pData->options.processMode == ENGINE_PROCESS_MODE_PATCHBAY) | |||
| refreshExternalGraphPorts<PatchbayGraph>(pData->graph.getPatchbayGraph(), false); | |||
| callback(ENGINE_CALLBACK_ENGINE_STARTED, | |||
| callback(true, true, | |||
| ENGINE_CALLBACK_ENGINE_STARTED, | |||
| 0, | |||
| pData->options.processMode, | |||
| pData->options.transportMode, | |||
| @@ -438,7 +439,8 @@ public: | |||
| std::snprintf(strBuf, STR_MAX-1, "%i:%i:%i:%i", connectionToId.groupA, connectionToId.portA, connectionToId.groupB, connectionToId.portB); | |||
| strBuf[STR_MAX-1] = '\0'; | |||
| callback(ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, | |||
| callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, | |||
| connectionToId.id, | |||
| 0, 0, 0, 0.0f, | |||
| strBuf); | |||
| @@ -462,7 +464,8 @@ public: | |||
| std::snprintf(strBuf, STR_MAX-1, "%i:%i:%i:%i", connectionToId.groupA, connectionToId.portA, connectionToId.groupB, connectionToId.portB); | |||
| strBuf[STR_MAX-1] = '\0'; | |||
| callback(ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, | |||
| callback(true, true, | |||
| ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, | |||
| connectionToId.id, | |||
| 0, 0, 0, 0.0f, | |||
| strBuf); | |||
| @@ -622,7 +625,7 @@ protected: | |||
| void audioDeviceError(const juce::String& errorMessage) override | |||
| { | |||
| callback(ENGINE_CALLBACK_ERROR, 0, 0, 0, 0, 0.0f, errorMessage.toRawUTF8()); | |||
| callback(true, true, ENGINE_CALLBACK_ERROR, 0, 0, 0, 0, 0.0f, errorMessage.toRawUTF8()); | |||
| } | |||
| // ------------------------------------------------------------------- | |||
| @@ -650,7 +650,8 @@ private: | |||
| void _updateParamValues(CarlaPlugin* const plugin, const uint32_t pluginId) const noexcept | |||
| { | |||
| for (uint32_t i=0, count=plugin->getParameterCount(); i<count; ++i) { | |||
| fEngine->callback(ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED, | |||
| fEngine->callback(true, true, | |||
| ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED, | |||
| pluginId, | |||
| static_cast<int>(i), | |||
| 0, 0, | |||
| @@ -819,11 +820,12 @@ protected: | |||
| return "Plugin"; | |||
| } | |||
| void callback(const EngineCallbackOpcode action, const uint pluginId, | |||
| void callback(const bool sendHost, const bool sendOsc, | |||
| const EngineCallbackOpcode action, const uint pluginId, | |||
| const int value1, const int value2, const int value3, | |||
| const float valuef, const char* const valueStr) noexcept override | |||
| { | |||
| CarlaEngine::callback(action, pluginId, value1, value2, value3, valuef, valueStr); | |||
| CarlaEngine::callback(sendHost, sendOsc, action, pluginId, value1, value2, value3, valuef, valueStr); | |||
| if (action == ENGINE_CALLBACK_IDLE && ! pData->aboutToClose) { | |||
| pHost->dispatcher(pHost->handle, | |||
| @@ -1968,7 +1970,7 @@ protected: | |||
| { | |||
| // remove all plugins from UI side | |||
| for (uint i=0, count=pData->curPluginCount; i < count; ++i) | |||
| CarlaEngine::callback(ENGINE_CALLBACK_PLUGIN_REMOVED, count-i-1, 0, 0, 0, 0.0f, nullptr); | |||
| CarlaEngine::callback(true, true, ENGINE_CALLBACK_PLUGIN_REMOVED, count-i-1, 0, 0, 0, 0.0f, nullptr); | |||
| // remove all plugins from backend, no lock | |||
| fIsRunning = false; | |||
| @@ -398,10 +398,23 @@ int CarlaEngineOsc::handleMsgRegister(const bool isTCP, const int argc, const lo | |||
| for (uint i=0, count=fEngine->getCurrentPluginCount(); i < count; ++i) | |||
| { | |||
| CarlaPlugin* const plugin(fEngine->getPluginUnchecked(i)); | |||
| CARLA_SAFE_ASSERT_CONTINUE(plugin != nullptr); | |||
| if (plugin != nullptr && plugin->isEnabled()) | |||
| plugin->registerToOscClient(); | |||
| fEngine->callback(false, true, ENGINE_CALLBACK_PLUGIN_ADDED, i, 0, 0, 0, 0.0f, plugin->getName()); | |||
| } | |||
| const EngineOptions& opts(fEngine->getOptions()); | |||
| fEngine->callback(false, true, | |||
| ENGINE_CALLBACK_ENGINE_STARTED, 0, | |||
| opts.processMode, | |||
| opts.transportMode, | |||
| static_cast<int>(fEngine->getBufferSize()), | |||
| static_cast<float>(fEngine->getSampleRate()), | |||
| fEngine->getCurrentDriverName()); | |||
| // TODO | |||
| // fEngine->patchbayRefresh(); | |||
| } | |||
| lo_address_free(addr); | |||
| @@ -28,6 +28,26 @@ CARLA_BACKEND_START_NAMESPACE | |||
| // ----------------------------------------------------------------------- | |||
| #ifndef BUILD_BRIDGE | |||
| void CarlaEngine::oscSend_control_callback(const EngineCallbackOpcode action, const uint pluginId, | |||
| const int value1, const int value2, const int value3, | |||
| const float valuef, const char* const valueStr) 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_callback(%i:%s, %i, %i, %i, %i, %f, \"%s\")", | |||
| action, EngineCallbackOpcode2Str(action), pluginId, value1, value2, value3, valuef, valueStr); | |||
| static const char* const kFakeNullString = "(null)"; | |||
| char targetPath[std::strlen(pData->oscData->path)+10]; | |||
| std::strcpy(targetPath, pData->oscData->path); | |||
| std::strcat(targetPath, "/callback"); | |||
| try_lo_send(pData->oscData->target, targetPath, "iiiiifs", | |||
| action, pluginId, value1, value2, value3, static_cast<double>(valuef), | |||
| valueStr != nullptr ? valueStr : kFakeNullString); | |||
| } | |||
| void CarlaEngine::oscSend_control_add_plugin_start(const uint pluginId, const char* const pluginName) const noexcept | |||
| { | |||
| CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
| @@ -43,6 +63,7 @@ void CarlaEngine::oscSend_control_add_plugin_start(const uint pluginId, const ch | |||
| try_lo_send(pData->oscData->target, targetPath, "is", static_cast<int32_t>(pluginId), pluginName); | |||
| } | |||
| #if 0 | |||
| void CarlaEngine::oscSend_control_add_plugin_end(const uint pluginId) const noexcept | |||
| { | |||
| CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
| @@ -70,6 +91,7 @@ void CarlaEngine::oscSend_control_remove_plugin(const uint pluginId) const noexc | |||
| std::strcat(targetPath, "/remove_plugin"); | |||
| try_lo_send(pData->oscData->target, targetPath, "i", static_cast<int32_t>(pluginId)); | |||
| } | |||
| #endif | |||
| 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 | |||
| { | |||
| @@ -239,6 +261,7 @@ void CarlaEngine::oscSend_control_set_parameter_ranges2(const uint pluginId, con | |||
| static_cast<double>(stepLarge)); | |||
| } | |||
| #if 0 | |||
| 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,); | |||
| @@ -270,8 +293,9 @@ void CarlaEngine::oscSend_control_set_parameter_midi_channel(const uint pluginId | |||
| 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)); | |||
| } | |||
| #endif | |||
| void CarlaEngine::oscSend_control_set_parameter_value(const uint pluginId, const int32_t index, const float value) const noexcept | |||
| void CarlaEngine::oscSend_control_set_output_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',); | |||
| @@ -279,18 +303,19 @@ void CarlaEngine::oscSend_control_set_parameter_value(const uint pluginId, const | |||
| CARLA_SAFE_ASSERT_RETURN(pluginId <= pData->curPluginCount,); | |||
| CARLA_SAFE_ASSERT_RETURN(index < 50,); | |||
| CARLA_SAFE_ASSERT_RETURN(index != PARAMETER_NULL,); | |||
| carla_debug("CarlaEngine::oscSend_control_set_parameter_value(%i, %i:%s, %f)", pluginId, index, | |||
| carla_debug("CarlaEngine::oscSend_control_set_output_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"); | |||
| std::strcat(targetPath, "/set_output_parameter_value"); | |||
| try_lo_send(pData->oscData->target, targetPath, "iif", | |||
| static_cast<int32_t>(pluginId), | |||
| index, | |||
| static_cast<double>(value)); | |||
| } | |||
| #if 0 | |||
| 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,); | |||
| @@ -338,6 +363,7 @@ void CarlaEngine::oscSend_control_set_current_midi_program(const uint pluginId, | |||
| std::strcat(targetPath, "/set_current_midi_program"); | |||
| try_lo_send(pData->oscData->target, targetPath, "ii", static_cast<int32_t>(pluginId), index); | |||
| } | |||
| #endif | |||
| void CarlaEngine::oscSend_control_set_program_name(const uint pluginId, const uint32_t index, const char* const name) const noexcept | |||
| { | |||
| @@ -371,6 +397,7 @@ void CarlaEngine::oscSend_control_set_midi_program_data(const uint pluginId, con | |||
| 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); | |||
| } | |||
| #if 0 | |||
| 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,); | |||
| @@ -403,6 +430,7 @@ void CarlaEngine::oscSend_control_note_off(const uint pluginId, const uint8_t ch | |||
| 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)); | |||
| } | |||
| #endif | |||
| void CarlaEngine::oscSend_control_set_peaks(const uint pluginId) const noexcept | |||
| { | |||
| @@ -424,6 +452,7 @@ void CarlaEngine::oscSend_control_set_peaks(const uint pluginId) const noexcept | |||
| static_cast<double>(epData.peaks[3])); | |||
| } | |||
| #if 0 | |||
| void CarlaEngine::oscSend_control_exit() const noexcept | |||
| { | |||
| CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,); | |||
| @@ -436,6 +465,7 @@ void CarlaEngine::oscSend_control_exit() const noexcept | |||
| std::strcat(targetPath, "/exit"); | |||
| try_lo_send(pData->oscData->target, targetPath, ""); | |||
| } | |||
| #endif | |||
| #endif // BUILD_BRIDGE | |||
| // ----------------------------------------------------------------------- | |||
| @@ -349,7 +349,8 @@ public: | |||
| if (pData->options.processMode == ENGINE_PROCESS_MODE_PATCHBAY) | |||
| refreshExternalGraphPorts<PatchbayGraph>(pData->graph.getPatchbayGraph(), false); | |||
| callback(ENGINE_CALLBACK_ENGINE_STARTED, | |||
| callback(true, true, | |||
| ENGINE_CALLBACK_ENGINE_STARTED, | |||
| 0, | |||
| pData->options.processMode, | |||
| pData->options.transportMode, | |||
| @@ -555,12 +556,11 @@ public: | |||
| extGraph.connections.list.append(connectionToId); | |||
| if (sendCallback) { | |||
| callback(ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, | |||
| connectionToId.id, | |||
| 0, 0, 0, 0.0f, | |||
| strBuf); | |||
| } | |||
| callback(sendCallback, true, | |||
| ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, | |||
| connectionToId.id, | |||
| 0, 0, 0, 0.0f, | |||
| strBuf); | |||
| } | |||
| fMidiOutMutex.lock(); | |||
| @@ -582,12 +582,11 @@ public: | |||
| extGraph.connections.list.append(connectionToId); | |||
| if (sendCallback) { | |||
| callback(ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, | |||
| connectionToId.id, | |||
| 0, 0, 0, 0.0f, | |||
| strBuf); | |||
| } | |||
| callback(sendCallback, true, | |||
| ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED, | |||
| connectionToId.id, | |||
| 0, 0, 0, 0.0f, | |||
| strBuf); | |||
| } | |||
| fMidiOutMutex.unlock(); | |||
| @@ -99,7 +99,7 @@ void CarlaEngineThread::run() noexcept | |||
| #if defined(HAVE_LIBLO) && ! defined(BUILD_BRIDGE) | |||
| // Update OSC engine client | |||
| if (oscRegisted) | |||
| kEngine->oscSend_control_set_parameter_value(i, static_cast<int32_t>(j), value); | |||
| kEngine->oscSend_control_set_output_parameter_value(i, static_cast<int32_t>(j), value); | |||
| #endif | |||
| // Update UI | |||
| if (updateUI) | |||
| @@ -890,7 +890,7 @@ void CarlaPlugin::loadStateSave(const CarlaStateSave& stateSave) | |||
| setActive(stateSave.active, true, true); | |||
| if (! pData->engine->isLoadingProject()) | |||
| pData->engine->callback(ENGINE_CALLBACK_UPDATE, pData->id, 0, 0, 0, 0.0f, nullptr); | |||
| pData->engine->callback(true, true, ENGINE_CALLBACK_UPDATE, pData->id, 0, 0, 0, 0.0f, nullptr); | |||
| #endif | |||
| } | |||
| @@ -1293,7 +1293,8 @@ void CarlaPlugin::setOption(const uint option, const bool yesNo, const bool send | |||
| #ifndef BUILD_BRIDGE_ALTERNATIVE_ARCH | |||
| if (sendCallback) | |||
| pData->engine->callback(ENGINE_CALLBACK_OPTION_CHANGED, | |||
| pData->engine->callback(true, true, | |||
| ENGINE_CALLBACK_OPTION_CHANGED, | |||
| pData->id, | |||
| static_cast<int>(option), | |||
| yesNo ? 1 : 0, | |||
| @@ -1342,25 +1343,17 @@ void CarlaPlugin::setActive(const bool active, const bool sendOsc, const bool se | |||
| pData->active = active; | |||
| #ifndef BUILD_BRIDGE_ALTERNATIVE_ARCH | |||
| const float value = active ? 1.0f : 0.0f; | |||
| #if defined(HAVE_LIBLO) && ! defined(BUILD_BRIDGE) | |||
| if (sendOsc && pData->engine->isOscControlRegistered()) | |||
| pData->engine->oscSend_control_set_parameter_value(pData->id, PARAMETER_ACTIVE, value); | |||
| #endif | |||
| #ifndef BUILD_BRIDGE_ALTERNATIVE_ARCH | |||
| if (sendCallback) | |||
| pData->engine->callback(ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED, | |||
| pData->id, | |||
| PARAMETER_ACTIVE, | |||
| 0, 0, | |||
| value, | |||
| nullptr); | |||
| pData->engine->callback(sendCallback, sendOsc, | |||
| ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED, | |||
| pData->id, | |||
| PARAMETER_ACTIVE, | |||
| 0, 0, | |||
| value, | |||
| nullptr); | |||
| #endif | |||
| // maybe unused | |||
| return; (void)value; | |||
| } | |||
| #ifndef BUILD_BRIDGE_ALTERNATIVE_ARCH | |||
| @@ -1380,18 +1373,13 @@ void CarlaPlugin::setDryWet(const float value, const bool sendOsc, const bool se | |||
| pData->postProc.dryWet = fixedValue; | |||
| # if defined(HAVE_LIBLO) && ! defined(BUILD_BRIDGE) | |||
| if (sendOsc && pData->engine->isOscControlRegistered()) | |||
| pData->engine->oscSend_control_set_parameter_value(pData->id, PARAMETER_DRYWET, fixedValue); | |||
| # endif | |||
| if (sendCallback) | |||
| pData->engine->callback(ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED, | |||
| pData->id, | |||
| PARAMETER_DRYWET, | |||
| 0, 0, | |||
| fixedValue, | |||
| nullptr); | |||
| pData->engine->callback(sendCallback, sendOsc, | |||
| ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED, | |||
| pData->id, | |||
| PARAMETER_DRYWET, | |||
| 0, 0, | |||
| fixedValue, | |||
| nullptr); | |||
| } | |||
| void CarlaPlugin::setVolume(const float value, const bool sendOsc, const bool sendCallback) noexcept | |||
| @@ -1410,18 +1398,13 @@ void CarlaPlugin::setVolume(const float value, const bool sendOsc, const bool se | |||
| pData->postProc.volume = fixedValue; | |||
| # if defined(HAVE_LIBLO) && ! defined(BUILD_BRIDGE) | |||
| if (sendOsc && pData->engine->isOscControlRegistered()) | |||
| pData->engine->oscSend_control_set_parameter_value(pData->id, PARAMETER_VOLUME, fixedValue); | |||
| # endif | |||
| if (sendCallback) | |||
| pData->engine->callback(ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED, | |||
| pData->id, | |||
| PARAMETER_VOLUME, | |||
| 0, 0, | |||
| fixedValue, | |||
| nullptr); | |||
| pData->engine->callback(sendCallback, sendOsc, | |||
| ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED, | |||
| pData->id, | |||
| PARAMETER_VOLUME, | |||
| 0, 0, | |||
| fixedValue, | |||
| nullptr); | |||
| } | |||
| void CarlaPlugin::setBalanceLeft(const float value, const bool sendOsc, const bool sendCallback) noexcept | |||
| @@ -1440,18 +1423,13 @@ void CarlaPlugin::setBalanceLeft(const float value, const bool sendOsc, const bo | |||
| pData->postProc.balanceLeft = fixedValue; | |||
| # if defined(HAVE_LIBLO) && ! defined(BUILD_BRIDGE) | |||
| if (sendOsc && pData->engine->isOscControlRegistered()) | |||
| pData->engine->oscSend_control_set_parameter_value(pData->id, PARAMETER_BALANCE_LEFT, fixedValue); | |||
| # endif | |||
| if (sendCallback) | |||
| pData->engine->callback(ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED, | |||
| pData->id, | |||
| PARAMETER_BALANCE_LEFT, | |||
| 0, 0, | |||
| fixedValue, | |||
| nullptr); | |||
| pData->engine->callback(sendCallback, sendOsc, | |||
| ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED, | |||
| pData->id, | |||
| PARAMETER_BALANCE_LEFT, | |||
| 0, 0, | |||
| fixedValue, | |||
| nullptr); | |||
| } | |||
| void CarlaPlugin::setBalanceRight(const float value, const bool sendOsc, const bool sendCallback) noexcept | |||
| @@ -1470,18 +1448,13 @@ void CarlaPlugin::setBalanceRight(const float value, const bool sendOsc, const b | |||
| pData->postProc.balanceRight = fixedValue; | |||
| # if defined(HAVE_LIBLO) && ! defined(BUILD_BRIDGE) | |||
| if (sendOsc && pData->engine->isOscControlRegistered()) | |||
| pData->engine->oscSend_control_set_parameter_value(pData->id, PARAMETER_BALANCE_RIGHT, fixedValue); | |||
| # endif | |||
| if (sendCallback) | |||
| pData->engine->callback(ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED, | |||
| pData->id, | |||
| PARAMETER_BALANCE_RIGHT, | |||
| 0, 0, | |||
| fixedValue, | |||
| nullptr); | |||
| pData->engine->callback(sendCallback, sendOsc, | |||
| ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED, | |||
| pData->id, | |||
| PARAMETER_BALANCE_RIGHT, | |||
| 0, 0, | |||
| fixedValue, | |||
| nullptr); | |||
| } | |||
| void CarlaPlugin::setPanning(const float value, const bool sendOsc, const bool sendCallback) noexcept | |||
| @@ -1500,18 +1473,13 @@ void CarlaPlugin::setPanning(const float value, const bool sendOsc, const bool s | |||
| pData->postProc.panning = fixedValue; | |||
| # if defined(HAVE_LIBLO) && ! defined(BUILD_BRIDGE) | |||
| if (sendOsc && pData->engine->isOscControlRegistered()) | |||
| pData->engine->oscSend_control_set_parameter_value(pData->id, PARAMETER_PANNING, fixedValue); | |||
| # endif | |||
| if (sendCallback) | |||
| pData->engine->callback(ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED, | |||
| pData->id, | |||
| PARAMETER_PANNING, | |||
| 0, 0, | |||
| fixedValue, | |||
| nullptr); | |||
| pData->engine->callback(sendCallback, sendOsc, | |||
| ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED, | |||
| pData->id, | |||
| PARAMETER_PANNING, | |||
| 0, 0, | |||
| fixedValue, | |||
| nullptr); | |||
| } | |||
| void CarlaPlugin::setDryWetRT(const float value) noexcept | |||
| @@ -1593,24 +1561,16 @@ void CarlaPlugin::setCtrlChannel(const int8_t channel, const bool sendOsc, const | |||
| pData->ctrlChannel = channel; | |||
| #ifndef BUILD_BRIDGE_ALTERNATIVE_ARCH | |||
| const float channelf = static_cast<float>(channel); | |||
| #if defined(HAVE_LIBLO) && ! defined(BUILD_BRIDGE) | |||
| if (sendOsc && pData->engine->isOscControlRegistered()) | |||
| pData->engine->oscSend_control_set_parameter_value(pData->id, PARAMETER_CTRL_CHANNEL, channelf); | |||
| #endif | |||
| #ifndef BUILD_BRIDGE_ALTERNATIVE_ARCH | |||
| if (sendCallback) | |||
| pData->engine->callback(ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED, | |||
| pData->id, | |||
| PARAMETER_CTRL_CHANNEL, | |||
| 0, 0, | |||
| channelf, nullptr); | |||
| pData->engine->callback(sendCallback, sendOsc, | |||
| ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED, | |||
| pData->id, | |||
| PARAMETER_CTRL_CHANNEL, | |||
| 0, 0, | |||
| channelf, nullptr); | |||
| #endif | |||
| // maybe unused | |||
| return; (void)channelf; | |||
| } | |||
| // ------------------------------------------------------------------- | |||
| @@ -1631,18 +1591,13 @@ void CarlaPlugin::setParameterValue(const uint32_t parameterId, const float valu | |||
| if (sendGui && (pData->hints & PLUGIN_HAS_CUSTOM_UI) != 0) | |||
| uiParameterChange(parameterId, value); | |||
| #if defined(HAVE_LIBLO) && ! defined(BUILD_BRIDGE) | |||
| if (sendOsc && pData->engine->isOscControlRegistered()) | |||
| pData->engine->oscSend_control_set_parameter_value(pData->id, static_cast<int32_t>(parameterId), value); | |||
| #endif | |||
| if (sendCallback) | |||
| pData->engine->callback(ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED, | |||
| pData->id, | |||
| static_cast<int>(parameterId), | |||
| 0, 0, | |||
| value, | |||
| nullptr); | |||
| pData->engine->callback(sendCallback, sendOsc, | |||
| ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED, | |||
| pData->id, | |||
| static_cast<int>(parameterId), | |||
| 0, 0, | |||
| value, | |||
| nullptr); | |||
| } | |||
| void CarlaPlugin::setParameterValueRT(const uint32_t parameterId, const float value) noexcept | |||
| @@ -1699,17 +1654,12 @@ void CarlaPlugin::setParameterMidiChannel(const uint32_t parameterId, const uint | |||
| pData->param.data[parameterId].midiChannel = channel; | |||
| #ifndef BUILD_BRIDGE_ALTERNATIVE_ARCH | |||
| # if defined(HAVE_LIBLO) && ! defined(BUILD_BRIDGE) | |||
| if (sendOsc && pData->engine->isOscControlRegistered()) | |||
| pData->engine->oscSend_control_set_parameter_midi_channel(pData->id, parameterId, channel); | |||
| # endif | |||
| if (sendCallback) | |||
| pData->engine->callback(ENGINE_CALLBACK_PARAMETER_MIDI_CHANNEL_CHANGED, | |||
| pData->id, | |||
| static_cast<int>(parameterId), | |||
| channel, | |||
| 0, 0.0f, nullptr); | |||
| pData->engine->callback(sendCallback, sendOsc, | |||
| ENGINE_CALLBACK_PARAMETER_MIDI_CHANNEL_CHANGED, | |||
| pData->id, | |||
| static_cast<int>(parameterId), | |||
| channel, | |||
| 0, 0.0f, nullptr); | |||
| #endif | |||
| } | |||
| @@ -1726,17 +1676,12 @@ void CarlaPlugin::setParameterMidiCC(const uint32_t parameterId, const int16_t c | |||
| pData->param.data[parameterId].midiCC = cc; | |||
| #ifndef BUILD_BRIDGE_ALTERNATIVE_ARCH | |||
| # if defined(HAVE_LIBLO) && ! defined(BUILD_BRIDGE) | |||
| if (sendOsc && pData->engine->isOscControlRegistered()) | |||
| pData->engine->oscSend_control_set_parameter_midi_cc(pData->id, parameterId, cc); | |||
| # endif | |||
| if (sendCallback) | |||
| pData->engine->callback(ENGINE_CALLBACK_PARAMETER_MIDI_CC_CHANGED, | |||
| pData->id, | |||
| static_cast<int>(parameterId), | |||
| cc, | |||
| 0, 0.0f, nullptr); | |||
| pData->engine->callback(sendCallback, sendOsc, | |||
| ENGINE_CALLBACK_PARAMETER_MIDI_CC_CHANGED, | |||
| pData->id, | |||
| static_cast<int>(parameterId), | |||
| cc, | |||
| 0, 0.0f, nullptr); | |||
| #endif | |||
| } | |||
| @@ -1794,20 +1739,11 @@ void CarlaPlugin::setProgram(const int32_t index, const bool sendGui, const bool | |||
| pData->prog.current = index; | |||
| #if defined(HAVE_LIBLO) && ! defined(BUILD_BRIDGE) | |||
| const bool reallySendOsc(sendOsc && pData->engine->isOscControlRegistered()); | |||
| if (reallySendOsc && index < 50) | |||
| pData->engine->oscSend_control_set_current_program(pData->id, index); | |||
| #else | |||
| const bool reallySendOsc(false); | |||
| #endif | |||
| if (sendCallback) | |||
| pData->engine->callback(ENGINE_CALLBACK_PROGRAM_CHANGED, | |||
| pData->id, | |||
| index, | |||
| 0, 0, 0.0f, nullptr); | |||
| pData->engine->callback(sendCallback, sendOsc, | |||
| ENGINE_CALLBACK_PROGRAM_CHANGED, | |||
| pData->id, | |||
| index, | |||
| 0, 0, 0.0f, nullptr); | |||
| // Change default parameter values | |||
| if (index >= 0) | |||
| @@ -1822,13 +1758,10 @@ void CarlaPlugin::setProgram(const int32_t index, const bool sendGui, const bool | |||
| break; | |||
| default: | |||
| pData->updateParameterValues(this, reallySendOsc, sendCallback, true); | |||
| pData->updateParameterValues(this, sendOsc, sendCallback, true); | |||
| break; | |||
| } | |||
| } | |||
| // may be unused | |||
| return; (void)sendOsc; | |||
| } | |||
| void CarlaPlugin::setMidiProgram(const int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback, const bool) noexcept | |||
| @@ -1837,20 +1770,11 @@ void CarlaPlugin::setMidiProgram(const int32_t index, const bool sendGui, const | |||
| pData->midiprog.current = index; | |||
| #if defined(HAVE_LIBLO) && ! defined(BUILD_BRIDGE) | |||
| const bool reallySendOsc(sendOsc && pData->engine->isOscControlRegistered()); | |||
| if (reallySendOsc && index < 50) | |||
| pData->engine->oscSend_control_set_current_midi_program(pData->id, index); | |||
| #else | |||
| const bool reallySendOsc(false); | |||
| #endif | |||
| if (sendCallback) | |||
| pData->engine->callback(ENGINE_CALLBACK_MIDI_PROGRAM_CHANGED, | |||
| pData->id, | |||
| index, | |||
| 0, 0, 0.0f, nullptr); | |||
| pData->engine->callback(sendCallback, sendOsc, | |||
| ENGINE_CALLBACK_MIDI_PROGRAM_CHANGED, | |||
| pData->id, | |||
| index, | |||
| 0, 0, 0.0f, nullptr); | |||
| // Change default parameter values | |||
| if (index >= 0) | |||
| @@ -1865,13 +1789,10 @@ void CarlaPlugin::setMidiProgram(const int32_t index, const bool sendGui, const | |||
| break; | |||
| default: | |||
| pData->updateParameterValues(this, reallySendOsc, sendCallback, true); | |||
| pData->updateParameterValues(this, sendOsc, sendCallback, true); | |||
| break; | |||
| } | |||
| } | |||
| // may be unused | |||
| return; (void)sendOsc; | |||
| } | |||
| void CarlaPlugin::setMidiProgramById(const uint32_t bank, const uint32_t program, const bool sendGui, const bool sendOsc, const bool sendCallback) noexcept | |||
| @@ -1969,9 +1890,6 @@ void CarlaPlugin::idle() | |||
| const bool hasUI(pData->hints & PLUGIN_HAS_CUSTOM_UI); | |||
| const bool needsUiMainThread(pData->hints & PLUGIN_NEEDS_UI_MAIN_THREAD); | |||
| #if defined(HAVE_LIBLO) && ! defined(BUILD_BRIDGE) | |||
| const bool sendOsc(pData->engine->isOscControlRegistered()); | |||
| #endif | |||
| const uint32_t latency(getLatencyInFrames()); | |||
| if (pData->latency.frames != latency) | |||
| @@ -2001,7 +1919,8 @@ void CarlaPlugin::idle() | |||
| } break; | |||
| case kPluginPostRtEventDebug: { | |||
| pData->engine->callback(ENGINE_CALLBACK_DEBUG, pData->id, | |||
| pData->engine->callback(true, true, | |||
| ENGINE_CALLBACK_DEBUG, pData->id, | |||
| event.value1, event.value2, event.value3, event.valuef, nullptr); | |||
| } break; | |||
| @@ -2017,13 +1936,9 @@ void CarlaPlugin::idle() | |||
| if (event.value2 != 0) | |||
| { | |||
| #if defined(HAVE_LIBLO) && ! defined(BUILD_BRIDGE) | |||
| // Update OSC control client | |||
| if (sendOsc) | |||
| pData->engine->oscSend_control_set_parameter_value(pData->id, event.value1, event.valuef); | |||
| #endif | |||
| // Update Host | |||
| pData->engine->callback(ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED, | |||
| pData->engine->callback(true, true, | |||
| ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED, | |||
| pData->id, | |||
| event.value1, | |||
| 0, 0, | |||
| @@ -2048,20 +1963,15 @@ void CarlaPlugin::idle() | |||
| const float paramDefault(pData->param.ranges[j].def); | |||
| const float paramValue(getParameterValue(j)); | |||
| #if defined(HAVE_LIBLO) && ! defined(BUILD_BRIDGE) | |||
| if (sendOsc && j < 50) | |||
| { | |||
| pData->engine->oscSend_control_set_parameter_value(pData->id, static_cast<int32_t>(j), paramValue); | |||
| pData->engine->oscSend_control_set_default_value(pData->id, j, paramDefault); | |||
| } | |||
| #endif | |||
| pData->engine->callback(ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED, | |||
| pData->engine->callback(true, true, | |||
| ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED, | |||
| pData->id, | |||
| static_cast<int>(j), | |||
| 0, 0, | |||
| paramValue, | |||
| nullptr); | |||
| pData->engine->callback(ENGINE_CALLBACK_PARAMETER_DEFAULT_CHANGED, | |||
| pData->engine->callback(true, true, | |||
| ENGINE_CALLBACK_PARAMETER_DEFAULT_CHANGED, | |||
| pData->id, | |||
| static_cast<int>(j), | |||
| 0, 0, | |||
| @@ -2069,13 +1979,9 @@ void CarlaPlugin::idle() | |||
| nullptr); | |||
| } | |||
| #if defined(HAVE_LIBLO) && ! defined(BUILD_BRIDGE) | |||
| // Update OSC control client | |||
| if (sendOsc) | |||
| pData->engine->oscSend_control_set_current_program(pData->id, event.value1); | |||
| #endif | |||
| // Update Host | |||
| pData->engine->callback(ENGINE_CALLBACK_PROGRAM_CHANGED, | |||
| pData->engine->callback(true, true, | |||
| ENGINE_CALLBACK_PROGRAM_CHANGED, | |||
| pData->id, | |||
| event.value1, | |||
| 0, 0, 0.0f, nullptr); | |||
| @@ -2098,20 +2004,15 @@ void CarlaPlugin::idle() | |||
| const float paramDefault(pData->param.ranges[j].def); | |||
| const float paramValue(getParameterValue(j)); | |||
| #if defined(HAVE_LIBLO) && ! defined(BUILD_BRIDGE) | |||
| if (sendOsc && j < 50) | |||
| { | |||
| pData->engine->oscSend_control_set_parameter_value(pData->id, static_cast<int32_t>(j), paramValue); | |||
| pData->engine->oscSend_control_set_default_value(pData->id, j, paramDefault); | |||
| } | |||
| #endif | |||
| pData->engine->callback(ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED, | |||
| pData->engine->callback(true, true, | |||
| ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED, | |||
| pData->id, | |||
| static_cast<int>(j), | |||
| 0, 0, | |||
| paramValue, | |||
| nullptr); | |||
| pData->engine->callback(ENGINE_CALLBACK_PARAMETER_DEFAULT_CHANGED, | |||
| pData->engine->callback(true, true, | |||
| ENGINE_CALLBACK_PARAMETER_DEFAULT_CHANGED, | |||
| pData->id, | |||
| static_cast<int>(j), | |||
| 0, 0, | |||
| @@ -2119,13 +2020,9 @@ void CarlaPlugin::idle() | |||
| nullptr); | |||
| } | |||
| #if defined(HAVE_LIBLO) && ! defined(BUILD_BRIDGE) | |||
| // Update OSC control client | |||
| if (sendOsc) | |||
| pData->engine->oscSend_control_set_current_midi_program(pData->id, event.value1); | |||
| #endif | |||
| // Update Host | |||
| pData->engine->callback(ENGINE_CALLBACK_MIDI_PROGRAM_CHANGED, | |||
| pData->engine->callback(true, true, | |||
| ENGINE_CALLBACK_MIDI_PROGRAM_CHANGED, | |||
| pData->id, | |||
| event.value1, | |||
| 0, 0, 0.0f, nullptr); | |||
| @@ -2150,13 +2047,9 @@ void CarlaPlugin::idle() | |||
| uiNoteOn(channel, note, velocity); | |||
| } | |||
| #if defined(HAVE_LIBLO) && ! defined(BUILD_BRIDGE) | |||
| // Update OSC control client | |||
| if (sendOsc) | |||
| pData->engine->oscSend_control_note_on(pData->id, channel, note, velocity); | |||
| #endif | |||
| // Update Host | |||
| pData->engine->callback(ENGINE_CALLBACK_NOTE_ON, | |||
| pData->engine->callback(true, true, | |||
| ENGINE_CALLBACK_NOTE_ON, | |||
| pData->id, | |||
| event.value1, | |||
| event.value2, | |||
| @@ -2180,13 +2073,9 @@ void CarlaPlugin::idle() | |||
| uiNoteOff(channel, note); | |||
| } | |||
| #if defined(HAVE_LIBLO) && ! defined(BUILD_BRIDGE) | |||
| // Update OSC control client | |||
| if (sendOsc) | |||
| pData->engine->oscSend_control_note_off(pData->id, channel, note); | |||
| #endif | |||
| // Update Host | |||
| pData->engine->callback(ENGINE_CALLBACK_NOTE_OFF, | |||
| pData->engine->callback(true, true, | |||
| ENGINE_CALLBACK_NOTE_OFF, | |||
| pData->id, | |||
| event.value1, | |||
| event.value2, | |||
| @@ -2312,13 +2201,13 @@ void CarlaPlugin::registerToOscClient() noexcept | |||
| pData->engine->oscSend_control_set_parameter_data(pData->id, i, paramData.type, paramData.hints, bufName, bufUnit); | |||
| pData->engine->oscSend_control_set_parameter_ranges1(pData->id, i, paramRanges.def, paramRanges.min, paramRanges.max); | |||
| pData->engine->oscSend_control_set_parameter_ranges2(pData->id, i, paramRanges.step, paramRanges.stepSmall, paramRanges.stepLarge); | |||
| pData->engine->oscSend_control_set_parameter_value(pData->id, static_cast<int32_t>(i), getParameterValue(i)); | |||
| if (paramData.midiCC >= 0) | |||
| pData->engine->oscSend_control_set_parameter_midi_cc(pData->id, i, paramData.midiCC); | |||
| if (paramData.midiChannel != 0) | |||
| pData->engine->oscSend_control_set_parameter_midi_channel(pData->id, i, paramData.midiChannel); | |||
| // pData->engine->oscSend_control_set_parameter_value(pData->id, static_cast<int32_t>(i), getParameterValue(i)); | |||
| // | |||
| // if (paramData.midiCC >= 0) | |||
| // pData->engine->oscSend_control_set_parameter_midi_cc(pData->id, i, paramData.midiCC); | |||
| // | |||
| // if (paramData.midiChannel != 0) | |||
| // pData->engine->oscSend_control_set_parameter_midi_channel(pData->id, i, paramData.midiChannel); | |||
| } | |||
| } | |||
| @@ -2330,7 +2219,7 @@ void CarlaPlugin::registerToOscClient() noexcept | |||
| for (uint32_t i=0; i < count; ++i) | |||
| pData->engine->oscSend_control_set_program_name(pData->id, i, pData->prog.names[i]); | |||
| pData->engine->oscSend_control_set_current_program(pData->id, pData->prog.current); | |||
| // pData->engine->oscSend_control_set_current_program(pData->id, pData->prog.current); | |||
| } | |||
| // MIDI Programs | |||
| @@ -2345,20 +2234,18 @@ void CarlaPlugin::registerToOscClient() noexcept | |||
| pData->engine->oscSend_control_set_midi_program_data(pData->id, i, mpData.bank, mpData.program, mpData.name); | |||
| } | |||
| pData->engine->oscSend_control_set_current_midi_program(pData->id, pData->midiprog.current); | |||
| // pData->engine->oscSend_control_set_current_midi_program(pData->id, pData->midiprog.current); | |||
| } | |||
| pData->engine->oscSend_control_add_plugin_end(pData->id); | |||
| // Internal Parameters | |||
| { | |||
| pData->engine->oscSend_control_set_parameter_value(pData->id, PARAMETER_DRYWET, pData->postProc.dryWet); | |||
| pData->engine->oscSend_control_set_parameter_value(pData->id, PARAMETER_VOLUME, pData->postProc.volume); | |||
| pData->engine->oscSend_control_set_parameter_value(pData->id, PARAMETER_BALANCE_LEFT, pData->postProc.balanceLeft); | |||
| pData->engine->oscSend_control_set_parameter_value(pData->id, PARAMETER_BALANCE_RIGHT, pData->postProc.balanceRight); | |||
| pData->engine->oscSend_control_set_parameter_value(pData->id, PARAMETER_PANNING, pData->postProc.panning); | |||
| pData->engine->oscSend_control_set_parameter_value(pData->id, PARAMETER_CTRL_CHANNEL, pData->ctrlChannel); | |||
| pData->engine->oscSend_control_set_parameter_value(pData->id, PARAMETER_ACTIVE, pData->active ? 1.0f : 0.0f); | |||
| // pData->engine->oscSend_control_set_parameter_value(pData->id, PARAMETER_DRYWET, pData->postProc.dryWet); | |||
| // pData->engine->oscSend_control_set_parameter_value(pData->id, PARAMETER_VOLUME, pData->postProc.volume); | |||
| // pData->engine->oscSend_control_set_parameter_value(pData->id, PARAMETER_BALANCE_LEFT, pData->postProc.balanceLeft); | |||
| // pData->engine->oscSend_control_set_parameter_value(pData->id, PARAMETER_BALANCE_RIGHT, pData->postProc.balanceRight); | |||
| // pData->engine->oscSend_control_set_parameter_value(pData->id, PARAMETER_PANNING, pData->postProc.panning); | |||
| // pData->engine->oscSend_control_set_parameter_value(pData->id, PARAMETER_CTRL_CHANNEL, pData->ctrlChannel); | |||
| // pData->engine->oscSend_control_set_parameter_value(pData->id, PARAMETER_ACTIVE, pData->active ? 1.0f : 0.0f); | |||
| } | |||
| } | |||
| #endif | |||
| @@ -2397,26 +2284,13 @@ void CarlaPlugin::sendMidiSingleNote(const uint8_t channel, const uint8_t note, | |||
| uiNoteOff(channel, note); | |||
| } | |||
| #if defined(HAVE_LIBLO) && ! defined(BUILD_BRIDGE) | |||
| if (sendOsc && pData->engine->isOscControlRegistered()) | |||
| { | |||
| if (velo > 0) | |||
| pData->engine->oscSend_control_note_on(pData->id, channel, note, velo); | |||
| else | |||
| pData->engine->oscSend_control_note_off(pData->id, channel, note); | |||
| } | |||
| #endif | |||
| if (sendCallback) | |||
| pData->engine->callback((velo > 0) ? ENGINE_CALLBACK_NOTE_ON : ENGINE_CALLBACK_NOTE_OFF, | |||
| pData->id, | |||
| channel, | |||
| note, | |||
| velo, | |||
| 0.0f, nullptr); | |||
| // may be unused | |||
| return; (void)sendOsc; | |||
| pData->engine->callback(sendCallback, sendOsc, | |||
| (velo > 0) ? ENGINE_CALLBACK_NOTE_ON : ENGINE_CALLBACK_NOTE_OFF, | |||
| pData->id, | |||
| channel, | |||
| note, | |||
| velo, | |||
| 0.0f, nullptr); | |||
| } | |||
| #ifndef BUILD_BRIDGE_ALTERNATIVE_ARCH | |||
| @@ -348,7 +348,8 @@ protected: | |||
| CarlaString errorString("Plugin '" + CarlaString(kPlugin->getName()) + "' has crashed!\n" | |||
| "Saving now will lose its current settings.\n" | |||
| "Please remove this plugin, and not rely on it from this point."); | |||
| kEngine->callback(CarlaBackend::ENGINE_CALLBACK_ERROR, kPlugin->getId(), 0, 0, 0, 0.0f, errorString); | |||
| kEngine->callback(true, true, | |||
| CarlaBackend::ENGINE_CALLBACK_ERROR, kPlugin->getId(), 0, 0, 0, 0.0f, errorString); | |||
| } | |||
| } | |||
| @@ -625,7 +626,7 @@ public: | |||
| #if 0 | |||
| // we waited and blocked for 5 secs, give host idle time now | |||
| pData->engine->callback(ENGINE_CALLBACK_IDLE, 0, 0, 0, 0, 0.0f, nullptr); | |||
| pData->engine->callback(true, true, ENGINE_CALLBACK_IDLE, 0, 0, 0, 0, 0.0f, nullptr); | |||
| if (pData->engine->getType() != kEngineTypePlugin) | |||
| pData->engine->idle(); | |||
| @@ -645,7 +646,7 @@ public: | |||
| for (; Time::getMillisecondCounter() < timeoutEnd && fBridgeThread.isThreadRunning();) | |||
| { | |||
| pData->engine->callback(ENGINE_CALLBACK_IDLE, 0, 0, 0, 0, 0.0f, nullptr); | |||
| pData->engine->callback(true, true, ENGINE_CALLBACK_IDLE, 0, 0, 0, 0, 0.0f, nullptr); | |||
| if (needsEngineIdle) | |||
| pData->engine->idle(); | |||
| @@ -2251,7 +2252,7 @@ public: | |||
| #ifndef BUILD_BRIDGE_ALTERNATIVE_ARCH | |||
| pData->transientTryCounter = 0; | |||
| #endif | |||
| pData->engine->callback(ENGINE_CALLBACK_UI_STATE_CHANGED, pData->id, 0, 0, 0, 0.0f, nullptr); | |||
| pData->engine->callback(true, true, ENGINE_CALLBACK_UI_STATE_CHANGED, pData->id, 0, 0, 0, 0.0f, nullptr); | |||
| break; | |||
| case kPluginBridgeNonRtServerError: { | |||
| @@ -2263,7 +2264,7 @@ public: | |||
| if (fInitiated) | |||
| { | |||
| pData->engine->callback(ENGINE_CALLBACK_ERROR, pData->id, 0, 0, 0, 0.0f, error); | |||
| pData->engine->callback(true, true, ENGINE_CALLBACK_ERROR, pData->id, 0, 0, 0, 0.0f, error); | |||
| // just in case | |||
| pData->engine->setLastError(error); | |||
| @@ -2592,11 +2593,9 @@ private: | |||
| if (wasActive) | |||
| { | |||
| #if defined(HAVE_LIBLO) && ! defined(BUILD_BRIDGE) | |||
| if (pData->engine->isOscControlRegistered()) | |||
| pData->engine->oscSend_control_set_parameter_value(pData->id, PARAMETER_ACTIVE, 0.0f); | |||
| pData->engine->callback(ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED, | |||
| #ifndef BUILD_BRIDGE_ALTERNATIVE_ARCH | |||
| pData->engine->callback(true, true, | |||
| ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED, | |||
| pData->id, | |||
| PARAMETER_ACTIVE, | |||
| 0, 0, | |||
| @@ -2607,7 +2606,8 @@ private: | |||
| if (pData->hints & PLUGIN_HAS_CUSTOM_UI) | |||
| { | |||
| pData->engine->callback(ENGINE_CALLBACK_UI_STATE_CHANGED, | |||
| pData->engine->callback(true, true, | |||
| ENGINE_CALLBACK_UI_STATE_CHANGED, | |||
| pData->id, | |||
| 0, | |||
| 0, 0, 0.0f, nullptr); | |||
| @@ -2687,7 +2687,8 @@ private: | |||
| if (needsCancelableAction) | |||
| { | |||
| pData->engine->setActionCanceled(false); | |||
| pData->engine->callback(ENGINE_CALLBACK_CANCELABLE_ACTION, | |||
| pData->engine->callback(true, true, | |||
| ENGINE_CALLBACK_CANCELABLE_ACTION, | |||
| pData->id, | |||
| 1, | |||
| 0, 0, 0.0f, | |||
| @@ -2697,7 +2698,7 @@ private: | |||
| for (;fBridgeThread.isThreadRunning();) | |||
| { | |||
| pData->engine->callback(ENGINE_CALLBACK_IDLE, 0, 0, 0, 0, 0.0f, nullptr); | |||
| pData->engine->callback(true, true, ENGINE_CALLBACK_IDLE, 0, 0, 0, 0, 0.0f, nullptr); | |||
| if (needsEngineIdle) | |||
| pData->engine->idle(); | |||
| @@ -2715,7 +2716,8 @@ private: | |||
| #ifndef BUILD_BRIDGE_ALTERNATIVE_ARCH | |||
| if (needsCancelableAction) | |||
| { | |||
| pData->engine->callback(ENGINE_CALLBACK_CANCELABLE_ACTION, | |||
| pData->engine->callback(true, true, | |||
| ENGINE_CALLBACK_CANCELABLE_ACTION, | |||
| pData->id, | |||
| 0, | |||
| 0, 0, 0.0f, | |||
| @@ -112,7 +112,8 @@ public: | |||
| fProcess->kill(); | |||
| fProcess = nullptr; | |||
| kEngine->callback(CarlaBackend::ENGINE_CALLBACK_UI_STATE_CHANGED, | |||
| kEngine->callback(true, true, | |||
| ENGINE_CALLBACK_UI_STATE_CHANGED, | |||
| kPlugin->getId(), | |||
| 0, | |||
| 0, 0, 0.0f, nullptr); | |||
| @@ -222,7 +223,8 @@ public: | |||
| } | |||
| fProcess = nullptr; | |||
| kEngine->callback(CarlaBackend::ENGINE_CALLBACK_UI_STATE_CHANGED, | |||
| kEngine->callback(true, true, | |||
| ENGINE_CALLBACK_UI_STATE_CHANGED, | |||
| kPlugin->getId(), | |||
| 0, | |||
| 0, 0, 0.0f, nullptr); | |||
| @@ -1278,7 +1280,7 @@ public: | |||
| if (programChanged) | |||
| setMidiProgram(pData->midiprog.current, true, true, true, false); | |||
| pData->engine->callback(ENGINE_CALLBACK_RELOAD_PROGRAMS, pData->id, 0, 0, 0, 0.0f, nullptr); | |||
| pData->engine->callback(true, true, ENGINE_CALLBACK_RELOAD_PROGRAMS, pData->id, 0, 0, 0, 0.0f, nullptr); | |||
| } | |||
| } | |||
| @@ -2385,7 +2387,8 @@ public: | |||
| showCustomUI(false); | |||
| // tell frontend | |||
| pData->engine->callback(ENGINE_CALLBACK_UI_STATE_CHANGED, | |||
| pData->engine->callback(true, true, | |||
| ENGINE_CALLBACK_UI_STATE_CHANGED, | |||
| pData->id, | |||
| 0, | |||
| 0, 0, 0.0f, nullptr); | |||
| @@ -522,7 +522,8 @@ public: | |||
| if (pData->ctrlChannel == static_cast<int32_t>(channel)) | |||
| { | |||
| pData->midiprog.current = index; | |||
| pData->engine->callback(ENGINE_CALLBACK_MIDI_PROGRAM_CHANGED, | |||
| pData->engine->callback(true, true, | |||
| ENGINE_CALLBACK_MIDI_PROGRAM_CHANGED, | |||
| pData->id, | |||
| index, | |||
| 0, 0, 0.0f, nullptr); | |||
| @@ -1076,7 +1077,7 @@ public: | |||
| } | |||
| else | |||
| { | |||
| pData->engine->callback(ENGINE_CALLBACK_RELOAD_PROGRAMS, pData->id, 0, 0, 0, 0.0f, nullptr); | |||
| pData->engine->callback(true, true, ENGINE_CALLBACK_RELOAD_PROGRAMS, pData->id, 0, 0, 0, 0.0f, nullptr); | |||
| } | |||
| } | |||
| @@ -819,33 +819,23 @@ void CarlaPlugin::ProtectedData::updateParameterValues(CarlaPlugin* const plugin | |||
| if (useDefault) | |||
| param.ranges[i].def = value; | |||
| #if defined(HAVE_LIBLO) && ! defined(BUILD_BRIDGE) | |||
| if (sendOsc && i < 50) | |||
| { | |||
| if (useDefault) | |||
| engine->oscSend_control_set_default_value(id, i, value); | |||
| engine->oscSend_control_set_parameter_value(id, static_cast<int32_t>(i), value); | |||
| if (useDefault) { | |||
| engine->callback(sendCallback, sendOsc, | |||
| ENGINE_CALLBACK_PARAMETER_DEFAULT_CHANGED, | |||
| id, | |||
| static_cast<int>(i), | |||
| 0, 0, | |||
| value, | |||
| nullptr); | |||
| } | |||
| #endif | |||
| if (sendCallback) | |||
| { | |||
| if (useDefault) { | |||
| engine->callback(ENGINE_CALLBACK_PARAMETER_DEFAULT_CHANGED, | |||
| id, | |||
| static_cast<int>(i), | |||
| 0, 0, | |||
| value, | |||
| nullptr); | |||
| } | |||
| engine->callback(ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED, | |||
| id, | |||
| static_cast<int>(i), | |||
| 0, 0, | |||
| value, | |||
| nullptr); | |||
| } | |||
| engine->callback(sendCallback, sendOsc, | |||
| ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED, | |||
| id, | |||
| static_cast<int>(i), | |||
| 0, 0, | |||
| value, | |||
| nullptr); | |||
| } | |||
| // may be unused | |||
| @@ -209,7 +209,8 @@ protected: | |||
| { | |||
| CARLA_SAFE_ASSERT_RETURN(std::strcmp(types, "") == 0, 0); | |||
| kEngine->callback(ENGINE_CALLBACK_UI_STATE_CHANGED, | |||
| kEngine->callback(true, true, | |||
| ENGINE_CALLBACK_UI_STATE_CHANGED, | |||
| kPlugin->getId(), | |||
| 1, | |||
| 0, 0, 0.0f, nullptr); | |||
| @@ -219,7 +220,8 @@ protected: | |||
| { | |||
| CARLA_SAFE_ASSERT_RETURN(std::strcmp(types, "") == 0, 0); | |||
| kEngine->callback(ENGINE_CALLBACK_UI_STATE_CHANGED, | |||
| kEngine->callback(true, true, | |||
| ENGINE_CALLBACK_UI_STATE_CHANGED, | |||
| kPlugin->getId(), | |||
| 0, | |||
| 0, 0, 0.0f, nullptr); | |||
| @@ -363,7 +365,8 @@ protected: | |||
| CarlaString errorString("Plugin '" + CarlaString(kPlugin->getName()) + "' has crashed!\n" | |||
| "Saving now will lose its current settings.\n" | |||
| "Please remove this plugin, and not rely on it from this point."); | |||
| kEngine->callback(CarlaBackend::ENGINE_CALLBACK_ERROR, | |||
| kEngine->callback(true, true, | |||
| ENGINE_CALLBACK_ERROR, | |||
| kPlugin->getId(), | |||
| 0, 0, 0, 0.0f, | |||
| errorString); | |||
| @@ -1421,7 +1424,8 @@ public: | |||
| break; | |||
| case kPluginBridgeNonRtServerUiClosed: | |||
| pData->engine->callback(ENGINE_CALLBACK_UI_STATE_CHANGED, | |||
| pData->engine->callback(true, true, | |||
| ENGINE_CALLBACK_UI_STATE_CHANGED, | |||
| pData->id, | |||
| 0, | |||
| 0, 0, 0.0f, nullptr); | |||
| @@ -1436,7 +1440,7 @@ public: | |||
| if (fInitiated) | |||
| { | |||
| pData->engine->callback(ENGINE_CALLBACK_ERROR, pData->id, 0, 0, 0, 0.0f, error); | |||
| pData->engine->callback(true, true, ENGINE_CALLBACK_ERROR, pData->id, 0, 0, 0, 0.0f, error); | |||
| // just in case | |||
| pData->engine->setLastError(error); | |||
| @@ -1653,20 +1657,18 @@ private: | |||
| if (wasActive) | |||
| { | |||
| #if defined(HAVE_LIBLO) && ! defined(BUILD_BRIDGE) | |||
| if (pData->engine->isOscControlRegistered()) | |||
| pData->engine->oscSend_control_set_parameter_value(pData->id, PARAMETER_ACTIVE, 0.0f); | |||
| pData->engine->callback(ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED, | |||
| pData->engine->callback(true, true, | |||
| ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED, | |||
| pData->id, | |||
| PARAMETER_ACTIVE, | |||
| 0, 0, | |||
| 0.0f, | |||
| nullptr); | |||
| #endif | |||
| } | |||
| if (pData->hints & PLUGIN_HAS_CUSTOM_UI) | |||
| pData->engine->callback(ENGINE_CALLBACK_UI_STATE_CHANGED, | |||
| pData->engine->callback(true, true, | |||
| ENGINE_CALLBACK_UI_STATE_CHANGED, | |||
| pData->id, | |||
| 0, | |||
| 0, 0, 0.0f, nullptr); | |||
| @@ -1775,7 +1777,8 @@ private: | |||
| if (needsCancelableAction) | |||
| { | |||
| pData->engine->setActionCanceled(false); | |||
| pData->engine->callback(ENGINE_CALLBACK_CANCELABLE_ACTION, | |||
| pData->engine->callback(true, true, | |||
| ENGINE_CALLBACK_CANCELABLE_ACTION, | |||
| pData->id, | |||
| 1, | |||
| 0, 0, 0.0f, | |||
| @@ -1784,7 +1787,7 @@ private: | |||
| for (;fBridgeThread.isThreadRunning();) | |||
| { | |||
| pData->engine->callback(ENGINE_CALLBACK_IDLE, 0, 0, 0, 0, 0.0f, nullptr); | |||
| pData->engine->callback(true, false, ENGINE_CALLBACK_IDLE, 0, 0, 0, 0, 0.0f, nullptr); | |||
| if (needsEngineIdle) | |||
| pData->engine->idle(); | |||
| @@ -1801,7 +1804,8 @@ private: | |||
| if (needsCancelableAction) | |||
| { | |||
| pData->engine->callback(ENGINE_CALLBACK_CANCELABLE_ACTION, | |||
| pData->engine->callback(true, true, | |||
| ENGINE_CALLBACK_CANCELABLE_ACTION, | |||
| pData->id, | |||
| 0, | |||
| 0, 0, 0.0f, | |||
| @@ -391,7 +391,8 @@ public: | |||
| if (fWindow->wasClosedByUser()) | |||
| { | |||
| showCustomUI(false); | |||
| pData->engine->callback(ENGINE_CALLBACK_UI_STATE_CHANGED, | |||
| pData->engine->callback(true, true, | |||
| ENGINE_CALLBACK_UI_STATE_CHANGED, | |||
| pData->id, | |||
| 0, | |||
| 0, 0, 0.0f, nullptr); | |||
| @@ -713,7 +714,7 @@ public: | |||
| fInstance->setCurrentProgram(pData->prog.current); | |||
| } | |||
| pData->engine->callback(ENGINE_CALLBACK_RELOAD_PROGRAMS, pData->id, 0, 0, 0, 0.0f, nullptr); | |||
| pData->engine->callback(true, true, ENGINE_CALLBACK_RELOAD_PROGRAMS, pData->id, 0, 0, 0, 0.0f, nullptr); | |||
| } | |||
| } | |||
| @@ -1171,7 +1172,7 @@ protected: | |||
| void audioProcessorChanged(juce::AudioProcessor*) override | |||
| { | |||
| pData->engine->callback(ENGINE_CALLBACK_UPDATE, pData->id, 0, 0, 0, 0.0f, nullptr); | |||
| pData->engine->callback(true, true, ENGINE_CALLBACK_UPDATE, pData->id, 0, 0, 0, 0.0f, nullptr); | |||
| } | |||
| void audioProcessorParameterChangeGestureBegin(juce::AudioProcessor*, int) override {} | |||
| @@ -1406,7 +1406,8 @@ public: | |||
| { | |||
| CARLA_SAFE_ASSERT(!yesNo); | |||
| } | |||
| pData->engine->callback(ENGINE_CALLBACK_UI_STATE_CHANGED, pData->id, 0, 0, 0, 0.0f, nullptr); | |||
| pData->engine->callback(true, true, | |||
| ENGINE_CALLBACK_UI_STATE_CHANGED, pData->id, 0, 0, 0, 0.0f, nullptr); | |||
| return; | |||
| } | |||
| @@ -1429,7 +1430,8 @@ public: | |||
| if (! fPipeServer.startPipeServer(std::min(fLv2Options.sequenceSize, 819200))) | |||
| { | |||
| pData->engine->callback(ENGINE_CALLBACK_UI_STATE_CHANGED, pData->id, 0, 0, 0, 0.0f, nullptr); | |||
| pData->engine->callback(true, true, | |||
| ENGINE_CALLBACK_UI_STATE_CHANGED, pData->id, 0, 0, 0, 0.0f, nullptr); | |||
| return; | |||
| } | |||
| @@ -1578,7 +1580,8 @@ public: | |||
| } | |||
| if (fUI.window == nullptr && fExt.uishow == nullptr) | |||
| return pData->engine->callback(ENGINE_CALLBACK_UI_STATE_CHANGED, pData->id, -1, 0, 0, 0.0f, msg); | |||
| return pData->engine->callback(true, true, | |||
| ENGINE_CALLBACK_UI_STATE_CHANGED, pData->id, -1, 0, 0, 0.0f, msg); | |||
| if (fUI.window != nullptr) | |||
| fFeatures[kFeatureIdUiParent]->data = fUI.window->getPtr(); | |||
| @@ -1609,7 +1612,8 @@ public: | |||
| fUI.handle = nullptr; | |||
| } | |||
| return pData->engine->callback(ENGINE_CALLBACK_UI_STATE_CHANGED, | |||
| return pData->engine->callback(true, true, | |||
| ENGINE_CALLBACK_UI_STATE_CHANGED, | |||
| pData->id, | |||
| -1, | |||
| 0, 0, 0.0f, | |||
| @@ -1732,7 +1736,8 @@ public: | |||
| #ifndef BUILD_BRIDGE_ALTERNATIVE_ARCH | |||
| pData->transientTryCounter = 0; | |||
| #endif | |||
| pData->engine->callback(ENGINE_CALLBACK_UI_STATE_CHANGED, | |||
| pData->engine->callback(true, true, | |||
| ENGINE_CALLBACK_UI_STATE_CHANGED, | |||
| pData->id, | |||
| 0, | |||
| 0, 0, 0.0f, nullptr); | |||
| @@ -1748,7 +1753,8 @@ public: | |||
| { | |||
| fNeedsUiClose = false; | |||
| showCustomUI(false); | |||
| pData->engine->callback(ENGINE_CALLBACK_UI_STATE_CHANGED, | |||
| pData->engine->callback(true, true, | |||
| ENGINE_CALLBACK_UI_STATE_CHANGED, | |||
| pData->id, | |||
| 0, | |||
| 0, 0, 0.0f, nullptr); | |||
| @@ -1769,7 +1775,8 @@ public: | |||
| else if (fUI.handle != nullptr && fExt.uiidle != nullptr && fExt.uiidle->idle(fUI.handle) != 0) | |||
| { | |||
| showCustomUI(false); | |||
| pData->engine->callback(ENGINE_CALLBACK_UI_STATE_CHANGED, | |||
| pData->engine->callback(true, true, | |||
| ENGINE_CALLBACK_UI_STATE_CHANGED, | |||
| pData->id, | |||
| 0, | |||
| 0, 0, 0.0f, nullptr); | |||
| @@ -2910,7 +2917,7 @@ public: | |||
| if (programChanged) | |||
| setMidiProgram(pData->midiprog.current, true, true, true, false); | |||
| pData->engine->callback(ENGINE_CALLBACK_RELOAD_PROGRAMS, pData->id, 0, 0, 0, 0.0f, nullptr); | |||
| pData->engine->callback(true, true, ENGINE_CALLBACK_RELOAD_PROGRAMS, pData->id, 0, 0, 0, 0.0f, nullptr); | |||
| } | |||
| } | |||
| @@ -4821,9 +4828,9 @@ public: | |||
| pData->midiprog.data[index].name = carla_strdup(progDesc->name); | |||
| if (index == pData->midiprog.current) | |||
| pData->engine->callback(ENGINE_CALLBACK_UPDATE, pData->id, 0, 0, 0, 0.0, nullptr); | |||
| pData->engine->callback(true, true, ENGINE_CALLBACK_UPDATE, pData->id, 0, 0, 0, 0.0, nullptr); | |||
| else | |||
| pData->engine->callback(ENGINE_CALLBACK_RELOAD_PROGRAMS, pData->id, 0, 0, 0, 0.0, nullptr); | |||
| pData->engine->callback(true, true, ENGINE_CALLBACK_RELOAD_PROGRAMS, pData->id, 0, 0, 0, 0.0, nullptr); | |||
| } | |||
| } | |||
| } | |||
| @@ -754,7 +754,8 @@ public: | |||
| if (pData->ctrlChannel == static_cast<int32_t>(channel)) | |||
| { | |||
| pData->midiprog.current = index; | |||
| pData->engine->callback(ENGINE_CALLBACK_MIDI_PROGRAM_CHANGED, | |||
| pData->engine->callback(true, true, | |||
| ENGINE_CALLBACK_MIDI_PROGRAM_CHANGED, | |||
| pData->id, | |||
| index, | |||
| 0, 0, 0.0f, nullptr); | |||
| @@ -1390,7 +1391,8 @@ public: | |||
| if (programChanged) | |||
| setMidiProgram(pData->midiprog.current, true, true, true, false); | |||
| pData->engine->callback(ENGINE_CALLBACK_RELOAD_PROGRAMS, | |||
| pData->engine->callback(true, true, | |||
| ENGINE_CALLBACK_RELOAD_PROGRAMS, | |||
| pData->id, | |||
| 0, 0, 0, 0.0f, nullptr); | |||
| } | |||
| @@ -2407,7 +2409,7 @@ protected: | |||
| void handleUiClosed() | |||
| { | |||
| pData->engine->callback(ENGINE_CALLBACK_UI_STATE_CHANGED, pData->id, 0, 0, 0, 0.0f, nullptr); | |||
| pData->engine->callback(true, true, ENGINE_CALLBACK_UI_STATE_CHANGED, pData->id, 0, 0, 0, 0.0f, nullptr); | |||
| fIsUiVisible = false; | |||
| } | |||
| @@ -2433,30 +2435,30 @@ protected: | |||
| break; | |||
| case NATIVE_HOST_OPCODE_UPDATE_PARAMETER: | |||
| // TODO | |||
| pData->engine->callback(ENGINE_CALLBACK_UPDATE, pData->id, -1, 0, 0, 0.0f, nullptr); | |||
| pData->engine->callback(true, true, ENGINE_CALLBACK_UPDATE, pData->id, -1, 0, 0, 0.0f, nullptr); | |||
| break; | |||
| case NATIVE_HOST_OPCODE_UPDATE_MIDI_PROGRAM: | |||
| // TODO | |||
| pData->engine->callback(ENGINE_CALLBACK_UPDATE, pData->id, -1, 0, 0, 0.0f, nullptr); | |||
| pData->engine->callback(true, true, ENGINE_CALLBACK_UPDATE, pData->id, -1, 0, 0, 0.0f, nullptr); | |||
| break; | |||
| case NATIVE_HOST_OPCODE_RELOAD_PARAMETERS: | |||
| reload(); // FIXME | |||
| pData->engine->callback(ENGINE_CALLBACK_RELOAD_PARAMETERS, pData->id, -1, 0, 0, 0.0f, nullptr); | |||
| pData->engine->callback(true, true, ENGINE_CALLBACK_RELOAD_PARAMETERS, pData->id, -1, 0, 0, 0.0f, nullptr); | |||
| break; | |||
| case NATIVE_HOST_OPCODE_RELOAD_MIDI_PROGRAMS: | |||
| reloadPrograms(false); | |||
| pData->engine->callback(ENGINE_CALLBACK_RELOAD_PROGRAMS, pData->id, -1, 0, 0, 0.0f, nullptr); | |||
| pData->engine->callback(true, true, ENGINE_CALLBACK_RELOAD_PROGRAMS, pData->id, -1, 0, 0, 0.0f, nullptr); | |||
| break; | |||
| case NATIVE_HOST_OPCODE_RELOAD_ALL: | |||
| reload(); | |||
| pData->engine->callback(ENGINE_CALLBACK_RELOAD_ALL, pData->id, -1, 0, 0, 0.0f, nullptr); | |||
| pData->engine->callback(true, true, ENGINE_CALLBACK_RELOAD_ALL, pData->id, -1, 0, 0, 0.0f, nullptr); | |||
| break; | |||
| case NATIVE_HOST_OPCODE_UI_UNAVAILABLE: | |||
| pData->engine->callback(ENGINE_CALLBACK_UI_STATE_CHANGED, pData->id, -1, 0, 0, 0.0f, nullptr); | |||
| pData->engine->callback(true, true, ENGINE_CALLBACK_UI_STATE_CHANGED, pData->id, -1, 0, 0, 0.0f, nullptr); | |||
| fIsUiAvailable = false; | |||
| break; | |||
| case NATIVE_HOST_OPCODE_HOST_IDLE: | |||
| pData->engine->callback(ENGINE_CALLBACK_IDLE, 0, 0, 0, 0, 0.0f, nullptr); | |||
| pData->engine->callback(true, false, ENGINE_CALLBACK_IDLE, 0, 0, 0, 0, 0.0f, nullptr); | |||
| break; | |||
| case NATIVE_HOST_OPCODE_INTERNAL_PLUGIN: | |||
| ret = 1; | |||
| @@ -41,7 +41,7 @@ static const ExternalMidiNote kExternalMidiNoteFallback = { -1, 0, 0 }; | |||
| static void loadingIdleCallbackFunction(void* ptr) | |||
| { | |||
| ((CarlaEngine*)ptr)->callback(ENGINE_CALLBACK_IDLE, 0, 0, 0, 0, 0.0f, nullptr); | |||
| ((CarlaEngine*)ptr)->callback(true, false, ENGINE_CALLBACK_IDLE, 0, 0, 0, 0, 0.0f, nullptr); | |||
| } | |||
| // ------------------------------------------------------------------------------------------------------------------- | |||
| @@ -510,7 +510,8 @@ public: | |||
| #endif | |||
| if (fUI.window == nullptr) | |||
| return pData->engine->callback(ENGINE_CALLBACK_UI_STATE_CHANGED, | |||
| return pData->engine->callback(true, true, | |||
| ENGINE_CALLBACK_UI_STATE_CHANGED, | |||
| pData->id, | |||
| -1, | |||
| 0, 0, 0.0f, | |||
| @@ -547,7 +548,8 @@ public: | |||
| fUI.window = nullptr; | |||
| carla_stderr2("Plugin refused to open its own UI"); | |||
| return pData->engine->callback(ENGINE_CALLBACK_UI_STATE_CHANGED, | |||
| return pData->engine->callback(true, true, | |||
| ENGINE_CALLBACK_UI_STATE_CHANGED, | |||
| pData->id, | |||
| -1, | |||
| 0, 0, 0.0f, | |||
| @@ -1054,7 +1056,7 @@ public: | |||
| dispatcher(effSetProgram, 0, pData->prog.current, nullptr, 0.0f); | |||
| } | |||
| pData->engine->callback(ENGINE_CALLBACK_RELOAD_PROGRAMS, pData->id, 0, 0, 0, 0.0f, nullptr); | |||
| pData->engine->callback(true, true, ENGINE_CALLBACK_RELOAD_PROGRAMS, pData->id, 0, 0, 0, 0.0f, nullptr); | |||
| } | |||
| } | |||
| @@ -1838,7 +1840,8 @@ protected: | |||
| carla_debug("CarlaPluginVST2::handlePluginUIClosed()"); | |||
| showCustomUI(false); | |||
| pData->engine->callback(ENGINE_CALLBACK_UI_STATE_CHANGED, | |||
| pData->engine->callback(true, true, | |||
| ENGINE_CALLBACK_UI_STATE_CHANGED, | |||
| pData->id, | |||
| 0, | |||
| 0, 0, 0.0f, nullptr); | |||
| @@ -1944,7 +1947,7 @@ protected: | |||
| case audioMasterIdle: | |||
| CARLA_SAFE_ASSERT_BREAK(pthread_equal(pthread_self(), fMainThread)); | |||
| pData->engine->callback(ENGINE_CALLBACK_IDLE, 0, 0, 0, 0, 0.0f, nullptr); | |||
| pData->engine->callback(true, false, ENGINE_CALLBACK_IDLE, 0, 0, 0, 0, 0.0f, nullptr); | |||
| if (pData->engine->getType() != kEngineTypePlugin) | |||
| pData->engine->idle(); | |||
| @@ -2193,7 +2196,8 @@ protected: | |||
| if (pData->prog.current != current) | |||
| { | |||
| pData->prog.current = current; | |||
| pData->engine->callback(ENGINE_CALLBACK_PROGRAM_CHANGED, | |||
| pData->engine->callback(true, true, | |||
| ENGINE_CALLBACK_PROGRAM_CHANGED, | |||
| pData->id, | |||
| current, | |||
| 0, 0, 0.0f, nullptr); | |||
| @@ -2202,7 +2206,8 @@ protected: | |||
| } | |||
| if (! fIsInitializing) | |||
| pData->engine->callback(ENGINE_CALLBACK_RELOAD_PARAMETERS, pData->id, 0, 0, 0, 0.0f, nullptr); | |||
| pData->engine->callback(true, true, | |||
| ENGINE_CALLBACK_RELOAD_PARAMETERS, pData->id, 0, 0, 0, 0.0f, nullptr); | |||
| ret = 1; | |||
| break; | |||
| @@ -162,19 +162,19 @@ class CarlaControlServer(Server): | |||
| self.host._add(pluginId) | |||
| self.host._set_pluginInfoUpdate(pluginId, {'name': pluginName}) | |||
| @make_method('/carla-control/add_plugin_end', 'i') # FIXME skip name | |||
| def add_plugin_end_callback(self, path, args): | |||
| print(path, args) | |||
| self.fReceivedMsgs = True | |||
| pluginId, = args | |||
| self.host.PluginAddedCallback.emit(pluginId, "") #self.fPluginsInfo[pluginId].pluginInfo['name']) | |||
| @make_method('/carla-control/remove_plugin', 'i') | |||
| def remove_plugin_callback(self, path, args): | |||
| print(path, args) | |||
| self.fReceivedMsgs = True | |||
| pluginId, = args | |||
| self.host.PluginRemovedCallback.emit(pluginId) | |||
| #@make_method('/carla-control/add_plugin_end', 'i') # FIXME skip name | |||
| #def add_plugin_end_callback(self, path, args): | |||
| #print(path, args) | |||
| #self.fReceivedMsgs = True | |||
| #pluginId, = args | |||
| #self.host.PluginAddedCallback.emit(pluginId, "") #self.fPluginsInfo[pluginId].pluginInfo['name']) | |||
| #@make_method('/carla-control/remove_plugin', 'i') | |||
| #def remove_plugin_callback(self, path, args): | |||
| #print(path, args) | |||
| #self.fReceivedMsgs = True | |||
| #pluginId, = args | |||
| #self.host.PluginRemovedCallback.emit(pluginId) | |||
| @make_method('/carla-control/set_plugin_info1', 'iiiih') | |||
| def set_plugin_info1_callback(self, path, args): | |||
| @@ -305,23 +305,23 @@ class CarlaControlServer(Server): | |||
| self.host._set_parameterRangesUpdate(pluginId, paramId, paramRanges) | |||
| @make_method('/carla-control/set_parameter_midi_cc', 'iii') | |||
| def set_parameter_midi_cc_callback(self, path, args): | |||
| print(path, args) | |||
| self.fReceivedMsgs = True | |||
| pluginId, paramId, cc = args | |||
| self.host._set_parameterMidiCC(pluginId, paramId, cc) | |||
| self.host.ParameterMidiCcChangedCallback.emit(pluginId, paramId, cc) | |||
| @make_method('/carla-control/set_parameter_midi_channel', 'iii') | |||
| def set_parameter_midi_channel_callback(self, path, args): | |||
| print(path, args) | |||
| self.fReceivedMsgs = True | |||
| pluginId, paramId, channel = args | |||
| self.host._set_parameterMidiChannel(pluginId, paramId, channel) | |||
| self.host.ParameterMidiChannelChangedCallback.emit(pluginId, paramId, channel) | |||
| @make_method('/carla-control/set_parameter_value', 'iif') | |||
| #@make_method('/carla-control/set_parameter_midi_cc', 'iii') | |||
| #def set_parameter_midi_cc_callback(self, path, args): | |||
| #print(path, args) | |||
| #self.fReceivedMsgs = True | |||
| #pluginId, paramId, cc = args | |||
| #self.host._set_parameterMidiCC(pluginId, paramId, cc) | |||
| #self.host.ParameterMidiCcChangedCallback.emit(pluginId, paramId, cc) | |||
| #@make_method('/carla-control/set_parameter_midi_channel', 'iii') | |||
| #def set_parameter_midi_channel_callback(self, path, args): | |||
| #print(path, args) | |||
| #self.fReceivedMsgs = True | |||
| #pluginId, paramId, channel = args | |||
| #self.host._set_parameterMidiChannel(pluginId, paramId, channel) | |||
| #self.host.ParameterMidiChannelChangedCallback.emit(pluginId, paramId, channel) | |||
| @make_method('/carla-control/set_output_parameter_value', 'iif') | |||
| def set_parameter_value_callback(self, path, args): | |||
| pluginId, paramId, paramValue = args | |||
| @@ -332,29 +332,29 @@ class CarlaControlServer(Server): | |||
| self.host.ParameterValueChangedCallback.emit(pluginId, paramId, paramValue) | |||
| @make_method('/carla-control/set_default_value', 'iif') | |||
| def set_default_value_callback(self, path, args): | |||
| print(path, args) | |||
| self.fReceivedMsgs = True | |||
| pluginId, paramId, paramValue = args | |||
| self.host._set_parameterDefault(pluginId, paramId, paramValue) | |||
| self.host.ParameterDefaultChangedCallback.emit(pluginId, paramId, paramValue) | |||
| @make_method('/carla-control/set_current_program', 'ii') | |||
| def set_current_program_callback(self, path, args): | |||
| print(path, args) | |||
| self.fReceivedMsgs = True | |||
| pluginId, current = args | |||
| self.host._set_currentProgram(pluginId, current) | |||
| self.host.ProgramChangedCallback.emit(pluginId, current) | |||
| @make_method('/carla-control/set_current_midi_program', 'ii') | |||
| def set_current_midi_program_callback(self, path, args): | |||
| print(path, args) | |||
| self.fReceivedMsgs = True | |||
| pluginId, current = args | |||
| self.host._set_currentMidiProgram(pluginId, current) | |||
| self.host.MidiProgramChangedCallback.emit(pluginId, current) | |||
| #@make_method('/carla-control/set_default_value', 'iif') | |||
| #def set_default_value_callback(self, path, args): | |||
| #print(path, args) | |||
| #self.fReceivedMsgs = True | |||
| #pluginId, paramId, paramValue = args | |||
| #self.host._set_parameterDefault(pluginId, paramId, paramValue) | |||
| #self.host.ParameterDefaultChangedCallback.emit(pluginId, paramId, paramValue) | |||
| #@make_method('/carla-control/set_current_program', 'ii') | |||
| #def set_current_program_callback(self, path, args): | |||
| #print(path, args) | |||
| #self.fReceivedMsgs = True | |||
| #pluginId, current = args | |||
| #self.host._set_currentProgram(pluginId, current) | |||
| #self.host.ProgramChangedCallback.emit(pluginId, current) | |||
| #@make_method('/carla-control/set_current_midi_program', 'ii') | |||
| #def set_current_midi_program_callback(self, path, args): | |||
| #print(path, args) | |||
| #self.fReceivedMsgs = True | |||
| #pluginId, current = args | |||
| #self.host._set_currentMidiProgram(pluginId, current) | |||
| #self.host.MidiProgramChangedCallback.emit(pluginId, current) | |||
| @make_method('/carla-control/set_program_name', 'iis') | |||
| def set_program_name_callback(self, path, args): | |||
| @@ -370,19 +370,19 @@ class CarlaControlServer(Server): | |||
| pluginId, midiProgId, bank, program, name = args | |||
| self.host._set_midiProgramData(pluginId, midiProgId, {'bank': bank, 'program': program, 'name': name}) | |||
| @make_method('/carla-control/note_on', 'iiii') | |||
| def set_note_on_callback(self, path, args): | |||
| print(path, args) | |||
| self.fReceivedMsgs = True | |||
| pluginId, channel, note, velocity = args | |||
| self.host.NoteOnCallback.emit(pluginId, channel, note, velocity) | |||
| #@make_method('/carla-control/note_on', 'iiii') | |||
| #def set_note_on_callback(self, path, args): | |||
| #print(path, args) | |||
| #self.fReceivedMsgs = True | |||
| #pluginId, channel, note, velocity = args | |||
| #self.host.NoteOnCallback.emit(pluginId, channel, note, velocity) | |||
| @make_method('/carla-control/note_off', 'iii') | |||
| def set_note_off_callback(self, path, args): | |||
| print(path, args) | |||
| self.fReceivedMsgs = True | |||
| pluginId, channel, note = args | |||
| self.host.NoteOffCallback.emit(pluginId, channel, note) | |||
| #@make_method('/carla-control/note_off', 'iii') | |||
| #def set_note_off_callback(self, path, args): | |||
| #print(path, args) | |||
| #self.fReceivedMsgs = True | |||
| #pluginId, channel, note = args | |||
| #self.host.NoteOffCallback.emit(pluginId, channel, note) | |||
| @make_method('/carla-control/set_peaks', 'iffff') | |||
| def set_peaks_callback(self, path, args): | |||
| @@ -405,6 +405,13 @@ class CarlaControlServer(Server): | |||
| self.host.QuitCallback.emit() | |||
| self.host.ErrorCallback.emit(error) | |||
| @make_method('/carla-control/callback', 'iiiiifs') | |||
| def set_callback_callback(self, path, args): | |||
| print(path, args) | |||
| self.fReceivedMsgs = True | |||
| action, pluginId, value1, value2, value3, valuef, valueStr = args | |||
| engineCallback(self.host, action, pluginId, value1, value2, value3, valuef, valueStr) | |||
| @make_method(None, None) | |||
| def fallback(self, path, args): | |||
| print("ControlServer::fallback(\"%s\") - unknown message, args =" % path, args) | |||
| @@ -415,7 +422,7 @@ class CarlaControlServer(Server): | |||
| class HostWindowOSC(HostWindow): | |||
| def __init__(self, host, oscAddr): | |||
| HostWindow.__init__(self, host, False) | |||
| HostWindow.__init__(self, host, True) | |||
| self.host = host | |||
| if False: | |||
| @@ -607,7 +614,10 @@ class HostWindowOSC(HostWindow): | |||
| self.killTimers() | |||
| if self.host.lo_target is not None and self.fOscServer is not None: | |||
| lo_send(self.host.lo_target, "/unregister", self.fOscServer.getFullURL()) | |||
| try: | |||
| lo_send(self.host.lo_target, "/unregister", self.fOscServer.getFullURL()) | |||
| except: | |||
| pass | |||
| HostWindow.closeEvent(self, event) | |||
| @@ -208,7 +208,6 @@ class HostWindow(QMainWindow): | |||
| self.ui.menu_Engine.setEnabled(False) | |||
| self.ui.menu_Engine.setVisible(False) | |||
| self.ui.menu_Engine.menuAction().setVisible(False) | |||
| self.ui.tabWidget.removeTab(2) | |||
| if self.host.isControl: | |||
| self.ui.act_file_new.setVisible(False) | |||
| @@ -223,10 +222,12 @@ class HostWindow(QMainWindow): | |||
| self.ui.menu_Plugin.setEnabled(False) | |||
| self.ui.menu_Plugin.setVisible(False) | |||
| self.ui.menu_Plugin.menuAction().setVisible(False) | |||
| self.ui.tw_statusbar.setEnabled(False) | |||
| self.ui.tw_statusbar.setVisible(False) | |||
| self.ui.tabUtils.removeTab(0) | |||
| #self.ui.tw_statusbar.setEnabled(False) | |||
| #self.ui.tw_statusbar.setVisible(False) | |||
| else: | |||
| self.ui.act_file_save_as.setText(self.tr("Export as...")) | |||
| self.ui.tabWidget.removeTab(2) | |||
| else: | |||
| self.ui.act_engine_start.setEnabled(True) | |||
| @@ -324,7 +325,7 @@ class HostWindow(QMainWindow): | |||
| self.ui.l_transport_frame.setMinimumWidth(minValueWidth + 3) | |||
| self.ui.l_transport_time.setMinimumWidth(minValueWidth + 3) | |||
| if host.isControl or host.isPlugin: | |||
| if host.isPlugin: | |||
| self.ui.b_transport_play.setEnabled(False) | |||
| self.ui.b_transport_stop.setEnabled(False) | |||
| self.ui.b_transport_backwards.setEnabled(False) | |||
| @@ -561,7 +562,7 @@ class HostWindow(QMainWindow): | |||
| self.ui.tabWidget.blockSignals(False) | |||
| # Start in patchbay tab if using forced patchbay mode | |||
| if host.processModeForced and host.processMode == ENGINE_PROCESS_MODE_PATCHBAY and not host.isControl: | |||
| if host.processModeForced and host.processMode == ENGINE_PROCESS_MODE_PATCHBAY: | |||
| self.ui.tabWidget.setCurrentIndex(1) | |||
| # Load initial project file if set | |||
| @@ -913,7 +914,7 @@ class HostWindow(QMainWindow): | |||
| self.ui.act_canvas_show_internal.blockSignals(True) | |||
| self.ui.act_canvas_show_external.blockSignals(True) | |||
| if processMode == ENGINE_PROCESS_MODE_PATCHBAY and not (self.host.isControl or self.host.isPlugin): | |||
| if processMode == ENGINE_PROCESS_MODE_PATCHBAY and not self.host.isPlugin: | |||
| self.ui.act_canvas_show_internal.setChecked(True) | |||
| self.ui.act_canvas_show_internal.setVisible(True) | |||
| self.ui.act_canvas_show_external.setChecked(False) | |||
| @@ -932,6 +933,8 @@ class HostWindow(QMainWindow): | |||
| self.ui.act_file_save.setEnabled(canSave) | |||
| self.ui.act_engine_start.setEnabled(False) | |||
| self.ui.act_engine_stop.setEnabled(True) | |||
| if not self.host.isPlugin: | |||
| self.enableTransport(transportMode != ENGINE_TRANSPORT_MODE_DISABLED) | |||
| if self.host.isPlugin or not self.fSessionManagerName: | |||
| @@ -1398,7 +1401,7 @@ class HostWindow(QMainWindow): | |||
| def slot_canvasRefresh(self): | |||
| patchcanvas.clear() | |||
| if self.host.processMode == ENGINE_PROCESS_MODE_CONTINUOUS_RACK and (self.host.isControl or self.host.isPlugin): | |||
| if self.host.processMode == ENGINE_PROCESS_MODE_CONTINUOUS_RACK and self.host.isPlugin: | |||
| return | |||
| if self.host.is_engine_running(): | |||
| @@ -1599,9 +1602,7 @@ class HostWindow(QMainWindow): | |||
| settings.setValue("Geometry", self.saveGeometry()) | |||
| settings.setValue("ShowToolbar", self.ui.toolBar.isEnabled()) | |||
| if not self.host.isControl: | |||
| settings.setValue("ShowSidePanel", self.ui.dockWidget.isEnabled()) | |||
| settings.setValue("ShowSidePanel", self.ui.dockWidget.isEnabled()) | |||
| diskFolders = [] | |||
| @@ -1637,7 +1638,7 @@ class HostWindow(QMainWindow): | |||
| #else: | |||
| #self.ui.splitter.setSizes([210, 99999]) | |||
| showSidePanel = settings.value("ShowSidePanel", True, type=bool) and not self.host.isControl | |||
| showSidePanel = settings.value("ShowSidePanel", True, type=bool) | |||
| self.ui.act_settings_show_side_panel.setChecked(showSidePanel) | |||
| self.slot_showSidePanel(showSidePanel) | |||
| @@ -1098,7 +1098,7 @@ void CarlaJackAppClient::runNonRealtimeThread() | |||
| */ | |||
| } | |||
| //callback(ENGINE_CALLBACK_ENGINE_STOPPED, 0, 0, 0, 0.0f, nullptr); | |||
| //callback(true, true, ENGINE_CALLBACK_ENGINE_STOPPED, 0, 0, 0, 0.0f, nullptr); | |||
| if (quitReceived) | |||
| { | |||