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.
|
inlinenoexcept |
Returns the current gain in decibels.
References Gain< FloatType >::getGainLinear().
|
inlinenoexcept |
Returns the current gain as a linear value.
References Gain< FloatType >::gain.
Referenced by Gain< FloatType >::getGainDecibels().
|
inlinenoexcept |
Returns the ramp duration in seconds.
References Gain< FloatType >::rampDurationSeconds.
|
inlinenoexcept |
Returns true if the current value is currently being interpolated.
References Gain< FloatType >::gain.
|
inlinenoexcept |
Called before processing starts.
References Gain< FloatType >::reset(), and Gain< FloatType >::sampleRate.
|
inlinenoexcept |
Processes the input and output buffers supplied in the processing context.
References Gain< FloatType >::gain, jassert, and FloatVectorOperations::multiply().
|
inlinenoexcept |
Returns the result of processing a single sample.
References Gain< FloatType >::gain.
|
inlinenoexcept |
Resets the internal state of the gain.
References Gain< FloatType >::gain, Gain< FloatType >::rampDurationSeconds, and Gain< FloatType >::sampleRate.
Referenced by Gain< FloatType >::prepare(), and Gain< FloatType >::setRampDurationSeconds().
|
inlinenoexcept |
Applies a new gain as a decibel value.
References Gain< FloatType >::setGainLinear().
|
inlinenoexcept |
Applies a new gain as a linear value.
References Gain< FloatType >::gain.
Referenced by Gain< FloatType >::setGainDecibels().
|
inlinenoexcept |
Sets the length of the ramp used for smoothing gain changes.
References Gain< FloatType >::rampDurationSeconds, and Gain< FloatType >::reset().
|
private |
|
private |
|
private |
Referenced by Gain< FloatType >::prepare(), and Gain< FloatType >::reset().