Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

CAudioManager Class Reference

#include <AudioManager.h>

List of all members.

Public Member Functions

 CAudioManager (void)
 ~CAudioManager (void)
void Init (void)
void SetListenerPosition (SPosition *p)
int CreateSource (void)
void SetSourcePosition (int name, SPosition *p)
void SetSourcePosition (int name, SVector *v)
void SetSourceDirection (int name, SVector *v)
void SetSourceVelocity (int name, SVector *v)
void SetSourceFrequency (int name, float freqScalar)
void AssignSfx (int source, int buffer)
int CreateSfx (PFS *pfs, const char *wavfile)
int IsValidSfx (int name)
int PlaySfx (int source, PFS *pfs, const char *wavfile)
int PlaySfx (int source, int name)
int PlaySfxDelay (int source, PFS *pfs, const char *wavfile, float delay, float *length)
int PlaySfxDelay (int source, int name, float delay, float *length)
void StopSfx (int name)
void StopSfxByUserData (int user1, int user2)
void SetSfxVolume (int name, float volume)
void SetSfxPosition (int name, SPosition *p)
void SetSfxPosition (int name, SVector *v)
void SetSfxDirection (int name, SVector *v)
void SetSfxVelocity (int name, SVector *v)
void SetSfxFrequency (int name, float freqScalar)
void SetSfxUserData (int name, int user1, int user2)

Public Attributes

std::map< std::string, CSoundEffect * > cache
SPosition listenerPos

Private Member Functions

CSoundEffectGetSoundEffect (int name)
CSoundEffectGetFirstSoundEffectByUserData (int user1, int user2)
CSoundEffectGetNextSoundEffectByUserData (int user1, int user2)

Private Attributes

std::map< std::string, CSoundEffect
* >::iterator 
iterUserData


Detailed Description

CAudioManager provides application control of all sound effects. The methods are modelled after the audio API functions in the Fly! SDK.

Definition at line 75 of file AudioManager.h.


Constructor & Destructor Documentation

CAudioManager::CAudioManager void   ) 
 

Definition at line 102 of file AudioManager.cpp.

CAudioManager::~CAudioManager void   ) 
 

Definition at line 109 of file AudioManager.cpp.

References cache.


Member Function Documentation

void CAudioManager::AssignSfx int  source,
int  buffer
 

Definition at line 436 of file AudioManager.cpp.

References globals, SGlobals::logWarning, and CLogFile::Write().

Referenced by PlaySfx().

int CAudioManager::CreateSfx PFS pfs,
const char *  wavfile
 

Definition at line 251 of file AudioManager.cpp.

References CSoundEffect::bound, cache, data, gtfo, CSoundEffect::name, pclose(), popen(), pread(), PODFILE::size, and CSoundEffect::wavfile.

Referenced by CRockerSwitch::ReadFinished(), CKAFireExtinguisherButton::ReadFinished(), CMasterCautionWarningButtonGauge::ReadFinished(), CSimpleFloatSwitch::ReadFinished(), CSimpleInOutStateSwitch::ReadFinished(), CSimpleSwitch::ReadFinished(), and CGyroSlavingGauge::ReadFinished().

int CAudioManager::CreateSource void   ) 
 

Definition at line 215 of file AudioManager.cpp.

References gtfo.

Referenced by CSituation::CSituation().

CSoundEffect * CAudioManager::GetFirstSoundEffectByUserData int  user1,
int  user2
[private]
 

Definition at line 378 of file AudioManager.cpp.

References CSoundEffect::user1, and CSoundEffect::user2.

Referenced by StopSfxByUserData().

CSoundEffect * CAudioManager::GetNextSoundEffectByUserData int  user1,
int  user2
[private]
 

Definition at line 405 of file AudioManager.cpp.

References CSoundEffect::user1, and CSoundEffect::user2.

Referenced by StopSfxByUserData().

CSoundEffect * CAudioManager::GetSoundEffect int  name  )  [private]
 

Definition at line 354 of file AudioManager.cpp.

References cache, and CSoundEffect::name.

Referenced by IsValidSfx(), PlaySfx(), PlaySfxDelay(), SetSfxDirection(), SetSfxFrequency(), SetSfxPosition(), SetSfxUserData(), SetSfxVolume(), and StopSfx().

void CAudioManager::Init void   ) 
 

Definition at line 135 of file AudioManager.cpp.

References gtfo, and listenerPos.

Referenced by InitGlobalsNoPodFilesystem().

int CAudioManager::IsValidSfx int  name  ) 
 

Definition at line 427 of file AudioManager.cpp.

References GetSoundEffect().

int CAudioManager::PlaySfx int  source,
int  name
 

Todo:
Does the source need to be stopped?

Definition at line 457 of file AudioManager.cpp.

References AssignSfx(), GetSoundEffect(), globals, SGlobals::logWarning, CSoundEffect::name, and CLogFile::Write().

int CAudioManager::PlaySfx int  source,
PFS pfs,
const char *  wavfile
 

Referenced by CSimpleSwitch::DecState(), CSimpleSwitch::IncState(), CBasicMagnetoSwitch::MouseClick(), CBasicBatterySwitch::MouseClick(), CSimpleInOutStateSwitch::MouseClick(), and CBasicMagnetoSwitch::StopClick().

int CAudioManager::PlaySfxDelay int  source,
int  name,
float  delay,
float *  length
 

Definition at line 491 of file AudioManager.cpp.

References GetSoundEffect(), globals, SGlobals::logWarning, CSoundEffect::name, and CLogFile::Write().

int CAudioManager::PlaySfxDelay int  source,
PFS pfs,
const char *  wavfile,
float  delay,
float *  length
 

void CAudioManager::SetListenerPosition SPosition p  ) 
 

Definition at line 204 of file AudioManager.cpp.

References SPosition::alt, SPosition::lat, listenerPos, and SPosition::lon.

void CAudioManager::SetSfxDirection int  name,
SVector v
 

Definition at line 636 of file AudioManager.cpp.

References GetSoundEffect(), globals, SGlobals::logWarning, CLogFile::Write(), SVector::x, SVector::y, and SVector::z.

void CAudioManager::SetSfxFrequency int  name,
float  freqScalar
 

Definition at line 677 of file AudioManager.cpp.

References GetSoundEffect(), globals, SGlobals::logWarning, and CLogFile::Write().

void CAudioManager::SetSfxPosition int  name,
SVector v
 

Definition at line 615 of file AudioManager.cpp.

References GetSoundEffect(), globals, SGlobals::logWarning, CLogFile::Write(), SVector::x, SVector::y, and SVector::z.

void CAudioManager::SetSfxPosition int  name,
SPosition p
 

Todo:
Calculate offset distance in audio 3D space coordinates

Definition at line 599 of file AudioManager.cpp.

void CAudioManager::SetSfxUserData int  name,
int  user1,
int  user2
 

Definition at line 706 of file AudioManager.cpp.

References GetSoundEffect(), CSoundEffect::user1, and CSoundEffect::user2.

void CAudioManager::SetSfxVelocity int  name,
SVector v
 

Todo:
SetSfxVelocity

Definition at line 662 of file AudioManager.cpp.

void CAudioManager::SetSfxVolume int  name,
float  volume
 

Definition at line 569 of file AudioManager.cpp.

References GetSoundEffect(), globals, SGlobals::logWarning, and CLogFile::Write().

void CAudioManager::SetSourceDirection int  name,
SVector v
 

void CAudioManager::SetSourceFrequency int  name,
float  freqScalar
 

void CAudioManager::SetSourcePosition int  name,
SVector v
 

void CAudioManager::SetSourcePosition int  name,
SPosition p
 

void CAudioManager::SetSourceVelocity int  name,
SVector v
 

void CAudioManager::StopSfx int  name  ) 
 

Definition at line 516 of file AudioManager.cpp.

References GetSoundEffect(), globals, SGlobals::logWarning, and CLogFile::Write().

void CAudioManager::StopSfxByUserData int  user1,
int  user2
 

Definition at line 543 of file AudioManager.cpp.

References GetFirstSoundEffectByUserData(), GetNextSoundEffectByUserData(), globals, SGlobals::logWarning, and CLogFile::Write().


Member Data Documentation

std::map<std::string,CSoundEffect*> CAudioManager::cache
 

Definition at line 124 of file AudioManager.h.

Referenced by CreateSfx(), GetSoundEffect(), and ~CAudioManager().

std::map<std::string,CSoundEffect*>::iterator CAudioManager::iterUserData [private]
 

Definition at line 131 of file AudioManager.h.

SPosition CAudioManager::listenerPos
 

Definition at line 127 of file AudioManager.h.

Referenced by Init(), and SetListenerPosition().


The documentation for this class was generated from the following files:
SourceForge.net Logo Documentation generated by doxygen