s_sound.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /* Emacs style mode select -*- C++ -*-
  2. *-----------------------------------------------------------------------------
  3. *
  4. *
  5. * PrBoom: a Doom port merged with LxDoom and LSDLDoom
  6. * based on BOOM, a modified and improved DOOM engine
  7. * Copyright (C) 1999 by
  8. * id Software, Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman
  9. * Copyright (C) 1999-2000 by
  10. * Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze
  11. * Copyright 2005, 2006 by
  12. * Florian Schulze, Colin Phipps, Neil Stevens, Andrey Budko
  13. *
  14. * This program is free software; you can redistribute it and/or
  15. * modify it under the terms of the GNU General Public License
  16. * as published by the Free Software Foundation; either version 2
  17. * of the License, or (at your option) any later version.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU General Public License
  25. * along with this program; if not, write to the Free Software
  26. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  27. * 02111-1307, USA.
  28. *
  29. * DESCRIPTION:
  30. * The not so system specific sound interface.
  31. *
  32. *-----------------------------------------------------------------------------*/
  33. #ifndef __S_SOUND__
  34. #define __S_SOUND__
  35. #ifdef __GNUG__
  36. #pragma interface
  37. #endif
  38. #include "p_mobj.h"
  39. #include "r_defs.h"
  40. #include "sounds.h"
  41. //
  42. // Initializes sound stuff, including volume
  43. // Sets channels, SFX and music volume,
  44. // allocates channel buffer, sets S_sfx lookup.
  45. //
  46. void S_Init(int sfxVolume, int musicVolume);
  47. // Kills all sounds
  48. void S_Stop(void);
  49. //
  50. // Per level startup code.
  51. // Kills playing sounds at start of level,
  52. // determines music if any, changes music.
  53. //
  54. void S_Start(void);
  55. //
  56. // Start sound for thing at <origin>
  57. // using <sound_id> from sounds.h
  58. //
  59. void S_StartSound(mobj_t *origin, int sfx_id);
  60. void S_StartSound2(degenmobj_t* origin, int sfx_id);
  61. // killough 4/25/98: mask used to indicate sound origin is player item pickup
  62. #define PICKUP_SOUND (0x8000)
  63. // Stop sound for thing at <origin>
  64. void S_StopSound(void* origin);
  65. // Start music using <music_id> from sounds.h
  66. void S_StartMusic(int music_id);
  67. // Start music using <music_id> from sounds.h, and set whether looping
  68. void S_ChangeMusic(int music_id, int looping);
  69. // Stops the music fer sure.
  70. void S_StopMusic(void);
  71. // Stop and resume music, during game PAUSE.
  72. void S_PauseSound(void);
  73. void S_ResumeSound(void);
  74. //
  75. // Updates music & sounds
  76. //
  77. void S_UpdateSounds(void* listener);
  78. void S_SetMusicVolume(int volume);
  79. void S_SetSfxVolume(int volume);
  80. typedef struct
  81. {
  82. const sfxinfo_t *sfxinfo; // sound information (if null, channel avail.)
  83. int tickend;
  84. void *origin; // origin of sound
  85. short handle; // handle of the sound being played
  86. short is_pickup; // killough 4/25/98: whether sound is a player's weapon
  87. } channel_t;
  88. #endif