summaryrefslogtreecommitdiff
path: root/gr-audio/python/audio/bindings/source_python.cc
diff options
context:
space:
mode:
authorJosh Morman <mormjb@gmail.com>2020-04-23 07:55:34 -0400
committerJosh Morman <mormjb@gmail.com>2020-06-04 10:05:47 -0400
commitf2423d354105155f21acf7f57ec6ec4a4188b091 (patch)
tree32055b4029d42485fa529e451a736d6e73824a93 /gr-audio/python/audio/bindings/source_python.cc
parentd8058406fa93becbfd8f5cbde0e96363e190d9ba (diff)
audio: add pybind11 bindings
Diffstat (limited to 'gr-audio/python/audio/bindings/source_python.cc')
-rw-r--r--gr-audio/python/audio/bindings/source_python.cc42
1 files changed, 42 insertions, 0 deletions
diff --git a/gr-audio/python/audio/bindings/source_python.cc b/gr-audio/python/audio/bindings/source_python.cc
new file mode 100644
index 0000000000..fa6ccc5523
--- /dev/null
+++ b/gr-audio/python/audio/bindings/source_python.cc
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2020 Free Software Foundation, Inc.
+ *
+ * This file is part of GNU Radio
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *
+ */
+
+/* This file is automatically generated using bindtool */
+
+#include <pybind11/complex.h>
+#include <pybind11/pybind11.h>
+#include <pybind11/stl.h>
+
+namespace py = pybind11;
+
+#include <gnuradio/audio/source.h>
+// pydoc.h is automatically generated in the build directory
+#include <source_pydoc.h>
+
+void bind_source(py::module& m)
+{
+
+ using source = ::gr::audio::source;
+
+
+ py::class_<source,
+ gr::sync_block,
+ gr::block,
+ gr::basic_block,
+ std::shared_ptr<source>>(m, "source", D(source))
+
+ .def(py::init(&source::make),
+ py::arg("sampling_rate"),
+ py::arg("device_name") = "",
+ py::arg("ok_to_block") = true,
+ D(source, make))
+
+
+ ;
+}