Browse Source

Enable code for non-jack drivers, kinda (weird mem issue lurking)

tags/1.9.4
falkTX 10 years ago
parent
commit
5287f2b838
3 changed files with 57 additions and 20 deletions
  1. +53
    -20
      source/backend/engine/CarlaEngineGraph.cpp
  2. +2
    -0
      source/backend/engine/CarlaEngineInternal.cpp
  3. +2
    -0
      source/backend/engine/CarlaEngineRtAudio.cpp

+ 53
- 20
source/backend/engine/CarlaEngineGraph.cpp View File

@@ -1295,21 +1295,37 @@ void EngineInternalGraph::processRack(CarlaEngine::ProtectedData* const data, co
bool CarlaEngine::patchbayConnect(const uint groupA, const uint portA, const uint groupB, const uint portB)
{
CARLA_SAFE_ASSERT_RETURN(pData->options.processMode == ENGINE_PROCESS_MODE_CONTINUOUS_RACK || pData->options.processMode == ENGINE_PROCESS_MODE_PATCHBAY, false);
//CARLA_SAFE_ASSERT_RETURN(pData->graph.isReady, false);
//CARLA_SAFE_ASSERT_RETURN(pData->graph.graph != nullptr, false);
CARLA_SAFE_ASSERT_RETURN(pData->graph.isReady(), false);
carla_stdout("CarlaEngine::patchbayConnect(%u, %u, %u, %u)", groupA, portA, groupB, portB);

return false; //pData->graph.graph->connect(this, groupA, portA, groupB, portB);
if (pData->options.processMode == ENGINE_PROCESS_MODE_CONTINUOUS_RACK)
{
if (RackGraph* const graph = pData->graph.getRackGraph())
return graph->connect(this, groupA, portA, groupB, portB);
}
else
{
}

return false;
}

bool CarlaEngine::patchbayDisconnect(const uint connectionId)
{
CARLA_SAFE_ASSERT_RETURN(pData->options.processMode == ENGINE_PROCESS_MODE_CONTINUOUS_RACK || pData->options.processMode == ENGINE_PROCESS_MODE_PATCHBAY, false);
//CARLA_SAFE_ASSERT_RETURN(pData->graph.isReady, false);
//CARLA_SAFE_ASSERT_RETURN(pData->graph.graph != nullptr, false);
CARLA_SAFE_ASSERT_RETURN(pData->graph.isReady(), false);
carla_stdout("CarlaEngine::patchbayDisconnect(%u)", connectionId);

return false; //pData->graph.graph->disconnect(this, connectionId);
if (pData->options.processMode == ENGINE_PROCESS_MODE_CONTINUOUS_RACK)
{
if (RackGraph* const graph = pData->graph.getRackGraph())
return graph->disconnect(this, connectionId);
}
else
{
}

return false;
}

bool CarlaEngine::patchbayRefresh()
@@ -1322,30 +1338,47 @@ bool CarlaEngine::patchbayRefresh()

const char* const* CarlaEngine::getPatchbayConnections() const
{
//CARLA_SAFE_ASSERT_RETURN(pData->graph.isReady, nullptr);
//CARLA_SAFE_ASSERT_RETURN(pData->graph.graph != nullptr, nullptr);
CARLA_SAFE_ASSERT_RETURN(pData->graph.isReady(), nullptr);
carla_debug("CarlaEngine::getPatchbayConnections()");

return nullptr; //pData->graph.graph->getConnections();
if (pData->options.processMode == ENGINE_PROCESS_MODE_CONTINUOUS_RACK)
{
if (RackGraph* const graph = pData->graph.getRackGraph())
return graph->getConnections();
}
else
{
}

return nullptr;
}

void CarlaEngine::restorePatchbayConnection(const char* const connSource, const char* const connTarget)
{
//CARLA_SAFE_ASSERT_RETURN(pData->graph.isReady,);
//CARLA_SAFE_ASSERT_RETURN(pData->graph.graph != nullptr,);
CARLA_SAFE_ASSERT_RETURN(pData->graph.isReady(),);
CARLA_SAFE_ASSERT_RETURN(connSource != nullptr && connSource[0] != '\0',);
CARLA_SAFE_ASSERT_RETURN(connTarget != nullptr && connTarget[0] != '\0',);
carla_debug("CarlaEngine::restorePatchbayConnection(\"%s\", \"%s\")", connSource, connTarget);

// uint groupA, portA;
// uint groupB, portB;
//
// if (! pData->graph.graph->getPortIdFromFullName(connSource, groupA, portA))
// return;
// if (! pData->graph.graph->getPortIdFromFullName(connTarget, groupB, portB))
// return;
//
// patchbayConnect(groupA, portA, groupB, portB);
uint groupA, portA;
uint groupB, portB;

if (pData->options.processMode == ENGINE_PROCESS_MODE_CONTINUOUS_RACK)
{
RackGraph* const graph = pData->graph.getRackGraph();
CARLA_SAFE_ASSERT_RETURN(graph != nullptr,);

if (! graph->getGroupAndPortIdFromFullName(connSource, groupA, portA))
return;
if (! graph->getGroupAndPortIdFromFullName(connTarget, groupB, portB))
return;
}
else
{
return;
}

patchbayConnect(groupA, portA, groupB, portB);
}

// -----------------------------------------------------------------------


+ 2
- 0
source/backend/engine/CarlaEngineInternal.cpp View File

@@ -152,6 +152,8 @@ bool CarlaEngine::ProtectedData::init(const char* const clientName)

case ENGINE_PROCESS_MODE_PATCHBAY:
maxPluginNumber = MAX_PATCHBAY_PLUGINS;
events.in = new EngineEvent[kMaxEngineEventInternalCount];
events.out = new EngineEvent[kMaxEngineEventInternalCount];
break;

case ENGINE_PROCESS_MODE_BRIDGE:


+ 2
- 0
source/backend/engine/CarlaEngineRtAudio.cpp View File

@@ -582,6 +582,8 @@ public:

void patchbayRefreshPatchbay() noexcept
{
PatchbayGraph* const graph(pData->graph.getPatchbayGraph());
CARLA_SAFE_ASSERT_RETURN(graph != nullptr,);
}

// -------------------------------------------------------------------


Loading…
Cancel
Save