Contents

MIDIEndpointSetRefCons(_:_:_:)

Sets contextual data on an endpoint.

Declaration

func MIDIEndpointSetRefCons(_ endpt: MIDIEndpointRef, _ ref1: UnsafeMutableRawPointer?, _ ref2: UnsafeMutableRawPointer?) -> OSStatus

Parameters

  • endpt:

    The endpoint to set the data on.

  • ref1:

    The first refCon.

  • ref2:

    The second refCon.

Return Value

An OSStatus result code.

Discussion

Drivers need an efficient way to translate from a MIDIEndpointRef (source or destination) to their own internal data structures corresponding to that endpoint. This function provides a way for the driver to assign its own data to endpoints.

The data you set isn’t persistent and needs to be reintialized in each call to Start.

A typical use is for one refCon to refer to a device, and a second to refer to a port on the device.

See Also

Endpoint management