home *** CD-ROM | disk | FTP | other *** search
/ ST-Computer Leser-CD 2000 January / LCD_01_2000.iso / games / doom / pmdoom / include / i_sound.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-12-17  |  2.8 KB  |  114 lines

  1. /*  Emacs style mode select   -*- C++ -*-  */
  2. /* ----------------------------------------------------------------------------- */
  3. /*  */
  4. /*  $Id:$ */
  5. /*  */
  6. /*  Copyright (C) 1993-1996 by id Software, Inc. */
  7. /*  */
  8. /*  This source is available for distribution and/or modification */
  9. /*  only under the terms of the DOOM Source Code License as */
  10. /*  published by id Software. All rights reserved. */
  11. /*  */
  12. /*  The source is distributed in the hope that it will be useful, */
  13. /*  but WITHOUT ANY WARRANTY; without even the implied warranty of */
  14. /*  FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License */
  15. /*  for more details. */
  16. /*  */
  17. /*  */
  18. /*  DESCRIPTION: */
  19. /*     System interface, sound. */
  20. /*  */
  21. /* ----------------------------------------------------------------------------- */
  22.  
  23. #ifndef __I_SOUND__
  24. #define __I_SOUND__
  25.  
  26. #include "doomdef.h"
  27.  
  28. #include "doomstat.h"
  29. #include "sounds.h"
  30.  
  31. extern int lengths[NUMSFX];
  32.  
  33. /*  Init at program start... */
  34. extern void (*I_InitSound)();
  35.  
  36. /*  ... update sound buffer and audio device at runtime... */
  37. void I_UpdateSound(void);
  38. void I_SubmitSound(void);
  39.  
  40. /*  ... shut down and relase at program termination. */
  41. extern void (*I_ShutdownSound) (void);
  42.  
  43.  
  44. /*  */
  45. /*   SFX I/O */
  46. /*  */
  47.  
  48. /*  Initialize channels? */
  49. void I_SetChannels();
  50.  
  51. /*  Get raw data lump index for sound descriptor. */
  52. int I_GetSfxLumpNum (sfxinfo_t* sfxinfo );
  53.  
  54.  
  55. /*  Starts a sound in a particular sound channel. */
  56. extern int (*I_StartSound)
  57. ( int        id,
  58.   int        vol,
  59.   int        sep,
  60.   int        pitch,
  61.   int        priority );
  62.  
  63.  
  64. /*  Stops a sound channel. */
  65. void I_StopSound(int handle);
  66.  
  67. /*  Called by S_*() functions */
  68. /*   to see if a channel is still playing. */
  69. /*  Returns 0 if no longer playing, 1 if playing. */
  70. int I_SoundIsPlaying(int handle);
  71.  
  72. /*  Updates the volume, separation, */
  73. /*   and pitch of a sound channel. */
  74. void
  75. I_UpdateSoundParams
  76. ( int        handle,
  77.   int        vol,
  78.   int        sep,
  79.   int        pitch );
  80.  
  81.  
  82. /*  */
  83. /*   MUSIC I/O */
  84. /*  */
  85. void I_InitMusic(void);
  86. void I_ShutdownMusic(void);
  87. /*  Volume. */
  88. void I_SetMusicVolume(int volume);
  89. /*  PAUSE game handling. */
  90. void I_PauseSong(int handle);
  91. void I_ResumeSong(int handle);
  92. /*  Registers a song handle to song data. */
  93. int I_RegisterSong(void *data);
  94. /*  Called by anything that wishes to start music. */
  95. /*   plays a song, and when the song is done, */
  96. /*   starts playing it again in an endless loop. */
  97. /*  Horrible thing to do, considering. */
  98. void
  99. I_PlaySong
  100. ( int        handle,
  101.   int        looping );
  102. /*  Stops a song over 3 seconds. */
  103. void I_StopSong(int handle);
  104. /*  See above (register), then think backwards */
  105. void I_UnRegisterSong(int handle);
  106.  
  107. extern void (*I_SndInit)(void);
  108. extern void (*I_SndUpdate)(void);
  109.  
  110. void *getsfx(char *sfxname,int *len);
  111. int addsfx(int sfxid,int volume,int step,int seperation);
  112.  
  113. #endif
  114.