alh.inc 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722
  1. (**
  2. * OpenAL cross platform audio library
  3. * Copyright (C) 1999-2000 by authors.
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Library General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Library General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Library General Public
  15. * License along with this library; if not, write to the
  16. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17. * Boston, MA 02111-1307, USA.
  18. * Or go to http://www.gnu.org/copyleft/lgpl.html
  19. *)
  20. (*
  21. * The OPENAL, ALAPI, ALAPIENTRY, AL_INVALID, AL_ILLEGAL_ENUM, and
  22. * AL_ILLEGAL_COMMAND macros are deprecated, but are included for
  23. * applications porting code from AL 1.0
  24. *)
  25. { OPENAL
  26. ALAPI AL_API
  27. ALAPIENTRY AL_APIENTRY
  28. AL_INVALID = (-1);
  29. AL_ILLEGAL_ENUM = AL_INVALID_ENUM;
  30. AL_ILLEGAL_COMMAND = AL_INVALID_OPERATION;
  31. AL_VERSION_1_0
  32. AL_VERSION_1_1}
  33. type
  34. (** 8-bit boolean *)
  35. ALboolean = cbool;
  36. PALboolean = pcbool;
  37. (** character *)
  38. ALchar = cchar;
  39. PALchar = pcchar;
  40. (** signed 8-bit 2's complement integer *)
  41. ALbyte = cint8;
  42. PALbyte = pcint8;
  43. (** unsigned 8-bit integer *)
  44. ALubyte = cuint8;
  45. PALubyte = pcuint8;
  46. (** signed 16-bit 2's complement integer *)
  47. ALshort = cint16;
  48. PALshort = pcint16;
  49. (** unsigned 16-bit integer *)
  50. ALushort = cuint16;
  51. PALushort = pcuint16;
  52. (** signed 32-bit 2's complement integer *)
  53. ALint = cint32;
  54. PALint = pcint32;
  55. (** unsigned 32-bit integer *)
  56. ALuint = cuint32;
  57. PALuint = pcuint32;
  58. (** non-negative 32-bit binary integer size *)
  59. ALsizei = cint32;
  60. PALsizei = pcint32;
  61. (** enumerated 32-bit value *)
  62. ALenum = cint32;
  63. PALenum = pcint32;
  64. (** 32-bit IEEE754 floating-point *)
  65. ALfloat = cfloat;
  66. PALfloat = pcfloat;
  67. (** 64-bit IEEE754 floating-point *)
  68. ALdouble = cdouble;
  69. PALdouble = pcdouble;
  70. (** void type (for opaque pointers only) *)
  71. PALvoid = pointer;
  72. (* Enumerant values begin at column 50. No tabs. *)
  73. const
  74. (* "no distance model" or "no buffer" *)
  75. AL_NONE = 0;
  76. (* Boolean False. *)
  77. AL_FALSE = 0;
  78. (** Boolean True. *)
  79. AL_TRUE = 1;
  80. (** Indicate Source has relative coordinates. *)
  81. AL_SOURCE_RELATIVE = $202;
  82. (**
  83. * Directional source, inner cone angle, in degrees.
  84. * Range: [0-360]
  85. * Default: 360
  86. *)
  87. AL_CONE_INNER_ANGLE = $1001;
  88. (**
  89. * Directional source, outer cone angle, in degrees.
  90. * Range: [0-360]
  91. * Default: 360
  92. *)
  93. AL_CONE_OUTER_ANGLE = $1002;
  94. (**
  95. * Specify the pitch to be applied, either at source,
  96. * or on mixer results, at listener.
  97. * Range: [0.5-2.0]
  98. * Default: 1.0
  99. *)
  100. AL_PITCH = $1003;
  101. (**
  102. * Specify the current location in three dimensional space.
  103. * OpenAL, like OpenGL, uses a right handed coordinate system,
  104. * where in a frontal default view X (thumb) points right,
  105. * Y points up (index finger), and Z points towards the
  106. * viewer/camera (middle finger).
  107. * To switch from a left handed coordinate system, flip the
  108. * sign on the Z coordinate.
  109. * Listener position is always in the world coordinate system.
  110. *)
  111. AL_POSITION = $1004;
  112. (** Specify the current direction. *)
  113. AL_DIRECTION = $1005;
  114. (** Specify the current velocity in three dimensional space. *)
  115. AL_VELOCITY = $1006;
  116. (**
  117. * Indicate whether source is looping.
  118. * Type: ALboolean?
  119. * Range: [AL_TRUE, AL_FALSE]
  120. * Default: FALSE.
  121. *)
  122. AL_LOOPING = $1007;
  123. (**
  124. * Indicate the buffer to provide sound samples.
  125. * Type: ALuint.
  126. * Range: any valid Buffer id.
  127. *)
  128. AL_BUFFER = $1009;
  129. (**
  130. * Indicate the gain (volume amplification) applied.
  131. * Type: ALfloat.
  132. * Range: ]0.0- ]
  133. * A value of 1.0 means un-attenuated/unchanged.
  134. * Each division by 2 equals an attenuation of -6dB.
  135. * Each multiplicaton with 2 equals an amplification of +6dB.
  136. * A value of 0.0 is meaningless with respect to a logarithmic
  137. * scale; it is interpreted as zero volume - the channel
  138. * is effectively disabled.
  139. *)
  140. AL_GAIN = $100A;
  141. (*
  142. * Indicate minimum source attenuation
  143. * Type: ALfloat
  144. * Range: [0.0 - 1.0]
  145. *
  146. * Logarthmic
  147. *)
  148. AL_MIN_GAIN = $100D;
  149. (**
  150. * Indicate maximum source attenuation
  151. * Type: ALfloat
  152. * Range: [0.0 - 1.0]
  153. *
  154. * Logarthmic
  155. *)
  156. AL_MAX_GAIN = $100E;
  157. (**
  158. * Indicate listener orientation.
  159. *
  160. * at/up
  161. *)
  162. AL_ORIENTATION = $100F;
  163. (**
  164. * Source state information.
  165. *)
  166. AL_SOURCE_STATE = $1010;
  167. AL_INITIAL = $1011;
  168. AL_PLAYING = $1012;
  169. AL_PAUSED = $1013;
  170. AL_STOPPED = $1014;
  171. (**
  172. * Buffer Queue params
  173. *)
  174. AL_BUFFERS_QUEUED = $1015;
  175. AL_BUFFERS_PROCESSED = $1016;
  176. (**
  177. * Source buffer position information
  178. *)
  179. AL_SEC_OFFSET = $1024;
  180. AL_SAMPLE_OFFSET = $1025;
  181. AL_BYTE_OFFSET = $1026;
  182. (*
  183. * Source type (Static, Streaming or undetermined)
  184. * Source is Static if a Buffer has been attached using AL_BUFFER
  185. * Source is Streaming if one or more Buffers have been attached using alSourceQueueBuffers
  186. * Source is undetermined when it has the NULL buffer attached
  187. *)
  188. AL_SOURCE_TYPE = $1027;
  189. AL_STATIC = $1028;
  190. AL_STREAMING = $1029;
  191. AL_UNDETERMINED = $1030;
  192. (** Sound samples: format specifier. *)
  193. AL_FORMAT_MONO8 = $1100;
  194. AL_FORMAT_MONO16 = $1101;
  195. AL_FORMAT_STEREO8 = $1102;
  196. AL_FORMAT_STEREO16 = $1103;
  197. (**
  198. * source specific reference distance
  199. * Type: ALfloat
  200. * Range: 0.0 - +inf
  201. *
  202. * At 0.0, no distance attenuation occurs. Default is
  203. * 1.0.
  204. *)
  205. AL_REFERENCE_DISTANCE = $1020;
  206. (**
  207. * source specific rolloff factor
  208. * Type: ALfloat
  209. * Range: 0.0 - +inf
  210. *
  211. *)
  212. AL_ROLLOFF_FACTOR = $1021;
  213. (**
  214. * Directional source, outer cone gain.
  215. *
  216. * Default: 0.0
  217. * Range: [0.0 - 1.0]
  218. * Logarithmic
  219. *)
  220. AL_CONE_OUTER_GAIN = $1022;
  221. (**
  222. * Indicate distance above which sources are not
  223. * attenuated using the inverse clamped distance model.
  224. *
  225. * Default: +inf
  226. * Type: ALfloat
  227. * Range: 0.0 - +inf
  228. *)
  229. AL_MAX_DISTANCE = $1023;
  230. (**
  231. * Sound samples: frequency, in units of Hertz [Hz].
  232. * This is the number of samples per second. Half of the
  233. * sample frequency marks the maximum significant
  234. * frequency component.
  235. *)
  236. AL_FREQUENCY = $2001;
  237. AL_BITS = $2002;
  238. AL_CHANNELS = $2003;
  239. AL_SIZE = $2004;
  240. (**
  241. * Buffer state.
  242. *
  243. * Not supported for public use (yet).
  244. *)
  245. AL_UNUSED = $2010;
  246. AL_PENDING = $2011;
  247. AL_PROCESSED = $2012;
  248. (** Errors: No Error. *)
  249. AL_NO_ERROR = AL_FALSE;
  250. (**
  251. * Invalid Name paramater passed to AL call.
  252. *)
  253. AL_INVALID_NAME = $A001;
  254. (**
  255. * Invalid parameter passed to AL call.
  256. *)
  257. AL_INVALID_ENUM = $A002;
  258. (**
  259. * Invalid enum parameter value.
  260. *)
  261. AL_INVALID_VALUE = $A003;
  262. (**
  263. * Illegal call.
  264. *)
  265. AL_INVALID_OPERATION = $A004;
  266. (**
  267. * No mojo.
  268. *)
  269. AL_OUT_OF_MEMORY = $A005;
  270. (** Context strings: Vendor Name. *)
  271. AL_VENDOR = $B001;
  272. AL_VERSION = $B002;
  273. AL_RENDERER = $B003;
  274. AL_EXTENSIONS = $B004;
  275. (** Global tweakage. *)
  276. (**
  277. * Doppler scale. Default 1.0
  278. *)
  279. AL_DOPPLER_FACTOR = $C000;
  280. (**
  281. * Tweaks speed of propagation.
  282. *)
  283. AL_DOPPLER_VELOCITY = $C001;
  284. (**
  285. * Speed of Sound in units per second
  286. *)
  287. AL_SPEED_OF_SOUND = $C003;
  288. (**
  289. * Distance models
  290. *
  291. * used in conjunction with DistanceModel
  292. *
  293. * implicit: NONE, which disances distance attenuation.
  294. *)
  295. AL_DISTANCE_MODEL = $D000;
  296. AL_INVERSE_DISTANCE = $D001;
  297. AL_INVERSE_DISTANCE_CLAMPED = $D002;
  298. AL_LINEAR_DISTANCE = $D003;
  299. AL_LINEAR_DISTANCE_CLAMPED = $D004;
  300. AL_EXPONENT_DISTANCE = $D005;
  301. AL_EXPONENT_DISTANCE_CLAMPED = $D006;
  302. (*
  303. * Renderer State management
  304. *)
  305. procedure alEnable(capability: ALenum); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  306. procedure alDisable(capability: ALenum); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  307. function alIsEnabled(capability: ALenum): ALboolean; cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  308. (*
  309. * State retrieval
  310. *)
  311. function alGetString(param: ALenum): PALchar; cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  312. procedure alGetBooleanv(param: ALenum; data: PALboolean); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  313. procedure alGetIntegerv(param: ALenum; data: PALint); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  314. procedure alGetFloatv(param: ALenum; data: PALfloat); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  315. procedure alGetDoublev(param: ALenum; data: PALdouble); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  316. function alGetBoolean(param: ALenum): ALboolean; cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  317. function alGetInteger(param: ALenum): ALint; cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  318. function alGetFloat(param: ALenum): ALfloat; cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  319. function alGetDouble(param: ALenum): ALdouble; cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  320. (*
  321. * Error support.
  322. * Obtain the most recent error generated in the AL state machine.
  323. *)
  324. function alGetError: ALenum; cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  325. (*
  326. * Extension support.
  327. * Query for the presence of an extension, and obtain any appropriate
  328. * function pointers and enum values.
  329. *)
  330. function alIsExtensionPresent(const extname: PALChar): ALboolean; cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  331. function alGetProcAddress(const fname: PALChar): pointer; cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  332. function alGetEnumValue(const ename: PALChar): ALenum; cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  333. (*
  334. * LISTENER
  335. * Listener represents the location and orientation of the
  336. * 'user' in 3D-space.
  337. *
  338. * Properties include: -
  339. *
  340. * Gain AL_GAIN ALfloat
  341. * Position AL_POSITION ALfloat[3]
  342. * Velocity AL_VELOCITY ALfloat[3]
  343. * Orientation AL_ORIENTATION ALfloat[6] (Forward then Up vectors)
  344. *)
  345. (*
  346. * Set Listener parameters
  347. *)
  348. procedure alListenerf(param: ALenum; value: ALfloat); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  349. procedure alListener3f(param: ALenum; value1, value2, value3: ALfloat); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  350. procedure alListenerfv(param: ALenum; const values: PALfloat); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  351. procedure alListeneri(param: ALenum; value: ALint); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  352. procedure alListener3i(param: ALenum; value1, value2, value3: ALint); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  353. procedure alListeneriv(param: ALenum; const values: PALint); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  354. (*
  355. * Get Listener parameters
  356. *)
  357. procedure alGetListenerf(param: ALenum; var value: ALfloat); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  358. procedure alGetListener3f(param: ALenum; var value1, value2, value3: ALfloat); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  359. procedure alGetListenerfv(param: ALenum; values: PALfloat); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  360. procedure alGetListeneri(param: ALenum; var value: ALint); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  361. procedure alGetListener3i(param: ALenum; var value1, value2, value3: ALint); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  362. procedure alGetListeneriv(param: ALenum; values: PALint); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  363. (**
  364. * SOURCE
  365. * Sources represent individual sound objects in 3D-space.
  366. * Sources take the PCM data provided in the specified Buffer,
  367. * apply Source-specific modifications, and then
  368. * submit them to be mixed according to spatial arrangement etc.
  369. *
  370. * Properties include: -
  371. *
  372. * Gain AL_GAIN ALfloat
  373. * Min Gain AL_MIN_GAIN ALfloat
  374. * Max Gain AL_MAX_GAIN ALfloat
  375. * Position AL_POSITION ALfloat[3]
  376. * Velocity AL_VELOCITY ALfloat[3]
  377. * Direction AL_DIRECTION ALfloat[3]
  378. * Head Relative Mode AL_SOURCE_RELATIVE ALint (AL_TRUE or AL_FALSE)
  379. * Reference Distance AL_REFERENCE_DISTANCE ALfloat
  380. * Max Distance AL_MAX_DISTANCE ALfloat
  381. * RollOff Factor AL_ROLLOFF_FACTOR ALfloat
  382. * Inner Angle AL_CONE_INNER_ANGLE ALint or ALfloat
  383. * Outer Angle AL_CONE_OUTER_ANGLE ALint or ALfloat
  384. * Cone Outer Gain AL_CONE_OUTER_GAIN ALint or ALfloat
  385. * Pitch AL_PITCH ALfloat
  386. * Looping AL_LOOPING ALint (AL_TRUE or AL_FALSE)
  387. * MS Offset AL_MSEC_OFFSET ALint or ALfloat
  388. * Byte Offset AL_BYTE_OFFSET ALint or ALfloat
  389. * Sample Offset AL_SAMPLE_OFFSET ALint or ALfloat
  390. * Attached Buffer AL_BUFFER ALint
  391. * State (Query only) AL_SOURCE_STATE ALint
  392. * Buffers Queued (Query only) AL_BUFFERS_QUEUED ALint
  393. * Buffers Processed (Query only) AL_BUFFERS_PROCESSED ALint
  394. *)
  395. (* Create Source objects *)
  396. procedure alGenSources(n: ALsizei; sources: PALuint); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  397. (* Delete Source objects *)
  398. procedure alDeleteSources(n: ALsizei; const sources: PALuint); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  399. (* Verify a handle is a valid Source *)
  400. function alIsSource(sid: ALuint): ALboolean; cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  401. (*
  402. * Set Source parameters
  403. *)
  404. procedure alSourcef(sid: ALuint; param: ALenum; value: ALfloat); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  405. procedure alSource3f(sid: ALuint; param: ALenum; value1, value2, value3: ALfloat); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  406. procedure alSourcefv(sid: ALuint; param: ALenum; const values: PALfloat); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  407. procedure alSourcei(sid: ALuint; param: ALenum; value: ALint); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  408. procedure alSource3i(sid: ALuint; param: ALenum; value1, value2, value3: ALint); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  409. procedure alSourceiv(sid: ALuint; param: ALenum; const values: PALint); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  410. (*
  411. * Get Source parameters
  412. *)
  413. procedure alGetSourcef(sid: ALuint; param: ALenum; var value: ALfloat); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  414. procedure alGetSource3f(sid: ALuint; param: ALenum; var value1, value2, value3: ALfloat); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  415. procedure alGetSourcefv(sid: ALuint; param: ALenum; values: PALfloat); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  416. procedure alGetSourcei(sid: ALuint; param: ALenum; var value: ALint); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  417. procedure alGetSource3i(sid: ALuint; param: ALenum; var value1, value2, value3: ALint); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  418. procedure alGetSourceiv(sid: ALuint; param: ALenum; values: PALint); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  419. (*
  420. * Source vector based playback calls
  421. *)
  422. (* Play, replay, or resume (if paused) a list of Sources *)
  423. procedure alSourcePlayv(ns: ALsizei; const sids: PALuint); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  424. (* Stop a list of Sources *)
  425. procedure alSourceStopv(ns: ALsizei; const sids: PALuint); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  426. (* Rewind a list of Sources *)
  427. procedure alSourceRewindv(ns: ALsizei; const sids: PALuint); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  428. (* Pause a list of Sources *)
  429. procedure alSourcePausev(ns: ALsizei; const sids: PALuint); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  430. (*
  431. * Source based playback calls
  432. *)
  433. (* Play, replay, or resume a Source *)
  434. procedure alSourcePlay(sid: ALuint); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  435. (* Stop a Source *)
  436. procedure alSourceStop(sid: ALuint); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  437. (* Rewind a Source (set playback postiton to beginning) *)
  438. procedure alSourceRewind(sid: ALuint); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  439. (* Pause a Source *)
  440. procedure alSourcePause(sid: ALuint); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  441. (*
  442. * Source Queuing
  443. *)
  444. procedure alSourceQueueBuffers(sid: ALuint; numEntries: ALsizei; const bids: PALuint); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  445. procedure alSourceUnqueueBuffers(sid: ALuint; numEntries: ALsizei; bids: PALuint); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  446. (**
  447. * BUFFER
  448. * Buffer objects are storage space for sample data.
  449. * Buffers are referred to by Sources. One Buffer can be used
  450. * by multiple Sources.
  451. *
  452. * Properties include: -
  453. *
  454. * Frequency (Query only) AL_FREQUENCY ALint
  455. * Size (Query only) AL_SIZE ALint
  456. * Bits (Query only) AL_BITS ALint
  457. * Channels (Query only) AL_CHANNELS ALint
  458. *)
  459. (* Create Buffer objects *)
  460. procedure alGenBuffers(n: ALsizei; buffers: PALuint); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  461. (* Delete Buffer objects *)
  462. procedure alDeleteBuffers(n: ALsizei; const buffers: PALuint); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  463. (* Verify a handle is a valid Buffer *)
  464. function alIsBuffer(bid: ALuint): ALboolean; cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  465. (* Specify the data to be copied into a buffer *)
  466. procedure alBufferData(bid: ALuint; format: ALenum; data: PALvoid; size: ALsizei; freq: ALsizei); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  467. (*
  468. * Set Buffer parameters
  469. *)
  470. procedure alBufferf(bid: ALuint; param: ALenum; value: ALfloat); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  471. procedure alBuffer3f(bid: ALuint; param: ALenum; value1, value2, value3: ALfloat); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  472. procedure alBufferfv(bid: ALuint; param: ALenum; const values: PALfloat); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  473. procedure alBufferi(bid: ALuint; param: ALenum; value: ALint); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  474. procedure alBuffer3i(bid: ALuint; param: ALenum; value1, value2, value3: ALint); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  475. procedure alBufferiv(bid: ALuint; param: ALenum; const values: ALint); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  476. (*
  477. * Get Buffer parameters
  478. *)
  479. procedure alGetBufferf(bid: ALuint; param: ALenum; var value: ALfloat); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  480. procedure alGetBuffer3f(bid: ALuint; param: ALenum; var value1, value2, value3: ALfloat); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  481. procedure alGetBufferfv(bid: ALuint; param: ALenum; values: PALfloat); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  482. procedure alGetBufferi(bid: ALuint; param: ALenum; var value: ALint); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  483. procedure alGetBuffer3i(bid: ALuint; param: ALenum; var value1, value2, value3: ALint); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  484. procedure alGetBufferiv(bid: ALuint; param: ALenum; values: ALint); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  485. (*
  486. * Global Parameters
  487. *)
  488. procedure alDopplerFactor(value: ALfloat); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  489. procedure alDopplerVelocity(value: ALfloat); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  490. procedure alSpeedOfSound(value: ALfloat); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  491. procedure alDistanceModel(distanceModel: ALenum); cdecl; external {$IFDEF DYNLINK}openallib{$ENDIF};
  492. (*
  493. * Pointer-to-function types, useful for dynamically getting AL entry points.
  494. *)
  495. {
  496. type
  497. LPALENABLE = procedure( ALenum capability ); cdecl;
  498. LPALDISABLE = procedure( ALenum capability ); cdecl;
  499. LPALISENABLED = function( ALenum capability ): ALboolean; cdecl;
  500. LPALGETSTRING = function( ALenum param ): PALchar; cdecl;
  501. LPALGETBOOLEANV = procedure( ALenum param, ALboolean* data ); cdecl;
  502. LPALGETINTEGERV = procedure( ALenum param, ALint* data ); cdecl;
  503. LPALGETFLOATV = procedure( ALenum param, ALfloat* data ); cdecl;
  504. LPALGETDOUBLEV = procedure( ALenum param, ALdouble* data ); cdecl;
  505. LPALGETBOOLEAN = function( ALenum param ): ALboolean; cdecl;
  506. LPALGETINTEGER = function( ALenum param ): ALint; cdecl;
  507. LPALGETFLOAT = function( ALenum param ): ALfloat; cdecl;
  508. LPALGETDOUBLE = function( ALenum param ): ALdouble; cdecl;
  509. LPALGETERROR = function( void ): ALenum; cdecl;
  510. LPALISEXTENSIONPRESENT = function(const ALchar* extname ): ALboolean; cdecl;
  511. LPALGETPROCADDRESS = function( const ALchar* fname ): pointer; cdecl;
  512. LPALGETENUMVALUE = function( const ALchar* ename ): ALenum; cdecl;
  513. LPALLISTENERF = procedure( ALenum param, ALfloat value ); cdecl;
  514. LPALLISTENER3F = procedure( ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 ); cdecl;
  515. LPALLISTENERFV = procedure( ALenum param, const ALfloat* values ); cdecl;
  516. LPALLISTENERI = procedure( ALenum param, ALint value ); cdecl;
  517. LPALLISTENER3I = procedure( ALenum param, ALint value1, ALint value2, ALint value3 ); cdecl;
  518. LPALLISTENERIV = procedure( ALenum param, const ALint* values ); cdecl;
  519. LPALGETLISTENERF = procedure( ALenum param, ALfloat* value ); cdecl;
  520. LPALGETLISTENER3F = procedure( ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3 ); cdecl;
  521. LPALGETLISTENERFV = procedure( ALenum param, ALfloat* values ); cdecl;
  522. LPALGETLISTENERI = procedure( ALenum param, ALint* value ); cdecl;
  523. LPALGETLISTENER3I = procedure( ALenum param, ALint *value1, ALint *value2, ALint *value3 ); cdecl;
  524. LPALGETLISTENERIV = procedure( ALenum param, ALint* values ); cdecl;
  525. LPALGENSOURCES = procedure( ALsizei n, ALuint* sources ); cdecl;
  526. LPALDELETESOURCES = procedure( ALsizei n, const ALuint* sources ); cdecl;
  527. LPALISSOURCE = function( ALuint sid ): ALboolean; cdecl;
  528. LPALSOURCEF = procedure( ALuint sid, ALenum param, ALfloat value); cdecl;
  529. LPALSOURCE3F = procedure( ALuint sid, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 ); cdecl;
  530. LPALSOURCEFV = procedure( ALuint sid, ALenum param, const ALfloat* values ); cdecl;
  531. LPALSOURCEI = procedure( ALuint sid, ALenum param, ALint value); cdecl;
  532. LPALSOURCE3I = procedure( ALuint sid, ALenum param, ALint value1, ALint value2, ALint value3 ); cdecl;
  533. LPALSOURCEIV = procedure( ALuint sid, ALenum param, const ALint* values ); cdecl;
  534. LPALGETSOURCEF = procedure( ALuint sid, ALenum param, ALfloat* value ); cdecl;
  535. LPALGETSOURCE3F = procedure( ALuint sid, ALenum param, ALfloat* value1, ALfloat* value2, ALfloat* value3); cdecl;
  536. LPALGETSOURCEFV = procedure( ALuint sid, ALenum param, ALfloat* values ); cdecl;
  537. LPALGETSOURCEI = procedure( ALuint sid, ALenum param, ALint* value ); cdecl;
  538. LPALGETSOURCE3I = procedure( ALuint sid, ALenum param, ALint* value1, ALint* value2, ALint* value3); cdecl;
  539. LPALGETSOURCEIV = procedure( ALuint sid, ALenum param, ALint* values ); cdecl;
  540. LPALSOURCEPLAYV = procedure( ALsizei ns, const ALuint *sids ); cdecl;
  541. LPALSOURCESTOPV = procedure( ALsizei ns, const ALuint *sids ); cdecl;
  542. LPALSOURCEREWINDV = procedure( ALsizei ns, const ALuint *sids ); cdecl;
  543. LPALSOURCEPAUSEV = procedure( ALsizei ns, const ALuint *sids ); cdecl;
  544. LPALSOURCEPLAY = procedure( ALuint sid ); cdecl;
  545. LPALSOURCESTOP = procedure( ALuint sid ); cdecl;
  546. LPALSOURCEREWIND = procedure( ALuint sid ); cdecl;
  547. LPALSOURCEPAUSE = procedure( ALuint sid ); cdecl;
  548. LPALSOURCEQUEUEBUFFERS = procedure(ALuint sid, ALsizei numEntries, const ALuint *bids ); cdecl;
  549. LPALSOURCEUNQUEUEBUFFERS = procedure(ALuint sid, ALsizei numEntries, ALuint *bids ); cdecl;
  550. LPALGENBUFFERS = procedure( ALsizei n, ALuint* buffers ); cdecl;
  551. LPALDELETEBUFFERS = procedure( ALsizei n, const ALuint* buffers ); cdecl;
  552. LPALISBUFFER = function( ALuint bid ): ALboolean; cdecl;
  553. LPALBUFFERDATA = procedure( ALuint bid, ALenum format, const ALvoid* data, ALsizei size, ALsizei freq ); cdecl;
  554. LPALBUFFERF = procedure( ALuint bid, ALenum param, ALfloat value); cdecl;
  555. LPALBUFFER3F = procedure( ALuint bid, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 ); cdecl;
  556. LPALBUFFERFV = procedure( ALuint bid, ALenum param, const ALfloat* values ); cdecl;
  557. LPALBUFFERI = procedure( ALuint bid, ALenum param, ALint value); cdecl;
  558. LPALBUFFER3I = procedure( ALuint bid, ALenum param, ALint value1, ALint value2, ALint value3 ); cdecl;
  559. LPALBUFFERIV = procedure( ALuint bid, ALenum param, const ALint* values ); cdecl;
  560. LPALGETBUFFERF = procedure( ALuint bid, ALenum param, ALfloat* value ); cdecl;
  561. LPALGETBUFFER3F = procedure( ALuint bid, ALenum param, ALfloat* value1, ALfloat* value2, ALfloat* value3); cdecl;
  562. LPALGETBUFFERFV = procedure( ALuint bid, ALenum param, ALfloat* values ); cdecl;
  563. LPALGETBUFFERI = procedure( ALuint bid, ALenum param, ALint* value ); cdecl;
  564. LPALGETBUFFER3I = procedure( ALuint bid, ALenum param, ALint* value1, ALint* value2, ALint* value3); cdecl;
  565. LPALGETBUFFERIV = procedure( ALuint bid, ALenum param, ALint* values ); cdecl;
  566. LPALDOPPLERFACTOR = procedure( ALfloat value ); cdecl;
  567. LPALDOPPLERVELOCITY = procedure( ALfloat value ); cdecl;
  568. LPALSPEEDOFSOUND = procedure( ALfloat value ); cdecl;
  569. LPALDISTANCEMODEL = procedure( ALenum distanceModel ); cdecl;
  570. }