pub unsafe extern "C-unwind" fn AUGraphUpdate(
in_graph: AUGraph,
out_is_updated: *mut u8,
) -> i32AUGraph only.Expand description
Updates the state of a running AUGraph
Call this after performing a series of “edits” on the AUGraph with calls such as AUGraphConnectNodeInput() to finalize those edits. The call will be synchronous if outIsUpdated is NULL, meaning it will block until the changes are incorporated into the graph OR an error is returned from the update process if outIsUpdated is non-NULL, then AUGraphUpdate() will return immediately and outIsUpdated will equal “true” if the changes were already made (no more changes to make) or “false” if changes are still outstanding.
Calling from the AUGraphRenderNotification callback: Connection and Disconnection events can be completely processed in the render notification callback of the AUGraph Nodes can also be removed (except for the output node or a sub-graph of the AUGraph) as well.
Getting kAUGraphErr_CannotDoInCurrentContext as a result code: If AUGraphUpdate returns this result, then it means it was unable to process the update, due to an inability to safely alter the state of the graph (because another thread was accessing a call that relies on the graph’s state having integrity). This result code is only a transitory state, which will pass as soon as your other thread’s call to AUGraph (that has the lock) completes.
If an error is encountered in the process of an update (say an invalid connection is attempted, a disconnection between nodes that are not connected, etc) on a running graph, then the call will return that error code. It only process events whilst it receives no error results. Thus, if an error is encountered, other events will not be processed until AUGraphUpdate is called again. This is done, in cases where the state of the graph could become inconsistent if further events were processed, so this decision is left up to you. The same applies to the “cant do” error - you have to explicitly call AUGraphUpdate again to have the processing of the events occur.
Parameter outIsUpdated: if specified returns true if all of the edits were applied to the graph
§Safety
in_graphmust be a valid pointer.out_is_updatedmust be a valid pointer or null.