CLAM-Development  1.4.0
Public Member Functions
CLAM::AudioCircularBuffer Class Reference

Specialization of the CircularBuffer class for the case of Audio chunks. More...

#include <AudioCircularBuffer.hxx>

List of all members.

Public Member Functions

 AudioCircularBuffer ()
 CONSTRUCTION.
 AudioCircularBuffer (TSize bufferSize)
void ReadAudio (Audio &in)
void NonCopyReadAudio (Audio &in)
void WriteAudio (const Audio &in)
void AddAudio (const Audio &in)
- Public Member Functions inherited from CLAM::CircularBuffer< TData >
 CircularBuffer ()
 Default constructor.
 CircularBuffer (TSize bufferSize)
 Constructor which initializes the buffer to a certain capacity.
TSize GetBufferSize () const
 Returns the circular buffer's buffer size.
void SetBufferSize (TSize size)
 Resizes the buffer to a new capacity (or buffer size).
TSize GetWriteIndex () const
 Returns the index of the element that the buffer is about to write (ie.
TSize GetReadIndex () const
 Returns the index of the element that the buffer is about to read (ie.
TSize GetInitialReadOffset () const
 Returns the initial read offset.
void SetInitialReadOffset (TSize size)
 Sets the initial read offset.
TSize GetInitialWriteOffset () const
 Returns the initial write offset.
void SetInitialWriteOffset (TSize size)
 Sets the initial write offset.
void Init ()
 Initializes the buffer by setting all elements to 0 and making sure read/write indices are set correctly (taking into account initial read/write offsets).
void SetBufferToZero ()
 Sets all elements in circular buffer to zero.
void InitPointers ()
 Initializes read/write indices (taking into account initial read/write offsets).
void Read (TData &element)
 Reads a single element at the current read index into element.
void Read (TData *buffer)
 Reads read size number of elements starting at the current read index into buffer.
void Read (Array< TData > &in, TSize offset=0)
 Reads read size number of elements starting at the current read index into the array at the specified offset (default: offset = 0).
void NonCopyRead (Array< TData > &buffer)
void Write (const TData &element)
 Writes a single element at the current write index.
void Write (const TData *buffer)
 Writes write size number of elements starting at the current write index from buffer.
void Write (const Array< TData > &in, TSize offset=0)
 Writes write size number of elements starting at the current write index from the array starting at the specified offset (default: offset = 0).
void Add (const TData &elem)
 Does an additive write of a single element at the current write index.
void Add (const Array< TData > &in, TSize offset=0)
 Does an additive write of write size number of elements at the current write index onwards from the specified input array starting at the specified offset (default: offset = 0) onwards.
void IncreaseReadIndex (TSize step=1)
 Increases the read index by the specified number of elements (default: step = 1).
void IncreaseWriteIndex (TSize step=1)
 Increases the write index by the specified number of elements (default: step = 1).
void DecreaseReadIndex (TSize step=1)
 Decreases the read index by the specified number of elements (default: step = 1).
void DecreaseWriteIndex (TSize step=1)
 Decreases the write index by the specified number of elements (default: step = 1).
TDataGetPtrToElement (int absPos)
 Returns a pointer (well, reference) to the element at the specified index.
TSize GetReadSize () const
 Returns the current read size.
TSize GetWriteSize () const
 Returns the current write size.
void SetReadSize (TSize size)
 Sets the read size.
void SetWriteSize (TSize size)
 Sets the write size.

Additional Inherited Members

- Protected Attributes inherited from CLAM::CircularBuffer< TData >
Array< TDatamBuffer
TSize mLogicalSize
TSize mReadSize
TSize mWriteSize
TSize mWriteIndex
TSize mReadIndex
TSize mInitialReadOffset
TSize mInitialWriteOffset

Detailed Description

Specialization of the CircularBuffer class for the case of Audio chunks.

See also:
CircularBuffer

Definition at line 36 of file AudioCircularBuffer.hxx.


Constructor & Destructor Documentation

CLAM::AudioCircularBuffer::AudioCircularBuffer ( )
inline

CONSTRUCTION.

Definition at line 44 of file AudioCircularBuffer.hxx.

CLAM::AudioCircularBuffer::AudioCircularBuffer ( TSize  bufferSize)
inline

Definition at line 46 of file AudioCircularBuffer.hxx.


Member Function Documentation

void CLAM::AudioCircularBuffer::AddAudio ( const Audio in)
inline

Definition at line 67 of file AudioCircularBuffer.hxx.

References CLAM::CircularBuffer< TData >::Add().

void CLAM::AudioCircularBuffer::NonCopyReadAudio ( Audio in)
inline
void CLAM::AudioCircularBuffer::ReadAudio ( Audio in)
inline

Definition at line 52 of file AudioCircularBuffer.hxx.

References CLAM::CircularBuffer< TData >::Read().

void CLAM::AudioCircularBuffer::WriteAudio ( const Audio in)
inline

Definition at line 62 of file AudioCircularBuffer.hxx.

References CLAM::CircularBuffer< TData >::Write().


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