30 std::vector<std::string> params;
31 params.push_back(
"file_name");
32 params.push_back(
"save_mode");
33 params.push_back(
"add_marker");
40 if (paramName ==
"file_name")
45 if (paramName ==
"save_mode")
50 if (paramName ==
"add_marker")
53 else paramValue =
"false";
57 yError() <<
"parameter '" << paramName <<
"' was not found";
76 if (config.
check(
"help"))
85 if (config.
check(
"file_name"))
88 yCInfo(AudioToFileDeviceParamsCOMPONENT) <<
"Parameter 'file_name' using value:" <<
m_file_name;
92 yCInfo(AudioToFileDeviceParamsCOMPONENT) <<
"Parameter 'file_name' using DEFAULT value:" <<
m_file_name;
94 prop_check.
unput(
"file_name");
99 if (config.
check(
"save_mode"))
102 yCInfo(AudioToFileDeviceParamsCOMPONENT) <<
"Parameter 'save_mode' using value:" <<
m_save_mode;
106 yCInfo(AudioToFileDeviceParamsCOMPONENT) <<
"Parameter 'save_mode' using DEFAULT value:" <<
m_save_mode;
108 prop_check.
unput(
"save_mode");
113 if (config.
check(
"add_marker"))
116 yCInfo(AudioToFileDeviceParamsCOMPONENT) <<
"Parameter 'add_marker' using value:" <<
m_add_marker;
120 yCInfo(AudioToFileDeviceParamsCOMPONENT) <<
"Parameter 'add_marker' using DEFAULT value:" <<
m_add_marker;
122 prop_check.
unput(
"add_marker");
157 doc = doc + std::string(
"\n=============================================\n");
158 doc = doc + std::string(
"This is the help for device: AudioToFileDevice\n");
159 doc = doc + std::string(
"\n");
160 doc = doc + std::string(
"This is the list of the parameters accepted by the device:\n");
161 doc = doc + std::string(
"'file_name': The name of the file written by the module\n");
162 doc = doc + std::string(
"'save_mode': Affects the behavior of the module and defines the save mode, as described in the documentation.\n");
163 doc = doc + std::string(
"'add_marker': If set, it will add a marker at the beginning and at the ending of each received waveform.\n");
164 doc = doc + std::string(
"\n");
165 doc = doc + std::string(
"Here are some examples of invocation command with yarpdev, with all params:\n");
166 doc = doc +
" yarpdev --device audioToFileDevice --file_name audio_out.wav --save_mode overwrite_file --add_marker false\n";
167 doc = doc + std::string(
"Using only mandatory params:\n");
168 doc = doc +
" yarpdev --device audioToFileDevice\n";
169 doc = doc + std::string(
"=============================================\n\n");
return doc;
bool getParamValue(const std::string ¶mName, std::string ¶mValue) const override
Return the value (represented as a string) of the requested parameter.
std::string getConfiguration() const override
Return the configuration of the device.
std::string m_provided_configuration
std::vector< std::string > getListOfParams() const override
Return a list of all params used by the device.
std::string getDocumentationOfDeviceParams() const override
Get the documentation of the DeviceDriver's parameters.
bool parseParams(const yarp::os::Searchable &config) override
Parse the DeviceDriver parameters.
AudioToFileDevice_ParamsParser()
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,...)