27 : currentSampleRate (0.0), bufferSizeExpected (0)
39 if (input !=
nullptr && ! inputs.
contains (input))
64 std::unique_ptr<AudioSource>
toDelete;
68 const int index = inputs.
indexOf (input);
73 if (inputsToDelete [index])
91 for (
int i = inputs.
size(); --i >= 0;)
92 if (inputsToDelete[i])
108 currentSampleRate = sampleRate;
111 for (
int i = inputs.
size(); --i >= 0;)
119 for (
int i = inputs.
size(); --i >= 0;)
124 currentSampleRate = 0;
125 bufferSizeExpected = 0;
132 if (inputs.
size() > 0)
136 if (inputs.
size() > 1)
138 tempBuffer.
setSize (jmax (1,
info.buffer->getNumChannels()),
139 info.buffer->getNumSamples());
143 for (
int i = 1; i < inputs.
size(); ++i)
154 info.clearActiveBufferRegion();
Holds a resizable array of primitive or copy-by-value objects.
ElementType getUnchecked(int index) const
Returns one of the elements in the array, without checking the index passed in.
int size() const noexcept
Returns the current number of elements in the array.
void remove(int indexToRemove)
Removes an element from the array.
int indexOf(ParameterType elementToLookFor) const
Finds the index of the first element which matches the value passed in.
void add(const ElementType &newElement)
Appends a new element at the end of the array.
bool contains(ParameterType elementToLookFor) const
Returns true if the array contains at least one occurrence of an object.
void clear()
Removes all elements from the array.
void setSize(int newNumChannels, int newNumSamples, bool keepExistingContent=false, bool clearExtraSpace=false, bool avoidReallocating=false)
Changes the buffer's size or number of channels.
Base class for objects that can produce a continuous stream of audio.
virtual void releaseResources()=0
Allows the source to release anything it no longer needs after playback has stopped.
virtual void prepareToPlay(int samplesPerBlockExpected, double sampleRate)=0
Tells the source to prepare for playing.
void shiftBits(int howManyBitsLeft, int startBit)
Shifts a section of bits left or right.
void setBit(int bitNumber)
Sets a specified bit to 1.
void removeInputSource(AudioSource *input)
Removes an input source.
void getNextAudioBlock(const AudioSourceChannelInfo &) override
Implementation of the AudioSource method.
MixerAudioSource()
Creates a MixerAudioSource.
void removeAllInputs()
Removes all the input sources.
void addInputSource(AudioSource *newInput, bool deleteWhenRemoved)
Adds an input source to the mixer.
void prepareToPlay(int samplesPerBlockExpected, double sampleRate) override
Implementation of the AudioSource method.
~MixerAudioSource() override
Destructor.
void releaseResources() override
Implementation of the AudioSource method.
Used by AudioSource::getNextAudioBlock().