Audacity 3.2.0
Classes | Functions
AudioGraph Namespace Reference

Classes

class  Buffers
 Accumulates (non-interleaved) data during effect processing. More...
 
class  EffectStage
 Decorates a source with a non-timewarping effect, which may have latency. More...
 
class  Sink
 Downstream receiver of sample streams, taking Buffers as external context. More...
 
class  Source
 Upstream producer of sample streams, taking Buffers as external context. More...
 
struct  Task
 Copies from a Source to a Sink, mediated by Buffers. More...
 

Functions

AUDIO_GRAPH_API unsigned MakeChannelMap (const Track &track, bool multichannel, ChannelName map[3])
 

Function Documentation

◆ MakeChannelMap()

unsigned AudioGraph::MakeChannelMap ( const Track track,
bool  multichannel,
ChannelName  map[3] 
)

Definition at line 379 of file EffectStage.cpp.

381{
382 // Iterate either over one track which could be any channel,
383 // or if multichannel, then over all channels of track,
384 // which is a leader.
385 unsigned numChannels = 0;
386 for (auto channel : TrackList::Channels(&track).StartingWith(&track)) {
387 if (channel->GetChannel() == Track::LeftChannel)
388 map[numChannels] = ChannelNameFrontLeft;
389 else if (channel->GetChannel() == Track::RightChannel)
390 map[numChannels] = ChannelNameFrontRight;
391 else
392 map[numChannels] = ChannelNameMono;
393 ++ numChannels;
394 map[numChannels] = ChannelNameEOL;
395 if (! multichannel)
396 break;
397 if (numChannels == 2) {
398 // TODO: more-than-two-channels
399 // Ignore other channels
400 break;
401 }
402 }
403 return numChannels;
404}
@ ChannelNameFrontLeft
@ ChannelNameEOL
@ ChannelNameMono
@ ChannelNameFrontRight
@ LeftChannel
Definition: Track.h:282
@ RightChannel
Definition: Track.h:283
static auto Channels(TrackType *pTrack) -> TrackIterRange< TrackType >
Definition: Track.h:1541

References ChannelNameEOL, ChannelNameFrontLeft, ChannelNameFrontRight, ChannelNameMono, TrackList::Channels(), Track::LeftChannel, and Track::RightChannel.

Referenced by anonymous_namespace{EffectStage.cpp}::MakeInstances(), and PerTrackEffect::ProcessPass().

Here is the call graph for this function:
Here is the caller graph for this function: