| 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 |
|
| 34 |
#ifndef __S_SOUND__ |
| 35 |
#define __S_SOUND__ |
| 36 |
|
| 37 |
#include "doomtype.h" |
| 38 |
#include "p_mobj.h" |
| 39 |
#include "r_defs.h" |
| 40 |
|
| 41 |
#define MAX_CHANNELS 32 |
| 42 |
|
| 43 |
// |
| 44 |
// Initializes sound stuff, including volume |
| 45 |
// Sets channels, SFX and music volume, |
| 46 |
// allocates channel buffer, sets S_sfx lookup. |
| 47 |
// |
| 48 |
void S_Init(void); |
| 49 |
|
| 50 |
// Kills all sounds |
| 51 |
void S_Stop(void); |
| 52 |
|
| 53 |
// |
| 54 |
// Per level startup code. |
| 55 |
// Kills playing sounds at start of level, |
| 56 |
// determines music if any, changes music. |
| 57 |
// |
| 58 |
void S_Start(void); |
| 59 |
|
| 60 |
// |
| 61 |
// Start sound for thing at <origin> |
| 62 |
// using <sound_id> from sounds.h |
| 63 |
// |
| 64 |
void S_StartSound(void *origin, int sound_id); |
| 65 |
void S_LoopSound(void *origin, int sfx_id, int timeout); |
| 66 |
|
| 67 |
void S_StartSectorSound(sector_t *sector, int sfx_id); |
| 68 |
void S_LoopSectorSound(sector_t *sector, int sfx_id, int timeout); |
| 69 |
|
| 70 |
void S_StartMobjSound(mobj_t *mobj, int sfx_id); |
| 71 |
void S_LoopMobjSound(mobj_t *mobj, int sfx_id, int timeout); |
| 72 |
|
| 73 |
void S_StartVoidSound(int sfx_id); |
| 74 |
void S_LoopVoidSound(int sfx_id, int timeout); |
| 75 |
|
| 76 |
void S_StartLineSound(line_t *line, degenmobj_t *soundorg, int sfx_id); |
| 77 |
|
| 78 |
// Will start a sound at a given volume. |
| 79 |
void S_StartSoundAtVolume(void *origin, int sound_id, int volume, int loop_timeout); |
| 80 |
|
| 81 |
// killough 4/25/98: mask used to indicate sound origin is player item pickup |
| 82 |
#define PICKUP_SOUND (0x8000) |
| 83 |
|
| 84 |
// Stop sound for thing at <origin> |
| 85 |
void S_StopSound(void* origin); |
| 86 |
|
| 87 |
void S_StopSoundLoops(void); |
| 88 |
|
| 89 |
extern int full_sounds; |
| 90 |
void S_UnlinkSound(void *origin); |
| 91 |
|
| 92 |
// Start music using <music_id> from sounds.h |
| 93 |
void S_StartMusic(int music_id); |
| 94 |
|
| 95 |
// Start music using <music_id> from sounds.h, and set whether looping |
| 96 |
void S_ChangeMusic(int music_id, int looping); |
| 97 |
void S_ChangeMusInfoMusic(int lumpnum, int looping); |
| 98 |
dboolean S_ChangeMusicByName(const char *name, dboolean looping); |
| 99 |
void S_RestartMusic(void); |
| 100 |
|
| 101 |
// Stops the music fer sure. |
| 102 |
void S_StopMusic(void); |
| 103 |
|
| 104 |
// Stop and resume music, during game PAUSE. |
| 105 |
void S_PauseSound(void); |
| 106 |
void S_ResumeSound(void); |
| 107 |
|
| 108 |
void S_AdjustAttenuation(float attenuation); |
| 109 |
void S_AdjustVolume(float volume); |
| 110 |
void S_ResetAdjustments(void); |
| 111 |
|
| 112 |
// |
| 113 |
// Updates music & sounds |
| 114 |
// |
| 115 |
void S_UpdateSounds(void); |
| 116 |
|
| 117 |
// machine-independent sound params |
| 118 |
extern int default_numChannels; |
| 119 |
extern int numChannels; |
| 120 |
|
| 121 |
//jff 3/17/98 holds last IDMUS number, or -1 |
| 122 |
extern int idmusnum; |
| 123 |
|
| 124 |
// heretic |
| 125 |
|
| 126 |
#include "doomtype.h" |
| 127 |
|
| 128 |
void S_SetSoundCurve(dboolean fullprocess); |
| 129 |
void S_StartAmbientSound(void *origin, int sound_id, int volume); |
| 130 |
|
| 131 |
// hexen |
| 132 |
|
| 133 |
void S_StartSongName(const char *songLump, dboolean loop); |
| 134 |
dboolean S_GetSoundPlayingInfo(void * mobj, int sound_id); |
| 135 |
int S_GetSoundID(const char *name); |
| 136 |
|
| 137 |
void S_ResetVolume(void); |
| 138 |
|
| 139 |
#endif |