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

VorbisLibEncoder Class Reference

#include <VorbisLibEncoder.h>

Inheritance diagram for VorbisLibEncoder:

Inheritance graph
[legend]
Collaboration diagram for VorbisLibEncoder:

Collaboration graph
[legend]
List of all members.

Detailed Description

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

Author:
Author
darkeye
Version:
Revision
1.9

Definition at line 73 of file VorbisLibEncoder.h.

Public Member Functions

 VorbisLibEncoder (CastSink *sink, unsigned int inSampleRate, unsigned int inBitsPerSample, unsigned int inChannel, bool inBigEndian, BitrateMode outBitrateMode, unsigned int outBitrate, double outQuality, unsigned int outSampleRate=0, unsigned int outChannel=0, unsigned int outMaxBitrate=0) throw ( Exception )
 Constructor.
 VorbisLibEncoder (CastSink *sink, const AudioSource *as, BitrateMode outBitrateMode, unsigned int outBitrate, double outQuality, unsigned int outSampleRate=0, unsigned int outChannel=0, unsigned int outMaxBitrate=0) throw ( Exception )
 Constructor.
 VorbisLibEncoder (const VorbisLibEncoder &encoder) throw ( Exception )
 Copy constructor.
virtual ~VorbisLibEncoder (void) throw ( Exception )
 Destructor.
virtual VorbisLibEncoderoperator= (const VorbisLibEncoder &encoder) throw ( Exception )
 Assignment operator.
unsigned int getOutMaxBitrate (void) const throw ()
 Get the maximum bit rate of the output in kbits/sec, for fixed / average bitrate encodings.
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

 VorbisLibEncoder (void) throw ( Exception )
 Default constructor.


Constructor & Destructor Documentation

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

Default constructor.

Always throws an Exception.

Exceptions:
Exception 

Definition at line 166 of file VorbisLibEncoder.h.

VorbisLibEncoder::VorbisLibEncoder CastSink sink,
unsigned int  inSampleRate,
unsigned int  inBitsPerSample,
unsigned int  inChannel,
bool  inBigEndian,
BitrateMode  outBitrateMode,
unsigned int  outBitrate,
double  outQuality,
unsigned int  outSampleRate = 0,
unsigned int  outChannel = 0,
unsigned int  outMaxBitrate = 0
throw ( Exception ) [inline]
 

Constructor.

Parameters:
sink the sink to send encoded 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).
outQuality the quality of the stream.
outSampleRate sample rate of the output. If 0, inSampleRate is used.
outMaxBitrate maximum output bitrate. 0 if not used.
outChannel number of channels of the output. If 0, inChannel is used.
Exceptions:
Exception 

Definition at line 194 of file VorbisLibEncoder.h.

VorbisLibEncoder::VorbisLibEncoder CastSink sink,
const AudioSource as,
BitrateMode  outBitrateMode,
unsigned int  outBitrate,
double  outQuality,
unsigned int  outSampleRate = 0,
unsigned int  outChannel = 0,
unsigned int  outMaxBitrate = 0
throw ( Exception ) [inline]
 

Constructor.

Parameters:
sink the sink to send encoded 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).
outQuality the quality of the stream.
outSampleRate sample rate of the output. If 0, input sample rate is used.
outMaxBitrate maximum output bitrate. 0 if not used.
outChannel number of channels of the output. If 0, input channel is used.
Exceptions:
Exception 

Definition at line 238 of file VorbisLibEncoder.h.

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

Copy constructor.

Parameters:
encoder the VorbisLibEncoder to copy.

Definition at line 264 of file VorbisLibEncoder.h.

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

Destructor.

Exceptions:
Exception 

Definition at line 280 of file VorbisLibEncoder.h.

References close(), and isOpen().


Member Function Documentation

virtual bool VorbisLibEncoder::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 388 of file VorbisLibEncoder.h.

References isOpen().

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

Close the encoding session.

Exceptions:
Exception 

Implements Sink.

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

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

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

Exceptions:
Exception 

Implements Sink.

unsigned int VorbisLibEncoder::getOutMaxBitrate void   )  const throw () [inline]
 

Get the maximum bit rate of the output in kbits/sec, for fixed / average bitrate encodings.

Returns:
the maximum bit rate of the output, or 0 if not set.

Definition at line 318 of file VorbisLibEncoder.h.

virtual bool VorbisLibEncoder::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 373 of file VorbisLibEncoder.h.

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

virtual bool VorbisLibEncoder::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 329 of file VorbisLibEncoder.h.

References isOpen().

virtual bool VorbisLibEncoder::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 VorbisLibEncoder& VorbisLibEncoder::operator= const VorbisLibEncoder encoder  )  throw ( Exception ) [inline, virtual]
 

Assignment operator.

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

Definition at line 296 of file VorbisLibEncoder.h.

References AudioEncoder::operator=().

virtual bool VorbisLibEncoder::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 342 of file VorbisLibEncoder.h.

References open().

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

Stop encoding.

Stops the encoding running in the background.

Exceptions:
Exception 

Implements AudioEncoder.

Definition at line 353 of file VorbisLibEncoder.h.

References close().

virtual unsigned int VorbisLibEncoder::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 Sat Oct 22 13:17:07 2005 for DarkIce by  doxygen 1.4.4