X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fsound.h;h=28d7ba21ef2d8c89099d165c9138e07655cf3fb4;hb=4bca9bc5f299a9b287134b06e41b147f506792b4;hp=47807ddec92d962897a80b4ae46fd76ceb8e3a0d;hpb=0a87fde47bcff35f196024766f8d0d00319a28d1;p=rocksndiamonds.git diff --git a/src/sound.h b/src/sound.h index 47807dde..28d7ba21 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__ @@ -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 @@ -119,25 +125,19 @@ struct SoundHeader_8SVX char magic_8SVX[4]; }; -struct SoundHeader_WAV -{ - char magic_RIFF[4]; - unsigned long header_size; - char magic_WAVE[4]; - char some_stuff[24]; - char magic_DATA[4]; - unsigned long data_size; -}; - 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 @@ -153,22 +153,22 @@ struct SoundControl 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 */ + +/* sound client functions */ boolean LoadSound(struct SoundInfo *); void PlaySound(int); void PlaySoundStereo(int, int);