X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fprop%2Fbinding%2Fdeviceoptions.h;h=f27823bdf08d8a0a10be5a466cae13cd446003aa;hb=2f779c1bd6a9a74c97be09ee6842a7527e083fa6;hp=340e0d727af4ae67c1b57afc9fe307132d06ffc5;hpb=9dbb80b0dbc0fc51a11e42f8e10fc72e9b66f694;p=pulseview.git diff --git a/pv/prop/binding/deviceoptions.h b/pv/prop/binding/deviceoptions.h index 340e0d7..f27823b 100644 --- a/pv/prop/binding/deviceoptions.h +++ b/pv/prop/binding/deviceoptions.h @@ -21,6 +21,9 @@ #ifndef PULSEVIEW_PV_PROP_BINDING_DEVICEOPTIONS_H #define PULSEVIEW_PV_PROP_BINDING_DEVICEOPTIONS_H +#include +#include + #include #include @@ -34,21 +37,30 @@ namespace binding { class DeviceOptions : public Binding { public: - DeviceOptions(struct sr_dev_inst *sdi); + DeviceOptions(const 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); + void bind_int(const QString &name, int key, QString suffix, + boost::optional< std::pair > range); + + static QString print_gvariant(GVariant *const gvar); - 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); + static QString print_voltage_threshold(GVariant *const gvar); protected: - const struct sr_dev_inst *_sdi; + const sr_dev_inst *const _sdi; }; } // binding