MIDIInputPortCreateWithBlock

Function MIDIInputPortCreateWithBlock 

Source
pub unsafe extern "C-unwind" fn MIDIInputPortCreateWithBlock(
    client: MIDIClientRef,
    port_name: &CFString,
    out_port: NonNull<MIDIPortRef>,
    read_block: MIDIReadBlock,
) -> i32
๐Ÿ‘ŽDeprecated
Available on crate features MIDIServices and block2 and objc2-core-foundation only.
Expand description

Creates an input port through which the client may receive incoming MIDI messages from any MIDI source.

Parameter client: The client to own the newly-created port.

Parameter portName: The name of the port.

Parameter outPort: On successful return, points to the newly-created MIDIPort.

Parameter readBlock: The MIDIReadBlock which will be called with incoming MIDI, from sources connected to this port.

Returns: An OSStatus result code.

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.

ยงSafety

  • out_port must be a valid pointer.
  • read_block must be a valid pointer.