49 auto max = 0, pos = 0;
53 for (i = position; (i <
n || isLooping) && (pos <
m); i += max)
55 max = jmin (
m - pos,
n - (i %
n));
58 for (;
ch < channels; ++
ch)
61 for (;
ch <
dst.getNumChannels(); ++
ch)
Holds a resizable array of primitive or copy-by-value objects.
void clear()
Removes all elements from the array.
void makeCopyOf(const AudioBuffer< OtherType > &other, bool avoidReallocating=false)
Resizes this buffer to match the given one, and copies all of its content across.
int getNumChannels() const noexcept
Returns the number of channels of audio data that this buffer contains.
int getNumSamples() const noexcept
Returns the number of samples allocated in each of the buffer's channels.
void setDataToReferTo(Type **dataToReferTo, int newNumChannels, int newStartSample, int newNumSamples)
Makes this buffer point to a pre-allocated set of channel data arrays.
MemoryAudioSource(AudioBuffer< float > &audioBuffer, bool copyMemory, bool shouldLoop=false)
Creates a MemoryAudioSource by providing an audio buffer.
void prepareToPlay(int samplesPerBlockExpected, double sampleRate) override
Implementation of the AudioSource method.
void getNextAudioBlock(const AudioSourceChannelInfo &bufferToFill) override
Implementation of the AudioSource method.
void releaseResources() override
Implementation of the AudioSource method.
Used by AudioSource::getNextAudioBlock().