From e001baafe3fd87aeb8b30ba3e3eb0c2d1e33d50d Mon Sep 17 00:00:00 2001 From: miniaudio-rs-bindgen Date: Mon, 28 Dec 2020 04:36:56 +0000 Subject: [PATCH] Updated bindings for macOS-latest --- .../macos-x86_64/bindings-with-vorbis.rs | 1142 +++++++---------- .../bindings/macos-x86_64/bindings.rs | 1142 +++++++---------- 2 files changed, 988 insertions(+), 1296 deletions(-) diff --git a/miniaudio-sys/bindings/macos-x86_64/bindings-with-vorbis.rs b/miniaudio-sys/bindings/macos-x86_64/bindings-with-vorbis.rs index 91d62e8..98b4b5f 100644 --- a/miniaudio-sys/bindings/macos-x86_64/bindings-with-vorbis.rs +++ b/miniaudio-sys/bindings/macos-x86_64/bindings-with-vorbis.rs @@ -1,89 +1,8 @@ -/* automatically generated by rust-bindgen 0.55.1 */ +/* automatically generated by rust-bindgen 0.56.0 */ -#[repr(C)] -#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] -pub struct __BindgenBitfieldUnit { - storage: Storage, - align: [Align; 0], -} -impl __BindgenBitfieldUnit { - #[inline] - pub const fn new(storage: Storage) -> Self { - Self { storage, align: [] } - } -} -impl __BindgenBitfieldUnit -where - Storage: AsRef<[u8]> + AsMut<[u8]>, -{ - #[inline] - pub fn get_bit(&self, index: usize) -> bool { - debug_assert!(index / 8 < self.storage.as_ref().len()); - let byte_index = index / 8; - let byte = self.storage.as_ref()[byte_index]; - let bit_index = if cfg!(target_endian = "big") { - 7 - (index % 8) - } else { - index % 8 - }; - let mask = 1 << bit_index; - byte & mask == mask - } - #[inline] - pub fn set_bit(&mut self, index: usize, val: bool) { - debug_assert!(index / 8 < self.storage.as_ref().len()); - let byte_index = index / 8; - let byte = &mut self.storage.as_mut()[byte_index]; - let bit_index = if cfg!(target_endian = "big") { - 7 - (index % 8) - } else { - index % 8 - }; - let mask = 1 << bit_index; - if val { - *byte |= mask; - } else { - *byte &= !mask; - } - } - #[inline] - pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { - debug_assert!(bit_width <= 64); - debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); - let mut val = 0; - for i in 0..(bit_width as usize) { - if self.get_bit(i + bit_offset) { - let index = if cfg!(target_endian = "big") { - bit_width as usize - 1 - i - } else { - i - }; - val |= 1 << index; - } - } - val - } - #[inline] - pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { - debug_assert!(bit_width <= 64); - debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); - for i in 0..(bit_width as usize) { - let mask = 1 << i; - let val_bit_is_set = val & mask == mask; - let index = if cfg!(target_endian = "big") { - bit_width as usize - 1 - i - } else { - i - }; - self.set_bit(index + bit_offset, val_bit_is_set); - } - } -} pub const MA_VERSION_MAJOR: u32 = 0; pub const MA_VERSION_MINOR: u32 = 10; -pub const MA_VERSION_REVISION: u32 = 24; +pub const MA_VERSION_REVISION: u32 = 29; pub const MA_TRUE: u32 = 1; pub const MA_FALSE: u32 = 0; pub const MA_SIZE_MAX: u32 = 4294967295; @@ -3673,7 +3592,10 @@ pub struct ma_channel_converter { pub channelMapOut: [ma_channel; 32usize], pub mixingMode: ma_channel_mix_mode, pub weights: ma_channel_converter__bindgen_ty_1, - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>, + pub isPassthrough: ma_bool8, + pub isSimpleShuffle: ma_bool8, + pub isSimpleMonoExpansion: ma_bool8, + pub isStereoToMono: ma_bool8, pub shuffleTable: [ma_uint8; 32usize], } #[repr(C)] @@ -3823,9 +3745,58 @@ fn bindgen_test_layout_ma_channel_converter() { ); assert_eq!( unsafe { - &(*(::core::ptr::null::())).shuffleTable as *const _ as usize + &(*(::core::ptr::null::())).isPassthrough as *const _ as usize + }, + 4176usize, + concat!( + "Offset of field: ", + stringify!(ma_channel_converter), + "::", + stringify!(isPassthrough) + ) + ); + assert_eq!( + unsafe { + &(*(::core::ptr::null::())).isSimpleShuffle as *const _ as usize }, 4177usize, + concat!( + "Offset of field: ", + stringify!(ma_channel_converter), + "::", + stringify!(isSimpleShuffle) + ) + ); + assert_eq!( + unsafe { + &(*(::core::ptr::null::())).isSimpleMonoExpansion as *const _ + as usize + }, + 4178usize, + concat!( + "Offset of field: ", + stringify!(ma_channel_converter), + "::", + stringify!(isSimpleMonoExpansion) + ) + ); + assert_eq!( + unsafe { + &(*(::core::ptr::null::())).isStereoToMono as *const _ as usize + }, + 4179usize, + concat!( + "Offset of field: ", + stringify!(ma_channel_converter), + "::", + stringify!(isStereoToMono) + ) + ); + assert_eq!( + unsafe { + &(*(::core::ptr::null::())).shuffleTable as *const _ as usize + }, + 4180usize, concat!( "Offset of field: ", stringify!(ma_channel_converter), @@ -3836,81 +3807,7 @@ fn bindgen_test_layout_ma_channel_converter() { } impl ::core::fmt::Debug for ma_channel_converter { fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - write ! (f , "ma_channel_converter {{ format: {:?}, channelsIn: {:?}, channelsOut: {:?}, channelMapIn: [...], channelMapOut: [...], mixingMode: {:?}, weights: {:?}, isPassthrough : {:?}, isSimpleShuffle : {:?}, isSimpleMonoExpansion : {:?}, isStereoToMono : {:?}, shuffleTable: [...] }}" , self . format , self . channelsIn , self . channelsOut , self . mixingMode , self . weights , self . isPassthrough () , self . isSimpleShuffle () , self . isSimpleMonoExpansion () , self . isStereoToMono ()) - } -} -impl ma_channel_converter { - #[inline] - pub fn isPassthrough(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } - } - #[inline] - pub fn set_isPassthrough(&mut self, val: ma_bool32) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn isSimpleShuffle(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } - } - #[inline] - pub fn set_isSimpleShuffle(&mut self, val: ma_bool32) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(1usize, 1u8, val as u64) - } - } - #[inline] - pub fn isSimpleMonoExpansion(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } - } - #[inline] - pub fn set_isSimpleMonoExpansion(&mut self, val: ma_bool32) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(2usize, 1u8, val as u64) - } - } - #[inline] - pub fn isStereoToMono(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) } - } - #[inline] - pub fn set_isStereoToMono(&mut self, val: ma_bool32) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(3usize, 1u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - isPassthrough: ma_bool32, - isSimpleShuffle: ma_bool32, - isSimpleMonoExpansion: ma_bool32, - isStereoToMono: ma_bool32, - ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = - Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let isPassthrough: u32 = unsafe { ::core::mem::transmute(isPassthrough) }; - isPassthrough as u64 - }); - __bindgen_bitfield_unit.set(1usize, 1u8, { - let isSimpleShuffle: u32 = unsafe { ::core::mem::transmute(isSimpleShuffle) }; - isSimpleShuffle as u64 - }); - __bindgen_bitfield_unit.set(2usize, 1u8, { - let isSimpleMonoExpansion: u32 = - unsafe { ::core::mem::transmute(isSimpleMonoExpansion) }; - isSimpleMonoExpansion as u64 - }); - __bindgen_bitfield_unit.set(3usize, 1u8, { - let isStereoToMono: u32 = unsafe { ::core::mem::transmute(isStereoToMono) }; - isStereoToMono as u64 - }); - __bindgen_bitfield_unit + write ! (f , "ma_channel_converter {{ format: {:?}, channelsIn: {:?}, channelsOut: {:?}, channelMapIn: [...], channelMapOut: [...], mixingMode: {:?}, weights: {:?}, isPassthrough: {:?}, isSimpleShuffle: {:?}, isSimpleMonoExpansion: {:?}, isStereoToMono: {:?}, shuffleTable: [...] }}" , self . format , self . channelsIn , self . channelsOut , self . mixingMode , self . weights , self . isPassthrough , self . isSimpleShuffle , self . isSimpleMonoExpansion , self . isStereoToMono) } } extern "C" { @@ -4292,8 +4189,11 @@ pub struct ma_data_converter { pub config: ma_data_converter_config, pub channelConverter: ma_channel_converter, pub resampler: ma_resampler, - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>, - pub __bindgen_padding_0: [u8; 7usize], + pub hasPreFormatConversion: ma_bool8, + pub hasPostFormatConversion: ma_bool8, + pub hasChannelConverter: ma_bool8, + pub hasResampler: ma_bool8, + pub isPassthrough: ma_bool8, } #[test] fn bindgen_test_layout_ma_data_converter() { @@ -4339,101 +4239,70 @@ fn bindgen_test_layout_ma_data_converter() { stringify!(resampler) ) ); -} -impl ::core::fmt::Debug for ma_data_converter { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - write ! (f , "ma_data_converter {{ config: {:?}, channelConverter: {:?}, resampler: {:?}, hasPreFormatConversion : {:?}, hasPostFormatConversion : {:?}, hasChannelConverter : {:?}, hasResampler : {:?}, isPassthrough : {:?} }}" , self . config , self . channelConverter , self . resampler , self . hasPreFormatConversion () , self . hasPostFormatConversion () , self . hasChannelConverter () , self . hasResampler () , self . isPassthrough ()) - } -} -impl ma_data_converter { - #[inline] - pub fn hasPreFormatConversion(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } - } - #[inline] - pub fn set_hasPreFormatConversion(&mut self, val: ma_bool32) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn hasPostFormatConversion(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } - } - #[inline] - pub fn set_hasPostFormatConversion(&mut self, val: ma_bool32) { + assert_eq!( unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(1usize, 1u8, val as u64) - } - } - #[inline] - pub fn hasChannelConverter(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } - } - #[inline] - pub fn set_hasChannelConverter(&mut self, val: ma_bool32) { + &(*(::core::ptr::null::())).hasPreFormatConversion as *const _ + as usize + }, + 10088usize, + concat!( + "Offset of field: ", + stringify!(ma_data_converter), + "::", + stringify!(hasPreFormatConversion) + ) + ); + assert_eq!( unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(2usize, 1u8, val as u64) - } - } - #[inline] - pub fn hasResampler(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) } - } - #[inline] - pub fn set_hasResampler(&mut self, val: ma_bool32) { + &(*(::core::ptr::null::())).hasPostFormatConversion as *const _ + as usize + }, + 10089usize, + concat!( + "Offset of field: ", + stringify!(ma_data_converter), + "::", + stringify!(hasPostFormatConversion) + ) + ); + assert_eq!( unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(3usize, 1u8, val as u64) - } - } - #[inline] - pub fn isPassthrough(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) } - } - #[inline] - pub fn set_isPassthrough(&mut self, val: ma_bool32) { + &(*(::core::ptr::null::())).hasChannelConverter as *const _ as usize + }, + 10090usize, + concat!( + "Offset of field: ", + stringify!(ma_data_converter), + "::", + stringify!(hasChannelConverter) + ) + ); + assert_eq!( + unsafe { &(*(::core::ptr::null::())).hasResampler as *const _ as usize }, + 10091usize, + concat!( + "Offset of field: ", + stringify!(ma_data_converter), + "::", + stringify!(hasResampler) + ) + ); + assert_eq!( unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(4usize, 1u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - hasPreFormatConversion: ma_bool32, - hasPostFormatConversion: ma_bool32, - hasChannelConverter: ma_bool32, - hasResampler: ma_bool32, - isPassthrough: ma_bool32, - ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = - Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let hasPreFormatConversion: u32 = - unsafe { ::core::mem::transmute(hasPreFormatConversion) }; - hasPreFormatConversion as u64 - }); - __bindgen_bitfield_unit.set(1usize, 1u8, { - let hasPostFormatConversion: u32 = - unsafe { ::core::mem::transmute(hasPostFormatConversion) }; - hasPostFormatConversion as u64 - }); - __bindgen_bitfield_unit.set(2usize, 1u8, { - let hasChannelConverter: u32 = unsafe { ::core::mem::transmute(hasChannelConverter) }; - hasChannelConverter as u64 - }); - __bindgen_bitfield_unit.set(3usize, 1u8, { - let hasResampler: u32 = unsafe { ::core::mem::transmute(hasResampler) }; - hasResampler as u64 - }); - __bindgen_bitfield_unit.set(4usize, 1u8, { - let isPassthrough: u32 = unsafe { ::core::mem::transmute(isPassthrough) }; - isPassthrough as u64 - }); - __bindgen_bitfield_unit + &(*(::core::ptr::null::())).isPassthrough as *const _ as usize + }, + 10092usize, + concat!( + "Offset of field: ", + stringify!(ma_data_converter), + "::", + stringify!(isPassthrough) + ) + ); +} +impl ::core::fmt::Debug for ma_data_converter { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + write ! (f , "ma_data_converter {{ config: {:?}, channelConverter: {:?}, resampler: {:?}, hasPreFormatConversion: {:?}, hasPostFormatConversion: {:?}, hasChannelConverter: {:?}, hasResampler: {:?}, isPassthrough: {:?} }}" , self . config , self . channelConverter , self . resampler , self . hasPreFormatConversion , self . hasPostFormatConversion , self . hasChannelConverter , self . hasResampler , self . isPassthrough) } } extern "C" { @@ -4687,6 +4556,9 @@ extern "C" { } extern "C" { #[doc = "Channel Maps"] + pub fn ma_channel_map_init_blank(channels: ma_uint32, pChannelMap: *mut ma_channel); +} +extern "C" { pub fn ma_get_standard_channel_map( standardChannelMap: ma_standard_channel_map, channels: ma_uint32, @@ -4757,7 +4629,8 @@ pub struct ma_rb { pub subbufferStrideInBytes: ma_uint32, pub encodedReadOffset: ma_uint32, pub encodedWriteOffset: ma_uint32, - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>, + pub ownsBuffer: ma_bool8, + pub clearOnWriteAcquire: ma_bool8, pub allocationCallbacks: ma_allocation_callbacks, } #[test] @@ -4832,6 +4705,26 @@ fn bindgen_test_layout_ma_rb() { stringify!(encodedWriteOffset) ) ); + assert_eq!( + unsafe { &(*(::core::ptr::null::())).ownsBuffer as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(ma_rb), + "::", + stringify!(ownsBuffer) + ) + ); + assert_eq!( + unsafe { &(*(::core::ptr::null::())).clearOnWriteAcquire as *const _ as usize }, + 29usize, + concat!( + "Offset of field: ", + stringify!(ma_rb), + "::", + stringify!(clearOnWriteAcquire) + ) + ); assert_eq!( unsafe { &(*(::core::ptr::null::())).allocationCallbacks as *const _ as usize }, 32usize, @@ -4843,47 +4736,6 @@ fn bindgen_test_layout_ma_rb() { ) ); } -impl ma_rb { - #[inline] - pub fn ownsBuffer(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } - } - #[inline] - pub fn set_ownsBuffer(&mut self, val: ma_bool32) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn clearOnWriteAcquire(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } - } - #[inline] - pub fn set_clearOnWriteAcquire(&mut self, val: ma_bool32) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(1usize, 1u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - ownsBuffer: ma_bool32, - clearOnWriteAcquire: ma_bool32, - ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = - Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let ownsBuffer: u32 = unsafe { ::core::mem::transmute(ownsBuffer) }; - ownsBuffer as u64 - }); - __bindgen_bitfield_unit.set(1usize, 1u8, { - let clearOnWriteAcquire: u32 = unsafe { ::core::mem::transmute(clearOnWriteAcquire) }; - clearOnWriteAcquire as u64 - }); - __bindgen_bitfield_unit - } -} extern "C" { pub fn ma_rb_init_ex( subbufferSizeInBytes: usize, @@ -5821,8 +5673,8 @@ pub struct ma_device_config { pub periodSizeInMilliseconds: ma_uint32, pub periods: ma_uint32, pub performanceProfile: ma_performance_profile, - pub noPreZeroedOutputBuffer: ma_bool32, - pub noClip: ma_bool32, + pub noPreZeroedOutputBuffer: ma_bool8, + pub noClip: ma_bool8, pub dataCallback: ma_device_callback_proc, pub stopCallback: ma_stop_proc, pub pUserData: *mut libc::c_void, @@ -5974,6 +5826,7 @@ pub struct ma_device_config__bindgen_ty_2 { pub format: ma_format, pub channels: ma_uint32, pub channelMap: [ma_channel; 32usize], + pub channelMixMode: ma_channel_mix_mode, pub shareMode: ma_share_mode, } #[test] @@ -6041,10 +5894,23 @@ fn bindgen_test_layout_ma_device_config__bindgen_ty_2() { ); assert_eq!( unsafe { - &(*(::core::ptr::null::())).shareMode as *const _ + &(*(::core::ptr::null::())).channelMixMode as *const _ as usize }, 48usize, + concat!( + "Offset of field: ", + stringify!(ma_device_config__bindgen_ty_2), + "::", + stringify!(channelMixMode) + ) + ); + assert_eq!( + unsafe { + &(*(::core::ptr::null::())).shareMode as *const _ + as usize + }, + 52usize, concat!( "Offset of field: ", stringify!(ma_device_config__bindgen_ty_2), @@ -6060,6 +5926,7 @@ pub struct ma_device_config__bindgen_ty_3 { pub format: ma_format, pub channels: ma_uint32, pub channelMap: [ma_channel; 32usize], + pub channelMixMode: ma_channel_mix_mode, pub shareMode: ma_share_mode, } #[test] @@ -6127,10 +5994,23 @@ fn bindgen_test_layout_ma_device_config__bindgen_ty_3() { ); assert_eq!( unsafe { - &(*(::core::ptr::null::())).shareMode as *const _ + &(*(::core::ptr::null::())).channelMixMode as *const _ as usize }, 48usize, + concat!( + "Offset of field: ", + stringify!(ma_device_config__bindgen_ty_3), + "::", + stringify!(channelMixMode) + ) + ); + assert_eq!( + unsafe { + &(*(::core::ptr::null::())).shareMode as *const _ + as usize + }, + 52usize, concat!( "Offset of field: ", stringify!(ma_device_config__bindgen_ty_3), @@ -6142,21 +6022,21 @@ fn bindgen_test_layout_ma_device_config__bindgen_ty_3() { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ma_device_config__bindgen_ty_4 { - pub noAutoConvertSRC: ma_bool32, - pub noDefaultQualitySRC: ma_bool32, - pub noAutoStreamRouting: ma_bool32, - pub noHardwareOffloading: ma_bool32, + pub noAutoConvertSRC: ma_bool8, + pub noDefaultQualitySRC: ma_bool8, + pub noAutoStreamRouting: ma_bool8, + pub noHardwareOffloading: ma_bool8, } #[test] fn bindgen_test_layout_ma_device_config__bindgen_ty_4() { assert_eq!( ::core::mem::size_of::(), - 16usize, + 4usize, concat!("Size of: ", stringify!(ma_device_config__bindgen_ty_4)) ); assert_eq!( ::core::mem::align_of::(), - 4usize, + 1usize, concat!("Alignment of ", stringify!(ma_device_config__bindgen_ty_4)) ); assert_eq!( @@ -6177,7 +6057,7 @@ fn bindgen_test_layout_ma_device_config__bindgen_ty_4() { &(*(::core::ptr::null::())).noDefaultQualitySRC as *const _ as usize }, - 4usize, + 1usize, concat!( "Offset of field: ", stringify!(ma_device_config__bindgen_ty_4), @@ -6190,7 +6070,7 @@ fn bindgen_test_layout_ma_device_config__bindgen_ty_4() { &(*(::core::ptr::null::())).noAutoStreamRouting as *const _ as usize }, - 8usize, + 2usize, concat!( "Offset of field: ", stringify!(ma_device_config__bindgen_ty_4), @@ -6203,7 +6083,7 @@ fn bindgen_test_layout_ma_device_config__bindgen_ty_4() { &(*(::core::ptr::null::())).noHardwareOffloading as *const _ as usize }, - 12usize, + 3usize, concat!( "Offset of field: ", stringify!(ma_device_config__bindgen_ty_4), @@ -6467,7 +6347,7 @@ fn bindgen_test_layout_ma_device_config__bindgen_ty_9() { fn bindgen_test_layout_ma_device_config() { assert_eq!( ::core::mem::size_of::(), - 256usize, + 248usize, concat!("Size of: ", stringify!(ma_device_config)) ); assert_eq!( @@ -6557,7 +6437,7 @@ fn bindgen_test_layout_ma_device_config() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).noClip as *const _ as usize }, - 28usize, + 25usize, concat!( "Offset of field: ", stringify!(ma_device_config), @@ -6637,7 +6517,7 @@ fn bindgen_test_layout_ma_device_config() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).alsa as *const _ as usize }, - 200usize, + 188usize, concat!( "Offset of field: ", stringify!(ma_device_config), @@ -6647,7 +6527,7 @@ fn bindgen_test_layout_ma_device_config() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).pulse as *const _ as usize }, - 216usize, + 208usize, concat!( "Offset of field: ", stringify!(ma_device_config), @@ -6657,7 +6537,7 @@ fn bindgen_test_layout_ma_device_config() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).coreaudio as *const _ as usize }, - 232usize, + 224usize, concat!( "Offset of field: ", stringify!(ma_device_config), @@ -6667,7 +6547,7 @@ fn bindgen_test_layout_ma_device_config() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).opensl as *const _ as usize }, - 236usize, + 228usize, concat!( "Offset of field: ", stringify!(ma_device_config), @@ -6677,7 +6557,7 @@ fn bindgen_test_layout_ma_device_config() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).aaudio as *const _ as usize }, - 244usize, + 236usize, concat!( "Offset of field: ", stringify!(ma_device_config), @@ -6828,6 +6708,7 @@ pub struct ma_backend_callbacks { pub onContextInit: ::core::option::Option< unsafe extern "C" fn( pContext: *mut ma_context, + pConfig: *const ma_context_config, pCallbacks: *mut ma_backend_callbacks, ) -> ma_result, >, @@ -6851,7 +6732,7 @@ pub struct ma_backend_callbacks { pub onDeviceInit: ::core::option::Option< unsafe extern "C" fn( pDevice: *mut ma_device, - deviceType: ma_device_type, + pConfig: *const ma_device_config, pDescriptorPlayback: *mut ma_device_descriptor, pDescriptorCapture: *mut ma_device_descriptor, ) -> ma_result, @@ -7373,6 +7254,7 @@ fn bindgen_test_layout_ma_context_config() { #[repr(C)] #[derive(Copy, Clone)] pub struct ma_context { + pub callbacks: ma_backend_callbacks, pub backend: ma_backend, pub logCallback: ma_log_proc, pub threadPriority: ma_thread_priority, @@ -7385,7 +7267,7 @@ pub struct ma_context { pub playbackDeviceInfoCount: ma_uint32, pub captureDeviceInfoCount: ma_uint32, pub pDeviceInfos: *mut ma_device_info, - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>, + pub isBackendAsynchronous: ma_bool8, pub onUninit: ::core::option::Option ma_result>, pub onEnumDevices: ::core::option::Option< @@ -7425,7 +7307,6 @@ pub struct ma_context { #[derive(Copy, Clone)] pub union ma_context__bindgen_ty_1 { pub coreaudio: ma_context__bindgen_ty_1__bindgen_ty_1, - pub custom: ma_backend_callbacks, pub null_backend: ma_context__bindgen_ty_1__bindgen_ty_2, _bindgen_union_align: [u64; 23usize], } @@ -7835,18 +7716,6 @@ fn bindgen_test_layout_ma_context__bindgen_ty_1() { stringify!(coreaudio) ) ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).custom as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ma_context__bindgen_ty_1), - "::", - stringify!(custom) - ) - ); assert_eq!( unsafe { &(*(::core::ptr::null::())).null_backend as *const _ as usize @@ -8163,7 +8032,7 @@ impl ::core::fmt::Debug for ma_context__bindgen_ty_2 { fn bindgen_test_layout_ma_context() { assert_eq!( ::core::mem::size_of::(), - 608usize, + 696usize, concat!("Size of: ", stringify!(ma_context)) ); assert_eq!( @@ -8172,8 +8041,18 @@ fn bindgen_test_layout_ma_context() { concat!("Alignment of ", stringify!(ma_context)) ); assert_eq!( - unsafe { &(*(::core::ptr::null::())).backend as *const _ as usize }, + unsafe { &(*(::core::ptr::null::())).callbacks as *const _ as usize }, 0usize, + concat!( + "Offset of field: ", + stringify!(ma_context), + "::", + stringify!(callbacks) + ) + ); + assert_eq!( + unsafe { &(*(::core::ptr::null::())).backend as *const _ as usize }, + 88usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8183,7 +8062,7 @@ fn bindgen_test_layout_ma_context() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).logCallback as *const _ as usize }, - 8usize, + 96usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8193,7 +8072,7 @@ fn bindgen_test_layout_ma_context() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).threadPriority as *const _ as usize }, - 16usize, + 104usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8203,7 +8082,7 @@ fn bindgen_test_layout_ma_context() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).threadStackSize as *const _ as usize }, - 24usize, + 112usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8213,7 +8092,7 @@ fn bindgen_test_layout_ma_context() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).pUserData as *const _ as usize }, - 32usize, + 120usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8223,7 +8102,7 @@ fn bindgen_test_layout_ma_context() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).allocationCallbacks as *const _ as usize }, - 40usize, + 128usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8233,7 +8112,7 @@ fn bindgen_test_layout_ma_context() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).deviceEnumLock as *const _ as usize }, - 72usize, + 160usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8243,7 +8122,7 @@ fn bindgen_test_layout_ma_context() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).deviceInfoLock as *const _ as usize }, - 136usize, + 224usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8253,7 +8132,7 @@ fn bindgen_test_layout_ma_context() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).deviceInfoCapacity as *const _ as usize }, - 200usize, + 288usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8265,7 +8144,7 @@ fn bindgen_test_layout_ma_context() { unsafe { &(*(::core::ptr::null::())).playbackDeviceInfoCount as *const _ as usize }, - 204usize, + 292usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8277,7 +8156,7 @@ fn bindgen_test_layout_ma_context() { unsafe { &(*(::core::ptr::null::())).captureDeviceInfoCount as *const _ as usize }, - 208usize, + 296usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8287,7 +8166,7 @@ fn bindgen_test_layout_ma_context() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).pDeviceInfos as *const _ as usize }, - 216usize, + 304usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8295,9 +8174,21 @@ fn bindgen_test_layout_ma_context() { stringify!(pDeviceInfos) ) ); + assert_eq!( + unsafe { + &(*(::core::ptr::null::())).isBackendAsynchronous as *const _ as usize + }, + 312usize, + concat!( + "Offset of field: ", + stringify!(ma_context), + "::", + stringify!(isBackendAsynchronous) + ) + ); assert_eq!( unsafe { &(*(::core::ptr::null::())).onUninit as *const _ as usize }, - 232usize, + 320usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8307,7 +8198,7 @@ fn bindgen_test_layout_ma_context() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).onEnumDevices as *const _ as usize }, - 240usize, + 328usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8317,7 +8208,7 @@ fn bindgen_test_layout_ma_context() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).onGetDeviceInfo as *const _ as usize }, - 248usize, + 336usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8327,7 +8218,7 @@ fn bindgen_test_layout_ma_context() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).onDeviceInit as *const _ as usize }, - 256usize, + 344usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8337,7 +8228,7 @@ fn bindgen_test_layout_ma_context() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).onDeviceUninit as *const _ as usize }, - 264usize, + 352usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8347,7 +8238,7 @@ fn bindgen_test_layout_ma_context() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).onDeviceStart as *const _ as usize }, - 272usize, + 360usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8357,7 +8248,7 @@ fn bindgen_test_layout_ma_context() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).onDeviceStop as *const _ as usize }, - 280usize, + 368usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8367,7 +8258,7 @@ fn bindgen_test_layout_ma_context() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).onDeviceMainLoop as *const _ as usize }, - 288usize, + 376usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8378,33 +8269,7 @@ fn bindgen_test_layout_ma_context() { } impl ::core::fmt::Debug for ma_context { fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - write ! (f , "ma_context {{ backend: {:?}, logCallback: {:?}, threadPriority: {:?}, threadStackSize: {:?}, pUserData: {:?}, allocationCallbacks: {:?}, deviceEnumLock: {:?}, deviceInfoLock: {:?}, deviceInfoCapacity: {:?}, playbackDeviceInfoCount: {:?}, captureDeviceInfoCount: {:?}, pDeviceInfos: {:?}, isBackendAsynchronous : {:?}, onUninit: {:?}, onEnumDevices: {:?}, onGetDeviceInfo: {:?}, onDeviceInit: {:?}, onDeviceUninit: {:?}, onDeviceStart: {:?}, onDeviceStop: {:?}, onDeviceMainLoop: {:?}, __bindgen_anon_1: {:?}, __bindgen_anon_2: {:?} }}" , self . backend , self . logCallback , self . threadPriority , self . threadStackSize , self . pUserData , self . allocationCallbacks , self . deviceEnumLock , self . deviceInfoLock , self . deviceInfoCapacity , self . playbackDeviceInfoCount , self . captureDeviceInfoCount , self . pDeviceInfos , self . isBackendAsynchronous () , self . onUninit , self . onEnumDevices , self . onGetDeviceInfo , self . onDeviceInit , self . onDeviceUninit , self . onDeviceStart , self . onDeviceStop , self . onDeviceMainLoop , self . __bindgen_anon_1 , self . __bindgen_anon_2) - } -} -impl ma_context { - #[inline] - pub fn isBackendAsynchronous(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } - } - #[inline] - pub fn set_isBackendAsynchronous(&mut self, val: ma_bool32) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - isBackendAsynchronous: ma_bool32, - ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = - Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let isBackendAsynchronous: u32 = - unsafe { ::core::mem::transmute(isBackendAsynchronous) }; - isBackendAsynchronous as u64 - }); - __bindgen_bitfield_unit + write ! (f , "ma_context {{ callbacks: {:?}, backend: {:?}, logCallback: {:?}, threadPriority: {:?}, threadStackSize: {:?}, pUserData: {:?}, allocationCallbacks: {:?}, deviceEnumLock: {:?}, deviceInfoLock: {:?}, deviceInfoCapacity: {:?}, playbackDeviceInfoCount: {:?}, captureDeviceInfoCount: {:?}, pDeviceInfos: {:?}, isBackendAsynchronous: {:?}, onUninit: {:?}, onEnumDevices: {:?}, onGetDeviceInfo: {:?}, onDeviceInit: {:?}, onDeviceUninit: {:?}, onDeviceStart: {:?}, onDeviceStop: {:?}, onDeviceMainLoop: {:?}, __bindgen_anon_1: {:?}, __bindgen_anon_2: {:?} }}" , self . callbacks , self . backend , self . logCallback , self . threadPriority , self . threadStackSize , self . pUserData , self . allocationCallbacks , self . deviceEnumLock , self . deviceInfoLock , self . deviceInfoCapacity , self . playbackDeviceInfoCount , self . captureDeviceInfoCount , self . pDeviceInfos , self . isBackendAsynchronous , self . onUninit , self . onEnumDevices , self . onGetDeviceInfo , self . onDeviceInit , self . onDeviceUninit , self . onDeviceStart , self . onDeviceStop , self . onDeviceMainLoop , self . __bindgen_anon_1 , self . __bindgen_anon_2) } } #[repr(C)] @@ -8423,7 +8288,12 @@ pub struct ma_device { pub stopEvent: ma_event, pub thread: ma_thread, pub workResult: ma_result, - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>, + pub usingDefaultSampleRate: ma_bool8, + pub usingDefaultBufferSize: ma_bool8, + pub usingDefaultPeriods: ma_bool8, + pub isOwnerOfContext: ma_bool8, + pub noPreZeroedOutputBuffer: ma_bool8, + pub noClip: ma_bool8, pub masterVolumeFactor: f32, pub duplexRB: ma_duplex_rb, pub resampling: ma_device__bindgen_ty_1, @@ -8563,7 +8433,6 @@ pub struct ma_device__bindgen_ty_2 { pub id: ma_device_id, pub name: [libc::c_char; 256usize], pub shareMode: ma_share_mode, - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>, pub format: ma_format, pub channels: ma_uint32, pub channelMap: [ma_channel; 32usize], @@ -8573,13 +8442,17 @@ pub struct ma_device__bindgen_ty_2 { pub internalChannelMap: [ma_channel; 32usize], pub internalPeriodSizeInFrames: ma_uint32, pub internalPeriods: ma_uint32, + pub channelMixMode: ma_channel_mix_mode, pub converter: ma_data_converter, + pub usingDefaultFormat: ma_bool8, + pub usingDefaultChannels: ma_bool8, + pub usingDefaultChannelMap: ma_bool8, } #[test] fn bindgen_test_layout_ma_device__bindgen_ty_2() { assert_eq!( ::core::mem::size_of::(), - 10712usize, + 10720usize, concat!("Size of: ", stringify!(ma_device__bindgen_ty_2)) ); assert_eq!( @@ -8621,7 +8494,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_2() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).format as *const _ as usize }, - 520usize, + 516usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_2), @@ -8633,7 +8506,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_2() { unsafe { &(*(::core::ptr::null::())).channels as *const _ as usize }, - 524usize, + 520usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_2), @@ -8645,7 +8518,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_2() { unsafe { &(*(::core::ptr::null::())).channelMap as *const _ as usize }, - 528usize, + 524usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_2), @@ -8657,7 +8530,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_2() { unsafe { &(*(::core::ptr::null::())).internalFormat as *const _ as usize }, - 560usize, + 556usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_2), @@ -8670,7 +8543,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_2() { &(*(::core::ptr::null::())).internalChannels as *const _ as usize }, - 564usize, + 560usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_2), @@ -8683,7 +8556,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_2() { &(*(::core::ptr::null::())).internalSampleRate as *const _ as usize }, - 568usize, + 564usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_2), @@ -8696,7 +8569,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_2() { &(*(::core::ptr::null::())).internalChannelMap as *const _ as usize }, - 572usize, + 568usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_2), @@ -8709,7 +8582,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_2() { &(*(::core::ptr::null::())).internalPeriodSizeInFrames as *const _ as usize }, - 604usize, + 600usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_2), @@ -8722,7 +8595,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_2() { &(*(::core::ptr::null::())).internalPeriods as *const _ as usize }, - 608usize, + 604usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_2), @@ -8730,6 +8603,18 @@ fn bindgen_test_layout_ma_device__bindgen_ty_2() { stringify!(internalPeriods) ) ); + assert_eq!( + unsafe { + &(*(::core::ptr::null::())).channelMixMode as *const _ as usize + }, + 608usize, + concat!( + "Offset of field: ", + stringify!(ma_device__bindgen_ty_2), + "::", + stringify!(channelMixMode) + ) + ); assert_eq!( unsafe { &(*(::core::ptr::null::())).converter as *const _ as usize @@ -8742,68 +8627,49 @@ fn bindgen_test_layout_ma_device__bindgen_ty_2() { stringify!(converter) ) ); -} -impl ::core::fmt::Debug for ma_device__bindgen_ty_2 { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - write ! (f , "ma_device__bindgen_ty_2 {{ id: {:?}, name: [...], shareMode: {:?}, usingDefaultFormat : {:?}, usingDefaultChannels : {:?}, usingDefaultChannelMap : {:?}, format: {:?}, channels: {:?}, channelMap: [...], internalFormat: {:?}, internalChannels: {:?}, internalSampleRate: {:?}, internalChannelMap: [...], internalPeriodSizeInFrames: {:?}, internalPeriods: {:?}, converter: {:?} }}" , self . id , self . shareMode , self . usingDefaultFormat () , self . usingDefaultChannels () , self . usingDefaultChannelMap () , self . format , self . channels , self . internalFormat , self . internalChannels , self . internalSampleRate , self . internalPeriodSizeInFrames , self . internalPeriods , self . converter) - } -} -impl ma_device__bindgen_ty_2 { - #[inline] - pub fn usingDefaultFormat(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } - } - #[inline] - pub fn set_usingDefaultFormat(&mut self, val: ma_bool32) { + assert_eq!( unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn usingDefaultChannels(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } - } - #[inline] - pub fn set_usingDefaultChannels(&mut self, val: ma_bool32) { + &(*(::core::ptr::null::())).usingDefaultFormat as *const _ + as usize + }, + 10712usize, + concat!( + "Offset of field: ", + stringify!(ma_device__bindgen_ty_2), + "::", + stringify!(usingDefaultFormat) + ) + ); + assert_eq!( unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(1usize, 1u8, val as u64) - } - } - #[inline] - pub fn usingDefaultChannelMap(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } - } - #[inline] - pub fn set_usingDefaultChannelMap(&mut self, val: ma_bool32) { + &(*(::core::ptr::null::())).usingDefaultChannels as *const _ + as usize + }, + 10713usize, + concat!( + "Offset of field: ", + stringify!(ma_device__bindgen_ty_2), + "::", + stringify!(usingDefaultChannels) + ) + ); + assert_eq!( unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(2usize, 1u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - usingDefaultFormat: ma_bool32, - usingDefaultChannels: ma_bool32, - usingDefaultChannelMap: ma_bool32, - ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = - Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let usingDefaultFormat: u32 = unsafe { ::core::mem::transmute(usingDefaultFormat) }; - usingDefaultFormat as u64 - }); - __bindgen_bitfield_unit.set(1usize, 1u8, { - let usingDefaultChannels: u32 = unsafe { ::core::mem::transmute(usingDefaultChannels) }; - usingDefaultChannels as u64 - }); - __bindgen_bitfield_unit.set(2usize, 1u8, { - let usingDefaultChannelMap: u32 = - unsafe { ::core::mem::transmute(usingDefaultChannelMap) }; - usingDefaultChannelMap as u64 - }); - __bindgen_bitfield_unit + &(*(::core::ptr::null::())).usingDefaultChannelMap as *const _ + as usize + }, + 10714usize, + concat!( + "Offset of field: ", + stringify!(ma_device__bindgen_ty_2), + "::", + stringify!(usingDefaultChannelMap) + ) + ); +} +impl ::core::fmt::Debug for ma_device__bindgen_ty_2 { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + write ! (f , "ma_device__bindgen_ty_2 {{ id: {:?}, name: [...], shareMode: {:?}, format: {:?}, channels: {:?}, channelMap: [...], internalFormat: {:?}, internalChannels: {:?}, internalSampleRate: {:?}, internalChannelMap: [...], internalPeriodSizeInFrames: {:?}, internalPeriods: {:?}, channelMixMode: {:?}, converter: {:?}, usingDefaultFormat: {:?}, usingDefaultChannels: {:?}, usingDefaultChannelMap: {:?} }}" , self . id , self . shareMode , self . format , self . channels , self . internalFormat , self . internalChannels , self . internalSampleRate , self . internalPeriodSizeInFrames , self . internalPeriods , self . channelMixMode , self . converter , self . usingDefaultFormat , self . usingDefaultChannels , self . usingDefaultChannelMap) } } #[repr(C)] @@ -8812,7 +8678,6 @@ pub struct ma_device__bindgen_ty_3 { pub id: ma_device_id, pub name: [libc::c_char; 256usize], pub shareMode: ma_share_mode, - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>, pub format: ma_format, pub channels: ma_uint32, pub channelMap: [ma_channel; 32usize], @@ -8822,13 +8687,17 @@ pub struct ma_device__bindgen_ty_3 { pub internalChannelMap: [ma_channel; 32usize], pub internalPeriodSizeInFrames: ma_uint32, pub internalPeriods: ma_uint32, + pub channelMixMode: ma_channel_mix_mode, pub converter: ma_data_converter, + pub usingDefaultFormat: ma_bool8, + pub usingDefaultChannels: ma_bool8, + pub usingDefaultChannelMap: ma_bool8, } #[test] fn bindgen_test_layout_ma_device__bindgen_ty_3() { assert_eq!( ::core::mem::size_of::(), - 10712usize, + 10720usize, concat!("Size of: ", stringify!(ma_device__bindgen_ty_3)) ); assert_eq!( @@ -8870,7 +8739,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_3() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).format as *const _ as usize }, - 520usize, + 516usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_3), @@ -8882,7 +8751,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_3() { unsafe { &(*(::core::ptr::null::())).channels as *const _ as usize }, - 524usize, + 520usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_3), @@ -8894,7 +8763,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_3() { unsafe { &(*(::core::ptr::null::())).channelMap as *const _ as usize }, - 528usize, + 524usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_3), @@ -8906,7 +8775,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_3() { unsafe { &(*(::core::ptr::null::())).internalFormat as *const _ as usize }, - 560usize, + 556usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_3), @@ -8919,7 +8788,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_3() { &(*(::core::ptr::null::())).internalChannels as *const _ as usize }, - 564usize, + 560usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_3), @@ -8932,7 +8801,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_3() { &(*(::core::ptr::null::())).internalSampleRate as *const _ as usize }, - 568usize, + 564usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_3), @@ -8945,7 +8814,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_3() { &(*(::core::ptr::null::())).internalChannelMap as *const _ as usize }, - 572usize, + 568usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_3), @@ -8958,7 +8827,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_3() { &(*(::core::ptr::null::())).internalPeriodSizeInFrames as *const _ as usize }, - 604usize, + 600usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_3), @@ -8971,7 +8840,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_3() { &(*(::core::ptr::null::())).internalPeriods as *const _ as usize }, - 608usize, + 604usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_3), @@ -8979,6 +8848,18 @@ fn bindgen_test_layout_ma_device__bindgen_ty_3() { stringify!(internalPeriods) ) ); + assert_eq!( + unsafe { + &(*(::core::ptr::null::())).channelMixMode as *const _ as usize + }, + 608usize, + concat!( + "Offset of field: ", + stringify!(ma_device__bindgen_ty_3), + "::", + stringify!(channelMixMode) + ) + ); assert_eq!( unsafe { &(*(::core::ptr::null::())).converter as *const _ as usize @@ -8991,68 +8872,49 @@ fn bindgen_test_layout_ma_device__bindgen_ty_3() { stringify!(converter) ) ); -} -impl ::core::fmt::Debug for ma_device__bindgen_ty_3 { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - write ! (f , "ma_device__bindgen_ty_3 {{ id: {:?}, name: [...], shareMode: {:?}, usingDefaultFormat : {:?}, usingDefaultChannels : {:?}, usingDefaultChannelMap : {:?}, format: {:?}, channels: {:?}, channelMap: [...], internalFormat: {:?}, internalChannels: {:?}, internalSampleRate: {:?}, internalChannelMap: [...], internalPeriodSizeInFrames: {:?}, internalPeriods: {:?}, converter: {:?} }}" , self . id , self . shareMode , self . usingDefaultFormat () , self . usingDefaultChannels () , self . usingDefaultChannelMap () , self . format , self . channels , self . internalFormat , self . internalChannels , self . internalSampleRate , self . internalPeriodSizeInFrames , self . internalPeriods , self . converter) - } -} -impl ma_device__bindgen_ty_3 { - #[inline] - pub fn usingDefaultFormat(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } - } - #[inline] - pub fn set_usingDefaultFormat(&mut self, val: ma_bool32) { + assert_eq!( unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn usingDefaultChannels(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } - } - #[inline] - pub fn set_usingDefaultChannels(&mut self, val: ma_bool32) { + &(*(::core::ptr::null::())).usingDefaultFormat as *const _ + as usize + }, + 10712usize, + concat!( + "Offset of field: ", + stringify!(ma_device__bindgen_ty_3), + "::", + stringify!(usingDefaultFormat) + ) + ); + assert_eq!( unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(1usize, 1u8, val as u64) - } - } - #[inline] - pub fn usingDefaultChannelMap(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } - } - #[inline] - pub fn set_usingDefaultChannelMap(&mut self, val: ma_bool32) { + &(*(::core::ptr::null::())).usingDefaultChannels as *const _ + as usize + }, + 10713usize, + concat!( + "Offset of field: ", + stringify!(ma_device__bindgen_ty_3), + "::", + stringify!(usingDefaultChannels) + ) + ); + assert_eq!( unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(2usize, 1u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - usingDefaultFormat: ma_bool32, - usingDefaultChannels: ma_bool32, - usingDefaultChannelMap: ma_bool32, - ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = - Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let usingDefaultFormat: u32 = unsafe { ::core::mem::transmute(usingDefaultFormat) }; - usingDefaultFormat as u64 - }); - __bindgen_bitfield_unit.set(1usize, 1u8, { - let usingDefaultChannels: u32 = unsafe { ::core::mem::transmute(usingDefaultChannels) }; - usingDefaultChannels as u64 - }); - __bindgen_bitfield_unit.set(2usize, 1u8, { - let usingDefaultChannelMap: u32 = - unsafe { ::core::mem::transmute(usingDefaultChannelMap) }; - usingDefaultChannelMap as u64 - }); - __bindgen_bitfield_unit + &(*(::core::ptr::null::())).usingDefaultChannelMap as *const _ + as usize + }, + 10714usize, + concat!( + "Offset of field: ", + stringify!(ma_device__bindgen_ty_3), + "::", + stringify!(usingDefaultChannelMap) + ) + ); +} +impl ::core::fmt::Debug for ma_device__bindgen_ty_3 { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + write ! (f , "ma_device__bindgen_ty_3 {{ id: {:?}, name: [...], shareMode: {:?}, format: {:?}, channels: {:?}, channelMap: [...], internalFormat: {:?}, internalChannels: {:?}, internalSampleRate: {:?}, internalChannelMap: [...], internalPeriodSizeInFrames: {:?}, internalPeriods: {:?}, channelMixMode: {:?}, converter: {:?}, usingDefaultFormat: {:?}, usingDefaultChannels: {:?}, usingDefaultChannelMap: {:?} }}" , self . id , self . shareMode , self . format , self . channels , self . internalFormat , self . internalChannels , self . internalSampleRate , self . internalPeriodSizeInFrames , self . internalPeriods , self . channelMixMode , self . converter , self . usingDefaultFormat , self . usingDefaultChannels , self . usingDefaultChannelMap) } } #[repr(C)] @@ -9060,7 +8922,7 @@ impl ma_device__bindgen_ty_3 { pub union ma_device__bindgen_ty_4 { pub coreaudio: ma_device__bindgen_ty_4__bindgen_ty_1, pub null_device: ma_device__bindgen_ty_4__bindgen_ty_2, - _bindgen_union_align: [u64; 38usize], + _bindgen_union_align: [u64; 53usize], } #[repr(C)] #[derive(Copy, Clone)] @@ -9070,7 +8932,7 @@ pub struct ma_device__bindgen_ty_4__bindgen_ty_1 { pub audioUnitPlayback: ma_ptr, pub audioUnitCapture: ma_ptr, pub pAudioBufferList: ma_ptr, - pub audioBufferSizeInBytes: ma_uint32, + pub audioBufferCapInFrames: ma_uint32, pub stopEvent: ma_event, pub originalPeriodSizeInFrames: ma_uint32, pub originalPeriodSizeInMilliseconds: ma_uint32, @@ -9168,14 +9030,14 @@ fn bindgen_test_layout_ma_device__bindgen_ty_4__bindgen_ty_1() { assert_eq!( unsafe { &(*(::core::ptr::null::())) - .audioBufferSizeInBytes as *const _ as usize + .audioBufferCapInFrames as *const _ as usize }, 32usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_4__bindgen_ty_1), "::", - stringify!(audioBufferSizeInBytes) + stringify!(audioBufferCapInFrames) ) ); assert_eq!( @@ -9311,7 +9173,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_4__bindgen_ty_1() { } impl ::core::fmt::Debug for ma_device__bindgen_ty_4__bindgen_ty_1 { fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - write ! (f , "ma_device__bindgen_ty_4__bindgen_ty_1 {{ deviceObjectIDPlayback: {:?}, deviceObjectIDCapture: {:?}, audioUnitPlayback: {:?}, audioUnitCapture: {:?}, pAudioBufferList: {:?}, audioBufferSizeInBytes: {:?}, stopEvent: {:?}, originalPeriodSizeInFrames: {:?}, originalPeriodSizeInMilliseconds: {:?}, originalPeriods: {:?}, isDefaultPlaybackDevice: {:?}, isDefaultCaptureDevice: {:?}, isSwitchingPlaybackDevice: {:?}, isSwitchingCaptureDevice: {:?}, duplexRB: {:?}, pRouteChangeHandler: {:?} }}" , self . deviceObjectIDPlayback , self . deviceObjectIDCapture , self . audioUnitPlayback , self . audioUnitCapture , self . pAudioBufferList , self . audioBufferSizeInBytes , self . stopEvent , self . originalPeriodSizeInFrames , self . originalPeriodSizeInMilliseconds , self . originalPeriods , self . isDefaultPlaybackDevice , self . isDefaultCaptureDevice , self . isSwitchingPlaybackDevice , self . isSwitchingCaptureDevice , self . duplexRB , self . pRouteChangeHandler) + write ! (f , "ma_device__bindgen_ty_4__bindgen_ty_1 {{ deviceObjectIDPlayback: {:?}, deviceObjectIDCapture: {:?}, audioUnitPlayback: {:?}, audioUnitCapture: {:?}, pAudioBufferList: {:?}, audioBufferCapInFrames: {:?}, stopEvent: {:?}, originalPeriodSizeInFrames: {:?}, originalPeriodSizeInMilliseconds: {:?}, originalPeriods: {:?}, isDefaultPlaybackDevice: {:?}, isDefaultCaptureDevice: {:?}, isSwitchingPlaybackDevice: {:?}, isSwitchingCaptureDevice: {:?}, duplexRB: {:?}, pRouteChangeHandler: {:?} }}" , self . deviceObjectIDPlayback , self . deviceObjectIDCapture , self . audioUnitPlayback , self . audioUnitCapture , self . pAudioBufferList , self . audioBufferCapInFrames , self . stopEvent , self . originalPeriodSizeInFrames , self . originalPeriodSizeInMilliseconds , self . originalPeriods , self . isDefaultPlaybackDevice , self . isDefaultCaptureDevice , self . isSwitchingPlaybackDevice , self . isSwitchingCaptureDevice , self . duplexRB , self . pRouteChangeHandler) } } #[repr(C)] @@ -9320,6 +9182,7 @@ pub struct ma_device__bindgen_ty_4__bindgen_ty_2 { pub deviceThread: ma_thread, pub operationEvent: ma_event, pub operationCompletionEvent: ma_event, + pub operationSemaphore: ma_semaphore, pub operation: ma_uint32, pub operationResult: ma_result, pub timer: ma_timer, @@ -9334,7 +9197,7 @@ pub struct ma_device__bindgen_ty_4__bindgen_ty_2 { fn bindgen_test_layout_ma_device__bindgen_ty_4__bindgen_ty_2() { assert_eq!( ::core::mem::size_of::(), - 304usize, + 424usize, concat!( "Size of: ", stringify!(ma_device__bindgen_ty_4__bindgen_ty_2) @@ -9387,12 +9250,25 @@ fn bindgen_test_layout_ma_device__bindgen_ty_4__bindgen_ty_2() { stringify!(operationCompletionEvent) ) ); + assert_eq!( + unsafe { + &(*(::core::ptr::null::())).operationSemaphore + as *const _ as usize + }, + 248usize, + concat!( + "Offset of field: ", + stringify!(ma_device__bindgen_ty_4__bindgen_ty_2), + "::", + stringify!(operationSemaphore) + ) + ); assert_eq!( unsafe { &(*(::core::ptr::null::())).operation as *const _ as usize }, - 248usize, + 368usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_4__bindgen_ty_2), @@ -9405,7 +9281,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_4__bindgen_ty_2() { &(*(::core::ptr::null::())).operationResult as *const _ as usize }, - 252usize, + 372usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_4__bindgen_ty_2), @@ -9418,7 +9294,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_4__bindgen_ty_2() { &(*(::core::ptr::null::())).timer as *const _ as usize }, - 256usize, + 376usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_4__bindgen_ty_2), @@ -9431,7 +9307,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_4__bindgen_ty_2() { &(*(::core::ptr::null::())).priorRunTime as *const _ as usize }, - 264usize, + 384usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_4__bindgen_ty_2), @@ -9444,7 +9320,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_4__bindgen_ty_2() { &(*(::core::ptr::null::())) .currentPeriodFramesRemainingPlayback as *const _ as usize }, - 272usize, + 392usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_4__bindgen_ty_2), @@ -9457,7 +9333,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_4__bindgen_ty_2() { &(*(::core::ptr::null::())) .currentPeriodFramesRemainingCapture as *const _ as usize }, - 276usize, + 396usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_4__bindgen_ty_2), @@ -9470,7 +9346,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_4__bindgen_ty_2() { &(*(::core::ptr::null::())) .lastProcessedFramePlayback as *const _ as usize }, - 280usize, + 400usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_4__bindgen_ty_2), @@ -9483,7 +9359,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_4__bindgen_ty_2() { &(*(::core::ptr::null::())) .lastProcessedFrameCapture as *const _ as usize }, - 288usize, + 408usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_4__bindgen_ty_2), @@ -9496,7 +9372,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_4__bindgen_ty_2() { &(*(::core::ptr::null::())).isStarted as *const _ as usize }, - 296usize, + 416usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_4__bindgen_ty_2), @@ -9507,14 +9383,14 @@ fn bindgen_test_layout_ma_device__bindgen_ty_4__bindgen_ty_2() { } impl ::core::fmt::Debug for ma_device__bindgen_ty_4__bindgen_ty_2 { fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - write ! (f , "ma_device__bindgen_ty_4__bindgen_ty_2 {{ deviceThread: {:?}, operationEvent: {:?}, operationCompletionEvent: {:?}, operation: {:?}, operationResult: {:?}, timer: {:?}, priorRunTime: {:?}, currentPeriodFramesRemainingPlayback: {:?}, currentPeriodFramesRemainingCapture: {:?}, lastProcessedFramePlayback: {:?}, lastProcessedFrameCapture: {:?}, isStarted: {:?} }}" , self . deviceThread , self . operationEvent , self . operationCompletionEvent , self . operation , self . operationResult , self . timer , self . priorRunTime , self . currentPeriodFramesRemainingPlayback , self . currentPeriodFramesRemainingCapture , self . lastProcessedFramePlayback , self . lastProcessedFrameCapture , self . isStarted) + write ! (f , "ma_device__bindgen_ty_4__bindgen_ty_2 {{ deviceThread: {:?}, operationEvent: {:?}, operationCompletionEvent: {:?}, operationSemaphore: {:?}, operation: {:?}, operationResult: {:?}, timer: {:?}, priorRunTime: {:?}, currentPeriodFramesRemainingPlayback: {:?}, currentPeriodFramesRemainingCapture: {:?}, lastProcessedFramePlayback: {:?}, lastProcessedFrameCapture: {:?}, isStarted: {:?} }}" , self . deviceThread , self . operationEvent , self . operationCompletionEvent , self . operationSemaphore , self . operation , self . operationResult , self . timer , self . priorRunTime , self . currentPeriodFramesRemainingPlayback , self . currentPeriodFramesRemainingCapture , self . lastProcessedFramePlayback , self . lastProcessedFrameCapture , self . isStarted) } } #[test] fn bindgen_test_layout_ma_device__bindgen_ty_4() { assert_eq!( ::core::mem::size_of::(), - 304usize, + 424usize, concat!("Size of: ", stringify!(ma_device__bindgen_ty_4)) ); assert_eq!( @@ -9556,7 +9432,7 @@ impl ::core::fmt::Debug for ma_device__bindgen_ty_4 { fn bindgen_test_layout_ma_device() { assert_eq!( ::core::mem::size_of::(), - 22312usize, + 22448usize, concat!("Size of: ", stringify!(ma_device)) ); assert_eq!( @@ -9695,8 +9571,74 @@ fn bindgen_test_layout_ma_device() { ) ); assert_eq!( - unsafe { &(*(::core::ptr::null::())).masterVolumeFactor as *const _ as usize }, + unsafe { + &(*(::core::ptr::null::())).usingDefaultSampleRate as *const _ as usize + }, + 484usize, + concat!( + "Offset of field: ", + stringify!(ma_device), + "::", + stringify!(usingDefaultSampleRate) + ) + ); + assert_eq!( + unsafe { + &(*(::core::ptr::null::())).usingDefaultBufferSize as *const _ as usize + }, + 485usize, + concat!( + "Offset of field: ", + stringify!(ma_device), + "::", + stringify!(usingDefaultBufferSize) + ) + ); + assert_eq!( + unsafe { &(*(::core::ptr::null::())).usingDefaultPeriods as *const _ as usize }, + 486usize, + concat!( + "Offset of field: ", + stringify!(ma_device), + "::", + stringify!(usingDefaultPeriods) + ) + ); + assert_eq!( + unsafe { &(*(::core::ptr::null::())).isOwnerOfContext as *const _ as usize }, + 487usize, + concat!( + "Offset of field: ", + stringify!(ma_device), + "::", + stringify!(isOwnerOfContext) + ) + ); + assert_eq!( + unsafe { + &(*(::core::ptr::null::())).noPreZeroedOutputBuffer as *const _ as usize + }, 488usize, + concat!( + "Offset of field: ", + stringify!(ma_device), + "::", + stringify!(noPreZeroedOutputBuffer) + ) + ); + assert_eq!( + unsafe { &(*(::core::ptr::null::())).noClip as *const _ as usize }, + 489usize, + concat!( + "Offset of field: ", + stringify!(ma_device), + "::", + stringify!(noClip) + ) + ); + assert_eq!( + unsafe { &(*(::core::ptr::null::())).masterVolumeFactor as *const _ as usize }, + 492usize, concat!( "Offset of field: ", stringify!(ma_device), @@ -9736,7 +9678,7 @@ fn bindgen_test_layout_ma_device() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).capture as *const _ as usize }, - 11296usize, + 11304usize, concat!( "Offset of field: ", stringify!(ma_device), @@ -9747,115 +9689,7 @@ fn bindgen_test_layout_ma_device() { } impl ::core::fmt::Debug for ma_device { fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - write ! (f , "ma_device {{ pContext: {:?}, type: {:?}, sampleRate: {:?}, state: {:?}, onData: {:?}, onStop: {:?}, pUserData: {:?}, lock: {:?}, wakeupEvent: {:?}, startEvent: {:?}, stopEvent: {:?}, thread: {:?}, workResult: {:?}, usingDefaultSampleRate : {:?}, usingDefaultBufferSize : {:?}, usingDefaultPeriods : {:?}, isOwnerOfContext : {:?}, noPreZeroedOutputBuffer : {:?}, noClip : {:?}, masterVolumeFactor: {:?}, duplexRB: {:?}, resampling: {:?}, playback: {:?}, capture: {:?}, __bindgen_anon_1: {:?} }}" , self . pContext , self . type_ , self . sampleRate , self . state , self . onData , self . onStop , self . pUserData , self . lock , self . wakeupEvent , self . startEvent , self . stopEvent , self . thread , self . workResult , self . usingDefaultSampleRate () , self . usingDefaultBufferSize () , self . usingDefaultPeriods () , self . isOwnerOfContext () , self . noPreZeroedOutputBuffer () , self . noClip () , self . masterVolumeFactor , self . duplexRB , self . resampling , self . playback , self . capture , self . __bindgen_anon_1) - } -} -impl ma_device { - #[inline] - pub fn usingDefaultSampleRate(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } - } - #[inline] - pub fn set_usingDefaultSampleRate(&mut self, val: ma_bool32) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn usingDefaultBufferSize(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } - } - #[inline] - pub fn set_usingDefaultBufferSize(&mut self, val: ma_bool32) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(1usize, 1u8, val as u64) - } - } - #[inline] - pub fn usingDefaultPeriods(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } - } - #[inline] - pub fn set_usingDefaultPeriods(&mut self, val: ma_bool32) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(2usize, 1u8, val as u64) - } - } - #[inline] - pub fn isOwnerOfContext(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) } - } - #[inline] - pub fn set_isOwnerOfContext(&mut self, val: ma_bool32) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(3usize, 1u8, val as u64) - } - } - #[inline] - pub fn noPreZeroedOutputBuffer(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) } - } - #[inline] - pub fn set_noPreZeroedOutputBuffer(&mut self, val: ma_bool32) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(4usize, 1u8, val as u64) - } - } - #[inline] - pub fn noClip(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u32) } - } - #[inline] - pub fn set_noClip(&mut self, val: ma_bool32) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(5usize, 1u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - usingDefaultSampleRate: ma_bool32, - usingDefaultBufferSize: ma_bool32, - usingDefaultPeriods: ma_bool32, - isOwnerOfContext: ma_bool32, - noPreZeroedOutputBuffer: ma_bool32, - noClip: ma_bool32, - ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = - Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let usingDefaultSampleRate: u32 = - unsafe { ::core::mem::transmute(usingDefaultSampleRate) }; - usingDefaultSampleRate as u64 - }); - __bindgen_bitfield_unit.set(1usize, 1u8, { - let usingDefaultBufferSize: u32 = - unsafe { ::core::mem::transmute(usingDefaultBufferSize) }; - usingDefaultBufferSize as u64 - }); - __bindgen_bitfield_unit.set(2usize, 1u8, { - let usingDefaultPeriods: u32 = unsafe { ::core::mem::transmute(usingDefaultPeriods) }; - usingDefaultPeriods as u64 - }); - __bindgen_bitfield_unit.set(3usize, 1u8, { - let isOwnerOfContext: u32 = unsafe { ::core::mem::transmute(isOwnerOfContext) }; - isOwnerOfContext as u64 - }); - __bindgen_bitfield_unit.set(4usize, 1u8, { - let noPreZeroedOutputBuffer: u32 = - unsafe { ::core::mem::transmute(noPreZeroedOutputBuffer) }; - noPreZeroedOutputBuffer as u64 - }); - __bindgen_bitfield_unit.set(5usize, 1u8, { - let noClip: u32 = unsafe { ::core::mem::transmute(noClip) }; - noClip as u64 - }); - __bindgen_bitfield_unit + write ! (f , "ma_device {{ pContext: {:?}, type: {:?}, sampleRate: {:?}, state: {:?}, onData: {:?}, onStop: {:?}, pUserData: {:?}, lock: {:?}, wakeupEvent: {:?}, startEvent: {:?}, stopEvent: {:?}, thread: {:?}, workResult: {:?}, usingDefaultSampleRate: {:?}, usingDefaultBufferSize: {:?}, usingDefaultPeriods: {:?}, isOwnerOfContext: {:?}, noPreZeroedOutputBuffer: {:?}, noClip: {:?}, masterVolumeFactor: {:?}, duplexRB: {:?}, resampling: {:?}, playback: {:?}, capture: {:?}, __bindgen_anon_1: {:?} }}" , self . pContext , self . type_ , self . sampleRate , self . state , self . onData , self . onStop , self . pUserData , self . lock , self . wakeupEvent , self . startEvent , self . stopEvent , self . thread , self . workResult , self . usingDefaultSampleRate , self . usingDefaultBufferSize , self . usingDefaultPeriods , self . isOwnerOfContext , self . noPreZeroedOutputBuffer , self . noClip , self . masterVolumeFactor , self . duplexRB , self . resampling , self . playback , self . capture , self . __bindgen_anon_1) } } extern "C" { @@ -12455,6 +12289,9 @@ extern "C" { extern "C" { pub fn ma_waveform_set_frequency(pWaveform: *mut ma_waveform, frequency: f64) -> ma_result; } +extern "C" { + pub fn ma_waveform_set_type(pWaveform: *mut ma_waveform, type_: ma_waveform_type) -> ma_result; +} extern "C" { pub fn ma_waveform_set_sample_rate( pWaveform: *mut ma_waveform, @@ -12788,3 +12625,12 @@ extern "C" { frameCount: ma_uint64, ) -> ma_uint64; } +extern "C" { + pub fn ma_noise_set_amplitude(pNoise: *mut ma_noise, amplitude: f64) -> ma_result; +} +extern "C" { + pub fn ma_noise_set_seed(pNoise: *mut ma_noise, seed: ma_int32) -> ma_result; +} +extern "C" { + pub fn ma_noise_set_type(pNoise: *mut ma_noise, type_: ma_noise_type) -> ma_result; +} diff --git a/miniaudio-sys/bindings/macos-x86_64/bindings.rs b/miniaudio-sys/bindings/macos-x86_64/bindings.rs index 91d62e8..98b4b5f 100644 --- a/miniaudio-sys/bindings/macos-x86_64/bindings.rs +++ b/miniaudio-sys/bindings/macos-x86_64/bindings.rs @@ -1,89 +1,8 @@ -/* automatically generated by rust-bindgen 0.55.1 */ +/* automatically generated by rust-bindgen 0.56.0 */ -#[repr(C)] -#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] -pub struct __BindgenBitfieldUnit { - storage: Storage, - align: [Align; 0], -} -impl __BindgenBitfieldUnit { - #[inline] - pub const fn new(storage: Storage) -> Self { - Self { storage, align: [] } - } -} -impl __BindgenBitfieldUnit -where - Storage: AsRef<[u8]> + AsMut<[u8]>, -{ - #[inline] - pub fn get_bit(&self, index: usize) -> bool { - debug_assert!(index / 8 < self.storage.as_ref().len()); - let byte_index = index / 8; - let byte = self.storage.as_ref()[byte_index]; - let bit_index = if cfg!(target_endian = "big") { - 7 - (index % 8) - } else { - index % 8 - }; - let mask = 1 << bit_index; - byte & mask == mask - } - #[inline] - pub fn set_bit(&mut self, index: usize, val: bool) { - debug_assert!(index / 8 < self.storage.as_ref().len()); - let byte_index = index / 8; - let byte = &mut self.storage.as_mut()[byte_index]; - let bit_index = if cfg!(target_endian = "big") { - 7 - (index % 8) - } else { - index % 8 - }; - let mask = 1 << bit_index; - if val { - *byte |= mask; - } else { - *byte &= !mask; - } - } - #[inline] - pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { - debug_assert!(bit_width <= 64); - debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); - let mut val = 0; - for i in 0..(bit_width as usize) { - if self.get_bit(i + bit_offset) { - let index = if cfg!(target_endian = "big") { - bit_width as usize - 1 - i - } else { - i - }; - val |= 1 << index; - } - } - val - } - #[inline] - pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { - debug_assert!(bit_width <= 64); - debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); - for i in 0..(bit_width as usize) { - let mask = 1 << i; - let val_bit_is_set = val & mask == mask; - let index = if cfg!(target_endian = "big") { - bit_width as usize - 1 - i - } else { - i - }; - self.set_bit(index + bit_offset, val_bit_is_set); - } - } -} pub const MA_VERSION_MAJOR: u32 = 0; pub const MA_VERSION_MINOR: u32 = 10; -pub const MA_VERSION_REVISION: u32 = 24; +pub const MA_VERSION_REVISION: u32 = 29; pub const MA_TRUE: u32 = 1; pub const MA_FALSE: u32 = 0; pub const MA_SIZE_MAX: u32 = 4294967295; @@ -3673,7 +3592,10 @@ pub struct ma_channel_converter { pub channelMapOut: [ma_channel; 32usize], pub mixingMode: ma_channel_mix_mode, pub weights: ma_channel_converter__bindgen_ty_1, - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>, + pub isPassthrough: ma_bool8, + pub isSimpleShuffle: ma_bool8, + pub isSimpleMonoExpansion: ma_bool8, + pub isStereoToMono: ma_bool8, pub shuffleTable: [ma_uint8; 32usize], } #[repr(C)] @@ -3823,9 +3745,58 @@ fn bindgen_test_layout_ma_channel_converter() { ); assert_eq!( unsafe { - &(*(::core::ptr::null::())).shuffleTable as *const _ as usize + &(*(::core::ptr::null::())).isPassthrough as *const _ as usize + }, + 4176usize, + concat!( + "Offset of field: ", + stringify!(ma_channel_converter), + "::", + stringify!(isPassthrough) + ) + ); + assert_eq!( + unsafe { + &(*(::core::ptr::null::())).isSimpleShuffle as *const _ as usize }, 4177usize, + concat!( + "Offset of field: ", + stringify!(ma_channel_converter), + "::", + stringify!(isSimpleShuffle) + ) + ); + assert_eq!( + unsafe { + &(*(::core::ptr::null::())).isSimpleMonoExpansion as *const _ + as usize + }, + 4178usize, + concat!( + "Offset of field: ", + stringify!(ma_channel_converter), + "::", + stringify!(isSimpleMonoExpansion) + ) + ); + assert_eq!( + unsafe { + &(*(::core::ptr::null::())).isStereoToMono as *const _ as usize + }, + 4179usize, + concat!( + "Offset of field: ", + stringify!(ma_channel_converter), + "::", + stringify!(isStereoToMono) + ) + ); + assert_eq!( + unsafe { + &(*(::core::ptr::null::())).shuffleTable as *const _ as usize + }, + 4180usize, concat!( "Offset of field: ", stringify!(ma_channel_converter), @@ -3836,81 +3807,7 @@ fn bindgen_test_layout_ma_channel_converter() { } impl ::core::fmt::Debug for ma_channel_converter { fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - write ! (f , "ma_channel_converter {{ format: {:?}, channelsIn: {:?}, channelsOut: {:?}, channelMapIn: [...], channelMapOut: [...], mixingMode: {:?}, weights: {:?}, isPassthrough : {:?}, isSimpleShuffle : {:?}, isSimpleMonoExpansion : {:?}, isStereoToMono : {:?}, shuffleTable: [...] }}" , self . format , self . channelsIn , self . channelsOut , self . mixingMode , self . weights , self . isPassthrough () , self . isSimpleShuffle () , self . isSimpleMonoExpansion () , self . isStereoToMono ()) - } -} -impl ma_channel_converter { - #[inline] - pub fn isPassthrough(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } - } - #[inline] - pub fn set_isPassthrough(&mut self, val: ma_bool32) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn isSimpleShuffle(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } - } - #[inline] - pub fn set_isSimpleShuffle(&mut self, val: ma_bool32) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(1usize, 1u8, val as u64) - } - } - #[inline] - pub fn isSimpleMonoExpansion(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } - } - #[inline] - pub fn set_isSimpleMonoExpansion(&mut self, val: ma_bool32) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(2usize, 1u8, val as u64) - } - } - #[inline] - pub fn isStereoToMono(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) } - } - #[inline] - pub fn set_isStereoToMono(&mut self, val: ma_bool32) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(3usize, 1u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - isPassthrough: ma_bool32, - isSimpleShuffle: ma_bool32, - isSimpleMonoExpansion: ma_bool32, - isStereoToMono: ma_bool32, - ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = - Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let isPassthrough: u32 = unsafe { ::core::mem::transmute(isPassthrough) }; - isPassthrough as u64 - }); - __bindgen_bitfield_unit.set(1usize, 1u8, { - let isSimpleShuffle: u32 = unsafe { ::core::mem::transmute(isSimpleShuffle) }; - isSimpleShuffle as u64 - }); - __bindgen_bitfield_unit.set(2usize, 1u8, { - let isSimpleMonoExpansion: u32 = - unsafe { ::core::mem::transmute(isSimpleMonoExpansion) }; - isSimpleMonoExpansion as u64 - }); - __bindgen_bitfield_unit.set(3usize, 1u8, { - let isStereoToMono: u32 = unsafe { ::core::mem::transmute(isStereoToMono) }; - isStereoToMono as u64 - }); - __bindgen_bitfield_unit + write ! (f , "ma_channel_converter {{ format: {:?}, channelsIn: {:?}, channelsOut: {:?}, channelMapIn: [...], channelMapOut: [...], mixingMode: {:?}, weights: {:?}, isPassthrough: {:?}, isSimpleShuffle: {:?}, isSimpleMonoExpansion: {:?}, isStereoToMono: {:?}, shuffleTable: [...] }}" , self . format , self . channelsIn , self . channelsOut , self . mixingMode , self . weights , self . isPassthrough , self . isSimpleShuffle , self . isSimpleMonoExpansion , self . isStereoToMono) } } extern "C" { @@ -4292,8 +4189,11 @@ pub struct ma_data_converter { pub config: ma_data_converter_config, pub channelConverter: ma_channel_converter, pub resampler: ma_resampler, - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>, - pub __bindgen_padding_0: [u8; 7usize], + pub hasPreFormatConversion: ma_bool8, + pub hasPostFormatConversion: ma_bool8, + pub hasChannelConverter: ma_bool8, + pub hasResampler: ma_bool8, + pub isPassthrough: ma_bool8, } #[test] fn bindgen_test_layout_ma_data_converter() { @@ -4339,101 +4239,70 @@ fn bindgen_test_layout_ma_data_converter() { stringify!(resampler) ) ); -} -impl ::core::fmt::Debug for ma_data_converter { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - write ! (f , "ma_data_converter {{ config: {:?}, channelConverter: {:?}, resampler: {:?}, hasPreFormatConversion : {:?}, hasPostFormatConversion : {:?}, hasChannelConverter : {:?}, hasResampler : {:?}, isPassthrough : {:?} }}" , self . config , self . channelConverter , self . resampler , self . hasPreFormatConversion () , self . hasPostFormatConversion () , self . hasChannelConverter () , self . hasResampler () , self . isPassthrough ()) - } -} -impl ma_data_converter { - #[inline] - pub fn hasPreFormatConversion(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } - } - #[inline] - pub fn set_hasPreFormatConversion(&mut self, val: ma_bool32) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn hasPostFormatConversion(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } - } - #[inline] - pub fn set_hasPostFormatConversion(&mut self, val: ma_bool32) { + assert_eq!( unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(1usize, 1u8, val as u64) - } - } - #[inline] - pub fn hasChannelConverter(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } - } - #[inline] - pub fn set_hasChannelConverter(&mut self, val: ma_bool32) { + &(*(::core::ptr::null::())).hasPreFormatConversion as *const _ + as usize + }, + 10088usize, + concat!( + "Offset of field: ", + stringify!(ma_data_converter), + "::", + stringify!(hasPreFormatConversion) + ) + ); + assert_eq!( unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(2usize, 1u8, val as u64) - } - } - #[inline] - pub fn hasResampler(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) } - } - #[inline] - pub fn set_hasResampler(&mut self, val: ma_bool32) { + &(*(::core::ptr::null::())).hasPostFormatConversion as *const _ + as usize + }, + 10089usize, + concat!( + "Offset of field: ", + stringify!(ma_data_converter), + "::", + stringify!(hasPostFormatConversion) + ) + ); + assert_eq!( unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(3usize, 1u8, val as u64) - } - } - #[inline] - pub fn isPassthrough(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) } - } - #[inline] - pub fn set_isPassthrough(&mut self, val: ma_bool32) { + &(*(::core::ptr::null::())).hasChannelConverter as *const _ as usize + }, + 10090usize, + concat!( + "Offset of field: ", + stringify!(ma_data_converter), + "::", + stringify!(hasChannelConverter) + ) + ); + assert_eq!( + unsafe { &(*(::core::ptr::null::())).hasResampler as *const _ as usize }, + 10091usize, + concat!( + "Offset of field: ", + stringify!(ma_data_converter), + "::", + stringify!(hasResampler) + ) + ); + assert_eq!( unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(4usize, 1u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - hasPreFormatConversion: ma_bool32, - hasPostFormatConversion: ma_bool32, - hasChannelConverter: ma_bool32, - hasResampler: ma_bool32, - isPassthrough: ma_bool32, - ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = - Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let hasPreFormatConversion: u32 = - unsafe { ::core::mem::transmute(hasPreFormatConversion) }; - hasPreFormatConversion as u64 - }); - __bindgen_bitfield_unit.set(1usize, 1u8, { - let hasPostFormatConversion: u32 = - unsafe { ::core::mem::transmute(hasPostFormatConversion) }; - hasPostFormatConversion as u64 - }); - __bindgen_bitfield_unit.set(2usize, 1u8, { - let hasChannelConverter: u32 = unsafe { ::core::mem::transmute(hasChannelConverter) }; - hasChannelConverter as u64 - }); - __bindgen_bitfield_unit.set(3usize, 1u8, { - let hasResampler: u32 = unsafe { ::core::mem::transmute(hasResampler) }; - hasResampler as u64 - }); - __bindgen_bitfield_unit.set(4usize, 1u8, { - let isPassthrough: u32 = unsafe { ::core::mem::transmute(isPassthrough) }; - isPassthrough as u64 - }); - __bindgen_bitfield_unit + &(*(::core::ptr::null::())).isPassthrough as *const _ as usize + }, + 10092usize, + concat!( + "Offset of field: ", + stringify!(ma_data_converter), + "::", + stringify!(isPassthrough) + ) + ); +} +impl ::core::fmt::Debug for ma_data_converter { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + write ! (f , "ma_data_converter {{ config: {:?}, channelConverter: {:?}, resampler: {:?}, hasPreFormatConversion: {:?}, hasPostFormatConversion: {:?}, hasChannelConverter: {:?}, hasResampler: {:?}, isPassthrough: {:?} }}" , self . config , self . channelConverter , self . resampler , self . hasPreFormatConversion , self . hasPostFormatConversion , self . hasChannelConverter , self . hasResampler , self . isPassthrough) } } extern "C" { @@ -4687,6 +4556,9 @@ extern "C" { } extern "C" { #[doc = "Channel Maps"] + pub fn ma_channel_map_init_blank(channels: ma_uint32, pChannelMap: *mut ma_channel); +} +extern "C" { pub fn ma_get_standard_channel_map( standardChannelMap: ma_standard_channel_map, channels: ma_uint32, @@ -4757,7 +4629,8 @@ pub struct ma_rb { pub subbufferStrideInBytes: ma_uint32, pub encodedReadOffset: ma_uint32, pub encodedWriteOffset: ma_uint32, - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>, + pub ownsBuffer: ma_bool8, + pub clearOnWriteAcquire: ma_bool8, pub allocationCallbacks: ma_allocation_callbacks, } #[test] @@ -4832,6 +4705,26 @@ fn bindgen_test_layout_ma_rb() { stringify!(encodedWriteOffset) ) ); + assert_eq!( + unsafe { &(*(::core::ptr::null::())).ownsBuffer as *const _ as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(ma_rb), + "::", + stringify!(ownsBuffer) + ) + ); + assert_eq!( + unsafe { &(*(::core::ptr::null::())).clearOnWriteAcquire as *const _ as usize }, + 29usize, + concat!( + "Offset of field: ", + stringify!(ma_rb), + "::", + stringify!(clearOnWriteAcquire) + ) + ); assert_eq!( unsafe { &(*(::core::ptr::null::())).allocationCallbacks as *const _ as usize }, 32usize, @@ -4843,47 +4736,6 @@ fn bindgen_test_layout_ma_rb() { ) ); } -impl ma_rb { - #[inline] - pub fn ownsBuffer(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } - } - #[inline] - pub fn set_ownsBuffer(&mut self, val: ma_bool32) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn clearOnWriteAcquire(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } - } - #[inline] - pub fn set_clearOnWriteAcquire(&mut self, val: ma_bool32) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(1usize, 1u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - ownsBuffer: ma_bool32, - clearOnWriteAcquire: ma_bool32, - ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = - Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let ownsBuffer: u32 = unsafe { ::core::mem::transmute(ownsBuffer) }; - ownsBuffer as u64 - }); - __bindgen_bitfield_unit.set(1usize, 1u8, { - let clearOnWriteAcquire: u32 = unsafe { ::core::mem::transmute(clearOnWriteAcquire) }; - clearOnWriteAcquire as u64 - }); - __bindgen_bitfield_unit - } -} extern "C" { pub fn ma_rb_init_ex( subbufferSizeInBytes: usize, @@ -5821,8 +5673,8 @@ pub struct ma_device_config { pub periodSizeInMilliseconds: ma_uint32, pub periods: ma_uint32, pub performanceProfile: ma_performance_profile, - pub noPreZeroedOutputBuffer: ma_bool32, - pub noClip: ma_bool32, + pub noPreZeroedOutputBuffer: ma_bool8, + pub noClip: ma_bool8, pub dataCallback: ma_device_callback_proc, pub stopCallback: ma_stop_proc, pub pUserData: *mut libc::c_void, @@ -5974,6 +5826,7 @@ pub struct ma_device_config__bindgen_ty_2 { pub format: ma_format, pub channels: ma_uint32, pub channelMap: [ma_channel; 32usize], + pub channelMixMode: ma_channel_mix_mode, pub shareMode: ma_share_mode, } #[test] @@ -6041,10 +5894,23 @@ fn bindgen_test_layout_ma_device_config__bindgen_ty_2() { ); assert_eq!( unsafe { - &(*(::core::ptr::null::())).shareMode as *const _ + &(*(::core::ptr::null::())).channelMixMode as *const _ as usize }, 48usize, + concat!( + "Offset of field: ", + stringify!(ma_device_config__bindgen_ty_2), + "::", + stringify!(channelMixMode) + ) + ); + assert_eq!( + unsafe { + &(*(::core::ptr::null::())).shareMode as *const _ + as usize + }, + 52usize, concat!( "Offset of field: ", stringify!(ma_device_config__bindgen_ty_2), @@ -6060,6 +5926,7 @@ pub struct ma_device_config__bindgen_ty_3 { pub format: ma_format, pub channels: ma_uint32, pub channelMap: [ma_channel; 32usize], + pub channelMixMode: ma_channel_mix_mode, pub shareMode: ma_share_mode, } #[test] @@ -6127,10 +5994,23 @@ fn bindgen_test_layout_ma_device_config__bindgen_ty_3() { ); assert_eq!( unsafe { - &(*(::core::ptr::null::())).shareMode as *const _ + &(*(::core::ptr::null::())).channelMixMode as *const _ as usize }, 48usize, + concat!( + "Offset of field: ", + stringify!(ma_device_config__bindgen_ty_3), + "::", + stringify!(channelMixMode) + ) + ); + assert_eq!( + unsafe { + &(*(::core::ptr::null::())).shareMode as *const _ + as usize + }, + 52usize, concat!( "Offset of field: ", stringify!(ma_device_config__bindgen_ty_3), @@ -6142,21 +6022,21 @@ fn bindgen_test_layout_ma_device_config__bindgen_ty_3() { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ma_device_config__bindgen_ty_4 { - pub noAutoConvertSRC: ma_bool32, - pub noDefaultQualitySRC: ma_bool32, - pub noAutoStreamRouting: ma_bool32, - pub noHardwareOffloading: ma_bool32, + pub noAutoConvertSRC: ma_bool8, + pub noDefaultQualitySRC: ma_bool8, + pub noAutoStreamRouting: ma_bool8, + pub noHardwareOffloading: ma_bool8, } #[test] fn bindgen_test_layout_ma_device_config__bindgen_ty_4() { assert_eq!( ::core::mem::size_of::(), - 16usize, + 4usize, concat!("Size of: ", stringify!(ma_device_config__bindgen_ty_4)) ); assert_eq!( ::core::mem::align_of::(), - 4usize, + 1usize, concat!("Alignment of ", stringify!(ma_device_config__bindgen_ty_4)) ); assert_eq!( @@ -6177,7 +6057,7 @@ fn bindgen_test_layout_ma_device_config__bindgen_ty_4() { &(*(::core::ptr::null::())).noDefaultQualitySRC as *const _ as usize }, - 4usize, + 1usize, concat!( "Offset of field: ", stringify!(ma_device_config__bindgen_ty_4), @@ -6190,7 +6070,7 @@ fn bindgen_test_layout_ma_device_config__bindgen_ty_4() { &(*(::core::ptr::null::())).noAutoStreamRouting as *const _ as usize }, - 8usize, + 2usize, concat!( "Offset of field: ", stringify!(ma_device_config__bindgen_ty_4), @@ -6203,7 +6083,7 @@ fn bindgen_test_layout_ma_device_config__bindgen_ty_4() { &(*(::core::ptr::null::())).noHardwareOffloading as *const _ as usize }, - 12usize, + 3usize, concat!( "Offset of field: ", stringify!(ma_device_config__bindgen_ty_4), @@ -6467,7 +6347,7 @@ fn bindgen_test_layout_ma_device_config__bindgen_ty_9() { fn bindgen_test_layout_ma_device_config() { assert_eq!( ::core::mem::size_of::(), - 256usize, + 248usize, concat!("Size of: ", stringify!(ma_device_config)) ); assert_eq!( @@ -6557,7 +6437,7 @@ fn bindgen_test_layout_ma_device_config() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).noClip as *const _ as usize }, - 28usize, + 25usize, concat!( "Offset of field: ", stringify!(ma_device_config), @@ -6637,7 +6517,7 @@ fn bindgen_test_layout_ma_device_config() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).alsa as *const _ as usize }, - 200usize, + 188usize, concat!( "Offset of field: ", stringify!(ma_device_config), @@ -6647,7 +6527,7 @@ fn bindgen_test_layout_ma_device_config() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).pulse as *const _ as usize }, - 216usize, + 208usize, concat!( "Offset of field: ", stringify!(ma_device_config), @@ -6657,7 +6537,7 @@ fn bindgen_test_layout_ma_device_config() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).coreaudio as *const _ as usize }, - 232usize, + 224usize, concat!( "Offset of field: ", stringify!(ma_device_config), @@ -6667,7 +6547,7 @@ fn bindgen_test_layout_ma_device_config() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).opensl as *const _ as usize }, - 236usize, + 228usize, concat!( "Offset of field: ", stringify!(ma_device_config), @@ -6677,7 +6557,7 @@ fn bindgen_test_layout_ma_device_config() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).aaudio as *const _ as usize }, - 244usize, + 236usize, concat!( "Offset of field: ", stringify!(ma_device_config), @@ -6828,6 +6708,7 @@ pub struct ma_backend_callbacks { pub onContextInit: ::core::option::Option< unsafe extern "C" fn( pContext: *mut ma_context, + pConfig: *const ma_context_config, pCallbacks: *mut ma_backend_callbacks, ) -> ma_result, >, @@ -6851,7 +6732,7 @@ pub struct ma_backend_callbacks { pub onDeviceInit: ::core::option::Option< unsafe extern "C" fn( pDevice: *mut ma_device, - deviceType: ma_device_type, + pConfig: *const ma_device_config, pDescriptorPlayback: *mut ma_device_descriptor, pDescriptorCapture: *mut ma_device_descriptor, ) -> ma_result, @@ -7373,6 +7254,7 @@ fn bindgen_test_layout_ma_context_config() { #[repr(C)] #[derive(Copy, Clone)] pub struct ma_context { + pub callbacks: ma_backend_callbacks, pub backend: ma_backend, pub logCallback: ma_log_proc, pub threadPriority: ma_thread_priority, @@ -7385,7 +7267,7 @@ pub struct ma_context { pub playbackDeviceInfoCount: ma_uint32, pub captureDeviceInfoCount: ma_uint32, pub pDeviceInfos: *mut ma_device_info, - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>, + pub isBackendAsynchronous: ma_bool8, pub onUninit: ::core::option::Option ma_result>, pub onEnumDevices: ::core::option::Option< @@ -7425,7 +7307,6 @@ pub struct ma_context { #[derive(Copy, Clone)] pub union ma_context__bindgen_ty_1 { pub coreaudio: ma_context__bindgen_ty_1__bindgen_ty_1, - pub custom: ma_backend_callbacks, pub null_backend: ma_context__bindgen_ty_1__bindgen_ty_2, _bindgen_union_align: [u64; 23usize], } @@ -7835,18 +7716,6 @@ fn bindgen_test_layout_ma_context__bindgen_ty_1() { stringify!(coreaudio) ) ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).custom as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ma_context__bindgen_ty_1), - "::", - stringify!(custom) - ) - ); assert_eq!( unsafe { &(*(::core::ptr::null::())).null_backend as *const _ as usize @@ -8163,7 +8032,7 @@ impl ::core::fmt::Debug for ma_context__bindgen_ty_2 { fn bindgen_test_layout_ma_context() { assert_eq!( ::core::mem::size_of::(), - 608usize, + 696usize, concat!("Size of: ", stringify!(ma_context)) ); assert_eq!( @@ -8172,8 +8041,18 @@ fn bindgen_test_layout_ma_context() { concat!("Alignment of ", stringify!(ma_context)) ); assert_eq!( - unsafe { &(*(::core::ptr::null::())).backend as *const _ as usize }, + unsafe { &(*(::core::ptr::null::())).callbacks as *const _ as usize }, 0usize, + concat!( + "Offset of field: ", + stringify!(ma_context), + "::", + stringify!(callbacks) + ) + ); + assert_eq!( + unsafe { &(*(::core::ptr::null::())).backend as *const _ as usize }, + 88usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8183,7 +8062,7 @@ fn bindgen_test_layout_ma_context() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).logCallback as *const _ as usize }, - 8usize, + 96usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8193,7 +8072,7 @@ fn bindgen_test_layout_ma_context() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).threadPriority as *const _ as usize }, - 16usize, + 104usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8203,7 +8082,7 @@ fn bindgen_test_layout_ma_context() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).threadStackSize as *const _ as usize }, - 24usize, + 112usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8213,7 +8092,7 @@ fn bindgen_test_layout_ma_context() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).pUserData as *const _ as usize }, - 32usize, + 120usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8223,7 +8102,7 @@ fn bindgen_test_layout_ma_context() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).allocationCallbacks as *const _ as usize }, - 40usize, + 128usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8233,7 +8112,7 @@ fn bindgen_test_layout_ma_context() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).deviceEnumLock as *const _ as usize }, - 72usize, + 160usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8243,7 +8122,7 @@ fn bindgen_test_layout_ma_context() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).deviceInfoLock as *const _ as usize }, - 136usize, + 224usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8253,7 +8132,7 @@ fn bindgen_test_layout_ma_context() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).deviceInfoCapacity as *const _ as usize }, - 200usize, + 288usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8265,7 +8144,7 @@ fn bindgen_test_layout_ma_context() { unsafe { &(*(::core::ptr::null::())).playbackDeviceInfoCount as *const _ as usize }, - 204usize, + 292usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8277,7 +8156,7 @@ fn bindgen_test_layout_ma_context() { unsafe { &(*(::core::ptr::null::())).captureDeviceInfoCount as *const _ as usize }, - 208usize, + 296usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8287,7 +8166,7 @@ fn bindgen_test_layout_ma_context() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).pDeviceInfos as *const _ as usize }, - 216usize, + 304usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8295,9 +8174,21 @@ fn bindgen_test_layout_ma_context() { stringify!(pDeviceInfos) ) ); + assert_eq!( + unsafe { + &(*(::core::ptr::null::())).isBackendAsynchronous as *const _ as usize + }, + 312usize, + concat!( + "Offset of field: ", + stringify!(ma_context), + "::", + stringify!(isBackendAsynchronous) + ) + ); assert_eq!( unsafe { &(*(::core::ptr::null::())).onUninit as *const _ as usize }, - 232usize, + 320usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8307,7 +8198,7 @@ fn bindgen_test_layout_ma_context() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).onEnumDevices as *const _ as usize }, - 240usize, + 328usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8317,7 +8208,7 @@ fn bindgen_test_layout_ma_context() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).onGetDeviceInfo as *const _ as usize }, - 248usize, + 336usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8327,7 +8218,7 @@ fn bindgen_test_layout_ma_context() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).onDeviceInit as *const _ as usize }, - 256usize, + 344usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8337,7 +8228,7 @@ fn bindgen_test_layout_ma_context() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).onDeviceUninit as *const _ as usize }, - 264usize, + 352usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8347,7 +8238,7 @@ fn bindgen_test_layout_ma_context() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).onDeviceStart as *const _ as usize }, - 272usize, + 360usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8357,7 +8248,7 @@ fn bindgen_test_layout_ma_context() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).onDeviceStop as *const _ as usize }, - 280usize, + 368usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8367,7 +8258,7 @@ fn bindgen_test_layout_ma_context() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).onDeviceMainLoop as *const _ as usize }, - 288usize, + 376usize, concat!( "Offset of field: ", stringify!(ma_context), @@ -8378,33 +8269,7 @@ fn bindgen_test_layout_ma_context() { } impl ::core::fmt::Debug for ma_context { fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - write ! (f , "ma_context {{ backend: {:?}, logCallback: {:?}, threadPriority: {:?}, threadStackSize: {:?}, pUserData: {:?}, allocationCallbacks: {:?}, deviceEnumLock: {:?}, deviceInfoLock: {:?}, deviceInfoCapacity: {:?}, playbackDeviceInfoCount: {:?}, captureDeviceInfoCount: {:?}, pDeviceInfos: {:?}, isBackendAsynchronous : {:?}, onUninit: {:?}, onEnumDevices: {:?}, onGetDeviceInfo: {:?}, onDeviceInit: {:?}, onDeviceUninit: {:?}, onDeviceStart: {:?}, onDeviceStop: {:?}, onDeviceMainLoop: {:?}, __bindgen_anon_1: {:?}, __bindgen_anon_2: {:?} }}" , self . backend , self . logCallback , self . threadPriority , self . threadStackSize , self . pUserData , self . allocationCallbacks , self . deviceEnumLock , self . deviceInfoLock , self . deviceInfoCapacity , self . playbackDeviceInfoCount , self . captureDeviceInfoCount , self . pDeviceInfos , self . isBackendAsynchronous () , self . onUninit , self . onEnumDevices , self . onGetDeviceInfo , self . onDeviceInit , self . onDeviceUninit , self . onDeviceStart , self . onDeviceStop , self . onDeviceMainLoop , self . __bindgen_anon_1 , self . __bindgen_anon_2) - } -} -impl ma_context { - #[inline] - pub fn isBackendAsynchronous(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } - } - #[inline] - pub fn set_isBackendAsynchronous(&mut self, val: ma_bool32) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - isBackendAsynchronous: ma_bool32, - ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = - Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let isBackendAsynchronous: u32 = - unsafe { ::core::mem::transmute(isBackendAsynchronous) }; - isBackendAsynchronous as u64 - }); - __bindgen_bitfield_unit + write ! (f , "ma_context {{ callbacks: {:?}, backend: {:?}, logCallback: {:?}, threadPriority: {:?}, threadStackSize: {:?}, pUserData: {:?}, allocationCallbacks: {:?}, deviceEnumLock: {:?}, deviceInfoLock: {:?}, deviceInfoCapacity: {:?}, playbackDeviceInfoCount: {:?}, captureDeviceInfoCount: {:?}, pDeviceInfos: {:?}, isBackendAsynchronous: {:?}, onUninit: {:?}, onEnumDevices: {:?}, onGetDeviceInfo: {:?}, onDeviceInit: {:?}, onDeviceUninit: {:?}, onDeviceStart: {:?}, onDeviceStop: {:?}, onDeviceMainLoop: {:?}, __bindgen_anon_1: {:?}, __bindgen_anon_2: {:?} }}" , self . callbacks , self . backend , self . logCallback , self . threadPriority , self . threadStackSize , self . pUserData , self . allocationCallbacks , self . deviceEnumLock , self . deviceInfoLock , self . deviceInfoCapacity , self . playbackDeviceInfoCount , self . captureDeviceInfoCount , self . pDeviceInfos , self . isBackendAsynchronous , self . onUninit , self . onEnumDevices , self . onGetDeviceInfo , self . onDeviceInit , self . onDeviceUninit , self . onDeviceStart , self . onDeviceStop , self . onDeviceMainLoop , self . __bindgen_anon_1 , self . __bindgen_anon_2) } } #[repr(C)] @@ -8423,7 +8288,12 @@ pub struct ma_device { pub stopEvent: ma_event, pub thread: ma_thread, pub workResult: ma_result, - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>, + pub usingDefaultSampleRate: ma_bool8, + pub usingDefaultBufferSize: ma_bool8, + pub usingDefaultPeriods: ma_bool8, + pub isOwnerOfContext: ma_bool8, + pub noPreZeroedOutputBuffer: ma_bool8, + pub noClip: ma_bool8, pub masterVolumeFactor: f32, pub duplexRB: ma_duplex_rb, pub resampling: ma_device__bindgen_ty_1, @@ -8563,7 +8433,6 @@ pub struct ma_device__bindgen_ty_2 { pub id: ma_device_id, pub name: [libc::c_char; 256usize], pub shareMode: ma_share_mode, - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>, pub format: ma_format, pub channels: ma_uint32, pub channelMap: [ma_channel; 32usize], @@ -8573,13 +8442,17 @@ pub struct ma_device__bindgen_ty_2 { pub internalChannelMap: [ma_channel; 32usize], pub internalPeriodSizeInFrames: ma_uint32, pub internalPeriods: ma_uint32, + pub channelMixMode: ma_channel_mix_mode, pub converter: ma_data_converter, + pub usingDefaultFormat: ma_bool8, + pub usingDefaultChannels: ma_bool8, + pub usingDefaultChannelMap: ma_bool8, } #[test] fn bindgen_test_layout_ma_device__bindgen_ty_2() { assert_eq!( ::core::mem::size_of::(), - 10712usize, + 10720usize, concat!("Size of: ", stringify!(ma_device__bindgen_ty_2)) ); assert_eq!( @@ -8621,7 +8494,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_2() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).format as *const _ as usize }, - 520usize, + 516usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_2), @@ -8633,7 +8506,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_2() { unsafe { &(*(::core::ptr::null::())).channels as *const _ as usize }, - 524usize, + 520usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_2), @@ -8645,7 +8518,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_2() { unsafe { &(*(::core::ptr::null::())).channelMap as *const _ as usize }, - 528usize, + 524usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_2), @@ -8657,7 +8530,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_2() { unsafe { &(*(::core::ptr::null::())).internalFormat as *const _ as usize }, - 560usize, + 556usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_2), @@ -8670,7 +8543,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_2() { &(*(::core::ptr::null::())).internalChannels as *const _ as usize }, - 564usize, + 560usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_2), @@ -8683,7 +8556,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_2() { &(*(::core::ptr::null::())).internalSampleRate as *const _ as usize }, - 568usize, + 564usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_2), @@ -8696,7 +8569,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_2() { &(*(::core::ptr::null::())).internalChannelMap as *const _ as usize }, - 572usize, + 568usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_2), @@ -8709,7 +8582,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_2() { &(*(::core::ptr::null::())).internalPeriodSizeInFrames as *const _ as usize }, - 604usize, + 600usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_2), @@ -8722,7 +8595,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_2() { &(*(::core::ptr::null::())).internalPeriods as *const _ as usize }, - 608usize, + 604usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_2), @@ -8730,6 +8603,18 @@ fn bindgen_test_layout_ma_device__bindgen_ty_2() { stringify!(internalPeriods) ) ); + assert_eq!( + unsafe { + &(*(::core::ptr::null::())).channelMixMode as *const _ as usize + }, + 608usize, + concat!( + "Offset of field: ", + stringify!(ma_device__bindgen_ty_2), + "::", + stringify!(channelMixMode) + ) + ); assert_eq!( unsafe { &(*(::core::ptr::null::())).converter as *const _ as usize @@ -8742,68 +8627,49 @@ fn bindgen_test_layout_ma_device__bindgen_ty_2() { stringify!(converter) ) ); -} -impl ::core::fmt::Debug for ma_device__bindgen_ty_2 { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - write ! (f , "ma_device__bindgen_ty_2 {{ id: {:?}, name: [...], shareMode: {:?}, usingDefaultFormat : {:?}, usingDefaultChannels : {:?}, usingDefaultChannelMap : {:?}, format: {:?}, channels: {:?}, channelMap: [...], internalFormat: {:?}, internalChannels: {:?}, internalSampleRate: {:?}, internalChannelMap: [...], internalPeriodSizeInFrames: {:?}, internalPeriods: {:?}, converter: {:?} }}" , self . id , self . shareMode , self . usingDefaultFormat () , self . usingDefaultChannels () , self . usingDefaultChannelMap () , self . format , self . channels , self . internalFormat , self . internalChannels , self . internalSampleRate , self . internalPeriodSizeInFrames , self . internalPeriods , self . converter) - } -} -impl ma_device__bindgen_ty_2 { - #[inline] - pub fn usingDefaultFormat(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } - } - #[inline] - pub fn set_usingDefaultFormat(&mut self, val: ma_bool32) { + assert_eq!( unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn usingDefaultChannels(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } - } - #[inline] - pub fn set_usingDefaultChannels(&mut self, val: ma_bool32) { + &(*(::core::ptr::null::())).usingDefaultFormat as *const _ + as usize + }, + 10712usize, + concat!( + "Offset of field: ", + stringify!(ma_device__bindgen_ty_2), + "::", + stringify!(usingDefaultFormat) + ) + ); + assert_eq!( unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(1usize, 1u8, val as u64) - } - } - #[inline] - pub fn usingDefaultChannelMap(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } - } - #[inline] - pub fn set_usingDefaultChannelMap(&mut self, val: ma_bool32) { + &(*(::core::ptr::null::())).usingDefaultChannels as *const _ + as usize + }, + 10713usize, + concat!( + "Offset of field: ", + stringify!(ma_device__bindgen_ty_2), + "::", + stringify!(usingDefaultChannels) + ) + ); + assert_eq!( unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(2usize, 1u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - usingDefaultFormat: ma_bool32, - usingDefaultChannels: ma_bool32, - usingDefaultChannelMap: ma_bool32, - ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = - Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let usingDefaultFormat: u32 = unsafe { ::core::mem::transmute(usingDefaultFormat) }; - usingDefaultFormat as u64 - }); - __bindgen_bitfield_unit.set(1usize, 1u8, { - let usingDefaultChannels: u32 = unsafe { ::core::mem::transmute(usingDefaultChannels) }; - usingDefaultChannels as u64 - }); - __bindgen_bitfield_unit.set(2usize, 1u8, { - let usingDefaultChannelMap: u32 = - unsafe { ::core::mem::transmute(usingDefaultChannelMap) }; - usingDefaultChannelMap as u64 - }); - __bindgen_bitfield_unit + &(*(::core::ptr::null::())).usingDefaultChannelMap as *const _ + as usize + }, + 10714usize, + concat!( + "Offset of field: ", + stringify!(ma_device__bindgen_ty_2), + "::", + stringify!(usingDefaultChannelMap) + ) + ); +} +impl ::core::fmt::Debug for ma_device__bindgen_ty_2 { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + write ! (f , "ma_device__bindgen_ty_2 {{ id: {:?}, name: [...], shareMode: {:?}, format: {:?}, channels: {:?}, channelMap: [...], internalFormat: {:?}, internalChannels: {:?}, internalSampleRate: {:?}, internalChannelMap: [...], internalPeriodSizeInFrames: {:?}, internalPeriods: {:?}, channelMixMode: {:?}, converter: {:?}, usingDefaultFormat: {:?}, usingDefaultChannels: {:?}, usingDefaultChannelMap: {:?} }}" , self . id , self . shareMode , self . format , self . channels , self . internalFormat , self . internalChannels , self . internalSampleRate , self . internalPeriodSizeInFrames , self . internalPeriods , self . channelMixMode , self . converter , self . usingDefaultFormat , self . usingDefaultChannels , self . usingDefaultChannelMap) } } #[repr(C)] @@ -8812,7 +8678,6 @@ pub struct ma_device__bindgen_ty_3 { pub id: ma_device_id, pub name: [libc::c_char; 256usize], pub shareMode: ma_share_mode, - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize], u8>, pub format: ma_format, pub channels: ma_uint32, pub channelMap: [ma_channel; 32usize], @@ -8822,13 +8687,17 @@ pub struct ma_device__bindgen_ty_3 { pub internalChannelMap: [ma_channel; 32usize], pub internalPeriodSizeInFrames: ma_uint32, pub internalPeriods: ma_uint32, + pub channelMixMode: ma_channel_mix_mode, pub converter: ma_data_converter, + pub usingDefaultFormat: ma_bool8, + pub usingDefaultChannels: ma_bool8, + pub usingDefaultChannelMap: ma_bool8, } #[test] fn bindgen_test_layout_ma_device__bindgen_ty_3() { assert_eq!( ::core::mem::size_of::(), - 10712usize, + 10720usize, concat!("Size of: ", stringify!(ma_device__bindgen_ty_3)) ); assert_eq!( @@ -8870,7 +8739,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_3() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).format as *const _ as usize }, - 520usize, + 516usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_3), @@ -8882,7 +8751,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_3() { unsafe { &(*(::core::ptr::null::())).channels as *const _ as usize }, - 524usize, + 520usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_3), @@ -8894,7 +8763,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_3() { unsafe { &(*(::core::ptr::null::())).channelMap as *const _ as usize }, - 528usize, + 524usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_3), @@ -8906,7 +8775,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_3() { unsafe { &(*(::core::ptr::null::())).internalFormat as *const _ as usize }, - 560usize, + 556usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_3), @@ -8919,7 +8788,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_3() { &(*(::core::ptr::null::())).internalChannels as *const _ as usize }, - 564usize, + 560usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_3), @@ -8932,7 +8801,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_3() { &(*(::core::ptr::null::())).internalSampleRate as *const _ as usize }, - 568usize, + 564usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_3), @@ -8945,7 +8814,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_3() { &(*(::core::ptr::null::())).internalChannelMap as *const _ as usize }, - 572usize, + 568usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_3), @@ -8958,7 +8827,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_3() { &(*(::core::ptr::null::())).internalPeriodSizeInFrames as *const _ as usize }, - 604usize, + 600usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_3), @@ -8971,7 +8840,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_3() { &(*(::core::ptr::null::())).internalPeriods as *const _ as usize }, - 608usize, + 604usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_3), @@ -8979,6 +8848,18 @@ fn bindgen_test_layout_ma_device__bindgen_ty_3() { stringify!(internalPeriods) ) ); + assert_eq!( + unsafe { + &(*(::core::ptr::null::())).channelMixMode as *const _ as usize + }, + 608usize, + concat!( + "Offset of field: ", + stringify!(ma_device__bindgen_ty_3), + "::", + stringify!(channelMixMode) + ) + ); assert_eq!( unsafe { &(*(::core::ptr::null::())).converter as *const _ as usize @@ -8991,68 +8872,49 @@ fn bindgen_test_layout_ma_device__bindgen_ty_3() { stringify!(converter) ) ); -} -impl ::core::fmt::Debug for ma_device__bindgen_ty_3 { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - write ! (f , "ma_device__bindgen_ty_3 {{ id: {:?}, name: [...], shareMode: {:?}, usingDefaultFormat : {:?}, usingDefaultChannels : {:?}, usingDefaultChannelMap : {:?}, format: {:?}, channels: {:?}, channelMap: [...], internalFormat: {:?}, internalChannels: {:?}, internalSampleRate: {:?}, internalChannelMap: [...], internalPeriodSizeInFrames: {:?}, internalPeriods: {:?}, converter: {:?} }}" , self . id , self . shareMode , self . usingDefaultFormat () , self . usingDefaultChannels () , self . usingDefaultChannelMap () , self . format , self . channels , self . internalFormat , self . internalChannels , self . internalSampleRate , self . internalPeriodSizeInFrames , self . internalPeriods , self . converter) - } -} -impl ma_device__bindgen_ty_3 { - #[inline] - pub fn usingDefaultFormat(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } - } - #[inline] - pub fn set_usingDefaultFormat(&mut self, val: ma_bool32) { + assert_eq!( unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn usingDefaultChannels(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } - } - #[inline] - pub fn set_usingDefaultChannels(&mut self, val: ma_bool32) { + &(*(::core::ptr::null::())).usingDefaultFormat as *const _ + as usize + }, + 10712usize, + concat!( + "Offset of field: ", + stringify!(ma_device__bindgen_ty_3), + "::", + stringify!(usingDefaultFormat) + ) + ); + assert_eq!( unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(1usize, 1u8, val as u64) - } - } - #[inline] - pub fn usingDefaultChannelMap(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } - } - #[inline] - pub fn set_usingDefaultChannelMap(&mut self, val: ma_bool32) { + &(*(::core::ptr::null::())).usingDefaultChannels as *const _ + as usize + }, + 10713usize, + concat!( + "Offset of field: ", + stringify!(ma_device__bindgen_ty_3), + "::", + stringify!(usingDefaultChannels) + ) + ); + assert_eq!( unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(2usize, 1u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - usingDefaultFormat: ma_bool32, - usingDefaultChannels: ma_bool32, - usingDefaultChannelMap: ma_bool32, - ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = - Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let usingDefaultFormat: u32 = unsafe { ::core::mem::transmute(usingDefaultFormat) }; - usingDefaultFormat as u64 - }); - __bindgen_bitfield_unit.set(1usize, 1u8, { - let usingDefaultChannels: u32 = unsafe { ::core::mem::transmute(usingDefaultChannels) }; - usingDefaultChannels as u64 - }); - __bindgen_bitfield_unit.set(2usize, 1u8, { - let usingDefaultChannelMap: u32 = - unsafe { ::core::mem::transmute(usingDefaultChannelMap) }; - usingDefaultChannelMap as u64 - }); - __bindgen_bitfield_unit + &(*(::core::ptr::null::())).usingDefaultChannelMap as *const _ + as usize + }, + 10714usize, + concat!( + "Offset of field: ", + stringify!(ma_device__bindgen_ty_3), + "::", + stringify!(usingDefaultChannelMap) + ) + ); +} +impl ::core::fmt::Debug for ma_device__bindgen_ty_3 { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + write ! (f , "ma_device__bindgen_ty_3 {{ id: {:?}, name: [...], shareMode: {:?}, format: {:?}, channels: {:?}, channelMap: [...], internalFormat: {:?}, internalChannels: {:?}, internalSampleRate: {:?}, internalChannelMap: [...], internalPeriodSizeInFrames: {:?}, internalPeriods: {:?}, channelMixMode: {:?}, converter: {:?}, usingDefaultFormat: {:?}, usingDefaultChannels: {:?}, usingDefaultChannelMap: {:?} }}" , self . id , self . shareMode , self . format , self . channels , self . internalFormat , self . internalChannels , self . internalSampleRate , self . internalPeriodSizeInFrames , self . internalPeriods , self . channelMixMode , self . converter , self . usingDefaultFormat , self . usingDefaultChannels , self . usingDefaultChannelMap) } } #[repr(C)] @@ -9060,7 +8922,7 @@ impl ma_device__bindgen_ty_3 { pub union ma_device__bindgen_ty_4 { pub coreaudio: ma_device__bindgen_ty_4__bindgen_ty_1, pub null_device: ma_device__bindgen_ty_4__bindgen_ty_2, - _bindgen_union_align: [u64; 38usize], + _bindgen_union_align: [u64; 53usize], } #[repr(C)] #[derive(Copy, Clone)] @@ -9070,7 +8932,7 @@ pub struct ma_device__bindgen_ty_4__bindgen_ty_1 { pub audioUnitPlayback: ma_ptr, pub audioUnitCapture: ma_ptr, pub pAudioBufferList: ma_ptr, - pub audioBufferSizeInBytes: ma_uint32, + pub audioBufferCapInFrames: ma_uint32, pub stopEvent: ma_event, pub originalPeriodSizeInFrames: ma_uint32, pub originalPeriodSizeInMilliseconds: ma_uint32, @@ -9168,14 +9030,14 @@ fn bindgen_test_layout_ma_device__bindgen_ty_4__bindgen_ty_1() { assert_eq!( unsafe { &(*(::core::ptr::null::())) - .audioBufferSizeInBytes as *const _ as usize + .audioBufferCapInFrames as *const _ as usize }, 32usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_4__bindgen_ty_1), "::", - stringify!(audioBufferSizeInBytes) + stringify!(audioBufferCapInFrames) ) ); assert_eq!( @@ -9311,7 +9173,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_4__bindgen_ty_1() { } impl ::core::fmt::Debug for ma_device__bindgen_ty_4__bindgen_ty_1 { fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - write ! (f , "ma_device__bindgen_ty_4__bindgen_ty_1 {{ deviceObjectIDPlayback: {:?}, deviceObjectIDCapture: {:?}, audioUnitPlayback: {:?}, audioUnitCapture: {:?}, pAudioBufferList: {:?}, audioBufferSizeInBytes: {:?}, stopEvent: {:?}, originalPeriodSizeInFrames: {:?}, originalPeriodSizeInMilliseconds: {:?}, originalPeriods: {:?}, isDefaultPlaybackDevice: {:?}, isDefaultCaptureDevice: {:?}, isSwitchingPlaybackDevice: {:?}, isSwitchingCaptureDevice: {:?}, duplexRB: {:?}, pRouteChangeHandler: {:?} }}" , self . deviceObjectIDPlayback , self . deviceObjectIDCapture , self . audioUnitPlayback , self . audioUnitCapture , self . pAudioBufferList , self . audioBufferSizeInBytes , self . stopEvent , self . originalPeriodSizeInFrames , self . originalPeriodSizeInMilliseconds , self . originalPeriods , self . isDefaultPlaybackDevice , self . isDefaultCaptureDevice , self . isSwitchingPlaybackDevice , self . isSwitchingCaptureDevice , self . duplexRB , self . pRouteChangeHandler) + write ! (f , "ma_device__bindgen_ty_4__bindgen_ty_1 {{ deviceObjectIDPlayback: {:?}, deviceObjectIDCapture: {:?}, audioUnitPlayback: {:?}, audioUnitCapture: {:?}, pAudioBufferList: {:?}, audioBufferCapInFrames: {:?}, stopEvent: {:?}, originalPeriodSizeInFrames: {:?}, originalPeriodSizeInMilliseconds: {:?}, originalPeriods: {:?}, isDefaultPlaybackDevice: {:?}, isDefaultCaptureDevice: {:?}, isSwitchingPlaybackDevice: {:?}, isSwitchingCaptureDevice: {:?}, duplexRB: {:?}, pRouteChangeHandler: {:?} }}" , self . deviceObjectIDPlayback , self . deviceObjectIDCapture , self . audioUnitPlayback , self . audioUnitCapture , self . pAudioBufferList , self . audioBufferCapInFrames , self . stopEvent , self . originalPeriodSizeInFrames , self . originalPeriodSizeInMilliseconds , self . originalPeriods , self . isDefaultPlaybackDevice , self . isDefaultCaptureDevice , self . isSwitchingPlaybackDevice , self . isSwitchingCaptureDevice , self . duplexRB , self . pRouteChangeHandler) } } #[repr(C)] @@ -9320,6 +9182,7 @@ pub struct ma_device__bindgen_ty_4__bindgen_ty_2 { pub deviceThread: ma_thread, pub operationEvent: ma_event, pub operationCompletionEvent: ma_event, + pub operationSemaphore: ma_semaphore, pub operation: ma_uint32, pub operationResult: ma_result, pub timer: ma_timer, @@ -9334,7 +9197,7 @@ pub struct ma_device__bindgen_ty_4__bindgen_ty_2 { fn bindgen_test_layout_ma_device__bindgen_ty_4__bindgen_ty_2() { assert_eq!( ::core::mem::size_of::(), - 304usize, + 424usize, concat!( "Size of: ", stringify!(ma_device__bindgen_ty_4__bindgen_ty_2) @@ -9387,12 +9250,25 @@ fn bindgen_test_layout_ma_device__bindgen_ty_4__bindgen_ty_2() { stringify!(operationCompletionEvent) ) ); + assert_eq!( + unsafe { + &(*(::core::ptr::null::())).operationSemaphore + as *const _ as usize + }, + 248usize, + concat!( + "Offset of field: ", + stringify!(ma_device__bindgen_ty_4__bindgen_ty_2), + "::", + stringify!(operationSemaphore) + ) + ); assert_eq!( unsafe { &(*(::core::ptr::null::())).operation as *const _ as usize }, - 248usize, + 368usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_4__bindgen_ty_2), @@ -9405,7 +9281,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_4__bindgen_ty_2() { &(*(::core::ptr::null::())).operationResult as *const _ as usize }, - 252usize, + 372usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_4__bindgen_ty_2), @@ -9418,7 +9294,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_4__bindgen_ty_2() { &(*(::core::ptr::null::())).timer as *const _ as usize }, - 256usize, + 376usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_4__bindgen_ty_2), @@ -9431,7 +9307,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_4__bindgen_ty_2() { &(*(::core::ptr::null::())).priorRunTime as *const _ as usize }, - 264usize, + 384usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_4__bindgen_ty_2), @@ -9444,7 +9320,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_4__bindgen_ty_2() { &(*(::core::ptr::null::())) .currentPeriodFramesRemainingPlayback as *const _ as usize }, - 272usize, + 392usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_4__bindgen_ty_2), @@ -9457,7 +9333,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_4__bindgen_ty_2() { &(*(::core::ptr::null::())) .currentPeriodFramesRemainingCapture as *const _ as usize }, - 276usize, + 396usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_4__bindgen_ty_2), @@ -9470,7 +9346,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_4__bindgen_ty_2() { &(*(::core::ptr::null::())) .lastProcessedFramePlayback as *const _ as usize }, - 280usize, + 400usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_4__bindgen_ty_2), @@ -9483,7 +9359,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_4__bindgen_ty_2() { &(*(::core::ptr::null::())) .lastProcessedFrameCapture as *const _ as usize }, - 288usize, + 408usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_4__bindgen_ty_2), @@ -9496,7 +9372,7 @@ fn bindgen_test_layout_ma_device__bindgen_ty_4__bindgen_ty_2() { &(*(::core::ptr::null::())).isStarted as *const _ as usize }, - 296usize, + 416usize, concat!( "Offset of field: ", stringify!(ma_device__bindgen_ty_4__bindgen_ty_2), @@ -9507,14 +9383,14 @@ fn bindgen_test_layout_ma_device__bindgen_ty_4__bindgen_ty_2() { } impl ::core::fmt::Debug for ma_device__bindgen_ty_4__bindgen_ty_2 { fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - write ! (f , "ma_device__bindgen_ty_4__bindgen_ty_2 {{ deviceThread: {:?}, operationEvent: {:?}, operationCompletionEvent: {:?}, operation: {:?}, operationResult: {:?}, timer: {:?}, priorRunTime: {:?}, currentPeriodFramesRemainingPlayback: {:?}, currentPeriodFramesRemainingCapture: {:?}, lastProcessedFramePlayback: {:?}, lastProcessedFrameCapture: {:?}, isStarted: {:?} }}" , self . deviceThread , self . operationEvent , self . operationCompletionEvent , self . operation , self . operationResult , self . timer , self . priorRunTime , self . currentPeriodFramesRemainingPlayback , self . currentPeriodFramesRemainingCapture , self . lastProcessedFramePlayback , self . lastProcessedFrameCapture , self . isStarted) + write ! (f , "ma_device__bindgen_ty_4__bindgen_ty_2 {{ deviceThread: {:?}, operationEvent: {:?}, operationCompletionEvent: {:?}, operationSemaphore: {:?}, operation: {:?}, operationResult: {:?}, timer: {:?}, priorRunTime: {:?}, currentPeriodFramesRemainingPlayback: {:?}, currentPeriodFramesRemainingCapture: {:?}, lastProcessedFramePlayback: {:?}, lastProcessedFrameCapture: {:?}, isStarted: {:?} }}" , self . deviceThread , self . operationEvent , self . operationCompletionEvent , self . operationSemaphore , self . operation , self . operationResult , self . timer , self . priorRunTime , self . currentPeriodFramesRemainingPlayback , self . currentPeriodFramesRemainingCapture , self . lastProcessedFramePlayback , self . lastProcessedFrameCapture , self . isStarted) } } #[test] fn bindgen_test_layout_ma_device__bindgen_ty_4() { assert_eq!( ::core::mem::size_of::(), - 304usize, + 424usize, concat!("Size of: ", stringify!(ma_device__bindgen_ty_4)) ); assert_eq!( @@ -9556,7 +9432,7 @@ impl ::core::fmt::Debug for ma_device__bindgen_ty_4 { fn bindgen_test_layout_ma_device() { assert_eq!( ::core::mem::size_of::(), - 22312usize, + 22448usize, concat!("Size of: ", stringify!(ma_device)) ); assert_eq!( @@ -9695,8 +9571,74 @@ fn bindgen_test_layout_ma_device() { ) ); assert_eq!( - unsafe { &(*(::core::ptr::null::())).masterVolumeFactor as *const _ as usize }, + unsafe { + &(*(::core::ptr::null::())).usingDefaultSampleRate as *const _ as usize + }, + 484usize, + concat!( + "Offset of field: ", + stringify!(ma_device), + "::", + stringify!(usingDefaultSampleRate) + ) + ); + assert_eq!( + unsafe { + &(*(::core::ptr::null::())).usingDefaultBufferSize as *const _ as usize + }, + 485usize, + concat!( + "Offset of field: ", + stringify!(ma_device), + "::", + stringify!(usingDefaultBufferSize) + ) + ); + assert_eq!( + unsafe { &(*(::core::ptr::null::())).usingDefaultPeriods as *const _ as usize }, + 486usize, + concat!( + "Offset of field: ", + stringify!(ma_device), + "::", + stringify!(usingDefaultPeriods) + ) + ); + assert_eq!( + unsafe { &(*(::core::ptr::null::())).isOwnerOfContext as *const _ as usize }, + 487usize, + concat!( + "Offset of field: ", + stringify!(ma_device), + "::", + stringify!(isOwnerOfContext) + ) + ); + assert_eq!( + unsafe { + &(*(::core::ptr::null::())).noPreZeroedOutputBuffer as *const _ as usize + }, 488usize, + concat!( + "Offset of field: ", + stringify!(ma_device), + "::", + stringify!(noPreZeroedOutputBuffer) + ) + ); + assert_eq!( + unsafe { &(*(::core::ptr::null::())).noClip as *const _ as usize }, + 489usize, + concat!( + "Offset of field: ", + stringify!(ma_device), + "::", + stringify!(noClip) + ) + ); + assert_eq!( + unsafe { &(*(::core::ptr::null::())).masterVolumeFactor as *const _ as usize }, + 492usize, concat!( "Offset of field: ", stringify!(ma_device), @@ -9736,7 +9678,7 @@ fn bindgen_test_layout_ma_device() { ); assert_eq!( unsafe { &(*(::core::ptr::null::())).capture as *const _ as usize }, - 11296usize, + 11304usize, concat!( "Offset of field: ", stringify!(ma_device), @@ -9747,115 +9689,7 @@ fn bindgen_test_layout_ma_device() { } impl ::core::fmt::Debug for ma_device { fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - write ! (f , "ma_device {{ pContext: {:?}, type: {:?}, sampleRate: {:?}, state: {:?}, onData: {:?}, onStop: {:?}, pUserData: {:?}, lock: {:?}, wakeupEvent: {:?}, startEvent: {:?}, stopEvent: {:?}, thread: {:?}, workResult: {:?}, usingDefaultSampleRate : {:?}, usingDefaultBufferSize : {:?}, usingDefaultPeriods : {:?}, isOwnerOfContext : {:?}, noPreZeroedOutputBuffer : {:?}, noClip : {:?}, masterVolumeFactor: {:?}, duplexRB: {:?}, resampling: {:?}, playback: {:?}, capture: {:?}, __bindgen_anon_1: {:?} }}" , self . pContext , self . type_ , self . sampleRate , self . state , self . onData , self . onStop , self . pUserData , self . lock , self . wakeupEvent , self . startEvent , self . stopEvent , self . thread , self . workResult , self . usingDefaultSampleRate () , self . usingDefaultBufferSize () , self . usingDefaultPeriods () , self . isOwnerOfContext () , self . noPreZeroedOutputBuffer () , self . noClip () , self . masterVolumeFactor , self . duplexRB , self . resampling , self . playback , self . capture , self . __bindgen_anon_1) - } -} -impl ma_device { - #[inline] - pub fn usingDefaultSampleRate(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } - } - #[inline] - pub fn set_usingDefaultSampleRate(&mut self, val: ma_bool32) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn usingDefaultBufferSize(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } - } - #[inline] - pub fn set_usingDefaultBufferSize(&mut self, val: ma_bool32) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(1usize, 1u8, val as u64) - } - } - #[inline] - pub fn usingDefaultPeriods(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } - } - #[inline] - pub fn set_usingDefaultPeriods(&mut self, val: ma_bool32) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(2usize, 1u8, val as u64) - } - } - #[inline] - pub fn isOwnerOfContext(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u32) } - } - #[inline] - pub fn set_isOwnerOfContext(&mut self, val: ma_bool32) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(3usize, 1u8, val as u64) - } - } - #[inline] - pub fn noPreZeroedOutputBuffer(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) } - } - #[inline] - pub fn set_noPreZeroedOutputBuffer(&mut self, val: ma_bool32) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(4usize, 1u8, val as u64) - } - } - #[inline] - pub fn noClip(&self) -> ma_bool32 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u32) } - } - #[inline] - pub fn set_noClip(&mut self, val: ma_bool32) { - unsafe { - let val: u32 = ::core::mem::transmute(val); - self._bitfield_1.set(5usize, 1u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - usingDefaultSampleRate: ma_bool32, - usingDefaultBufferSize: ma_bool32, - usingDefaultPeriods: ma_bool32, - isOwnerOfContext: ma_bool32, - noPreZeroedOutputBuffer: ma_bool32, - noClip: ma_bool32, - ) -> __BindgenBitfieldUnit<[u8; 1usize], u8> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize], u8> = - Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let usingDefaultSampleRate: u32 = - unsafe { ::core::mem::transmute(usingDefaultSampleRate) }; - usingDefaultSampleRate as u64 - }); - __bindgen_bitfield_unit.set(1usize, 1u8, { - let usingDefaultBufferSize: u32 = - unsafe { ::core::mem::transmute(usingDefaultBufferSize) }; - usingDefaultBufferSize as u64 - }); - __bindgen_bitfield_unit.set(2usize, 1u8, { - let usingDefaultPeriods: u32 = unsafe { ::core::mem::transmute(usingDefaultPeriods) }; - usingDefaultPeriods as u64 - }); - __bindgen_bitfield_unit.set(3usize, 1u8, { - let isOwnerOfContext: u32 = unsafe { ::core::mem::transmute(isOwnerOfContext) }; - isOwnerOfContext as u64 - }); - __bindgen_bitfield_unit.set(4usize, 1u8, { - let noPreZeroedOutputBuffer: u32 = - unsafe { ::core::mem::transmute(noPreZeroedOutputBuffer) }; - noPreZeroedOutputBuffer as u64 - }); - __bindgen_bitfield_unit.set(5usize, 1u8, { - let noClip: u32 = unsafe { ::core::mem::transmute(noClip) }; - noClip as u64 - }); - __bindgen_bitfield_unit + write ! (f , "ma_device {{ pContext: {:?}, type: {:?}, sampleRate: {:?}, state: {:?}, onData: {:?}, onStop: {:?}, pUserData: {:?}, lock: {:?}, wakeupEvent: {:?}, startEvent: {:?}, stopEvent: {:?}, thread: {:?}, workResult: {:?}, usingDefaultSampleRate: {:?}, usingDefaultBufferSize: {:?}, usingDefaultPeriods: {:?}, isOwnerOfContext: {:?}, noPreZeroedOutputBuffer: {:?}, noClip: {:?}, masterVolumeFactor: {:?}, duplexRB: {:?}, resampling: {:?}, playback: {:?}, capture: {:?}, __bindgen_anon_1: {:?} }}" , self . pContext , self . type_ , self . sampleRate , self . state , self . onData , self . onStop , self . pUserData , self . lock , self . wakeupEvent , self . startEvent , self . stopEvent , self . thread , self . workResult , self . usingDefaultSampleRate , self . usingDefaultBufferSize , self . usingDefaultPeriods , self . isOwnerOfContext , self . noPreZeroedOutputBuffer , self . noClip , self . masterVolumeFactor , self . duplexRB , self . resampling , self . playback , self . capture , self . __bindgen_anon_1) } } extern "C" { @@ -12455,6 +12289,9 @@ extern "C" { extern "C" { pub fn ma_waveform_set_frequency(pWaveform: *mut ma_waveform, frequency: f64) -> ma_result; } +extern "C" { + pub fn ma_waveform_set_type(pWaveform: *mut ma_waveform, type_: ma_waveform_type) -> ma_result; +} extern "C" { pub fn ma_waveform_set_sample_rate( pWaveform: *mut ma_waveform, @@ -12788,3 +12625,12 @@ extern "C" { frameCount: ma_uint64, ) -> ma_uint64; } +extern "C" { + pub fn ma_noise_set_amplitude(pNoise: *mut ma_noise, amplitude: f64) -> ma_result; +} +extern "C" { + pub fn ma_noise_set_seed(pNoise: *mut ma_noise, seed: ma_int32) -> ma_result; +} +extern "C" { + pub fn ma_noise_set_type(pNoise: *mut ma_noise, type_: ma_noise_type) -> ma_result; +}