audiere::SampleSource Class Reference

#include <audiere.h>

Inheritance diagram for audiere::SampleSource:

audiere::LoopPointSource List of all members.

Public Member Functions

virtual void ADR_CALL getFormat (int &channel_count, int &sample_rate, SampleFormat &sample_format)=0
virtual int ADR_CALL read (int frame_count, void *buffer)=0
virtual void ADR_CALL reset ()=0
virtual bool ADR_CALL isSeekable ()=0
virtual int ADR_CALL getLength ()=0
virtual void ADR_CALL setPosition (int position)=0
virtual int ADR_CALL getPosition ()=0
virtual bool ADR_CALL getRepeat ()=0
virtual void ADR_CALL setRepeat (bool repeat)=0

Detailed Description

Source of raw PCM samples. Sample sources have an intrinsic format (
See also:
SampleFormat), sample rate, and number of channels. They can be read from or reset.
Some sample sources are seekable. Seekable sources have two additional properties: length and position. Length is read-only.

This interface is not synchronized.


Member Function Documentation

virtual void ADR_CALL audiere::SampleSource::getFormat int &  channel_count,
int &  sample_rate,
SampleFormat &  sample_format
[pure virtual]
 

Retrieve the number of channels, sample rate, and sample format of the sample source.

virtual int ADR_CALL audiere::SampleSource::getLength  )  [pure virtual]
 

Returns:
number of frames in the stream, or 0 if the stream is not seekable

virtual int ADR_CALL audiere::SampleSource::getPosition  )  [pure virtual]
 

Returns the current position within the sample source.

Returns:
current position in frames

virtual bool ADR_CALL audiere::SampleSource::getRepeat  )  [pure virtual]
 

Returns:
true if the sample source is set to repeat

virtual bool ADR_CALL audiere::SampleSource::isSeekable  )  [pure virtual]
 

Returns:
true if the stream is seekable, false otherwise

virtual int ADR_CALL audiere::SampleSource::read int  frame_count,
void *  buffer
[pure virtual]
 

Read frame_count samples into buffer. buffer must be at least |frame_count * GetSampleSize(format) * channel_count| bytes long.

Parameters:
frame_count number of frames to read
buffer buffer to store samples in
Returns:
number of frames actually read

virtual void ADR_CALL audiere::SampleSource::reset  )  [pure virtual]
 

Reset the sample source. This has the same effect as setPosition(0) on a seekable source. On an unseekable source, it resets all internal state to the way it was when the source was first created.

virtual void ADR_CALL audiere::SampleSource::setPosition int  position  )  [pure virtual]
 

Sets the current position within the sample source. If the stream is not seekable, this method does nothing.

Parameters:
position current position in frames

virtual void ADR_CALL audiere::SampleSource::setRepeat bool  repeat  )  [pure virtual]
 

Sets whether the sample source should repeat or not. Note that not all sample sources repeat by starting again at the beginning of the sound. For example MOD files can contain embedded loop points.

Parameters:
repeat true if the source should repeat, false otherwise


The documentation for this class was generated from the following file:
Generated on Tue Feb 14 13:48:45 2006 for Twgui by  doxygen 1.4.6-NO