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