OpenShot Audio Library | OpenShotAudio: juce::SmoothedValueBase< SmoothedValueType > Class Template Reference

OpenShot Audio Library | OpenShotAudio 1.0.0

Loading...
Searching...
No Matches
juce::SmoothedValueBase< SmoothedValueType > Class Template Reference

`#include <juce_SmoothedValue.h>`

## Public Types
using | FloatType = typename FloatTypeHelper<SmoothedValueType>::Type

## Public Member Functions
| SmoothedValueBase ()=default
bool | isSmoothing () const noexcept
FloatType | getCurrentValue () const noexcept
FloatType | getTargetValue () const noexcept
void | setCurrentAndTargetValue (FloatType newValue)
void | applyGain (FloatType *samples, int numSamples) noexcept
void | applyGain (FloatType *samplesOut, const FloatType *samplesIn, int numSamples) noexcept
void | applyGain (AudioBuffer< FloatType > &buffer, int numSamples) noexcept

## Protected Attributes
FloatType | currentValue = 0
FloatType | target = currentValue
int | countdown = 0

## Detailed Description

template<typename SmoothedValueType>
class juce::SmoothedValueBase< SmoothedValueType >

A base class for the smoothed value classes.

This class is used to provide common functionality to the SmoothedValue and dsp::LogRampedValue classes.

Definition at line 36 of file juce_SmoothedValue.h.

## Member Typedef Documentation

## ◆ FloatType

template<typename SmoothedValueType>

using juce::SmoothedValueBase< SmoothedValueType >::FloatType = typename FloatTypeHelper<SmoothedValueType>::Type

Definition at line 55 of file juce_SmoothedValue.h.

## Constructor & Destructor Documentation

## ◆ SmoothedValueBase()

template<typename SmoothedValueType>

juce::SmoothedValueBase< SmoothedValueType >::SmoothedValueBase | ( |  | ) |
| default

Constructor.

## Member Function Documentation

## ◆ applyGain() [1/3]

template<typename SmoothedValueType>

void juce::SmoothedValueBase< SmoothedValueType >::applyGain | ( | AudioBuffer< FloatType > & | buffer,
|  | int | numSamples )
| inlinenoexcept

Applies a smoothed gain to a buffer

Definition at line 124 of file juce_SmoothedValue.h.

## ◆ applyGain() [2/3]

template<typename SmoothedValueType>

void juce::SmoothedValueBase< SmoothedValueType >::applyGain | ( | FloatType * | samples,
|  | int | numSamples )
| inlinenoexcept

Applies a smoothed gain to a stream of samples S[i] *= gain

Parameters

  samples | Pointer to a raw array of samples
  numSamples | Length of array of samples

Definition at line 87 of file juce_SmoothedValue.h.

## ◆ applyGain() [3/3]

template<typename SmoothedValueType>

void juce::SmoothedValueBase< SmoothedValueType >::applyGain | ( | FloatType * | samplesOut,
|  | const FloatType * | samplesIn,
|  | int | numSamples )
| inlinenoexcept

Computes output as a smoothed gain applied to a stream of samples. Sout[i] = Sin[i] * gain

Parameters

  samplesOut | A pointer to a raw array of output samples
  samplesIn | A pointer to a raw array of input samples
  numSamples | The length of the array of samples

Definition at line 108 of file juce_SmoothedValue.h.

## ◆ getCurrentValue()

template<typename SmoothedValueType>

FloatType juce::SmoothedValueBase< SmoothedValueType >::getCurrentValue | ( |  | ) | const
| inlinenoexcept

Returns the current value of the ramp.

Definition at line 66 of file juce_SmoothedValue.h.

## ◆ getTargetValue()

template<typename SmoothedValueType>

FloatType juce::SmoothedValueBase< SmoothedValueType >::getTargetValue | ( |  | ) | const
| inlinenoexcept

Returns the target value towards which the smoothed value is currently moving.

Definition at line 70 of file juce_SmoothedValue.h.

## ◆ isSmoothing()

template<typename SmoothedValueType>

bool juce::SmoothedValueBase< SmoothedValueType >::isSmoothing | ( |  | ) | const
| inlinenoexcept

Returns true if the current value is currently being interpolated.

Definition at line 63 of file juce_SmoothedValue.h.

Referenced by applyGain(), applyGain(), and applyGain().

## ◆ setCurrentAndTargetValue()

template<typename SmoothedValueType>

void juce::SmoothedValueBase< SmoothedValueType >::setCurrentAndTargetValue | ( | FloatType | newValue | ) |
| inline

Sets the current value and the target value.

Parameters

  newValue | the new value to take

Definition at line 75 of file juce_SmoothedValue.h.

## Member Data Documentation

## ◆ countdown

template<typename SmoothedValueType>

int juce::SmoothedValueBase< SmoothedValueType >::countdown = 0
| protected

Definition at line 165 of file juce_SmoothedValue.h.

## ◆ currentValue

template<typename SmoothedValueType>

FloatType juce::SmoothedValueBase< SmoothedValueType >::currentValue = 0
| protected

Definition at line 163 of file juce_SmoothedValue.h.

## ◆ target

template<typename SmoothedValueType>

FloatType juce::SmoothedValueBase< SmoothedValueType >::target = currentValue
| protected

Definition at line 164 of file juce_SmoothedValue.h.

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

- juce_SmoothedValue.h