Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
switchboard::AudioGraph Class Reference

Manages a graph of AudioNode instances. More...

#include <AudioGraph.hpp>

Public Member Functions

 WASM_EXPORT (AudioGraph)
 
WASM AudioGraph (const uint maxNumberOfChannels=constants::STEREO, const uint maxNumberOfFrames=constants::MAX_NUMBER_OF_FRAMES)
 Creates an AudioGraph.
 
WASM ~AudioGraph ()
 AudioGraph destructor.
 
WASM const AudioSourceNodegetInputNode () const
 Returns the input node of the audio graph.
 
WASM const AudioSinkNodegetOutputNode () const
 Returns the output node of the audio graph.
 
WASM bool addNode (AudioNode &audioNode)
 Adds a node to the audio graph.
 
WASM bool removeNode (AudioNode &audioNode)
 Removes a node from the audio graph.
 
WASM bool connect (const AudioSourceNode &srcNode, const AudioProcessorNode &dstNode)
 Connects a source node to a processor node.
 
WASM bool connect (const AudioSourceNode &srcNode, const AudioSinkNode &dstNode)
 Connects a source node to a sink node.
 
WASM bool connect (const AudioProcessorNode &srcNode, const AudioProcessorNode &dstNode)
 Connects a processor node to another processor node.
 
WASM bool connect (const AudioProcessorNode &srcNode, const AudioSinkNode &dstNode)
 Connects a processor node to a sink node.
 
WASM bool start ()
 Starts the audio graph.
 
WASM void stop ()
 Stops the audio graph.
 
WASM bool process (AudioBusList &inAudioBuses, AudioBusList &outAudioBuses)
 The real-time audio process function of the audio graph.
 

Public Attributes

const uint maxNumberOfChannels
 Maximum number of channels that is supported by the audio graph.
 
const uint maxNumberOfFrames
 Maximum number of frames that is supported by the audio graph.
 

Detailed Description

Manages a graph of AudioNode instances.

AudioGraph class.

This class can be used to easily put together complicated audio pipelines by adding and then connecting AudioNode instances together.

Constructor & Destructor Documentation

◆ AudioGraph()

switchboard::AudioGraph::AudioGraph ( const uint  maxNumberOfChannels = constants::STEREO,
const uint  maxNumberOfFrames = constants::MAX_NUMBER_OF_FRAMES 
)

Creates an AudioGraph.

Parameters
maxNumberOfChannelsMaximum number of channels that is supported by the audio graph.
maxNumberOfFramesMaximum number of frames that is supported by the audio graph.

Member Function Documentation

◆ addNode()

bool switchboard::AudioGraph::addNode ( AudioNode audioNode)

Adds a node to the audio graph.

Parameters
audioNodeThe node to be added.
Returns
True if the node was successfully added, false otherwise.

◆ connect() [1/4]

bool switchboard::AudioGraph::connect ( const AudioProcessorNode srcNode,
const AudioProcessorNode dstNode 
)

Connects a processor node to another processor node.

Parameters
srcNodeThe source processor node.
dstNodeThe destination processor node.
Returns
True if the nodes were successfully connected, false otherwise.

◆ connect() [2/4]

bool switchboard::AudioGraph::connect ( const AudioProcessorNode srcNode,
const AudioSinkNode dstNode 
)

Connects a processor node to a sink node.

Parameters
srcNodeThe processor node.
dstNodeThe sink node.
Returns
True if the nodes were successfully connected, false otherwise.

◆ connect() [3/4]

bool switchboard::AudioGraph::connect ( const AudioSourceNode srcNode,
const AudioProcessorNode dstNode 
)

Connects a source node to a processor node.

Parameters
srcNodeThe source node.
dstNodeThe processor node.
Returns
True if the nodes were successfully connected, false otherwise.

◆ connect() [4/4]

bool switchboard::AudioGraph::connect ( const AudioSourceNode srcNode,
const AudioSinkNode dstNode 
)

Connects a source node to a sink node.

Parameters
srcNodeThe source node.
dstNodeThe sink node.
Returns
True if the nodes were successfully connected, false otherwise.

◆ getInputNode()

const AudioSourceNode & switchboard::AudioGraph::getInputNode ( ) const

Returns the input node of the audio graph.

Returns
The input node.

◆ getOutputNode()

const AudioSinkNode & switchboard::AudioGraph::getOutputNode ( ) const

Returns the output node of the audio graph.

Returns
The output node.

◆ process()

WASM bool switchboard::AudioGraph::process ( AudioBusList inAudioBuses,
AudioBusList outAudioBuses 
)

The real-time audio process function of the audio graph.

Parameters
inAudioBusesThe input audio buses.
outAudioBusesThe output audio buses.
Returns
True if the process call was successful, false otherwise.

◆ removeNode()

bool switchboard::AudioGraph::removeNode ( AudioNode audioNode)

Removes a node from the audio graph.

Parameters
audioNodeThe node to be removed.
Returns
True if the node was successfully removed, false otherwise.

◆ start()

WASM bool switchboard::AudioGraph::start ( )

Starts the audio graph.

Returns
True if the audio graph was started successfully, false otherwise.

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