dsp_jack Class Reference

#include <dsp-jack.h>

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

List of all members.

Public Member Functions

 dsp_jack (const PlayerConfig &config)
void start (audio_source *s)
void stop ()
void internal_pause ()
void internal_unpause ()
void write (stereo_sample2 value)
signed8 latency ()
int open (bool ui)
void close (bool flush_first)
virtual ~dsp_jack ()
int audio_process (jack_nframes_t nframes)
int set_buffer_size (jack_nframes_t nframes)
void process_buffers ()
jack_client_t * get_client ()
jack_port_t * get_output_port_1 ()
jack_port_t * get_output_port_2 ()

Constructor & Destructor Documentation

dsp_jack::dsp_jack ( const PlayerConfig config  ) 

References Debug().

dsp_jack::~dsp_jack (  )  [virtual]

References Debug().


Member Function Documentation

int dsp_jack::audio_process ( jack_nframes_t  nframes  ) 

This is the function that will be called back from within the jack audio thread. In this function we should provide the next chunk of data. Depending on whether the driver is in synchronous or asynchronous mode do we either call get_next_buffer or generate_next_buffer

References dsp_driver::stopped.

Referenced by chunk_getter().

void dsp_jack::close ( bool  flush_first  )  [virtual]

Implements dsp_driver.

References Debug().

Referenced by stop().

jack_client_t* dsp_jack::get_client (  )  [inline]
jack_port_t* dsp_jack::get_output_port_1 (  )  [inline]
jack_port_t* dsp_jack::get_output_port_2 (  )  [inline]
void dsp_jack::internal_pause (  )  [inline, 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.

void dsp_jack::internal_unpause (  )  [inline, virtual]

Implements dsp_driver.

signed8 dsp_jack::latency (  )  [virtual]

This method must return the latency between the sample position that currently comes out of the speakers and the next sample that will be read from the audio source.

Implements dsp_driver.

int dsp_jack::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.

Implements dsp_driver.

References bpmdj_allocate, chunk_getter(), Debug(), err_dsp, err_none, Error(), Info(), pbuffers(), dsp_driver::playrate, set_buffer_size(), and sprintf().

void dsp_jack::process_buffers (  ) 
int dsp_jack::set_buffer_size ( jack_nframes_t  nframes  ) 

Referenced by buffer_size_callback(), and open().

void dsp_jack::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_driver::audio, Debug(), dsp_driver::paused, dsp_driver::stop_request, and dsp_driver::stopped.

void dsp_jack::stop (  )  [virtual]

The stop method is called from an external thread. It should signal the driver that any playing thread should stop and the dsp device closed once done. When all this is finished, the method should return. This should be a synchronous call.

Reimplemented from dsp_driver.

References close(), Debug(), dsp_driver::stop_request, and dsp_driver::stopped.

void dsp_jack::write ( stereo_sample2  value  )  [inline, 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.


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