Audacity  3.0.3
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 54 of file Mix.h.

Constructor & Destructor Documentation

◆ MixerSpec() [1/2]

MixerSpec::MixerSpec ( unsigned  numTracks,
unsigned  maxNumChannels 
)

Definition at line 808 of file Mix.cpp.

809 {
810  mNumTracks = mNumChannels = numTracks;
811  mMaxNumChannels = maxNumChannels;
812 
815 
816  Alloc();
817 
818  for( unsigned int i = 0; i < mNumTracks; i++ )
819  for( unsigned int j = 0; j < mNumChannels; j++ )
820  mMap[ i ][ j ] = ( i == j );
821 }

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 823 of file Mix.cpp.

824 {
825  mNumTracks = mixerSpec.mNumTracks;
826  mMaxNumChannels = mixerSpec.mMaxNumChannels;
827  mNumChannels = mixerSpec.mNumChannels;
828 
829  Alloc();
830 
831  for( unsigned int i = 0; i < mNumTracks; i++ )
832  for( unsigned int j = 0; j < mNumChannels; j++ )
833  mMap[ i ][ j ] = mixerSpec.mMap[ i ][ j ];
834 }

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

Here is the call graph for this function:

◆ ~MixerSpec()

MixerSpec::~MixerSpec ( )
virtual

Definition at line 841 of file Mix.cpp.

842 {
843 }

Member Function Documentation

◆ Alloc()

void MixerSpec::Alloc ( )
private

Definition at line 836 of file Mix.cpp.

837 {
839 }

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 70 of file Mix.h.

70 { return mMaxNumChannels; }

◆ GetNumChannels()

unsigned MixerSpec::GetNumChannels ( )
inline

Definition at line 68 of file Mix.h.

68 { 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 71 of file Mix.h.

71 { 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 866 of file Mix.cpp.

867 {
868  mNumTracks = mixerSpec.mNumTracks;
869  mNumChannels = mixerSpec.mNumChannels;
870  mMaxNumChannels = mixerSpec.mMaxNumChannels;
871 
872  Alloc();
873 
874  for( unsigned int i = 0; i < mNumTracks; i++ )
875  for( unsigned int j = 0; j < mNumChannels; j++ )
876  mMap[ i ][ j ] = mixerSpec.mMap[ i ][ j ];
877 
878  return *this;
879 }

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

Here is the call graph for this function:

◆ SetNumChannels()

bool MixerSpec::SetNumChannels ( unsigned  numChannels)

Definition at line 845 of file Mix.cpp.

846 {
847  if( mNumChannels == newNumChannels )
848  return true;
849 
850  if( newNumChannels > mMaxNumChannels )
851  return false;
852 
853  for( unsigned int i = 0; i < mNumTracks; i++ )
854  {
855  for( unsigned int j = newNumChannels; j < mNumChannels; j++ )
856  mMap[ i ][ j ] = false;
857 
858  for( unsigned int j = mNumChannels; j < newNumChannels; j++ )
859  mMap[ i ][ j ] = false;
860  }
861 
862  mNumChannels = newNumChannels;
863  return true;
864 }

References mMap, mMaxNumChannels, mNumChannels, and mNumTracks.

Member Data Documentation

◆ mMap

ArraysOf<bool> MixerSpec::mMap

◆ mMaxNumChannels

unsigned MixerSpec::mMaxNumChannels
private

Definition at line 56 of file Mix.h.

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

◆ mNumChannels

unsigned MixerSpec::mNumChannels
private

Definition at line 56 of file Mix.h.

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

◆ mNumTracks

unsigned MixerSpec::mNumTracks
private

Definition at line 56 of file Mix.h.

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


The documentation for this class was generated from the following files:
ArraysOf::reinit
void reinit(Integral count)
Definition: MemoryX.h:109
MixerSpec::mMap
ArraysOf< bool > mMap
Definition: Mix.h:61
MixerSpec::mMaxNumChannels
unsigned mMaxNumChannels
Definition: Mix.h:56
MixerSpec::mNumChannels
unsigned mNumChannels
Definition: Mix.h:56
MixerSpec::Alloc
void Alloc()
Definition: Mix.cpp:836
MixerSpec::mNumTracks
unsigned mNumTracks
Definition: Mix.h:56