00001
00011 #ifndef SOUNDMGR_H
00012 #define SOUNDMGR_H
00013
00014 #define OUTSIDE_GLUE_CORE
00015 #include <mlib/points.H>
00016 #include <std/strings.H>
00017 #include <std/list.H>
00018
00019
00020
00021 enum SOUNDPARAM {
00022 SP_LOOP = 0,
00023 SP_PITCH = 1,
00024 SP_GAIN = 2,
00025 SP_POSX = 3,
00026 SP_POSY = 4,
00027 SP_POSZ = 5,
00028 SP_VELX = 6,
00029 SP_VELY = 7,
00030 SP_VELZ = 8,
00031
00032 SP_NUM_PARAMS = 9
00033 };
00034
00035
00036
00037 class SoundImplementation
00038 {
00039 public:
00040
00041 virtual void setListenerLoc(Wtransf m) = 0;
00042 virtual void setListenerVel(Wvec v) = 0;
00043 virtual void setListenerGain(float g) = 0;
00044
00045
00046 virtual void load(str_ptr filename) = 0;
00047 virtual void play(str_ptr filename) = 0;
00048 virtual void stop(str_ptr filename) = 0;
00049 virtual void deleteSound(str_ptr filename) = 0;
00050 virtual void setParam(str_ptr filename, SOUNDPARAM param, float value) = 0;
00051 };
00052
00053
00054
00055
00056
00057 class SOUNDMGR
00058 {
00059 public:
00060
00061
00062
00063
00064
00065
00066 static void addImplementation(SoundImplementation *simp);
00067
00068 static void setListenerLoc(Wtransf m);
00069 static void setListenerVel(Wvec v);
00070 static void setListenerGain(float g);
00071
00072
00073 static void load(str_ptr filename);
00074
00075 static void play(str_ptr filename);
00076
00077 static void stop(str_ptr filename);
00078
00079 static void deleteSound(str_ptr filename);
00080
00081
00082 static void setParam(str_ptr filename, SOUNDPARAM param, float value);
00083
00084 private:
00085
00086 static ARRAY<SoundImplementation*> _imp;
00087
00088 };
00089
00090 #endif