X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fprop%2Fbinding%2Fdeviceoptions.h;h=f2344796e338220b77dd8892459efe60a9000b6b;hb=0d600d54070777aa706dbad1d2bbd5191e953cbb;hp=ce0799b5f09a2c2be1cb5f8a239cf031d9e539cc;hpb=3820592a018c777727a6e65bd754d113742f4462;p=pulseview.git diff --git a/pv/prop/binding/deviceoptions.h b/pv/prop/binding/deviceoptions.h index ce0799b5..f2344796 100644 --- a/pv/prop/binding/deviceoptions.h +++ b/pv/prop/binding/deviceoptions.h @@ -21,11 +21,11 @@ #ifndef PULSEVIEW_PV_PROP_BINDING_DEVICEOPTIONS_H #define PULSEVIEW_PV_PROP_BINDING_DEVICEOPTIONS_H +#include + #include -extern "C" { #include -} #include "binding.h" @@ -39,18 +39,32 @@ public: DeviceOptions(struct sr_dev_inst *sdi); private: - void expose_enum(const struct sr_config_info *info, - const std::vector > &values, - int opt); - void bind_stropt(const struct sr_config_info *info, int key); + static GVariant* config_getter( + const struct sr_dev_inst *sdi, int key); + static void config_setter( + const struct sr_dev_inst *sdi, int key, GVariant* value); + + void bind_bool(const QString &name, int key); + void bind_enum(const QString &name, int key, + GVariant *const gvar_list, + boost::function printer = print_gvariant); + + static QString print_gvariant(GVariant *const gvar); + + void bind_samplerate(const QString &name, + GVariant *const gvar_list); + static QString print_samplerate(GVariant *const gvar); + static GVariant* samplerate_double_getter( + const struct sr_dev_inst *sdi); + static void samplerate_double_setter( + struct sr_dev_inst *sdi, GVariant *value); - void bind_buffer_size(const struct sr_config_info *info); - void bind_time_base(const struct sr_config_info *info); - void bind_vdiv(const struct sr_config_info *info); + static QString print_timebase(GVariant *const gvar); + static QString print_vdiv(GVariant *const gvar); protected: - const struct sr_dev_inst *_sdi; + struct sr_dev_inst *const _sdi; }; } // binding