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();
181 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioTransportSource)
Base class for objects that can produce a continuous stream of audio.
An AudioSource that takes a PositionableAudioSource and allows it to be played, stopped,...
bool hasStreamFinished() const noexcept
Returns true if the player has stopped because its input stream ran out of data.
float getGain() const noexcept
Returns the current gain setting.
bool isPlaying() const noexcept
Returns true if it's currently playing.
An AudioSource which takes another source as input, and buffers it using a thread.
Holds a list of ChangeListeners, and sends messages to them when instructed.
A type of AudioSource which can be repositioned.
A type of AudioSource that takes an input source and changes its sample rate.
A thread that keeps a list of clients, and calls each one in turn, giving them all a chance to run so...
#define JUCE_API
This macro is added to all JUCE public class declarations.
Used by AudioSource::getNextAudioBlock().