1 /* $Id: audio.h,v 5.3 2001/06/02 21:02:00 bertg Exp $
2  *
3  * XPilot, a multiplayer gravity war game.  Copyright (C) 1991-2001 by
4  *
5  *      Bj�rn Stabell        <bjoern@xpilot.org>
6  *      Ken Ronny Schouten   <ken@xpilot.org>
7  *      Bert Gijsbers        <bert@xpilot.org>
8  *      Dick Balaska         <dick@xpilot.org>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23  */
24 /* This piece of code was provided by Greg Renda (greg@ncd.com). */
25 
26 #ifndef _audio_h
27 #define _audio_h
28 
29 #define SOUND_MAX_VOLUME	100
30 #define SOUND_MIN_VOLUME	10
31 
32 enum {
33     START_SOUND,
34     FIRE_SHOT_SOUND,
35     FIRE_TORPEDO_SOUND,
36     FIRE_HEAT_SHOT_SOUND,
37     FIRE_SMART_SHOT_SOUND,
38     PLAYER_EXPLOSION_SOUND,
39     PLAYER_HIT_PLAYER_SOUND,
40     PLAYER_HIT_CANNON_SOUND,
41     PLAYER_HIT_MINE_SOUND,
42     PLAYER_EAT_TORPEDO_SHOT_SOUND,
43     PLAYER_EAT_HEAT_SHOT_SOUND,
44     PLAYER_EAT_SMART_SHOT_SOUND,
45     DROP_MINE_SOUND,
46     PLAYER_HIT_WALL_SOUND,
47     WORM_HOLE_SOUND,
48     WIDEANGLE_SHOT_PICKUP_SOUND,
49     SENSOR_PACK_PICKUP_SOUND,
50     BACK_SHOT_PICKUP_SOUND,
51     ROCKET_PACK_PICKUP_SOUND,
52     CLOAKING_DEVICE_PICKUP_SOUND,
53     ENERGY_PACK_PICKUP_SOUND,
54     MINE_PACK_PICKUP_SOUND,
55     REFUEL_SOUND,
56     THRUST_SOUND,
57     CLOAK_SOUND,
58     CHANGE_HOME_SOUND,
59     ECM_PICKUP_SOUND,
60     AFTERBURNER_PICKUP_SOUND,
61     TANK_PICKUP_SOUND,
62     DROP_MOVING_MINE_SOUND,
63     MINE_EXPLOSION_SOUND,
64     ECM_SOUND,
65     TANK_DETACH_SOUND,
66     CANNON_FIRE_SOUND,
67     PLAYER_SHOT_THEMSELF_SOUND,
68     DECLARE_WAR_SOUND,
69     PLAYER_HIT_CANNONFIRE_SOUND,
70     OBJECT_EXPLOSION_SOUND,
71     PLAYER_EAT_SHOT_SOUND,
72     TRANSPORTER_PICKUP_SOUND,
73     TRANSPORTER_SUCCESS_SOUND,
74     TRANSPORTER_FAIL_SOUND,
75     DEFLECTOR_PICKUP_SOUND,
76     DEFLECTOR_SOUND,
77     HYPERJUMP_PICKUP_SOUND,
78     HYPERJUMP_SOUND,
79     PHASING_DEVICE_PICKUP_SOUND,
80     PHASING_ON_SOUND,
81     PHASING_OFF_SOUND,
82     MIRROR_PICKUP_SOUND,
83     ARMOR_PICKUP_SOUND,
84     NUKE_LAUNCH_SOUND,
85     NUKE_EXPLOSION_SOUND,
86     PLAYER_RAN_OVER_PLAYER_SOUND,
87     LASER_PICKUP_SOUND,
88     EMERGENCY_THRUST_PICKUP_SOUND,
89     AUTOPILOT_PICKUP_SOUND,
90     TRACTOR_BEAM_PICKUP_SOUND,
91     PLAYER_BOUNCED_SOUND,
92     FIRE_LASER_SOUND,
93     AUTOPILOT_ON_SOUND,
94     AUTOPILOT_OFF_SOUND,
95     EMERGENCY_THRUST_ON_SOUND,
96     EMERGENCY_THRUST_OFF_SOUND,
97     TRACTOR_BEAM_SOUND,
98     PRESSOR_BEAM_SOUND,
99     CONNECT_BALL_SOUND,
100     DROP_BALL_SOUND,
101     EXPLODE_BALL_SOUND,
102     DESTROY_BALL_SOUND,
103     DESTROY_TARGET_SOUND,
104     TEAM_WIN_SOUND,
105     TEAM_DRAW_SOUND,
106     PLAYER_WIN_SOUND,
107     PLAYER_DRAW_SOUND,
108     PLAYER_ROASTED_SOUND,
109     PLAYER_EAT_LASER_SOUND,
110     EMERGENCY_SHIELD_PICKUP_SOUND,
111     EMERGENCY_SHIELD_ON_SOUND,
112     EMERGENCY_SHIELD_OFF_SOUND,
113     CANNON_EXPLOSION_SOUND,
114     ASTEROID_HIT_SOUND,
115     ASTEROID_BREAK_SOUND,
116     MAX_SOUNDS
117 };
118 
119 #ifdef _CAUDIO_C_
120 
121 static char    *soundNames[] =
122 {
123     "start",
124     "fire_shot",
125     "fire_torpedo",
126     "fire_heat_shot",
127     "fire_smart_shot",
128     "player_explosion",
129     "player_hit_player",
130     "player_hit_cannon",
131     "player_hit_mine",
132     "player_eat_torpedo_shot",
133     "player_eat_heat_shot",
134     "player_eat_smart_shot",
135     "drop_mine",
136     "player_hit_wall",
137     "worm_hole",
138     "wideangle_shot_pickup",
139     "sensor_pack_pickup",
140     "back_shot_pickup",
141     "smart_shot_pickup",
142     "cloaking_device_pickup",
143     "energy_pack_pickup",
144     "mine_pack_pickup",
145     "refuel",
146     "thrust",
147     "cloak",
148     "change_home",
149     "ecm_pickup",
150     "afterburner_pickup",
151     "tank_pickup",
152     "drop_moving_mine",
153     "mine_explosion",
154     "ecm",
155     "tank_detach",
156     "cannon_fire",
157     "player_shot_themself",
158     "declare_war",
159     "player_hit_cannonfire",
160     "object_explosion",
161     "player_eat_shot",
162     "transporter_pickup",
163     "transporter_success",
164     "transporter_fail",
165     "deflector_pickup",
166     "deflector",
167     "hyperjump_pickup",
168     "hyperjump",
169     "phasing_device_pickup",
170     "phasing_on",
171     "phasing_off",
172     "mirror_pickup",
173     "armor_pickup",
174     "nuke_launch",
175     "nuke_explosion",
176     "player_ran_over_player",
177     "laser_pickup",
178     "emergency_thrust_pickup",
179     "autopilot_pickup",
180     "tractor_beam_pickup",
181     "player_bounced",
182     "fire_laser",
183     "autopilot_on",
184     "autopilot_off",
185     "emergency_thrust_on",
186     "emergency_thrust_off",
187     "tractor_beam",
188     "pressor_beam",
189     "connect_ball",
190     "drop_ball",
191     "explode_ball",
192     "destroy_ball",
193     "destroy_target",
194     "team_win",
195     "team_draw",
196     "player_win",
197     "player_draw",
198     "player_roasted",
199     "player_eat_laser",
200     "emergency_shield_pickup",
201     "emergency_shield_on",
202     "emergency_shield_off",
203     "cannon_explosion",
204     "asteroid_hit",
205     "asteroid_break",
206 };
207 
208 #endif						/* _CAUDIO_C_ */
209 
210 extern	void audioInit(char* display);
211 extern	void audioCleanup(void);
212 extern	int	Handle_audio(int type, int volume);
213 
214 extern	int	audioDeviceInit(char *display);
215 extern	void	audioDeviceEvents(void);
216 extern	void	audioDevicePlay(char *filename, int type, int volume, void **private);
217 
218 #endif						/* _audio_h */
219