Contents

MIDISourceCreateWithProtocol(_:_:_:_:)

Creates a virtual source in a client.

Declaration

func MIDISourceCreateWithProtocol(_ client: MIDIClientRef, _ name: CFString, _ protocol: MIDIProtocolID, _ outSrc: UnsafeMutablePointer<MIDIEndpointRef>) -> OSStatus

Parameters

  • client:

    The client to own the virtual source.

  • name:

    The name of the virtual source.

  • protocol:

    The MIDI protocol variant to send from this source. The system automatically converts messages from this protocol to the protocol of the destination.

  • outSrc:

    On successful return, a pointer to the newly created source.

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. After creating a virtual source, use MIDIReceivedEventList(_:_:) to transmit MIDI messages from your virtual source to any clients connected to the virtual source.

See Also

Endpoint management