Audacity 3.2.0
Namespaces | Functions
EffectStage.cpp File Reference
#include "EffectStage.h"
#include "AudacityException.h"
#include "AudioGraphBuffers.h"
#include "WideSampleSequence.h"
#include <cassert>
Include dependency graph for EffectStage.cpp:

Go to the source code of this file.

Namespaces

namespace  anonymous_namespace{EffectStage.cpp}
 

Functions

std::vector< std::shared_ptr< EffectInstance > > anonymous_namespace{EffectStage.cpp}::MakeInstances (const EffectStage::Factory &factory, EffectSettings &settings, double sampleRate, const WideSampleSequence &sequence, std::optional< sampleCount > genLength, int channel)
 
unsigned MakeChannelMap (const WideSampleSequence &sequence, int channel, ChannelName map[3])
 

Function Documentation

◆ MakeChannelMap()

unsigned MakeChannelMap ( const WideSampleSequence sequence,
int  channel,
ChannelName  map[3] 
)

Definition at line 372 of file EffectStage.cpp.

374{
375 const auto nChannels = sequence.NChannels();
376 assert(channel < static_cast<int>(nChannels)); // precondition
377
378 size_t index = 0;
379 if (nChannels == 1)
380 map[index++] = ChannelNameMono;
381 else {
382 // TODO: more-than-two-channels
383 if (channel < 1)
384 map[index++] = ChannelNameFrontLeft;
385 if (channel != 0)
386 map[index++] = ChannelNameFrontRight;
387 }
388 map[index] = ChannelNameEOL;
389 return index;
390}
@ ChannelNameFrontLeft
@ ChannelNameEOL
@ ChannelNameMono
@ ChannelNameFrontRight
virtual size_t NChannels() const =0
A constant property.

References ChannelNameEOL, ChannelNameFrontLeft, ChannelNameFrontRight, ChannelNameMono, and WideSampleSequence::NChannels().

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: