JUCE  v6.1.6 (6.0.8-1114)
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::SmoothedValueBase< SmoothedValueType > Class Template Reference

A base class for the smoothed value classes. More...

#include <juce_SmoothedValue.h>

Inheritance diagram for juce::SmoothedValueBase< SmoothedValueType >:
Collaboration diagram for juce::SmoothedValueBase< SmoothedValueType >:

Classes

struct  FloatTypeHelper
 
struct  FloatTypeHelper< SmoothedValueClass< FloatType > >
 
struct  FloatTypeHelper< SmoothedValueClass< FloatType, SmoothingType > >
 

Public Types

using FloatType = typename FloatTypeHelper< SmoothedValueType >::Type
 

Public Member Functions

 SmoothedValueBase ()=default
 Constructor. More...
 
void applyGain (AudioBuffer< FloatType > &buffer, int numSamples) noexcept
 Applies a smoothed gain to a buffer. More...
 
void applyGain (FloatType *samples, int numSamples) noexcept
 Applies a smoothed gain to a stream of samples S[i] *= gain. More...
 
void applyGain (FloatType *samplesOut, const FloatType *samplesIn, int numSamples) noexcept
 Computes output as a smoothed gain applied to a stream of samples. More...
 
FloatType getCurrentValue () const noexcept
 Returns the current value of the ramp. More...
 
FloatType getTargetValue () const noexcept
 Returns the target value towards which the smoothed value is currently moving. More...
 
bool isSmoothing () const noexcept
 Returns true if the current value is currently being interpolated. More...
 
void setCurrentAndTargetValue (FloatType newValue)
 Sets the current value and the target value. More...
 

Protected Attributes

int countdown = 0
 
FloatType currentValue = 0
 
FloatType target = currentValue
 

Private Member Functions

FloatType getNextSmoothedValue () noexcept
 

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.

@tags{Audio}

Member Typedef Documentation

◆ FloatType

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

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.

◆ 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
samplesPointer to a raw array of samples
numSamplesLength of array of samples

◆ 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
samplesOutA pointer to a raw array of output samples
samplesInA pointer to a raw array of input samples
numSamplesThe length of the array of samples

◆ getCurrentValue()

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

Returns the current value of the ramp.

◆ getNextSmoothedValue()

template<typename SmoothedValueType >
FloatType juce::SmoothedValueBase< SmoothedValueType >::getNextSmoothedValue ( )
inlineprivatenoexcept

◆ getTargetValue()

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

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

Referenced by juce::dsp::Bias< FloatType >::getBias(), juce::dsp::Oscillator< SampleType >::getFrequency(), and juce::dsp::Gain< FloatType >::getGainLinear().

◆ isSmoothing()

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

◆ setCurrentAndTargetValue()

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

Sets the current value and the target value.

Parameters
newValuethe new value to take

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

Member Data Documentation

◆ countdown

◆ currentValue

◆ target


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