21 (options.
find(
"sender_side").
asBool()) ?
"sender side" :
"receiver side");
24 m_channel = (options.
check(
"channel") ? options.
find(
"channel").
asInt8() : -1);
25 m_output_freq = (options.
check(
"frequency") ? options.
find(
"frequency").
asInt32() : -1);
26 m_gain = (options.
check(
"gain_percent") ? options.
find(
"gain_percent").
asFloat32() : -1)/100;
46 if (m_output_freq < 0)
50 else if (m_output_freq == 0)
76 params.
put(
"channel", m_channel);
77 params.
put(
"frequency", m_output_freq);
bool create(const yarp::os::Property &options) override
This will be called when the dll is properly loaded by the portmonitor carrier.
yarp::os::Things & update(yarp::os::Things &thing) override
After data get accpeted in the accept() callback, an instance of that is given to the update function...
void destroy() override
This will be called when the portmonitor object destroyes.
bool accept(yarp::os::Things &thing) override
This will be called when the data reach the portmonitor object.
void trig() override
This will be called when one of the peer connections to the same import port receives data.
bool getparam(yarp::os::Property ¶ms) override
This will be called when the portmonitor carrier parameters are requested via YARP admin port.
bool setparam(const yarp::os::Property ¶ms) override
This will be called when the portmonitor carrier parameters are set via YARP admin port.
A mini-server for performing network communication in the background.
A class for storing options and configuration information.
Value & find(const std::string &key) const override
Gets a value corresponding to a given keyword.
void put(const std::string &key, const std::string &value)
Associate the given key with the given string.
bool check(const std::string &key) const override
Check if there exists a property of the given name.
Base class for generic things.
void setPortWriter(yarp::os::PortWriter *writer)
Set the reference to a PortWriter object.
virtual std::int8_t asInt8() const
Get 8-bit integer value.
virtual bool asBool() const
Get boolean value.
virtual std::int32_t asInt32() const
Get 32-bit integer value.
virtual yarp::conf::float32_t asFloat32() const
Get 32-bit floating point value.
Class for storing sounds See Audio in YARP for additional documentation on YARP audio.
Sound extractChannelAsSound(size_t channel_id) const
Extract a single channel from the sound.
void amplify(double gain)
amplify a sound
#define yCInfo(component,...)
#define yCError(component,...)
#define yCWarning(component,...)
#define yCDebug(component,...)
#define YARP_LOG_COMPONENT(name,...)
An interface to the operating system, including Port based communication.
bool resample(yarp::sig::Sound &snd, size_t frequency)
Resample a sound.