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

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

#include <audioFromFileDevice/AudioFromFileDevice_ParamsParser.h>

+ Inheritance diagram for AudioFromFileDevice_ParamsParser:

Classes

struct  parser_version_type
 

Public Member Functions

 AudioFromFileDevice_ParamsParser ()
 
 ~AudioFromFileDevice_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 = {"AudioFromFileDevice"}
 
const std::string m_device_name = {"audioFromFileDevice"}
 
bool m_parser_is_strict = false
 
const parser_version_type m_parser_version = {}
 
const std::string m_use_params_from_file_defaultValue = {"true"}
 
const std::string m_file_name_defaultValue = {"audio.wav"}
 
const std::string m_period_defaultValue = {"0.010"}
 
const std::string m_driver_frame_size_defaultValue = {"512"}
 
const std::string m_reset_on_stop_defaultValue = {"false"}
 
bool m_use_params_from_file = {true}
 
std::string m_file_name = {"audio.wav"}
 
double m_period = {0.010}
 
int m_driver_frame_size = {512}
 
bool m_reset_on_stop = {false}
 

Detailed Description

This class is the parameters parser for class AudioFromFileDevice.

These are the used parameters:

Group name Parameter name Type Units Default Value Required Description Notes
- use_params_from_file bool - true 0 If set to true, recording params (e.g. channels, freq etc. are taken from file. Otherwise are AUDIO_BASE parameters are used and the file is converted to the specified format -
- file_name string - audio.wav 0 The name of the file opened by the module Only .wav files supported
- period double s 0.010 0 the period of thread which processes the file On each iteration xxx samples are processed
- driver_frame_size int samples 512 0 the number of samples to process on each iteration of the thread -
- reset_on_stop bool - false 0 if enabled, the file is played back from the beginning every stop. Otherwise on start the previous position is resumed -

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

yarpdev --device audioFromFileDevice --use_params_from_file true --file_name audio.wav --period 0.010 --driver_frame_size 512 --reset_on_stop false
yarpdev --device audioFromFileDevice

Definition at line 45 of file AudioFromFileDevice_ParamsParser.h.

Constructor & Destructor Documentation

◆ AudioFromFileDevice_ParamsParser()

AudioFromFileDevice_ParamsParser::AudioFromFileDevice_ParamsParser ( )

Definition at line 23 of file AudioFromFileDevice_ParamsParser.cpp.

◆ ~AudioFromFileDevice_ParamsParser()

AudioFromFileDevice_ParamsParser::~AudioFromFileDevice_ParamsParser ( )
overridedefault

Member Function Documentation

◆ getDeviceClassName()

std::string AudioFromFileDevice_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 75 of file AudioFromFileDevice_ParamsParser.h.

◆ getDeviceName()

std::string AudioFromFileDevice_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 76 of file AudioFromFileDevice_ParamsParser.h.

◆ getDocumentationOfDeviceParams()

std::string AudioFromFileDevice_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 149 of file AudioFromFileDevice_ParamsParser.cpp.

◆ getListOfParams()

std::vector< std::string > AudioFromFileDevice_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 AudioFromFileDevice_ParamsParser.cpp.

◆ parseParams()

bool AudioFromFileDevice_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 40 of file AudioFromFileDevice_ParamsParser.cpp.

Member Data Documentation

◆ m_device_classname

const std::string AudioFromFileDevice_ParamsParser::m_device_classname = {"AudioFromFileDevice"}

Definition at line 52 of file AudioFromFileDevice_ParamsParser.h.

◆ m_device_name

const std::string AudioFromFileDevice_ParamsParser::m_device_name = {"audioFromFileDevice"}

Definition at line 53 of file AudioFromFileDevice_ParamsParser.h.

◆ m_driver_frame_size

int AudioFromFileDevice_ParamsParser::m_driver_frame_size = {512}

Definition at line 71 of file AudioFromFileDevice_ParamsParser.h.

◆ m_driver_frame_size_defaultValue

const std::string AudioFromFileDevice_ParamsParser::m_driver_frame_size_defaultValue = {"512"}

Definition at line 65 of file AudioFromFileDevice_ParamsParser.h.

◆ m_file_name

std::string AudioFromFileDevice_ParamsParser::m_file_name = {"audio.wav"}

Definition at line 69 of file AudioFromFileDevice_ParamsParser.h.

◆ m_file_name_defaultValue

const std::string AudioFromFileDevice_ParamsParser::m_file_name_defaultValue = {"audio.wav"}

Definition at line 63 of file AudioFromFileDevice_ParamsParser.h.

◆ m_parser_is_strict

bool AudioFromFileDevice_ParamsParser::m_parser_is_strict = false

Definition at line 54 of file AudioFromFileDevice_ParamsParser.h.

◆ m_parser_version

const parser_version_type AudioFromFileDevice_ParamsParser::m_parser_version = {}

Definition at line 60 of file AudioFromFileDevice_ParamsParser.h.

◆ m_period

double AudioFromFileDevice_ParamsParser::m_period = {0.010}

Definition at line 70 of file AudioFromFileDevice_ParamsParser.h.

◆ m_period_defaultValue

const std::string AudioFromFileDevice_ParamsParser::m_period_defaultValue = {"0.010"}

Definition at line 64 of file AudioFromFileDevice_ParamsParser.h.

◆ m_reset_on_stop

bool AudioFromFileDevice_ParamsParser::m_reset_on_stop = {false}

Definition at line 72 of file AudioFromFileDevice_ParamsParser.h.

◆ m_reset_on_stop_defaultValue

const std::string AudioFromFileDevice_ParamsParser::m_reset_on_stop_defaultValue = {"false"}

Definition at line 66 of file AudioFromFileDevice_ParamsParser.h.

◆ m_use_params_from_file

bool AudioFromFileDevice_ParamsParser::m_use_params_from_file = {true}

Definition at line 68 of file AudioFromFileDevice_ParamsParser.h.

◆ m_use_params_from_file_defaultValue

const std::string AudioFromFileDevice_ParamsParser::m_use_params_from_file_defaultValue = {"true"}

Definition at line 62 of file AudioFromFileDevice_ParamsParser.h.


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