py: Expose the Connector::get_mode methods
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Wed, 22 Jun 2016 00:10:21 +0000 (03:10 +0300)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Wed, 22 Jun 2016 05:47:47 +0000 (08:47 +0300)
Those methods are useful in Python scripts, expose them through the
bindings.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
py/pykmsbase.cpp

index f1e0c5ce11f6b05410e23eb49691838f8158e612..b279de353916f0236673dc52d0232f25b6744ad5 100644 (file)
@@ -42,6 +42,8 @@ void init_pykmsbase(py::module &m)
                        .def("get_current_crtc", &Connector::get_current_crtc)
                        .def("get_possible_crtcs", &Connector::get_possible_crtcs)
                        .def("get_modes", &Connector::get_modes)
+                       .def("get_mode", (Videomode (Connector::*)(const string& mode) const)&Connector::get_mode)
+                       .def("get_mode", (Videomode (Connector::*)(unsigned xres, unsigned yres, unsigned refresh, bool ilace) const)&Connector::get_mode)
                        .def("__repr__", [](const Connector& o) { return "<pykms.Connector " + to_string(o.id()) + ">"; })
                        ;