Added inverse functions for speed. Might be usefull for someone that wants to make...
[supertux.git] / src / sound.h
index 57e17a1..a7663e2 100644 (file)
@@ -22,9 +22,9 @@
 #define SOUND_RESERVED_CHANNELS 2
 
 /*global variable*/
-extern int use_sound;           /* handle sound on/off menu and command-line option */
-extern int use_music;           /* handle music on/off menu and command-line option */
-extern int audio_device;        /* != 0: available and initialized */
+extern bool use_sound;           /* handle sound on/off menu and command-line option */
+extern bool use_music;           /* handle music on/off menu and command-line option */
+extern bool audio_device;        /* != 0: available and initialized */
 
 /* enum of different internal music types */
 enum Music_Type {
@@ -67,8 +67,7 @@ enum {
 
 extern char* soundfilenames[NUM_SOUNDS];
 
-#ifndef NOSOUND
-
+#include <string>
 #include <SDL_mixer.h>
 
 /* variables for stocking the sound and music */
@@ -79,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);
@@ -93,30 +92,4 @@ int get_current_music();
 void set_current_music(int music);
 void play_current_music();
 
-#else
-
-/* fake variables */
-extern void* sounds[NUM_SOUNDS];
-extern void * level_song, * level_song_fast, * 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);
-
-int get_current_music();
-void set_current_music(int music);
-void play_current_music(void);
-
-#endif
-
 #endif /*SUPERTUX_SOUND_H*/