Nuclide
Software Development Kit for id Tech
NSSoundScape.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024 Vera Visions LLC.
3 *
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
13 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
14 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15*/
16
18{
19 SOUNDSCAPE_ORIGIN,
20 SOUNDSCAPE_REVERB,
21 SOUNDSCAPE_DECAY,
22 SOUNDSCAPE_REFLECTION,
23 SOUNDSCAPE_Late,
24 SOUNDSCAPE_ECHO,
25 SOUNDSCAPE_MODULATION,
26 SOUNDSCAPE_MISC
27};
28
84class
86{
87public:
88 void NSSoundScape(void);
89
90 /* overrides */
91
92
93#ifdef SERVER
95 nonvirtual void SetDensity(float);
97 nonvirtual void SetDiffusion(float);
99 nonvirtual void SetGain(float);
101 nonvirtual void SetGainHF(float);
103 nonvirtual void SetGainLF(float);
105 nonvirtual void SetDecayTime(float);
107 nonvirtual void SetDecayHFRatio(float);
109 nonvirtual void SetDecayLFRatio(float);
111 nonvirtual void SetReflectionGain(float);
113 nonvirtual void SetReflectionDelay(float);
115 nonvirtual void SetReflectionPan(vector);
117 nonvirtual void SetLateGain(float);
119 nonvirtual void SetLateDelay(float);
121 nonvirtual void SetLatePan(vector);
123 nonvirtual void SetEchoTime(float);
125 nonvirtual void SetEchoDepth(float);
127 nonvirtual void SetModulationTime(float);
129 nonvirtual void SetModulationDepth(float);
131 nonvirtual void SetAirAbsorptionGainHF(float);
133 nonvirtual void SetHFReference(float);
135 nonvirtual void SetLFReference(float);
137 nonvirtual void SetRoomRolloffFactor(float);
139 nonvirtual void SetDecayHFLimit(int);
140
142 nonvirtual void SetRadius(float);
143#endif
144
145#ifdef CLIENT
146 nonvirtual float GetDensity(void);
147 nonvirtual float GetDiffusion(void);
148 nonvirtual float GetGain(void);
149 nonvirtual float GetGainHF(void);
150 nonvirtual float GetGainLF(void);
151 nonvirtual float GetDecayTime(void);
152 nonvirtual float GetDecayHFRatio(void);
153 nonvirtual float GetDecayLFRatio(void);
154 nonvirtual float GetReflectionGain(void);
155 nonvirtual float GetReflectionDelay(void);
156 nonvirtual vector GetReflectionPan(void);
157 nonvirtual float GetLateGain(void);
158 nonvirtual float GetLateDelay(void);
159 nonvirtual vector GetLatePan(void);
160 nonvirtual float GetEchoTime(void);
161 nonvirtual float GetEchoDepth(void);
162 nonvirtual float GetModulationTime(void);
163 nonvirtual float GetModulationDepth(void);
164 nonvirtual float GetAirAbsorptionGainHF(void);
165 nonvirtual float GetHFReference(void);
166 nonvirtual float GetLFReference(void);
167 nonvirtual float GetRoomRolloffFactor(void);
168 nonvirtual int GetDecayHFLimit(void);
169 nonvirtual float GetRadius(void);
170#endif
171
172
173#ifdef SERVER
174 virtual void SpawnKey(string, string);
175 virtual void Input(entity,string, string);
176 virtual void EvaluateEntity(void);
177 virtual float SendEntity(entity, float);
178 virtual void Save(float);
179 virtual void Restore(string,string);
180#endif
181
182 nonvirtual bool LoadFromEFX(string);
183
184#ifdef CLIENT
185 virtual void DebugDraw(void);
186 virtual void ReceiveEntity(float, float);
187 nonvirtual void SetupEFXReverb(reverbinfo_t *);
188#endif
189
190
191private:
192 NETWORKED_FLOAT(m_density)
193 NETWORKED_FLOAT(m_diffusion)
194 NETWORKED_FLOAT(m_gain)
195 NETWORKED_FLOAT(m_gainHF)
196 NETWORKED_FLOAT(m_gainLF)
197 NETWORKED_FLOAT(m_decayTime)
198 NETWORKED_FLOAT(m_decayHFRatio)
199 NETWORKED_FLOAT(m_decayLFRatio)
200 NETWORKED_FLOAT(m_reflectionGain)
201 NETWORKED_FLOAT(m_reflectionDelay)
202 NETWORKED_VECTOR(m_reflectionPan)
203 NETWORKED_FLOAT(m_LateGain)
204 NETWORKED_FLOAT(m_LateDelay)
205 NETWORKED_VECTOR(m_LatePan)
206 NETWORKED_FLOAT(m_echoTime)
207 NETWORKED_FLOAT(m_echoDepth)
208 NETWORKED_FLOAT(m_modulationTime)
209 NETWORKED_FLOAT(m_modulationDepth)
210 NETWORKED_FLOAT(m_airAbsorptionGainHF)
211 NETWORKED_FLOAT(m_HFReference)
212 NETWORKED_FLOAT(m_LFReference)
213 NETWORKED_FLOAT(m_roomRolloffFactor)
214 NETWORKED_INT(m_decayHFLimit)
215 NETWORKED_FLOAT(m_radius)
216};
217
218#ifdef CLIENT
220#endif
void EFX_UpdateSoundScape(NSSoundScape)
Definition: NSSoundScape.qc:838
enumflags
Definition: NSSoundScape.h:18
This entity class represents point-entity triggers.
Definition: NSPointTrigger.h:26
Shared-Entity: Sound System Scape/Reverb Controller.
Definition: NSSoundScape.h:86
virtual void ReceiveEntity(float, float)
Client: Handles network updates from the server for the associated entity.
#define NETWORKED_INT(x)
Definition: defs.h:20
#define NETWORKED_FLOAT(x)
Definition: defs.h:21
#define NETWORKED_VECTOR(x)
Definition: defs.h:22