DEADSOFTWARE

dc46f7c6538cf8a954984b9d67ea7dd7ed808b42
[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 #ifdef __cplusplus
28 extern "C" {
29 #endif
31 // заголовок инструмента (DMI)
32 #pragma pack(1)
33 typedef struct{
34 unsigned int len, // длина в байтах
35 rate, // частота в Гц.
36 lstart, // начало повтора в байтах от начала данных
37 llen; // длина повтора в байтах
38 }snd_t;
39 #pragma pack()
41 void S_init(void);
43 void S_done(void);
45 // проиграть звук s на канале c (1-8), частоте r и громкости v (0-255)
46 // возвращает номер канала, на котором играется звук
47 // если c==0, то звук попадет в любой свободный канал
48 // r - это относительная частота (обычно 1024)
49 short S_play(snd_t *s,short c,unsigned r,short v);
51 // остановить звук на канале c (1-8)
52 void S_stop(short c);
54 void S_startmusic(int);
56 void S_stopmusic(void);
58 void S_updatemusic(void);
60 // громкость звука и музыки (0-128)
61 extern short snd_vol,mus_vol;
63 void S_volumemusic(int v);
64 void S_volume(int v);
65 void free_chunks();
66 void S_wait();
68 extern char music_random;
69 extern int music_time;
70 extern int music_fade;
72 void F_freemus(void);
73 void S_initmusic(void);
74 void S_donemusic(void);
76 #ifdef __cplusplus
77 }
78 #endif