MIDIInputPortCreateWithBlock(_:_:_:_:)
Creates an input port through which the client may receive incoming MIDI messages from any MIDI source.
Declaration
func MIDIInputPortCreateWithBlock(_ client: MIDIClientRef, _ portName: CFString, _ outPort: UnsafeMutablePointer<MIDIPortRef>, _ readBlock: @escaping MIDIReadBlock) -> OSStatusParameters
- client:
The client to own the newly-created port.
- portName:
The name of the port.
- outPort:
On successful return, points to the newly-created MIDIPort.
- readBlock:
The MIDIReadBlock which will be called with incoming MIDI, from sources connected to this port.
Return Value
An OSStatus result code.
Discussion
After creating a port, use MIDIPortConnectSource to establish an input connection from any number of sources to your port.
readBlock will be called on a separate high-priority thread owned by CoreMIDI.