]> git.lizzy.rs Git - plan9front.git/blob - sys/src/games/doom/i_sound.h
games/doom:
[plan9front.git] / sys / src / games / doom / i_sound.h
1 // Emacs style mode select   -*- C++ -*- 
2 //-----------------------------------------------------------------------------
3 //
4 // $Id:$
5 //
6 // Copyright (C) 1993-1996 by id Software, Inc.
7 //
8 // This source is available for distribution and/or modification
9 // only under the terms of the DOOM Source Code License as
10 // published by id Software. All rights reserved.
11 //
12 // The source is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
15 // for more details.
16 //
17 //
18 // DESCRIPTION:
19 //      System interface, sound.
20 //
21 //-----------------------------------------------------------------------------
22
23 #ifndef __I_SOUND__
24 #define __I_SOUND__
25
26 #include "doomdef.h"
27
28 #include "doomstat.h"
29 #include "sounds.h"
30
31
32
33 // Init at program start...
34 void I_InitSound(void);
35
36 // ... update sound buffer and audio device at runtime...
37 void I_UpdateSound(void);
38 void I_SubmitSound(void);
39
40 // ... shut down and relase at program termination.
41 void I_ShutdownSound(void);
42
43
44 //
45 //  SFX I/O
46 //
47
48 // Initialize channels?
49 void I_SetChannels(void);
50
51 // Get raw data lump index for sound descriptor.
52 int I_GetSfxLumpNum (sfxinfo_t* sfxinfo );
53
54
55 // Starts a sound in a particular sound channel.
56 int
57 I_StartSound
58 ( int           id,
59   int           vol,
60   int           sep,
61   int           pitch,
62   int           priority );
63
64
65 // Stops a sound channel.
66 void I_StopSound(int handle);
67
68 // Called by S_*() functions
69 //  to see if a channel is still playing.
70 // Returns 0 if no longer playing, 1 if playing.
71 int I_SoundIsPlaying(int handle);
72
73 // Updates the volume, separation,
74 //  and pitch of a sound channel.
75 void
76 I_UpdateSoundParams
77 ( int           handle,
78   int           vol,
79   int           sep,
80   int           pitch );
81
82
83 //
84 //  MUSIC I/O
85 //
86 void I_InitMusic(void);
87 void I_ShutdownMusic(void);
88 // Volume.
89 void I_SetMusicVolume(int volume);
90 // PAUSE game handling.
91 void I_PauseSong(int handle);
92 void I_ResumeSong(int handle);
93 // Registers a song handle to song data.
94 int I_RegisterSong(void *data);
95 // Called by anything that wishes to start music.
96 //  plays a song, and when the song is done,
97 //  starts playing it again in an endless loop.
98 // Horrible thing to do, considering.
99 void
100 I_PlaySong
101 ( int           handle,
102   int           looping );
103 // Stops a song over 3 seconds.
104 void I_StopSong(int handle);
105 // See above (register), then think backwards
106 void I_UnRegisterSong(int handle);
107
108
109
110 #endif
111 //-----------------------------------------------------------------------------
112 //
113 // $Log:$
114 //
115 //-----------------------------------------------------------------------------