CrystalSpace

Public API Reference

Public Member Functions
CS::SndSys::SoundCyclicBuffer Class Reference

An implementation of a cyclic buffer oriented for sound functionality. More...

#include <csplugincommon/sndsys/cyclicbuf.h>

List of all members.

Public Member Functions

void AddBytes (void *bytes_ptr, size_t bytes_length)
 Add bytes to the cyclic buffer.
void AdvanceStartValue (size_t advance_amount)
 Advance the first byte pointer of the cyclic buffer so that data below this value can be overwritten.
void Clear (long value=0)
 Clear the buffer and reset the start and end values to the provided value.
void GetDataPointersFromPosition (size_t *position_value, size_t max_length, uint8 **buffer1, size_t *buffer1_length, uint8 **buffer2, size_t *buffer2_length)
 Get data pointers to copy data out of the cyclic buffer.
size_t GetEndValue ()
 The positional value associated with one byte beyond the last byte in the buffer.
size_t GetFreeBytes ()
 Return the number of free bytes in the cyclic buffer.
size_t GetLength ()
 Get the buffer length of the cyclic buffer in bytes.
size_t GetStartValue ()
 The positional value associated with the first byte of data in the buffer.
 SoundCyclicBuffer (size_t buffer_size)
 Construct the cycling buffer with a specific maximum storage size.

Detailed Description

An implementation of a cyclic buffer oriented for sound functionality.

Definition at line 34 of file cyclicbuf.h.


Constructor & Destructor Documentation

Construct the cycling buffer with a specific maximum storage size.


Member Function Documentation

void CS::SndSys::SoundCyclicBuffer::AddBytes ( void *  bytes_ptr,
size_t  bytes_length 
)

Add bytes to the cyclic buffer.

The bytes must fit. Use GetFreeBytes() to check for available space and AdvanceStartValue() to make more space available.

void CS::SndSys::SoundCyclicBuffer::AdvanceStartValue ( size_t  advance_amount)

Advance the first byte pointer of the cyclic buffer so that data below this value can be overwritten.

void CS::SndSys::SoundCyclicBuffer::Clear ( long  value = 0)

Clear the buffer and reset the start and end values to the provided value.

void CS::SndSys::SoundCyclicBuffer::GetDataPointersFromPosition ( size_t *  position_value,
size_t  max_length,
uint8 **  buffer1,
size_t *  buffer1_length,
uint8 **  buffer2,
size_t *  buffer2_length 
)

Get data pointers to copy data out of the cyclic buffer.

The positional value associated with one byte beyond the last byte in the buffer.

Return the number of free bytes in the cyclic buffer.

Get the buffer length of the cyclic buffer in bytes.

Definition at line 81 of file cyclicbuf.h.

The positional value associated with the first byte of data in the buffer.


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

Generated for Crystal Space 2.0 by doxygen 1.7.6.1