X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=toolbar.c;h=368d4bafed861421f4ee87acf9ab9b066758bc60;hb=4bedfdb7513341721f7e8488e8e2f34aedffd29b;hp=edf3c936c015ddc28c935bac9e5847c541b33d7b;hpb=97fe0e2b047a996ebd9d4a13e5d8db7cea05bbb3;p=sigrok-gtk.git diff --git a/toolbar.c b/toolbar.c index edf3c93..368d4ba 100644 --- a/toolbar.c +++ b/toolbar.c @@ -59,10 +59,11 @@ static void prop_edited(GtkCellRendererText *cel, gchar *path, gchar *text, if (sr_parse_sizestring(text, &tmp_u64) != SR_OK) return; - ret = dev->plugin->config_set(dev->plugin_index, cap, &tmp_u64); + ret = dev->driver->dev_config_set(dev->driver_index, + cap, &tmp_u64); break; case SR_T_CHAR: - ret = dev->plugin->config_set(dev->plugin_index, cap, text); + ret = dev->driver->dev_config_set(dev->driver_index, cap, text); break; /* SR_T_BOOL will be handled by prop_toggled */ } @@ -85,8 +86,8 @@ static void prop_toggled(GtkCellRendererToggle *cel, gchar *path, DEV_PROP_TYPE, &type, -1); val = !gtk_cell_renderer_toggle_get_active(cel); - ret = dev->plugin->config_set(dev->plugin_index, cap, - GINT_TO_POINTER(val)); + ret = dev->driver->dev_config_set(dev->driver_index, cap, + GINT_TO_POINTER(val)); if (!ret) gtk_list_store_set(props, &iter, DEV_PROP_BOOLVALUE, val, -1); @@ -136,7 +137,7 @@ static void dev_set_options(GtkAction *action, GtkWindow *parent) G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_BOOLEAN); gtk_tree_view_set_model(GTK_TREE_VIEW(tv), GTK_TREE_MODEL(props)); - int *hwcaps = dev->plugin->hwcap_get_all(); + int *hwcaps = dev->driver->hwcap_get_all(); int cap; GtkTreeIter iter; for (cap = 0; hwcaps[cap]; cap++) { @@ -229,7 +230,7 @@ static void probe_named(GtkCellRendererText *cel, gchar *path, gchar *text, gtk_tree_model_get_iter_from_string(probes, &iter, path); gtk_tree_model_get(probes, &iter, PROBE_NUMBER, &i, -1); - sr_dev_probe_name(dev, i, text); + sr_dev_probe_name_set(dev, i, text); gtk_list_store_set(GTK_LIST_STORE(probes), &iter, PROBE_NAME, text, -1); } @@ -352,10 +353,10 @@ static void capture_run(GtkAction *action, GObject *parent) } if (time_msec) { - if (sr_hw_has_hwcap(dev->plugin, SR_HWCAP_LIMIT_MSEC)) { - if (dev->plugin->config_set(dev->plugin_index, - SR_HWCAP_LIMIT_MSEC, - &time_msec) != SR_OK) { + if (sr_hw_has_hwcap(dev->driver, SR_HWCAP_LIMIT_MSEC)) { + if (dev->driver->dev_config_set(dev->driver_index, + SR_HWCAP_LIMIT_MSEC, + &time_msec) != SR_OK) { g_critical("Failed to configure time limit."); sr_session_destroy(); return; @@ -367,8 +368,8 @@ static void capture_run(GtkAction *action, GObject *parent) limit_samples = 0; if (sr_dev_has_hwcap(dev, SR_HWCAP_SAMPLERATE)) { guint64 tmp_u64; - tmp_u64 = *((uint64_t *)dev->plugin->get_dev_info( - dev->plugin_index, + tmp_u64 = *((uint64_t *)dev->driver->dev_info_get( + dev->driver_index, SR_DI_CUR_SAMPLERATE)); limit_samples = tmp_u64 * time_msec / (uint64_t) 1000; } @@ -377,24 +378,24 @@ static void capture_run(GtkAction *action, GObject *parent) return; } - if (dev->plugin->config_set(dev->plugin_index, - SR_HWCAP_LIMIT_SAMPLES, - &limit_samples) != SR_OK) { + if (dev->driver->dev_config_set(dev->driver_index, + SR_HWCAP_LIMIT_SAMPLES, + &limit_samples) != SR_OK) { g_critical("Failed to configure time-based sample limit."); return; } } } if (limit_samples) { - if (dev->plugin->config_set(dev->plugin_index, - SR_HWCAP_LIMIT_SAMPLES, - &limit_samples) != SR_OK) { + if (dev->driver->dev_config_set(dev->driver_index, + SR_HWCAP_LIMIT_SAMPLES, + &limit_samples) != SR_OK) { g_critical("Failed to configure sample limit."); return; } } - if (dev->plugin->config_set(dev->plugin_index, + if (dev->driver->dev_config_set(dev->driver_index, SR_HWCAP_PROBECONFIG, (char *)dev->probes) != SR_OK) { printf("Failed to configure probes.\n"); sr_session_destroy();