2 * $Logfile: /Freespace2/code/Object/ObjectSnd.h $
7 * Header file for managing object-linked persistant sounds
10 * Revision 1.1 2002/05/03 03:28:12 root
14 * 4 7/01/99 4:23p Dave
15 * Full support for multiple linked ambient engine sounds. Added "big
18 * 3 7/01/99 11:44a Dave
19 * Updated object sound system to allow multiple obj sounds per ship.
20 * Added hit-by-beam sound. Added killed by beam sound.
22 * 2 10/07/98 10:53a Dave
25 * 1 10/07/98 10:50a Dave
27 * 11 3/17/98 5:55p Lawrance
28 * Support object-linked sounds for asteroids.
30 * 10 9/03/97 5:02p Lawrance
31 * add engine stuttering when a ship is dying
33 * 9 7/14/97 12:04a Lawrance
34 * make Obj_snd_enabled visible
36 * 8 6/09/97 11:50p Lawrance
37 * integrating DirectSound3D
39 * 7 6/06/97 4:13p Lawrance
40 * use an index instead of a pointer for object-linked sounds
42 * 6 6/05/97 1:07a Lawrance
43 * changes to support sound interface
45 * 5 6/02/97 1:50p Lawrance
46 * supporting integration with Direct3D
48 * 4 5/09/97 4:33p Lawrance
51 * 3 5/09/97 9:41a Lawrance
52 * added #ifndef to avoid multiple inclusions
54 * 2 5/08/97 4:30p Lawrance
55 * split off object sound stuff into separate file
60 #ifndef __OBJECTSND_H__
61 #define __OBJECTSND_H__
63 #define OS_USED (1<<0)
64 #define OS_DS3D (1<<1)
65 #define OS_MAIN (1<<2) // "main" sound. attentuation does not apply until outside the radius of the object
67 extern int Obj_snd_enabled;
69 void obj_snd_level_init();
70 void obj_snd_level_close();
71 void obj_snd_do_frame();
73 // pos is the position of the sound source in the object's frame of reference.
74 // so, if the objp->pos was at the origin, the pos passed here would be the exact
75 // model coords of the location of the engine
76 // by passing vmd_zero_vector here, you get a sound centered directly on the object
77 // NOTE : if main is true, the attentuation factors don't apply if you're within the radius of the object
78 int obj_snd_assign(int objnum, int sndnum, vector *pos, int main);
80 // if sndnum is not -1, deletes all instances of the given sound within the object
81 void obj_snd_delete(int objnum, int sndnum = -1);
83 void obj_snd_delete_all();
84 void obj_snd_stop_all();
85 int obj_snd_is_playing(int index);
86 int obj_snd_return_instance(int index);