From: Bert Vermeulen Date: Sat, 20 Apr 2013 23:56:28 +0000 (+0200) Subject: Use new probe_groups API X-Git-Tag: pulseview-0.2.0~230 X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=commitdiff_plain;h=68162c2925e3c5a3c7d0b4d3d100184e5c649eba Use new probe_groups API --- diff --git a/pv/dialogs/connect.cpp b/pv/dialogs/connect.cpp index ea411f15..f8fbe67f 100644 --- a/pv/dialogs/connect.cpp +++ b/pv/dialogs/connect.cpp @@ -102,8 +102,8 @@ void Connect::populate_drivers() * and sensors. */ bool supported_device = false; - if ((sr_config_list(drivers[i], SR_CONF_DEVICE_OPTIONS, - &gvar_opts, NULL) == SR_OK)) { + if ((sr_config_list(drivers[i], NULL, NULL, + SR_CONF_DEVICE_OPTIONS, &gvar_opts) == SR_OK)) { hwopts = (const int32_t *)g_variant_get_fixed_array(gvar_opts, &num_opts, sizeof(int32_t)); for (unsigned int j = 0; j < num_opts; j++) @@ -189,8 +189,8 @@ void Connect::device_selected(int index) unset_connection(); - if ((sr_config_list(driver, SR_CONF_SCAN_OPTIONS, - &gvar_list, NULL) == SR_OK)) { + if ((sr_config_list(driver, NULL, NULL, + SR_CONF_SCAN_OPTIONS, &gvar_list) == SR_OK)) { hwopts = (const int32_t *)g_variant_get_fixed_array(gvar_list, &num_opts, sizeof(int32_t)); diff --git a/pv/prop/binding/deviceoptions.cpp b/pv/prop/binding/deviceoptions.cpp index 513fe856..3fe63940 100644 --- a/pv/prop/binding/deviceoptions.cpp +++ b/pv/prop/binding/deviceoptions.cpp @@ -47,8 +47,8 @@ DeviceOptions::DeviceOptions(struct sr_dev_inst *sdi) : GVariant *gvar_opts, *gvar_list; gsize num_opts; - if ((sr_config_list(sdi->driver, SR_CONF_DEVICE_OPTIONS, - &gvar_opts, sdi) != SR_OK)) + if ((sr_config_list(sdi->driver, sdi, NULL, SR_CONF_DEVICE_OPTIONS, + &gvar_opts) != SR_OK)) /* Driver supports no device instance options. */ return; @@ -63,7 +63,7 @@ DeviceOptions::DeviceOptions(struct sr_dev_inst *sdi) : const int key = info->key; - if(sr_config_list(_sdi->driver, key, &gvar_list, _sdi) != SR_OK) + if (sr_config_list(_sdi->driver, _sdi, NULL, key, &gvar_list) != SR_OK) gvar_list = NULL; const QString name(info->name); @@ -113,7 +113,7 @@ GVariant* DeviceOptions::config_getter( const struct sr_dev_inst *sdi, int key) { GVariant *data = NULL; - if (sr_config_get(sdi->driver, key, &data, sdi) != SR_OK) { + if (sr_config_get(sdi->driver, sdi, NULL, key, &data) != SR_OK) { qDebug() << "WARNING: Failed to get value of config id" << key; return NULL; @@ -124,7 +124,7 @@ GVariant* DeviceOptions::config_getter( void DeviceOptions::config_setter( const struct sr_dev_inst *sdi, int key, GVariant* value) { - if (sr_config_set(sdi, key, value) != SR_OK) + if (sr_config_set(sdi, NULL, key, value) != SR_OK) qDebug() << "WARNING: Failed to set value of sample rate"; } diff --git a/pv/sigsession.cpp b/pv/sigsession.cpp index aadaf450..b27fd6ec 100644 --- a/pv/sigsession.cpp +++ b/pv/sigsession.cpp @@ -428,8 +428,8 @@ void SigSession::read_sample_rate(const sr_dev_inst *const sdi) // Read out the sample rate if(sdi->driver) { - const int ret = sr_config_get(sdi->driver, - SR_CONF_SAMPLERATE, &gvar, sdi); + const int ret = sr_config_get(sdi->driver, sdi, NULL, + SR_CONF_SAMPLERATE, &gvar); if (ret != SR_OK) { qDebug("Failed to get samplerate\n"); return; @@ -505,7 +505,7 @@ void SigSession::sample_thread_proc(struct sr_dev_inst *sdi, } // Set the sample limit - if (sr_config_set(sdi, SR_CONF_LIMIT_SAMPLES, + if (sr_config_set(sdi, NULL, SR_CONF_LIMIT_SAMPLES, g_variant_new_uint64(record_length)) != SR_OK) { error_handler(tr("Failed to configure " "time-based sample limit.")); diff --git a/pv/toolbars/samplingbar.cpp b/pv/toolbars/samplingbar.cpp index b80d6f80..2fa2d391 100644 --- a/pv/toolbars/samplingbar.cpp +++ b/pv/toolbars/samplingbar.cpp @@ -192,8 +192,8 @@ void SamplingBar::update_sample_rate_selector() if (!sdi) return; - if (sr_config_list(sdi->driver, SR_CONF_SAMPLERATE, - &gvar_dict, sdi) != SR_OK) + if (sr_config_list(sdi->driver, sdi, NULL, + SR_CONF_SAMPLERATE, &gvar_dict) != SR_OK) return; _sample_rate_list_action->setVisible(false); @@ -247,8 +247,8 @@ void SamplingBar::update_sample_rate_selector_value() assert(sdi); - if (sr_config_get(sdi->driver, SR_CONF_SAMPLERATE, - &gvar, sdi) != SR_OK) { + if (sr_config_get(sdi->driver, sdi, NULL, + SR_CONF_SAMPLERATE, &gvar) != SR_OK) { qDebug() << "WARNING: Failed to get value of sample rate"; return; @@ -294,7 +294,7 @@ void SamplingBar::commit_sample_rate() return; // Set the samplerate - if (sr_config_set(sdi, SR_CONF_SAMPLERATE, + if (sr_config_set(sdi, NULL, SR_CONF_SAMPLERATE, g_variant_new_uint64(sample_rate)) != SR_OK) { qDebug() << "Failed to configure samplerate."; return; diff --git a/pv/view/logicsignal.cpp b/pv/view/logicsignal.cpp index 31b8f0a2..b1d0037a 100644 --- a/pv/view/logicsignal.cpp +++ b/pv/view/logicsignal.cpp @@ -238,8 +238,8 @@ void LogicSignal::populate_popup_form(QWidget *parent, QFormLayout *form) // Add the trigger actions const sr_dev_inst *const sdi = _session.get_device(); - if (sr_config_list(sdi->driver, SR_CONF_TRIGGER_TYPE, - &gvar, sdi) == SR_OK) + if (sr_config_list(sdi->driver, sdi, NULL, SR_CONF_TRIGGER_TYPE, + &gvar) == SR_OK) { const char *const trig_types = g_variant_get_string(gvar, NULL);