#ifndef SOUND_H #define SOUND_H typedef struct _xsw_sound_struct xsw_sound_struct; #define XSW_SOUND(p) ((xsw_sound_struct *)(p)) /* * Sound Server Types: */ #define SOUND_SERVER_TYPE_NONE 0 #define SOUND_SERVER_TYPE_YIFF 1 #define SOUND_SERVER_TYPE_ESOUND 2 #define SOUND_SERVER_TYPE_MIKMOD 3 /* Not supported */ /* * Effects: */ #define SOUND_EFFECT_REPEATING (1 << 4) /* * Sound Server Connection: */ struct _xsw_sound_struct { /* Sound server type (one of SOUND_SERVER_TYPE_*) */ int server_type; /* Script file that starts sound server */ char *start_cmd; /* Connection argument to connect to sound server */ char *con_arg; /* Pointer to the sound server connection */ void *con_data; /* Name of the current Audio mode (sound server specific) */ char *audio_mode_name; /* Compelte list of play IDs */ void **playid_list; int nplayids; /* Current background music play ID and SndRef number */ void *bg_music_playid; int bg_music_sndref_num; /* Loop play ID */ void *loop_tractor_beam_playid; }; extern "C" xsw_sound_struct sound; /* sound.cpp */ extern "C" int SoundInit(xsw_sound_struct *snd, const int server_type); extern "C" int SoundChangeMode(xsw_sound_struct *snd, const char *mode_name); extern "C" void *SoundPlay( xsw_sound_struct *snd, const int sndref_num, const float vol_left, /* 0.0 to 1.0 */ const float vol_right, /* 0.0 to 1.0 */ const unsigned int effects, const int priority /* 0 or 1 */ ); extern "C" void SoundStop(xsw_sound_struct *snd, void *playid); extern "C" int SoundChangeBackgroundMusic( xsw_sound_struct *snd, const int sndref_num, const unsigned int effects, /* Any of SOUND_EFFECT_* */ const int priority /* 0 or 1 */ ); extern "C" int SoundStopBackgroundMusic(xsw_sound_struct *snd); extern "C" int SoundManage(xsw_sound_struct *snd); extern "C" void SoundShutdown(xsw_sound_struct *snd); #endif /* SOUND_H */