al.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523
  1. #ifndef __al_h_
  2. #define __al_h_
  3. /**
  4. * OpenAL cross platform audio library
  5. * Copyright (C) 1999-2000 by authors.
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Library General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2 of the License, or (at your option) any later version.
  10. *
  11. * This library is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Library General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Library General Public
  17. * License along with this library; if not, write to the
  18. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  19. * Boston, MA 02111-1307, USA.
  20. * Or go to http://www.gnu.org/copyleft/lgpl.html
  21. */
  22. #include <AL/altypes.h>
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. #ifdef _WIN32
  27. #define ALAPI __declspec(dllexport)
  28. #define ALAPIENTRY __cdecl
  29. #define AL_CALLBACK
  30. #else /* _WIN32 */
  31. #define ALAPI
  32. #define ALAPIENTRY
  33. #define AL_CALLBACK
  34. #endif /* _WIN32 */
  35. #ifndef AL_NO_PROTOTYPES
  36. /**
  37. * OpenAL Maintenance Functions
  38. * State Management and Query.
  39. * Error Handling.
  40. * Extension Support.
  41. */
  42. /** Renderer State management. */
  43. ALAPI void ALAPIENTRY alEnable( ALenum capability );
  44. ALAPI void ALAPIENTRY alDisable( ALenum capability );
  45. ALAPI ALboolean ALAPIENTRY alIsEnabled( ALenum capability );
  46. /** Application preferences for driver performance choices. */
  47. ALAPI void ALAPIENTRY alHint( ALenum target, ALenum mode );
  48. /** State retrieval. */
  49. ALAPI ALboolean ALAPIENTRY alGetBoolean( ALenum param );
  50. /** State retrieval. */
  51. ALAPI ALint ALAPIENTRY alGetInteger( ALenum param );
  52. /** State retrieval. */
  53. ALAPI ALfloat ALAPIENTRY alGetFloat( ALenum param );
  54. /** State retrieval. */
  55. ALAPI ALdouble ALAPIENTRY alGetDouble( ALenum param );
  56. /** State retrieval. */
  57. ALAPI void ALAPIENTRY alGetBooleanv( ALenum param, ALboolean* data );
  58. /** State retrieval. */
  59. ALAPI void ALAPIENTRY alGetIntegerv( ALenum param, ALint* data );
  60. /** State retrieval. */
  61. ALAPI void ALAPIENTRY alGetFloatv( ALenum param, ALfloat* data );
  62. /** State retrieval. */
  63. ALAPI void ALAPIENTRY alGetDoublev( ALenum param, ALdouble* data );
  64. /** State retrieval. */
  65. ALAPI const ALubyte* ALAPIENTRY alGetString( ALenum param );
  66. /**
  67. * Error support.
  68. * Obtain the most recent error generated in the AL state machine.
  69. */
  70. ALAPI ALenum ALAPIENTRY alGetError( ALvoid );
  71. /**
  72. * Extension support.
  73. * Obtain the address of a function (usually an extension)
  74. * with the name fname. All addresses are context-independent.
  75. */
  76. ALAPI ALboolean ALAPIENTRY alIsExtensionPresent( const ALubyte* fname );
  77. /**
  78. * Extension support.
  79. * Obtain the address of a function (usually an extension)
  80. * with the name fname. All addresses are context-independent.
  81. */
  82. ALAPI void* ALAPIENTRY alGetProcAddress( const ALubyte* fname );
  83. /**
  84. * Extension support.
  85. * Obtain the integer value of an enumeration (usually an extension) with the name ename.
  86. */
  87. ALAPI ALenum ALAPIENTRY alGetEnumValue( const ALubyte* ename );
  88. /**
  89. * LISTENER
  90. * Listener is the sample position for a given context.
  91. * The multi-channel (usually stereo) output stream generated
  92. * by the mixer is parametrized by this Listener object:
  93. * its position and velocity relative to Sources, within
  94. * occluder and reflector geometry.
  95. */
  96. /**
  97. *
  98. * Listener Gain: default 1.0f.
  99. */
  100. ALAPI void ALAPIENTRY alListenerf( ALenum pname, ALfloat param );
  101. /**
  102. *
  103. * Listener Position.
  104. * Listener Velocity.
  105. */
  106. ALAPI void ALAPIENTRY alListener3f( ALenum pname, ALfloat param1,
  107. ALfloat param2,
  108. ALfloat param3 );
  109. /**
  110. *
  111. * Listener Position: ALfloat[3]
  112. * Listener Velocity: ALfloat[3]
  113. * Listener Orientation: ALfloat[6] (forward and up vector).
  114. */
  115. ALAPI void ALAPIENTRY alListenerfv( ALenum pname, ALfloat* param );
  116. /*
  117. * Retrieve listener information.
  118. */
  119. ALAPI void ALAPIENTRY alGetListeneri( ALenum pname, ALint* value );
  120. ALAPI void ALAPIENTRY alGetListenerf( ALenum pname, ALfloat* values );
  121. ALAPI void ALAPIENTRY alGetListenerfv( ALenum pname, ALfloat* values );
  122. /**
  123. * SOURCE
  124. * Source objects are by default localized. Sources
  125. * take the PCM data provided in the specified Buffer,
  126. * apply Source-specific modifications, and then
  127. * submit them to be mixed according to spatial
  128. * arrangement etc.
  129. */
  130. /** Create Source objects. */
  131. ALAPI void ALAPIENTRY alGenSources( ALsizei n, ALuint* sources );
  132. /** Delete Source objects. */
  133. ALAPI void ALAPIENTRY alDeleteSources( ALsizei n, ALuint* sources );
  134. /** Verify a handle is a valid Source. */
  135. ALAPI ALboolean ALAPIENTRY alIsSource( ALuint sid );
  136. /** Set an integer parameter for a Source object. */
  137. ALAPI void ALAPIENTRY alSourcei( ALuint sid, ALenum param, ALint value );
  138. ALAPI void ALAPIENTRY alSourcef( ALuint sid, ALenum param, ALfloat value );
  139. ALAPI void ALAPIENTRY alSource3f( ALuint sid, ALenum param, ALfloat v1, ALfloat v2, ALfloat v3 );
  140. ALAPI void ALAPIENTRY alSourcefv( ALuint sid, ALenum param, ALfloat* values );
  141. /** Get an integer parameter for a Source object. */
  142. ALAPI void ALAPIENTRY alGetSourcei( ALuint sid, ALenum pname, ALint* value );
  143. ALAPI void ALAPIENTRY alGetSourcef( ALuint sid, ALenum pname, ALfloat* value );
  144. ALAPI void ALAPIENTRY alGetSourcefv( ALuint sid, ALenum pname, ALfloat* values );
  145. ALAPI void ALAPIENTRY alSourcePlayv( ALuint ns, ALuint *ids );
  146. ALAPI void ALAPIENTRY alSourceStopv( ALuint ns, ALuint *ids );
  147. /** Activate a source, start replay. */
  148. ALAPI void ALAPIENTRY alSourcePlay( ALuint sid );
  149. /**
  150. * Pause a source,
  151. * temporarily remove it from the mixer list.
  152. */
  153. ALAPI void ALAPIENTRY alSourcePause( ALuint sid );
  154. /**
  155. * Stop a source,
  156. * temporarily remove it from the mixer list,
  157. * and reset its internal state to pre-Play.
  158. * To remove a Source completely, it has to be
  159. * deleted following Stop, or before Play.
  160. */
  161. ALAPI void ALAPIENTRY alSourceStop( ALuint sid );
  162. /**
  163. * BUFFER
  164. * Buffer objects are storage space for sample data.
  165. * Buffers are referred to by Sources. There can be more than
  166. * one Source using the same Buffer data. If Buffers have
  167. * to be duplicated on a per-Source basis, the driver has to
  168. * take care of allocation, copying, and deallocation as well
  169. * as propagating buffer data changes.
  170. */
  171. /** Buffer object generation. */
  172. ALAPI void ALAPIENTRY alGenBuffers( ALsizei n, ALuint* samples );
  173. ALAPI void ALAPIENTRY alDeleteBuffers( ALsizei n, ALuint* samples );
  174. ALAPI ALboolean ALAPIENTRY alIsBuffer( ALuint buffer );
  175. /**
  176. * Specify the data to be filled into a buffer.
  177. */
  178. ALAPI void ALAPIENTRY alBufferData( ALuint buffer,
  179. ALenum format,
  180. ALvoid* data,
  181. ALsizei size,
  182. ALsizei freq );
  183. /**
  184. * Specify data to be filled into a looping buffer.
  185. * This takes the current position at the time of the
  186. * call, and returns the number of samples written.
  187. */
  188. ALsizei ALAPIENTRY alBufferAppendData( ALuint buffer,
  189. ALenum format,
  190. ALvoid* data,
  191. ALsizei size,
  192. ALsizei freq );
  193. ALAPI void ALAPIENTRY alGetBufferi( ALuint buffer, ALenum param, ALint* value );
  194. ALAPI void ALAPIENTRY alGetBufferf( ALuint buffer, ALenum param, ALfloat* value );
  195. /**
  196. * Frequency Domain Filters are band filters.
  197. * Attenuation in Media (distance based)
  198. * Reflection Material
  199. * Occlusion Material (separating surface)
  200. *
  201. * Temporal Domain Filters:
  202. * Early Reflections
  203. * Late Reverb
  204. *
  205. */
  206. /**
  207. * EXTENSION: IASIG Level 2 Environment.
  208. * Environment object generation.
  209. * This is an EXTension that describes the Environment/Reverb
  210. * properties according to IASIG Level 2 specifications.
  211. */
  212. /**
  213. * Allocate n environment ids and store them in the array environs.
  214. * Returns the number of environments actually allocated.
  215. */
  216. ALAPI ALsizei ALAPIENTRY alGenEnvironmentIASIG( ALsizei n, ALuint* environs );
  217. ALAPI void ALAPIENTRY alDeleteEnvironmentIASIG( ALsizei n, ALuint* environs );
  218. ALAPI ALboolean ALAPIENTRY alIsEnvironmentIASIG( ALuint environ );
  219. ALAPI void ALAPIENTRY alEnvironmentiIASIG( ALuint eid, ALenum param, ALint value );
  220. ALAPI void ALAPIENTRY alEnvironmentfIASIG( ALuint eid, ALenum param, ALfloat value );
  221. #else /* AL_NO_PROTOTYPES */
  222. //
  223. //
  224. ///** OpenAL Maintenance Functions */
  225. //
  226. // void (*alEnable)( ALenum capability );
  227. // void (*alDisable)( ALenum capability );
  228. // ALboolean (*alIsEnabled)( ALenum capability );
  229. // void (*alHint)( ALenum target, ALenum mode );
  230. // ALboolean (*alGetBoolean)( ALenum param );
  231. // ALint (*alGetInteger)( ALenum param );
  232. // ALfloat (*alGetFloat)( ALenum param );
  233. // ALdouble (*alGetDouble)( ALenum param );
  234. // void (*alGetBooleanv)( ALenum param,
  235. // ALboolean* data );
  236. // void (*alGetIntegerv)( ALenum param,
  237. // ALint* data );
  238. // void (*alGetFloatv)( ALenum param,
  239. // ALfloat* data );
  240. // void (*alGetDoublev)( ALenum param,
  241. // ALdouble* data );
  242. // const ALubyte* (*GetString)( ALenum param );
  243. // ALenum (*alGetError)( ALvoid );
  244. //
  245. // /**
  246. // * Extension support.
  247. // * Query existance of extension
  248. // */
  249. // ALboolean (*alIsExtensionPresent)(const ALubyte* fname );
  250. //
  251. // /**
  252. // * Extension support.
  253. // * Obtain the address of a function (usually an extension)
  254. // * with the name fname. All addresses are context-independent.
  255. // */
  256. // void* (*alGetProcAddress)( const ALubyte* fname );
  257. //
  258. //
  259. // /**
  260. // * Extension support.
  261. // * Obtain the integer value of an enumeration (usually an extension) with the name ename.
  262. // */
  263. // ALenum (*alGetEnumValue)( const ALubyte* ename );
  264. //
  265. ///**
  266. // * LISTENER
  267. // * Listener is the sample position for a given context.
  268. // * The multi-channel (usually stereo) output stream generated
  269. // * by the mixer is parametrized by this Listener object:
  270. // * its position and velocity relative to Sources, within
  271. // * occluder and reflector geometry.
  272. // */
  273. // /**
  274. // *
  275. // * Listener Gain: default 1.0f.
  276. // */
  277. // void (*alListenerf)( ALenum pname, ALfloat param );
  278. //
  279. // /**
  280. // *
  281. // * Listener Position.
  282. // * Listener Velocity.
  283. // */
  284. // void (*alListener3f)( ALenum pname,
  285. // ALfloat param1, ALfloat param2, ALfloat param3);
  286. //
  287. // /**
  288. // *
  289. // * Listener Position: ALfloat[3]
  290. // * Listener Velocity: ALfloat[3]
  291. // * Listener Orientation: ALfloat[6] (forward and up vector).
  292. // */
  293. // void (*alListenerfv)( ALenum pname, ALfloat* param );
  294. //
  295. ///**
  296. // * SOURCE
  297. // * Source objects are by default localized. Sources
  298. // * take the PCM data provided in the specified Buffer,
  299. // * apply Source-specific modifications, and then
  300. // * submit them to be mixed according to spatial
  301. // * arrangement etc.
  302. // */
  303. //
  304. // /** Create Source objects. */
  305. // void (*alGenSources)( ALsizei n, ALuint* sources );
  306. //
  307. // /** Delete Source objects. */
  308. // void (*alDeleteSources)( ALsizei n, ALuint* sources );
  309. //
  310. // /** Verify a handle is a valid Source. */
  311. // ALboolean (*alIsSource)( ALuint sid );
  312. //
  313. // /** Set an integer parameter for a Source object. */
  314. // void (*alSourcei)( ALuint sid, ALenum param, ALint value);
  315. //
  316. // /** Set a float parameter for a Source object. */
  317. // void (*alSourcef)( ALuint sid, ALenum param, ALfloat value);
  318. //
  319. // /** Set a 3-float parameter for a Source object. */
  320. // void (*alSource3f)( ALuint sid, ALenum param,
  321. // ALfloat v1, ALfloat v2, ALfloat v3 );
  322. //
  323. // /** Set a float vector parameter for a Source object. */
  324. // void (*alSourcefv)( ALuint sid, ALenum param,
  325. // ALfloat* values );
  326. //
  327. // /** Get an integer parameter for a Source object. */
  328. // void (*alGetSourcei)( ALuint sid,
  329. // ALenum pname, ALint* value );
  330. // /** Get a float parameter for a Source object. */
  331. // void (*alGetSourcef)( ALuint sid,
  332. // ALenum pname, ALfloat* value );
  333. // /** Get a float vector parameter for a Source object. */
  334. // void (*alGetSourcefv)( ALuint sid,
  335. // ALenum pname, ALfloat* values );
  336. //
  337. // /** Activate a source, start replay. */
  338. // void (*alSourcePlay)( ALuint sid );
  339. //
  340. // /**
  341. // * Pause a source,
  342. // * temporarily remove it from the mixer list.
  343. // */
  344. // void (*alSourcePause)( ALuint sid );
  345. //
  346. // /**
  347. // * Stop a source,
  348. // * temporarily remove it from the mixer list,
  349. // * and reset its internal state to pre-Play.
  350. // * To remove a Source completely, it has to be
  351. // * deleted following Stop, or before Play.
  352. // */
  353. // void (*alSourceStop)( ALuint sid );
  354. //
  355. ///**
  356. // * BUFFER
  357. // * Buffer objects are storage space for sample data.
  358. // * Buffers are referred to by Sources. There can be more than
  359. // * one Source using the same Buffer data. If Buffers have
  360. // * to be duplicated on a per-Source basis, the driver has to
  361. // * take care of allocation, copying, and deallocation as well
  362. // * as propagating buffer data changes.
  363. // */
  364. //
  365. // /** Buffer object generation. */
  366. // void (*alGenBuffers)( ALsizei n, ALuint* samples );
  367. // void (*alDeleteBuffers)( ALsizei n, ALuint* samples );
  368. // ALboolean (*alIsBuffer)( ALuint buffer );
  369. //
  370. // /**
  371. // * Specify the data to be filled into a buffer.
  372. // */
  373. // void (*alBufferData)( ALuint buffer,
  374. // ALenum format,
  375. // ALvoid* data,
  376. // ALsizei size,
  377. // ALsizei freq );
  378. //
  379. // /**
  380. // * Specify data to be filled into a looping buffer.
  381. // * This takes the current position at the time of the
  382. // * call, and returns the number of samples written.
  383. // */
  384. // ALsizei (*alBufferAppendData)( ALuint buffer,
  385. // ALenum format,
  386. // ALvoid* data,
  387. // ALsizei size,
  388. // ALsizei freq );
  389. // void (*alGetBufferi)( ALuint buffer,
  390. // ALenum param, ALint* value );
  391. // void (*alGetBufferf)( ALuint buffer,
  392. // ALenum param, ALfloat* value );
  393. //
  394. ///**
  395. // * EXTENSION: IASIG Level 2 Environment.
  396. // * Environment object generation.
  397. // * This is an EXTension that describes the Environment/Reverb
  398. // * properties according to IASIG Level 2 specifications.
  399. // */
  400. // /**
  401. // * Allocate n environment ids and store them in the array environs.
  402. // * Returns the number of environments actually allocated.
  403. // */
  404. // ALsizei (*alGenEnvironmentIASIG)( ALsizei n, ALuint* environs );
  405. // void (*alDeleteEnvironmentIASIG)(ALsizei n,
  406. // ALuint* environs);
  407. // ALboolean (*alIsEnvironmentIASIG)( ALuint environ );
  408. // void (*alEnvironmentiIASIG)( ALuint eid,
  409. // ALenum param, ALint value );
  410. // void (*alEnvironmentfIASIG)( ALuint eid,
  411. // ALenum param, ALuint value );
  412. //
  413. ///**
  414. // * Frequency Domain Filters are band filters.
  415. // * Attenuation in Media (distance based)
  416. // * Reflection Material
  417. // * Occlusion Material (separating surface)
  418. // *
  419. // * Temporal Domain Filters:
  420. // * Early Reflections
  421. // * Late Reverb
  422. // *
  423. // */
  424. //
  425. #endif /* AL_NO_PROTOTYPES */
  426. #ifdef __cplusplus
  427. } /* extern "C" */
  428. #endif
  429. #endif /* __al_h_ */