Skip to content

Commit

Permalink
Use simpler constructor for MidiPacket on CoreMidi, as Xamarin CoreMi…
Browse files Browse the repository at this point in the history
…di as an issue with pointer initialized MidiPackets.
  • Loading branch information
jamesdlow committed Sep 9, 2023
1 parent fe38884 commit 24f7c16
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions Commons.Music.Midi.CoreMidiShared/CoreMidiAccess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,8 @@ public void Dispose()
MidiPacket[] arr = new MidiPacket[1];
public void Send (byte[] mevent, int offset, int length, long timestamp)
{
unsafe {
fixed (byte* ptr = mevent) {
arr [0] = new MidiPacket(timestamp, (ushort)length, (IntPtr)(ptr + offset));
port.Send (details.Endpoint, arr);
}
}
arr [0] = new MidiPacket(timestamp, mevent, offset, length);

Check failure on line 215 in Commons.Music.Midi.CoreMidiShared/CoreMidiAccess.cs

View workflow job for this annotation

GitHub Actions / Build

'MidiPacket' does not contain a constructor that takes 4 arguments

Check failure on line 215 in Commons.Music.Midi.CoreMidiShared/CoreMidiAccess.cs

View workflow job for this annotation

GitHub Actions / Build

'MidiPacket' does not contain a constructor that takes 4 arguments
port.Send (details.Endpoint, arr);
}
}
}

0 comments on commit 24f7c16

Please sign in to comment.