Switchboard SDK
Loading...
Searching...
No Matches
switchboard::SingleBusAudioSinkNode Class Referenceabstract

Provides a simplified interface for AudioSinkNode which is useful when only a single bus is supported by the audio sink. More...

#include <SingleBusAudioSinkNode.hpp>

Inheritance diagram for switchboard::SingleBusAudioSinkNode:
switchboard::AudioSinkNode switchboard::AudioNode switchboard::ClippingDetectorNode switchboard::PipeSinkNode switchboard::RecorderNode switchboard::ResampledSinkNode switchboard::VUMeterNode switchboard::VoiceActivityDetectorNode

Public Member Functions

virtual bool setBusFormat (AudioBusFormat &busFormat)=0
 Sets bus format.
 
virtual bool consume (AudioBus &bus)=0
 Consumes audio data from the given bus.
 
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::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 &name)
 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 Attributes inherited from switchboard::AudioNode
std::string type
 
std::vector< std::unique_ptr< Parameter > > parameters
 

Detailed Description

Provides a simplified interface for AudioSinkNode which is useful when only a single bus is supported by the audio sink.

SingleBusAudioSinkNode class.

Member Function Documentation

◆ consume() [1/2]

virtual bool switchboard::SingleBusAudioSinkNode::consume ( AudioBus & bus)
pure virtual

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.

Implemented in switchboard::ClippingDetectorNode, switchboard::PipeSinkNode, switchboard::RecorderNode, switchboard::ResampledSinkNode, switchboard::VoiceActivityDetectorNode, and switchboard::VUMeterNode.

◆ consume() [2/2]

bool switchboard::SingleBusAudioSinkNode::consume ( AudioBusList & buses)
overridevirtual

Consumes audio data from the given buses.

Should be overridden by subclasses.

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

Implements switchboard::AudioSinkNode.

◆ setBusFormat()

virtual bool switchboard::SingleBusAudioSinkNode::setBusFormat ( AudioBusFormat & busFormat)
pure virtual

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.

Implemented in switchboard::ClippingDetectorNode, switchboard::PipeSinkNode, switchboard::RecorderNode, switchboard::ResampledSinkNode, switchboard::VoiceActivityDetectorNode, and switchboard::VUMeterNode.

◆ setBusFormats()

bool switchboard::SingleBusAudioSinkNode::setBusFormats ( AudioBusFormatList & busFormats)
overridevirtual

Sets bus formats.

Should be overridden by subclasses.

Parameters
busFormatsThe bus formats to set.
Returns
True if the bus formats were set successfully, false otherwise.

Implements switchboard::AudioSinkNode.

◆ setNumberOfBuses()

bool switchboard::SingleBusAudioSinkNode::setNumberOfBuses ( const uint numberOfBuses)
overridevirtual

Sets number of buses.

Should be overridden by subclasses.

Parameters
numberOfBusesThe number of buses to set.
Returns
True if the number of buses was set successfully, false otherwise.

Implements switchboard::AudioSinkNode.