X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fsound.h;h=7ebdc65b26b0dd75b3bc2a8bdfea45cb1d0fd6b0;hb=a8b2caa1d373c84c1b3fc2f615370c2a319051ca;hp=1822b3aabc478d788dfd9a5166b7ff2ae026b056;hpb=b2a0ff1ddd4430110b331129469dabb8ea7b6ba7;p=rocksndiamonds.git diff --git a/src/sound.h b/src/sound.h index 1822b3aa..7ebdc65b 100644 --- a/src/sound.h +++ b/src/sound.h @@ -22,8 +22,14 @@ #ifndef VOXWARE #define VOXWARE #endif + +#if 0 /* where is the right declaration for 'ioctl'? */ extern void ioctl(long, long, void *); +#else +#include +#endif + #endif #ifdef __FreeBSD__ @@ -79,9 +85,6 @@ extern void ioctl(long, long, void *); #define SSND_STOPPING(x) (x & (SSND_STOP_SOUND | SSND_STOP_ALL_SOUNDS)) #define SSND_ALL(x) (x&(SSND_FADE_ALL_SOUNDS|SSND_STOP_ALL_SOUNDS)) -#define TRUE 1 -#define FALSE 0 - /* settings for sound path, sound device, etc. */ #ifndef SND_PATH #define SND_PATH "./sounds" @@ -124,13 +127,17 @@ struct SoundHeader_8SVX struct SoundInfo { - unsigned char *name; - unsigned char *file_ptr; - char *data_ptr; - long file_len, data_len; + char *name; + byte *data_ptr; + long data_len; + #ifdef MSDOS SAMPLE *sample_ptr; #endif + +#ifdef TARGET_SDL + Mix_Chunk *mix_chunk; +#endif }; struct SoundControl @@ -138,35 +145,34 @@ struct SoundControl int nr; int volume; int stereo; - BOOL active; - BOOL loop; - BOOL fade_sound; - BOOL stop_sound; - BOOL stop_all_sounds; + boolean active; + boolean loop; + boolean fade_sound; + boolean stop_sound; + boolean stop_all_sounds; int playingtime; long playingpos; long data_len; - char *data_ptr; + byte *data_ptr; #ifdef MSDOS int voice; #endif }; -/* sound server functions */ +/* general sound functions */ +int OpenAudio(char *); +int CheckAudio(char *); +boolean UnixInitAudio(void); + +/* sound server functions */ void SoundServer(void); -void SoundServer_InsertNewSound(struct SoundControl); -void SoundServer_StopSound(int); -void SoundServer_StopAllSounds(void); -void HPUX_Audio_Control(void); -unsigned char linear_to_ulaw(int); -int ulaw_to_linear(unsigned char); - -/* application functions */ -BOOL LoadSound(struct SoundInfo *); + +/* sound client functions */ +boolean LoadSound(struct SoundInfo *); void PlaySound(int); void PlaySoundStereo(int, int); void PlaySoundLoop(int); -void PlaySoundExt(int, int, int, BOOL); +void PlaySoundExt(int, int, int, boolean); void FadeSound(int); void FadeSounds(void); void StopSound(int);