I_HEADER.H 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #ifndef __I_HEADER_H__
  2. #define __I_HEADER_H__
  3. #include "DoomDef.h"
  4. //--------
  5. //SOUND IO
  6. //--------
  7. #define FREQ_LOW 0x40
  8. #define FREQ_NORM 0x80
  9. #define FREQ_HIGH 0xff
  10. void I_SetMasterVolume(int volume);
  11. void I_TurnOffSfx(void);
  12. void I_TurnOnSfx(void);
  13. void I_TurnOffMusic(void);
  14. void I_TurnOnMusic(void);
  15. // MUSIC I/O
  16. //
  17. int I_RegisterSong(void *songdata);
  18. // called by anything that wants to register a song lump with the sound lib
  19. // calls Paul's function of the similar name to register music only.
  20. // note that the song data is the same for any sound card and is paul's
  21. // MUS format. Returns a handle which will be passed to all other music
  22. // functions.
  23. void I_UnregisterSong(int handle);
  24. // called by anything which is finished with a song and no longer needs
  25. // the sound library to be aware of it. All songs should be stopped
  26. // before calling this, but it will double check and stop it if necessary.
  27. void I_LoopSong(int handle);
  28. // called by anything that wishes to start music.
  29. // plays a song, and when the song is done, starts playing it again in
  30. // an endless loop. the start is faded in over three seconds.
  31. void I_FadeOutSong(int handle, int fotime);
  32. // called by anything that wishes to stop music.
  33. // fades out the song over <fotime> milliseconds.
  34. void I_StopSong(int handle);
  35. // called by anything that wishes to stop music.
  36. // stops a song abruptly.
  37. // SFX I/O
  38. //
  39. void *I_GetSoundEffect (char *soundname);
  40. // called by routines which wish to play a sound effect at some later
  41. // time. Pass it the lump name of a sound effect WITHOUT the sfx
  42. // prefix. This means the maximum name length is 7 letters/digits.
  43. // The prefixes for different sound cards are 'S','M','A', and 'P'.
  44. // They refer to the card type. The routine will cache in the
  45. // appropriate sound effect when it is played.
  46. void I_UngetSoundEffect (void *soundset);
  47. // called by routines which wish to no longer use the sounds at all
  48. // frees up the associated structure. It stops any currently playing
  49. // sound effects.
  50. void I_StartSound (channel_t *c, int vol, int sep, int pitch, int priority);
  51. // Starts a sound in a particular sound channel
  52. void I_UpdateSoundParams(channel_t *c, int vol, int sep, int pitch);
  53. // Updates the volume, separation, and pitch of a sound channel
  54. void I_StopSound(channel_t *c);
  55. // Stops a sound channel
  56. int I_SoundIsPlaying(channel_t *c);
  57. // called by S_*()'s to see if a channel is still playing. Returns 0
  58. // if no longer playing, 1 if playing.
  59. #endif