X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fsound.h;h=e47d4883bef9eb57dae2186cb663075568568bdb;hb=cc5f060754c9e0ba2c06ab6a00efa1254833baaa;hp=825fdd7091e3b100d7eaeefe8872b6ab9ff1fb62;hpb=7fc94a99a287a0d7104d75eac2aeffcff4bf4703;p=supertux.git diff --git a/src/sound.h b/src/sound.h index 825fdd709..e47d4883b 100644 --- a/src/sound.h +++ b/src/sound.h @@ -6,27 +6,48 @@ by Bill Kendrick bill@newbreedsoftware.com http://www.newbreedsoftware.com/supertux/ - - April 22, 2000 - July 15, 2002 + + April 22, 2000 - December 28, 2003 + + Current maintainer: + Duong-Khang NGUYEN */ #ifndef SUPERTUX_SOUND_H #define SUPERTUX_SOUND_H - /*all the sounds we have*/ +#include "defines.h" /* get YES/NO defines */ + +/*all the sounds we have*/ #define NUM_SOUNDS 16 +/*global variable*/ +int use_sound; +int use_music; +int audio_device; /* != 0: available and initialized */ + +/* enum of different internal music types */ +enum Music_Type { + NO_MUSIC, + LEVEL_MUSIC, + HURRYUP_MUSIC, + HERRING_MUSIC +} current_music; + + #ifndef NOSOUND #include -// variables for stocking the sound and music -Mix_Chunk* sounds[NUM_SOUNDS]; -Mix_Music* song; +/* variables for stocking the sound and music */ +Mix_Chunk * sounds[NUM_SOUNDS]; +Mix_Music * level_song, * level_song_fast, * herring_song; + +/* functions handling the sound and music */ +int open_audio(int frequency, Uint16 format, int channels, int chunksize); -// functions handling the sound and music Mix_Chunk * load_sound(char * file); -void playsound(Mix_Chunk * snd); +void play_sound(Mix_Chunk * snd); Mix_Music * load_song(char * file); int playing_music(void); @@ -39,24 +60,21 @@ void free_chunk(Mix_Chunk*chunk); //fake variables void* sounds[NUM_SOUNDS]; -void* song; +void* level_song, *herring_song; // fake sound handlers +int open_audio (int frequency, int format, int channels, int chunksize); + void* load_sound(void* file); -void playsound(void * snd); +void play_sound(void * snd); void* load_song(void* file); -int Mix_PlayingMusic(); -void Mix_HaltMusic(); -int Mix_PlayMusic(); -void Mix_FreeMusic(); -void Mix_FreeChunk(); -int Mix_OpenAudio(int a, int b, int c, int d); int playing_music(); void halt_music(); -int play_music(int *music, int loops); -void free_music(int *music);; -void free_chunk(int *chunk); +int play_music(void *music, int loops); +void free_music(void *music); +; +void free_chunk(void *chunk); #endif