YARP
Yet Another Robot Platform
PortAudioPlayerDeviceDriver Class Reference

portaudioPlayer: Documentation to be added More...

#include <portaudioPlayer/PortAudioPlayerDeviceDriver.h>

+ Inheritance diagram for PortAudioPlayerDeviceDriver:

Public Member Functions

 PortAudioPlayerDeviceDriver ()
 
 PortAudioPlayerDeviceDriver (const PortAudioPlayerDeviceDriver &)=delete
 
 PortAudioPlayerDeviceDriver (PortAudioPlayerDeviceDriver &&)=delete
 
PortAudioPlayerDeviceDriveroperator= (const PortAudioPlayerDeviceDriver &)=delete
 
PortAudioPlayerDeviceDriveroperator= (PortAudioPlayerDeviceDriver &&)=delete
 
 ~PortAudioPlayerDeviceDriver () override
 
bool open (yarp::os::Searchable &config) override
 Open the DeviceDriver. More...
 
bool open (PortAudioPlayerDeviceDriverSettings &config)
 Configures the device. More...
 
bool close () override
 Close the DeviceDriver. More...
 
bool renderSound (const yarp::sig::Sound &sound) override
 Render a sound using a device (i.e. More...
 
bool startPlayback () override
 Start the playback. More...
 
bool stopPlayback () override
 Stop the playback. More...
 
bool abortSound ()
 
bool immediateSound (const yarp::sig::Sound &sound)
 
bool appendSound (const yarp::sig::Sound &sound)
 
bool getPlaybackAudioBufferMaxSize (yarp::dev::AudioBufferSize &size) override
 
bool getPlaybackAudioBufferCurrentSize (yarp::dev::AudioBufferSize &size) override
 
bool resetPlaybackAudioBuffer () override
 
- Public Member Functions inherited from yarp::dev::IAudioRender
virtual ~IAudioRender ()
 Destructor. More...
 
- Public Member Functions inherited from yarp::dev::DeviceDriver
 ~DeviceDriver () override=default
 Destructor. More...
 
template<class T >
bool view (T *&x)
 Get an interface to the device driver. More...
 
virtual DeviceDrivergetImplementation ()
 Some drivers are bureaucrats, pointing at others. More...
 
- Public Member Functions inherited from yarp::os::IConfig
virtual ~IConfig ()
 Destructor. More...
 
virtual bool configure (Searchable &config)
 Change online parameters. More...
 

Protected Types

enum  {
  RENDER_APPEND =0,
  RENDER_IMMEDIATE =1
}
 

Protected Member Functions

void handleError ()
 

Protected Attributes

void * m_system_resource
 
PortAudioPlayerDeviceDriverSettings m_driverConfig
 
enum PortAudioPlayerDeviceDriver:: { ... }  renderMode
 

Detailed Description

portaudioPlayer: Documentation to be added

Requires the PortAudio library (http://www.portaudio.com), at least v19.

Definition at line 71 of file PortAudioPlayerDeviceDriver.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
RENDER_APPEND 
RENDER_IMMEDIATE 

Definition at line 127 of file PortAudioPlayerDeviceDriver.h.

Constructor & Destructor Documentation

◆ PortAudioPlayerDeviceDriver() [1/3]

PortAudioPlayerDeviceDriver::PortAudioPlayerDeviceDriver ( )

Definition at line 200 of file PortAudioPlayerDeviceDriver.cpp.

◆ PortAudioPlayerDeviceDriver() [2/3]

PortAudioPlayerDeviceDriver::PortAudioPlayerDeviceDriver ( const PortAudioPlayerDeviceDriver )
delete

◆ PortAudioPlayerDeviceDriver() [3/3]

PortAudioPlayerDeviceDriver::PortAudioPlayerDeviceDriver ( PortAudioPlayerDeviceDriver &&  )
delete

◆ ~PortAudioPlayerDeviceDriver()

PortAudioPlayerDeviceDriver::~PortAudioPlayerDeviceDriver ( )
override

Definition at line 210 of file PortAudioPlayerDeviceDriver.cpp.

Member Function Documentation

◆ abortSound()

bool PortAudioPlayerDeviceDriver::abortSound ( )

Definition at line 323 of file PortAudioPlayerDeviceDriver.cpp.

◆ appendSound()

bool PortAudioPlayerDeviceDriver::appendSound ( const yarp::sig::Sound sound)

Definition at line 405 of file PortAudioPlayerDeviceDriver.cpp.

◆ close()

bool PortAudioPlayerDeviceDriver::close ( )
overridevirtual

Close the DeviceDriver.

Returns
true/false on success/failure.

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 300 of file PortAudioPlayerDeviceDriver.cpp.

◆ getPlaybackAudioBufferCurrentSize()

bool PortAudioPlayerDeviceDriver::getPlaybackAudioBufferCurrentSize ( yarp::dev::AudioBufferSize size)
overridevirtual

Implements yarp::dev::IAudioRender.

Definition at line 419 of file PortAudioPlayerDeviceDriver.cpp.

◆ getPlaybackAudioBufferMaxSize()

bool PortAudioPlayerDeviceDriver::getPlaybackAudioBufferMaxSize ( yarp::dev::AudioBufferSize size)
overridevirtual

Implements yarp::dev::IAudioRender.

Definition at line 426 of file PortAudioPlayerDeviceDriver.cpp.

◆ handleError()

void PortAudioPlayerDeviceDriver::handleError ( )
protected

Definition at line 287 of file PortAudioPlayerDeviceDriver.cpp.

◆ immediateSound()

bool PortAudioPlayerDeviceDriver::immediateSound ( const yarp::sig::Sound sound)

Definition at line 339 of file PortAudioPlayerDeviceDriver.cpp.

◆ open() [1/2]

bool PortAudioPlayerDeviceDriver::open ( PortAudioPlayerDeviceDriverSettings config)

Configures the device.

rate: Sample rate to use, in Hertz. Specify 0 to use a default.

samples: Number of samples per call to getSound. Specify 0 to use a default.

channels: Number of channels of input. Specify 0 to use a default.

Returns
true on success

Definition at line 235 of file PortAudioPlayerDeviceDriver.cpp.

◆ open() [2/2]

bool PortAudioPlayerDeviceDriver::open ( yarp::os::Searchable config)
overridevirtual

Open the DeviceDriver.

Parameters
configis a list of parameters for the device. Which parameters are effective for your device can vary. See device invocation examples. If there is no example for your device, you can run the "yarpdev" program with the verbose flag set to probe what parameters the device is checking. If that fails too, you'll need to read the source code (please nag one of the yarp developers to add documentation for your device).
Returns
true/false upon success/failure

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 216 of file PortAudioPlayerDeviceDriver.cpp.

◆ operator=() [1/2]

PortAudioPlayerDeviceDriver& PortAudioPlayerDeviceDriver::operator= ( const PortAudioPlayerDeviceDriver )
delete

◆ operator=() [2/2]

PortAudioPlayerDeviceDriver& PortAudioPlayerDeviceDriver::operator= ( PortAudioPlayerDeviceDriver &&  )
delete

◆ renderSound()

bool PortAudioPlayerDeviceDriver::renderSound ( const yarp::sig::Sound sound)
overridevirtual

Render a sound using a device (i.e.

send it to the speakers).

Parameters
soundthe sound to be rendered
Returns
true/false upon success/failure

Implements yarp::dev::IAudioRender.

Definition at line 355 of file PortAudioPlayerDeviceDriver.cpp.

◆ resetPlaybackAudioBuffer()

bool PortAudioPlayerDeviceDriver::resetPlaybackAudioBuffer ( )
overridevirtual

Implements yarp::dev::IAudioRender.

Definition at line 433 of file PortAudioPlayerDeviceDriver.cpp.

◆ startPlayback()

bool PortAudioPlayerDeviceDriver::startPlayback ( )
overridevirtual

Start the playback.

Returns
true/false upon success/failure

Implements yarp::dev::IAudioRender.

Definition at line 440 of file PortAudioPlayerDeviceDriver.cpp.

◆ stopPlayback()

bool PortAudioPlayerDeviceDriver::stopPlayback ( )
overridevirtual

Stop the playback.

Returns
true/false upon success/failure

Implements yarp::dev::IAudioRender.

Definition at line 447 of file PortAudioPlayerDeviceDriver.cpp.

Member Data Documentation

◆ m_driverConfig

PortAudioPlayerDeviceDriverSettings PortAudioPlayerDeviceDriver::m_driverConfig
protected

Definition at line 126 of file PortAudioPlayerDeviceDriver.h.

◆ m_system_resource

void* PortAudioPlayerDeviceDriver::m_system_resource
protected

Definition at line 124 of file PortAudioPlayerDeviceDriver.h.

◆ renderMode

enum { ... } PortAudioPlayerDeviceDriver::renderMode

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