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

Holds a list of AudioBus instances and allocates memory on the heap. More...

#include <AudioBusVector.hpp>

Inheritance diagram for switchboard::AudioBusVector:
switchboard::AudioBusList

Public Member Functions

WASM AudioBusVector (const uint numberOfBuses)
 Creates an AudioBusVector instance.
 
 AudioBusVector (AudioBus &audioBus)
 Creates an AudioBusVector instance with a single audio bus.
 
 AudioBusVector (AudioBuffer< float > &buffer)
 Creates an AudioBusVector instance with a single audio bus from an audio buffer.
 
WASM uint getNumberOfBuses () const override
 Gets the number of audio buses.
 
WASM AudioBusgetBus (const uint busIndex) const override
 Gets an audio bus by its index.
 
AudioBusFormatListgetFormat () override
 Gets the formats of the audio buses.
 
- Public Member Functions inherited from switchboard::AudioBusList
 AudioBusList ()=default
 Default constructor for AudioBusList.
 
virtual ~AudioBusList ()=default
 Default destructor for AudioBusList.
 
void copyFrom (const AudioBusList &srcAudioBusList) const
 Copies another AudioBusList instance.
 
void clear () const
 Sets the content of all audio buses to zero.
 
 AudioBusList (const AudioBusList &)=delete
 
AudioBusListoperator= (const AudioBusList &)=delete
 

Detailed Description

Holds a list of AudioBus instances and allocates memory on the heap.

AudioBusVector class.

Constructor & Destructor Documentation

◆ AudioBusVector() [1/3]

switchboard::AudioBusVector::AudioBusVector ( const uint numberOfBuses)

Creates an AudioBusVector instance.

Allocates enough memory on the heap to hold the AudioBus instances.

Parameters
numberOfBusesThe number of audio buses.

◆ AudioBusVector() [2/3]

switchboard::AudioBusVector::AudioBusVector ( AudioBus & audioBus)

Creates an AudioBusVector instance with a single audio bus.

Allocates memory on the heap for one AudioBus instance.

Parameters
audioBusThe audio bus.

◆ AudioBusVector() [3/3]

switchboard::AudioBusVector::AudioBusVector ( AudioBuffer< float > & buffer)

Creates an AudioBusVector instance with a single audio bus from an audio buffer.

Allocates memory on the heap.

Parameters
bufferThe audio buffer for the single audio bus.

Member Function Documentation

◆ getBus()

AudioBus & switchboard::AudioBusVector::getBus ( const uint busIndex) const
overridevirtual

Gets an audio bus by its index.

Parameters
busIndexThe index of the audio bus.
Returns
The AudioBus instance.

Implements switchboard::AudioBusList.

◆ getFormat()

AudioBusFormatList & switchboard::AudioBusVector::getFormat ( )
overridevirtual

Gets the formats of the audio buses.

Returns
An AudioBusFormatList instance that describes the formats of the audio buses.

Implements switchboard::AudioBusList.

◆ getNumberOfBuses()

uint switchboard::AudioBusVector::getNumberOfBuses ( ) const
overridevirtual

Gets the number of audio buses.

Returns
The number of audio buses.

Implements switchboard::AudioBusList.