19 YARP_LOG_COMPONENT(AudioPlayerWrapperParamsCOMPONENT,
"yarp.device.AudioPlayerWrapper")
30 std::vector<std::string> params;
31 params.push_back(
"name");
32 params.push_back(
"period");
33 params.push_back(
"debug");
34 params.push_back(
"playback_network_buffer_size");
35 params.push_back(
"start");
42 if (paramName ==
"name")
47 if (paramName ==
"period")
49 paramValue = std::to_string(
m_period);
52 if (paramName ==
"debug")
54 if (
m_debug==
true) paramValue =
"true";
55 else paramValue =
"false";
58 if (paramName ==
"playback_network_buffer_size")
63 if (paramName ==
"start")
65 if (
m_start==
true) paramValue =
"true";
66 else paramValue =
"false";
70 yError() <<
"parameter '" << paramName <<
"' was not found";
89 if (config.
check(
"help"))
98 if (config.
check(
"name"))
101 yCInfo(AudioPlayerWrapperParamsCOMPONENT) <<
"Parameter 'name' using value:" <<
m_name;
105 yCInfo(AudioPlayerWrapperParamsCOMPONENT) <<
"Parameter 'name' using DEFAULT value:" <<
m_name;
107 prop_check.
unput(
"name");
112 if (config.
check(
"period"))
115 yCInfo(AudioPlayerWrapperParamsCOMPONENT) <<
"Parameter 'period' using value:" <<
m_period;
119 yCInfo(AudioPlayerWrapperParamsCOMPONENT) <<
"Parameter 'period' using DEFAULT value:" <<
m_period;
121 prop_check.
unput(
"period");
126 if (config.
check(
"debug"))
129 yCInfo(AudioPlayerWrapperParamsCOMPONENT) <<
"Parameter 'debug' using value:" <<
m_debug;
133 yCInfo(AudioPlayerWrapperParamsCOMPONENT) <<
"Parameter 'debug' using DEFAULT value:" <<
m_debug;
135 prop_check.
unput(
"debug");
140 if (config.
check(
"playback_network_buffer_size"))
149 prop_check.
unput(
"playback_network_buffer_size");
154 if (config.
check(
"start"))
157 yCInfo(AudioPlayerWrapperParamsCOMPONENT) <<
"Parameter 'start' using value:" <<
m_start;
161 yCInfo(AudioPlayerWrapperParamsCOMPONENT) <<
"Parameter 'start' using DEFAULT value:" <<
m_start;
163 prop_check.
unput(
"start");
198 doc = doc + std::string(
"\n=============================================\n");
199 doc = doc + std::string(
"This is the help for device: AudioPlayerWrapper\n");
200 doc = doc + std::string(
"\n");
201 doc = doc + std::string(
"This is the list of the parameters accepted by the device:\n");
202 doc = doc + std::string(
"'name': prefix of the ports opened by the device\n");
203 doc = doc + std::string(
"'period': period of the internal thread, in s\n");
204 doc = doc + std::string(
"'debug': developers use only\n");
205 doc = doc + std::string(
"'playback_network_buffer_size': size of the audio buffer in seconds, increasing this value to robustify the real-time audio stream (it will increase latency too)\n");
206 doc = doc + std::string(
"'start': automatically activates the playback when the device is started\n");
207 doc = doc + std::string(
"\n");
208 doc = doc + std::string(
"Here are some examples of invocation command with yarpdev, with all params:\n");
209 doc = doc +
" yarpdev --device AudioPlayerWrapper --name /audioPlayerWrapper --period 0.02 --debug false --playback_network_buffer_size 5.0 --start false\n";
210 doc = doc + std::string(
"Using only mandatory params:\n");
211 doc = doc +
" yarpdev --device AudioPlayerWrapper\n";
212 doc = doc + std::string(
"=============================================\n\n");
return doc;
std::string m_provided_configuration
std::string getConfiguration() const override
Return the configuration of the device.
bool getParamValue(const std::string ¶mName, std::string ¶mValue) const override
Return the value (represented as a string) of the requested parameter.
std::string getDocumentationOfDeviceParams() const override
Get the documentation of the DeviceDriver's parameters.
double m_playback_network_buffer_size
std::vector< std::string > getListOfParams() const override
Return a list of all params used by the device.
AudioPlayerWrapper_ParamsParser()
bool parseParams(const yarp::os::Searchable &config) override
Parse the DeviceDriver parameters.
A class for storing options and configuration information.
void unput(const std::string &key)
Remove the association from the given key to a value, if present.
A base class for nested structures that can be searched.
virtual bool check(const std::string &key) const =0
Check if there exists a property of the given name.
virtual std::string toString() const =0
Return a standard text representation of the content of the object.
virtual Value & find(const std::string &key) const =0
Gets a value corresponding to a given keyword.
#define yCInfo(component,...)
#define YARP_LOG_COMPONENT(name,...)