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

## Detailed Description

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

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

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

- juce_dsp/widgets/juce_Gain.h

## Public Member Functions

| Gain () noexcept=default
void | setGainLinear (FloatType newGain) noexcept
| Applies a new gain as a linear value.
void | setGainDecibels (FloatType newGainDecibels) noexcept
| Applies a new gain as a decibel value.
FloatType | getGainLinear () const noexcept
| Returns the current gain as a linear value.
FloatType | getGainDecibels () const noexcept
| Returns the current gain in decibels.
void | setRampDurationSeconds (double newDurationSeconds) noexcept
| Sets the length of the ramp used for smoothing gain changes.
double | getRampDurationSeconds () const noexcept
| Returns the ramp duration in seconds.
bool | isSmoothing () const noexcept
| Returns true if the current value is currently being interpolated.
void | prepare (const ProcessSpec &spec) noexcept
| Called before processing starts.
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.
template<typename ProcessContext>
void | process (const ProcessContext &context) noexcept
| Processes the input and output buffers supplied in the processing context.

## Constructors and Destructors

## Gain()

template<typename FloatType>

juce::dsp::Gain< FloatType >::Gain | ( |  | ) |

default noexcept

## Member Functions

## setGainLinear()

template<typename FloatType>

void juce::dsp::Gain< FloatType >::setGainLinear | ( | FloatType | newGain | ) |

inline noexcept

Applies a new gain as a linear value.

References setGainLinear().

Referenced by setGainDecibels(), and setGainLinear().

## setGainDecibels()

template<typename FloatType>

void juce::dsp::Gain< FloatType >::setGainDecibels | ( | FloatType | newGainDecibels | ) |

inline noexcept

Applies a new gain as a decibel value.

References juce::Decibels::decibelsToGain(), and setGainLinear().

## getGainLinear()

template<typename FloatType>

FloatType juce::dsp::Gain< FloatType >::getGainLinear | ( |  | ) | const

inline noexcept

Returns the current gain as a linear value.

Referenced by getGainDecibels().

## getGainDecibels()

template<typename FloatType>

FloatType juce::dsp::Gain< FloatType >::getGainDecibels | ( |  | ) | const

inline noexcept

Returns the current gain in decibels.

References juce::Decibels::gainToDecibels(), and getGainLinear().

## setRampDurationSeconds()

template<typename FloatType>

void juce::dsp::Gain< FloatType >::setRampDurationSeconds | ( | double | newDurationSeconds | ) |

inline noexcept

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

References juce::approximatelyEqual(), and reset().

## getRampDurationSeconds()

template<typename FloatType>

double juce::dsp::Gain< FloatType >::getRampDurationSeconds | ( |  | ) | const

inline noexcept

Returns the ramp duration in seconds.

## isSmoothing()

template<typename FloatType>

bool juce::dsp::Gain< FloatType >::isSmoothing | ( |  | ) | const

inline noexcept

Returns true if the current value is currently being interpolated.

## prepare()

template<typename FloatType>

void juce::dsp::Gain< FloatType >::prepare | ( | const ProcessSpec & | spec | ) |

inline noexcept

Called before processing starts.

References reset().

## reset()

template<typename FloatType>

void juce::dsp::Gain< FloatType >::reset | ( |  | ) |

inline noexcept

Resets the internal state of the gain.

Referenced by prepare(), and setRampDurationSeconds().

## processSample()

template<typename FloatType>
template<typename SampleType>

SampleType JUCE_VECTOR_CALLTYPE juce::dsp::Gain< FloatType >::processSample | ( | SampleType | s | ) |

inline noexcept

Returns the result of processing a single sample.

References JUCE_VECTOR_CALLTYPE.

## process()

template<typename FloatType>
template<typename ProcessContext>

void juce::dsp::Gain< FloatType >::process | ( | const ProcessContext & | context | ) |

inline noexcept

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

References jassert, JUCE_BEGIN_IGNORE_WARNINGS_MSVC, and JUCE_END_IGNORE_WARNINGS_MSVC.

### Purchase

Get JUCE

### Discover

What's New in JUCE Features

### Learn

Documentaion Tutorials Made with JUCE Resources

### Support

JUCE Forum Newsletter Archive

### About

Contact Us JUCE Legal JUCE Licensing FAQ

### Events

Audio Developer Conference
© Raw Material Software Limited