struct CCL::IAudioNode

Overview

A node in an IAudioGraph with input and output streams. More…

#include <iaudiograph.h>

struct IAudioNode: public CCL::IUnknown
{
    // methods

    virtual void CCL_API setID (StringID id) = 0;
    virtual StringID CCL_API getID () const = 0;
    virtual tresult CCL_API setStreamLayout (const IAudioStreamLayout& layout) = 0;
    virtual const IAudioStreamLayout&CCL_API getStreamLayout () const = 0;

    virtual tresult CCL_API connect (
        IAudioNode* destination,
        int outputIndex = 0,
        int inputIndex = 0
    ) = 0;

    virtual tresult CCL_API disconnect (int outputIndex = 0) = 0;
    virtual tresult CCL_API disconnectAll () = 0;
};

Inherited Members

public:
    // methods

    virtual tresult CCL_API queryInterface (UIDRef iid, void** ptr) = 0;
    virtual unsigned int CCL_API retain () = 0;
    virtual unsigned int CCL_API release () = 0;

Detailed Documentation

A node in an IAudioGraph with input and output streams.

An input node (e.g. wrapping an IAudioSource) has zero input streams and one output stream. A processing node (e.g. gain or panning) typically has one stream of each direction. An output node has one input stream and zero output streams.

Additional interfaces:

Methods

virtual void CCL_API setID (StringID id) = 0

Set node identifier.

virtual StringID CCL_API getID () const = 0

Get node identifier.

virtual tresult CCL_API setStreamLayout (const IAudioStreamLayout& layout) = 0

Initialize node with given stream layout.

The node layout can be changed for most node types.

virtual const IAudioStreamLayout&CCL_API getStreamLayout () const = 0

Get stream layout for node.

virtual tresult CCL_API connect (
    IAudioNode* destination,
    int outputIndex = 0,
    int inputIndex = 0
) = 0

Connect an output stream of this node to an input stream of destination.

Fails if the two streams’ channel counts differ. Multiple output streams may connect to the same input stream, in which case their signals are summed. If the given output stream is already connected elsewhere, it is moved - no need to disconnect first.

Retains both source and destination for as long as this connection exists.

virtual tresult CCL_API disconnect (int outputIndex = 0) = 0

Disconnect a single output stream.

Releases the retained source and destination.

virtual tresult CCL_API disconnectAll () = 0

Disconnect every output stream.

Releases each retained source and destination.