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

An enum wrapper class that specifies the type of a sample of audio data. More...

#include <omSoundSampleType.h>

Public Types

enum  Enum {
  SAMPLE_8, SAMPLE_16, SAMPLE_24, SAMPLE_32,
  SAMPLE_64, SAMPLE_32F, SAMPLE_64F, UNDEFINED
}
 The underlying enum type that specifies the type of a sample of audio data. More...
 

Public Member Functions

 SampleType ()
 Create a new sample type with the undefined sample type enum value. More...
 
 SampleType (Enum newType)
 Create a new sample type with the specified sample type enum value. More...
 
 operator Enum () const
 Convert this sample type to an enum value. More...
 
Size getSizeInBytes () const
 Get the size in bytes that this sample type occupies. More...
 
Bool isIntegral () const
 Return whether or not this sample type is an integer-based sample type. More...
 
Bool isFloatingPoint () const
 Return whether or not this sample type is a floating-point-based sample type. More...
 
data::String toString () const
 Return a string representation of the sample type. More...
 
 operator data::String () const
 Convert this sample type into a string representation. More...
 

Detailed Description

An enum wrapper class that specifies the type of a sample of audio data.

In addition to providing conversion operator to and from the underlying enum type, the class also provides a way to query the size in bytes of a given sample type, avoiding the need for an external switch statement.

Member Enumeration Documentation

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

Enumerator
SAMPLE_8 

An 8-bit signed integer sample, stored in native endian format.

SAMPLE_16 

A 16-bit signed integer sample, stored in native endian format.

SAMPLE_24 

A 24-bit signed integer sample, stored in native endian format.

SAMPLE_32 

A 32-bit signed integer sample, stored in native endian format.

SAMPLE_64 

A 64-bit signed integer sample, stored in native endian format.

SAMPLE_32F 

A 32-bit floating point sample, stored in native endian format.

SAMPLE_64F 

A 64-bit floating point sample, stored in native endian format.

UNDEFINED 

An undefined/unsupported sample type.

Constructor & Destructor Documentation

om::sound::base::SampleType::SampleType ( )
inline

Create a new sample type with the undefined sample type enum value.

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

Create a new sample type with the specified sample type enum value.

Member Function Documentation

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

Convert this sample type to an enum value.

This operator is provided so that the SampleType 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 sample type.
Size om::sound::base::SampleType::getSizeInBytes ( ) const
inline

Get the size in bytes that this sample type occupies.

Bool om::sound::base::SampleType::isIntegral ( ) const
inline

Return whether or not this sample type is an integer-based sample type.

Bool om::sound::base::SampleType::isFloatingPoint ( ) const
inline

Return whether or not this sample type is a floating-point-based sample type.

data::String om::sound::base::SampleType::toString ( ) const

Return a string representation of the sample type.

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

Convert this sample type into a string representation.


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