alch.inc 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. (*
  2. * The ALCAPI, ALCAPIENTRY, and ALC_INVALID macros are deprecated, but are
  3. * included for applications porting code from AL 1.0
  4. *)
  5. { ALCAPI ALC_API
  6. ALCAPIENTRY ALC_APIENTRY
  7. ALC_INVALID = 0;
  8. ALC_VERSION_0_1 = 1;}
  9. type
  10. PALCdevice = ^ALCdevice;
  11. ALCdevice = record
  12. end;
  13. PALCcontext = ^ALCcontext;
  14. ALCcontext = record
  15. end;
  16. (** 8-bit boolean *)
  17. ALCboolean = cbool;
  18. PALCboolean = pcbool;
  19. (** character *)
  20. ALCchar = cchar;
  21. PALCchar = pcchar;
  22. (** signed 8-bit 2's complement integer *)
  23. ALCbyte = cint8;
  24. PALCbyte = pcint8;
  25. (** unsigned 8-bit integer *)
  26. ALCubyte = cuint8;
  27. PALCubyte = pcuint8;
  28. (** signed 16-bit 2's complement integer *)
  29. ALCshort = cint16;
  30. PALCshort = pcint16;
  31. (** unsigned 16-bit integer *)
  32. ALCushort = cuint16;
  33. PALCushort = pcuint16;
  34. (** signed 32-bit 2's complement integer *)
  35. ALCint = cint32;
  36. PALCint = pcint32;
  37. (** unsigned 32-bit integer *)
  38. ALCuint = cuint32;
  39. PALCuint = pcuint32;
  40. (** non-negative 32-bit binary integer size *)
  41. ALCsizei = cint32;
  42. PALCsizei = pcint32;
  43. (** enumerated 32-bit value *)
  44. ALCenum = cint32;
  45. PALCenum = pcint32;
  46. (** 32-bit IEEE754 floating-point *)
  47. ALCfloat = cfloat;
  48. PALCfloat = pcfloat;
  49. (** 64-bit IEEE754 floating-point *)
  50. ALCdouble = cdouble;
  51. PALCdouble = pcdouble;
  52. (** void type (for opaque pointers only) *)
  53. PALCvoid = pointer;
  54. (* Enumerant values begin at column 50. No tabs. *)
  55. const
  56. (* Boolean False. *)
  57. ALC_FALSE = 0;
  58. (* Boolean True. *)
  59. ALC_TRUE = 1;
  60. (**
  61. * followed by <int> Hz
  62. *)
  63. ALC_FREQUENCY = $1007;
  64. (**
  65. * followed by <int> Hz
  66. *)
  67. ALC_REFRESH = $1008;
  68. (**
  69. * followed by AL_TRUE, AL_FALSE
  70. *)
  71. ALC_SYNC = $1009;
  72. (**
  73. * followed by <int> Num of requested Mono (3D) Sources
  74. *)
  75. ALC_MONO_SOURCES = $1010;
  76. (**
  77. * followed by <int> Num of requested Stereo Sources
  78. *)
  79. ALC_STEREO_SOURCES = $1011;
  80. (**
  81. * errors
  82. *)
  83. (**
  84. * No error
  85. *)
  86. ALC_NO_ERROR = ALC_FALSE;
  87. (**
  88. * No device
  89. *)
  90. ALC_INVALID_DEVICE = $A001;
  91. (**
  92. * invalid context ID
  93. *)
  94. ALC_INVALID_CONTEXT = $A002;
  95. (**
  96. * bad enum
  97. *)
  98. ALC_INVALID_ENUM = $A003;
  99. (**
  100. * bad value
  101. *)
  102. ALC_INVALID_VALUE = $A004;
  103. (**
  104. * Out of memory.
  105. *)
  106. ALC_OUT_OF_MEMORY = $A005;
  107. (**
  108. * The Specifier string for default device
  109. *)
  110. ALC_DEFAULT_DEVICE_SPECIFIER = $1004;
  111. ALC_DEVICE_SPECIFIER = $1005;
  112. ALC_EXTENSIONS = $1006;
  113. ALC_MAJOR_VERSION = $1000;
  114. ALC_MINOR_VERSION = $1001;
  115. ALC_ATTRIBUTES_SIZE = $1002;
  116. ALC_ALL_ATTRIBUTES = $1003;
  117. (**
  118. * Capture extension
  119. *)
  120. ALC_CAPTURE_DEVICE_SPECIFIER = $310;
  121. ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER = $311;
  122. ALC_CAPTURE_SAMPLES = $312;
  123. (*
  124. * Context Management
  125. *)
  126. function alcCreateContext(device: PALCdevice; const attrlist: PALCint): PALCcontext; cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  127. function alcMakeContextCurrent(context: PALCcontext): ALCboolean; cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  128. procedure alcProcessContext(context: PALCcontext); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  129. procedure alcSuspendContext(context: PALCcontext); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  130. procedure alcDestroyContext(context: PALCcontext); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  131. function alcGetCurrentContext: PALCcontext; cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  132. function alcGetContextsDevice(context: PALCcontext): PALCdevice; cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  133. (*
  134. * Device Management
  135. *)
  136. function alcOpenDevice(const devicename: PALCchar): PALCdevice; cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  137. function alcCloseDevice(device: PALCdevice): ALCboolean; cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  138. (*
  139. * Error support.
  140. * Obtain the most recent Context error
  141. *)
  142. function alcGetError(device: PALCdevice): ALCenum; cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  143. (*
  144. * Extension support.
  145. * Query for the presence of an extension, and obtain any appropriate
  146. * function pointers and enum values.
  147. *)
  148. function alcIsExtensionPresent(device: PALCdevice; const extname: PALCchar): ALCboolean; cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  149. function alcGetProcAddress(device: PALCdevice; const funcname: PALCchar): pointer; cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  150. function alcGetEnumValue(device: PALCdevice; const enumname: PALCchar): ALCenum; cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  151. (*
  152. * Query functions
  153. *)
  154. function alcGetString(device: PALCdevice; param: ALCenum): PALCchar; cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  155. procedure alcGetIntegerv(device: PALCdevice; param: ALCenum; size: ALCsizei; data: PALCint); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  156. (*
  157. * Capture functions
  158. *)
  159. function alcCaptureOpenDevice(const devicename: PALCchar; frequency: ALCuint; format: ALCenum; buffersize: ALCsizei): PALCdevice; cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  160. function alcCaptureCloseDevice(device: PALCdevice): ALCboolean; cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  161. procedure alcCaptureStart(device: PALCdevice); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  162. procedure alcCaptureStop(device: PALCdevice); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  163. procedure alcCaptureSamples(device: PALCdevice; buffer: PALCvoid; samples: ALCsizei); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  164. (*
  165. * Pointer-to-function types, useful for dynamically getting ALC entry points.
  166. *)
  167. {
  168. type
  169. LPALCCREATECONTEXT = function(ALCdevice *device, const ALCint *attrlist): PALCcontext; cdecl;
  170. LPALCMAKECONTEXTCURRENT = function( ALCcontext *context ): ALCboolean; cdecl;
  171. LPALCPROCESSCONTEXT = procedure( ALCcontext *context ); cdecl;
  172. LPALCSUSPENDCONTEXT = procedure( ALCcontext *context ); cdecl;
  173. LPALCDESTROYCONTEXT = procedure( ALCcontext *context ); cdecl;
  174. LPALCGETCURRENTCONTEXT = function( ALCvoid ): PALCcontext; cdecl;
  175. LPALCGETCONTEXTSDEVICE = function( ALCcontext *context ): PALCdevice; cdecl;
  176. LPALCOPENDEVICE = function( const ALCchar *devicename ): PALCdevice; cdecl;
  177. LPALCCLOSEDEVICE = function( ALCdevice *device ): ALCboolean; cdecl;
  178. LPALCGETERROR = function( ALCdevice *device ): ALCenum; cdecl;
  179. LPALCISEXTENSIONPRESENT = function( ALCdevice *device, const ALCchar *extname ): ALCboolean; cdecl;
  180. LPALCGETPROCADDRESS = function(ALCdevice *device, const ALCchar *funcname ): pointer; cdecl;
  181. LPALCGETENUMVALUE = function(ALCdevice *device, const ALCchar *enumname ): ALCenum; cdecl;
  182. LPALCGETSTRING = function( ALCdevice *device, ALCenum param ): PALCchar; cdecl;
  183. LPALCGETINTEGERV = procedure(ALCdevice *device, ALCenum param, ALCsizei size, ALCint *dest ); cdecl;
  184. LPALCCAPTUREOPENDEVICE = function( const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize ): PALCdevice; cdecl;
  185. LPALCCAPTURECLOSEDEVICE = function( ALCdevice *device ): ALCboolean; cdecl;
  186. LPALCCAPTURESTART = procedure( ALCdevice *device ); cdecl;
  187. LPALCCAPTURESTOP = procedure( ALCdevice *device ); cdecl;
  188. LPALCCAPTURESAMPLES = procedure( ALCdevice *device, ALCvoid *buffer, ALCsizei samples ); cdecl;
  189. }