]> icculus.org git repositories - taylor/freespace2.git/blob - include/objectsnd.h
Initial revision
[taylor/freespace2.git] / include / objectsnd.h
1 /*
2  * $Logfile: /Freespace2/code/Object/ObjectSnd.h $
3  * $Revision$
4  * $Date$
5  * $Author$
6  *
7  * Header file for managing object-linked persistant sounds
8  *
9  * $Log$
10  * Revision 1.1  2002/05/03 03:28:12  root
11  * Initial revision
12  *
13  * 
14  * 4     7/01/99 4:23p Dave
15  * Full support for multiple linked ambient engine sounds. Added "big
16  * damage" flag.
17  * 
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.
21  * 
22  * 2     10/07/98 10:53a Dave
23  * Initial checkin.
24  * 
25  * 1     10/07/98 10:50a Dave
26  * 
27  * 11    3/17/98 5:55p Lawrance
28  * Support object-linked sounds for asteroids.
29  * 
30  * 10    9/03/97 5:02p Lawrance
31  * add engine stuttering when a ship is dying
32  * 
33  * 9     7/14/97 12:04a Lawrance
34  * make Obj_snd_enabled visible
35  * 
36  * 8     6/09/97 11:50p Lawrance
37  * integrating DirectSound3D
38  * 
39  * 7     6/06/97 4:13p Lawrance
40  * use an index instead of a pointer for object-linked sounds
41  * 
42  * 6     6/05/97 1:07a Lawrance
43  * changes to support sound interface
44  * 
45  * 5     6/02/97 1:50p Lawrance
46  * supporting integration with Direct3D
47  * 
48  * 4     5/09/97 4:33p Lawrance
49  * doppler effects
50  * 
51  * 3     5/09/97 9:41a Lawrance
52  * added #ifndef to avoid multiple inclusions
53  * 
54  * 2     5/08/97 4:30p Lawrance
55  * split off object sound stuff into separate file
56  *
57  * $NoKeywords: $
58  */
59
60 #ifndef __OBJECTSND_H__
61 #define __OBJECTSND_H__
62
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
66
67 extern int Obj_snd_enabled;
68
69 void    obj_snd_level_init();
70 void    obj_snd_level_close();
71 void    obj_snd_do_frame();
72
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);
79
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);
82
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);
87
88 #endif
89