diff options
author | David Robillard <d@drobilla.net> | 2015-10-24 18:06:50 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2015-10-24 18:06:50 -0400 |
commit | b041b087d18197553a439603cdaf5102a9a73cfa (patch) | |
tree | c7d05b43219c2ed9396bb3fb41b41fef8cd52b21 | |
parent | 54bad1e397679efca7cfaa3a174d618f74e72637 (diff) | |
download | lv2-b041b087d18197553a439603cdaf5102a9a73cfa.tar.xz |
eg-scope: Don't feed back UI state updates
-rw-r--r-- | lv2/lv2plug.in/ns/meta/meta.ttl | 9 | ||||
-rw-r--r-- | plugins/eg-scope.lv2/examploscope_ui.c | 13 |
2 files changed, 19 insertions, 3 deletions
diff --git a/lv2/lv2plug.in/ns/meta/meta.ttl b/lv2/lv2plug.in/ns/meta/meta.ttl index e1a7950..5d8cd2e 100644 --- a/lv2/lv2plug.in/ns/meta/meta.ttl +++ b/lv2/lv2plug.in/ns/meta/meta.ttl @@ -46,6 +46,15 @@ THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH R meta:kfoltman , meta:paniq ; doap:release [ + doap:revision "1.12.1" ; + doap:created "2015-10-24" ; + dcs:blame <http://drobilla.net/drobilla#me> ; + dcs:changeset [ + dcs:item [ + rdfs:label "eg-scope: Don't feed back UI state updates." + ] + ] + ] , [ doap:revision "1.12.0" ; doap:created "2015-04-07" ; doap:file-release <http://lv2plug.in/spec/lv2-1.12.0.tar.bz2> ; diff --git a/plugins/eg-scope.lv2/examploscope_ui.c b/plugins/eg-scope.lv2/examploscope_ui.c index 04f6292..558f624 100644 --- a/plugins/eg-scope.lv2/examploscope_ui.c +++ b/plugins/eg-scope.lv2/examploscope_ui.c @@ -71,6 +71,7 @@ typedef struct { uint32_t n_channels; bool paused; float rate; + bool updating; } EgScopeUI; @@ -158,7 +159,11 @@ send_ui_enable(LV2UI_Handle handle) static gboolean on_cfg_changed(GtkWidget* widget, gpointer data) { - send_ui_state(data); + EgScopeUI* ui = (EgScopeUI*)data; + if (!ui->updating) { + // Only send UI state if the change is from user interaction + send_ui_state(data); + } return TRUE; } @@ -414,7 +419,7 @@ instantiate(const LV2UI_Descriptor* descriptor, LV2UI_Widget* widget, const LV2_Feature* const* features) { - EgScopeUI* ui = (EgScopeUI*)malloc(sizeof(EgScopeUI)); + EgScopeUI* ui = (EgScopeUI*)calloc(1, sizeof(EgScopeUI)); if (!ui) { fprintf(stderr, "EgScope.lv2 UI: out of memory\n"); @@ -593,9 +598,11 @@ recv_ui_state(EgScopeUI* ui, const LV2_Atom_Object* obj) const float amp = ((const LV2_Atom_Float*)amp_val)->body; const float rate = ((const LV2_Atom_Float*)rate_val)->body; - // Update UI + // Disable transmission and update UI + ui->updating = true; gtk_spin_button_set_value(GTK_SPIN_BUTTON(ui->spb_speed), spp); gtk_spin_button_set_value(GTK_SPIN_BUTTON(ui->spb_amp), amp); + ui->updating = false; ui->rate = rate; return 0; |