LASP 1.0
Library for Acoustic Signal Processing
Loading...
Searching...
No Matches
lasp_deviceinfo.h
Go to the documentation of this file.
1#pragma once
2#include "lasp_config.h"
3#include "lasp_daqconfig.h"
4#include "lasp_types.h"
5#include <memory>
6
11using DeviceInfoList = std::vector<std::unique_ptr<DeviceInfo>>;
12
17public:
21 virtual ~DeviceInfo() {}
22 DeviceInfo& operator=(const DeviceInfo&) = delete;
23
29 virtual std::unique_ptr<DeviceInfo> clone() const {
30 return std::make_unique<DeviceInfo>(*this);
31 }
32
40 string device_name = "";
41
45 std::vector<DataTypeDescriptor::DataType> availableDataTypes;
50
59
69
78
82 unsigned ninchannels = 0;
86 unsigned noutchannels = 0;
87
92 bool hasInputIEPE = false;
100 bool hasInputTrigger = false;
101
102 double prefSampleRate() const {
104 (prefSampleRateIndex >= 0)) {
106 } else {
107 throw std::runtime_error("No prefered sample rate available");
108 }
109 }
110
118
125 bool duplexModeForced = false;
126
134
140 operator string() const {
141 using std::endl;
142 std::stringstream str;
143 str << api.apiname + " " << endl
144 << " number of input channels: " << ninchannels
145 << endl
146 << " number of output channels: " << noutchannels << endl;
147 return str.str();
148 }
149
156};
157
Class that specifies API related information. An API configuration is part of the DAQConfiguration an...
string apiname
Qty
Possible physical quantities that are recorded.
Structure containing device info parameters.
unsigned ninchannels
The number of input channels available for the device.
bool duplexModeForced
This flag is used to be able to indicate that the device cannot run input and output streams independ...
unsigned noutchannels
The number of output channels available for the device.
dvec availableSampleRates
Available sample rates the device can run on.
string device_name
The name of the device.
double prefSampleRate() const
std::vector< DataTypeDescriptor::DataType > availableDataTypes
The available data types the device can output.
DaqChannel::Qty physicalOutputQty
The physical quantity of the output signal. For 'normal' audio devices, this is typically a 'number' ...
int prefDataTypeIndex
The device's prefferd data type.
virtual ~DeviceInfo()
Virtual desctructor. Can be derived class.
bool hasInputACCouplingSwitch
Whether the device is capable of enabling a hardware AC-coupling.
usvec availableFramesPerBlock
Available latency-setting (number of frames passed in each callback).
int prefInputRangeIndex
Its preffered range.
static DeviceInfoList getDeviceInfo()
Create a list of DeviceInfo's that are at call time avalable.
virtual std::unique_ptr< DeviceInfo > clone() const
Clone a device info.
DaqApi api
Backend API corresponding to device.
bool hasInternalOutputMonitor
Whether the device has an internal monitor of the output signal. If true, the device is able to monit...
DeviceInfo & operator=(const DeviceInfo &)=delete
us prefFramesPerBlockIndex
Preffered number of frames per callback.
bool hasInputTrigger
Whether the device is able to trigger on input.
dvec availableInputRanges
Available ranges for the input, i.e. +/- 1V and/or +/- 10 V etc.
int prefSampleRateIndex
Preferred setting for the sample rate.
bool hasInputIEPE
Whether the device is capable to provide IEPE constant current power supply.
std::vector< std::unique_ptr< DeviceInfo > > DeviceInfoList
std::vector< us > usvec
std::vector< double > dvec
size_t us
We often use boolean values.
Definition lasp_types.h:29