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

OpenShot Audio Library | OpenShotAudio 0.3.0

Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Attributes | List of all members
juce::SmoothedValueBase< SmoothedValueType > Class Template Reference

`#include <juce_SmoothedValue.h>`

Inheritance diagram for juce::SmoothedValueBase< SmoothedValueType >:

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

## ◆ ~SmoothedValueBase()

template<typename SmoothedValueType >

virtual juce::SmoothedValueBase< SmoothedValueType >::~SmoothedValueBase | ( |  | ) |
| inlinevirtual

Definition at line 61 of file juce_SmoothedValue.h.

## 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 126 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 89 of file juce_SmoothedValue.h.

Referenced by juce::dsp::Convolution::Pimpl::processSamples().

## ◆ 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 110 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 68 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 72 of file juce_SmoothedValue.h.

Referenced by juce::dsp::Oscillator< SampleType >::getFrequency().

## ◆ isSmoothing()

template<typename SmoothedValueType >

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

Returns true if the current value is currently being interpolated.

Definition at line 65 of file juce_SmoothedValue.h.

Referenced by juce::SmoothedValueBase< SmoothedValueType >::applyGain(), juce::SmoothedValue< FloatType, SmoothingType >::getNextValue(), and juce::dsp::Oscillator< SampleType >::process().

## ◆ 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 77 of file juce_SmoothedValue.h.

Referenced by juce::SmoothedValue< FloatType, SmoothingType >::reset(), juce::dsp::Oscillator< SampleType >::setFrequency(), juce::SmoothedValue< FloatType, SmoothingType >::setTargetValue(), and juce::SmoothedValue< FloatType, SmoothingType >::skip().

## Member Data Documentation

## ◆ countdown

template<typename SmoothedValueType >

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

Definition at line 167 of file juce_SmoothedValue.h.

## ◆ currentValue

template<typename SmoothedValueType >

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

Definition at line 165 of file juce_SmoothedValue.h.

## ◆ target

template<typename SmoothedValueType >

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

Definition at line 166 of file juce_SmoothedValue.h.

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

- juce_SmoothedValue.h