Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
sound.c
Go to the documentation of this file.
1 enum WaveKind
2 {
14 }
15 
17 {
18  private void AbstractSoundScene() {}
19  private void ~AbstractSoundScene() {}
20 
21  proto native AbstractWave Play2D(SoundObject soundObject, SoundObjectBuilder soundBuilder);
22  proto native AbstractWave Play3D(SoundObject soundObject, SoundObjectBuilder soundBuilder);
23  proto native SoundObject BuildSoundObject(SoundObjectBuilder soundObjectbuilder);
24 
25  proto native float GetRadioVolume();
26  proto native void SetRadioVolume(float vol, float time);
27 
28  proto native float GetSpeechExVolume();
29  proto native void SetSpeechExVolume(float vol, float time);
30 
31  proto native float GetMusicVolume();
32  proto native void SetMusicVolume(float vol, float time);
33 
34  proto native float GetSoundVolume();
35  proto native void SetSoundVolume(float vol, float time);
36 
37  proto native float GetVOIPVolume();
38  proto native void SetVOIPVolume(float vol, float time);
39 
40  proto native float GetSilenceThreshold();
41  proto native float GetAudioLevel();
42 }
43 
44 
46 {
47  void SoundObjectBuilder(SoundParams soundParams);
48 
49  SoundObject BuildSoundObject()
50  {
51  return GetGame().GetSoundScene().BuildSoundObject(this);
52  }
53 
54  proto native void Initialize(SoundParams soundParams);
55 
56  proto native void AddEnvSoundVariables(vector position);
57  proto native void AddVariable(string name, float value);
58  proto void AddVariables(notnull array<string> names, array<float> values = null);
59 
61  void UpdateEnvSoundControllers(vector position)
62  {
63  AddEnvSoundVariables(position);
64  }
65 
67  void SetVariable(string name, float value)
68  {
69  AddVariable(name, value);
70  }
71 }
72 
73 
74 class SoundObject
75 {
76  void SoundObject(SoundParams soundParams);
77 
78  proto void UpdateVariables(notnull array<float> values);
79 
82  proto native void SetParent(IEntity parent, int pivot = -1);
83  proto native IEntity GetParent();
84  proto native int GetHierarchyPivot();
85 
87  proto native void SetPosition(vector position);
88  proto native vector GetPosition();
89 
91  proto native void SetSpeed(vector speed);
92  proto native vector GetSpeed();
93 
94  proto native void SetOcclusionObstruction(float occlusion, float obstruction);
95  proto native void SetKind(WaveKind kind);
96  proto native void Initialize(SoundParams soundParams);
97 }
98 
99 //soundsys.hpp
101 {
102  void SoundParams(string name);
103 
104  proto native bool Load(string name);
105  proto native bool IsValid();
106  proto string GetName();
107 }
108 
109 class AbstractWaveEvents
110 {
116 }
117 
119 {
120  private void InitEvents()
121  {
122  AbstractWaveEvents events = new AbstractWaveEvents();
123  SetUserData(events);
124  }
125 
126  #ifdef DIAG_DEVELOPER
127  private void AbstractWave() { InitEvents(); }
128  private void ~AbstractWave() {}
129  #else
130  void AbstractWave() { InitEvents(); }
131  #endif
132 
133  proto void SetUserData(Managed inst);
134  proto Managed GetUserData();
135 
136  proto void Play();
137 
138  void PlayWithOffset(float offset)
139  {
140  Play();
141  SetStartOffset(offset);
142  }
143  //proto native void Mute();
144  proto void Stop();
145  proto void Restart();
146  proto void SetStartOffset(float offset);
148  proto float GetLength();
150  proto float GetCurrPosition();
151  proto void Loop(bool setLoop);
152  proto float GetVolume();
153  proto void SetVolume(float value);
154  proto void SetVolumeRelative(float value);
155  proto void SetFrequency(float value);
156  proto float GetFrequency();
157  proto void SetPosition(vector position, vector velocity = "0 0 0");
158  proto void SetFadeInFactor(float volume);
159  proto void SetFadeOutFactor(float volume);
160  proto void SetDoppler(bool setDoppler);
161  proto void Skip(float timeSec);
162  proto bool IsHeaderLoaded();
163 
164  AbstractWaveEvents GetEvents()
165  {
166  return AbstractWaveEvents.Cast(GetUserData());
167  }
168 
169  void OnPlay()
170  {
171  GetEvents().Event_OnSoundWaveStarted.Invoke(this);
172  }
173 
174  void OnStop()
175  {
176  GetEvents().Event_OnSoundWaveStopped.Invoke(this);
177  }
178 
179  void OnLoad()
180  {
181  GetEvents().Event_OnSoundWaveLoaded.Invoke(this);
182  }
183 
184  void OnHeaderLoad()
185  {
186  GetEvents().Event_OnSoundWaveHeaderLoaded.Invoke(this);
187  }
188 
189  void OnEnd()
190  {
191  GetEvents().Event_OnSoundWaveEnded.Invoke(this);
192  }
193 }
GetVOIPVolume
proto native float GetVOIPVolume()
GetGame
proto native CGame GetGame()
WAVEWEAPONS
WAVEWEAPONS
Definition: sound.c:9
Event_OnSoundWaveStopped
ref ScriptInvoker Event_OnSoundWaveStopped
Definition: sound.c:112
WAVESPEECHEX
WAVESPEECHEX
Definition: sound.c:6
WAVEATTALWAYS
WAVEATTALWAYS
Definition: sound.c:11
Event_OnSoundWaveEnded
ref ScriptInvoker Event_OnSoundWaveEnded
Definition: sound.c:115
WAVEEFFECTEX
WAVEEFFECTEX
Definition: sound.c:3
SetSoundVolume
proto native void SetSoundVolume(float vol, float time)
SetOcclusionObstruction
proto native void SetOcclusionObstruction(float occlusion, float obstruction)
GetHierarchyPivot
proto native int GetHierarchyPivot()
GetUserData
proto void GetUserData(out Class data)
Play
ParticleSource Play(int particle_id, Object parent_obj, vector local_pos="0 0 0", vector local_ori="0 0 0")
Legacy function for backwards compatibility with 1.01 and below.
Definition: particlemanager.c:226
SetParent
proto native void SetParent(IEntity parent, int pivot=-1)
WAVEENVIRONMENT
WAVEENVIRONMENT
Definition: sound.c:7
Play2D
proto native AbstractWave Play2D(SoundObject soundObject, SoundObjectBuilder soundBuilder)
WAVEUI
WAVEUI
Definition: sound.c:13
WAVEMUSIC
WAVEMUSIC
Definition: sound.c:5
SetKind
proto native void SetKind(WaveKind kind)
GetSpeechExVolume
proto native float GetSpeechExVolume()
SetRadioVolume
proto native void SetRadioVolume(float vol, float time)
WAVESPEECH
WAVESPEECH
Definition: sound.c:4
GetMusicVolume
proto native float GetMusicVolume()
Managed
TODO doc.
Definition: enscript.c:117
SoundObject
class SoundObjectBuilder SoundObject(SoundParams soundParams)
GetSpeed
proto native vector GetSpeed()
~AbstractSoundScene
private void ~AbstractSoundScene()
Definition: sound.c:19
IEntity
Definition: enentity.c:164
Initialize
proto native void Initialize(SoundParams soundParams)
Event_OnSoundWaveHeaderLoaded
ref ScriptInvoker Event_OnSoundWaveHeaderLoaded
Definition: sound.c:114
SoundParams
Definition: sound.c:100
Event_OnSoundWaveStarted
class SoundParams Event_OnSoundWaveStarted
WAVEEFFECT
WAVEEFFECT
Definition: sound.c:2
vector
Definition: enconvert.c:105
WAVEWEAPONSEX
WAVEWEAPONSEX
Definition: sound.c:10
SetSpeed
proto native void SetSpeed(vector speed)
Note: Sets the speed locally if parented, retrieves globally with the parent speed.
BuildSoundObject
proto native SoundObject BuildSoundObject(SoundObjectBuilder soundObjectbuilder)
WaveKind
WaveKind
Definition: sound.c:1
SetVOIPVolume
proto native void SetVOIPVolume(float vol, float time)
SetMusicVolume
proto native void SetMusicVolume(float vol, float time)
WAVEENVIRONMENTEX
WAVEENVIRONMENTEX
Definition: sound.c:8
array< string >
name
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
Play3D
proto native AbstractWave Play3D(SoundObject soundObject, SoundObjectBuilder soundBuilder)
SetPosition
proto native void SetPosition(vector position)
Note: Sets the position locally if parented, retrieves globally with the sound offset.
Definition: effect.c:436
AbstractSoundScene
enum WaveKind AbstractSoundScene()
Definition: sound.c:18
UpdateVariables
proto void UpdateVariables(notnull array< float > values)
GetPosition
proto native vector GetPosition()
Get the world position of the Effect.
Definition: undergroundarealoader.c:9
GetAudioLevel
proto native float GetAudioLevel()
SoundObjectBuilder
Definition: sound.c:45
GetParent
proto native IEntity GetParent()
Get parent of the Effect.
Definition: effect.c:405
SetSpeechExVolume
proto native void SetSpeechExVolume(float vol, float time)
AbstractWave
Definition: sound.c:118
GetRadioVolume
proto native float GetRadioVolume()
GetSilenceThreshold
proto native float GetSilenceThreshold()
GetSoundVolume
proto native float GetSoundVolume()
Event_OnSoundWaveLoaded
ref ScriptInvoker Event_OnSoundWaveLoaded
Definition: sound.c:113
ScriptInvoker
ScriptInvoker Class provide list of callbacks usage:
Definition: tools.c:115