i_sound.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. * System interface, sound.
  31. *
  32. *-----------------------------------------------------------------------------*/
  33. #ifndef __I_SOUND__
  34. #define __I_SOUND__
  35. #include "sounds.h"
  36. #include "doomtype.h"
  37. #define SNDSERV
  38. #undef SNDINTR
  39. #ifndef SNDSERV
  40. #include "l_soundgen.h"
  41. #endif
  42. // Init at program start...
  43. void I_InitSound(void);
  44. // ... shut down and relase at program termination.
  45. void I_ShutdownSound(void);
  46. //
  47. // SFX I/O
  48. //
  49. // Initialize channels?
  50. void I_SetChannels(void);
  51. // Get raw data lump index for sound descriptor.
  52. int I_GetSfxLumpNum (sfxinfo_t *sfxinfo);
  53. // Starts a sound in a particular sound channel.
  54. int I_StartSound(int id, int channel, int vol, int sep, int pitch, 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. boolean I_SoundIsPlaying(int handle);
  61. // Called by m_menu.c to let the quit sound play and quit right after it stops
  62. boolean I_AnySoundStillPlaying(void);
  63. // Updates the volume, separation,
  64. // and pitch of a sound channel.
  65. void I_UpdateSoundParams(int handle, int vol, int sep, int pitch);
  66. //
  67. // MUSIC I/O
  68. //
  69. void I_InitMusic(void);
  70. void I_ShutdownMusic(void);
  71. void I_UpdateMusic(void);
  72. // Volume.
  73. void I_SetMusicVolume(int volume);
  74. // PAUSE game handling.
  75. void I_PauseSong(int handle);
  76. void I_ResumeSong(int handle);
  77. // Registers a song handle to song data.
  78. int I_RegisterSong(const void *data, size_t len);
  79. // cournia - tries to load a music file
  80. int I_RegisterMusic( const char* filename, musicinfo_t *music );
  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 I_PlaySong(int handle, int looping);
  86. // Stops a song over 3 seconds.
  87. void I_StopSong(int handle);
  88. // See above (register), then think backwards
  89. void I_UnRegisterSong(int handle);
  90. // Allegro card support jff 1/18/98
  91. extern int snd_card;
  92. extern int mus_card;
  93. // CPhipps - put these in config file
  94. extern int snd_samplerate;
  95. #endif