openalext.h 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  1. /*
  2. * (C) 2001-2012 Marmalade. All Rights Reserved.
  3. *
  4. * This document is protected by copyright, and contains information
  5. * proprietary to Marmalade.
  6. *
  7. * This file consists of source code released by Marmalade under
  8. * the terms of the accompanying End User License Agreement (EULA).
  9. * Please do not use this program/source code before you have read the
  10. * EULA and have agreed to be bound by its terms.
  11. */
  12. /*
  13. * WARNING: this is an autogenerated file and will be overwritten by
  14. * the extension interface script.
  15. */
  16. #ifndef S3E_EXT_OPENALEXT_H
  17. #define S3E_EXT_OPENALEXT_H
  18. #define AL_NONE 0
  19. /* Boolean False. */
  20. #define AL_FALSE 0
  21. /** Boolean True. */
  22. #define AL_TRUE 1
  23. /** Indicate Source has relative coordinates. */
  24. #define AL_SOURCE_RELATIVE 0x202
  25. /**
  26. * Directional source, inner cone angle, in degrees.
  27. * Range: [0-360]
  28. * Default: 360
  29. */
  30. #define AL_CONE_INNER_ANGLE 0x1001
  31. /**
  32. * Directional source, outer cone angle, in degrees.
  33. * Range: [0-360]
  34. * Default: 360
  35. */
  36. #define AL_CONE_OUTER_ANGLE 0x1002
  37. /**
  38. * Specify the pitch to be applied at source.
  39. * Range: [0.5-2.0]
  40. * Default: 1.0
  41. */
  42. #define AL_PITCH 0x1003
  43. /**
  44. * Specify the current location in three dimensional space.
  45. * OpenAL, like OpenGL, uses a right handed coordinate system,
  46. * where in a frontal default view X (thumb) points right,
  47. * Y points up (index finger), and Z points towards the
  48. * viewer/camera (middle finger).
  49. * To switch from a left handed coordinate system, flip the
  50. * sign on the Z coordinate.
  51. * Listener position is always in the world coordinate system.
  52. */
  53. #define AL_POSITION 0x1004
  54. /** Specify the current direction. */
  55. #define AL_DIRECTION 0x1005
  56. /** Specify the current velocity in three dimensional space. */
  57. #define AL_VELOCITY 0x1006
  58. /**
  59. * Indicate whether source is looping.
  60. * Type: ALboolean?
  61. * Range: [AL_TRUE, AL_FALSE]
  62. * Default: FALSE.
  63. */
  64. #define AL_LOOPING 0x1007
  65. /**
  66. * Indicate the buffer to provide sound samples.
  67. * Type: _ALuint.
  68. * Range: any valid Buffer id.
  69. */
  70. #define AL_BUFFER 0x1009
  71. /**
  72. * Indicate the gain (volume amplification) applied.
  73. * Type: _ALfloat.
  74. * Range: ]0.0- ]
  75. * A value of 1.0 means un-attenuated/unchanged.
  76. * Each division by 2 equals an attenuation of -6dB.
  77. * Each multiplicaton with 2 equals an amplification of +6dB.
  78. * A value of 0.0 is meaningless with respect to a logarithmic
  79. * scale; it is interpreted as zero volume - the channel
  80. * is effectively disabled.
  81. */
  82. #define AL_GAIN 0x100A
  83. /*
  84. * Indicate minimum source attenuation
  85. * Type: _ALfloat
  86. * Range: [0.0 - 1.0]
  87. *
  88. * Logarthmic
  89. */
  90. #define AL_MIN_GAIN 0x100D
  91. /**
  92. * Indicate maximum source attenuation
  93. * Type: _ALfloat
  94. * Range: [0.0 - 1.0]
  95. *
  96. * Logarthmic
  97. */
  98. #define AL_MAX_GAIN 0x100E
  99. /**
  100. * Indicate listener orientation.
  101. *
  102. * at/up
  103. */
  104. #define AL_ORIENTATION 0x100F
  105. /**
  106. * Source state information.
  107. */
  108. #define AL_SOURCE_STATE 0x1010
  109. #define AL_INITIAL 0x1011
  110. #define AL_PLAYING 0x1012
  111. #define AL_PAUSED 0x1013
  112. #define AL_STOPPED 0x1014
  113. /**
  114. * Buffer Queue params
  115. */
  116. #define AL_BUFFERS_QUEUED 0x1015
  117. #define AL_BUFFERS_PROCESSED 0x1016
  118. /**
  119. * Source buffer position information
  120. */
  121. #define AL_SEC_OFFSET 0x1024
  122. #define AL_SAMPLE_OFFSET 0x1025
  123. #define AL_BYTE_OFFSET 0x1026
  124. /*
  125. * Source type (Static, Streaming or undetermined)
  126. * Source is Static if a Buffer has been attached using AL_BUFFER
  127. * Source is Streaming if one or more Buffers have been attached using alSourceQueueBuffers
  128. * Source is undetermined when it has the NULL buffer attached
  129. */
  130. #define AL_SOURCE_TYPE 0x1027
  131. #define AL_STATIC 0x1028
  132. #define AL_STREAMING 0x1029
  133. #define AL_UNDETERMINED 0x1030
  134. /** Sound samples: format specifier. */
  135. #define AL_FORMAT_MONO8 0x1100
  136. #define AL_FORMAT_MONO16 0x1101
  137. #define AL_FORMAT_STEREO8 0x1102
  138. #define AL_FORMAT_STEREO16 0x1103
  139. /**
  140. * source specific reference distance
  141. * Type: _ALfloat
  142. * Range: 0.0 - +inf
  143. *
  144. * At 0.0, no distance attenuation occurs. Default is
  145. * 1.0.
  146. */
  147. #define AL_REFERENCE_DISTANCE 0x1020
  148. /**
  149. * source specific rolloff factor
  150. * Type: _ALfloat
  151. * Range: 0.0 - +inf
  152. *
  153. */
  154. #define AL_ROLLOFF_FACTOR 0x1021
  155. /**
  156. * Directional source, outer cone gain.
  157. *
  158. * Default: 0.0
  159. * Range: [0.0 - 1.0]
  160. * Logarithmic
  161. */
  162. #define AL_CONE_OUTER_GAIN 0x1022
  163. /**
  164. * Indicate distance above which sources are not
  165. * attenuated using the inverse clamped distance model.
  166. *
  167. * Default: +inf
  168. * Type: _ALfloat
  169. * Range: 0.0 - +inf
  170. */
  171. #define AL_MAX_DISTANCE 0x1023
  172. /**
  173. * Sound samples: frequency, in units of Hertz [Hz].
  174. * This is the number of samples per second. Half of the
  175. * sample frequency marks the maximum significant
  176. * frequency component.
  177. */
  178. #define AL_FREQUENCY 0x2001
  179. #define AL_BITS 0x2002
  180. #define AL_CHANNELS 0x2003
  181. #define AL_SIZE 0x2004
  182. /**
  183. * Buffer state.
  184. *
  185. * Not supported for public use (yet).
  186. */
  187. #define AL_UNUSED 0x2010
  188. #define AL_PENDING 0x2011
  189. #define AL_PROCESSED 0x2012
  190. /** Errors: No Error. */
  191. #define AL_NO_ERROR 0
  192. /**
  193. * Invalid Name paramater passed to AL call.
  194. */
  195. #define AL_INVALID_NAME 0xA001
  196. /**
  197. * Invalid parameter passed to AL call.
  198. */
  199. #define AL_INVALID_ENUM 0xA002
  200. /**
  201. * Invalid enum parameter value.
  202. */
  203. #define AL_INVALID_VALUE 0xA003
  204. /**
  205. * Illegal call.
  206. */
  207. #define AL_INVALID_OPERATION 0xA004
  208. /**
  209. * No mojo.
  210. */
  211. #define AL_OUT_OF_MEMORY 0xA005
  212. /** Context strings: Vendor Name. */
  213. #define AL_VENDOR 0xB001
  214. #define AL_VERSION 0xB002
  215. #define AL_RENDERER 0xB003
  216. #define AL_EXTENSIONS 0xB004
  217. /** Global tweakage. */
  218. /**
  219. * Doppler scale. Default 1.0
  220. */
  221. #define AL_DOPPLER_FACTOR 0xC000
  222. /**
  223. * Tweaks speed of propagation.
  224. */
  225. #define AL_DOPPLER_VELOCITY 0xC001
  226. /**
  227. * Speed of Sound in units per second
  228. */
  229. #define AL_SPEED_OF_SOUND 0xC003
  230. /**
  231. * Distance models
  232. *
  233. * used in conjunction with DistanceModel
  234. *
  235. * implicit: NONE, which disances distance attenuation.
  236. */
  237. #define AL_DISTANCE_MODEL 0xD000
  238. #define AL_INVERSE_DISTANCE 0xD001
  239. #define AL_INVERSE_DISTANCE_CLAMPED 0xD002
  240. #define AL_LINEAR_DISTANCE 0xD003
  241. #define AL_LINEAR_DISTANCE_CLAMPED 0xD004
  242. #define AL_EXPONENT_DISTANCE 0xD005
  243. #define AL_EXPONENT_DISTANCE_CLAMPED 0xD006
  244. #define _ALuint unsigned int
  245. #define _ALint int
  246. #define _ALCint int
  247. #define _ALsizei int
  248. #define _ALenum unsigned int
  249. #define _ALfloat float
  250. #define _ALCboolean char
  251. #define _ALvoid void
  252. typedef struct _ALCdevice _ALCdevice;
  253. typedef struct _ALCcontext _ALCcontext;
  254. #include "s3eTypes.h"
  255. // \cond HIDDEN_DEFINES
  256. S3E_BEGIN_C_DECL
  257. // \endcond
  258. /**
  259. * Returns S3E_TRUE if the openalext extension is available.
  260. */
  261. s3eBool openalextAvailable();
  262. unsigned int _alGetError();
  263. void _alSourceQueueBuffers( _ALuint sid, _ALsizei numEntries, const _ALuint* bids);
  264. void _alSourceUnqueueBuffers( _ALuint sid, _ALsizei numEntries, _ALuint* bids );
  265. void _alGetSourcei( _ALuint sid, _ALenum param, _ALint* value );
  266. void _alGetSourcef( _ALuint sid, _ALenum param, _ALfloat* value );
  267. void _alSourcef( _ALuint sid, _ALenum param, _ALfloat value );
  268. void _alSourcei( _ALuint sid, _ALenum param, _ALint value );
  269. void _alSourcePlay( _ALuint sid );
  270. void _alSourceStop( _ALuint sid );
  271. void _alSourcePause( _ALuint sid );
  272. void _alGenSources( _ALsizei n, _ALuint* sources );
  273. void _alDeleteSources( _ALsizei n, const _ALuint* sources );
  274. void _alGenBuffers( _ALsizei n, _ALuint* buffers );
  275. void _alDeleteBuffers( _ALsizei n, const _ALuint* buffers );
  276. void _alBufferData( _ALuint bid, _ALenum format, const _ALvoid* data, _ALsizei size, _ALsizei freq );
  277. _ALCdevice* _alcOpenDevice( const char* devicename );
  278. void _alcCloseDevice( _ALCdevice* device );
  279. _ALCcontext * _alcCreateContext( _ALCdevice* device, const _ALCint* attrlist );
  280. _ALCboolean _alcMakeContextCurrent( _ALCcontext* context );
  281. void _alcProcessContext( _ALCcontext* context );
  282. void _alcSuspendContext( _ALCcontext* context );
  283. void _alcDestroyContext( _ALCcontext* context );
  284. _ALCcontext * _alcGetCurrentContext();
  285. S3E_END_C_DECL
  286. #endif /* !S3E_EXT_OPENALEXT_H */