objc2_audio_toolbox/generated/
AUGraph.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::cell::UnsafeCell;
4use core::ffi::*;
5use core::marker::{PhantomData, PhantomPinned};
6use core::ptr::NonNull;
7use objc2::__framework_prelude::*;
8
9use crate::*;
10
11/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/opaqueaugraph?language=objc)
12#[repr(C)]
13#[derive(Debug)]
14pub struct OpaqueAUGraph {
15    inner: [u8; 0],
16    _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
17}
18
19unsafe impl RefEncode for OpaqueAUGraph {
20    const ENCODING_REF: Encoding = Encoding::Pointer(&Encoding::Struct("OpaqueAUGraph", &[]));
21}
22
23/// A reference to an AUGraph object.
24///
25/// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/augraph?language=objc)
26pub type AUGraph = *mut OpaqueAUGraph;
27
28/// Used to represent a member of an AUGraph
29///
30/// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/aunode?language=objc)
31pub type AUNode = i32;
32
33/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaugrapherr_nodenotfound?language=objc)
34pub const kAUGraphErr_NodeNotFound: OSStatus = -10860;
35/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaugrapherr_invalidconnection?language=objc)
36pub const kAUGraphErr_InvalidConnection: OSStatus = -10861;
37/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaugrapherr_outputnodeerr?language=objc)
38pub const kAUGraphErr_OutputNodeErr: OSStatus = -10862;
39/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaugrapherr_cannotdoincurrentcontext?language=objc)
40pub const kAUGraphErr_CannotDoInCurrentContext: OSStatus = -10863;
41/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaugrapherr_invalidaudiounit?language=objc)
42pub const kAUGraphErr_InvalidAudioUnit: OSStatus = -10864;
43
44extern "C-unwind" {
45    /// Create a new AUGraph
46    ///
47    ///
48    /// Parameter `outGraph`: the new AUGraph object
49    ///
50    /// # Safety
51    ///
52    /// `out_graph` must be a valid pointer.
53    #[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
54    pub fn NewAUGraph(out_graph: NonNull<AUGraph>) -> OSStatus;
55}
56
57extern "C-unwind" {
58    /// Dispose an AUGraph
59    ///
60    /// Deallocates the AUGraph along with its nodes and their resources.
61    ///
62    ///
63    /// Parameter `inGraph`: the AUGraph object to be disposed
64    ///
65    /// # Safety
66    ///
67    /// `in_graph` must be a valid pointer.
68    #[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
69    pub fn DisposeAUGraph(in_graph: AUGraph) -> OSStatus;
70}
71
72extern "C-unwind" {
73    /// Add a node to an AUGraph
74    ///
75    /// Creates a node in the graph that is an AudioUnit, using the supplied
76    /// AudioComponentDescription to find and open that unit.
77    ///
78    ///
79    /// Parameter `inGraph`: the AUGraph object
80    ///
81    /// Parameter `inDescription`: the AudioComponentDescription used to find and open the AudioUnit
82    ///
83    /// Parameter `outNode`: the newly added node
84    ///
85    /// # Safety
86    ///
87    /// - `in_graph` must be a valid pointer.
88    /// - `in_description` must be a valid pointer.
89    /// - `out_node` must be a valid pointer.
90    #[cfg(feature = "AudioComponent")]
91    #[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
92    pub fn AUGraphAddNode(
93        in_graph: AUGraph,
94        in_description: NonNull<AudioComponentDescription>,
95        out_node: NonNull<AUNode>,
96    ) -> OSStatus;
97}
98
99extern "C-unwind" {
100    /// Remove a node from an AUGraph
101    ///
102    /// Nodes can be removed from any thread context. The output node of
103    /// the AUGraph cannot be removed while the graph is running.
104    ///
105    ///
106    /// Parameter `inGraph`: the AUGraph object
107    ///
108    /// Parameter `inNode`: the node to be removed
109    ///
110    /// # Safety
111    ///
112    /// `in_graph` must be a valid pointer.
113    #[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
114    pub fn AUGraphRemoveNode(in_graph: AUGraph, in_node: AUNode) -> OSStatus;
115}
116
117extern "C-unwind" {
118    /// The number of nodes in an AUGraph
119    ///
120    ///
121    /// Parameter `inGraph`: the AUGraph object
122    ///
123    /// Parameter `outNumberOfNodes`: the number of nodes
124    ///
125    /// # Safety
126    ///
127    /// - `in_graph` must be a valid pointer.
128    /// - `out_number_of_nodes` must be a valid pointer.
129    #[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
130    pub fn AUGraphGetNodeCount(in_graph: AUGraph, out_number_of_nodes: NonNull<u32>) -> OSStatus;
131}
132
133extern "C-unwind" {
134    /// Returns the node at a given index
135    ///
136    /// By using AUGraphGetNodeCount in conjunction with this call, you can
137    /// iterate through the nodes of an AUGraph.
138    ///
139    ///
140    /// Parameter `inGraph`: the AUGraph object
141    ///
142    /// Parameter `inIndex`: the index of the node to retrieve
143    ///
144    /// Parameter `outNode`: the node at that index
145    ///
146    /// # Safety
147    ///
148    /// - `in_graph` must be a valid pointer.
149    /// - `out_node` must be a valid pointer.
150    #[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
151    pub fn AUGraphGetIndNode(
152        in_graph: AUGraph,
153        in_index: u32,
154        out_node: NonNull<AUNode>,
155    ) -> OSStatus;
156}
157
158extern "C-unwind" {
159    /// Returns information about a particular AUNode
160    ///
161    /// You can pass in NULL for any of the out parameters if you're not interested
162    /// in that value.
163    ///
164    ///
165    /// Parameter `inGraph`: the AUGraph object
166    ///
167    /// Parameter `inNode`: the node to query
168    ///
169    /// Parameter `outDescription`: the component description that would describe the AudioUnit of this node
170    ///
171    /// Parameter `outAudioUnit`: the AudioUnit of this node
172    ///
173    /// # Safety
174    ///
175    /// - `in_graph` must be a valid pointer.
176    /// - `out_description` must be a valid pointer or null.
177    /// - `out_audio_unit` must be a valid pointer or null.
178    #[cfg(all(feature = "AUComponent", feature = "AudioComponent"))]
179    #[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
180    pub fn AUGraphNodeInfo(
181        in_graph: AUGraph,
182        in_node: AUNode,
183        out_description: *mut AudioComponentDescription,
184        out_audio_unit: *mut AudioUnit,
185    ) -> OSStatus;
186}
187
188extern "C-unwind" {
189    /// Create a node that will represent a sub graph
190    ///
191    /// This will create a node that represents a contained or member AUGraph.
192    /// The AUGraph can be retrieved through the GetNodeInfoSubGraph call.
193    /// The member AUGraph is owned by the parent graph and will be disposed when
194    /// either:
195    /// 1. The parent graph is disposed
196    /// 2. The node is removed from the parent AUGraph
197    ///
198    ///
199    /// Parameter `inGraph`: the AUGraph object
200    ///
201    /// Parameter `outNode`: the node that is used to refer to the sub-graph
202    ///
203    /// # Safety
204    ///
205    /// - `in_graph` must be a valid pointer.
206    /// - `out_node` must be a valid pointer.
207    #[deprecated = "no longer supported"]
208    pub fn AUGraphNewNodeSubGraph(in_graph: AUGraph, out_node: NonNull<AUNode>) -> OSStatus;
209}
210
211extern "C-unwind" {
212    /// Return an AUGraph represented by this node
213    ///
214    /// This will return the sub graph represented by this AUNode.
215    ///
216    ///
217    /// Parameter `inGraph`: the AUGraph object
218    ///
219    /// Parameter `inNode`: the node to query
220    ///
221    /// Parameter `outSubGraph`: the sub-graph
222    ///
223    /// # Safety
224    ///
225    /// - `in_graph` must be a valid pointer.
226    /// - `out_sub_graph` must be a valid pointer.
227    #[deprecated = "no longer supported"]
228    pub fn AUGraphGetNodeInfoSubGraph(
229        in_graph: AUGraph,
230        in_node: AUNode,
231        out_sub_graph: NonNull<AUGraph>,
232    ) -> OSStatus;
233}
234
235extern "C-unwind" {
236    /// Determine whether the node represents a sub graph
237    ///
238    /// This will return true if the specified node represents a subgraph, false if not.
239    ///
240    ///
241    /// Parameter `inGraph`: the AUGraph object
242    ///
243    /// Parameter `inNode`: the node to query
244    ///
245    /// Parameter `outFlag`: true if the node is a subgraph, false if not
246    ///
247    /// # Safety
248    ///
249    /// - `in_graph` must be a valid pointer.
250    /// - `out_flag` must be a valid pointer.
251    #[deprecated = "no longer supported"]
252    pub fn AUGraphIsNodeSubGraph(
253        in_graph: AUGraph,
254        in_node: AUNode,
255        out_flag: NonNull<Boolean>,
256    ) -> OSStatus;
257}
258
259/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaunodeinteraction_connection?language=objc)
260pub const kAUNodeInteraction_Connection: u32 = 1;
261/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/kaunodeinteraction_inputcallback?language=objc)
262pub const kAUNodeInteraction_InputCallback: u32 = 2;
263
264/// A connection between two nodes
265///
266/// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/audiounitnodeconnection?language=objc)
267#[repr(C)]
268#[derive(Clone, Copy, Debug, PartialEq)]
269pub struct AudioUnitNodeConnection {
270    pub sourceNode: AUNode,
271    pub sourceOutputNumber: u32,
272    pub destNode: AUNode,
273    pub destInputNumber: u32,
274}
275
276unsafe impl Encode for AudioUnitNodeConnection {
277    const ENCODING: Encoding = Encoding::Struct(
278        "AudioUnitNodeConnection",
279        &[
280            <AUNode>::ENCODING,
281            <u32>::ENCODING,
282            <AUNode>::ENCODING,
283            <u32>::ENCODING,
284        ],
285    );
286}
287
288unsafe impl RefEncode for AudioUnitNodeConnection {
289    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
290}
291
292/// [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/aunodeconnection?language=objc)
293pub type AUNodeConnection = AudioUnitNodeConnection;
294
295/// A callback used to provide input to an audio unit
296///
297/// Used to contain information when a callback is used
298/// to provide input to the specific node's specified input
299///
300/// See also [Apple's documentation](https://developer.apple.com/documentation/audiotoolbox/aunoderendercallback?language=objc)
301#[cfg(all(
302    feature = "AUComponent",
303    feature = "AudioUnitProperties",
304    feature = "objc2-core-audio-types"
305))]
306#[repr(C)]
307#[derive(Clone, Copy, Debug, PartialEq)]
308pub struct AUNodeRenderCallback {
309    pub destNode: AUNode,
310    pub destInputNumber: AudioUnitElement,
311    pub cback: AURenderCallbackStruct,
312}
313
314#[cfg(all(
315    feature = "AUComponent",
316    feature = "AudioUnitProperties",
317    feature = "objc2-core-audio-types"
318))]
319unsafe impl Encode for AUNodeRenderCallback {
320    const ENCODING: Encoding = Encoding::Struct(
321        "AUNodeRenderCallback",
322        &[
323            <AUNode>::ENCODING,
324            <AudioUnitElement>::ENCODING,
325            <AURenderCallbackStruct>::ENCODING,
326        ],
327    );
328}
329
330#[cfg(all(
331    feature = "AUComponent",
332    feature = "AudioUnitProperties",
333    feature = "objc2-core-audio-types"
334))]
335unsafe impl RefEncode for AUNodeRenderCallback {
336    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
337}
338
339extern "C-unwind" {
340    /// connect a node's output to a node's input
341    ///
342    /// # Safety
343    ///
344    /// `in_graph` must be a valid pointer.
345    #[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
346    pub fn AUGraphConnectNodeInput(
347        in_graph: AUGraph,
348        in_source_node: AUNode,
349        in_source_output_number: u32,
350        in_dest_node: AUNode,
351        in_dest_input_number: u32,
352    ) -> OSStatus;
353}
354
355extern "C-unwind" {
356    /// Set a callback for the specified node's specified input.
357    ///
358    /// Parameter `inInputCallback`: The callback that will provide input data to the node
359    ///
360    /// # Safety
361    ///
362    /// - `in_graph` must be a valid pointer.
363    /// - `in_input_callback` must be a valid pointer.
364    #[cfg(all(
365        feature = "AUComponent",
366        feature = "AudioUnitProperties",
367        feature = "objc2-core-audio-types"
368    ))]
369    #[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
370    pub fn AUGraphSetNodeInputCallback(
371        in_graph: AUGraph,
372        in_dest_node: AUNode,
373        in_dest_input_number: u32,
374        in_input_callback: NonNull<AURenderCallbackStruct>,
375    ) -> OSStatus;
376}
377
378extern "C-unwind" {
379    /// disconnect a node's input
380    ///
381    /// This can be used to disconnect either a connection or callback interaction
382    /// to the specified node input
383    ///
384    /// # Safety
385    ///
386    /// `in_graph` must be a valid pointer.
387    #[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
388    pub fn AUGraphDisconnectNodeInput(
389        in_graph: AUGraph,
390        in_dest_node: AUNode,
391        in_dest_input_number: u32,
392    ) -> OSStatus;
393}
394
395extern "C-unwind" {
396    /// clear all of the interactions in a graph
397    ///
398    /// This will clear all connections and callback interactions of the nodes of a graph
399    ///
400    /// # Safety
401    ///
402    /// `in_graph` must be a valid pointer.
403    #[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
404    pub fn AUGraphClearConnections(in_graph: AUGraph) -> OSStatus;
405}
406
407extern "C-unwind" {
408    /// Retrieve the number of interactions of a graph
409    ///
410    /// The number of node interactions currently being managed by the graph
411    ///
412    /// # Safety
413    ///
414    /// - `in_graph` must be a valid pointer.
415    /// - `out_num_interactions` must be a valid pointer.
416    #[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
417    pub fn AUGraphGetNumberOfInteractions(
418        in_graph: AUGraph,
419        out_num_interactions: NonNull<u32>,
420    ) -> OSStatus;
421}
422
423extern "C-unwind" {
424    /// Retrieve the number of interactions of a graph's node
425    ///
426    /// The number of node interactions currently being managed by the graph for the specified node.
427    ///
428    /// # Safety
429    ///
430    /// - `in_graph` must be a valid pointer.
431    /// - `out_num_interactions` must be a valid pointer.
432    #[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
433    pub fn AUGraphCountNodeInteractions(
434        in_graph: AUGraph,
435        in_node: AUNode,
436        out_num_interactions: NonNull<u32>,
437    ) -> OSStatus;
438}
439
440extern "C-unwind" {
441    /// Updates the state of a running AUGraph
442    ///
443    /// Call this after performing a series of "edits" on the AUGraph with calls
444    /// such as AUGraphConnectNodeInput() to finalize those edits.
445    /// The call will be synchronous if outIsUpdated is NULL,
446    /// meaning it will block until the changes are incorporated
447    /// into the graph OR an error is returned from the update process
448    /// if outIsUpdated is non-NULL, then AUGraphUpdate() will return
449    /// immediately and outIsUpdated will equal "true" if the changes
450    /// were already made (no more changes to make) or "false" if changes are still
451    /// outstanding.
452    ///
453    /// Calling from the AUGraphRenderNotification callback:
454    /// Connection and Disconnection events can be completely processed
455    /// in the render notification callback of the AUGraph
456    /// Nodes can also be removed (except for the output node or a sub-graph of the AUGraph)
457    /// as well.
458    ///
459    /// Getting kAUGraphErr_CannotDoInCurrentContext as a result code:
460    /// If AUGraphUpdate returns this result, then it means it was
461    /// unable to process the update, due to an inability to safely
462    /// alter the state of the graph (because another thread was accessing
463    /// a call that relies on the graph's state having integrity).
464    /// This result code is only a transitory state, which will pass as soon
465    /// as your other thread's call to AUGraph (that has the lock) completes.
466    ///
467    /// If an error is encountered in the process of an update (say an invalid connection
468    /// is attempted, a disconnection between nodes that are not connected, etc) on a running graph,
469    /// then the call will return that error code. It only process events whilst it receives
470    /// no error results. Thus, if an error is encountered, other events will not be
471    /// processed until AUGraphUpdate is called again. This is done, in cases where
472    /// the state of the graph could become inconsistent if further events were processed, so
473    /// this decision is left up to you. The same applies to the "cant do" error - you have
474    /// to explicitly call AUGraphUpdate again to have the processing of the events occur.
475    ///
476    ///
477    /// Parameter `outIsUpdated`: if specified returns true if all of the edits were applied to the graph
478    ///
479    /// # Safety
480    ///
481    /// - `in_graph` must be a valid pointer.
482    /// - `out_is_updated` must be a valid pointer or null.
483    #[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
484    pub fn AUGraphUpdate(in_graph: AUGraph, out_is_updated: *mut Boolean) -> OSStatus;
485}
486
487extern "C-unwind" {
488    /// Open a graph
489    ///
490    /// AudioUnits are open but not initialized (no resource allocation occurs here)
491    ///
492    /// # Safety
493    ///
494    /// `in_graph` must be a valid pointer.
495    #[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
496    pub fn AUGraphOpen(in_graph: AUGraph) -> OSStatus;
497}
498
499extern "C-unwind" {
500    /// Close a graph
501    ///
502    /// All AudioUnits are closed - leaving only its nodal representation
503    ///
504    /// # Safety
505    ///
506    /// `in_graph` must be a valid pointer.
507    #[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
508    pub fn AUGraphClose(in_graph: AUGraph) -> OSStatus;
509}
510
511extern "C-unwind" {
512    /// Initialise a graph
513    ///
514    /// AudioUnitInitialize() is called on each opened node/AudioUnit
515    /// (get ready to render) and SubGraph that are involved in a
516    /// interaction. If the node is not involved, it is initialised
517    /// after it becomes involved in an interaction.
518    ///
519    /// A graph must be opened before it can be initialised.
520    ///
521    /// # Safety
522    ///
523    /// `in_graph` must be a valid pointer.
524    #[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
525    pub fn AUGraphInitialize(in_graph: AUGraph) -> OSStatus;
526}
527
528extern "C-unwind" {
529    /// Uninitialise a graph
530    ///
531    /// The member of the graph are uninitialised
532    ///
533    /// # Safety
534    ///
535    /// `in_graph` must be a valid pointer.
536    #[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
537    pub fn AUGraphUninitialize(in_graph: AUGraph) -> OSStatus;
538}
539
540extern "C-unwind" {
541    /// Start a graph
542    ///
543    /// Start() is called on the "head" node(s) of the AUGraph (now rendering starts)
544    ///
545    /// The graph must be initialised before it can be started.
546    ///
547    /// # Safety
548    ///
549    /// `in_graph` must be a valid pointer.
550    #[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
551    pub fn AUGraphStart(in_graph: AUGraph) -> OSStatus;
552}
553
554extern "C-unwind" {
555    /// Stop a graph
556    ///
557    /// Stop() is called on the "head" node(s) of the AUGraph    (rendering is stopped)
558    ///
559    /// # Safety
560    ///
561    /// `in_graph` must be a valid pointer.
562    #[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
563    pub fn AUGraphStop(in_graph: AUGraph) -> OSStatus;
564}
565
566extern "C-unwind" {
567    /// Is the graph open
568    ///
569    /// # Safety
570    ///
571    /// - `in_graph` must be a valid pointer.
572    /// - `out_is_open` must be a valid pointer.
573    #[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
574    pub fn AUGraphIsOpen(in_graph: AUGraph, out_is_open: NonNull<Boolean>) -> OSStatus;
575}
576
577extern "C-unwind" {
578    /// Is the graph initialised
579    ///
580    /// # Safety
581    ///
582    /// - `in_graph` must be a valid pointer.
583    /// - `out_is_initialized` must be a valid pointer.
584    #[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
585    pub fn AUGraphIsInitialized(
586        in_graph: AUGraph,
587        out_is_initialized: NonNull<Boolean>,
588    ) -> OSStatus;
589}
590
591extern "C-unwind" {
592    /// Is the graph running (has it been started)
593    ///
594    /// # Safety
595    ///
596    /// - `in_graph` must be a valid pointer.
597    /// - `out_is_running` must be a valid pointer.
598    #[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
599    pub fn AUGraphIsRunning(in_graph: AUGraph, out_is_running: NonNull<Boolean>) -> OSStatus;
600}
601
602extern "C-unwind" {
603    /// The CPU load of the graph
604    ///
605    /// Returns a short-term running average of the current CPU load of the graph.
606    ///
607    /// # Safety
608    ///
609    /// - `in_graph` must be a valid pointer.
610    /// - `out_average_cpu_load` must be a valid pointer.
611    #[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
612    pub fn AUGraphGetCPULoad(in_graph: AUGraph, out_average_cpu_load: NonNull<f32>) -> OSStatus;
613}
614
615extern "C-unwind" {
616    /// The Maximum CPU load of the graph
617    ///
618    /// Returns the max CPU load of the graph since this call was last made or the graph was last
619    /// started.
620    ///
621    /// # Safety
622    ///
623    /// - `in_graph` must be a valid pointer.
624    /// - `out_max_load` must be a valid pointer.
625    #[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
626    pub fn AUGraphGetMaxCPULoad(in_graph: AUGraph, out_max_load: NonNull<f32>) -> OSStatus;
627}
628
629extern "C-unwind" {
630    /// Add a notification callback
631    ///
632    /// Add a callback that the graph will call every time the graph renders. The callback will be
633    /// called once before the graph's render operation, and once after the render operation is
634    /// complete.
635    ///
636    /// # Safety
637    ///
638    /// - `in_graph` must be a valid pointer.
639    /// - `in_callback` must be implemented correctly.
640    /// - `in_ref_con` must be a valid pointer or null.
641    #[cfg(all(feature = "AUComponent", feature = "objc2-core-audio-types"))]
642    #[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
643    pub fn AUGraphAddRenderNotify(
644        in_graph: AUGraph,
645        in_callback: AURenderCallback,
646        in_ref_con: *mut c_void,
647    ) -> OSStatus;
648}
649
650extern "C-unwind" {
651    /// Remove a notification callback
652    ///
653    /// Remove a previously added callback. You must provide both the callback and the refCon that was
654    /// used previously to add the callback.
655    ///
656    /// # Safety
657    ///
658    /// - `in_graph` must be a valid pointer.
659    /// - `in_callback` must be implemented correctly.
660    /// - `in_ref_con` must be a valid pointer or null.
661    #[cfg(all(feature = "AUComponent", feature = "objc2-core-audio-types"))]
662    #[deprecated = "AUGraph is deprecated in favor of AVAudioEngine"]
663    pub fn AUGraphRemoveRenderNotify(
664        in_graph: AUGraph,
665        in_callback: AURenderCallback,
666        in_ref_con: *mut c_void,
667    ) -> OSStatus;
668}
669
670extern "C-unwind" {
671    /// # Safety
672    ///
673    /// - `in_graph` must be a valid pointer.
674    /// - `out_num_connections` must be a valid pointer.
675    #[deprecated = "no longer supported"]
676    pub fn AUGraphGetNumberOfConnections(
677        in_graph: AUGraph,
678        out_num_connections: NonNull<u32>,
679    ) -> OSStatus;
680}
681
682extern "C-unwind" {
683    /// # Safety
684    ///
685    /// - `in_graph` must be a valid pointer.
686    /// - `out_source_node` must be a valid pointer.
687    /// - `out_source_output_number` must be a valid pointer.
688    /// - `out_dest_node` must be a valid pointer.
689    /// - `out_dest_input_number` must be a valid pointer.
690    #[deprecated = "no longer supported"]
691    pub fn AUGraphGetConnectionInfo(
692        in_graph: AUGraph,
693        in_connection_index: u32,
694        out_source_node: NonNull<AUNode>,
695        out_source_output_number: NonNull<u32>,
696        out_dest_node: NonNull<AUNode>,
697        out_dest_input_number: NonNull<u32>,
698    ) -> OSStatus;
699}
700
701extern "C-unwind" {
702    /// # Safety
703    ///
704    /// - `in_graph` must be a valid pointer.
705    /// - `out_num_connections` must be a valid pointer.
706    #[deprecated = "no longer supported"]
707    pub fn AUGraphCountNodeConnections(
708        in_graph: AUGraph,
709        in_node: AUNode,
710        out_num_connections: NonNull<u32>,
711    ) -> OSStatus;
712}
713
714extern "C-unwind" {
715    /// # Safety
716    ///
717    /// - `in_graph` must be a valid pointer.
718    /// - `out_connections` must be a valid pointer.
719    /// - `io_num_connections` must be a valid pointer.
720    #[deprecated = "no longer supported"]
721    pub fn AUGraphGetNodeConnections(
722        in_graph: AUGraph,
723        in_node: AUNode,
724        out_connections: NonNull<AudioUnitNodeConnection>,
725        io_num_connections: NonNull<u32>,
726    ) -> OSStatus;
727}