GVariant *gvar_dict, *gvar_list;
const uint64_t *elements = NULL;
gsize num_elements;
+ QAction *selector_action = NULL;
assert(_sample_rate_value_action);
assert(_sample_rate_list_action);
gvar_list, &num_elements, sizeof(uint64_t));
_sample_rate_value.setRange(elements[0], elements[1]);
_sample_rate_value.setSingleStep(elements[2]);
- _sample_rate_value_action->setVisible(true);
g_variant_unref(gvar_list);
+
+ selector_action = _sample_rate_value_action;
}
else if ((gvar_list = g_variant_lookup_value(gvar_dict,
"samplerates", G_VARIANT_TYPE("at"))))
}
_sample_rate_list.show();
- _sample_rate_list_action->setVisible(true);
g_variant_unref(gvar_list);
+
+ selector_action = _sample_rate_list_action;
}
g_variant_unref(gvar_dict);
update_sample_rate_selector_value();
+
+ // We delay showing the action, so that value change events
+ // are ignored.
+ if (selector_action)
+ selector_action->setVisible(true);
}
void SamplingBar::update_sample_rate_selector_value()
index).value<uint64_t>();
}
+ if (sample_rate == 0)
+ return;
+
// Set the samplerate
if (sr_config_set(sdi, SR_CONF_SAMPLERATE,
g_variant_new_uint64(sample_rate)) != SR_OK) {