From 49b1bec938fba1cbfb4cbcc79252b810042b3ec8 Mon Sep 17 00:00:00 2001 From: falkTX Date: Wed, 25 Dec 2019 23:31:06 +0000 Subject: [PATCH] Cleanup previous test stuff --- source/backend/engine/CarlaEngine.cpp | 6 +++--- source/backend/engine/CarlaEngineGraph.cpp | 17 +++++++++-------- source/backend/engine/CarlaEngineGraph.hpp | 2 +- source/backend/engine/CarlaEngineInternal.hpp | 2 +- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/source/backend/engine/CarlaEngine.cpp b/source/backend/engine/CarlaEngine.cpp index f40305f9c..dc3cfbffa 100644 --- a/source/backend/engine/CarlaEngine.cpp +++ b/source/backend/engine/CarlaEngine.cpp @@ -711,7 +711,7 @@ bool CarlaEngine::addPlugin(const BinaryType btype, #ifndef BUILD_BRIDGE_ALTERNATIVE_ARCH if (pData->options.processMode == ENGINE_PROCESS_MODE_PATCHBAY) - pData->graph.addPlugin(plugin, 1); + pData->graph.addPlugin(plugin); #endif } @@ -2579,7 +2579,7 @@ bool CarlaEngine::loadProjectInternal(water::XmlDocument& xmlDoc) 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, 1); + pData->graph.addPlugin(plugin); } else { @@ -2722,7 +2722,7 @@ bool CarlaEngine::loadProjectInternal(water::XmlDocument& xmlDoc) #ifndef BUILD_BRIDGE_ALTERNATIVE_ARCH if (pData->options.processMode == ENGINE_PROCESS_MODE_PATCHBAY) - pData->graph.addPlugin(plugin, 1); + pData->graph.addPlugin(plugin); #endif } else diff --git a/source/backend/engine/CarlaEngineGraph.cpp b/source/backend/engine/CarlaEngineGraph.cpp index 455e17e0a..7b1e1769d 100644 --- a/source/backend/engine/CarlaEngineGraph.cpp +++ b/source/backend/engine/CarlaEngineGraph.cpp @@ -1796,14 +1796,14 @@ void PatchbayGraph::setOffline(const bool offline) graph.setNonRealtime(offline); } -AudioProcessorGraph::Node* PatchbayGraph::addPlugin(CarlaPlugin* const plugin, bool) +void PatchbayGraph::addPlugin(CarlaPlugin* const plugin) { - CARLA_SAFE_ASSERT_RETURN(plugin != nullptr, nullptr); + CARLA_SAFE_ASSERT_RETURN(plugin != nullptr,); carla_debug("PatchbayGraph::addPlugin(%p)", plugin); CarlaPluginInstance* const instance(new CarlaPluginInstance(kEngine, plugin)); AudioProcessorGraph::Node* const node(graph.addNode(instance)); - CARLA_SAFE_ASSERT_RETURN(node != nullptr, nullptr); + CARLA_SAFE_ASSERT_RETURN(node != nullptr,); const bool sendHost = !usingExternalHost; const bool sendOSC = !usingExternalOSC; @@ -1814,8 +1814,6 @@ AudioProcessorGraph::Node* PatchbayGraph::addPlugin(CarlaPlugin* const plugin, b node->properties.set("pluginId", static_cast(plugin->getId())); addNodeToPatchbay(sendHost, sendOSC, kEngine, node->nodeId, static_cast(plugin->getId()), instance); - - return node; } void PatchbayGraph::replacePlugin(CarlaPlugin* const oldPlugin, CarlaPlugin* const newPlugin) @@ -1873,6 +1871,9 @@ void PatchbayGraph::reconfigureForCV(CarlaPlugin* const plugin, const uint portI CARLA_SAFE_ASSERT_RETURN(plugin != nullptr,); carla_debug("PatchbayGraph::reconfigureForCV(%p, %u, %s)", plugin, portIndex, bool2str(added)); + if (graph.isSuspended()) + return; + AudioProcessorGraph::Node* const node = graph.getNodeForId(plugin->getPatchbayNodeId()); CARLA_SAFE_ASSERT_RETURN(node != nullptr,); @@ -2517,10 +2518,10 @@ void EngineInternalGraph::processRack(CarlaEngine::ProtectedData* const data, co // ----------------------------------------------------------------------- // used for internal patchbay mode -water::AudioProcessorGraph::Node* EngineInternalGraph::addPlugin(CarlaPlugin* const plugin, bool x) +void EngineInternalGraph::addPlugin(CarlaPlugin* const plugin) { - CARLA_SAFE_ASSERT_RETURN(fPatchbay != nullptr, nullptr); - return fPatchbay->addPlugin(plugin, x); + CARLA_SAFE_ASSERT_RETURN(fPatchbay != nullptr,); + fPatchbay->addPlugin(plugin); } void EngineInternalGraph::replacePlugin(CarlaPlugin* const oldPlugin, CarlaPlugin* const newPlugin) diff --git a/source/backend/engine/CarlaEngineGraph.hpp b/source/backend/engine/CarlaEngineGraph.hpp index 033bdf33b..14436e7c2 100644 --- a/source/backend/engine/CarlaEngineGraph.hpp +++ b/source/backend/engine/CarlaEngineGraph.hpp @@ -179,7 +179,7 @@ public: void setSampleRate(double sampleRate); void setOffline(bool offline); - AudioProcessorGraph::Node* addPlugin(CarlaPlugin* plugin, bool); + void addPlugin(CarlaPlugin* plugin); void replacePlugin(CarlaPlugin* oldPlugin, CarlaPlugin* newPlugin); void renamePlugin(CarlaPlugin* plugin, const char* newName); void reconfigureForCV(CarlaPlugin* const plugin, const uint portIndex, bool added); diff --git a/source/backend/engine/CarlaEngineInternal.hpp b/source/backend/engine/CarlaEngineInternal.hpp index 44852a579..3358b47f4 100644 --- a/source/backend/engine/CarlaEngineInternal.hpp +++ b/source/backend/engine/CarlaEngineInternal.hpp @@ -95,7 +95,7 @@ public: void processRack(CarlaEngine::ProtectedData* data, const float* inBuf[2], float* outBuf[2], uint32_t frames); // used for internal patchbay mode - water::AudioProcessorGraph::Node* addPlugin(CarlaPlugin* plugin, bool); + void addPlugin(CarlaPlugin* plugin); void replacePlugin(CarlaPlugin* oldPlugin, CarlaPlugin* newPlugin); void renamePlugin(CarlaPlugin* plugin, const char* newName); void removePlugin(CarlaPlugin* plugin);