- replaced YES/NO with true/false
[supertux.git] / src / sound.h
index 6373313..1a867b2 100644 (file)
@@ -7,7 +7,7 @@
   bill@newbreedsoftware.com
   http://www.newbreedsoftware.com/supertux/
  
-  April 22, 2000 - December 28, 2003
+  April 22, 2000 - March 15, 2004
 
   Current maintainer:
         Duong-Khang NGUYEN <neoneurone@users.sf.net>
@@ -34,7 +34,6 @@ enum Music_Type {
   HERRING_MUSIC
 };
 
-extern int current_music;
 
 /* panning effects: terrible :-) ! */
 enum Sound_Speaker {
@@ -66,8 +65,9 @@ enum {
   NUM_SOUNDS
 };
 
-#ifndef NOSOUND
+extern char* soundfilenames[NUM_SOUNDS];
 
+#include <string>
 #include <SDL_mixer.h>
 
 /* variables for stocking the sound and music */
@@ -78,9 +78,9 @@ extern Mix_Music * level_song, * level_song_fast, * herring_song;
 int open_audio(int frequency, Uint16 format, int channels, int chunksize);
 void close_audio( void );
 
-Mix_Chunk * load_sound(char * file);
+Mix_Chunk * load_sound(const std::string& file);
 void play_sound(Mix_Chunk * snd, enum Sound_Speaker whichSpeaker);
-Mix_Music * load_song(char * file);
+Mix_Music * load_song(const std::string& file);
 
 int playing_music(void);
 int halt_music(void);
@@ -88,30 +88,8 @@ int play_music(Mix_Music*music, int loops);
 void free_music(Mix_Music*music);
 void free_chunk(Mix_Chunk*chunk);
 
-void play_current_music(void);
-
-#else
-
-/* fake variables */
-extern void* sounds[NUM_SOUNDS];
-extern void* level_song, *herring_song;
-
-/* fake sound handlers */
-int open_audio (int frequency, int format, int channels, int chunksize);
-void close_audio( void );
-
-void* load_sound(void* file);
-void play_sound(void * snd, enum Sound_Speaker whichSpeaker);
-void* load_song(void* file);
-
-int playing_music();
-void halt_music();
-int play_music(void *music, int loops);
-void free_music(void *music);
-void free_chunk(void *chunk);
-
-void play_current_music(void);
-
-#endif
+int get_current_music();
+void set_current_music(int music);
+void play_current_music();
 
 #endif /*SUPERTUX_SOUND_H*/