use core::cell::UnsafeCell;
use core::ffi::*;
use core::marker::{PhantomData, PhantomPinned};
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use crate::*;
#[repr(C)]
#[derive(Debug)]
pub struct OpaqueAUGraph {
inner: [u8; 0],
_p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
}
unsafe impl RefEncode for OpaqueAUGraph {
const ENCODING_REF: Encoding = Encoding::Pointer(&Encoding::Struct("OpaqueAUGraph", &[]));
}
pub type AUGraph = *mut OpaqueAUGraph;
pub type AUNode = i32;
pub const kAUGraphErr_NodeNotFound: OSStatus = -10860;
pub const kAUGraphErr_InvalidConnection: OSStatus = -10861;
pub const kAUGraphErr_OutputNodeErr: OSStatus = -10862;
pub const kAUGraphErr_CannotDoInCurrentContext: OSStatus = -10863;
pub const kAUGraphErr_InvalidAudioUnit: OSStatus = -10864;
extern "C-unwind" {
#[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
pub fn NewAUGraph(out_graph: NonNull<AUGraph>) -> OSStatus;
}
extern "C-unwind" {
#[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
pub fn DisposeAUGraph(in_graph: AUGraph) -> OSStatus;
}
extern "C-unwind" {
#[cfg(feature = "AudioComponent")]
#[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
pub fn AUGraphAddNode(
in_graph: AUGraph,
in_description: NonNull<AudioComponentDescription>,
out_node: NonNull<AUNode>,
) -> OSStatus;
}
extern "C-unwind" {
#[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
pub fn AUGraphRemoveNode(in_graph: AUGraph, in_node: AUNode) -> OSStatus;
}
extern "C-unwind" {
#[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
pub fn AUGraphGetNodeCount(in_graph: AUGraph, out_number_of_nodes: NonNull<u32>) -> OSStatus;
}
extern "C-unwind" {
#[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
pub fn AUGraphGetIndNode(
in_graph: AUGraph,
in_index: u32,
out_node: NonNull<AUNode>,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(all(feature = "AUComponent", feature = "AudioComponent"))]
#[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
pub fn AUGraphNodeInfo(
in_graph: AUGraph,
in_node: AUNode,
out_description: *mut AudioComponentDescription,
out_audio_unit: *mut AudioUnit,
) -> OSStatus;
}
extern "C-unwind" {
#[deprecated = "no longer supported"]
pub fn AUGraphNewNodeSubGraph(in_graph: AUGraph, out_node: NonNull<AUNode>) -> OSStatus;
}
extern "C-unwind" {
#[deprecated = "no longer supported"]
pub fn AUGraphGetNodeInfoSubGraph(
in_graph: AUGraph,
in_node: AUNode,
out_sub_graph: NonNull<AUGraph>,
) -> OSStatus;
}
extern "C-unwind" {
#[deprecated = "no longer supported"]
pub fn AUGraphIsNodeSubGraph(
in_graph: AUGraph,
in_node: AUNode,
out_flag: NonNull<Boolean>,
) -> OSStatus;
}
pub const kAUNodeInteraction_Connection: u32 = 1;
pub const kAUNodeInteraction_InputCallback: u32 = 2;
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct AudioUnitNodeConnection {
pub sourceNode: AUNode,
pub sourceOutputNumber: u32,
pub destNode: AUNode,
pub destInputNumber: u32,
}
unsafe impl Encode for AudioUnitNodeConnection {
const ENCODING: Encoding = Encoding::Struct(
"AudioUnitNodeConnection",
&[
<AUNode>::ENCODING,
<u32>::ENCODING,
<AUNode>::ENCODING,
<u32>::ENCODING,
],
);
}
unsafe impl RefEncode for AudioUnitNodeConnection {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
pub type AUNodeConnection = AudioUnitNodeConnection;
#[cfg(all(
feature = "AUComponent",
feature = "AudioUnitProperties",
feature = "objc2-core-audio-types"
))]
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct AUNodeRenderCallback {
pub destNode: AUNode,
pub destInputNumber: AudioUnitElement,
pub cback: AURenderCallbackStruct,
}
#[cfg(all(
feature = "AUComponent",
feature = "AudioUnitProperties",
feature = "objc2-core-audio-types"
))]
unsafe impl Encode for AUNodeRenderCallback {
const ENCODING: Encoding = Encoding::Struct(
"AUNodeRenderCallback",
&[
<AUNode>::ENCODING,
<AudioUnitElement>::ENCODING,
<AURenderCallbackStruct>::ENCODING,
],
);
}
#[cfg(all(
feature = "AUComponent",
feature = "AudioUnitProperties",
feature = "objc2-core-audio-types"
))]
unsafe impl RefEncode for AUNodeRenderCallback {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern "C-unwind" {
#[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
pub fn AUGraphConnectNodeInput(
in_graph: AUGraph,
in_source_node: AUNode,
in_source_output_number: u32,
in_dest_node: AUNode,
in_dest_input_number: u32,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(all(
feature = "AUComponent",
feature = "AudioUnitProperties",
feature = "objc2-core-audio-types"
))]
#[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
pub fn AUGraphSetNodeInputCallback(
in_graph: AUGraph,
in_dest_node: AUNode,
in_dest_input_number: u32,
in_input_callback: NonNull<AURenderCallbackStruct>,
) -> OSStatus;
}
extern "C-unwind" {
#[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
pub fn AUGraphDisconnectNodeInput(
in_graph: AUGraph,
in_dest_node: AUNode,
in_dest_input_number: u32,
) -> OSStatus;
}
extern "C-unwind" {
#[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
pub fn AUGraphClearConnections(in_graph: AUGraph) -> OSStatus;
}
extern "C-unwind" {
#[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
pub fn AUGraphGetNumberOfInteractions(
in_graph: AUGraph,
out_num_interactions: NonNull<u32>,
) -> OSStatus;
}
extern "C-unwind" {
#[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
pub fn AUGraphCountNodeInteractions(
in_graph: AUGraph,
in_node: AUNode,
out_num_interactions: NonNull<u32>,
) -> OSStatus;
}
extern "C-unwind" {
#[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
pub fn AUGraphUpdate(in_graph: AUGraph, out_is_updated: *mut Boolean) -> OSStatus;
}
extern "C-unwind" {
#[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
pub fn AUGraphOpen(in_graph: AUGraph) -> OSStatus;
}
extern "C-unwind" {
#[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
pub fn AUGraphClose(in_graph: AUGraph) -> OSStatus;
}
extern "C-unwind" {
#[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
pub fn AUGraphInitialize(in_graph: AUGraph) -> OSStatus;
}
extern "C-unwind" {
#[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
pub fn AUGraphUninitialize(in_graph: AUGraph) -> OSStatus;
}
extern "C-unwind" {
#[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
pub fn AUGraphStart(in_graph: AUGraph) -> OSStatus;
}
extern "C-unwind" {
#[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
pub fn AUGraphStop(in_graph: AUGraph) -> OSStatus;
}
extern "C-unwind" {
#[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
pub fn AUGraphIsOpen(in_graph: AUGraph, out_is_open: NonNull<Boolean>) -> OSStatus;
}
extern "C-unwind" {
#[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
pub fn AUGraphIsInitialized(
in_graph: AUGraph,
out_is_initialized: NonNull<Boolean>,
) -> OSStatus;
}
extern "C-unwind" {
#[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
pub fn AUGraphIsRunning(in_graph: AUGraph, out_is_running: NonNull<Boolean>) -> OSStatus;
}
extern "C-unwind" {
#[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
pub fn AUGraphGetCPULoad(in_graph: AUGraph, out_average_cpu_load: NonNull<f32>) -> OSStatus;
}
extern "C-unwind" {
#[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
pub fn AUGraphGetMaxCPULoad(in_graph: AUGraph, out_max_load: NonNull<f32>) -> OSStatus;
}
extern "C-unwind" {
#[cfg(all(feature = "AUComponent", feature = "objc2-core-audio-types"))]
#[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
pub fn AUGraphAddRenderNotify(
in_graph: AUGraph,
in_callback: AURenderCallback,
in_ref_con: *mut c_void,
) -> OSStatus;
}
extern "C-unwind" {
#[cfg(all(feature = "AUComponent", feature = "objc2-core-audio-types"))]
#[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
pub fn AUGraphRemoveRenderNotify(
in_graph: AUGraph,
in_callback: AURenderCallback,
in_ref_con: *mut c_void,
) -> OSStatus;
}
extern "C-unwind" {
#[deprecated = "no longer supported"]
pub fn AUGraphGetNumberOfConnections(
in_graph: AUGraph,
out_num_connections: NonNull<u32>,
) -> OSStatus;
}
extern "C-unwind" {
#[deprecated = "no longer supported"]
pub fn AUGraphGetConnectionInfo(
in_graph: AUGraph,
in_connection_index: u32,
out_source_node: NonNull<AUNode>,
out_source_output_number: NonNull<u32>,
out_dest_node: NonNull<AUNode>,
out_dest_input_number: NonNull<u32>,
) -> OSStatus;
}
extern "C-unwind" {
#[deprecated = "no longer supported"]
pub fn AUGraphCountNodeConnections(
in_graph: AUGraph,
in_node: AUNode,
out_num_connections: NonNull<u32>,
) -> OSStatus;
}
extern "C-unwind" {
#[deprecated = "no longer supported"]
pub fn AUGraphGetNodeConnections(
in_graph: AUGraph,
in_node: AUNode,
out_connections: NonNull<AudioUnitNodeConnection>,
io_num_connections: NonNull<u32>,
) -> OSStatus;
}