home *** CD-ROM | disk | FTP | other *** search
/ Black Art of 3D Game Programming / Black_Art_of_3D_Game_Programming.iso / source / msc / library / black6.h < prev    next >
Text File  |  1994-11-11  |  3KB  |  104 lines

  1.  
  2. // Header File for Library Module BLACK6.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 Sound_Stop(void);
  85.  
  86.  
  87.  
  88. int Music_Load(char *filename, music_ptr the_music);
  89.  
  90. void Music_Unload(music_ptr the_music);
  91.  
  92. int Music_Register(music_ptr the_music);
  93.  
  94. void Music_Stop(void);
  95.  
  96. int Music_Play(music_ptr the_music,int sequence);
  97.  
  98. void Music_Resume(void);
  99.  
  100. int Music_Status(void);
  101.  
  102.  
  103.  
  104.