1 //Copyright Paul Reiche, Fred Ford. 1992-2002
2 
3 /*
4  *  This program is free software; you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation; either version 2 of the License, or
7  *  (at your option) any later version.
8  *
9  *  This program is distributed in the hope that it will be useful,
10  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  *  GNU General Public License for more details.
13  *
14  *  You should have received a copy of the GNU General Public License
15  *  along with this program; if not, write to the Free Software
16  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  */
18 
19 #ifndef UQM_SOUNDS_H_
20 #define UQM_SOUNDS_H_
21 
22 #include "element.h"
23 #include "libs/compiler.h"
24 #include "libs/sndlib.h"
25 
26 #if defined(__cplusplus)
27 extern "C" {
28 #endif
29 
30 typedef enum
31 {
32 	GRAB_CREW = 0,
33 	SHIP_EXPLODES,
34 	TARGET_DAMAGED_FOR_1_PT,
35 	TARGET_DAMAGED_FOR_2_3_PT,
36 	TARGET_DAMAGED_FOR_4_5_PT,
37 	TARGET_DAMAGED_FOR_6_PLUS_PT
38 } SOUND_EFFECTS;
39 
40 typedef enum
41 {
42 	MENU_SOUND_MOVE = 0,
43 	MENU_SOUND_SUCCESS,
44 	MENU_SOUND_FAILURE,
45 	MENU_SOUND_INVOKED,
46 } MENU_SOUND_EFFECT;
47 
48 extern SOUND MenuSounds;
49 extern SOUND GameSounds;
50 
51 /* Constants for DoInput */
52 typedef UWORD MENU_SOUND_FLAGS;
53 #define MENU_SOUND_UP       ((MENU_SOUND_FLAGS)(1 << 0))
54 #define MENU_SOUND_DOWN     ((MENU_SOUND_FLAGS)(1 << 1))
55 #define MENU_SOUND_LEFT     ((MENU_SOUND_FLAGS)(1 << 2))
56 #define MENU_SOUND_RIGHT    ((MENU_SOUND_FLAGS)(1 << 3))
57 #define MENU_SOUND_SELECT   ((MENU_SOUND_FLAGS)(1 << 4))
58 #define MENU_SOUND_CANCEL   ((MENU_SOUND_FLAGS)(1 << 5))
59 #define MENU_SOUND_SPECIAL  ((MENU_SOUND_FLAGS)(1 << 6))
60 #define MENU_SOUND_PAGEUP   ((MENU_SOUND_FLAGS)(1 << 7))
61 #define MENU_SOUND_PAGEDOWN ((MENU_SOUND_FLAGS)(1 << 8))
62 #define MENU_SOUND_DELETE   ((MENU_SOUND_FLAGS)(1 << 9))
63 #define MENU_SOUND_ARROWS   (MENU_SOUND_UP | MENU_SOUND_DOWN | MENU_SOUND_LEFT | MENU_SOUND_RIGHT)
64 #define MENU_SOUND_NONE     ((MENU_SOUND_FLAGS)0)
65 
66 extern void SetMenuSounds (MENU_SOUND_FLAGS sound_0,
67 		MENU_SOUND_FLAGS sound_1);
68 extern void GetMenuSounds (MENU_SOUND_FLAGS *sound_0,
69 		MENU_SOUND_FLAGS *sound_1);
70 
71 extern void PlaySound (SOUND S, SoundPosition Pos,
72 		ELEMENT *PositionalObject, BYTE Priority);
73 extern void PlayMenuSound (MENU_SOUND_EFFECT S);
74 extern void ProcessSound (SOUND Sound, ELEMENT *PositionalObject);
75 extern SoundPosition CalcSoundPosition (ELEMENT *ElementPtr);
76 extern SoundPosition NotPositional (void);
77 extern void UpdateSoundPositions (void);
78 extern void FlushSounds (void);
79 extern void RemoveSoundsForObject (ELEMENT *PosObj);
80 
81 #if defined(__cplusplus)
82 }
83 #endif
84 
85 #endif /* UQM_SOUNDS_H_ */
86