Audacity 3.2.0
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
MixerOptions::Downmix Class Referencefinal

A matrix of booleans, one row per input channel, column per output. More...

#include <MixerOptions.h>

Collaboration diagram for MixerOptions::Downmix:
[legend]

Public Member Functions

 Downmix (unsigned numTracks, unsigned maxNumChannels)
 
 Downmix (const Downmix &mixerSpec)
 
 ~Downmix ()
 
bool SetNumChannels (unsigned numChannels)
 
unsigned GetNumChannels ()
 
unsigned GetMaxNumChannels ()
 
unsigned GetNumTracks ()
 
Downmixoperator= (const Downmix &mixerSpec)
 

Public Attributes

ArraysOf< bool > mMap
 

Private Member Functions

void Alloc ()
 

Private Attributes

unsigned mNumTracks
 
unsigned mNumChannels
 
unsigned mMaxNumChannels
 

Detailed Description

A matrix of booleans, one row per input channel, column per output.

Definition at line 32 of file MixerOptions.h.

Constructor & Destructor Documentation

◆ Downmix() [1/2]

MixerOptions::Downmix::Downmix ( unsigned  numTracks,
unsigned  maxNumChannels 
)

Definition at line 69 of file MixerOptions.cpp.

70{
71 mNumTracks = mNumChannels = numTracks;
72 mMaxNumChannels = maxNumChannels;
73
76
77 Alloc();
78
79 for( unsigned int i = 0; i < mNumTracks; i++ )
80 for( unsigned int j = 0; j < mNumChannels; j++ )
81 mMap[ i ][ j ] = ( i == j );
82}
ArraysOf< bool > mMap
Definition: MixerOptions.h:38

◆ Downmix() [2/2]

MixerOptions::Downmix::Downmix ( const Downmix mixerSpec)

Definition at line 84 of file MixerOptions.cpp.

85{
86 mNumTracks = mixerSpec.mNumTracks;
87 mMaxNumChannels = mixerSpec.mMaxNumChannels;
88 mNumChannels = mixerSpec.mNumChannels;
89
90 Alloc();
91
92 for( unsigned int i = 0; i < mNumTracks; i++ )
93 for( unsigned int j = 0; j < mNumChannels; j++ )
94 mMap[ i ][ j ] = mixerSpec.mMap[ i ][ j ];
95}

References mMap, mMaxNumChannels, mNumChannels, and mNumTracks.

◆ ~Downmix()

MixerOptions::Downmix::~Downmix ( )

Definition at line 102 of file MixerOptions.cpp.

103{
104}

Member Function Documentation

◆ Alloc()

void MixerOptions::Downmix::Alloc ( )
private

Definition at line 97 of file MixerOptions.cpp.

98{
100}
void reinit(Integral count)
Definition: MemoryX.h:109

◆ GetMaxNumChannels()

unsigned MixerOptions::Downmix::GetMaxNumChannels ( )
inline

Definition at line 47 of file MixerOptions.h.

47{ return mMaxNumChannels; }

◆ GetNumChannels()

unsigned MixerOptions::Downmix::GetNumChannels ( )
inline

Definition at line 45 of file MixerOptions.h.

45{ return mNumChannels; }

Referenced by ExportMixerPanel::OnMouseEvent(), and ExportMixerPanel::OnPaint().

Here is the caller graph for this function:

◆ GetNumTracks()

unsigned MixerOptions::Downmix::GetNumTracks ( )
inline

Definition at line 48 of file MixerOptions.h.

48{ return mNumTracks; }

Referenced by ExportMixerPanel::OnMouseEvent(), and ExportMixerPanel::OnPaint().

Here is the caller graph for this function:

◆ operator=()

auto MixerOptions::Downmix::operator= ( const Downmix mixerSpec)

Definition at line 127 of file MixerOptions.cpp.

128{
129 mNumTracks = mixerSpec.mNumTracks;
130 mNumChannels = mixerSpec.mNumChannels;
131 mMaxNumChannels = mixerSpec.mMaxNumChannels;
132
133 Alloc();
134
135 for( unsigned int i = 0; i < mNumTracks; i++ )
136 for( unsigned int j = 0; j < mNumChannels; j++ )
137 mMap[ i ][ j ] = mixerSpec.mMap[ i ][ j ];
138
139 return *this;
140}

References mNumTracks.

◆ SetNumChannels()

bool MixerOptions::Downmix::SetNumChannels ( unsigned  numChannels)

Definition at line 106 of file MixerOptions.cpp.

107{
108 if( mNumChannels == newNumChannels )
109 return true;
110
111 if( newNumChannels > mMaxNumChannels )
112 return false;
113
114 for( unsigned int i = 0; i < mNumTracks; i++ )
115 {
116 for( unsigned int j = newNumChannels; j < mNumChannels; j++ )
117 mMap[ i ][ j ] = false;
118
119 for( unsigned int j = mNumChannels; j < newNumChannels; j++ )
120 mMap[ i ][ j ] = false;
121 }
122
123 mNumChannels = newNumChannels;
124 return true;
125}

Member Data Documentation

◆ mMap

ArraysOf<bool> MixerOptions::Downmix::mMap

◆ mMaxNumChannels

unsigned MixerOptions::Downmix::mMaxNumChannels
private

Definition at line 33 of file MixerOptions.h.

Referenced by Downmix().

◆ mNumChannels

unsigned MixerOptions::Downmix::mNumChannels
private

Definition at line 33 of file MixerOptions.h.

Referenced by Downmix().

◆ mNumTracks

unsigned MixerOptions::Downmix::mNumTracks
private

Definition at line 33 of file MixerOptions.h.

Referenced by Downmix(), and operator=().


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