X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fprop%2Fbinding%2Fdeviceoptions.cpp;h=1ce08eb8a14d7c9b6cc4a167625e28a5606f5051;hb=c6dd7ed262a3bc4879b511f516532bc954d743f4;hp=50af3ed4ffdec51a09565537a997f2578f2d366b;hpb=de1d99bbe58f825e30048baa48a9439c01686f10;p=pulseview.git diff --git a/pv/prop/binding/deviceoptions.cpp b/pv/prop/binding/deviceoptions.cpp index 50af3ed..1ce08eb 100644 --- a/pv/prop/binding/deviceoptions.cpp +++ b/pv/prop/binding/deviceoptions.cpp @@ -30,6 +30,7 @@ #include #include #include +#include using namespace boost; using namespace std; @@ -71,6 +72,10 @@ DeviceOptions::DeviceOptions(struct sr_dev_inst *sdi) : bind_samplerate(name, gvar_list); break; + case SR_CONF_CAPTURE_RATIO: + bind_int(name, key, "%", pair(0, 100)); + break; + case SR_CONF_PATTERN_MODE: case SR_CONF_BUFFERSIZE: case SR_CONF_TRIGGER_SOURCE: @@ -143,6 +148,15 @@ void DeviceOptions::bind_enum(const QString &name, int key, bind(config_setter, _sdi, key, _1)))); } +void DeviceOptions::bind_int(const QString &name, int key, QString suffix, + optional< std::pair > range) +{ + _properties.push_back(shared_ptr( + new Int(name, suffix, range, + bind(config_getter, _sdi, key), + bind(config_setter, _sdi, key, _1)))); +} + QString DeviceOptions::print_gvariant(GVariant *const gvar) { QString s;