YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
AudioRecorder_nws_yarp_ParamsParser Class Reference

This class is the parameters parser for class AudioRecorder_nws_yarp. More...

#include <networkWrappers/audioRecorder_nws_yarp/AudioRecorder_nws_yarp_ParamsParser.h>

+ Inheritance diagram for AudioRecorder_nws_yarp_ParamsParser:

Classes

struct  parser_version_type
 

Public Member Functions

 AudioRecorder_nws_yarp_ParamsParser ()
 
 ~AudioRecorder_nws_yarp_ParamsParser () override=default
 
bool parseParams (const yarp::os::Searchable &config) override
 Parse the DeviceDriver parameters.
 
std::string getDeviceClassName () const override
 Get the name of the DeviceDriver class.
 
std::string getDeviceName () const override
 Get the name of the device (i.e.
 
std::string getDocumentationOfDeviceParams () const override
 Get the documentation of the DeviceDriver's parameters.
 
std::vector< std::string > getListOfParams () const override
 Return a list of all params used by the device.
 
- Public Member Functions inherited from yarp::dev::IDeviceDriverParams
virtual ~IDeviceDriverParams ()
 

Public Attributes

const std::string m_device_classname = {"AudioRecorder_nws_yarp"}
 
const std::string m_device_name = {"audioRecorder_nws_yarp"}
 
bool m_parser_is_strict = false
 
const parser_version_type m_parser_version = {}
 
const std::string m_name_defaultValue = {"/audioRecorder_nws"}
 
const std::string m_period_defaultValue = {"0.02"}
 
const std::string m_debug_defaultValue = {"false"}
 
const std::string m_min_samples_over_network_defaultValue = {"11250"}
 
const std::string m_max_samples_over_network_defaultValue = {"11250"}
 
const std::string m_getSound_timeout_defaultValue = {"1.0"}
 
const std::string m_start_defaultValue = {"false"}
 
const std::string m_send_sound_on_stop_defaultValue = {"true"}
 
std::string m_name = {"/audioRecorder_nws"}
 
float m_period = {0.02}
 
bool m_debug = {false}
 
size_t m_min_samples_over_network = {11250}
 
size_t m_max_samples_over_network = {11250}
 
float m_getSound_timeout = {1.0}
 
bool m_start = {false}
 
bool m_send_sound_on_stop = {true}
 

Detailed Description

This class is the parameters parser for class AudioRecorder_nws_yarp.

These are the used parameters:

Group name Parameter name Type Units Default Value Required Description Notes
- name string - /audioRecorder_nws 0 full name of the port opened by the device MUST start with a '/' character, xxx/audio:o and xxx/rpc suffixes are appended
- period float s 0.02 0 period of the internal thread, in ms default 20ms
- debug bool - false 0 developers use only -
- min_samples_over_network size_t samples 11250 0 sends the network packet ifs n samples are collected AND the timeout is expired the algorithm is implemented in AudioRecorderDeviceBase::getSound() method
- max_samples_over_network size_t samples 11250 0 sends the network packet as soon as n samples have been collected the algorithm is implemented in AudioRecorderDeviceBase::getSound() method
- max_samples_timeout float s 1.0 0 timeout for sample collection the algorithm is implemented in AudioRecorderDeviceBase::getSound() method
- start bool - false 0 automatically activates the recording when the device is started if false, the recording is enabled via rpc port
- send_sound_on_stop bool - true 0 send the sound when the stop rpc is called, even if it does not met network size parameters it will not send empty sounds

The device can be launched by yarpdev using one of the following examples (with and without all optional parameters):

yarpdev --device audioRecorder_nws_yarp --name /audioRecorder_nws --period 0.02 --debug false --min_samples_over_network 11250 --max_samples_over_network 11250 --max_samples_timeout 1.0 --start false --send_sound_on_stop true
yarpdev --device audioRecorder_nws_yarp

Definition at line 48 of file AudioRecorder_nws_yarp_ParamsParser.h.

Constructor & Destructor Documentation

◆ AudioRecorder_nws_yarp_ParamsParser()

AudioRecorder_nws_yarp_ParamsParser::AudioRecorder_nws_yarp_ParamsParser ( )

Definition at line 23 of file AudioRecorder_nws_yarp_ParamsParser.cpp.

◆ ~AudioRecorder_nws_yarp_ParamsParser()

AudioRecorder_nws_yarp_ParamsParser::~AudioRecorder_nws_yarp_ParamsParser ( )
overridedefault

Member Function Documentation

◆ getDeviceClassName()

std::string AudioRecorder_nws_yarp_ParamsParser::getDeviceClassName ( ) const
inlineoverridevirtual

Get the name of the DeviceDriver class.

Returns
A string containing the name of the class.

Implements yarp::dev::IDeviceDriverParams.

Definition at line 84 of file AudioRecorder_nws_yarp_ParamsParser.h.

◆ getDeviceName()

std::string AudioRecorder_nws_yarp_ParamsParser::getDeviceName ( ) const
inlineoverridevirtual

Get the name of the device (i.e.

the plugin name).

Returns
A string containing the name of the device.

Implements yarp::dev::IDeviceDriverParams.

Definition at line 85 of file AudioRecorder_nws_yarp_ParamsParser.h.

◆ getDocumentationOfDeviceParams()

std::string AudioRecorder_nws_yarp_ParamsParser::getDocumentationOfDeviceParams ( ) const
overridevirtual

Get the documentation of the DeviceDriver's parameters.

Returns
A string containing the documentation.

Implements yarp::dev::IDeviceDriverParams.

Definition at line 194 of file AudioRecorder_nws_yarp_ParamsParser.cpp.

◆ getListOfParams()

std::vector< std::string > AudioRecorder_nws_yarp_ParamsParser::getListOfParams ( ) const
overridevirtual

Return a list of all params used by the device.

Returns
A vector containing the names of parameters used by the device.

Implements yarp::dev::IDeviceDriverParams.

Definition at line 28 of file AudioRecorder_nws_yarp_ParamsParser.cpp.

◆ parseParams()

bool AudioRecorder_nws_yarp_ParamsParser::parseParams ( const yarp::os::Searchable config)
overridevirtual

Parse the DeviceDriver parameters.

Returns
true if the parsing is successful, false otherwise

Implements yarp::dev::IDeviceDriverParams.

Definition at line 43 of file AudioRecorder_nws_yarp_ParamsParser.cpp.

Member Data Documentation

◆ m_debug

bool AudioRecorder_nws_yarp_ParamsParser::m_debug = {false}

Definition at line 76 of file AudioRecorder_nws_yarp_ParamsParser.h.

◆ m_debug_defaultValue

const std::string AudioRecorder_nws_yarp_ParamsParser::m_debug_defaultValue = {"false"}

Definition at line 67 of file AudioRecorder_nws_yarp_ParamsParser.h.

◆ m_device_classname

const std::string AudioRecorder_nws_yarp_ParamsParser::m_device_classname = {"AudioRecorder_nws_yarp"}

Definition at line 55 of file AudioRecorder_nws_yarp_ParamsParser.h.

◆ m_device_name

const std::string AudioRecorder_nws_yarp_ParamsParser::m_device_name = {"audioRecorder_nws_yarp"}

Definition at line 56 of file AudioRecorder_nws_yarp_ParamsParser.h.

◆ m_getSound_timeout

float AudioRecorder_nws_yarp_ParamsParser::m_getSound_timeout = {1.0}

Definition at line 79 of file AudioRecorder_nws_yarp_ParamsParser.h.

◆ m_getSound_timeout_defaultValue

const std::string AudioRecorder_nws_yarp_ParamsParser::m_getSound_timeout_defaultValue = {"1.0"}

Definition at line 70 of file AudioRecorder_nws_yarp_ParamsParser.h.

◆ m_max_samples_over_network

size_t AudioRecorder_nws_yarp_ParamsParser::m_max_samples_over_network = {11250}

Definition at line 78 of file AudioRecorder_nws_yarp_ParamsParser.h.

◆ m_max_samples_over_network_defaultValue

const std::string AudioRecorder_nws_yarp_ParamsParser::m_max_samples_over_network_defaultValue = {"11250"}

Definition at line 69 of file AudioRecorder_nws_yarp_ParamsParser.h.

◆ m_min_samples_over_network

size_t AudioRecorder_nws_yarp_ParamsParser::m_min_samples_over_network = {11250}

Definition at line 77 of file AudioRecorder_nws_yarp_ParamsParser.h.

◆ m_min_samples_over_network_defaultValue

const std::string AudioRecorder_nws_yarp_ParamsParser::m_min_samples_over_network_defaultValue = {"11250"}

Definition at line 68 of file AudioRecorder_nws_yarp_ParamsParser.h.

◆ m_name

std::string AudioRecorder_nws_yarp_ParamsParser::m_name = {"/audioRecorder_nws"}

Definition at line 74 of file AudioRecorder_nws_yarp_ParamsParser.h.

◆ m_name_defaultValue

const std::string AudioRecorder_nws_yarp_ParamsParser::m_name_defaultValue = {"/audioRecorder_nws"}

Definition at line 65 of file AudioRecorder_nws_yarp_ParamsParser.h.

◆ m_parser_is_strict

bool AudioRecorder_nws_yarp_ParamsParser::m_parser_is_strict = false

Definition at line 57 of file AudioRecorder_nws_yarp_ParamsParser.h.

◆ m_parser_version

const parser_version_type AudioRecorder_nws_yarp_ParamsParser::m_parser_version = {}

Definition at line 63 of file AudioRecorder_nws_yarp_ParamsParser.h.

◆ m_period

float AudioRecorder_nws_yarp_ParamsParser::m_period = {0.02}

Definition at line 75 of file AudioRecorder_nws_yarp_ParamsParser.h.

◆ m_period_defaultValue

const std::string AudioRecorder_nws_yarp_ParamsParser::m_period_defaultValue = {"0.02"}

Definition at line 66 of file AudioRecorder_nws_yarp_ParamsParser.h.

◆ m_send_sound_on_stop

bool AudioRecorder_nws_yarp_ParamsParser::m_send_sound_on_stop = {true}

Definition at line 81 of file AudioRecorder_nws_yarp_ParamsParser.h.

◆ m_send_sound_on_stop_defaultValue

const std::string AudioRecorder_nws_yarp_ParamsParser::m_send_sound_on_stop_defaultValue = {"true"}

Definition at line 72 of file AudioRecorder_nws_yarp_ParamsParser.h.

◆ m_start

bool AudioRecorder_nws_yarp_ParamsParser::m_start = {false}

Definition at line 80 of file AudioRecorder_nws_yarp_ParamsParser.h.

◆ m_start_defaultValue

const std::string AudioRecorder_nws_yarp_ParamsParser::m_start_defaultValue = {"false"}

Definition at line 71 of file AudioRecorder_nws_yarp_ParamsParser.h.


The documentation for this class was generated from the following files: