audiere::LoopPointSourceImpl Class Reference

Inheritance diagram for audiere::LoopPointSourceImpl:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 LoopPointSourceImpl (SampleSource *source)
void addLoopPoint (int location, int target, int loopCount)
void removeLoopPoint (int index)
int getLoopPointCount ()
bool getLoopPoint (int index, int &location, int &target, int &loopCount)
void getFormat (int &channel_count, int &sample_rate, SampleFormat &sample_format)
int read (int fc, void *buffer)
int getNextLoopPoint (int position)
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)

Detailed Description

Definition at line 21 of file loop_point_source.cpp.


Constructor & Destructor Documentation

audiere::LoopPointSourceImpl::LoopPointSourceImpl SampleSource source  )  [inline]
 

Definition at line 23 of file loop_point_source.cpp.

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


Member Function Documentation

void audiere::LoopPointSourceImpl::addLoopPoint int  location,
int  target,
int  loopCount
[inline, virtual]
 

Adds a loop point to the stream. If a loop point at 'location' already exists, the new one replaces it. Location and target are clamped to the actual length of the stream.

Parameters:
location frame where loop occurs
target frame to jump to after loop point is hit
loopCount number of times to execute this jump.

Implements audiere::LoopPointSource.

Definition at line 34 of file loop_point_source.cpp.

References audiere::clamp(), audiere::LoopPoint::location, audiere::LoopPoint::loopCount, audiere::LoopPoint::originalLoopCount, and audiere::LoopPoint::target.

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

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

Implements audiere::SampleSource.

Definition at line 80 of file loop_point_source.cpp.

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

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

Implements audiere::SampleSource.

Definition at line 165 of file loop_point_source.cpp.

bool audiere::LoopPointSourceImpl::getLoopPoint int  index,
int &  location,
int &  target,
int &  loopCount
[inline, virtual]
 

Retrieves information about a specific loop point.

Parameters:
index index of the loop point
location frame where loop occurs
target loop point's target frame
loopCount number of times to loop from this particular point
Returns:
true if the index is valid and information is returned

Implements audiere::LoopPointSource.

Definition at line 64 of file loop_point_source.cpp.

int audiere::LoopPointSourceImpl::getLoopPointCount  )  [inline, virtual]
 

Returns the number of loop points in this stream.

Implements audiere::LoopPointSource.

Definition at line 60 of file loop_point_source.cpp.

int audiere::LoopPointSourceImpl::getNextLoopPoint int  position  )  [inline]
 

Definition at line 141 of file loop_point_source.cpp.

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

Returns the current position within the sample source.

Returns:
current position in frames

Implements audiere::SampleSource.

Definition at line 173 of file loop_point_source.cpp.

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

Returns:
true if the sample source is set to repeat

Implements audiere::SampleSource.

Definition at line 177 of file loop_point_source.cpp.

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

Returns number of metadata tags present in this sample source.

Implements audiere::SampleSource.

Definition at line 185 of file loop_point_source.cpp.

const char* audiere::LoopPointSourceImpl::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 186 of file loop_point_source.cpp.

const char* audiere::LoopPointSourceImpl::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 188 of file loop_point_source.cpp.

const char* audiere::LoopPointSourceImpl::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 187 of file loop_point_source.cpp.

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

Returns:
true if the stream is seekable, false otherwise

Implements audiere::SampleSource.

Definition at line 160 of file loop_point_source.cpp.

int audiere::LoopPointSourceImpl::read int  fc,
void *  buffer
[inline, 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 87 of file loop_point_source.cpp.

void audiere::LoopPointSourceImpl::removeLoopPoint int  index  )  [inline, virtual]
 

Removes the loop point at index 'index' from the stream.

Parameters:
index index of the loop point to remove

Implements audiere::LoopPointSource.

Definition at line 56 of file loop_point_source.cpp.

void audiere::LoopPointSourceImpl::reset  )  [inline, 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 151 of file loop_point_source.cpp.

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

Definition at line 169 of file loop_point_source.cpp.

void audiere::LoopPointSourceImpl::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 181 of file loop_point_source.cpp.


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