63 bool deleteSourceWhenDeleted,
64 int numberOfSamplesToBuffer,
65 int numberOfChannels = 2,
66 bool prefillBufferOnPrepareToPlay =
true);
77 void prepareToPlay (
int samplesPerBlockExpected,
double sampleRate)
override;
80 void releaseResources()
override;
87 void setNextReadPosition (int64 newPosition)
override;
90 int64 getNextReadPosition()
const override;
108 int numberOfSamplesToBuffer, numberOfChannels;
112 std::atomic<int64> bufferValidStart { 0 }, bufferValidEnd { 0 }, nextPlayPos { 0 };
113 double sampleRate = 0;
114 bool wasSourceLooping =
false, isPrepared =
false, prefillBuffer;
116 bool readNextBufferChunk();
117 void readBufferSection (int64 start,
int length,
int bufferOffset);
118 int useTimeSlice()
override;
120 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (BufferingAudioSource)
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).
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.
#define JUCE_API
This macro is added to all JUCE public class declarations.
Used by AudioSource::getNextAudioBlock().