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

Encapsulates a SingleBusAudioSinkNode and provides environment for it with specified sample rate. More...

#include <ResampledSinkNode.hpp>

Inheritance diagram for switchboard::ResampledSinkNode:
switchboard::SingleBusAudioSinkNode switchboard::AudioSinkNode switchboard::AudioNode

Public Member Functions

 ResampledSinkNode ()
 ResampledSinkNode constructor.
 
void setSinkNode (SingleBusAudioSinkNode *sinkNode)
 Sets the internal sink node for the ResampledSinkNode (the sample rate of the encapsulated sink node).
 
uint getInternalSampleRate () const
 Returns the internally set sample rate for the sink node.
 
void setInternalSampleRate (const uint internalSampleRate)
 Sets the internal sample rate for the encapsulated sink node (the sample rate of the encapsulated sink node).
 
bool setBusFormat (AudioBusFormat &busFormat) override
 Sets bus format.
 
bool consume (AudioBus &bus) override
 Consumes audio data from the given bus.
 
- Public Member Functions inherited from switchboard::SingleBusAudioSinkNode
bool setNumberOfBuses (const uint numberOfBuses) override
 Sets number of buses.
 
bool setBusFormats (AudioBusFormatList &busFormats) override
 Sets bus formats.
 
bool consume (AudioBusList &buses) override
 Consumes audio data from the given buses.
 
- Public Member Functions inherited from switchboard::AudioSinkNode
- Public Member Functions inherited from switchboard::AudioNode
 AudioNode ()
 AudioNode constructor.
 
virtual ~AudioNode ()=default
 AudioNode virtual destructor.
 
const std::string & getType () const
 Gets the type of the audio node.
 
virtual const std::string getDisplayName () const
 Gets the display name of the audio node.
 
virtual std::vector< std::unique_ptr< Parameter > > & getParameters ()
 Gets the parameters of the audio node.
 
virtual ParametergetParameter (const std::string &id)
 Gets the parameter with the given name.
 

Additional Inherited Members

- Public Attributes inherited from switchboard::AudioNode
std::string name
 The name of the audio node.
 
- Protected Member Functions inherited from switchboard::AudioNode
void initParameters (std::map< std::string, std::any > config)
 Initializes the node parameters from the given configuration values.
 
- Protected Attributes inherited from switchboard::AudioNode
std::string type
 
std::vector< std::unique_ptr< Parameter > > parameters
 

Detailed Description

Encapsulates a SingleBusAudioSinkNode and provides environment for it with specified sample rate.

ResampledSinkNode class.

Member Function Documentation

◆ consume()

bool switchboard::ResampledSinkNode::consume ( AudioBus & bus)
overridevirtual

Consumes audio data from the given bus.

Should be overridden by subclasses.

Parameters
busThe bus that contain the audio data.
Returns
True if audio was consumed successfully, false otherwise.

Implements switchboard::SingleBusAudioSinkNode.

◆ getInternalSampleRate()

uint switchboard::ResampledSinkNode::getInternalSampleRate ( ) const

Returns the internally set sample rate for the sink node.

Returns
The internal sample rate.

◆ setBusFormat()

bool switchboard::ResampledSinkNode::setBusFormat ( AudioBusFormat & busFormat)
overridevirtual

Sets bus format.

Should be overridden by subclasses.

Parameters
busFormatThe bus format to set.
Returns
True if the bus format was set successfully, false otherwise.

Implements switchboard::SingleBusAudioSinkNode.

◆ setInternalSampleRate()

void switchboard::ResampledSinkNode::setInternalSampleRate ( const uint internalSampleRate)

Sets the internal sample rate for the encapsulated sink node (the sample rate of the encapsulated sink node).

Parameters
internalSampleRateThe desired internal sample rate.

◆ setSinkNode()

void switchboard::ResampledSinkNode::setSinkNode ( SingleBusAudioSinkNode * sinkNode)

Sets the internal sink node for the ResampledSinkNode (the sample rate of the encapsulated sink node).

Parameters
sinkNodeThe encapsulated sink node.