Nuclide
Software Development Kit for id Technology
NSSoundScape.h
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
65class
67{
68public:
69 void NSSoundScape(void);
70
71 /* overrides */
72
73
74#ifdef SERVER
76 nonvirtual void SetDensity(float);
78 nonvirtual void SetDiffusion(float);
80 nonvirtual void SetGain(float);
82 nonvirtual void SetGainHF(float);
84 nonvirtual void SetGainLF(float);
86 nonvirtual void SetDecayTime(float);
88 nonvirtual void SetDecayHFRatio(float);
90 nonvirtual void SetDecayLFRatio(float);
92 nonvirtual void SetReflectionGain(float);
94 nonvirtual void SetReflectionDelay(float);
96 nonvirtual void SetReflectionPan(vector);
98 nonvirtual void SetLateGain(float);
100 nonvirtual void SetLateDelay(float);
102 nonvirtual void SetLatePan(vector);
104 nonvirtual void SetEchoTime(float);
106 nonvirtual void SetEchoDepth(float);
108 nonvirtual void SetModulationTime(float);
110 nonvirtual void SetModulationDepth(float);
112 nonvirtual void SetAirAbsorptionGainHF(float);
114 nonvirtual void SetHFReference(float);
116 nonvirtual void SetLFReference(float);
118 nonvirtual void SetRoomRolloffFactor(float);
120 nonvirtual void SetDecayHFLimit(int);
121
123 nonvirtual void SetRadius(float);
124#endif
125
126#ifdef CLIENT
127 nonvirtual float GetDensity(void);
128 nonvirtual float GetDiffusion(void);
129 nonvirtual float GetGain(void);
130 nonvirtual float GetGainHF(void);
131 nonvirtual float GetGainLF(void);
132 nonvirtual float GetDecayTime(void);
133 nonvirtual float GetDecayHFRatio(void);
134 nonvirtual float GetDecayLFRatio(void);
135 nonvirtual float GetReflectionGain(void);
136 nonvirtual float GetReflectionDelay(void);
137 nonvirtual vector GetReflectionPan(void);
138 nonvirtual float GetLateGain(void);
139 nonvirtual float GetLateDelay(void);
140 nonvirtual vector GetLatePan(void);
141 nonvirtual float GetEchoTime(void);
142 nonvirtual float GetEchoDepth(void);
143 nonvirtual float GetModulationTime(void);
144 nonvirtual float GetModulationDepth(void);
145 nonvirtual float GetAirAbsorptionGainHF(void);
146 nonvirtual float GetHFReference(void);
147 nonvirtual float GetLFReference(void);
148 nonvirtual float GetRoomRolloffFactor(void);
149 nonvirtual int GetDecayHFLimit(void);
150 nonvirtual float GetRadius(void);
151#endif
152
153
154#ifdef SERVER
155 virtual void SpawnKey(string, string);
156 virtual void Input(entity,string, string);
157 virtual void EvaluateEntity(void);
158 virtual float SendEntity(entity, float);
159 virtual void Save(float);
160 virtual void Restore(string,string);
161#endif
162
163 nonvirtual bool LoadFromEFX(string);
164
165#ifdef CLIENT
166 virtual void DebugDraw(void);
167 virtual void ReceiveEntity(float, float);
168 nonvirtual void SetupEFXReverb(reverbinfo_t *);
169#endif
170
171
172private:
173 NETWORKED_FLOAT(m_density)
174 NETWORKED_FLOAT(m_diffusion)
175 NETWORKED_FLOAT(m_gain)
176 NETWORKED_FLOAT(m_gainHF)
177 NETWORKED_FLOAT(m_gainLF)
178 NETWORKED_FLOAT(m_decayTime)
179 NETWORKED_FLOAT(m_decayHFRatio)
180 NETWORKED_FLOAT(m_decayLFRatio)
181 NETWORKED_FLOAT(m_reflectionGain)
182 NETWORKED_FLOAT(m_reflectionDelay)
183 NETWORKED_VECTOR(m_reflectionPan)
184 NETWORKED_FLOAT(m_LateGain)
185 NETWORKED_FLOAT(m_LateDelay)
186 NETWORKED_VECTOR(m_LatePan)
187 NETWORKED_FLOAT(m_echoTime)
188 NETWORKED_FLOAT(m_echoDepth)
189 NETWORKED_FLOAT(m_modulationTime)
190 NETWORKED_FLOAT(m_modulationDepth)
191 NETWORKED_FLOAT(m_airAbsorptionGainHF)
192 NETWORKED_FLOAT(m_HFReference)
193 NETWORKED_FLOAT(m_LFReference)
194 NETWORKED_FLOAT(m_roomRolloffFactor)
195 NETWORKED_INT(m_decayHFLimit)
196 NETWORKED_FLOAT(m_radius)
197};
198 // end of decl_efx
222
223#ifdef CLIENT
224void EFX_UpdateSoundScape(NSSoundScape);
225#endif
This entity class represents point-entity triggers.
Definition: NSPointTrigger.h:26
Shared-Entity: Sound System Scape/Reverb Controller.
Definition: NSSoundScape.h:67
virtual void ReceiveEntity(float, float)
Client: Handles network updates from the server for the associated entity.
typedef enumflags
Defines the valid alignment flags for text fields.
Definition: font.h:37