altypes.h 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334
  1. #ifndef _ALTYPES_H_
  2. #define _ALTYPES_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. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. /** OpenAL boolean type. */
  26. typedef char ALboolean;
  27. /** OpenAL 8bit signed byte. */
  28. typedef char ALbyte;
  29. /** OpenAL 8bit unsigned byte. */
  30. typedef unsigned char ALubyte;
  31. /** OpenAL 16bit signed short integer type. */
  32. typedef short ALshort;
  33. /** OpenAL 16bit unsigned short integer type. */
  34. typedef unsigned short ALushort;
  35. /** OpenAL 32bit unsigned integer type. */
  36. typedef unsigned ALuint;
  37. /** OpenAL 32bit signed integer type. */
  38. typedef int ALint;
  39. /** OpenAL 32bit floating point type. */
  40. typedef float ALfloat;
  41. /** OpenAL 64bit double point type. */
  42. typedef double ALdouble;
  43. /** OpenAL 32bit type. */
  44. typedef unsigned int ALsizei;
  45. /** OpenAL void type */
  46. typedef void ALvoid;
  47. /** OpenAL enumerations. */
  48. typedef int ALenum;
  49. /* Bad value. */
  50. #define AL_INVALID (-1)
  51. /* Disable value. */
  52. #define AL_NONE 0
  53. /* Boolean False. */
  54. #define AL_FALSE 0
  55. /* Boolean True. */
  56. #define AL_TRUE 1
  57. /**
  58. * Indicate the type of AL_SOURCE.
  59. * Sources can be spatialized
  60. */
  61. #define AL_SOURCE_TYPE 0x200
  62. /** Indicate source has absolute coordinates. */
  63. #define AL_SOURCE_ABSOLUTE 0x201
  64. /** Indicate Source has listener relative coordinates. */
  65. #define AL_SOURCE_RELATIVE 0x202
  66. /**
  67. * Directional source, inner cone angle, in degrees.
  68. * Range: [0-360]
  69. * Default: 360
  70. */
  71. #define AL_CONE_INNER_ANGLE 0x1001
  72. /**
  73. * Directional source, outer cone angle, in degrees.
  74. * Range: [0-360]
  75. * Default: 360
  76. */
  77. #define AL_CONE_OUTER_ANGLE 0x1002
  78. /**
  79. * Specify the pitch to be applied, either at source,
  80. * or on mixer results, at listener.
  81. * Range: [0.5-2.0]
  82. * Default: 1.0
  83. */
  84. #define AL_PITCH 0x1003
  85. /**
  86. * Specify the current location in three dimensional space.
  87. * OpenAL, like OpenGL, uses a right handed coordinate system,
  88. * where in a frontal default view X (thumb) points right,
  89. * Y points up (index finger), and Z points towards the
  90. * viewer/camera (middle finger).
  91. * To switch from a left handed coordinate system, flip the
  92. * sign on the Z coordinate.
  93. * Listener position is always in the world coordinate system.
  94. */
  95. #define AL_POSITION 0x1004
  96. /** Specify the current direction as forward vector. */
  97. #define AL_DIRECTION 0x1005
  98. /** Specify the current velocity in three dimensional space. */
  99. #define AL_VELOCITY 0x1006
  100. /**
  101. * Indicate whether source has to loop infinite.
  102. * Type: ALboolean
  103. * Range: [AL_TRUE, AL_FALSE]
  104. * Default: AL_FALSE
  105. */
  106. #define AL_LOOPING 0x1007
  107. /**
  108. * Indicate the buffer to provide sound samples.
  109. * Type: ALuint.
  110. * Range: any valid Buffer id.
  111. */
  112. #define AL_BUFFER 0x1009
  113. /**
  114. * Indicate the gain (volume amplification) applied.
  115. * Type: ALfloat.
  116. * Range: ]0.0- ]
  117. * A value of 1.0 means un-attenuated/unchanged.
  118. * Each division by 2 equals an attenuation of -6dB.
  119. * Each multiplicaton with 2 equals an amplification of +6dB.
  120. * A value of 0.0 is meaningless with respect to a logarithmic
  121. * scale; it is interpreted as zero volume - the channel
  122. * is effectively disabled.
  123. */
  124. #define AL_GAIN 0x100A
  125. /**
  126. * Indicate minimum source attenuation.
  127. * Type: ALfloat
  128. * Range: [0.0 - 1.0]
  129. */
  130. #define AL_MIN_GAIN 0x100D
  131. /**
  132. * Indicate maximum source attenuation.
  133. * Type: ALfloat
  134. * Range: [0.0 - 1.0]
  135. */
  136. #define AL_MAX_GAIN 0x100E
  137. /**
  138. * Specify the current orientation.
  139. * Type: ALfv6 (at/up)
  140. * Range: N/A
  141. */
  142. #define AL_ORIENTATION 0x100F
  143. /* byte offset into source (in canon format). -1 if source
  144. * is not playing. Don't set this, get this.
  145. *
  146. * Type: ALfloat
  147. * Range: [0.0 - ]
  148. * Default: 1.0
  149. */
  150. #define AL_REFERENCE_DISTANCE 0x1020
  151. /**
  152. * Indicate the rolloff factor for the source.
  153. * Type: ALfloat
  154. * Range: [0.0 - ]
  155. * Default: 1.0
  156. */
  157. #define AL_ROLLOFF_FACTOR 0x1021
  158. /**
  159. * Indicate the gain (volume amplification) applied.
  160. * Type: ALfloat.
  161. * Range: ]0.0- ]
  162. * A value of 1.0 means un-attenuated/unchanged.
  163. * Each division by 2 equals an attenuation of -6dB.
  164. * Each multiplicaton with 2 equals an amplification of +6dB.
  165. * A value of 0.0 is meaningless with respect to a logarithmic
  166. * scale; it is interpreted as zero volume - the channel
  167. * is effectively disabled.
  168. */
  169. #define AL_CONE_OUTER_GAIN 0x1022
  170. /**
  171. * Specify the maximum distance.
  172. * Type: ALfloat
  173. * Range: [0.0 - ]
  174. */
  175. #define AL_MAX_DISTANCE 0x1023
  176. /**
  177. * Specify the channel mask. (Creative)
  178. * Type: ALuint
  179. * Range: [0 - 255]
  180. */
  181. #define AL_CHANNEL_MASK 0x3000
  182. /**
  183. * Source state information
  184. */
  185. #define AL_SOURCE_STATE 0x1010
  186. #define AL_INITIAL 0x1011
  187. #define AL_PLAYING 0x1012
  188. #define AL_PAUSED 0x1013
  189. #define AL_STOPPED 0x1014
  190. /**
  191. * Buffer Queue params
  192. */
  193. #define AL_BUFFERS_QUEUED 0x1015
  194. #define AL_BUFFERS_PROCESSED 0x1016
  195. /** Sound buffers: format specifier. */
  196. #define AL_FORMAT_MONO8 0x1100
  197. #define AL_FORMAT_MONO16 0x1101
  198. #define AL_FORMAT_STEREO8 0x1102
  199. #define AL_FORMAT_STEREO16 0x1103
  200. /**
  201. * Sound buffers: frequency, in units of Hertz [Hz].
  202. * This is the number of samples per second. Half of the
  203. * sample frequency marks the maximum significant
  204. * frequency component.
  205. */
  206. #define AL_FREQUENCY 0x2001
  207. #define AL_BITS 0x2002
  208. #define AL_CHANNELS 0x2003
  209. #define AL_SIZE 0x2004
  210. #define AL_DATA 0x2005
  211. /**
  212. * Buffer state.
  213. *
  214. * Not supported for public use (yet).
  215. */
  216. #define AL_UNUSED 0x2010
  217. #define AL_PENDING 0x2011
  218. #define AL_PROCESSED 0x2012
  219. /** Errors: No Error. */
  220. #define AL_NO_ERROR AL_FALSE
  221. /**
  222. * Illegal name passed as an argument to an AL call.
  223. */
  224. #define AL_INVALID_NAME 0xA001
  225. /**
  226. * Illegal enum passed as an argument to an AL call.
  227. */
  228. #define AL_INVALID_ENUM 0xA002
  229. /**
  230. * Illegal value passed as an argument to an AL call.
  231. * Applies to parameter values, but not to enumerations.
  232. */
  233. #define AL_INVALID_VALUE 0xA003
  234. /**
  235. * A function was called at inappropriate time,
  236. * or in an inappropriate way, causing an illegal state.
  237. * This can be an incompatible ALenum, object ID,
  238. * and/or function.
  239. */
  240. #define AL_INVALID_OPERATION 0xA004
  241. /**
  242. * A function could not be completed,
  243. * because there is not enough memory available.
  244. */
  245. #define AL_OUT_OF_MEMORY 0xA005
  246. /** Context strings: Vendor Name. */
  247. #define AL_VENDOR 0xB001
  248. #define AL_VERSION 0xB002
  249. #define AL_RENDERER 0xB003
  250. #define AL_EXTENSIONS 0xB004
  251. /** Global tweakage. */
  252. /**
  253. * Doppler scale. Default 1.0
  254. */
  255. #define AL_DOPPLER_FACTOR 0xC000
  256. /**
  257. * Doppler velocity. Default 1.0
  258. */
  259. #define AL_DOPPLER_VELOCITY 0xC001
  260. /**
  261. * Distance model. Default AL_INVERSE_DISTANCE_CLAMPED
  262. */
  263. #define AL_DISTANCE_MODEL 0xD000
  264. /** Distance models. */
  265. #define AL_INVERSE_DISTANCE 0xD001
  266. #define AL_INVERSE_DISTANCE_CLAMPED 0xD002
  267. /**
  268. * enables
  269. */
  270. #ifdef __cplusplus
  271. }
  272. #endif
  273. #endif