4 Super Tux - Audio Functions
7 bill@newbreedsoftware.com
8 http://www.newbreedsoftware.com/supertux/
10 April 22, 2000 - March 15, 2004
13 Duong-Khang NGUYEN <neoneurone@users.sf.net>
16 #ifndef SUPERTUX_SOUND_H
17 #define SUPERTUX_SOUND_H
19 #include "defines.h" /* get YES/NO defines */
21 /* used to reserve some channels for panning effects */
22 #define SOUND_RESERVED_CHANNELS 2
25 extern int use_sound; /* handle sound on/off menu and command-line option */
26 extern int use_music; /* handle music on/off menu and command-line option */
27 extern int audio_device; /* != 0: available and initialized */
29 /* enum of different internal music types */
38 /* panning effects: terrible :-) ! */
40 SOUND_LEFT_SPEAKER = 0,
41 SOUND_RIGHT_SPEAKER = 1,
42 SOUND_CENTER_SPEAKER = -1
68 extern char* soundfilenames[NUM_SOUNDS];
73 #include <SDL_mixer.h>
75 /* variables for stocking the sound and music */
76 extern Mix_Chunk * sounds[NUM_SOUNDS];
77 extern Mix_Music * level_song, * level_song_fast, * herring_song;
79 /* functions handling the sound and music */
80 int open_audio(int frequency, Uint16 format, int channels, int chunksize);
81 void close_audio( void );
83 Mix_Chunk * load_sound(const std::string& file);
84 void play_sound(Mix_Chunk * snd, enum Sound_Speaker whichSpeaker);
85 Mix_Music * load_song(const std::string& file);
87 int playing_music(void);
89 int play_music(Mix_Music*music, int loops);
90 void free_music(Mix_Music*music);
91 void free_chunk(Mix_Chunk*chunk);
93 int get_current_music();
94 void set_current_music(int music);
95 void play_current_music();
100 extern void* sounds[NUM_SOUNDS];
101 extern void * level_song, * level_song_fast, * herring_song;
103 /* fake sound handlers */
104 int open_audio (int frequency, int format, int channels, int chunksize);
105 void close_audio( void );
107 void* load_sound(void* file);
108 void play_sound(void * snd, enum Sound_Speaker whichSpeaker);
109 void* load_song(void* file);
113 int play_music(void *music, int loops);
114 void free_music(void *music);
115 void free_chunk(void *chunk);
117 int get_current_music();
118 void set_current_music(int music);
119 void play_current_music(void);
123 #endif /*SUPERTUX_SOUND_H*/