DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс EffectSound

Wrapper class for managing sound through SEffectManager. Подробнее...

+ Граф наследования:EffectSound:

Защищенные члены

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.
 

Защищенные данные

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
 

Закрытые данные

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.

Конструктор(ы)

◆ EffectSound()

void EffectSound ( )
inlineprotected

ctor

64 {
65 m_SoundWaveKind = WaveKind.WAVEEFFECTEX;
68 m_SoundAutodestroy = false;
69 m_SoundWaveStopping = false;
70 m_SoundFadedOut = false;
71 m_SoundDoppler = -1;
72 }
WaveKind
Definition Sound.c:2
bool m_SoundWaveStopping
Definition EffectSound.c:48
WaveKind m_SoundWaveKind
Definition EffectSound.c:30
float m_SoundWaveVolumeMax
Definition EffectSound.c:38
float m_SoundWaveVolume
Definition EffectSound.c:37
int m_SoundDoppler
Definition EffectSound.c:40
bool m_SoundAutodestroy
Definition EffectSound.c:34
bool m_SoundFadedOut
Definition EffectSound.c:49

Перекрестные ссылки m_SoundAutodestroy, m_SoundDoppler, m_SoundFadedOut, m_SoundWaveKind, m_SoundWaveStopping, m_SoundWaveVolume и m_SoundWaveVolumeMax.

◆ ~EffectSound()

void ~EffectSound ( )
inlineprotected

dtor

78 {
79
80 }

Методы

◆ CanDestroy()

override bool CanDestroy ( )
inlineprotected
634 {
636 }
bool m_SoundWaveIsPlaying
Definition EffectSound.c:35
float m_SoundFadeOutDuration
Definition EffectSound.c:54

Перекрестные ссылки m_SoundFadeOutDuration и m_SoundWaveIsPlaying.

◆ Event_OnFrameUpdate()

override void Event_OnFrameUpdate ( float time_delta)
inlineprotected

Event called on frame when enabled by SetEnableEventFrame(true)

Заметки
Is always enabled on sound
Called from SEffectManager.Event_OnFrameUpdate in MissionGameplay.OnUpdate
Аргументы
time_deltafloat Time passed since the previous frame
458 {
459 if ( IsSoundPlaying() )
460 {
461 if (m_SoundDoppler != -1)
462 {
464 }
465 // FadeIn
467 {
468 if ( m_SoundFadeInDuration > 0 )
469 {
471
473 {
476 m_SoundWaveStarting = false;
477 }
478 }
479 else
480 {
482 m_SoundWaveStarting = false;
483 }
484 }
485
486 // FadeOut
488 {
489 if ( m_SoundFadeOutDuration > 0 )
490 {
491 if ( m_SoundFadeOutInitVolume == 0 )
492 {
495 }
497 }
498 else
499 {
500 SetSoundVolume( 0 );
501 }
502
503 if ( GetSoundVolume() <= 0 )
504 {
505 if ( m_SoundWaveObject )
506 {
508 m_SoundWaveStopping = false;
509 m_SoundFadedOut = true;
510 }
511 }
512 }
513
514 // Counting timer here because loop play
516 }
517 }
proto void SetDoppler(bool setDoppler)
proto void Stop()
float m_SoundWaveTime
Definition EffectSound.c:39
ref ScriptInvoker Event_OnSoundFadeOutStarted
Definition EffectSound.c:13
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
Definition EffectSound.c:274
void SetSoundVolume(float volume)
Set the RELATIVE volume for the sound.
Definition EffectSound.c:836
float m_SoundFadeInDuration
Definition EffectSound.c:51
float m_SoundFadeOutInitVolume
Definition EffectSound.c:55
ref ScriptInvoker Event_OnSoundFadeInStopped
Definition EffectSound.c:12
bool m_SoundWaveStarting
Definition EffectSound.c:47
AbstractWave m_SoundWaveObject
Definition EffectSound.c:23
float GetSoundVolume()
Get the RELATIVE volume set by 'SetSoundVolume'.
Definition EffectSound.c:847
Definition EntityAI.c:95

Перекрестные ссылки 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() и AbstractWave::Stop().

◆ Event_OnRegistered()

override void Event_OnRegistered ( int id)
inlineprotected

Event called from SEffectManager when the Effect is registered.

Заметки
Should only ever be called by SEffectManager!
Аргументы
idint ID registered in SEffectManager
525 {
526 super.Event_OnRegistered(id);
527
529 }
ref ScriptInvoker Event_OnSoundWaveEnded
Definition EffectSound.c:11
Manager class for managing Effect (EffectParticle, EffectSound)
Definition EffectManager.c:6
static void Event_OnSoundWaveEnded(EffectSound effect_sound)
Event called from EffectSound.Event_OnSoundWaveEnded.
Definition EffectManager.c:468

Перекрестные ссылки SEffectManager::Event_OnSoundWaveEnded() и Event_OnSoundWaveEnded.

◆ Event_OnSoundFadeInStopped()

void Event_OnSoundFadeInStopped ( )
inlineprotected

Event called when sound fade in stops.

Заметки
Called from Event_OnFrameUpdate
573 {
574 Event_OnSoundFadeInStopped.Invoke(this);
575 }

Перекрестные ссылки Event_OnSoundFadeInStopped.

◆ Event_OnSoundFadeOutStarted()

void Event_OnSoundFadeOutStarted ( )
inlineprotected

Event called when sound fade out starts.

Заметки
Called from Event_OnFrameUpdate
582 {
583 Event_OnSoundFadeOutStarted.Invoke(this);
584 }

Перекрестные ссылки Event_OnSoundFadeOutStarted.

◆ Event_OnSoundWaveEnded()

void Event_OnSoundWaveEnded ( )
inlineprotected

Event called when sound stops playing.

Заметки
Inserted into events of m_SoundWaveObject
560 {
561 m_SoundWaveIsPlaying = false;
562
563 Event_OnSoundWaveEnded.Invoke(this);
564
566 }
ref ScriptInvoker Event_OnEffectEnded
Event used when the actual effect stopped playing.
Definition Effect.c:25

Перекрестные ссылки Event_OnEffectEnded, Event_OnSoundWaveEnded и m_SoundWaveIsPlaying.

◆ Event_OnSoundWaveStarted()

void Event_OnSoundWaveStarted ( )
inlineprotected

Event called when sound starts playing.

Заметки
Inserted into events of m_SoundWaveObject
547 {
549
550 Event_OnSoundWaveStarted.Invoke(this);
551
553 }
ref ScriptInvoker Event_OnEffectStarted
Event used when the actual effect started playing.
Definition Effect.c:24
ref ScriptInvoker Event_OnSoundWaveStarted
Definition EffectSound.c:10

Перекрестные ссылки Event_OnEffectStarted, Event_OnSoundWaveStarted и m_SoundWaveIsPlaying.

◆ Event_OnUnregistered()

override void Event_OnUnregistered ( )
inlineprotected

Event called from SEffectManager when the Effect is unregistered.

Заметки
Should only ever be called by SEffectManager!
536 {
537 super.Event_OnUnregistered();
538
540 }

Перекрестные ссылки SEffectManager::Event_OnSoundWaveEnded() и Event_OnSoundWaveEnded.

◆ GetCurrentLocalPosition()

override vector GetCurrentLocalPosition ( )
inlineprotected

Get the current local position of the managed sound.

Возвращает
vector The current local position of the managed sound
741 {
742 Object parent = GetParent();
743
744 if (m_SoundObject)
745 {
746 //TODO(kumarjac): Create and expose 'SoundObject.GetLocalPosition'
747 if (parent)
748 return parent.WorldToModel(m_SoundObject.GetPosition());
749 else
750 return m_SoundObject.GetPosition();
751 }
752 else
753 {
754 if (parent)
755 return GetLocalPosition();
756 else
757 return GetPosition();
758 }
759
760 return vector.Zero;
761 }
vector GetLocalPosition()
Get the local position of the Effect.
Definition Effect.c:488
class JsonUndergroundAreaTriggerData GetPosition
Definition UndergroundAreaLoader.c:9
ref SoundObject m_SoundObject
Definition EffectSound.c:22
override Object GetParent()
Get parent for the EffectSound.
Definition EffectSound.c:665
Definition ObjectTyped.c:2
Definition EnConvert.c:106
static const vector Zero
Definition EnConvert.c:110

Перекрестные ссылки GetLocalPosition(), GetParent(), GetPosition, m_SoundObject и vector::Zero.

Используется в SoundPlayEx().

◆ GetCurrentParent()

override Object GetCurrentParent ( )
inlineprotected

Get parent for the EffectSound.

Заметки
There is no real parenting with sound, so the setters and getters for parents do the exact same
Возвращает
Object The parent for the EffectSound
679 {
680 if (m_SoundObject)
681 return Object.Cast(m_SoundObject.GetParent());
682 else
683 return super.GetParent(); // Yes, intentionally this one
684 }

Перекрестные ссылки m_SoundObject.

◆ GetCurrentPosition()

override vector GetCurrentPosition ( )
inlineprotected

Get the current world position of the managed sound.

Возвращает
vector The current world position of the managed sound
711 {
712 if (m_SoundObject)
713 return m_SoundObject.GetPosition();
714
715 if (m_ParentObject)
716 return m_ParentObject.ModelToWorld(GetPosition());
717
718 return GetPosition();
719 }
Object m_ParentObject
Cached parent.
Definition Effect.c:39

Перекрестные ссылки GetPosition, m_ParentObject и m_SoundObject.

◆ GetDebugName()

override string GetDebugName ( )
inlineprotected

Override when getting debug information.

98 {
99 string identifier;
100 if (m_SoundSetName != "")
101 {
103 }
104 else
105 {
106 identifier = "NO_SOUNDSET";
107 }
108
109 return string.Format("%1:%2", super.GetDebugName(), identifier);
110 }
string m_SoundSetName
Definition EffectSound.c:31

Перекрестные ссылки m_SoundSetName.

◆ GetEffectType()

override EffectType GetEffectType ( )
inlineprotected

Get what type of effect the Effect is.

Возвращает
EffectType What type of effect the Effect is
124 {
125 return EffectType.SOUND;
126 }
EffectType
Enum to determine what type of effect the Effect is.
Definition Effect.c:3

◆ GetParent()

override Object GetParent ( )
inlineprotected

Get parent for the EffectSound.

Возвращает
Object The parent for the EffectSound
666 {
667 if (m_SoundObject)
668 return Object.Cast(m_SoundObject.GetParent());
669 else
670 return super.GetParent();
671 }

Перекрестные ссылки m_SoundObject.

Используется в GetCurrentLocalPosition() и SetCurrentPosition().

◆ GetSoundSet()

string GetSoundSet ( )
inlineprotected

Get soundset for the sound.

Возвращает
string Name of the soundset
788 {
789 return m_SoundSetName;
790 }

Перекрестные ссылки m_SoundSetName.

◆ GetSoundVolume()

float GetSoundVolume ( )
inlineprotected

Get the RELATIVE volume set by 'SetSoundVolume'.

Возвращает
float The relative volume for the sound set by 'SetSoundVolume'
848 {
849 return m_SoundWaveVolume;
850 }

Перекрестные ссылки m_SoundWaveVolume.

Используется в Event_OnFrameUpdate().

◆ GetSoundWaveLenght()

float GetSoundWaveLenght ( )
inlineprotected

Get the sound wave length.

Заметки
Legacy, exists for backwards compatibility
Возвращает
float The sound wave length
819 {
820 return GetSoundWaveLength();
821 }
float GetSoundWaveLength()
Get the sound wave length.
Definition EffectSound.c:827

Перекрестные ссылки GetSoundWaveLength().

◆ GetSoundWaveLength()

float GetSoundWaveLength ( )
inlineprotected

Get the sound wave length.

Возвращает
float The sound wave length
828 {
829 return m_SoundWaveLenght;
830 }
float m_SoundWaveLenght
Definition EffectSound.c:36

Перекрестные ссылки m_SoundWaveLenght.

Используется в GetSoundWaveLenght() и SoundWaveValidation().

◆ GetSoundWaveTime()

float GetSoundWaveTime ( )
inlineprotected

Get the time since EffectSound started playing.

Предупреждения
May not reflect the actual time of the sound, as it can start at negative time to simulate speed of sound
Возвращает
float The time since EffectSound started playing
871 {
872 return m_SoundWaveTime;
873 }

Перекрестные ссылки m_SoundWaveTime.

◆ InitEffect()

override void InitEffect ( )
inlineprotected

init

86 {
87 super.InitEffect();
88
89 // These will be called by the sound events
92 }
ref ScriptInvoker Event_OnStopped
Event used when Stop was called.
Definition Effect.c:23
Event_OnStarted
Event used when Start was called.
Definition Effect.c:302

Перекрестные ссылки Event_OnEffectEnded, Event_OnEffectStarted, Event_OnStarted и Event_OnStopped.

◆ IsAutodestroy()

override bool IsAutodestroy ( )
inlineprotected

Get whether Effect automatically cleans up when it stops.

Возвращает
bool Whether Effect automatically cleans up when it stops
611 {
612 return IsSoundAutodestroy();
613 }
bool IsSoundAutodestroy()
Get whether EffectSound automatically cleans up when sound stops.
Definition EffectSound.c:628

Перекрестные ссылки IsSoundAutodestroy().

◆ IsPlaying()

override bool IsPlaying ( )
inlineprotected

Returns true when the effect is playing, false otherwise.

283 {
284 return IsSoundPlaying(); // Just in case, as that's what used to be the actual way to check
285 }

Перекрестные ссылки IsSoundPlaying().

Используется в FlashbangEffect::PlaySound().

◆ IsSound()

override bool IsSound ( )
inlineprotected

Check whether the Effect is EffectSound without casting.

Возвращает
bool Whether the Effect is EffectSound
133 {
134 return true;
135 }

◆ IsSoundAutodestroy()

bool IsSoundAutodestroy ( )
inlineprotected

Get whether EffectSound automatically cleans up when sound stops.

Возвращает
bool Whether EffectSound automatically cleans up when sound stops
629 {
630 return m_SoundAutodestroy;
631 }

Перекрестные ссылки m_SoundAutodestroy.

Используется в IsAutodestroy().

◆ IsSoundPlaying()

bool IsSoundPlaying ( )
inlineprotected

Get whether EffectSound is currently playing.

Возвращает
bool Whether EffectSound is currently playing
275 {
277 }

Перекрестные ссылки m_SoundWaveIsPlaying.

Используется в Event_OnFrameUpdate(), IsPlaying(), InventoryItem::OnRPC(), ActionBuildShelter::PlayActionLoopSound(), PlayEmptyingLoopSound(), PlayPouringLoopSound() и SoundStop().

◆ IsSoundValid()

bool IsSoundValid ( )
inlineprotected

Helper for checking if params are valid.

357 {
358 return m_SoundParams.IsValid();
359 }
ref SoundParams m_SoundParams
Definition EffectSound.c:20

Перекрестные ссылки m_SoundParams.

◆ SetAutodestroy()

override void SetAutodestroy ( bool auto_destroy)
inlineprotected

Sets whether Effect automatically cleans up when it stops.

Заметки
This means that it will be unregistered from SEffectManager as well
Аргументы
auto_destroybool Whether Effect automatically cleans up when it stops
601 {
602 super.SetAutodestroy(auto_destroy);
604 }

Перекрестные ссылки m_SoundAutodestroy.

Используется в Land_WarheadStorage_Main::OnDoorCloseStart(), Land_WarheadStorage_Main::OnDoorOpenStart(), InventoryItem::PlayDeployFinishSound(), InventoryItem::PlayDeployLoopSoundEx(), InventoryItem::PlayDeploySound(), InventoryItem::PlayPlaceSound(), FlashbangEffect::PlaySound(), PlaySound() и SetSoundAutodestroy().

◆ SetCurrentLocalPosition()

override void SetCurrentLocalPosition ( vector pos,
bool updateCached = true )
inlineprotected

Set the current local position of the managed sound.

Аргументы
posvector The current local position for the managed sound
updateCachedbool Whether to update the cached variable
727 {
728 super.SetCurrentLocalPosition(pos, updateCached);
729
730 if (m_SoundObject)
731 {
732 m_SoundObject.SetPosition(pos);
733 }
734 }

Перекрестные ссылки m_SoundObject.

Используется в SoundPlayEx().

◆ SetCurrentPosition()

override void SetCurrentPosition ( vector pos,
bool updateCached = true )
inlineprotected

Set the world position of the managed sound.

Аргументы
posvector The world position of the managed sound
updateCachedbool Whether to update the cached variable
692 {
693 super.SetCurrentPosition(pos, updateCached);
694
695 if (m_SoundObject)
696 {
697 Object parent = GetParent();
698
699 if (parent)
700 pos = parent.WorldToModel(pos);
701
702 m_SoundObject.SetPosition(pos);
703 }
704 }

Перекрестные ссылки GetParent() и m_SoundObject.

◆ SetDoppler()

void SetDoppler ( bool setDoppler)
inlineprotected

Set if the sound has the doppler effect enabled.

Аргументы
setDopplerfloat 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

898 {
900 m_SoundDoppler = 0;
901 if (setDoppler)
902 {
903 m_SoundDoppler = 1;
904 }
905 }

Перекрестные ссылки m_SoundDoppler.

◆ SetEnviromentVariables()

void SetEnviromentVariables ( bool setEnvVariables)
inlineprotected

Sets whether AddEnvSoundVariables needs to be called during Loading.

Аргументы
setEnvVariablesbool Whether AddEnvSoundVariables is called
809 {
811 }
bool m_SetEnvVariables
Definition EffectSound.c:33

Перекрестные ссылки m_SetEnvVariables.

◆ SetParent()

override void SetParent ( Object parent_obj)
inlineprotected

Set parent for the sound to follow.

Аргументы
parent_objObject The parent for the sound to follow
652 {
653 super.SetParent(parent_obj); // ...
654
655 if (m_SoundObject)
656 {
657 m_SoundObject.SetParent(parent_obj);
658 }
659 }

Перекрестные ссылки m_SoundObject.

Используется в FlashbangEffect::PlaySound().

◆ SetSoundAutodestroy()

void SetSoundAutodestroy ( bool auto_destroy)
inlineprotected

Sets whether EffectSound automatically cleans up when sound stops.

Аргументы
auto_destroybool Whether EffectSound automatically cleans up when sound stops
620 {
622 }
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
Definition EffectSound.c:600

Перекрестные ссылки SetAutodestroy().

◆ SetSoundFadeIn()

void SetSoundFadeIn ( float fade_in)
inlineprotected

Set the sound fade in duration.

Аргументы
fade_infloat The fade in duration
880 {
882 }

Перекрестные ссылки m_SoundFadeInDuration.

Используется в FlashbangEffect::PlaySound().

◆ SetSoundFadeOut()

void SetSoundFadeOut ( float fade_out)
inlineprotected

Set the sound fade out duration.

Аргументы
fade_outfloat The fade out duration
889 {
891 }

Перекрестные ссылки m_SoundFadeOutDuration.

Используется в FlashbangEffect::PlaySound(), ActionBuildShelter::StopActionLoopSound() и InventoryItem::StopDeployLoopSoundEx().

◆ SetSoundLoop()

void SetSoundLoop ( bool loop)
inlineprotected

Set if the sound loops.

Аргументы
loopbool Whether the sound should loop
797 {
799
800 if ( m_SoundWaveObject )
802 }
proto void Loop(bool setLoop)
bool m_SoundLoop
Definition EffectSound.c:32

Перекрестные ссылки AbstractWave::Loop(), m_SoundLoop и m_SoundWaveObject.

Используется в FlashbangEffect::PlaySound() и ValidateSoundWave().

◆ SetSoundMaxVolume()

void SetSoundMaxVolume ( float volume)
inlineprotected

Set the sound max volume.

Предупреждения
Seems to purely be used for fade in effect, rather than really setting the max volume...
Adjusts the current volume to this value as well
Аргументы
volumefloat The maximum volume for the sound
859 {
861 if ( m_SoundWaveObject )
863 }
proto void SetVolumeRelative(float value)

Перекрестные ссылки m_SoundWaveObject, m_SoundWaveVolume, m_SoundWaveVolumeMax и AbstractWave::SetVolumeRelative().

Используется в FlashbangEffect::PlaySound().

◆ SetSoundSet()

void SetSoundSet ( string snd)
inlineprotected

Set soundset for the sound.

Заметки
Needs to be set before playing
Аргументы
sndstring Name of the soundset to play
779 {
781 }

Перекрестные ссылки m_SoundSetName.

◆ SetSoundVolume()

void SetSoundVolume ( float volume)
inlineprotected

Set the RELATIVE volume for the sound.

Аргументы
volumefloat The relative volume for the sound

Перекрестные ссылки m_SoundWaveObject, m_SoundWaveVolume и AbstractWave::SetVolumeRelative().

Используется в Event_OnFrameUpdate() и ProcessSound().

◆ SetSoundWaveKind()

void SetSoundWaveKind ( WaveKind wave_kind)
inlineprotected

Set WaveKind for the sound.

Заметки
Needs to be set before playing
Аргументы
wave_kindWaveKind The WaveKind for the sound
769 {
771 }

Перекрестные ссылки m_SoundWaveKind.

Используется в FlashbangEffect::PlaySound().

◆ SoundError()

void SoundError ( string err_msg)
inlineprotected

Helper for throwing sound errors.

915 {
916 ErrorEx(string.Format("%1: SoundSetName: '%2' :: %3", this, m_SoundSetName, err_msg));
917 }
enum ShapeType ErrorEx

Перекрестные ссылки ErrorEx и m_SoundSetName.

Используется в SoundLoadEx(), SoundPlayEx() и SoundWaveValidation().

◆ SoundLoad()

bool SoundLoad ( )
inlineprotected

Loads in the sound when it is requested for playing.

Заметки
Legacy, backwards compatibility
348 {
350 return SoundLoadEx(params);
351 }
bool SoundLoadEx(out SoundParams params)
Loads in the sound when it is requested for playing through 'SoundPlayEx'.
Definition EffectSound.c:300
Definition Sound.c:101

Перекрестные ссылки SoundLoadEx().

◆ SoundLoadEx()

bool SoundLoadEx ( out SoundParams params)
inlineprotected

Loads in the sound when it is requested for playing through 'SoundPlayEx'.

Аргументы
paramsSoundParams Possibility of passing in an already existing SoundParams, else one will get created
301 {
302 if ( !m_SoundParams || !m_SoundParams.IsValid() )
303 {
304 if (!params)
305 {
307 }
308
309 //Print("SoundLoad is loading..");
311 if ( !m_SoundParams.IsValid() )
312 {
313 SoundError("Invalid sound set.");
314 return false;
315 }
316
319 {
320 m_SoundObjectBuilder.AddEnvSoundVariables(GetPosition());
321 }
322
323 m_SoundObject = m_SoundObjectBuilder.BuildSoundObject();
324
325 if ( m_SoundObject )
326 {
328 m_SoundObject.SetParent( m_ParentObject );
329 }
330 else
331 {
332 SoundError("m_SoundObject is null.");
333 }
334 }
335 else
336 {
337 //Print("SoundLoad is loaded.");
338 }
339
340 return true;
341 }
void SoundObjectBuilder(SoundParams soundParams)
ref SoundObjectBuilder m_SoundObjectBuilder
Definition EffectSound.c:21
void SoundError(string err_msg)
Helper for throwing sound errors.
Definition EffectSound.c:914

Перекрестные ссылки GetPosition, m_ParentObject, m_SetEnvVariables, m_SoundObject, m_SoundObjectBuilder, m_SoundParams, m_SoundSetName, m_SoundWaveKind, SoundError() и SoundObjectBuilder().

Используется в SoundLoad() и SoundPlayEx().

◆ SoundPlay()

bool SoundPlay ( )
inlineprotected

Plays sound.

Возвращает
bool Whether the sound will start playing
200 {
202 return SoundPlayEx(params);
203 }
bool SoundPlayEx(out SoundParams params)
Plays sound.
Definition EffectSound.c:152

Перекрестные ссылки SoundPlayEx().

Используется в PlayIntense(), PlayLight(), FlashbangEffect::PlaySound() и Start().

◆ SoundPlayEx()

bool SoundPlayEx ( out SoundParams params)
inlineprotected

Plays sound.

Аргументы
paramsSoundParams Sound Parameters for the sound
Возвращает
bool Whether the sound will start playing
153 {
154 super.Start();
155
156 if (m_SoundSetName != "")
157 {
159
160 if ( SoundLoadEx(params) )
161 {
163 {
164 m_SoundObjectBuilder.AddEnvSoundVariables(GetPosition());
165 m_SoundObject = m_SoundObjectBuilder.BuildSoundObject();
167 m_SoundObject.SetParent( m_ParentObject );
168 }
169
170 if ( m_SoundObject )
171 {
173 m_SoundWaveObject = GetGame().GetSoundScene().Play3D( m_SoundObject, m_SoundObjectBuilder );
174 if ( !m_SoundWaveObject )
175 return false;
176
177 // Wait for header to be loaded before asking for its length, else we block the main thread
180 else
181 m_SoundWaveObject.GetEvents().Event_OnSoundWaveHeaderLoaded.Insert(ValidateSoundWave);
182
183 return true;
184 }
185 else
186 {
187 SoundError("m_SoundObject is null.");
188 }
189 }
190 }
191
192 return false;
193 }
proto bool IsHeaderLoaded()
AbstractWaveEvents GetEvents()
Definition Sound.c:164
override vector GetCurrentLocalPosition()
Get the current local position of the managed sound.
Definition EffectSound.c:740
void ValidateSoundWave()
Gets called to fill in the necessary data when the header has finished loading.
Definition EffectSound.c:365
override void SetCurrentLocalPosition(vector pos, bool updateCached=true)
Set the current local position of the managed sound.
Definition EffectSound.c:726
proto native CGame GetGame()

Перекрестные ссылки 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() и ValidateSoundWave().

Используется в SoundPlay().

◆ SoundReset()

void SoundReset ( )
inlineprotected

Resets EffectSound.

253 {
254 m_IsPlaying = false;
255 m_SoundWaveIsPlaying = false;
256 m_SoundWaveStopping = false;
257 m_SoundFadedOut = false;
259 m_SoundWaveTime = 0;
262
263 if ( m_SoundWaveObject )
264 {
267 }
268 }
bool m_IsPlaying
Whether the Effect is currently playing.
Definition Effect.c:37
float m_SoundFadeOutStartTime
Definition EffectSound.c:53

Перекрестные ссылки m_IsPlaying, m_SoundFadedOut, m_SoundFadeOutInitVolume, m_SoundFadeOutStartTime, m_SoundWaveIsPlaying, m_SoundWaveObject, m_SoundWaveStopping, m_SoundWaveTime, m_SoundWaveVolume, m_SoundWaveVolumeMax, AbstractWave::SetVolumeRelative() и AbstractWave::Stop().

Используется в SoundStop().

◆ SoundStop()

void SoundStop ( )
inlineprotected

Stops sound.

Заметки
Will not be immediately if a SoundFadeOutDuration was set
218 {
219 super.Stop();
220
221 if ( IsSoundPlaying() )
222 {
224 {
225 m_SoundWaveStopping = true;
226 m_SoundFadedOut = false;
227 m_SoundWaveStarting = false;
229 }
230 else
231 {
233 }
234 }
235 else if (!IsPendingDeletion()) // not about to be destroyed
236 {
237 SoundReset();
238 }
239 }
void SoundReset()
Resets EffectSound.
Definition EffectSound.c:252
bool IsPendingDeletion()
Get whether the Effect is queued up for being cleaned up.
Definition Effect.c:258

Перекрестные ссылки IsPendingDeletion(), IsSoundPlaying(), m_SoundFadedOut, m_SoundFadeOutDuration, m_SoundFadeOutStartTime, m_SoundWaveObject, m_SoundWaveStarting, m_SoundWaveStopping, m_SoundWaveTime, SoundReset() и AbstractWave::Stop().

Используется в BuildingSuper::EEDelete(), ItemBase::OnIsCharged(), PlayIntense(), PlayLight(), Stop(), ActionBuildShelter::StopActionLoopSound(), StopAllMusic(), ItemBase::StopChargedAlarm(), ItemBase::StopChargingSound(), InventoryItem::StopDeployLoopSoundEx(), StopEmptyingLoopSound(), StopPouringLoopSound(), FlashbangEffect::StopSound(), FlareSimulation::~FlareSimulation() и InventoryItem::~ItemBase().

◆ SoundWaveValidation()

bool SoundWaveValidation ( )
inlineprotected

Validation of fade settings.

Заметки
Called from 'ValidateSoundWave'
401 {
402 bool valid = true;
403
405 {
406 SoundError("FadeIn is longer than sound wave length.");
407 valid = false;
408 }
409
411 {
412 SoundError("FadeOut is longer than sound wave length.");
413 valid = false;
414 }
415
417 {
418 SoundError("FadeIn & FadeOut are longer than sound wave length.");
419 valid = false;
420 }
421
422 return valid;
423 }

Перекрестные ссылки GetSoundWaveLength(), m_SoundFadeInDuration, m_SoundFadeOutDuration и SoundError().

Используется в ValidateSoundWave().

◆ Start()

override void Start ( )
inlineprotected

Plays sound.

209 {
210 SoundPlay();
211 }
bool SoundPlay()
Plays sound.
Definition EffectSound.c:199

Перекрестные ссылки SoundPlay().

◆ Stop()

◆ UpdateEvents()

void UpdateEvents ( )
inlineprotected

Enables the frame event on the EffectSound.

Заметки
Called from 'ValidateSoundWave' when all is successful
So this is effectively enabling frame event on all valid EffectSound
431 {
432 if ( m_SoundWaveObject )
433 {
435 }
436 else
437 {
438 SetEnableEventFrame(false);
439 }
440 }
void SetEnableEventFrame(bool enable)
Enable Event_OnFrameUpdate for the effect.
Definition Effect.c:280

Перекрестные ссылки m_SoundWaveObject и SetEnableEventFrame().

Используется в ValidateSoundWave().

◆ ValidateSoundWave()

void ValidateSoundWave ( )
inlineprotected

Gets called to fill in the necessary data when the header has finished loading.

Заметки
Called from 'SoundPlayEx'
366 {
368 Print(this.ToString() + " SoundWaveObject does not exist, SoundSet: " + m_SoundSetName);
369
371
372 if ( SoundWaveValidation() )
373 {
374 if ( m_SoundFadeInDuration > 0 )
375 {
378 }
379
381
382 m_SoundWaveStarting = true;
383
385 events.Event_OnSoundWaveStarted.Insert( Event_OnSoundWaveStarted );
386 events.Event_OnSoundWaveEnded.Insert( Event_OnSoundWaveEnded );
387
388 UpdateEvents();
389 }
390 else
391 {
393 }
394 }
proto string ToString()
proto float GetLength()
WARNING: Blocking! Waits for header to load.
void UpdateEvents()
Enables the frame event on the EffectSound.
Definition EffectSound.c:430
bool SoundWaveValidation()
Validation of fade settings.
Definition EffectSound.c:400
void SetSoundLoop(bool loop)
Set if the sound loops.
Definition EffectSound.c:796
proto void Print(void var)
Prints content of variable to console/log.

Перекрестные ссылки Event_OnSoundWaveEnded, Event_OnSoundWaveStarted, AbstractWave::GetEvents(), AbstractWave::GetLength(), m_SoundFadeInDuration, m_SoundFadeOutStartTime, m_SoundLoop, m_SoundWaveLenght, m_SoundWaveObject, m_SoundWaveStarting, Print(), SetSoundLoop(), AbstractWave::SetVolumeRelative(), SoundWaveValidation(), AbstractWave::Stop(), ToString() и UpdateEvents().

Используется в SoundPlayEx().

Поля

◆ Event_OnSoundFadeInStopped

ref ScriptInvoker Event_OnSoundFadeInStopped = new ScriptInvoker()
private

Используется в Event_OnFrameUpdate() и Event_OnSoundFadeInStopped().

◆ Event_OnSoundFadeOutStarted

ref ScriptInvoker Event_OnSoundFadeOutStarted = new ScriptInvoker()
private

Используется в Event_OnFrameUpdate() и Event_OnSoundFadeOutStarted().

◆ Event_OnSoundWaveEnded

ref ScriptInvoker Event_OnSoundWaveEnded = new ScriptInvoker()
private

◆ Event_OnSoundWaveStarted

ref ScriptInvoker Event_OnSoundWaveStarted = new ScriptInvoker()
private

Используется в Event_OnSoundWaveStarted() и ValidateSoundWave().

◆ m_SetEnvVariables

bool m_SetEnvVariables
protected

Используется в SetEnviromentVariables(), SoundLoadEx() и SoundPlayEx().

◆ m_SoundAutodestroy

bool m_SoundAutodestroy
protected

Используется в EffectSound(), IsSoundAutodestroy() и SetAutodestroy().

◆ m_SoundDoppler

int m_SoundDoppler
protected

Используется в EffectSound(), Event_OnFrameUpdate() и SetDoppler().

◆ m_SoundFadedOut

bool m_SoundFadedOut
protected

Используется в EffectSound(), Event_OnFrameUpdate(), SoundReset() и SoundStop().

◆ m_SoundFadeInDuration

float m_SoundFadeInDuration
protected

◆ m_SoundFadeOutDuration

float m_SoundFadeOutDuration
protected

◆ m_SoundFadeOutInitVolume

float m_SoundFadeOutInitVolume
protected

Используется в Event_OnFrameUpdate() и SoundReset().

◆ m_SoundFadeOutStartTime

float m_SoundFadeOutStartTime
protected

Используется в SoundReset(), SoundStop() и ValidateSoundWave().

◆ m_SoundLoop

bool m_SoundLoop
protected

Используется в SetSoundLoop() и ValidateSoundWave().

◆ m_SoundObject

◆ m_SoundObjectBuilder

ref SoundObjectBuilder m_SoundObjectBuilder
protected

Используется в SoundLoadEx() и SoundPlayEx().

◆ m_SoundParams

ref SoundParams m_SoundParams
protected

Используется в IsSoundValid(), SoundLoadEx() и SoundPlayEx().

◆ m_SoundSetName

string m_SoundSetName
protected

◆ m_SoundWaveIsPlaying

bool m_SoundWaveIsPlaying
protected

◆ m_SoundWaveKind

WaveKind m_SoundWaveKind
protected

Используется в EffectSound(), SetSoundWaveKind(), SoundLoadEx() и SoundPlayEx().

◆ m_SoundWaveLenght

float m_SoundWaveLenght
protected

Используется в GetSoundWaveLength() и ValidateSoundWave().

◆ m_SoundWaveObject

◆ m_SoundWaveStarting

bool m_SoundWaveStarting
protected

Используется в Event_OnFrameUpdate(), SoundStop() и ValidateSoundWave().

◆ m_SoundWaveStopping

bool m_SoundWaveStopping
protected

Используется в EffectSound(), Event_OnFrameUpdate(), SoundReset() и SoundStop().

◆ m_SoundWaveTime

float m_SoundWaveTime
protected

◆ m_SoundWaveVolume

float m_SoundWaveVolume
protected

◆ m_SoundWaveVolumeMax

float m_SoundWaveVolumeMax
protected

Объявления и описания членов класса находятся в файле: