From: Joel Holdsworth Date: Sun, 22 Feb 2015 14:56:56 +0000 (+0000) Subject: pv::binding::InputOutput: Bound up more integer types and Bool X-Git-Tag: pulseview-0.3.0~221 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=5d2aa2c724cd7b6693c7956d4f1c7f0f856dcc27;p=pulseview.git pv::binding::InputOutput: Bound up more integer types and Bool --- diff --git a/pv/binding/inputoutput.cpp b/pv/binding/inputoutput.cpp index 42ebf062..956b12b3 100644 --- a/pv/binding/inputoutput.cpp +++ b/pv/binding/inputoutput.cpp @@ -26,6 +26,7 @@ #include +#include #include #include #include @@ -47,6 +48,7 @@ using Glib::VariantType; using sigrok::Option; +using pv::prop::Bool; using pv::prop::Double; using pv::prop::Enum; using pv::prop::Int; @@ -79,10 +81,14 @@ InputOutput::InputOutput( if (!opt->values().empty()) prop = bind_enum(name, values, get, set); + else if (def_val.is_of_type(VariantType("b"))) + prop = shared_ptr(new Bool(name, get, set)); else if (def_val.is_of_type(VariantType("d"))) prop = shared_ptr(new Double(name, 2, "", nullptr, nullptr, get, set)); - else if (def_val.is_of_type(VariantType("u"))) + else if (def_val.is_of_type(VariantType("i")) || + def_val.is_of_type(VariantType("t")) || + def_val.is_of_type(VariantType("u"))) prop = shared_ptr( new Int(name, "", none, get, set)); else if (def_val.is_of_type(VariantType("s")))