audiere::BasicSource Class Reference

#include <basic_source.h>

Inheritance diagram for audiere::BasicSource:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 BasicSource ()
int read (int frame_count, void *buffer)
bool isSeekable ()
int getLength ()
void setPosition (int)
int getPosition ()
bool getRepeat ()
void setRepeat (bool repeat)
int getTagCount ()
const char * getTagKey (int i)
const char * getTagValue (int i)
const char * getTagType (int i)
virtual int doRead (int frame_count, void *buffer)=0

Protected Member Functions

void addTag (const Tag &t)
void addTag (const std::string &k, const std::string &v, const std::string &t)

Detailed Description

Basic implementation of a sample source including things such as repeat. BasicSource also defines the required methods for unseekable sources. Override them if you can seek.

Definition at line 29 of file basic_source.h.


Constructor & Destructor Documentation

audiere::BasicSource::BasicSource  ) 
 

Definition at line 8 of file basic_source.cpp.


Member Function Documentation

void audiere::BasicSource::addTag const std::string &  k,
const std::string &  v,
const std::string &  t
[inline, protected]
 

Definition at line 60 of file basic_source.h.

References addTag().

void audiere::BasicSource::addTag const Tag t  )  [inline, protected]
 

Definition at line 56 of file basic_source.h.

Referenced by addTag(), and audiere::OGGInputStream::initialize().

virtual int audiere::BasicSource::doRead int  frame_count,
void *  buffer
[pure virtual]
 

Implement this method in subclasses.

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

Referenced by read().

int audiere::BasicSource::getLength  )  [inline, virtual]
 

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

Implements audiere::SampleSource.

Reimplemented in audiere::AIFFInputStream, audiere::FLACInputStream, audiere::MP3InputStream, audiere::OGGInputStream, audiere::SpeexInputStream, audiere::WAVInputStream, and audiere::BufferStream.

Definition at line 40 of file basic_source.h.

int audiere::BasicSource::getPosition  )  [inline, virtual]
 

Returns the current position within the sample source.

Returns:
current position in frames

Implements audiere::SampleSource.

Reimplemented in audiere::AIFFInputStream, audiere::FLACInputStream, audiere::MP3InputStream, audiere::OGGInputStream, audiere::SpeexInputStream, audiere::WAVInputStream, and audiere::BufferStream.

Definition at line 42 of file basic_source.h.

bool audiere::BasicSource::getRepeat  )  [inline, virtual]
 

Returns:
true if the sample source is set to repeat

Implements audiere::SampleSource.

Definition at line 44 of file basic_source.h.

int audiere::BasicSource::getTagCount  )  [inline, virtual]
 

Returns number of metadata tags present in this sample source.

Implements audiere::SampleSource.

Definition at line 47 of file basic_source.h.

const char* audiere::BasicSource::getTagKey int  i  )  [inline, virtual]
 

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

Implements audiere::SampleSource.

Definition at line 48 of file basic_source.h.

const char* audiere::BasicSource::getTagType int  i  )  [inline, 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".

Implements audiere::SampleSource.

Definition at line 50 of file basic_source.h.

const char* audiere::BasicSource::getTagValue int  i  )  [inline, virtual]
 

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

Implements audiere::SampleSource.

Definition at line 49 of file basic_source.h.

bool audiere::BasicSource::isSeekable  )  [inline, virtual]
 

Returns:
true if the stream is seekable, false otherwise

Implements audiere::SampleSource.

Reimplemented in audiere::AIFFInputStream, audiere::FLACInputStream, audiere::MP3InputStream, audiere::OGGInputStream, audiere::SpeexInputStream, audiere::WAVInputStream, and audiere::BufferStream.

Definition at line 39 of file basic_source.h.

int audiere::BasicSource::read int  frame_count,
void *  buffer
[virtual]
 

Manages repeating within read(). Implement doRead() in implementation classes.

Implements audiere::SampleSource.

Definition at line 13 of file basic_source.cpp.

References ADR_LOG, doRead(), audiere::GetFrameSize(), and audiere::SampleSource::reset().

Referenced by audiere::WAVInputStream::doRead(), audiere::AIFFInputStream::doRead(), and audiere::FLACInputStream::initialize().

void audiere::BasicSource::setPosition int   )  [inline, 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

Implements audiere::SampleSource.

Reimplemented in audiere::AIFFInputStream, audiere::FLACInputStream, audiere::MP3InputStream, audiere::OGGInputStream, audiere::SpeexInputStream, audiere::WAVInputStream, and audiere::BufferStream.

Definition at line 41 of file basic_source.h.

void audiere::BasicSource::setRepeat bool  repeat  )  [inline, 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

Implements audiere::SampleSource.

Definition at line 45 of file basic_source.h.


The documentation for this class was generated from the following files:
Generated on Mon Feb 13 23:08:54 2006 for audiere by  doxygen 1.4.6