83 int readAheadBufferSize = 0,
85 double sourceSampleRateToCorrectFor = 0.0,
86 int maxNumChannels = 2);
98 void setPosition (
double newPosition);
103 double getCurrentPosition()
const;
106 double getLengthInSeconds()
const;
134 void setGain (
float newGain) noexcept;
139 float getGain() const noexcept {
return gain; }
143 void prepareToPlay (
int samplesPerBlockExpected,
double sampleRate)
override;
146 void releaseResources()
override;
153 void setNextReadPosition (int64 newPosition)
override;
156 int64 getNextReadPosition()
const override;
159 int64 getTotalLength()
const override;
162 bool isLooping()
const override;
173 float gain = 1.0f, lastGain = 1.0f;
174 std::atomic<bool> playing {
false }, stopped {
true };
175 double sampleRate = 44100.0, sourceSampleRate = 0;
176 int blockSize = 128, readAheadBufferSize = 0;
177 bool isPrepared =
false, inputStreamEOF =
false;
179 void releaseMasterResources();
#define JUCE_API
This macro is added to all JUCE public class declarations.
A type of AudioSource that takes an input source and changes its sample rate.
Base class for objects that can produce a continuous stream of audio.
Holds a list of ChangeListeners, and sends messages to them when instructed.
bool hasStreamFinished() const noexcept
Returns true if the player has stopped because its input stream ran out of data.
An AudioSource that takes a PositionableAudioSource and allows it to be played, stopped, started, etc.
An AudioSource which takes another source as input, and buffers it using a thread.
A thread that keeps a list of clients, and calls each one in turn, giving them all a chance to run so...
A type of AudioSource which can be repositioned.
Used by AudioSource::getNextAudioBlock().
float getGain() const noexcept
Returns the current gain setting.
bool isPlaying() const noexcept
Returns true if it's currently playing.