4 Super Tux - Audio Functions
7 bill@newbreedsoftware.com
8 http://www.newbreedsoftware.com/supertux/
10 April 22, 2000 - December 28, 2003
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 */
37 extern int current_music;
39 /* panning effects: terrible :-) ! */
41 SOUND_LEFT_SPEAKER = 0,
42 SOUND_RIGHT_SPEAKER = 1,
43 SOUND_CENTER_SPEAKER = -1
71 #include <SDL_mixer.h>
73 /* variables for stocking the sound and music */
74 extern Mix_Chunk * sounds[NUM_SOUNDS];
75 extern Mix_Music * level_song, * level_song_fast, * herring_song;
77 /* functions handling the sound and music */
78 int open_audio(int frequency, Uint16 format, int channels, int chunksize);
79 void close_audio( void );
81 Mix_Chunk * load_sound(char * file);
82 void play_sound(Mix_Chunk * snd, enum Sound_Speaker whichSpeaker);
83 Mix_Music * load_song(char * file);
85 int playing_music(void);
87 int play_music(Mix_Music*music, int loops);
88 void free_music(Mix_Music*music);
89 void free_chunk(Mix_Chunk*chunk);
91 void play_current_music(void);
96 extern void* sounds[NUM_SOUNDS];
97 extern void* level_song, *herring_song;
99 /* fake sound handlers */
100 int open_audio (int frequency, int format, int channels, int chunksize);
101 void close_audio( void );
103 void* load_sound(void* file);
104 void play_sound(void * snd, enum Sound_Speaker whichSpeaker);
105 void* load_song(void* file);
109 int play_music(void *music, int loops);
110 void free_music(void *music);
111 void free_chunk(void *chunk);
113 void play_current_music(void);
117 #endif /*SUPERTUX_SOUND_H*/