Base-class for sound processing routines working in FIFO principle. More...
#include <FIFOSamplePipe.h>
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::SAMPLETYPE * | ptrBegin () const |
| Returns a pointer to the beginning of the output samples. | |
Protected Attributes | |
| FIFOSamplePipe * | output |
| Internal pipe where processed samples are put. | |
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.
| 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.
| 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.
| 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.
| 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().
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.
| 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.
FIFOSamplePipe* FIFOProcessor::output [protected] |
Internal pipe where processed samples are put.
Definition at line 129 of file FIFOSamplePipe.h.
Referenced by soundtouch::SoundTouch::calcEffectiveRateAndTempo(), FIFOProcessor(), isEmpty(), numSamples(), ptrBegin(), soundtouch::SoundTouch::putSamples(), receiveSamples(), and setOutPipe().
1.6.3