X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fbinding%2Fdevice.cpp;h=026ca16c6b49354f5e51cbbe89b59a1c09f5bf86;hb=7bb0fbf4d3809dbbd0fe5b35fc7e475b1065ae20;hp=32edea164144786d0ef9ad8aeab525dc99363eb8;hpb=198f9bc74d6c955a72e3e3282c2b0ba16ef39a62;p=pulseview.git diff --git a/pv/binding/device.cpp b/pv/binding/device.cpp index 32edea1..026ca16 100644 --- a/pv/binding/device.cpp +++ b/pv/binding/device.cpp @@ -56,11 +56,12 @@ namespace binding { Device::Device(shared_ptr configurable) : configurable_(configurable) { - assert(configurable); - for (auto entry : configurable->config_keys(ConfigKey::DEVICE_OPTIONS)) { - auto key = entry.first; - auto capabilities = entry.second; + auto keys = configurable->config_keys(); + + for (auto key : keys) { + + auto capabilities = configurable->config_capabilities(key); if (!capabilities.count(Capability::GET) || !capabilities.count(Capability::SET)) @@ -82,8 +83,7 @@ Device::Device(shared_ptr configurable) : config_changed(); }; - switch (key->id()) - { + switch (key->id()) { case SR_CONF_SAMPLERATE: // Sample rate values are not bound because they are shown // in the MainBar @@ -141,7 +141,7 @@ void Device::bind_bool(const QString &name, } void Device::bind_enum(const QString &name, - const ConfigKey *key, std::set capabilities, + const ConfigKey *key, std::set capabilities, Property::Getter getter, Property::Setter setter, function printer) {