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

OssDspSource Class Reference

#include <OssDspSource.h>

Inheritance diagram for OssDspSource:

Inheritance graph
[legend]
Collaboration diagram for OssDspSource:

Collaboration graph
[legend]
List of all members.

Detailed Description

An audio input based on /dev/dsp-like raw devices.

Author:
Author
darkeye
Version:
Revision
1.7

Definition at line 57 of file OssDspSource.h.

Public Member Functions

 OssDspSource (const char *name, int sampleRate=44100, int bitsPerSample=16, int channel=2) throw ( Exception )
 Constructor.
 OssDspSource (const OssDspSource &ods) throw ( Exception )
 Copy Constructor.
virtual ~OssDspSource (void) throw ( Exception )
 Destructor.
virtual OssDspSourceoperator= (const OssDspSource &ds) throw ( Exception )
 Assignment operator.
virtual bool isBigEndian (void) const throw ()
 Tell if the data from this source comes in big or little endian.
virtual bool open (void) throw ( Exception )
 Open the OssDspSource.
virtual bool isOpen (void) const throw ()
 Check if the OssDspSource is open.
virtual bool canRead (unsigned int sec, unsigned int usec) throw ( Exception )
 Check if the OssDspSource can be read from.
virtual unsigned int read (void *buf, unsigned int len) throw ( Exception )
 Read from the OssDspSource.
virtual void close (void) throw ( Exception )
 Close the OssDspSource.

Protected Member Functions

 OssDspSource (void) throw ( Exception )
 Default constructor.
void init (const char *name) throw ( Exception )
 Initialize the object.
void strip (void) throw ( Exception )
 De-iitialize the object.


Constructor & Destructor Documentation

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

Default constructor.

Always throws an Exception.

Exceptions:
Exception 

Definition at line 86 of file OssDspSource.h.

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

Constructor.

Parameters:
name the file name of the OSS DSP device (e.g. /dev/dsp or /dev/dsp0).
sampleRate samples per second (e.g. 44100 for 44.1kHz).
bitsPerSample bits per sample (e.g. 16 bits).
channel number of channels of the audio source (e.g. 1 for mono, 2 for stereo, etc.).
Exceptions:
Exception 

Definition at line 123 of file OssDspSource.h.

References init().

OssDspSource::OssDspSource const OssDspSource ods  )  throw ( Exception ) [inline]
 

Copy Constructor.

Parameters:
ods the object to copy.
Exceptions:
Exception 

Definition at line 141 of file OssDspSource.h.

References init().

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

Destructor.

Exceptions:
Exception 

Definition at line 153 of file OssDspSource.h.

References strip().


Member Function Documentation

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

Check if the OssDspSource can be read from.

Blocks until the specified time for data to be available. Puts the OSS 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 OssDspSource is ready to be read from, false otherwise.
Exceptions:
Exception 

Implements Source.

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

Close the OssDspSource.

Exceptions:
Exception 

Implements Source.

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

Initialize the object.

Parameters:
name the file name of the OSS DSP device.
Exceptions:
Exception 

Referenced by operator=(), and OssDspSource().

virtual bool OssDspSource::isBigEndian void   )  const throw () [virtual]
 

Tell if the data from this source comes in big or little endian.

Returns:
true if the source is big endian, false otherwise

Reimplemented from AudioSource.

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

Check if the OssDspSource is open.

Returns:
true if the OssDspSource is open, false otherwise.

Implements Source.

Definition at line 204 of file OssDspSource.h.

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

Open the OssDspSource.

This does not put the OSS 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 OssDspSource& OssDspSource::operator= const OssDspSource 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 166 of file OssDspSource.h.

References init(), AudioSource::operator=(), and strip().

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

Read from the OssDspSource.

Puts the OSS 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.

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

De-iitialize the object.

Exceptions:
Exception 

Reimplemented from AudioSource.

Referenced by operator=(), and ~OssDspSource().


The documentation for this class was generated from the following file:
Generated on Sat Oct 22 13:17:07 2005 for DarkIce by  doxygen 1.4.4