11#ifndef __AUDACITY_RING_BUFFER__
12#define __AUDACITY_RING_BUFFER__
41 std::pair<samplePtr, size_t>
GetUnflushed(
unsigned iBlock);
55 size_t Filled(
size_t start,
size_t end)
const;
56 size_t Free(
size_t start,
size_t end)
const;
Holds streamed audio samples.
size_t WrittenForGet() const
Reader may concurrently cause a decrease of what this returns.
size_t AvailForPut() const
size_t Unput(size_t size)
Remove an initial segment of data that has been Put but not Flushed yet.
size_t Put(constSamplePtr buffer, sampleFormat format, size_t samples, size_t padding=0)
Does not apply dithering.
size_t Free(size_t start, size_t end) const
std::pair< samplePtr, size_t > GetUnflushed(unsigned iBlock)
NonInterfering< std::atomic< size_t > > mEnd
size_t Filled(size_t start, size_t end) const
void Flush()
Flush after a sequence of Put (and/or Clear) calls to let consumer see.
size_t Clear(sampleFormat format, size_t samples)
size_t Get(samplePtr buffer, sampleFormat format, size_t samples)
Does not apply dithering.
const sampleFormat mFormat
NonInterfering< std::atomic< size_t > > mStart
const SampleBuffer mBuffer
size_t Discard(size_t samples)
RingBuffer(sampleFormat format, size_t size)
size_t AvailForGet() const
const char * end(const char *str) noexcept