59 bool deleteSourceWhenDeleted,
60 int numberOfSamplesToBuffer,
61 int numberOfChannels = 2,
62 bool prefillBufferOnPrepareToPlay =
true);
73 void prepareToPlay (
int samplesPerBlockExpected,
double sampleRate)
override;
76 void releaseResources()
override;
83 void setNextReadPosition (
int64 newPosition)
override;
86 int64 getNextReadPosition()
const override;
102 Range<int> getValidBufferRange (
int numSamples)
const;
103 bool readNextBufferChunk();
104 void readBufferSection (
int64 start,
int length,
int bufferOffset);
105 int useTimeSlice()
override;
110 int numberOfSamplesToBuffer, numberOfChannels;
114 int64 bufferValidStart = 0, bufferValidEnd = 0;
116 double sampleRate = 0;
117 bool wasSourceLooping =
false, isPrepared =
false;
118 const bool prefillBuffer;
A multi-channel buffer containing floating point audio samples.
An AudioSource which takes another source as input, and buffers it using a thread.
int64 getTotalLength() const override
Implements the PositionableAudioSource method.
bool isLooping() const override
Implements the PositionableAudioSource method.
Holds a pointer to an object which can optionally be deleted when this pointer goes out of scope.
A type of AudioSource which can be repositioned.
virtual bool isLooping() const =0
Returns true if this source is actually playing in a loop.
virtual int64 getTotalLength() const =0
Returns the total length of the stream (in samples).
A general-purpose range object, that simply represents any linear range with a start and end point.
Used by the TimeSliceThread class.
A thread that keeps a list of clients, and calls each one in turn, giving them all a chance to run so...
Allows threads to wait for events triggered by other threads.
unsigned int uint32
A platform-independent 32-bit unsigned integer type.
long long int64
A platform-independent 64-bit integer type.
Used by AudioSource::getNextAudioBlock().