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

Creates AudioGraph instances. More...

#include <AudioGraphFactory.hpp>

Public Member Functions

 SB_WASM_EXPORT (AudioGraphFactory)
 

Static Public Member Functions

static void addNodeFactory (const std::shared_ptr< NodeFactory > nodeFactory)
 Registers a node factory that can create nodes for the audio graph.
 
static AudioGraphparseJSON (const std::string &config)
 Parses a JSON audio graph config and returns the creates AudioGraph.
 
static SB_WASM AudioGraphparseJSON (const char *config)
 Parses a JSON audio graph config and returns the creates AudioGraph.
 
static SB_WASM AudioGraphcreateGraph (const std::map< std::string, std::any > &config)
 Creates an audio graph from a map of parameters.
 

Detailed Description

Creates AudioGraph instances.

AudioGraphFactory class.

Member Function Documentation

◆ addNodeFactory()

void switchboard::AudioGraphFactory::addNodeFactory ( const std::shared_ptr< NodeFactory > nodeFactory)
static

Registers a node factory that can create nodes for the audio graph.

Parameters
nodeFactoryThe added NodeFactory.

◆ createGraph()

AudioGraph * switchboard::AudioGraphFactory::createGraph ( const std::map< std::string, std::any > & config)
static

Creates an audio graph from a map of parameters.

The returned audio graph instances need to be freed by the user of the AudioGraphFactory.

Parameters
configThe map of parameters.
Returns
The created AudioGraph instance, or nullptr if the audio graph could not be created.

◆ parseJSON() [1/2]

AudioGraph * switchboard::AudioGraphFactory::parseJSON ( const char * config)
static

Parses a JSON audio graph config and returns the creates AudioGraph.

The returned audio graph instances need to be freed by the user of the AudioGraphFactory.

Parameters
configThe JSON audio graph config.
Returns
The created AudioGraph instance, or nullptr if the audio graph could not be created.

◆ parseJSON() [2/2]

AudioGraph * switchboard::AudioGraphFactory::parseJSON ( const std::string & config)
static

Parses a JSON audio graph config and returns the creates AudioGraph.

The returned audio graph instances need to be freed by the user of the AudioGraphFactory.

Parameters
configThe JSON audio graph config.
Returns
The created AudioGraph instance, or nullptr if the audio graph could not be created.