Applies a gain to audio samples as single samples or AudioBlocks. More...
#include <juce_Gain.h>
Public Member Functions | |
Gain () noexcept=default | |
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 | |
SmoothedValue< FloatType > | gain |
double | rampDurationSeconds = 0 |
double | sampleRate = 0 |
Applies a gain to audio samples as single samples or AudioBlocks.
@tags{DSP}
|
defaultnoexcept |
|
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, and juce::SmoothedValueBase< SmoothedValueType >::getTargetValue().
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, and juce::SmoothedValueBase< SmoothedValueType >::isSmoothing().
|
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::gl::dst, juce::dsp::Gain< FloatType >::gain, juce::SmoothedValue< FloatType, SmoothingType >::getNextValue(), jassert, JUCE_BEGIN_IGNORE_WARNINGS_MSVC, JUCE_END_IGNORE_WARNINGS_MSVC, juce::gl::len, juce::SmoothedValue< FloatType, SmoothingType >::skip(), and juce::gl::src.
|
inlinenoexcept |
Returns the result of processing a single sample.
References juce::dsp::Gain< FloatType >::gain, juce::SmoothedValue< FloatType, SmoothingType >::getNextValue(), and juce::gl::s.
|
inlinenoexcept |
Resets the internal state of the gain.
References juce::dsp::Gain< FloatType >::gain, juce::dsp::Gain< FloatType >::rampDurationSeconds, juce::SmoothedValue< FloatType, SmoothingType >::reset(), 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, and juce::SmoothedValue< FloatType, SmoothingType >::setTargetValue().
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().