TracktionEngine
Loading...
Searching...
No Matches
engine::soundtouch::FIFOProcessor Class Reference

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

#include <tracktion_TempoDetect.h>

Inheritance diagram for engine::soundtouch::FIFOProcessor:

Public Member Functions

virtual uint receiveSamples (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.
virtual uint adjustAmountOfSamples (uint numSamples)
 allow trimming (downwards) amount of samples in pipeline.
Public Member Functions inherited from engine::soundtouch::FIFOSamplePipe
virtual ~FIFOSamplePipe ()
virtual void putSamples (const SAMPLETYPE *samples, uint numSamples)=0
 Adds 'numSamples' pcs of samples from the 'samples' memory position to the sample buffer.
void moveSamples (FIFOSamplePipe &other)
virtual void clear ()=0
 Clears all the samples.

Protected Member Functions

void setOutPipe (FIFOSamplePipe *pOutput)
 Sets output pipe.
 FIFOProcessor ()
 Constructor.
 FIFOProcessor (FIFOSamplePipe *pOutput)
 Constructor. Configures output pipe.
virtual ~FIFOProcessor ()
 Destructor.
virtual SAMPLETYPE * ptrBegin ()
 Returns a pointer to the beginning of the output samples.
Protected Member Functions inherited from engine::soundtouch::FIFOSamplePipe
bool verifyNumberOfChannels (int nChannels) const

Protected Attributes

FIFOSamplePipe * output
 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.

Constructor & Destructor Documentation

◆ FIFOProcessor() [1/2]

engine::soundtouch::FIFOProcessor::FIFOProcessor ( )
protected

Constructor.

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

◆ FIFOProcessor() [2/2]

engine::soundtouch::FIFOProcessor::FIFOProcessor ( FIFOSamplePipe * pOutput)
protected

Constructor. Configures output pipe.

Parameters
pOutputOutput pipe.

◆ ~FIFOProcessor()

virtual engine::soundtouch::FIFOProcessor::~FIFOProcessor ( )
protectedvirtual

Destructor.

Member Function Documentation

◆ setOutPipe()

void engine::soundtouch::FIFOProcessor::setOutPipe ( FIFOSamplePipe * pOutput)
protected

Sets output pipe.

◆ ptrBegin()

virtual SAMPLETYPE * engine::soundtouch::FIFOProcessor::ptrBegin ( )
protectedvirtual

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 engine::soundtouch::FIFOSamplePipe.

◆ receiveSamples() [1/2]

virtual uint engine::soundtouch::FIFOProcessor::receiveSamples ( SAMPLETYPE * outBuffer,
uint maxSamples )
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
outBufferBuffer where to copy output samples.
maxSamplesHow many samples to receive at max.

Implements engine::soundtouch::FIFOSamplePipe.

◆ receiveSamples() [2/2]

virtual uint engine::soundtouch::FIFOProcessor::receiveSamples ( uint maxSamples)
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
maxSamplesRemove this many samples from the beginning of pipe.

Implements engine::soundtouch::FIFOSamplePipe.

◆ numSamples()

virtual uint engine::soundtouch::FIFOProcessor::numSamples ( ) const
virtual

Returns number of samples currently available.

Implements engine::soundtouch::FIFOSamplePipe.

◆ isEmpty()

virtual int engine::soundtouch::FIFOProcessor::isEmpty ( ) const
virtual

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

Implements engine::soundtouch::FIFOSamplePipe.

◆ adjustAmountOfSamples()

virtual uint engine::soundtouch::FIFOProcessor::adjustAmountOfSamples ( uint numSamples)
virtual

allow trimming (downwards) amount of samples in pipeline.

Returns adjusted amount of samples

Implements engine::soundtouch::FIFOSamplePipe.

Member Data Documentation

◆ output

FIFOSamplePipe* engine::soundtouch::FIFOProcessor::output
protected

Internal pipe where processed samples are put.


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