Human readable debug

Leverage the code that writes a preset to XML so that messages
can be displayed in a human readable format.

E.g.,

(6, 2432, 1280)  Distortion: Dist Type: Screamer

The 3-tuple is position, id, value, which is followed by the
colon separated decode of the position, id, and the mapped value.
This commit is contained in:
Tim LaBerge
2012-04-06 08:57:08 -07:00
parent 1205a1639d
commit ea80320531
7 changed files with 177 additions and 36 deletions

View File

@@ -330,10 +330,11 @@ Preset *create_preset_from_data(GList *list)
SettingParam *param = setting_param_new_from_data(&data->str[x], &x);
n++;
preset->params = g_list_prepend(preset->params, param);
debug_msg(DEBUG_MSG2HOST, "%3d ID %4d Position %2d "
"Value %6.1d",
n, param->id, param->position,
param->value);
if (debug_flag_is_set(DEBUG_MSG2HOST)) {
GString *ipv = format_ipv(param->id, param->position, param->value);
debug_msg(DEBUG_MSG2HOST, "%3d %s", n, ipv->str);
g_string_free(ipv, TRUE);
}
} while ((x < data->len) && n<total);
debug_msg(DEBUG_MSG2HOST, "TOTAL %d", total);
preset->params = g_list_sort(preset->params, params_cmp);