MythTV  0.28pre
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
FIFOProcessor Class Reference

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

#include <FIFOSamplePipe.h>

Inheritance diagram for FIFOProcessor:
Inheritance graph
[legend]
Collaboration diagram for FIFOProcessor:
Collaboration graph
[legend]

Public Member Functions

virtual uint receiveSamples (soundtouch::SAMPLETYPE *outBuffer, uint maxSamples)
 Output samples from beginning of the sample buffer. More...
 
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. More...
 
virtual uint numSamples () const
 Returns number of samples currently available. More...
 
virtual int isEmpty () const
 Returns nonzero if there aren't any samples available for outputting. More...
 
- Public Member Functions inherited from FIFOSamplePipe
virtual void putSamples (const soundtouch::SAMPLETYPE *samples, uint numSamples)=0
 Adds 'numSamples' pcs of samples from the 'samples' memory position to the sample buffer. More...
 
void moveSamples (FIFOSamplePipe &other)
 
virtual void clear ()=0
 Clears all the samples. More...
 
virtual ~FIFOSamplePipe ()
 Destructor to shut gcc 4 up. More...
 

Protected Member Functions

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

Protected Attributes

FIFOSamplePipeoutput
 Internal pipe where processed samples are put. More...
 

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 ( )
inlineprotected

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)
inlineprotected

Constructor. Configures output pipe.

Parameters
pOutputOutput pipe.

Definition at line 149 of file FIFOSamplePipe.h.

virtual FIFOProcessor::~FIFOProcessor ( )
inlineprotectedvirtual

Destructor.

Definition at line 157 of file FIFOSamplePipe.h.

Member Function Documentation

void FIFOProcessor::setOutPipe ( FIFOSamplePipe pOutput)
inlineprotected

Sets output pipe.

Definition at line 132 of file FIFOSamplePipe.h.

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

virtual soundtouch::SAMPLETYPE* FIFOProcessor::ptrBegin ( ) const
inlineprotectedvirtual

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 
)
inlinevirtual

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
outBufferBuffer where to copy output samples.
maxSamplesHow 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)
inlinevirtual

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
maxSamplesRemove this many samples from the beginning of pipe.

Implements FIFOSamplePipe.

Definition at line 194 of file FIFOSamplePipe.h.

virtual uint FIFOProcessor::numSamples ( ) const
inlinevirtual
virtual int FIFOProcessor::isEmpty ( ) const
inlinevirtual

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.

Referenced by soundtouch::RateTransposer::isEmpty().

Member Data Documentation

FIFOSamplePipe* FIFOProcessor::output
protected

The documentation for this class was generated from the following file: