X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fsound.h;h=28d7ba21ef2d8c89099d165c9138e07655cf3fb4;hb=4bca9bc5f299a9b287134b06e41b147f506792b4;hp=02431c4593d136232c0cd93a72ec05d7273f5458;hpb=823bddb0d9cc63ddda17a2cd20266aa3b82bde38;p=rocksndiamonds.git diff --git a/src/sound.h b/src/sound.h index 02431c45..28d7ba21 100644 --- a/src/sound.h +++ b/src/sound.h @@ -14,16 +14,22 @@ #ifndef SOUND_H #define SOUND_H -#include "main.h" #include +#include "main.h" #ifdef linux #include #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__ @@ -39,14 +45,14 @@ extern void ioctl(long, long, void *); #define HPUX_AUDIO #endif /* _HPUX_SOURCE */ -#ifndef MSDOS +#if !defined(PLATFORM_MSDOS) #define MAX_SOUNDS_PLAYING 16 #else #define MAX_SOUNDS_PLAYING 8 #endif /* some values for PlaySound(), StopSound() and friends */ -#ifndef MSDOS +#if !defined(PLATFORM_MSDOS) #define PSND_SILENCE 0 #define PSND_MAX_VOLUME_BITS 7 #define PSND_MIN_VOLUME 0 @@ -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; -#ifdef MSDOS + char *name; + byte *data_ptr; + long data_len; + +#if defined(PLATFORM_MSDOS) SAMPLE *sample_ptr; #endif + +#if defined(TARGET_SDL) + Mix_Chunk *mix_chunk; +#endif }; struct SoundControl @@ -138,35 +145,35 @@ 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; -#ifdef MSDOS + byte *data_ptr; + +#if defined(PLATFORM_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);