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 87ae4cd280
commit 3002d2256e
7 changed files with 176 additions and 29 deletions

View File

@@ -52,7 +52,7 @@ XmlSettings *get_xml_settings (guint id, guint position)
}
gchar *
map_xml_value(XmlSettings *xml, gint value)
map_xml_value (XmlSettings *xml, gint value)
{
switch (xml->values->type) {
case VALUE_TYPE_LABEL:
@@ -84,9 +84,9 @@ map_xml_value(XmlSettings *xml, gint value)
return NULL;
}
gboolean value_is_extra (EffectValues *val, SettingParam *param)
gboolean value_is_extra (EffectValues *val, int value)
{
if ((param->value < val->min) || (param->value > val->max)) {
if ((value < val->min) || (value > val->max)) {
return TRUE;
}
return FALSE;
@@ -176,7 +176,7 @@ write_preset_to_xml(Preset *preset, gchar *filename)
BAD_CAST xml->label);
values = xml->values;
type = values->type;
while ((type & VALUE_TYPE_EXTRA) && value_is_extra(values, param)) {
while ((type & VALUE_TYPE_EXTRA) && value_is_extra(values, param->value)) {
values = values->extra;
type = values->type;
}