Now loads both normal and fast versions of songs; plays according to time left.
[supertux.git] / src / sound.h
index 825fdd7..e47d488 100644 (file)
@@ -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 <neoneurone@users.sf.net>
 */
 
 #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 <SDL_mixer.h>
 
-// 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