#include <qwavwavedatainterface.h>
Inheritance diagram for QwavWaveDataInterface:
Public Methods | |
virtual float | sampleRate (void) const=0 |
virtual long | nrOfSamples (void) const=0 |
virtual uint | nrOfChannels (void) const=0 |
virtual bool | readFile (const string &filename)=0 throw (FileOpenError,FileReadError) |
virtual bool | writeFile (const string &filename)=0 throw (FileOpenError,FileReadError) |
virtual QwavPeakInfo | getPeak (QwavPeakInterpolator *s, int pixel, int nPixels, Float zoomFac=1.0, uint channel=1) const=0 |
virtual const Float & | operator[] (uint index) const=0 |
virtual bool | isOpen () const=0 |
The WaveDataInterface is an abstract interface class and can be derived to implement sound data/information access via different sound libraries (e.g. libaudiofile, libsndfile, ..). All methods in this class are pure virtual and have to be implemented in subclasses.
Information about the sound data can be obtained by
isOpen() informs about sound data is already being read by readFile(). To write the sound data into a file use writeFile().The sound data can be directly accesed using operator[]().
The QwavPeakInfo for a particular pixel can be obtained using getPeak().
|
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.
Implemented in QwavLibSndfileWaveData, and QwavVorbisWaveData. |
|
Returns true when the waveform is open, otherwise false.
Implemented in QwavLibSndfileWaveData, and QwavVorbisWaveData. |
|
Returns the number of channels of the waveform.
Implemented in QwavLibSndfileWaveData, and QwavVorbisWaveData. |
|
Returns the number of samples of the waveform.
Implemented in QwavLibSndfileWaveData, and QwavVorbisWaveData. |
|
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].
Implemented in QwavLibSndfileWaveData, and QwavVorbisWaveData. |
|
Opens the soundfile filename.
Implemented in QwavLibSndfileWaveData, and QwavVorbisWaveData. |
|
Returns the sample rate of the waveform.
Implemented in QwavLibSndfileWaveData, and QwavVorbisWaveData. |
|
Writes the sound data to the the file filename.
Implemented in QwavLibSndfileWaveData, and QwavVorbisWaveData. |