pub unsafe trait AUMessageChannel {
// Provided methods
unsafe fn callAudioUnit(
&self,
message: &NSDictionary,
) -> Retained<NSDictionary>
where Self: Sized + Message { ... }
unsafe fn callHostBlock(&self) -> CallHostBlock
where Self: Sized + Message { ... }
unsafe fn setCallHostBlock(&self, call_host_block: CallHostBlock)
where Self: Sized + Message { ... }
}AUAudioUnit only.Expand description
The protocol which objects returned from [AUAudioUnit messageChannelFor:] have to conform to.
Audio Units and hosts that have special needs of communication, e.g. to exchange musical context required for better audio processing,
can implement a communication object to exchange messages in form of NSDictionaries. An Audio Unit would need to implement
a class conforming to the AUMessageChannel protocol and return an instance via [AUAudioUnit messageChannelFor:]. A host can query
the instance via the channel name.
The protocol offers a method to send messages to the AU and a block to send messages to the host.
See also Apple’s documentation
Provided Methods§
Sourceunsafe fn callAudioUnit(&self, message: &NSDictionary) -> Retained<NSDictionary>
unsafe fn callAudioUnit(&self, message: &NSDictionary) -> Retained<NSDictionary>
Calls the Audio Unit with custom data message.
Parameter message: An NSDictionary with custom data. The allowed classes for key and value types are
NSArray, NSDictionary, NSOrderedSet, NSSet, NSString, NSData, NSNull, NSNumber, NSDate
Returns: An NSDictionary with custom data. The allowed classes for key and value types are NSArray, NSDictionary, NSOrderedSet, NSSet, NSString, NSData, NSNull, NSNumber, NSDate
§Safety
message generic should be of the correct type.
Sourceunsafe fn callHostBlock(&self) -> CallHostBlock
Available on crate feature block2 only.
unsafe fn callHostBlock(&self) -> CallHostBlock
block2 only.A callback for the AU to send a message to the host.
The host has to set a block on this property.
§Safety
The returned block’s argument must be a valid pointer.
Sourceunsafe fn setCallHostBlock(&self, call_host_block: CallHostBlock)
Available on crate feature block2 only.
unsafe fn setCallHostBlock(&self, call_host_block: CallHostBlock)
block2 only.Setter for callHostBlock.
This is copied when set.
§Safety
call_host_block must be a valid pointer or null.