alto/
ext.rs

1use std::mem;
2use std::ptr;
3
4use sys::*;
5
6
7macro_rules! alc_ext {
8	{
9		pub(crate) cache $cache:ident;
10
11
12		$(pub ext $ext:ident {
13			$(pub const $const_:ident,)*
14			$(pub fn $fn_:ident: $fn_ty:ty,)*
15		})*
16	} => {
17		#[allow(non_snake_case)]
18		pub(crate) struct $cache {
19			pub $($ext: ExtResult<$ext>,)*
20		}
21
22
23		#[allow(non_snake_case, dead_code)]
24		impl $cache {
25			pub unsafe fn new(api: &AlApi, dev: *mut ALCdevice) -> $cache {
26				$cache{
27					$($ext: $ext::load(api, dev),)*
28				}
29			}
30
31
32			$(pub fn $ext(&self) -> ExtResult<&$ext> {
33				self.$ext.as_ref().map_err(|e| *e)
34			})*
35		}
36
37
38		unsafe impl Send for $cache { }
39		unsafe impl Sync for $cache { }
40
41
42		$(#[allow(non_camel_case_types, non_snake_case)]
43		#[derive(Debug)]
44		pub struct $ext {
45			$(pub $const_: ExtResult<ALCenum>,)*
46			$(pub $fn_: ExtResult<$fn_ty>,)*
47		}
48
49
50		impl $ext {
51			pub fn load(api: &AlApi, dev: *mut ALCdevice) -> ExtResult<$ext> {
52				unsafe { api.alcGetError(dev); }
53				if unsafe { api.alcIsExtensionPresent(dev, concat!(stringify!($ext), "\0").as_bytes().as_ptr() as *const ALCchar) } == ALC_TRUE {
54					Ok($ext{
55						$($const_: {
56							let e = unsafe { api.alcGetEnumValue(dev, concat!(stringify!($const_), "\0").as_bytes().as_ptr() as *const ALCchar) };
57							if e != 0 && unsafe { api.alcGetError(dev) } == ALC_NO_ERROR {
58								Ok(e)
59							} else {
60								// Workaround for missing symbols in OpenAL-Soft
61								match stringify!($const_) {
62									"AL_EFFECTSLOT_EFFECT" => Ok(1),
63									"AL_EFFECTSLOT_GAIN" => Ok(2),
64									"AL_EFFECTSLOT_AUXILIARY_SEND_AUTO" => Ok(3),
65									_ => Err(ExtensionError),
66								}
67							}
68						},)*
69						$($fn_: {
70							let p = unsafe { api.alcGetProcAddress(dev, concat!(stringify!($fn_), "\0").as_bytes().as_ptr() as *const ALCchar) };
71							if p != ptr::null_mut() && unsafe { api.alcGetError(dev) } == ALC_NO_ERROR {
72								Ok(unsafe { mem::transmute(p) })
73							} else {
74								Err(ExtensionError)
75							}
76						},)*
77					})
78				} else {
79					Err(ExtensionError)
80				}
81			}
82		})*
83	};
84}
85
86
87macro_rules! al_ext {
88	{
89		pub(crate) cache $cache:ident;
90
91
92		$(pub ext $ext:ident {
93			$(pub const $const_:ident,)*
94			$(pub fn $fn_:ident: $fn_ty:ty,)*
95		})*
96	} => {
97		#[allow(non_snake_case)]
98		pub(crate) struct $cache {
99			pub $($ext: ExtResult<$ext>,)*
100		}
101
102
103		#[allow(non_snake_case, dead_code)]
104		impl $cache {
105			pub unsafe fn new(api: &AlApi) -> $cache {
106				$cache{
107					$($ext: $ext::load(api),)*
108				}
109			}
110
111
112			$(pub fn $ext(&self) -> ExtResult<&$ext> {
113				self.$ext.as_ref().map_err(|e| *e)
114			})*
115		}
116
117
118		unsafe impl Send for $cache { }
119
120
121		$(#[allow(non_camel_case_types, non_snake_case)]
122		#[derive(Debug)]
123		pub struct $ext {
124			$(pub $const_: ExtResult<ALenum>,)*
125			$(pub $fn_: ExtResult<$fn_ty>,)*
126		}
127
128
129		impl $ext {
130			pub fn load(api: &AlApi) -> ExtResult<$ext> {
131				unsafe { api.alGetError(); }
132				if unsafe { api.alIsExtensionPresent(concat!(stringify!($ext), "\0").as_bytes().as_ptr() as *const ALchar) } == AL_TRUE {
133					Ok($ext{
134						$($const_: {
135							let e = unsafe { api.alGetEnumValue(concat!(stringify!($const_), "\0").as_bytes().as_ptr() as *const ALchar) };
136							if e != 0 && unsafe { api.alGetError() } == AL_NO_ERROR {
137								Ok(e)
138							} else {
139								Err(ExtensionError)
140							}
141						},)*
142						$($fn_: {
143							let p = unsafe { api.alGetProcAddress(concat!(stringify!($fn_), "\0").as_bytes().as_ptr() as *const ALchar) };
144							if p != ptr::null_mut() && unsafe { api.alGetError() } == AL_NO_ERROR {
145								Ok(unsafe { mem::transmute(p) })
146							} else {
147								Err(ExtensionError)
148							}
149						},)*
150					})
151				} else {
152					Err(ExtensionError)
153				}
154			}
155		})*
156	};
157}
158
159
160#[doc(hidden)]
161#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
162pub struct ExtensionError;
163
164
165#[doc(hidden)]
166pub type ExtResult<T> = ::std::result::Result<T, ExtensionError>;
167
168
169#[derive(Copy, Clone, PartialEq, Hash, Eq, Debug)]
170pub enum AlcNull {
171	/// `ALC_ENUMERATE_ALL_EXT`
172	EnumerateAll,
173	/// `ALC_SOFT_loopback`
174	SoftLoopback,
175	/// `ALC_EXT_thread_local_context`
176	ThreadLocalContext,
177}
178
179
180#[derive(Copy, Clone, PartialEq, Hash, Eq, Debug)]
181pub enum Alc {
182	/// `ALC_EXT_DEDICATED`
183	Dedicated,
184	/// `ALC_EXT_disconnect`
185	Disconnect,
186	/// `ALC_EXT_EFX`
187	Efx,
188	/// `ALC_SOFT_HRTF`
189	SoftHrtf,
190	/// `ALC_SOFT_pause_device`
191	SoftPauseDevice,
192	/// `ALC_SOFT_output_limiter`
193	SoftOutputLimiter,
194}
195
196
197#[derive(Copy, Clone, PartialEq, Hash, Eq, Debug)]
198pub enum Al {
199	/// `AL_EXT_ALAW`
200	ALaw,
201	/// `AL_EXT_BFORMAT`
202	BFormat,
203	/// `AL_EXT_double`
204	Double,
205	/// `AL_EXT_float32`
206	Float32,
207	/// `AL_EXT_IMA4`
208	Ima4,
209	/// `AL_EXT_MCFORMATS`
210	McFormats,
211	/// `AL_EXT_MULAW`
212	MuLaw,
213	/// `AL_EXT_MULAW_BFORMAT`
214	MuLawBFormat,
215	/// `AL_EXT_MULAW_MCFORMATS`
216	MuLawMcFormats,
217	/// `AL_SOFT_block_alignment`
218	SoftBlockAlignment,
219//	SoftBufferSamples,
220//	SoftBufferSubData,
221	/// `AL_SOFT_deferred_updates`
222	SoftDeferredUpdates,
223	/// `AL_SOFT_direct_channels`
224	SoftDirectChannels,
225	/// `AL_SOFT_loop_points`
226	SoftLoopPoints,
227	/// `AL_SOFT_MSADPCM`
228	SoftMsadpcm,
229	/// `AL_SOFT_source_latency`
230	SoftSourceLatency,
231	/// `AL_SOFT_source_length`
232	SoftSourceLength,
233	/// `AL_EXT_source_distance_model`
234	SourceDistanceModel,
235	/// `AL_SOFT_source_spatialize`
236	SoftSourceSpatialize,
237	/// `AL_SOFT_source_resampler`
238	SoftSourceResampler,
239	/// `AL_SOFT_gain_clamp_ex`
240	SoftGainClampEx,
241	/// `AL_EXT_STEREO_ANGLES`
242	StereoAngles,
243	/// `AL_EXT_SOURCE_RADIUS`
244	SourceRadius,
245}
246
247
248alc_ext! {
249	pub(crate) cache AlcNullCache;
250
251
252	pub ext ALC_ENUMERATE_ALL_EXT {
253		pub const ALC_ALL_DEVICES_SPECIFIER,
254		pub const ALC_DEFAULT_ALL_DEVICES_SPECIFIER,
255	}
256
257
258	pub ext ALC_SOFT_loopback {
259		pub const ALC_BYTE_SOFT,
260		pub const ALC_UNSIGNED_BYTE_SOFT,
261		pub const ALC_SHORT_SOFT,
262		pub const ALC_UNSIGNED_SHORT_SOFT,
263		pub const ALC_INT_SOFT,
264		pub const ALC_UNSIGNED_INT_SOFT,
265		pub const ALC_FLOAT_SOFT,
266		pub const ALC_MONO_SOFT,
267		pub const ALC_STEREO_SOFT,
268		pub const ALC_QUAD_SOFT,
269		pub const ALC_5POINT1_SOFT,
270		pub const ALC_6POINT1_SOFT,
271		pub const ALC_7POINT1_SOFT,
272		pub const ALC_FORMAT_CHANNELS_SOFT,
273		pub const ALC_FORMAT_TYPE_SOFT,
274
275		pub fn alcLoopbackOpenDeviceSOFT: unsafe extern "C" fn(deviceName: *const ALCchar) -> *mut ALCdevice,
276		pub fn alcIsRenderFormatSupportedSOFT: unsafe extern "C" fn(device: *mut ALCdevice, frequency: ALCsizei, channels: ALCenum, type_: ALCenum) -> ALCboolean,
277		pub fn alcRenderSamplesSOFT: unsafe extern "C" fn(device: *mut ALCdevice, buffer: *mut ALvoid, samples: ALCsizei),
278	}
279
280
281	pub ext ALC_EXT_thread_local_context {
282		pub fn alcSetThreadContext: unsafe extern "C" fn(ctx: *mut ALCcontext) -> ALCboolean,
283		pub fn alcGetThreadContext: unsafe extern "C" fn() -> *mut ALCcontext,
284	}
285}
286
287
288alc_ext! {
289	pub(crate) cache AlcCache;
290
291
292	pub ext ALC_EXT_DEDICATED {
293		pub const AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT,
294		pub const AL_EFFECT_DEDICATED_DIALOGUE,
295		pub const AL_EFFECT_DEDICATED_GAIN,
296	}
297
298
299	pub ext ALC_EXT_DISCONNECT {
300		pub const ALC_CONNECTED,
301	}
302
303
304	pub ext ALC_EXT_EFX {
305		pub const AL_EFFECTSLOT_EFFECT,
306		pub const AL_EFFECTSLOT_GAIN,
307		pub const AL_EFFECTSLOT_AUXILIARY_SEND_AUTO,
308
309		pub const AL_EFFECT_TYPE,
310		pub const AL_EFFECT_EAXREVERB,
311		pub const AL_EAXREVERB_DENSITY,
312		pub const AL_EAXREVERB_DIFFUSION,
313		pub const AL_EAXREVERB_GAIN,
314		pub const AL_EAXREVERB_GAINHF,
315		pub const AL_EAXREVERB_GAINLF,
316		pub const AL_EAXREVERB_DECAY_TIME,
317		pub const AL_EAXREVERB_DECAY_HFRATIO,
318		pub const AL_EAXREVERB_DECAY_LFRATIO,
319		pub const AL_EAXREVERB_REFLECTIONS_GAIN,
320		pub const AL_EAXREVERB_REFLECTIONS_DELAY,
321		pub const AL_EAXREVERB_REFLECTIONS_PAN,
322		pub const AL_EAXREVERB_LATE_REVERB_GAIN,
323		pub const AL_EAXREVERB_LATE_REVERB_DELAY,
324		pub const AL_EAXREVERB_LATE_REVERB_PAN,
325		pub const AL_EAXREVERB_ECHO_TIME,
326		pub const AL_EAXREVERB_ECHO_DEPTH,
327		pub const AL_EAXREVERB_MODULATION_TIME,
328		pub const AL_EAXREVERB_MODULATION_DEPTH,
329		pub const AL_EAXREVERB_AIR_ABSORPTION_GAINHF,
330		pub const AL_EAXREVERB_HFREFERENCE,
331		pub const AL_EAXREVERB_LFREFERENCE,
332		pub const AL_EAXREVERB_ROOM_ROLLOFF_FACTOR,
333		pub const AL_EAXREVERB_DECAY_HFLIMIT,
334		pub const AL_EFFECT_REVERB,
335		pub const AL_REVERB_DENSITY,
336		pub const AL_REVERB_DIFFUSION,
337		pub const AL_REVERB_GAIN,
338		pub const AL_REVERB_GAINHF,
339		pub const AL_REVERB_DECAY_TIME,
340		pub const AL_REVERB_DECAY_HFRATIO,
341		pub const AL_REVERB_REFLECTIONS_GAIN,
342		pub const AL_REVERB_REFLECTIONS_DELAY,
343		pub const AL_REVERB_LATE_REVERB_GAIN,
344		pub const AL_REVERB_LATE_REVERB_DELAY,
345		pub const AL_REVERB_AIR_ABSORPTION_GAINHF,
346		pub const AL_REVERB_ROOM_ROLLOFF_FACTOR,
347		pub const AL_REVERB_DECAY_HFLIMIT,
348		pub const AL_EFFECT_CHORUS,
349		pub const AL_CHORUS_WAVEFORM,
350		pub const AL_CHORUS_PHASE,
351		pub const AL_CHORUS_RATE,
352		pub const AL_CHORUS_DEPTH,
353		pub const AL_CHORUS_FEEDBACK,
354		pub const AL_CHORUS_DELAY,
355		pub const AL_EFFECT_DISTORTION,
356		pub const AL_DISTORTION_EDGE,
357		pub const AL_DISTORTION_GAIN,
358		pub const AL_DISTORTION_LOWPASS_CUTOFF,
359		pub const AL_DISTORTION_EQCENTER,
360		pub const AL_DISTORTION_EQBANDWIDTH,
361		pub const AL_EFFECT_ECHO,
362		pub const AL_ECHO_DELAY,
363		pub const AL_ECHO_LRDELAY,
364		pub const AL_ECHO_DAMPING,
365		pub const AL_ECHO_FEEDBACK,
366		pub const AL_ECHO_SPREAD,
367		pub const AL_EFFECT_FLANGER,
368		pub const AL_FLANGER_WAVEFORM,
369		pub const AL_FLANGER_PHASE,
370		pub const AL_FLANGER_RATE,
371		pub const AL_FLANGER_DEPTH,
372		pub const AL_FLANGER_FEEDBACK,
373		pub const AL_FLANGER_DELAY,
374		pub const AL_EFFECT_FREQUENCY_SHIFTER,
375		pub const AL_FREQUENCY_SHIFTER_FREQUENCY,
376		pub const AL_FREQUENCY_SHIFTER_LEFT_DIRECTION,
377		pub const AL_FREQUENCY_SHIFTER_RIGHT_DIRECTION,
378		pub const AL_EFFECT_VOCAL_MORPHER,
379		pub const AL_VOCAL_MORPHER_PHONEMEA,
380		pub const AL_VOCAL_MORPHER_PHONEMEB,
381		pub const AL_VOCAL_MORPHER_PHONEMEA_COARSE_TUNING,
382		pub const AL_VOCAL_MORPHER_PHONEMEB_COARSE_TUNING,
383		pub const AL_VOCAL_MORPHER_WAVEFORM,
384		pub const AL_VOCAL_MORPHER_RATE,
385		pub const AL_EFFECT_PITCH_SHIFTER,
386		pub const AL_PITCH_SHIFTER_COARSE_TUNE,
387		pub const AL_PITCH_SHIFTER_FINE_TUNE,
388		pub const AL_EFFECT_RING_MODULATOR,
389		pub const AL_RING_MODULATOR_FREQUENCY,
390		pub const AL_RING_MODULATOR_HIGHPASS_CUTOFF,
391		pub const AL_RING_MODULATOR_WAVEFORM,
392		pub const AL_EFFECT_AUTOWAH,
393		pub const AL_AUTOWAH_ATTACK_TIME,
394		pub const AL_AUTOWAH_RELEASE_TIME,
395		pub const AL_AUTOWAH_RESONANCE,
396		pub const AL_AUTOWAH_PEAK_GAIN,
397		pub const AL_EFFECT_COMPRESSOR,
398		pub const AL_COMPRESSOR_ONOFF,
399		pub const AL_EFFECT_EQUALIZER,
400		pub const AL_EQUALIZER_LOW_GAIN,
401		pub const AL_EQUALIZER_LOW_CUTOFF,
402		pub const AL_EQUALIZER_MID1_GAIN,
403		pub const AL_EQUALIZER_MID1_CENTER,
404		pub const AL_EQUALIZER_MID1_WIDTH,
405		pub const AL_EQUALIZER_MID2_GAIN,
406		pub const AL_EQUALIZER_MID2_CENTER,
407		pub const AL_EQUALIZER_MID2_WIDTH,
408		pub const AL_EQUALIZER_HIGH_GAIN,
409		pub const AL_EQUALIZER_HIGH_CUTOFF,
410
411		pub const AL_FILTER_TYPE,
412		pub const AL_FILTER_LOWPASS,
413		pub const AL_LOWPASS_GAIN,
414		pub const AL_LOWPASS_GAINHF,
415		pub const AL_FILTER_HIGHPASS,
416		pub const AL_HIGHPASS_GAIN,
417		pub const AL_HIGHPASS_GAINLF,
418		pub const AL_FILTER_BANDPASS,
419		pub const AL_BANDPASS_GAIN,
420		pub const AL_BANDPASS_GAINLF,
421		pub const AL_BANDPASS_GAINHF,
422
423		pub const AL_DIRECT_FILTER,
424		pub const AL_AUXILIARY_SEND_FILTER,
425		pub const AL_AIR_ABSORPTION_FACTOR,
426		pub const AL_ROOM_ROLLOFF_FACTOR,
427		pub const AL_CONE_OUTER_GAINHF,
428		pub const AL_DIRECT_FILTER_GAINHF_AUTO,
429		pub const AL_AUXILIARY_SEND_FILTER_GAIN_AUTO,
430		pub const AL_AUXILIARY_SEND_FILTER_GAINHF_AUTO,
431
432		pub const AL_METERS_PER_UNIT,
433
434		pub const ALC_EFX_MAJOR_VERSION,
435		pub const ALC_EFX_MINOR_VERSION,
436		pub const ALC_MAX_AUXILIARY_SENDS,
437
438
439		pub fn alGenAuxiliaryEffectSlots: unsafe extern "C" fn(n: ALsizei, auxiliaryeffectslots: *mut ALuint),
440		pub fn alDeleteAuxiliaryEffectSlots: unsafe extern "C" fn(n: ALsizei, auxiliaryeffectslots: *mut ALuint),
441		pub fn alIsAuxiliaryEffectSlot: unsafe extern "C" fn(auxiliaryeffectslot: ALuint),
442		pub fn alAuxiliaryEffectSloti: unsafe extern "C" fn(auxiliaryeffectslot: ALuint, param: ALenum, iValue: ALint),
443		pub fn alAuxiliaryEffectSlotiv: unsafe extern "C" fn(auxiliaryeffectslot: ALuint, param: ALenum, piValues: *mut ALint),
444		pub fn alAuxiliaryEffectSlotf: unsafe extern "C" fn(auxiliaryeffectslot: ALuint, param: ALenum, flValue: ALfloat),
445		pub fn alAuxiliaryEffectSlotfv: unsafe extern "C" fn(auxiliaryeffectslot: ALuint, param: ALenum, pflValues: *mut ALfloat),
446		pub fn alGetAuxiliaryEffectSloti: unsafe extern "C" fn(auxiliaryeffectslot: ALuint, param: ALenum, piValue: *mut ALint),
447		pub fn alGetAuxiliaryEffectSlotiv: unsafe extern "C" fn(auxiliaryeffectslot: ALuint, param: ALenum, piValues: *mut ALint),
448		pub fn alGetAuxiliaryEffectSlotf: unsafe extern "C" fn(auxiliaryeffectslot: ALuint, param: ALenum, pflValue: *mut ALfloat),
449		pub fn alGetAuxiliaryEffectSlotfv: unsafe extern "C" fn(auxiliaryeffectslot: ALuint, param: ALenum, pflValues: *mut ALfloat),
450
451		pub fn alGenEffects: unsafe extern "C" fn(n: ALsizei, effects: *mut ALuint),
452		pub fn alDeleteEffects: unsafe extern "C" fn(n: ALsizei, effects: *mut ALuint),
453		pub fn alIsEffect: unsafe extern "C" fn(effect: ALuint),
454		pub fn alEffecti: unsafe extern "C" fn(effect: ALuint, param: ALenum, iValue: ALint),
455		pub fn alEffectiv: unsafe extern "C" fn(effect: ALuint, param: ALenum, piValues: *mut ALint),
456		pub fn alEffectf: unsafe extern "C" fn(effect: ALuint, param: ALenum, flValue: ALfloat),
457		pub fn alEffectfv: unsafe extern "C" fn(effect: ALuint, param: ALenum, pflValues: *mut ALfloat),
458		pub fn alGetEffecti: unsafe extern "C" fn(effect: ALuint, param: ALenum, piValue: *mut ALint),
459		pub fn alGetEffectiv: unsafe extern "C" fn(effect: ALuint, param: ALenum, piValues: *mut ALint),
460		pub fn alGetEffectf: unsafe extern "C" fn(effect: ALuint, param: ALenum, pflValue: *mut ALfloat),
461		pub fn alGetEffectfv: unsafe extern "C" fn(effect: ALuint, param: ALenum, pflValues: *mut ALfloat),
462
463		pub fn alGenFilters: unsafe extern "C" fn(n: ALsizei, filters: *mut ALuint),
464		pub fn alDeleteFilters: unsafe extern "C" fn(n: ALsizei, filters: *mut ALuint),
465		pub fn alIsFilter: unsafe extern "C" fn(filter: ALuint),
466		pub fn alFilteri: unsafe extern "C" fn(filter: ALuint, param: ALenum, iValue: ALint),
467		pub fn alFilteriv: unsafe extern "C" fn(filter: ALuint, param: ALenum, piValues: *mut ALint),
468		pub fn alFilterf: unsafe extern "C" fn(filter: ALuint, param: ALenum, flValue: ALfloat),
469		pub fn alFilterfv: unsafe extern "C" fn(filter: ALuint, param: ALenum, pflValues: *mut ALfloat),
470		pub fn alGetFilteri: unsafe extern "C" fn(filter: ALuint, param: ALenum, piValue: *mut ALint),
471		pub fn alGetFilteriv: unsafe extern "C" fn(filter: ALuint, param: ALenum, piValues: *mut ALint),
472		pub fn alGetFilterf: unsafe extern "C" fn(filter: ALuint, param: ALenum, pflValue: *mut ALfloat),
473		pub fn alGetFilterfv: unsafe extern "C" fn(filter: ALuint, param: ALenum, pflValues: *mut ALfloat),
474	}
475
476
477	pub ext ALC_SOFT_HRTF {
478		pub const ALC_HRTF_SOFT,
479		pub const ALC_HRTF_ID_SOFT,
480		pub const ALC_DONT_CARE_SOFT,
481		pub const ALC_HRTF_STATUS_SOFT,
482		pub const ALC_NUM_HRTF_SPECIFIERS_SOFT,
483		pub const ALC_HRTF_SPECIFIER_SOFT,
484		pub const ALC_HRTF_DISABLED_SOFT,
485		pub const ALC_HRTF_ENABLED_SOFT,
486		pub const ALC_HRTF_DENIED_SOFT,
487		pub const ALC_HRTF_REQUIRED_SOFT,
488		pub const ALC_HRTF_HEADPHONES_DETECTED_SOFT,
489		pub const ALC_HRTF_UNSUPPORTED_FORMAT_SOFT,
490
491		pub fn alcGetStringiSOFT: unsafe extern "C" fn(dev: *mut ALCdevice, paramName: ALCenum, index: ALCsizei) -> *const ALCchar,
492		pub fn alcResetDeviceSOFT: unsafe extern "C" fn(dev: *mut ALCdevice, attrList: *const ALCint) -> ALCboolean,
493	}
494
495
496	pub ext ALC_SOFT_pause_device {
497		pub fn alcDevicePauseSOFT: unsafe extern "C" fn(dev: *mut ALCdevice),
498		pub fn alcDeviceResumeSOFT: unsafe extern "C" fn(dev: *mut ALCdevice),
499	}
500
501
502	pub ext ALC_SOFT_output_limiter {
503		pub const ALC_OUTPUT_LIMITER_SOFT,
504		pub const ALC_DONT_CARE_SOFT,
505
506		pub fn alcResetDeviceSOFT: unsafe extern "C" fn(dev: *mut ALCdevice, attrList: *const ALCint) -> ALCboolean,
507	}
508}
509
510
511pub type ALint64SOFT = i64;
512pub type ALuint64SOFT = u64;
513
514
515al_ext! {
516	pub(crate) cache AlCache;
517
518
519	pub ext AL_EXT_ALAW {
520		pub const AL_FORMAT_MONO_ALAW_EXT,
521		pub const AL_FORMAT_STEREO_ALAW_EXT,
522	}
523
524
525	pub ext AL_EXT_BFORMAT {
526		pub const AL_FORMAT_BFORMAT2D_8,
527		pub const AL_FORMAT_BFORMAT2D_16,
528		pub const AL_FORMAT_BFORMAT2D_FLOAT32,
529		pub const AL_FORMAT_BFORMAT3D_8,
530		pub const AL_FORMAT_BFORMAT3D_16,
531		pub const AL_FORMAT_BFORMAT3D_FLOAT32,
532	}
533
534
535	pub ext AL_EXT_double {
536		pub const AL_FORMAT_MONO_DOUBLE_EXT,
537		pub const AL_FORMAT_STEREO_DOUBLE_EXT,
538	}
539
540
541	pub ext AL_EXT_float32 {
542		pub const AL_FORMAT_MONO_FLOAT32,
543		pub const AL_FORMAT_STEREO_FLOAT32,
544	}
545
546
547	pub ext AL_EXT_IMA4 {
548		pub const AL_FORMAT_MONO_IMA4,
549		pub const AL_FORMAT_STEREO_IMA4,
550	}
551
552
553	pub ext AL_EXT_MCFORMATS {
554		pub const AL_FORMAT_QUAD8,
555		pub const AL_FORMAT_QUAD16,
556		pub const AL_FORMAT_QUAD32,
557		pub const AL_FORMAT_REAR8,
558		pub const AL_FORMAT_REAR16,
559		pub const AL_FORMAT_REAR32,
560		pub const AL_FORMAT_51CHN8,
561		pub const AL_FORMAT_51CHN16,
562		pub const AL_FORMAT_51CHN32,
563		pub const AL_FORMAT_61CHN8,
564		pub const AL_FORMAT_61CHN16,
565		pub const AL_FORMAT_61CHN32,
566		pub const AL_FORMAT_71CHN8,
567		pub const AL_FORMAT_71CHN16,
568		pub const AL_FORMAT_71CHN32,
569	}
570
571
572	pub ext AL_EXT_MULAW {
573		pub const AL_FORMAT_MONO_MULAW_EXT,
574		pub const AL_FORMAT_STEREO_MULAW_EXT,
575	}
576
577
578	pub ext AL_EXT_MULAW_BFORMAT {
579		pub const AL_FORMAT_BFORMAT2D_MULAW,
580		pub const AL_FORMAT_BFORMAT3D_MULAW,
581	}
582
583
584	pub ext AL_EXT_MULAW_MCFORMATS {
585		pub const AL_FORMAT_MONO_MULAW,
586		pub const AL_FORMAT_STEREO_MULAW,
587		pub const AL_FORMAT_QUAD_MULAW,
588		pub const AL_FORMAT_REAR_MULAW,
589		pub const AL_FORMAT_51CHN_MULAW,
590		pub const AL_FORMAT_61CHN_MULAW,
591		pub const AL_FORMAT_71CHN_MULAW,
592	}
593
594
595	pub ext AL_SOFT_block_alignment {
596		pub const AL_UNPACK_BLOCK_ALIGNMENT_SOFT,
597		pub const AL_PACK_BLOCK_ALIGNMENT_SOFT,
598	}
599
600
601//	pub ext AL_SOFT_buffer_samples {
602//		pub const AL_MONO_SOFT,
603//		pub const AL_STEREO_SOFT,
604//		pub const AL_REAR_SOFT,
605//		pub const AL_QUAD_SOFT,
606//		pub const AL_5POINT1_SOFT,
607//		pub const AL_6POINT1_SOFT,
608//		pub const AL_7POINT1_SOFT,
609//
610//		pub const AL_BYTE_SOFT,
611//		pub const AL_UNSIGNED_BYTE_SOFT,
612//		pub const AL_SHORT_SOFT,
613//		pub const AL_UNSIGNED_SHORT_SOFT,
614//		pub const AL_INT_SOFT,
615//		pub const AL_UNSIGNED_INT_SOFT,
616//		pub const AL_FLOAT_SOFT,
617//		pub const AL_DOUBLE_SOFT,
618//		pub const AL_BYTE3_SOFT,
619//		pub const AL_UNSIGNED_BYTE3_SOFT,
620//
621//		pub const AL_MONO8_SOFT,
622//		pub const AL_MONO16_SOFT,
623//		pub const AL_MONO32F_SOFT,
624//		pub const AL_STEREO8_SOFT,
625//		pub const AL_STEREO16_SOFT,
626//		pub const AL_STEREO32F_SOFT,
627//		pub const AL_QUAD8_SOFT,
628//		pub const AL_QUAD16_SOFT,
629//		pub const AL_QUAD32F_SOFT,
630//		pub const AL_REAR8_SOFT,
631//		pub const AL_REAR16_SOFT,
632//		pub const AL_REAR32F_SOFT,
633//		pub const AL_5POINT1_8_SOFT,
634//		pub const AL_5POINT1_16_SOFT,
635//		pub const AL_5POINT1_32F_SOFT,
636//		pub const AL_6POINT1_8_SOFT,
637//		pub const AL_6POINT1_16_SOFT,
638//		pub const AL_6POINT1_32F_SOFT,
639//		pub const AL_7POINT1_8_SOFT,
640//		pub const AL_7POINT1_16_SOFT,
641//		pub const AL_7POINT1_32F_SOFT,
642//
643//		pub const AL_INTERNAL_FORMAT_SOFT,
644//		pub const AL_BYTE_LENGTH_SOFT,
645//		pub const AL_SAMPLE_LENGTH_SOFT,
646//		pub const AL_SEC_LENGTH_SOFT,
647//
648//		pub fn alBufferSamplesSOFT: unsafe extern "C" fn(buffer: ALuint, samplerate: ALuint, internalformat: ALenum, samples: ALsizei, channels: ALenum, type_: ALenum, data: *const ALvoid),
649//		pub fn alBufferSubSamplesSOFT: unsafe extern "C" fn(buffer: ALuint, offset: ALsizei, samples: ALsizei, channels: ALenum, type_: ALenum, data: *const ALvoid),
650//		pub fn alGetBufferSamplesSOFT: unsafe extern "C" fn(buffer: ALuint, offset: ALsizei, samples: ALsizei, channels: ALenum, type_: ALenum, data: *mut ALvoid),
651//		pub fn alIsBufferFormatSupportedSOFT: unsafe extern "C" fn(format: ALenum) -> ALboolean,
652//	}
653//
654//
655//	pub ext AL_SOFT_buffer_sub_data {
656//		pub const AL_BYTE_RW_OFFSETS_SOFT,
657//		pub const AL_SAMPLE_RW_OFFSETS_SOFT,
658//
659//		pub fn alBufferSubDataSOFT: unsafe extern "C" fn(buffer: ALuint, format: ALenum, data: *const ALvoid, offset: ALsizei, length: ALsizei),
660//	}
661
662
663	pub ext AL_SOFT_deferred_updates {
664		pub const AL_DEFERRED_UPDATES_SOFT,
665
666		pub fn alDeferUpdatesSOFT: unsafe extern "C" fn(),
667		pub fn alProcessUpdatesSOFT: unsafe extern "C" fn(),
668	}
669
670
671	pub ext AL_SOFT_direct_channels {
672		pub const AL_DIRECT_CHANNELS_SOFT,
673	}
674
675
676	pub ext AL_SOFT_loop_points {
677		pub const AL_LOOP_POINTS_SOFT,
678	}
679
680
681	pub ext AL_SOFT_MSADPCM {
682		pub const AL_FORMAT_MONO_MSADPCM_SOFT,
683		pub const AL_FORMAT_STEREO_MSADPCM_SOFT,
684	}
685
686
687	pub ext AL_SOFT_source_latency {
688		pub const AL_SAMPLE_OFFSET_LATENCY_SOFT,
689		pub const AL_SEC_OFFSET_LATENCY_SOFT,
690
691		pub fn alSourcedSOFT: unsafe extern "C" fn(source: ALuint, param: ALenum, value: ALdouble),
692		pub fn alSource3dSOFT: unsafe extern "C" fn(source: ALuint, param: ALenum, value1: ALdouble, value2: ALdouble, value3: ALdouble),
693		pub fn alSourcedvSOFT: unsafe extern "C" fn(source: ALuint, param: ALenum, values: *const ALdouble),
694		pub fn alGetSourcedSOFT: unsafe extern "C" fn(source: ALuint, param: ALenum, value: *mut ALdouble),
695		pub fn alGetSource3dSOFT: unsafe extern "C" fn(source: ALuint, param: ALenum, value1: *mut ALdouble, value2: *mut ALdouble, value3: *mut ALdouble),
696		pub fn alGetSourcedvSOFT: unsafe extern "C" fn(source: ALuint, param: ALenum, values: *mut ALdouble),
697		pub fn alSourcei64SOFT: unsafe extern "C" fn(source: ALuint, param: ALenum, value: ALint64SOFT),
698		pub fn alSource3i64SOFT: unsafe extern "C" fn(source: ALuint, param: ALenum, value1: ALint64SOFT, value2: ALint64SOFT, value3: ALint64SOFT),
699		pub fn alSourcei64vSOFT: unsafe extern "C" fn(source: ALuint, param: ALenum, values: *const ALint64SOFT),
700		pub fn alGetSourcei64SOFT: unsafe extern "C" fn(source: ALuint, param: ALenum, value: *mut ALint64SOFT),
701		pub fn alGetSource3i64SOFT: unsafe extern "C" fn(source: ALuint, param: ALenum, value1: *mut ALint64SOFT, value2: *mut ALint64SOFT, value3: *mut ALint64SOFT),
702		pub fn alGetSourcei64vSOFT: unsafe extern "C" fn(source: ALuint, param: ALenum, values: *mut ALint64SOFT),
703	}
704
705
706	pub ext AL_SOFT_source_length {
707		pub const AL_BYTE_LENGTH_SOFT,
708		pub const AL_SAMPLE_LENGTH_SOFT,
709		pub const AL_SEC_LENGTH_SOFT,
710	}
711
712
713	pub ext AL_EXT_source_distance_model {
714		pub const AL_SOURCE_DISTANCE_MODEL,
715	}
716
717
718	pub ext AL_EXT_STEREO_ANGLES {
719		pub const AL_STEREO_ANGLES,
720	}
721
722
723	pub ext AL_EXT_SOURCE_RADIUS {
724		pub const AL_SOURCE_RADIUS,
725	}
726
727
728	pub ext AL_SOFT_gain_clamp_ex {
729		pub const AL_GAIN_LIMIT_SOFT,
730	}
731
732
733	pub ext AL_SOFT_source_resampler {
734		pub const AL_NUM_RESAMPLERS_SOFT,
735		pub const AL_DEFAULT_RESAMPLER_SOFT,
736		pub const AL_SOURCE_RESAMPLER_SOFT,
737		pub const AL_RESAMPLER_NAME_SOFT,
738
739		pub fn alGetStringiSOFT: unsafe extern "C" fn(paramName: ALenum, index: ALsizei) -> *const ALchar,
740	}
741
742
743	pub ext AL_SOFT_source_spatialize {
744		pub const AL_SOURCE_SPATIALIZE_SOFT,
745		pub const AL_AUTO_SOFT,
746	}
747}
748
749