MezzanineEngine March 18, 2012

Mezzanine::AudioManager Class Reference

This is simply a place for storing all the Sound utilities and functions. More...

#include <audiomanager.h>

Inheritance diagram for Mezzanine::AudioManager:
Mezzanine::ManagerBase Mezzanine::Singleton< AudioManager >

List of all members.

Public Member Functions

 AudioManager (bool DefaultSettings=true)
 Class Constructor.
virtual ~AudioManager ()
 Class Destructor.
virtual void AddSoundToSoundSet (const String &SoundSetName, Audio::Sound *SoundInst)
 Add's a sound to the defined set.
virtual void ClearLogs ()
 This empties logs that the audio subystem creates.
virtual Audio::SoundCreateAmbientSound (ConstString &SoundName, ConstString &FileName, ConstString &Group)
 Creates an ambient sound instance from a file that can be used to play sounds.
virtual Audio::SoundCreateDialogSound (ConstString &SoundName, ConstString &FileName, ConstString &Group)
 Creates an dialog sound instance from a file that can be used to play sounds.
virtual Audio::SoundCreateEffectSound (ConstString &SoundName, ConstString &FileName, ConstString &Group)
 Creates an effect sound instance from a file that can be used to play sounds.
virtual Audio::SoundCreateMusicSound (ConstString &SoundName, ConstString &FileName, ConstString &Group)
 Creates an music sound instance from a file that can be used to play sounds.
virtual Audio::SoundSetCreateSoundSet (const String &SoundSetName)
 Creates a sound set.
virtual void DestroyAllSounds ()
 Deletes all stored sounds.
virtual void DestroySound (Audio::Sound *ToBeDestroyed)
 Deletes a Sound.
virtual void DoMainLoopItems ()
virtual Real GetAmbientVolume () const
 Gets the currently set Ambient volume.
virtual Whole GetAvailableDeviceCount () const
 Gets the number of available devices.
virtual String GetAvailableDeviceNameByIndex (const Whole &Index) const
 Gets the name of an available device.
virtual cAudio::IAudioManager * GetcAudioManager () const
 Gets the internal cAudioManager this manager is based on.
virtual String GetDefaultDeviceName () const
 Gets the name of the default device.
virtual Real GetDialogVolume () const
 Gets the currently set Dialog volume.
virtual Real GetEffectVolume () const
 Gets the currently set Effect volume.
virtual Audio::ListenerGetListener () const
 Retrieve's the listener for this sound manager.
virtual std::stringstream * GetLogs () const
 This gets the logs that the audio subystem creates.
virtual Real GetMasterVolume () const
 Gets the currently set Master volume.
virtual Audio::MusicPlayerGetMusicPlayer () const
 Gets the Music Player for this sound manager.
virtual Real GetMusicVolume () const
 Gets the currently set Music volume.
virtual Audio::SoundGetSoundByName (const String &SoundName) const
 Gets a sound by it's name.
virtual Audio::SoundSetGetSoundSet (const String &SoundSetName) const
 Gets an existing sound set.
virtual
ManagerBase::ManagerTypeName 
GetType () const
virtual void Initialize ()
virtual void InitializeManager (ConstString &DeviceName, int OutputFrequency=-1, int EAXEffectSlots=4)
 Initializes the Manager.
virtual bool IsMuted () const
 Gets whether or not the Audio subsystem is muted.
virtual void Mute (bool Enable)
 Sets whether or not to mute all Audio.
virtual void SetAmbientVolume (const Real &Ambient)
 Sets the volume for all stored Ambient sounds.
virtual void SetDialogVolume (const Real &Dialog)
 Sets the volume for all stored Dialog sounds.
virtual void SetEffectVolume (const Real &Effect)
 Sets the volume for all stored Effect sounds.
virtual void SetMasterVolume (const Real &Master)
 Sets the volume for all stored sounds.
virtual void SetMusicVolume (const Real &Music)
 Sets the volume for all stored Music sounds.
virtual void UpdateAllVolumes ()
 Calls on all sounds stored in this manager to update their volume after a settings change.

Protected Attributes

std::vector< Audio::Sound * > AmbientSounds
Real AmbientVolume
cAudio::IAudioManager * cAudioManager
std::vector< Audio::Sound * > DialogSounds
Real DialogVolume
std::vector< Audio::Sound * > EffectSounds
Real EffectVolume
Audio::ListenerListener
Real MasterVolume
Audio::MusicPlayerMusicPlayer
std::vector< Audio::Sound * > MusicSounds
Real MusicVolume
bool Muted
Real MuteStandby
std::map< String, Audio::Sound * > Sounds
std::map< String,
Audio::SoundSet * > 
SoundSets

Detailed Description

This is simply a place for storing all the Sound utilities and functions.

This is a place for loading, storing, and running sound files as necessary in a given game.

Definition at line 77 of file audiomanager.h.


Constructor & Destructor Documentation

Mezzanine::AudioManager::AudioManager ( bool  DefaultSettings = true)

Class Constructor.

This is the class constructor. It gives you the option to start up the manager with default values if you choose. If not then you'll need to setup and initialize the manager yourself after it is constructed.

Parameters:
DefaultSettingsWhether or not to load default settings and initialize the manager immediately.

Definition at line 55 of file audiomanager.cpp.

Mezzanine::AudioManager::~AudioManager ( ) [virtual]

Class Destructor.

The class destructor.

Definition at line 69 of file audiomanager.cpp.


Member Function Documentation

void Mezzanine::AudioManager::AddSoundToSoundSet ( const String SoundSetName,
Audio::Sound SoundInst 
) [virtual]

Add's a sound to the defined set.

This function will add a sound instance to a created sound set.

Parameters:
SoundNameThe sound instance to be added.

Definition at line 151 of file audiomanager.cpp.

void Mezzanine::AudioManager::ClearLogs ( ) [virtual]

This empties logs that the audio subystem creates.

Internally the Mezzanine engine currently uses cAudio to process 3d sound. It has it's own logging system that we have customized to work with our logger. This clears that data allow us to work with it as we need

Definition at line 277 of file audiomanager.cpp.

Audio::Sound * Mezzanine::AudioManager::CreateAmbientSound ( ConstString SoundName,
ConstString FileName,
ConstString Group 
) [virtual]

Creates an ambient sound instance from a file that can be used to play sounds.

Parameters:
SoundNameThe name of the Sound instance.
FileNameThe name of the file.
GroupThe resource group in which the file resides.
Returns:
Returns a pointer to the Sound Instance that was created.

Definition at line 75 of file audiomanager.cpp.

Audio::Sound * Mezzanine::AudioManager::CreateDialogSound ( ConstString SoundName,
ConstString FileName,
ConstString Group 
) [virtual]

Creates an dialog sound instance from a file that can be used to play sounds.

Parameters:
SoundNameThe name of the Sound instance.
FileNameThe name of the file.
GroupThe resource group in which the file resides.
Returns:
Returns a pointer to the Sound Instance that was created.

Definition at line 83 of file audiomanager.cpp.

Audio::Sound * Mezzanine::AudioManager::CreateEffectSound ( ConstString SoundName,
ConstString FileName,
ConstString Group 
) [virtual]

Creates an effect sound instance from a file that can be used to play sounds.

Parameters:
SoundNameThe name of the Sound instance.
FileNameThe name of the file.
GroupThe resource group in which the file resides.
Returns:
Returns a pointer to the Sound Instance that was created.

Definition at line 91 of file audiomanager.cpp.

Audio::Sound * Mezzanine::AudioManager::CreateMusicSound ( ConstString SoundName,
ConstString FileName,
ConstString Group 
) [virtual]

Creates an music sound instance from a file that can be used to play sounds.

Parameters:
SoundNameThe name of the Sound instance.
FileNameThe name of the file.
GroupThe resource group in which the file resides.
Returns:
Returns a pointer to the Sound Instance that was created.

Definition at line 99 of file audiomanager.cpp.

Audio::SoundSet * Mezzanine::AudioManager::CreateSoundSet ( const String SoundSetName) [virtual]

Creates a sound set.

This function will create a sound set vector you can use to store similiar sound instances.

Parameters:
SoundSetNameThe name you wish the sound set to have.
Returns:
Returns a pointer to the created Vector.

Definition at line 137 of file audiomanager.cpp.

void Mezzanine::AudioManager::DestroySound ( Audio::Sound ToBeDestroyed) [virtual]

Deletes a Sound.

Parameters:
SoundNameA pointer to the Sound you want deleted.

Definition at line 114 of file audiomanager.cpp.

void Mezzanine::AudioManager::DoMainLoopItems ( ) [virtual]

The main loop calls this once per frame.

This is where each manager is expected to put anything that needs to be run each iteration of the main loop

Implements Mezzanine::ManagerBase.

Definition at line 305 of file audiomanager.cpp.

Real Mezzanine::AudioManager::GetAmbientVolume ( ) const [virtual]

Gets the currently set Ambient volume.

Returns:
Returns a Real representing the current Ambient volume.

Definition at line 166 of file audiomanager.cpp.

Whole Mezzanine::AudioManager::GetAvailableDeviceCount ( ) const [virtual]

Gets the number of available devices.

This function will return the total number of available devices, including the default.

Returns:
Returns the number of available devices.

Definition at line 267 of file audiomanager.cpp.

String Mezzanine::AudioManager::GetAvailableDeviceNameByIndex ( const Whole Index) const [virtual]

Gets the name of an available device.

This function will retrieve the name of a device by it's index on the sound managers device list.

Parameters:
IndexThe position on the device list you wish to access the name of.
Returns:
Returns the name of the device.

Definition at line 253 of file audiomanager.cpp.

cAudio::IAudioManager * Mezzanine::AudioManager::GetcAudioManager ( ) const [virtual]

Gets the internal cAudioManager this manager is based on.

Returns:
Returns a pointer to the internal cAudio manager.

Definition at line 297 of file audiomanager.cpp.

String Mezzanine::AudioManager::GetDefaultDeviceName ( ) const [virtual]

Gets the name of the default device.

This function will return the name of the system default device.

Returns:
Returns the name of the default device.

Definition at line 260 of file audiomanager.cpp.

Real Mezzanine::AudioManager::GetDialogVolume ( ) const [virtual]

Gets the currently set Dialog volume.

Returns:
Returns a Real representing the current Dialog volume.

Definition at line 180 of file audiomanager.cpp.

Real Mezzanine::AudioManager::GetEffectVolume ( ) const [virtual]

Gets the currently set Effect volume.

Returns:
Returns a Real representing the current Effect volume.

Definition at line 194 of file audiomanager.cpp.

Audio::Listener * Mezzanine::AudioManager::GetListener ( ) const [virtual]

Retrieve's the listener for this sound manager.

This function will return the listener for this manager which can be used to help create 3D sound.

Returns:
Returns a pointer to the managers Sound Listener.

Definition at line 287 of file audiomanager.cpp.

std::stringstream * Mezzanine::AudioManager::GetLogs ( ) const [virtual]

This gets the logs that the audio subystem creates.

Internally the Mezzanine engine currently uses cAudio to process 3d sound. It has it's own logging system that we have customized to work with our logger.

Returns:
This gets the log of what actions the audio system has performed

Definition at line 272 of file audiomanager.cpp.

Real Mezzanine::AudioManager::GetMasterVolume ( ) const [virtual]

Gets the currently set Master volume.

Returns:
Returns a Real representing the current Master volume.

Definition at line 219 of file audiomanager.cpp.

Audio::MusicPlayer * Mezzanine::AudioManager::GetMusicPlayer ( ) const [virtual]

Gets the Music Player for this sound manager.

Returns:
Returns a pointer to the managers Music Player.

Definition at line 292 of file audiomanager.cpp.

Real Mezzanine::AudioManager::GetMusicVolume ( ) const [virtual]

Gets the currently set Music volume.

Returns:
Returns a Real representing the current Music volume.

Definition at line 208 of file audiomanager.cpp.

Audio::Sound * Mezzanine::AudioManager::GetSoundByName ( const String SoundName) const [virtual]

Gets a sound by it's name.

Returns:
Returns a pointer to the specified sound.

Definition at line 107 of file audiomanager.cpp.

Audio::SoundSet * Mezzanine::AudioManager::GetSoundSet ( const String SoundSetName) const [virtual]

Gets an existing sound set.

This function will find the specified sound set and return a pointer to it.

Parameters:
SoundSetNameThe name of the sound set to retrieve.
Returns:
Returns a pointer to the named Vector.

Definition at line 144 of file audiomanager.cpp.

ManagerBase::ManagerTypeName Mezzanine::AudioManager::GetType ( ) const [virtual]

This returns the type of this manager.

This is intended to make using and casting from Manager base easier. With this is is possible to cast from ManagerBase to the correct Manager Type.

Returns:
This returns a ManagerTypeName to identify what this can be safely cast to.

Implements Mezzanine::ManagerBase.

Definition at line 308 of file audiomanager.cpp.

void Mezzanine::AudioManager::Initialize ( ) [virtual]

Configure Items requiring other Managers.

If you are using the Mezzanine::World this is called when Mezzanine::World::GameInit() is called. It is expected that by the time this is called either ManagerBase::ManagerBase(World*) or ManagerBase::SetGameWorld(World*) will have been called. This is where all configuration that requires atleast one other manager on the Mezzanine::World to exist.

Yes we know it is spelled wrong, but are Zs cooler anyway.

Implements Mezzanine::ManagerBase.

Definition at line 302 of file audiomanager.cpp.

void Mezzanine::AudioManager::InitializeManager ( ConstString DeviceName,
int  OutputFrequency = -1,
int  EAXEffectSlots = 4 
) [virtual]

Initializes the Manager.

This function will initialize the manager using the device and parameters provided. You need to call this function if you passed false into the sound manager constructor before you can use the manager.

Parameters:
DeviceNameThe name of the device you wish to have this manager interface with/use.
OutputFrequencyFrequency of the output audio, -1 for the devices default.
EAXEffectSlotsThe number of effects per sound allowed to be applied.

Definition at line 282 of file audiomanager.cpp.

bool Mezzanine::AudioManager::IsMuted ( ) const [virtual]

Gets whether or not the Audio subsystem is muted.

Returns:
Returns a bool indicating whether or not the Audio subsystem is currently muted.

Definition at line 240 of file audiomanager.cpp.

void Mezzanine::AudioManager::Mute ( bool  Enable) [virtual]

Sets whether or not to mute all Audio.

Parameters:
EnableWhether or not all sounds should be muted.

Definition at line 224 of file audiomanager.cpp.

void Mezzanine::AudioManager::SetAmbientVolume ( const Real Ambient) [virtual]

Sets the volume for all stored Ambient sounds.

Parameters:
AmbientThe volume to apply to all Ambient sounds.

Definition at line 157 of file audiomanager.cpp.

void Mezzanine::AudioManager::SetDialogVolume ( const Real Dialog) [virtual]

Sets the volume for all stored Dialog sounds.

Parameters:
DialogThe volume to apply to all Dialog sounds.

Definition at line 171 of file audiomanager.cpp.

void Mezzanine::AudioManager::SetEffectVolume ( const Real Effect) [virtual]

Sets the volume for all stored Effect sounds.

Parameters:
EffectThe volume to apply to all Effect sounds.

Definition at line 185 of file audiomanager.cpp.

void Mezzanine::AudioManager::SetMasterVolume ( const Real Master) [virtual]

Sets the volume for all stored sounds.

Parameters:
MusicThe volume to apply to all sounds.

Definition at line 213 of file audiomanager.cpp.

void Mezzanine::AudioManager::SetMusicVolume ( const Real Music) [virtual]

Sets the volume for all stored Music sounds.

Parameters:
MusicThe volume to apply to all Music sounds.

Definition at line 199 of file audiomanager.cpp.

void Mezzanine::AudioManager::UpdateAllVolumes ( ) [virtual]

Calls on all sounds stored in this manager to update their volume after a settings change.

Note:
You shouldn't need to call this manually as it is automatically called every time a setting is changed.

Definition at line 245 of file audiomanager.cpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines