2 * Copyright (C) Volition, Inc. 1999. All rights reserved.
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
10 * $Logfile: /Freespace2/code/Object/ObjectSnd.h $
15 * Header file for managing object-linked persistant sounds
18 * Revision 1.2 2002/06/09 04:41:14 relnev
19 * added copyright header
21 * Revision 1.1.1.1 2002/05/03 03:28:12 root
25 * 4 7/01/99 4:23p Dave
26 * Full support for multiple linked ambient engine sounds. Added "big
29 * 3 7/01/99 11:44a Dave
30 * Updated object sound system to allow multiple obj sounds per ship.
31 * Added hit-by-beam sound. Added killed by beam sound.
33 * 2 10/07/98 10:53a Dave
36 * 1 10/07/98 10:50a Dave
38 * 11 3/17/98 5:55p Lawrance
39 * Support object-linked sounds for asteroids.
41 * 10 9/03/97 5:02p Lawrance
42 * add engine stuttering when a ship is dying
44 * 9 7/14/97 12:04a Lawrance
45 * make Obj_snd_enabled visible
47 * 8 6/09/97 11:50p Lawrance
48 * integrating DirectSound3D
50 * 7 6/06/97 4:13p Lawrance
51 * use an index instead of a pointer for object-linked sounds
53 * 6 6/05/97 1:07a Lawrance
54 * changes to support sound interface
56 * 5 6/02/97 1:50p Lawrance
57 * supporting integration with Direct3D
59 * 4 5/09/97 4:33p Lawrance
62 * 3 5/09/97 9:41a Lawrance
63 * added #ifndef to avoid multiple inclusions
65 * 2 5/08/97 4:30p Lawrance
66 * split off object sound stuff into separate file
71 #ifndef __OBJECTSND_H__
72 #define __OBJECTSND_H__
74 #define OS_USED (1<<0)
75 #define OS_DS3D (1<<1)
76 #define OS_MAIN (1<<2) // "main" sound. attentuation does not apply until outside the radius of the object
78 extern int Obj_snd_enabled;
80 void obj_snd_level_init();
81 void obj_snd_level_close();
82 void obj_snd_do_frame();
84 // pos is the position of the sound source in the object's frame of reference.
85 // so, if the objp->pos was at the origin, the pos passed here would be the exact
86 // model coords of the location of the engine
87 // by passing vmd_zero_vector here, you get a sound centered directly on the object
88 // NOTE : if main is true, the attentuation factors don't apply if you're within the radius of the object
89 int obj_snd_assign(int objnum, int sndnum, vector *pos, int main);
91 // if sndnum is not -1, deletes all instances of the given sound within the object
92 void obj_snd_delete(int objnum, int sndnum = -1);
94 void obj_snd_delete_all();
95 void obj_snd_stop_all();
96 int obj_snd_is_playing(int index);
97 int obj_snd_return_instance(int index);