home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / BATTLE.ZIP / INSTALL.ZIP / SOUND.H < prev    next >
C/C++ Source or Header  |  1996-04-05  |  4KB  |  124 lines

  1.  
  2. // Header File for Library Module SOUND.C
  3.  
  4. // D E F I N E S ////////////////////////////////////////////////////////////
  5.  
  6. // return values for digital sound status function
  7.  
  8. #define SOUND_STOPPED     0       // no sound is playing
  9. #define SOUND_PLAYING     1       // a sound is playing
  10.  
  11. // return values for the midi sequence status function
  12.  
  13. #define SEQUENCE_STOPPED     0    // the current sequence is stopped
  14. #define SEQUENCE_PLAYING     1    // the current sequence is playing
  15. #define SEQUENCE_COMPLETE    2    // the current sequence has completed
  16. #define SEQUENCE_UNAVAILABLE 0    // this sequence is unavailable
  17.  
  18. // these return values are used to determine what happened when a midi file
  19. // has been registered
  20.  
  21. #define XMIDI_UNREGISTERED  0 // the midi file couldn't be registered at all
  22. #define XMIDI_BUFFERED      1 // the midi file was registered and buffered
  23. #define XMIDI_UNBUFFERED    2 // the midi file was registered, but was too
  24.                               // big to be buffered, hence, the caller
  25.                               // needs to keep the midi data resident in
  26.                               // memory
  27.  
  28. // T Y P E D E F S //////////////////////////////////////////////////////////
  29.  
  30. // the DIGIPAK sound structure
  31.  
  32. typedef struct SNDSTRUC_typ
  33.         {
  34.  
  35.         unsigned char far *sound;   // a pointer to the raw sound data
  36.         unsigned short sndlen;      // the length of the sound data in bytes
  37.         short far *IsPlaying;       // a pointer to a variable that will be
  38.                                     // used to hold the status of a playing
  39.                                     // sound
  40.         short frequency;            // the frequency in hertz that the
  41.                                     // sound should be played at
  42.  
  43.         } SNDSTRUC, *SNDSTRUC_PTR;
  44.  
  45. // our high level sound structure
  46.  
  47. typedef struct sound_typ
  48.         {
  49.         unsigned char far *buffer;   // pointer to the start of VOC file
  50.  
  51.         short status;                // the current status of the sound
  52.  
  53.         SNDSTRUC SS;                 // the DIGIPAK sound structure
  54.  
  55.         } Sound, *sound_ptr;
  56.  
  57. // this holds a midi file
  58.  
  59. typedef struct music_typ
  60.         {
  61.  
  62.         unsigned char far *buffer;   // pointer to midi data
  63.         long size;                   // size of midi file in bytes
  64.         int status;                  // status of song
  65.         int register_info;           // return value of RegisterXmidiFile
  66.  
  67.         } music, *music_ptr;
  68.  
  69. // E X T E R N A L S ////////////////////////////////////////////////////////
  70.  
  71.  
  72. // P R O T O T Y P E S  /////////////////////////////////////////////////////
  73.  
  74. int Sound_Load(char *filename, sound_ptr sound,int translate);
  75.  
  76. void Sound_Unload(sound_ptr the_sound);
  77.  
  78. void Sound_Translate(sound_ptr the_sound);
  79.  
  80. void Sound_Play(sound_ptr the_sound);
  81.  
  82. int Sound_Status(void);
  83.  
  84. void Time_Delay(int clicks);
  85.  
  86. void Sound_Stop(void);
  87.  
  88.  
  89.  
  90. int Music_Load(char *filename, music_ptr the_music);
  91.  
  92. void Music_Unload(music_ptr the_music);
  93.  
  94. int Music_Register(music_ptr the_music);
  95.  
  96. void Music_Stop(void);
  97.  
  98. int Music_Play(music_ptr the_music,int sequence);
  99.  
  100. void Music_Resume(void);
  101.  
  102. int Music_Status(void);
  103.  
  104. extern void call_DIGIPAK (void);
  105.  
  106. extern void call_DIGIPAK2 (void);
  107.  
  108. extern int da_sound_status (void);
  109.  
  110. extern void stoppit_pleeez (void);
  111.  
  112. extern int call_MIDIPAK (void);
  113.  
  114. extern void stop_da_music (void);
  115.  
  116. extern int play_da_music (void);
  117.  
  118. extern void resume_da_music (void);
  119.  
  120. extern int what_da_music (void);
  121.  
  122.  
  123.  
  124.