diff --git a/.github/workflows/cpal.yml b/.github/workflows/cpal.yml index 805d723..09834ad 100644 --- a/.github/workflows/cpal.yml +++ b/.github/workflows/cpal.yml @@ -24,6 +24,23 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} args: --all --all-features + rustfmt-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Install stable + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + components: rustfmt + - name: Run rustfmt + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check + cargo-publish: if: github.event_name == 'push' && github.ref == 'refs/heads/master' diff --git a/.rustfmt.toml b/.rustfmt.toml deleted file mode 100644 index 5d38d1c..0000000 --- a/.rustfmt.toml +++ /dev/null @@ -1,18 +0,0 @@ -fn_args_density = "Compressed" -fn_args_layout = "Visual" -fn_brace_style = "SameLineWhere" -fn_call_style = "Visual" -fn_empty_single_line = false -format_strings = true -generics_indent = "Visual" -impl_empty_single_line = false -match_block_trailing_comma = true -reorder_imported_names = true -reorder_imports = true -reorder_imports_in_group = true -spaces_around_ranges = true -use_try_shorthand = true -where_density = "Tall" -where_style = "Legacy" -wrap_match_arms = false -write_mode = "Overwrite" diff --git a/alsa-sys/src/lib.rs b/alsa-sys/src/lib.rs index 08273c4..b8471a1 100644 --- a/alsa-sys/src/lib.rs +++ b/alsa-sys/src/lib.rs @@ -3,13 +3,16 @@ #![allow(non_snake_case)] #![allow(non_upper_case_globals)] -use libc::{c_int, c_uint, c_long, c_longlong, size_t, ssize_t, c_void, c_char, c_uchar, c_ulong, c_double, FILE, c_ushort, c_short, pid_t, timeval, timespec, pollfd}; -use std::{mem}; +use libc::{ + c_char, c_double, c_int, c_long, c_longlong, c_short, c_uchar, c_uint, c_ulong, c_ushort, + c_void, pid_t, pollfd, size_t, ssize_t, timespec, timeval, FILE, +}; +use std::mem; extern crate libc; pub static SND_PCM_NONBLOCK: c_int = 0x1; -pub static SND_PCM_ASYNC: c_int = 0x2; +pub static SND_PCM_ASYNC: c_int = 0x2; #[repr(C)] pub struct snd_dlsym_link { @@ -18,164 +21,171 @@ pub struct snd_dlsym_link { pub dlsym_ptr: *const c_void, } -pub enum snd_async_handler_t { } +pub enum snd_async_handler_t {} -pub type snd_async_callback_t = Option; -pub enum snd_shm_area { } +pub type snd_async_callback_t = Option; +pub enum snd_shm_area {} pub type snd_timestamp_t = timeval; pub type snd_htimestamp_t = timespec; -pub enum snd_input_t { } +pub enum snd_input_t {} pub type snd_input_type_t = c_uint; -pub const SND_INPUT_STDIO: c_uint = 0; +pub const SND_INPUT_STDIO: c_uint = 0; pub const SND_INPUT_BUFFER: c_uint = 1; -pub enum snd_output_t { } +pub enum snd_output_t {} pub type snd_output_type_t = c_uint; -pub const SND_OUTPUT_STDIO: c_uint = 0; +pub const SND_OUTPUT_STDIO: c_uint = 0; pub const SND_OUTPUT_BUFFER: c_uint = 1; -pub type snd_lib_error_handler_t = - Option; +pub type snd_lib_error_handler_t = Option< + extern "C" fn( + arg1: *const c_char, + arg2: c_int, + arg3: *const c_char, + arg4: c_int, + arg5: *const c_char, + ... + ), +>; //pub type snd_local_error_handler_t = // Option; pub type snd_config_type_t = c_uint; -pub const SND_CONFIG_TYPE_INTEGER: c_uint = 0; +pub const SND_CONFIG_TYPE_INTEGER: c_uint = 0; pub const SND_CONFIG_TYPE_INTEGER64: c_uint = 1; -pub const SND_CONFIG_TYPE_REAL: c_uint = 2; -pub const SND_CONFIG_TYPE_STRING: c_uint = 3; -pub const SND_CONFIG_TYPE_POINTER: c_uint = 4; -pub const SND_CONFIG_TYPE_COMPOUND: c_uint = 1024; +pub const SND_CONFIG_TYPE_REAL: c_uint = 2; +pub const SND_CONFIG_TYPE_STRING: c_uint = 3; +pub const SND_CONFIG_TYPE_POINTER: c_uint = 4; +pub const SND_CONFIG_TYPE_COMPOUND: c_uint = 1024; -pub enum snd_config_t { } +pub enum snd_config_t {} -pub enum Struct__snd_config_iterator { } +pub enum Struct__snd_config_iterator {} pub type snd_config_iterator_t = *mut Struct__snd_config_iterator; -pub enum snd_config_update_t { } +pub enum snd_config_update_t {} #[repr(C)] pub struct snd_devname_t { - pub name: *mut c_char, + pub name: *mut c_char, pub comment: *mut c_char, - pub next: *mut snd_devname_t, + pub next: *mut snd_devname_t, } -pub enum snd_pcm_info_t { } -pub enum snd_pcm_hw_params_t { } -pub enum snd_pcm_sw_params_t { } -pub enum snd_pcm_status_t { } -pub enum snd_pcm_access_mask_t { } -pub enum snd_pcm_format_mask_t { } -pub enum snd_pcm_subformat_mask_t { } +pub enum snd_pcm_info_t {} +pub enum snd_pcm_hw_params_t {} +pub enum snd_pcm_sw_params_t {} +pub enum snd_pcm_status_t {} +pub enum snd_pcm_access_mask_t {} +pub enum snd_pcm_format_mask_t {} +pub enum snd_pcm_subformat_mask_t {} pub type snd_pcm_class_t = c_uint; -pub const SND_PCM_CLASS_GENERIC: c_uint = 0; -pub const SND_PCM_CLASS_MULTI: c_uint = 1; -pub const SND_PCM_CLASS_MODEM: c_uint = 2; +pub const SND_PCM_CLASS_GENERIC: c_uint = 0; +pub const SND_PCM_CLASS_MULTI: c_uint = 1; +pub const SND_PCM_CLASS_MODEM: c_uint = 2; pub const SND_PCM_CLASS_DIGITIZER: c_uint = 3; -pub const SND_PCM_CLASS_LAST: c_uint = 3; +pub const SND_PCM_CLASS_LAST: c_uint = 3; pub type snd_pcm_subclass_t = c_uint; pub const SND_PCM_SUBCLASS_GENERIC_MIX: c_uint = 0; -pub const SND_PCM_SUBCLASS_MULTI_MIX: c_uint = 1; -pub const SND_PCM_SUBCLASS_LAST: c_uint = 1; +pub const SND_PCM_SUBCLASS_MULTI_MIX: c_uint = 1; +pub const SND_PCM_SUBCLASS_LAST: c_uint = 1; pub type snd_pcm_stream_t = c_uint; pub const SND_PCM_STREAM_PLAYBACK: c_uint = 0; -pub const SND_PCM_STREAM_CAPTURE: c_uint = 1; -pub const SND_PCM_STREAM_LAST: c_uint = 1; +pub const SND_PCM_STREAM_CAPTURE: c_uint = 1; +pub const SND_PCM_STREAM_LAST: c_uint = 1; pub type snd_pcm_access_t = c_uint; -pub const SND_PCM_ACCESS_MMAP_INTERLEAVED: c_uint = 0; +pub const SND_PCM_ACCESS_MMAP_INTERLEAVED: c_uint = 0; pub const SND_PCM_ACCESS_MMAP_NONINTERLEAVED: c_uint = 1; -pub const SND_PCM_ACCESS_MMAP_COMPLEX: c_uint = 2; -pub const SND_PCM_ACCESS_RW_INTERLEAVED: c_uint = 3; -pub const SND_PCM_ACCESS_RW_NONINTERLEAVED: c_uint = 4; -pub const SND_PCM_ACCESS_LAST: c_uint = 4; +pub const SND_PCM_ACCESS_MMAP_COMPLEX: c_uint = 2; +pub const SND_PCM_ACCESS_RW_INTERLEAVED: c_uint = 3; +pub const SND_PCM_ACCESS_RW_NONINTERLEAVED: c_uint = 4; +pub const SND_PCM_ACCESS_LAST: c_uint = 4; pub type snd_pcm_format_t = c_int; -pub const SND_PCM_FORMAT_UNKNOWN: c_int = -1; -pub const SND_PCM_FORMAT_S8: c_int = 0; -pub const SND_PCM_FORMAT_U8: c_int = 1; -pub const SND_PCM_FORMAT_S16_LE: c_int = 2; -pub const SND_PCM_FORMAT_S16_BE: c_int = 3; -pub const SND_PCM_FORMAT_U16_LE: c_int = 4; -pub const SND_PCM_FORMAT_U16_BE: c_int = 5; -pub const SND_PCM_FORMAT_S24_LE: c_int = 6; -pub const SND_PCM_FORMAT_S24_BE: c_int = 7; -pub const SND_PCM_FORMAT_U24_LE: c_int = 8; -pub const SND_PCM_FORMAT_U24_BE: c_int = 9; -pub const SND_PCM_FORMAT_S32_LE: c_int = 10; -pub const SND_PCM_FORMAT_S32_BE: c_int = 11; -pub const SND_PCM_FORMAT_U32_LE: c_int = 12; -pub const SND_PCM_FORMAT_U32_BE: c_int = 13; -pub const SND_PCM_FORMAT_FLOAT_LE: c_int = 14; -pub const SND_PCM_FORMAT_FLOAT_BE: c_int = 15; -pub const SND_PCM_FORMAT_FLOAT64_LE: c_int = 16; -pub const SND_PCM_FORMAT_FLOAT64_BE: c_int = 17; +pub const SND_PCM_FORMAT_UNKNOWN: c_int = -1; +pub const SND_PCM_FORMAT_S8: c_int = 0; +pub const SND_PCM_FORMAT_U8: c_int = 1; +pub const SND_PCM_FORMAT_S16_LE: c_int = 2; +pub const SND_PCM_FORMAT_S16_BE: c_int = 3; +pub const SND_PCM_FORMAT_U16_LE: c_int = 4; +pub const SND_PCM_FORMAT_U16_BE: c_int = 5; +pub const SND_PCM_FORMAT_S24_LE: c_int = 6; +pub const SND_PCM_FORMAT_S24_BE: c_int = 7; +pub const SND_PCM_FORMAT_U24_LE: c_int = 8; +pub const SND_PCM_FORMAT_U24_BE: c_int = 9; +pub const SND_PCM_FORMAT_S32_LE: c_int = 10; +pub const SND_PCM_FORMAT_S32_BE: c_int = 11; +pub const SND_PCM_FORMAT_U32_LE: c_int = 12; +pub const SND_PCM_FORMAT_U32_BE: c_int = 13; +pub const SND_PCM_FORMAT_FLOAT_LE: c_int = 14; +pub const SND_PCM_FORMAT_FLOAT_BE: c_int = 15; +pub const SND_PCM_FORMAT_FLOAT64_LE: c_int = 16; +pub const SND_PCM_FORMAT_FLOAT64_BE: c_int = 17; pub const SND_PCM_FORMAT_IEC958_SUBFRAME_LE: c_int = 18; pub const SND_PCM_FORMAT_IEC958_SUBFRAME_BE: c_int = 19; -pub const SND_PCM_FORMAT_MU_LAW: c_int = 20; -pub const SND_PCM_FORMAT_A_LAW: c_int = 21; -pub const SND_PCM_FORMAT_IMA_ADPCM: c_int = 22; -pub const SND_PCM_FORMAT_MPEG: c_int = 23; -pub const SND_PCM_FORMAT_GSM: c_int = 24; -pub const SND_PCM_FORMAT_SPECIAL: c_int = 31; -pub const SND_PCM_FORMAT_S24_3LE: c_int = 32; -pub const SND_PCM_FORMAT_S24_3BE: c_int = 33; -pub const SND_PCM_FORMAT_U24_3LE: c_int = 34; -pub const SND_PCM_FORMAT_U24_3BE: c_int = 35; -pub const SND_PCM_FORMAT_S20_3LE: c_int = 36; -pub const SND_PCM_FORMAT_S20_3BE: c_int = 37; -pub const SND_PCM_FORMAT_U20_3LE: c_int = 38; -pub const SND_PCM_FORMAT_U20_3BE: c_int = 39; -pub const SND_PCM_FORMAT_S18_3LE: c_int = 40; -pub const SND_PCM_FORMAT_S18_3BE: c_int = 41; -pub const SND_PCM_FORMAT_U18_3LE: c_int = 42; -pub const SND_PCM_FORMAT_U18_3BE: c_int = 43; -pub const SND_PCM_FORMAT_G723_24: c_int = 44; -pub const SND_PCM_FORMAT_G723_24_1B: c_int = 45; -pub const SND_PCM_FORMAT_G723_40: c_int = 46; -pub const SND_PCM_FORMAT_G723_40_1B: c_int = 47; -pub const SND_PCM_FORMAT_DSD_U8: c_int = 48; -pub const SND_PCM_FORMAT_DSD_U16_LE: c_int = 49; -pub const SND_PCM_FORMAT_LAST: c_int = 49; -pub const SND_PCM_FORMAT_S16: c_int = 2; -pub const SND_PCM_FORMAT_U16: c_int = 4; -pub const SND_PCM_FORMAT_S24: c_int = 6; -pub const SND_PCM_FORMAT_U24: c_int = 8; -pub const SND_PCM_FORMAT_S32: c_int = 10; -pub const SND_PCM_FORMAT_U32: c_int = 12; -pub const SND_PCM_FORMAT_FLOAT: c_int = 14; -pub const SND_PCM_FORMAT_FLOAT64: c_int = 16; -pub const SND_PCM_FORMAT_IEC958_SUBFRAME: c_int = 18; +pub const SND_PCM_FORMAT_MU_LAW: c_int = 20; +pub const SND_PCM_FORMAT_A_LAW: c_int = 21; +pub const SND_PCM_FORMAT_IMA_ADPCM: c_int = 22; +pub const SND_PCM_FORMAT_MPEG: c_int = 23; +pub const SND_PCM_FORMAT_GSM: c_int = 24; +pub const SND_PCM_FORMAT_SPECIAL: c_int = 31; +pub const SND_PCM_FORMAT_S24_3LE: c_int = 32; +pub const SND_PCM_FORMAT_S24_3BE: c_int = 33; +pub const SND_PCM_FORMAT_U24_3LE: c_int = 34; +pub const SND_PCM_FORMAT_U24_3BE: c_int = 35; +pub const SND_PCM_FORMAT_S20_3LE: c_int = 36; +pub const SND_PCM_FORMAT_S20_3BE: c_int = 37; +pub const SND_PCM_FORMAT_U20_3LE: c_int = 38; +pub const SND_PCM_FORMAT_U20_3BE: c_int = 39; +pub const SND_PCM_FORMAT_S18_3LE: c_int = 40; +pub const SND_PCM_FORMAT_S18_3BE: c_int = 41; +pub const SND_PCM_FORMAT_U18_3LE: c_int = 42; +pub const SND_PCM_FORMAT_U18_3BE: c_int = 43; +pub const SND_PCM_FORMAT_G723_24: c_int = 44; +pub const SND_PCM_FORMAT_G723_24_1B: c_int = 45; +pub const SND_PCM_FORMAT_G723_40: c_int = 46; +pub const SND_PCM_FORMAT_G723_40_1B: c_int = 47; +pub const SND_PCM_FORMAT_DSD_U8: c_int = 48; +pub const SND_PCM_FORMAT_DSD_U16_LE: c_int = 49; +pub const SND_PCM_FORMAT_LAST: c_int = 49; +pub const SND_PCM_FORMAT_S16: c_int = 2; +pub const SND_PCM_FORMAT_U16: c_int = 4; +pub const SND_PCM_FORMAT_S24: c_int = 6; +pub const SND_PCM_FORMAT_U24: c_int = 8; +pub const SND_PCM_FORMAT_S32: c_int = 10; +pub const SND_PCM_FORMAT_U32: c_int = 12; +pub const SND_PCM_FORMAT_FLOAT: c_int = 14; +pub const SND_PCM_FORMAT_FLOAT64: c_int = 16; +pub const SND_PCM_FORMAT_IEC958_SUBFRAME: c_int = 18; pub type snd_pcm_subformat_t = c_uint; -pub const SND_PCM_SUBFORMAT_STD: c_uint = 0; +pub const SND_PCM_SUBFORMAT_STD: c_uint = 0; pub const SND_PCM_SUBFORMAT_LAST: c_uint = 0; pub type snd_pcm_state_t = c_uint; -pub const SND_PCM_STATE_OPEN: c_uint = 0; -pub const SND_PCM_STATE_SETUP: c_uint = 1; -pub const SND_PCM_STATE_PREPARED: c_uint = 2; -pub const SND_PCM_STATE_RUNNING: c_uint = 3; -pub const SND_PCM_STATE_XRUN: c_uint = 4; -pub const SND_PCM_STATE_DRAINING: c_uint = 5; -pub const SND_PCM_STATE_PAUSED: c_uint = 6; -pub const SND_PCM_STATE_SUSPENDED: c_uint = 7; +pub const SND_PCM_STATE_OPEN: c_uint = 0; +pub const SND_PCM_STATE_SETUP: c_uint = 1; +pub const SND_PCM_STATE_PREPARED: c_uint = 2; +pub const SND_PCM_STATE_RUNNING: c_uint = 3; +pub const SND_PCM_STATE_XRUN: c_uint = 4; +pub const SND_PCM_STATE_DRAINING: c_uint = 5; +pub const SND_PCM_STATE_PAUSED: c_uint = 6; +pub const SND_PCM_STATE_SUSPENDED: c_uint = 7; pub const SND_PCM_STATE_DISCONNECTED: c_uint = 8; -pub const SND_PCM_STATE_LAST: c_uint = 8; +pub const SND_PCM_STATE_LAST: c_uint = 8; pub type snd_pcm_start_t = c_uint; -pub const SND_PCM_START_DATA: c_uint = 0; +pub const SND_PCM_START_DATA: c_uint = 0; pub const SND_PCM_START_EXPLICIT: c_uint = 1; -pub const SND_PCM_START_LAST: c_uint = 1; +pub const SND_PCM_START_LAST: c_uint = 1; pub type snd_pcm_xrun_t = c_uint; pub const SND_PCM_XRUN_NONE: c_uint = 0; @@ -183,48 +193,48 @@ pub const SND_PCM_XRUN_STOP: c_uint = 1; pub const SND_PCM_XRUN_LAST: c_uint = 1; pub type snd_pcm_tstamp_t = c_uint; -pub const SND_PCM_TSTAMP_NONE: c_uint = 0; +pub const SND_PCM_TSTAMP_NONE: c_uint = 0; pub const SND_PCM_TSTAMP_ENABLE: c_uint = 1; -pub const SND_PCM_TSTAMP_MMAP: c_uint = 1; -pub const SND_PCM_TSTAMP_LAST: c_uint = 1; +pub const SND_PCM_TSTAMP_MMAP: c_uint = 1; +pub const SND_PCM_TSTAMP_LAST: c_uint = 1; pub type snd_pcm_uframes_t = c_ulong; pub type snd_pcm_sframes_t = c_long; -pub enum snd_pcm_t { } +pub enum snd_pcm_t {} pub type snd_pcm_type_t = c_uint; -pub const SND_PCM_TYPE_HW: c_uint = 0; -pub const SND_PCM_TYPE_HOOKS: c_uint = 1; -pub const SND_PCM_TYPE_MULTI: c_uint = 2; -pub const SND_PCM_TYPE_FILE: c_uint = 3; -pub const SND_PCM_TYPE_NULL: c_uint = 4; -pub const SND_PCM_TYPE_SHM: c_uint = 5; -pub const SND_PCM_TYPE_INET: c_uint = 6; -pub const SND_PCM_TYPE_COPY: c_uint = 7; -pub const SND_PCM_TYPE_LINEAR: c_uint = 8; -pub const SND_PCM_TYPE_ALAW: c_uint = 9; -pub const SND_PCM_TYPE_MULAW: c_uint = 10; -pub const SND_PCM_TYPE_ADPCM: c_uint = 11; -pub const SND_PCM_TYPE_RATE: c_uint = 12; -pub const SND_PCM_TYPE_ROUTE: c_uint = 13; -pub const SND_PCM_TYPE_PLUG: c_uint = 14; -pub const SND_PCM_TYPE_SHARE: c_uint = 15; -pub const SND_PCM_TYPE_METER: c_uint = 16; -pub const SND_PCM_TYPE_MIX: c_uint = 17; -pub const SND_PCM_TYPE_DROUTE: c_uint = 18; -pub const SND_PCM_TYPE_LBSERVER: c_uint = 19; +pub const SND_PCM_TYPE_HW: c_uint = 0; +pub const SND_PCM_TYPE_HOOKS: c_uint = 1; +pub const SND_PCM_TYPE_MULTI: c_uint = 2; +pub const SND_PCM_TYPE_FILE: c_uint = 3; +pub const SND_PCM_TYPE_NULL: c_uint = 4; +pub const SND_PCM_TYPE_SHM: c_uint = 5; +pub const SND_PCM_TYPE_INET: c_uint = 6; +pub const SND_PCM_TYPE_COPY: c_uint = 7; +pub const SND_PCM_TYPE_LINEAR: c_uint = 8; +pub const SND_PCM_TYPE_ALAW: c_uint = 9; +pub const SND_PCM_TYPE_MULAW: c_uint = 10; +pub const SND_PCM_TYPE_ADPCM: c_uint = 11; +pub const SND_PCM_TYPE_RATE: c_uint = 12; +pub const SND_PCM_TYPE_ROUTE: c_uint = 13; +pub const SND_PCM_TYPE_PLUG: c_uint = 14; +pub const SND_PCM_TYPE_SHARE: c_uint = 15; +pub const SND_PCM_TYPE_METER: c_uint = 16; +pub const SND_PCM_TYPE_MIX: c_uint = 17; +pub const SND_PCM_TYPE_DROUTE: c_uint = 18; +pub const SND_PCM_TYPE_LBSERVER: c_uint = 19; pub const SND_PCM_TYPE_LINEAR_FLOAT: c_uint = 20; -pub const SND_PCM_TYPE_LADSPA: c_uint = 21; -pub const SND_PCM_TYPE_DMIX: c_uint = 22; -pub const SND_PCM_TYPE_JACK: c_uint = 23; -pub const SND_PCM_TYPE_DSNOOP: c_uint = 24; -pub const SND_PCM_TYPE_DSHARE: c_uint = 25; -pub const SND_PCM_TYPE_IEC958: c_uint = 26; -pub const SND_PCM_TYPE_SOFTVOL: c_uint = 27; -pub const SND_PCM_TYPE_IOPLUG: c_uint = 28; -pub const SND_PCM_TYPE_EXTPLUG: c_uint = 29; -pub const SND_PCM_TYPE_MMAP_EMUL: c_uint = 30; -pub const SND_PCM_TYPE_LAST: c_uint = 30; +pub const SND_PCM_TYPE_LADSPA: c_uint = 21; +pub const SND_PCM_TYPE_DMIX: c_uint = 22; +pub const SND_PCM_TYPE_JACK: c_uint = 23; +pub const SND_PCM_TYPE_DSNOOP: c_uint = 24; +pub const SND_PCM_TYPE_DSHARE: c_uint = 25; +pub const SND_PCM_TYPE_IEC958: c_uint = 26; +pub const SND_PCM_TYPE_SOFTVOL: c_uint = 27; +pub const SND_PCM_TYPE_IOPLUG: c_uint = 28; +pub const SND_PCM_TYPE_EXTPLUG: c_uint = 29; +pub const SND_PCM_TYPE_MMAP_EMUL: c_uint = 30; +pub const SND_PCM_TYPE_LAST: c_uint = 30; #[repr(C)] pub struct snd_pcm_channel_area_t { @@ -249,54 +259,54 @@ impl snd_pcm_sync_id_t { } } -pub enum snd_pcm_scope_t { } +pub enum snd_pcm_scope_t {} pub type snd_pcm_chmap_type = c_uint; -pub const SND_CHMAP_TYPE_NONE: c_uint = 0; -pub const SND_CHMAP_TYPE_FIXED: c_uint = 1; -pub const SND_CHMAP_TYPE_VAR: c_uint = 2; +pub const SND_CHMAP_TYPE_NONE: c_uint = 0; +pub const SND_CHMAP_TYPE_FIXED: c_uint = 1; +pub const SND_CHMAP_TYPE_VAR: c_uint = 2; pub const SND_CHMAP_TYPE_PAIRED: c_uint = 3; -pub const SND_CHMAP_TYPE_LAST: c_uint = 3; +pub const SND_CHMAP_TYPE_LAST: c_uint = 3; pub type snd_pcm_chmap_position = c_uint; pub const SND_CHMAP_UNKNOWN: c_uint = 0; -pub const SND_CHMAP_NA: c_uint = 1; -pub const SND_CHMAP_MONO: c_uint = 2; -pub const SND_CHMAP_FL: c_uint = 3; -pub const SND_CHMAP_FR: c_uint = 4; -pub const SND_CHMAP_RL: c_uint = 5; -pub const SND_CHMAP_RR: c_uint = 6; -pub const SND_CHMAP_FC: c_uint = 7; -pub const SND_CHMAP_LFE: c_uint = 8; -pub const SND_CHMAP_SL: c_uint = 9; -pub const SND_CHMAP_SR: c_uint = 10; -pub const SND_CHMAP_RC: c_uint = 11; -pub const SND_CHMAP_FLC: c_uint = 12; -pub const SND_CHMAP_FRC: c_uint = 13; -pub const SND_CHMAP_RLC: c_uint = 14; -pub const SND_CHMAP_RRC: c_uint = 15; -pub const SND_CHMAP_FLW: c_uint = 16; -pub const SND_CHMAP_FRW: c_uint = 17; -pub const SND_CHMAP_FLH: c_uint = 18; -pub const SND_CHMAP_FCH: c_uint = 19; -pub const SND_CHMAP_FRH: c_uint = 20; -pub const SND_CHMAP_TC: c_uint = 21; -pub const SND_CHMAP_TFL: c_uint = 22; -pub const SND_CHMAP_TFR: c_uint = 23; -pub const SND_CHMAP_TFC: c_uint = 24; -pub const SND_CHMAP_TRL: c_uint = 25; -pub const SND_CHMAP_TRR: c_uint = 26; -pub const SND_CHMAP_TRC: c_uint = 27; -pub const SND_CHMAP_TFLC: c_uint = 28; -pub const SND_CHMAP_TFRC: c_uint = 29; -pub const SND_CHMAP_TSL: c_uint = 30; -pub const SND_CHMAP_TSR: c_uint = 31; -pub const SND_CHMAP_LLFE: c_uint = 32; -pub const SND_CHMAP_RLFE: c_uint = 33; -pub const SND_CHMAP_BC: c_uint = 34; -pub const SND_CHMAP_BLC: c_uint = 35; -pub const SND_CHMAP_BRC: c_uint = 36; -pub const SND_CHMAP_LAST: c_uint = 36; +pub const SND_CHMAP_NA: c_uint = 1; +pub const SND_CHMAP_MONO: c_uint = 2; +pub const SND_CHMAP_FL: c_uint = 3; +pub const SND_CHMAP_FR: c_uint = 4; +pub const SND_CHMAP_RL: c_uint = 5; +pub const SND_CHMAP_RR: c_uint = 6; +pub const SND_CHMAP_FC: c_uint = 7; +pub const SND_CHMAP_LFE: c_uint = 8; +pub const SND_CHMAP_SL: c_uint = 9; +pub const SND_CHMAP_SR: c_uint = 10; +pub const SND_CHMAP_RC: c_uint = 11; +pub const SND_CHMAP_FLC: c_uint = 12; +pub const SND_CHMAP_FRC: c_uint = 13; +pub const SND_CHMAP_RLC: c_uint = 14; +pub const SND_CHMAP_RRC: c_uint = 15; +pub const SND_CHMAP_FLW: c_uint = 16; +pub const SND_CHMAP_FRW: c_uint = 17; +pub const SND_CHMAP_FLH: c_uint = 18; +pub const SND_CHMAP_FCH: c_uint = 19; +pub const SND_CHMAP_FRH: c_uint = 20; +pub const SND_CHMAP_TC: c_uint = 21; +pub const SND_CHMAP_TFL: c_uint = 22; +pub const SND_CHMAP_TFR: c_uint = 23; +pub const SND_CHMAP_TFC: c_uint = 24; +pub const SND_CHMAP_TRL: c_uint = 25; +pub const SND_CHMAP_TRR: c_uint = 26; +pub const SND_CHMAP_TRC: c_uint = 27; +pub const SND_CHMAP_TFLC: c_uint = 28; +pub const SND_CHMAP_TFRC: c_uint = 29; +pub const SND_CHMAP_TSL: c_uint = 30; +pub const SND_CHMAP_TSR: c_uint = 31; +pub const SND_CHMAP_LLFE: c_uint = 32; +pub const SND_CHMAP_RLFE: c_uint = 33; +pub const SND_CHMAP_BC: c_uint = 34; +pub const SND_CHMAP_BLC: c_uint = 35; +pub const SND_CHMAP_BRC: c_uint = 36; +pub const SND_CHMAP_LAST: c_uint = 36; #[repr(C)] pub struct snd_pcm_chmap_t { @@ -312,101 +322,101 @@ pub struct snd_pcm_chmap_query_t { pub type snd_pcm_hook_type_t = c_uint; pub const SND_PCM_HOOK_TYPE_HW_PARAMS: c_uint = 0; -pub const SND_PCM_HOOK_TYPE_HW_FREE: c_uint = 1; -pub const SND_PCM_HOOK_TYPE_CLOSE: c_uint = 2; -pub const SND_PCM_HOOK_TYPE_LAST: c_uint = 2; +pub const SND_PCM_HOOK_TYPE_HW_FREE: c_uint = 1; +pub const SND_PCM_HOOK_TYPE_CLOSE: c_uint = 2; +pub const SND_PCM_HOOK_TYPE_LAST: c_uint = 2; -pub enum snd_pcm_hook_t { } -pub type snd_pcm_hook_func_t = Option c_int>; +pub enum snd_pcm_hook_t {} +pub type snd_pcm_hook_func_t = Option c_int>; #[repr(C)] pub struct snd_pcm_scope_ops_t { - pub enable: Option c_int>, - pub disable: Option, - pub start: Option, - pub stop: Option, - pub update: Option, - pub reset: Option, - pub close: Option, + pub enable: Option c_int>, + pub disable: Option, + pub start: Option, + pub stop: Option, + pub update: Option, + pub reset: Option, + pub close: Option, } pub type snd_spcm_latency_t = c_uint; pub const SND_SPCM_LATENCY_STANDARD: c_uint = 0; -pub const SND_SPCM_LATENCY_MEDIUM: c_uint = 1; +pub const SND_SPCM_LATENCY_MEDIUM: c_uint = 1; pub const SND_SPCM_LATENCY_REALTIME: c_uint = 2; pub type snd_spcm_xrun_type_t = c_uint; pub const SND_SPCM_XRUN_IGNORE: c_uint = 0; -pub const SND_SPCM_XRUN_STOP: c_uint = 1; +pub const SND_SPCM_XRUN_STOP: c_uint = 1; pub type snd_spcm_duplex_type_t = c_uint; -pub const SND_SPCM_DUPLEX_LIBERAL: c_uint = 0; +pub const SND_SPCM_DUPLEX_LIBERAL: c_uint = 0; pub const SND_SPCM_DUPLEX_PEDANTIC: c_uint = 1; -pub enum snd_rawmidi_info_t { } +pub enum snd_rawmidi_info_t {} -pub enum snd_rawmidi_params_t { } +pub enum snd_rawmidi_params_t {} -pub enum snd_rawmidi_status_t { } +pub enum snd_rawmidi_status_t {} pub type snd_rawmidi_stream_t = c_uint; pub const SND_RAWMIDI_STREAM_OUTPUT: c_uint = 0; -pub const SND_RAWMIDI_STREAM_INPUT: c_uint = 1; -pub const SND_RAWMIDI_STREAM_LAST: c_uint = 1; +pub const SND_RAWMIDI_STREAM_INPUT: c_uint = 1; +pub const SND_RAWMIDI_STREAM_LAST: c_uint = 1; -pub enum snd_rawmidi_t { } +pub enum snd_rawmidi_t {} pub type snd_rawmidi_type_t = c_uint; -pub const SND_RAWMIDI_TYPE_HW: c_uint = 0; -pub const SND_RAWMIDI_TYPE_SHM: c_uint = 1; -pub const SND_RAWMIDI_TYPE_INET: c_uint = 2; +pub const SND_RAWMIDI_TYPE_HW: c_uint = 0; +pub const SND_RAWMIDI_TYPE_SHM: c_uint = 1; +pub const SND_RAWMIDI_TYPE_INET: c_uint = 2; pub const SND_RAWMIDI_TYPE_VIRTUAL: c_uint = 3; -pub enum snd_timer_id_t { } +pub enum snd_timer_id_t {} -pub enum snd_timer_ginfo_t { } +pub enum snd_timer_ginfo_t {} -pub enum snd_timer_gparams_t { } +pub enum snd_timer_gparams_t {} -pub enum snd_timer_gstatus_t { } +pub enum snd_timer_gstatus_t {} -pub enum snd_timer_info_t { } +pub enum snd_timer_info_t {} -pub enum snd_timer_params_t { } +pub enum snd_timer_params_t {} -pub enum snd_timer_status_t { } +pub enum snd_timer_status_t {} pub type snd_timer_class_t = c_int; -pub const SND_TIMER_CLASS_NONE: c_int = -1; -pub const SND_TIMER_CLASS_SLAVE: c_int = 0; +pub const SND_TIMER_CLASS_NONE: c_int = -1; +pub const SND_TIMER_CLASS_SLAVE: c_int = 0; pub const SND_TIMER_CLASS_GLOBAL: c_int = 1; -pub const SND_TIMER_CLASS_CARD: c_int = 2; -pub const SND_TIMER_CLASS_PCM: c_int = 3; -pub const SND_TIMER_CLASS_LAST: c_int = 3; +pub const SND_TIMER_CLASS_CARD: c_int = 2; +pub const SND_TIMER_CLASS_PCM: c_int = 3; +pub const SND_TIMER_CLASS_LAST: c_int = 3; pub type snd_timer_slave_class_t = c_uint; -pub const SND_TIMER_SCLASS_NONE: c_uint = 0; -pub const SND_TIMER_SCLASS_APPLICATION: c_uint = 1; -pub const SND_TIMER_SCLASS_SEQUENCER: c_uint = 2; +pub const SND_TIMER_SCLASS_NONE: c_uint = 0; +pub const SND_TIMER_SCLASS_APPLICATION: c_uint = 1; +pub const SND_TIMER_SCLASS_SEQUENCER: c_uint = 2; pub const SND_TIMER_SCLASS_OSS_SEQUENCER: c_uint = 3; -pub const SND_TIMER_SCLASS_LAST: c_uint = 3; +pub const SND_TIMER_SCLASS_LAST: c_uint = 3; pub type snd_timer_event_t = c_uint; pub const SND_TIMER_EVENT_RESOLUTION: c_uint = 0; -pub const SND_TIMER_EVENT_TICK: c_uint = 1; -pub const SND_TIMER_EVENT_START: c_uint = 2; -pub const SND_TIMER_EVENT_STOP: c_uint = 3; -pub const SND_TIMER_EVENT_CONTINUE: c_uint = 4; -pub const SND_TIMER_EVENT_PAUSE: c_uint = 5; -pub const SND_TIMER_EVENT_EARLY: c_uint = 6; -pub const SND_TIMER_EVENT_SUSPEND: c_uint = 7; -pub const SND_TIMER_EVENT_RESUME: c_uint = 8; -pub const SND_TIMER_EVENT_MSTART: c_uint = 12; -pub const SND_TIMER_EVENT_MSTOP: c_uint = 13; -pub const SND_TIMER_EVENT_MCONTINUE: c_uint = 14; -pub const SND_TIMER_EVENT_MPAUSE: c_uint = 15; -pub const SND_TIMER_EVENT_MSUSPEND: c_uint = 17; -pub const SND_TIMER_EVENT_MRESUME: c_uint = 18; +pub const SND_TIMER_EVENT_TICK: c_uint = 1; +pub const SND_TIMER_EVENT_START: c_uint = 2; +pub const SND_TIMER_EVENT_STOP: c_uint = 3; +pub const SND_TIMER_EVENT_CONTINUE: c_uint = 4; +pub const SND_TIMER_EVENT_PAUSE: c_uint = 5; +pub const SND_TIMER_EVENT_EARLY: c_uint = 6; +pub const SND_TIMER_EVENT_SUSPEND: c_uint = 7; +pub const SND_TIMER_EVENT_RESUME: c_uint = 8; +pub const SND_TIMER_EVENT_MSTART: c_uint = 12; +pub const SND_TIMER_EVENT_MSTOP: c_uint = 13; +pub const SND_TIMER_EVENT_MCONTINUE: c_uint = 14; +pub const SND_TIMER_EVENT_MPAUSE: c_uint = 15; +pub const SND_TIMER_EVENT_MSUSPEND: c_uint = 17; +pub const SND_TIMER_EVENT_MRESUME: c_uint = 18; #[repr(C)] pub struct snd_timer_read_t { @@ -422,45 +432,45 @@ pub struct snd_timer_tread_t { } pub type snd_timer_type_t = c_uint; -pub const SND_TIMER_TYPE_HW: c_uint = 0; -pub const SND_TIMER_TYPE_SHM: c_uint = 1; +pub const SND_TIMER_TYPE_HW: c_uint = 0; +pub const SND_TIMER_TYPE_SHM: c_uint = 1; pub const SND_TIMER_TYPE_INET: c_uint = 2; -pub enum snd_timer_query_t { } +pub enum snd_timer_query_t {} -pub enum snd_timer_t { } +pub enum snd_timer_t {} -pub enum snd_hwdep_info_t { } +pub enum snd_hwdep_info_t {} -pub enum snd_hwdep_dsp_status_t { } +pub enum snd_hwdep_dsp_status_t {} -pub enum snd_hwdep_dsp_image_t { } +pub enum snd_hwdep_dsp_image_t {} pub type snd_hwdep_iface_t = c_uint; -pub const SND_HWDEP_IFACE_OPL2: c_uint = 0; -pub const SND_HWDEP_IFACE_OPL3: c_uint = 1; -pub const SND_HWDEP_IFACE_OPL4: c_uint = 2; -pub const SND_HWDEP_IFACE_SB16CSP: c_uint = 3; -pub const SND_HWDEP_IFACE_EMU10K1: c_uint = 4; -pub const SND_HWDEP_IFACE_YSS225: c_uint = 5; -pub const SND_HWDEP_IFACE_ICS2115: c_uint = 6; -pub const SND_HWDEP_IFACE_SSCAPE: c_uint = 7; -pub const SND_HWDEP_IFACE_VX: c_uint = 8; -pub const SND_HWDEP_IFACE_MIXART: c_uint = 9; -pub const SND_HWDEP_IFACE_USX2Y: c_uint = 10; +pub const SND_HWDEP_IFACE_OPL2: c_uint = 0; +pub const SND_HWDEP_IFACE_OPL3: c_uint = 1; +pub const SND_HWDEP_IFACE_OPL4: c_uint = 2; +pub const SND_HWDEP_IFACE_SB16CSP: c_uint = 3; +pub const SND_HWDEP_IFACE_EMU10K1: c_uint = 4; +pub const SND_HWDEP_IFACE_YSS225: c_uint = 5; +pub const SND_HWDEP_IFACE_ICS2115: c_uint = 6; +pub const SND_HWDEP_IFACE_SSCAPE: c_uint = 7; +pub const SND_HWDEP_IFACE_VX: c_uint = 8; +pub const SND_HWDEP_IFACE_MIXART: c_uint = 9; +pub const SND_HWDEP_IFACE_USX2Y: c_uint = 10; pub const SND_HWDEP_IFACE_EMUX_WAVETABLE: c_uint = 11; -pub const SND_HWDEP_IFACE_BLUETOOTH: c_uint = 12; -pub const SND_HWDEP_IFACE_USX2Y_PCM: c_uint = 13; -pub const SND_HWDEP_IFACE_PCXHR: c_uint = 14; -pub const SND_HWDEP_IFACE_SB_RC: c_uint = 15; -pub const SND_HWDEP_IFACE_LAST: c_uint = 15; +pub const SND_HWDEP_IFACE_BLUETOOTH: c_uint = 12; +pub const SND_HWDEP_IFACE_USX2Y_PCM: c_uint = 13; +pub const SND_HWDEP_IFACE_PCXHR: c_uint = 14; +pub const SND_HWDEP_IFACE_SB_RC: c_uint = 15; +pub const SND_HWDEP_IFACE_LAST: c_uint = 15; pub type snd_hwdep_type_t = c_uint; -pub const SND_HWDEP_TYPE_HW: c_uint = 0; -pub const SND_HWDEP_TYPE_SHM: c_uint = 1; +pub const SND_HWDEP_TYPE_HW: c_uint = 0; +pub const SND_HWDEP_TYPE_SHM: c_uint = 1; pub const SND_HWDEP_TYPE_INET: c_uint = 2; -pub enum snd_hwdep_t { } +pub enum snd_hwdep_t {} #[repr(C)] pub struct snd_aes_iec958_t { @@ -470,99 +480,105 @@ pub struct snd_aes_iec958_t { pub dig_subframe: [c_uchar; 4], } -pub enum snd_ctl_card_info_t { } +pub enum snd_ctl_card_info_t {} -pub enum snd_ctl_elem_id_t { } +pub enum snd_ctl_elem_id_t {} -pub enum snd_ctl_elem_list_t { } +pub enum snd_ctl_elem_list_t {} -pub enum snd_ctl_elem_info_t { } +pub enum snd_ctl_elem_info_t {} -pub enum snd_ctl_elem_value_t { } +pub enum snd_ctl_elem_value_t {} -pub enum snd_ctl_event_t { } +pub enum snd_ctl_event_t {} pub type snd_ctl_elem_type_t = c_uint; -pub const SND_CTL_ELEM_TYPE_NONE: c_uint = 0; -pub const SND_CTL_ELEM_TYPE_BOOLEAN: c_uint = 1; -pub const SND_CTL_ELEM_TYPE_INTEGER: c_uint = 2; +pub const SND_CTL_ELEM_TYPE_NONE: c_uint = 0; +pub const SND_CTL_ELEM_TYPE_BOOLEAN: c_uint = 1; +pub const SND_CTL_ELEM_TYPE_INTEGER: c_uint = 2; pub const SND_CTL_ELEM_TYPE_ENUMERATED: c_uint = 3; -pub const SND_CTL_ELEM_TYPE_BYTES: c_uint = 4; -pub const SND_CTL_ELEM_TYPE_IEC958: c_uint = 5; -pub const SND_CTL_ELEM_TYPE_INTEGER64: c_uint = 6; -pub const SND_CTL_ELEM_TYPE_LAST: c_uint = 6; +pub const SND_CTL_ELEM_TYPE_BYTES: c_uint = 4; +pub const SND_CTL_ELEM_TYPE_IEC958: c_uint = 5; +pub const SND_CTL_ELEM_TYPE_INTEGER64: c_uint = 6; +pub const SND_CTL_ELEM_TYPE_LAST: c_uint = 6; pub type snd_ctl_elem_iface_t = c_uint; -pub const SND_CTL_ELEM_IFACE_CARD: c_uint = 0; -pub const SND_CTL_ELEM_IFACE_HWDEP: c_uint = 1; -pub const SND_CTL_ELEM_IFACE_MIXER: c_uint = 2; -pub const SND_CTL_ELEM_IFACE_PCM: c_uint = 3; -pub const SND_CTL_ELEM_IFACE_RAWMIDI: c_uint = 4; -pub const SND_CTL_ELEM_IFACE_TIMER: c_uint = 5; +pub const SND_CTL_ELEM_IFACE_CARD: c_uint = 0; +pub const SND_CTL_ELEM_IFACE_HWDEP: c_uint = 1; +pub const SND_CTL_ELEM_IFACE_MIXER: c_uint = 2; +pub const SND_CTL_ELEM_IFACE_PCM: c_uint = 3; +pub const SND_CTL_ELEM_IFACE_RAWMIDI: c_uint = 4; +pub const SND_CTL_ELEM_IFACE_TIMER: c_uint = 5; pub const SND_CTL_ELEM_IFACE_SEQUENCER: c_uint = 6; -pub const SND_CTL_ELEM_IFACE_LAST: c_uint = 6; +pub const SND_CTL_ELEM_IFACE_LAST: c_uint = 6; pub type snd_ctl_event_type_t = c_uint; pub const SND_CTL_EVENT_ELEM: c_uint = 0; pub const SND_CTL_EVENT_LAST: c_uint = 0; pub type snd_ctl_type_t = c_uint; -pub const SND_CTL_TYPE_HW: c_uint = 0; -pub const SND_CTL_TYPE_SHM: c_uint = 1; +pub const SND_CTL_TYPE_HW: c_uint = 0; +pub const SND_CTL_TYPE_SHM: c_uint = 1; pub const SND_CTL_TYPE_INET: c_uint = 2; -pub const SND_CTL_TYPE_EXT: c_uint = 3; +pub const SND_CTL_TYPE_EXT: c_uint = 3; -pub enum snd_ctl_t { } +pub enum snd_ctl_t {} -pub enum snd_sctl_t { } +pub enum snd_sctl_t {} -pub enum snd_hctl_elem_t { } +pub enum snd_hctl_elem_t {} -pub enum snd_hctl_t { } +pub enum snd_hctl_t {} -pub type snd_hctl_compare_t = Option c_int>; -pub type snd_hctl_callback_t = Option c_int>; -pub type snd_hctl_elem_callback_t = Option c_int>; +pub type snd_hctl_compare_t = + Option c_int>; +pub type snd_hctl_callback_t = + Option c_int>; +pub type snd_hctl_elem_callback_t = + Option c_int>; -pub enum snd_mixer_t { } +pub enum snd_mixer_t {} -pub enum snd_mixer_class_t { } +pub enum snd_mixer_class_t {} -pub enum snd_mixer_elem_t { } +pub enum snd_mixer_elem_t {} -pub type snd_mixer_callback_t = Option c_int>; -pub type snd_mixer_elem_callback_t = Option c_int>; -pub type snd_mixer_compare_t = Option c_int>; -pub type snd_mixer_event_t = Option c_int>; +pub type snd_mixer_callback_t = Option< + extern "C" fn(arg1: *mut snd_mixer_t, arg2: c_uint, arg3: *mut snd_mixer_elem_t) -> c_int, +>; +pub type snd_mixer_elem_callback_t = + Option c_int>; +pub type snd_mixer_compare_t = + Option c_int>; +pub type snd_mixer_event_t = Option< + extern "C" fn( + arg1: *mut snd_mixer_class_t, + arg2: c_uint, + arg3: *mut snd_hctl_elem_t, + arg4: *mut snd_mixer_elem_t, + ) -> c_int, +>; pub type snd_mixer_elem_type_t = c_uint; pub const SND_MIXER_ELEM_SIMPLE: c_uint = 0; -pub const SND_MIXER_ELEM_LAST: c_uint = 0; +pub const SND_MIXER_ELEM_LAST: c_uint = 0; pub type snd_mixer_selem_channel_id_t = c_int; -pub const SND_MIXER_SCHN_UNKNOWN: c_int = -1; -pub const SND_MIXER_SCHN_FRONT_LEFT: c_int = 0; -pub const SND_MIXER_SCHN_FRONT_RIGHT: c_int = 1; -pub const SND_MIXER_SCHN_REAR_LEFT: c_int = 2; -pub const SND_MIXER_SCHN_REAR_RIGHT: c_int = 3; +pub const SND_MIXER_SCHN_UNKNOWN: c_int = -1; +pub const SND_MIXER_SCHN_FRONT_LEFT: c_int = 0; +pub const SND_MIXER_SCHN_FRONT_RIGHT: c_int = 1; +pub const SND_MIXER_SCHN_REAR_LEFT: c_int = 2; +pub const SND_MIXER_SCHN_REAR_RIGHT: c_int = 3; pub const SND_MIXER_SCHN_FRONT_CENTER: c_int = 4; -pub const SND_MIXER_SCHN_WOOFER: c_int = 5; -pub const SND_MIXER_SCHN_SIDE_LEFT: c_int = 6; -pub const SND_MIXER_SCHN_SIDE_RIGHT: c_int = 7; -pub const SND_MIXER_SCHN_REAR_CENTER: c_int = 8; -pub const SND_MIXER_SCHN_LAST: c_int = 31; -pub const SND_MIXER_SCHN_MONO: c_int = 0; +pub const SND_MIXER_SCHN_WOOFER: c_int = 5; +pub const SND_MIXER_SCHN_SIDE_LEFT: c_int = 6; +pub const SND_MIXER_SCHN_SIDE_RIGHT: c_int = 7; +pub const SND_MIXER_SCHN_REAR_CENTER: c_int = 8; +pub const SND_MIXER_SCHN_LAST: c_int = 31; +pub const SND_MIXER_SCHN_MONO: c_int = 0; pub type snd_mixer_selem_regopt_abstract = c_uint; -pub static SND_MIXER_SABSTRACT_NONE: c_uint = 0; +pub static SND_MIXER_SABSTRACT_NONE: c_uint = 0; pub static SND_MIXER_SABSTRACT_BASIC: c_uint = 1; #[repr(C)] @@ -574,85 +590,85 @@ pub struct snd_mixer_selem_regopt { pub capture_pcm: *mut snd_pcm_t, } -pub enum snd_mixer_selem_id_t { } +pub enum snd_mixer_selem_id_t {} pub type snd_seq_event_type_t = c_uchar; -pub const SND_SEQ_EVENT_SYSTEM: c_uint = 0; -pub const SND_SEQ_EVENT_RESULT: c_uint = 1; -pub const SND_SEQ_EVENT_NOTE: c_uint = 5; -pub const SND_SEQ_EVENT_NOTEON: c_uint = 6; -pub const SND_SEQ_EVENT_NOTEOFF: c_uint = 7; -pub const SND_SEQ_EVENT_KEYPRESS: c_uint = 8; -pub const SND_SEQ_EVENT_CONTROLLER: c_uint = 10; -pub const SND_SEQ_EVENT_PGMCHANGE: c_uint = 11; -pub const SND_SEQ_EVENT_CHANPRESS: c_uint = 12; -pub const SND_SEQ_EVENT_PITCHBEND: c_uint = 13; -pub const SND_SEQ_EVENT_CONTROL14: c_uint = 14; -pub const SND_SEQ_EVENT_NONREGPARAM: c_uint = 15; -pub const SND_SEQ_EVENT_REGPARAM: c_uint = 16; -pub const SND_SEQ_EVENT_SONGPOS: c_uint = 20; -pub const SND_SEQ_EVENT_SONGSEL: c_uint = 21; -pub const SND_SEQ_EVENT_QFRAME: c_uint = 22; -pub const SND_SEQ_EVENT_TIMESIGN: c_uint = 23; -pub const SND_SEQ_EVENT_KEYSIGN: c_uint = 24; -pub const SND_SEQ_EVENT_START: c_uint = 30; -pub const SND_SEQ_EVENT_CONTINUE: c_uint = 31; -pub const SND_SEQ_EVENT_STOP: c_uint = 32; -pub const SND_SEQ_EVENT_SETPOS_TICK: c_uint = 33; -pub const SND_SEQ_EVENT_SETPOS_TIME: c_uint = 34; -pub const SND_SEQ_EVENT_TEMPO: c_uint = 35; -pub const SND_SEQ_EVENT_CLOCK: c_uint = 36; -pub const SND_SEQ_EVENT_TICK: c_uint = 37; -pub const SND_SEQ_EVENT_QUEUE_SKEW: c_uint = 38; -pub const SND_SEQ_EVENT_SYNC_POS: c_uint = 39; -pub const SND_SEQ_EVENT_TUNE_REQUEST: c_uint = 40; -pub const SND_SEQ_EVENT_RESET: c_uint = 41; -pub const SND_SEQ_EVENT_SENSING: c_uint = 42; -pub const SND_SEQ_EVENT_ECHO: c_uint = 50; -pub const SND_SEQ_EVENT_OSS: c_uint = 51; -pub const SND_SEQ_EVENT_CLIENT_START: c_uint = 60; -pub const SND_SEQ_EVENT_CLIENT_EXIT: c_uint = 61; -pub const SND_SEQ_EVENT_CLIENT_CHANGE: c_uint = 62; -pub const SND_SEQ_EVENT_PORT_START: c_uint = 63; -pub const SND_SEQ_EVENT_PORT_EXIT: c_uint = 64; -pub const SND_SEQ_EVENT_PORT_CHANGE: c_uint = 65; -pub const SND_SEQ_EVENT_PORT_SUBSCRIBED: c_uint = 66; +pub const SND_SEQ_EVENT_SYSTEM: c_uint = 0; +pub const SND_SEQ_EVENT_RESULT: c_uint = 1; +pub const SND_SEQ_EVENT_NOTE: c_uint = 5; +pub const SND_SEQ_EVENT_NOTEON: c_uint = 6; +pub const SND_SEQ_EVENT_NOTEOFF: c_uint = 7; +pub const SND_SEQ_EVENT_KEYPRESS: c_uint = 8; +pub const SND_SEQ_EVENT_CONTROLLER: c_uint = 10; +pub const SND_SEQ_EVENT_PGMCHANGE: c_uint = 11; +pub const SND_SEQ_EVENT_CHANPRESS: c_uint = 12; +pub const SND_SEQ_EVENT_PITCHBEND: c_uint = 13; +pub const SND_SEQ_EVENT_CONTROL14: c_uint = 14; +pub const SND_SEQ_EVENT_NONREGPARAM: c_uint = 15; +pub const SND_SEQ_EVENT_REGPARAM: c_uint = 16; +pub const SND_SEQ_EVENT_SONGPOS: c_uint = 20; +pub const SND_SEQ_EVENT_SONGSEL: c_uint = 21; +pub const SND_SEQ_EVENT_QFRAME: c_uint = 22; +pub const SND_SEQ_EVENT_TIMESIGN: c_uint = 23; +pub const SND_SEQ_EVENT_KEYSIGN: c_uint = 24; +pub const SND_SEQ_EVENT_START: c_uint = 30; +pub const SND_SEQ_EVENT_CONTINUE: c_uint = 31; +pub const SND_SEQ_EVENT_STOP: c_uint = 32; +pub const SND_SEQ_EVENT_SETPOS_TICK: c_uint = 33; +pub const SND_SEQ_EVENT_SETPOS_TIME: c_uint = 34; +pub const SND_SEQ_EVENT_TEMPO: c_uint = 35; +pub const SND_SEQ_EVENT_CLOCK: c_uint = 36; +pub const SND_SEQ_EVENT_TICK: c_uint = 37; +pub const SND_SEQ_EVENT_QUEUE_SKEW: c_uint = 38; +pub const SND_SEQ_EVENT_SYNC_POS: c_uint = 39; +pub const SND_SEQ_EVENT_TUNE_REQUEST: c_uint = 40; +pub const SND_SEQ_EVENT_RESET: c_uint = 41; +pub const SND_SEQ_EVENT_SENSING: c_uint = 42; +pub const SND_SEQ_EVENT_ECHO: c_uint = 50; +pub const SND_SEQ_EVENT_OSS: c_uint = 51; +pub const SND_SEQ_EVENT_CLIENT_START: c_uint = 60; +pub const SND_SEQ_EVENT_CLIENT_EXIT: c_uint = 61; +pub const SND_SEQ_EVENT_CLIENT_CHANGE: c_uint = 62; +pub const SND_SEQ_EVENT_PORT_START: c_uint = 63; +pub const SND_SEQ_EVENT_PORT_EXIT: c_uint = 64; +pub const SND_SEQ_EVENT_PORT_CHANGE: c_uint = 65; +pub const SND_SEQ_EVENT_PORT_SUBSCRIBED: c_uint = 66; pub const SND_SEQ_EVENT_PORT_UNSUBSCRIBED: c_uint = 67; -pub const SND_SEQ_EVENT_USR0: c_uint = 90; -pub const SND_SEQ_EVENT_USR1: c_uint = 91; -pub const SND_SEQ_EVENT_USR2: c_uint = 92; -pub const SND_SEQ_EVENT_USR3: c_uint = 93; -pub const SND_SEQ_EVENT_USR4: c_uint = 94; -pub const SND_SEQ_EVENT_USR5: c_uint = 95; -pub const SND_SEQ_EVENT_USR6: c_uint = 96; -pub const SND_SEQ_EVENT_USR7: c_uint = 97; -pub const SND_SEQ_EVENT_USR8: c_uint = 98; -pub const SND_SEQ_EVENT_USR9: c_uint = 99; -pub const SND_SEQ_EVENT_SYSEX: c_uint = 130; -pub const SND_SEQ_EVENT_BOUNCE: c_uint = 131; -pub const SND_SEQ_EVENT_USR_VAR0: c_uint = 135; -pub const SND_SEQ_EVENT_USR_VAR1: c_uint = 136; -pub const SND_SEQ_EVENT_USR_VAR2: c_uint = 137; -pub const SND_SEQ_EVENT_USR_VAR3: c_uint = 138; -pub const SND_SEQ_EVENT_USR_VAR4: c_uint = 139; -pub const SND_SEQ_EVENT_NONE: c_uint = 255; +pub const SND_SEQ_EVENT_USR0: c_uint = 90; +pub const SND_SEQ_EVENT_USR1: c_uint = 91; +pub const SND_SEQ_EVENT_USR2: c_uint = 92; +pub const SND_SEQ_EVENT_USR3: c_uint = 93; +pub const SND_SEQ_EVENT_USR4: c_uint = 94; +pub const SND_SEQ_EVENT_USR5: c_uint = 95; +pub const SND_SEQ_EVENT_USR6: c_uint = 96; +pub const SND_SEQ_EVENT_USR7: c_uint = 97; +pub const SND_SEQ_EVENT_USR8: c_uint = 98; +pub const SND_SEQ_EVENT_USR9: c_uint = 99; +pub const SND_SEQ_EVENT_SYSEX: c_uint = 130; +pub const SND_SEQ_EVENT_BOUNCE: c_uint = 131; +pub const SND_SEQ_EVENT_USR_VAR0: c_uint = 135; +pub const SND_SEQ_EVENT_USR_VAR1: c_uint = 136; +pub const SND_SEQ_EVENT_USR_VAR2: c_uint = 137; +pub const SND_SEQ_EVENT_USR_VAR3: c_uint = 138; +pub const SND_SEQ_EVENT_USR_VAR4: c_uint = 139; +pub const SND_SEQ_EVENT_NONE: c_uint = 255; #[repr(C)] pub struct snd_seq_addr_t { pub client: c_uchar, - pub port: c_uchar, + pub port: c_uchar, } #[repr(C)] pub struct snd_seq_connect_t { pub sender: snd_seq_addr_t, - pub dest: snd_seq_addr_t, + pub dest: snd_seq_addr_t, } #[repr(C)] pub struct snd_seq_real_time_t { - pub tv_sec: c_uint, + pub tv_sec: c_uint, pub tv_nsec: c_uint, } @@ -750,14 +766,14 @@ impl Union_Unnamed9 { #[repr(C)] pub struct snd_seq_event_t { - pub _type: snd_seq_event_type_t, - pub flags: c_uchar, - pub tag: c_uchar, - pub queue: c_uchar, - pub time: snd_seq_timestamp_t, + pub _type: snd_seq_event_type_t, + pub flags: c_uchar, + pub tag: c_uchar, + pub queue: c_uchar, + pub time: snd_seq_timestamp_t, pub source: snd_seq_addr_t, - pub dest: snd_seq_addr_t, - pub data: Union_Unnamed10, + pub dest: snd_seq_addr_t, + pub data: Union_Unnamed10, } #[repr(C)] @@ -797,74 +813,74 @@ impl Union_Unnamed10 { } } -pub enum snd_seq_t { } +pub enum snd_seq_t {} pub type snd_seq_type_t = c_uint; -pub const SND_SEQ_TYPE_HW: c_uint = 0; -pub const SND_SEQ_TYPE_SHM: c_uint = 1; +pub const SND_SEQ_TYPE_HW: c_uint = 0; +pub const SND_SEQ_TYPE_SHM: c_uint = 1; pub const SND_SEQ_TYPE_INET: c_uint = 2; -pub enum snd_seq_system_info_t { } +pub enum snd_seq_system_info_t {} -pub enum snd_seq_client_info_t { } +pub enum snd_seq_client_info_t {} pub type snd_seq_client_type_t = c_uint; -pub const SND_SEQ_USER_CLIENT: c_uint = 1; +pub const SND_SEQ_USER_CLIENT: c_uint = 1; pub const SND_SEQ_KERNEL_CLIENT: c_uint = 2; -pub enum snd_seq_client_pool_t { } +pub enum snd_seq_client_pool_t {} -pub enum snd_seq_port_info_t { } +pub enum snd_seq_port_info_t {} -pub enum snd_seq_port_subscribe_t { } +pub enum snd_seq_port_subscribe_t {} -pub enum snd_seq_query_subscribe_t { } +pub enum snd_seq_query_subscribe_t {} pub type snd_seq_query_subs_type_t = c_uint; -pub const SND_SEQ_QUERY_SUBS_READ: c_uint = 0; +pub const SND_SEQ_QUERY_SUBS_READ: c_uint = 0; pub const SND_SEQ_QUERY_SUBS_WRITE: c_uint = 1; -pub enum snd_seq_queue_info_t { } +pub enum snd_seq_queue_info_t {} -pub enum snd_seq_queue_status_t { } +pub enum snd_seq_queue_status_t {} -pub enum snd_seq_queue_tempo_t { } +pub enum snd_seq_queue_tempo_t {} -pub enum snd_seq_queue_timer_t { } +pub enum snd_seq_queue_timer_t {} pub type snd_seq_queue_timer_type_t = c_uint; -pub const SND_SEQ_TIMER_ALSA: c_uint = 0; +pub const SND_SEQ_TIMER_ALSA: c_uint = 0; pub const SND_SEQ_TIMER_MIDI_CLOCK: c_uint = 1; -pub const SND_SEQ_TIMER_MIDI_TICK: c_uint = 2; +pub const SND_SEQ_TIMER_MIDI_TICK: c_uint = 2; -pub enum snd_seq_remove_events_t { } +pub enum snd_seq_remove_events_t {} -pub const SND_SEQ_EVFLG_RESULT: c_uint = 0; -pub const SND_SEQ_EVFLG_NOTE: c_uint = 1; -pub const SND_SEQ_EVFLG_CONTROL: c_uint = 2; -pub const SND_SEQ_EVFLG_QUEUE: c_uint = 3; -pub const SND_SEQ_EVFLG_SYSTEM: c_uint = 4; -pub const SND_SEQ_EVFLG_MESSAGE: c_uint = 5; +pub const SND_SEQ_EVFLG_RESULT: c_uint = 0; +pub const SND_SEQ_EVFLG_NOTE: c_uint = 1; +pub const SND_SEQ_EVFLG_CONTROL: c_uint = 2; +pub const SND_SEQ_EVFLG_QUEUE: c_uint = 3; +pub const SND_SEQ_EVFLG_SYSTEM: c_uint = 4; +pub const SND_SEQ_EVFLG_MESSAGE: c_uint = 5; pub const SND_SEQ_EVFLG_CONNECTION: c_uint = 6; -pub const SND_SEQ_EVFLG_SAMPLE: c_uint = 7; -pub const SND_SEQ_EVFLG_USERS: c_uint = 8; -pub const SND_SEQ_EVFLG_INSTR: c_uint = 9; -pub const SND_SEQ_EVFLG_QUOTE: c_uint = 10; -pub const SND_SEQ_EVFLG_NONE: c_uint = 11; -pub const SND_SEQ_EVFLG_RAW: c_uint = 12; -pub const SND_SEQ_EVFLG_FIXED: c_uint = 13; -pub const SND_SEQ_EVFLG_VARIABLE: c_uint = 14; -pub const SND_SEQ_EVFLG_VARUSR: c_uint = 15; +pub const SND_SEQ_EVFLG_SAMPLE: c_uint = 7; +pub const SND_SEQ_EVFLG_USERS: c_uint = 8; +pub const SND_SEQ_EVFLG_INSTR: c_uint = 9; +pub const SND_SEQ_EVFLG_QUOTE: c_uint = 10; +pub const SND_SEQ_EVFLG_NONE: c_uint = 11; +pub const SND_SEQ_EVFLG_RAW: c_uint = 12; +pub const SND_SEQ_EVFLG_FIXED: c_uint = 13; +pub const SND_SEQ_EVFLG_VARIABLE: c_uint = 14; +pub const SND_SEQ_EVFLG_VARUSR: c_uint = 15; pub const SND_SEQ_EVFLG_NOTE_ONEARG: c_uint = 0; pub const SND_SEQ_EVFLG_NOTE_TWOARG: c_uint = 1; pub const SND_SEQ_EVFLG_QUEUE_NOARG: c_uint = 0; -pub const SND_SEQ_EVFLG_QUEUE_TICK: c_uint = 1; -pub const SND_SEQ_EVFLG_QUEUE_TIME: c_uint = 2; +pub const SND_SEQ_EVFLG_QUEUE_TICK: c_uint = 1; +pub const SND_SEQ_EVFLG_QUEUE_TIME: c_uint = 2; pub const SND_SEQ_EVFLG_QUEUE_VALUE: c_uint = 3; -pub enum snd_midi_event_t { } +pub enum snd_midi_event_t {} extern "C" { pub static mut snd_dlsym_start: *mut snd_dlsym_link; @@ -873,27 +889,57 @@ extern "C" { pub static mut snd_seq_event_types: *const c_uint; pub fn snd_asoundlib_version() -> *const c_char; pub fn snd_dlopen(file: *const c_char, mode: c_int) -> *mut c_void; - pub fn snd_dlsym(handle: *mut c_void, name: *const c_char, version: *const c_char) -> *mut c_void; + pub fn snd_dlsym( + handle: *mut c_void, + name: *const c_char, + version: *const c_char, + ) -> *mut c_void; pub fn snd_dlclose(handle: *mut c_void) -> c_int; - pub fn snd_async_add_handler(handler: *mut *mut snd_async_handler_t, fd: c_int, callback: snd_async_callback_t, private_data: *mut c_void) -> c_int; + pub fn snd_async_add_handler( + handler: *mut *mut snd_async_handler_t, + fd: c_int, + callback: snd_async_callback_t, + private_data: *mut c_void, + ) -> c_int; pub fn snd_async_del_handler(handler: *mut snd_async_handler_t) -> c_int; pub fn snd_async_handler_get_fd(handler: *mut snd_async_handler_t) -> c_int; pub fn snd_async_handler_get_signo(handler: *mut snd_async_handler_t) -> c_int; - pub fn snd_async_handler_get_callback_private(handler: *mut snd_async_handler_t) -> *mut c_void; + pub fn snd_async_handler_get_callback_private(handler: *mut snd_async_handler_t) + -> *mut c_void; pub fn snd_shm_area_create(shmid: c_int, ptr: *mut c_void) -> *mut snd_shm_area; pub fn snd_shm_area_share(area: *mut snd_shm_area) -> *mut snd_shm_area; pub fn snd_shm_area_destroy(area: *mut snd_shm_area) -> c_int; pub fn snd_user_file(file: *const c_char, result: *mut *mut c_char) -> c_int; - pub fn snd_input_stdio_open(inputp: *mut *mut snd_input_t, file: *const c_char, mode: *const c_char) -> c_int; - pub fn snd_input_stdio_attach(inputp: *mut *mut snd_input_t, fp: *mut FILE, _close: c_int) -> c_int; - pub fn snd_input_buffer_open(inputp: *mut *mut snd_input_t, buffer: *const c_char, size: ssize_t) -> c_int; + pub fn snd_input_stdio_open( + inputp: *mut *mut snd_input_t, + file: *const c_char, + mode: *const c_char, + ) -> c_int; + pub fn snd_input_stdio_attach( + inputp: *mut *mut snd_input_t, + fp: *mut FILE, + _close: c_int, + ) -> c_int; + pub fn snd_input_buffer_open( + inputp: *mut *mut snd_input_t, + buffer: *const c_char, + size: ssize_t, + ) -> c_int; pub fn snd_input_close(input: *mut snd_input_t) -> c_int; pub fn snd_input_scanf(input: *mut snd_input_t, format: *const c_char, ...) -> c_int; pub fn snd_input_gets(input: *mut snd_input_t, str: *mut c_char, size: size_t) -> *mut c_char; pub fn snd_input_getc(input: *mut snd_input_t) -> c_int; pub fn snd_input_ungetc(input: *mut snd_input_t, c: c_int) -> c_int; - pub fn snd_output_stdio_open(outputp: *mut *mut snd_output_t, file: *const c_char, mode: *const c_char) -> c_int; - pub fn snd_output_stdio_attach(outputp: *mut *mut snd_output_t, fp: *mut FILE, _close: c_int) -> c_int; + pub fn snd_output_stdio_open( + outputp: *mut *mut snd_output_t, + file: *const c_char, + mode: *const c_char, + ) -> c_int; + pub fn snd_output_stdio_attach( + outputp: *mut *mut snd_output_t, + fp: *mut FILE, + _close: c_int, + ) -> c_int; pub fn snd_output_buffer_open(outputp: *mut *mut snd_output_t) -> c_int; pub fn snd_output_buffer_string(output: *mut snd_output_t, buf: *mut *mut c_char) -> size_t; pub fn snd_output_close(output: *mut snd_output_t) -> c_int; @@ -910,30 +956,86 @@ extern "C" { pub fn snd_config_load_override(config: *mut snd_config_t, _in: *mut snd_input_t) -> c_int; pub fn snd_config_save(config: *mut snd_config_t, out: *mut snd_output_t) -> c_int; pub fn snd_config_update() -> c_int; - pub fn snd_config_update_r(top: *mut *mut snd_config_t, update: *mut *mut snd_config_update_t, path: *const c_char) -> c_int; + pub fn snd_config_update_r( + top: *mut *mut snd_config_t, + update: *mut *mut snd_config_update_t, + path: *const c_char, + ) -> c_int; pub fn snd_config_update_free(update: *mut snd_config_update_t) -> c_int; pub fn snd_config_update_free_global() -> c_int; - pub fn snd_config_search(config: *mut snd_config_t, key: *const c_char, result: *mut *mut snd_config_t) -> c_int; - pub fn snd_config_searchv(config: *mut snd_config_t, result: *mut *mut snd_config_t, ...) -> c_int; - pub fn snd_config_search_definition(config: *mut snd_config_t, base: *const c_char, key: *const c_char, result: *mut *mut snd_config_t) -> c_int; - pub fn snd_config_expand(config: *mut snd_config_t, root: *mut snd_config_t, args: *const c_char, private_data: *mut snd_config_t, result: *mut *mut snd_config_t) -> c_int; - pub fn snd_config_evaluate(config: *mut snd_config_t, root: *mut snd_config_t, private_data: *mut snd_config_t, result: *mut *mut snd_config_t) -> c_int; + pub fn snd_config_search( + config: *mut snd_config_t, + key: *const c_char, + result: *mut *mut snd_config_t, + ) -> c_int; + pub fn snd_config_searchv( + config: *mut snd_config_t, + result: *mut *mut snd_config_t, + ... + ) -> c_int; + pub fn snd_config_search_definition( + config: *mut snd_config_t, + base: *const c_char, + key: *const c_char, + result: *mut *mut snd_config_t, + ) -> c_int; + pub fn snd_config_expand( + config: *mut snd_config_t, + root: *mut snd_config_t, + args: *const c_char, + private_data: *mut snd_config_t, + result: *mut *mut snd_config_t, + ) -> c_int; + pub fn snd_config_evaluate( + config: *mut snd_config_t, + root: *mut snd_config_t, + private_data: *mut snd_config_t, + result: *mut *mut snd_config_t, + ) -> c_int; pub fn snd_config_add(config: *mut snd_config_t, leaf: *mut snd_config_t) -> c_int; pub fn snd_config_delete(config: *mut snd_config_t) -> c_int; pub fn snd_config_delete_compound_members(config: *const snd_config_t) -> c_int; pub fn snd_config_copy(dst: *mut *mut snd_config_t, src: *mut snd_config_t) -> c_int; - pub fn snd_config_make(config: *mut *mut snd_config_t, key: *const c_char, _type: snd_config_type_t) -> c_int; + pub fn snd_config_make( + config: *mut *mut snd_config_t, + key: *const c_char, + _type: snd_config_type_t, + ) -> c_int; pub fn snd_config_make_integer(config: *mut *mut snd_config_t, key: *const c_char) -> c_int; pub fn snd_config_make_integer64(config: *mut *mut snd_config_t, key: *const c_char) -> c_int; pub fn snd_config_make_real(config: *mut *mut snd_config_t, key: *const c_char) -> c_int; pub fn snd_config_make_string(config: *mut *mut snd_config_t, key: *const c_char) -> c_int; pub fn snd_config_make_pointer(config: *mut *mut snd_config_t, key: *const c_char) -> c_int; - pub fn snd_config_make_compound(config: *mut *mut snd_config_t, key: *const c_char, join: c_int) -> c_int; - pub fn snd_config_imake_integer(config: *mut *mut snd_config_t, key: *const c_char, value: c_long) -> c_int; - pub fn snd_config_imake_integer64(config: *mut *mut snd_config_t, key: *const c_char, value: c_longlong) -> c_int; - pub fn snd_config_imake_real(config: *mut *mut snd_config_t, key: *const c_char, value: c_double) -> c_int; - pub fn snd_config_imake_string(config: *mut *mut snd_config_t, key: *const c_char, ascii: *const c_char) -> c_int; - pub fn snd_config_imake_pointer(config: *mut *mut snd_config_t, key: *const c_char, ptr: *const c_void) -> c_int; + pub fn snd_config_make_compound( + config: *mut *mut snd_config_t, + key: *const c_char, + join: c_int, + ) -> c_int; + pub fn snd_config_imake_integer( + config: *mut *mut snd_config_t, + key: *const c_char, + value: c_long, + ) -> c_int; + pub fn snd_config_imake_integer64( + config: *mut *mut snd_config_t, + key: *const c_char, + value: c_longlong, + ) -> c_int; + pub fn snd_config_imake_real( + config: *mut *mut snd_config_t, + key: *const c_char, + value: c_double, + ) -> c_int; + pub fn snd_config_imake_string( + config: *mut *mut snd_config_t, + key: *const c_char, + ascii: *const c_char, + ) -> c_int; + pub fn snd_config_imake_pointer( + config: *mut *mut snd_config_t, + key: *const c_char, + ptr: *const c_void, + ) -> c_int; pub fn snd_config_get_type(config: *const snd_config_t) -> snd_config_type_t; pub fn snd_config_set_id(config: *mut snd_config_t, id: *const c_char) -> c_int; pub fn snd_config_set_integer(config: *mut snd_config_t, value: c_long) -> c_int; @@ -961,24 +1063,59 @@ extern "C" { pub fn snd_config_get_ctl_iface(conf: *const snd_config_t) -> c_int; pub fn snd_names_list(iface: *const c_char, list: *mut *mut snd_devname_t) -> c_int; pub fn snd_names_list_free(list: *mut snd_devname_t); - pub fn snd_pcm_open(pcm: *mut *mut snd_pcm_t, name: *const c_char, stream: snd_pcm_stream_t, mode: c_int) -> c_int; - pub fn snd_pcm_open_lconf(pcm: *mut *mut snd_pcm_t, name: *const c_char, stream: snd_pcm_stream_t, mode: c_int, lconf: *mut snd_config_t) -> c_int; - pub fn snd_pcm_open_fallback(pcm: *mut *mut snd_pcm_t, root: *mut snd_config_t, name: *const c_char, orig_name: *const c_char, stream: snd_pcm_stream_t, mode: c_int) -> c_int; + pub fn snd_pcm_open( + pcm: *mut *mut snd_pcm_t, + name: *const c_char, + stream: snd_pcm_stream_t, + mode: c_int, + ) -> c_int; + pub fn snd_pcm_open_lconf( + pcm: *mut *mut snd_pcm_t, + name: *const c_char, + stream: snd_pcm_stream_t, + mode: c_int, + lconf: *mut snd_config_t, + ) -> c_int; + pub fn snd_pcm_open_fallback( + pcm: *mut *mut snd_pcm_t, + root: *mut snd_config_t, + name: *const c_char, + orig_name: *const c_char, + stream: snd_pcm_stream_t, + mode: c_int, + ) -> c_int; pub fn snd_pcm_close(pcm: *mut snd_pcm_t) -> c_int; pub fn snd_pcm_name(pcm: *mut snd_pcm_t) -> *const c_char; pub fn snd_pcm_type(pcm: *mut snd_pcm_t) -> snd_pcm_type_t; pub fn snd_pcm_stream(pcm: *mut snd_pcm_t) -> snd_pcm_stream_t; pub fn snd_pcm_poll_descriptors_count(pcm: *mut snd_pcm_t) -> c_int; - pub fn snd_pcm_poll_descriptors(pcm: *mut snd_pcm_t, pfds: *mut pollfd, space: c_uint) -> c_int; - pub fn snd_pcm_poll_descriptors_revents(pcm: *mut snd_pcm_t, pfds: *mut pollfd, nfds: c_uint, revents: *mut c_ushort) -> c_int; + pub fn snd_pcm_poll_descriptors(pcm: *mut snd_pcm_t, pfds: *mut pollfd, space: c_uint) + -> c_int; + pub fn snd_pcm_poll_descriptors_revents( + pcm: *mut snd_pcm_t, + pfds: *mut pollfd, + nfds: c_uint, + revents: *mut c_ushort, + ) -> c_int; pub fn snd_pcm_nonblock(pcm: *mut snd_pcm_t, nonblock: c_int) -> c_int; - pub fn snd_async_add_pcm_handler(handler: *mut *mut snd_async_handler_t, pcm: *mut snd_pcm_t, callback: snd_async_callback_t, private_data: *mut c_void) -> c_int; + pub fn snd_async_add_pcm_handler( + handler: *mut *mut snd_async_handler_t, + pcm: *mut snd_pcm_t, + callback: snd_async_callback_t, + private_data: *mut c_void, + ) -> c_int; pub fn snd_async_handler_get_pcm(handler: *mut snd_async_handler_t) -> *mut snd_pcm_t; pub fn snd_pcm_info(pcm: *mut snd_pcm_t, info: *mut snd_pcm_info_t) -> c_int; - pub fn snd_pcm_hw_params_current(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t) -> c_int; + pub fn snd_pcm_hw_params_current( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + ) -> c_int; pub fn snd_pcm_hw_params(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t) -> c_int; pub fn snd_pcm_hw_free(pcm: *mut snd_pcm_t) -> c_int; - pub fn snd_pcm_sw_params_current(pcm: *mut snd_pcm_t, params: *mut snd_pcm_sw_params_t) -> c_int; + pub fn snd_pcm_sw_params_current( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_sw_params_t, + ) -> c_int; pub fn snd_pcm_sw_params(pcm: *mut snd_pcm_t, params: *mut snd_pcm_sw_params_t) -> c_int; pub fn snd_pcm_prepare(pcm: *mut snd_pcm_t) -> c_int; pub fn snd_pcm_reset(pcm: *mut snd_pcm_t) -> c_int; @@ -991,35 +1128,80 @@ extern "C" { pub fn snd_pcm_hwsync(pcm: *mut snd_pcm_t) -> c_int; pub fn snd_pcm_delay(pcm: *mut snd_pcm_t, delayp: *mut snd_pcm_sframes_t) -> c_int; pub fn snd_pcm_resume(pcm: *mut snd_pcm_t) -> c_int; - pub fn snd_pcm_htimestamp(pcm: *mut snd_pcm_t, avail: *mut snd_pcm_uframes_t, tstamp: *mut snd_htimestamp_t) -> c_int; + pub fn snd_pcm_htimestamp( + pcm: *mut snd_pcm_t, + avail: *mut snd_pcm_uframes_t, + tstamp: *mut snd_htimestamp_t, + ) -> c_int; pub fn snd_pcm_avail(pcm: *mut snd_pcm_t) -> snd_pcm_sframes_t; pub fn snd_pcm_avail_update(pcm: *mut snd_pcm_t) -> snd_pcm_sframes_t; - pub fn snd_pcm_avail_delay(pcm: *mut snd_pcm_t, availp: *mut snd_pcm_sframes_t, delayp: *mut snd_pcm_sframes_t) -> c_int; + pub fn snd_pcm_avail_delay( + pcm: *mut snd_pcm_t, + availp: *mut snd_pcm_sframes_t, + delayp: *mut snd_pcm_sframes_t, + ) -> c_int; pub fn snd_pcm_rewindable(pcm: *mut snd_pcm_t) -> snd_pcm_sframes_t; pub fn snd_pcm_rewind(pcm: *mut snd_pcm_t, frames: snd_pcm_uframes_t) -> snd_pcm_sframes_t; pub fn snd_pcm_forwardable(pcm: *mut snd_pcm_t) -> snd_pcm_sframes_t; pub fn snd_pcm_forward(pcm: *mut snd_pcm_t, frames: snd_pcm_uframes_t) -> snd_pcm_sframes_t; - pub fn snd_pcm_writei(pcm: *mut snd_pcm_t, buffer: *const c_void, size: snd_pcm_uframes_t) -> snd_pcm_sframes_t; - pub fn snd_pcm_readi(pcm: *mut snd_pcm_t, buffer: *mut c_void, size: snd_pcm_uframes_t) -> snd_pcm_sframes_t; - pub fn snd_pcm_writen(pcm: *mut snd_pcm_t, bufs: *mut *mut c_void, size: snd_pcm_uframes_t) -> snd_pcm_sframes_t; - pub fn snd_pcm_readn(pcm: *mut snd_pcm_t, bufs: *mut *mut c_void, size: snd_pcm_uframes_t) -> snd_pcm_sframes_t; + pub fn snd_pcm_writei( + pcm: *mut snd_pcm_t, + buffer: *const c_void, + size: snd_pcm_uframes_t, + ) -> snd_pcm_sframes_t; + pub fn snd_pcm_readi( + pcm: *mut snd_pcm_t, + buffer: *mut c_void, + size: snd_pcm_uframes_t, + ) -> snd_pcm_sframes_t; + pub fn snd_pcm_writen( + pcm: *mut snd_pcm_t, + bufs: *mut *mut c_void, + size: snd_pcm_uframes_t, + ) -> snd_pcm_sframes_t; + pub fn snd_pcm_readn( + pcm: *mut snd_pcm_t, + bufs: *mut *mut c_void, + size: snd_pcm_uframes_t, + ) -> snd_pcm_sframes_t; pub fn snd_pcm_wait(pcm: *mut snd_pcm_t, timeout: c_int) -> c_int; pub fn snd_pcm_link(pcm1: *mut snd_pcm_t, pcm2: *mut snd_pcm_t) -> c_int; pub fn snd_pcm_unlink(pcm: *mut snd_pcm_t) -> c_int; pub fn snd_pcm_query_chmaps(pcm: *mut snd_pcm_t) -> *mut *mut snd_pcm_chmap_query_t; - pub fn snd_pcm_query_chmaps_from_hw(card: c_int, dev: c_int, subdev: c_int, stream: snd_pcm_stream_t) -> *mut *mut snd_pcm_chmap_query_t; + pub fn snd_pcm_query_chmaps_from_hw( + card: c_int, + dev: c_int, + subdev: c_int, + stream: snd_pcm_stream_t, + ) -> *mut *mut snd_pcm_chmap_query_t; pub fn snd_pcm_free_chmaps(maps: *mut *mut snd_pcm_chmap_query_t); pub fn snd_pcm_get_chmap(pcm: *mut snd_pcm_t) -> *mut snd_pcm_chmap_t; pub fn snd_pcm_set_chmap(pcm: *mut snd_pcm_t, map: *const snd_pcm_chmap_t) -> c_int; pub fn snd_pcm_chmap_type_name(val: snd_pcm_chmap_type) -> *const c_char; pub fn snd_pcm_chmap_name(val: snd_pcm_chmap_position) -> *const c_char; pub fn snd_pcm_chmap_long_name(val: snd_pcm_chmap_position) -> *const c_char; - pub fn snd_pcm_chmap_print(map: *const snd_pcm_chmap_t, maxlen: size_t, buf: *mut c_char) -> c_int; + pub fn snd_pcm_chmap_print( + map: *const snd_pcm_chmap_t, + maxlen: size_t, + buf: *mut c_char, + ) -> c_int; pub fn snd_pcm_chmap_from_string(str: *const c_char) -> c_uint; pub fn snd_pcm_chmap_parse_string(str: *const c_char) -> *mut snd_pcm_chmap_t; pub fn snd_pcm_recover(pcm: *mut snd_pcm_t, err: c_int, silent: c_int) -> c_int; - pub fn snd_pcm_set_params(pcm: *mut snd_pcm_t, format: snd_pcm_format_t, access: snd_pcm_access_t, channels: c_uint, rate: c_uint, soft_resample: c_int, latency: c_uint) -> c_int; - pub fn snd_pcm_get_params(pcm: *mut snd_pcm_t, buffer_size: *mut snd_pcm_uframes_t, period_size: *mut snd_pcm_uframes_t) -> c_int; + pub fn snd_pcm_set_params( + pcm: *mut snd_pcm_t, + format: snd_pcm_format_t, + access: snd_pcm_access_t, + channels: c_uint, + rate: c_uint, + soft_resample: c_int, + latency: c_uint, + ) -> c_int; + pub fn snd_pcm_get_params( + pcm: *mut snd_pcm_t, + buffer_size: *mut snd_pcm_uframes_t, + period_size: *mut snd_pcm_uframes_t, + ) -> c_int; pub fn snd_pcm_info_sizeof() -> size_t; pub fn snd_pcm_info_malloc(ptr: *mut *mut snd_pcm_info_t) -> c_int; pub fn snd_pcm_info_free(obj: *mut snd_pcm_info_t); @@ -1040,7 +1222,9 @@ extern "C" { pub fn snd_pcm_info_set_subdevice(obj: *mut snd_pcm_info_t, val: c_uint); pub fn snd_pcm_info_set_stream(obj: *mut snd_pcm_info_t, val: snd_pcm_stream_t); pub fn snd_pcm_hw_params_any(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t) -> c_int; - pub fn snd_pcm_hw_params_can_mmap_sample_resolution(params: *const snd_pcm_hw_params_t) -> c_int; + pub fn snd_pcm_hw_params_can_mmap_sample_resolution( + params: *const snd_pcm_hw_params_t, + ) -> c_int; pub fn snd_pcm_hw_params_is_double(params: *const snd_pcm_hw_params_t) -> c_int; pub fn snd_pcm_hw_params_is_batch(params: *const snd_pcm_hw_params_t) -> c_int; pub fn snd_pcm_hw_params_is_block_transfer(params: *const snd_pcm_hw_params_t) -> c_int; @@ -1051,181 +1235,738 @@ extern "C" { pub fn snd_pcm_hw_params_is_half_duplex(params: *const snd_pcm_hw_params_t) -> c_int; pub fn snd_pcm_hw_params_is_joint_duplex(params: *const snd_pcm_hw_params_t) -> c_int; pub fn snd_pcm_hw_params_can_sync_start(params: *const snd_pcm_hw_params_t) -> c_int; - pub fn snd_pcm_hw_params_can_disable_period_wakeup(params: *const snd_pcm_hw_params_t) -> c_int; - pub fn snd_pcm_hw_params_supports_audio_wallclock_ts(params: *const snd_pcm_hw_params_t) -> c_int; - pub fn snd_pcm_hw_params_get_rate_numden(params: *const snd_pcm_hw_params_t, rate_num: *mut c_uint, rate_den: *mut c_uint) -> c_int; + pub fn snd_pcm_hw_params_can_disable_period_wakeup(params: *const snd_pcm_hw_params_t) + -> c_int; + pub fn snd_pcm_hw_params_supports_audio_wallclock_ts( + params: *const snd_pcm_hw_params_t, + ) -> c_int; + pub fn snd_pcm_hw_params_get_rate_numden( + params: *const snd_pcm_hw_params_t, + rate_num: *mut c_uint, + rate_den: *mut c_uint, + ) -> c_int; pub fn snd_pcm_hw_params_get_sbits(params: *const snd_pcm_hw_params_t) -> c_int; pub fn snd_pcm_hw_params_get_fifo_size(params: *const snd_pcm_hw_params_t) -> c_int; pub fn snd_pcm_hw_params_sizeof() -> size_t; pub fn snd_pcm_hw_params_malloc(ptr: *mut *mut snd_pcm_hw_params_t) -> c_int; pub fn snd_pcm_hw_params_free(obj: *mut snd_pcm_hw_params_t); pub fn snd_pcm_hw_params_copy(dst: *mut snd_pcm_hw_params_t, src: *const snd_pcm_hw_params_t); - pub fn snd_pcm_hw_params_get_access(params: *const snd_pcm_hw_params_t, _access: *mut snd_pcm_access_t) -> c_int; - pub fn snd_pcm_hw_params_test_access(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, _access: snd_pcm_access_t) -> c_int; - pub fn snd_pcm_hw_params_set_access(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, _access: snd_pcm_access_t) -> c_int; - pub fn snd_pcm_hw_params_set_access_first(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, _access: *mut snd_pcm_access_t) -> c_int; - pub fn snd_pcm_hw_params_set_access_last(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, _access: *mut snd_pcm_access_t) -> c_int; - pub fn snd_pcm_hw_params_set_access_mask(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, mask: *mut snd_pcm_access_mask_t) -> c_int; - pub fn snd_pcm_hw_params_get_access_mask(params: *mut snd_pcm_hw_params_t, mask: *mut snd_pcm_access_mask_t) -> c_int; - pub fn snd_pcm_hw_params_get_format(params: *const snd_pcm_hw_params_t, val: *mut snd_pcm_format_t) -> c_int; - pub fn snd_pcm_hw_params_test_format(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: snd_pcm_format_t) -> c_int; - pub fn snd_pcm_hw_params_set_format(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: snd_pcm_format_t) -> c_int; - pub fn snd_pcm_hw_params_set_format_first(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, format: *mut snd_pcm_format_t) -> c_int; - pub fn snd_pcm_hw_params_set_format_last(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, format: *mut snd_pcm_format_t) -> c_int; - pub fn snd_pcm_hw_params_set_format_mask(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, mask: *mut snd_pcm_format_mask_t) -> c_int; - pub fn snd_pcm_hw_params_get_format_mask(params: *mut snd_pcm_hw_params_t, mask: *mut snd_pcm_format_mask_t); - pub fn snd_pcm_hw_params_get_subformat(params: *const snd_pcm_hw_params_t, subformat: *mut snd_pcm_subformat_t) -> c_int; - pub fn snd_pcm_hw_params_test_subformat(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, subformat: snd_pcm_subformat_t) -> c_int; - pub fn snd_pcm_hw_params_set_subformat(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, subformat: snd_pcm_subformat_t) -> c_int; - pub fn snd_pcm_hw_params_set_subformat_first(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, subformat: *mut snd_pcm_subformat_t) -> c_int; - pub fn snd_pcm_hw_params_set_subformat_last(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, subformat: *mut snd_pcm_subformat_t) -> c_int; - pub fn snd_pcm_hw_params_set_subformat_mask(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, mask: *mut snd_pcm_subformat_mask_t) -> c_int; - pub fn snd_pcm_hw_params_get_subformat_mask(params: *mut snd_pcm_hw_params_t, mask: *mut snd_pcm_subformat_mask_t); - pub fn snd_pcm_hw_params_get_channels(params: *const snd_pcm_hw_params_t, val: *mut c_uint) -> c_int; - pub fn snd_pcm_hw_params_get_channels_min(params: *const snd_pcm_hw_params_t, val: *mut c_uint) -> c_int; - pub fn snd_pcm_hw_params_get_channels_max(params: *const snd_pcm_hw_params_t, val: *mut c_uint) -> c_int; - pub fn snd_pcm_hw_params_test_channels(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: c_uint) -> c_int; - pub fn snd_pcm_hw_params_set_channels(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: c_uint) -> c_int; - pub fn snd_pcm_hw_params_set_channels_min(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut c_uint) -> c_int; - pub fn snd_pcm_hw_params_set_channels_max(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut c_uint) -> c_int; - pub fn snd_pcm_hw_params_set_channels_minmax(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, min: *mut c_uint, max: *mut c_uint) -> c_int; - pub fn snd_pcm_hw_params_set_channels_near(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut c_uint) -> c_int; - pub fn snd_pcm_hw_params_set_channels_first(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut c_uint) -> c_int; - pub fn snd_pcm_hw_params_set_channels_last(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut c_uint) -> c_int; - pub fn snd_pcm_hw_params_get_rate(params: *const snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_get_rate_min(params: *const snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_get_rate_max(params: *const snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_test_rate(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: c_uint, dir: c_int) -> c_int; - pub fn snd_pcm_hw_params_set_rate(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: c_uint, dir: c_int) -> c_int; - pub fn snd_pcm_hw_params_set_rate_min(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_set_rate_max(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_set_rate_minmax(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, min: *mut c_uint, mindir: *mut c_int, max: *mut c_uint, maxdir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_set_rate_near(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_set_rate_first(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_set_rate_last(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_set_rate_resample(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: c_uint) -> c_int; - pub fn snd_pcm_hw_params_get_rate_resample(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut c_uint) -> c_int; - pub fn snd_pcm_hw_params_set_export_buffer(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: c_uint) -> c_int; - pub fn snd_pcm_hw_params_get_export_buffer(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut c_uint) -> c_int; - pub fn snd_pcm_hw_params_set_period_wakeup(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: c_uint) -> c_int; - pub fn snd_pcm_hw_params_get_period_wakeup(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut c_uint) -> c_int; - pub fn snd_pcm_hw_params_get_period_time(params: *const snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_get_period_time_min(params: *const snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_get_period_time_max(params: *const snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_test_period_time(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: c_uint, dir: c_int) -> c_int; - pub fn snd_pcm_hw_params_set_period_time(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: c_uint, dir: c_int) -> c_int; - pub fn snd_pcm_hw_params_set_period_time_min(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_set_period_time_max(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_set_period_time_minmax(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, min: *mut c_uint, mindir: *mut c_int, max: *mut c_uint, maxdir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_set_period_time_near(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_set_period_time_first(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_set_period_time_last(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_get_period_size(params: *const snd_pcm_hw_params_t, frames: *mut snd_pcm_uframes_t, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_get_period_size_min(params: *const snd_pcm_hw_params_t, frames: *mut snd_pcm_uframes_t, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_get_period_size_max(params: *const snd_pcm_hw_params_t, frames: *mut snd_pcm_uframes_t, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_test_period_size(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: snd_pcm_uframes_t, dir: c_int) -> c_int; - pub fn snd_pcm_hw_params_set_period_size(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: snd_pcm_uframes_t, dir: c_int) -> c_int; - pub fn snd_pcm_hw_params_set_period_size_min(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut snd_pcm_uframes_t, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_set_period_size_max(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut snd_pcm_uframes_t, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_set_period_size_minmax(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, min: *mut snd_pcm_uframes_t, mindir: *mut c_int, max: *mut snd_pcm_uframes_t, maxdir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_set_period_size_near(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut snd_pcm_uframes_t, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_set_period_size_first(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut snd_pcm_uframes_t, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_set_period_size_last(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut snd_pcm_uframes_t, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_set_period_size_integer(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t) -> c_int; - pub fn snd_pcm_hw_params_get_periods(params: *const snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_get_periods_min(params: *const snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_get_periods_max(params: *const snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_test_periods(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: c_uint, dir: c_int) -> c_int; - pub fn snd_pcm_hw_params_set_periods(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: c_uint, dir: c_int) -> c_int; - pub fn snd_pcm_hw_params_set_periods_min(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_set_periods_max(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_set_periods_minmax(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, min: *mut c_uint, mindir: *mut c_int, max: *mut c_uint, maxdir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_set_periods_near(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_set_periods_first(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_set_periods_last(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_set_periods_integer(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t) -> c_int; - pub fn snd_pcm_hw_params_get_buffer_time(params: *const snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_get_buffer_time_min(params: *const snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_get_buffer_time_max(params: *const snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_test_buffer_time(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: c_uint, dir: c_int) -> c_int; - pub fn snd_pcm_hw_params_set_buffer_time(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: c_uint, dir: c_int) -> c_int; - pub fn snd_pcm_hw_params_set_buffer_time_min(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_set_buffer_time_max(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_set_buffer_time_minmax(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, min: *mut c_uint, mindir: *mut c_int, max: *mut c_uint, maxdir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_set_buffer_time_near(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_set_buffer_time_first(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_set_buffer_time_last(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_get_buffer_size(params: *const snd_pcm_hw_params_t, val: *mut snd_pcm_uframes_t) -> c_int; - pub fn snd_pcm_hw_params_get_buffer_size_min(params: *const snd_pcm_hw_params_t, val: *mut snd_pcm_uframes_t) -> c_int; - pub fn snd_pcm_hw_params_get_buffer_size_max(params: *const snd_pcm_hw_params_t, val: *mut snd_pcm_uframes_t) -> c_int; - pub fn snd_pcm_hw_params_test_buffer_size(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: snd_pcm_uframes_t) -> c_int; - pub fn snd_pcm_hw_params_set_buffer_size(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: snd_pcm_uframes_t) -> c_int; - pub fn snd_pcm_hw_params_set_buffer_size_min(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut snd_pcm_uframes_t) -> c_int; - pub fn snd_pcm_hw_params_set_buffer_size_max(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut snd_pcm_uframes_t) -> c_int; - pub fn snd_pcm_hw_params_set_buffer_size_minmax(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, min: *mut snd_pcm_uframes_t, max: *mut snd_pcm_uframes_t) -> c_int; - pub fn snd_pcm_hw_params_set_buffer_size_near(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut snd_pcm_uframes_t) -> c_int; - pub fn snd_pcm_hw_params_set_buffer_size_first(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut snd_pcm_uframes_t) -> c_int; - pub fn snd_pcm_hw_params_set_buffer_size_last(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut snd_pcm_uframes_t) -> c_int; - pub fn snd_pcm_hw_params_get_min_align(params: *const snd_pcm_hw_params_t, val: *mut snd_pcm_uframes_t) -> c_int; + pub fn snd_pcm_hw_params_get_access( + params: *const snd_pcm_hw_params_t, + _access: *mut snd_pcm_access_t, + ) -> c_int; + pub fn snd_pcm_hw_params_test_access( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + _access: snd_pcm_access_t, + ) -> c_int; + pub fn snd_pcm_hw_params_set_access( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + _access: snd_pcm_access_t, + ) -> c_int; + pub fn snd_pcm_hw_params_set_access_first( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + _access: *mut snd_pcm_access_t, + ) -> c_int; + pub fn snd_pcm_hw_params_set_access_last( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + _access: *mut snd_pcm_access_t, + ) -> c_int; + pub fn snd_pcm_hw_params_set_access_mask( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + mask: *mut snd_pcm_access_mask_t, + ) -> c_int; + pub fn snd_pcm_hw_params_get_access_mask( + params: *mut snd_pcm_hw_params_t, + mask: *mut snd_pcm_access_mask_t, + ) -> c_int; + pub fn snd_pcm_hw_params_get_format( + params: *const snd_pcm_hw_params_t, + val: *mut snd_pcm_format_t, + ) -> c_int; + pub fn snd_pcm_hw_params_test_format( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: snd_pcm_format_t, + ) -> c_int; + pub fn snd_pcm_hw_params_set_format( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: snd_pcm_format_t, + ) -> c_int; + pub fn snd_pcm_hw_params_set_format_first( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + format: *mut snd_pcm_format_t, + ) -> c_int; + pub fn snd_pcm_hw_params_set_format_last( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + format: *mut snd_pcm_format_t, + ) -> c_int; + pub fn snd_pcm_hw_params_set_format_mask( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + mask: *mut snd_pcm_format_mask_t, + ) -> c_int; + pub fn snd_pcm_hw_params_get_format_mask( + params: *mut snd_pcm_hw_params_t, + mask: *mut snd_pcm_format_mask_t, + ); + pub fn snd_pcm_hw_params_get_subformat( + params: *const snd_pcm_hw_params_t, + subformat: *mut snd_pcm_subformat_t, + ) -> c_int; + pub fn snd_pcm_hw_params_test_subformat( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + subformat: snd_pcm_subformat_t, + ) -> c_int; + pub fn snd_pcm_hw_params_set_subformat( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + subformat: snd_pcm_subformat_t, + ) -> c_int; + pub fn snd_pcm_hw_params_set_subformat_first( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + subformat: *mut snd_pcm_subformat_t, + ) -> c_int; + pub fn snd_pcm_hw_params_set_subformat_last( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + subformat: *mut snd_pcm_subformat_t, + ) -> c_int; + pub fn snd_pcm_hw_params_set_subformat_mask( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + mask: *mut snd_pcm_subformat_mask_t, + ) -> c_int; + pub fn snd_pcm_hw_params_get_subformat_mask( + params: *mut snd_pcm_hw_params_t, + mask: *mut snd_pcm_subformat_mask_t, + ); + pub fn snd_pcm_hw_params_get_channels( + params: *const snd_pcm_hw_params_t, + val: *mut c_uint, + ) -> c_int; + pub fn snd_pcm_hw_params_get_channels_min( + params: *const snd_pcm_hw_params_t, + val: *mut c_uint, + ) -> c_int; + pub fn snd_pcm_hw_params_get_channels_max( + params: *const snd_pcm_hw_params_t, + val: *mut c_uint, + ) -> c_int; + pub fn snd_pcm_hw_params_test_channels( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: c_uint, + ) -> c_int; + pub fn snd_pcm_hw_params_set_channels( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: c_uint, + ) -> c_int; + pub fn snd_pcm_hw_params_set_channels_min( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut c_uint, + ) -> c_int; + pub fn snd_pcm_hw_params_set_channels_max( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut c_uint, + ) -> c_int; + pub fn snd_pcm_hw_params_set_channels_minmax( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + min: *mut c_uint, + max: *mut c_uint, + ) -> c_int; + pub fn snd_pcm_hw_params_set_channels_near( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut c_uint, + ) -> c_int; + pub fn snd_pcm_hw_params_set_channels_first( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut c_uint, + ) -> c_int; + pub fn snd_pcm_hw_params_set_channels_last( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut c_uint, + ) -> c_int; + pub fn snd_pcm_hw_params_get_rate( + params: *const snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_get_rate_min( + params: *const snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_get_rate_max( + params: *const snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_test_rate( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: c_uint, + dir: c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_rate( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: c_uint, + dir: c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_rate_min( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_rate_max( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_rate_minmax( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + min: *mut c_uint, + mindir: *mut c_int, + max: *mut c_uint, + maxdir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_rate_near( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_rate_first( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_rate_last( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_rate_resample( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: c_uint, + ) -> c_int; + pub fn snd_pcm_hw_params_get_rate_resample( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut c_uint, + ) -> c_int; + pub fn snd_pcm_hw_params_set_export_buffer( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: c_uint, + ) -> c_int; + pub fn snd_pcm_hw_params_get_export_buffer( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut c_uint, + ) -> c_int; + pub fn snd_pcm_hw_params_set_period_wakeup( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: c_uint, + ) -> c_int; + pub fn snd_pcm_hw_params_get_period_wakeup( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut c_uint, + ) -> c_int; + pub fn snd_pcm_hw_params_get_period_time( + params: *const snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_get_period_time_min( + params: *const snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_get_period_time_max( + params: *const snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_test_period_time( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: c_uint, + dir: c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_period_time( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: c_uint, + dir: c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_period_time_min( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_period_time_max( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_period_time_minmax( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + min: *mut c_uint, + mindir: *mut c_int, + max: *mut c_uint, + maxdir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_period_time_near( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_period_time_first( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_period_time_last( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_get_period_size( + params: *const snd_pcm_hw_params_t, + frames: *mut snd_pcm_uframes_t, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_get_period_size_min( + params: *const snd_pcm_hw_params_t, + frames: *mut snd_pcm_uframes_t, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_get_period_size_max( + params: *const snd_pcm_hw_params_t, + frames: *mut snd_pcm_uframes_t, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_test_period_size( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: snd_pcm_uframes_t, + dir: c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_period_size( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: snd_pcm_uframes_t, + dir: c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_period_size_min( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut snd_pcm_uframes_t, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_period_size_max( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut snd_pcm_uframes_t, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_period_size_minmax( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + min: *mut snd_pcm_uframes_t, + mindir: *mut c_int, + max: *mut snd_pcm_uframes_t, + maxdir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_period_size_near( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut snd_pcm_uframes_t, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_period_size_first( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut snd_pcm_uframes_t, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_period_size_last( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut snd_pcm_uframes_t, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_period_size_integer( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + ) -> c_int; + pub fn snd_pcm_hw_params_get_periods( + params: *const snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_get_periods_min( + params: *const snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_get_periods_max( + params: *const snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_test_periods( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: c_uint, + dir: c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_periods( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: c_uint, + dir: c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_periods_min( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_periods_max( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_periods_minmax( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + min: *mut c_uint, + mindir: *mut c_int, + max: *mut c_uint, + maxdir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_periods_near( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_periods_first( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_periods_last( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_periods_integer( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + ) -> c_int; + pub fn snd_pcm_hw_params_get_buffer_time( + params: *const snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_get_buffer_time_min( + params: *const snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_get_buffer_time_max( + params: *const snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_test_buffer_time( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: c_uint, + dir: c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_buffer_time( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: c_uint, + dir: c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_buffer_time_min( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_buffer_time_max( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_buffer_time_minmax( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + min: *mut c_uint, + mindir: *mut c_int, + max: *mut c_uint, + maxdir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_buffer_time_near( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_buffer_time_first( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_buffer_time_last( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_get_buffer_size( + params: *const snd_pcm_hw_params_t, + val: *mut snd_pcm_uframes_t, + ) -> c_int; + pub fn snd_pcm_hw_params_get_buffer_size_min( + params: *const snd_pcm_hw_params_t, + val: *mut snd_pcm_uframes_t, + ) -> c_int; + pub fn snd_pcm_hw_params_get_buffer_size_max( + params: *const snd_pcm_hw_params_t, + val: *mut snd_pcm_uframes_t, + ) -> c_int; + pub fn snd_pcm_hw_params_test_buffer_size( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: snd_pcm_uframes_t, + ) -> c_int; + pub fn snd_pcm_hw_params_set_buffer_size( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: snd_pcm_uframes_t, + ) -> c_int; + pub fn snd_pcm_hw_params_set_buffer_size_min( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut snd_pcm_uframes_t, + ) -> c_int; + pub fn snd_pcm_hw_params_set_buffer_size_max( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut snd_pcm_uframes_t, + ) -> c_int; + pub fn snd_pcm_hw_params_set_buffer_size_minmax( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + min: *mut snd_pcm_uframes_t, + max: *mut snd_pcm_uframes_t, + ) -> c_int; + pub fn snd_pcm_hw_params_set_buffer_size_near( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut snd_pcm_uframes_t, + ) -> c_int; + pub fn snd_pcm_hw_params_set_buffer_size_first( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut snd_pcm_uframes_t, + ) -> c_int; + pub fn snd_pcm_hw_params_set_buffer_size_last( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut snd_pcm_uframes_t, + ) -> c_int; + pub fn snd_pcm_hw_params_get_min_align( + params: *const snd_pcm_hw_params_t, + val: *mut snd_pcm_uframes_t, + ) -> c_int; pub fn snd_pcm_sw_params_sizeof() -> size_t; pub fn snd_pcm_sw_params_malloc(ptr: *mut *mut snd_pcm_sw_params_t) -> c_int; pub fn snd_pcm_sw_params_free(obj: *mut snd_pcm_sw_params_t); pub fn snd_pcm_sw_params_copy(dst: *mut snd_pcm_sw_params_t, src: *const snd_pcm_sw_params_t); - pub fn snd_pcm_sw_params_get_boundary(params: *const snd_pcm_sw_params_t, val: *mut snd_pcm_uframes_t) -> c_int; - pub fn snd_pcm_sw_params_set_tstamp_mode(pcm: *mut snd_pcm_t, params: *mut snd_pcm_sw_params_t, val: snd_pcm_tstamp_t) -> c_int; - pub fn snd_pcm_sw_params_get_tstamp_mode(params: *const snd_pcm_sw_params_t, val: *mut snd_pcm_tstamp_t) -> c_int; - pub fn snd_pcm_sw_params_set_avail_min(pcm: *mut snd_pcm_t, params: *mut snd_pcm_sw_params_t, val: snd_pcm_uframes_t) -> c_int; - pub fn snd_pcm_sw_params_get_avail_min(params: *const snd_pcm_sw_params_t, val: *mut snd_pcm_uframes_t) -> c_int; - pub fn snd_pcm_sw_params_set_period_event(pcm: *mut snd_pcm_t, params: *mut snd_pcm_sw_params_t, val: c_int) -> c_int; - pub fn snd_pcm_sw_params_get_period_event(params: *const snd_pcm_sw_params_t, val: *mut c_int) -> c_int; - pub fn snd_pcm_sw_params_set_start_threshold(pcm: *mut snd_pcm_t, params: *mut snd_pcm_sw_params_t, val: snd_pcm_uframes_t) -> c_int; - pub fn snd_pcm_sw_params_get_start_threshold(paramsm: *const snd_pcm_sw_params_t, val: *mut snd_pcm_uframes_t) -> c_int; - pub fn snd_pcm_sw_params_set_stop_threshold(pcm: *mut snd_pcm_t, params: *mut snd_pcm_sw_params_t, val: snd_pcm_uframes_t) -> c_int; - pub fn snd_pcm_sw_params_get_stop_threshold(params: *const snd_pcm_sw_params_t, val: *mut snd_pcm_uframes_t) -> c_int; - pub fn snd_pcm_sw_params_set_silence_threshold(pcm: *mut snd_pcm_t, params: *mut snd_pcm_sw_params_t, val: snd_pcm_uframes_t) -> c_int; - pub fn snd_pcm_sw_params_get_silence_threshold(params: *const snd_pcm_sw_params_t, val: *mut snd_pcm_uframes_t) -> c_int; - pub fn snd_pcm_sw_params_set_silence_size(pcm: *mut snd_pcm_t, params: *mut snd_pcm_sw_params_t, val: snd_pcm_uframes_t) -> c_int; - pub fn snd_pcm_sw_params_get_silence_size(params: *const snd_pcm_sw_params_t, val: *mut snd_pcm_uframes_t) -> c_int; + pub fn snd_pcm_sw_params_get_boundary( + params: *const snd_pcm_sw_params_t, + val: *mut snd_pcm_uframes_t, + ) -> c_int; + pub fn snd_pcm_sw_params_set_tstamp_mode( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_sw_params_t, + val: snd_pcm_tstamp_t, + ) -> c_int; + pub fn snd_pcm_sw_params_get_tstamp_mode( + params: *const snd_pcm_sw_params_t, + val: *mut snd_pcm_tstamp_t, + ) -> c_int; + pub fn snd_pcm_sw_params_set_avail_min( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_sw_params_t, + val: snd_pcm_uframes_t, + ) -> c_int; + pub fn snd_pcm_sw_params_get_avail_min( + params: *const snd_pcm_sw_params_t, + val: *mut snd_pcm_uframes_t, + ) -> c_int; + pub fn snd_pcm_sw_params_set_period_event( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_sw_params_t, + val: c_int, + ) -> c_int; + pub fn snd_pcm_sw_params_get_period_event( + params: *const snd_pcm_sw_params_t, + val: *mut c_int, + ) -> c_int; + pub fn snd_pcm_sw_params_set_start_threshold( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_sw_params_t, + val: snd_pcm_uframes_t, + ) -> c_int; + pub fn snd_pcm_sw_params_get_start_threshold( + paramsm: *const snd_pcm_sw_params_t, + val: *mut snd_pcm_uframes_t, + ) -> c_int; + pub fn snd_pcm_sw_params_set_stop_threshold( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_sw_params_t, + val: snd_pcm_uframes_t, + ) -> c_int; + pub fn snd_pcm_sw_params_get_stop_threshold( + params: *const snd_pcm_sw_params_t, + val: *mut snd_pcm_uframes_t, + ) -> c_int; + pub fn snd_pcm_sw_params_set_silence_threshold( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_sw_params_t, + val: snd_pcm_uframes_t, + ) -> c_int; + pub fn snd_pcm_sw_params_get_silence_threshold( + params: *const snd_pcm_sw_params_t, + val: *mut snd_pcm_uframes_t, + ) -> c_int; + pub fn snd_pcm_sw_params_set_silence_size( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_sw_params_t, + val: snd_pcm_uframes_t, + ) -> c_int; + pub fn snd_pcm_sw_params_get_silence_size( + params: *const snd_pcm_sw_params_t, + val: *mut snd_pcm_uframes_t, + ) -> c_int; pub fn snd_pcm_access_mask_sizeof() -> size_t; pub fn snd_pcm_access_mask_malloc(ptr: *mut *mut snd_pcm_access_mask_t) -> c_int; pub fn snd_pcm_access_mask_free(obj: *mut snd_pcm_access_mask_t); - pub fn snd_pcm_access_mask_copy(dst: *mut snd_pcm_access_mask_t, src: *const snd_pcm_access_mask_t); + pub fn snd_pcm_access_mask_copy( + dst: *mut snd_pcm_access_mask_t, + src: *const snd_pcm_access_mask_t, + ); pub fn snd_pcm_access_mask_none(mask: *mut snd_pcm_access_mask_t); pub fn snd_pcm_access_mask_any(mask: *mut snd_pcm_access_mask_t); - pub fn snd_pcm_access_mask_test(mask: *const snd_pcm_access_mask_t, val: snd_pcm_access_t) -> c_int; + pub fn snd_pcm_access_mask_test( + mask: *const snd_pcm_access_mask_t, + val: snd_pcm_access_t, + ) -> c_int; pub fn snd_pcm_access_mask_empty(mask: *const snd_pcm_access_mask_t) -> c_int; pub fn snd_pcm_access_mask_set(mask: *mut snd_pcm_access_mask_t, val: snd_pcm_access_t); pub fn snd_pcm_access_mask_reset(mask: *mut snd_pcm_access_mask_t, val: snd_pcm_access_t); pub fn snd_pcm_format_mask_sizeof() -> size_t; pub fn snd_pcm_format_mask_malloc(ptr: *mut *mut snd_pcm_format_mask_t) -> c_int; pub fn snd_pcm_format_mask_free(obj: *mut snd_pcm_format_mask_t); - pub fn snd_pcm_format_mask_copy(dst: *mut snd_pcm_format_mask_t, src: *const snd_pcm_format_mask_t); + pub fn snd_pcm_format_mask_copy( + dst: *mut snd_pcm_format_mask_t, + src: *const snd_pcm_format_mask_t, + ); pub fn snd_pcm_format_mask_none(mask: *mut snd_pcm_format_mask_t); pub fn snd_pcm_format_mask_any(mask: *mut snd_pcm_format_mask_t); - pub fn snd_pcm_format_mask_test(mask: *const snd_pcm_format_mask_t, val: snd_pcm_format_t) -> c_int; + pub fn snd_pcm_format_mask_test( + mask: *const snd_pcm_format_mask_t, + val: snd_pcm_format_t, + ) -> c_int; pub fn snd_pcm_format_mask_empty(mask: *const snd_pcm_format_mask_t) -> c_int; pub fn snd_pcm_format_mask_set(mask: *mut snd_pcm_format_mask_t, val: snd_pcm_format_t); pub fn snd_pcm_format_mask_reset(mask: *mut snd_pcm_format_mask_t, val: snd_pcm_format_t); pub fn snd_pcm_subformat_mask_sizeof() -> size_t; pub fn snd_pcm_subformat_mask_malloc(ptr: *mut *mut snd_pcm_subformat_mask_t) -> c_int; pub fn snd_pcm_subformat_mask_free(obj: *mut snd_pcm_subformat_mask_t); - pub fn snd_pcm_subformat_mask_copy(dst: *mut snd_pcm_subformat_mask_t, src: *const snd_pcm_subformat_mask_t); + pub fn snd_pcm_subformat_mask_copy( + dst: *mut snd_pcm_subformat_mask_t, + src: *const snd_pcm_subformat_mask_t, + ); pub fn snd_pcm_subformat_mask_none(mask: *mut snd_pcm_subformat_mask_t); pub fn snd_pcm_subformat_mask_any(mask: *mut snd_pcm_subformat_mask_t); - pub fn snd_pcm_subformat_mask_test(mask: *const snd_pcm_subformat_mask_t, val: snd_pcm_subformat_t) -> c_int; + pub fn snd_pcm_subformat_mask_test( + mask: *const snd_pcm_subformat_mask_t, + val: snd_pcm_subformat_t, + ) -> c_int; pub fn snd_pcm_subformat_mask_empty(mask: *const snd_pcm_subformat_mask_t) -> c_int; - pub fn snd_pcm_subformat_mask_set(mask: *mut snd_pcm_subformat_mask_t, val: snd_pcm_subformat_t); - pub fn snd_pcm_subformat_mask_reset(mask: *mut snd_pcm_subformat_mask_t, val: snd_pcm_subformat_t); + pub fn snd_pcm_subformat_mask_set( + mask: *mut snd_pcm_subformat_mask_t, + val: snd_pcm_subformat_t, + ); + pub fn snd_pcm_subformat_mask_reset( + mask: *mut snd_pcm_subformat_mask_t, + val: snd_pcm_subformat_t, + ); pub fn snd_pcm_status_sizeof() -> size_t; pub fn snd_pcm_status_malloc(ptr: *mut *mut snd_pcm_status_t) -> c_int; pub fn snd_pcm_status_free(obj: *mut snd_pcm_status_t); pub fn snd_pcm_status_copy(dst: *mut snd_pcm_status_t, src: *const snd_pcm_status_t); pub fn snd_pcm_status_get_state(obj: *const snd_pcm_status_t) -> snd_pcm_state_t; - pub fn snd_pcm_status_get_trigger_tstamp(obj: *const snd_pcm_status_t, ptr: *mut snd_timestamp_t); - pub fn snd_pcm_status_get_trigger_htstamp(obj: *const snd_pcm_status_t, ptr: *mut snd_htimestamp_t); + pub fn snd_pcm_status_get_trigger_tstamp( + obj: *const snd_pcm_status_t, + ptr: *mut snd_timestamp_t, + ); + pub fn snd_pcm_status_get_trigger_htstamp( + obj: *const snd_pcm_status_t, + ptr: *mut snd_htimestamp_t, + ); pub fn snd_pcm_status_get_tstamp(obj: *const snd_pcm_status_t, ptr: *mut snd_timestamp_t); pub fn snd_pcm_status_get_htstamp(obj: *const snd_pcm_status_t, ptr: *mut snd_htimestamp_t); - pub fn snd_pcm_status_get_audio_htstamp(obj: *const snd_pcm_status_t, ptr: *mut snd_htimestamp_t); + pub fn snd_pcm_status_get_audio_htstamp( + obj: *const snd_pcm_status_t, + ptr: *mut snd_htimestamp_t, + ); pub fn snd_pcm_status_get_delay(obj: *const snd_pcm_status_t) -> snd_pcm_sframes_t; pub fn snd_pcm_status_get_avail(obj: *const snd_pcm_status_t) -> snd_pcm_uframes_t; pub fn snd_pcm_status_get_avail_max(obj: *const snd_pcm_status_t) -> snd_pcm_uframes_t; @@ -1244,15 +1985,46 @@ extern "C" { pub fn snd_pcm_dump_hw_setup(pcm: *mut snd_pcm_t, out: *mut snd_output_t) -> c_int; pub fn snd_pcm_dump_sw_setup(pcm: *mut snd_pcm_t, out: *mut snd_output_t) -> c_int; pub fn snd_pcm_dump_setup(pcm: *mut snd_pcm_t, out: *mut snd_output_t) -> c_int; - pub fn snd_pcm_hw_params_dump(params: *mut snd_pcm_hw_params_t, out: *mut snd_output_t) -> c_int; - pub fn snd_pcm_sw_params_dump(params: *mut snd_pcm_sw_params_t, out: *mut snd_output_t) -> c_int; + pub fn snd_pcm_hw_params_dump( + params: *mut snd_pcm_hw_params_t, + out: *mut snd_output_t, + ) -> c_int; + pub fn snd_pcm_sw_params_dump( + params: *mut snd_pcm_sw_params_t, + out: *mut snd_output_t, + ) -> c_int; pub fn snd_pcm_status_dump(status: *mut snd_pcm_status_t, out: *mut snd_output_t) -> c_int; - pub fn snd_pcm_mmap_begin(pcm: *mut snd_pcm_t, areas: *mut *const snd_pcm_channel_area_t, offset: *mut snd_pcm_uframes_t, frames: *mut snd_pcm_uframes_t) -> c_int; - pub fn snd_pcm_mmap_commit(pcm: *mut snd_pcm_t, offset: snd_pcm_uframes_t, frames: snd_pcm_uframes_t) -> snd_pcm_sframes_t; - pub fn snd_pcm_mmap_writei(pcm: *mut snd_pcm_t, buffer: *const c_void, size: snd_pcm_uframes_t) -> snd_pcm_sframes_t; - pub fn snd_pcm_mmap_readi(pcm: *mut snd_pcm_t, buffer: *mut c_void, size: snd_pcm_uframes_t) -> snd_pcm_sframes_t; - pub fn snd_pcm_mmap_writen(pcm: *mut snd_pcm_t, bufs: *mut *mut c_void, size: snd_pcm_uframes_t) -> snd_pcm_sframes_t; - pub fn snd_pcm_mmap_readn(pcm: *mut snd_pcm_t, bufs: *mut *mut c_void, size: snd_pcm_uframes_t) -> snd_pcm_sframes_t; + pub fn snd_pcm_mmap_begin( + pcm: *mut snd_pcm_t, + areas: *mut *const snd_pcm_channel_area_t, + offset: *mut snd_pcm_uframes_t, + frames: *mut snd_pcm_uframes_t, + ) -> c_int; + pub fn snd_pcm_mmap_commit( + pcm: *mut snd_pcm_t, + offset: snd_pcm_uframes_t, + frames: snd_pcm_uframes_t, + ) -> snd_pcm_sframes_t; + pub fn snd_pcm_mmap_writei( + pcm: *mut snd_pcm_t, + buffer: *const c_void, + size: snd_pcm_uframes_t, + ) -> snd_pcm_sframes_t; + pub fn snd_pcm_mmap_readi( + pcm: *mut snd_pcm_t, + buffer: *mut c_void, + size: snd_pcm_uframes_t, + ) -> snd_pcm_sframes_t; + pub fn snd_pcm_mmap_writen( + pcm: *mut snd_pcm_t, + bufs: *mut *mut c_void, + size: snd_pcm_uframes_t, + ) -> snd_pcm_sframes_t; + pub fn snd_pcm_mmap_readn( + pcm: *mut snd_pcm_t, + bufs: *mut *mut c_void, + size: snd_pcm_uframes_t, + ) -> snd_pcm_sframes_t; pub fn snd_pcm_format_signed(format: snd_pcm_format_t) -> c_int; pub fn snd_pcm_format_unsigned(format: snd_pcm_format_t) -> c_int; pub fn snd_pcm_format_linear(format: snd_pcm_format_t) -> c_int; @@ -1262,25 +2034,66 @@ extern "C" { pub fn snd_pcm_format_cpu_endian(format: snd_pcm_format_t) -> c_int; pub fn snd_pcm_format_width(format: snd_pcm_format_t) -> c_int; pub fn snd_pcm_format_physical_width(format: snd_pcm_format_t) -> c_int; - pub fn snd_pcm_build_linear_format(width: c_int, pwidth: c_int, unsignd: c_int, big_endian: c_int) -> snd_pcm_format_t; + pub fn snd_pcm_build_linear_format( + width: c_int, + pwidth: c_int, + unsignd: c_int, + big_endian: c_int, + ) -> snd_pcm_format_t; pub fn snd_pcm_format_size(format: snd_pcm_format_t, samples: size_t) -> ssize_t; pub fn snd_pcm_format_silence(format: snd_pcm_format_t) -> u8; pub fn snd_pcm_format_silence_16(format: snd_pcm_format_t) -> u16; pub fn snd_pcm_format_silence_32(format: snd_pcm_format_t) -> u32; pub fn snd_pcm_format_silence_64(format: snd_pcm_format_t) -> u64; - pub fn snd_pcm_format_set_silence(format: snd_pcm_format_t, buf: *mut c_void, samples: c_uint) -> c_int; + pub fn snd_pcm_format_set_silence( + format: snd_pcm_format_t, + buf: *mut c_void, + samples: c_uint, + ) -> c_int; pub fn snd_pcm_bytes_to_frames(pcm: *mut snd_pcm_t, bytes: ssize_t) -> snd_pcm_sframes_t; pub fn snd_pcm_frames_to_bytes(pcm: *mut snd_pcm_t, frames: snd_pcm_sframes_t) -> ssize_t; pub fn snd_pcm_bytes_to_samples(pcm: *mut snd_pcm_t, bytes: ssize_t) -> c_long; pub fn snd_pcm_samples_to_bytes(pcm: *mut snd_pcm_t, samples: c_long) -> ssize_t; - pub fn snd_pcm_area_silence(dst_channel: *const snd_pcm_channel_area_t, dst_offset: snd_pcm_uframes_t, samples: c_uint, format: snd_pcm_format_t) -> c_int; - pub fn snd_pcm_areas_silence(dst_channels: *const snd_pcm_channel_area_t, dst_offset: snd_pcm_uframes_t, channels: c_uint, frames: snd_pcm_uframes_t, format: snd_pcm_format_t) -> c_int; - pub fn snd_pcm_area_copy(dst_channel: *const snd_pcm_channel_area_t, dst_offset: snd_pcm_uframes_t, src_channel: *const snd_pcm_channel_area_t, src_offset: snd_pcm_uframes_t, samples: c_uint, format: snd_pcm_format_t) -> c_int; - pub fn snd_pcm_areas_copy(dst_channels: *const snd_pcm_channel_area_t, dst_offset: snd_pcm_uframes_t, src_channels: *const snd_pcm_channel_area_t, src_offset: snd_pcm_uframes_t, channels: c_uint, frames: snd_pcm_uframes_t, format: snd_pcm_format_t) -> c_int; + pub fn snd_pcm_area_silence( + dst_channel: *const snd_pcm_channel_area_t, + dst_offset: snd_pcm_uframes_t, + samples: c_uint, + format: snd_pcm_format_t, + ) -> c_int; + pub fn snd_pcm_areas_silence( + dst_channels: *const snd_pcm_channel_area_t, + dst_offset: snd_pcm_uframes_t, + channels: c_uint, + frames: snd_pcm_uframes_t, + format: snd_pcm_format_t, + ) -> c_int; + pub fn snd_pcm_area_copy( + dst_channel: *const snd_pcm_channel_area_t, + dst_offset: snd_pcm_uframes_t, + src_channel: *const snd_pcm_channel_area_t, + src_offset: snd_pcm_uframes_t, + samples: c_uint, + format: snd_pcm_format_t, + ) -> c_int; + pub fn snd_pcm_areas_copy( + dst_channels: *const snd_pcm_channel_area_t, + dst_offset: snd_pcm_uframes_t, + src_channels: *const snd_pcm_channel_area_t, + src_offset: snd_pcm_uframes_t, + channels: c_uint, + frames: snd_pcm_uframes_t, + format: snd_pcm_format_t, + ) -> c_int; pub fn snd_pcm_hook_get_pcm(hook: *mut snd_pcm_hook_t) -> *mut snd_pcm_t; pub fn snd_pcm_hook_get_private(hook: *mut snd_pcm_hook_t) -> *mut c_void; pub fn snd_pcm_hook_set_private(hook: *mut snd_pcm_hook_t, private_data: *mut c_void); - pub fn snd_pcm_hook_add(hookp: *mut *mut snd_pcm_hook_t, pcm: *mut snd_pcm_t, _type: snd_pcm_hook_type_t, func: snd_pcm_hook_func_t, private_data: *mut c_void) -> c_int; + pub fn snd_pcm_hook_add( + hookp: *mut *mut snd_pcm_hook_t, + pcm: *mut snd_pcm_t, + _type: snd_pcm_hook_type_t, + func: snd_pcm_hook_func_t, + private_data: *mut c_void, + ) -> c_int; pub fn snd_pcm_hook_remove(hook: *mut snd_pcm_hook_t) -> c_int; pub fn snd_pcm_meter_get_bufsize(pcm: *mut snd_pcm_t) -> snd_pcm_uframes_t; pub fn snd_pcm_meter_get_channels(pcm: *mut snd_pcm_t) -> c_uint; @@ -1288,45 +2101,176 @@ extern "C" { pub fn snd_pcm_meter_get_now(pcm: *mut snd_pcm_t) -> snd_pcm_uframes_t; pub fn snd_pcm_meter_get_boundary(pcm: *mut snd_pcm_t) -> snd_pcm_uframes_t; pub fn snd_pcm_meter_add_scope(pcm: *mut snd_pcm_t, scope: *mut snd_pcm_scope_t) -> c_int; - pub fn snd_pcm_meter_search_scope(pcm: *mut snd_pcm_t, name: *const c_char) -> *mut snd_pcm_scope_t; + pub fn snd_pcm_meter_search_scope( + pcm: *mut snd_pcm_t, + name: *const c_char, + ) -> *mut snd_pcm_scope_t; pub fn snd_pcm_scope_malloc(ptr: *mut *mut snd_pcm_scope_t) -> c_int; pub fn snd_pcm_scope_set_ops(scope: *mut snd_pcm_scope_t, val: *const snd_pcm_scope_ops_t); pub fn snd_pcm_scope_set_name(scope: *mut snd_pcm_scope_t, val: *const c_char); pub fn snd_pcm_scope_get_name(scope: *mut snd_pcm_scope_t) -> *const c_char; pub fn snd_pcm_scope_get_callback_private(scope: *mut snd_pcm_scope_t) -> *mut c_void; pub fn snd_pcm_scope_set_callback_private(scope: *mut snd_pcm_scope_t, val: *mut c_void); - pub fn snd_pcm_scope_s16_open(pcm: *mut snd_pcm_t, name: *const c_char, scopep: *mut *mut snd_pcm_scope_t) -> c_int; - pub fn snd_pcm_scope_s16_get_channel_buffer(scope: *mut snd_pcm_scope_t, channel: c_uint) -> *mut i16; - pub fn snd_spcm_init(pcm: *mut snd_pcm_t, rate: c_uint, channels: c_uint, format: snd_pcm_format_t, subformat: snd_pcm_subformat_t, latency: snd_spcm_latency_t, _access: snd_pcm_access_t, xrun_type: snd_spcm_xrun_type_t) -> c_int; - pub fn snd_spcm_init_duplex(playback_pcm: *mut snd_pcm_t, capture_pcm: *mut snd_pcm_t, rate: c_uint, channels: c_uint, format: snd_pcm_format_t, subformat: snd_pcm_subformat_t, latency: snd_spcm_latency_t, _access: snd_pcm_access_t, xrun_type: snd_spcm_xrun_type_t, duplex_type: snd_spcm_duplex_type_t) -> c_int; - pub fn snd_spcm_init_get_params(pcm: *mut snd_pcm_t, rate: *mut c_uint, buffer_size: *mut snd_pcm_uframes_t, period_size: *mut snd_pcm_uframes_t) -> c_int; + pub fn snd_pcm_scope_s16_open( + pcm: *mut snd_pcm_t, + name: *const c_char, + scopep: *mut *mut snd_pcm_scope_t, + ) -> c_int; + pub fn snd_pcm_scope_s16_get_channel_buffer( + scope: *mut snd_pcm_scope_t, + channel: c_uint, + ) -> *mut i16; + pub fn snd_spcm_init( + pcm: *mut snd_pcm_t, + rate: c_uint, + channels: c_uint, + format: snd_pcm_format_t, + subformat: snd_pcm_subformat_t, + latency: snd_spcm_latency_t, + _access: snd_pcm_access_t, + xrun_type: snd_spcm_xrun_type_t, + ) -> c_int; + pub fn snd_spcm_init_duplex( + playback_pcm: *mut snd_pcm_t, + capture_pcm: *mut snd_pcm_t, + rate: c_uint, + channels: c_uint, + format: snd_pcm_format_t, + subformat: snd_pcm_subformat_t, + latency: snd_spcm_latency_t, + _access: snd_pcm_access_t, + xrun_type: snd_spcm_xrun_type_t, + duplex_type: snd_spcm_duplex_type_t, + ) -> c_int; + pub fn snd_spcm_init_get_params( + pcm: *mut snd_pcm_t, + rate: *mut c_uint, + buffer_size: *mut snd_pcm_uframes_t, + period_size: *mut snd_pcm_uframes_t, + ) -> c_int; pub fn snd_pcm_start_mode_name(mode: snd_pcm_start_t) -> *const c_char; pub fn snd_pcm_xrun_mode_name(mode: snd_pcm_xrun_t) -> *const c_char; - pub fn snd_pcm_sw_params_set_start_mode(pcm: *mut snd_pcm_t, params: *mut snd_pcm_sw_params_t, val: snd_pcm_start_t) -> c_int; + pub fn snd_pcm_sw_params_set_start_mode( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_sw_params_t, + val: snd_pcm_start_t, + ) -> c_int; pub fn snd_pcm_sw_params_get_start_mode(params: *const snd_pcm_sw_params_t) -> snd_pcm_start_t; - pub fn snd_pcm_sw_params_set_xrun_mode(pcm: *mut snd_pcm_t, params: *mut snd_pcm_sw_params_t, val: snd_pcm_xrun_t) -> c_int; + pub fn snd_pcm_sw_params_set_xrun_mode( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_sw_params_t, + val: snd_pcm_xrun_t, + ) -> c_int; pub fn snd_pcm_sw_params_get_xrun_mode(params: *const snd_pcm_sw_params_t) -> snd_pcm_xrun_t; - pub fn snd_pcm_sw_params_set_xfer_align(pcm: *mut snd_pcm_t, params: *mut snd_pcm_sw_params_t, val: snd_pcm_uframes_t) -> c_int; - pub fn snd_pcm_sw_params_get_xfer_align(params: *const snd_pcm_sw_params_t, val: *mut snd_pcm_uframes_t) -> c_int; - pub fn snd_pcm_sw_params_set_sleep_min(pcm: *mut snd_pcm_t, params: *mut snd_pcm_sw_params_t, val: c_uint) -> c_int; - pub fn snd_pcm_sw_params_get_sleep_min(params: *const snd_pcm_sw_params_t, val: *mut c_uint) -> c_int; - pub fn snd_pcm_hw_params_get_tick_time(params: *const snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_get_tick_time_min(params: *const snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_get_tick_time_max(params: *const snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_test_tick_time(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: c_uint, dir: c_int) -> c_int; - pub fn snd_pcm_hw_params_set_tick_time(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: c_uint, dir: c_int) -> c_int; - pub fn snd_pcm_hw_params_set_tick_time_min(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_set_tick_time_max(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_set_tick_time_minmax(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, min: *mut c_uint, mindir: *mut c_int, max: *mut c_uint, maxdir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_set_tick_time_near(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_set_tick_time_first(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_pcm_hw_params_set_tick_time_last(pcm: *mut snd_pcm_t, params: *mut snd_pcm_hw_params_t, val: *mut c_uint, dir: *mut c_int) -> c_int; - pub fn snd_rawmidi_open(in_rmidi: *mut *mut snd_rawmidi_t, out_rmidi: *mut *mut snd_rawmidi_t, name: *const c_char, mode: c_int) -> c_int; - pub fn snd_rawmidi_open_lconf(in_rmidi: *mut *mut snd_rawmidi_t, out_rmidi: *mut *mut snd_rawmidi_t, name: *const c_char, mode: c_int, lconf: *mut snd_config_t) -> c_int; + pub fn snd_pcm_sw_params_set_xfer_align( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_sw_params_t, + val: snd_pcm_uframes_t, + ) -> c_int; + pub fn snd_pcm_sw_params_get_xfer_align( + params: *const snd_pcm_sw_params_t, + val: *mut snd_pcm_uframes_t, + ) -> c_int; + pub fn snd_pcm_sw_params_set_sleep_min( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_sw_params_t, + val: c_uint, + ) -> c_int; + pub fn snd_pcm_sw_params_get_sleep_min( + params: *const snd_pcm_sw_params_t, + val: *mut c_uint, + ) -> c_int; + pub fn snd_pcm_hw_params_get_tick_time( + params: *const snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_get_tick_time_min( + params: *const snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_get_tick_time_max( + params: *const snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_test_tick_time( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: c_uint, + dir: c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_tick_time( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: c_uint, + dir: c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_tick_time_min( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_tick_time_max( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_tick_time_minmax( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + min: *mut c_uint, + mindir: *mut c_int, + max: *mut c_uint, + maxdir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_tick_time_near( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_tick_time_first( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_pcm_hw_params_set_tick_time_last( + pcm: *mut snd_pcm_t, + params: *mut snd_pcm_hw_params_t, + val: *mut c_uint, + dir: *mut c_int, + ) -> c_int; + pub fn snd_rawmidi_open( + in_rmidi: *mut *mut snd_rawmidi_t, + out_rmidi: *mut *mut snd_rawmidi_t, + name: *const c_char, + mode: c_int, + ) -> c_int; + pub fn snd_rawmidi_open_lconf( + in_rmidi: *mut *mut snd_rawmidi_t, + out_rmidi: *mut *mut snd_rawmidi_t, + name: *const c_char, + mode: c_int, + lconf: *mut snd_config_t, + ) -> c_int; pub fn snd_rawmidi_close(rmidi: *mut snd_rawmidi_t) -> c_int; pub fn snd_rawmidi_poll_descriptors_count(rmidi: *mut snd_rawmidi_t) -> c_int; - pub fn snd_rawmidi_poll_descriptors(rmidi: *mut snd_rawmidi_t, pfds: *mut pollfd, space: c_uint) -> c_int; - pub fn snd_rawmidi_poll_descriptors_revents(rawmidi: *mut snd_rawmidi_t, pfds: *mut pollfd, nfds: c_uint, revent: *mut c_ushort) -> c_int; + pub fn snd_rawmidi_poll_descriptors( + rmidi: *mut snd_rawmidi_t, + pfds: *mut pollfd, + space: c_uint, + ) -> c_int; + pub fn snd_rawmidi_poll_descriptors_revents( + rawmidi: *mut snd_rawmidi_t, + pfds: *mut pollfd, + nfds: c_uint, + revent: *mut c_ushort, + ) -> c_int; pub fn snd_rawmidi_nonblock(rmidi: *mut snd_rawmidi_t, nonblock: c_int) -> c_int; pub fn snd_rawmidi_info_sizeof() -> size_t; pub fn snd_rawmidi_info_malloc(ptr: *mut *mut snd_rawmidi_info_t) -> c_int; @@ -1349,45 +2293,124 @@ extern "C" { pub fn snd_rawmidi_params_sizeof() -> size_t; pub fn snd_rawmidi_params_malloc(ptr: *mut *mut snd_rawmidi_params_t) -> c_int; pub fn snd_rawmidi_params_free(obj: *mut snd_rawmidi_params_t); - pub fn snd_rawmidi_params_copy(dst: *mut snd_rawmidi_params_t, src: *const snd_rawmidi_params_t); - pub fn snd_rawmidi_params_set_buffer_size(rmidi: *mut snd_rawmidi_t, params: *mut snd_rawmidi_params_t, val: size_t) -> c_int; + pub fn snd_rawmidi_params_copy( + dst: *mut snd_rawmidi_params_t, + src: *const snd_rawmidi_params_t, + ); + pub fn snd_rawmidi_params_set_buffer_size( + rmidi: *mut snd_rawmidi_t, + params: *mut snd_rawmidi_params_t, + val: size_t, + ) -> c_int; pub fn snd_rawmidi_params_get_buffer_size(params: *const snd_rawmidi_params_t) -> size_t; - pub fn snd_rawmidi_params_set_avail_min(rmidi: *mut snd_rawmidi_t, params: *mut snd_rawmidi_params_t, val: size_t) -> c_int; + pub fn snd_rawmidi_params_set_avail_min( + rmidi: *mut snd_rawmidi_t, + params: *mut snd_rawmidi_params_t, + val: size_t, + ) -> c_int; pub fn snd_rawmidi_params_get_avail_min(params: *const snd_rawmidi_params_t) -> size_t; - pub fn snd_rawmidi_params_set_no_active_sensing(rmidi: *mut snd_rawmidi_t, params: *mut snd_rawmidi_params_t, val: c_int) -> c_int; + pub fn snd_rawmidi_params_set_no_active_sensing( + rmidi: *mut snd_rawmidi_t, + params: *mut snd_rawmidi_params_t, + val: c_int, + ) -> c_int; pub fn snd_rawmidi_params_get_no_active_sensing(params: *const snd_rawmidi_params_t) -> c_int; - pub fn snd_rawmidi_params(rmidi: *mut snd_rawmidi_t, params: *mut snd_rawmidi_params_t) -> c_int; - pub fn snd_rawmidi_params_current(rmidi: *mut snd_rawmidi_t, params: *mut snd_rawmidi_params_t) -> c_int; + pub fn snd_rawmidi_params( + rmidi: *mut snd_rawmidi_t, + params: *mut snd_rawmidi_params_t, + ) -> c_int; + pub fn snd_rawmidi_params_current( + rmidi: *mut snd_rawmidi_t, + params: *mut snd_rawmidi_params_t, + ) -> c_int; pub fn snd_rawmidi_status_sizeof() -> size_t; pub fn snd_rawmidi_status_malloc(ptr: *mut *mut snd_rawmidi_status_t) -> c_int; pub fn snd_rawmidi_status_free(obj: *mut snd_rawmidi_status_t); - pub fn snd_rawmidi_status_copy(dst: *mut snd_rawmidi_status_t, src: *const snd_rawmidi_status_t); - pub fn snd_rawmidi_status_get_tstamp(obj: *const snd_rawmidi_status_t, ptr: *mut snd_htimestamp_t); + pub fn snd_rawmidi_status_copy( + dst: *mut snd_rawmidi_status_t, + src: *const snd_rawmidi_status_t, + ); + pub fn snd_rawmidi_status_get_tstamp( + obj: *const snd_rawmidi_status_t, + ptr: *mut snd_htimestamp_t, + ); pub fn snd_rawmidi_status_get_avail(obj: *const snd_rawmidi_status_t) -> size_t; pub fn snd_rawmidi_status_get_xruns(obj: *const snd_rawmidi_status_t) -> size_t; - pub fn snd_rawmidi_status(rmidi: *mut snd_rawmidi_t, status: *mut snd_rawmidi_status_t) -> c_int; + pub fn snd_rawmidi_status( + rmidi: *mut snd_rawmidi_t, + status: *mut snd_rawmidi_status_t, + ) -> c_int; pub fn snd_rawmidi_drain(rmidi: *mut snd_rawmidi_t) -> c_int; pub fn snd_rawmidi_drop(rmidi: *mut snd_rawmidi_t) -> c_int; - pub fn snd_rawmidi_write(rmidi: *mut snd_rawmidi_t, buffer: *const c_void, size: size_t) -> ssize_t; - pub fn snd_rawmidi_read(rmidi: *mut snd_rawmidi_t, buffer: *mut c_void, size: size_t) -> ssize_t; + pub fn snd_rawmidi_write( + rmidi: *mut snd_rawmidi_t, + buffer: *const c_void, + size: size_t, + ) -> ssize_t; + pub fn snd_rawmidi_read( + rmidi: *mut snd_rawmidi_t, + buffer: *mut c_void, + size: size_t, + ) -> ssize_t; pub fn snd_rawmidi_name(rmidi: *mut snd_rawmidi_t) -> *const c_char; pub fn snd_rawmidi_type(rmidi: *mut snd_rawmidi_t) -> snd_rawmidi_type_t; pub fn snd_rawmidi_stream(rawmidi: *mut snd_rawmidi_t) -> snd_rawmidi_stream_t; - pub fn snd_timer_query_open(handle: *mut *mut snd_timer_query_t, name: *const c_char, mode: c_int) -> c_int; - pub fn snd_timer_query_open_lconf(handle: *mut *mut snd_timer_query_t, name: *const c_char, mode: c_int, lconf: *mut snd_config_t) -> c_int; + pub fn snd_timer_query_open( + handle: *mut *mut snd_timer_query_t, + name: *const c_char, + mode: c_int, + ) -> c_int; + pub fn snd_timer_query_open_lconf( + handle: *mut *mut snd_timer_query_t, + name: *const c_char, + mode: c_int, + lconf: *mut snd_config_t, + ) -> c_int; pub fn snd_timer_query_close(handle: *mut snd_timer_query_t) -> c_int; - pub fn snd_timer_query_next_device(handle: *mut snd_timer_query_t, tid: *mut snd_timer_id_t) -> c_int; - pub fn snd_timer_query_info(handle: *mut snd_timer_query_t, info: *mut snd_timer_ginfo_t) -> c_int; - pub fn snd_timer_query_params(handle: *mut snd_timer_query_t, params: *mut snd_timer_gparams_t) -> c_int; - pub fn snd_timer_query_status(handle: *mut snd_timer_query_t, status: *mut snd_timer_gstatus_t) -> c_int; - pub fn snd_timer_open(handle: *mut *mut snd_timer_t, name: *const c_char, mode: c_int) -> c_int; - pub fn snd_timer_open_lconf(handle: *mut *mut snd_timer_t, name: *const c_char, mode: c_int, lconf: *mut snd_config_t) -> c_int; + pub fn snd_timer_query_next_device( + handle: *mut snd_timer_query_t, + tid: *mut snd_timer_id_t, + ) -> c_int; + pub fn snd_timer_query_info( + handle: *mut snd_timer_query_t, + info: *mut snd_timer_ginfo_t, + ) -> c_int; + pub fn snd_timer_query_params( + handle: *mut snd_timer_query_t, + params: *mut snd_timer_gparams_t, + ) -> c_int; + pub fn snd_timer_query_status( + handle: *mut snd_timer_query_t, + status: *mut snd_timer_gstatus_t, + ) -> c_int; + pub fn snd_timer_open(handle: *mut *mut snd_timer_t, name: *const c_char, mode: c_int) + -> c_int; + pub fn snd_timer_open_lconf( + handle: *mut *mut snd_timer_t, + name: *const c_char, + mode: c_int, + lconf: *mut snd_config_t, + ) -> c_int; pub fn snd_timer_close(handle: *mut snd_timer_t) -> c_int; - pub fn snd_async_add_timer_handler(handler: *mut *mut snd_async_handler_t, timer: *mut snd_timer_t, callback: snd_async_callback_t, private_data: *mut c_void) -> c_int; + pub fn snd_async_add_timer_handler( + handler: *mut *mut snd_async_handler_t, + timer: *mut snd_timer_t, + callback: snd_async_callback_t, + private_data: *mut c_void, + ) -> c_int; pub fn snd_async_handler_get_timer(handler: *mut snd_async_handler_t) -> *mut snd_timer_t; pub fn snd_timer_poll_descriptors_count(handle: *mut snd_timer_t) -> c_int; - pub fn snd_timer_poll_descriptors(handle: *mut snd_timer_t, pfds: *mut pollfd, space: c_uint) -> c_int; - pub fn snd_timer_poll_descriptors_revents(timer: *mut snd_timer_t, pfds: *mut pollfd, nfds: c_uint, revents: *mut c_ushort) -> c_int; + pub fn snd_timer_poll_descriptors( + handle: *mut snd_timer_t, + pfds: *mut pollfd, + space: c_uint, + ) -> c_int; + pub fn snd_timer_poll_descriptors_revents( + timer: *mut snd_timer_t, + pfds: *mut pollfd, + nfds: c_uint, + revents: *mut c_ushort, + ) -> c_int; pub fn snd_timer_info(handle: *mut snd_timer_t, timer: *mut snd_timer_info_t) -> c_int; pub fn snd_timer_params(handle: *mut snd_timer_t, params: *mut snd_timer_params_t) -> c_int; pub fn snd_timer_status(handle: *mut snd_timer_t, status: *mut snd_timer_status_t) -> c_int; @@ -1436,11 +2459,20 @@ extern "C" { pub fn snd_timer_params_malloc(ptr: *mut *mut snd_timer_params_t) -> c_int; pub fn snd_timer_params_free(obj: *mut snd_timer_params_t); pub fn snd_timer_params_copy(dst: *mut snd_timer_params_t, src: *const snd_timer_params_t); - pub fn snd_timer_params_set_auto_start(params: *mut snd_timer_params_t, auto_start: c_int) -> c_int; + pub fn snd_timer_params_set_auto_start( + params: *mut snd_timer_params_t, + auto_start: c_int, + ) -> c_int; pub fn snd_timer_params_get_auto_start(params: *mut snd_timer_params_t) -> c_int; - pub fn snd_timer_params_set_exclusive(params: *mut snd_timer_params_t, exclusive: c_int) -> c_int; + pub fn snd_timer_params_set_exclusive( + params: *mut snd_timer_params_t, + exclusive: c_int, + ) -> c_int; pub fn snd_timer_params_get_exclusive(params: *mut snd_timer_params_t) -> c_int; - pub fn snd_timer_params_set_early_event(params: *mut snd_timer_params_t, early_event: c_int) -> c_int; + pub fn snd_timer_params_set_early_event( + params: *mut snd_timer_params_t, + early_event: c_int, + ) -> c_int; pub fn snd_timer_params_get_early_event(params: *mut snd_timer_params_t) -> c_int; pub fn snd_timer_params_set_ticks(params: *mut snd_timer_params_t, ticks: c_long); pub fn snd_timer_params_get_ticks(params: *mut snd_timer_params_t) -> c_long; @@ -1460,14 +2492,27 @@ extern "C" { pub fn snd_timer_info_get_ticks(info: *mut snd_timer_info_t) -> c_long; pub fn snd_hwdep_open(hwdep: *mut *mut snd_hwdep_t, name: *const c_char, mode: c_int) -> c_int; pub fn snd_hwdep_close(hwdep: *mut snd_hwdep_t) -> c_int; - pub fn snd_hwdep_poll_descriptors(hwdep: *mut snd_hwdep_t, pfds: *mut pollfd, space: c_uint) -> c_int; - pub fn snd_hwdep_poll_descriptors_revents(hwdep: *mut snd_hwdep_t, pfds: *mut pollfd, nfds: c_uint, revents: *mut c_ushort) -> c_int; + pub fn snd_hwdep_poll_descriptors( + hwdep: *mut snd_hwdep_t, + pfds: *mut pollfd, + space: c_uint, + ) -> c_int; + pub fn snd_hwdep_poll_descriptors_revents( + hwdep: *mut snd_hwdep_t, + pfds: *mut pollfd, + nfds: c_uint, + revents: *mut c_ushort, + ) -> c_int; pub fn snd_hwdep_nonblock(hwdep: *mut snd_hwdep_t, nonblock: c_int) -> c_int; pub fn snd_hwdep_info(hwdep: *mut snd_hwdep_t, info: *mut snd_hwdep_info_t) -> c_int; - pub fn snd_hwdep_dsp_status(hwdep: *mut snd_hwdep_t, status: *mut snd_hwdep_dsp_status_t) -> c_int; + pub fn snd_hwdep_dsp_status( + hwdep: *mut snd_hwdep_t, + status: *mut snd_hwdep_dsp_status_t, + ) -> c_int; pub fn snd_hwdep_dsp_load(hwdep: *mut snd_hwdep_t, block: *mut snd_hwdep_dsp_image_t) -> c_int; pub fn snd_hwdep_ioctl(hwdep: *mut snd_hwdep_t, request: c_uint, arg: *mut c_void) -> c_int; - pub fn snd_hwdep_write(hwdep: *mut snd_hwdep_t, buffer: *const c_void, size: size_t) -> ssize_t; + pub fn snd_hwdep_write(hwdep: *mut snd_hwdep_t, buffer: *const c_void, size: size_t) + -> ssize_t; pub fn snd_hwdep_read(hwdep: *mut snd_hwdep_t, buffer: *mut c_void, size: size_t) -> ssize_t; pub fn snd_hwdep_info_sizeof() -> size_t; pub fn snd_hwdep_info_malloc(ptr: *mut *mut snd_hwdep_info_t) -> c_int; @@ -1482,7 +2527,10 @@ extern "C" { pub fn snd_hwdep_dsp_status_sizeof() -> size_t; pub fn snd_hwdep_dsp_status_malloc(ptr: *mut *mut snd_hwdep_dsp_status_t) -> c_int; pub fn snd_hwdep_dsp_status_free(obj: *mut snd_hwdep_dsp_status_t); - pub fn snd_hwdep_dsp_status_copy(dst: *mut snd_hwdep_dsp_status_t, src: *const snd_hwdep_dsp_status_t); + pub fn snd_hwdep_dsp_status_copy( + dst: *mut snd_hwdep_dsp_status_t, + src: *const snd_hwdep_dsp_status_t, + ); pub fn snd_hwdep_dsp_status_get_version(obj: *const snd_hwdep_dsp_status_t) -> c_uint; pub fn snd_hwdep_dsp_status_get_id(obj: *const snd_hwdep_dsp_status_t) -> *const c_char; pub fn snd_hwdep_dsp_status_get_num_dsps(obj: *const snd_hwdep_dsp_status_t) -> c_uint; @@ -1491,7 +2539,10 @@ extern "C" { pub fn snd_hwdep_dsp_image_sizeof() -> size_t; pub fn snd_hwdep_dsp_image_malloc(ptr: *mut *mut snd_hwdep_dsp_image_t) -> c_int; pub fn snd_hwdep_dsp_image_free(obj: *mut snd_hwdep_dsp_image_t); - pub fn snd_hwdep_dsp_image_copy(dst: *mut snd_hwdep_dsp_image_t, src: *const snd_hwdep_dsp_image_t); + pub fn snd_hwdep_dsp_image_copy( + dst: *mut snd_hwdep_dsp_image_t, + src: *const snd_hwdep_dsp_image_t, + ); pub fn snd_hwdep_dsp_image_get_index(obj: *const snd_hwdep_dsp_image_t) -> c_uint; pub fn snd_hwdep_dsp_image_get_name(obj: *const snd_hwdep_dsp_image_t) -> *const c_char; pub fn snd_hwdep_dsp_image_get_image(obj: *const snd_hwdep_dsp_image_t) -> *const c_void; @@ -1505,19 +2556,45 @@ extern "C" { pub fn snd_card_get_index(name: *const c_char) -> c_int; pub fn snd_card_get_name(card: c_int, name: *mut *mut c_char) -> c_int; pub fn snd_card_get_longname(card: c_int, name: *mut *mut c_char) -> c_int; - pub fn snd_device_name_hint(card: c_int, iface: *const c_char, hints: *mut *mut *mut c_void) -> c_int; + pub fn snd_device_name_hint( + card: c_int, + iface: *const c_char, + hints: *mut *mut *mut c_void, + ) -> c_int; pub fn snd_device_name_free_hint(hints: *mut *mut c_void) -> c_int; pub fn snd_device_name_get_hint(hint: *const c_void, id: *const c_char) -> *mut c_char; pub fn snd_ctl_open(ctl: *mut *mut snd_ctl_t, name: *const c_char, mode: c_int) -> c_int; - pub fn snd_ctl_open_lconf(ctl: *mut *mut snd_ctl_t, name: *const c_char, mode: c_int, lconf: *mut snd_config_t) -> c_int; - pub fn snd_ctl_open_fallback(ctl: *mut *mut snd_ctl_t, root: *mut snd_config_t, name: *const c_char, orig_name: *const c_char, mode: c_int) -> c_int; + pub fn snd_ctl_open_lconf( + ctl: *mut *mut snd_ctl_t, + name: *const c_char, + mode: c_int, + lconf: *mut snd_config_t, + ) -> c_int; + pub fn snd_ctl_open_fallback( + ctl: *mut *mut snd_ctl_t, + root: *mut snd_config_t, + name: *const c_char, + orig_name: *const c_char, + mode: c_int, + ) -> c_int; pub fn snd_ctl_close(ctl: *mut snd_ctl_t) -> c_int; pub fn snd_ctl_nonblock(ctl: *mut snd_ctl_t, nonblock: c_int) -> c_int; - pub fn snd_async_add_ctl_handler(handler: *mut *mut snd_async_handler_t, ctl: *mut snd_ctl_t, callback: snd_async_callback_t, private_data: *mut c_void) -> c_int; + pub fn snd_async_add_ctl_handler( + handler: *mut *mut snd_async_handler_t, + ctl: *mut snd_ctl_t, + callback: snd_async_callback_t, + private_data: *mut c_void, + ) -> c_int; pub fn snd_async_handler_get_ctl(handler: *mut snd_async_handler_t) -> *mut snd_ctl_t; pub fn snd_ctl_poll_descriptors_count(ctl: *mut snd_ctl_t) -> c_int; - pub fn snd_ctl_poll_descriptors(ctl: *mut snd_ctl_t, pfds: *mut pollfd, space: c_uint) -> c_int; - pub fn snd_ctl_poll_descriptors_revents(ctl: *mut snd_ctl_t, pfds: *mut pollfd, nfds: c_uint, revents: *mut c_ushort) -> c_int; + pub fn snd_ctl_poll_descriptors(ctl: *mut snd_ctl_t, pfds: *mut pollfd, space: c_uint) + -> c_int; + pub fn snd_ctl_poll_descriptors_revents( + ctl: *mut snd_ctl_t, + pfds: *mut pollfd, + nfds: c_uint, + revents: *mut c_ushort, + ) -> c_int; pub fn snd_ctl_subscribe_events(ctl: *mut snd_ctl_t, subscribe: c_int) -> c_int; pub fn snd_ctl_card_info(ctl: *mut snd_ctl_t, info: *mut snd_ctl_card_info_t) -> c_int; pub fn snd_ctl_elem_list(ctl: *mut snd_ctl_t, list: *mut snd_ctl_elem_list_t) -> c_int; @@ -1526,9 +2603,22 @@ extern "C" { pub fn snd_ctl_elem_write(ctl: *mut snd_ctl_t, value: *mut snd_ctl_elem_value_t) -> c_int; pub fn snd_ctl_elem_lock(ctl: *mut snd_ctl_t, id: *mut snd_ctl_elem_id_t) -> c_int; pub fn snd_ctl_elem_unlock(ctl: *mut snd_ctl_t, id: *mut snd_ctl_elem_id_t) -> c_int; - pub fn snd_ctl_elem_tlv_read(ctl: *mut snd_ctl_t, id: *const snd_ctl_elem_id_t, tlv: *mut c_uint, tlv_size: c_uint) -> c_int; - pub fn snd_ctl_elem_tlv_write(ctl: *mut snd_ctl_t, id: *const snd_ctl_elem_id_t, tlv: *const c_uint) -> c_int; - pub fn snd_ctl_elem_tlv_command(ctl: *mut snd_ctl_t, id: *const snd_ctl_elem_id_t, tlv: *const c_uint) -> c_int; + pub fn snd_ctl_elem_tlv_read( + ctl: *mut snd_ctl_t, + id: *const snd_ctl_elem_id_t, + tlv: *mut c_uint, + tlv_size: c_uint, + ) -> c_int; + pub fn snd_ctl_elem_tlv_write( + ctl: *mut snd_ctl_t, + id: *const snd_ctl_elem_id_t, + tlv: *const c_uint, + ) -> c_int; + pub fn snd_ctl_elem_tlv_command( + ctl: *mut snd_ctl_t, + id: *const snd_ctl_elem_id_t, + tlv: *const c_uint, + ) -> c_int; pub fn snd_ctl_hwdep_next_device(ctl: *mut snd_ctl_t, device: *mut c_int) -> c_int; pub fn snd_ctl_hwdep_info(ctl: *mut snd_ctl_t, info: *mut snd_hwdep_info_t) -> c_int; pub fn snd_ctl_pcm_next_device(ctl: *mut snd_ctl_t, device: *mut c_int) -> c_int; @@ -1558,7 +2648,12 @@ extern "C" { pub fn snd_ctl_elem_list_free_space(obj: *mut snd_ctl_elem_list_t); pub fn snd_ctl_ascii_elem_id_get(id: *mut snd_ctl_elem_id_t) -> *mut c_char; pub fn snd_ctl_ascii_elem_id_parse(dst: *mut snd_ctl_elem_id_t, str: *const c_char) -> c_int; - pub fn snd_ctl_ascii_value_parse(handle: *mut snd_ctl_t, dst: *mut snd_ctl_elem_value_t, info: *mut snd_ctl_elem_info_t, value: *const c_char) -> c_int; + pub fn snd_ctl_ascii_value_parse( + handle: *mut snd_ctl_t, + dst: *mut snd_ctl_elem_value_t, + info: *mut snd_ctl_elem_info_t, + value: *const c_char, + ) -> c_int; pub fn snd_ctl_elem_id_sizeof() -> size_t; pub fn snd_ctl_elem_id_malloc(ptr: *mut *mut snd_ctl_elem_id_t) -> c_int; pub fn snd_ctl_elem_id_free(obj: *mut snd_ctl_elem_id_t); @@ -1602,12 +2697,22 @@ extern "C" { pub fn snd_ctl_elem_list_set_offset(obj: *mut snd_ctl_elem_list_t, val: c_uint); pub fn snd_ctl_elem_list_get_used(obj: *const snd_ctl_elem_list_t) -> c_uint; pub fn snd_ctl_elem_list_get_count(obj: *const snd_ctl_elem_list_t) -> c_uint; - pub fn snd_ctl_elem_list_get_id(obj: *const snd_ctl_elem_list_t, idx: c_uint, ptr: *mut snd_ctl_elem_id_t); + pub fn snd_ctl_elem_list_get_id( + obj: *const snd_ctl_elem_list_t, + idx: c_uint, + ptr: *mut snd_ctl_elem_id_t, + ); pub fn snd_ctl_elem_list_get_numid(obj: *const snd_ctl_elem_list_t, idx: c_uint) -> c_uint; - pub fn snd_ctl_elem_list_get_interface(obj: *const snd_ctl_elem_list_t, idx: c_uint) -> snd_ctl_elem_iface_t; + pub fn snd_ctl_elem_list_get_interface( + obj: *const snd_ctl_elem_list_t, + idx: c_uint, + ) -> snd_ctl_elem_iface_t; pub fn snd_ctl_elem_list_get_device(obj: *const snd_ctl_elem_list_t, idx: c_uint) -> c_uint; pub fn snd_ctl_elem_list_get_subdevice(obj: *const snd_ctl_elem_list_t, idx: c_uint) -> c_uint; - pub fn snd_ctl_elem_list_get_name(obj: *const snd_ctl_elem_list_t, idx: c_uint) -> *const c_char; + pub fn snd_ctl_elem_list_get_name( + obj: *const snd_ctl_elem_list_t, + idx: c_uint, + ) -> *const c_char; pub fn snd_ctl_elem_list_get_index(obj: *const snd_ctl_elem_list_t, idx: c_uint) -> c_uint; pub fn snd_ctl_elem_info_sizeof() -> size_t; pub fn snd_ctl_elem_info_malloc(ptr: *mut *mut snd_ctl_elem_info_t) -> c_int; @@ -1640,78 +2745,188 @@ extern "C" { pub fn snd_ctl_elem_info_get_dimension(obj: *const snd_ctl_elem_info_t, idx: c_uint) -> c_int; pub fn snd_ctl_elem_info_get_id(obj: *const snd_ctl_elem_info_t, ptr: *mut snd_ctl_elem_id_t); pub fn snd_ctl_elem_info_get_numid(obj: *const snd_ctl_elem_info_t) -> c_uint; - pub fn snd_ctl_elem_info_get_interface(obj: *const snd_ctl_elem_info_t) -> snd_ctl_elem_iface_t; + pub fn snd_ctl_elem_info_get_interface(obj: *const snd_ctl_elem_info_t) + -> snd_ctl_elem_iface_t; pub fn snd_ctl_elem_info_get_device(obj: *const snd_ctl_elem_info_t) -> c_uint; pub fn snd_ctl_elem_info_get_subdevice(obj: *const snd_ctl_elem_info_t) -> c_uint; pub fn snd_ctl_elem_info_get_name(obj: *const snd_ctl_elem_info_t) -> *const c_char; pub fn snd_ctl_elem_info_get_index(obj: *const snd_ctl_elem_info_t) -> c_uint; pub fn snd_ctl_elem_info_set_id(obj: *mut snd_ctl_elem_info_t, ptr: *const snd_ctl_elem_id_t); pub fn snd_ctl_elem_info_set_numid(obj: *mut snd_ctl_elem_info_t, val: c_uint); - pub fn snd_ctl_elem_info_set_interface(obj: *mut snd_ctl_elem_info_t, val: snd_ctl_elem_iface_t); + pub fn snd_ctl_elem_info_set_interface( + obj: *mut snd_ctl_elem_info_t, + val: snd_ctl_elem_iface_t, + ); pub fn snd_ctl_elem_info_set_device(obj: *mut snd_ctl_elem_info_t, val: c_uint); pub fn snd_ctl_elem_info_set_subdevice(obj: *mut snd_ctl_elem_info_t, val: c_uint); pub fn snd_ctl_elem_info_set_name(obj: *mut snd_ctl_elem_info_t, val: *const c_char); pub fn snd_ctl_elem_info_set_index(obj: *mut snd_ctl_elem_info_t, val: c_uint); - pub fn snd_ctl_elem_add_integer(ctl: *mut snd_ctl_t, id: *const snd_ctl_elem_id_t, count: c_uint, imin: c_long, imax: c_long, istep: c_long) -> c_int; - pub fn snd_ctl_elem_add_integer64(ctl: *mut snd_ctl_t, id: *const snd_ctl_elem_id_t, count: c_uint, imin: c_longlong, imax: c_longlong, istep: c_longlong) -> c_int; - pub fn snd_ctl_elem_add_boolean(ctl: *mut snd_ctl_t, id: *const snd_ctl_elem_id_t, count: c_uint) -> c_int; - pub fn snd_ctl_elem_add_enumerated(ctl: *mut snd_ctl_t, id: *const snd_ctl_elem_id_t, count: c_uint, items: c_uint, names: *const *const c_char) -> c_int; + pub fn snd_ctl_elem_add_integer( + ctl: *mut snd_ctl_t, + id: *const snd_ctl_elem_id_t, + count: c_uint, + imin: c_long, + imax: c_long, + istep: c_long, + ) -> c_int; + pub fn snd_ctl_elem_add_integer64( + ctl: *mut snd_ctl_t, + id: *const snd_ctl_elem_id_t, + count: c_uint, + imin: c_longlong, + imax: c_longlong, + istep: c_longlong, + ) -> c_int; + pub fn snd_ctl_elem_add_boolean( + ctl: *mut snd_ctl_t, + id: *const snd_ctl_elem_id_t, + count: c_uint, + ) -> c_int; + pub fn snd_ctl_elem_add_enumerated( + ctl: *mut snd_ctl_t, + id: *const snd_ctl_elem_id_t, + count: c_uint, + items: c_uint, + names: *const *const c_char, + ) -> c_int; pub fn snd_ctl_elem_add_iec958(ctl: *mut snd_ctl_t, id: *const snd_ctl_elem_id_t) -> c_int; pub fn snd_ctl_elem_remove(ctl: *mut snd_ctl_t, id: *mut snd_ctl_elem_id_t) -> c_int; pub fn snd_ctl_elem_value_sizeof() -> size_t; pub fn snd_ctl_elem_value_malloc(ptr: *mut *mut snd_ctl_elem_value_t) -> c_int; pub fn snd_ctl_elem_value_free(obj: *mut snd_ctl_elem_value_t); pub fn snd_ctl_elem_value_clear(obj: *mut snd_ctl_elem_value_t); - pub fn snd_ctl_elem_value_copy(dst: *mut snd_ctl_elem_value_t, src: *const snd_ctl_elem_value_t); - pub fn snd_ctl_elem_value_compare(left: *mut snd_ctl_elem_value_t, right: *const snd_ctl_elem_value_t) -> c_int; + pub fn snd_ctl_elem_value_copy( + dst: *mut snd_ctl_elem_value_t, + src: *const snd_ctl_elem_value_t, + ); + pub fn snd_ctl_elem_value_compare( + left: *mut snd_ctl_elem_value_t, + right: *const snd_ctl_elem_value_t, + ) -> c_int; pub fn snd_ctl_elem_value_get_id(obj: *const snd_ctl_elem_value_t, ptr: *mut snd_ctl_elem_id_t); pub fn snd_ctl_elem_value_get_numid(obj: *const snd_ctl_elem_value_t) -> c_uint; - pub fn snd_ctl_elem_value_get_interface(obj: *const snd_ctl_elem_value_t) -> snd_ctl_elem_iface_t; + pub fn snd_ctl_elem_value_get_interface( + obj: *const snd_ctl_elem_value_t, + ) -> snd_ctl_elem_iface_t; pub fn snd_ctl_elem_value_get_device(obj: *const snd_ctl_elem_value_t) -> c_uint; pub fn snd_ctl_elem_value_get_subdevice(obj: *const snd_ctl_elem_value_t) -> c_uint; pub fn snd_ctl_elem_value_get_name(obj: *const snd_ctl_elem_value_t) -> *const c_char; pub fn snd_ctl_elem_value_get_index(obj: *const snd_ctl_elem_value_t) -> c_uint; pub fn snd_ctl_elem_value_set_id(obj: *mut snd_ctl_elem_value_t, ptr: *const snd_ctl_elem_id_t); pub fn snd_ctl_elem_value_set_numid(obj: *mut snd_ctl_elem_value_t, val: c_uint); - pub fn snd_ctl_elem_value_set_interface(obj: *mut snd_ctl_elem_value_t, val: snd_ctl_elem_iface_t); + pub fn snd_ctl_elem_value_set_interface( + obj: *mut snd_ctl_elem_value_t, + val: snd_ctl_elem_iface_t, + ); pub fn snd_ctl_elem_value_set_device(obj: *mut snd_ctl_elem_value_t, val: c_uint); pub fn snd_ctl_elem_value_set_subdevice(obj: *mut snd_ctl_elem_value_t, val: c_uint); pub fn snd_ctl_elem_value_set_name(obj: *mut snd_ctl_elem_value_t, val: *const c_char); pub fn snd_ctl_elem_value_set_index(obj: *mut snd_ctl_elem_value_t, val: c_uint); pub fn snd_ctl_elem_value_get_boolean(obj: *const snd_ctl_elem_value_t, idx: c_uint) -> c_int; pub fn snd_ctl_elem_value_get_integer(obj: *const snd_ctl_elem_value_t, idx: c_uint) -> c_long; - pub fn snd_ctl_elem_value_get_integer64(obj: *const snd_ctl_elem_value_t, idx: c_uint) -> c_longlong; - pub fn snd_ctl_elem_value_get_enumerated(obj: *const snd_ctl_elem_value_t, idx: c_uint) -> c_uint; + pub fn snd_ctl_elem_value_get_integer64( + obj: *const snd_ctl_elem_value_t, + idx: c_uint, + ) -> c_longlong; + pub fn snd_ctl_elem_value_get_enumerated( + obj: *const snd_ctl_elem_value_t, + idx: c_uint, + ) -> c_uint; pub fn snd_ctl_elem_value_get_byte(obj: *const snd_ctl_elem_value_t, idx: c_uint) -> c_uchar; pub fn snd_ctl_elem_value_set_boolean(obj: *mut snd_ctl_elem_value_t, idx: c_uint, val: c_long); pub fn snd_ctl_elem_value_set_integer(obj: *mut snd_ctl_elem_value_t, idx: c_uint, val: c_long); - pub fn snd_ctl_elem_value_set_integer64(obj: *mut snd_ctl_elem_value_t, idx: c_uint, val: c_longlong); - pub fn snd_ctl_elem_value_set_enumerated(obj: *mut snd_ctl_elem_value_t, idx: c_uint, val: c_uint); + pub fn snd_ctl_elem_value_set_integer64( + obj: *mut snd_ctl_elem_value_t, + idx: c_uint, + val: c_longlong, + ); + pub fn snd_ctl_elem_value_set_enumerated( + obj: *mut snd_ctl_elem_value_t, + idx: c_uint, + val: c_uint, + ); pub fn snd_ctl_elem_value_set_byte(obj: *mut snd_ctl_elem_value_t, idx: c_uint, val: c_uchar); pub fn snd_ctl_elem_set_bytes(obj: *mut snd_ctl_elem_value_t, data: *mut c_void, size: size_t); pub fn snd_ctl_elem_value_get_bytes(obj: *const snd_ctl_elem_value_t) -> *const c_void; - pub fn snd_ctl_elem_value_get_iec958(obj: *const snd_ctl_elem_value_t, ptr: *mut snd_aes_iec958_t); - pub fn snd_ctl_elem_value_set_iec958(obj: *mut snd_ctl_elem_value_t, ptr: *const snd_aes_iec958_t); - pub fn snd_tlv_parse_dB_info(tlv: *mut c_uint, tlv_size: c_uint, db_tlvp: *mut *mut c_uint) -> c_int; - pub fn snd_tlv_get_dB_range(tlv: *mut c_uint, rangemin: c_long, rangemax: c_long, min: *mut c_long, max: *mut c_long) -> c_int; - pub fn snd_tlv_convert_to_dB(tlv: *mut c_uint, rangemin: c_long, rangemax: c_long, volume: c_long, db_gain: *mut c_long) -> c_int; - pub fn snd_tlv_convert_from_dB(tlv: *mut c_uint, rangemin: c_long, rangemax: c_long, db_gain: c_long, value: *mut c_long, xdir: c_int) -> c_int; - pub fn snd_ctl_get_dB_range(ctl: *mut snd_ctl_t, id: *const snd_ctl_elem_id_t, min: *mut c_long, max: *mut c_long) -> c_int; - pub fn snd_ctl_convert_to_dB(ctl: *mut snd_ctl_t, id: *const snd_ctl_elem_id_t, volume: c_long, db_gain: *mut c_long) -> c_int; - pub fn snd_ctl_convert_from_dB(ctl: *mut snd_ctl_t, id: *const snd_ctl_elem_id_t, db_gain: c_long, value: *mut c_long, xdir: c_int) -> c_int; + pub fn snd_ctl_elem_value_get_iec958( + obj: *const snd_ctl_elem_value_t, + ptr: *mut snd_aes_iec958_t, + ); + pub fn snd_ctl_elem_value_set_iec958( + obj: *mut snd_ctl_elem_value_t, + ptr: *const snd_aes_iec958_t, + ); + pub fn snd_tlv_parse_dB_info( + tlv: *mut c_uint, + tlv_size: c_uint, + db_tlvp: *mut *mut c_uint, + ) -> c_int; + pub fn snd_tlv_get_dB_range( + tlv: *mut c_uint, + rangemin: c_long, + rangemax: c_long, + min: *mut c_long, + max: *mut c_long, + ) -> c_int; + pub fn snd_tlv_convert_to_dB( + tlv: *mut c_uint, + rangemin: c_long, + rangemax: c_long, + volume: c_long, + db_gain: *mut c_long, + ) -> c_int; + pub fn snd_tlv_convert_from_dB( + tlv: *mut c_uint, + rangemin: c_long, + rangemax: c_long, + db_gain: c_long, + value: *mut c_long, + xdir: c_int, + ) -> c_int; + pub fn snd_ctl_get_dB_range( + ctl: *mut snd_ctl_t, + id: *const snd_ctl_elem_id_t, + min: *mut c_long, + max: *mut c_long, + ) -> c_int; + pub fn snd_ctl_convert_to_dB( + ctl: *mut snd_ctl_t, + id: *const snd_ctl_elem_id_t, + volume: c_long, + db_gain: *mut c_long, + ) -> c_int; + pub fn snd_ctl_convert_from_dB( + ctl: *mut snd_ctl_t, + id: *const snd_ctl_elem_id_t, + db_gain: c_long, + value: *mut c_long, + xdir: c_int, + ) -> c_int; pub fn snd_hctl_compare_fast(c1: *const snd_hctl_elem_t, c2: *const snd_hctl_elem_t) -> c_int; pub fn snd_hctl_open(hctl: *mut *mut snd_hctl_t, name: *const c_char, mode: c_int) -> c_int; pub fn snd_hctl_open_ctl(hctlp: *mut *mut snd_hctl_t, ctl: *mut snd_ctl_t) -> c_int; pub fn snd_hctl_close(hctl: *mut snd_hctl_t) -> c_int; pub fn snd_hctl_nonblock(hctl: *mut snd_hctl_t, nonblock: c_int) -> c_int; pub fn snd_hctl_poll_descriptors_count(hctl: *mut snd_hctl_t) -> c_int; - pub fn snd_hctl_poll_descriptors(hctl: *mut snd_hctl_t, pfds: *mut pollfd, space: c_uint) -> c_int; - pub fn snd_hctl_poll_descriptors_revents(ctl: *mut snd_hctl_t, pfds: *mut pollfd, nfds: c_uint, revents: *mut c_ushort) -> c_int; + pub fn snd_hctl_poll_descriptors( + hctl: *mut snd_hctl_t, + pfds: *mut pollfd, + space: c_uint, + ) -> c_int; + pub fn snd_hctl_poll_descriptors_revents( + ctl: *mut snd_hctl_t, + pfds: *mut pollfd, + nfds: c_uint, + revents: *mut c_ushort, + ) -> c_int; pub fn snd_hctl_get_count(hctl: *mut snd_hctl_t) -> c_uint; pub fn snd_hctl_set_compare(hctl: *mut snd_hctl_t, hsort: snd_hctl_compare_t) -> c_int; pub fn snd_hctl_first_elem(hctl: *mut snd_hctl_t) -> *mut snd_hctl_elem_t; pub fn snd_hctl_last_elem(hctl: *mut snd_hctl_t) -> *mut snd_hctl_elem_t; - pub fn snd_hctl_find_elem(hctl: *mut snd_hctl_t, id: *const snd_ctl_elem_id_t) -> *mut snd_hctl_elem_t; + pub fn snd_hctl_find_elem( + hctl: *mut snd_hctl_t, + id: *const snd_ctl_elem_id_t, + ) -> *mut snd_hctl_elem_t; pub fn snd_hctl_set_callback(hctl: *mut snd_hctl_t, callback: snd_hctl_callback_t); pub fn snd_hctl_set_callback_private(hctl: *mut snd_hctl_t, data: *mut c_void); pub fn snd_hctl_get_callback_private(hctl: *mut snd_hctl_t) -> *mut c_void; @@ -1724,9 +2939,19 @@ extern "C" { pub fn snd_hctl_elem_next(elem: *mut snd_hctl_elem_t) -> *mut snd_hctl_elem_t; pub fn snd_hctl_elem_prev(elem: *mut snd_hctl_elem_t) -> *mut snd_hctl_elem_t; pub fn snd_hctl_elem_info(elem: *mut snd_hctl_elem_t, info: *mut snd_ctl_elem_info_t) -> c_int; - pub fn snd_hctl_elem_read(elem: *mut snd_hctl_elem_t, value: *mut snd_ctl_elem_value_t) -> c_int; - pub fn snd_hctl_elem_write(elem: *mut snd_hctl_elem_t, value: *mut snd_ctl_elem_value_t) -> c_int; - pub fn snd_hctl_elem_tlv_read(elem: *mut snd_hctl_elem_t, tlv: *mut c_uint, tlv_size: c_uint) -> c_int; + pub fn snd_hctl_elem_read( + elem: *mut snd_hctl_elem_t, + value: *mut snd_ctl_elem_value_t, + ) -> c_int; + pub fn snd_hctl_elem_write( + elem: *mut snd_hctl_elem_t, + value: *mut snd_ctl_elem_value_t, + ) -> c_int; + pub fn snd_hctl_elem_tlv_read( + elem: *mut snd_hctl_elem_t, + tlv: *mut c_uint, + tlv_size: c_uint, + ) -> c_int; pub fn snd_hctl_elem_tlv_write(elem: *mut snd_hctl_elem_t, tlv: *const c_uint) -> c_int; pub fn snd_hctl_elem_tlv_command(elem: *mut snd_hctl_elem_t, tlv: *const c_uint) -> c_int; pub fn snd_hctl_elem_get_hctl(elem: *mut snd_hctl_elem_t) -> *mut snd_hctl_t; @@ -1740,7 +2965,13 @@ extern "C" { pub fn snd_hctl_elem_set_callback(obj: *mut snd_hctl_elem_t, val: snd_hctl_elem_callback_t); pub fn snd_hctl_elem_get_callback_private(obj: *const snd_hctl_elem_t) -> *mut c_void; pub fn snd_hctl_elem_set_callback_private(obj: *mut snd_hctl_elem_t, val: *mut c_void); - pub fn snd_sctl_build(ctl: *mut *mut snd_sctl_t, handle: *mut snd_ctl_t, config: *mut snd_config_t, private_data: *mut snd_config_t, mode: c_int) -> c_int; + pub fn snd_sctl_build( + ctl: *mut *mut snd_sctl_t, + handle: *mut snd_ctl_t, + config: *mut snd_config_t, + private_data: *mut snd_config_t, + mode: c_int, + ) -> c_int; pub fn snd_sctl_free(handle: *mut snd_sctl_t) -> c_int; pub fn snd_sctl_install(handle: *mut snd_sctl_t) -> c_int; pub fn snd_sctl_remove(handle: *mut snd_sctl_t) -> c_int; @@ -1753,10 +2984,23 @@ extern "C" { pub fn snd_mixer_attach_hctl(mixer: *mut snd_mixer_t, hctl: *mut snd_hctl_t) -> c_int; pub fn snd_mixer_detach(mixer: *mut snd_mixer_t, name: *const c_char) -> c_int; pub fn snd_mixer_detach_hctl(mixer: *mut snd_mixer_t, hctl: *mut snd_hctl_t) -> c_int; - pub fn snd_mixer_get_hctl(mixer: *mut snd_mixer_t, name: *const c_char, hctl: *mut *mut snd_hctl_t) -> c_int; + pub fn snd_mixer_get_hctl( + mixer: *mut snd_mixer_t, + name: *const c_char, + hctl: *mut *mut snd_hctl_t, + ) -> c_int; pub fn snd_mixer_poll_descriptors_count(mixer: *mut snd_mixer_t) -> c_int; - pub fn snd_mixer_poll_descriptors(mixer: *mut snd_mixer_t, pfds: *mut pollfd, space: c_uint) -> c_int; - pub fn snd_mixer_poll_descriptors_revents(mixer: *mut snd_mixer_t, pfds: *mut pollfd, nfds: c_uint, revents: *mut c_ushort) -> c_int; + pub fn snd_mixer_poll_descriptors( + mixer: *mut snd_mixer_t, + pfds: *mut pollfd, + space: c_uint, + ) -> c_int; + pub fn snd_mixer_poll_descriptors_revents( + mixer: *mut snd_mixer_t, + pfds: *mut pollfd, + nfds: c_uint, + revents: *mut c_ushort, + ) -> c_int; pub fn snd_mixer_load(mixer: *mut snd_mixer_t) -> c_int; pub fn snd_mixer_free(mixer: *mut snd_mixer_t); pub fn snd_mixer_wait(mixer: *mut snd_mixer_t, timeout: c_int) -> c_int; @@ -1772,15 +3016,31 @@ extern "C" { pub fn snd_mixer_elem_get_callback_private(obj: *const snd_mixer_elem_t) -> *mut c_void; pub fn snd_mixer_elem_set_callback_private(obj: *mut snd_mixer_elem_t, val: *mut c_void); pub fn snd_mixer_elem_get_type(obj: *const snd_mixer_elem_t) -> snd_mixer_elem_type_t; - pub fn snd_mixer_class_register(class_: *mut snd_mixer_class_t, mixer: *mut snd_mixer_t) -> c_int; - pub fn snd_mixer_elem_new(elem: *mut *mut snd_mixer_elem_t, _type: snd_mixer_elem_type_t, compare_weight: c_int, private_data: *mut c_void, private_free: ::std::option::Option) -> c_int; - pub fn snd_mixer_elem_add(elem: *mut snd_mixer_elem_t, class_: *mut snd_mixer_class_t) -> c_int; + pub fn snd_mixer_class_register( + class_: *mut snd_mixer_class_t, + mixer: *mut snd_mixer_t, + ) -> c_int; + pub fn snd_mixer_elem_new( + elem: *mut *mut snd_mixer_elem_t, + _type: snd_mixer_elem_type_t, + compare_weight: c_int, + private_data: *mut c_void, + private_free: ::std::option::Option, + ) -> c_int; + pub fn snd_mixer_elem_add(elem: *mut snd_mixer_elem_t, class_: *mut snd_mixer_class_t) + -> c_int; pub fn snd_mixer_elem_remove(elem: *mut snd_mixer_elem_t) -> c_int; pub fn snd_mixer_elem_free(elem: *mut snd_mixer_elem_t); pub fn snd_mixer_elem_info(elem: *mut snd_mixer_elem_t) -> c_int; pub fn snd_mixer_elem_value(elem: *mut snd_mixer_elem_t) -> c_int; - pub fn snd_mixer_elem_attach(melem: *mut snd_mixer_elem_t, helem: *mut snd_hctl_elem_t) -> c_int; - pub fn snd_mixer_elem_detach(melem: *mut snd_mixer_elem_t, helem: *mut snd_hctl_elem_t) -> c_int; + pub fn snd_mixer_elem_attach( + melem: *mut snd_mixer_elem_t, + helem: *mut snd_hctl_elem_t, + ) -> c_int; + pub fn snd_mixer_elem_detach( + melem: *mut snd_mixer_elem_t, + helem: *mut snd_hctl_elem_t, + ) -> c_int; pub fn snd_mixer_elem_empty(melem: *mut snd_mixer_elem_t) -> c_int; pub fn snd_mixer_elem_get_private(melem: *const snd_mixer_elem_t) -> *mut c_void; pub fn snd_mixer_class_sizeof() -> size_t; @@ -1791,21 +3051,46 @@ extern "C" { pub fn snd_mixer_class_get_event(class_: *const snd_mixer_class_t) -> snd_mixer_event_t; pub fn snd_mixer_class_get_private(class_: *const snd_mixer_class_t) -> *mut c_void; pub fn snd_mixer_class_get_compare(class_: *const snd_mixer_class_t) -> snd_mixer_compare_t; - pub fn snd_mixer_class_set_event(class_: *mut snd_mixer_class_t, event: snd_mixer_event_t) -> c_int; - pub fn snd_mixer_class_set_private(class_: *mut snd_mixer_class_t, private_data: *mut c_void) -> c_int; - pub fn snd_mixer_class_set_private_free(class_: *mut snd_mixer_class_t, private_free: ::std::option::Option) -> c_int; - pub fn snd_mixer_class_set_compare(class_: *mut snd_mixer_class_t, compare: snd_mixer_compare_t) -> c_int; + pub fn snd_mixer_class_set_event( + class_: *mut snd_mixer_class_t, + event: snd_mixer_event_t, + ) -> c_int; + pub fn snd_mixer_class_set_private( + class_: *mut snd_mixer_class_t, + private_data: *mut c_void, + ) -> c_int; + pub fn snd_mixer_class_set_private_free( + class_: *mut snd_mixer_class_t, + private_free: ::std::option::Option, + ) -> c_int; + pub fn snd_mixer_class_set_compare( + class_: *mut snd_mixer_class_t, + compare: snd_mixer_compare_t, + ) -> c_int; pub fn snd_mixer_selem_channel_name(channel: snd_mixer_selem_channel_id_t) -> *const c_char; - pub fn snd_mixer_selem_register(mixer: *mut snd_mixer_t, options: *mut snd_mixer_selem_regopt, classp: *mut *mut snd_mixer_class_t) -> c_int; + pub fn snd_mixer_selem_register( + mixer: *mut snd_mixer_t, + options: *mut snd_mixer_selem_regopt, + classp: *mut *mut snd_mixer_class_t, + ) -> c_int; pub fn snd_mixer_selem_get_id(element: *mut snd_mixer_elem_t, id: *mut snd_mixer_selem_id_t); pub fn snd_mixer_selem_get_name(elem: *mut snd_mixer_elem_t) -> *const c_char; pub fn snd_mixer_selem_get_index(elem: *mut snd_mixer_elem_t) -> c_uint; - pub fn snd_mixer_find_selem(mixer: *mut snd_mixer_t, id: *const snd_mixer_selem_id_t) -> *mut snd_mixer_elem_t; + pub fn snd_mixer_find_selem( + mixer: *mut snd_mixer_t, + id: *const snd_mixer_selem_id_t, + ) -> *mut snd_mixer_elem_t; pub fn snd_mixer_selem_is_active(elem: *mut snd_mixer_elem_t) -> c_int; pub fn snd_mixer_selem_is_playback_mono(elem: *mut snd_mixer_elem_t) -> c_int; - pub fn snd_mixer_selem_has_playback_channel(obj: *mut snd_mixer_elem_t, channel: snd_mixer_selem_channel_id_t) -> c_int; + pub fn snd_mixer_selem_has_playback_channel( + obj: *mut snd_mixer_elem_t, + channel: snd_mixer_selem_channel_id_t, + ) -> c_int; pub fn snd_mixer_selem_is_capture_mono(elem: *mut snd_mixer_elem_t) -> c_int; - pub fn snd_mixer_selem_has_capture_channel(obj: *mut snd_mixer_elem_t, channel: snd_mixer_selem_channel_id_t) -> c_int; + pub fn snd_mixer_selem_has_capture_channel( + obj: *mut snd_mixer_elem_t, + channel: snd_mixer_selem_channel_id_t, + ) -> c_int; pub fn snd_mixer_selem_get_capture_group(elem: *mut snd_mixer_elem_t) -> c_int; pub fn snd_mixer_selem_has_common_volume(elem: *mut snd_mixer_elem_t) -> c_int; pub fn snd_mixer_selem_has_playback_volume(elem: *mut snd_mixer_elem_t) -> c_int; @@ -1818,57 +3103,206 @@ extern "C" { pub fn snd_mixer_selem_has_capture_switch(elem: *mut snd_mixer_elem_t) -> c_int; pub fn snd_mixer_selem_has_capture_switch_joined(elem: *mut snd_mixer_elem_t) -> c_int; pub fn snd_mixer_selem_has_capture_switch_exclusive(elem: *mut snd_mixer_elem_t) -> c_int; - pub fn snd_mixer_selem_ask_playback_vol_dB(elem: *mut snd_mixer_elem_t, value: c_long, dBvalue: *mut c_long) -> c_int; - pub fn snd_mixer_selem_ask_capture_vol_dB(elem: *mut snd_mixer_elem_t, value: c_long, dBvalue: *mut c_long) -> c_int; - pub fn snd_mixer_selem_ask_playback_dB_vol(elem: *mut snd_mixer_elem_t, dBvalue: c_long, dir: c_int, value: *mut c_long) -> c_int; - pub fn snd_mixer_selem_ask_capture_dB_vol(elem: *mut snd_mixer_elem_t, dBvalue: c_long, dir: c_int, value: *mut c_long) -> c_int; - pub fn snd_mixer_selem_get_playback_volume(elem: *mut snd_mixer_elem_t, channel: snd_mixer_selem_channel_id_t, value: *mut c_long) -> c_int; - pub fn snd_mixer_selem_get_capture_volume(elem: *mut snd_mixer_elem_t, channel: snd_mixer_selem_channel_id_t, value: *mut c_long) -> c_int; - pub fn snd_mixer_selem_get_playback_dB(elem: *mut snd_mixer_elem_t, channel: snd_mixer_selem_channel_id_t, value: *mut c_long) -> c_int; - pub fn snd_mixer_selem_get_capture_dB(elem: *mut snd_mixer_elem_t, channel: snd_mixer_selem_channel_id_t, value: *mut c_long) -> c_int; - pub fn snd_mixer_selem_get_playback_switch(elem: *mut snd_mixer_elem_t, channel: snd_mixer_selem_channel_id_t, value: *mut c_int) -> c_int; - pub fn snd_mixer_selem_get_capture_switch(elem: *mut snd_mixer_elem_t, channel: snd_mixer_selem_channel_id_t, value: *mut c_int) -> c_int; - pub fn snd_mixer_selem_set_playback_volume(elem: *mut snd_mixer_elem_t, channel: snd_mixer_selem_channel_id_t, value: c_long) -> c_int; - pub fn snd_mixer_selem_set_capture_volume(elem: *mut snd_mixer_elem_t, channel: snd_mixer_selem_channel_id_t, value: c_long) -> c_int; - pub fn snd_mixer_selem_set_playback_dB(elem: *mut snd_mixer_elem_t, channel: snd_mixer_selem_channel_id_t, value: c_long, dir: c_int) -> c_int; - pub fn snd_mixer_selem_set_capture_dB(elem: *mut snd_mixer_elem_t, channel: snd_mixer_selem_channel_id_t, value: c_long, dir: c_int) -> c_int; - pub fn snd_mixer_selem_set_playback_volume_all(elem: *mut snd_mixer_elem_t, value: c_long) -> c_int; - pub fn snd_mixer_selem_set_capture_volume_all(elem: *mut snd_mixer_elem_t, value: c_long) -> c_int; - pub fn snd_mixer_selem_set_playback_dB_all(elem: *mut snd_mixer_elem_t, value: c_long, dir: c_int) -> c_int; - pub fn snd_mixer_selem_set_capture_dB_all(elem: *mut snd_mixer_elem_t, value: c_long, dir: c_int) -> c_int; - pub fn snd_mixer_selem_set_playback_switch(elem: *mut snd_mixer_elem_t, channel: snd_mixer_selem_channel_id_t, value: c_int) -> c_int; - pub fn snd_mixer_selem_set_capture_switch(elem: *mut snd_mixer_elem_t, channel: snd_mixer_selem_channel_id_t, value: c_int) -> c_int; - pub fn snd_mixer_selem_set_playback_switch_all(elem: *mut snd_mixer_elem_t, value: c_int) -> c_int; - pub fn snd_mixer_selem_set_capture_switch_all(elem: *mut snd_mixer_elem_t, value: c_int) -> c_int; - pub fn snd_mixer_selem_get_playback_volume_range(elem: *mut snd_mixer_elem_t, min: *mut c_long, max: *mut c_long) -> c_int; - pub fn snd_mixer_selem_get_playback_dB_range(elem: *mut snd_mixer_elem_t, min: *mut c_long, max: *mut c_long) -> c_int; - pub fn snd_mixer_selem_set_playback_volume_range(elem: *mut snd_mixer_elem_t, min: c_long, max: c_long) -> c_int; - pub fn snd_mixer_selem_get_capture_volume_range(elem: *mut snd_mixer_elem_t, min: *mut c_long, max: *mut c_long) -> c_int; - pub fn snd_mixer_selem_get_capture_dB_range(elem: *mut snd_mixer_elem_t, min: *mut c_long, max: *mut c_long) -> c_int; - pub fn snd_mixer_selem_set_capture_volume_range(elem: *mut snd_mixer_elem_t, min: c_long, max: c_long) -> c_int; + pub fn snd_mixer_selem_ask_playback_vol_dB( + elem: *mut snd_mixer_elem_t, + value: c_long, + dBvalue: *mut c_long, + ) -> c_int; + pub fn snd_mixer_selem_ask_capture_vol_dB( + elem: *mut snd_mixer_elem_t, + value: c_long, + dBvalue: *mut c_long, + ) -> c_int; + pub fn snd_mixer_selem_ask_playback_dB_vol( + elem: *mut snd_mixer_elem_t, + dBvalue: c_long, + dir: c_int, + value: *mut c_long, + ) -> c_int; + pub fn snd_mixer_selem_ask_capture_dB_vol( + elem: *mut snd_mixer_elem_t, + dBvalue: c_long, + dir: c_int, + value: *mut c_long, + ) -> c_int; + pub fn snd_mixer_selem_get_playback_volume( + elem: *mut snd_mixer_elem_t, + channel: snd_mixer_selem_channel_id_t, + value: *mut c_long, + ) -> c_int; + pub fn snd_mixer_selem_get_capture_volume( + elem: *mut snd_mixer_elem_t, + channel: snd_mixer_selem_channel_id_t, + value: *mut c_long, + ) -> c_int; + pub fn snd_mixer_selem_get_playback_dB( + elem: *mut snd_mixer_elem_t, + channel: snd_mixer_selem_channel_id_t, + value: *mut c_long, + ) -> c_int; + pub fn snd_mixer_selem_get_capture_dB( + elem: *mut snd_mixer_elem_t, + channel: snd_mixer_selem_channel_id_t, + value: *mut c_long, + ) -> c_int; + pub fn snd_mixer_selem_get_playback_switch( + elem: *mut snd_mixer_elem_t, + channel: snd_mixer_selem_channel_id_t, + value: *mut c_int, + ) -> c_int; + pub fn snd_mixer_selem_get_capture_switch( + elem: *mut snd_mixer_elem_t, + channel: snd_mixer_selem_channel_id_t, + value: *mut c_int, + ) -> c_int; + pub fn snd_mixer_selem_set_playback_volume( + elem: *mut snd_mixer_elem_t, + channel: snd_mixer_selem_channel_id_t, + value: c_long, + ) -> c_int; + pub fn snd_mixer_selem_set_capture_volume( + elem: *mut snd_mixer_elem_t, + channel: snd_mixer_selem_channel_id_t, + value: c_long, + ) -> c_int; + pub fn snd_mixer_selem_set_playback_dB( + elem: *mut snd_mixer_elem_t, + channel: snd_mixer_selem_channel_id_t, + value: c_long, + dir: c_int, + ) -> c_int; + pub fn snd_mixer_selem_set_capture_dB( + elem: *mut snd_mixer_elem_t, + channel: snd_mixer_selem_channel_id_t, + value: c_long, + dir: c_int, + ) -> c_int; + pub fn snd_mixer_selem_set_playback_volume_all( + elem: *mut snd_mixer_elem_t, + value: c_long, + ) -> c_int; + pub fn snd_mixer_selem_set_capture_volume_all( + elem: *mut snd_mixer_elem_t, + value: c_long, + ) -> c_int; + pub fn snd_mixer_selem_set_playback_dB_all( + elem: *mut snd_mixer_elem_t, + value: c_long, + dir: c_int, + ) -> c_int; + pub fn snd_mixer_selem_set_capture_dB_all( + elem: *mut snd_mixer_elem_t, + value: c_long, + dir: c_int, + ) -> c_int; + pub fn snd_mixer_selem_set_playback_switch( + elem: *mut snd_mixer_elem_t, + channel: snd_mixer_selem_channel_id_t, + value: c_int, + ) -> c_int; + pub fn snd_mixer_selem_set_capture_switch( + elem: *mut snd_mixer_elem_t, + channel: snd_mixer_selem_channel_id_t, + value: c_int, + ) -> c_int; + pub fn snd_mixer_selem_set_playback_switch_all( + elem: *mut snd_mixer_elem_t, + value: c_int, + ) -> c_int; + pub fn snd_mixer_selem_set_capture_switch_all( + elem: *mut snd_mixer_elem_t, + value: c_int, + ) -> c_int; + pub fn snd_mixer_selem_get_playback_volume_range( + elem: *mut snd_mixer_elem_t, + min: *mut c_long, + max: *mut c_long, + ) -> c_int; + pub fn snd_mixer_selem_get_playback_dB_range( + elem: *mut snd_mixer_elem_t, + min: *mut c_long, + max: *mut c_long, + ) -> c_int; + pub fn snd_mixer_selem_set_playback_volume_range( + elem: *mut snd_mixer_elem_t, + min: c_long, + max: c_long, + ) -> c_int; + pub fn snd_mixer_selem_get_capture_volume_range( + elem: *mut snd_mixer_elem_t, + min: *mut c_long, + max: *mut c_long, + ) -> c_int; + pub fn snd_mixer_selem_get_capture_dB_range( + elem: *mut snd_mixer_elem_t, + min: *mut c_long, + max: *mut c_long, + ) -> c_int; + pub fn snd_mixer_selem_set_capture_volume_range( + elem: *mut snd_mixer_elem_t, + min: c_long, + max: c_long, + ) -> c_int; pub fn snd_mixer_selem_is_enumerated(elem: *mut snd_mixer_elem_t) -> c_int; pub fn snd_mixer_selem_is_enum_playback(elem: *mut snd_mixer_elem_t) -> c_int; pub fn snd_mixer_selem_is_enum_capture(elem: *mut snd_mixer_elem_t) -> c_int; pub fn snd_mixer_selem_get_enum_items(elem: *mut snd_mixer_elem_t) -> c_int; - pub fn snd_mixer_selem_get_enum_item_name(elem: *mut snd_mixer_elem_t, idx: c_uint, maxlen: size_t, str: *mut c_char) -> c_int; - pub fn snd_mixer_selem_get_enum_item(elem: *mut snd_mixer_elem_t, channel: snd_mixer_selem_channel_id_t, idxp: *mut c_uint) -> c_int; - pub fn snd_mixer_selem_set_enum_item(elem: *mut snd_mixer_elem_t, channel: snd_mixer_selem_channel_id_t, idx: c_uint) -> c_int; + pub fn snd_mixer_selem_get_enum_item_name( + elem: *mut snd_mixer_elem_t, + idx: c_uint, + maxlen: size_t, + str: *mut c_char, + ) -> c_int; + pub fn snd_mixer_selem_get_enum_item( + elem: *mut snd_mixer_elem_t, + channel: snd_mixer_selem_channel_id_t, + idxp: *mut c_uint, + ) -> c_int; + pub fn snd_mixer_selem_set_enum_item( + elem: *mut snd_mixer_elem_t, + channel: snd_mixer_selem_channel_id_t, + idx: c_uint, + ) -> c_int; pub fn snd_mixer_selem_id_sizeof() -> size_t; pub fn snd_mixer_selem_id_malloc(ptr: *mut *mut snd_mixer_selem_id_t) -> c_int; pub fn snd_mixer_selem_id_free(obj: *mut snd_mixer_selem_id_t); - pub fn snd_mixer_selem_id_copy(dst: *mut snd_mixer_selem_id_t, src: *const snd_mixer_selem_id_t); + pub fn snd_mixer_selem_id_copy( + dst: *mut snd_mixer_selem_id_t, + src: *const snd_mixer_selem_id_t, + ); pub fn snd_mixer_selem_id_get_name(obj: *const snd_mixer_selem_id_t) -> *const c_char; pub fn snd_mixer_selem_id_get_index(obj: *const snd_mixer_selem_id_t) -> c_uint; pub fn snd_mixer_selem_id_set_name(obj: *mut snd_mixer_selem_id_t, val: *const c_char); pub fn snd_mixer_selem_id_set_index(obj: *mut snd_mixer_selem_id_t, val: c_uint); - pub fn snd_seq_open(handle: *mut *mut snd_seq_t, name: *const c_char, streams: c_int, mode: c_int) -> c_int; - pub fn snd_seq_open_lconf(handle: *mut *mut snd_seq_t, name: *const c_char, streams: c_int, mode: c_int, lconf: *mut snd_config_t) -> c_int; + pub fn snd_seq_open( + handle: *mut *mut snd_seq_t, + name: *const c_char, + streams: c_int, + mode: c_int, + ) -> c_int; + pub fn snd_seq_open_lconf( + handle: *mut *mut snd_seq_t, + name: *const c_char, + streams: c_int, + mode: c_int, + lconf: *mut snd_config_t, + ) -> c_int; pub fn snd_seq_name(seq: *mut snd_seq_t) -> *const c_char; pub fn snd_seq_type(seq: *mut snd_seq_t) -> snd_seq_type_t; pub fn snd_seq_close(handle: *mut snd_seq_t) -> c_int; pub fn snd_seq_poll_descriptors_count(handle: *mut snd_seq_t, events: c_short) -> c_int; - pub fn snd_seq_poll_descriptors(handle: *mut snd_seq_t, pfds: *mut pollfd, space: c_uint, events: c_short) -> c_int; - pub fn snd_seq_poll_descriptors_revents(seq: *mut snd_seq_t, pfds: *mut pollfd, nfds: c_uint, revents: *mut c_ushort) -> c_int; + pub fn snd_seq_poll_descriptors( + handle: *mut snd_seq_t, + pfds: *mut pollfd, + space: c_uint, + events: c_short, + ) -> c_int; + pub fn snd_seq_poll_descriptors_revents( + seq: *mut snd_seq_t, + pfds: *mut pollfd, + nfds: c_uint, + revents: *mut c_ushort, + ) -> c_int; pub fn snd_seq_nonblock(handle: *mut snd_seq_t, nonblock: c_int) -> c_int; pub fn snd_seq_client_id(handle: *mut snd_seq_t) -> c_int; pub fn snd_seq_get_output_buffer_size(handle: *mut snd_seq_t) -> size_t; @@ -1878,7 +3312,10 @@ extern "C" { pub fn snd_seq_system_info_sizeof() -> size_t; pub fn snd_seq_system_info_malloc(ptr: *mut *mut snd_seq_system_info_t) -> c_int; pub fn snd_seq_system_info_free(ptr: *mut snd_seq_system_info_t); - pub fn snd_seq_system_info_copy(dst: *mut snd_seq_system_info_t, src: *const snd_seq_system_info_t); + pub fn snd_seq_system_info_copy( + dst: *mut snd_seq_system_info_t, + src: *const snd_seq_system_info_t, + ); pub fn snd_seq_system_info_get_queues(info: *const snd_seq_system_info_t) -> c_int; pub fn snd_seq_system_info_get_clients(info: *const snd_seq_system_info_t) -> c_int; pub fn snd_seq_system_info_get_ports(info: *const snd_seq_system_info_t) -> c_int; @@ -1889,32 +3326,67 @@ extern "C" { pub fn snd_seq_client_info_sizeof() -> size_t; pub fn snd_seq_client_info_malloc(ptr: *mut *mut snd_seq_client_info_t) -> c_int; pub fn snd_seq_client_info_free(ptr: *mut snd_seq_client_info_t); - pub fn snd_seq_client_info_copy(dst: *mut snd_seq_client_info_t, src: *const snd_seq_client_info_t); + pub fn snd_seq_client_info_copy( + dst: *mut snd_seq_client_info_t, + src: *const snd_seq_client_info_t, + ); pub fn snd_seq_client_info_get_client(info: *const snd_seq_client_info_t) -> c_int; - pub fn snd_seq_client_info_get_type(info: *const snd_seq_client_info_t) -> snd_seq_client_type_t; + pub fn snd_seq_client_info_get_type( + info: *const snd_seq_client_info_t, + ) -> snd_seq_client_type_t; pub fn snd_seq_client_info_get_name(info: *mut snd_seq_client_info_t) -> *const c_char; pub fn snd_seq_client_info_get_broadcast_filter(info: *const snd_seq_client_info_t) -> c_int; pub fn snd_seq_client_info_get_error_bounce(info: *const snd_seq_client_info_t) -> c_int; - pub fn snd_seq_client_info_get_event_filter(info: *const snd_seq_client_info_t) -> *const c_uchar; + pub fn snd_seq_client_info_get_event_filter( + info: *const snd_seq_client_info_t, + ) -> *const c_uchar; pub fn snd_seq_client_info_get_num_ports(info: *const snd_seq_client_info_t) -> c_int; pub fn snd_seq_client_info_get_event_lost(info: *const snd_seq_client_info_t) -> c_int; pub fn snd_seq_client_info_set_client(info: *mut snd_seq_client_info_t, client: c_int); pub fn snd_seq_client_info_set_name(info: *mut snd_seq_client_info_t, name: *const c_char); pub fn snd_seq_client_info_set_broadcast_filter(info: *mut snd_seq_client_info_t, val: c_int); pub fn snd_seq_client_info_set_error_bounce(info: *mut snd_seq_client_info_t, val: c_int); - pub fn snd_seq_client_info_set_event_filter(info: *mut snd_seq_client_info_t, filter: *mut c_uchar); + pub fn snd_seq_client_info_set_event_filter( + info: *mut snd_seq_client_info_t, + filter: *mut c_uchar, + ); pub fn snd_seq_client_info_event_filter_clear(info: *mut snd_seq_client_info_t); - pub fn snd_seq_client_info_event_filter_add(info: *mut snd_seq_client_info_t, event_type: c_int); - pub fn snd_seq_client_info_event_filter_del(info: *mut snd_seq_client_info_t, event_type: c_int); - pub fn snd_seq_client_info_event_filter_check(info: *mut snd_seq_client_info_t, event_type: c_int) -> c_int; - pub fn snd_seq_get_client_info(handle: *mut snd_seq_t, info: *mut snd_seq_client_info_t) -> c_int; - pub fn snd_seq_get_any_client_info(handle: *mut snd_seq_t, client: c_int, info: *mut snd_seq_client_info_t) -> c_int; - pub fn snd_seq_set_client_info(handle: *mut snd_seq_t, info: *mut snd_seq_client_info_t) -> c_int; - pub fn snd_seq_query_next_client(handle: *mut snd_seq_t, info: *mut snd_seq_client_info_t) -> c_int; + pub fn snd_seq_client_info_event_filter_add( + info: *mut snd_seq_client_info_t, + event_type: c_int, + ); + pub fn snd_seq_client_info_event_filter_del( + info: *mut snd_seq_client_info_t, + event_type: c_int, + ); + pub fn snd_seq_client_info_event_filter_check( + info: *mut snd_seq_client_info_t, + event_type: c_int, + ) -> c_int; + pub fn snd_seq_get_client_info( + handle: *mut snd_seq_t, + info: *mut snd_seq_client_info_t, + ) -> c_int; + pub fn snd_seq_get_any_client_info( + handle: *mut snd_seq_t, + client: c_int, + info: *mut snd_seq_client_info_t, + ) -> c_int; + pub fn snd_seq_set_client_info( + handle: *mut snd_seq_t, + info: *mut snd_seq_client_info_t, + ) -> c_int; + pub fn snd_seq_query_next_client( + handle: *mut snd_seq_t, + info: *mut snd_seq_client_info_t, + ) -> c_int; pub fn snd_seq_client_pool_sizeof() -> size_t; pub fn snd_seq_client_pool_malloc(ptr: *mut *mut snd_seq_client_pool_t) -> c_int; pub fn snd_seq_client_pool_free(ptr: *mut snd_seq_client_pool_t); - pub fn snd_seq_client_pool_copy(dst: *mut snd_seq_client_pool_t, src: *const snd_seq_client_pool_t); + pub fn snd_seq_client_pool_copy( + dst: *mut snd_seq_client_pool_t, + src: *const snd_seq_client_pool_t, + ); pub fn snd_seq_client_pool_get_client(info: *const snd_seq_client_pool_t) -> c_int; pub fn snd_seq_client_pool_get_output_pool(info: *const snd_seq_client_pool_t) -> size_t; pub fn snd_seq_client_pool_get_input_pool(info: *const snd_seq_client_pool_t) -> size_t; @@ -1924,8 +3396,14 @@ extern "C" { pub fn snd_seq_client_pool_set_output_pool(info: *mut snd_seq_client_pool_t, size: size_t); pub fn snd_seq_client_pool_set_input_pool(info: *mut snd_seq_client_pool_t, size: size_t); pub fn snd_seq_client_pool_set_output_room(info: *mut snd_seq_client_pool_t, size: size_t); - pub fn snd_seq_get_client_pool(handle: *mut snd_seq_t, info: *mut snd_seq_client_pool_t) -> c_int; - pub fn snd_seq_set_client_pool(handle: *mut snd_seq_t, info: *mut snd_seq_client_pool_t) -> c_int; + pub fn snd_seq_get_client_pool( + handle: *mut snd_seq_t, + info: *mut snd_seq_client_pool_t, + ) -> c_int; + pub fn snd_seq_set_client_pool( + handle: *mut snd_seq_t, + info: *mut snd_seq_client_pool_t, + ) -> c_int; pub fn snd_seq_port_info_sizeof() -> size_t; pub fn snd_seq_port_info_malloc(ptr: *mut *mut snd_seq_port_info_t) -> c_int; pub fn snd_seq_port_info_free(ptr: *mut snd_seq_port_info_t); @@ -1960,54 +3438,112 @@ extern "C" { pub fn snd_seq_port_info_set_timestamp_queue(info: *mut snd_seq_port_info_t, queue: c_int); pub fn snd_seq_create_port(handle: *mut snd_seq_t, info: *mut snd_seq_port_info_t) -> c_int; pub fn snd_seq_delete_port(handle: *mut snd_seq_t, port: c_int) -> c_int; - pub fn snd_seq_get_port_info(handle: *mut snd_seq_t, port: c_int, info: *mut snd_seq_port_info_t) -> c_int; - pub fn snd_seq_get_any_port_info(handle: *mut snd_seq_t, client: c_int, port: c_int, info: *mut snd_seq_port_info_t) -> c_int; - pub fn snd_seq_set_port_info(handle: *mut snd_seq_t, port: c_int, info: *mut snd_seq_port_info_t) -> c_int; - pub fn snd_seq_query_next_port(handle: *mut snd_seq_t, info: *mut snd_seq_port_info_t) -> c_int; + pub fn snd_seq_get_port_info( + handle: *mut snd_seq_t, + port: c_int, + info: *mut snd_seq_port_info_t, + ) -> c_int; + pub fn snd_seq_get_any_port_info( + handle: *mut snd_seq_t, + client: c_int, + port: c_int, + info: *mut snd_seq_port_info_t, + ) -> c_int; + pub fn snd_seq_set_port_info( + handle: *mut snd_seq_t, + port: c_int, + info: *mut snd_seq_port_info_t, + ) -> c_int; + pub fn snd_seq_query_next_port(handle: *mut snd_seq_t, info: *mut snd_seq_port_info_t) + -> c_int; pub fn snd_seq_port_subscribe_sizeof() -> size_t; pub fn snd_seq_port_subscribe_malloc(ptr: *mut *mut snd_seq_port_subscribe_t) -> c_int; pub fn snd_seq_port_subscribe_free(ptr: *mut snd_seq_port_subscribe_t); - pub fn snd_seq_port_subscribe_copy(dst: *mut snd_seq_port_subscribe_t, src: *const snd_seq_port_subscribe_t); - pub fn snd_seq_port_subscribe_get_sender(info: *const snd_seq_port_subscribe_t) -> *const snd_seq_addr_t; - pub fn snd_seq_port_subscribe_get_dest(info: *const snd_seq_port_subscribe_t) -> *const snd_seq_addr_t; + pub fn snd_seq_port_subscribe_copy( + dst: *mut snd_seq_port_subscribe_t, + src: *const snd_seq_port_subscribe_t, + ); + pub fn snd_seq_port_subscribe_get_sender( + info: *const snd_seq_port_subscribe_t, + ) -> *const snd_seq_addr_t; + pub fn snd_seq_port_subscribe_get_dest( + info: *const snd_seq_port_subscribe_t, + ) -> *const snd_seq_addr_t; pub fn snd_seq_port_subscribe_get_queue(info: *const snd_seq_port_subscribe_t) -> c_int; pub fn snd_seq_port_subscribe_get_exclusive(info: *const snd_seq_port_subscribe_t) -> c_int; pub fn snd_seq_port_subscribe_get_time_update(info: *const snd_seq_port_subscribe_t) -> c_int; pub fn snd_seq_port_subscribe_get_time_real(info: *const snd_seq_port_subscribe_t) -> c_int; - pub fn snd_seq_port_subscribe_set_sender(info: *mut snd_seq_port_subscribe_t, addr: *const snd_seq_addr_t); - pub fn snd_seq_port_subscribe_set_dest(info: *mut snd_seq_port_subscribe_t, addr: *const snd_seq_addr_t); + pub fn snd_seq_port_subscribe_set_sender( + info: *mut snd_seq_port_subscribe_t, + addr: *const snd_seq_addr_t, + ); + pub fn snd_seq_port_subscribe_set_dest( + info: *mut snd_seq_port_subscribe_t, + addr: *const snd_seq_addr_t, + ); pub fn snd_seq_port_subscribe_set_queue(info: *mut snd_seq_port_subscribe_t, q: c_int); pub fn snd_seq_port_subscribe_set_exclusive(info: *mut snd_seq_port_subscribe_t, val: c_int); pub fn snd_seq_port_subscribe_set_time_update(info: *mut snd_seq_port_subscribe_t, val: c_int); pub fn snd_seq_port_subscribe_set_time_real(info: *mut snd_seq_port_subscribe_t, val: c_int); - pub fn snd_seq_get_port_subscription(handle: *mut snd_seq_t, sub: *mut snd_seq_port_subscribe_t) -> c_int; - pub fn snd_seq_subscribe_port(handle: *mut snd_seq_t, sub: *mut snd_seq_port_subscribe_t) -> c_int; - pub fn snd_seq_unsubscribe_port(handle: *mut snd_seq_t, sub: *mut snd_seq_port_subscribe_t) -> c_int; + pub fn snd_seq_get_port_subscription( + handle: *mut snd_seq_t, + sub: *mut snd_seq_port_subscribe_t, + ) -> c_int; + pub fn snd_seq_subscribe_port( + handle: *mut snd_seq_t, + sub: *mut snd_seq_port_subscribe_t, + ) -> c_int; + pub fn snd_seq_unsubscribe_port( + handle: *mut snd_seq_t, + sub: *mut snd_seq_port_subscribe_t, + ) -> c_int; pub fn snd_seq_query_subscribe_sizeof() -> size_t; pub fn snd_seq_query_subscribe_malloc(ptr: *mut *mut snd_seq_query_subscribe_t) -> c_int; pub fn snd_seq_query_subscribe_free(ptr: *mut snd_seq_query_subscribe_t); - pub fn snd_seq_query_subscribe_copy(dst: *mut snd_seq_query_subscribe_t, src: *const snd_seq_query_subscribe_t); + pub fn snd_seq_query_subscribe_copy( + dst: *mut snd_seq_query_subscribe_t, + src: *const snd_seq_query_subscribe_t, + ); pub fn snd_seq_query_subscribe_get_client(info: *const snd_seq_query_subscribe_t) -> c_int; pub fn snd_seq_query_subscribe_get_port(info: *const snd_seq_query_subscribe_t) -> c_int; - pub fn snd_seq_query_subscribe_get_root(info: *const snd_seq_query_subscribe_t) -> *const snd_seq_addr_t; - pub fn snd_seq_query_subscribe_get_type(info: *const snd_seq_query_subscribe_t) -> snd_seq_query_subs_type_t; + pub fn snd_seq_query_subscribe_get_root( + info: *const snd_seq_query_subscribe_t, + ) -> *const snd_seq_addr_t; + pub fn snd_seq_query_subscribe_get_type( + info: *const snd_seq_query_subscribe_t, + ) -> snd_seq_query_subs_type_t; pub fn snd_seq_query_subscribe_get_index(info: *const snd_seq_query_subscribe_t) -> c_int; pub fn snd_seq_query_subscribe_get_num_subs(info: *const snd_seq_query_subscribe_t) -> c_int; - pub fn snd_seq_query_subscribe_get_addr(info: *const snd_seq_query_subscribe_t) -> *const snd_seq_addr_t; + pub fn snd_seq_query_subscribe_get_addr( + info: *const snd_seq_query_subscribe_t, + ) -> *const snd_seq_addr_t; pub fn snd_seq_query_subscribe_get_queue(info: *const snd_seq_query_subscribe_t) -> c_int; pub fn snd_seq_query_subscribe_get_exclusive(info: *const snd_seq_query_subscribe_t) -> c_int; - pub fn snd_seq_query_subscribe_get_time_update(info: *const snd_seq_query_subscribe_t) -> c_int; + pub fn snd_seq_query_subscribe_get_time_update(info: *const snd_seq_query_subscribe_t) + -> c_int; pub fn snd_seq_query_subscribe_get_time_real(info: *const snd_seq_query_subscribe_t) -> c_int; pub fn snd_seq_query_subscribe_set_client(info: *mut snd_seq_query_subscribe_t, client: c_int); pub fn snd_seq_query_subscribe_set_port(info: *mut snd_seq_query_subscribe_t, port: c_int); - pub fn snd_seq_query_subscribe_set_root(info: *mut snd_seq_query_subscribe_t, addr: *const snd_seq_addr_t); - pub fn snd_seq_query_subscribe_set_type(info: *mut snd_seq_query_subscribe_t, _type: snd_seq_query_subs_type_t); + pub fn snd_seq_query_subscribe_set_root( + info: *mut snd_seq_query_subscribe_t, + addr: *const snd_seq_addr_t, + ); + pub fn snd_seq_query_subscribe_set_type( + info: *mut snd_seq_query_subscribe_t, + _type: snd_seq_query_subs_type_t, + ); pub fn snd_seq_query_subscribe_set_index(info: *mut snd_seq_query_subscribe_t, _index: c_int); - pub fn snd_seq_query_port_subscribers(seq: *mut snd_seq_t, subs: *mut snd_seq_query_subscribe_t) -> c_int; + pub fn snd_seq_query_port_subscribers( + seq: *mut snd_seq_t, + subs: *mut snd_seq_query_subscribe_t, + ) -> c_int; pub fn snd_seq_queue_info_sizeof() -> size_t; pub fn snd_seq_queue_info_malloc(ptr: *mut *mut snd_seq_queue_info_t) -> c_int; pub fn snd_seq_queue_info_free(ptr: *mut snd_seq_queue_info_t); - pub fn snd_seq_queue_info_copy(dst: *mut snd_seq_queue_info_t, src: *const snd_seq_queue_info_t); + pub fn snd_seq_queue_info_copy( + dst: *mut snd_seq_queue_info_t, + src: *const snd_seq_queue_info_t, + ); pub fn snd_seq_queue_info_get_queue(info: *const snd_seq_queue_info_t) -> c_int; pub fn snd_seq_queue_info_get_name(info: *const snd_seq_queue_info_t) -> *const c_char; pub fn snd_seq_queue_info_get_owner(info: *const snd_seq_queue_info_t) -> c_int; @@ -2021,25 +3557,47 @@ extern "C" { pub fn snd_seq_alloc_named_queue(seq: *mut snd_seq_t, name: *const c_char) -> c_int; pub fn snd_seq_alloc_queue(handle: *mut snd_seq_t) -> c_int; pub fn snd_seq_free_queue(handle: *mut snd_seq_t, q: c_int) -> c_int; - pub fn snd_seq_get_queue_info(seq: *mut snd_seq_t, q: c_int, info: *mut snd_seq_queue_info_t) -> c_int; - pub fn snd_seq_set_queue_info(seq: *mut snd_seq_t, q: c_int, info: *mut snd_seq_queue_info_t) -> c_int; + pub fn snd_seq_get_queue_info( + seq: *mut snd_seq_t, + q: c_int, + info: *mut snd_seq_queue_info_t, + ) -> c_int; + pub fn snd_seq_set_queue_info( + seq: *mut snd_seq_t, + q: c_int, + info: *mut snd_seq_queue_info_t, + ) -> c_int; pub fn snd_seq_query_named_queue(seq: *mut snd_seq_t, name: *const c_char) -> c_int; pub fn snd_seq_get_queue_usage(handle: *mut snd_seq_t, q: c_int) -> c_int; pub fn snd_seq_set_queue_usage(handle: *mut snd_seq_t, q: c_int, used: c_int) -> c_int; pub fn snd_seq_queue_status_sizeof() -> size_t; pub fn snd_seq_queue_status_malloc(ptr: *mut *mut snd_seq_queue_status_t) -> c_int; pub fn snd_seq_queue_status_free(ptr: *mut snd_seq_queue_status_t); - pub fn snd_seq_queue_status_copy(dst: *mut snd_seq_queue_status_t, src: *const snd_seq_queue_status_t); + pub fn snd_seq_queue_status_copy( + dst: *mut snd_seq_queue_status_t, + src: *const snd_seq_queue_status_t, + ); pub fn snd_seq_queue_status_get_queue(info: *const snd_seq_queue_status_t) -> c_int; pub fn snd_seq_queue_status_get_events(info: *const snd_seq_queue_status_t) -> c_int; - pub fn snd_seq_queue_status_get_tick_time(info: *const snd_seq_queue_status_t) -> snd_seq_tick_time_t; - pub fn snd_seq_queue_status_get_real_time(info: *const snd_seq_queue_status_t) -> *const snd_seq_real_time_t; + pub fn snd_seq_queue_status_get_tick_time( + info: *const snd_seq_queue_status_t, + ) -> snd_seq_tick_time_t; + pub fn snd_seq_queue_status_get_real_time( + info: *const snd_seq_queue_status_t, + ) -> *const snd_seq_real_time_t; pub fn snd_seq_queue_status_get_status(info: *const snd_seq_queue_status_t) -> c_uint; - pub fn snd_seq_get_queue_status(handle: *mut snd_seq_t, q: c_int, status: *mut snd_seq_queue_status_t) -> c_int; + pub fn snd_seq_get_queue_status( + handle: *mut snd_seq_t, + q: c_int, + status: *mut snd_seq_queue_status_t, + ) -> c_int; pub fn snd_seq_queue_tempo_sizeof() -> size_t; pub fn snd_seq_queue_tempo_malloc(ptr: *mut *mut snd_seq_queue_tempo_t) -> c_int; pub fn snd_seq_queue_tempo_free(ptr: *mut snd_seq_queue_tempo_t); - pub fn snd_seq_queue_tempo_copy(dst: *mut snd_seq_queue_tempo_t, src: *const snd_seq_queue_tempo_t); + pub fn snd_seq_queue_tempo_copy( + dst: *mut snd_seq_queue_tempo_t, + src: *const snd_seq_queue_tempo_t, + ); pub fn snd_seq_queue_tempo_get_queue(info: *const snd_seq_queue_tempo_t) -> c_int; pub fn snd_seq_queue_tempo_get_tempo(info: *const snd_seq_queue_tempo_t) -> c_uint; pub fn snd_seq_queue_tempo_get_ppq(info: *const snd_seq_queue_tempo_t) -> c_int; @@ -2049,21 +3607,45 @@ extern "C" { pub fn snd_seq_queue_tempo_set_ppq(info: *mut snd_seq_queue_tempo_t, ppq: c_int); pub fn snd_seq_queue_tempo_set_skew(info: *mut snd_seq_queue_tempo_t, skew: c_uint); pub fn snd_seq_queue_tempo_set_skew_base(info: *mut snd_seq_queue_tempo_t, base: c_uint); - pub fn snd_seq_get_queue_tempo(handle: *mut snd_seq_t, q: c_int, tempo: *mut snd_seq_queue_tempo_t) -> c_int; - pub fn snd_seq_set_queue_tempo(handle: *mut snd_seq_t, q: c_int, tempo: *mut snd_seq_queue_tempo_t) -> c_int; + pub fn snd_seq_get_queue_tempo( + handle: *mut snd_seq_t, + q: c_int, + tempo: *mut snd_seq_queue_tempo_t, + ) -> c_int; + pub fn snd_seq_set_queue_tempo( + handle: *mut snd_seq_t, + q: c_int, + tempo: *mut snd_seq_queue_tempo_t, + ) -> c_int; pub fn snd_seq_queue_timer_sizeof() -> size_t; pub fn snd_seq_queue_timer_malloc(ptr: *mut *mut snd_seq_queue_timer_t) -> c_int; pub fn snd_seq_queue_timer_free(ptr: *mut snd_seq_queue_timer_t); - pub fn snd_seq_queue_timer_copy(dst: *mut snd_seq_queue_timer_t, src: *const snd_seq_queue_timer_t); + pub fn snd_seq_queue_timer_copy( + dst: *mut snd_seq_queue_timer_t, + src: *const snd_seq_queue_timer_t, + ); pub fn snd_seq_queue_timer_get_queue(info: *const snd_seq_queue_timer_t) -> c_int; - pub fn snd_seq_queue_timer_get_type(info: *const snd_seq_queue_timer_t) -> snd_seq_queue_timer_type_t; + pub fn snd_seq_queue_timer_get_type( + info: *const snd_seq_queue_timer_t, + ) -> snd_seq_queue_timer_type_t; pub fn snd_seq_queue_timer_get_id(info: *const snd_seq_queue_timer_t) -> *const snd_timer_id_t; pub fn snd_seq_queue_timer_get_resolution(info: *const snd_seq_queue_timer_t) -> c_uint; - pub fn snd_seq_queue_timer_set_type(info: *mut snd_seq_queue_timer_t, _type: snd_seq_queue_timer_type_t); + pub fn snd_seq_queue_timer_set_type( + info: *mut snd_seq_queue_timer_t, + _type: snd_seq_queue_timer_type_t, + ); pub fn snd_seq_queue_timer_set_id(info: *mut snd_seq_queue_timer_t, id: *const snd_timer_id_t); pub fn snd_seq_queue_timer_set_resolution(info: *mut snd_seq_queue_timer_t, resolution: c_uint); - pub fn snd_seq_get_queue_timer(handle: *mut snd_seq_t, q: c_int, timer: *mut snd_seq_queue_timer_t) -> c_int; - pub fn snd_seq_set_queue_timer(handle: *mut snd_seq_t, q: c_int, timer: *mut snd_seq_queue_timer_t) -> c_int; + pub fn snd_seq_get_queue_timer( + handle: *mut snd_seq_t, + q: c_int, + timer: *mut snd_seq_queue_timer_t, + ) -> c_int; + pub fn snd_seq_set_queue_timer( + handle: *mut snd_seq_t, + q: c_int, + timer: *mut snd_seq_queue_timer_t, + ) -> c_int; pub fn snd_seq_free_event(ev: *mut snd_seq_event_t) -> c_int; pub fn snd_seq_event_length(ev: *mut snd_seq_event_t) -> ssize_t; pub fn snd_seq_event_output(handle: *mut snd_seq_t, ev: *mut snd_seq_event_t) -> c_int; @@ -2081,40 +3663,91 @@ extern "C" { pub fn snd_seq_remove_events_sizeof() -> size_t; pub fn snd_seq_remove_events_malloc(ptr: *mut *mut snd_seq_remove_events_t) -> c_int; pub fn snd_seq_remove_events_free(ptr: *mut snd_seq_remove_events_t); - pub fn snd_seq_remove_events_copy(dst: *mut snd_seq_remove_events_t, src: *const snd_seq_remove_events_t); + pub fn snd_seq_remove_events_copy( + dst: *mut snd_seq_remove_events_t, + src: *const snd_seq_remove_events_t, + ); pub fn snd_seq_remove_events_get_condition(info: *const snd_seq_remove_events_t) -> c_uint; pub fn snd_seq_remove_events_get_queue(info: *const snd_seq_remove_events_t) -> c_int; - pub fn snd_seq_remove_events_get_time(info: *const snd_seq_remove_events_t) -> *const snd_seq_timestamp_t; - pub fn snd_seq_remove_events_get_dest(info: *const snd_seq_remove_events_t) -> *const snd_seq_addr_t; + pub fn snd_seq_remove_events_get_time( + info: *const snd_seq_remove_events_t, + ) -> *const snd_seq_timestamp_t; + pub fn snd_seq_remove_events_get_dest( + info: *const snd_seq_remove_events_t, + ) -> *const snd_seq_addr_t; pub fn snd_seq_remove_events_get_channel(info: *const snd_seq_remove_events_t) -> c_int; pub fn snd_seq_remove_events_get_event_type(info: *const snd_seq_remove_events_t) -> c_int; pub fn snd_seq_remove_events_get_tag(info: *const snd_seq_remove_events_t) -> c_int; pub fn snd_seq_remove_events_set_condition(info: *mut snd_seq_remove_events_t, flags: c_uint); pub fn snd_seq_remove_events_set_queue(info: *mut snd_seq_remove_events_t, queue: c_int); - pub fn snd_seq_remove_events_set_time(info: *mut snd_seq_remove_events_t, time: *const snd_seq_timestamp_t); - pub fn snd_seq_remove_events_set_dest(info: *mut snd_seq_remove_events_t, addr: *const snd_seq_addr_t); + pub fn snd_seq_remove_events_set_time( + info: *mut snd_seq_remove_events_t, + time: *const snd_seq_timestamp_t, + ); + pub fn snd_seq_remove_events_set_dest( + info: *mut snd_seq_remove_events_t, + addr: *const snd_seq_addr_t, + ); pub fn snd_seq_remove_events_set_channel(info: *mut snd_seq_remove_events_t, channel: c_int); pub fn snd_seq_remove_events_set_event_type(info: *mut snd_seq_remove_events_t, _type: c_int); pub fn snd_seq_remove_events_set_tag(info: *mut snd_seq_remove_events_t, tag: c_int); - pub fn snd_seq_remove_events(handle: *mut snd_seq_t, info: *mut snd_seq_remove_events_t) -> c_int; + pub fn snd_seq_remove_events( + handle: *mut snd_seq_t, + info: *mut snd_seq_remove_events_t, + ) -> c_int; pub fn snd_seq_set_bit(nr: c_int, array: *mut c_void); pub fn snd_seq_unset_bit(nr: c_int, array: *mut c_void); pub fn snd_seq_change_bit(nr: c_int, array: *mut c_void) -> c_int; pub fn snd_seq_get_bit(nr: c_int, array: *mut c_void) -> c_int; - pub fn snd_seq_control_queue(seq: *mut snd_seq_t, q: c_int, _type: c_int, value: c_int, ev: *mut snd_seq_event_t) -> c_int; - pub fn snd_seq_create_simple_port(seq: *mut snd_seq_t, name: *const c_char, caps: c_uint, _type: c_uint) -> c_int; + pub fn snd_seq_control_queue( + seq: *mut snd_seq_t, + q: c_int, + _type: c_int, + value: c_int, + ev: *mut snd_seq_event_t, + ) -> c_int; + pub fn snd_seq_create_simple_port( + seq: *mut snd_seq_t, + name: *const c_char, + caps: c_uint, + _type: c_uint, + ) -> c_int; pub fn snd_seq_delete_simple_port(seq: *mut snd_seq_t, port: c_int) -> c_int; - pub fn snd_seq_connect_from(seq: *mut snd_seq_t, my_port: c_int, src_client: c_int, src_port: c_int) -> c_int; - pub fn snd_seq_connect_to(seq: *mut snd_seq_t, my_port: c_int, dest_client: c_int, dest_port: c_int) -> c_int; - pub fn snd_seq_disconnect_from(seq: *mut snd_seq_t, my_port: c_int, src_client: c_int, src_port: c_int) -> c_int; - pub fn snd_seq_disconnect_to(seq: *mut snd_seq_t, my_port: c_int, dest_client: c_int, dest_port: c_int) -> c_int; + pub fn snd_seq_connect_from( + seq: *mut snd_seq_t, + my_port: c_int, + src_client: c_int, + src_port: c_int, + ) -> c_int; + pub fn snd_seq_connect_to( + seq: *mut snd_seq_t, + my_port: c_int, + dest_client: c_int, + dest_port: c_int, + ) -> c_int; + pub fn snd_seq_disconnect_from( + seq: *mut snd_seq_t, + my_port: c_int, + src_client: c_int, + src_port: c_int, + ) -> c_int; + pub fn snd_seq_disconnect_to( + seq: *mut snd_seq_t, + my_port: c_int, + dest_client: c_int, + dest_port: c_int, + ) -> c_int; pub fn snd_seq_set_client_name(seq: *mut snd_seq_t, name: *const c_char) -> c_int; pub fn snd_seq_set_client_event_filter(seq: *mut snd_seq_t, event_type: c_int) -> c_int; pub fn snd_seq_set_client_pool_output(seq: *mut snd_seq_t, size: size_t) -> c_int; pub fn snd_seq_set_client_pool_output_room(seq: *mut snd_seq_t, size: size_t) -> c_int; pub fn snd_seq_set_client_pool_input(seq: *mut snd_seq_t, size: size_t) -> c_int; pub fn snd_seq_sync_output_queue(seq: *mut snd_seq_t) -> c_int; - pub fn snd_seq_parse_address(seq: *mut snd_seq_t, addr: *mut snd_seq_addr_t, str: *const c_char) -> c_int; + pub fn snd_seq_parse_address( + seq: *mut snd_seq_t, + addr: *mut snd_seq_addr_t, + str: *const c_char, + ) -> c_int; pub fn snd_seq_reset_pool_output(seq: *mut snd_seq_t) -> c_int; pub fn snd_seq_reset_pool_input(seq: *mut snd_seq_t) -> c_int; pub fn snd_midi_event_new(bufsize: size_t, rdev: *mut *mut snd_midi_event_t) -> c_int; @@ -2124,7 +3757,21 @@ extern "C" { pub fn snd_midi_event_reset_encode(dev: *mut snd_midi_event_t); pub fn snd_midi_event_reset_decode(dev: *mut snd_midi_event_t); pub fn snd_midi_event_no_status(dev: *mut snd_midi_event_t, on: c_int); - pub fn snd_midi_event_encode(dev: *mut snd_midi_event_t, buf: *const c_uchar, count: c_long, ev: *mut snd_seq_event_t) -> c_long; - pub fn snd_midi_event_encode_byte(dev: *mut snd_midi_event_t, c: c_int, ev: *mut snd_seq_event_t) -> c_int; - pub fn snd_midi_event_decode(dev: *mut snd_midi_event_t, buf: *mut c_uchar, count: c_long, ev: *const snd_seq_event_t) -> c_long; + pub fn snd_midi_event_encode( + dev: *mut snd_midi_event_t, + buf: *const c_uchar, + count: c_long, + ev: *mut snd_seq_event_t, + ) -> c_long; + pub fn snd_midi_event_encode_byte( + dev: *mut snd_midi_event_t, + c: c_int, + ev: *mut snd_seq_event_t, + ) -> c_int; + pub fn snd_midi_event_decode( + dev: *mut snd_midi_event_t, + buf: *mut c_uchar, + count: c_long, + ev: *const snd_seq_event_t, + ) -> c_long; } diff --git a/asio-sys/build.rs b/asio-sys/build.rs index 1ef7e1f..0d0bd52 100644 --- a/asio-sys/build.rs +++ b/asio-sys/build.rs @@ -64,8 +64,8 @@ fn create_lib(cpal_asio_dir: &PathBuf) { let entry = match entry { Err(e) => { println!("error: {}", e); - continue - }, + continue; + } Ok(entry) => entry, }; match entry.path().extension().and_then(|s| s.to_str()) { @@ -127,8 +127,13 @@ fn create_bindings(cpal_asio_dir: &PathBuf) { ($opt_header:expr, $FILE_NAME:expr) => { match $opt_header.as_ref() { None => { - panic!("Could not find {} in {}: {}", $FILE_NAME, CPAL_ASIO_DIR, cpal_asio_dir.display()); - }, + panic!( + "Could not find {} in {}: {}", + $FILE_NAME, + CPAL_ASIO_DIR, + cpal_asio_dir.display() + ); + } Some(path) => path.to_str().expect("Could not convert path to str"), } }; @@ -152,9 +157,9 @@ fn create_bindings(cpal_asio_dir: &PathBuf) { .clang_arg("-x") .clang_arg("c++") .clang_arg("-std=c++14") - .clang_arg( format!("-I{}/{}", cpal_asio_dir.display(), "host/pc") ) - .clang_arg( format!("-I{}/{}", cpal_asio_dir.display(), "host") ) - .clang_arg( format!("-I{}/{}", cpal_asio_dir.display(), "common") ) + .clang_arg(format!("-I{}/{}", cpal_asio_dir.display(), "host/pc")) + .clang_arg(format!("-I{}/{}", cpal_asio_dir.display(), "host")) + .clang_arg(format!("-I{}/{}", cpal_asio_dir.display(), "common")) // Need to whitelist to avoid binding tp c++ std::* .whitelist_type("AsioDrivers") .whitelist_type("AsioDriver") diff --git a/asio-sys/examples/enumerate.rs b/asio-sys/examples/enumerate.rs index edc2623..121c481 100644 --- a/asio-sys/examples/enumerate.rs +++ b/asio-sys/examples/enumerate.rs @@ -38,8 +38,12 @@ fn main() { for name in asio.driver_names() { println!("Driver: {:?}", name); let driver = asio.load_driver(&name).expect("failed to load driver"); - let channels = driver.channels().expect("failed to retrieve channel counts"); - let sample_rate = driver.sample_rate().expect("failed to retrieve sample rate"); + let channels = driver + .channels() + .expect("failed to retrieve channel counts"); + let sample_rate = driver + .sample_rate() + .expect("failed to retrieve sample rate"); let in_fmt = Format { channels: channels.ins as _, sample_rate: SampleRate(sample_rate as _), diff --git a/asio-sys/examples/test.rs b/asio-sys/examples/test.rs index 3aa5869..9059323 100644 --- a/asio-sys/examples/test.rs +++ b/asio-sys/examples/test.rs @@ -5,7 +5,13 @@ fn main() { for driver in asio.driver_names() { println!("Driver: {}", driver); let driver = asio.load_driver(&driver).expect("failed to load drivers"); - println!(" Channels: {:?}", driver.channels().expect("failed to get channels")); - println!(" Sample rate: {:?}", driver.sample_rate().expect("failed to get sample rate")); + println!( + " Channels: {:?}", + driver.channels().expect("failed to get channels") + ); + println!( + " Sample rate: {:?}", + driver.sample_rate().expect("failed to get sample rate") + ); } } diff --git a/asio-sys/src/bindings/errors.rs b/asio-sys/src/bindings/errors.rs index 4c770e6..8c1e367 100644 --- a/asio-sys/src/bindings/errors.rs +++ b/asio-sys/src/bindings/errors.rs @@ -112,7 +112,9 @@ macro_rules! asio_result { r if r == AsioErrorWrapper::ASE_OK as i32 => Ok(()), r if r == AsioErrorWrapper::ASE_SUCCESS as i32 => Ok(()), r if r == AsioErrorWrapper::ASE_NotPresent as i32 => Err(AsioError::NoDrivers), - r if r == AsioErrorWrapper::ASE_HWMalfunction as i32 => Err(AsioError::HardwareMalfunction), + r if r == AsioErrorWrapper::ASE_HWMalfunction as i32 => { + Err(AsioError::HardwareMalfunction) + } r if r == AsioErrorWrapper::ASE_InvalidParameter as i32 => Err(AsioError::InvalidInput), r if r == AsioErrorWrapper::ASE_InvalidMode as i32 => Err(AsioError::BadMode), r if r == AsioErrorWrapper::ASE_SPNotAdvancing as i32 => Err(AsioError::HardwareStuck), diff --git a/asio-sys/src/bindings/mod.rs b/asio-sys/src/bindings/mod.rs index a1c7b1a..0964685 100644 --- a/asio-sys/src/bindings/mod.rs +++ b/asio-sys/src/bindings/mod.rs @@ -2,8 +2,8 @@ pub mod asio_import; #[macro_use] pub mod errors; -use num_traits::FromPrimitive; use self::errors::{AsioError, AsioErrorWrapper, LoadDriverError}; +use num_traits::FromPrimitive; use std::ffi::CStr; use std::ffi::CString; use std::os::raw::{c_char, c_double, c_long, c_void}; @@ -165,9 +165,12 @@ pub struct AsioBufferInfo { struct AsioCallbacks { buffer_switch: extern "C" fn(double_buffer_index: c_long, direct_process: c_long) -> (), sample_rate_did_change: extern "C" fn(s_rate: c_double) -> (), - asio_message: - extern "C" fn(selector: c_long, value: c_long, message: *mut (), opt: *mut c_double) - -> c_long, + asio_message: extern "C" fn( + selector: c_long, + value: c_long, + message: *mut (), + opt: *mut c_double, + ) -> c_long, buffer_switch_time_info: extern "C" fn( params: *mut ai::ASIOTime, double_buffer_index: c_long, @@ -276,8 +279,9 @@ impl Asio { } unsafe { - let num_drivers = ai::get_driver_names(driver_name_ptrs.as_mut_ptr(), MAX_DRIVERS as i32); - (0 .. num_drivers) + let num_drivers = + ai::get_driver_names(driver_name_ptrs.as_mut_ptr(), MAX_DRIVERS as i32); + (0..num_drivers) .map(|i| driver_name_to_utf8(&driver_names[i as usize]).to_string()) .collect() } @@ -317,8 +321,8 @@ impl Asio { } // Make owned CString to send to load driver - let driver_name_cstring = CString::new(driver_name) - .expect("failed to create `CString` from driver name"); + let driver_name_cstring = + CString::new(driver_name).expect("failed to create `CString` from driver name"); let mut driver_info = std::mem::MaybeUninit::::uninit(); unsafe { @@ -332,9 +336,15 @@ impl Asio { let state = Mutex::new(DriverState::Initialized); let name = driver_name.to_string(); let destroyed = false; - let inner = Arc::new(DriverInner { name, state, destroyed }); - *self.loaded_driver.lock().expect("failed to acquire loaded driver lock") = - Arc::downgrade(&inner); + let inner = Arc::new(DriverInner { + name, + state, + destroyed, + }); + *self + .loaded_driver + .lock() + .expect("failed to acquire loaded driver lock") = Arc::downgrade(&inner); let driver = Driver { inner }; Ok(driver) } @@ -461,7 +471,10 @@ impl Driver { mut input_buffer_infos: Vec, mut output_buffer_infos: Vec, ) -> Result { - let (input, output) = match (input_buffer_infos.is_empty(), output_buffer_infos.is_empty()) { + let (input, output) = match ( + input_buffer_infos.is_empty(), + output_buffer_infos.is_empty(), + ) { // Both stream exist. (false, false) => { // Create one continuous slice of buffers. @@ -481,7 +494,7 @@ impl Driver { buffer_size, }); (input, output) - }, + } // Just input (false, true) => { let buffer_size = self.create_buffers(&mut input_buffer_infos)?; @@ -491,7 +504,7 @@ impl Driver { }); let output = None; (input, output) - }, + } // Just output (true, false) => { let buffer_size = self.create_buffers(&mut output_buffer_infos)?; @@ -501,7 +514,7 @@ impl Driver { buffer_size, }); (input, output) - }, + } // Impossible (true, true) => unreachable!("Trying to create streams without preparing"), }; @@ -729,7 +742,11 @@ fn prepare_buffer_infos(is_input: bool, n_channels: usize) -> Vec Result { /// /// This converts to utf8. fn driver_name_to_utf8(bytes: &[c_char]) -> std::borrow::Cow { - unsafe { - CStr::from_ptr(bytes.as_ptr()).to_string_lossy() - } + unsafe { CStr::from_ptr(bytes.as_ptr()).to_string_lossy() } } /// ASIO uses null terminated c strings for channel names. /// /// This converts to utf8. fn _channel_name_to_utf8(bytes: &[c_char]) -> std::borrow::Cow { - unsafe { - CStr::from_ptr(bytes.as_ptr()).to_string_lossy() - } + unsafe { CStr::from_ptr(bytes.as_ptr()).to_string_lossy() } } /// Indicates the stream sample rate has changed. @@ -917,8 +930,9 @@ extern "C" fn buffer_switch(double_buffer_index: c_long, direct_process: c_long) &mut time.time_info.system_time, ); if let Ok(()) = asio_result!(res) { - time.time_info.flags = - (ai::AsioTimeInfoFlags::kSystemTimeValid | ai::AsioTimeInfoFlags::kSamplePositionValid).0; + time.time_info.flags = (ai::AsioTimeInfoFlags::kSystemTimeValid + | ai::AsioTimeInfoFlags::kSamplePositionValid) + .0; } time }; @@ -930,7 +944,16 @@ extern "C" fn buffer_switch(double_buffer_index: c_long, direct_process: c_long) #[test] fn check_type_sizes() { - assert_eq!(std::mem::size_of::(), std::mem::size_of::()); - assert_eq!(std::mem::size_of::(), std::mem::size_of::()); - assert_eq!(std::mem::size_of::(), std::mem::size_of::()); + assert_eq!( + std::mem::size_of::(), + std::mem::size_of::() + ); + assert_eq!( + std::mem::size_of::(), + std::mem::size_of::() + ); + assert_eq!( + std::mem::size_of::(), + std::mem::size_of::() + ); } diff --git a/asio-sys/src/lib.rs b/asio-sys/src/lib.rs index a071e7b..e27209e 100644 --- a/asio-sys/src/lib.rs +++ b/asio-sys/src/lib.rs @@ -13,6 +13,6 @@ extern crate num_traits; #[cfg(asio)] pub mod bindings; #[cfg(asio)] -pub use bindings::*; -#[cfg(asio)] pub use bindings::errors::{AsioError, LoadDriverError}; +#[cfg(asio)] +pub use bindings::*; diff --git a/build.rs b/build.rs index 3975ea9..fbb2344 100644 --- a/build.rs +++ b/build.rs @@ -3,10 +3,10 @@ use std::env; const CPAL_ASIO_DIR: &'static str = "CPAL_ASIO_DIR"; fn main() { - // If ASIO directory isn't set silently return early + // If ASIO directory isn't set silently return early // otherwise set the asio config flag match env::var(CPAL_ASIO_DIR) { Err(_) => return, Ok(_) => println!("cargo:rustc-cfg=asio"), }; -} \ No newline at end of file +} diff --git a/examples/enumerate.rs b/examples/enumerate.rs index 2ed57f3..56542eb 100644 --- a/examples/enumerate.rs +++ b/examples/enumerate.rs @@ -1,5 +1,5 @@ -extern crate cpal; extern crate anyhow; +extern crate cpal; use cpal::traits::{DeviceTrait, HostTrait}; @@ -30,12 +30,17 @@ fn main() -> Result<(), anyhow::Error> { Err(e) => { println!("Error: {:?}", e); continue; - }, + } }; if input_formats.peek().is_some() { println!(" All supported input stream formats:"); for (format_index, format) in input_formats.enumerate() { - println!(" {}.{}. {:?}", device_index + 1, format_index + 1, format); + println!( + " {}.{}. {:?}", + device_index + 1, + format_index + 1, + format + ); } } @@ -48,12 +53,17 @@ fn main() -> Result<(), anyhow::Error> { Err(e) => { println!("Error: {:?}", e); continue; - }, + } }; if output_formats.peek().is_some() { println!(" All supported output stream formats:"); for (format_index, format) in output_formats.enumerate() { - println!(" {}.{}. {:?}", device_index + 1, format_index + 1, format); + println!( + " {}.{}. {:?}", + device_index + 1, + format_index + 1, + format + ); } } } diff --git a/examples/feedback.rs b/examples/feedback.rs index 6e8c48e..e935c5d 100644 --- a/examples/feedback.rs +++ b/examples/feedback.rs @@ -69,11 +69,14 @@ fn main() -> Result<(), anyhow::Error> { Err(err) => { input_fell_behind = Some(err); 0.0 - }, + } }; } if let Some(err) = input_fell_behind { - eprintln!("input stream fell behind: {:?}: try increasing latency", err); + eprintln!( + "input stream fell behind: {:?}: try increasing latency", + err + ); } }; diff --git a/examples/record_wav.rs b/examples/record_wav.rs index 5d00b8e..44207b6 100644 --- a/examples/record_wav.rs +++ b/examples/record_wav.rs @@ -7,9 +7,9 @@ extern crate cpal; extern crate hound; use cpal::traits::{DeviceTrait, HostTrait, StreamTrait}; -use std::sync::{Arc, Mutex}; use std::fs::File; use std::io::BufWriter; +use std::sync::{Arc, Mutex}; fn main() -> Result<(), anyhow::Error> { // Use the default host for working with audio devices. @@ -40,12 +40,10 @@ fn main() -> Result<(), anyhow::Error> { eprintln!("an error occurred on stream: {}", err); }; - let data_fn = move |data: &cpal::Data| { - match data.sample_format() { - cpal::SampleFormat::F32 => write_input_data::(data, &writer_2), - cpal::SampleFormat::I16 => write_input_data::(data, &writer_2), - cpal::SampleFormat::U16 => write_input_data::(data, &writer_2), - } + let data_fn = move |data: &cpal::Data| match data.sample_format() { + cpal::SampleFormat::F32 => write_input_data::(data, &writer_2), + cpal::SampleFormat::I16 => write_input_data::(data, &writer_2), + cpal::SampleFormat::U16 => write_input_data::(data, &writer_2), }; let stream = device.build_input_stream(&format, data_fn, err_fn)?; diff --git a/src/host/alsa/enumerate.rs b/src/host/alsa/enumerate.rs index b8b53df..180e841 100644 --- a/src/host/alsa/enumerate.rs +++ b/src/host/alsa/enumerate.rs @@ -1,9 +1,9 @@ -use {BackendSpecificError, DevicesError}; -use super::Device; use super::alsa; use super::check_errors; +use super::Device; use std::ffi::CString; use std::ptr; +use {BackendSpecificError, DevicesError}; /// ALSA implementation for `Devices`. pub struct Devices { @@ -36,10 +36,8 @@ impl Devices { } } -unsafe impl Send for Devices { -} -unsafe impl Sync for Devices { -} +unsafe impl Send for Devices {} +unsafe impl Sync for Devices {} impl Drop for Devices { #[inline] @@ -61,8 +59,10 @@ impl Iterator for Devices { } let name = { - let n_ptr = alsa::snd_device_name_get_hint(*self.next_str as *const _, - b"NAME\0".as_ptr() as *const _); + let n_ptr = alsa::snd_device_name_get_hint( + *self.next_str as *const _, + b"NAME\0".as_ptr() as *const _, + ); if !n_ptr.is_null() { let bytes = CString::from_raw(n_ptr).into_bytes(); let string = String::from_utf8(bytes).unwrap(); @@ -73,8 +73,10 @@ impl Iterator for Devices { }; let io = { - let n_ptr = alsa::snd_device_name_get_hint(*self.next_str as *const _, - b"IOID\0".as_ptr() as *const _); + let n_ptr = alsa::snd_device_name_get_hint( + *self.next_str as *const _, + b"IOID\0".as_ptr() as *const _, + ); if !n_ptr.is_null() { let bytes = CString::from_raw(n_ptr).into_bytes(); let string = String::from_utf8(bytes).unwrap(); @@ -99,7 +101,7 @@ impl Iterator for Devices { continue; } name - }, + } _ => continue, }; diff --git a/src/host/alsa/mod.rs b/src/host/alsa/mod.rs index 512ed0c..a241b7e 100644 --- a/src/host/alsa/mod.rs +++ b/src/host/alsa/mod.rs @@ -2,26 +2,14 @@ extern crate alsa_sys as alsa; extern crate libc; use crate::{ - BackendSpecificError, - BuildStreamError, - ChannelCount, - Data, - DefaultFormatError, - DeviceNameError, - DevicesError, - Format, - PauseStreamError, - PlayStreamError, - SampleFormat, - SampleRate, - StreamError, - SupportedFormat, - SupportedFormatsError, + BackendSpecificError, BuildStreamError, ChannelCount, Data, DefaultFormatError, + DeviceNameError, DevicesError, Format, PauseStreamError, PlayStreamError, SampleFormat, + SampleRate, StreamError, SupportedFormat, SupportedFormatsError, }; -use std::{cmp, ffi, io, ptr}; use std::sync::Arc; use std::thread::{self, JoinHandle}; use std::vec::IntoIter as VecIntoIter; +use std::{cmp, ffi, io, ptr}; use traits::{DeviceTrait, HostTrait, StreamTrait}; pub use self::enumerate::{default_input_device, default_output_device, Devices}; @@ -72,11 +60,15 @@ impl DeviceTrait for Device { Device::name(self) } - fn supported_input_formats(&self) -> Result { + fn supported_input_formats( + &self, + ) -> Result { Device::supported_input_formats(self) } - fn supported_output_formats(&self) -> Result { + fn supported_output_formats( + &self, + ) -> Result { Device::supported_output_formats(self) } @@ -119,7 +111,6 @@ impl DeviceTrait for Device { } } - struct TriggerSender(libc::c_int); struct TriggerReceiver(libc::c_int); @@ -247,8 +238,7 @@ impl Device { unsafe fn supported_formats( &self, stream_t: alsa::snd_pcm_stream_t, - ) -> Result, SupportedFormatsError> - { + ) -> Result, SupportedFormatsError> { let mut handle = ptr::null_mut(); let device_name = match ffi::CString::new(&self.0[..]) { Ok(name) => name, @@ -284,53 +274,50 @@ impl Device { }; // TODO: check endianess - const FORMATS: [(SampleFormat, alsa::snd_pcm_format_t); 3] = - [ - //SND_PCM_FORMAT_S8, - //SND_PCM_FORMAT_U8, - (SampleFormat::I16, alsa::SND_PCM_FORMAT_S16_LE), - //SND_PCM_FORMAT_S16_BE, - (SampleFormat::U16, alsa::SND_PCM_FORMAT_U16_LE), - //SND_PCM_FORMAT_U16_BE, - /*SND_PCM_FORMAT_S24_LE, - SND_PCM_FORMAT_S24_BE, - SND_PCM_FORMAT_U24_LE, - SND_PCM_FORMAT_U24_BE, - SND_PCM_FORMAT_S32_LE, - SND_PCM_FORMAT_S32_BE, - SND_PCM_FORMAT_U32_LE, - SND_PCM_FORMAT_U32_BE,*/ - (SampleFormat::F32, alsa::SND_PCM_FORMAT_FLOAT_LE) /*SND_PCM_FORMAT_FLOAT_BE, - SND_PCM_FORMAT_FLOAT64_LE, - SND_PCM_FORMAT_FLOAT64_BE, - SND_PCM_FORMAT_IEC958_SUBFRAME_LE, - SND_PCM_FORMAT_IEC958_SUBFRAME_BE, - SND_PCM_FORMAT_MU_LAW, - SND_PCM_FORMAT_A_LAW, - SND_PCM_FORMAT_IMA_ADPCM, - SND_PCM_FORMAT_MPEG, - SND_PCM_FORMAT_GSM, - SND_PCM_FORMAT_SPECIAL, - SND_PCM_FORMAT_S24_3LE, - SND_PCM_FORMAT_S24_3BE, - SND_PCM_FORMAT_U24_3LE, - SND_PCM_FORMAT_U24_3BE, - SND_PCM_FORMAT_S20_3LE, - SND_PCM_FORMAT_S20_3BE, - SND_PCM_FORMAT_U20_3LE, - SND_PCM_FORMAT_U20_3BE, - SND_PCM_FORMAT_S18_3LE, - SND_PCM_FORMAT_S18_3BE, - SND_PCM_FORMAT_U18_3LE, - SND_PCM_FORMAT_U18_3BE,*/, - ]; + const FORMATS: [(SampleFormat, alsa::snd_pcm_format_t); 3] = [ + //SND_PCM_FORMAT_S8, + //SND_PCM_FORMAT_U8, + (SampleFormat::I16, alsa::SND_PCM_FORMAT_S16_LE), + //SND_PCM_FORMAT_S16_BE, + (SampleFormat::U16, alsa::SND_PCM_FORMAT_U16_LE), + //SND_PCM_FORMAT_U16_BE, + //SND_PCM_FORMAT_S24_LE, + //SND_PCM_FORMAT_S24_BE, + //SND_PCM_FORMAT_U24_LE, + //SND_PCM_FORMAT_U24_BE, + //SND_PCM_FORMAT_S32_LE, + //SND_PCM_FORMAT_S32_BE, + //SND_PCM_FORMAT_U32_LE, + //SND_PCM_FORMAT_U32_BE, + (SampleFormat::F32, alsa::SND_PCM_FORMAT_FLOAT_LE), + //SND_PCM_FORMAT_FLOAT_BE, + //SND_PCM_FORMAT_FLOAT64_LE, + //SND_PCM_FORMAT_FLOAT64_BE, + //SND_PCM_FORMAT_IEC958_SUBFRAME_LE, + //SND_PCM_FORMAT_IEC958_SUBFRAME_BE, + //SND_PCM_FORMAT_MU_LAW, + //SND_PCM_FORMAT_A_LAW, + //SND_PCM_FORMAT_IMA_ADPCM, + //SND_PCM_FORMAT_MPEG, + //SND_PCM_FORMAT_GSM, + //SND_PCM_FORMAT_SPECIAL, + //SND_PCM_FORMAT_S24_3LE, + //SND_PCM_FORMAT_S24_3BE, + //SND_PCM_FORMAT_U24_3LE, + //SND_PCM_FORMAT_U24_3BE, + //SND_PCM_FORMAT_S20_3LE, + //SND_PCM_FORMAT_S20_3BE, + //SND_PCM_FORMAT_U20_3LE, + //SND_PCM_FORMAT_U20_3BE, + //SND_PCM_FORMAT_S18_3LE, + //SND_PCM_FORMAT_S18_3BE, + //SND_PCM_FORMAT_U18_3LE, + //SND_PCM_FORMAT_U18_3BE, + ]; let mut supported_formats = Vec::new(); for &(sample_format, alsa_format) in FORMATS.iter() { - if alsa::snd_pcm_hw_params_test_format(handle, - hw_params.0, - alsa_format) == 0 - { + if alsa::snd_pcm_hw_params_test_format(handle, hw_params.0, alsa_format) == 0 { supported_formats.push(sample_format); } } @@ -357,34 +344,19 @@ impl Device { return Err(err.into()); } - let sample_rates = if min_rate == max_rate || - alsa::snd_pcm_hw_params_test_rate(handle, hw_params.0, min_rate + 1, 0) == 0 + let sample_rates = if min_rate == max_rate + || alsa::snd_pcm_hw_params_test_rate(handle, hw_params.0, min_rate + 1, 0) == 0 { vec![(min_rate, max_rate)] } else { const RATES: [libc::c_uint; 13] = [ - 5512, - 8000, - 11025, - 16000, - 22050, - 32000, - 44100, - 48000, - 64000, - 88200, - 96000, - 176400, + 5512, 8000, 11025, 16000, 22050, 32000, 44100, 48000, 64000, 88200, 96000, 176400, 192000, ]; let mut rates = Vec::new(); for &rate in RATES.iter() { - if alsa::snd_pcm_hw_params_test_rate(handle, - hw_params.0, - rate, - 0) == 0 - { + if alsa::snd_pcm_hw_params_test_rate(handle, hw_params.0, rate, 0) == 0 { rates.push((rate, rate)); } } @@ -397,44 +369,48 @@ impl Device { }; let mut min_channels = 0; - if let Err(desc) = check_errors(alsa::snd_pcm_hw_params_get_channels_min(hw_params.0, &mut min_channels)) { + if let Err(desc) = check_errors(alsa::snd_pcm_hw_params_get_channels_min( + hw_params.0, + &mut min_channels, + )) { let description = format!("unable to get minimum supported channel count: {}", desc); let err = BackendSpecificError { description }; return Err(err.into()); } let mut max_channels = 0; - if let Err(desc) = check_errors(alsa::snd_pcm_hw_params_get_channels_max(hw_params.0, &mut max_channels)) { + if let Err(desc) = check_errors(alsa::snd_pcm_hw_params_get_channels_max( + hw_params.0, + &mut max_channels, + )) { let description = format!("unable to get maximum supported channel count: {}", desc); let err = BackendSpecificError { description }; return Err(err.into()); } let max_channels = cmp::min(max_channels, 32); // TODO: limiting to 32 channels or too much stuff is returned - let supported_channels = (min_channels .. max_channels + 1) - .filter_map(|num| if alsa::snd_pcm_hw_params_test_channels( - handle, - hw_params.0, - num, - ) == 0 - { - Some(num as ChannelCount) - } else { - None + let supported_channels = (min_channels..max_channels + 1) + .filter_map(|num| { + if alsa::snd_pcm_hw_params_test_channels(handle, hw_params.0, num) == 0 { + Some(num as ChannelCount) + } else { + None + } }) .collect::>(); - let mut output = Vec::with_capacity(supported_formats.len() * supported_channels.len() * - sample_rates.len()); + let mut output = Vec::with_capacity( + supported_formats.len() * supported_channels.len() * sample_rates.len(), + ); for &data_type in supported_formats.iter() { for channels in supported_channels.iter() { for &(min_rate, max_rate) in sample_rates.iter() { output.push(SupportedFormat { - channels: channels.clone(), - min_sample_rate: SampleRate(min_rate as u32), - max_sample_rate: SampleRate(max_rate as u32), - data_type: data_type, - }); + channels: channels.clone(), + min_sample_rate: SampleRate(min_rate as u32), + max_sample_rate: SampleRate(max_rate as u32), + data_type: data_type, + }); } } } @@ -445,15 +421,11 @@ impl Device { } fn supported_input_formats(&self) -> Result { - unsafe { - self.supported_formats(alsa::SND_PCM_STREAM_CAPTURE) - } + unsafe { self.supported_formats(alsa::SND_PCM_STREAM_CAPTURE) } } fn supported_output_formats(&self) -> Result { - unsafe { - self.supported_formats(alsa::SND_PCM_STREAM_PLAYBACK) - } + unsafe { self.supported_formats(alsa::SND_PCM_STREAM_PLAYBACK) } } // ALSA does not offer default stream formats, so instead we compare all supported formats by @@ -461,13 +433,12 @@ impl Device { fn default_format( &self, stream_t: alsa::snd_pcm_stream_t, - ) -> Result - { + ) -> Result { let mut formats: Vec<_> = unsafe { match self.supported_formats(stream_t) { Err(SupportedFormatsError::DeviceNotAvailable) => { return Err(DefaultFormatError::DeviceNotAvailable); - }, + } Err(SupportedFormatsError::InvalidArgument) => { // this happens sometimes when querying for input and output capabilities but // the device supports only one @@ -492,8 +463,8 @@ impl Device { format.sample_rate = HZ_44100; } Ok(format) - }, - None => Err(DefaultFormatError::StreamTypeNotSupported) + } + None => Err(DefaultFormatError::StreamTypeNotSupported), } } @@ -536,7 +507,10 @@ unsafe impl Send for StreamInner {} unsafe impl Sync for StreamInner {} #[derive(Debug, Eq, PartialEq)] -enum StreamType { Input, Output } +enum StreamType { + Input, + Output, +} pub struct Stream { /// The high-priority audio processing thread calling callbacks. @@ -567,7 +541,10 @@ fn input_stream_worker( match poll_descriptors_and_prepare_buffer(&rx, stream, &mut ctxt, error_callback) { PollDescriptorsFlow::Continue => continue, PollDescriptorsFlow::Return => return, - PollDescriptorsFlow::Ready { available_frames, stream_type } => { + PollDescriptorsFlow::Ready { + available_frames, + stream_type, + } => { assert_eq!( stream_type, StreamType::Input, @@ -596,7 +573,10 @@ fn output_stream_worker( match poll_descriptors_and_prepare_buffer(&rx, stream, &mut ctxt, error_callback) { PollDescriptorsFlow::Continue => continue, PollDescriptorsFlow::Return => return, - PollDescriptorsFlow::Ready { available_frames, stream_type } => { + PollDescriptorsFlow::Ready { + available_frames, + stream_type, + } => { assert_eq!( stream_type, StreamType::Output, @@ -620,7 +600,7 @@ enum PollDescriptorsFlow { Ready { stream_type: StreamType, available_frames: usize, - } + }, } // This block is shared between both input and output stream worker functions. @@ -661,7 +641,11 @@ fn poll_descriptors_and_prepare_buffer( let res = unsafe { // Don't timeout, wait forever. - libc::poll(descriptors.as_mut_ptr(), descriptors.len() as libc::nfds_t, -1) + libc::poll( + descriptors.as_mut_ptr(), + descriptors.len() as libc::nfds_t, + -1, + ) }; if res < 0 { let description = format!("`libc::poll()` failed: {}", io::Error::last_os_error()); @@ -684,7 +668,7 @@ fn poll_descriptors_and_prepare_buffer( Ok(None) => { // Nothing to process, poll again return PollDescriptorsFlow::Continue; - }, + } Err(err) => { error_callback(err.into()); return PollDescriptorsFlow::Continue; @@ -739,9 +723,7 @@ fn process_input( let sample_format = stream.sample_format; let data = buffer.as_mut_ptr() as *mut (); let len = buffer.len() / sample_format.sample_size(); - let data = unsafe { - Data::from_parts(data, len, sample_format) - }; + let data = unsafe { Data::from_parts(data, len, sample_format) }; data_callback(&data); } @@ -760,9 +742,7 @@ fn process_output( let sample_format = stream.sample_format; let data = buffer.as_mut_ptr() as *mut (); let len = buffer.len() / sample_format.sample_size(); - let mut data = unsafe { - Data::from_parts(data, len, sample_format) - }; + let mut data = unsafe { Data::from_parts(data, len, sample_format) }; data_callback(&mut data); } loop { @@ -784,9 +764,8 @@ fn process_output( } else if result as usize != available_frames { let description = format!( "unexpected number of frames written: expected {}, \ - result {} (this should never happen)", - available_frames, - result, + result {} (this should never happen)", + available_frames, result, ); error_callback(BackendSpecificError { description }.into()); continue; @@ -857,7 +836,7 @@ impl StreamTrait for Stream { // TODO: error handling Ok(()) } - fn pause(&self)-> Result<(), PauseStreamError> { + fn pause(&self) -> Result<(), PauseStreamError> { unsafe { alsa::snd_pcm_pause(self.inner.channel, 1); } @@ -888,8 +867,7 @@ fn check_for_pollout_or_pollin( (revent, res) }; if let Err(desc) = check_errors(res) { - let description = - format!("`snd_pcm_poll_descriptors_revents` failed: {}",desc); + let description = format!("`snd_pcm_poll_descriptors_revents` failed: {}", desc); let err = BackendSpecificError { description }; return Err(err); } @@ -905,9 +883,7 @@ fn check_for_pollout_or_pollin( // Determine the number of samples that are available to read/write. fn get_available_samples(stream: &StreamInner) -> Result { - let available = unsafe { - alsa::snd_pcm_avail_update(stream.channel) - }; + let available = unsafe { alsa::snd_pcm_avail_update(stream.channel) }; if available == -32 { // buffer underrun // TODO: Notify the user some how. @@ -929,9 +905,11 @@ unsafe fn set_hw_params_from_format( if let Err(e) = check_errors(alsa::snd_pcm_hw_params_any(pcm_handle, hw_params.0)) { return Err(format!("errors on pcm handle: {}", e)); } - if let Err(e) = check_errors(alsa::snd_pcm_hw_params_set_access(pcm_handle, - hw_params.0, - alsa::SND_PCM_ACCESS_RW_INTERLEAVED)) { + if let Err(e) = check_errors(alsa::snd_pcm_hw_params_set_access( + pcm_handle, + hw_params.0, + alsa::SND_PCM_ACCESS_RW_INTERLEAVED, + )) { return Err(format!("handle not acessible: {}", e)); } @@ -949,21 +927,26 @@ unsafe fn set_hw_params_from_format( } }; - if let Err(e) = check_errors(alsa::snd_pcm_hw_params_set_format(pcm_handle, - hw_params.0, - data_type)) { + if let Err(e) = check_errors(alsa::snd_pcm_hw_params_set_format( + pcm_handle, + hw_params.0, + data_type, + )) { return Err(format!("format could not be set: {}", e)); } - if let Err(e) = check_errors(alsa::snd_pcm_hw_params_set_rate(pcm_handle, - hw_params.0, - format.sample_rate.0 as libc::c_uint, - 0)) { + if let Err(e) = check_errors(alsa::snd_pcm_hw_params_set_rate( + pcm_handle, + hw_params.0, + format.sample_rate.0 as libc::c_uint, + 0, + )) { return Err(format!("sample rate could not be set: {}", e)); } - if let Err(e) = check_errors(alsa::snd_pcm_hw_params_set_channels(pcm_handle, - hw_params.0, - format.channels as - libc::c_uint)) { + if let Err(e) = check_errors(alsa::snd_pcm_hw_params_set_channels( + pcm_handle, + hw_params.0, + format.channels as libc::c_uint, + )) { return Err(format!("channel count could not be set: {}", e)); } @@ -987,8 +970,7 @@ unsafe fn set_hw_params_from_format( unsafe fn set_sw_params_from_format( pcm_handle: *mut alsa::snd_pcm_t, format: &Format, -) -> Result<(usize, usize), String> -{ +) -> Result<(usize, usize), String> { let mut sw_params = ptr::null_mut(); // TODO: RAII if let Err(e) = check_errors(alsa::snd_pcm_sw_params_malloc(&mut sw_params)) { return Err(format!("snd_pcm_sw_params_malloc failed: {}", e)); @@ -996,20 +978,31 @@ unsafe fn set_sw_params_from_format( if let Err(e) = check_errors(alsa::snd_pcm_sw_params_current(pcm_handle, sw_params)) { return Err(format!("snd_pcm_sw_params_current failed: {}", e)); } - if let Err(e) = check_errors(alsa::snd_pcm_sw_params_set_start_threshold(pcm_handle, sw_params, 0)) { - return Err(format!("snd_pcm_sw_params_set_start_threshold failed: {}", e)); + if let Err(e) = check_errors(alsa::snd_pcm_sw_params_set_start_threshold( + pcm_handle, sw_params, 0, + )) { + return Err(format!( + "snd_pcm_sw_params_set_start_threshold failed: {}", + e + )); } let (buffer_len, period_len) = { let mut buffer = 0; let mut period = 0; - if let Err(e) = check_errors(alsa::snd_pcm_get_params(pcm_handle, &mut buffer, &mut period)) { + if let Err(e) = check_errors(alsa::snd_pcm_get_params( + pcm_handle, + &mut buffer, + &mut period, + )) { return Err(format!("failed to initialize buffer: {}", e)); } if buffer == 0 { return Err(format!("initialization resulted in a null buffer")); } - if let Err(e) = check_errors(alsa::snd_pcm_sw_params_set_avail_min(pcm_handle, sw_params, period)) { + if let Err(e) = check_errors(alsa::snd_pcm_sw_params_set_avail_min( + pcm_handle, sw_params, period, + )) { return Err(format!("snd_pcm_sw_params_set_avail_min failed: {}", e)); } let buffer = buffer as usize * format.channels as usize; diff --git a/src/host/asio/device.rs b/src/host/asio/device.rs index 4025a74..b0b6532 100644 --- a/src/host/asio/device.rs +++ b/src/host/asio/device.rs @@ -2,8 +2,10 @@ use std; pub type SupportedInputFormats = std::vec::IntoIter; pub type SupportedOutputFormats = std::vec::IntoIter; +use super::parking_lot::Mutex; +use super::sys; use std::hash::{Hash, Hasher}; -use std::sync::{Arc}; +use std::sync::Arc; use BackendSpecificError; use DefaultFormatError; use DeviceNameError; @@ -13,8 +15,6 @@ use SampleFormat; use SampleRate; use SupportedFormat; use SupportedFormatsError; -use super::sys; -use super::parking_lot::Mutex; /// A ASIO Device pub struct Device { @@ -55,9 +55,7 @@ impl Device { /// Gets the supported input formats. /// TODO currently only supports the default. /// Need to find all possible formats. - pub fn supported_input_formats( - &self, - ) -> Result { + pub fn supported_input_formats(&self) -> Result { // Retrieve the default format for the total supported channels and supported sample // format. let mut f = match self.default_input_format() { @@ -68,7 +66,12 @@ impl Device { // Collect a format for every combination of supported sample rate and number of channels. let mut supported_formats = vec![]; for &rate in ::COMMON_SAMPLE_RATES { - if !self.driver.can_sample_rate(rate.0.into()).ok().unwrap_or(false) { + if !self + .driver + .can_sample_rate(rate.0.into()) + .ok() + .unwrap_or(false) + { continue; } for channels in 1..f.channels + 1 { @@ -96,7 +99,12 @@ impl Device { // Collect a format for every combination of supported sample rate and number of channels. let mut supported_formats = vec![]; for &rate in ::COMMON_SAMPLE_RATES { - if !self.driver.can_sample_rate(rate.0.into()).ok().unwrap_or(false) { + if !self + .driver + .can_sample_rate(rate.0.into()) + .ok() + .unwrap_or(false) + { continue; } for channels in 1..f.channels + 1 { @@ -114,8 +122,8 @@ impl Device { let sample_rate = SampleRate(self.driver.sample_rate().map_err(default_format_err)? as _); // Map th ASIO sample type to a CPAL sample type let data_type = self.driver.input_data_type().map_err(default_format_err)?; - let data_type = convert_data_type(&data_type) - .ok_or(DefaultFormatError::StreamTypeNotSupported)?; + let data_type = + convert_data_type(&data_type).ok_or(DefaultFormatError::StreamTypeNotSupported)?; Ok(Format { channels, sample_rate, @@ -128,8 +136,8 @@ impl Device { let channels = self.driver.channels().map_err(default_format_err)?.outs as u16; let sample_rate = SampleRate(self.driver.sample_rate().map_err(default_format_err)? as _); let data_type = self.driver.output_data_type().map_err(default_format_err)?; - let data_type = convert_data_type(&data_type) - .ok_or(DefaultFormatError::StreamTypeNotSupported)?; + let data_type = + convert_data_type(&data_type).ok_or(DefaultFormatError::StreamTypeNotSupported)?; Ok(Format { channels, sample_rate, @@ -159,10 +167,13 @@ impl Iterator for Devices { input: None, output: None, })); - return Some(Device { driver, asio_streams }); + return Some(Device { + driver, + asio_streams, + }); } Err(_) => continue, - } + }, None => return None, } } @@ -193,8 +204,9 @@ pub(crate) fn convert_data_type(ty: &sys::AsioSampleType) -> Option DefaultFormatError { match e { - sys::AsioError::NoDrivers | - sys::AsioError::HardwareMalfunction => DefaultFormatError::DeviceNotAvailable, + sys::AsioError::NoDrivers | sys::AsioError::HardwareMalfunction => { + DefaultFormatError::DeviceNotAvailable + } sys::AsioError::NoRate => DefaultFormatError::StreamTypeNotSupported, err => { let description = format!("{}", err); diff --git a/src/host/asio/mod.rs b/src/host/asio/mod.rs index 3295470..b875469 100644 --- a/src/host/asio/mod.rs +++ b/src/host/asio/mod.rs @@ -2,22 +2,10 @@ extern crate asio_sys as sys; extern crate parking_lot; use crate::{ - BuildStreamError, - Data, - DefaultFormatError, - DeviceNameError, - DevicesError, - Format, - PauseStreamError, - PlayStreamError, - StreamError, - SupportedFormatsError, -}; -use traits::{ - DeviceTrait, - HostTrait, - StreamTrait, + BuildStreamError, Data, DefaultFormatError, DeviceNameError, DevicesError, Format, + PauseStreamError, PlayStreamError, StreamError, SupportedFormatsError, }; +use traits::{DeviceTrait, HostTrait, StreamTrait}; pub use self::device::{Device, Devices, SupportedInputFormats, SupportedOutputFormats}; pub use self::stream::Stream; @@ -73,11 +61,15 @@ impl DeviceTrait for Device { Device::name(self) } - fn supported_input_formats(&self) -> Result { + fn supported_input_formats( + &self, + ) -> Result { Device::supported_input_formats(self) } - fn supported_output_formats(&self) -> Result { + fn supported_output_formats( + &self, + ) -> Result { Device::supported_output_formats(self) } @@ -97,7 +89,7 @@ impl DeviceTrait for Device { ) -> Result where D: FnMut(&Data) + Send + 'static, - E: FnMut(StreamError) + Send + 'static + E: FnMut(StreamError) + Send + 'static, { Device::build_input_stream(self, format, data_callback, error_callback) } @@ -110,7 +102,7 @@ impl DeviceTrait for Device { ) -> Result where D: FnMut(&mut Data) + Send + 'static, - E: FnMut(StreamError) + Send + 'static + E: FnMut(StreamError) + Send + 'static, { Device::build_output_stream(self, format, data_callback, error_callback) } diff --git a/src/host/asio/stream.rs b/src/host/asio/stream.rs index 696491c..24fd59f 100644 --- a/src/host/asio/stream.rs +++ b/src/host/asio/stream.rs @@ -2,11 +2,11 @@ extern crate asio_sys as sys; extern crate num_traits; use self::num_traits::PrimInt; +use super::parking_lot::Mutex; use super::Device; use std; -use std::sync::atomic::{Ordering, AtomicBool}; +use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Arc; -use super::parking_lot::Mutex; use BackendSpecificError; use BuildStreamError; use Data; @@ -93,7 +93,7 @@ impl Device { let callback_id = self.driver.add_callback(move |buffer_index| unsafe { // If not playing return early. if !playing.load(Ordering::SeqCst) { - return + return; } // There is 0% chance of lock contention the host only locks when recreating streams. @@ -111,8 +111,7 @@ impl Device { asio_stream: &sys::AsioStream, buffer_index: usize, from_endianness: F, - ) - where + ) where A: AsioSample, B: Sample, D: FnMut(&Data) + Send + 'static, @@ -157,8 +156,8 @@ impl Device { // TODO: Handle endianness conversion for floats? We currently use the `PrimInt` // trait for the `to_le` and `to_be` methods, but this does not support floats. - (&sys::AsioSampleType::ASIOSTFloat32LSB, SampleFormat::F32) | - (&sys::AsioSampleType::ASIOSTFloat32MSB, SampleFormat::F32) => { + (&sys::AsioSampleType::ASIOSTFloat32LSB, SampleFormat::F32) + | (&sys::AsioSampleType::ASIOSTFloat32MSB, SampleFormat::F32) => { process_input_callback::( &mut data_callback, &mut interleaved, @@ -191,8 +190,8 @@ impl Device { } // TODO: Handle endianness conversion for floats? We currently use the `PrimInt` // trait for the `to_le` and `to_be` methods, but this does not support floats. - (&sys::AsioSampleType::ASIOSTFloat64LSB, SampleFormat::F32) | - (&sys::AsioSampleType::ASIOSTFloat64MSB, SampleFormat::F32) => { + (&sys::AsioSampleType::ASIOSTFloat64LSB, SampleFormat::F32) + | (&sys::AsioSampleType::ASIOSTFloat64MSB, SampleFormat::F32) => { process_input_callback::( &mut data_callback, &mut interleaved, @@ -202,10 +201,11 @@ impl Device { ); } - unsupported_format_pair => { - unreachable!("`build_input_stream` should have returned with unsupported \ - format {:?}", unsupported_format_pair) - } + unsupported_format_pair => unreachable!( + "`build_input_stream` should have returned with unsupported \ + format {:?}", + unsupported_format_pair + ), } }); @@ -258,7 +258,7 @@ impl Device { let callback_id = self.driver.add_callback(move |buffer_index| unsafe { // If not playing, return early. if !playing.load(Ordering::SeqCst) { - return + return; } // There is 0% chance of lock contention the host only locks when recreating streams. @@ -301,8 +301,7 @@ impl Device { asio_stream: &sys::AsioStream, buffer_index: usize, to_endianness: F, - ) - where + ) where A: Sample, B: AsioSample, D: FnMut(&mut Data) + Send + 'static, @@ -321,7 +320,9 @@ impl Device { for ch_ix in 0..n_channels { let asio_channel = asio_channel_slice_mut::(asio_stream, buffer_index, ch_ix); - asio_channel.iter_mut().for_each(|s| *s = to_endianness(B::SILENCE)); + asio_channel + .iter_mut() + .for_each(|s| *s = to_endianness(B::SILENCE)); } } @@ -359,8 +360,8 @@ impl Device { // TODO: Handle endianness conversion for floats? We currently use the `PrimInt` // trait for the `to_le` and `to_be` methods, but this does not support floats. - (SampleFormat::F32, &sys::AsioSampleType::ASIOSTFloat32LSB) | - (SampleFormat::F32, &sys::AsioSampleType::ASIOSTFloat32MSB) => { + (SampleFormat::F32, &sys::AsioSampleType::ASIOSTFloat32LSB) + | (SampleFormat::F32, &sys::AsioSampleType::ASIOSTFloat32MSB) => { process_output_callback::( &mut data_callback, &mut interleaved, @@ -396,8 +397,8 @@ impl Device { } // TODO: Handle endianness conversion for floats? We currently use the `PrimInt` // trait for the `to_le` and `to_be` methods, but this does not support floats. - (SampleFormat::F32, &sys::AsioSampleType::ASIOSTFloat64LSB) | - (SampleFormat::F32, &sys::AsioSampleType::ASIOSTFloat64MSB) => { + (SampleFormat::F32, &sys::AsioSampleType::ASIOSTFloat64LSB) + | (SampleFormat::F32, &sys::AsioSampleType::ASIOSTFloat64MSB) => { process_output_callback::( &mut data_callback, &mut interleaved, @@ -408,10 +409,11 @@ impl Device { ); } - unsupported_format_pair => { - unreachable!("`build_output_stream` should have returned with unsupported \ - format {:?}", unsupported_format_pair) - } + unsupported_format_pair => unreachable!( + "`build_output_stream` should have returned with unsupported \ + format {:?}", + unsupported_format_pair + ), } }); @@ -434,15 +436,12 @@ impl Device { /// If there is no existing ASIO Input Stream it will be created. /// /// On success, the buffer size of the stream is returned. - fn get_or_create_input_stream( - &self, - format: &Format, - ) -> Result { + fn get_or_create_input_stream(&self, format: &Format) -> Result { match self.default_input_format() { Ok(f) => { let num_asio_channels = f.channels; check_format(&self.driver, format, num_asio_channels) - }, + } Err(_) => Err(BuildStreamError::FormatNotSupported), }?; let num_channels = format.channels as usize; @@ -462,7 +461,8 @@ impl Device { }; *streams = new_streams; bs - }).map_err(|ref e| { + }) + .map_err(|ref e| { println!("Error preparing stream: {}", e); BuildStreamError::DeviceNotAvailable }) @@ -473,15 +473,12 @@ impl Device { /// Create a new CPAL Output Stream. /// /// If there is no existing ASIO Output Stream it will be created. - fn get_or_create_output_stream( - &self, - format: &Format, - ) -> Result { + fn get_or_create_output_stream(&self, format: &Format) -> Result { match self.default_output_format() { Ok(f) => { let num_asio_channels = f.channels; check_format(&self.driver, format, num_asio_channels) - }, + } Err(_) => Err(BuildStreamError::FormatNotSupported), }?; let num_channels = format.channels as usize; @@ -501,7 +498,8 @@ impl Device { }; *streams = new_streams; bs - }).map_err(|ref e| { + }) + .map_err(|ref e| { println!("Error preparing stream: {}", e); BuildStreamError::DeviceNotAvailable }) @@ -588,7 +586,10 @@ fn check_format( // Try and set the sample rate to what the user selected. let sample_rate = sample_rate.0.into(); if sample_rate != driver.sample_rate().map_err(build_stream_err)? { - if driver.can_sample_rate(sample_rate).map_err(build_stream_err)? { + if driver + .can_sample_rate(sample_rate) + .map_err(build_stream_err)? + { driver .set_sample_rate(sample_rate) .map_err(build_stream_err)?; @@ -656,19 +657,17 @@ unsafe fn asio_channel_slice_mut( buffer_index: usize, channel_index: usize, ) -> &mut [T] { - let buff_ptr: *mut T = asio_stream - .buffer_infos[channel_index] - .buffers[buffer_index as usize] - as *mut _; + let buff_ptr: *mut T = + asio_stream.buffer_infos[channel_index].buffers[buffer_index as usize] as *mut _; std::slice::from_raw_parts_mut(buff_ptr, asio_stream.buffer_size as usize) } fn build_stream_err(e: sys::AsioError) -> BuildStreamError { match e { - sys::AsioError::NoDrivers | - sys::AsioError::HardwareMalfunction => BuildStreamError::DeviceNotAvailable, - sys::AsioError::InvalidInput | - sys::AsioError::BadMode => BuildStreamError::InvalidArgument, + sys::AsioError::NoDrivers | sys::AsioError::HardwareMalfunction => { + BuildStreamError::DeviceNotAvailable + } + sys::AsioError::InvalidInput | sys::AsioError::BadMode => BuildStreamError::InvalidArgument, err => { let description = format!("{}", err); BackendSpecificError { description }.into() diff --git a/src/host/coreaudio/enumerate.rs b/src/host/coreaudio/enumerate.rs index 8805ce5..6762665 100644 --- a/src/host/coreaudio/enumerate.rs +++ b/src/host/coreaudio/enumerate.rs @@ -1,22 +1,15 @@ -use {BackendSpecificError, DevicesError, SupportedFormat}; +use super::coreaudio::sys::{ + kAudioHardwareNoError, kAudioHardwarePropertyDefaultInputDevice, + kAudioHardwarePropertyDefaultOutputDevice, kAudioHardwarePropertyDevices, + kAudioObjectPropertyElementMaster, kAudioObjectPropertyScopeGlobal, kAudioObjectSystemObject, + AudioDeviceID, AudioObjectGetPropertyData, AudioObjectGetPropertyDataSize, + AudioObjectPropertyAddress, OSStatus, +}; +use super::Device; use std::mem; use std::ptr::null; use std::vec::IntoIter as VecIntoIter; -use super::coreaudio::sys::{ - AudioDeviceID, - AudioObjectPropertyAddress, - AudioObjectGetPropertyData, - AudioObjectGetPropertyDataSize, - kAudioHardwareNoError, - kAudioHardwarePropertyDefaultInputDevice, - kAudioHardwarePropertyDefaultOutputDevice, - kAudioHardwarePropertyDevices, - kAudioObjectPropertyElementMaster, - kAudioObjectPropertyScopeGlobal, - kAudioObjectSystemObject, - OSStatus, -}; -use super::Device; +use {BackendSpecificError, DevicesError, SupportedFormat}; unsafe fn audio_devices() -> Result, OSStatus> { let property_address = AudioObjectPropertyAddress { @@ -80,15 +73,15 @@ impl Devices { } } -unsafe impl Send for Devices { -} -unsafe impl Sync for Devices { -} +unsafe impl Send for Devices {} +unsafe impl Sync for Devices {} impl Iterator for Devices { type Item = Device; fn next(&mut self) -> Option { - self.0.next().map(|id| Device { audio_device_id: id }) + self.0.next().map(|id| Device { + audio_device_id: id, + }) } } diff --git a/src/host/coreaudio/mod.rs b/src/host/coreaudio/mod.rs index e56ab61..b145359 100644 --- a/src/host/coreaudio/mod.rs +++ b/src/host/coreaudio/mod.rs @@ -1,67 +1,33 @@ -extern crate coreaudio; extern crate core_foundation_sys; +extern crate coreaudio; -use crate::{ - ChannelCount, - BackendSpecificError, - BuildStreamError, - Data, - DefaultFormatError, - DeviceNameError, - DevicesError, - Format, - PauseStreamError, - PlayStreamError, - SampleFormat, - SampleRate, - StreamError, - SupportedFormat, - SupportedFormatsError, +use self::core_foundation_sys::string::{CFStringGetCStringPtr, CFStringRef}; +use self::coreaudio::audio_unit::render_callback::{self, data}; +use self::coreaudio::audio_unit::{AudioUnit, Element, Scope}; +use self::coreaudio::sys::{ + kAudioDevicePropertyAvailableNominalSampleRates, kAudioDevicePropertyDeviceNameCFString, + kAudioDevicePropertyNominalSampleRate, kAudioDevicePropertyScopeOutput, + kAudioDevicePropertyStreamConfiguration, kAudioDevicePropertyStreamFormat, + kAudioFormatFlagIsFloat, kAudioFormatFlagIsPacked, kAudioFormatLinearPCM, + kAudioObjectPropertyElementMaster, kAudioObjectPropertyScopeGlobal, + kAudioObjectPropertyScopeInput, kAudioObjectPropertyScopeOutput, + kAudioOutputUnitProperty_CurrentDevice, kAudioOutputUnitProperty_EnableIO, + kAudioUnitProperty_StreamFormat, kCFStringEncodingUTF8, AudioBuffer, AudioBufferList, + AudioDeviceID, AudioObjectAddPropertyListener, AudioObjectGetPropertyData, + AudioObjectGetPropertyDataSize, AudioObjectID, AudioObjectPropertyAddress, + AudioObjectPropertyScope, AudioObjectRemovePropertyListener, AudioObjectSetPropertyData, + AudioStreamBasicDescription, AudioValueRange, OSStatus, }; use crate::traits::{DeviceTrait, HostTrait, StreamTrait}; -use self::coreaudio::audio_unit::{AudioUnit, Scope, Element}; -use self::coreaudio::audio_unit::render_callback::{self, data}; -use self::coreaudio::sys::{ - AudioBuffer, - AudioBufferList, - AudioDeviceID, - AudioObjectAddPropertyListener, - AudioObjectGetPropertyData, - AudioObjectGetPropertyDataSize, - AudioObjectID, - AudioObjectPropertyAddress, - AudioObjectPropertyScope, - AudioObjectRemovePropertyListener, - AudioObjectSetPropertyData, - AudioStreamBasicDescription, - AudioValueRange, - kAudioDevicePropertyAvailableNominalSampleRates, - kAudioDevicePropertyDeviceNameCFString, - kAudioDevicePropertyNominalSampleRate, - kAudioObjectPropertyScopeInput, - kAudioObjectPropertyScopeGlobal, - kAudioDevicePropertyScopeOutput, - kAudioDevicePropertyStreamConfiguration, - kAudioDevicePropertyStreamFormat, - kAudioFormatFlagIsFloat, - kAudioFormatFlagIsPacked, - kAudioFormatLinearPCM, - kAudioObjectPropertyElementMaster, - kAudioObjectPropertyScopeOutput, - kAudioOutputUnitProperty_CurrentDevice, - kAudioOutputUnitProperty_EnableIO, - kAudioUnitProperty_StreamFormat, - kCFStringEncodingUTF8, - OSStatus, -}; -use self::core_foundation_sys::string::{ - CFStringRef, - CFStringGetCStringPtr, +use crate::{ + BackendSpecificError, BuildStreamError, ChannelCount, Data, DefaultFormatError, + DeviceNameError, DevicesError, Format, PauseStreamError, PlayStreamError, SampleFormat, + SampleRate, StreamError, SupportedFormat, SupportedFormatsError, }; +use std::cell::RefCell; use std::ffi::CStr; use std::fmt; use std::mem; -use std::cell::RefCell; use std::os::raw::c_char; use std::ptr::null; use std::slice; @@ -70,7 +36,10 @@ use std::time::Duration; mod enumerate; -pub use self::enumerate::{Devices, SupportedInputFormats, SupportedOutputFormats, default_input_device, default_output_device}; +pub use self::enumerate::{ + default_input_device, default_output_device, Devices, SupportedInputFormats, + SupportedOutputFormats, +}; /// Coreaudio host, the default host on macOS and iOS. #[derive(Debug)] @@ -107,17 +76,21 @@ impl HostTrait for Host { impl DeviceTrait for Device { type SupportedInputFormats = SupportedInputFormats; type SupportedOutputFormats = SupportedOutputFormats; - type Stream = Stream; + type Stream = Stream; fn name(&self) -> Result { Device::name(self) } - fn supported_input_formats(&self) -> Result { + fn supported_input_formats( + &self, + ) -> Result { Device::supported_input_formats(self) } - fn supported_output_formats(&self) -> Result { + fn supported_output_formats( + &self, + ) -> Result { Device::supported_output_formats(self) } @@ -196,8 +169,7 @@ impl Device { fn supported_formats( &self, scope: AudioObjectPropertyScope, - ) -> Result - { + ) -> Result { let mut property_address = AudioObjectPropertyAddress { mSelector: kAudioDevicePropertyStreamConfiguration, mScope: scope, @@ -307,17 +279,18 @@ impl Device { fn default_format( &self, scope: AudioObjectPropertyScope, - ) -> Result - { + ) -> Result { fn default_format_error_from_os_status(status: OSStatus) -> Result<(), DefaultFormatError> { let err = match coreaudio::Error::from_os_status(status) { Err(err) => err, Ok(_) => return Ok(()), }; match err { - coreaudio::Error::AudioUnit(coreaudio::error::AudioUnitError::FormatNotSupported) | - coreaudio::Error::AudioCodec(_) | - coreaudio::Error::AudioFormat(_) => { + coreaudio::Error::AudioUnit( + coreaudio::error::AudioUnitError::FormatNotSupported, + ) + | coreaudio::Error::AudioCodec(_) + | coreaudio::Error::AudioFormat(_) => { Err(DefaultFormatError::StreamTypeNotSupported) } coreaudio::Error::AudioUnit(coreaudio::error::AudioUnitError::NoConnection) => { @@ -412,11 +385,11 @@ struct StreamInner { impl From for BuildStreamError { fn from(err: coreaudio::Error) -> BuildStreamError { match err { - coreaudio::Error::RenderCallbackBufferFormatDoesNotMatchAudioUnitStreamFormat | - coreaudio::Error::NoKnownSubtype | - coreaudio::Error::AudioUnit(coreaudio::error::AudioUnitError::FormatNotSupported) | - coreaudio::Error::AudioCodec(_) | - coreaudio::Error::AudioFormat(_) => BuildStreamError::FormatNotSupported, + coreaudio::Error::RenderCallbackBufferFormatDoesNotMatchAudioUnitStreamFormat + | coreaudio::Error::NoKnownSubtype + | coreaudio::Error::AudioUnit(coreaudio::error::AudioUnitError::FormatNotSupported) + | coreaudio::Error::AudioCodec(_) + | coreaudio::Error::AudioFormat(_) => BuildStreamError::FormatNotSupported, _ => BuildStreamError::DeviceNotAvailable, } } @@ -513,8 +486,8 @@ impl Device { // Get the current sample rate. let mut property_address = AudioObjectPropertyAddress { mSelector: kAudioDevicePropertyNominalSampleRate, - mScope: kAudioObjectPropertyScopeGlobal, - mElement: kAudioObjectPropertyElementMaster, + mScope: kAudioObjectPropertyScopeGlobal, + mElement: kAudioObjectPropertyElementMaster, }; let sample_rate: f64 = 0.0; let data_size = mem::size_of::() as u32; @@ -558,9 +531,9 @@ impl Device { // Now that we have the available ranges, pick the one matching the desired rate. let sample_rate = format.sample_rate.0; - let maybe_index = ranges - .iter() - .position(|r| r.mMinimum as u32 == sample_rate && r.mMaximum as u32 == sample_rate); + let maybe_index = ranges.iter().position(|r| { + r.mMinimum as u32 == sample_rate && r.mMaximum as u32 == sample_rate + }); let range_index = match maybe_index { None => return Err(BuildStreamError::FormatNotSupported), Some(i) => i, @@ -583,8 +556,8 @@ impl Device { let data_size = mem::size_of::(); let property_address = AudioObjectPropertyAddress { mSelector: kAudioDevicePropertyNominalSampleRate, - mScope: kAudioObjectPropertyScopeGlobal, - mElement: kAudioObjectPropertyElementMaster, + mScope: kAudioObjectPropertyScopeGlobal, + mElement: kAudioObjectPropertyElementMaster, }; AudioObjectGetPropertyData( device_id, @@ -624,7 +597,8 @@ impl Device { let timer = ::std::time::Instant::now(); while sample_rate != reported_rate { if timer.elapsed() > Duration::from_secs(1) { - let description = "timeout waiting for sample rate update for device".into(); + let description = + "timeout waiting for sample rate update for device".into(); let err = BackendSpecificError { description }; return Err(err.into()); } @@ -662,7 +636,7 @@ impl Device { let AudioBuffer { mNumberChannels: _num_channels, mDataByteSize: data_byte_size, - mData: data + mData: data, } = buffers[0]; let data = data as *mut (); @@ -713,7 +687,7 @@ impl Device { let AudioBuffer { mNumberChannels: _num_channels, mDataByteSize: data_byte_size, - mData: data + mData: data, } = (*args.data.data).mBuffers[0]; let data = data as *mut (); diff --git a/src/host/emscripten/mod.rs b/src/host/emscripten/mod.rs index 0eb951f..a561be7 100644 --- a/src/host/emscripten/mod.rs +++ b/src/host/emscripten/mod.rs @@ -2,23 +2,14 @@ use std::mem; use std::os::raw::c_void; use std::slice::from_raw_parts; use stdweb; -use stdweb::Reference; use stdweb::unstable::TryInto; -use stdweb::web::TypedArray; use stdweb::web::set_timeout; +use stdweb::web::TypedArray; +use stdweb::Reference; use crate::{ - BuildStreamError, - Data, - DefaultFormatError, - DeviceNameError, - DevicesError, - Format, - PauseStreamError, - PlayStreamError, - SampleFormat, - StreamError, - SupportedFormat, + BuildStreamError, Data, DefaultFormatError, DeviceNameError, DevicesError, Format, + PauseStreamError, PlayStreamError, SampleFormat, StreamError, SupportedFormat, SupportedFormatsError, }; use traits::{DeviceTrait, HostTrait, StreamTrait}; @@ -83,16 +74,13 @@ impl Device { // // UPDATE: We can do this now. Might be best to use `crate::COMMON_SAMPLE_RATES` and // filter out those that lay outside the range specified above. - Ok( - vec![ - SupportedFormat { - channels: 2, - min_sample_rate: ::SampleRate(44100), - max_sample_rate: ::SampleRate(44100), - data_type: ::SampleFormat::F32, - }, - ].into_iter(), - ) + Ok(vec![SupportedFormat { + channels: 2, + min_sample_rate: ::SampleRate(44100), + max_sample_rate: ::SampleRate(44100), + data_type: ::SampleFormat::F32, + }] + .into_iter()) } fn default_input_format(&self) -> Result { @@ -101,13 +89,11 @@ impl Device { fn default_output_format(&self) -> Result { // TODO: because it is hard coded, see supported_output_formats. - Ok( - Format { - channels: 2, - sample_rate: ::SampleRate(44100), - data_type: ::SampleFormat::F32, - }, - ) + Ok(Format { + channels: 2, + sample_rate: ::SampleRate(44100), + data_type: ::SampleFormat::F32, + }) } } @@ -142,11 +128,15 @@ impl DeviceTrait for Device { Device::name(self) } - fn supported_input_formats(&self) -> Result { + fn supported_input_formats( + &self, + ) -> Result { Device::supported_input_formats(self) } - fn supported_output_formats(&self) -> Result { + fn supported_output_formats( + &self, + ) -> Result { Device::supported_output_formats(self) } @@ -201,7 +191,10 @@ impl DeviceTrait for Device { // // See also: The call to `set_timeout` at the end of the `audio_callback_fn` which creates // the loop. - set_timeout(|| audio_callback_fn::(user_data_ptr as *mut c_void), 10); + set_timeout( + || audio_callback_fn::(user_data_ptr as *mut c_void), + 10, + ); Ok(stream) } @@ -323,9 +316,10 @@ fn default_output_device() -> Option { fn is_webaudio_available() -> bool { stdweb::initialize(); js!(if (!AudioContext) { - return false; - } else { - return true; - }).try_into() - .unwrap() + return false; + } else { + return true; + }) + .try_into() + .unwrap() } diff --git a/src/host/null/mod.rs b/src/host/null/mod.rs index def00c9..1f62b6e 100644 --- a/src/host/null/mod.rs +++ b/src/host/null/mod.rs @@ -1,15 +1,6 @@ use crate::{ - BuildStreamError, - Data, - DefaultFormatError, - DevicesError, - DeviceNameError, - Format, - PauseStreamError, - PlayStreamError, - StreamError, - SupportedFormatsError, - SupportedFormat, + BuildStreamError, Data, DefaultFormatError, DeviceNameError, DevicesError, Format, + PauseStreamError, PlayStreamError, StreamError, SupportedFormat, SupportedFormatsError, }; use traits::{DeviceTrait, HostTrait, StreamTrait}; diff --git a/src/host/wasapi/device.rs b/src/host/wasapi/device.rs index 6421864..1a98541 100644 --- a/src/host/wasapi/device.rs +++ b/src/host/wasapi/device.rs @@ -1,15 +1,6 @@ use crate::{ - BackendSpecificError, - Data, - DefaultFormatError, - DeviceNameError, - DevicesError, - Format, - SampleFormat, - SampleRate, - SupportedFormat, - SupportedFormatsError, - COMMON_SAMPLE_RATES, + BackendSpecificError, Data, DefaultFormatError, DeviceNameError, DevicesError, Format, + SampleFormat, SampleRate, SupportedFormat, SupportedFormatsError, COMMON_SAMPLE_RATES, }; use std; use std::ffi::OsString; @@ -115,7 +106,11 @@ impl DeviceTrait for Device { E: FnMut(StreamError) + Send + 'static, { let stream_inner = self.build_input_stream_inner(format)?; - Ok(Stream::new_input(stream_inner, data_callback, error_callback)) + Ok(Stream::new_input( + stream_inner, + data_callback, + error_callback, + )) } fn build_output_stream( @@ -129,7 +124,11 @@ impl DeviceTrait for Device { E: FnMut(StreamError) + Send + 'static, { let stream_inner = self.build_output_stream_inner(format)?; - Ok(Stream::new_output(stream_inner, data_callback, error_callback)) + Ok(Stream::new_output( + stream_inner, + data_callback, + error_callback, + )) } } @@ -716,8 +715,7 @@ impl Device { // Building a `IAudioCaptureClient` that will be used to read captured samples. let capture_client = { - let mut capture_client: *mut audioclient::IAudioCaptureClient = - ptr::null_mut(); + let mut capture_client: *mut audioclient::IAudioCaptureClient = ptr::null_mut(); let hresult = (*audio_client).GetService( &audioclient::IID_IAudioCaptureClient, &mut capture_client as *mut *mut audioclient::IAudioCaptureClient as *mut _, diff --git a/src/host/wasapi/stream.rs b/src/host/wasapi/stream.rs index bd55196..8d996d3 100644 --- a/src/host/wasapi/stream.rs +++ b/src/host/wasapi/stream.rs @@ -1,16 +1,3 @@ -use crate::{ - BackendSpecificError, - Data, - PauseStreamError, - PlayStreamError, - SampleFormat, - StreamError, -}; -use crate::traits::StreamTrait; -use std::mem; -use std::ptr; -use std::sync::mpsc::{channel, Receiver, Sender}; -use std::thread::{self, JoinHandle}; use super::check_result; use super::winapi::shared::basetsd::UINT32; use super::winapi::shared::minwindef::{BYTE, FALSE, WORD}; @@ -19,6 +6,14 @@ use super::winapi::um::handleapi; use super::winapi::um::synchapi; use super::winapi::um::winbase; use super::winapi::um::winnt; +use crate::traits::StreamTrait; +use crate::{ + BackendSpecificError, Data, PauseStreamError, PlayStreamError, SampleFormat, StreamError, +}; +use std::mem; +use std::ptr; +use std::sync::mpsc::{channel, Receiver, Sender}; +use std::thread::{self, JoinHandle}; pub struct Stream { /// The high-priority audio processing thread calling callbacks. @@ -295,7 +290,12 @@ fn run_input( AudioClientFlow::Capture { capture_client } => capture_client, _ => unreachable!(), }; - match process_input(&mut run_ctxt.stream, capture_client, data_callback, error_callback) { + match process_input( + &mut run_ctxt.stream, + capture_client, + data_callback, + error_callback, + ) { ControlFlow::Break => break, ControlFlow::Continue => continue, } @@ -317,7 +317,12 @@ fn run_output( AudioClientFlow::Render { render_client } => render_client, _ => unreachable!(), }; - match process_output(&mut run_ctxt.stream, render_client, data_callback, error_callback) { + match process_output( + &mut run_ctxt.stream, + render_client, + data_callback, + error_callback, + ) { ControlFlow::Break => break, ControlFlow::Continue => continue, } @@ -401,8 +406,7 @@ fn process_input( debug_assert!(!buffer.is_null()); let data = buffer as *mut (); - let len = frames_available as usize - * stream.bytes_per_frame as usize + let len = frames_available as usize * stream.bytes_per_frame as usize / stream.sample_format.sample_size(); let data = Data::from_parts(data, len, stream.sample_format); data_callback(&data); @@ -436,8 +440,7 @@ fn process_output( unsafe { let mut buffer: *mut BYTE = ptr::null_mut(); - let hresult = - (*render_client).GetBuffer(frames_available, &mut buffer as *mut *mut _); + let hresult = (*render_client).GetBuffer(frames_available, &mut buffer as *mut *mut _); if let Err(err) = stream_error_from_hresult(hresult) { error_callback(err); @@ -447,8 +450,7 @@ fn process_output( debug_assert!(!buffer.is_null()); let data = buffer as *mut (); - let len = frames_available as usize - * stream.bytes_per_frame as usize + let len = frames_available as usize * stream.bytes_per_frame as usize / stream.sample_format.sample_size(); let mut data = Data::from_parts(data, len, stream.sample_format); data_callback(&mut data); diff --git a/src/lib.rs b/src/lib.rs index b77d454..0884312 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -149,8 +149,8 @@ extern crate thiserror; pub use error::*; pub use platform::{ - ALL_HOSTS, available_hosts, default_host, Device, Devices, Host, host_from_id, - HostId, Stream, SupportedInputFormats, SupportedOutputFormats, + available_hosts, default_host, host_from_id, Device, Devices, Host, HostId, Stream, + SupportedInputFormats, SupportedOutputFormats, ALL_HOSTS, }; pub use samples_formats::{Sample, SampleFormat}; @@ -218,7 +218,11 @@ impl Data { len: usize, sample_format: SampleFormat, ) -> Self { - Data { data, len, sample_format } + Data { + data, + len, + sample_format, + } } /// The sample format of the internal audio data. @@ -241,9 +245,7 @@ impl Data { let len = self.len * self.sample_format.sample_size(); // The safety of this block relies on correct construction of the `Data` instance. See // the unsafe `from_parts` constructor for these requirements. - unsafe { - std::slice::from_raw_parts(self.data as *const u8, len) - } + unsafe { std::slice::from_raw_parts(self.data as *const u8, len) } } /// The raw slice of memory representing the underlying audio data as a slice of bytes. @@ -253,9 +255,7 @@ impl Data { let len = self.len * self.sample_format.sample_size(); // The safety of this block relies on correct construction of the `Data` instance. See // the unsafe `from_parts` constructor for these requirements. - unsafe { - std::slice::from_raw_parts_mut(self.data as *mut u8, len) - } + unsafe { std::slice::from_raw_parts_mut(self.data as *mut u8, len) } } /// Access the data as a slice of sample type `T`. @@ -268,9 +268,7 @@ impl Data { if T::FORMAT == self.sample_format { // The safety of this block relies on correct construction of the `Data` instance. See // the unsafe `from_parts` constructor for these requirements. - unsafe { - Some(std::slice::from_raw_parts(self.data as *const T, self.len)) - } + unsafe { Some(std::slice::from_raw_parts(self.data as *const T, self.len)) } } else { None } @@ -287,7 +285,10 @@ impl Data { // The safety of this block relies on correct construction of the `Data` instance. See // the unsafe `from_parts` constructor for these requirements. unsafe { - Some(std::slice::from_raw_parts_mut(self.data as *mut T, self.len)) + Some(std::slice::from_raw_parts_mut( + self.data as *mut T, + self.len, + )) } } else { None @@ -365,10 +366,9 @@ impl SupportedFormat { } const HZ_44100: SampleRate = SampleRate(44_100); - let r44100_in_self = self.min_sample_rate <= HZ_44100 - && HZ_44100 <= self.max_sample_rate; - let r44100_in_other = other.min_sample_rate <= HZ_44100 - && HZ_44100 <= other.max_sample_rate; + let r44100_in_self = self.min_sample_rate <= HZ_44100 && HZ_44100 <= self.max_sample_rate; + let r44100_in_other = + other.min_sample_rate <= HZ_44100 && HZ_44100 <= other.max_sample_rate; let cmp_r44100 = r44100_in_self.cmp(&r44100_in_other); if cmp_r44100 != Equal { return cmp_r44100; diff --git a/src/platform/mod.rs b/src/platform/mod.rs index 8b936a9..87062e8 100644 --- a/src/platform/mod.rs +++ b/src/platform/mod.rs @@ -435,10 +435,7 @@ macro_rules! impl_platform_host { #[cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd"))] mod platform_impl { pub use crate::host::alsa::{ - Device as AlsaDevice, - Devices as AlsaDevices, - Host as AlsaHost, - Stream as AlsaStream, + Device as AlsaDevice, Devices as AlsaDevices, Host as AlsaHost, Stream as AlsaStream, SupportedInputFormats as AlsaSupportedInputFormats, SupportedOutputFormats as AlsaSupportedOutputFormats, }; @@ -453,15 +450,11 @@ mod platform_impl { } } - #[cfg(any(target_os = "macos", target_os = "ios"))] mod platform_impl { pub use crate::host::coreaudio::{ - Device as CoreAudioDevice, - Devices as CoreAudioDevices, - Host as CoreAudioHost, - Stream as CoreAudioStream, - SupportedInputFormats as CoreAudioSupportedInputFormats, + Device as CoreAudioDevice, Devices as CoreAudioDevices, Host as CoreAudioHost, + Stream as CoreAudioStream, SupportedInputFormats as CoreAudioSupportedInputFormats, SupportedOutputFormats as CoreAudioSupportedOutputFormats, }; @@ -478,11 +471,8 @@ mod platform_impl { #[cfg(target_os = "emscripten")] mod platform_impl { pub use crate::host::emscripten::{ - Device as EmscriptenDevice, - Devices as EmscriptenDevices, - Host as EmscriptenHost, - Stream as EmscriptenStream, - SupportedInputFormats as EmscriptenSupportedInputFormats, + Device as EmscriptenDevice, Devices as EmscriptenDevices, Host as EmscriptenHost, + Stream as EmscriptenStream, SupportedInputFormats as EmscriptenSupportedInputFormats, SupportedOutputFormats as EmscriptenSupportedOutputFormats, }; @@ -500,19 +490,13 @@ mod platform_impl { mod platform_impl { #[cfg(feature = "asio")] pub use crate::host::asio::{ - Device as AsioDevice, - Devices as AsioDevices, - Stream as AsioStream, - Host as AsioHost, + Device as AsioDevice, Devices as AsioDevices, Host as AsioHost, Stream as AsioStream, SupportedInputFormats as AsioSupportedInputFormats, SupportedOutputFormats as AsioSupportedOutputFormats, }; pub use crate::host::wasapi::{ - Device as WasapiDevice, - Devices as WasapiDevices, - Stream as WasapiStream, - Host as WasapiHost, - SupportedInputFormats as WasapiSupportedInputFormats, + Device as WasapiDevice, Devices as WasapiDevices, Host as WasapiHost, + Stream as WasapiStream, SupportedInputFormats as WasapiSupportedInputFormats, SupportedOutputFormats as WasapiSupportedOutputFormats, }; @@ -530,16 +514,19 @@ mod platform_impl { } } -#[cfg(not(any(windows, target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "macos", - target_os = "ios", target_os = "emscripten")))] +#[cfg(not(any( + windows, + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "macos", + target_os = "ios", + target_os = "emscripten" +)))] mod platform_impl { pub use crate::host::null::{ - Device as NullDevice, - Devices as NullDevices, - EventLoop as NullEventLoop, - Host as NullHost, - StreamId as NullStreamId, - SupportedInputFormats as NullSupportedInputFormats, + Device as NullDevice, Devices as NullDevices, EventLoop as NullEventLoop, Host as NullHost, + StreamId as NullStreamId, SupportedInputFormats as NullSupportedInputFormats, SupportedOutputFormats as NullSupportedOutputFormats, }; diff --git a/src/samples_formats.rs b/src/samples_formats.rs index 2f5014f..cd146e4 100644 --- a/src/samples_formats.rs +++ b/src/samples_formats.rs @@ -37,7 +37,8 @@ pub unsafe trait Sample: Copy + Clone { /// Converts any sample type to this one by calling `to_i16`, `to_u16` or `to_f32`. fn from(&S) -> Self - where S: Sample; + where + S: Sample; } unsafe impl Sample for u16 { @@ -64,7 +65,8 @@ unsafe impl Sample for u16 { #[inline] fn from(sample: &S) -> Self - where S: Sample + where + S: Sample, { sample.to_u16() } @@ -98,7 +100,8 @@ unsafe impl Sample for i16 { #[inline] fn from(sample: &S) -> Self - where S: Sample + where + S: Sample, { sample.to_i16() } @@ -128,7 +131,8 @@ unsafe impl Sample for f32 { #[inline] fn from(sample: &S) -> Self - where S: Sample + where + S: Sample, { sample.to_f32() } diff --git a/src/traits.rs b/src/traits.rs index 4aeb8e6..d12e98a 100644 --- a/src/traits.rs +++ b/src/traits.rs @@ -1,18 +1,8 @@ //! The suite of traits allowing CPAL to abstract over hosts, devices, event loops and stream IDs. use { - BuildStreamError, - Data, - DefaultFormatError, - DeviceNameError, - DevicesError, - Format, - InputDevices, - OutputDevices, - PauseStreamError, - PlayStreamError, - StreamError, - SupportedFormat, + BuildStreamError, Data, DefaultFormatError, DeviceNameError, DevicesError, Format, + InputDevices, OutputDevices, PauseStreamError, PlayStreamError, StreamError, SupportedFormat, SupportedFormatsError, }; @@ -65,7 +55,8 @@ pub trait HostTrait { /// Can be empty if the system does not support audio input. fn input_devices(&self) -> Result, DevicesError> { fn supports_input(device: &D) -> bool { - device.supported_input_formats() + device + .supported_input_formats() .map(|mut iter| iter.next().is_some()) .unwrap_or(false) } @@ -78,7 +69,8 @@ pub trait HostTrait { /// Can be empty if the system does not support audio output. fn output_devices(&self) -> Result, DevicesError> { fn supports_output(device: &D) -> bool { - device.supported_output_formats() + device + .supported_output_formats() .map(|mut iter| iter.next().is_some()) .unwrap_or(false) } @@ -104,12 +96,15 @@ pub trait DeviceTrait { /// An iterator yielding formats that are supported by the backend. /// /// Can return an error if the device is no longer valid (eg. it has been disconnected). - fn supported_input_formats(&self) -> Result; + fn supported_input_formats(&self) + -> Result; /// An iterator yielding output stream formats that are supported by the device. /// /// Can return an error if the device is no longer valid (eg. it has been disconnected). - fn supported_output_formats(&self) -> Result; + fn supported_output_formats( + &self, + ) -> Result; /// The default input stream format for the device. fn default_input_format(&self) -> Result;