Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
roc::sndio::ISource Class Referenceabstract

Source interface. More...

#include <isource.h>

Inheritance diagram for roc::sndio::ISource:

Public Types

enum  State { Active, Inactive }
 Source state. More...
 

Public Member Functions

virtual size_t sample_rate () const =0
 Get source sample rate. More...
 
virtual bool has_clock () const =0
 Check if the source has own clock. More...
 
virtual State state () const =0
 Get current source state. More...
 
virtual void wait_active () const =0
 Wait until the source state becomes active. More...
 
virtual bool read (audio::Frame &)=0
 Read frame. More...
 

Detailed Description

Source interface.

Definition at line 21 of file isource.h.

Member Enumeration Documentation

Source state.

Enumerator
Active 

Source is active and is producing some sound.

Inactive 

Source is inactive and is producing silence.

Definition at line 32 of file isource.h.

Member Function Documentation

virtual bool roc::sndio::ISource::has_clock ( ) const
pure virtual

Check if the source has own clock.

Implemented in roc::pipeline::Receiver, and roc::sndio::SoxSource.

virtual bool roc::sndio::ISource::read ( audio::Frame )
pure virtual

Read frame.

Returns
false if there is nothing to read anymore.

Implemented in roc::pipeline::Receiver, and roc::sndio::SoxSource.

virtual size_t roc::sndio::ISource::sample_rate ( ) const
pure virtual

Get source sample rate.

Implemented in roc::pipeline::Receiver, and roc::sndio::SoxSource.

virtual State roc::sndio::ISource::state ( ) const
pure virtual

Get current source state.

Implemented in roc::pipeline::Receiver, and roc::sndio::SoxSource.

virtual void roc::sndio::ISource::wait_active ( ) const
pure virtual

Wait until the source state becomes active.

Remarks
Spurious wakeups are allowed.

Implemented in roc::pipeline::Receiver, and roc::sndio::SoxSource.


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