i_sound.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /*
  2. ===========================================================================
  3. Doom 3 BFG Edition GPL Source Code
  4. Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company.
  5. This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code").
  6. Doom 3 BFG Edition Source Code is free software: you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation, either version 3 of the License, or
  9. (at your option) any later version.
  10. Doom 3 BFG Edition Source Code is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with Doom 3 BFG Edition Source Code. If not, see <http://www.gnu.org/licenses/>.
  16. In addition, the Doom 3 BFG Edition Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 BFG Edition Source Code. If not, please request a copy in writing from id Software at the address below.
  17. If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
  18. ===========================================================================
  19. */
  20. #ifndef __I_SOUND__
  21. #define __I_SOUND__
  22. #include "doomdef.h"
  23. // UNIX hack, to be removed.
  24. #ifdef SNDSERV
  25. #include <stdio.h>
  26. extern FILE* sndserver;
  27. extern char* sndserver_filename;
  28. #endif
  29. #include "doomstat.h"
  30. #include "sounds.h"
  31. // Init at program start...
  32. void I_InitSound();
  33. void I_InitSoundHardware( int numOutputChannels_, int channelMask );
  34. // ... update sound buffer and audio device at runtime...
  35. void I_UpdateSound(void);
  36. void I_SubmitSound(void);
  37. // ... shut down and relase at program termination.
  38. void I_ShutdownSound(void);
  39. void I_ShutdownSoundHardware();
  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 I_StartSound( int id, mobj_t *origin, mobj_t *listener_origin, int vol, int pitch, int priority );
  49. // Stops a sound channel.
  50. void I_StopSound(int handle, int player = -1);
  51. // Called by S_*() functions
  52. // to see if a channel is still playing.
  53. // Returns 0 if no longer playing, 1 if playing.
  54. int I_SoundIsPlaying(int handle);
  55. // Updates the volume, separation,
  56. // and pitch of a sound channel.
  57. void I_UpdateSoundParams( int handle, int vol, int sep, int pitch );
  58. void I_SetSfxVolume( int );
  59. //
  60. // MUSIC I/O
  61. //
  62. void I_InitMusic(void);
  63. void I_ShutdownMusic(void);
  64. // Volume.
  65. void I_SetMusicVolume(int volume);
  66. // PAUSE game handling.
  67. void I_PauseSong(int handle);
  68. void I_ResumeSong(int handle);
  69. // Registers a song handle to song data.
  70. int I_RegisterSong(void *data, int length);
  71. // Called by anything that wishes to start music.
  72. // plays a song, and when the song is done,
  73. // starts playing it again in an endless loop.
  74. // Horrible thing to do, considering.
  75. void I_PlaySong( const char *songname, int looping );
  76. // Stops a song over 3 seconds.
  77. void I_StopSong(int handle);
  78. // See above (register), then think backwards
  79. void I_UnRegisterSong(int handle);
  80. // Update Music (XMP), check for notifications
  81. void I_UpdateMusic(void);
  82. int Mus2Midi(unsigned char* bytes, unsigned char* out, int* len);
  83. #endif