Om  1.0.0
A universal framework for multimedia simulation
Public Types | Public Member Functions | List of all members
om::sound::base::ChannelType Class Reference

An enum wrapper class that specifies the semantic usage of a channel of audio. More...

#include <omSoundChannelType.h>

Public Types

enum  Enum {
  LEFT = 0, FRONT_LEFT = LEFT, RIGHT = 1, FRONT_RIGHT = RIGHT,
  CENTER = 2, FRONT_CENTER = CENTER, LOW_FREQUENCY = 3, SURROUND_LEFT = 4,
  SURROUND_RIGHT = 5, BACK_LEFT = 6, BACK_RIGHT = 7, FRONT_LEFT_OF_CENTER = 8,
  FRONT_RIGHT_OF_CENTER = 9, BACK_CENTER = 10, MONO, UNDEFINED
}
 The underlying enum type that specifies the type of a sample of audio data. More...
 

Public Member Functions

 ChannelType ()
 Create a new channel type object with the undefined channel type enum value. More...
 
 ChannelType (Enum newType)
 Create a new channel type object with the specified channel type enum value. More...
 
 operator Enum () const
 Convert this channel type to an enum value. More...
 
Index getChannelIndex () const
 Return the cannonical channel index associated with this channel type. More...
 
Vector3f getPosition () const
 Return a 3D vector representing the cannonical position for this channel type's speaker. More...
 
String getAbbreviation () const
 Return a short abbreviation string for this channel type's string representation. More...
 
String toString () const
 Return a string representation of the channel type. More...
 
String getName () const
 Return a string representing a human-readable name of this channel type. More...
 
 operator data::String () const
 Convert this channel type into a string representation. More...
 

Detailed Description

An enum wrapper class that specifies the semantic usage of a channel of audio.

This class allows channels of audio to be tagged with their semantic usage. Classes that process that audio can then alter their processing depending on the semantic usage of the channel.

Member Enumeration Documentation

The underlying enum type that specifies the type of a sample of audio data.

Enumerator
LEFT 

The main front left channel in headphone, 2-channel, quad, and surround setups.

FRONT_LEFT 

The main front left channel in headphone, 2-channel, quad, and surround setups.

RIGHT 

The main front right channel in headphone, 2-channel, quad, and surround setups.

FRONT_RIGHT 

The main front right channel in headphone, 2-channel, quad, and surround setups.

CENTER 

The front center channel in surround setups.

FRONT_CENTER 

The front center channel in surround setups.

LOW_FREQUENCY 

A channel which carries low-frequency audio information only.

SURROUND_LEFT 

The left surround channel in quad and surround setups.

SURROUND_RIGHT 

The right surround channel in quad and surround setups.

BACK_LEFT 

The back left channel in 7.1 and higher surround setups.

BACK_RIGHT 

The back right channel in 7.1 and higher surround setups.

FRONT_LEFT_OF_CENTER 

The channel for a speaker positioned between the center speaker and the front left speaker.

FRONT_RIGHT_OF_CENTER 

The channel for a speaker positioned between the center speaker and the front right speaker.

BACK_CENTER 

The channel for a speaker positioned directly behind the listener.

MONO 

The channel type indicating a single channel speaker.

UNDEFINED 

An undefined channel type - the channel is used for an unknown purpose.

Constructor & Destructor Documentation

om::sound::base::ChannelType::ChannelType ( )
inline

Create a new channel type object with the undefined channel type enum value.

om::sound::base::ChannelType::ChannelType ( Enum  newType)
inline

Create a new channel type object with the specified channel type enum value.

Member Function Documentation

om::sound::base::ChannelType::operator Enum ( ) const
inline

Convert this channel type to an enum value.

This operator is provided so that the ChannelType object can be used directly in a switch statement without the need to explicitly access the underlying enum value.

Returns
the enum representation of this channel type.
Index om::sound::base::ChannelType::getChannelIndex ( ) const

Return the cannonical channel index associated with this channel type.

Vector3f om::sound::base::ChannelType::getPosition ( ) const

Return a 3D vector representing the cannonical position for this channel type's speaker.

The direction returned is in the right-handed 3D coordinate system where -z is forward, +x is to the right, and +y is up. The direction may not be accurate for all kinds of speaker layouts, but points to the general position where the speaker should be located.

Some channel types may have a length-zero position vector, indicating they are not positional, like MONO and LOW_FREQUENCY channels.

String om::sound::base::ChannelType::getAbbreviation ( ) const

Return a short abbreviation string for this channel type's string representation.

String om::sound::base::ChannelType::toString ( ) const

Return a string representation of the channel type.

String om::sound::base::ChannelType::getName ( ) const
inline

Return a string representing a human-readable name of this channel type.

om::sound::base::ChannelType::operator data::String ( ) const
inline

Convert this channel type into a string representation.


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