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)
IIRFilterAudioSource(AudioSource *inputSource, bool deleteInputWhenDeleted)
Creates a IIRFilterAudioSource for a given input source.
int numSamples
The number of samples in the buffer which the callback is expected to fill with data.
void setCoefficients(const IIRCoefficients &newCoefficients)
Changes the filter to use the same parameters as the one being passed in.
Base class for objects that can produce a continuous stream of audio.
int getNumChannels() const noexcept
Returns the number of channels of audio data that this buffer contains.
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.
int startSample
The first sample in the buffer from which the callback is expected to write data. ...
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 releaseResources() override
Allows the source to release anything it no longer needs after playback has stopped.
AudioBuffer< float > * buffer
The destination buffer to fill with audio data.
A set of coefficients for use in an IIRFilter object.
~IIRFilterAudioSource() override
Destructor.
Type * getWritePointer(int channelNumber) noexcept
Returns a writeable pointer to one of the buffer's channels.
Used by AudioSource::getNextAudioBlock().