Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

JackDspSource Class Reference

#include <JackDspSource.h>

Inheritance diagram for JackDspSource:

Inheritance graph
[legend]
Collaboration diagram for JackDspSource:

Collaboration graph
[legend]
List of all members.

Detailed Description

An audio input based on JACK.

Author:
Author
darkeye
Version:
Revision
1.2

Definition at line 65 of file JackDspSource.h.

Public Member Functions

 JackDspSource (const char *name, int sampleRate=44100, int bitsPerSample=16, int channels=2) throw ( Exception )
 Constructor.
 JackDspSource (const JackDspSource &jds) throw ( Exception )
 Copy Constructor.
virtual ~JackDspSource (void) throw ( Exception )
 Destructor.
virtual JackDspSourceoperator= (const JackDspSource &ds) throw ( Exception )
 Assignment operator.
virtual bool open (void) throw ( Exception )
 Open the JackDspSource.
virtual bool isOpen (void) const throw ()
 Check if the JackDspSource is registered.
virtual bool canRead (unsigned int sec, unsigned int usec) throw ( Exception )
 Check if the JackDspSource can be read from.
virtual unsigned int read (void *buf, unsigned int len) throw ( Exception )
 Read from the JackDspSource.
virtual void close (void) throw ( Exception )
 Close the JackDspSource.

Protected Member Functions

 JackDspSource (void) throw ( Exception )
 Default constructor.
void init (const char *name) throw ( Exception )
 Initialize the object.
void strip (void) throw ( Exception )
 De-initialize the object.
void do_auto_connect () throw ( Exception )
 Attempt to connect up the JACK ports automatically.

Static Protected Member Functions

static int process_callback (jack_nframes_t nframes, void *arg)
 Callback called by JACK when audio is available.
static void shutdown_callback (void *arg)
 Callback called by JACK when jackd is shutting down.


Constructor & Destructor Documentation

JackDspSource::JackDspSource void   )  throw ( Exception ) [inline, protected]
 

Default constructor.

Always throws an Exception.

Exceptions:
Exception 

Definition at line 102 of file JackDspSource.h.

JackDspSource::JackDspSource const char *  name,
int  sampleRate = 44100,
int  bitsPerSample = 16,
int  channels = 2
throw ( Exception ) [inline]
 

Constructor.

Parameters:
name the name of the jack device
sampleRate samples per second (e.g. 44100 for 44.1kHz).
bitsPerSample bits per sample (e.g. 16 bits).
channels number of channels of the audio source (e.g. 1 for mono, 2 for stereo, etc.).
Exceptions:
Exception 

Definition at line 156 of file JackDspSource.h.

References init().

JackDspSource::JackDspSource const JackDspSource jds  )  throw ( Exception ) [inline]
 

Copy Constructor.

Parameters:
jds the object to copy.
Exceptions:
Exception 

Definition at line 174 of file JackDspSource.h.

virtual JackDspSource::~JackDspSource void   )  throw ( Exception ) [inline, virtual]
 

Destructor.

Exceptions:
Exception 

Definition at line 186 of file JackDspSource.h.

References strip().


Member Function Documentation

virtual bool JackDspSource::canRead unsigned int  sec,
unsigned int  usec
throw ( Exception ) [virtual]
 

Check if the JackDspSource can be read from.

Blocks until the specified time for data to be available. Puts the Jack DSP device into recording mode.

Parameters:
sec the maximum seconds to block.
usec micro seconds to block after the full seconds.
Returns:
true if the JackDspSource is ready to be read from, false otherwise.
Exceptions:
Exception 

Implements Source.

virtual void JackDspSource::close void   )  throw ( Exception ) [virtual]
 

Close the JackDspSource.

Exceptions:
Exception 

Implements Source.

void JackDspSource::do_auto_connect  )  throw ( Exception ) [protected]
 

Attempt to connect up the JACK ports automatically.

void JackDspSource::init const char *  name  )  throw ( Exception ) [protected]
 

Initialize the object.

Exceptions:
Exception 

Referenced by JackDspSource().

virtual bool JackDspSource::isOpen void   )  const throw () [inline, virtual]
 

Check if the JackDspSource is registered.

Returns:
true if Jack client is setup

Implements Source.

Definition at line 224 of file JackDspSource.h.

virtual bool JackDspSource::open void   )  throw ( Exception ) [virtual]
 

Open the JackDspSource.

This does not put the Jack DSP device into recording mode. To start getting samples, call either canRead() or read().

Returns:
true if opening was successful, false otherwise
Exceptions:
Exception 
See also:
canRead

read

Implements Source.

virtual JackDspSource& JackDspSource::operator= const JackDspSource ds  )  throw ( Exception ) [inline, virtual]
 

Assignment operator.

Parameters:
ds the object to assign to this one.
Returns:
a reference to this object.
Exceptions:
Exception 

Definition at line 199 of file JackDspSource.h.

static int JackDspSource::process_callback jack_nframes_t  nframes,
void *  arg
[static, protected]
 

Callback called by JACK when audio is available.

virtual unsigned int JackDspSource::read void *  buf,
unsigned int  len
throw ( Exception ) [virtual]
 

Read from the JackDspSource.

Puts the Jack DSP device into recording mode.

Parameters:
buf the buffer to read into.
len the number of bytes to read into buf
Returns:
the number of bytes read (may be less than len).
Exceptions:
Exception 

Implements Source.

static void JackDspSource::shutdown_callback void *  arg  )  [static, protected]
 

Callback called by JACK when jackd is shutting down.

void JackDspSource::strip void   )  throw ( Exception ) [protected]
 

De-initialize the object.

Exceptions:
Exception 

Reimplemented from AudioSource.

Referenced by ~JackDspSource().


The documentation for this class was generated from the following file:
Generated on Thu Apr 14 13:59:13 2005 for DarkIce by  doxygen 1.4.1