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

TwoLameLibEncoder Class Reference

#include <TwoLameLibEncoder.h>

Inheritance diagram for TwoLameLibEncoder:

Inheritance graph
[legend]
Collaboration diagram for TwoLameLibEncoder:

Collaboration graph
[legend]
List of all members.

Detailed Description

A class representing the TwoLame encoder linked as a shared object or as a static library.

Author:
Author
darkeye
Version:
Revision
1.1

Definition at line 72 of file TwoLameLibEncoder.h.

Public Member Functions

 TwoLameLibEncoder (Sink *sink, unsigned int inSampleRate, unsigned int inBitsPerSample, unsigned int inChannel, bool inBigEndian, BitrateMode outBitrateMode, unsigned int outBitrate, unsigned int outSampleRate=0, unsigned int outChannel=0) throw ( Exception )
 Constructor.
 TwoLameLibEncoder (Sink *sink, const AudioSource *as, BitrateMode outBitrateMode, unsigned int outBitrate, unsigned int outSampleRate=0, unsigned int outChannel=0) throw ( Exception )
 Constructor.
 TwoLameLibEncoder (const TwoLameLibEncoder &encoder) throw ( Exception )
 Copy constructor.
virtual ~TwoLameLibEncoder (void) throw ( Exception )
 Destructor.
virtual TwoLameLibEncoderoperator= (const TwoLameLibEncoder &encoder) throw ( Exception )
 Assignment operator.
const char * getLameVersion (void)
 Get the version string of the underlying lame library.
virtual bool isRunning (void) const throw ()
 Check wether encoding is in progress.
virtual bool start (void) throw ( Exception )
 Start encoding.
virtual void stop (void) throw ( Exception )
 Stop encoding.
virtual bool open (void) throw ( Exception )
 Open an encoding session.
virtual bool isOpen (void) const throw ()
 Check if the encoding session is open.
virtual bool canWrite (unsigned int sec, unsigned int usec) throw ( Exception )
 Check if the encoder is ready to accept data.
virtual unsigned int write (const void *buf, unsigned int len) throw ( Exception )
 Write data to the encoder.
virtual void flush (void) throw ( Exception )
 Flush all data that was written to the encoder to the underlying connection.
virtual void close (void) throw ( Exception )
 Close the encoding session.

Protected Member Functions

 TwoLameLibEncoder (void) throw ( Exception )
 Default constructor.


Constructor & Destructor Documentation

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

Default constructor.

Always throws an Exception.

Exceptions:
Exception 

Definition at line 114 of file TwoLameLibEncoder.h.

TwoLameLibEncoder::TwoLameLibEncoder Sink sink,
unsigned int  inSampleRate,
unsigned int  inBitsPerSample,
unsigned int  inChannel,
bool  inBigEndian,
BitrateMode  outBitrateMode,
unsigned int  outBitrate,
unsigned int  outSampleRate = 0,
unsigned int  outChannel = 0
throw ( Exception ) [inline]
 

Constructor.

Parameters:
sink the sink to send mp2 output to
inSampleRate sample rate of the input.
inBitsPerSample number of bits per sample of the input.
inChannel number of channels of the input.
inBigEndian shows if the input is big or little endian
outBitrateMode the bit rate mode of the output.
outBitrate bit rate of the output (kbits/sec).
outSampleRate sample rate of the output. If 0, inSampleRate is used.
outChannel number of channels of the output. If 0, inChannel is used.
Exceptions:
Exception 

Definition at line 139 of file TwoLameLibEncoder.h.

TwoLameLibEncoder::TwoLameLibEncoder Sink sink,
const AudioSource as,
BitrateMode  outBitrateMode,
unsigned int  outBitrate,
unsigned int  outSampleRate = 0,
unsigned int  outChannel = 0
throw ( Exception ) [inline]
 

Constructor.

Parameters:
sink the sink to send mp2 output to
as get input sample rate, bits per sample and channels from this AudioSource.
outBitrateMode the bit rate mode of the output.
outBitrate bit rate of the output (kbits/sec).
outSampleRate sample rate of the output. If 0, input sample rate is used.
outChannel number of channels of the output. If 0, input channel is used.
Exceptions:
Exception 

Definition at line 178 of file TwoLameLibEncoder.h.

TwoLameLibEncoder::TwoLameLibEncoder const TwoLameLibEncoder encoder  )  throw ( Exception ) [inline]
 

Copy constructor.

Parameters:
encoder the TwoLameLibEncoder to copy.

Definition at line 202 of file TwoLameLibEncoder.h.

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

Destructor.

Exceptions:
Exception 

Definition at line 216 of file TwoLameLibEncoder.h.

References close(), and isOpen().


Member Function Documentation

virtual bool TwoLameLibEncoder::canWrite unsigned int  sec,
unsigned int  usec
throw ( Exception ) [inline, virtual]
 

Check if the encoder is ready to accept data.

Parameters:
sec the maximum seconds to block.
usec micro seconds to block after the full seconds.
Returns:
true if the encoder is ready to accept data, false otherwise.
Exceptions:
Exception 

Implements Sink.

Definition at line 319 of file TwoLameLibEncoder.h.

References isOpen().

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

Close the encoding session.

Exceptions:
Exception 

Implements Sink.

Referenced by stop(), and ~TwoLameLibEncoder().

virtual void TwoLameLibEncoder::flush void   )  throw ( Exception ) [virtual]
 

Flush all data that was written to the encoder to the underlying connection.

Exceptions:
Exception 

Implements Sink.

const char* TwoLameLibEncoder::getLameVersion void   )  [inline]
 

Get the version string of the underlying lame library.

Returns:
the version string of the underlying lame library.

Definition at line 249 of file TwoLameLibEncoder.h.

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

Check if the encoding session is open.

Returns:
true if the encoding session is open, false otherwise.

Implements Sink.

Definition at line 304 of file TwoLameLibEncoder.h.

Referenced by canWrite(), isRunning(), and ~TwoLameLibEncoder().

virtual bool TwoLameLibEncoder::isRunning void   )  const throw () [inline, virtual]
 

Check wether encoding is in progress.

Returns:
true if encoding is in progress, false otherwise.

Implements AudioEncoder.

Definition at line 260 of file TwoLameLibEncoder.h.

References isOpen().

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

Open an encoding session.

Returns:
true if opening was successfull, false otherwise.
Exceptions:
Exception 

Implements Sink.

Referenced by start().

virtual TwoLameLibEncoder& TwoLameLibEncoder::operator= const TwoLameLibEncoder encoder  )  throw ( Exception ) [inline, virtual]
 

Assignment operator.

Parameters:
encoder the TwoLameLibEncoder to assign this to.
Returns:
a reference to this TwoLameLibEncoder.
Exceptions:
Exception 

Definition at line 232 of file TwoLameLibEncoder.h.

References AudioEncoder::operator=().

virtual bool TwoLameLibEncoder::start void   )  throw ( Exception ) [inline, virtual]
 

Start encoding.

This function returns as soon as possible, with encoding started in the background.

Returns:
true if encoding has started, false otherwise.
Exceptions:
Exception 

Implements AudioEncoder.

Definition at line 273 of file TwoLameLibEncoder.h.

References open().

virtual void TwoLameLibEncoder::stop void   )  throw ( Exception ) [inline, virtual]
 

Stop encoding.

Stops the encoding running in the background.

Exceptions:
Exception 

Implements AudioEncoder.

Definition at line 284 of file TwoLameLibEncoder.h.

References close().

virtual unsigned int TwoLameLibEncoder::write const void *  buf,
unsigned int  len
throw ( Exception ) [virtual]
 

Write data to the encoder.

Buf is expected to be a sequence of big-endian 16 bit values, with left and right channels interleaved. Len is the number of bytes, must be a multiple of 4.

Parameters:
buf the data to write.
len number of bytes to write from buf.
Returns:
the number of bytes written (may be less than len).
Exceptions:
Exception 

Implements Sink.


The documentation for this class was generated from the following file:
Generated on Fri May 19 15:36:49 2006 for DarkIce by  doxygen 1.4.4