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 Member Functions

virtual void getFormat (int &channel_count, int &sample_rate, SampleFormat &sample_format)=0
virtual int read (int frame_count, void *buffer)=0
virtual void reset ()=0
virtual bool isSeekable ()=0
virtual int getLength ()=0
virtual void setPosition (int position)=0
virtual int getPosition ()=0
virtual bool getRepeat ()=0
virtual void setRepeat (bool repeat)=0
virtual int getTagCount ()=0
virtual const char * getTagKey (int i)=0
virtual const char * getTagValue (int i)=0
virtual const char * getTagType (int i)=0

Protected Member Functions

 ~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 306 of file audiere.h.


Constructor & Destructor Documentation

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

Definition at line 308 of file audiere.h.


Member Function Documentation

virtual void 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 audiere::SampleSource::getLength  )  [pure virtual]
 

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

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

Returns the current position within the sample source.

Returns:
current position in frames

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

Returns:
true if the sample source is set to repeat

virtual int audiere::SampleSource::getTagCount  )  [pure virtual]
 

Returns number of metadata tags present in this sample source.

virtual const char* audiere::SampleSource::getTagKey int  i  )  [pure virtual]
 

Returns the key of the i'th tag in the source. If the tag is "author=me", the key is "author".

virtual const char* audiere::SampleSource::getTagType int  i  )  [pure virtual]
 

Returns the type of the i'th tag in the source. The type is where the tag comes from, i.e. "ID3v1", "ID3v2", or "vorbis".

virtual const char* audiere::SampleSource::getTagValue int  i  )  [pure virtual]
 

Returns the value of the i'th tag in the source. If the tag is "author=me", the value is "me".

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

Returns:
true if the stream is seekable, false otherwise

virtual int 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 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 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 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 Mon Feb 13 23:07:17 2006 for audiere by  doxygen 1.4.6