audiere::Resampler Class Reference

#include <resampler.h>

Inheritance diagram for audiere::Resampler:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Resampler (SampleSource *source, int rate)
void getFormat (int &channel_count, int &sample_rate, SampleFormat &sample_format)
int read (int frame_count, void *buffer)
void reset ()
bool isSeekable ()
int getLength ()
void setPosition (int position)
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)
void setPitchShift (float shift)
float getPitchShift ()

Detailed Description

Definition at line 14 of file resampler.h.


Constructor & Destructor Documentation

audiere::Resampler::Resampler SampleSource source,
int  rate
 

Definition at line 6 of file resampler.cpp.


Member Function Documentation

void audiere::Resampler::getFormat int &  channel_count,
int &  sample_rate,
SampleFormat sample_format
[virtual]
 

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

Implements audiere::SampleSource.

Definition at line 21 of file resampler.cpp.

References audiere::SF_S16.

int audiere::Resampler::getLength  )  [virtual]
 

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

Implements audiere::SampleSource.

Definition at line 162 of file resampler.cpp.

float audiere::Resampler::getPitchShift  ) 
 

Definition at line 205 of file resampler.cpp.

int audiere::Resampler::getPosition  )  [virtual]
 

Returns the current position within the sample source.

Returns:
current position in frames

Implements audiere::SampleSource.

Definition at line 174 of file resampler.cpp.

References audiere::DUMB_RESAMPLER::pos.

bool audiere::Resampler::getRepeat  )  [virtual]
 

Returns:
true if the sample source is set to repeat

Implements audiere::SampleSource.

Definition at line 184 of file resampler.cpp.

int audiere::Resampler::getTagCount  )  [virtual]
 

Returns number of metadata tags present in this sample source.

Implements audiere::SampleSource.

Definition at line 194 of file resampler.cpp.

const char * audiere::Resampler::getTagKey int  i  )  [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 195 of file resampler.cpp.

const char * audiere::Resampler::getTagType int  i  )  [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 197 of file resampler.cpp.

const char * audiere::Resampler::getTagValue int  i  )  [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 196 of file resampler.cpp.

bool audiere::Resampler::isSeekable  )  [virtual]
 

Returns:
true if the stream is seekable, false otherwise

Implements audiere::SampleSource.

Definition at line 157 of file resampler.cpp.

int audiere::Resampler::read int  frame_count,
void *  buffer
[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

Implements audiere::SampleSource.

Definition at line 32 of file resampler.cpp.

References ADR_ASSERT, audiere::clamp(), audiere::DUMB_RESAMPLER::dir, audiere::dumb_resample(), audiere::DUMB_RESAMPLER::end, audiere::DUMB_RESAMPLER::pos, audiere::DUMB_RESAMPLER::start, and audiere::DUMB_RESAMPLER::subpos.

void audiere::Resampler::reset  )  [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.

Implements audiere::SampleSource.

Definition at line 81 of file resampler.cpp.

void audiere::Resampler::setPitchShift float  shift  ) 
 

Definition at line 200 of file resampler.cpp.

void audiere::Resampler::setPosition int  position  )  [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.

Definition at line 167 of file resampler.cpp.

void audiere::Resampler::setRepeat bool  repeat  )  [virtual]
 

Todo:
if we've already read to the end, do we try to read more?

Implements audiere::SampleSource.

Definition at line 189 of file resampler.cpp.


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