#include <C4SoundSystem.h>
Public Member Functions | |
C4SoundSystem () | |
~C4SoundSystem () | |
void | Clear () |
void | Execute () |
int32_t | LoadEffects (C4Group &hGroup, const char *namespace_prefix, bool group_is_root) |
C4SoundInstance * | NewEffect (const char *szSound, bool fLoop=false, int32_t iVolume=100, C4Object *pObj=nullptr, int32_t iCustomFalloffDistance=0, int32_t iPitch=0, C4SoundModifier *modifier=nullptr) |
C4SoundInstance * | FindInstance (const char *szSound, C4Object *pObj) |
C4SoundInstance * | GetFirstInstance () const |
C4SoundInstance * | GetNextInstance (C4SoundInstance *prev) const |
bool | Init () |
void | ClearPointers (C4Object *pObj) |
C4SoundEffect * | GetFirstSound () const |
Public Attributes | |
C4SoundModifierList | Modifiers |
Protected Member Functions | |
void | ClearEffects () |
C4SoundEffect * | GetEffect (const char *szSound) |
int32_t | RemoveEffect (const char *szFilename) |
Protected Attributes | |
C4Group | SoundFile |
C4SoundEffect * | FirstSound {nullptr} |
bool | initialized {false} |
Definition at line 38 of file C4SoundSystem.h.
|
default |
|
default |
void C4SoundSystem::Clear | ( | ) |
Definition at line 57 of file C4SoundSystem.cpp.
References C4SoundModifierList::Clear(), ClearEffects(), C4Group::Close(), initialized, Modifiers, and SoundFile.
Referenced by C4Game::Clear(), C4Application::Clear(), and C4MainMenu::MenuCommand().
|
protected |
Definition at line 66 of file C4SoundSystem.cpp.
References FirstSound, and C4SoundEffect::Next.
Referenced by Clear(), and Init().
void C4SoundSystem::ClearPointers | ( | C4Object * | pObj | ) |
Definition at line 239 of file C4SoundSystem.cpp.
References FirstSound, and C4SoundEffect::Next.
Referenced by C4Game::ClearPointers().
void C4SoundSystem::Execute | ( | ) |
Definition at line 78 of file C4SoundSystem.cpp.
References Application, C4SoundEffect::Execute(), FirstSound, C4Application::MusicSystem, C4SoundEffect::Next, and C4MusicSystem::SelectContext().
Referenced by C4Application::GameTick().
C4SoundInstance * C4SoundSystem::FindInstance | ( | const char * | szSound, |
C4Object * | pObj | ||
) |
Definition at line 140 of file C4SoundSystem.cpp.
References C4MaxSoundName, DefaultExtension(), FirstSound, C4SoundEffect::Next, SCopy(), and WildcardMatch().
Referenced by GetSoundInstance(), SoundLevel(), SoundPan(), SoundPitch(), and StopSoundEffect().
|
protected |
Definition at line 91 of file C4SoundSystem.cpp.
References C4MaxSoundName, DefaultExtension(), FirstSound, IsWildcardString(), C4SoundEffect::Name, C4SoundEffect::Next, SCopy(), UnsyncedRandom(), and WildcardMatch().
Referenced by NewEffect().
C4SoundInstance * C4SoundSystem::GetFirstInstance | ( | ) | const |
Definition at line 245 of file C4SoundSystem.cpp.
References FirstSound, and C4SoundEffect::Next.
Referenced by C4SoundModifierList::SetGlobalModifier().
|
inline |
C4SoundInstance * C4SoundSystem::GetNextInstance | ( | C4SoundInstance * | prev | ) | const |
Definition at line 253 of file C4SoundSystem.cpp.
References C4SoundEffect::Next, C4SoundInstance::pEffect, and C4SoundInstance::pNext.
Referenced by C4SoundModifierList::SetGlobalModifier().
bool C4SoundSystem::Init | ( | ) |
Definition at line 35 of file C4SoundSystem.cpp.
References Application, C4CFN_Sound, C4MaxSoundInstances, ClearEffects(), C4SoundModifierList::Init(), initialized, C4MusicSystem::InitializeMOD(), C4Group::IsOpen(), LoadEffects(), Modifiers, C4MusicSystem::MODInitialized, C4Application::MusicSystem, C4Reloc::Open(), Reloc, and SoundFile.
Referenced by C4MainMenu::MenuCommand(), and C4Application::PreInit().
int32_t C4SoundSystem::LoadEffects | ( | C4Group & | hGroup, |
const char * | namespace_prefix, | ||
bool | group_is_root | ||
) |
Definition at line 158 of file C4SoundSystem.cpp.
References _MAX_FNAME, _MAX_FNAME_LEN, StdStrBuf::Append(), C4CFN_Sound, C4CFN_SoundFiles, C4CFN_SoundSubgroups, StdStrBuf::Copy(), C4Group::FindEntry(), C4Group::FindNextEntry(), FirstSound, StdStrBuf::getData(), C4SoundEffect::Load(), C4SoundEffect::Name, C4SoundEffect::Next, C4Group::OpenAsChild(), RemoveEffect(), C4Group::ResetSearch(), and SCopySegment().
Referenced by Init().
C4SoundInstance * C4SoundSystem::NewEffect | ( | const char * | szSound, |
bool | fLoop = false , |
||
int32_t | iVolume = 100 , |
||
C4Object * | pObj = nullptr , |
||
int32_t | iCustomFalloffDistance = 0 , |
||
int32_t | iPitch = 0 , |
||
C4SoundModifier * | modifier = nullptr |
||
) |
Definition at line 124 of file C4SoundSystem.cpp.
References Config, DebugLogF(), GetEffect(), initialized, C4SoundEffect::New(), C4ConfigSound::RXSound, and C4Config::Sound.
Referenced by StartSoundEffect().
|
protected |
Definition at line 219 of file C4SoundSystem.cpp.
References FirstSound, iResult, C4SoundEffect::Next, and WildcardMatch().
Referenced by LoadEffects().
|
protected |
Definition at line 57 of file C4SoundSystem.h.
Referenced by ClearEffects(), ClearPointers(), Execute(), FindInstance(), GetEffect(), GetFirstInstance(), GetFirstSound(), LoadEffects(), and RemoveEffect().
|
protected |
Definition at line 58 of file C4SoundSystem.h.
Referenced by Clear(), Init(), and NewEffect().
C4SoundModifierList C4SoundSystem::Modifiers |
Definition at line 54 of file C4SoundSystem.h.
Referenced by C4SoundModifier::C4SoundModifier(), C4Game::Clear(), Clear(), Init(), C4Game::SetGlobalSoundModifier(), C4SoundInstance::SetPlayer(), C4Player::SetSoundModifier(), and C4SoundModifier::~C4SoundModifier().
|
protected |
Definition at line 56 of file C4SoundSystem.h.