Browse Source

Always load patchbay connections when importing a carla project

This ignores SM, as it should for this specific case

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.2.0-RC1
falkTX 4 years ago
parent
commit
743ed07ac7
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
3 changed files with 19 additions and 12 deletions
  1. +1
    -1
      source/backend/CarlaEngine.hpp
  2. +17
    -10
      source/backend/engine/CarlaEngine.cpp
  3. +1
    -1
      source/backend/engine/CarlaEngineNative.cpp

+ 1
- 1
source/backend/CarlaEngine.hpp View File

@@ -1345,7 +1345,7 @@ protected:
/*! /*!
* Common load project function for main engine and plugin. * Common load project function for main engine and plugin.
*/ */
bool loadProjectInternal(water::XmlDocument& xmlDoc);
bool loadProjectInternal(water::XmlDocument& xmlDoc, bool alwaysLoadConnections);


// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Helper functions // Helper functions


+ 17
- 10
source/backend/engine/CarlaEngine.cpp View File

@@ -1281,7 +1281,7 @@ bool CarlaEngine::loadProject(const char* const filename, const bool setAsCurren
} }


XmlDocument xml(file); XmlDocument xml(file);
return loadProjectInternal(xml);
return loadProjectInternal(xml, !setAsCurrentProject);
} }


bool CarlaEngine::saveProject(const char* const filename, const bool setAsCurrentProject) bool CarlaEngine::saveProject(const char* const filename, const bool setAsCurrentProject)
@@ -2499,7 +2499,7 @@ static String findBinaryInCustomPath(const char* const searchPath, const char* c
return String(); return String();
} }


bool CarlaEngine::loadProjectInternal(water::XmlDocument& xmlDoc)
bool CarlaEngine::loadProjectInternal(water::XmlDocument& xmlDoc, const bool alwaysLoadConnections)
{ {
CarlaScopedPointer<XmlElement> xmlElement(xmlDoc.getDocumentElement(true)); CarlaScopedPointer<XmlElement> xmlElement(xmlDoc.getDocumentElement(true));
CARLA_SAFE_ASSERT_RETURN_ERR(xmlElement != nullptr, "Failed to parse project file"); CARLA_SAFE_ASSERT_RETURN_ERR(xmlElement != nullptr, "Failed to parse project file");
@@ -3003,16 +3003,23 @@ bool CarlaEngine::loadProjectInternal(water::XmlDocument& xmlDoc)
// if we're running inside some session-manager (and using JACK), let them handle the external connections // if we're running inside some session-manager (and using JACK), let them handle the external connections
bool loadExternalConnections; bool loadExternalConnections;


/**/ if (std::strcmp(getCurrentDriverName(), "JACK") != 0)
if (alwaysLoadConnections)
{
loadExternalConnections = true; loadExternalConnections = true;
else if (std::getenv("CARLA_DONT_MANAGE_CONNECTIONS") != nullptr)
loadExternalConnections = false;
else if (std::getenv("LADISH_APP_NAME") != nullptr)
loadExternalConnections = false;
else if (std::getenv("NSM_URL") != nullptr)
loadExternalConnections = false;
}
else else
loadExternalConnections = true;
{
/**/ if (std::strcmp(getCurrentDriverName(), "JACK") != 0)
loadExternalConnections = true;
else if (std::getenv("CARLA_DONT_MANAGE_CONNECTIONS") != nullptr)
loadExternalConnections = false;
else if (std::getenv("LADISH_APP_NAME") != nullptr)
loadExternalConnections = false;
else if (std::getenv("NSM_URL") != nullptr)
loadExternalConnections = false;
else
loadExternalConnections = true;
}


// plus external connections too // plus external connections too
if (loadExternalConnections) if (loadExternalConnections)


+ 1
- 1
source/backend/engine/CarlaEngineNative.cpp View File

@@ -1536,7 +1536,7 @@ protected:
fOptionsForced = true; fOptionsForced = true;
const String state(data); const String state(data);
XmlDocument xml(state); XmlDocument xml(state);
loadProjectInternal(xml);
loadProjectInternal(xml, true);


reloadFromUI(); reloadFromUI();
} }


Loading…
Cancel
Save