TracktionEngine
Loading...
Searching...
No Matches
tracktion::engine::ChannelRemappingNode Class Referencefinal

A Node that remaps audio channels from input to output. More...

#include <tracktion_ChannelRemappingNode.h>

Inherits tracktion::graph::Node.

Public Member Functions

 ChannelRemappingNode (std::unique_ptr< tracktion::graph::Node > inputNode, ChannelMap channelMap)
 Creates a ChannelRemappingNode in explicit mapping mode.
 ChannelRemappingNode (std::unique_ptr< tracktion::graph::Node > processorNode, ChannelConfiguration inputConfig, ChannelConfiguration processorConfig)
 Creates a ChannelRemappingNode in processor passthrough mode.
tracktion::graph::NodeProperties getNodeProperties () override
std::vector< Node * > getDirectInputNodes () override
bool isReadyToProcess () override
void prepareToPlay (const tracktion::graph::PlaybackInitialisationInfo &) override
void process (ProcessContext &) override

Detailed Description

A Node that remaps audio channels from input to output.

This node supports two modes of operation:

  1. EXPLICIT MAPPING MODE: Uses a ChannelMap to explicitly route source channels to destination channels.

    • Multiple sources can map to the same destination (summed together)
    • A single source can map to multiple destinations (duplicated)
    • MIDI is always passed through

    Example: Mono to stereo duplication:

    auto node = makeNode<ChannelRemappingNode> (input, ChannelMap::monoToStereo());
    static ChannelMap monoToStereo()
    Creates a mapping that duplicates a mono source to stereo.
    Definition tracktion_ChannelMap.h:60
  2. PROCESSOR PASSTHROUGH MODE: Wraps a processor node (e.g., PluginNode) and handles channel count mismatches:

    • PASSTHROUGH (input > processor): Channels beyond the processor's capacity pass through unchanged from the original input. Example: 5.1 through stereo plugin - L/R processed, C/LFE/Ls/Rs pass through.
    • EXPANSION (input < processor): The processor outputs more channels than the input provided. Output is the processor's channel count. Example: Mono through stereo plugin - output is stereo.
    auto pluginNode = makeNode<PluginNode> (input, plugin, ...);
    auto node = makeNode<ChannelRemappingNode> (pluginNode, inputConfig, processorConfig);

Constructor & Destructor Documentation

◆ ChannelRemappingNode() [1/2]

tracktion::engine::ChannelRemappingNode::ChannelRemappingNode ( std::unique_ptr< tracktion::graph::Node > inputNode,
ChannelMap channelMap )

Creates a ChannelRemappingNode in explicit mapping mode.

Parameters
inputNodeThe input node to remap channels from.
channelMapThe channel mapping to apply.

◆ ChannelRemappingNode() [2/2]

tracktion::engine::ChannelRemappingNode::ChannelRemappingNode ( std::unique_ptr< tracktion::graph::Node > processorNode,
ChannelConfiguration inputConfig,
ChannelConfiguration processorConfig )

Creates a ChannelRemappingNode in processor passthrough mode.

Parameters
processorNodeThe processor node (e.g., PluginNode) that has already been created with its input. This node takes ownership.
inputConfigThe channel configuration of the original input.
processorConfigThe channel configuration the processor handles. An empty config means the processor handles all input channels (pass-through), so no remapping is needed.

Member Function Documentation

◆ getNodeProperties()

tracktion::graph::NodeProperties tracktion::engine::ChannelRemappingNode::getNodeProperties ( )
override

◆ getDirectInputNodes()

std::vector< Node * > tracktion::engine::ChannelRemappingNode::getDirectInputNodes ( )
override

◆ isReadyToProcess()

bool tracktion::engine::ChannelRemappingNode::isReadyToProcess ( )
override

◆ prepareToPlay()

void tracktion::engine::ChannelRemappingNode::prepareToPlay ( const tracktion::graph::PlaybackInitialisationInfo & )
override

◆ process()

void tracktion::engine::ChannelRemappingNode::process ( ProcessContext & )
override

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