OpenShot Library | OpenShotAudio  0.2.2
juce::dsp::Gain< FloatType > Class Template Reference

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

#include <juce_Gain.h>

Public Member Functions

void setGainLinear (FloatType newGain) noexcept
 Applies a new gain as a linear value. More...
 
void setGainDecibels (FloatType newGainDecibels) noexcept
 Applies a new gain as a decibel value. More...
 
FloatType getGainLinear () const noexcept
 Returns the current gain as a linear value. More...
 
FloatType getGainDecibels () const noexcept
 Returns the current gain in decibels. More...
 
void setRampDurationSeconds (double newDurationSeconds) noexcept
 Sets the length of the ramp used for smoothing gain changes. 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...
 
void reset () noexcept
 Resets the internal state of the gain.
 
template<typename SampleType >
SampleType JUCE_VECTOR_CALLTYPE processSample (SampleType s) noexcept
 Returns the result of processing a single sample. More...
 
template<typename ProcessContext >
void process (const ProcessContext &context) noexcept
 Processes the input and output buffers supplied in the processing context. More...
 

Detailed Description

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

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

Definition at line 42 of file juce_Gain.h.

Member Function Documentation

◆ setGainLinear()

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

Applies a new gain as a linear value.

Definition at line 49 of file juce_Gain.h.

References juce::SmoothedValue< FloatType, SmoothingType >::setTargetValue().

Referenced by juce::dsp::Gain< FloatType >::setGainDecibels().

◆ setGainDecibels()

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

Applies a new gain as a decibel value.

Definition at line 52 of file juce_Gain.h.

References juce::dsp::Gain< FloatType >::setGainLinear().

◆ getGainLinear()

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

Returns the current gain as a linear value.

Definition at line 55 of file juce_Gain.h.

References juce::SmoothedValueBase< SmoothedValueType >::getTargetValue().

Referenced by juce::dsp::Gain< FloatType >::getGainDecibels().

◆ getGainDecibels()

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

Returns the current gain in decibels.

Definition at line 58 of file juce_Gain.h.

References juce::dsp::Gain< FloatType >::getGainLinear().

◆ setRampDurationSeconds()

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

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

Definition at line 61 of file juce_Gain.h.

References juce::dsp::Gain< FloatType >::reset().

◆ getRampDurationSeconds()

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

Returns the ramp duration in seconds.

Definition at line 71 of file juce_Gain.h.

◆ isSmoothing()

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

Returns true if the current value is currently being interpolated.

Definition at line 74 of file juce_Gain.h.

References juce::SmoothedValueBase< SmoothedValueType >::isSmoothing().

◆ prepare()

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

Called before processing starts.

Definition at line 78 of file juce_Gain.h.

References juce::dsp::Gain< FloatType >::reset().

◆ 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.

Definition at line 94 of file juce_Gain.h.

References juce::SmoothedValue< FloatType, SmoothingType >::getNextValue().

◆ 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.

Definition at line 101 of file juce_Gain.h.

References juce::SmoothedValue< FloatType, SmoothingType >::getNextValue(), juce::FloatVectorOperations::multiply(), and juce::SmoothedValue< FloatType, SmoothingType >::skip().


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