i_sound.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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. #ifndef __I_SOUND__
  23. #define __I_SOUND__
  24. #include "doomdef.h"
  25. // UNIX hack, to be removed.
  26. #ifdef SNDSERV
  27. #include <stdio.h>
  28. extern FILE* sndserver;
  29. extern char* sndserver_filename;
  30. #endif
  31. #include "doomstat.h"
  32. #include "sounds.h"
  33. // Init at program start...
  34. void I_InitSound();
  35. // ... update sound buffer and audio device at runtime...
  36. void I_UpdateSound(void);
  37. void I_SubmitSound(void);
  38. // ... shut down and relase at program termination.
  39. void I_ShutdownSound(void);
  40. //
  41. // SFX I/O
  42. //
  43. // Initialize channels?
  44. void I_SetChannels();
  45. // Get raw data lump index for sound descriptor.
  46. int I_GetSfxLumpNum (sfxinfo_t* sfxinfo );
  47. // Starts a sound in a particular sound channel.
  48. int
  49. I_StartSound
  50. ( int id,
  51. int vol,
  52. int sep,
  53. int pitch,
  54. int priority );
  55. // Stops a sound channel.
  56. void I_StopSound(int handle);
  57. // Called by S_*() functions
  58. // to see if a channel is still playing.
  59. // Returns 0 if no longer playing, 1 if playing.
  60. int I_SoundIsPlaying(int handle);
  61. // Updates the volume, separation,
  62. // and pitch of a sound channel.
  63. void
  64. I_UpdateSoundParams
  65. ( int handle,
  66. int vol,
  67. int sep,
  68. int pitch );
  69. //
  70. // MUSIC I/O
  71. //
  72. void I_InitMusic(void);
  73. void I_ShutdownMusic(void);
  74. // Volume.
  75. void I_SetMusicVolume(int volume);
  76. // PAUSE game handling.
  77. void I_PauseSong(int handle);
  78. void I_ResumeSong(int handle);
  79. // Registers a song handle to song data.
  80. int I_RegisterSong(void *data);
  81. // Called by anything that wishes to start music.
  82. // plays a song, and when the song is done,
  83. // starts playing it again in an endless loop.
  84. // Horrible thing to do, considering.
  85. void
  86. I_PlaySong
  87. ( int handle,
  88. int looping );
  89. // Stops a song over 3 seconds.
  90. void I_StopSong(int handle);
  91. // See above (register), then think backwards
  92. void I_UnRegisterSong(int handle);
  93. #endif
  94. //-----------------------------------------------------------------------------
  95. //
  96. // $Log:$
  97. //
  98. //-----------------------------------------------------------------------------