I would like to send a MIDISysex using the CoreMIDI API. I do not know how to fill out the last two data types in the struct, prompting errors in Xcode.
The struct:
Both the completionProc and the completionRefCon have to be initialized to something. Does anybody know what?
As an example,
brings the error: Non-nominal type 'MIDICompletionProc' does not support explicit initialization.
EDIT: the MIDICompletionProc can be filled by defining a function, e.g.
Which leaves how to initialize the completionRefCon.
The struct:
Code Block struct MIDISysexSendRequest{ MIDIEndpointRef destination; const Byte * data; UInt32 bytesToSend; Boolean complete; Byte reserved[3]; MIDICompletionProc completionProc; void * completionRefCon;};
Both the completionProc and the completionRefCon have to be initialized to something. Does anybody know what?
As an example,
Code Block var completionProc = MIDICompletionProc()
brings the error: Non-nominal type 'MIDICompletionProc' does not support explicit initialization.
EDIT: the MIDICompletionProc can be filled by defining a function, e.g.
Code Block func MIDICompletionProc(request: UnsafeMutablePointer<MIDISysexSendRequest>) -> Void { }
Which leaves how to initialize the completionRefCon.