Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

audiere::SampleSource Class Reference

#include <audiere.h>

Inheritance diagram for audiere::SampleSource:

Inheritance graph
[legend]
Collaboration diagram for audiere::SampleSource:

Collaboration graph
[legend]
List of all members.

Public Methods

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

Protected Methods

 ~SampleSource ()

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.

Definition at line 231 of file audiere.h.


Constructor & Destructor Documentation

audiere::SampleSource::~SampleSource   [inline, protected]
 

Definition at line 233 of file audiere.h.


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.

Implemented in audiere::FLACInputStream, audiere::MODInputStream, audiere::MP3InputStream, audiere::OGGInputStream, audiere::WAVInputStream, audiere::WhiteNoise, audiere::PinkNoise, audiere::RepeatableStream, audiere::Resampler, audiere::BufferStream, audiere::SquareWave, and audiere::SineWave.

Referenced by audiere::DSOutputStream::DSOutputStream(), audiere::OALAudioDevice::openStream(), and audiere::DSAudioDevice::openStream().

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

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

Implemented in audiere::FLACInputStream, audiere::OGGInputStream, audiere::WAVInputStream, audiere::RepeatableStream, audiere::Resampler, audiere::BufferStream, and audiere::UnseekableSource.

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

Returns the current position within the sample source.

Returns :
current position in frames

Implemented in audiere::FLACInputStream, audiere::OGGInputStream, audiere::WAVInputStream, audiere::RepeatableStream, audiere::Resampler, audiere::BufferStream, and audiere::UnseekableSource.

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

Returns :
true if the stream is seekable, false otherwise

Implemented in audiere::FLACInputStream, audiere::OGGInputStream, audiere::WAVInputStream, audiere::RepeatableStream, audiere::Resampler, audiere::BufferStream, and audiere::UnseekableSource.

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

Implemented in audiere::FLACInputStream, audiere::MODInputStream, audiere::MP3InputStream, audiere::OGGInputStream, audiere::WAVInputStream, audiere::WhiteNoise, audiere::PinkNoise, audiere::RepeatableStream, audiere::Resampler, audiere::BufferStream, audiere::SquareWave, and audiere::SineWave.

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.

Implemented in audiere::FLACInputStream, audiere::MODInputStream, audiere::MP3InputStream, audiere::OGGInputStream, audiere::WAVInputStream, audiere::WhiteNoise, audiere::PinkNoise, audiere::RepeatableStream, audiere::Resampler, audiere::BufferStream, audiere::SquareWave, and audiere::SineWave.

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

Implemented in audiere::FLACInputStream, audiere::OGGInputStream, audiere::WAVInputStream, audiere::RepeatableStream, audiere::Resampler, audiere::BufferStream, and audiere::UnseekableSource.


The documentation for this class was generated from the following file:
Generated on Sat Oct 12 01:44:29 2002 for audiere by doxygen1.2.17