Logo Search packages:      
Sourcecode: ardour version File versions  Download package

soundtouch::FIFOSampleBuffer Class Reference

#include <FIFOSampleBuffer.h>

Inheritance diagram for soundtouch::FIFOSampleBuffer:

soundtouch::FIFOSamplePipe

List of all members.


Detailed Description

Sample buffer working in FIFO (first-in-first-out) principle. The class takes care of storage size adjustment and data moving during input/output operations.

Notice that in case of stereo audio, one sample is considered to consist of both channel data.

Definition at line 59 of file FIFOSampleBuffer.h.


Public Member Functions

virtual void clear ()
 Clears all the samples.
 FIFOSampleBuffer (uint numChannels=2)
 Constructor.
virtual int isEmpty () const
 Returns nonzero if there aren't any samples available for outputting.
void moveSamples (FIFOSamplePipe &other)
virtual uint numSamples () const
 Returns number of samples currently available.
virtual SAMPLETYPE * ptrBegin () const
SAMPLETYPE * ptrEnd (uint slackCapacity)
virtual void putSamples (uint numSamples)
virtual void putSamples (const SAMPLETYPE *samples, uint numSamples)
virtual uint receiveSamples (uint maxSamples)
virtual uint receiveSamples (SAMPLETYPE *output, uint maxSamples)
void setChannels (uint numChannels)
 Sets number of channels, 1 = mono, 2 = stereo.
virtual ~FIFOSampleBuffer ()
 destructor

Private Member Functions

void ensureCapacity (const uint capacityRequirement)
 Ensures that the buffer has capacity for at least this many samples.
uint getCapacity () const
 Returns current capacity.
void rewind ()

Private Attributes

SAMPLETYPE * buffer
 Sample buffer.
uint bufferPos
SAMPLETYPE * bufferUnaligned
uint channels
 Channels, 1=mono, 2=stereo.
uint samplesInBuffer
 How many samples are currently in buffer.
uint sizeInBytes
 Sample buffer size in bytes.

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

Generated by  Doxygen 1.6.0   Back to index