Dayz 1.25
Dayz Code 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
631 {
633 }
float m_SoundFadeOutDuration
Definition EffectSound.c:54

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

◆ 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
455 {
456 if ( IsSoundPlaying() )
457 {
458 if (m_SoundDoppler != -1)
459 {
461 }
462 // FadeIn
464 {
465 if ( m_SoundFadeInDuration > 0 )
466 {
468
470 {
473 m_SoundWaveStarting = false;
474 }
475 }
476 else
477 {
479 m_SoundWaveStarting = false;
480 }
481 }
482
483 // FadeOut
485 {
486 if ( m_SoundFadeOutDuration > 0 )
487 {
488 if ( m_SoundFadeOutInitVolume == 0 )
489 {
492 }
494 }
495 else
496 {
497 SetSoundVolume( 0 );
498 }
499
500 if ( GetSoundVolume() <= 0 )
501 {
502 if ( m_SoundWaveObject )
503 {
505 m_SoundWaveStopping = false;
506 m_SoundFadedOut = true;
507 }
508 }
509 }
510
511 // Counting timer here because loop play
513 }
514 }
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:833
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:844
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
522 {
523 super.Event_OnRegistered(id);
524
526 }
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:446

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

◆ Event_OnSoundFadeInStopped()

void Event_OnSoundFadeInStopped ( )
inlineprotected

Event called when sound fade in stops.

Заметки
Called from Event_OnFrameUpdate
570 {
571 Event_OnSoundFadeInStopped.Invoke(this);
572 }

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

◆ Event_OnSoundFadeOutStarted()

void Event_OnSoundFadeOutStarted ( )
inlineprotected

Event called when sound fade out starts.

Заметки
Called from Event_OnFrameUpdate
579 {
580 Event_OnSoundFadeOutStarted.Invoke(this);
581 }

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

◆ Event_OnSoundWaveEnded()

void Event_OnSoundWaveEnded ( )
inlineprotected

Event called when sound stops playing.

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

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

◆ Event_OnSoundWaveStarted()

void Event_OnSoundWaveStarted ( )
inlineprotected

Event called when sound starts playing.

Заметки
Inserted into events of m_SoundWaveObject
544 {
546
547 Event_OnSoundWaveStarted.Invoke(this);
548
550 }
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!
533 {
534 super.Event_OnUnregistered();
535
537 }

Перекрестные ссылки 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
738 {
739 Object parent = GetParent();
740
741 if (m_SoundObject)
742 {
743 //TODO(kumarjac): Create and expose 'SoundObject.GetLocalPosition'
744 if (parent)
745 return parent.WorldToModel(m_SoundObject.GetPosition());
746 else
747 return m_SoundObject.GetPosition();
748 }
749 else
750 {
751 if (parent)
752 return GetLocalPosition();
753 else
754 return GetPosition();
755 }
756
757 return vector.Zero;
758 }
vector GetLocalPosition()
Get the local position of the Effect.
Definition Effect.c:486
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:662
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
676 {
677 if (m_SoundObject)
678 return Object.Cast(m_SoundObject.GetParent());
679 else
680 return super.GetParent(); // Yes, intentionally this one
681 }

Перекрестные ссылки 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
708 {
709 if (m_SoundObject)
710 return m_SoundObject.GetPosition();
711
712 if (m_ParentObject)
713 return m_ParentObject.ModelToWorld(GetPosition());
714
715 return GetPosition();
716 }
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
663 {
664 if (m_SoundObject)
665 return Object.Cast(m_SoundObject.GetParent());
666 else
667 return super.GetParent();
668 }

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

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

◆ GetSoundSet()

string GetSoundSet ( )
inlineprotected

Get soundset for the sound.

Возвращает
string Name of the soundset
785 {
786 return m_SoundSetName;
787 }

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

◆ GetSoundVolume()

float GetSoundVolume ( )
inlineprotected

Get the RELATIVE volume set by 'SetSoundVolume'.

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

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

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

◆ GetSoundWaveLenght()

float GetSoundWaveLenght ( )
inlineprotected

Get the sound wave length.

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

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

◆ GetSoundWaveLength()

float GetSoundWaveLength ( )
inlineprotected

Get the sound wave length.

Возвращает
float The sound wave length
825 {
826 return m_SoundWaveLenght;
827 }
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
868 {
869 return m_SoundWaveTime;
870 }

Перекрестные ссылки 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:300

Перекрестные ссылки 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
608 {
609 return IsSoundAutodestroy();
610 }
bool IsSoundAutodestroy()
Get whether EffectSound automatically cleans up when sound stops.
Definition EffectSound.c:625

Перекрестные ссылки 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
626 {
627 return m_SoundAutodestroy;
628 }

Перекрестные ссылки 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
598 {
599 super.SetAutodestroy(auto_destroy);
601 }

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

Используется в 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
724 {
725 super.SetCurrentLocalPosition(pos, updateCached);
726
727 if (m_SoundObject)
728 {
729 m_SoundObject.SetPosition(pos);
730 }
731 }

Перекрестные ссылки 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
689 {
690 super.SetCurrentPosition(pos, updateCached);
691
692 if (m_SoundObject)
693 {
694 Object parent = GetParent();
695
696 if (parent)
697 pos = parent.WorldToModel(pos);
698
699 m_SoundObject.SetPosition(pos);
700 }
701 }

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

895 {
897 m_SoundDoppler = 0;
898 if (setDoppler)
899 {
900 m_SoundDoppler = 1;
901 }
902 }

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

◆ SetEnviromentVariables()

void SetEnviromentVariables ( bool setEnvVariables)
inlineprotected

Sets whether AddEnvSoundVariables needs to be called during Loading.

Аргументы
setEnvVariablesbool Whether AddEnvSoundVariables is called
806 {
808 }
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
649 {
650 super.SetParent(parent_obj); // ...
651
652 if (m_SoundObject)
653 {
654 m_SoundObject.SetParent(parent_obj);
655 }
656 }

Перекрестные ссылки 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
617 {
619 }
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
Definition EffectSound.c:597

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

◆ SetSoundFadeIn()

void SetSoundFadeIn ( float fade_in)
inlineprotected

Set the sound fade in duration.

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

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

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

◆ SetSoundFadeOut()

void SetSoundFadeOut ( float fade_out)
inlineprotected

Set the sound fade out duration.

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

Перекрестные ссылки 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
794 {
796
797 if ( m_SoundWaveObject )
799 }
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
856 {
858 if ( m_SoundWaveObject )
860 }
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
776 {
778 }

Перекрестные ссылки 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
766 {
768 }

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

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

◆ SoundError()

void SoundError ( string err_msg)
inlineprotected

Helper for throwing sound errors.

912 {
913 ErrorEx(string.Format("%1: SoundSetName: '%2' :: %3", this, m_SoundSetName, err_msg));
914 }
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:911

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

◆ SoundWaveValidation()

bool SoundWaveValidation ( )
inlineprotected

Validation of fade settings.

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

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

override void Stop ( )
inlineprotected

Stops sound.

245 {
246 SoundStop();
247 }
void SoundStop()
Stops sound.
Definition EffectSound.c:217

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

Используется в Land_Underground_Stairs_Exit::HandleAudioPlayback(), FireworksLauncher::OnFiringStartClient(), FireworksLauncherClientEvent::PlayExplosionSound(), Edible_Base::SoundCookingStop() и ~UndergroundHandlerClient().

◆ 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
428 {
429 if ( m_SoundWaveObject )
430 {
432 }
433 else
434 {
435 SetEnableEventFrame(false);
436 }
437 }
void SetEnableEventFrame(bool enable)
Enable Event_OnFrameUpdate for the effect.
Definition Effect.c:278

Перекрестные ссылки 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
369 if ( SoundWaveValidation() )
370 {
371 if ( m_SoundFadeInDuration > 0 )
372 {
375 }
376
378
379 m_SoundWaveStarting = true;
380
382 events.Event_OnSoundWaveStarted.Insert( Event_OnSoundWaveStarted );
383 events.Event_OnSoundWaveEnded.Insert( Event_OnSoundWaveEnded );
384
385 UpdateEvents();
386 }
387 else
388 {
390 }
391 }
proto float GetLength()
WARNING: Blocking! Waits for header to load.
void UpdateEvents()
Enables the frame event on the EffectSound.
Definition EffectSound.c:427
bool SoundWaveValidation()
Validation of fade settings.
Definition EffectSound.c:397
void SetSoundLoop(bool loop)
Set if the sound loops.
Definition EffectSound.c:793

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

◆ 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

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