update
[supertux.git] / src / sound.h
index 14feafa..57e17a1 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>
@@ -22,9 +22,9 @@
 #define SOUND_RESERVED_CHANNELS 2
 
 /*global variable*/
-int use_sound;           /* handle sound on/off menu and command-line option */
-int use_music;           /* handle music on/off menu and command-line option */
-int audio_device;        /* != 0: available and initialized */
+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 */
 
 /* enum of different internal music types */
 enum Music_Type {
@@ -32,7 +32,8 @@ enum Music_Type {
   LEVEL_MUSIC,
   HURRYUP_MUSIC,
   HERRING_MUSIC
-} current_music;
+};
+
 
 /* panning effects: terrible :-) ! */
 enum Sound_Speaker {
@@ -64,13 +65,15 @@ enum {
   NUM_SOUNDS
 };
 
+extern char* soundfilenames[NUM_SOUNDS];
+
 #ifndef NOSOUND
 
 #include <SDL_mixer.h>
 
 /* variables for stocking the sound and music */
-Mix_Chunk * sounds[NUM_SOUNDS];
-Mix_Music * level_song, * level_song_fast, * herring_song;
+extern Mix_Chunk * sounds[NUM_SOUNDS];
+extern 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);
@@ -86,11 +89,15 @@ int play_music(Mix_Music*music, int loops);
 void free_music(Mix_Music*music);
 void free_chunk(Mix_Chunk*chunk);
 
+int get_current_music();
+void set_current_music(int music);
+void play_current_music();
+
 #else
 
 /* fake variables */
-void* sounds[NUM_SOUNDS];
-void* level_song, *herring_song;
+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);
@@ -106,6 +113,10 @@ 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*/