Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
sound.c
Go to the documentation of this file.
19//----------------------------------------------
24
25enum SoundControllerAction
26{
29 Overwrite
30}
31
38proto native void SetSoundControllerOverride(string controllerName, float value, SoundControllerAction action);
39
43proto native void MuteAllSoundControllers();
44
48proto native void ResetAllSoundControllers();
49
51
52
54{
55 private void AbstractSoundScene() {}
56 private void ~AbstractSoundScene() {}
57
58 proto native AbstractWave Play2D(SoundObject soundObject, SoundObjectBuilder soundBuilder);
59 proto native AbstractWave Play3D(SoundObject soundObject, SoundObjectBuilder soundBuilder);
60 proto native SoundObject BuildSoundObject(SoundObjectBuilder soundObjectbuilder);
61
62 proto native float GetRadioVolume();
63 proto native void SetRadioVolume(float vol, float time);
64
65 proto native float GetSpeechExVolume();
66 proto native void SetSpeechExVolume(float vol, float time);
67
68 proto native float GetMusicVolume();
69 proto native void SetMusicVolume(float vol, float time);
70
71 proto native float GetSoundVolume();
72 proto native void SetSoundVolume(float vol, float time);
73
74 proto native float GetVOIPVolume();
75 proto native void SetVOIPVolume(float vol, float time);
76
77 proto native float GetSilenceThreshold();
78 proto native float GetAudioLevel();
79}
80
81
83{
84 void SoundObjectBuilder(SoundParams soundParams);
85
87 {
88 return g_Game.GetSoundScene().BuildSoundObject(this);
89 }
90
91 proto native void Initialize(SoundParams soundParams);
92
93 proto native void AddEnvSoundVariables(vector position);
94 proto native void AddVariable(string name, float value);
95 proto void AddVariables(notnull array<string> names, array<float> values = null);
96
99 {
100 AddEnvSoundVariables(position);
101 }
102
104 void SetVariable(string name, float value)
105 {
106 AddVariable(name, value);
107 }
108}
109
110
112{
113 void SoundObject(SoundParams soundParams);
114
115 proto void UpdateVariables(notnull array<float> values);
116
119 proto native void SetParent(IEntity parent, int pivot = -1);
120 proto native IEntity GetParent();
121 proto native int GetHierarchyPivot();
122
124 proto native void SetPosition(vector position);
125 proto native vector GetPosition();
126
128 proto native void SetSpeed(vector speed);
129 proto native vector GetSpeed();
130
131 proto native void SetOcclusionObstruction(float occlusion, float obstruction);
132 proto native void SetKind(WaveKind kind);
133 proto native void Initialize(SoundParams soundParams);
134}
135
136//soundsys.hpp
137class SoundParams
138{
139 void SoundParams(string name);
140
141 proto native bool Load(string name);
142 proto native bool IsValid();
163 #ifdef DIAG_DEVELOPER
164 private void AbstractWave() { InitEvents(); }
165 private void ~AbstractWave() {}
166 #else
168 #endif
169
170 proto void SetUserData(Managed inst);
172
173 proto void Play();
174
175 void PlayWithOffset(float offset)
176 {
177 Play();
178 SetStartOffset(offset);
179 }
180 //proto native void Mute();
181 proto void Stop();
182 proto void Restart();
183 proto void SetStartOffset(float offset);
185 proto float GetLength();
187 proto float GetCurrPosition();
188 proto void Loop(bool setLoop);
189 proto float GetVolume();
190 proto void SetVolume(float value);
191 proto void SetVolumeRelative(float value);
192 proto void SetFrequency(float value);
193 proto float GetFrequency();
194 proto void SetPosition(vector position, vector velocity = "0 0 0");
195 proto void SetFadeInFactor(float volume);
196 proto void SetFadeOutFactor(float volume);
197 proto void SetDoppler(bool setDoppler);
198 proto void Skip(float timeSec);
199 proto bool IsHeaderLoaded();
200
205
206 void OnPlay()
207 {
208 GetEvents().Event_OnSoundWaveStarted.Invoke(this);
209 }
210
211 void OnStop()
212 {
213 GetEvents().Event_OnSoundWaveStopped.Invoke(this);
214 }
215
216 void OnLoad()
217 {
218 GetEvents().Event_OnSoundWaveLoaded.Invoke(this);
219 }
220
222 {
223 GetEvents().Event_OnSoundWaveHeaderLoaded.Invoke(this);
224 }
225
226 void OnEnd()
227 {
228 GetEvents().Event_OnSoundWaveEnded.Invoke(this);
229 }
230}
proto bool IsValid()
Checks if the ScriptCaller is valid.
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
Internal ancestor of all Entity implementations.
Definition enentity.c:165
TODO doc.
Definition enscript.c:118
ScriptInvoker Class provide list of callbacks usage:
Definition tools.c:116
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
DayZGame g_Game
Definition dayzgame.c:3942
@ None
Definition enworld.c:73
proto native void SetPosition(vector position)
Set the world position of the Effect.
Definition effect.c:463
SetSoundControllerOverride(string controllerName, float value, SoundControllerAction action)
Overrides or limits soundmap value for a sound cotroller.
proto void SetVolume(float value)
proto native void SetSpeed(vector speed)
Note: Sets the speed locally if parented, retrieves globally with the parent speed.
proto void SetStartOffset(float offset)
WAVEENVIRONMENTEX
Definition sound.c:9
proto void SetFadeInFactor(float volume)
proto float GetVolume()
proto void Play()
void SoundObject(SoundParams soundParams)
class AbstractWaveEvents InitEvents()
Definition sound.c:157
void PlayWithOffset(float offset)
Definition sound.c:175
proto native IEntity GetParent()
proto native void AddVariable(string name, float value)
WAVEENVIRONMENT
Definition sound.c:8
proto void AddVariables(notnull array< string > names, array< float > values=null)
void OnEnd()
Definition sound.c:226
proto native AbstractWave Play2D(SoundObject soundObject, SoundObjectBuilder soundBuilder)
ref ScriptInvoker Event_OnSoundWaveEnded
Definition sound.c:152
proto native void Initialize(SoundParams soundParams)
WAVEWEAPONSEX
Definition sound.c:11
proto native void SetPosition(vector position)
Note: Sets the position locally if parented, retrieves globally with the sound offset.
ref ScriptInvoker Event_OnSoundWaveLoaded
Definition sound.c:150
proto native float GetAudioLevel()
proto void SetDoppler(bool setDoppler)
proto void SetFrequency(float value)
proto native vector GetPosition()
ref ScriptInvoker Event_OnSoundWaveStopped
Definition sound.c:149
proto native void AddEnvSoundVariables(vector position)
proto native void SetParent(IEntity parent, int pivot=-1)
Note: 'SoundObject' is not an Entity, and therefore can not be accessed by using 'IEntity....
proto native void SetKind(WaveKind kind)
proto native float GetSilenceThreshold()
Limit
WAVEWEAPONS
Definition sound.c:10
WAVEEFFECT
Definition sound.c:3
class AbstractSoundScene SoundObjectBuilder(SoundParams soundParams)
SoundObject BuildSoundObject()
Definition sound.c:86
proto native void SetSoundVolume(float vol, float time)
proto void SetFadeOutFactor(float volume)
proto native float GetSpeechExVolume()
proto native float GetMusicVolume()
proto native float GetSoundVolume()
proto void Loop(bool setLoop)
proto native float GetVOIPVolume()
proto native void SetSpeechExVolume(float vol, float time)
void AbstractWave()
Definition sound.c:167
proto native SoundObject BuildSoundObject(SoundObjectBuilder soundObjectbuilder)
proto void SetVolumeRelative(float value)
void AbstractSoundScene()
Definition sound.c:55
void OnHeaderLoad()
Definition sound.c:221
proto float GetCurrPosition()
Current position in percentage of total length.
void SetVariable(string name, float value)
Deprecated - same functionality, just poor naming.
Definition sound.c:104
proto native vector GetSpeed()
ref ScriptInvoker Event_OnSoundWaveHeaderLoaded
Definition sound.c:151
WAVEUI
Definition sound.c:14
class SoundObject SoundParams(string name)
proto void UpdateVariables(notnull array< float > values)
proto bool IsHeaderLoaded()
proto void Restart()
WAVEEFFECTEX
Definition sound.c:4
proto native AbstractWave Play3D(SoundObject soundObject, SoundObjectBuilder soundBuilder)
proto native int GetHierarchyPivot()
WAVEATTALWAYS
Definition sound.c:12
WAVESPEECHEX
Definition sound.c:7
proto Managed GetUserData()
void ~AbstractSoundScene()
Definition sound.c:56
void OnStop()
Definition sound.c:211
proto native void SetMusicVolume(float vol, float time)
proto native void SetVOIPVolume(float vol, float time)
proto native void SetRadioVolume(float vol, float time)
proto native void SetOcclusionObstruction(float occlusion, float obstruction)
void OnLoad()
Definition sound.c:216
WAVESPEECH
Definition sound.c:5
proto float GetFrequency()
void UpdateEnvSoundControllers(vector position)
Deprecated - same functionality, just poor naming.
Definition sound.c:98
WAVEMUSIC
Definition sound.c:6
proto void Skip(float timeSec)
proto native float GetRadioVolume()
void Stop()
Stops all elements this effect consists of.
Definition effect.c:183
proto native void ResetAllSoundControllers()
Removes all the previously set overrides of sound controllers.
ref ScriptInvoker Event_OnSoundWaveStarted
Definition sound.c:148
proto native void MuteAllSoundControllers()
Overrides all the environment controllers to be muted.
void OnPlay()
Definition sound.c:206
proto float GetLength()
WARNING: Blocking! Waits for header to load.
proto native owned string GetName()
Test name getter. Strictly for UI porposes!
proto native void SetUserData(Class data)
proto native void Load(string noise_name)
ParticleEvents GetEvents()
Get the events.
WaveKind
Definition sound.c:2