Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

QwavVorbisWaveData Class Reference

Implements sound access via the vorbis library to read ogg data. More...

#include <qwavvorbiswavedata.h>

Inheritance diagram for QwavVorbisWaveData:

Inheritance graph
[legend]
Collaboration diagram for QwavVorbisWaveData:

Collaboration graph
[legend]
List of all members.

Public Methods

 QwavVorbisWaveData ()
 QwavVorbisWaveData (const string &filename) throw (FileOpenError, FileReadError)
virtual ~QwavVorbisWaveData ()
float sampleRate (void) const
long nrOfSamples (void) const
uint nrOfChannels (void) const
const Float & operator[] (uint index) const
bool readFile (const string &filename) throw (FileOpenError, FileReadError)
bool writeFile (const string &filename) throw (FileOpenError,FileReadError)
QwavPeakInfo getPeak (QwavPeakInterpolator *s, int pixel, int nPixels, Float zoomFac=1.0, uint channel=1) const
bool isOpen () const

Protected Methods

 QwavVorbisWaveData (const QwavVorbisWaveData &)
const QwavVorbisWaveData & operator= (const QwavVorbisWaveData &)

Detailed Description

Implements sound access via the vorbis library to read ogg data.

Author:
Peter Eschler


Constructor & Destructor Documentation

Qwav_BEGIN_NAMESPACE QwavVorbisWaveData::QwavVorbisWaveData (    ) 
 

Standard constructor. Creates an empty and uninitialized QwavVorbisWaveData object.

Call readFile() to open and read a waveform.

QwavVorbisWaveData::QwavVorbisWaveData (  const string &    filename )  throw (FileOpenError, FileReadError)
 

Constructor. Creates an empty and uninitialized QwavVorbisWaveData object.

Call readFile() to open and read a waveform.

QwavVorbisWaveData::~QwavVorbisWaveData (    )  [virtual]
 

Destructor.

QwavVorbisWaveData::QwavVorbisWaveData (  const QwavVorbisWaveData &    )  [protected]
 

Copy constructor. Made protected and unimplemented.


Member Function Documentation

QwavPeakInfo QwavVorbisWaveData::getPeak (  QwavPeakInterpolator *    s,
int    pixel,
int    nPixels,
Float    zoomFac = 1.0,
uint    channel = 1
)  const [virtual]
 

Returns the peak for pixel using the QwavPeakInterpolator s according to the current nPixels and the zoomFac. The peak is returned for the given channel.

Returns:
the peak info

Implements QwavWaveDataInterface.

bool QwavVorbisWaveData::isOpen (    )  const [inline, virtual]
 

Returns true if the wave is open, false if not.

Implements QwavWaveDataInterface.

uint QwavVorbisWaveData::nrOfChannels (  void    )  const [inline, virtual]
 

Returns the number of channels of the waveform.

Returns:
the number of channels

Implements QwavWaveDataInterface.

long QwavVorbisWaveData::nrOfSamples (  void    )  const [inline, virtual]
 

Returns the number of samples of the waveform.

Returns:
the number of samples

Implements QwavWaveDataInterface.

const QwavVorbisWaveData& QwavVorbisWaveData::operator= (  const QwavVorbisWaveData &    )  [protected]
 

Assignment operator. Made protected and unimplemented.

const Float & QwavVorbisWaveData::operator[] (  uint    index )  const [inline, virtual]
 

Returns the pcm value at index of this waveform.

The parameter index is not range checked for speed reason.

The format of the returned pcm value depends on the setting in defines.h. The default is float, thus value are in the interval [-1,1].

Todo:
extend this to stereo waveforms
Parameters:
indext  the index of the value to return
Returns:
the pcm value

Implements QwavWaveDataInterface.

bool QwavVorbisWaveData::readFile (  const string &    filename )  throw (FileOpenError, FileReadError) [virtual]
 

Opens the soundfile filename.

Parameters:
filename  the filename of the waveform
Returns:
true if filename opened succesfully, if open failed an exception is thrown
Exceptions:
FileOpenError  is thrown when an error occurred while opening the file
FileReadError  is thrown when an error occurred while reading the file
Todo:
rename this to readFile

add a parameter doPeakUpdate=true

Implements QwavWaveDataInterface.

float QwavVorbisWaveData::sampleRate (  void    )  const [inline, virtual]
 

Returns the sample rate of the waveform.

Returns:
the sample rate

Implements QwavWaveDataInterface.

bool QwavVorbisWaveData::writeFile (  const string &    filename )  throw (FileOpenError,FileReadError) [virtual]
 

Writes the sound data to the the file filename.

Parameters:
filename  the filename
Exceptions:
FileOpenError  is thrown when an error occured during opening the file for writing

Implements QwavWaveDataInterface.


The documentation for this class was generated from the following files:
Generated on Mon Jan 20 00:24:56 2003 for Qwav by doxygen1.2.16