## Public API Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# CrystalSpace::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 32 of file cyclicbuf.h.

## Constructor & Destructor Documentation

CrystalSpace::SoundCyclicBuffer::SoundCyclicBuffer | ( | size_t | buffer_size | ) |

| Construct the cycling buffer with a specific maximum storage size.

## Member Function Documentation

void CrystalSpace::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 CrystalSpace::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 CrystalSpace::SoundCyclicBuffer::Clear | ( | long | value = `0` | ) |

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

void CrystalSpace::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.

size_t CrystalSpace::SoundCyclicBuffer::GetEndValue | ( |  | ) |

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

size_t CrystalSpace::SoundCyclicBuffer::GetFreeBytes | ( |  | ) |

| Return the number of free bytes in the cyclic buffer.

size_t CrystalSpace::SoundCyclicBuffer::GetLength | ( |  | ) | `[inline]`

| Get the buffer length of the cyclic buffer in bytes. Definition at line 79 of file cyclicbuf.h.

size_t CrystalSpace::SoundCyclicBuffer::GetStartValue | ( |  | ) |

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

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

- csplugincommon/sndsys/cyclicbuf.h