--=========== Copyright © 2020, Planimeter, All rights reserved. ===========--
--
-- Purpose:
--
--==========================================================================--

local ffi = require( "ffi" )
io.input( framework.execdir .. "include/al.h" )
ffi.cdef( io.read( "*all" ) )

local AL = ffi.load( ffi.os == "Windows" and "OpenAL32" or "OpenAL.framework/OpenAL" )
local _M = {
	AL_INVALID                                = (-1),
	AL_NONE                                   = 0,
	AL_FALSE                                  = 0,
	AL_TRUE                                   = 1,
	AL_SOURCE_RELATIVE                        = 0x202,
	AL_CONE_INNER_ANGLE                       = 0x1001,
	AL_CONE_OUTER_ANGLE                       = 0x1002,
	AL_PITCH                                  = 0x1003,
	AL_POSITION                               = 0x1004,
	AL_DIRECTION                              = 0x1005,
	AL_VELOCITY                               = 0x1006,
	AL_LOOPING                                = 0x1007,
	AL_BUFFER                                 = 0x1009,
	AL_GAIN                                   = 0x100A,
	AL_MIN_GAIN                               = 0x100D,
	AL_MAX_GAIN                               = 0x100E,
	AL_ORIENTATION                            = 0x100F,
	AL_SOURCE_STATE                           = 0x1010,
	AL_INITIAL                                = 0x1011,
	AL_PLAYING                                = 0x1012,
	AL_PAUSED                                 = 0x1013,
	AL_STOPPED                                = 0x1014,
	AL_BUFFERS_QUEUED                         = 0x1015,
	AL_BUFFERS_PROCESSED                      = 0x1016,
	AL_SEC_OFFSET                             = 0x1024,
	AL_SAMPLE_OFFSET                          = 0x1025,
	AL_BYTE_OFFSET                            = 0x1026,
	AL_SOURCE_TYPE                            = 0x1027,
	AL_STATIC                                 = 0x1028,
	AL_STREAMING                              = 0x1029,
	AL_UNDETERMINED                           = 0x1030,
	AL_FORMAT_MONO8                           = 0x1100,
	AL_FORMAT_MONO16                          = 0x1101,
	AL_FORMAT_STEREO8                         = 0x1102,
	AL_FORMAT_STEREO16                        = 0x1103,
	AL_REFERENCE_DISTANCE                     = 0x1020,
	AL_ROLLOFF_FACTOR                         = 0x1021,
	AL_CONE_OUTER_GAIN                        = 0x1022,
	AL_MAX_DISTANCE                           = 0x1023,
	AL_FREQUENCY                              = 0x2001,
	AL_BITS                                   = 0x2002,
	AL_CHANNELS                               = 0x2003,
	AL_SIZE                                   = 0x2004,
	AL_UNUSED                                 = 0x2010,
	AL_PENDING                                = 0x2011,
	AL_PROCESSED                              = 0x2012,
	AL_NO_ERROR                               = 0,
	AL_INVALID_NAME                           = 0xA001,
	AL_INVALID_ENUM                           = 0xA002,
	AL_INVALID_VALUE                          = 0xA003,
	AL_INVALID_OPERATION                      = 0xA004,
	AL_OUT_OF_MEMORY                          = 0xA005,
	AL_VENDOR                                 = 0xB001,
	AL_VERSION                                = 0xB002,
	AL_RENDERER                               = 0xB003,
	AL_EXTENSIONS                             = 0xB004,
	AL_DOPPLER_FACTOR                         = 0xC000,
	AL_DOPPLER_VELOCITY                       = 0xC001,
	AL_SPEED_OF_SOUND                         = 0xC003,
	AL_DISTANCE_MODEL                         = 0xD000,
	AL_INVERSE_DISTANCE                       = 0xD001,
	AL_INVERSE_DISTANCE_CLAMPED               = 0xD002,
	AL_LINEAR_DISTANCE                        = 0xD003,
	AL_LINEAR_DISTANCE_CLAMPED                = 0xD004,
	AL_EXPONENT_DISTANCE                      = 0xD005,
	AL_EXPONENT_DISTANCE_CLAMPED              = 0xD006,
	ALC_INVALID = 0,
	ALC_VERSION_0_1         = 1,
	ALC_FALSE                                = 0,
	ALC_TRUE                                 = 1,
	ALC_FREQUENCY                            = 0x1007,
	ALC_REFRESH                              = 0x1008,
	ALC_SYNC                                 = 0x1009,
	ALC_MONO_SOURCES                         = 0x1010,
	ALC_STEREO_SOURCES                       = 0x1011,
	ALC_NO_ERROR                             = 0,
	ALC_INVALID_DEVICE                       = 0xA001,
	ALC_INVALID_CONTEXT                      = 0xA002,
	ALC_INVALID_ENUM                         = 0xA003,
	ALC_INVALID_VALUE                        = 0xA004,
	ALC_OUT_OF_MEMORY                        = 0xA005,
	ALC_DEFAULT_DEVICE_SPECIFIER             = 0x1004,
	ALC_DEVICE_SPECIFIER                     = 0x1005,
	ALC_EXTENSIONS                           = 0x1006,
	ALC_MAJOR_VERSION                        = 0x1000,
	ALC_MINOR_VERSION                        = 0x1001,
	ALC_ATTRIBUTES_SIZE                      = 0x1002,
	ALC_ALL_ATTRIBUTES                       = 0x1003,
	ALC_DEFAULT_ALL_DEVICES_SPECIFIER        = 0x1012,
	ALC_ALL_DEVICES_SPECIFIER                = 0x1013,
	ALC_CAPTURE_DEVICE_SPECIFIER             = 0x310,
	ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER     = 0x311,
	ALC_CAPTURE_SAMPLES                      = 0x312
}
return setmetatable( _M, {
	__index = function( table, key )
		return AL[ key ]
	end
} )
