Om
1.0.0
A universal framework for multimedia simulation
|
An enum wrapper class that specifies various predefined types of channel layouts. More...
#include <omSoundChannelLayoutType.h>
Public Member Functions | |
ChannelLayoutType () | |
Create a new channel layout type object with the undefined channel layout type enum value. More... | |
ChannelLayoutType (Size numChannels) | |
Create a new channel layout type object for the specified number of channels. More... | |
ChannelLayoutType (ChannelLayout::Type newType) | |
Create a new channel layout type object with the specified channel layout type enum value. More... | |
Size | getChannelCount () const |
Return the number of channels of audio that are part of a stream with this channel layout type. More... | |
ChannelType | getChannelType (Index channelIndex) const |
Return the cannonical channel type for the specified channel index in this layout. More... | |
Vector3f | getChannelPosition (Index channelIndex) const |
Return the cannonical 3D position for the specified channel index in this layout. More... | |
operator ChannelLayout::Type () const | |
Convert this channel layout type to an enum value. More... | |
data::String | toString () const |
Return a string representation of the channel layout type. More... | |
data::String | getName () const |
Return a string representing the name of this channel layout type. More... | |
operator data::String () const | |
Convert this channel type into a string representation. More... | |
An enum wrapper class that specifies various predefined types of channel layouts.
See the ChannelLayout::Type declaration for more information on the predefined layout types.
|
inline |
Create a new channel layout type object with the undefined channel layout type enum value.
om::sound::base::ChannelLayoutType::ChannelLayoutType | ( | Size | numChannels | ) |
Create a new channel layout type object for the specified number of channels.
This constructor creates a layout type that is the cannonical semantic type for the given number of channels. For example, 1 = MONO, 2 = STEREO, 4 = QUAD, etc.
|
inline |
Create a new channel layout type object with the specified channel layout type enum value.
Size om::sound::base::ChannelLayoutType::getChannelCount | ( | ) | const |
Return the number of channels of audio that are part of a stream with this channel layout type.
If the channel layout type is ChannelType::CUSTOM or ChannelType::UNDEFINED, the method returns 0.
ChannelType om::sound::base::ChannelLayoutType::getChannelType | ( | Index | channelIndex | ) | const |
Return the cannonical channel type for the specified channel index in this layout.
If the index is invalid or the layout type has no channel type for that for that index, ChannelType::UNDEFINED is returned.
Vector3f om::sound::base::ChannelLayoutType::getChannelPosition | ( | Index | channelIndex | ) | const |
Return the cannonical 3D position for the specified channel index in this layout.
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.
|
inline |
Convert this channel layout type to an enum value.
This operator is provided so that the ChannelLayoutType object can be used directly in a switch statement without the need to explicitly access the underlying enum value.
data::String om::sound::base::ChannelLayoutType::toString | ( | ) | const |
Return a string representation of the channel layout type.
|
inline |
Return a string representing the name of this channel layout type.
|
inline |
Convert this channel type into a string representation.