lasp/cpp_src/pybind11/lasp_deviceinfo.cpp

49 lines
2.0 KiB
C++
Raw Permalink Normal View History

2022-07-20 12:58:48 +00:00
#include <pybind11/stl.h>
#include <stdint.h>
#include <iostream>
2022-07-20 12:58:48 +00:00
#include "lasp_deviceinfo.h"
using std::cerr;
namespace py = pybind11;
void init_deviceinfo(py::module& m) {
/// DeviceInfo
py::class_<DeviceInfo> devinfo(m, "DeviceInfo");
devinfo.def("__str__", [](const DeviceInfo& d) {return d.device_name;});
2022-07-20 12:58:48 +00:00
devinfo.def_readonly("api", &DeviceInfo::api);
devinfo.def_readonly("device_name", &DeviceInfo::device_name);
devinfo.def_readonly("availableDataTypes", &DeviceInfo::availableDataTypes);
devinfo.def_readonly("prefDataTypeIndex", &DeviceInfo::prefDataTypeIndex);
devinfo.def_readonly("availableSampleRates",
&DeviceInfo::availableSampleRates);
devinfo.def_readonly("prefSampleRateIndex", &DeviceInfo::prefSampleRateIndex);
devinfo.def_readonly("availableFramesPerBlock",
&DeviceInfo::availableFramesPerBlock);
devinfo.def_readonly("prefFramesPerBlockIndex",
&DeviceInfo::prefFramesPerBlockIndex);
devinfo.def_readonly("availableInputRanges",
&DeviceInfo::availableInputRanges);
devinfo.def_readonly("prefInputRangeIndex", &DeviceInfo::prefInputRangeIndex);
devinfo.def_readonly("availableOutputRanges",
&DeviceInfo::availableOutputRanges);
devinfo.def_readonly("prefOutputRangeIndex", &DeviceInfo::prefOutputRangeIndex);
2022-07-20 12:58:48 +00:00
devinfo.def_readonly("ninchannels", &DeviceInfo::ninchannels);
devinfo.def_readonly("noutchannels", &DeviceInfo::noutchannels);
devinfo.def_readonly("hasInputIEPE", &DeviceInfo::hasInputIEPE);
devinfo.def_readonly("hasInputACCouplingSwitch",
&DeviceInfo::hasInputACCouplingSwitch);
devinfo.def_readonly("hasDuplexMode", &DeviceInfo::hasDuplexMode);
devinfo.def_readonly("duplexModeForced", &DeviceInfo::duplexModeForced);
devinfo.def_readonly("hasInternalOutputMonitor", &DeviceInfo::hasInternalOutputMonitor);
devinfo.def_readonly("physicalInputQty", &DeviceInfo::physicalInputQty);
devinfo.def_readonly("physicalOutputQty", &DeviceInfo::physicalOutputQty);
2022-07-20 12:58:48 +00:00
}