MODULE OpenAL;
IMPORT
SYSTEM, Unix, Modules, Strings, KernelLog;
CONST
libname="libopenal.so";
TYPE
String256*=ARRAY 256 OF CHAR;
PString256*= POINTER TO ARRAY OF String256;
ADDRESS = SYSTEM.ADDRESS;
ALbyte * = CHAR;
ALshort * = INTEGER;
ALint * = LONGINT;
ALfloat * = REAL;
ALdouble * = LONGREAL;
ALboolean * = BOOLEAN;
ALubyte * = CHAR;
ALushort * = INTEGER;
ALuint * = LONGINT;
ALsizei * = LONGINT;
ALenum * = LONGINT;
PALboolean * = ADDRESS;
PALfloat * = ADDRESS;
PALdouble * = ADDRESS;
PALbyte * = ADDRESS;
PALshort * = ADDRESS;
PALint * = ADDRESS;
PALubyte * = ADDRESS;
PALushort * = ADDRESS;
PALuint * = ADDRESS;
CONST
AL_INVALID * = (-1);
AL_NONE * = 0;
AL_FALSE * = 0;
AL_TRUE * = 1;
AL_SOURCE_ABSOLUTE * = 201H;
AL_SOURCE_RELATIVE * = 202H;
AL_CONE_INNER_ANGLE * = 1001H;
AL_CONE_OUTER_ANGLE * = 1002H;
AL_PITCH * = 1003H;
AL_POSITION * = 1004H;
AL_DIRECTION * = 1005H;
AL_VELOCITY * = 1006H;
AL_LOOPING * = 1007H;
AL_BUFFER * = 1009H;
AL_GAIN * = 100AH;
AL_MIN_GAIN * = 100DH;
AL_MAX_GAIN * = 100EH;
AL_ORIENTATION * = 100FH;
AL_SOURCE_STATE * = 1010H;
AL_INITIAL * = 1011H;
AL_PLAYING * = 1012H;
AL_PAUSED * = 1013H;
AL_STOPPED * = 1014H;
AL_BUFFERS_QUEUED * = 1015H;
AL_BUFFERS_PROCESSED * = 1016H;
AL_SEC_OFFSET * = 1024H;
AL_SAMPLE_OFFSET * = 1025H;
AL_BYTE_OFFSET * = 1026H;
AL_SOURCE_TYPE * = 1027H;
AL_STATIC * = 1028H;
AL_STREAMING * = 1029H;
AL_UNDETERMINED * = 1030H;
AL_FORMAT_MONO8 * = 1100H;
AL_FORMAT_MONO16 * = 1101H;
AL_FORMAT_STEREO8 * = 1102H;
AL_FORMAT_STEREO16 * = 1103H;
AL_REFERENCE_DISTANCE * = 1020H;
AL_ROLLOFF_FACTOR * = 1021H;
AL_CONE_OUTER_GAIN * = 1022H;
AL_MAX_DISTANCE * = 1023H;
AL_FREQUENCY * = 2001H;
AL_BITS * = 2002H;
AL_CHANNELS * = 2003H;
AL_SIZE * = 2004H;
AL_UNUSED * = 2010H;
AL_PENDING * = 2011H;
AL_PROCESSED * = 2012H;
AL_NO_ERROR * = AL_FALSE;
AL_INVALID_NAME * = 0A001H;
AL_INVALID_ENUM * = 0A002H;
AL_INVALID_VALUE * = 0A003H;
AL_INVALID_OPERATION * = 0A004H;
AL_OUT_OF_MEMORY * = 0A005H;
AL_VENDOR * = 0B001H;
AL_VERSION * = 0B002H;
AL_RENDERER * = 0B003H;
AL_EXTENSIONS * = 0B004H;
AL_DOPPLER_FACTOR * = 0C000H;
AL_DOPPLER_VELOCITY * = 0C001H;
AL_SPEED_OF_SOUND * = 0C003H;
AL_DISTANCE_MODEL * = 0D000H;
AL_INVERSE_DISTANCE * = 0D001H;
AL_INVERSE_DISTANCE_CLAMPED * = 0D002H;
AL_LINEAR_DISTANCE * = 0D003H;
AL_LINEAR_DISTANCE_CLAMPED * = 0D004H;
AL_EXPONENT_DISTANCE * = 0D005H;
AL_EXPONENT_DISTANCE_CLAMPED * = 0D006H;
TYPE
ALCbyte * = CHAR;
ALCshort * = INTEGER;
ALCint * = LONGINT;
ALCfloat * = REAL;
ALCdouble * = LONGREAL;
ALCboolean * = BOOLEAN;
ALCubyte * = CHAR;
ALCushort * = INTEGER;
ALCuint * = LONGINT;
ALCsizei * = LONGINT;
ALCenum * = LONGINT;
ALCcontext * = ADDRESS;
ALCdevice * = ADDRESS;
PALCboolean * = ADDRESS;
PALCfloat * = ADDRESS;
PALCdouble * = ADDRESS;
PALCbyte * = ADDRESS;
PALCshort * = ADDRESS;
PALCint * = ADDRESS;
PALCubyte * = ADDRESS;
PALCushort * = ADDRESS;
PALCuint * = ADDRESS;
CONST
ALC_INVALID * = (-1);
ALC_FALSE * = AL_FALSE;
ALC_TRUE * = AL_TRUE;
ALC_MAJOR_VERSION * = 1000H;
ALC_MINOR_VERSION * = 1001H;
ALC_ATTRIBUTES_SIZE * = 1002H;
ALC_ALL_ATTRIBUTES * = 1003H;
ALC_DEFAULT_DEVICE_SPECIFIER * = 1004H;
ALC_DEVICE_SPECIFIER * = 1005H;
ALC_EXTENSIONS * = 1006H;
ALC_CAPTURE_DEVICE_SPECIFIER * = 310H;
ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER * = 311H;
ALC_CAPTURE_SAMPLES * = 312H;
ALC_FREQUENCY * = 1007H;
ALC_REFRESH * = 1008H;
ALC_SYNC * = 1009H;
ALC_MONO_SOURCES * = 1010H;
ALC_STEREO_SOURCES * = 1011H;
ALC_NO_ERROR * = ALC_FALSE;
ALC_INVALID_DEVICE * = 0A001H;
ALC_INVALID_CONTEXT * = 0A002H;
ALC_INVALID_ENUM * = 0A003H;
ALC_INVALID_VALUE * = 0A004H;
ALC_OUT_OF_MEMORY * = 0A005H;
AL_FORMAT_IMA_ADPCM_MONO16_EXT * =10000H;
AL_FORMAT_IMA_ADPCM_STEREO16_EXT * =10001H;
AL_FORMAT_WAVE_EXT * =10002H;
AL_FORMAT_VORBIS_EXT * =10003H;
AL_FORMAT_QUAD8_LOKI * =10004H;
AL_FORMAT_QUAD16_LOKI * =10005H;
AL_FORMAT_MONO_FLOAT32 * =10010H;
AL_FORMAT_STEREO_FLOAT32 * =10011H;
AL_FORMAT_MONO_DOUBLE_EXT * =10012H;
AL_FORMAT_STEREO_DOUBLE_EXT * =10013H;
ALC_CHAN_MAIN_LOKI * =500001H;
ALC_CHAN_PCM_LOKI * =500002H;
ALC_CHAN_CD_LOKI * =500003H;
ALC_DEFAULT_ALL_DEVICES_SPECIFIER * =1012H;
ALC_ALL_DEVICES_SPECIFIER * =1013H;
AL_FORMAT_QUAD8 * =1204H;
AL_FORMAT_QUAD16 * =1205H;
AL_FORMAT_QUAD32 * =1206H;
AL_FORMAT_REAR8 * =1207H;
AL_FORMAT_REAR16 * =1208H;
AL_FORMAT_REAR32 * =1209H;
AL_FORMAT_51CHN8 * =120AH;
AL_FORMAT_51CHN16 * =120BH;
AL_FORMAT_51CHN32 * =120CH;
AL_FORMAT_61CHN8 * =120DH;
AL_FORMAT_61CHN16 * =120EH;
AL_FORMAT_61CHN32 * =120FH;
AL_FORMAT_71CHN8 * =1210H;
AL_FORMAT_71CHN16 * =1211H;
AL_FORMAT_71CHN32 * =1212H;
AL_FORMAT_MONO_MULAW * =10014H;
AL_FORMAT_STEREO_MULAW * =10015H;
AL_FORMAT_QUAD_MULAW * =10021H;
AL_FORMAT_REAR_MULAW * =10022H;
AL_FORMAT_51CHN_MULAW * =10023H;
AL_FORMAT_61CHN_MULAW * =10024H;
AL_FORMAT_71CHN_MULAW * =10025H;
AL_FORMAT_MONO_IMA4 * =1300H;
AL_FORMAT_STEREO_IMA4 * =1301H;
ALC_CONNECTED * =313H;
AL_SOURCE_DISTANCE_MODEL* = 200H;
AL_BYTE_RW_OFFSETS_SOFT* = 1031H;
AL_SAMPLE_RW_OFFSETS_SOFT* = 1032H;
AL_LOOP_POINTS_SOFT * = 2015H;
VAR
xlib: LONGINT;
alEnable-: PROCEDURE { C } (capability : ALenum);
alDisable -: PROCEDURE { C } (capability : ALenum);
alIsEnabled-: PROCEDURE { C } (capability : ALenum) : ALboolean;
alGetBoolean- : PROCEDURE { C } (param : ALenum) : ALboolean;
alGetInteger-: PROCEDURE { C } (param : ALenum) : ALint;
alGetFloat-: PROCEDURE { C } (param : ALenum) : ALfloat;
alGetDouble-: PROCEDURE { C } (param : ALenum) : ALdouble;
alGetBooleanv-: PROCEDURE { C } (param : ALenum; VAR data : ALboolean);
alGetIntegerv-: PROCEDURE { C } (param : ALenum; VAR data : ALint);
alGetFloatv-: PROCEDURE { C } (param : ALenum; VAR data : ALfloat);
alGetDoublev-: PROCEDURE { C } (param : ALenum; VAR data : ALdouble);
alGetString-: PROCEDURE { C } (param : ALenum) : PALubyte;
alGetError-: PROCEDURE { C } () : ALenum;
alIsExtensionPresent-: PROCEDURE { C } (CONST fname : ARRAY OF CHAR) : ALboolean;
alGetProcAddress-: PROCEDURE { C } (CONST fname : ARRAY OF CHAR): ADDRESS;
alGetEnumValue-: PROCEDURE { C } (VAR ename : ALubyte) : ALenum;
alListenerf-: PROCEDURE { C } (param : ALenum; value : ALfloat);
alListener3f-: PROCEDURE { C } (param : ALenum; v1, v2, v3 : ALfloat);
alListenerfv-: PROCEDURE { C } (param : ALenum; values : PALfloat);
alListeneri-: PROCEDURE { C } (param : ALenum; value : ALint);
alListener3i-: PROCEDURE { C } (param : ALenum; v1, v2, v3 : ALint);
alListeneriv-: PROCEDURE { C } (param : ALenum; values : PALint);
alGetListenerf-: PROCEDURE { C } (param : ALenum; VAR value : ALfloat);
alGetListener3f-: PROCEDURE { C } (param : ALenum; VAR v1, v2, v3 : ALfloat);
alGetListenerfv-: PROCEDURE { C } (param : ALenum; values : PALfloat);
alGetListeneri-: PROCEDURE { C } (param : ALenum; VAR value : ALint);
alGetListener3i-: PROCEDURE { C } (param : ALenum; VAR v1, v2, v3: ALint);
alGetListeneriv-: PROCEDURE { C } (param : ALenum; values : PALint);
alGenSources-: PROCEDURE { C } (n : ALsizei; sources : PALuint);
alDeleteSources-: PROCEDURE { C } (n : ALsizei; sources : PALuint);
alIsSource-: PROCEDURE { C } (id : ALuint) : ALboolean;
alSourcef-: PROCEDURE { C } (source : ALuint; param : ALenum; value : ALfloat);
alSource3f-: PROCEDURE { C } (source : ALuint; param : ALenum; v1, v2, v3 : ALfloat);
alSourcefv-: PROCEDURE { C } (source : ALuint; param : ALenum; values : PALfloat);
alSourcei-: PROCEDURE { C } (source : ALuint; param : ALenum; value : ALint);
alSource3i-: PROCEDURE { C } (source : ALuint; param : ALenum; v1, v2, v3 : ALint);
alSourceiv-: PROCEDURE { C } (source : ALuint; param : ALenum; values : PALint);
alGetSourcef-: PROCEDURE { C } (source : ALuint; param : ALenum; VAR value : ALfloat);
alGetSource3f-: PROCEDURE { C } (source : ALuint; param : ALenum; VAR v1, v2, v3 : ALfloat);
alGetSourcefv-: PROCEDURE { C } (source : ALuint; param : ALenum; values : PALfloat);
alGetSourcei-: PROCEDURE { C } (source : ALuint; param : ALenum; VAR value : ALint);
alGetSource3i-: PROCEDURE { C } (source : ALuint; param : ALenum; VAR v1, v2, v3 : ALint);
alGetSourceiv-: PROCEDURE { C } (source : ALuint; param : ALenum; values : PALint);
alSourcePlayv-: PROCEDURE { C } (n : ALsizei; sources : PALuint);
alSourcePausev-: PROCEDURE { C } (n : ALsizei; sources : PALuint);
alSourceStopv-: PROCEDURE { C } (n : ALsizei; sources : PALuint);
alSourceRewindv-: PROCEDURE { C } (n : ALsizei; sources : PALuint);
alSourcePlay-: PROCEDURE { C } ( source : ALuint);
alSourcePause-: PROCEDURE { C } ( source : ALuint);
alSourceStop-: PROCEDURE { C } (source : ALuint);
alSourceRewind-: PROCEDURE { C } (source : ALuint);
alSourceQueueBuffers-: PROCEDURE { C } (source : ALuint; n : ALsizei; buffers : PALuint);
alSourceUnqueueBuffers-: PROCEDURE { C } (source : ALuint; n : ALsizei; buffers : PALuint);
alGenBuffers-: PROCEDURE { C } (n : ALsizei; buffers : PALuint);
alDeleteBuffers-: PROCEDURE { C } (n : ALsizei; buffers : PALuint);
alIsBuffer-: PROCEDURE { C } (buffer : ALuint) : ALboolean;
alBufferData-: PROCEDURE { C } (buffer : ALuint; format : ALenum; data: ADDRESS ; size, freq : ALsizei);
alBufferf-: PROCEDURE { C } (buffer : ALuint; param : ALenum; value : ALfloat);
alBuffer3f-: PROCEDURE { C } (buffer : ALuint; param : ALenum; v1, v2, v3: ALfloat);
alBufferfv-: PROCEDURE { C } (buffer : ALuint; param : ALenum; value : PALfloat);
alBufferi-: PROCEDURE { C } (buffer : ALuint; param : ALenum; value : ALint);
alBuffer3i-: PROCEDURE { C } (buffer : ALuint; param : ALenum; v1, v2, v3 : ALint);
alBufferiv-: PROCEDURE { C } (buffer : ALuint; param : ALenum; value : PALint);
alGetBufferf-: PROCEDURE { C } (buffer : ALuint; param : ALenum; VAR value : ALfloat);
alGetBuffer3f-: PROCEDURE { C } (buffer : ALuint; param : ALenum; VAR v1, v2, v3: ALfloat);
alGetBufferfv-: PROCEDURE { C } (buffer : ALuint; param : ALenum; value : PALfloat);
alGetBufferi-: PROCEDURE { C } (buffer : ALuint; param : ALenum; VAR value : ALint);
alGetBuffer3i-: PROCEDURE { C } (buffer : ALuint; param : ALenum; VAR v1, v2, v3 : ALint);
alGetBufferiv-: PROCEDURE { C } (buffer : ALuint; param : ALenum; value : PALint);
alDistanceModel-: PROCEDURE { C } (value : ALenum);
alDopplerFactor-: PROCEDURE { C } (value : ALfloat);
alSpeedOfSound-: PROCEDURE { C } (value : ALfloat);
alDopplerVelocity-: PROCEDURE { C } (value : ALfloat);
alcOpenDeviceXXX-: PROCEDURE { C } (deviceName : ADDRESS) : ALCdevice;
alcCloseDevice-: PROCEDURE { C } (device : ALCdevice): ALCboolean;
alcCreateContext-: PROCEDURE { C } (device : ALCdevice; attrList : PALCint) : ALCcontext;
alcMakeContextCurrent-: PROCEDURE { C } ( context : ALCcontext) : ALCboolean;
alcProcessContext-: PROCEDURE { C } (context : ALCcontext);
alcGetCurrentContext-: PROCEDURE { C } () : ALCcontext;
alcGetContextsDevice-: PROCEDURE { C } (context : ALCcontext) : ALCdevice;
alcSuspendContext-: PROCEDURE { C } (context : ALCcontext);
alcDestroyContext-: PROCEDURE { C } (context : ALCcontext);
alcGetError-: PROCEDURE { C } (device : ALCdevice) : ALCenum;
alcIsExtensionPresentXXX- : PROCEDURE { C } (device : ALCdevice; extName : ADDRESS) : ALCboolean;
alcGetProcAddressXXX-: PROCEDURE { C } (device : ALCdevice; funcName: ADDRESS): ADDRESS;
alcGetEnumValue-: PROCEDURE { C } (device : ALCdevice; VAR enumName : ALCubyte) : ALCenum;
alcGetString-: PROCEDURE { C } (device : ALCdevice; param : ALCenum) : LONGINT;
alcGetIntegerv -: PROCEDURE { C } ( device : ALCdevice; param : ALCenum; size : ALCsizei; data : PALCint);
alcCaptureOpenDeviceXXX-: PROCEDURE { C } (devicename: ADDRESS;
frequency: ALCuint; format: ALCenum; buffersize: ALCsizei): ALCdevice;
alcCaptureCloseDevice-: PROCEDURE { C } (device: ALCdevice): ALCboolean;
alcCaptureStart-: PROCEDURE { C } (device: ALCdevice);
alcCaptureStop-: PROCEDURE { C } (device: ALCdevice);
alcCaptureSamples-: PROCEDURE { C } (device: ALCdevice; buffer: ADDRESS; samples: ALCsizei);
PROCEDURE LoadFunctions;
BEGIN
xlib := Unix.Dlopen(libname, 2 );
ASSERT(xlib # 0, 103);
Unix.Dlsym( xlib, "alEnable", SYSTEM.VAL( ADDRESS, alEnable));
Unix.Dlsym( xlib, "alDisable", SYSTEM.VAL( ADDRESS, alDisable));
Unix.Dlsym( xlib, "alIsEnabled", SYSTEM.VAL( ADDRESS, alIsEnabled));
Unix.Dlsym( xlib, "alGetBoolean", SYSTEM.VAL( ADDRESS, alGetBoolean));
Unix.Dlsym( xlib, "alGetInteger", SYSTEM.VAL( ADDRESS, alGetInteger));
Unix.Dlsym( xlib, "alGetFloat", SYSTEM.VAL( ADDRESS, alGetFloat));
Unix.Dlsym( xlib, "alGetDouble", SYSTEM.VAL( ADDRESS, alGetDouble));
Unix.Dlsym( xlib, "alGetBooleanv", SYSTEM.VAL( ADDRESS, alGetBooleanv));
Unix.Dlsym( xlib, "alGetIntegerv", SYSTEM.VAL( ADDRESS, alGetIntegerv));
Unix.Dlsym( xlib, "alGetFloatv", SYSTEM.VAL( ADDRESS, alGetFloatv));
Unix.Dlsym( xlib, "alGetDoublev", SYSTEM.VAL( ADDRESS, alGetDoublev));
Unix.Dlsym( xlib, "alGetString", SYSTEM.VAL( ADDRESS, alGetString));
Unix.Dlsym( xlib, "alGetError", SYSTEM.VAL( ADDRESS, alGetError));
Unix.Dlsym( xlib, "alIsExtensionPresent", SYSTEM.VAL( ADDRESS, alIsExtensionPresent));
Unix.Dlsym( xlib, "alGetProcAddress", SYSTEM.VAL( ADDRESS, alGetProcAddress));
Unix.Dlsym( xlib, "alGetEnumValue", SYSTEM.VAL( ADDRESS, alGetEnumValue));
Unix.Dlsym( xlib, "alListenerf", SYSTEM.VAL( ADDRESS, alListenerf));
Unix.Dlsym( xlib, "alListener3f", SYSTEM.VAL( ADDRESS, alListener3f));
Unix.Dlsym( xlib, "alListenerfv", SYSTEM.VAL( ADDRESS, alListenerfv));
Unix.Dlsym( xlib, "alListeneri", SYSTEM.VAL( ADDRESS, alListeneri));
Unix.Dlsym( xlib, "alListener3i", SYSTEM.VAL( ADDRESS, alListener3i));
Unix.Dlsym( xlib, "alListeneriv", SYSTEM.VAL( ADDRESS, alListeneriv));
Unix.Dlsym( xlib, "alGetListenerf", SYSTEM.VAL( ADDRESS, alGetListenerf));
Unix.Dlsym( xlib, "alGetListener3f", SYSTEM.VAL( ADDRESS, alGetListener3f));
Unix.Dlsym( xlib, "alGetListenerfv", SYSTEM.VAL( ADDRESS, alGetListenerfv));
Unix.Dlsym( xlib, "alGetListeneri", SYSTEM.VAL( ADDRESS, alGetListeneri));
Unix.Dlsym( xlib, "alGetListener3i", SYSTEM.VAL( ADDRESS, alGetListener3i));
Unix.Dlsym( xlib, "alGetListeneriv", SYSTEM.VAL( ADDRESS, alGetListeneriv));
Unix.Dlsym( xlib, "alGenSources", SYSTEM.VAL( ADDRESS, alGenSources));
Unix.Dlsym( xlib, "alDeleteSources", SYSTEM.VAL( ADDRESS, alDeleteSources));
Unix.Dlsym( xlib, "alIsSource", SYSTEM.VAL( ADDRESS, alIsSource));
Unix.Dlsym( xlib, "alSourcei", SYSTEM.VAL( ADDRESS, alSourcei));
Unix.Dlsym( xlib, "alSourcef", SYSTEM.VAL( ADDRESS, alSourcef));
Unix.Dlsym( xlib, "alSource3f", SYSTEM.VAL( ADDRESS, alSource3f));
Unix.Dlsym( xlib, "alSourcefv", SYSTEM.VAL( ADDRESS, alSourcefv));
Unix.Dlsym( xlib, "alSourcei", SYSTEM.VAL( ADDRESS, alSourcei));
Unix.Dlsym( xlib, "alSource3i", SYSTEM.VAL( ADDRESS, alSource3i));
Unix.Dlsym( xlib, "alSourceiv", SYSTEM.VAL( ADDRESS, alSourceiv));
Unix.Dlsym( xlib, "alGetSourcef", SYSTEM.VAL( ADDRESS, alGetSourcef));
Unix.Dlsym( xlib, "alGetSource3f", SYSTEM.VAL( ADDRESS, alGetSource3f));
Unix.Dlsym( xlib, "alGetSourcefv", SYSTEM.VAL( ADDRESS, alGetSourcefv));
Unix.Dlsym( xlib, "alGetSourcei", SYSTEM.VAL( ADDRESS, alGetSourcei));
Unix.Dlsym( xlib, "alGetSource3i", SYSTEM.VAL( ADDRESS, alGetSource3i));
Unix.Dlsym( xlib, "alGetSourceiv", SYSTEM.VAL( ADDRESS, alGetSourceiv));
Unix.Dlsym( xlib, "alSourcePlayv", SYSTEM.VAL( ADDRESS, alSourcePlayv));
Unix.Dlsym( xlib, "alSourcePausev", SYSTEM.VAL( ADDRESS, alSourcePausev));
Unix.Dlsym( xlib, "alSourceStopv", SYSTEM.VAL( ADDRESS, alSourceStopv));
Unix.Dlsym( xlib, "alSourceRewindv", SYSTEM.VAL( ADDRESS, alSourceRewindv));
Unix.Dlsym( xlib, "alSourcePlay", SYSTEM.VAL( ADDRESS, alSourcePlay));
Unix.Dlsym( xlib, "alSourcePause", SYSTEM.VAL( ADDRESS, alSourcePause));
Unix.Dlsym( xlib, "alSourceStop", SYSTEM.VAL( ADDRESS, alSourceStop));
Unix.Dlsym( xlib, "alSourceRewind", SYSTEM.VAL( ADDRESS, alSourceRewind));
Unix.Dlsym( xlib, "alGenBuffers", SYSTEM.VAL( ADDRESS, alGenBuffers));
Unix.Dlsym( xlib, "alDeleteBuffers", SYSTEM.VAL( ADDRESS, alDeleteBuffers));
Unix.Dlsym( xlib, "alIsBuffer", SYSTEM.VAL( ADDRESS, alIsBuffer));
Unix.Dlsym( xlib, "alBufferData", SYSTEM.VAL( ADDRESS, alBufferData));
Unix.Dlsym( xlib, "alBufferf", SYSTEM.VAL( ADDRESS, alBufferf));
Unix.Dlsym( xlib, "alBuffer3f", SYSTEM.VAL( ADDRESS, alBuffer3f));
Unix.Dlsym( xlib, "alBufferfv", SYSTEM.VAL( ADDRESS, alBufferfv));
Unix.Dlsym( xlib, "alBufferi", SYSTEM.VAL( ADDRESS, alBufferi));
Unix.Dlsym( xlib, "alBuffer3i", SYSTEM.VAL( ADDRESS, alBuffer3i));
Unix.Dlsym( xlib, "alBufferiv", SYSTEM.VAL( ADDRESS, alBufferiv));
Unix.Dlsym( xlib, "alGetBufferf", SYSTEM.VAL( ADDRESS, alGetBufferf));
Unix.Dlsym( xlib, "alGetBuffer3f", SYSTEM.VAL( ADDRESS, alGetBuffer3f));
Unix.Dlsym( xlib, "alGetBufferfv", SYSTEM.VAL( ADDRESS, alGetBufferfv));
Unix.Dlsym( xlib, "alGetBufferi", SYSTEM.VAL( ADDRESS, alGetBufferi));
Unix.Dlsym( xlib, "alGetBuffer3i", SYSTEM.VAL( ADDRESS, alGetBuffer3i));
Unix.Dlsym( xlib, "alGetBufferiv", SYSTEM.VAL( ADDRESS, alGetBufferiv));
Unix.Dlsym( xlib, "alSourceQueueBuffers", SYSTEM.VAL( ADDRESS, alSourceQueueBuffers));
Unix.Dlsym( xlib, "alSourceUnqueueBuffers", SYSTEM.VAL( ADDRESS, alSourceUnqueueBuffers));
Unix.Dlsym( xlib, "alDistanceModel", SYSTEM.VAL( ADDRESS, alDistanceModel));
Unix.Dlsym( xlib, "alDopplerFactor", SYSTEM.VAL( ADDRESS, alDopplerFactor));
Unix.Dlsym( xlib, "alSpeedOfSound", SYSTEM.VAL( ADDRESS, alSpeedOfSound));
Unix.Dlsym( xlib, "alDopplerVelocity", SYSTEM.VAL( ADDRESS, alDopplerVelocity));
Unix.Dlsym( xlib, "alcOpenDevice", SYSTEM.VAL( ADDRESS, alcOpenDeviceXXX));
Unix.Dlsym( xlib, "alcCloseDevice", SYSTEM.VAL( ADDRESS, alcCloseDevice));
Unix.Dlsym( xlib, "alcCreateContext", SYSTEM.VAL( ADDRESS, alcCreateContext));
Unix.Dlsym( xlib, "alcMakeContextCurrent", SYSTEM.VAL( ADDRESS, alcMakeContextCurrent));
Unix.Dlsym( xlib, "alcProcessContext", SYSTEM.VAL( ADDRESS, alcProcessContext));
Unix.Dlsym( xlib, "alcGetCurrentContext", SYSTEM.VAL( ADDRESS, alcGetCurrentContext));
Unix.Dlsym( xlib, "alcGetContextsDevice", SYSTEM.VAL( ADDRESS, alcGetContextsDevice));
Unix.Dlsym( xlib, "alcSuspendContext", SYSTEM.VAL( ADDRESS, alcSuspendContext));
Unix.Dlsym( xlib, "alcDestroyContext", SYSTEM.VAL( ADDRESS, alcDestroyContext));
Unix.Dlsym( xlib, "alcGetError", SYSTEM.VAL( ADDRESS, alcGetError));
Unix.Dlsym( xlib, "alcGetString", SYSTEM.VAL( ADDRESS, alcGetString));
Unix.Dlsym( xlib, "alcGetIntegerv", SYSTEM.VAL( ADDRESS, alcGetIntegerv));
Unix.Dlsym( xlib, "alcIsExtensionPresent", SYSTEM.VAL( ADDRESS, alcIsExtensionPresentXXX));
Unix.Dlsym( xlib, "alcGetProcAddress", SYSTEM.VAL( ADDRESS, alcGetProcAddressXXX));
Unix.Dlsym( xlib, "alcGetEnumValue", SYSTEM.VAL( ADDRESS, alcGetEnumValue));
Unix.Dlsym( xlib, "alcCaptureOpenDevice", SYSTEM.VAL( ADDRESS, alcCaptureOpenDeviceXXX));
Unix.Dlsym( xlib, "alcCaptureCloseDevice", SYSTEM.VAL( ADDRESS, alcCaptureCloseDevice));
Unix.Dlsym( xlib, "alcCaptureStart", SYSTEM.VAL( ADDRESS, alcCaptureStart));
Unix.Dlsym( xlib, "alcCaptureStop", SYSTEM.VAL( ADDRESS, alcCaptureStop));
Unix.Dlsym( xlib, "alcCaptureSamples", SYSTEM.VAL( ADDRESS, alcCaptureSamples));
END LoadFunctions;
PROCEDURE OnClose;
BEGIN
IF xlib # 0 THEN
Unix.Dlclose(xlib);
KernelLog.String(libname); KernelLog.String(' unloaded.'); KernelLog.Ln;
END;
END OnClose;
PROCEDURE alcOpenDevice*( CONST deviceName: ARRAY OF CHAR ): ALCdevice;
VAR dev: ALCdevice;
BEGIN
dev := alcOpenDeviceXXX( SYSTEM.ADR( deviceName[0] ) );
RETURN dev
END alcOpenDevice;
PROCEDURE alcCaptureOpenDevice*( CONST deviceName: ARRAY OF CHAR;
frequency: ALCuint; format: ALCenum; buffersize: ALCsizei): ALCdevice;
VAR dev: ALCdevice;
BEGIN
dev := alcCaptureOpenDeviceXXX( SYSTEM.ADR( deviceName[0] ), frequency, format, buffersize );
RETURN dev
END alcCaptureOpenDevice;
PROCEDURE alcIsExtensionPresent* (device : ALCdevice; CONST extName : ARRAY OF CHAR) : ALCboolean;
VAR res: ALCboolean;
BEGIN
res := alcIsExtensionPresentXXX(device, SYSTEM.ADR(extName[0]));
RETURN res;
END alcIsExtensionPresent;
PROCEDURE alcGetProcAddress* (device : ALCdevice; CONST funcName: ARRAY OF CHAR): ADDRESS;
VAR adr: ADDRESS;
BEGIN
adr := alcGetProcAddressXXX (device, SYSTEM.ADR(funcName[0]));
RETURN adr;
END alcGetProcAddress;
PROCEDURE GetStringFromAddr(adr: LONGINT): Strings.String;
VAR sadr, sadr1: LONGINT;
i, cnt: LONGINT;
ch: CHAR;
s: Strings.String;
BEGIN
sadr := adr;
cnt :=0;
sadr1 := sadr;
IF sadr1 # 0 THEN
SYSTEM.GET(sadr1,ch);
WHILE (ch # 0X) DO INC(cnt); INC(sadr1); SYSTEM.GET(sadr1,ch); END;
END;
IF cnt = 0 THEN
NEW(s,1); s[0]:=0X; RETURN s
END;
NEW(s, cnt+1);
i:=0;
sadr1 := sadr;
SYSTEM.GET(sadr1,ch);
WHILE (i< cnt) & (ch # 0X) DO
s^[i] := ch; INC(i); INC(sadr1);
SYSTEM.GET(sadr1,ch);
END;
RETURN s;
END GetStringFromAddr;
PROCEDURE ALGetString*( name: ALCenum): Strings.String;
VAR sadr: LONGINT;
BEGIN
sadr := alGetString( name);
RETURN GetStringFromAddr(sadr);
END ALGetString;
PROCEDURE ALCGetString*(device: ALCdevice; name: ALCenum): Strings.String;
VAR sadr: LONGINT;
BEGIN
sadr := alcGetString(device, name);
RETURN GetStringFromAddr(sadr);
END ALCGetString;
PROCEDURE GetDevStringFromAddr(adr: LONGINT): Strings.String;
VAR sadr, sadr1: LONGINT;
i, cnt: LONGINT;
ch: CHAR;
s: Strings.String;
BEGIN
sadr := adr;
cnt :=0;
sadr1 := sadr;
IF sadr1 # 0 THEN
SYSTEM.GET(sadr1,ch);
WHILE (ch # 0X) DO INC(cnt); INC(sadr1); SYSTEM.GET(sadr1,ch); END;
END;
IF cnt = 0 THEN
RETURN NIL
END;
NEW(s, cnt+1);
i:=0;
sadr1 := sadr;
SYSTEM.GET(sadr1,ch);
WHILE (i< cnt) & (ch # 0X) DO
s^[i] := ch; INC(i); INC(sadr1);
SYSTEM.GET(sadr1,ch);
END;
RETURN s;
END GetDevStringFromAddr;
PROCEDURE ALCGetDeviceList*(device: ALCdevice; name: ALCenum): PString256;
VAR sadr, sadr0: LONGINT;
slen, index: LONGINT;
str: Strings.String;
dynstr: PString256;
BEGIN
sadr0 := alcGetString(device, name);
sadr := sadr0;
str := GetDevStringFromAddr(sadr);
index := 0;
WHILE (str # NIL) & (index<10) DO
slen := Strings.Length(str^);
sadr := sadr + slen +1;
str := GetDevStringFromAddr(sadr);
INC(index);
END;
NEW(dynstr, index);
sadr0 := alcGetString(device, name);
sadr := sadr0;
str := GetDevStringFromAddr(sadr);
index := 0;
WHILE (str # NIL) & (index<10) DO
COPY(str^, dynstr^[index]);
slen := Strings.Length(str^);
sadr := sadr + slen +1;
str := GetDevStringFromAddr(sadr);
INC(index);
END;
RETURN dynstr;
END ALCGetDeviceList;
BEGIN
LoadFunctions;
Modules.InstallTermHandler(OnClose) ;
END OpenAL.
SystemTools.Free OpenAL~