00001
00002 #ifndef SFX_H
00003 #define SFX_H
00004
00005 #include "mss.h"
00006
00007
00008
00009 #define SFX_NUM_CHANNELS 2
00010 #define SFX_SAMPLE_RATE 22050
00011 #define SFX_BITS_PER_SAMPLE 16
00012
00013 #define SFX_MAX_LOAD 256
00014 #define SFX_MAX_SAMPLES 16
00015 #define SFX_MAX_SAMPLES_3D 64
00016
00017 #define SFX_MIN_VOL 0
00018 #define SFX_MAX_VOL 127
00019 #define SFX_LEFT_PAN 0
00020 #define SFX_CENTRE_PAN 64
00021 #define SFX_RIGHT_PAN 127
00022
00023 #define SFX_3D_PAN_MUL 64
00024 #define SFX_3D_MIN_DIST 600
00025 #define SFX_3D_SUB_DIST (8.0f / (float)SFX_MAX_VOL)
00026 #define SFX_3D_SOS 1024
00027
00028 typedef struct {
00029 HSAMPLE Handle;
00030 } SAMPLE_SFX;
00031
00032 typedef struct {
00033 void *Pos;
00034 long Size;
00035 } SFX_LOAD;
00036
00037 typedef struct {
00038 long Alive, Num, Vol, Freq, Loop;
00039 float LastDist;
00040 SAMPLE_SFX *Sample;
00041 VEC Pos;
00042 } SAMPLE_3D;
00043
00044 typedef struct {
00045 char *Name;
00046 char **Files;
00047 } LEVEL_SFX;
00048
00049
00050
00051 extern long InitSound(void);
00052 extern void ReleaseSound(void);
00053 extern long LoadSfx(char *levelname);
00054 extern void FreeSfx(void);
00055 extern void PlaySfx(long num, long vol, long pan, long freq);
00056 extern void StopSfx(SAMPLE_SFX *sample);
00057 extern void PauseAllSfx();
00058 extern void ResumeAllSfx();
00059 extern void PlaySfx3D(long num, long vol, long freq, VEC *pos);
00060 extern SAMPLE_3D *CreateSfx3D(long num, long vol, long freq, long loop, VEC *pos);
00061 extern void FreeSfx3D(SAMPLE_3D *sample3d);
00062 extern void GetSfxSettings3D(long *vol, long *freq, long *pan, VEC *pos, float vel);
00063 extern void ChangeSfxSample3D(SAMPLE_3D *sample3d, long sfx);
00064 extern void MaintainAllSfx(void);
00065 extern void PlayMP3(char *file);
00066 extern void StopMP3();
00067
00068
00069
00070 extern long SoundOff;
00071
00072
00073
00074 enum {
00075 SFX_ENGINE,
00076 SFX_HONK,
00077 SFX_SCRAPE1,
00078 SFX_SCREECH,
00079 SFX_RECORD,
00080 SFX_PICKUP,
00081 SFX_PICKUP_CLONE,
00082 SFX_SHOCKWAVE,
00083 SFX_ELECTROPULSE,
00084 SFX_FIREWORK,
00085 SFX_FIREWORK_BANG,
00086 SFX_CHROMEBALL,
00087 SFX_CHROMEBALL_HIT,
00088 SFX_WATERBOMB,
00089 SFX_WATERBOMB_HIT,
00090 SFX_PUTTYBOMB_BANG,
00091 SFX_FUSE,
00092
00093 SFX_GENERIC_NUM
00094 };
00095
00096
00097
00098 enum {
00099 SFX_TOY_PIANO = SFX_GENERIC_NUM,
00100 SFX_TOY_PLANE,
00101 SFX_TOY_COPTER,
00102 SFX_TOY_DRAGON,
00103 SFX_TOY_CREAK,
00104 SFX_TOY_TRAIN,
00105 SFX_TOY_WHISTLE,
00106 };
00107
00108 #endif