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

QwavLibSndfileWaveData Class Reference

Implements sound access via the libsndfile library. More...

#include <qwavlibsndfilewavedata.h>

Inheritance diagram for QwavLibSndfileWaveData:

Inheritance graph
[legend]
Collaboration diagram for QwavLibSndfileWaveData:

Collaboration graph
[legend]
List of all members.

Public Methods

 QwavLibSndfileWaveData ()
 QwavLibSndfileWaveData (const string &filename) throw (FileOpenError, FileReadError)
virtual ~QwavLibSndfileWaveData ()
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

 QwavLibSndfileWaveData (const QwavLibSndfileWaveData &)
const QwavLibSndfileWaveData & operator= (const QwavLibSndfileWaveData &)

Detailed Description

Implements sound access via the libsndfile library.

Author:
Peter Eschler


Constructor & Destructor Documentation

Qwav_BEGIN_NAMESPACE QwavLibSndfileWaveData::QwavLibSndfileWaveData  
 

Standard constructor. Creates an empty and uninitialized QwavLibSndfileWaveData object.

Call readFile() to open and read a waveform.

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

Constructor. Creates an empty and uninitialized QwavLibSndfileWaveData object.

Call readFile() to open and read a waveform.

QwavLibSndfileWaveData::~QwavLibSndfileWaveData   [virtual]
 

Destructor.

QwavLibSndfileWaveData::QwavLibSndfileWaveData const QwavLibSndfileWaveData &    [protected]
 

Copy constructor. Made protected and unimplemented.


Member Function Documentation

QwavPeakInfo QwavLibSndfileWaveData::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 QwavLibSndfileWaveData::isOpen   const [inline, virtual]
 

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

Implements QwavWaveDataInterface.

uint QwavLibSndfileWaveData::nrOfChannels void    const [inline, virtual]
 

Returns the number of channels of the waveform.

Returns:
the number of channels

Implements QwavWaveDataInterface.

long QwavLibSndfileWaveData::nrOfSamples void    const [inline, virtual]
 

Returns the number of samples of the waveform.

Returns:
the number of samples

Implements QwavWaveDataInterface.

const QwavLibSndfileWaveData& QwavLibSndfileWaveData::operator= const QwavLibSndfileWaveData &    [protected]
 

Assignment operator. Made protected and unimplemented.

const Float & QwavLibSndfileWaveData::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 QwavLibSndfileWaveData::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 QwavLibSndfileWaveData::sampleRate void    const [inline, virtual]
 

Returns the sample rate of the waveform.

Returns:
the sample rate

Implements QwavWaveDataInterface.

bool QwavLibSndfileWaveData::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:55 2003 for Qwav by doxygen1.2.16