]> sigrok.org Git - pulseview.git/blobdiff - pv/binding/decoder.cpp
DecodeSignal: Support unitsize > 1 for logic output
[pulseview.git] / pv / binding / decoder.cpp
index 28f42a08b38027ca87a9e42a5c6bec84e31c7a09..80725d2a8b35248461ca1c14e57c3d39f5f529d8 100644 (file)
@@ -31,7 +31,6 @@
 #include <pv/prop/string.hpp>
 
 using boost::none;
-using std::make_pair;
 using std::map;
 using std::pair;
 using std::shared_ptr;
@@ -55,12 +54,11 @@ Decoder::Decoder(
 {
        assert(decoder_);
 
-       const srd_decoder *const dec = decoder_->decoder();
+       const srd_decoder *const dec = decoder_->get_srd_decoder();
        assert(dec);
 
        for (GSList *l = dec->options; l; l = l->next) {
-               const srd_decoder_option *const opt =
-                       (srd_decoder_option*)l->data;
+               const srd_decoder_option *const opt = (srd_decoder_option*)l->data;
 
                const QString name = QString::fromUtf8(opt->desc);
 
@@ -97,7 +95,7 @@ shared_ptr<Property> Decoder::bind_enum(
        vector< pair<Glib::VariantBase, QString> > values;
        for (GSList *l = option->values; l; l = l->next) {
                Glib::VariantBase var = Glib::VariantBase((GVariant*)l->data, true);
-               values.push_back(make_pair(var, print_gvariant(var)));
+               values.emplace_back(var, print_gvariant(var));
        }
 
        return shared_ptr<Property>(new Enum(name, desc, values, getter, setter));
@@ -116,12 +114,11 @@ Glib::VariantBase Decoder::getter(const char *id)
        if (iter != options.end())
                val = (*iter).second;
        else {
-               assert(decoder_->decoder());
+               assert(decoder_->get_srd_decoder());
 
                // Get the default value if not
-               for (GSList *l = decoder_->decoder()->options; l; l = l->next) {
-                       const srd_decoder_option *const opt =
-                               (srd_decoder_option*)l->data;
+               for (GSList *l = decoder_->get_srd_decoder()->options; l; l = l->next) {
+                       const srd_decoder_option *const opt = (srd_decoder_option*)l->data;
                        if (strcmp(opt->id, id) == 0) {
                                val = opt->def;
                                break;