27 const bool deleteInputWhenDeleted)
28 : input (inputSource, deleteInputWhenDeleted)
30 jassert (inputSource !=
nullptr);
32 for (
int i = 2; --i >= 0;)
41 for (
int i = iirFilters.size(); --i >= 0;)
42 iirFilters.getUnchecked(i)->setCoefficients (newCoefficients);
47 for (
int i = iirFilters.size(); --i >= 0;)
48 iirFilters.getUnchecked(i)->makeInactive();
54 input->prepareToPlay (samplesPerBlockExpected, sampleRate);
56 for (
int i = iirFilters.size(); --i >= 0;)
57 iirFilters.getUnchecked(i)->reset();
62 input->releaseResources();
67 input->getNextAudioBlock (bufferToFill);
71 while (numChannels > iirFilters.size())
72 iirFilters.add (
new IIRFilter (*iirFilters.getUnchecked (0)));
74 for (
int i = 0; i < numChannels; ++i)
75 iirFilters.getUnchecked(i)
Type * getWritePointer(int channelNumber) noexcept
Returns a writeable pointer to one of the buffer's channels.
int getNumChannels() const noexcept
Returns the number of channels of audio data that this buffer contains.
Base class for objects that can produce a continuous stream of audio.
A set of coefficients for use in an IIRFilter object.
void makeInactive()
Calls IIRFilter::makeInactive() on all the filters being used internally.
void prepareToPlay(int samplesPerBlockExpected, double sampleRate) override
Tells the source to prepare for playing.
void setCoefficients(const IIRCoefficients &newCoefficients)
Changes the filter to use the same parameters as the one being passed in.
IIRFilterAudioSource(AudioSource *inputSource, bool deleteInputWhenDeleted)
Creates a IIRFilterAudioSource for a given input source.
void releaseResources() override
Allows the source to release anything it no longer needs after playback has stopped.
~IIRFilterAudioSource() override
Destructor.
void getNextAudioBlock(const AudioSourceChannelInfo &) override
Called repeatedly to fetch subsequent blocks of audio data.
An IIR filter that can perform low, high, or band-pass filtering on an audio signal.
Used by AudioSource::getNextAudioBlock().
int numSamples
The number of samples in the buffer which the callback is expected to fill with data.
AudioBuffer< float > * buffer
The destination buffer to fill with audio data.
int startSample
The first sample in the buffer from which the callback is expected to write data.