Add support for linkable parameters.

These changes allow gdigi to link parameters to the expression pedal,
LFO1, and LFO2. The changes have been implemented only for RP355, but
should be easily extendible to other devices.

The design is as follows:

The effect group entries for the linkable effects have only a placeholder
entry "None" at startup.

During startup, we send an unsolicited REQUEST_MODIFIER_LINKABLE_LIST. When we
receive RECEIVE_MODIFIER_LINKABLE_LIST in response, we use it to construct the
ModifierLinkableList and update the combo boxes for the Pedal Assign and LFO
effects.

Whenever the selected chorus/fx effect changes, the list of linkable parameters
also changes, so the device will send us a NOTIFY_MODIFIER_GROUP_CHANGED. Again,
we send a REQUEST_MODIFIER_LINKABLE_LIST and use the response to rebuild
ModifierLinkableList. Then we tear down and rebuild the state associated with
the affected combo boxes.

The changes made are as follows:

1) Add settings for pedal1_assign. This is the min/max value returned
   by the pedal.

2) Add separate EffectGroup for both pedal assignment and the LFO's
   for the non-combo box settings.

3) Fix up a few more missing effects in the xml and modifier lists.
   There is additional work to do here, but that will be in future
   commits.

4) Fixed a missing break in the RECEIVE_DEVICE_NOTIFICATION case
   in push_message().

5) When we receive a NOTIFY_MODIFIER_GROUP_CHANGED message, free the exisiting
   modifier group and send a REQUEST_MODIFIER_LINKABLE_LIST so we can
   rebuild it.

6) When we receive a RECEIVE_MODIFIER_LINKABLE_LIST, protect the calls to
   create_modifier_group() with GDK_THREADS_ENTER() so we don't crash
   because of interactions with the event/gui threads.

7) Added a BUG assert to an error leg in get_message_list().

8) Fix memory leak in get_digitech_devices() found by valgrind.

9) Add a function to tear down the state associated with the entries of a
   pedal assign or LFO combo box.

10) Add a function to build up the entries of a pedal assign or LFO combo
    box from the modifier linkable list received from the device.

11) Use gtk_combo_box_text_append_text() throughout.

12) A few whitespace/readability changes and more comments.
This commit is contained in:
Tim LaBerge
2012-12-16 09:29:16 -08:00
parent 8b998c636f
commit 3a3017b46f
3 changed files with 143 additions and 56 deletions

View File

@@ -1579,6 +1579,11 @@ static EffectSettings gnx3k_reverb_settings[] = {
{"Level", REVERB_LEVEL, REVERB_POSITION, &values_0_to_99},
};
static EffectSettings pedal1_assign_settings[] = {
{"Pedal Min 1", EXP_MIN, EXP_POSITION, &values_0_to_99,},
{"Pedal Max 1", EXP_MAX, EXP_POSITION, &values_0_to_99,},
};
static EffectSettings lfo1_settings[] = {
{"Heel", LFO_MIN, LFO1_POSITION, &values_0_to_99},
{"Toe", LFO_MAX, LFO1_POSITION, &values_0_to_99},
@@ -1953,16 +1958,19 @@ static EffectGroup rp355_chorusfx_group[] = {
};
static EffectGroup rp355_pedal1_assign_group[] = {
{ 0, "Placeholder", NULL, 0},
};
{ 0, NULL, pedal1_assign_settings, G_N_ELEMENTS(pedal1_assign_settings)},
{ 0, "None", NULL, 0},
};
static EffectGroup rp355_lfo2_group[] = {
{ 0, "Placeholder", lfo2_settings, G_N_ELEMENTS(lfo2_settings)},
{ 0, NULL, lfo2_settings, G_N_ELEMENTS(lfo2_settings)},
{ 0, "None", NULL, 0},
};
static EffectGroup rp355_lfo1_group[] = {
{ 0, "Placeholder", lfo1_settings, G_N_ELEMENTS(lfo1_settings)},
};
{ 0, NULL, lfo1_settings, G_N_ELEMENTS(lfo1_settings)},
{ 0, "None", NULL, 0},
};
static EffectGroup rp500_chorusfx_group[] = {
{CHORUS_TYPE_CE, "CE Chorus", chorusfx_ce_settings, G_N_ELEMENTS(chorusfx_ce_settings)},
@@ -3362,6 +3370,11 @@ static Modifier modifiers[] = {
{"Phaser Regen", PHASER_REGEN, CHORUSFX_POSITION, &values_0_to_99},
{"Phaser Waveform", PHASER_WAVE, CHORUSFX_POSITION, &values_waveform},
{"Phaser Level", PHASER_LEVEL, CHORUSFX_POSITION, &values_0_to_99},
{"Phaser Intensity", MX_PHASER_INTENSITY, CHORUSFX_POSITION, &values_0_to_99},
{"Trig Phaser Speed", TRIG_PHASER_SPEED, CHORUSFX_POSITION, &values_0_to_99},
{"Trig Phaser Sens", TRIG_PHASER_SENS, CHORUSFX_POSITION, &values_0_to_99},
{"Trig Phaser LFO", TRIG_PHASER_LFO_START, CHORUSFX_POSITION, &values_0_to_99},
{"Trig Phaser Level", TRIG_PHASER_LEVEL, CHORUSFX_POSITION, &values_0_to_99},
{"Chorus Speed", CHORUS_SPEED, CHORUSFX_POSITION, &values_0_to_99},
{"Chorus Depth", CHORUS_DEPTH, CHORUSFX_POSITION, &values_0_to_99},
{"Chorus Level", CHORUS_LEVEL, CHORUSFX_POSITION, &values_0_to_99},
@@ -3972,6 +3985,7 @@ XmlSettings xml_settings[] = {
{PHASER_REGEN, CHORUSFX_POSITION, "Phaser Regen", &values_0_to_99,},
{PHASER_WAVE, CHORUSFX_POSITION, "Phaser Waveform", &values_waveform, xml_waveform_labels, G_N_ELEMENTS(xml_waveform_labels)},
{PHASER_LEVEL, CHORUSFX_POSITION, "Phaser Level", &values_0_to_99,},
{MX_PHASER_INTENSITY, CHORUSFX_POSITION, "Intensity", &values_1_to_4,},
{CHORUS_SPEED, CHORUSFX_POSITION, "Chorus Speed", &values_0_to_99,},
{CHORUS_DEPTH, CHORUSFX_POSITION, "Chorus Depth", &values_0_to_99,},
{CHORUS_LEVEL, CHORUSFX_POSITION, "Chorus Level", &values_0_to_99,},