use std::ffi::c_void;
use crate::{arc, at, at::au, cf, define_opts, os};
impl au::Scope {
#[doc(alias = "kAudioUnitScope_Global")]
pub const GLOBAL: Self = Self(0);
#[doc(alias = "kAudioUnitScope_Input")]
pub const INPUT: Self = Self(1);
#[doc(alias = "kAudioUnitScope_Output")]
pub const OUTPUT: Self = Self(2);
#[doc(alias = "kAudioUnitScope_Group")]
pub const GROUP: Self = Self(3);
#[doc(alias = "kAudioUnitScope_Part")]
pub const PART: Self = Self(4);
#[doc(alias = "kAudioUnitScope_Note")]
pub const NOTE: Self = Self(5);
#[doc(alias = "kAudioUnitScope_Layer")]
pub const LAYER: Self = Self(6);
#[doc(alias = "kAudioUnitScope_LayerItem")]
pub const LAYER_ITEM: Self = Self(7);
}
impl au::Element {
pub const OUTPUT: Self = Self(0);
pub const INPUT: Self = Self(1);
}
define_opts!(
#[doc(alias = "AudioUnitParameterOptions")]
pub ParamFlags(u32)
);
impl ParamFlags {
#[doc(alias = "kAudioUnitParameterFlag_CFNameRelease")]
pub const CF_NAME_RELEASE: Self = Self(1 << 4);
#[doc(alias = "kAudioUnitParameterFlag_OmitFromPresets")]
pub const OMIT_FROM_PRESETS: Self = Self(1 << 13);
#[doc(alias = "kAudioUnitParameterFlag_PlotHistory")]
pub const PLOT_HISTORY: Self = Self(1 << 14);
#[doc(alias = "kAudioUnitParameterFlag_MeterReadOnly")]
pub const METER_READ_ONLY: Self = Self(1 << 15);
#[doc(alias = "kAudioUnitParameterFlag_DisplayMask")]
pub const DISPLAY_MASK: Self = Self((7 << 16) | (1 << 22));
#[doc(alias = "kAudioUnitParameterFlag_DisplaySquareRoot")]
pub const DISPLAY_SQUARE_ROOT: Self = Self(1 << 16);
#[doc(alias = "kAudioUnitParameterFlag_DisplaySquared")]
pub const DISPLAY_SQUARED: Self = Self(2 << 16);
#[doc(alias = "kAudioUnitParameterFlag_DisplayCubed")]
pub const DISPLAY_CUBED: Self = Self(3 << 16);
#[doc(alias = "kAudioUnitParameterFlag_DisplayCubeRoot")]
pub const DISPLAY_CUBE_ROOT: Self = Self(4 << 16);
#[doc(alias = "kAudioUnitParameterFlag_DisplayExponential")]
pub const DISPLAY_EXPONENTIAL: Self = Self(4 << 16);
#[doc(alias = "kAudioUnitParameterFlag_HasClump")]
pub const HAS_CLUMP: Self = Self(1 << 20);
#[doc(alias = "kAudioUnitParameterFlag_ValuesHaveStrings")]
pub const VALUES_HAVE_STRINGS: Self = Self(1 << 21);
#[doc(alias = "kAudioUnitParameterFlag_DisplayLogarithmic")]
pub const DISPLAY_LOGARITHMIC: Self = Self(1 << 22);
#[doc(alias = "kAudioUnitParameterFlag_IsHighResolution")]
pub const IS_HIGH_RESOLUTION: Self = Self(1 << 23);
#[doc(alias = "kAudioUnitParameterFlag_NonRealTime")]
pub const NON_REAL_TIME: Self = Self(1 << 24);
#[doc(alias = "kAudioUnitParameterFlag_CanRamp")]
pub const CAN_RAMP: Self = Self(1 << 25);
#[doc(alias = "kAudioUnitParameterFlag_ExpertMode")]
pub const EXPERT_MODE: Self = Self(1 << 26);
#[doc(alias = "kAudioUnitParameterFlag_HasCFNameString")]
pub const HAS_CF_NAME_STRING: Self = Self(1 << 27);
#[doc(alias = "kAudioUnitParameterFlag_IsGlobalMeta")]
pub const IS_GLOBAL_META: Self = Self(1 << 28);
#[doc(alias = "kAudioUnitParameterFlag_IsElementMeta")]
pub const IS_ELEMENT_META: Self = Self(1 << 29);
#[doc(alias = "kAudioUnitParameterFlag_IsReadable")]
pub const IS_READABLE: Self = Self(1 << 30);
#[doc(alias = "kAudioUnitParameterFlag_IsWritable")]
pub const IS_WRITABLE: Self = Self(1 << 30);
}
#[doc(alias = "AudioUnitParameterUnit")]
#[derive(Debug, Eq, PartialEq, Copy, Clone)]
#[repr(u32)]
pub enum ParamUnit {
Generic = 0,
Indexed = 1,
Boolean = 2,
Percent = 3,
Seconds = 4,
SampleFrames = 5,
Phase = 6,
Rate = 7,
Hertz = 8,
Cents = 9,
RelativeSemiTones = 10,
MidiNoteNumber = 11,
MidiController = 12,
Decibels = 13,
LinearGain = 14,
Degrees = 15,
EqualPowerCrossfade = 16,
MixerFaderCurve1 = 17,
Pan = 18,
Meters = 19,
AbsoluteCents = 20,
Octaves = 21,
Bpm = 22,
Beats = 23,
Milliseconds = 24,
Ratio = 25,
CustomUnit = 26,
Midi2Controller = 27,
}
#[doc(alias = "AudioUnitParameterInfo")]
#[derive(Debug)]
#[repr(C)]
pub struct ParamInfo {
name: [std::ffi::c_char; 52],
pub unit_name: Option<arc::R<cf::String>>,
pub clump_id: u32,
pub name_string: Option<arc::R<cf::String>>,
pub unit: au::ParamUnit,
pub min_value: au::ParamValue,
pub max_value: au::ParamValue,
pub default_value: au::ParamValue,
pub flags: ParamFlags,
}
impl Default for ParamInfo {
fn default() -> Self {
Self {
name: [0; 52],
unit_name: None,
clump_id: 0,
name_string: None,
unit: ParamUnit::Generic,
min_value: 0.0,
max_value: 0.0,
default_value: 0.0,
flags: ParamFlags::default(),
}
}
}
impl au::PropId {
#[doc(alias = "kAudioUnitProperty_ClassInfo")]
pub const CLASS_INFO: Self = Self(0);
#[doc(alias = "kAudioUnitProperty_MakeConnection")]
pub const MAKE_CONNECTION: Self = Self(1);
#[doc(alias = "kAudioUnitProperty_SampleRate")]
pub const SAMPLE_RATE: Self = Self(2);
#[doc(alias = "kAudioUnitProperty_ParameterList")]
pub const PARAM_LIST: Self = Self(3);
#[doc(alias = "kAudioUnitProperty_ParameterInfo")]
pub const PARAM_INFO: Self = Self(4);
#[doc(alias = "kAudioUnitProperty_CPULoad")]
pub const CPU_LOAD: Self = Self(6);
#[doc(alias = "kAudioUnitProperty_StreamFormat")]
pub const STREAM_FORMAT: Self = Self(8);
#[doc(alias = "kAudioUnitProperty_ElementCount")]
pub const ELEMENT_COUNT: Self = Self(11);
#[doc(alias = "kAudioUnitProperty_Latency")]
pub const LATENCY: Self = Self(12);
#[doc(alias = "kAudioUnitProperty_SupportedNumChannels")]
pub const SUPPORTED_NUM_CHANNELS: Self = Self(13);
#[doc(alias = "kAudioUnitProperty_MaximumFramesPerSlice")]
pub const MAX_FRAMES_PER_SLICE: Self = Self(14);
#[doc(alias = "kAudioUnitProperty_ParameterValueStrings")]
pub const PARAM_VALUE_STRINGS: Self = Self(16);
#[doc(alias = "kAudioUnitProperty_AudioChannelLayout")]
pub const AUDIO_CHANNEL_LAYOUT: Self = Self(19);
#[doc(alias = "kAudioUnitProperty_TailTime")]
pub const TAIL_TIME: Self = Self(20);
#[doc(alias = "kAudioUnitProperty_BypassEffect")]
pub const BYPASS_EFFECT: Self = Self(21);
#[doc(alias = "kAudioUnitProperty_LastRenderError")]
pub const LAST_RENDER_ERROR: Self = Self(22);
#[doc(alias = "kAudioUnitProperty_SetRenderCallback")]
pub const SET_RENDER_CB: Self = Self(23);
#[doc(alias = "kAudioUnitProperty_FactoryPresets")]
pub const FACTORY_PRESETS: Self = Self(24);
#[doc(alias = "kAudioUnitProperty_RenderQuality")]
pub const RENDER_QUALITY: Self = Self(26);
#[doc(alias = "kAudioUnitProperty_HostCallbacks")]
pub const HOST_CBS: Self = Self(27);
#[doc(alias = "kAudioUnitProperty_InPlaceProcessing")]
pub const IN_PLACE_PROCESSING: Self = Self(29);
#[doc(alias = "kAudioUnitProperty_ElementName")]
pub const ELEMENT_NAME: Self = Self(30);
#[doc(alias = "kAudioUnitProperty_SupportedChannelLayoutTags")]
pub const SUPPORTED_CHANNEL_LAYOUT_TAGS: Self = Self(32);
#[doc(alias = "kAudioUnitProperty_PresentPreset")]
pub const PRESENT_PRESET: Self = Self(36);
#[doc(alias = "kAudioUnitProperty_DependentParameters")]
pub const DEPENDENT_PARAMS: Self = Self(45);
#[doc(alias = "kAudioUnitProperty_InputSamplesInOutput")]
pub const INPUT_SAMPLES_IN_OUTPUT: Self = Self(49);
#[doc(alias = "kAudioUnitProperty_ShouldAllocateBuffer")]
pub const SHOULD_ALLOCATE_BUF: Self = Self(51);
#[doc(alias = "kAudioUnitProperty_FrequencyResponse")]
pub const FREQUENCY_RESPONSE: Self = Self(52);
#[doc(alias = "kAudioUnitProperty_ParameterHistoryInfo")]
pub const PARAM_HISTORY_INFO: Self = Self(53);
#[doc(alias = "kAudioUnitProperty_NickName")]
pub const NICK_NAME: Self = Self(54);
#[doc(alias = "kAudioUnitProperty_OfflineRender")]
pub const OFFLINE_RENDER: Self = Self(37);
#[doc(alias = "kAudioUnitProperty_ParameterIDName")]
pub const PARAM_ID_NAME: Self = Self(34);
#[doc(alias = "kAudioUnitProperty_ParameterStringFromValue")]
pub const PARAM_STRING_FROM_VALUE: Self = Self(33);
#[doc(alias = "kAudioUnitProperty_ParameterClumpName")]
pub const PARAM_CLUMP_NAME: Self = Self(35);
#[doc(alias = "kAudioUnitProperty_ParameterValueFromString")]
pub const PARAM_VALUE_FROM_STRING: Self = Self(38);
#[doc(alias = "kAudioUnitProperty_ContextName")]
pub const CONTEXT_NAME: Self = Self(25);
#[doc(alias = "kAudioUnitProperty_PresentationLatency")]
pub const PRESENTATION_LATENCY: Self = Self(40);
#[doc(alias = "kAudioUnitProperty_ClassInfoFromDocument")]
pub const CLASS_INFO_FROM_DOCUMENT: Self = Self(50);
#[doc(alias = "kAudioUnitProperty_RequestViewController")]
pub const REQUEST_VIEW_CONTROLLER: Self = Self(56);
#[doc(alias = "kAudioUnitProperty_ParametersForOverview")]
pub const PARAMS_FOR_OVERVIEW: Self = Self(57);
#[doc(alias = "kAudioUnitProperty_SupportsMPE")]
pub const SUPPORTS_MPE: Self = Self(58);
#[doc(alias = "kAudioUnitProperty_RenderContextObserver")]
pub const RENDER_CONTEXT_OBSERVER: Self = Self(60);
#[doc(alias = "kAudioUnitProperty_LastRenderSampleTime")]
pub const LAST_RENDER_SAMPLE_TIME: Self = Self(61);
#[doc(alias = "kAudioUnitProperty_LoadedOutOfProcess")]
pub const LOADED_OUT_OF_PROCESS: Self = Self(62);
#[cfg(target_os = "macos")]
#[doc(alias = "kAudioUnitProperty_FastDispatch")]
pub const FAST_DISPATCH: Self = Self(5);
#[cfg(target_os = "macos")]
#[doc(alias = "kAudioUnitProperty_SetExternalBuffer")]
pub const SET_EXTERNAL_BUF: Self = Self(15);
#[cfg(target_os = "macos")]
#[doc(alias = "kAudioUnitProperty_GetUIComponentList")]
pub const GET_UI_COMPONENT_LIST: Self = Self(18);
#[cfg(target_os = "macos")]
#[doc(alias = "kAudioUnitProperty_CocoaUI")]
pub const COCOA_UI: Self = Self(31);
#[cfg(target_os = "macos")]
#[doc(alias = "kAudioUnitProperty_IconLocation")]
pub const ICON_LOCATION: Self = Self(39);
#[cfg(target_os = "macos")]
#[doc(alias = "kAudioUnitProperty_AUHostIdentifier")]
pub const AU_HOST_IDENTIFIER: Self = Self(46);
#[doc(alias = "kAudioUnitProperty_MIDIOutputCallbackInfo")]
pub const MIDI_OUTPUT_CB_INFO: Self = Self(47);
#[doc(alias = "kAudioUnitProperty_MIDIOutputCallback")]
pub const MIDI_OUTPUT_CB: Self = Self(48);
#[doc(alias = "kAudioUnitProperty_MIDIOutputEventListCallback")]
pub const MIDI_OUTPUT_EVENT_LIST_CB: Self = Self(63);
#[doc(alias = "kAudioUnitProperty_AudioUnitMIDIProtocol")]
pub const AUDIO_UNIT_MIDI_PROTOCOL: Self = Self(64);
#[doc(alias = "kAudioUnitProperty_HostMIDIProtocol")]
pub const HOST_MIDI_PROTOCOL: Self = Self(65);
#[doc(alias = "kAudioUnitProperty_MIDIOutputBufferSizeHint")]
pub const MIDI_OUTPUT_BUF_SIZE_HINT: Self = Self(66);
}
impl au::PropId {
#[doc(alias = "kAudioUnitProperty_RemoteControlEventListener")]
pub const REMOTE_CONTROL_EVENT_LISTENER: Self = Self(100);
#[doc(alias = "kAudioUnitProperty_IsInterAppConnected")]
pub const IS_INTER_APP_CONNECTED: Self = Self(101);
#[doc(alias = "kAudioUnitProperty_PeerURL")]
pub const PEER_URL: Self = Self(102);
}
impl au::PropId {
#[doc(alias = "kAudioUnitOfflineProperty_InputSize")]
pub const OFFLINE_INPUT_SIZE: Self = Self(3020);
#[doc(alias = "kAudioUnitOfflineProperty_OutputSize")]
pub const OFFLINE_OUTPUT_SIZE: Self = Self(3021);
#[doc(alias = "kAudioUnitOfflineProperty_StartOffset")]
pub const OFFLINE_START_OFFSET: Self = Self(3022);
#[doc(alias = "kAudioUnitOfflineProperty_PreflightRequirements")]
pub const OFFLINE_PREFLIGHT_REQUIREMENTS: Self = Self(3023);
#[doc(alias = "kAudioUnitOfflineProperty_PreflightName")]
pub const OFFLINE_PREFLIGHT_NAME: Self = Self(3024);
}
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
#[repr(u32)]
pub enum OfflinePreflight {
NotRequired = 0,
Optional = 1,
Required = 2,
}
impl au::PropId {
#[doc(alias = "kAudioUnitProperty_SampleRateConverterComplexity")]
pub const SAMPLE_RATE_CONVERTER_COMPLEXITY: Self = Self(3014);
}
#[doc(alias = "kAudioUnitSampleRateConverterComplexity")]
pub mod sample_rate_converter_complexity {
#[doc(alias = "kAudioUnitSampleRateConverterComplexity_Linear")]
pub const LINEAR: u32 = u32::from_be_bytes(*b"line");
#[doc(alias = "kAudioUnitSampleRateConverterComplexity_Normal")]
pub const NORMAL: u32 = u32::from_be_bytes(*b"norm");
#[doc(alias = "kAudioUnitSampleRateConverterComplexity_Mastering")]
pub const MASTERING: u32 = u32::from_be_bytes(*b"bats");
}
impl au::PropId {
#[doc(alias = "kAudioOutputUnitProperty_CurrentDevice")]
pub const OUTPUT_CURRENT_DEVICE: Self = Self(2000);
#[doc(alias = "kAudioOutputUnitProperty_IsRunning")]
pub const OUTPUT_IS_RUNNING: Self = Self(2001);
#[doc(alias = "kAudioOutputUnitProperty_ChannelMap")]
pub const CHANNEL_MAP: Self = Self(2002);
#[doc(alias = "kAudioOutputUnitProperty_EnableIO")]
pub const OUTPUT_ENABLE_IO: Self = Self(2003);
#[doc(alias = "kAudioOutputUnitProperty_StartTime")]
pub const OUTPUT_START_TIME: Self = Self(2004);
#[doc(alias = "kAudioOutputUnitProperty_SetInputCallback")]
pub const OUTPUT_SET_INPUT_CB: Self = Self(2005);
#[doc(alias = "kAudioOutputUnitProperty_HasIO")]
pub const OUTPUT_HAS_IO: Self = Self(2006);
#[doc(alias = "kAudioOutputUnitProperty_StartTimestampsAtZero")]
pub const OUTPUT_START_TS_AT_ZERO: Self = Self(2007);
#[doc(alias = "kAudioOutputUnitProperty_OSWorkgroup")]
pub const OUTPUT_OS_WORKGROUP: Self = Self(2015);
#[doc(alias = "kAudioOutputUnitProperty_MIDICallbacks")]
pub const OUTPUT_MIDI_CBS: Self = Self(2010);
#[doc(alias = "kAudioOutputUnitProperty_HostReceivesRemoteControlEvents")]
pub const OUTPUT_HOST_RECEIVES_REMOVE_CONTROL_EVENTS: Self = Self(2011);
#[doc(alias = "kAudioOutputUnitProperty_RemoteControlToHost")]
pub const OUTPUT_REMOTE_CONTROL_HOST: Self = Self(2012);
#[doc(alias = "kAudioOutputUnitProperty_HostTransportState")]
pub const OUTPUT_HOST_TRANSPORT_STATE: Self = Self(2013);
#[doc(alias = "kAudioOutputUnitProperty_NodeComponentDescription")]
pub const OUTPUT_NODE_COMPONENT_DESC: Self = Self(2013);
}
#[doc(alias = "AudioOutputUnitStartAtTimeParams")]
#[derive(Debug)]
#[repr(C)]
pub struct StartAtTimeParams {
pub timestamp: at::audio::TimeStamp,
pub flags: u32,
}
impl au::PropId {
#[doc(alias = "kAUVoiceIOProperty_BypassVoiceProcessing")]
pub const VOICE_IO_BYPASS_VOICE_PROCESSING: Self = Self(2100);
#[doc(alias = "kAUVoiceIOProperty_VoiceProcessingEnableAGC")]
pub const VOICE_IO_ENABLE_AGC: Self = Self(2101);
#[doc(alias = "kAUVoiceIOProperty_MuteOutput")]
pub const VOICE_IO_MUTE_OUTPUT: Self = Self(2104);
}
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
#[repr(u32)]
pub enum VoiceIoSpeechActivityEvent {
#[doc(alias = "kAUVoiceIOSpeechActivityHasStarted")]
Started = 0,
#[doc(alias = "kAUVoiceIOSpeechActivityHasEnded")]
Ended = 1,
}
#[cfg(feature = "blocks")]
pub type VoiceIoMutedSpeechActivityEventListener =
crate::blocks::EscBlock<fn(VoiceIoSpeechActivityEvent)>;
impl au::PropId {
#[doc(alias = "kAUVoiceIOProperty_MutedSpeechActivityEventListener")]
pub const VOICE_IO_MUTED_SPEECH_ACTIVITY_EVENT_LISTENER: Self = Self(2106);
}
pub mod voice_io_other_audio_ducking_level {
#[doc(alias = "kAUVoiceIOOtherAudioDuckingLevelDefault")]
pub const DEFAULT: u32 = 0;
#[doc(alias = "kAUVoiceIOOtherAudioDuckingLevelMin")]
pub const MIN: u32 = 10;
#[doc(alias = "kAUVoiceIOOtherAudioDuckingLevelMid")]
pub const MID: u32 = 20;
#[doc(alias = "kAUVoiceIOOtherAudioDuckingLevelMax")]
pub const MAX: u32 = 30;
}
#[doc(alias = "AUVoiceIOOtherAudioDuckingConfiguration")]
#[derive(Debug, Eq, PartialEq, Copy, Clone)]
#[repr(C)]
pub struct VoiceIoOtherAudioDuckingCfg {
pub enable_advanced_ducking: bool,
pub ducking_level: u32,
}
impl Default for VoiceIoOtherAudioDuckingCfg {
fn default() -> Self {
Self {
enable_advanced_ducking: false,
ducking_level: voice_io_other_audio_ducking_level::DEFAULT,
}
}
}
impl au::PropId {
#[doc(alias = "kAUVoiceIOProperty_OtherAudioDuckingConfiguration")]
pub const VOICE_IO_OTHER_AUDIO_DUCKING_CFG: Self = Self(2108);
}
impl au::PropId {
#[doc(alias = "kAUNBandEQProperty_NumberOfBands")]
pub const BAND_EQ_NUMBER_OF_BANDS: Self = Self(2200);
#[doc(alias = "kAUNBandEQProperty_MaxNumberOfBands")]
pub const BAND_EQ_MAX_NUMBER_OF_BANDS: Self = Self(2201);
#[doc(alias = "kAUNBandEQProperty_BiquadCoefficients")]
pub const BAND_EQ_BIQUAD_COEFFICIENTS: Self = Self(2203);
}
impl au::PropId {
#[doc(alias = "kAudioUnitProperty_MeteringMode")]
pub const METERING_MODE: Self = Self(3007);
#[doc(alias = "kAudioUnitProperty_MatrixLevels")]
pub const MATRIX_LEVELS: Self = Self(3006);
#[doc(alias = "kAudioUnitProperty_MatrixDimensions")]
pub const MATRIX_DIMENSIONS: Self = Self(3009);
#[doc(alias = "kAudioUnitProperty_MeterClipping")]
pub const METER_CLIPPING: Self = Self(3011);
#[doc(alias = "kAudioUnitProperty_InputAnchorTimeStamp")]
pub const INPUT_ANCHOR_TS: Self = Self(3011);
}
#[doc(alias = "AudioUnitMeterClipping")]
#[repr(C)]
pub struct MeterClipping {
pub peak_value_since_last_call: f32,
pub saw_infinity: bool,
pub saw_nan: bool,
}
impl au::PropId {
#[doc(alias = "kAudioUnitProperty_ReverbRoomType")]
pub const REVERB_ROOM_TYPE: Self = Self(10);
#[doc(alias = "kAudioUnitProperty_UsesInternalReverb")]
pub const USES_INTERNAL_REVERB: Self = Self(1005);
#[doc(alias = "kAudioUnitProperty_SpatializationAlgorithm")]
pub const SPATIALIZATION_ALGORITHM: Self = Self(3000);
#[doc(alias = "kAudioUnitProperty_SpatialMixerRenderingFlags")]
pub const SPATIAL_MIXER_RENDERING_FLAGS: Self = Self(3003);
#[doc(alias = "kAudioUnitProperty_SpatialMixerSourceMode")]
pub const SPATIAL_MIXER_SRC_MODE: Self = Self(3005);
#[doc(alias = "kAudioUnitProperty_SpatialMixerDistanceParams")]
pub const SPATIAL_MIXER_DISTANCE_PARAMS: Self = Self(3010);
#[doc(alias = "kAudioUnitProperty_SpatialMixerAttenuationCurve")]
pub const SPATIAL_MIXER_ATTENUATION_CURVE: Self = Self(3013);
#[doc(alias = "kAudioUnitProperty_SpatialMixerOutputType")]
pub const SPATIAL_MIXER_OUTPUT_TYPE: Self = Self(3100);
#[doc(alias = "kAudioUnitProperty_SpatialMixerPointSourceInHeadMode")]
pub const SPATIAL_MIXER_POINT_SRC_IN_HEAD_MODE: Self = Self(3103);
#[cfg(target_os = "macos")]
#[doc(alias = "kAudioUnitProperty_SpatialMixerEnableHeadTracking")]
pub const SPATIAL_MIXER_ENABLE_HEAD_TRACKING: Self = Self(3111);
#[doc(alias = "kAudioUnitProperty_SpatialMixerPersonalizedHRTFMode")]
pub const SPATIAL_MIXER_PERSONALIZED_HRTF_MODE: Self = Self(3113);
#[doc(alias = "kAudioUnitProperty_SpatialMixerAnyInputIsUsingPersonalizedHRTF")]
pub const SPATIAL_MIXER_ANY_INPUT_IS_USING_PERSONALIZED_HRTF: Self = Self(3116);
}
#[doc(alias = "AUSpatializationAlgorithm")]
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
#[repr(u32)]
pub enum SpatializationAlgorithm {
#[doc(alias = "kSpatializationAlgorithm_EqualPowerPanning")]
EqualPowerPanning = 0,
#[doc(alias = "kSpatializationAlgorithm_SphericalHead")]
SphericalHead = 1,
#[doc(alias = "kSpatializationAlgorithm_HRTF")]
Hrtf = 2,
#[doc(alias = "kSpatializationAlgorithm_SoundField")]
SoundField = 3,
#[doc(alias = "kSpatializationAlgorithm_VectorBasedPanning")]
VectorBasedPanning = 4,
#[doc(alias = "kSpatializationAlgorithm_StereoPassThrough")]
StereoPassThrough = 5,
#[doc(alias = "kSpatializationAlgorithm_HRTFHQ")]
HrtfHq = 6,
#[doc(alias = "kSpatializationAlgorithm_UseOutputType")]
UseOutputType = 7,
}
pub mod preset_key {
use crate::cf;
#[doc(alias = "kAUPresetVersionKey")]
pub fn version() -> &'static cf::String {
cf::str!(c"version")
}
#[doc(alias = "kAUPresetTypeKey")]
pub fn type_() -> &'static cf::String {
cf::str!(c"type")
}
#[doc(alias = "kAUPresetSubtypeKey")]
pub fn subtype() -> &'static cf::String {
cf::str!(c"subtype")
}
#[doc(alias = "kAUPresetManufacturerKey")]
pub fn manufacturer() -> &'static cf::String {
cf::str!(c"manufacturer")
}
#[doc(alias = "kAUPresetDataKey")]
pub fn data() -> &'static cf::String {
cf::str!(c"data")
}
#[doc(alias = "kAUPresetNameKey")]
pub fn name() -> &'static cf::String {
cf::str!(c"name")
}
#[doc(alias = "kAUPresetNumberKey")]
pub fn preset_number() -> &'static cf::String {
cf::str!(c"preset-number")
}
#[doc(alias = "kAUPresetRenderQualityKey")]
pub fn render_quality() -> &'static cf::String {
cf::str!(c"render-quality")
}
#[doc(alias = "kAUPresetCPULoadKey")]
pub fn cpu_load() -> &'static cf::String {
cf::str!(c"cpu-load")
}
#[doc(alias = "kAUPresetElementNameKey")]
pub fn element_name() -> &'static cf::String {
cf::str!(c"element-name")
}
#[doc(alias = "kAUPresetExternalFileRefs")]
pub fn file_refs() -> &'static cf::String {
cf::str!(c"file-references")
}
#[cfg(target_os = "macos")]
#[doc(alias = "kAUPresetVSTDataKey")]
pub fn vst_data() -> &'static cf::String {
cf::str!(c"vstdata")
}
#[cfg(target_os = "macos")]
#[doc(alias = "kAUPresetVSTPresetKey")]
pub fn vst_preset() -> &'static cf::String {
cf::str!(c"vstpreset")
}
#[cfg(target_os = "macos")]
#[doc(alias = "kAUPresetMASDataKey")]
pub fn mas_data() -> &'static cf::String {
cf::str!(c"masdata")
}
#[doc(alias = "kAUPresetPartKey")]
pub fn part() -> &'static cf::String {
cf::str!(c"part")
}
}
#[doc(alias = "AudioUnitConnection")]
#[repr(C)]
pub struct Connection {
pub src_au: *const au::Unit,
pub src_output_num: u32,
pub dst_input_num: u32,
}
#[doc(alias = "AUChannelInfo")]
#[repr(C)]
pub struct ChannelInfo {
pub in_channels: i16,
pub out_channels: i16,
}
#[doc(alias = "AudioUnitExternalBuffer")]
#[repr(C)]
pub struct ExternalBuf {
pub buf: *mut u8,
pub size: u32,
}
#[doc(alias = "AURenderCallbackStruct")]
#[repr(C)]
pub struct RenderCbStruct<const N: usize, T = c_void> {
pub proc: *const au::RenderCb<N, T>,
pub proc_ref_con: *const T,
}
#[doc(alias = "AUPreset")]
#[repr(C)]
pub struct Preset {
pub number: i32,
pub name: Option<arc::R<cf::String>>,
}
#[doc(alias = "AudioUnitFrequencyResponseBin")]
#[derive(Debug, Default, Copy, Clone)]
#[repr(C)]
pub struct FrequencyResponseBin {
pub frequency: f64,
pub magnitude: f64,
}
impl FrequencyResponseBin {
#[doc(alias = "kNumberOfResponseFrequencies")]
pub const MAX_LEN: usize = 1024;
}
define_opts!(
#[doc(alias = "AUScheduledAudioSliceFlags")]
pub ScheduledSliceFlags(u32)
);
impl ScheduledSliceFlags {
#[doc(alias = "kScheduledAudioSliceFlag_Complete")]
pub const COMPLETE: Self = Self(0x01);
#[doc(alias = "kScheduledAudioSliceFlag_BeganToRender")]
pub const BEGAN_TO_RENDER: Self = Self(0x02);
#[doc(alias = "kScheduledAudioSliceFlag_BeganToRenderLate")]
pub const BEGAN_TO_RENDER_LATE: Self = Self(0x04);
#[doc(alias = "kScheduledAudioSliceFlag_Loop")]
pub const LOOP: Self = Self(0x08);
#[doc(alias = "kScheduledAudioSliceFlag_Interrupt")]
pub const INTERRUPT: Self = Self(0x10);
#[doc(alias = "kScheduledAudioSliceFlag_InterruptAtLoop")]
pub const INTERRUPT_AT_LOOP: Self = Self(0x20);
}
#[doc(alias = "ScheduledAudioSliceCompletionProc")]
pub type ScheduledSliceCompProc<T = c_void> = extern "C" fn(*mut T, &mut ScheduledSlice);
#[doc(alias = "ScheduledAudioSlice")]
#[repr(C)]
pub struct ScheduledSlice<T = c_void> {
pub ts: at::AudioTimeStamp,
pub comp_proc: Option<ScheduledSliceCompProc<T>>,
pub comp_proc_user_data: *mut T,
pub flags: ScheduledSliceFlags,
pub reserved: u32,
pub reserved2: *mut c_void,
pub number_frames: u32,
pub buf_list: *const at::AudioBufList,
}
impl au::PropId {
#[doc(alias = "kAudioUnitProperty_ScheduleAudioSlice")]
pub const SCHEDULE_SLICE: Self = Self(3300);
#[doc(alias = "kAudioUnitProperty_ScheduleStartTimeStamp")]
pub const SCHEDULE_START_TS: Self = Self(3301);
#[doc(alias = "kAudioUnitProperty_CurrentPlayTime")]
pub const CURRENT_PLAY_TIME: Self = Self(3302);
}
impl au::PropId {
#[doc(alias = "kAudioUnitProperty_ScheduledFileIDs")]
pub const SCHEDULED_FILE_IDS: Self = Self(3310);
#[doc(alias = "kAudioUnitProperty_ScheduledFileRegion")]
pub const SCHEDULED_FILE_REGION: Self = Self(3311);
#[doc(alias = "kAudioUnitProperty_ScheduledFilePrime")]
pub const SCHEDULED_FILE_PRIME: Self = Self(3312);
#[doc(alias = "kAudioUnitProperty_ScheduledFileBufferSizeFrames")]
pub const SCHEDULED_FILE_BUF_SIZE_FRAMES: Self = Self(3313);
#[doc(alias = "kAudioUnitProperty_ScheduledFileNumberBuffers")]
pub const SCHEDULED_FILE_NUMBER_BUFS: Self = Self(3314);
}
#[doc(alias = "ScheduledAudioFileRegionCompletionProc")]
pub type ScheduledFileRegionCompProc<T = c_void> =
extern "C" fn(*mut T, &mut ScheduledFileRegion<T>, os::Status);
#[doc(alias = "ScheduledAudioFileRegion")]
pub struct ScheduledFileRegion<T = c_void> {
pub ts: at::AudioTimeStamp,
pub comp_proc: Option<ScheduledFileRegionCompProc<T>>,
pub comp_proc_user_data: *mut T,
pub audio_file: *const at::AudioFileId,
pub loop_count: u32,
pub start_time: i64,
pub frames_to_play: u32,
}