1 /*
2  * Copyright (C) Volition, Inc. 1999.  All rights reserved.
3  *
4  * All source code herein is the property of Volition, Inc. You may not sell
5  * or otherwise commercially exploit the source or things you created based on the
6  * source.
7  *
8 */
9 
10 
11 
12 #ifndef __GAMESND_H__
13 #define __GAMESND_H__
14 
15 #include "sound/sound.h"
16 #include "utils/id.h"
17 
18 /**
19  * symbolic names for misc. game sounds.
20  *
21  * The order here must match the order in sounds.tbl
22  *
23  * INSTRUCTIONS FOR ADDING A NEW SOUND:
24  * Add interface (ie non-gameplay) sounds to the end of the interface list of sounds.
25  * Add gameplay sounds to the correct portion of the gameplay sounds section (ie Misc, Weapons, or Ship).
26  *
27  * Then add a symbolic name to the appropriate position in the enum below
28  * and add an entry to sounds.tbl.  If there is no .wav file for the sound yet, specify sound_hook.wav in sounds.tbl.
29  */
30 enum class GameSounds {
31 	MISSILE_TRACKING           = 0,  //!< Missle tracking to acquire a lock (looped)
32 	MISSILE_LOCK               = 1,  //!< Missle lock (non-looping)
33 	PRIMARY_CYCLE              = 2,  //!< cycle primary weapon
34 	SECONDARY_CYCLE            = 3,  //!< cycle secondary weapon
35 	ENGINE                     = 4,  //!< engine sound (as heard in cockpit)
36 	CARGO_REVEAL               = 5,  //!< cargo revealed
37 	DEATH_ROLL                 = 6,  //!< ship death roll
38 	SHIP_EXPLODE_1             = 7,  //!< ship explosion 1
39 	TARGET_ACQUIRE             = 8,  //!< target acquried
40 	ENERGY_ADJUST              = 9,  //!< energy level change success
41 	ENERGY_ADJUST_FAIL         = 10, //!< energy level change fail
42 	ENERGY_TRANS               = 11, //!< energy transfer success
43 	ENERGY_TRANS_FAIL          = 12, //!< energy transfer fail
44 	FULL_THROTTLE              = 13, //!< set full throttle
45 	ZERO_THROTTLE              = 14, //!< set zero throttle
46 	THROTTLE_UP                = 15, //!< set 1/3 or 2/3 throttle (up)
47 	THROTTLE_DOWN              = 16, //!< set 1/3 or 2/3 throttle (down)
48 	DOCK_APPROACH              = 17, //!< dock approach retros
49 	DOCK_ATTACH                = 18, //!< dock attach
50 	DOCK_DETACH                = 19, //!< dock detach
51 	DOCK_DEPART                = 20, //!< dock depart retros
52 	ABURN_ENGAGE               = 21, //!< afterburner engage
53 	ABURN_LOOP                 = 22, //!< afterburner burn sound (looped)
54 	VAPORIZED                  = 23, //!< Destroyed by a beam (vaporized)
55 	ABURN_FAIL                 = 24, //!< afterburner fail (no fuel when aburn pressed)
56 	HEATLOCK_WARN              = 25, //!< heat-seeker launch warning
57 	OUT_OF_MISSLES             = 26, //!< tried to fire a missle when none are left
58 	OUT_OF_WEAPON_ENERGY       = 27, //!< tried to fire lasers when not enough energy left
59 	TARGET_FAIL                = 28, //!< target fail sound (i.e. press targeting key, but nothing happens)
60 	SQUADMSGING_ON             = 29, //!< squadmate message menu appears
61 	SQUADMSGING_OFF            = 30, //!< squadmate message menu disappears
62 	DEBRIS                     = 31, //!< debris sound (persistant, looping)
63 	SUBSYS_DIE_1               = 32, //!< subsystem gets destroyed on player ship
64 	MISSILE_START_LOAD         = 33, //!< missle start load (during rearm/repair)
65 	MISSILE_LOAD               = 34, //!< missle load (during rearm/repair)
66 	SHIP_REPAIR                = 35, //!< ship is being repaired (during rearm/repair)
67 	PLAYER_HIT_LASER           = 36, //!< player ship is hit by laser fire
68 	PLAYER_HIT_MISSILE         = 37, //!< player ship is hit by missile
69 	CMEASURE_CYCLE             = 38, //!< countermeasure cycle
70 	SHIELD_HIT                 = 39, //!< shield hit
71 	SHIELD_HIT_YOU             = 40, //!< player shield is hit
72 	GAME_MOUSE_CLICK           = 41, //!< mouse click
73 	ASPECTLOCK_WARN            = 42, //!< aspect launch warning
74 	SHIELD_XFER_OK             = 43, //!< shield quadrant transfer successful
75 	ENGINE_WASH                = 44, //!< Engine wash (looped)
76 	WARP_IN                    = 45, //!< warp hole opening up for arriving
77 	WARP_OUT                   = 46, //!< warp hole opening up for departing (Same as warp in for now)
78 	PLAYER_WARP_FAIL           = 47, //!< player warp has failed
79 	STATIC                     = 48, //!< hud gauge static
80 	SHIP_EXPLODE_2             = 49, //!< ship explosion 2
81 	PLAYER_WARP_OUT            = 50, //!< ship is warping out in 3rd person
82 	SHIP_SHIP_HEAVY            = 51, //!< heavy ship-ship collide sound
83 	SHIP_SHIP_LIGHT            = 52, //!< light ship-ship collide sound
84 	SHIP_SHIP_SHIELD           = 53, //!< shield ship-ship collide overlay sound
85 	THREAT_FLASH               = 54, //!< missile threat indicator flashes
86 	PROXIMITY_WARNING          = 55, //!< proximity warning (heat seeker)
87 	PROXIMITY_ASPECT_WARNING   = 56, //!< proximity warning (aspect)
88 	DIRECTIVE_COMPLETE         = 57, //!< directive complete
89 	SUBSYS_EXPLODE             = 58, //!< other ship subsystem destroyed
90 	CAPSHIP_EXPLODE            = 59, //!< captial ship explosion
91 	CAPSHIP_SUBSYS_EXPLODE     = 60, //!< captial ship subsystem destroyed
92 	LARGESHIP_WARPOUT          = 61, //!< large ship warps out
93 	ASTEROID_EXPLODE_LARGE     = 62, //!< large asteroid blows up
94 	ASTEROID_EXPLODE_SMALL     = 63, //!< small asteroid blows up
95 	CUE_VOICE                  = 64, //!< sound to indicate voice is about to start
96 	END_VOICE                  = 65, //!< sound to indicate voice has ended
97 	CARGO_SCAN                 = 66, //!< cargo scanning (looped)
98 	WEAPON_FLYBY               = 67, //!< weapon flyby sound
99 	ASTEROID                   = 68, //!< asteroid sound (persistant, looped)
100 	CAPITAL_WARP_IN            = 69, //!< capital warp hole opening
101 	CAPITAL_WARP_OUT           = 70, //!< capital warp hole closing
102 	ENGINE_LOOP_LARGE          = 71, //!< LARGE engine ambient
103 	SUBSPACE_LEFT_CHANNEL      = 72, //!< subspace ambient sound (left channel) (looped)
104 	SUBSPACE_RIGHT_CHANNEL     = 73, //!< subspace ambient sound (right channel) (looped)
105 	MISSILE_EVADED_POPUP       = 74, //!< "evaded" HUD popup
106 	ENGINE_LOOP_HUGE           = 75, //!< HUGE engine ambient
107 	//Weapons section
108 		LIGHT_LASER_FIRE           = 76, //!< SD-4 Sidearm laser fired
109 	LIGHT_LASER_IMPACT         = 77, //!< DR-2 Scalpel fired
110 	HVY_LASER_FIRE             = 78, //!< Flail II fired
111 	HVY_LASER_IMPACT           = 79, //!< Prometheus R laser fired
112 	MASSDRV_FIRED              = 80, //!< Prometheus S laser fired
113 	MASSDRV_IMPACT             = 81, //!< GTW-66 Newton Cannon fired
114 	FLAIL_FIRED                = 82, //!< UD-8 Kayser Laser fired
115 	FLAIL_IMPACT               = 83, //!< GTW-19 Circe laser fired
116 	NEUTRON_FLUX_FIRED         = 84, //!< GTW-83 Lich laser fired
117 	NEUTRON_FLUX_IMPACT        = 85, //!< Laser impact
118 	DEBUG_LASER_FIRED          = 86, //!< Subach-HLV Vasudan laser
119 	ROCKEYE_FIRED              = 87, //!< rockeye missile launch
120 	MISSILE_IMPACT1            = 88, //!< missile impact 1
121 	MAG_MISSILE_LAUNCH         = 89, //!< mag pulse missile launch
122 	FURY_MISSILE_LAUNCH        = 90, //!< fury missile launch
123 	SHRIKE_MISSILE_LAUNCH      = 91, //!< shrike missile launch
124 	ANGEL_MISSILE_LAUNCH       = 92, //!< angel fire missile launch
125 	CLUSTER_MISSILE_LAUNCH     = 93, //!< cluster bomb launch
126 	CLUSTERB_MISSILE_LAUNCH    = 94, //!< cluster baby bomb launch
127 	STILETTO_MISSILE_LAUNCH    = 95, //!< stiletto bomb launch
128 	TSUNAMI_MISSILE_LAUNCH     = 96, //!< tsunami bomb launch
129 	HARBINGER_MISSILE_LAUNCH   = 97, //!< harbinger bomb launch
130 	MEGAWOKKA_MISSILE_LAUNCH   = 98, //!< mega wokka launch
131 	CMEASURE1_LAUNCH           = 99, //!< countermeasure 1 launch
132 	SHIVAN_LIGHT_LASER_FIRE    = 100,//!< Shivan light laser
133 	SHOCKWAVE_EXPLODE          = 101,//!< shockwave ignition
134 	SWARM_MISSILE_LAUNCH       = 102,//!< swarm missile sound
135 	UNDEFINED_103              = 103,//!< Shivan heavy laser
136 	UNDEFINED_104              = 104,//!< Vasudan SuperCap engine
137 	UNDEFINED_105              = 105,//!< Shivan SuperCap engine
138 	UNDEFINED_106              = 106,//!< Terran SuperCap engine
139 	UNDEFINED_107              = 107,//!< Vasudan light laser fired
140 	UNDEFINED_108              = 108,//!< Shivan heavy laser
141 	SHOCKWAVE_IMPACT           = 109,//!< shockwave impact
142 	UNDEFINED_110              = 110,//!< TERRAN TURRET 1
143 	UNDEFINED_111              = 111,//!< TERRAN TURRET 2
144 	UNDEFINED_112              = 112,//!< VASUDAN TURRET 1
145 	UNDEFINED_113              = 113,//!< VASUDAN TURRET 2
146 	UNDEFINED_114              = 114,//!< SHIVAN TURRET 1
147 	TARG_LASER_LOOP            = 115,//!< targeting laser loop sound
148 	FLAK_FIRE                  = 116,//!< Flak Gun Launch
149 	SHIELD_BREAKER             = 117,//!< Flak Gun Impact
150 	EMP_MISSILE                = 118,//!< EMP Missle
151 	AUTOCANNON_LOOP            = 119,//!< Escape Pod Drone
152 	AUTOCANNON_SHOT            = 120,//!< Beam Hit 1
153 	BEAM_LOOP                  = 121,//!< beam loop
154 	BEAM_UP                    = 122,//!< beam power up
155 	BEAM_DOWN                  = 123,//!< beam power down
156 	BEAM_SHOT                  = 124,//!< Beam shot 1
157 	BEAM_VAPORIZE              = 125,//!< Beam shot 2
158 	//Ship Engine Sounds section
159 		TERRAN_FIGHTER_ENG         = 126,//!< Terran fighter engine
160 	TERRAN_BOMBER_ENG          = 127,//!< Terran bomber engine
161 	TERRAN_CAPITAL_ENG         = 128,//!< Terran cruiser engine
162 	SPECIESB_FIGHTER_ENG       = 129,//!< Vasudan fighter engine
163 	SPECIESB_BOMBER_ENG        = 130,//!< Vasudan bomber engine
164 	SPECIESB_CAPITAL_ENG       = 131,//!< Vasudan cruiser engine
165 	SHIVAN_FIGHTER_ENG         = 132,//!< Shivan fighter engine
166 	SHIVAN_BOMBER_ENG          = 133,//!< Shivan bomber engine
167 	SHIVAN_CAPITAL_ENG         = 134,//!< Shivan cruiser engine
168 	REPAIR_SHIP_ENG            = 135,//!< Repair ship beacon/engine sound
169 	UNDEFINED_136              = 136,//!< Terran capital engine
170 	UNDEFINED_137              = 137,//!< Vasudan capital engine
171 	UNDEFINED_138              = 138,//!< Shivan capital engine
172 	// Electrical arc sound fx on the debris pieces
173 		DEBRIS_ARC_01              = 139,//!< 0.10 second spark sound effect
174 	DEBRIS_ARC_02              = 140,//!< 0.25 second spark sound effect
175 	DEBRIS_ARC_03              = 141,//!< 0.50 second spark sound effect
176 	DEBRIS_ARC_04              = 142,//!< 0.75 second spark sound effect
177 	DEBRIS_ARC_05              = 143,//!< 1.00 second spark sound effect
178 	// Beam Sounds
179 		UNDEFINED_144              = 144,//!< LTerSlash beam loop
180 	UNDEFINED_145              = 145,//!< TerSlash	beam loop
181 	UNDEFINED_146              = 146,//!< SGreen 	beam loop
182 	UNDEFINED_147              = 147,//!< BGreen	beem loop
183 	UNDEFINED_148              = 148,//!< BFGreen	been loop
184 	UNDEFINED_149              = 149,//!< Antifighter 	beam loop
185 	UNDEFINED_150              = 150,//!< 1 sec		warm up
186 	UNDEFINED_151              = 151,//!< 1.5 sec 	warm up
187 	UNDEFINED_152              = 152,//!< 2.5 sec 	warm up
188 	UNDEFINED_153              = 153,//!< 3 sec 	warm up
189 	UNDEFINED_154              = 154,//!< 3.5 sec 	warm up
190 	UNDEFINED_155              = 155,//!< 5 sec 	warm up
191 	UNDEFINED_156              = 156,//!< LTerSlash	warm down
192 	UNDEFINED_157              = 157,//!< TerSlash	warm down
193 	UNDEFINED_158              = 158,//!< SGreen	warm down
194 	UNDEFINED_159              = 159,//!< BGreen	warm down
195 	UNDEFINED_160              = 160,//!< BFGreen	warm down
196 	UNDEFINED_161              = 161,//!< T_AntiFtr	warm down
197 
198 	COPILOT                    = 162,//!< copilot (SCP)
199 	UNDEFINED_163              = 163,//!< (Empty in Retail)
200 	UNDEFINED_164              = 164,//!< (Empty in Retail)
201 	UNDEFINED_165              = 165,//!< (Empty in Retail)
202 	UNDEFINED_166              = 166,//!< (Empty in Retail)
203 	UNDEFINED_167              = 167,//!< (Empty in Retail)
204 	UNDEFINED_168              = 168,//!< (Empty in Retail)
205 	UNDEFINED_169              = 169,//!< (Empty in Retail)
206 	UNDEFINED_170              = 170,//!< (Empty in Retail)
207 	UNDEFINED_171              = 171,//!< (Empty in Retail)
208 	UNDEFINED_172              = 172,//!< (Empty in Retail)
209 	SUPERNOVA_1                = 173,//!< SuperNova (distant)
210 	SUPERNOVA_2                = 174,//!< SuperNova (shockwave)
211 	UNDEFINED_175              = 175,//!< Shivan large engine
212 	UNDEFINED_176              = 176,//!< Shivan large engine
213 	UNDEFINED_177              = 177,//!< SRed 		beam loop
214 	UNDEFINED_178              = 178,//!< LRed		beam loop
215 	UNDEFINED_179              = 179,//!< Antifighter	beam loop
216 	LIGHTNING_1                = 180,//!< Thunder 1 sound in neblua
217 	LIGHTNING_2                = 181,//!< Thunder 2 sound in neblua
218 	UNDEFINED_182              = 182,//!< 1 sec 	warm up
219 	UNDEFINED_183              = 183,//!< 1.5 sec 	warm up
220 	UNDEFINED_184              = 184,//!< 3 sec 	warm up
221 	UNDEFINED_185              = 185,//!< Shivan Commnode
222 	UNDEFINED_186              = 186,//!< Volition PirateShip
223 	UNDEFINED_187              = 187,//!< SRed 		warm down
224 	UNDEFINED_188              = 188,//!< LRed 		warm down
225 	UNDEFINED_189              = 189,//!< AntiFtr	warm down
226 	UNDEFINED_190              = 190,//!< Instellation 1
227 	UNDEFINED_191              = 191,//!< Instellation 2
228 	UNDEFINED_192              = 192,//!< (Undefined in Retail)
229 	UNDEFINED_193              = 193,//!< (Undefined in Retail)
230 	UNDEFINED_194              = 194,//!< (Undefined in Retail)
231 	UNDEFINED_195              = 195,//!< (Undefined in Retail)
232 	UNDEFINED_196              = 196,//!< (Undefined in Retail)
233 	UNDEFINED_197              = 197,//!< (Undefined in Retail)
234 	UNDEFINED_198              = 198,//!< (Undefined in Retail)
235 	UNDEFINED_199              = 199,//!< (Undefined in Retail)
236 
237 	BALLISTIC_START_LOAD       = 200,//!< (SCP)
238 	BALLISTIC_LOAD             = 201,//!< (SCP)
239 
240 	/**
241 	 * Keep this below all defined enum values
242 	 */
243 		MIN_GAME_SOUNDS = 202
244 };
245 
246 /**
247  * Interface sounds
248  */
249 enum class InterfaceSounds {
250 	IFACE_MOUSE_CLICK       =0, //!< mouse click
251 	ICON_PICKUP             =1, //!< pick up a ship icon (Empty in Retail)
252 	ICON_DROP_ON_WING       =2, //!< drop a ship icon on a wing slot
253 	ICON_DROP               =3, //!< drop a ship icon back to the list
254 	SCREEN_MODE_PRESSED     =4, //!< press briefing, ship selection or weapons bar (top-left)
255 	SWITCH_SCREENS          =5, //!< Switching to a new screen, but not commit
256 	HELP_PRESSED            =6, //!< help pressed
257 	COMMIT_PRESSED          =7, //!< commit pressed
258 	PREV_NEXT_PRESSED       =8, //!< prev/next pressed
259 	SCROLL                  =9, //!< scroll pressed (and scroll)
260 	GENERAL_FAIL            =10,//!< general failure sound for any event
261 	SHIP_ICON_CHANGE        =11,//!< ship animation starts (ie text and ship first appear)
262 	MAIN_HALL_AMBIENT       =12,//!< ambient sound for the Terran main hall (looping)
263 	BTN_SLIDE               =13,//!< ambient sound for the Vasudan main hall (looping)
264 	BRIEF_STAGE_CHG         =14,//!< brief stage change
265 	BRIEF_STAGE_CHG_FAIL    =15,//!< brief stage change fail
266 	BRIEF_ICON_SELECT       =16,//!< selet brief icon
267 	USER_OVER               =17,//!< user_over (mouse over a control)
268 	USER_SELECT             =18,//!< user_click (mouse selects a control)
269 	RESET_PRESSED           =19,//!< reset (or similar button) pressed
270 	BRIEF_TEXT_WIPE         =20,//!< briefing text wipe
271 	VASUDAN_PA_1            =21,//!< main hall - elevator
272 	WEAPON_ANIM_START       =22,//!< weapon animation starts
273 	MAIN_HALL_DOOR_OPEN     =23,//!< door in main hall opens
274 	MAIN_HALL_DOOR_CLOSE    =24,//!< door in main hall closes
275 	GLOW_OPEN               =25,//!< glow in main hall opens
276 	VASUDAN_PA_2            =26,//!< main hall - crane 1
277 	AMBIENT_MENU            =27,//!< ambient sound for menus off the main hall (looping)
278 	POPUP_APPEAR            =28,//!< popup dialog box appeared
279 	POPUP_DISAPPEAR         =29,//!< popup dialog box goes away
280 	VOICE_SLIDER_CLIP       =30,//!< voice clip played when volume slider changes
281 	VASUDAN_PA_3            =31,//!< main hall - crane 2
282 	MAIN_HALL_GET_PEPSI     =32,//!< main hall options - mouse on
283 	MAIN_HALL_LIFT_UP       =33,//!< main hall options - mouse off
284 	MAIN_HALL_WELD1         =34,//!< main hall tech room - mouse on
285 	MAIN_HALL_WELD2         =35,//!< main hall tech room - mouse off
286 	MAIN_HALL_WELD3         =36,//!< main hall exit open
287 	MAIN_HALL_WELD4         =37,//!< main hall exit close
288 	MAIN_HALL_INT1          =38,//!< main hall random intercom 1
289 	MAIN_HALL_INT2          =39,//!< main hall random intercom 2
290 	MAIN_HALL_INT3          =40,//!< main hall random intercom 3
291 	ICON_HIGHLIGHT          =41,//!< spinning highlight in briefing
292 	BRIEFING_STATIC         =42,//!< static in a briefing stage cut
293 	MAIN_HALL2_CRANE1_1     =43,//!< main hall campaign - mouse on
294 	MAIN_HALL2_CRANE1_2     =44,//!< main hall campaign - mouse off
295 	MAIN_HALL2_CRANE2_1     =45,//!< vasudan hall - hatch open
296 	MAIN_HALL2_CRANE2_2     =46,//!< vasudan hall - hatch close
297 	MAIN_HALL2_CAR1         =47,//!< vasudan hall - roll open
298 	MAIN_HALL2_CAR2         =48,//!< vasudan hall - roll close
299 	MAIN_HALL2_INT1         =49,//!< vasudan hall - lift up
300 	MAIN_HALL2_INT2         =50,//!< vasudan hall - lift down
301 	MAIN_HALL2_INT3         =51,//!< vasudan hall - glow on
302 	INTERFACE_UNDEFINED_52  =52,//!< vasudan hall - glow off
303 	INTERFACE_UNDEFINED_53  =53,//!< vasudan hall - skiff loop
304 	INTERFACE_UNDEFINED_54  =54,//!< vasudan hall - screen on
305 	INTERFACE_UNDEFINED_55  =55,//!< vasudan hall - screen off
306 	INTERFACE_UNDEFINED_56  =56,//!< vasudan hall - vasudan greeting
307 	INTERFACE_UNDEFINED_57  =57,//!< vasudan hall - vasudan bye
308 	INTERFACE_UNDEFINED_58  =58,//!< vasudan hall - vasudan pa 1
309 	INTERFACE_UNDEFINED_59  =59,//!< vasudan hall - vasudan pa 2
310 	INTERFACE_UNDEFINED_60  =60,//!< vasudan hall - vasudan pa 3
311 	VASUDAN_BUP             =61,//!< bup bup bup-bup bup bup
312 	INTERFACE_UNDEFINED_62  =62,//!< thankyou
313 	INTERFACE_UNDEFINED_63  =62,//!< vasudan hall - exit open
314 	INTERFACE_UNDEFINED_64  =62,//!< vasudan hall - exit close
315 
316 	/**
317 	* Keep this below all defined enum values
318 	*/
319 		MIN_INTERFACE_SOUNDS        =70 //!< MIN_INTERFACE_SOUNDS
320 };
321 
322 // These two id types are defined as sublcasses so that type safe implicit conversions are possible from the predefined
323 // sound enum values
324 
325 struct gamesnd_id_tag{};
326 /**
327  * @brief A game sound handle type
328  *
329  * This allows implicit conversions from the GameSounds enum class.
330  */
331 class gamesnd_id : public util::ID<gamesnd_id_tag, int, -1> {
332  public:
gamesnd_id(GameSounds snd)333 	/*implicit*/ gamesnd_id(GameSounds snd) : util::ID<gamesnd_id_tag, int, -1>(static_cast<int>(snd)) {}
gamesnd_id(int val)334 	explicit gamesnd_id(int val) : ID(val) {
335 	}
gamesnd_id()336 	gamesnd_id() {
337 	}
338 };
339 
340 struct interface_snd_tag{};
341 /**
342  * @brief A interface sound handle type
343  *
344  * This allows implicit conversions from the InterfaceSounds enum class.
345  */
346 class interface_snd_id : public util::ID<interface_snd_tag, int, -1> {
347  public:
interface_snd_id(InterfaceSounds snd)348 	/*implicit*/ interface_snd_id(InterfaceSounds snd) : util::ID<interface_snd_tag, int, -1>(static_cast<int>(snd)) {}
interface_snd_id()349 	interface_snd_id() {
350 	}
interface_snd_id(int val)351 	explicit interface_snd_id(int val) : ID(val) {
352 	}
353 };
354 
355 void gamesnd_parse_soundstbl();	// Loads in general game sounds from sounds.tbl
356 void gamesnd_close();	// close out gamesnd... only call from game_shutdown()!
357 void gamesnd_load_gameplay_sounds();
358 void gamesnd_unload_gameplay_sounds();
359 void gamesnd_load_interface_sounds();
360 void gamesnd_unload_interface_sounds();
361 void gamesnd_preload_common_sounds();
362 void gamesnd_load_gameplay_sounds();
363 void gamesnd_unload_gameplay_sounds();
364 void gamesnd_play_iface(interface_snd_id n);
365 void gamesnd_play_error_beep();
366 gamesnd_id gamesnd_get_by_name(const char* name);
367 interface_snd_id gamesnd_get_by_iface_name(const char* name);
368 gamesnd_id gamesnd_get_by_tbl_index(int index);
369 interface_snd_id gamesnd_get_by_iface_tbl_index(int index);
370 
371 // This should handle NO_SOUND just fine since it doesn't directly access lowlevel code
372 // Does all parsing for a sound.  Returns true if a sound was successfully parsed.
373 bool parse_game_sound(const char* tag, gamesnd_id* idx_dest);
374 
375 gamesnd_id parse_game_sound_inline();
376 
377 void parse_iface_sound(const char* tag, interface_snd_id* idx_dest);
378 void parse_iface_sound_list(const char* tag, SCP_vector<interface_snd_id>& destination, const char* object_name, bool scp_list = false);
379 
380 // this is a callback, so it needs to be a real function
381 void common_play_highlight_sound();
382 
383 /**
384  * @brief Gets a pointer to the game sound with the specified handle
385  * @param handle The sound handle
386  * @return The game sound handle
387  */
388 game_snd* gamesnd_get_game_sound(gamesnd_id handle);
389 
390 /**
391  * @brief Gets a pointer to the interface sound with the specified handle
392  * @param handle The sound handle
393  * @return The interface sound handle
394  */
395 game_snd* gamesnd_get_interface_sound(interface_snd_id handle);
396 
397 /**
398  * @brief Checks if the given sound handle is a valid game sound handle
399  * @param sound The handle to check
400  * @return @c true if the handle is valid
401  */
402 bool gamesnd_game_sound_valid(gamesnd_id sound);
403 
404 /**
405  * @brief Checks if the given sound handle is a valid interface sound handle
406  * @param sound The handle to check
407  * @return @c true if the handle is valid
408  */
409 bool gamesnd_interface_sound_valid(interface_snd_id sound);
410 
411 /**
412  * @brief Determines the maximum time this game sound may take to be played.
413  *
414  * @details Use this instead of snd_get_duration since a game sound may have multiple sounds with different durations.
415  * This function also accounts for pitch changes which also changes the length of a sound.
416  *
417  * @param gs The game sound to check
418  * @return The length of the sound in milliseconds
419  */
420 float gamesnd_get_max_duration(game_snd* gs);
421 
422 /**
423  * @brief Chooses a sound entry for the specified game sound according to the rules specified by the game data
424  *
425  * @warning The returned pointer is temporary and may not be valid forever. Do no store this pointer anywhere!
426  *
427  * @param gs The game sound to choose the entry from
428  * @return The chosen entry
429  */
430 game_snd_entry* gamesnd_choose_entry(game_snd* gs);
431 
432 #endif
433