Suppose a Mac API has the following struct, referenced here: Apple Developer Documentation (with code from here ):
const Byte * data;
void * completionRefCon;
How to import it into Xojo? The intention is to be able to create one so I can send it with the MIDISendSysex CoreMIDI API command.
The Xojo tutorial mainly talks about importing Functions, not structures.
You’ll have to manually recreate the structure in Xojo (Insert->Structure). Something like this:
MIDIEndpointRef As Ptr
Data As Ptr
BytesToSend As UInt32
Complete As Boolean
Reserved As String*3
MIDICompletionProc As Ptr
CompletionRefCon As Ptr
Thank you, barring other solutions I will use that.
Is there a way to embed Swift or Objective-C code into Xojo? The call I would like to execute requires a lot of CoreMIDI variables and functions.
What about the following structs:
My current implementations (which do not work):
timestamp As Integer
length As Uint16
data As String*256
numPackets As UInt32
packet(1) As MidiPacket
A problem I can think of is structs do not support MemoryBlocks (what I would guess equals the ‘Byte’ data type).
So my solution was to assign my binary data to memory block (mb.byte(0) = &hf0 etc), then assign the data string to that memoryblock.
EDIT: Nevermind it works! I forgot to set the packet.length property.