LMMS
Loading...
Searching...
No Matches
juce::dsp::Gain< FloatType > Class Template Reference

#include <juce_Gain.h>

Public Member Functions

 Gain () noexcept=default
void setGainLinear (FloatType newGain) noexcept
void setGainDecibels (FloatType newGainDecibels) noexcept
FloatType getGainLinear () const noexcept
FloatType getGainDecibels () const noexcept
void setRampDurationSeconds (double newDurationSeconds) noexcept
double getRampDurationSeconds () const noexcept
bool isSmoothing () const noexcept
void prepare (const ProcessSpec &spec) noexcept
void reset () noexcept
template<typename SampleType>
SampleType JUCE_VECTOR_CALLTYPE processSample (SampleType s) noexcept
template<typename ProcessContext>
void process (const ProcessContext &context) noexcept

Private Attributes

SmoothedValue< FloatType > gain
double sampleRate = 0
double rampDurationSeconds = 0

Detailed Description

template<typename FloatType>
class juce::dsp::Gain< FloatType >

Applies a gain to audio samples as single samples or AudioBlocks.

@tags{DSP}

Constructor & Destructor Documentation

◆ Gain()

template<typename FloatType>
juce::dsp::Gain< FloatType >::Gain ( )
defaultnoexcept

Member Function Documentation

◆ getGainDecibels()

template<typename FloatType>
FloatType juce::dsp::Gain< FloatType >::getGainDecibels ( ) const
inlinenoexcept

Returns the current gain in decibels.

◆ getGainLinear()

template<typename FloatType>
FloatType juce::dsp::Gain< FloatType >::getGainLinear ( ) const
inlinenoexcept

Returns the current gain as a linear value.

◆ getRampDurationSeconds()

template<typename FloatType>
double juce::dsp::Gain< FloatType >::getRampDurationSeconds ( ) const
inlinenoexcept

Returns the ramp duration in seconds.

◆ isSmoothing()

template<typename FloatType>
bool juce::dsp::Gain< FloatType >::isSmoothing ( ) const
inlinenoexcept

Returns true if the current value is currently being interpolated.

◆ prepare()

template<typename FloatType>
void juce::dsp::Gain< FloatType >::prepare ( const ProcessSpec & spec)
inlinenoexcept

Called before processing starts.

◆ process()

template<typename FloatType>
template<typename ProcessContext>
void juce::dsp::Gain< FloatType >::process ( const ProcessContext & context)
inlinenoexcept

Processes the input and output buffers supplied in the processing context.

◆ processSample()

template<typename FloatType>
template<typename SampleType>
SampleType JUCE_VECTOR_CALLTYPE juce::dsp::Gain< FloatType >::processSample ( SampleType s)
inlinenoexcept

Returns the result of processing a single sample.

◆ reset()

template<typename FloatType>
void juce::dsp::Gain< FloatType >::reset ( )
inlinenoexcept

Resets the internal state of the gain

◆ setGainDecibels()

template<typename FloatType>
void juce::dsp::Gain< FloatType >::setGainDecibels ( FloatType newGainDecibels)
inlinenoexcept

Applies a new gain as a decibel value.

◆ setGainLinear()

template<typename FloatType>
void juce::dsp::Gain< FloatType >::setGainLinear ( FloatType newGain)
inlinenoexcept

Applies a new gain as a linear value.

◆ setRampDurationSeconds()

template<typename FloatType>
void juce::dsp::Gain< FloatType >::setRampDurationSeconds ( double newDurationSeconds)
inlinenoexcept

Sets the length of the ramp used for smoothing gain changes.

Member Data Documentation

◆ gain

template<typename FloatType>
SmoothedValue<FloatType> juce::dsp::Gain< FloatType >::gain
private

◆ rampDurationSeconds

template<typename FloatType>
double juce::dsp::Gain< FloatType >::rampDurationSeconds = 0
private

◆ sampleRate

template<typename FloatType>
double juce::dsp::Gain< FloatType >::sampleRate = 0
private

The documentation for this class was generated from the following file: