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

SolarisDspSource Class Reference

#include <SolarisDspSource.h>

Inheritance diagram for SolarisDspSource:

Inheritance graph
[legend]
Collaboration diagram for SolarisDspSource:

Collaboration graph
[legend]
List of all members.

Detailed Description

An audio input based on Solaris /dev/audio devices.

Author:
Author
darkeye
Version:
Revision
1.5

Definition at line 57 of file SolarisDspSource.h.

Public Member Functions

 SolarisDspSource (const char *name, int sampleRate=44100, int bitsPerSample=16, int channel=2) throw ( Exception )
 Constructor.
 SolarisDspSource (const SolarisDspSource &sds) throw ( Exception )
 Copy Constructor.
virtual ~SolarisDspSource (void) throw ( Exception )
 Destructor.
virtual SolarisDspSourceoperator= (const SolarisDspSource &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 SolarisDspSource.
virtual bool isOpen (void) const throw ()
 Check if the SolarisDspSource is open.
virtual bool canRead (unsigned int sec, unsigned int usec) throw ( Exception )
 Check if the SolarisDspSource can be read from.
virtual unsigned int read (void *buf, unsigned int len) throw ( Exception )
 Read from the SolarisDspSource.
virtual void close (void) throw ( Exception )
 Close the SolarisDspSource.

Protected Member Functions

 SolarisDspSource (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

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

Default constructor.

Always throws an Exception.

Exceptions:
Exception 

Definition at line 80 of file SolarisDspSource.h.

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

Constructor.

Parameters:
name the file name of the Solaris DSP device (e.g. /dev/audio or /dev/sound/0)
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 117 of file SolarisDspSource.h.

References init().

SolarisDspSource::SolarisDspSource const SolarisDspSource sds  )  throw ( Exception ) [inline]
 

Copy Constructor.

Parameters:
sds the object to copy.
Exceptions:
Exception 

Definition at line 135 of file SolarisDspSource.h.

References init().

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

Destructor.

Exceptions:
Exception 

Definition at line 148 of file SolarisDspSource.h.

References strip().


Member Function Documentation

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

Check if the SolarisDspSource can be read from.

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

Implements Source.

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

Close the SolarisDspSource.

Exceptions:
Exception 

Implements Source.

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

Initialize the object.

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

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

virtual bool SolarisDspSource::isBigEndian void   )  const throw () [inline, virtual]
 

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

Returns:
true

Reimplemented from AudioSource.

Definition at line 177 of file SolarisDspSource.h.

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

Check if the SolarisDspSource is open.

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

Implements Source.

Definition at line 206 of file SolarisDspSource.h.

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

Open the SolarisDspSource.

This does not put the Solaris 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 SolarisDspSource& SolarisDspSource::operator= const SolarisDspSource 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 161 of file SolarisDspSource.h.

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

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

Read from the SolarisDspSource.

Puts the Solaris 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 SolarisDspSource::strip void   )  throw ( Exception ) [protected]
 

De-iitialize the object.

Exceptions:
Exception 

Reimplemented from AudioSource.

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


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