Contents

MIDIGetDevice(_:)

Returns a device from the system.

Declaration

func MIDIGetDevice(_ deviceIndex0: Int) -> MIDIDeviceRef

Parameters

  • deviceIndex0:

    The index of the device to retrieve.

Return Value

A reference to a device, or NULL if an error occurred.

Discussion

Call this function to enumerate the devices in the system. To enumerate the entities in the system, walk through the devices and then walk through the device’s entities. When you iterate through the devices and entities in the system, you don’t visit virtual sources and destinations created by other clients.

A device iteration returns devices that are offline (they were present in the past but aren’t currently available), while iterations through the system’s sources and destinations don’t include the endpoints of offline devices. Instead, clients typically use MIDIGetNumberOfSources(), MIDIGetSource(_:), MIDIGetNumberOfDestinations() and MIDIGetDestination(_:).

See Also

Device lookup