]> icculus.org git repositories - btb/d2x.git/blob - main/digi.h
use the orientation parameter of g3_draw_bitmap
[btb/d2x.git] / main / digi.h
1 /*
2 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
3 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
4 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
5 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
6 IN USING, DISPLAYING,  AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
7 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
8 FREE PURPOSES.  IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
9 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES.  THE END-USER UNDERSTANDS
10 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
11 COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
12 */
13
14 /*
15  *
16  * Include file for sound hardware.
17  *
18  */
19
20
21
22 #ifndef _DIGI_H
23 #define _DIGI_H
24
25 #include "pstypes.h"
26 #include "vecmat.h"
27
28 /*
29 #ifdef __DJGPP__
30 #define ALLEGRO
31 #endif
32 */
33
34 #ifdef ALLEGRO
35 #include "allg_snd.h"
36 typedef SAMPLE digi_sound;
37 #else
38 typedef struct digi_sound       {
39         int length;
40         ubyte * data;
41 } digi_sound;
42 #endif
43
44 #define SAMPLE_RATE_11K         11025
45 #define SAMPLE_RATE_22K         22050
46
47
48
49 #ifdef __DJGPP__
50 extern int digi_driver_board;
51 extern cvar_t digi_driver_port;
52 extern cvar_t digi_driver_irq;
53 extern int digi_driver_dma;
54 extern int digi_midi_type;
55 extern cvar_t digi_midi_port;
56 #endif
57
58 extern int digi_sample_rate;
59
60 extern int digi_get_settings(void);
61 extern int digi_init(void);
62 extern void digi_reset(void);
63 extern void digi_close(void);
64
65 // Volume is max at F1_0.
66 extern void digi_play_sample( int sndnum, fix max_volume );
67 extern void digi_play_sample_once( int sndnum, fix max_volume );
68 extern int digi_link_sound_to_object( int soundnum, short objnum, int forever, fix max_volume );
69 extern int digi_link_sound_to_pos( int soundnum, short segnum, short sidenum, vms_vector * pos, int forever, fix max_volume );
70 // Same as above, but you pass the max distance sound can be heard.  The old way uses f1_0*256 for max_distance.
71 extern int digi_link_sound_to_object2( int soundnum, short objnum, int forever, fix max_volume, fix  max_distance );
72 extern int digi_link_sound_to_pos2( int soundnum, short segnum, short sidenum, vms_vector * pos, int forever, fix max_volume, fix max_distance );
73
74 extern int digi_link_sound_to_object3( int org_soundnum, short objnum, int forever, fix max_volume, fix  max_distance, int loop_start, int loop_end );
75
76 extern void digi_play_midi_song( char * filename, char * melodic_bank, char * drum_bank, int loop );
77
78 extern void digi_play_sample_3d( int soundno, int angle, int volume, int no_dups ); // Volume from 0-0x7fff
79
80 extern void digi_init_sounds(void);
81 extern void digi_sync_sounds(void);
82 extern void digi_kill_sound_linked_to_segment( int segnum, int sidenum, int soundnum );
83 extern void digi_kill_sound_linked_to_object( int objnum );
84
85 extern void digi_set_midi_volume( int mvolume );
86 extern void digi_set_digi_volume( int dvolume );
87 extern void digi_set_volume( int dvolume, int mvolume );
88
89 extern int digi_is_sound_playing(int soundno);
90
91 extern void digi_pause_all(void);
92 extern void digi_resume_all(void);
93 extern void digi_pause_digi_sounds(void);
94 extern void digi_resume_digi_sounds(void);
95 extern void digi_stop_all(void);
96
97 extern void digi_set_max_channels(int n);
98 extern int digi_get_max_channels(void);
99
100 extern int digi_lomem;
101
102 extern int digi_xlat_sound(int soundno);
103
104 extern void digi_stop_sound( int channel );
105
106 // Returns the channel a sound number is playing on, or
107 // -1 if none.
108 extern int digi_find_channel(int soundno);
109
110 // Volume 0-F1_0
111 extern int digi_start_sound(short soundnum, fix volume, int pan, int looping, int loop_start, int loop_end, int soundobj);
112
113 // Stops all sounds that are playing
114 void digi_stop_all_channels(void);
115
116 extern void digi_end_sound( int channel );
117 extern void digi_set_channel_pan( int channel, int pan );
118 extern void digi_set_channel_volume( int channel, int volume );
119 extern int digi_is_channel_playing(int channel);
120 extern void digi_pause_midi(void);
121 extern void digi_debug(void);
122 extern void digi_stop_current_song(void);
123
124 extern void digi_play_sample_looping( int soundno, fix max_volume,int loop_start, int loop_end );
125 extern void digi_change_looping_volume( fix volume );
126 extern void digi_stop_looping_sound(void);
127
128 // Plays a queued voice sound.
129 extern void digi_start_sound_queued( short soundnum, fix volume );
130
131 #endif