const uint64_t *elements = NULL;
gsize num_elements;
+ if (_updating_sample_rate)
+ return;
+
const shared_ptr<DevInst> dev_inst = get_selected_device();
if (!dev_inst)
return;
+ assert(!_updating_sample_rate);
_updating_sample_rate = true;
if (!(gvar_dict = dev_inst->list_config(NULL, SR_CONF_SAMPLERATE)))
GVariant *gvar;
uint64_t samplerate;
+ if (_updating_sample_rate)
+ return;
+
const shared_ptr<DevInst> dev_inst = get_selected_device();
if (!dev_inst)
return;
samplerate = g_variant_get_uint64(gvar);
g_variant_unref(gvar);
+ assert(!_updating_sample_rate);
_updating_sample_rate = true;
_sample_rate.set_value(samplerate);
_updating_sample_rate = false;
{
GVariant *gvar;
+ if (_updating_sample_count)
+ return;
+
const shared_ptr<DevInst> dev_inst = get_selected_device();
if (!dev_inst)
return;
+ assert(!_updating_sample_count);
_updating_sample_count = true;
if (_sample_count_supported)
{
uint64_t sample_count = 0;
+ if (_updating_sample_count)
+ return;
+
const shared_ptr<DevInst> dev_inst = get_selected_device();
if (!dev_inst)
return;
sample_count = _sample_count.value();
// Set the sample count
+ assert(!_updating_sample_count);
+ _updating_sample_count = true;
if (!dev_inst->set_config(NULL, SR_CONF_LIMIT_SAMPLES,
g_variant_new_uint64(sample_count))) {
qDebug() << "Failed to configure sample count.";
return;
}
+ _updating_sample_count = false;
}
void SamplingBar::commit_sample_rate()
{
uint64_t sample_rate = 0;
+ if (_updating_sample_rate)
+ return;
+
const shared_ptr<DevInst> dev_inst = get_selected_device();
if (!dev_inst)
return;
return;
// Set the samplerate
+ assert(!_updating_sample_rate);
+ _updating_sample_rate = true;
if (!dev_inst->set_config(NULL, SR_CONF_SAMPLERATE,
g_variant_new_uint64(sample_rate))) {
qDebug() << "Failed to configure samplerate.";
return;
}
+ _updating_sample_rate = false;
}
void SamplingBar::on_device_selected()
void SamplingBar::on_sample_count_changed()
{
- if(!_updating_sample_count)
- commit_sample_count();
+ commit_sample_count();
}
void SamplingBar::on_sample_rate_changed()
{
- if (!_updating_sample_rate)
- commit_sample_rate();
+ commit_sample_rate();
}
void SamplingBar::on_run_stop()