AUMessageChannel

Trait AUMessageChannel 

Source
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 { ... }
}
Available on crate feature 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§

Source

unsafe fn callAudioUnit(&self, message: &NSDictionary) -> Retained<NSDictionary>
where Self: Sized + Message,

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

Source

unsafe fn callHostBlock(&self) -> CallHostBlock
where Self: Sized + Message,

Available on crate feature block2 only.

A callback for the AU to send a message to the host.

The host has to set a block on this property.

Source

unsafe fn setCallHostBlock(&self, call_host_block: CallHostBlock)
where Self: Sized + Message,

Available on crate feature block2 only.

Setter for callHostBlock.

Trait Implementations§

Source§

impl ProtocolType for dyn AUMessageChannel

Source§

const NAME: &'static str = "AUMessageChannel"

The name of the Objective-C protocol that this type represents. Read more
Source§

fn protocol() -> Option<&'static AnyProtocol>

Get a reference to the Objective-C protocol object that this type represents. Read more
Source§

impl<T> ImplementedBy<T> for dyn AUMessageChannel

Implementations on Foreign Types§

Source§

impl<T> AUMessageChannel for ProtocolObject<T>
where T: ?Sized + AUMessageChannel,

Implementors§