Applies a gain to audio samples as single samples or AudioBlocks. More...
#include <juce_Gain.h>
Public Member Functions | |
Gain () noexcept | |
FloatType | getGainDecibels () const noexcept |
Returns the current gain in decibels. More... | |
FloatType | getGainLinear () const noexcept |
Returns the current gain as a linear value. More... | |
double | getRampDurationSeconds () const noexcept |
Returns the ramp duration in seconds. More... | |
bool | isSmoothing () const noexcept |
Returns true if the current value is currently being interpolated. More... | |
void | prepare (const ProcessSpec &spec) noexcept |
Called before processing starts. More... | |
template<typename ProcessContext > | |
void | process (const ProcessContext &context) noexcept |
Processes the input and output buffers supplied in the processing context. More... | |
template<typename SampleType > | |
SampleType JUCE_VECTOR_CALLTYPE | processSample (SampleType s) noexcept |
Returns the result of processing a single sample. More... | |
void | reset () noexcept |
Resets the internal state of the gain. More... | |
void | setGainDecibels (FloatType newGainDecibels) noexcept |
Applies a new gain as a decibel value. More... | |
void | setGainLinear (FloatType newGain) noexcept |
Applies a new gain as a linear value. More... | |
void | setRampDurationSeconds (double newDurationSeconds) noexcept |
Sets the length of the ramp used for smoothing gain changes. More... | |
Private Attributes | |
LinearSmoothedValue< FloatType > | gain |
double | rampDurationSeconds = 0 |
double | sampleRate = 0 |
Applies a gain to audio samples as single samples or AudioBlocks.
{DSP}
|
inlinenoexcept |
|
inlinenoexcept |
Returns the current gain in decibels.
References juce::dsp::Gain< FloatType >::getGainLinear().
|
inlinenoexcept |
Returns the current gain as a linear value.
References juce::dsp::Gain< FloatType >::gain.
Referenced by juce::dsp::Gain< FloatType >::getGainDecibels().
|
inlinenoexcept |
Returns the ramp duration in seconds.
References juce::dsp::Gain< FloatType >::rampDurationSeconds.
|
inlinenoexcept |
Returns true if the current value is currently being interpolated.
References juce::dsp::Gain< FloatType >::gain.
|
inlinenoexcept |
Called before processing starts.
References juce::dsp::Gain< FloatType >::reset(), and juce::dsp::Gain< FloatType >::sampleRate.
|
inlinenoexcept |
Processes the input and output buffers supplied in the processing context.
References juce::dsp::Gain< FloatType >::gain, jassert, and juce::FloatVectorOperations::multiply().
|
inlinenoexcept |
Returns the result of processing a single sample.
References juce::dsp::Gain< FloatType >::gain.
|
inlinenoexcept |
Resets the internal state of the gain.
References juce::dsp::Gain< FloatType >::gain, juce::dsp::Gain< FloatType >::rampDurationSeconds, and juce::dsp::Gain< FloatType >::sampleRate.
Referenced by juce::dsp::Gain< FloatType >::prepare(), and juce::dsp::Gain< FloatType >::setRampDurationSeconds().
|
inlinenoexcept |
Applies a new gain as a decibel value.
References juce::dsp::Gain< FloatType >::setGainLinear().
|
inlinenoexcept |
Applies a new gain as a linear value.
References juce::dsp::Gain< FloatType >::gain.
Referenced by juce::dsp::Gain< FloatType >::setGainDecibels().
|
inlinenoexcept |
Sets the length of the ramp used for smoothing gain changes.
References juce::dsp::Gain< FloatType >::rampDurationSeconds, and juce::dsp::Gain< FloatType >::reset().
|
private |
|
private |
|
private |
Referenced by juce::dsp::Gain< FloatType >::prepare(), and juce::dsp::Gain< FloatType >::reset().