Skip to content

Node

Base class for Amplimix pipeline nodes.

Detailed Description

This class presents the basic structure to create Amplimix pipeline nodes. Each Node of your pipelines must be derived from this class and implement the CreateInstance() method.

See also: NodeInstance

Public Functions

Type Name
virtual bool CanConsume () const = 0
Returns true if the node can consume audio data.
virtual bool CanProduce () const = 0
Returns true if the node can produce audio data.
virtual std::shared_ptr< NodeInstance > CreateInstance () const = 0
Creates a new instance of the node.
virtual AmSize GetMaxInputCount () const = 0
Returns the maximum number of input connections the node can have.
virtual AmSize GetMinInputCount () const = 0
Returns the minimum number of input connections the node can have.
const AmString & GetName () const
Returns the name of the node.
virtual AmSize GetParameterCount () const
Returns the number of parameters accepted by this node.
virtual AmReal32 GetParameterMax (AmSize index) const
Gets the maximum allowed value of the parameter at the given index.
virtual AmReal32 GetParameterMin (AmSize index) const
Gets the minimum allowed value of the parameter at the given index.
virtual AmString GetParameterName (AmSize index) const
Gets the name of the parameter at the given index.
virtual eParameterType GetParameterType (AmSize index) const
Gets the type of the parameter at the given index.
Node (AmString name)
Node constructor.
virtual ~Node ()
Node destructor.

Public Static Functions

Type Name
std::shared_ptr< NodeInstance > Construct (const AmString & name)
Creates a new instance of the node with the given name and returns its pointer.
std::shared_ptr< Node > Find (const AmString & name)
Look up a node by name.
const std::map< AmString, std::shared_ptr< Node > > & GetRegistry ()
Gets the list of registered nodes.
void LockRegistry ()
Locks the nodes' registry.
void Register (std::shared_ptr< Node > node)
Registers a new node.
void UnlockRegistry ()
Unlocks the nodes' registry.
void Unregister (std::shared_ptr< const Node > node)
Unregisters a node.

Protected Attributes

Type Name
AmString m_name
The name of this node.

Public Functions Documentation

CanConsume

Returns true if the node can consume audio data.

virtual bool Amplitude::Node::CanConsume () const = 0

Returns:

true if the node can consume audio data, false otherwise.

CanProduce

Returns true if the node can produce audio data.

virtual bool Amplitude::Node::CanProduce () const = 0

Returns:

true if the node can produce audio data, false otherwise.

CreateInstance

Creates a new instance of the node.

virtual std::shared_ptr< NodeInstance > Amplitude::Node::CreateInstance () const = 0

Returns:

A new instance of the node.

GetMaxInputCount

Returns the maximum number of input connections the node can have.

virtual AmSize Amplitude::Node::GetMaxInputCount () const = 0

Returns:

The maximum number of input connections the node can have.

GetMinInputCount

Returns the minimum number of input connections the node can have.

virtual AmSize Amplitude::Node::GetMinInputCount () const = 0

Returns:

The minimum number of input connections the node can have.

GetName

Returns the name of the node.

const AmString & Amplitude::Node::GetName () const
GetParameterCount

Returns the number of parameters accepted by this node.

virtual AmSize Amplitude::Node::GetParameterCount () const

Returns:

The number of parameters accepted by the node.

GetParameterMax

Gets the maximum allowed value of the parameter at the given index.

virtual AmReal32 Amplitude::Node::GetParameterMax (
    AmSize index
) const

Parameters:

  • index The parameter index.

Returns:

The maximum allowed value of the parameter at the given index.

GetParameterMin

Gets the minimum allowed value of the parameter at the given index.

virtual AmReal32 Amplitude::Node::GetParameterMin (
    AmSize index
) const

Parameters:

  • index The parameter index.

Returns:

The minimum allowed value of the parameter at the given index.

GetParameterName

Gets the name of the parameter at the given index.

virtual AmString Amplitude::Node::GetParameterName (
    AmSize index
) const

Parameters:

  • index The parameter index.

Returns:

The name of the parameter at the given index.

GetParameterType

Gets the type of the parameter at the given index.

virtual eParameterType Amplitude::Node::GetParameterType (
    AmSize index
) const

Parameters:

  • index The parameter index.

Returns:

The type of the parameter at the given index.

Node

Node constructor.

explicit Amplitude::Node::Node (
    AmString name
) 

Parameters:

  • name Name of the node. Should be unique within the pipeline.
~Node

Node destructor.

virtual Amplitude::Node::~Node () 

Public Static Functions Documentation

Construct

Creates a new instance of the node with the given name and returns its pointer.

static std::shared_ptr< NodeInstance > Amplitude::Node::Construct (
    const AmString & name
) 

Parameters:

  • name The name of the node.

Returns:

The node with the given name, or nullptr if not found.

Find

Look up a node by name.

static std::shared_ptr< Node > Amplitude::Node::Find (
    const AmString & name
) 

Returns:

The node with the given name, or nullptr if not found.

GetRegistry

Gets the list of registered nodes.

static const std::map< AmString, std::shared_ptr< Node > > & Amplitude::Node::GetRegistry () 

Returns:

The registry of nodes.

LockRegistry

Locks the nodes' registry.

static void Amplitude::Node::LockRegistry () 

Warning:

This function is mainly used for internal purposes. It's called before the Engine initialization, to discard the registration of new nodes after the engine is fully loaded.

Register

Registers a new node.

static void Amplitude::Node::Register (
    std::shared_ptr< Node > node
) 

Parameters:

  • node The node to add in the registry.
UnlockRegistry

Unlocks the nodes' registry.

static void Amplitude::Node::UnlockRegistry () 

Warning:

This function is mainly used for internal purposes. It's called after the Engine deinitialization, to allow the registration of new nodes after the engine is fully unloaded.

Unregister

Unregisters a node.

static void Amplitude::Node::Unregister (
    std::shared_ptr< const Node > node
) 

Parameters:

  • node The node to remove from the registry.

Protected Attributes Documentation

m_name

The name of this node.

AmString SparkyStudios::Audio::Amplitude::Node::m_name;

The documentation for this class was generated from the following file: include/SparkyStudios/Audio/Amplitude/Mixer/Node.h