Audacity 3.2.0
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
MixerSpec Class Reference

Class used with Mixer. More...

#include <Mix.h>

Collaboration diagram for MixerSpec:
[legend]

Public Member Functions

 MixerSpec (unsigned numTracks, unsigned maxNumChannels)
 
 MixerSpec (const MixerSpec &mixerSpec)
 
virtual ~MixerSpec ()
 
bool SetNumChannels (unsigned numChannels)
 
unsigned GetNumChannels ()
 
unsigned GetMaxNumChannels ()
 
unsigned GetNumTracks ()
 
MixerSpecoperator= (const MixerSpec &mixerSpec)
 

Public Attributes

ArraysOf< bool > mMap
 

Private Member Functions

void Alloc ()
 

Private Attributes

unsigned mNumTracks
 
unsigned mNumChannels
 
unsigned mMaxNumChannels
 

Detailed Description

Class used with Mixer.

Definition at line 28 of file Mix.h.

Constructor & Destructor Documentation

◆ MixerSpec() [1/2]

MixerSpec::MixerSpec ( unsigned  numTracks,
unsigned  maxNumChannels 
)

Definition at line 648 of file Mix.cpp.

649{
650 mNumTracks = mNumChannels = numTracks;
651 mMaxNumChannels = maxNumChannels;
652
655
656 Alloc();
657
658 for( unsigned int i = 0; i < mNumTracks; i++ )
659 for( unsigned int j = 0; j < mNumChannels; j++ )
660 mMap[ i ][ j ] = ( i == j );
661}
void Alloc()
Definition: Mix.cpp:676
unsigned mMaxNumChannels
Definition: Mix.h:30
unsigned mNumChannels
Definition: Mix.h:30
ArraysOf< bool > mMap
Definition: Mix.h:35
unsigned mNumTracks
Definition: Mix.h:30

References Alloc(), mMap, mMaxNumChannels, mNumChannels, and mNumTracks.

Here is the call graph for this function:

◆ MixerSpec() [2/2]

MixerSpec::MixerSpec ( const MixerSpec mixerSpec)

Definition at line 663 of file Mix.cpp.

664{
665 mNumTracks = mixerSpec.mNumTracks;
667 mNumChannels = mixerSpec.mNumChannels;
668
669 Alloc();
670
671 for( unsigned int i = 0; i < mNumTracks; i++ )
672 for( unsigned int j = 0; j < mNumChannels; j++ )
673 mMap[ i ][ j ] = mixerSpec.mMap[ i ][ j ];
674}

References Alloc(), mMap, mMaxNumChannels, mNumChannels, and mNumTracks.

Here is the call graph for this function:

◆ ~MixerSpec()

MixerSpec::~MixerSpec ( )
virtual

Definition at line 681 of file Mix.cpp.

682{
683}

Member Function Documentation

◆ Alloc()

void MixerSpec::Alloc ( )
private

Definition at line 676 of file Mix.cpp.

677{
679}
void reinit(Integral count)
Definition: MemoryX.h:109

References mMap, mMaxNumChannels, mNumTracks, and ArraysOf< X >::reinit().

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

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

◆ GetMaxNumChannels()

unsigned MixerSpec::GetMaxNumChannels ( )
inline

Definition at line 44 of file Mix.h.

44{ return mMaxNumChannels; }

◆ GetNumChannels()

unsigned MixerSpec::GetNumChannels ( )
inline

Definition at line 42 of file Mix.h.

42{ return mNumChannels; }

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

Here is the caller graph for this function:

◆ GetNumTracks()

unsigned MixerSpec::GetNumTracks ( )
inline

Definition at line 45 of file Mix.h.

45{ return mNumTracks; }

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

Here is the caller graph for this function:

◆ operator=()

MixerSpec & MixerSpec::operator= ( const MixerSpec mixerSpec)

Definition at line 706 of file Mix.cpp.

707{
708 mNumTracks = mixerSpec.mNumTracks;
709 mNumChannels = mixerSpec.mNumChannels;
711
712 Alloc();
713
714 for( unsigned int i = 0; i < mNumTracks; i++ )
715 for( unsigned int j = 0; j < mNumChannels; j++ )
716 mMap[ i ][ j ] = mixerSpec.mMap[ i ][ j ];
717
718 return *this;
719}

References Alloc(), mMap, mMaxNumChannels, mNumChannels, and mNumTracks.

Here is the call graph for this function:

◆ SetNumChannels()

bool MixerSpec::SetNumChannels ( unsigned  numChannels)

Definition at line 685 of file Mix.cpp.

686{
687 if( mNumChannels == newNumChannels )
688 return true;
689
690 if( newNumChannels > mMaxNumChannels )
691 return false;
692
693 for( unsigned int i = 0; i < mNumTracks; i++ )
694 {
695 for( unsigned int j = newNumChannels; j < mNumChannels; j++ )
696 mMap[ i ][ j ] = false;
697
698 for( unsigned int j = mNumChannels; j < newNumChannels; j++ )
699 mMap[ i ][ j ] = false;
700 }
701
702 mNumChannels = newNumChannels;
703 return true;
704}

References mMap, mMaxNumChannels, mNumChannels, and mNumTracks.

Member Data Documentation

◆ mMap

ArraysOf<bool> MixerSpec::mMap

◆ mMaxNumChannels

unsigned MixerSpec::mMaxNumChannels
private

Definition at line 30 of file Mix.h.

Referenced by Alloc(), MixerSpec(), operator=(), and SetNumChannels().

◆ mNumChannels

unsigned MixerSpec::mNumChannels
private

Definition at line 30 of file Mix.h.

Referenced by MixerSpec(), operator=(), and SetNumChannels().

◆ mNumTracks

unsigned MixerSpec::mNumTracks
private

Definition at line 30 of file Mix.h.

Referenced by Alloc(), MixerSpec(), operator=(), and SetNumChannels().


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