DayZ 1.24
|
Wrapper class for managing sound through SEffectManager. More...
Protected Member Functions | |
EffectType | |
Information about what type of effect the Effect is, without the need for casting | |
override EffectType | GetEffectType () |
Get what type of effect the Effect is. | |
override bool | IsSound () |
Check whether the Effect is EffectSound without casting. | |
Playback | |
Methods to Play/Stop sound Generally, SEffectManager.PlaySound methods are used instead of SoundPlay | |
bool | SoundPlayEx (out SoundParams params) |
Plays sound. | |
bool | SoundPlay () |
Plays sound. | |
override void | Start () |
Plays sound. | |
void | SoundStop () |
Stops sound. | |
override void | Stop () |
Stops sound. | |
void | SoundReset () |
Resets EffectSound. | |
bool | IsSoundPlaying () |
Get whether EffectSound is currently playing. | |
override bool | IsPlaying () |
Returns true when the effect is playing, false otherwise. | |
Sound load | |
Methods regarding the loading of the sound, used in SoundPlay | |
bool | SoundLoadEx (out SoundParams params) |
Loads in the sound when it is requested for playing through 'SoundPlayEx'. | |
bool | SoundLoad () |
Loads in the sound when it is requested for playing. | |
bool | IsSoundValid () |
Helper for checking if params are valid. | |
void | ValidateSoundWave () |
Gets called to fill in the necessary data when the header has finished loading. | |
bool | SoundWaveValidation () |
Validation of fade settings. | |
void | UpdateEvents () |
Enables the frame event on the EffectSound. | |
Events | |
Various events that can be overriden for custom behaviour | |
override void | Event_OnFrameUpdate (float time_delta) |
Event called on frame when enabled by SetEnableEventFrame(true) | |
override void | Event_OnRegistered (int id) |
Event called from SEffectManager when the Effect is registered. | |
override void | Event_OnUnregistered () |
Event called from SEffectManager when the Effect is unregistered. | |
void | Event_OnSoundWaveStarted () |
Event called when sound starts playing. | |
void | Event_OnSoundWaveEnded () |
Event called when sound stops playing. | |
void | Event_OnSoundFadeInStopped () |
Event called when sound fade in stops. | |
void | Event_OnSoundFadeOutStarted () |
Event called when sound fade out starts. | |
AutoDestroy | |
Methods regarding automatic cleanup on stop | |
override void | SetAutodestroy (bool auto_destroy) |
Sets whether Effect automatically cleans up when it stops. | |
override bool | IsAutodestroy () |
Get whether Effect automatically cleans up when it stops. | |
void | SetSoundAutodestroy (bool auto_destroy) |
Sets whether EffectSound automatically cleans up when sound stops. | |
bool | IsSoundAutodestroy () |
Get whether EffectSound automatically cleans up when sound stops. | |
override bool | CanDestroy () |
Generic API | |
Setters and getters for generic data and properties | |
override void | SetParent (Object parent_obj) |
Set parent for the sound to follow. | |
override Object | GetParent () |
Get parent for the EffectSound. | |
override Object | GetCurrentParent () |
Get parent for the EffectSound. | |
override void | SetCurrentPosition (vector pos, bool updateCached=true) |
Set the world position of the managed sound. | |
override vector | GetCurrentPosition () |
Get the current world position of the managed sound. | |
override void | SetCurrentLocalPosition (vector pos, bool updateCached=true) |
Set the current local position of the managed sound. | |
override vector | GetCurrentLocalPosition () |
Get the current local position of the managed sound. | |
void | SetSoundWaveKind (WaveKind wave_kind) |
Set WaveKind for the sound. | |
void | SetSoundSet (string snd) |
Set soundset for the sound. | |
string | GetSoundSet () |
Get soundset for the sound. | |
void | SetSoundLoop (bool loop) |
Set if the sound loops. | |
void | SetEnviromentVariables (bool setEnvVariables) |
Sets whether AddEnvSoundVariables needs to be called during Loading. | |
float | GetSoundWaveLenght () |
Get the sound wave length. | |
float | GetSoundWaveLength () |
Get the sound wave length. | |
void | SetSoundVolume (float volume) |
Set the RELATIVE volume for the sound. | |
float | GetSoundVolume () |
Get the RELATIVE volume set by 'SetSoundVolume'. | |
void | SetSoundMaxVolume (float volume) |
Set the sound max volume. | |
float | GetSoundWaveTime () |
Get the time since EffectSound started playing. | |
void | SetSoundFadeIn (float fade_in) |
Set the sound fade in duration. | |
void | SetSoundFadeOut (float fade_out) |
Set the sound fade out duration. | |
void | SetDoppler (bool setDoppler) |
Set if the sound has the doppler effect enabled. | |
void | SoundError (string err_msg) |
Helper for throwing sound errors. | |
Protected Attributes | |
Sound objects and structures | |
Objects and structures for the sound | |
ref SoundParams | m_SoundParams |
ref SoundObjectBuilder | m_SoundObjectBuilder |
ref SoundObject | m_SoundObject |
AbstractWave | m_SoundWaveObject |
Generic data | |
Generic data for the sound | |
WaveKind | m_SoundWaveKind |
string | m_SoundSetName |
bool | m_SoundLoop |
bool | m_SetEnvVariables |
bool | m_SoundAutodestroy |
bool | m_SoundWaveIsPlaying |
float | m_SoundWaveLenght |
float | m_SoundWaveVolume |
float | m_SoundWaveVolumeMax |
float | m_SoundWaveTime |
int | m_SoundDoppler |
Private Attributes | |
Event invokers | |
ScriptInvonkers for certain events | |
ref ScriptInvoker | Event_OnSoundWaveStarted = new ScriptInvoker() |
ref ScriptInvoker | Event_OnSoundWaveEnded = new ScriptInvoker() |
ref ScriptInvoker | Event_OnSoundFadeInStopped = new ScriptInvoker() |
ref ScriptInvoker | Event_OnSoundFadeOutStarted = new ScriptInvoker() |
Fading data | |
Data for fadein/fadeout for the sound | |
bool | m_SoundWaveStarting |
bool | m_SoundWaveStopping |
bool | m_SoundFadedOut |
float | m_SoundFadeInDuration |
float | m_SoundFadeOutStartTime |
float | m_SoundFadeOutDuration |
float | m_SoundFadeOutInitVolume |
void | EffectSound () |
ctor | |
void | ~EffectSound () |
dtor | |
override void | InitEffect () |
init | |
override string | GetDebugName () |
Override when getting debug information. | |
Wrapper class for managing sound through SEffectManager.
Definition at line 4 of file EffectSound.c.
|
inlineprotected |
ctor
Definition at line 62 of file EffectSound.c.
References m_SoundAutodestroy, m_SoundDoppler, m_SoundFadedOut, m_SoundWaveKind, m_SoundWaveStopping, m_SoundWaveVolume, and m_SoundWaveVolumeMax.
|
inlineprotected |
Definition at line 598 of file EffectSound.c.
References m_SoundFadedOut, and m_SoundFadeOutDuration.
Event called on frame when enabled by SetEnableEventFrame(true)
time_delta | float Time passed since the previous frame |
Definition at line 427 of file EffectSound.c.
References Event_OnSoundFadeInStopped, Event_OnSoundFadeOutStarted, GetSoundVolume(), IsSoundPlaying(), m_SoundDoppler, m_SoundFadedOut, m_SoundFadeInDuration, m_SoundFadeOutDuration, m_SoundFadeOutInitVolume, m_SoundWaveObject, m_SoundWaveStarting, m_SoundWaveStopping, m_SoundWaveTime, m_SoundWaveVolumeMax, AbstractWave::SetDoppler(), SetSoundVolume(), and AbstractWave::Stop().
Event called from SEffectManager when the Effect is registered.
id | int ID registered in SEffectManager |
Definition at line 490 of file EffectSound.c.
References SEffectManager::Event_OnSoundWaveEnded(), and Event_OnSoundWaveEnded.
|
inlineprotected |
Event called when sound fade in stops.
Definition at line 538 of file EffectSound.c.
References Event_OnSoundFadeInStopped.
|
inlineprotected |
Event called when sound fade out starts.
Definition at line 547 of file EffectSound.c.
References Event_OnSoundFadeOutStarted.
|
inlineprotected |
Event called when sound stops playing.
Definition at line 525 of file EffectSound.c.
References Event_OnEffectEnded, Event_OnSoundWaveEnded, and m_SoundWaveIsPlaying.
|
inlineprotected |
Event called when sound starts playing.
Definition at line 512 of file EffectSound.c.
References Event_OnEffectStarted, Event_OnSoundWaveStarted, and m_SoundWaveIsPlaying.
Event called from SEffectManager when the Effect is unregistered.
Definition at line 501 of file EffectSound.c.
References SEffectManager::Event_OnSoundWaveEnded(), and Event_OnSoundWaveEnded.
Get the current local position of the managed sound.
vector
The current local position of the managed sound Definition at line 700 of file EffectSound.c.
References GetLocalPosition(), GetParent(), GetPosition, m_SoundObject, and vector::Zero.
Referenced by SoundPlayEx().
Get parent for the EffectSound.
Object
The parent for the EffectSound Definition at line 640 of file EffectSound.c.
References m_SoundObject.
Get the current world position of the managed sound.
vector
The current world position of the managed sound Definition at line 672 of file EffectSound.c.
References GetPosition, m_ParentObject, and m_SoundObject.
Override when getting debug information.
Definition at line 96 of file EffectSound.c.
References m_SoundSetName.
|
inlineprotected |
Get what type of effect the Effect is.
EffectType
What type of effect the Effect is Definition at line 117 of file EffectSound.c.
Get parent for the EffectSound.
Object
The parent for the EffectSound Definition at line 627 of file EffectSound.c.
References m_SoundObject.
Referenced by GetCurrentLocalPosition(), and SetCurrentPosition().
|
inlineprotected |
Get soundset for the sound.
string
Name of the soundset Definition at line 747 of file EffectSound.c.
References m_SoundSetName.
|
inlineprotected |
Get the RELATIVE volume set by 'SetSoundVolume'.
float
The relative volume for the sound set by 'SetSoundVolume' Definition at line 807 of file EffectSound.c.
References m_SoundWaveVolume.
Referenced by Event_OnFrameUpdate().
|
inlineprotected |
Get the sound wave length.
float
The sound wave length Definition at line 778 of file EffectSound.c.
References GetSoundWaveLength().
|
inlineprotected |
Get the sound wave length.
float
The sound wave length Definition at line 787 of file EffectSound.c.
References m_SoundWaveLenght.
Referenced by GetSoundWaveLenght(), and SoundWaveValidation().
|
inlineprotected |
Get the time since EffectSound started playing.
float
The time since EffectSound started playing Definition at line 830 of file EffectSound.c.
References m_SoundWaveTime.
init
Definition at line 84 of file EffectSound.c.
References Event_OnEffectEnded, Event_OnEffectStarted, Event_OnStarted, and Event_OnStopped.
Get whether Effect automatically cleans up when it stops.
bool
Whether Effect automatically cleans up when it stops Definition at line 575 of file EffectSound.c.
References IsSoundAutodestroy().
Returns true when the effect is playing, false otherwise.
Definition at line 269 of file EffectSound.c.
References IsSoundPlaying().
Referenced by FlashbangEffect::PlaySound().
Check whether the Effect is EffectSound without casting.
bool
Whether the Effect is EffectSound Definition at line 126 of file EffectSound.c.
|
inlineprotected |
Get whether EffectSound automatically cleans up when sound stops.
bool
Whether EffectSound automatically cleans up when sound stops Definition at line 593 of file EffectSound.c.
References m_SoundAutodestroy.
Referenced by IsAutodestroy().
|
inlineprotected |
Get whether EffectSound is currently playing.
bool
Whether EffectSound is currently playing Definition at line 261 of file EffectSound.c.
References m_SoundWaveIsPlaying.
Referenced by Event_OnFrameUpdate(), IsPlaying(), InventoryItem::OnRPC(), ActionBuildShelter::PlayActionLoopSound(), PlayEmptyingLoopSound(), PlayPouringLoopSound(), and SoundStop().
|
inlineprotected |
Helper for checking if params are valid.
Definition at line 336 of file EffectSound.c.
References m_SoundParams.
Sets whether Effect automatically cleans up when it stops.
auto_destroy | bool Whether Effect automatically cleans up when it stops |
Definition at line 565 of file EffectSound.c.
References m_SoundAutodestroy.
Referenced by InventoryItem::PlayDeployFinishSound(), InventoryItem::PlayDeployLoopSoundEx(), InventoryItem::PlayDeploySound(), InventoryItem::PlayPlaceSound(), FlashbangEffect::PlaySound(), PlaySound(), and SetSoundAutodestroy().
|
inlineprotected |
Set the current local position of the managed sound.
pos | vector The current local position for the managed sound |
updateCached | bool Whether to update the cached variable |
Definition at line 688 of file EffectSound.c.
References m_SoundObject.
Referenced by SoundPlayEx().
|
inlineprotected |
Set the world position of the managed sound.
pos | vector The world position of the managed sound |
updateCached | bool Whether to update the cached variable |
Definition at line 653 of file EffectSound.c.
References GetParent(), and m_SoundObject.
Set if the sound has the doppler effect enabled.
setDoppler | float If the doppler effect is enabled |
bool is a fancy int, ensure the bool is 0 or 1 and don't allow -1 here since resetting isn't supported
Definition at line 857 of file EffectSound.c.
References m_SoundDoppler.
Sets whether AddEnvSoundVariables needs to be called during Loading.
setEnvVariables | bool Whether AddEnvSoundVariables is called |
Definition at line 768 of file EffectSound.c.
References m_SetEnvVariables.
Set parent for the sound to follow.
parent_obj | Object The parent for the sound to follow |
Definition at line 615 of file EffectSound.c.
References m_SoundObject.
Referenced by FlashbangEffect::PlaySound().
Sets whether EffectSound automatically cleans up when sound stops.
auto_destroy | bool Whether EffectSound automatically cleans up when sound stops |
Definition at line 584 of file EffectSound.c.
References SetAutodestroy().
Set the sound fade in duration.
fade_in | float The fade in duration |
Definition at line 839 of file EffectSound.c.
References m_SoundFadeInDuration.
Referenced by FlashbangEffect::PlaySound().
Set the sound fade out duration.
fade_out | float The fade out duration |
Definition at line 848 of file EffectSound.c.
References m_SoundFadeOutDuration.
Referenced by FlashbangEffect::PlaySound(), ActionBuildShelter::StopActionLoopSound(), and InventoryItem::StopDeployLoopSoundEx().
Set if the sound loops.
loop | bool Whether the sound should loop |
Definition at line 756 of file EffectSound.c.
References AbstractWave::Loop(), m_SoundLoop, and m_SoundWaveObject.
Referenced by FlashbangEffect::PlaySound(), and ValidateSoundWave().
Set the sound max volume.
volume | float The maximum volume for the sound |
Definition at line 818 of file EffectSound.c.
References m_SoundWaveObject, m_SoundWaveVolume, m_SoundWaveVolumeMax, and AbstractWave::SetVolumeRelative().
Referenced by FlashbangEffect::PlaySound().
Set soundset for the sound.
snd | string Name of the soundset to play |
Definition at line 738 of file EffectSound.c.
References m_SoundSetName.
Set the RELATIVE volume for the sound.
volume | float The relative volume for the sound |
Definition at line 796 of file EffectSound.c.
References m_SoundWaveObject, m_SoundWaveVolume, and AbstractWave::SetVolumeRelative().
Referenced by Event_OnFrameUpdate(), and ProcessSound().
Set WaveKind for the sound.
wave_kind | WaveKind The WaveKind for the sound |
Definition at line 728 of file EffectSound.c.
References m_SoundWaveKind.
Referenced by FlashbangEffect::PlaySound().
Helper for throwing sound errors.
Definition at line 871 of file EffectSound.c.
References ErrorEx, and m_SoundSetName.
Referenced by SoundLoadEx(), SoundPlayEx(), and SoundWaveValidation().
|
inlineprotected |
Loads in the sound when it is requested for playing.
Definition at line 327 of file EffectSound.c.
References SoundLoadEx().
|
inlineprotected |
Loads in the sound when it is requested for playing through 'SoundPlayEx'.
params | SoundParams Possibility of passing in an already existing SoundParams, else one will get created |
Definition at line 286 of file EffectSound.c.
References GetPosition, m_ParentObject, m_SetEnvVariables, m_SoundObject, m_SoundObjectBuilder, m_SoundParams, m_SoundSetName, m_SoundWaveKind, SoundError(), and SoundObjectBuilder().
Referenced by SoundLoad(), and SoundPlayEx().
|
inlineprotected |
Plays sound.
bool
Whether the sound will start playing Definition at line 190 of file EffectSound.c.
References SoundPlayEx().
Referenced by PlayIntense(), PlayLight(), FlashbangEffect::PlaySound(), and Start().
|
inlineprotected |
Plays sound.
params | SoundParams Sound Parameters for the sound |
bool
Whether the sound will start playing Definition at line 145 of file EffectSound.c.
References GetCurrentLocalPosition(), AbstractWave::GetEvents(), GetGame(), GetPosition, AbstractWave::IsHeaderLoaded(), m_ParentObject, m_SetEnvVariables, m_SoundObject, m_SoundObjectBuilder, m_SoundParams, m_SoundSetName, m_SoundWaveKind, m_SoundWaveObject, SetCurrentLocalPosition(), SoundError(), SoundLoadEx(), and ValidateSoundWave().
Referenced by SoundPlay().
|
inlineprotected |
Resets EffectSound.
Definition at line 239 of file EffectSound.c.
References m_IsPlaying, m_SoundFadedOut, m_SoundFadeOutInitVolume, m_SoundFadeOutStartTime, m_SoundWaveIsPlaying, m_SoundWaveObject, m_SoundWaveStopping, m_SoundWaveTime, m_SoundWaveVolume, m_SoundWaveVolumeMax, AbstractWave::SetVolumeRelative(), and AbstractWave::Stop().
Referenced by SoundStop().
|
inlineprotected |
Stops sound.
Definition at line 208 of file EffectSound.c.
References IsSoundPlaying(), m_SoundFadedOut, m_SoundFadeOutDuration, m_SoundFadeOutStartTime, m_SoundWaveObject, m_SoundWaveStarting, m_SoundWaveStopping, m_SoundWaveTime, SoundReset(), and AbstractWave::Stop().
Referenced by BuildingSuper::EEDelete(), ItemBase::OnIsCharged(), PlayIntense(), PlayLight(), Stop(), ActionBuildShelter::StopActionLoopSound(), StopAllMusic(), ItemBase::StopChargedAlarm(), ItemBase::StopChargingSound(), InventoryItem::StopDeployLoopSoundEx(), StopEmptyingLoopSound(), StopPouringLoopSound(), FlashbangEffect::StopSound(), FlareSimulation::~FlareSimulation(), and InventoryItem::~ItemBase().
|
inlineprotected |
Validation of fade settings.
Definition at line 375 of file EffectSound.c.
References GetSoundWaveLength(), m_SoundFadeInDuration, m_SoundFadeOutDuration, and SoundError().
Referenced by ValidateSoundWave().
Plays sound.
Definition at line 199 of file EffectSound.c.
References SoundPlay().
Stops sound.
Definition at line 231 of file EffectSound.c.
References SoundStop().
Referenced by Land_Underground_Stairs_Exit::HandleAudioPlayback(), FireworksLauncher::OnFiringStartClient(), FireworksLauncherClientEvent::PlayExplosionSound(), Edible_Base::SoundCookingStop(), and ~UndergroundHandlerClient().
|
inlineprotected |
Enables the frame event on the EffectSound.
Definition at line 405 of file EffectSound.c.
References m_SoundWaveObject, and SetEnableEventFrame().
Referenced by ValidateSoundWave().
|
inlineprotected |
Gets called to fill in the necessary data when the header has finished loading.
Definition at line 345 of file EffectSound.c.
References Event_OnSoundWaveEnded, Event_OnSoundWaveStarted, AbstractWave::GetEvents(), AbstractWave::GetLength(), m_SoundFadeInDuration, m_SoundFadeOutStartTime, m_SoundLoop, m_SoundWaveLenght, m_SoundWaveObject, m_SoundWaveStarting, SetSoundLoop(), AbstractWave::SetVolumeRelative(), SoundWaveValidation(), AbstractWave::Stop(), and UpdateEvents().
Referenced by SoundPlayEx().
|
private |
Definition at line 12 of file EffectSound.c.
Referenced by Event_OnFrameUpdate(), and Event_OnSoundFadeInStopped().
|
private |
Definition at line 13 of file EffectSound.c.
Referenced by Event_OnFrameUpdate(), and Event_OnSoundFadeOutStarted().
|
private |
Definition at line 11 of file EffectSound.c.
Referenced by Event_OnRegistered(), Event_OnSoundWaveEnded(), Event_OnUnregistered(), and ValidateSoundWave().
|
private |
Definition at line 10 of file EffectSound.c.
Referenced by Event_OnSoundWaveStarted(), and ValidateSoundWave().
|
protected |
Definition at line 33 of file EffectSound.c.
Referenced by SetEnviromentVariables(), SoundLoadEx(), and SoundPlayEx().
|
protected |
Definition at line 34 of file EffectSound.c.
Referenced by EffectSound(), IsSoundAutodestroy(), and SetAutodestroy().
|
protected |
Definition at line 40 of file EffectSound.c.
Referenced by EffectSound(), Event_OnFrameUpdate(), and SetDoppler().
|
protected |
Definition at line 49 of file EffectSound.c.
Referenced by CanDestroy(), EffectSound(), Event_OnFrameUpdate(), SoundReset(), and SoundStop().
|
protected |
Definition at line 51 of file EffectSound.c.
Referenced by Event_OnFrameUpdate(), SetSoundFadeIn(), SoundWaveValidation(), and ValidateSoundWave().
|
protected |
Definition at line 54 of file EffectSound.c.
Referenced by CanDestroy(), Event_OnFrameUpdate(), SetSoundFadeOut(), SoundStop(), and SoundWaveValidation().
|
protected |
Definition at line 55 of file EffectSound.c.
Referenced by Event_OnFrameUpdate(), and SoundReset().
|
protected |
Definition at line 53 of file EffectSound.c.
Referenced by SoundReset(), SoundStop(), and ValidateSoundWave().
|
protected |
Definition at line 32 of file EffectSound.c.
Referenced by SetSoundLoop(), and ValidateSoundWave().
|
protected |
Definition at line 22 of file EffectSound.c.
Referenced by GetCurrentLocalPosition(), GetCurrentParent(), GetCurrentPosition(), GetParent(), SetCurrentLocalPosition(), SetCurrentPosition(), SetParent(), SoundLoadEx(), and SoundPlayEx().
|
protected |
Definition at line 21 of file EffectSound.c.
Referenced by SoundLoadEx(), and SoundPlayEx().
|
protected |
Definition at line 20 of file EffectSound.c.
Referenced by IsSoundValid(), SoundLoadEx(), and SoundPlayEx().
|
protected |
Definition at line 31 of file EffectSound.c.
Referenced by GetDebugName(), GetSoundSet(), SetSoundSet(), SoundError(), SoundLoadEx(), and SoundPlayEx().
|
protected |
Definition at line 35 of file EffectSound.c.
Referenced by Event_OnSoundWaveEnded(), Event_OnSoundWaveStarted(), IsSoundPlaying(), and SoundReset().
|
protected |
Definition at line 30 of file EffectSound.c.
Referenced by EffectSound(), SetSoundWaveKind(), SoundLoadEx(), and SoundPlayEx().
|
protected |
Definition at line 36 of file EffectSound.c.
Referenced by GetSoundWaveLength(), and ValidateSoundWave().
|
protected |
Definition at line 23 of file EffectSound.c.
Referenced by Event_OnFrameUpdate(), SetSoundLoop(), SetSoundMaxVolume(), SetSoundVolume(), SoundPlayEx(), SoundReset(), SoundStop(), UpdateEvents(), and ValidateSoundWave().
|
protected |
Definition at line 47 of file EffectSound.c.
Referenced by Event_OnFrameUpdate(), SoundStop(), and ValidateSoundWave().
|
protected |
Definition at line 48 of file EffectSound.c.
Referenced by EffectSound(), Event_OnFrameUpdate(), SoundReset(), and SoundStop().
|
protected |
Definition at line 39 of file EffectSound.c.
Referenced by Event_OnFrameUpdate(), GetSoundWaveTime(), SoundReset(), and SoundStop().
|
protected |
Definition at line 37 of file EffectSound.c.
Referenced by EffectSound(), GetSoundVolume(), SetSoundMaxVolume(), SetSoundVolume(), and SoundReset().
|
protected |
Definition at line 38 of file EffectSound.c.
Referenced by EffectSound(), Event_OnFrameUpdate(), SetSoundMaxVolume(), and SoundReset().