dsp_alsa Class Reference

#include <dsp-alsa.h>

Inheritance diagram for dsp_alsa:
Inheritance graph
[legend]
Collaboration diagram for dsp_alsa:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 dsp_alsa (const PlayerConfig &config)
void start (audio_source *)
void internal_pause ()
void internal_unpause ()
void write (stereo_sample2 value)
signed8 latency ()
int open (bool ui)
void close (bool flush)

Constructor & Destructor Documentation

dsp_alsa::dsp_alsa ( const PlayerConfig config  ) 

References Debug(), and dsp.


Member Function Documentation

void dsp_alsa::close ( bool  flush  )  [virtual]

Implements dsp_driver.

References Debug(), dsp, i, Warning(), write(), and zero.

void dsp_alsa::internal_pause (  )  [virtual]

The internal pause method is the one responsible for altering the dsp configuration. This function should return as well. After pause_internal, and internal_unpause will be called to signal the end of the pause. See pause() for more information.

Implements dsp_driver.

References dsp, and Warning().

void dsp_alsa::internal_unpause (  )  [virtual]

Implements dsp_driver.

References dsp, and Warning().

signed8 dsp_alsa::latency (  )  [virtual]

Because the latency call access the device from a concurrent thread (the other one is the sound pusher thread), it might happen that the return value of the snd_pcm_delay call is crap. In that case we simply try again.

Implements dsp_driver.

References dsp, and Warning().

int dsp_alsa::open ( bool  ui  )  [virtual]

The open function should initialize the specific device such that we can start writing to it and that it will play sound. If the open is not possible this function should return err_dsp. If the function is successful open() should return err_none. If user interface is set to true then error dialogs will be shown when errors appear. If the open fails and returns err_dsp, then expect a close to be followed afterward.

Interleaved reading and writing (in contrast to channel per channel read/write)

Implements dsp_driver.

References bpmdj_allocate, dsp, err_dsp, err_none, Error(), dsp_driver::playrate, dsp_driver::verbose, and Warning().

void dsp_alsa::start ( audio_source from  )  [virtual]

The normal start routine will spawn a process which will rely on a synchronous writing of data to the output. The start routine must return directly after the thread was created and the pause flag is set correctly.

Implements dsp_driver.

References dsp, and Error().

void dsp_alsa::write ( stereo_sample2  value  )  [virtual]

The write function should write out the specified value and block when necessary.It is mainly used by the pusher thread at the moment. If you plan to write a complete asynchronous driver you might not need to implement this function.

Implements dsp_driver.

References assert(), dsp, Error(), stereo_sample2::value(), and Warning().

Referenced by close().


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by  doxygen 1.6.2