TracktionEngine
Loading...
Searching...
No Matches
engine::soundtouch::FIFOSamplePipe Class Referenceabstract

Abstract base class for FIFO (first-in-first-out) sample processing classes. More...

#include <tracktion_TempoDetect.h>

Inheritance diagram for engine::soundtouch::FIFOSamplePipe:

Public Member Functions

virtual ~FIFOSamplePipe ()
virtual SAMPLETYPE * ptrBegin ()=0
 Returns a pointer to the beginning of the output samples.
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 uint receiveSamples (SAMPLETYPE *output, uint maxSamples)=0
 Output samples from beginning of the sample buffer.
virtual uint receiveSamples (uint maxSamples)=0
 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 =0
 Returns number of samples currently available.
virtual int isEmpty () const =0
virtual void clear ()=0
 Clears all the samples.
virtual uint adjustAmountOfSamples (uint numSamples)=0
 allow trimming (downwards) amount of samples in pipeline.

Protected Member Functions

bool verifyNumberOfChannels (int nChannels) const

Detailed Description

Abstract base class for FIFO (first-in-first-out) sample processing classes.

Constructor & Destructor Documentation

◆ ~FIFOSamplePipe()

virtual engine::soundtouch::FIFOSamplePipe::~FIFOSamplePipe ( )
virtual

Member Function Documentation

◆ verifyNumberOfChannels()

bool engine::soundtouch::FIFOSamplePipe::verifyNumberOfChannels ( int nChannels) const
protected

◆ ptrBegin()

virtual SAMPLETYPE * engine::soundtouch::FIFOSamplePipe::ptrBegin ( )
pure 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

Implemented in engine::soundtouch::FIFOProcessor, and engine::soundtouch::FIFOSampleBuffer.

◆ putSamples()

virtual void engine::soundtouch::FIFOSamplePipe::putSamples ( const SAMPLETYPE * samples,
uint numSamples )
pure virtual

Adds 'numSamples' pcs of samples from the 'samples' memory position to the sample buffer.

Parameters
samplesPointer to samples.
numSamplesNumber of samples to insert.

Implemented in engine::soundtouch::FIFOSampleBuffer.

◆ moveSamples()

void engine::soundtouch::FIFOSamplePipe::moveSamples ( FIFOSamplePipe & other)
Parameters
otherOther pipe instance where from the receive the data.

◆ receiveSamples() [1/2]

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

Implemented in engine::soundtouch::FIFOProcessor, and engine::soundtouch::FIFOSampleBuffer.

◆ receiveSamples() [2/2]

virtual uint engine::soundtouch::FIFOSamplePipe::receiveSamples ( uint maxSamples)
pure 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.

Implemented in engine::soundtouch::FIFOProcessor, and engine::soundtouch::FIFOSampleBuffer.

◆ numSamples()

virtual uint engine::soundtouch::FIFOSamplePipe::numSamples ( ) const
pure virtual

Returns number of samples currently available.

Implemented in engine::soundtouch::FIFOProcessor, and engine::soundtouch::FIFOSampleBuffer.

Referenced by adjustAmountOfSamples().

◆ isEmpty()

virtual int engine::soundtouch::FIFOSamplePipe::isEmpty ( ) const
pure virtual

◆ clear()

virtual void engine::soundtouch::FIFOSamplePipe::clear ( )
pure virtual

Clears all the samples.

Implemented in engine::soundtouch::FIFOSampleBuffer.

◆ adjustAmountOfSamples()

virtual uint engine::soundtouch::FIFOSamplePipe::adjustAmountOfSamples ( uint numSamples)
pure virtual

allow trimming (downwards) amount of samples in pipeline.

Returns adjusted amount of samples

Implemented in engine::soundtouch::FIFOProcessor, and engine::soundtouch::FIFOSampleBuffer.

References numSamples().


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