+ _updating_sample_count = false;
+}
+
+void SamplingBar::commit_sample_rate()
+{
+ uint64_t sample_rate = 0;
+
+ if (_updating_sample_rate)
+ return;
+
+ const shared_ptr<device::DevInst> dev_inst = get_selected_device();
+ if (!dev_inst)
+ return;
+
+ sample_rate = _sample_rate.value();
+ if (sample_rate == 0)
+ 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()
+{
+ if (_updating_device_selector)
+ return;
+
+ const shared_ptr<device::DevInst> dev_inst = get_selected_device();
+ if (!dev_inst)
+ return;
+
+ _session.set_device(dev_inst);
+
+ update_device_config_widgets();