DEADSOFTWARE

8851b8513320a4d6870faeebee0b6b24473edda1
[flatwaifu.git] / src / sound.h
1 /*
2 Управление звуком и музыкой для DOS4GW
3 Версия 1.0
4 Copyright (C) Алексей Волынсков, 1996
6 Copyright (C) Prikol Software 1996-1997
7 Copyright (C) Aleksey Volynskov 1996-1997
8 Copyright (C) <ARembo@gmail.com> 2011
10 This file is part of the Doom2D:Rembo project.
12 Doom2D:Rembo is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License version 2 as
14 published by the Free Software Foundation.
16 Doom2D:Rembo is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, see <http://www.gnu.org/licenses/> or
23 write to the Free Software Foundation, Inc.,
24 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 */
27 #ifndef SOUND_H_INCLUDED
28 #define SOUND_H_INCLUDED
30 typedef struct {
31 int tag;
32 } snd_t;
34 // Sound volume 0..128
35 extern short snd_vol;
37 // Get sound handle for resource <id>
38 snd_t *S_get (int id);
40 // Get sound handle for resource with name
41 snd_t *S_load (const char name[8]);
43 // Stop sound and free handle
44 void S_free (snd_t *s);
46 // Initialize sound subsystem
47 void S_init (void);
49 // Deinitialize sound subsystem
50 void S_done (void);
52 // Play sound <s> on channel <c> with volume <v>.
53 // <s> = sound handle (NULL is ignored)
54 // <c> = 1..8 or 0 for any free
55 // <v> = 0..255
56 // return used channel or zero on error
57 short S_play (snd_t *s, short c, short v);
59 // Stop sound on channel <c>
60 // <c> = 0..8 (0 ignored)
61 void S_stop (short c);
63 // Set sound volume to <v>, also affects variable snd_vol
64 // <v> = 0..128
65 void S_volume (int v);
67 // Wait before all sounds end playing
68 void S_wait (void);
70 #endif /* SOUND_H_INCLUDED */