|
TracktionEngine
|
Represents a mapping from source channels to destination channels. More...
#include <tracktion_ChannelMap.h>
Classes | |
| struct | Entry |
Public Member Functions | |
| ChannelMap ()=default | |
| Creates an empty channel map. | |
| ChannelMap (std::vector< std::pair< int, int > > mappings) | |
| Creates a channel map from a vector of source->dest pairs (gain defaults to 1.0). | |
| bool | isEmpty () const noexcept |
| Returns true if the map is empty. | |
| size_t | size () const noexcept |
| Returns the number of mappings. | |
| bool | isIdentity () const noexcept |
| Returns true if this is an identity mapping (each channel maps to itself at unity gain). | |
| int | getRequiredOutputChannels () const noexcept |
| Returns the maximum destination channel index + 1 (i.e., the required output channel count). | |
Static Public Member Functions | |
| static ChannelMap | identity (int numChannels) |
| Creates an identity mapping for the given number of channels. | |
| static ChannelMap | monoToStereo () |
| Creates a mapping that duplicates a mono source to stereo. | |
| static ChannelMap | stereoToMono () |
| Creates a mapping that averages stereo to mono (each channel at 0.5 gain). | |
| static ChannelMap | conversion (int fromChannels, int toChannels) |
| Creates an appropriate conversion mapping between channel counts. | |
| static ChannelMap | duplicateToChannels (int sourceChannel, int numDestChannels) |
| Creates a mapping that duplicates a source to all destination channels. | |
Public Attributes | |
| std::vector< Entry > | entries |
| The source -> destination mappings. | |
Represents a mapping from source channels to destination channels.
Each entry maps a source channel index to a destination channel index with an optional gain factor (default 1.0). Multiple sources can map to the same destination (they will be summed). A single source can map to multiple destinations (it will be duplicated).
|
default |
Creates an empty channel map.
Referenced by conversion(), duplicateToChannels(), identity(), monoToStereo(), and stereoToMono().
|
explicit |
Creates a channel map from a vector of source->dest pairs (gain defaults to 1.0).
References entries.
|
static |
Creates an identity mapping for the given number of channels.
References ChannelMap(), and entries.
Referenced by conversion().
|
static |
Creates a mapping that duplicates a mono source to stereo.
References ChannelMap().
Referenced by conversion().
|
static |
Creates a mapping that averages stereo to mono (each channel at 0.5 gain).
References ChannelMap(), and entries.
Referenced by conversion().
|
static |
Creates an appropriate conversion mapping between channel counts.
Rules:
References ChannelMap(), entries, identity(), monoToStereo(), and stereoToMono().
|
static |
Creates a mapping that duplicates a source to all destination channels.
References ChannelMap(), and entries.
|
noexcept |
Returns true if the map is empty.
References entries.
|
noexcept |
Returns the number of mappings.
References entries.
|
noexcept |
Returns true if this is an identity mapping (each channel maps to itself at unity gain).
References entries.
|
noexcept |
Returns the maximum destination channel index + 1 (i.e., the required output channel count).
References entries.
| std::vector<Entry> tracktion::engine::ChannelMap::entries |
The source -> destination mappings.
Referenced by ChannelMap(), conversion(), duplicateToChannels(), getRequiredOutputChannels(), identity(), isEmpty(), isIdentity(), size(), and stereoToMono().