Switchboard SDK
Loading...
Searching...
No Matches
switchboard::DuckingManager Class Reference

Calculates and applies ducking based on configuration. More...

#include <DuckingManager.hpp>

Public Member Functions

 DuckingManager ()
 DuckingManager constructor.
 
 ~DuckingManager ()
 DuckingManager destructor.
 
uint getDuckingSignalCount () const
 Returns the number of ducking signals.
 
void setNumberOfDuckingSignals (const uint numberOfDuckingSignals)
 Sets the number of ducking signals.
 
void triggerDucking (const uint duckingSignalIndex=0)
 Triggers ducking for a ducking signal.
 
void process (const uint sampleRate, const uint numberOfFrames, float *musicAudioBuffer)
 Processes and applies ducking for the music audio buffer.
 
float getDuckingAmount (const uint duckingSignalIndex) const
 Gets the ducking amount for a ducking signal. Returned value is between 0 and 1.
 
void setDuckingAmount (const float newDuckingAmount, const uint duckingSignalIndex)
 Sets the ducking amount for a ducking signal. The provided value has to be between 0 and 1.
 
float getDuckReleaseAmount () const
 Returns the ducking release amount. When the ducking threshold is not exceeded, the ducking amount value will be increased by this value. Default value: 0.5 dB.
 
void setDuckReleaseAmount (const float newDuckReleaseAmount)
 Sets the ducking release amount. When the ducking threshold is not exceeded, the ducking amount value will be increased by this value. Default value: 0.5 dB.
 
float getDuckReleaseSeconds () const
 
void setDuckReleaseSeconds (const float duckReleaseSeconds)
 
float getNumSecondsToHoldDucking () const
 Returns the number of seconds to hold ducking value. When ducking stops being triggered, ducking will still be held for this many seconds. Default value: 2.0 secs.
 
void setNumSecondsToHoldDucking (const float numSecondsToHoldDucking)
 Sets the number of seconds to hold ducking value.
 
DuckingManagerDelegategetDelegate () const
 Gets the current ducking delegate. Can be null.
 
void setDelegate (DuckingManagerDelegate *delegate)
 Sets the ducking delegate.
 
DuckingCompressorgetCompressor () const
 Gets the compressor.
 
void setCompressor (DuckingCompressor *compressor)
 Sets the compressor.
 
std::map< std::string, std::string > getState ()
 Returns the internal state of the DuckingManager for diagnostics purposes.
 

Detailed Description

Calculates and applies ducking based on configuration.

DuckingManager class.

Member Function Documentation

◆ getCompressor()

DuckingCompressor * switchboard::DuckingManager::getCompressor ( ) const

Gets the compressor.

Returns
The compressor instance. Can be null.

◆ getDelegate()

DuckingManagerDelegate * switchboard::DuckingManager::getDelegate ( ) const

Gets the current ducking delegate. Can be null.

Returns
Pointer to the ducking delegate instance.

◆ getDuckingAmount()

float switchboard::DuckingManager::getDuckingAmount ( const uint duckingSignalIndex) const

Gets the ducking amount for a ducking signal. Returned value is between 0 and 1.

Parameters
duckingSignalIndexThe index of the ducking signal.
Returns
The ducking amount for the ducking signal in dBFS.

◆ getDuckingSignalCount()

uint switchboard::DuckingManager::getDuckingSignalCount ( ) const

Returns the number of ducking signals.

Returns
The number of ducking signals.

◆ getDuckReleaseAmount()

float switchboard::DuckingManager::getDuckReleaseAmount ( ) const

Returns the ducking release amount. When the ducking threshold is not exceeded, the ducking amount value will be increased by this value. Default value: 0.5 dB.

Returns
the ducking release amount.

◆ getNumSecondsToHoldDucking()

float switchboard::DuckingManager::getNumSecondsToHoldDucking ( ) const

Returns the number of seconds to hold ducking value. When ducking stops being triggered, ducking will still be held for this many seconds. Default value: 2.0 secs.

Returns
The number of seconds to hold ducking.

◆ getState()

std::map< std::string, std::string > switchboard::DuckingManager::getState ( )

Returns the internal state of the DuckingManager for diagnostics purposes.

Returns
The internal state.

◆ process()

void switchboard::DuckingManager::process ( const uint sampleRate,
const uint numberOfFrames,
float * musicAudioBuffer )

Processes and applies ducking for the music audio buffer.

Parameters
sampleRatethe sampleRate of the data to be ducked
numberOfFramesthe number of frames in each input buffer.
musicAudioBufferThe music audio buffer that will be ducked. Must be a stereo interleaved buffer. Can be nullptr if ducking is only used via the delegate.

◆ setCompressor()

void switchboard::DuckingManager::setCompressor ( DuckingCompressor * compressor)

Sets the compressor.

Parameters
compressorThe new compressor instance. Can be null.

◆ setDelegate()

void switchboard::DuckingManager::setDelegate ( DuckingManagerDelegate * delegate)

Sets the ducking delegate.

Parameters
delegateThe new ducking delegate instance. Can be null.

◆ setDuckingAmount()

void switchboard::DuckingManager::setDuckingAmount ( const float newDuckingAmount,
const uint duckingSignalIndex )

Sets the ducking amount for a ducking signal. The provided value has to be between 0 and 1.

Parameters
newDuckingAmountThe new amount.
duckingSignalIndexThe index of the ducking signal.

◆ setDuckReleaseAmount()

void switchboard::DuckingManager::setDuckReleaseAmount ( const float newDuckReleaseAmount)

Sets the ducking release amount. When the ducking threshold is not exceeded, the ducking amount value will be increased by this value. Default value: 0.5 dB.

Parameters
newDuckReleaseAmountThe new value.

◆ setNumberOfDuckingSignals()

void switchboard::DuckingManager::setNumberOfDuckingSignals ( const uint numberOfDuckingSignals)

Sets the number of ducking signals.

Parameters
numberOfDuckingSignalsThe new number of ducking signals.

◆ setNumSecondsToHoldDucking()

void switchboard::DuckingManager::setNumSecondsToHoldDucking ( const float numSecondsToHoldDucking)

Sets the number of seconds to hold ducking value.

Parameters
numSecondsToHoldDuckingThe new value.

◆ triggerDucking()

void switchboard::DuckingManager::triggerDucking ( const uint duckingSignalIndex = 0)

Triggers ducking for a ducking signal.

Parameters
duckingSignalIndexThe index of the ducking signal that is triggering ducking.