Browse Source

Better error reporting regarding missing clients during load

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.2.0-RC1
falkTX 4 years ago
parent
commit
0463d8f1b7
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
2 changed files with 26 additions and 27 deletions
  1. +25
    -27
      source/backend/engine/CarlaEngineJack.cpp
  2. +1
    -0
      source/includes/CarlaDefines.h

+ 25
- 27
source/backend/engine/CarlaEngineJack.cpp View File

@@ -2688,12 +2688,12 @@ public:
bool restorePatchbayGroupPosition(const bool external, PatchbayPosition& ppos) override
{
CARLA_SAFE_ASSERT_RETURN(fClient != nullptr, false);
carla_debug("CarlaEngineJack::restorePatchbayGroupPosition(%s, ...)", bool2str(external));
carla_debug("CarlaEngineJack::restorePatchbayGroupPosition(%s, {%i, %i, %i, %i, %i, \"%s\"})",
bool2str(external), ppos.pluginId, ppos.x1, ppos.y1, ppos.x2, ppos.y2, ppos.name);

if (pData->options.processMode == ENGINE_PROCESS_MODE_PATCHBAY && ! external)
return CarlaEngine::restorePatchbayGroupPosition(external, ppos);

bool hasGroups = true;
uint groupId = 0;
const char* const orig_name = ppos.name;

@@ -2717,16 +2717,13 @@ public:
ppos.dealloc = true;
}

for (int i=10; --i >=0;)
for (int i=20; --i >=0;)
{
{
const CarlaMutexLocker cml(fUsedGroups.mutex);

if (fUsedGroups.list.count() == 0)
{
hasGroups = false;
break;
}

groupId = fUsedGroups.getGroupId(ppos.name);
}
@@ -2734,7 +2731,7 @@ public:
if (groupId != 0)
break;

carla_msleep(200);
carla_msleep(100);
callback(true, true, ENGINE_CALLBACK_IDLE, 0, 0, 0, 0, 0.0f, nullptr);
}
}
@@ -2744,34 +2741,35 @@ public:

if (fUsedGroups.list.count() != 0)
groupId = fUsedGroups.getGroupId(ppos.name);
else
hasGroups = false;
}

if (hasGroups) {
CARLA_SAFE_ASSERT(groupId != 0);
if (groupId == 0)
{
carla_stdout("NOTICE: Previously saved client '%s' not found", ppos.name);
}

for (;;)
else
{
const CarlaRecursiveMutexLocker crml(fThreadSafeMetadataMutex);

jack_uuid_t uuid;
for (;;)
{
char* const uuidstr = jackbridge_get_uuid_for_client_name(fClient, ppos.name);
CARLA_SAFE_ASSERT_BREAK(uuidstr != nullptr && uuidstr[0] != '\0');
const CarlaRecursiveMutexLocker crml(fThreadSafeMetadataMutex);

const bool parsed = jackbridge_uuid_parse(uuidstr, &uuid);
jackbridge_free(uuidstr);
CARLA_CUSTOM_SAFE_ASSERT_ONCE_BREAK("JACK meta-data support unavailable", parsed);
}
jack_uuid_t uuid;
{
char* const uuidstr = jackbridge_get_uuid_for_client_name(fClient, ppos.name);
CARLA_SAFE_ASSERT_BREAK(uuidstr != nullptr && uuidstr[0] != '\0');

char valueStr[STR_MAX];
std::snprintf(valueStr, STR_MAX-1, "%i:%i:%i:%i", ppos.x1, ppos.y1, ppos.x2, ppos.y2);
valueStr[STR_MAX-1] = '\0';
const bool parsed = jackbridge_uuid_parse(uuidstr, &uuid);
jackbridge_free(uuidstr);
CARLA_CUSTOM_SAFE_ASSERT_ONCE_BREAK("JACK meta-data support unavailable", parsed);
}

jackbridge_set_property(fClient, uuid, URI_POSITION, valueStr, URI_TYPE_STRING);
break;
char valueStr[STR_MAX];
std::snprintf(valueStr, STR_MAX-1, "%i:%i:%i:%i", ppos.x1, ppos.y1, ppos.x2, ppos.y2);
valueStr[STR_MAX-1] = '\0';

jackbridge_set_property(fClient, uuid, URI_POSITION, valueStr, URI_TYPE_STRING);
break;
}
}

# if 0


+ 1
- 0
source/includes/CarlaDefines.h View File

@@ -175,6 +175,7 @@
#define CARLA_SAFE_ASSERT_CONTINUE(cond) if (! (cond)) { carla_safe_assert(#cond, __FILE__, __LINE__); continue; }
#define CARLA_SAFE_ASSERT_RETURN(cond, ret) if (! (cond)) { carla_safe_assert(#cond, __FILE__, __LINE__); return ret; }

#define CARLA_CUSTOM_SAFE_ASSERT(msg, cond) if (! (cond)) carla_custom_safe_assert(msg, #cond, __FILE__, __LINE__);
#define CARLA_CUSTOM_SAFE_ASSERT_BREAK(msg, cond) if (! (cond)) { carla_custom_safe_assert(msg, #cond, __FILE__, __LINE__); break; }
#define CARLA_CUSTOM_SAFE_ASSERT_CONTINUE(msg, cond) if (! (cond)) { carla_custom_safe_assert(msg, #cond, __FILE__, __LINE__); continue; }
#define CARLA_CUSTOM_SAFE_ASSERT_RETURN(msg, cond, ret) if (! (cond)) { carla_custom_safe_assert(msg, #cond, __FILE__, __LINE__); return ret; }


Loading…
Cancel
Save