1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]

use bindings::*;

pub mod bindings;

pub const SL_BOOLEAN_FALSE: SLboolean = 0x00000000;
pub const SL_BOOLEAN_TRUE: SLboolean = 0x00000001;

pub const SL_MILLIBEL_MAX: SLmillibel = 0x7FFF;
pub const SL_MILLIBEL_MIN: SLmillibel = -SL_MILLIBEL_MAX - 1;

pub const SL_MILLIHERTZ_MAX: SLmilliHertz = 0xFFFFFFFF;
pub const SL_MILLIMETER_MAX: SLmillimeter = 0x7FFFFFFF;

pub const SL_OBJECTID_ENGINE: SLuint32 = 0x00001001;
pub const SL_OBJECTID_LEDDEVICE: SLuint32 = 0x00001002;
pub const SL_OBJECTID_VIBRADEVICE: SLuint32 = 0x00001003;
pub const SL_OBJECTID_AUDIOPLAYER: SLuint32 = 0x00001004;
pub const SL_OBJECTID_AUDIORECORDER: SLuint32 = 0x00001005;
pub const SL_OBJECTID_MIDIPLAYER: SLuint32 = 0x00001006;
pub const SL_OBJECTID_LISTENER: SLuint32 = 0x00001007;
pub const SL_OBJECTID_3DGROUP: SLuint32 = 0x00001008;
pub const SL_OBJECTID_OUTPUTMIX: SLuint32 = 0x00001009;
pub const SL_OBJECTID_METADATAEXTRACTOR: SLuint32 = 0x0000100A;

pub const SL_PROFILES_PHONE: SLuint16 = 0x0001;
pub const SL_PROFILES_MUSIC: SLuint16 = 0x0002;
pub const SL_PROFILES_GAME: SLuint16 = 0x0004;

pub const SL_VOICETYPE_2D_AUDIO: SLuint16 = 0x0001;
pub const SL_VOICETYPE_MIDI: SLuint16 = 0x0002;
pub const SL_VOICETYPE_3D_AUDIO: SLuint16 = 0x0004;
pub const SL_VOICETYPE_3D_MIDIOUTPUT: SLuint16 = 0x0008;

pub const SL_PRIORITY_LOWEST: SLint32 = -0x7FFFFFFF - 1;
pub const SL_PRIORITY_VERYLOW: SLint32 = -0x60000000;
pub const SL_PRIORITY_LOW: SLint32 = -0x40000000;
pub const SL_PRIORITY_BELOWNORMAL: SLint32 = -0x20000000;
pub const SL_PRIORITY_NORMAL: SLint32 = 0x00000000;
pub const SL_PRIORITY_ABOVENORMAL: SLint32 = 0x20000000;
pub const SL_PRIORITY_HIGH: SLint32 = 0x40000000;
pub const SL_PRIORITY_VERYHIGH: SLint32 = 0x60000000;
pub const SL_PRIORITY_HIGHEST: SLint32 = 0x7FFFFFFF;

pub const SL_PCMSAMPLEFORMAT_FIXED_8: SLuint16 = 0x0008;
pub const SL_PCMSAMPLEFORMAT_FIXED_16: SLuint16 = 0x0010;
pub const SL_PCMSAMPLEFORMAT_FIXED_20: SLuint16 = 0x0014;
pub const SL_PCMSAMPLEFORMAT_FIXED_24: SLuint16 = 0x0018;
pub const SL_PCMSAMPLEFORMAT_FIXED_28: SLuint16 = 0x001C;
pub const SL_PCMSAMPLEFORMAT_FIXED_32: SLuint16 = 0x0020;

pub const SL_SAMPLINGRATE_8: SLuint32 = 8000000;
pub const SL_SAMPLINGRATE_11_025: SLuint32 = 11025000;
pub const SL_SAMPLINGRATE_12: SLuint32 = 12000000;
pub const SL_SAMPLINGRATE_16: SLuint32 = 16000000;
pub const SL_SAMPLINGRATE_22_05: SLuint32 = 22050000;
pub const SL_SAMPLINGRATE_24: SLuint32 = 24000000;
pub const SL_SAMPLINGRATE_32: SLuint32 = 32000000;
pub const SL_SAMPLINGRATE_44_1: SLuint32 = 44100000;
pub const SL_SAMPLINGRATE_48: SLuint32 = 48000000;
pub const SL_SAMPLINGRATE_64: SLuint32 = 64000000;
pub const SL_SAMPLINGRATE_88_2: SLuint32 = 88200000;
pub const SL_SAMPLINGRATE_96: SLuint32 = 96000000;
pub const SL_SAMPLINGRATE_192: SLuint32 = 192000000;

pub const SL_SPEAKER_FRONT_LEFT: SLuint32 = 0x00000001;
pub const SL_SPEAKER_FRONT_RIGHT: SLuint32 = 0x00000002;
pub const SL_SPEAKER_FRONT_CENTER: SLuint32 = 0x00000004;
pub const SL_SPEAKER_LOW_FREQUENCY: SLuint32 = 0x00000008;
pub const SL_SPEAKER_BACK_LEFT: SLuint32 = 0x00000010;
pub const SL_SPEAKER_BACK_RIGHT: SLuint32 = 0x00000020;
pub const SL_SPEAKER_FRONT_LEFT_OF_CENTER: SLuint32 = 0x00000040;
pub const SL_SPEAKER_FRONT_RIGHT_OF_CENTER: SLuint32 = 0x00000080;
pub const SL_SPEAKER_BACK_CENTER: SLuint32 = 0x00000100;
pub const SL_SPEAKER_SIDE_LEFT: SLuint32 = 0x00000200;
pub const SL_SPEAKER_SIDE_RIGHT: SLuint32 = 0x00000400;
pub const SL_SPEAKER_TOP_CENTER: SLuint32 = 0x00000800;
pub const SL_SPEAKER_TOP_FRONT_LEFT: SLuint32 = 0x00001000;
pub const SL_SPEAKER_TOP_FRONT_CENTER: SLuint32 = 0x00002000;
pub const SL_SPEAKER_TOP_FRONT_RIGHT: SLuint32 = 0x00004000;
pub const SL_SPEAKER_TOP_BACK_LEFT: SLuint32 = 0x00008000;
pub const SL_SPEAKER_TOP_BACK_CENTER: SLuint32 = 0x00010000;
pub const SL_SPEAKER_TOP_BACK_RIGHT: SLuint32 = 0x00020000;

pub const SL_OBJECT_STATE_UNREALIZED: SLuint32 = 0x00000001;
pub const SL_OBJECT_STATE_REALIZED: SLuint32 = 0x00000002;
pub const SL_OBJECT_STATE_SUSPENDED: SLuint32 = 0x00000003;

pub const SL_OBJECT_EVENT_RUNTIME_ERROR: SLuint32 = 0x00000001;
pub const SL_OBJECT_EVENT_ASYNC_TERMINATION: SLuint32 = 0x00000002;
pub const SL_OBJECT_EVENT_RESOURCES_LOST: SLuint32 = 0x00000003;
pub const SL_OBJECT_EVENT_RESOURCES_AVAILABLE: SLuint32 = 0x00000004;
pub const SL_OBJECT_EVENT_ITF_CONTROL_TAKEN: SLuint32 = 0x00000005;
pub const SL_OBJECT_EVENT_ITF_CONTROL_RETURNED: SLuint32 = 0x00000006;
pub const SL_OBJECT_EVENT_ITF_PARAMETERS_CHANGED: SLuint32 = 0x00000007;

pub const SL_DATALOCATOR_URI: SLuint32 = 0x00000001;
pub const SL_DATALOCATOR_ADDRESS: SLuint32 = 0x00000002;
pub const SL_DATALOCATOR_IODEVICE: SLuint32 = 0x00000003;
pub const SL_DATALOCATOR_OUTPUTMIX: SLuint32 = 0x00000004;
pub const SL_DATALOCATOR_RESERVED5: SLuint32 = 0x00000005;
pub const SL_DATALOCATOR_BUFFERQUEUE: SLuint32 = 0x00000006;
pub const SL_DATALOCATOR_MIDIBUFFERQUEUE: SLuint32 = 0x00000007;
pub const SL_DATALOCATOR_RESERVED8: SLuint32 = 0x00000008;

pub const SL_IODEVICE_AUDIOINPUT: SLuint32 = 0x00000001;
pub const SL_IODEVICE_LEDARRAY: SLuint32 = 0x00000002;
pub const SL_IODEVICE_VIBRA: SLuint32 = 0x00000003;
pub const SL_IODEVICE_RESERVED4: SLuint32 = 0x00000004;
pub const SL_IODEVICE_RESERVED5: SLuint32 = 0x00000005;

pub const SL_DATAFORMAT_MIME: SLuint32 = 0x00000001;
pub const SL_DATAFORMAT_PCM: SLuint32 = 0x00000002;
pub const SL_DATAFORMAT_RESERVED3: SLuint32 = 0x00000003;

pub const SL_BYTEORDER_BIGENDIAN: SLuint32 = 0x00000001;
pub const SL_BYTEORDER_LITTLEENDIAN: SLuint32 = 0x00000002;

pub const SL_CONTAINERTYPE_UNSPECIFIED: SLuint32 = 0x00000001;
pub const SL_CONTAINERTYPE_RAW: SLuint32 = 0x00000002;
pub const SL_CONTAINERTYPE_ASF: SLuint32 = 0x00000003;
pub const SL_CONTAINERTYPE_AVI: SLuint32 = 0x00000004;
pub const SL_CONTAINERTYPE_BMP: SLuint32 = 0x00000005;
pub const SL_CONTAINERTYPE_JPG: SLuint32 = 0x00000006;
pub const SL_CONTAINERTYPE_JPG2000: SLuint32 = 0x00000007;
pub const SL_CONTAINERTYPE_M4A: SLuint32 = 0x00000008;
pub const SL_CONTAINERTYPE_MP3: SLuint32 = 0x00000009;
pub const SL_CONTAINERTYPE_MP4: SLuint32 = 0x0000000A;
pub const SL_CONTAINERTYPE_MPEG_ES: SLuint32 = 0x0000000B;
pub const SL_CONTAINERTYPE_MPEG_PS: SLuint32 = 0x0000000C;
pub const SL_CONTAINERTYPE_MPEG_TS: SLuint32 = 0x0000000D;
pub const SL_CONTAINERTYPE_QT: SLuint32 = 0x0000000E;
pub const SL_CONTAINERTYPE_WAV: SLuint32 = 0x0000000F;
pub const SL_CONTAINERTYPE_XMF_0: SLuint32 = 0x00000010;
pub const SL_CONTAINERTYPE_XMF_1: SLuint32 = 0x00000011;
pub const SL_CONTAINERTYPE_XMF_2: SLuint32 = 0x00000012;
pub const SL_CONTAINERTYPE_XMF_3: SLuint32 = 0x00000013;
pub const SL_CONTAINERTYPE_XMF_GENERIC: SLuint32 = 0x00000014;
pub const SL_CONTAINERTYPE_AMR: SLuint32 = 0x00000015;
pub const SL_CONTAINERTYPE_AAC: SLuint32 = 0x00000016;
pub const SL_CONTAINERTYPE_3GPP: SLuint32 = 0x00000017;
pub const SL_CONTAINERTYPE_3GA: SLuint32 = 0x00000018;
pub const SL_CONTAINERTYPE_RM: SLuint32 = 0x00000019;
pub const SL_CONTAINERTYPE_DMF: SLuint32 = 0x0000001A;
pub const SL_CONTAINERTYPE_SMF: SLuint32 = 0x0000001B;
pub const SL_CONTAINERTYPE_MOBILE_DLS: SLuint32 = 0x0000001C;
pub const SL_CONTAINERTYPE_OGG: SLuint32 = 0x0000001D;

pub const SL_DEFAULTDEVICEID_AUDIOINPUT: SLuint32 = 0xFFFFFFFF;
pub const SL_DEFAULTDEVICEID_AUDIOOUTPUT: SLuint32 = 0xFFFFFFFE;
pub const SL_DEFAULTDEVICEID_LED: SLuint32 = 0xFFFFFFFD;
pub const SL_DEFAULTDEVICEID_VIBRA: SLuint32 = 0xFFFFFFFC;
pub const SL_DEFAULTDEVICEID_RESERVED1: SLuint32 = 0xFFFFFFFB;

pub const SL_DEVCONNECTION_INTEGRATED: SLint16 = 0x0001;
pub const SL_DEVCONNECTION_ATTACHED_WIRED: SLint16 = 0x0100;
pub const SL_DEVCONNECTION_ATTACHED_WIRELESS: SLint16 = 0x0200;
pub const SL_DEVCONNECTION_NETWORK: SLint16 = 0x0400;

pub const SL_DEVLOCATION_HANDSET: SLuint16 = 0x0001;
pub const SL_DEVLOCATION_HEADSET: SLuint16 = 0x0002;
pub const SL_DEVLOCATION_CARKIT: SLuint16 = 0x0003;
pub const SL_DEVLOCATION_DOCK: SLuint16 = 0x0004;
pub const SL_DEVLOCATION_REMOTE: SLuint16 = 0x0005;
/* Note: SL_DEVLOCATION_RESLTE is deprecated, use SL_DEVLOCATION_REMOTE instead. */
pub const SL_DEVLOCATION_RESLTE: SLuint16 = 0x0005;

pub const SL_DEVSCOPE_UNKNOWN: SLuint16 = 0x0001;
pub const SL_DEVSCOPE_ENVIRONMENT: SLuint16 = 0x0002;
pub const SL_DEVSCOPE_USER: SLuint16 = 0x0003;

pub const SL_CHARACTERENCODING_UNKNOWN: SLuint32 = 0x00000000;
pub const SL_CHARACTERENCODING_BINARY: SLuint32 = 0x00000001;
pub const SL_CHARACTERENCODING_ASCII: SLuint32 = 0x00000002;
pub const SL_CHARACTERENCODING_BIG5: SLuint32 = 0x00000003;
pub const SL_CHARACTERENCODING_CODEPAGE1252: SLuint32 = 0x00000004;
pub const SL_CHARACTERENCODING_GB2312: SLuint32 = 0x00000005;
pub const SL_CHARACTERENCODING_HZGB2312: SLuint32 = 0x00000006;
pub const SL_CHARACTERENCODING_GB12345: SLuint32 = 0x00000007;
pub const SL_CHARACTERENCODING_GB18030: SLuint32 = 0x00000008;
pub const SL_CHARACTERENCODING_GBK: SLuint32 = 0x00000009;
pub const SL_CHARACTERENCODING_IMAPUTF7: SLuint32 = 0x0000000A;
pub const SL_CHARACTERENCODING_ISO2022JP: SLuint32 = 0x0000000B;
pub const SL_CHARACTERENCODING_ISO2022JP1: SLuint32 = 0x0000000B;
pub const SL_CHARACTERENCODING_ISO88591: SLuint32 = 0x0000000C;
pub const SL_CHARACTERENCODING_ISO885910: SLuint32 = 0x0000000D;
pub const SL_CHARACTERENCODING_ISO885913: SLuint32 = 0x0000000E;
pub const SL_CHARACTERENCODING_ISO885914: SLuint32 = 0x0000000F;
pub const SL_CHARACTERENCODING_ISO885915: SLuint32 = 0x00000010;
pub const SL_CHARACTERENCODING_ISO88592: SLuint32 = 0x00000011;
pub const SL_CHARACTERENCODING_ISO88593: SLuint32 = 0x00000012;
pub const SL_CHARACTERENCODING_ISO88594: SLuint32 = 0x00000013;
pub const SL_CHARACTERENCODING_ISO88595: SLuint32 = 0x00000014;
pub const SL_CHARACTERENCODING_ISO88596: SLuint32 = 0x00000015;
pub const SL_CHARACTERENCODING_ISO88597: SLuint32 = 0x00000016;
pub const SL_CHARACTERENCODING_ISO88598: SLuint32 = 0x00000017;
pub const SL_CHARACTERENCODING_ISO88599: SLuint32 = 0x00000018;
pub const SL_CHARACTERENCODING_ISOEUCJP: SLuint32 = 0x00000019;
pub const SL_CHARACTERENCODING_SHIFTJIS: SLuint32 = 0x0000001A;
pub const SL_CHARACTERENCODING_SMS7BIT: SLuint32 = 0x0000001B;
pub const SL_CHARACTERENCODING_UTF7: SLuint32 = 0x0000001C;
pub const SL_CHARACTERENCODING_UTF8: SLuint32 = 0x0000001D;
pub const SL_CHARACTERENCODING_JAVACONFORMANTUTF8: SLuint32 = 0x0000001E;
pub const SL_CHARACTERENCODING_UTF16BE: SLuint32 = 0x0000001F;
pub const SL_CHARACTERENCODING_UTF16LE: SLuint32 = 0x00000020;

pub const SL_METADATA_FILTER_KEY: SLuint8 = 0x01;
pub const SL_METADATA_FILTER_LANG: SLuint8 = 0x02;
pub const SL_METADATA_FILTER_ENCODING: SLuint8 = 0x04;

pub const SL_METADATATRAVERSALMODE_ALL: SLuint32 = 0x00000001;
pub const SL_METADATATRAVERSALMODE_NODE: SLuint32 = 0x00000002;

pub const SL_NODETYPE_UNSPECIFIED: SLuint32 = 0x00000001;
pub const SL_NODETYPE_AUDIO: SLuint32 = 0x00000002;
pub const SL_NODETYPE_VIDEO: SLuint32 = 0x00000003;
pub const SL_NODETYPE_IMAGE: SLuint32 = 0x00000004;

pub const SL_PLAYSTATE_STOPPED: SLuint32 = 0x00000001;
pub const SL_PLAYSTATE_PAUSED: SLuint32 = 0x00000002;
pub const SL_PLAYSTATE_PLAYING: SLuint32 = 0x00000003;

pub const SL_PLAYEVENT_HEADATEND: SLuint32 = 0x00000001;
pub const SL_PLAYEVENT_HEADATMARKER: SLuint32 = 0x00000002;
pub const SL_PLAYEVENT_HEADATNEWPOS: SLuint32 = 0x00000004;
pub const SL_PLAYEVENT_HEADMOVING: SLuint32 = 0x00000008;
pub const SL_PLAYEVENT_HEADSTALLED: SLuint32 = 0x00000010;

pub const SL_TIME_UNKNOWN: SLuint32 = 0xFFFFFFFF;

pub const SL_PREFETCHEVENT_STATUSCHANGE: SLuint32 = 0x00000001;
pub const SL_PREFETCHEVENT_FILLLEVELCHANGE: SLuint32 = 0x00000002;

pub const SL_PREFETCHSTATUS_UNDERFLOW: SLuint32 = 0x00000001;
pub const SL_PREFETCHSTATUS_SUFFICIENTDATA: SLuint32 = 0x00000002;
pub const SL_PREFETCHSTATUS_OVERFLOW: SLuint32 = 0x00000003;

pub const SL_SEEKMODE_FAST: SLuint32 = 0x0001;
pub const SL_SEEKMODE_ACCURATE: SLuint32 = 0x0002;

pub const SL_RECORDSTATE_STOPPED: SLuint32 = 0x00000001;
pub const SL_RECORDSTATE_PAUSED: SLuint32 = 0x00000002;
pub const SL_RECORDSTATE_RECORDING: SLuint32 = 0x00000003;

pub const SL_RECORDEVENT_HEADATLIMIT: SLuint32 = 0x00000001;
pub const SL_RECORDEVENT_HEADATMARKER: SLuint32 = 0x00000002;
pub const SL_RECORDEVENT_HEADATNEWPOS: SLuint32 = 0x00000004;
pub const SL_RECORDEVENT_HEADMOVING: SLuint32 = 0x00000008;
pub const SL_RECORDEVENT_HEADSTALLED: SLuint32 = 0x00000010;
/* Note: SL_RECORDEVENT_BUFFER_INSUFFICIENT is deprecated, use SL_RECORDEVENT_BUFFER_FULL instead. */
pub const SL_RECORDEVENT_BUFFER_INSUFFICIENT: SLuint32 = 0x00000020;
pub const SL_RECORDEVENT_BUFFER_FULL: SLuint32 = 0x00000020;

pub const SL_EQUALIZER_UNDEFINED: SLuint16 = 0xFFFF;

pub const SL_REVERBPRESET_NONE: SLuint16 = 0x0000;
pub const SL_REVERBPRESET_SMALLROOM: SLuint16 = 0x0001;
pub const SL_REVERBPRESET_MEDIUMROOM: SLuint16 = 0x0002;
pub const SL_REVERBPRESET_LARGEROOM: SLuint16 = 0x0003;
pub const SL_REVERBPRESET_MEDIUMHALL: SLuint16 = 0x0004;
pub const SL_REVERBPRESET_LARGEHALL: SLuint16 = 0x0005;
pub const SL_REVERBPRESET_PLATE: SLuint16 = 0x0006;

pub const SL_ROLLOFFMODEL_EXPONENTIAL: SLuint32 = 0x00000000;
pub const SL_ROLLOFFMODEL_LINEAR: SLuint32 = 0x00000001;

pub const SL_DYNAMIC_ITF_EVENT_RUNTIME_ERROR: SLuint32 = 0x00000001;
pub const SL_DYNAMIC_ITF_EVENT_ASYNC_TERMINATION: SLuint32 = 0x00000002;
pub const SL_DYNAMIC_ITF_EVENT_RESOURCES_LOST: SLuint32 = 0x00000003;
pub const SL_DYNAMIC_ITF_EVENT_RESOURCES_LOST_PERMANENTLY: SLuint32 = 0x00000004;
pub const SL_DYNAMIC_ITF_EVENT_RESOURCES_AVAILABLE: SLuint32 = 0x00000005;

pub const SL_MIDIMESSAGETYPE_NOTE_ON_OFF: SLuint32 = 0x00000001;
pub const SL_MIDIMESSAGETYPE_POLY_PRESSURE: SLuint32 = 0x00000002;
pub const SL_MIDIMESSAGETYPE_CONTROL_CHANGE: SLuint32 = 0x00000003;
pub const SL_MIDIMESSAGETYPE_PROGRAM_CHANGE: SLuint32 = 0x00000004;
pub const SL_MIDIMESSAGETYPE_CHANNEL_PRESSURE: SLuint32 = 0x00000005;
pub const SL_MIDIMESSAGETYPE_PITCH_BEND: SLuint32 = 0x00000006;
pub const SL_MIDIMESSAGETYPE_SYSTEM_MESSAGE: SLuint32 = 0x00000007;

pub const SL_RATECONTROLMODE_CONSTANTBITRATE: SLuint32 = 0x00000001;
pub const SL_RATECONTROLMODE_VARIABLEBITRATE: SLuint32 = 0x00000002;

pub const SL_AUDIOCODEC_PCM: SLuint32 = 0x00000001;
pub const SL_AUDIOCODEC_MP3: SLuint32 = 0x00000002;
pub const SL_AUDIOCODEC_AMR: SLuint32 = 0x00000003;
pub const SL_AUDIOCODEC_AMRWB: SLuint32 = 0x00000004;
pub const SL_AUDIOCODEC_AMRWBPLUS: SLuint32 = 0x00000005;
pub const SL_AUDIOCODEC_AAC: SLuint32 = 0x00000006;
pub const SL_AUDIOCODEC_WMA: SLuint32 = 0x00000007;
pub const SL_AUDIOCODEC_REAL: SLuint32 = 0x00000008;

pub const SL_AUDIOPROFILE_PCM: SLuint32 = 0x00000001;

pub const SL_AUDIOPROFILE_MPEG1_L3: SLuint32 = 0x00000001;
pub const SL_AUDIOPROFILE_MPEG2_L3: SLuint32 = 0x00000002;
pub const SL_AUDIOPROFILE_MPEG25_L3: SLuint32 = 0x00000003;

pub const SL_AUDIOCHANMODE_MP3_MONO: SLuint32 = 0x00000001;
pub const SL_AUDIOCHANMODE_MP3_STEREO: SLuint32 = 0x00000002;
pub const SL_AUDIOCHANMODE_MP3_JOINTSTEREO: SLuint32 = 0x00000003;
pub const SL_AUDIOCHANMODE_MP3_DUAL: SLuint32 = 0x00000004;

pub const SL_AUDIOPROFILE_AMR: SLuint32 = 0x00000001;

pub const SL_AUDIOSTREAMFORMAT_CONFORMANCE: SLuint32 = 0x00000001;
pub const SL_AUDIOSTREAMFORMAT_IF1: SLuint32 = 0x00000002;
pub const SL_AUDIOSTREAMFORMAT_IF2: SLuint32 = 0x00000003;
pub const SL_AUDIOSTREAMFORMAT_FSF: SLuint32 = 0x00000004;
pub const SL_AUDIOSTREAMFORMAT_RTPPAYLOAD: SLuint32 = 0x00000005;
pub const SL_AUDIOSTREAMFORMAT_ITU: SLuint32 = 0x00000006;

pub const SL_AUDIOPROFILE_AMRWB: SLuint32 = 0x00000001;

pub const SL_AUDIOPROFILE_AMRWBPLUS: SLuint32 = 0x00000001;

pub const SL_AUDIOPROFILE_AAC_AAC: SLuint32 = 0x00000001;

pub const SL_AUDIOMODE_AAC_MAIN: SLuint32 = 0x00000001;
pub const SL_AUDIOMODE_AAC_LC: SLuint32 = 0x00000002;
pub const SL_AUDIOMODE_AAC_SSR: SLuint32 = 0x00000003;
pub const SL_AUDIOMODE_AAC_LTP: SLuint32 = 0x00000004;
pub const SL_AUDIOMODE_AAC_HE: SLuint32 = 0x00000005;
pub const SL_AUDIOMODE_AAC_SCALABLE: SLuint32 = 0x00000006;
pub const SL_AUDIOMODE_AAC_ERLC: SLuint32 = 0x00000007;
pub const SL_AUDIOMODE_AAC_LD: SLuint32 = 0x00000008;
pub const SL_AUDIOMODE_AAC_HE_PS: SLuint32 = 0x00000009;
pub const SL_AUDIOMODE_AAC_HE_MPS: SLuint32 = 0x0000000A;

pub const SL_AUDIOSTREAMFORMAT_MP2ADTS: SLuint32 = 0x00000001;
pub const SL_AUDIOSTREAMFORMAT_MP4ADTS: SLuint32 = 0x00000002;
pub const SL_AUDIOSTREAMFORMAT_MP4LOAS: SLuint32 = 0x00000003;
pub const SL_AUDIOSTREAMFORMAT_MP4LATM: SLuint32 = 0x00000004;
pub const SL_AUDIOSTREAMFORMAT_ADIF: SLuint32 = 0x00000005;
pub const SL_AUDIOSTREAMFORMAT_MP4FF: SLuint32 = 0x00000006;
pub const SL_AUDIOSTREAMFORMAT_RAW: SLuint32 = 0x00000007;

pub const SL_AUDIOPROFILE_WMA7: SLuint32 = 0x00000001;
pub const SL_AUDIOPROFILE_WMA8: SLuint32 = 0x00000002;
pub const SL_AUDIOPROFILE_WMA9: SLuint32 = 0x00000003;
pub const SL_AUDIOPROFILE_WMA10: SLuint32 = 0x00000004;

pub const SL_AUDIOMODE_WMA_LEVEL1: SLuint32 = 0x00000001;
pub const SL_AUDIOMODE_WMA_LEVEL2: SLuint32 = 0x00000002;
pub const SL_AUDIOMODE_WMA_LEVEL3: SLuint32 = 0x00000003;
pub const SL_AUDIOMODE_WMA_LEVEL4: SLuint32 = 0x00000004;
pub const SL_AUDIOMODE_WMAPRO_LEVELM0: SLuint32 = 0x00000005;
pub const SL_AUDIOMODE_WMAPRO_LEVELM1: SLuint32 = 0x00000006;
pub const SL_AUDIOMODE_WMAPRO_LEVELM2: SLuint32 = 0x00000007;
pub const SL_AUDIOMODE_WMAPRO_LEVELM3: SLuint32 = 0x00000008;

pub const SL_AUDIOPROFILE_REALAUDIO: SLuint32 = 0x00000001;

pub const SL_AUDIOMODE_REALAUDIO_G2: SLuint32 = 0x00000001;
pub const SL_AUDIOMODE_REALAUDIO_8: SLuint32 = 0x00000002;
pub const SL_AUDIOMODE_REALAUDIO_10: SLuint32 = 0x00000003;
pub const SL_AUDIOMODE_REALAUDIO_SURROUND: SLuint32 = 0x00000004;

pub const SL_ENGINEOPTION_THREADSAFE: SLuint32 = 0x00000001;
pub const SL_ENGINEOPTION_LOSSOFCONTROL: SLuint32 = 0x00000002;

// From https://www.khronos.org/registry/OpenSL-ES/api/1.0/OpenSLES.h
#[derive(Debug, Copy, Clone, PartialEq)]
pub enum SLResult {
    Success,
    PreconditionsViolated,
    ParameterInvalid,
    MemoryFailure,
    ResourceError,
    ResourceLost,
    IoError,
    BufferInsufficient,
    ContentCorrupted,
    ContentUnsupported,
    ContentNotFound,
    PermissionDenied,
    FeatureUnsupported,
    InternalError,
    UnknownError,
    OperationAborted,
    ControlLost,
}

impl From<bindings::SLresult> for SLResult {
    fn from(res: bindings::SLresult) -> Self {
        match res {
            0 => SLResult::Success,
            1 => SLResult::PreconditionsViolated,
            2 => SLResult::ParameterInvalid,
            3 => SLResult::MemoryFailure,
            4 => SLResult::ResourceError,
            5 => SLResult::ResourceLost,
            6 => SLResult::IoError,
            7 => SLResult::BufferInsufficient,
            8 => SLResult::ContentCorrupted,
            9 => SLResult::ContentUnsupported,
            10 => SLResult::ContentNotFound,
            11 => SLResult::PermissionDenied,
            12 => SLResult::FeatureUnsupported,
            13 => SLResult::InternalError,
            14 => SLResult::UnknownError,
            15 => SLResult::OperationAborted,
            16 => SLResult::ControlLost,
            _ => SLResult::UnknownError
        }
    }
}