MIDIDestinationCreateWithProtocol(_:_:_:_:_:)
Creates a virtual destination in a client.
Declaration
func MIDIDestinationCreateWithProtocol(_ client: MIDIClientRef, _ name: CFString, _ protocol: MIDIProtocolID, _ outDest: UnsafeMutablePointer<MIDIEndpointRef>, _ readBlock: @escaping MIDIReceiveBlock) -> OSStatusParameters
- client:
The client that owns the virtual destination.
- name:
The name of the virtual destination.
- protocol:
The MIDI protocol variant to deliver to the destination. The system automatically converts messages to this protocol as needed.
- outDest:
On successful return, a pointer to the newly created destination.
- readBlock:
A callback block the system invokes when a client sends MIDI data to the virtual destination.
Return Value
An OSStatus result code.
Discussion
Drivers don’t need to call this function. When they create devices and entities, the system automatically creates sources and destinations at that time. See kMIDIPropertyAdvanceScheduleTimeMuSec for information about the relationship between when a sender sends MIDI data to the destination and when it’s received.
The system calls the read block on a separate high-priority thread owned by Core MIDI.