From f1aa3665ed9137806c21262ea222a2a6c2b05e03 Mon Sep 17 00:00:00 2001 From: Tim LaBerge Date: Wed, 25 Dec 2013 13:52:15 -0800 Subject: [PATCH] Support for RP1000 1) Add missing support for DELAY_TAP_TIME, DELAY_MULTIPLIER, and AMP_LOOP_ON_OFF. 2) Add a warning when get_modifier() fails. 3) In update_modifier_linkable_list(), set label to "Unknown" when the lookup of a modfier fails. 4) In format ipv(), the warning message that's emitted if get_xml_settings() fails reversed position and id. 5) In update_modifier_vbox(), remove the assert that the group label is not null. Set the combo box text to "Unknown". --- effects.c | 22 +++++++++++++++++++++- gdigi.c | 2 +- gui.c | 8 ++++++-- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/effects.c b/effects.c index 47abe53..8b6dede 100644 --- a/effects.c +++ b/effects.c @@ -637,6 +637,11 @@ static EffectValues values_delay_type = { .type = VALUE_TYPE_LABEL, }; +static EffectValues values_delay_multiplier = { + .min = 2176.0, .max = 2180.0, + .type = VALUE_TYPE_LABEL, +}; + static EffectValues values_reverb_type = { .min = 1107.0, .max = 1151.0, .type = VALUE_TYPE_LABEL, @@ -3389,6 +3394,7 @@ static Modifier modifiers[] = { {"Amp B Enable", AMP_ON_OFF, AMP_B_POSITION, &values_on_off}, {"Amp B Gain", AMP_GAIN, AMP_B_POSITION, &values_0_to_99}, {"Amp B Level", AMP_LEVEL, AMP_B_POSITION, &values_0_to_99}, + {"Amp Loop Enable", AMP_LOOP_ON_OFF, AMP_LOOP_POSITION, &values_on_off}, {"EQ Enable", EQ_ENABLE, EQ_A_POSITION, &values_on_off}, {"EQ Bass", EQ_BASS, EQ_A_POSITION, &values_eq_db}, {"EQ Mid", EQ_MID, EQ_A_POSITION, &values_eq_db}, @@ -3838,6 +3844,14 @@ static XmlLabel xml_delay_labels[] = { {DELAY_GNX3K_TYPE_SPREAD, "Spread"}, }; +static XmlLabel xml_delay_multiplier_labels[] = { + {DELAY_HALF, "Half"}, + {DELAY_QUARTER, "Quarter"}, + {DELAY_DOTEIGHT, "DotEight"}, + {DELAY_EIGHT, "Eight"}, + {DELAY_3_QUARTR, "3 Quarter"}, +}; + static XmlLabel xml_reverb_labels[] = { {REVERB_TYPE_TWIN, "Twin"}, {REVERB_TYPE_LEX_AMBIENCE, "Lexicon Ambience"}, @@ -4172,6 +4186,8 @@ XmlSettings xml_settings[] = { {AMP_CAB_TYPE, AMP_CAB_POSITION, "Cab A Type", &values_cab_type, xml_amp_cab_labels, G_N_ELEMENTS(xml_amp_cab_labels)}, {AMP_CAB_TYPE, AMP_CAB_B_POSITION, "Cab B Type", &values_cab_type, xml_amp_cab_labels, G_N_ELEMENTS(xml_amp_cab_labels)}, + {AMP_LOOP_ON_OFF, AMP_LOOP_POSITION, "Amp Loop Enable", &values_on_off, xml_on_off_labels, G_N_ELEMENTS(xml_on_off_labels)}, + {NOISEGATE_TYPE, NOISEGATE_POSITION, "Gate Type", &values_gate_type, xml_noisegate_labels, G_N_ELEMENTS(xml_noisegate_labels)}, {NOISEGATE_ON_OFF, NOISEGATE_POSITION, "Gate Enable", &values_on_off, xml_on_off_labels, G_N_ELEMENTS(xml_on_off_labels)}, {NOISEGATE_SWELL_SENS, NOISEGATE_POSITION, "Gate Pluck Sens", &values_0_to_99,}, @@ -4307,6 +4323,8 @@ XmlSettings xml_settings[] = { {DELAY_TAPE_WOW, DELAY_POSITION, "Delay Tape Wow", &values_0_to_99,}, {DELAY_TAPE_FLUTTER, DELAY_POSITION, "Delay Tape Flut", &values_0_to_99,}, {DELAY_TAP_TIME_0_4990, DELAY_POSITION, "Tap Time", &values_delay_time_0_4990,}, + {DELAY_TAP_TIME, DELAY_POSITION, "Tap Time", &values_delay_time_0_5000,}, + {DELAY_MULTIPLIER, DELAY_POSITION, "Multiplier", &values_delay_multiplier, xml_delay_multiplier_labels, G_N_ELEMENTS(xml_delay_multiplier_labels)}, {REVERB_TYPE, REVERB_POSITION, "Reverb Type", &values_reverb_type, xml_reverb_labels, G_N_ELEMENTS(xml_reverb_labels)}, {REVERB_ON_OFF, REVERB_POSITION, "Reverb Enable", &values_on_off, xml_on_off_labels, G_N_ELEMENTS(xml_on_off_labels)}, @@ -4467,6 +4485,8 @@ static Modifier *get_modifier(guint id, guint position) if ((modifiers[x].id == id) && (modifiers[x].position == position)) return &(modifiers[x]); + g_warning("Failed to find modifier for id %d position %d", id, position); + return NULL; } @@ -4594,7 +4614,7 @@ void update_modifier_linkable_list(GString *msg) group[i].settings = get_modifier_settings(modifier->values); group[i].settings_amt = 2; } else { - group[i].label = NULL; + group[i].label = "Unknown"; group[i].settings = NULL; } diff --git a/gdigi.c b/gdigi.c index 1ca93ae..dad5ca1 100644 --- a/gdigi.c +++ b/gdigi.c @@ -188,7 +188,7 @@ format_ipv (guint id, guint pos, guint val) if (!xml) { g_warning("Failed to find xml settings for position %d id %d.", - id, pos); + pos, id); g_string_printf(buf, "%s", "error"); return buf; } diff --git a/gui.c b/gui.c index b30746a..7992edb 100644 --- a/gui.c +++ b/gui.c @@ -757,7 +757,6 @@ static void update_modifier_vbox(GtkWidget *vbox, GObject *combo_box, gint id, g for (x = 0; xid = id; @@ -779,7 +778,12 @@ static void update_modifier_vbox(GtkWidget *vbox, GObject *combo_box, gint id, g g_object_set_data(G_OBJECT(combo_box), name, settings); g_free(name); - gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo_box), group[x].label); + if (group[x].label) { + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo_box), group[x].label); + } else { + // If a device is not fully supported, mark the effect as unknown. + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo_box), "unknown"); + } widget_tree_add(combo_box, id, position, group[x].type, x); }