Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
roc::sndio::Pump Class Reference

Audio pump. More...

#include <pump.h>

Inheritance diagram for roc::sndio::Pump:
Collaboration diagram for roc::sndio::Pump:

Public Types

enum  Mode { ModePermanent = 0, ModeOneshot = 1 }
 Pump mode. More...
 

Public Member Functions

 Pump (core::BufferPool< audio::sample_t > &buffer_pool, ISource &source, ISink &sink, size_t frame_size, Mode mode)
 Initialize. More...
 
bool valid () const
 Check if the object was successfulyl constructed. More...
 
bool run ()
 Run the pump. More...
 
void stop ()
 Stop the pump. More...
 

Detailed Description

Audio pump.

Remarks
Reads frames from source and writes them to sink.

Definition at line 29 of file pump.h.

Member Enumeration Documentation

Pump mode.

Definition at line 32 of file pump.h.

Constructor & Destructor Documentation

roc::sndio::Pump::Pump ( core::BufferPool< audio::sample_t > &  buffer_pool,
ISource source,
ISink sink,
size_t  frame_size,
Mode  mode 
)

Initialize.

Member Function Documentation

bool roc::sndio::Pump::run ( )

Run the pump.

Remarks
Run until the stop() is called or, if oneshot mode is enabled, the source becomes inactive.
void roc::sndio::Pump::stop ( )

Stop the pump.

Remarks
May be called from any thread.
bool roc::sndio::Pump::valid ( ) const

Check if the object was successfulyl constructed.


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