1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-28 14:18:41 +02:00
audacity/src/RingBuffer.h
lllucius e5a4eecb25 Reverting r12591 as it was not complete and we're too close to
freeze to risk fixing it now.  Will readdress after 2.0.5 is 
released.

Basically, RingBuffer is ill equiped to handle an input stride
other than 1.

Thanks to Peter for testing this for me.
2013-10-07 12:37:15 +00:00

47 lines
885 B
C++

/**********************************************************************
Audacity: A Digital Audio Editor
RingBuffer.h
Dominic Mazzoni
*******************************************************************/
#ifndef __AUDACITY_RING_BUFFER__
#define __AUDACITY_RING_BUFFER__
#include "SampleFormat.h"
class RingBuffer {
public:
RingBuffer(sampleFormat format, int size);
~RingBuffer();
//
// For the writer only:
//
int AvailForPut();
int Put(samplePtr buffer, sampleFormat format, int samples);
//
// For the reader only:
//
int AvailForGet();
int Get(samplePtr buffer, sampleFormat format, int samples);
int Discard(int samples);
private:
int Len();
sampleFormat mFormat;
int mStart;
int mEnd;
int mBufferSize;
samplePtr mBuffer;
};
#endif /* __AUDACITY_RING_BUFFER__ */