trikRuntime
trikControl::SoundSensorWorker Class Reference

Worker object that processes sound sensor output and updates stored reading. More...

#include <soundSensorWorker.h>

Inheritance diagram for trikControl::SoundSensorWorker:
Collaboration diagram for trikControl::SoundSensorWorker:

Public Slots

void init (bool showOnDisplay)
 Initializes an ALSA. More...
 
void detect ()
 Not use. More...
 
void volume (int volCoeff)
 Sets volume coefficient. More...
 
QVector< int > read ()
 Returns angle and volume for both channels. Can be accessed directly from other thread. More...
 
- Public Slots inherited from trikControl::AbstractVirtualSensorWorker
virtual void stop ()
 Stops detection until init() will be called again. More...
 

Public Member Functions

 SoundSensorWorker (const QString &script, const QString &inputFile, const QString &outputFile, DeviceState &state, trikHal::HardwareAbstractionInterface &hardwareAbstraction)
 Constructor. More...
 
 ~SoundSensorWorker () override
 
- Public Member Functions inherited from trikControl::AbstractVirtualSensorWorker
 AbstractVirtualSensorWorker (const QString &script, const QString &inputFile, const QString &outputFile, DeviceState &state, trikHal::HardwareAbstractionInterface &hardwareAbstraction)
 Constructor. More...
 
 ~AbstractVirtualSensorWorker () override
 
Status status () const override
 Returns current status of the device. More...
 
- Public Member Functions inherited from trikControl::DeviceInterface
 DeviceInterface ()=default
 
virtual ~DeviceInterface ()=default
 

Additional Inherited Members

- Public Types inherited from trikControl::DeviceInterface
enum  Status {
  Status::permanentFailure, Status::temporaryFailure, Status::off, Status::starting,
  Status::ready, Status::stopping
}
 Device status. More...
 
- Signals inherited from trikControl::AbstractVirtualSensorWorker
void stopped ()
 Emitted when sensor is stopped successfully. More...
 
- Static Public Member Functions inherited from trikControl::DeviceInterface
static Status combine (const DeviceInterface &underlying, const DeviceInterface::Status &dependent)
 Helper method to return status of a device relying on other device to work. More...
 
- Protected Member Functions inherited from trikControl::AbstractVirtualSensorWorker
void init ()
 Launch sensor. More...
 
void sendCommand (const QString &command)
 If sensor is ready, sends a command to its input FIFO, otherwise queues this command and sends it later. More...
 

Detailed Description

Worker object that processes sound sensor output and updates stored reading.

Meant to be executed in separate thread.

Constructor & Destructor Documentation

SoundSensorWorker::SoundSensorWorker ( const QString &  script,
const QString &  inputFile,
const QString &  outputFile,
DeviceState state,
trikHal::HardwareAbstractionInterface hardwareAbstraction 
)

Constructor.

Parameters
script- file name of a scrit used to start or stop a sensor.
inputFile- sensor input fifo. Note that we will write data here, not read it.
outputFile- sensor output fifo. Note that we will read sensor data from here.
SoundSensorWorker::~SoundSensorWorker ( )
override

Member Function Documentation

void SoundSensorWorker::detect ( )
slot

Not use.

Todo:
???
void SoundSensorWorker::init ( bool  showOnDisplay)
slot

Initializes an ALSA.

Parameters
showOnDisplay- true if we want an image from a DSP to be drawn on robot display.
QVector< int > SoundSensorWorker::read ( )
slot

Returns angle and volume for both channels. Can be accessed directly from other thread.

void SoundSensorWorker::volume ( int  volCoeff)
slot

Sets volume coefficient.


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