1 // 2 // Copyright(C) 1993-1996 Id Software, Inc. 3 // Copyright(C) 2005-2014 Simon Howard 4 // 5 // This program is free software; you can redistribute it and/or 6 // modify it under the terms of the GNU General Public License 7 // as published by the Free Software Foundation; either version 2 8 // of the License, or (at your option) any later version. 9 // 10 // This program 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 // 15 // DESCRIPTION: 16 // The not so system specific sound interface. 17 // 18 19 20 #ifndef __S_SOUND__ 21 #define __S_SOUND__ 22 23 #include "p_mobj.h" 24 #include "sounds.h" 25 26 // 27 // Initializes sound stuff, including volume 28 // Sets channels, SFX and music volume, 29 // allocates channel buffer, sets S_sfx lookup. 30 // 31 32 void S_Init(int sfxVolume, int musicVolume); 33 34 35 // Shut down sound 36 37 void S_Shutdown(void); 38 39 40 41 // 42 // Per level startup code. 43 // Kills playing sounds at start of level, 44 // determines music if any, changes music. 45 // 46 47 void S_Start(void); 48 49 // 50 // Start sound for thing at <origin> 51 // using <sound_id> from sounds.h 52 // 53 54 void S_StartSound(void *origin, int sound_id); 55 void S_StartSoundOnce(void *origin, int sound_id); 56 57 // Stop sound for thing at <origin> 58 void S_StopSound(mobj_t *origin); 59 void S_UnlinkSound(mobj_t *origin); 60 61 62 // Start music using <music_id> from sounds.h 63 void S_StartMusic(int music_id); 64 65 // Start music using <music_id> from sounds.h, 66 // and set whether looping 67 void S_ChangeMusic(int music_id, int looping); 68 void S_ChangeMusInfoMusic(int lumpnum, int looping); 69 70 // query if music is playing 71 boolean S_MusicPlaying(void); 72 73 // Stops the music fer sure. 74 void S_StopMusic(void); 75 76 // Stop and resume music, during game PAUSE. 77 void S_PauseSound(void); 78 void S_ResumeSound(void); 79 80 81 // 82 // Updates music & sounds 83 // 84 void S_UpdateSounds(mobj_t *listener); 85 86 void S_SetMusicVolume(int volume); 87 void S_SetSfxVolume(int volume); 88 89 extern int snd_channels; 90 91 void S_UpdateSndChannels (void); 92 void S_UpdateStereoSeparation (void); 93 94 #endif 95 96