9 #ifndef PLAYD_RINGBUFFER_HPP 10 #define PLAYD_RINGBUFFER_HPP 13 #include "../contrib/pa_ringbuffer/pa_ringbuffer.h" 84 unsigned long Write(
const char *start,
unsigned long count);
105 unsigned long Read(
char *start,
unsigned long count);
112 PaUtilRingBuffer *
rb;
119 static unsigned long CountCast(ring_buffer_size_t count);
122 #endif // PLAYD_RINGBUFFER_HPP RingBuffer(int power, int size)
Constructs a RingBuffer.
char * buffer
The array used by the ringbuffer.
~RingBuffer()
Destructs a PaRingBuffer.
PaUtilRingBuffer * rb
The internal PortAudio ringbuffer.
RingBuffer & operator=(const RingBuffer &)=delete
Deleted copy-assignment.
unsigned long Read(char *start, unsigned long count)
Reads samples from the ring buffer into an array.
size_t WriteCapacity() const
The current write capacity.
size_t ReadCapacity() const
The current read capacity.
unsigned long Write(const char *start, unsigned long count)
Writes samples from an array into the ring buffer.
void Flush()
Empties the ring buffer.
static unsigned long CountCast(ring_buffer_size_t count)
Converts a ring buffer size into an external size.