FIFOProcessor Class Reference

Base-class for sound processing routines working in FIFO principle. More...

#include <FIFOSamplePipe.h>

Inheritance diagram for FIFOProcessor:
FIFOSamplePipe soundtouch::RateTransposer soundtouch::SoundTouch soundtouch::TDStretch RateTransposerFloat RateTransposerInteger soundtouch::TDStretchMMX soundtouch::TDStretchSSE2 soundtouch::TDStretchSSE3

List of all members.

Public Member Functions

virtual uint receiveSamples (soundtouch::SAMPLETYPE *outBuffer, uint maxSamples)
 Output samples from beginning of the sample buffer.
virtual uint receiveSamples (uint maxSamples)
 Adjusts book-keeping so that given number of samples are removed from beginning of the sample buffer without copying them anywhere.
virtual uint numSamples () const
 Returns number of samples currently available.
virtual int isEmpty () const
 Returns nonzero if there aren't any samples available for outputting.

Protected Member Functions

void setOutPipe (FIFOSamplePipe *pOutput)
 Sets output pipe.
 FIFOProcessor ()
 Constructor.
 FIFOProcessor (FIFOSamplePipe *pOutput)
 Constructor. Configures output pipe.
virtual ~FIFOProcessor ()
 Destructor.
virtual soundtouch::SAMPLETYPEptrBegin () const
 Returns a pointer to the beginning of the output samples.

Protected Attributes

FIFOSamplePipeoutput
 Internal pipe where processed samples are put.

Detailed Description

Base-class for sound processing routines working in FIFO principle.

With this base class it's easy to implement sound processing stages that can be chained together, so that samples that are fed into beginning of the pipe automatically go through all the processing stages.

When samples are input to this class, they're first processed and then put to the FIFO pipe that's defined as output of this class. This output pipe can be either other processing stage or a FIFO sample buffer.

Definition at line 125 of file FIFOSamplePipe.h.


Constructor & Destructor Documentation

FIFOProcessor::FIFOProcessor (  )  [inline, protected]

Constructor.

Doesn't define output pipe; it has to be set be 'setOutPipe' function.

Definition at line 142 of file FIFOSamplePipe.h.

FIFOProcessor::FIFOProcessor ( FIFOSamplePipe pOutput  )  [inline, protected]

Constructor. Configures output pipe.

Parameters:
pOutput Output pipe.

Definition at line 149 of file FIFOSamplePipe.h.

virtual FIFOProcessor::~FIFOProcessor (  )  [inline, protected, virtual]

Destructor.

Definition at line 157 of file FIFOSamplePipe.h.


Member Function Documentation

void FIFOProcessor::setOutPipe ( FIFOSamplePipe pOutput  )  [inline, protected]

Sets output pipe.

Definition at line 132 of file FIFOSamplePipe.h.

Referenced by soundtouch::SoundTouch::SoundTouch().

virtual soundtouch::SAMPLETYPE* FIFOProcessor::ptrBegin (  )  const [inline, protected, virtual]

Returns a pointer to the beginning of the output samples.

This function is provided for accessing the output samples directly. Please be careful for not to corrupt the book-keeping!

When using this function to output samples, also remember to 'remove' the output samples from the buffer by calling the 'receiveSamples(numSamples)' function

Implements FIFOSamplePipe.

Definition at line 169 of file FIFOSamplePipe.h.

virtual uint FIFOProcessor::receiveSamples ( soundtouch::SAMPLETYPE outBuffer,
uint  maxSamples 
) [inline, virtual]

Output samples from beginning of the sample buffer.

Copies requested samples to output buffer and removes them from the sample buffer. If there are less than 'numsample' samples in the buffer, returns all that available.

Returns:
Number of samples returned.
Parameters:
outBuffer Buffer where to copy output samples.
maxSamples How many samples to receive at max.

Implements FIFOSamplePipe.

Definition at line 181 of file FIFOSamplePipe.h.

Referenced by AudioOutputBase::AddData().

virtual uint FIFOProcessor::receiveSamples ( uint  maxSamples  )  [inline, virtual]

Adjusts book-keeping so that given number of samples are removed from beginning of the sample buffer without copying them anywhere.

Used to reduce the number of samples in the buffer when accessing the sample buffer directly with 'ptrBegin' function.

Parameters:
maxSamples Remove this many samples from the beginning of pipe.

Implements FIFOSamplePipe.

Definition at line 194 of file FIFOSamplePipe.h.

virtual uint FIFOProcessor::numSamples (  )  const [inline, virtual]

Returns number of samples currently available.

Implements FIFOSamplePipe.

Definition at line 202 of file FIFOSamplePipe.h.

Referenced by AudioOutputBase::AddData(), soundtouch::SoundTouch::flush(), and AudioOutputBase::SetAudiotime().

virtual int FIFOProcessor::isEmpty (  )  const [inline, virtual]

Returns nonzero if there aren't any samples available for outputting.

Implements FIFOSamplePipe.

Reimplemented in soundtouch::RateTransposer.

Definition at line 209 of file FIFOSamplePipe.h.


Member Data Documentation


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends
Generated on Thu May 24 06:42:01 2012 for MythTV by  doxygen 1.6.3