Subversion Repositories Kolibri OS

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
9169 turbocat 1
/*
2
 * OpenTyrian: A modern cross-platform port of Tyrian
3
 * Copyright (C) 2007-2009  The OpenTyrian Development Team
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
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18
 */
19
#ifndef LOUDNESS_H
20
#define LOUDNESS_H
21
 
22
#include "opentyr.h"
23
#include "opl.h"
24
 
25
#include "SDL.h"
26
 
27
#define SFX_CHANNELS 8
28
 
29
#if defined(TARGET_GP2X) || defined(TARGET_DINGUX)
30
#define OUTPUT_QUALITY 2  // 22 kHz
31
#else
32
#define OUTPUT_QUALITY 4  // 44 kHz
33
#endif
34
 
35
#define SAMPLE_SCALING OUTPUT_QUALITY
36
#define SAMPLE_TYPE Bit16s
37
#define BYTES_PER_SAMPLE 2
38
 
39
extern float music_volume, sample_volume;
40
 
41
extern unsigned int song_playing;
42
 
43
extern bool audio_disabled, music_disabled, samples_disabled;
44
 
45
bool init_audio( void );
46
void deinit_audio( void );
47
 
48
void load_music( void );
49
void play_song( unsigned int song_num );
50
void restart_song( void );
51
void stop_song( void );
52
void fade_song( void );
53
 
54
void set_volume( unsigned int music, unsigned int sample );
55
 
56
void JE_multiSamplePlay(JE_byte *buffer, JE_word size, JE_byte chan, JE_byte vol);
57
 
58
#endif /* LOUDNESS_H */
59