00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00052 #if !defined(NOSOUND)
00053
00054 #include <AL/al.h>
00055 #include <AL/alut.h>
00056 #include <AL/alc.h>
00057
00058 #endif
00059
00060 #if !defined(WIN32)
00061 #define ALCcontext void
00062 #define alGetSourcei alGetSourceiv
00063 #endif
00064
00065
00066
00067 #if !defined(OMICRONTYPES_SOUND_DEFINED)
00068 #define OMICRONTYPES_SOUND_DEFINED
00069
00074 class sound_manager_c
00075 {
00076 protected:
00077
00078
00083 typedef struct sound_s
00084 {
00085 unsigned int buffer;
00086 unsigned int source;
00087 bool iscopy;
00088 bool temporary;
00089
00090 sound_s() { iscopy = temporary = false; buffer = 0; source = 0; };
00091 } sound_t;
00092
00093 array_c<sound_t> *sounds;
00094
00095 ALCdevice *sounddevice;
00096 ALCcontext *soundcontext;
00097
00098 public:
00099
00100 sound_manager_c();
00101 ~sound_manager_c();
00102
00103 static const char *
00104 sound_alerror(ALenum e);
00105
00106 sshort
00107 load_wav(const char *fname);
00108
00109 void
00110 unload(sshort num);
00111
00112 sshort
00113 duplicate(sshort);
00114
00115 void
00116 play(sshort);
00117
00118 void
00119 play_copy(sshort);
00120
00121 void
00122 stop(sshort num);
00123
00124 void
00125 update();
00126 };
00127
00128 #endif