JUCE
Public Types | Public Member Functions | Static Public Member Functions | List of all members
AudioChannelSet Class Reference

Represents a set of audio channel types. More...

Public Types

enum  ChannelType {
  unknown = 0, left = 1, right = 2, centre = 3,
  subbass = 4, leftSurround = 5, rightSurround = 6, leftCentre = 7,
  rightCentre = 8, surround = 9, leftSurroundDirect = 10, rightSurroundDirect = 11,
  topMiddle = 12, topFrontLeft = 13, topFrontCentre = 14, topFrontRight = 15,
  topRearLeft = 16, topRearCentre = 17, topRearRight = 18, subbass2 = 19,
  leftRearSurround = 20, rightRearSurround = 21, wideLeft = 22, wideRight = 23,
  ambisonicW = 24, ambisonicX = 25, ambisonicY = 26, ambisonicZ = 27,
  discreteChannel0 = 64
}
 Represents different audio channel types. More...
 

Public Member Functions

 AudioChannelSet () noexcept
 Creates an empty channel set. More...
 
void addChannel (ChannelType newChannelType)
 Adds a channel to the set. More...
 
int size () const noexcept
 Returns the number of channels in the set. More...
 
bool isDisabled () const noexcept
 Returns the number of channels in the set. More...
 
Array< ChannelTypegetChannelTypes () const
 Returns an array of all the types in this channel set. More...
 
ChannelType getTypeOfChannel (int channelIndex) const noexcept
 Returns the type of one of the channels in the set, by index. More...
 
int getChannelIndexForType (ChannelType type) const noexcept
 Returns the index for a particular channel-type. More...
 
String getSpeakerArrangementAsString () const
 Returns a string containing a whitespace-separated list of speaker types corresponding to each channel. More...
 
String getDescription () const
 Returns the description of the current layout. More...
 
bool isDiscreteLayout () const noexcept
 Returns if this is a channel layout made-up of discrete channels. More...
 
bool operator== (const AudioChannelSet &) const noexcept
 
bool operator!= (const AudioChannelSet &) const noexcept
 
bool operator< (const AudioChannelSet &) const noexcept
 

Static Public Member Functions

static AudioChannelSet disabled ()
 Creates a zero-channel set which can be used to indicate that a bus is disabled. More...
 
static AudioChannelSet mono ()
 Creates a one-channel mono set. More...
 
static AudioChannelSet stereo ()
 Creates a set containing a left and right channel. More...
 
static AudioChannelSet createLCR ()
 Creates a set containing a left, right and centre channels. More...
 
static AudioChannelSet createLRS ()
 Creates a set containing a left, right and centre channels. More...
 
static AudioChannelSet createLCRS ()
 Creates a set containing a left, right, centre and surround channels. More...
 
static AudioChannelSet quadraphonic ()
 Creates a set for quadraphonic surround setup. More...
 
static AudioChannelSet pentagonal ()
 Creates a set for pentagonal surround setup. More...
 
static AudioChannelSet hexagonal ()
 Creates a set for hexagonal surround setup. More...
 
static AudioChannelSet octagonal ()
 Creates a set for octagonal surround setup. More...
 
static AudioChannelSet ambisonic ()
 Creates a set for ambisonic surround setups. More...
 
static AudioChannelSet create5point0 ()
 Creates a set for a 5.0 surround setup. More...
 
static AudioChannelSet create5point1 ()
 Creates a set for a 5.1 surround setup. More...
 
static AudioChannelSet create6point0 ()
 Creates a set for a 6.0 Cine surround setup. More...
 
static AudioChannelSet create6point0Music ()
 Creates a set for a 6.0 Music surround setup. More...
 
static AudioChannelSet create6point1 ()
 Creates a set for a 6.1 surround setup. More...
 
static AudioChannelSet create7point0 ()
 Creates a set for a 7.0 surround setup. More...
 
static AudioChannelSet create7point1 ()
 Creates a set for a 7.1 surround setup. More...
 
static AudioChannelSet create7point1AC3 ()
 Creates a set for a 7.1 AC3 C surround setup. More...
 
static AudioChannelSet createFront7point0 ()
 Creates a set for a 7.0 surround setup (with side instead of rear speakers). More...
 
static AudioChannelSet createFront7point1 ()
 Creates a set for a 7.1 surround setup (with side instead of rear speakers). More...
 
static AudioChannelSet discreteChannels (int numChannels)
 Creates a set of untyped discrete channels. More...
 
static AudioChannelSet canonicalChannelSet (int numChannels)
 Create a canonical channel set for a given number of channels. More...
 
static String getChannelTypeName (ChannelType)
 Returns the name of a given channel type. More...
 
static String getAbbreviatedChannelTypeName (ChannelType)
 Returns the abbreviated name of a channel type. More...
 

Detailed Description

Represents a set of audio channel types.

For example, you might have a set of left + right channels, which is a stereo channel set. It is a collection of values from the AudioChannelSet::ChannelType enum, where each type may only occur once within the set.

See also
AudioProcessorBus

Member Enumeration Documentation

Represents different audio channel types.

Enumerator
unknown 
left 
right 
centre 
subbass 
leftSurround 
rightSurround 
leftCentre 
rightCentre 
surround 
leftSurroundDirect 
rightSurroundDirect 
topMiddle 
topFrontLeft 
topFrontCentre 
topFrontRight 
topRearLeft 
topRearCentre 
topRearRight 
subbass2 
leftRearSurround 
rightRearSurround 
wideLeft 
wideRight 
ambisonicW 
ambisonicX 
ambisonicY 
ambisonicZ 
discreteChannel0 

Non-typed individual channels are indexed upwards from this value.

Constructor & Destructor Documentation

AudioChannelSet::AudioChannelSet ( )
noexcept

Creates an empty channel set.

You can call addChannel to add channels to the set.

Member Function Documentation

static AudioChannelSet AudioChannelSet::disabled ( )
static
static AudioChannelSet AudioChannelSet::mono ( )
static
static AudioChannelSet AudioChannelSet::stereo ( )
static

Creates a set containing a left and right channel.

Referenced by AudioUnitHelpers::CALayoutTagToChannelSet(), and AudioUnitHelpers::ChannelSetToCALayoutTag().

static AudioChannelSet AudioChannelSet::createLCR ( )
static

Creates a set containing a left, right and centre channels.

Referenced by AudioUnitHelpers::CALayoutTagToChannelSet(), and AudioUnitHelpers::ChannelSetToCALayoutTag().

static AudioChannelSet AudioChannelSet::createLRS ( )
static

Creates a set containing a left, right and centre channels.

Referenced by AudioUnitHelpers::CALayoutTagToChannelSet(), and AudioUnitHelpers::ChannelSetToCALayoutTag().

static AudioChannelSet AudioChannelSet::createLCRS ( )
static

Creates a set containing a left, right, centre and surround channels.

Referenced by AudioUnitHelpers::CALayoutTagToChannelSet(), and AudioUnitHelpers::ChannelSetToCALayoutTag().

static AudioChannelSet AudioChannelSet::quadraphonic ( )
static

Creates a set for quadraphonic surround setup.

Referenced by AudioUnitHelpers::CALayoutTagToChannelSet(), and AudioUnitHelpers::ChannelSetToCALayoutTag().

static AudioChannelSet AudioChannelSet::pentagonal ( )
static
static AudioChannelSet AudioChannelSet::hexagonal ( )
static
static AudioChannelSet AudioChannelSet::octagonal ( )
static

Creates a set for octagonal surround setup.

Referenced by AudioUnitHelpers::CALayoutTagToChannelSet(), and AudioUnitHelpers::ChannelSetToCALayoutTag().

static AudioChannelSet AudioChannelSet::ambisonic ( )
static

Creates a set for ambisonic surround setups.

Referenced by AudioUnitHelpers::CALayoutTagToChannelSet(), and AudioUnitHelpers::ChannelSetToCALayoutTag().

static AudioChannelSet AudioChannelSet::create5point0 ( )
static

Creates a set for a 5.0 surround setup.

Referenced by AudioUnitHelpers::CALayoutTagToChannelSet(), and AudioUnitHelpers::ChannelSetToCALayoutTag().

static AudioChannelSet AudioChannelSet::create5point1 ( )
static

Creates a set for a 5.1 surround setup.

Referenced by AudioUnitHelpers::CALayoutTagToChannelSet(), and AudioUnitHelpers::ChannelSetToCALayoutTag().

static AudioChannelSet AudioChannelSet::create6point0 ( )
static

Creates a set for a 6.0 Cine surround setup.

Referenced by AudioUnitHelpers::CALayoutTagToChannelSet(), and AudioUnitHelpers::ChannelSetToCALayoutTag().

static AudioChannelSet AudioChannelSet::create6point0Music ( )
static

Creates a set for a 6.0 Music surround setup.

Referenced by AudioUnitHelpers::CALayoutTagToChannelSet(), and AudioUnitHelpers::ChannelSetToCALayoutTag().

static AudioChannelSet AudioChannelSet::create6point1 ( )
static

Creates a set for a 6.1 surround setup.

Referenced by AudioUnitHelpers::CALayoutTagToChannelSet(), and AudioUnitHelpers::ChannelSetToCALayoutTag().

static AudioChannelSet AudioChannelSet::create7point0 ( )
static

Creates a set for a 7.0 surround setup.

Referenced by AudioUnitHelpers::CALayoutTagToChannelSet(), and AudioUnitHelpers::ChannelSetToCALayoutTag().

static AudioChannelSet AudioChannelSet::create7point1 ( )
static

Creates a set for a 7.1 surround setup.

Referenced by AudioUnitHelpers::CALayoutTagToChannelSet(), and AudioUnitHelpers::ChannelSetToCALayoutTag().

static AudioChannelSet AudioChannelSet::create7point1AC3 ( )
static

Creates a set for a 7.1 AC3 C surround setup.

Referenced by AudioUnitHelpers::CALayoutTagToChannelSet(), and AudioUnitHelpers::ChannelSetToCALayoutTag().

static AudioChannelSet AudioChannelSet::createFront7point0 ( )
static

Creates a set for a 7.0 surround setup (with side instead of rear speakers).

Referenced by AudioUnitHelpers::CALayoutTagToChannelSet(), and AudioUnitHelpers::ChannelSetToCALayoutTag().

static AudioChannelSet AudioChannelSet::createFront7point1 ( )
static

Creates a set for a 7.1 surround setup (with side instead of rear speakers).

Referenced by AudioUnitHelpers::CALayoutTagToChannelSet(), and AudioUnitHelpers::ChannelSetToCALayoutTag().

static AudioChannelSet AudioChannelSet::discreteChannels ( int  numChannels)
static
static AudioChannelSet AudioChannelSet::canonicalChannelSet ( int  numChannels)
static

Create a canonical channel set for a given number of channels.

For example, numChannels = 1 will return mono, numChannels = 2 will return stereo, etc.

static String AudioChannelSet::getChannelTypeName ( ChannelType  )
static

Returns the name of a given channel type.

For example, this method may return "Surround Left".

static String AudioChannelSet::getAbbreviatedChannelTypeName ( ChannelType  )
static

Returns the abbreviated name of a channel type.

For example, this method may return "Ls".

void AudioChannelSet::addChannel ( ChannelType  newChannelType)

Adds a channel to the set.

Referenced by AudioUnitHelpers::CoreAudioChannelBitmapToJuceType(), and toString().

int AudioChannelSet::size ( ) const
noexcept
bool AudioChannelSet::isDisabled ( ) const
noexcept

Returns the number of channels in the set.

References operator!=(), operator<(), and operator==().

Referenced by AudioUnitHelpers::getAUChannelInfo().

Array<ChannelType> AudioChannelSet::getChannelTypes ( ) const

Returns an array of all the types in this channel set.

Referenced by AudioUnitHelpers::auChannelIndexToJuce(), and toString().

ChannelType AudioChannelSet::getTypeOfChannel ( int  channelIndex) const
noexcept

Returns the type of one of the channels in the set, by index.

Referenced by AudioUnitHelpers::juceChannelIndexToAu().

int AudioChannelSet::getChannelIndexForType ( ChannelType  type) const
noexcept

Returns the index for a particular channel-type.

Will return -1 if the this set does not contain a channel of this type.

String AudioChannelSet::getSpeakerArrangementAsString ( ) const

Returns a string containing a whitespace-separated list of speaker types corresponding to each channel.

For example in a 5.1 arrangement, the string may be "L R C Lfe Ls Rs". If the speaker arrangement is unknown, the returned string will be empty.

String AudioChannelSet::getDescription ( ) const

Returns the description of the current layout.

For example, this method may return "Quadraphonic". Note that the returned string may not be unique.

bool AudioChannelSet::isDiscreteLayout ( ) const
noexcept

Returns if this is a channel layout made-up of discrete channels.

Referenced by PluginBusUtilities::getDefaultLayoutForChannelNumAndBus().

bool AudioChannelSet::operator== ( const AudioChannelSet ) const
noexcept
bool AudioChannelSet::operator!= ( const AudioChannelSet ) const
noexcept
bool AudioChannelSet::operator< ( const AudioChannelSet ) const
noexcept

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