Audacity 3.2.0
Public Member Functions | Private Attributes | List of all members
SimpleDonwmixSource Class Referencefinal

#include <DownmixSource.h>

Inheritance diagram for SimpleDonwmixSource:
[legend]
Collaboration diagram for SimpleDonwmixSource:
[legend]

Public Member Functions

 SimpleDonwmixSource (AudioGraph::Source &downstream, size_t channels)
 
AudioGraph::SourceGetDownstream () const override
 Returns underlying AudioGraph::Source processed by Mixer. More...
 
size_t NChannels () const override
 Number of output channels of the underlying Source. More...
 
float GetChannelGain (size_t channel) const override
 Gain multiplier that should be applied to the channel. More...
 
void FindChannelFlags (unsigned char *channelFlags, size_t numChannels, size_t iChannel) override
 
bool CanMakeMono () const override
 Returns true if source channels could be combined into mono if needed. More...
 
- Public Member Functions inherited from DownmixSource
 DownmixSource ()=default
 
virtual ~DownmixSource ()=default
 
virtual AudioGraph::SourceGetDownstream () const =0
 Returns underlying AudioGraph::Source processed by Mixer. More...
 
virtual size_t NChannels () const =0
 Number of output channels of the underlying Source. More...
 
virtual float GetChannelGain (size_t channel) const =0
 Gain multiplier that should be applied to the channel. More...
 
virtual void FindChannelFlags (unsigned char *channelFlags, size_t numChannels, size_t iChannel)=0
 
virtual bool CanMakeMono () const =0
 Returns true if source channels could be combined into mono if needed. More...
 

Private Attributes

AudioGraph::SourcemDownstream
 
size_t mNChannels
 

Detailed Description

No gain applied, channels are either mapped to corresponding ones or combined into mono, depending on FindChannelFlags input

Definition at line 68 of file DownmixSource.h.

Constructor & Destructor Documentation

◆ SimpleDonwmixSource()

SimpleDonwmixSource::SimpleDonwmixSource ( AudioGraph::Source downstream,
size_t  channels 
)

Definition at line 67 of file DownmixSource.cpp.

68 : mDownstream(downstream), mNChannels(channels)
69{
70}
AudioGraph::Source & mDownstream
Definition: DownmixSource.h:70

Member Function Documentation

◆ CanMakeMono()

bool SimpleDonwmixSource::CanMakeMono ( ) const
overridevirtual

Returns true if source channels could be combined into mono if needed.

Implements DownmixSource.

Definition at line 101 of file DownmixSource.cpp.

102{
103 return true;
104}

◆ FindChannelFlags()

void SimpleDonwmixSource::FindChannelFlags ( unsigned char *  channelFlags,
size_t  numChannels,
size_t  iChannel 
)
overridevirtual

For the given iChannel fills the channelFlags array, that describes to which output it should go.

Implements DownmixSource.

Definition at line 87 of file DownmixSource.cpp.

88{
89 if(mNChannels == 1)
90 {
91 for(size_t i = 0; i < numChannels; ++i)
92 channelFlags[i] = true;
93 }
94 else
95 {
96 for(size_t i = 0; i < numChannels; ++i)
97 channelFlags[i] = i == iChannel;
98 }
99}

References anonymous_namespace{StretchingSequenceIntegrationTest.cpp}::iChannel, and mNChannels.

◆ GetChannelGain()

float SimpleDonwmixSource::GetChannelGain ( size_t  channel) const
overridevirtual

Gain multiplier that should be applied to the channel.

Implements DownmixSource.

Definition at line 82 of file DownmixSource.cpp.

83{
84 return 1.0f;
85}

◆ GetDownstream()

AudioGraph::Source & SimpleDonwmixSource::GetDownstream ( ) const
overridevirtual

Returns underlying AudioGraph::Source processed by Mixer.

Implements DownmixSource.

Definition at line 72 of file DownmixSource.cpp.

73{
74 return mDownstream;
75}

References mDownstream.

◆ NChannels()

size_t SimpleDonwmixSource::NChannels ( ) const
overridevirtual

Number of output channels of the underlying Source.

Implements DownmixSource.

Definition at line 77 of file DownmixSource.cpp.

78{
79 return mNChannels;
80}

References mNChannels.

Member Data Documentation

◆ mDownstream

AudioGraph::Source& SimpleDonwmixSource::mDownstream
private

Definition at line 70 of file DownmixSource.h.

Referenced by GetDownstream().

◆ mNChannels

size_t SimpleDonwmixSource::mNChannels
private

Definition at line 71 of file DownmixSource.h.

Referenced by FindChannelFlags(), and NChannels().


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