00001
00002
00003 #ifndef SoundH
00004 #define SoundH
00005
00006 #include <windows.h>
00007 #include "shared.h"
00008 #include "tll.h"
00009 #include "vector.h"
00010 #include "bass.h"
00011
00012
00013 enum {sample_engine = 1, sample_drip, sample_bird, sample_carhorn};
00014
00015 enum {channel_engine = 1, channel_drip1, channel_drip2, channel_bird, channel_carhorn};
00016
00017 class SOUND_SAMPLE
00018 {
00019 public:
00020 SOUND_SAMPLE(){};
00021 ~SOUND_SAMPLE(){};
00022
00023 int Compare(const SOUND_SAMPLE& Sample);
00024 int GetMyPosition() const {return linkPosition;}
00025 void SetMyPosition(int newPosition) {linkPosition = newPosition;}
00026 int linkPosition;
00027
00028 HSAMPLE hSample;
00029 char name[32];
00030 int max;
00031 DWORD flags;
00032 DWORD volume;
00033 float mindist;
00034 float maxdist;
00035 };
00036
00037 class SOUND_CHANNEL
00038 {
00039 public:
00040 SOUND_CHANNEL(){};
00041 ~SOUND_CHANNEL(){};
00042
00043 int Compare(const SOUND_CHANNEL& Channel);
00044 int GetMyPosition() const {return linkPosition;}
00045 void SetMyPosition(int newPosition) {linkPosition = newPosition;}
00046 int linkPosition;
00047
00048 HCHANNEL hChannel;
00049 HSAMPLE hSample;
00050 BASS_3DVECTOR position;
00051 BASS_3DVECTOR orientation;
00052 BASS_3DVECTOR velocity;
00053 int direction;
00054 bool looped;
00055 bool intermittent;
00056 bool random;
00057 unsigned int lowerrand;
00058 unsigned int upperrand;
00059 unsigned int interval;
00060 unsigned int idEvent;
00061 };
00062
00063 void InitializeBASS();
00064 void LoadSample(SOUND_SAMPLE* Sample);
00065 void CreateChannel(int SampleNumber);
00066 void UpdateListener();
00067 void UpdateChannel(int ChannelNumber, VECTOR* Position, VECTOR* Orientation, VECTOR* Velocity);
00068 void PlayChannel(int ChannelNumber);
00069 VOID CALLBACK SoundTimerProc(HWND hWnd, UINT uMsg, UINT idEvent, DWORD dwTime);
00070 void CreateSounds();
00071 BOOL CALLBACK devicedialogproc(HWND h,UINT m,WPARAM w,LPARAM l);
00072
00073 #endif