sfFDN
Loading...
Searching...
No Matches
sfFDN::ParallelGains Class Reference

A parallel gains processor. More...

#include <parallel_gains.h>

Inheritance diagram for sfFDN::ParallelGains:
[legend]
Collaboration diagram for sfFDN::ParallelGains:
[legend]

Public Member Functions

 ParallelGains (ParallelGainsMode mode)
 Constructs a ParallelGains processor.
 
 ParallelGains (const ParallelGainsOptions &options)
 Constructs a ParallelGains processor.
 
 ParallelGains (ParallelGainsMode mode, std::span< const float > gains)
 Constructs a ParallelGains processor.
 
void SetMode (ParallelGainsMode mode)
 Sets the processing mode.
 
void SetGains (std::span< const float > gains)
 Sets the gains for each channel.
 
void GetGains (std::span< float > gains) const
 Gets the gains for each channel.
 
void Process (const AudioBuffer &input, AudioBuffer &output) noexcept override
 Processes the audio buffer.
 
uint32_t InputChannelCount () const override
 Gets the number of input channels supported.
 
uint32_t OutputChannelCount () const override
 Gets the number of output channels supported.
 
void Clear () override
 Clears the internal state of the processor.
 
std::unique_ptr< AudioProcessorClone () const override
 Creates a copy of the ParallelGains processor.
 
- Public Member Functions inherited from sfFDN::AudioProcessor

Detailed Description

A parallel gains processor.

Supports three modes:

  • Split: Single input channel, multiple output channels. Each output channel is equal to the input channel scaled by a gain.
  • Merge: Multiple input channels, single output channel. The output channel is equal to the sum of all input channels scaled by their respective gains.
  • Parallel: Multiple input channels, multiple output channels. Each output channel is equal to the corresponding input channel scaled by a gain.

Constructor & Destructor Documentation

◆ ParallelGains() [1/3]

sfFDN::ParallelGains::ParallelGains ( ParallelGainsMode mode)

Constructs a ParallelGains processor.

Parameters
modeThe processing mode to use.

◆ ParallelGains() [2/3]

sfFDN::ParallelGains::ParallelGains ( const ParallelGainsOptions & options)

Constructs a ParallelGains processor.

Parameters
optionsThe options for the processor.

◆ ParallelGains() [3/3]

sfFDN::ParallelGains::ParallelGains ( ParallelGainsMode mode,
std::span< const float > gains )

Constructs a ParallelGains processor.

Parameters
modeThe processing mode to use.
gainsA span of gains to apply to each channel.

Member Function Documentation

◆ Clear()

void sfFDN::ParallelGains::Clear ( )
overridevirtual

Clears the internal state of the processor.

This function does nothing as there is no internal state to clear.

Implements sfFDN::AudioProcessor.

◆ Clone()

std::unique_ptr< AudioProcessor > sfFDN::ParallelGains::Clone ( ) const
overridevirtual

Creates a copy of the ParallelGains processor.

Returns
A unique pointer to the cloned ParallelGains processor.

Implements sfFDN::AudioProcessor.

◆ GetGains()

void sfFDN::ParallelGains::GetGains ( std::span< float > gains) const

Gets the gains for each channel.

Parameters
gainsA span to store the gains. The size of the span must be equal to the number of gains set in SetGains().

◆ InputChannelCount()

uint32_t sfFDN::ParallelGains::InputChannelCount ( ) const
overridevirtual

Gets the number of input channels supported.

Note
For ParallelGainsMode::Split, this is always 1.

Implements sfFDN::AudioProcessor.

◆ OutputChannelCount()

uint32_t sfFDN::ParallelGains::OutputChannelCount ( ) const
overridevirtual

Gets the number of output channels supported.

Note
For ParallelGainsMode::Merge, this is always 1.

Implements sfFDN::AudioProcessor.

◆ Process()

void sfFDN::ParallelGains::Process ( const AudioBuffer & input,
AudioBuffer & output )
overridevirtualnoexcept

Processes the audio buffer.

Parameters
inputThe input audio buffer.
outputThe output audio buffer. The input and output buffers must have the same number of samples. For ParallelGainsMode::Split, the input buffer must have 1 channels and the output buffer must have OutputChannelCount() channels. For ParallelGainsMode::Merge, the input buffer must have InputChannelCount() channels and the output buffer must have 1 channels. For ParallelGainsMode::Parallel, the input and output buffers must have the same number of channels equal to InputChannelCount() and OutputChannelCount().

Implements sfFDN::AudioProcessor.

◆ SetGains()

void sfFDN::ParallelGains::SetGains ( std::span< const float > gains)

Sets the gains for each channel.

Parameters
gainsA span of gains to apply to each channel. The size of the span must be equal to InputChannelCount() for ParallelGainsMode::Merge. The size of the span must be equal to OutputChannelCount() for ParallelGainsMode::Split. The size of the span must be equal to InputChannelCount() and OutputChannelCount() for ParallelGainsMode::Parallel.

◆ SetMode()

void sfFDN::ParallelGains::SetMode ( ParallelGainsMode mode)

Sets the processing mode.

Parameters
modeThe processing mode to use.

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