825fdd7091e3b100d7eaeefe8872b6ab9ff1fb62
[supertux.git] / src / sound.h
1 /*
2   sound.h
3   
4   Super Tux - Audio Functions
5   
6   by Bill Kendrick
7   bill@newbreedsoftware.com
8   http://www.newbreedsoftware.com/supertux/
9   
10   April 22, 2000 - July 15, 2002
11 */
12
13 #ifndef SUPERTUX_SOUND_H
14 #define SUPERTUX_SOUND_H
15
16  /*all the sounds we have*/
17 #define NUM_SOUNDS 16
18
19 #ifndef NOSOUND
20
21 #include <SDL_mixer.h>
22
23 // variables for stocking the sound and music
24 Mix_Chunk* sounds[NUM_SOUNDS];
25 Mix_Music* song;
26
27 // functions handling the sound and music
28 Mix_Chunk * load_sound(char * file);
29 void playsound(Mix_Chunk * snd);
30 Mix_Music * load_song(char * file);
31
32 int playing_music(void);
33 int halt_music(void);
34 int play_music(Mix_Music*music, int loops);
35 void free_music(Mix_Music*music);
36 void free_chunk(Mix_Chunk*chunk);
37
38 #else
39
40 //fake variables
41 void* sounds[NUM_SOUNDS];
42 void* song;
43
44 // fake sound handlers
45 void* load_sound(void* file);
46 void playsound(void * snd);
47 void* load_song(void* file);
48 int Mix_PlayingMusic();
49 void Mix_HaltMusic();
50 int Mix_PlayMusic();
51 void Mix_FreeMusic();
52 void Mix_FreeChunk();
53 int Mix_OpenAudio(int a, int b, int c, int d);
54
55 int playing_music();
56 void halt_music();
57 int play_music(int *music, int loops);
58 void free_music(int *music);;
59 void free_chunk(int *chunk);
60
61 #endif
62
63 #endif /*SUPERTUX_SOUND_H*/