[]Jimmy's World.org
I care not for your petty politics.
[]
Jimmy's World Games
Not a Member? - Login or Create an Account
[] Monday the 5th of January 2009 @ 11:55pm
News Journal Creative Writing Projects Your JW About

LibN2L-4 Library Code Reference

Classes
Compounds
Files
Members
Method Index
Full Reference

n2l::cAudioMixer Class Reference

A singleton class representing the audio mixing device provided by SDL_mixer. More...

#include <cAudioMixer.h>

Collaboration diagram for n2l::cAudioMixer:

Collaboration graph
[legend]
List of all members.

Public Types

Static Public Member Functions

Static Public Attributes

Classes

  • class cSubSysHolder

Detailed Description

A singleton class representing the audio mixing device provided by SDL_mixer.

Definition at line 45 of file cAudioMixer.h.


Member Typedef Documentation

typedef tUint n2l::cAudioMixer::tFrequency
 

Definition at line 56 of file cAudioMixer.h.

typedef tSint n2l::cAudioMixer::tMixChannels
 

Definition at line 57 of file cAudioMixer.h.


Member Enumeration Documentation

enum n2l::cAudioMixer::tFadeStatus
 

Enumerator:
Fading_None 
Fading_Out 
Fading_In 

Definition at line 71 of file cAudioMixer.h.

enum n2l::cAudioMixer::tFormat
 

Enumerator:
Format_U8 
Format_S8 
Format_U16LSB 
Format_S16LSB 
Format_U16MSB 
Format_S16MSB 
Format_U16SYS 
Format_S16SYS 
Format_Unknown 

Definition at line 59 of file cAudioMixer.h.

enum n2l::cAudioMixer::tSoundChannels
 

Enumerator:
Channels_Mono 
Channels_Stereo 

Definition at line 77 of file cAudioMixer.h.

enum n2l::cAudioMixer::tSoundDriver
 

Enumerator:
SoundDriver_Auto 
SoundDriver_OpenBSD 
SoundDriver_DSP 
SoundDriver_ALSA 
SoundDriver_Audio 
SoundDriver_AL 
SoundDriver_ARTSC 
SoundDriver_ESD 
SoundDriver_NAS 
SoundDriver_DMA 
SoundDriver_DSound 
SoundDriver_WaveOut 
SoundDriver_BeOS 
SoundDriver_MacOSSoundManager 
SoundDriver_AIX 
SoundDriver_AHI 
SoundDriver_Disk 
SoundDriver_Null 
SoundDriver_NumSoundDrivers 

Definition at line 82 of file cAudioMixer.h.


Member Function Documentation

void n2l::cAudioMixer::allocateMixingChannels const tMixChannels  iNum  )  [static]
 

Definition at line 242 of file cAudioMixer.cpp.

void n2l::cAudioMixer::channelVolume const tAudioChannel  iChannel,
const tFloat iVolume
[static]
 

Definition at line 343 of file cAudioMixer.cpp.

References n2l::asString(), n2l::n2lMax(), and n2l::n2lMin().

void n2l::cAudioMixer::closeAudio  )  [static]
 

Close the audio mixer and clean up.

Calling this method is optional, as it will be called automatically when the program is ended anyway.

Note:
It is safe to call this method even if the audio system is not currently configured.

Definition at line 138 of file cAudioMixer.cpp.

References n2l::releaseSDLSubSystem(), and n2l::SDLSubSystemInitFlag_Audio.

const tString & n2l::cAudioMixer::driverName  )  [static]
 

Definition at line 377 of file cAudioMixer.cpp.

const tString & n2l::cAudioMixer::driverName const tSoundDriver iDriver  )  [static]
 

Definition at line 358 of file cAudioMixer.cpp.

References SoundDriver_Auto, and SoundDriver_NumSoundDrivers.

void n2l::cAudioMixer::fadeOutMusic const tUint  iMilliseconds  )  [static]
 

Definition at line 318 of file cAudioMixer.cpp.

References MusicChannel.

const cAudioMixer::tFormat n2l::cAudioMixer::format  )  [static]
 

Definition at line 160 of file cAudioMixer.cpp.

References Format_S16LSB, Format_S16MSB, Format_S8, Format_U16LSB, Format_U16MSB, Format_U8, Format_Unknown, and frequency().

Referenced by formatAsString(), frequency(), sampleSize(), and soundChannels().

const tString & n2l::cAudioMixer::formatAsString  )  [static]
 

Definition at line 196 of file cAudioMixer.cpp.

References format(), and frequency().

const cAudioMixer::tFrequency n2l::cAudioMixer::frequency  )  [static]
 

Definition at line 148 of file cAudioMixer.cpp.

References format().

Referenced by format(), formatAsString(), n2l::cAudioChunk::load(), and soundChannels().

const cAudioMixer::tSoundDriver n2l::cAudioMixer::getDriver  )  [static]
 

Definition at line 81 of file cAudioMixer.cpp.

static const tBool n2l::cAudioMixer::inited  )  [inline, static]
 

Definition at line 179 of file cAudioMixer.h.

Referenced by n2l::cAudioChunk::length(), n2l::cMusic::load(), n2l::cAudioChunk::load(), n2l::cMusic::play(), n2l::cAudioChunk::play(), n2l::cAudioChunk::playAtPos(), and n2l::cAudioChunk::size().

const cAudioMixer::tFadeStatus n2l::cAudioMixer::musicFadeStatus  )  [static]
 

Definition at line 332 of file cAudioMixer.cpp.

References Fading_None, and MusicChannel.

void n2l::cAudioMixer::musicVolume const tFloat  iVolume  )  [static]
 

Set the music playing volume to a percentage of maximum.

Note:
The volume provided is clamped [0.0 -> 1.0]

Definition at line 305 of file cAudioMixer.cpp.

References MusicChannel, n2l::n2l_max(), and n2l::n2l_min().

void n2l::cAudioMixer::musicVolume const tSint  iVolume  )  [static]
 

Definition at line 294 of file cAudioMixer.cpp.

References MusicChannel.

const tUint n2l::cAudioMixer::numChannels  )  [static]
 

Return the total number of channels.

Note:
This number will not include the music channel if a channel is being used to fake the music player.

This method should be used rather than adding the results of numChannelsPlaying and numFreeChannels since theoretically channel status could change between calls.

Definition at line 285 of file cAudioMixer.cpp.

const tUint n2l::cAudioMixer::numChannelsPlaying  )  [static]
 

Return the number of channels currently playing.

Note:
If music is being faked on an audio channel, it is not returned in the count, even if music is currently playing.

Definition at line 264 of file cAudioMixer.cpp.

References MusicChannel.

Referenced by numFreeChannels().

const tUint n2l::cAudioMixer::numFreeChannels  )  [static]
 

Return the number of mixing channels which are currently not in use.

Note:
If music is being faked on an audio channel but is not currently playing, the music channel will still not be returned.

Definition at line 276 of file cAudioMixer.cpp.

References numChannelsPlaying().

void n2l::cAudioMixer::openAudio const tFrequency  iFrequency = DefaultFrequency,
const tFormat  iFormat = DefaultFormat,
const tSoundChannels  iSoundChannels = DefaultSoundChannels,
const tSint  iChunkSize = DefaultChunkSize
[static]
 

Definition at line 87 of file cAudioMixer.cpp.

References DefaultMixingChannels, n2l::n2lSetEnv(), n2l::n2lUnsetEnv(), n2l::requireSDLSubSystem(), n2l::SDLSubSystemInitFlag_Audio, SoundDriver_Auto, and SoundDriver_Null.

void n2l::cAudioMixer::registerSource cAudioSource ioSource  )  [static]
 

Connects an audioSource to the mixer to be informed when an audio sample has finished playing on a channel.

After the sample has finished playing the registration is automatically removed.

Note:
Users shouldn't call this method manually.

Definition at line 383 of file cAudioMixer.cpp.

References n2l::cAudioSource::currentChannel().

Referenced by n2l::cAudioSource::play().

const tUint n2l::cAudioMixer::sampleSize  )  [static]
 

Return the size of a single data sample in bytes, will be 1 for 8-bit formats, 2 for 16 or 0 for unknown.

Definition at line 181 of file cAudioMixer.cpp.

References format(), Format_S16LSB, Format_S16MSB, Format_S8, Format_U16LSB, Format_U16MSB, and Format_U8.

Referenced by n2l::cAudioChunk::load().

void n2l::cAudioMixer::setDriver const tSoundDriver iDriver  )  [static]
 

Definition at line 74 of file cAudioMixer.cpp.

const cAudioMixer::tSoundChannels n2l::cAudioMixer::soundChannels  )  [static]
 

Definition at line 228 of file cAudioMixer.cpp.

References Channels_Mono, Channels_Stereo, format(), and frequency().

Referenced by n2l::cAudioChunk::load().

void n2l::cAudioMixer::unregisterSource cAudioSource ioSource  )  [static]
 

Definition at line 392 of file cAudioMixer.cpp.

References n2l::cAudioSource::currentChannel().

Referenced by n2l::cAudioSource::stop().


Member Data Documentation

const tSint n2l::cAudioMixer::DefaultChunkSize = 4096 [static]
 

Definition at line 109 of file cAudioMixer.h.

const cAudioMixer::tFormat n2l::cAudioMixer::DefaultFormat [static]
 

Initial value:

        cAudioMixer::tFormat(MIX_DEFAULT_FORMAT)

Definition at line 107 of file cAudioMixer.h.

const cAudioMixer::tFrequency n2l::cAudioMixer::DefaultFrequency [static]
 

Initial value:

        cAudioMixer::tFrequency(MIX_DEFAULT_FREQUENCY)

Definition at line 106 of file cAudioMixer.h.

const cAudioMixer::tMixChannels n2l::cAudioMixer::DefaultMixingChannels = 8 [static]
 

Definition at line 110 of file cAudioMixer.h.

Referenced by openAudio().

const cAudioMixer::tSoundChannels n2l::cAudioMixer::DefaultSoundChannels [static]
 

Initial value:

Definition at line 108 of file cAudioMixer.h.

const cAudioMixer::tMixChannels n2l::cAudioMixer::MusicChannel = 0 [static]
 

Definition at line 112 of file cAudioMixer.h.

Referenced by fadeOutMusic(), musicFadeStatus(), musicVolume(), numChannelsPlaying(), and n2l::cMusic::play().

cAutoPtr< cAudioMixer::cSubSysHolder > n2l::cAudioMixer::smSubSysHolder [static]
 

Initial value:

        new cAudioMixer::cSubSysHolder()

Definition at line 114 of file cAudioMixer.h.


The documentation for this class was generated from the following files:
©2009 Aaron Cameron
Benchmarks