home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1998 #6 / amigaacscoverdisc1998-061998.iso / games / descent / source / main / digi.h < prev    next >
Text File  |  1998-06-08  |  7KB  |  190 lines

  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.  * $Source: f:/miner/source/main/rcs/digi.h $
  15.  * $Revision: 2.0 $
  16.  * $Author: john $
  17.  * $Date: 1995/02/27 11:28:40 $
  18.  * 
  19.  * Include file for sound hardware.
  20.  * 
  21.  * $Log: digi.h $
  22.  * Revision 2.0  1995/02/27  11:28:40  john
  23.  * New version 2.0, which has no anonymous unions, builds with
  24.  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
  25.  * 
  26.  * Revision 1.29  1995/02/11  12:42:00  john
  27.  * Added new song method, with FM bank switching..
  28.  * 
  29.  * Revision 1.28  1995/02/03  17:08:26  john
  30.  * Changed sound stuff to allow low memory usage.
  31.  * Also, changed so that Sounds isn't an array of digi_sounds, it
  32.  * is a ubyte pointing into GameSounds, this way the digi.c code that
  33.  * locks sounds won't accidentally unlock a sound that is already playing, but
  34.  * since it's Sounds[soundno] is different, it would erroneously be unlocked.
  35.  * 
  36.  * Revision 1.27  1995/02/01  22:20:31  john
  37.  * Added digi_is_sound_playing.
  38.  * 
  39.  * Revision 1.26  1994/12/20  18:03:51  john
  40.  * Added loop midi flag.
  41.  * 
  42.  * Revision 1.25  1994/12/13  00:46:14  john
  43.  * Split digi and midi volume into 2 seperate functions.
  44.  * 
  45.  * Revision 1.24  1994/12/10  20:34:53  john
  46.  * Added digi_kill_sound_linked_to_object.
  47.  * 
  48.  * Revision 1.23  1994/12/10  15:59:39  mike
  49.  * Fixed bug.
  50.  * 
  51.  * Revision 1.22  1994/12/10  15:44:35  john
  52.  * Added max_distance passing for sound objects.
  53.  * 
  54.  * Revision 1.21  1994/12/05  12:17:40  john
  55.  * Added code that locks/unlocks digital sounds on demand.
  56.  * 
  57.  * Revision 1.20  1994/11/28  18:34:57  john
  58.  * Made the digi_max_channels cut of an old sound instead of
  59.  * not playing a new sound.
  60.  * 
  61.  * Revision 1.19  1994/11/14  17:53:56  allender
  62.  * made some digi variables extern
  63.  * 
  64.  * Revision 1.18  1994/10/28  14:42:58  john
  65.  * Added sound volumes to all sound calls.
  66.  * 
  67.  * Revision 1.17  1994/10/11  15:25:37  john
  68.  * Added new function to play a sound once...
  69.  * 
  70.  * Revision 1.16  1994/10/03  20:51:44  john
  71.  * Started added pause sound function; for the network I changed to 
  72.  * packet structure a bit; never tested, though.
  73.  * 
  74.  * 
  75.  * Revision 1.15  1994/10/03  13:09:43  john
  76.  * Added Pause function, but never tested it yet.
  77.  * 
  78.  * Revision 1.14  1994/09/30  10:09:24  john
  79.  * Changed sound stuff... made it so the reseting card doesn't hang, 
  80.  * made volume change only if sound is installed.
  81.  * 
  82.  * Revision 1.13  1994/09/29  21:13:43  john
  83.  * Added Master volumes for digi and midi. Also took out panning,
  84.  * because it doesn't work with MasterVolume stuff. 
  85.  * 
  86.  * Revision 1.12  1994/09/29  12:42:34  john
  87.  * Added sidenum to keep track of sound pos. Made sound functions
  88.  * not do anything if nosound. Made sounds_init delete currently
  89.  * playing sounds.
  90.  * 
  91.  * Revision 1.11  1994/09/29  12:23:42  john
  92.  * Added digi_kill_sound_linked_to_segment function.
  93.  * 
  94.  * Revision 1.10  1994/09/29  11:59:04  john
  95.  * Added digi_kill_sound
  96.  * 
  97.  * Revision 1.9  1994/09/29  10:37:38  john
  98.  * Added sound objects that dynamicaly change volume,pan.
  99.  * 
  100.  * Revision 1.8  1994/09/28  16:18:37  john
  101.  * Added capability to play midi song.
  102.  * 
  103.  * Revision 1.7  1994/06/17  18:01:41  john
  104.  * A bunch of new stuff by John
  105.  * 
  106.  * Revision 1.6  1994/06/15  19:00:58  john
  107.  * Added the capability to make 3d sounds play just once for the
  108.  * laser hit wall effects.
  109.  * 
  110.  * Revision 1.5  1994/06/07  10:54:30  john
  111.  * Made key S reinit the sound system.
  112.  * 
  113.  * Revision 1.4  1994/05/09  21:11:39  john
  114.  * Sound changes; pass index instead of pointer to digi routines.
  115.  * Made laser sound cut off the last laser sound.
  116.  * 
  117.  * Revision 1.3  1994/04/27  11:44:25  john
  118.  * First version of sound! Yay!
  119.  * 
  120.  * Revision 1.2  1994/04/20  21:58:50  john
  121.  * First version of sound stuff... hopefully everything
  122.  * is commented out because it hangs..
  123.  * 
  124.  * Revision 1.1  1994/04/15  14:25:02  john
  125.  * Initial revision
  126.  * 
  127.  * 
  128.  */
  129.  
  130.  
  131.  
  132. #ifndef _DIGI_H
  133. #define _DIGI_H
  134.  
  135. #include "types.h"
  136. #include "vecmat.h"
  137.  
  138. typedef struct digi_sound     {
  139.     int length;
  140.     ubyte * data;
  141. } digi_sound;
  142.  
  143. extern int digi_driver_board;
  144. extern int digi_driver_port;
  145. extern int digi_driver_irq;
  146. extern int digi_driver_dma;
  147. extern int digi_midi_type;
  148. extern int digi_midi_port;
  149.  
  150. extern int digi_get_settings();
  151. extern int digi_init();
  152. extern void digi_reset();
  153. extern void digi_close();
  154.  
  155. // Volume is max at F1_0.
  156. extern void digi_play_sample( int sndnum, fix max_volume );
  157. extern void digi_play_sample_once( int sndnum, fix max_volume );
  158. extern int digi_link_sound_to_object( int soundnum, short objnum, int forever, fix max_volume );
  159. extern int digi_link_sound_to_pos( int soundnum, short segnum, short sidenum, vms_vector * pos, int forever, fix max_volume );
  160. // Same as above, but you pass the max distance sound can be heard.  The old way uses f1_0*256 for max_distance.
  161. extern int digi_link_sound_to_object2( int soundnum, short objnum, int forever, fix max_volume, fix  max_distance );
  162. extern int digi_link_sound_to_pos2( int soundnum, short segnum, short sidenum, vms_vector * pos, int forever, fix max_volume, fix max_distance );
  163.  
  164. extern void digi_play_midi_song( char * filename, char * melodic_bank, char * drum_bank, int loop );
  165.  
  166. extern void digi_play_sample_3d( int soundno, int angle, int volume, int no_dups ); // Volume from 0-0x7fff
  167.  
  168. extern void digi_init_sounds();
  169. extern void digi_sync_sounds();
  170. extern void digi_kill_sound_linked_to_segment( int segnum, int sidenum, int soundnum );
  171. extern void digi_kill_sound_linked_to_object( int objnum );
  172.  
  173. extern void digi_set_midi_volume( int mvolume );
  174. extern void digi_set_digi_volume( int dvolume );
  175. extern void digi_set_volume( int dvolume, int mvolume );
  176.  
  177. extern int digi_is_sound_playing(int soundno);
  178.  
  179. extern void digi_pause_all();
  180. extern void digi_resume_all();
  181. extern void digi_stop_all();
  182.  
  183. extern digi_set_max_channels(int n);
  184. extern int digi_get_max_channels();
  185.  
  186. extern int digi_lomem;
  187.  
  188. #endif
  189. 
  190.