Skip to content

[CoreMidi] Add missing CoreMIDI bindings and MidiEventList support.#24738

Draft
rolfbjarne wants to merge 4 commits into
mainfrom
dev/rolf/coremidi-copilot
Draft

[CoreMidi] Add missing CoreMIDI bindings and MidiEventList support.#24738
rolfbjarne wants to merge 4 commits into
mainfrom
dev/rolf/coremidi-copilot

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

Bind the following missing CoreMIDI APIs:

  • MIDIDeviceCreate/MIDIDeviceDispose
  • MIDIExternalDeviceCreate
  • MIDISetupAddDevice/MIDISetupRemoveDevice
  • MIDISetupAddExternalDevice/MIDISetupRemoveExternalDevice
  • MIDIEntityAddOrRemoveEndpoints
  • MIDIDeviceRemoveEntity
  • MIDIEndPointGetRefCons/MIDIEndPointSetRefCons
  • MIDIDriverEnableMonitoring
  • MIDIGetDriverDeviceList/MIDIGetDriverIORunLoop
  • MIDISendSysex/MIDISendUMPSysex
  • MIDIDestinationCreateWithProtocol
  • MIDISourceCreateWithProtocol
  • MIDIInputPortCreateWithProtocol
  • MIDIClientCreateWithBlock
  • MIDIEventPacketSysexBytesForGroup
  • MIDI 2.0 structs (MIDI2DeviceManufacturer, MIDI2DeviceRevisionLevel,
    MIDICIProfileID, MIDISysexSendRequest, MIDISysexSendRequestUMP)
  • MidiDriver abstract class for implementing custom MIDI drivers

Add MidiEventList and MidiEventPacket classes for MIDI 2.0 Universal MIDI
Packet (UMP) support (MIDIEventList/MIDIEventPacket structs).

Add comprehensive tests including a Happy Birthday melody test.

There's a sample project in progress here: dotnet/macios-samples#10.

Fixes #4452
Fixes #12489

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds comprehensive CoreMIDI bindings for missing APIs and implements MIDI 2.0 Universal MIDI Packet (UMP) support, addressing issues #4452 and #12489. The changes enable developers to work with MIDI devices at a lower level, including custom driver implementation, and provide full support for the modern MIDI 2.0 protocol.

Changes:

  • Added MidiEventList and MidiEventPacket classes for MIDI 2.0 UMP support, enabling Universal MIDI Packet handling
  • Implemented missing CoreMIDI device/entity management APIs (Create, Dispose, AddOrRemoveEndpoints, etc.) and sysex sending functionality
  • Introduced experimental MidiDriver abstract class for implementing custom MIDI drivers with full lifecycle management

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
tests/xtro-sharpie/api-annotations-dotnet/*.ignore Removed API ignore entries for newly bound CoreMIDI APIs across all platforms
tests/cecil-tests/Documentation.cs Added FunctionPointerType handling to return empty doc IDs for unmanaged function pointers
tests/cecil-tests/Documentation.KnownFailures.txt Removed known failures for newly documented CoreMIDI types and fixed function pointer doc IDs
tests/monotouch-test/CoreMidi/MidiEventPacketTest.cs Comprehensive unit tests for MidiEventPacket struct including bounds checking and data manipulation
tests/monotouch-test/CoreMidi/MidiEventListTest.cs Unit tests for MidiEventList covering construction, adding packets, iteration, and edge cases
tests/monotouch-test/CoreMidi/MidiEndpointTest.cs Added tests for GetRefCons/SetRefCons endpoint reference management APIs
tests/monotouch-test/CoreMidi/MidiDeviceTest.cs Tests for external device creation and MidiSetup add/remove operations
tests/monotouch-test/CoreMidi/MidiComprehensiveTest.cs Extensive integration tests including a complete "Happy Birthday" melody demonstration
src/frameworks.sources Registered new CoreMidi and CoreFoundation source files in the build system
src/coremidi.cs Added MidiDriverProperty enum for driver-specific properties
src/CoreMidi/MidiThruConnectionParams.cs Moved enum definitions outside TVOS conditional to fix tvOS build issues
src/CoreMidi/MidiStructs.cs Implemented MIDI 2.0 structs (Midi2DeviceManufacturer, Midi2DeviceRevisionLevel, MidiCIProfileId variants, MidiSysexSendRequest)
src/CoreMidi/MidiServices.cs Added device/entity creation, external device support, sysex async sending, and protocol-aware port/endpoint creation methods
src/CoreMidi/MidiEventPacket.cs Implemented MidiEventPacket struct with 64-word capacity, indexer, and GetSysexBytes method
src/CoreMidi/MidiEventList.cs Implemented MidiEventList as IDisposable wrapper with Add, Send, Receive, and iteration support
src/CoreMidi/MidiDriverInterface.cs Created experimental MidiDriver abstract class with COM-style interface for custom driver implementation
src/CoreMidi/MidiBluetoothDriver.cs Removed TVOS conditional and added XML documentation for Bluetooth driver methods
src/CoreFoundation/CFUuidBytes.cs Added CFUuidBytes struct for CoreMIDI driver interface QueryInterface method
docs/preview-apis.md Documented MidiDriver as experimental (APL0004) until .NET 12

Comment on lines +35 to +54
public void CtorTest_Size ()
{
Exception ex;

Assert.Multiple (() => {
ex = Assert.Throws<ArgumentOutOfRangeException> (() => new MidiEventList (MidiProtocolId.Protocol_1_0, int.MinValue), "AOORE int.MinValue");
Assert.That (ex.Message, Does.Contain ("size must be at least 276."), "AOORE msg int.MinValue");
ex = Assert.Throws<ArgumentOutOfRangeException> (() => new MidiEventList (MidiProtocolId.Protocol_1_0, -1), "AOORE -1");
Assert.That (ex.Message, Does.Contain ("size must be at least 276."), "AOORE msg -1");
ex = Assert.Throws<ArgumentOutOfRangeException> (() => new MidiEventList (MidiProtocolId.Protocol_1_0, 0), "AOORE 0");
Assert.That (ex.Message, Does.Contain ("size must be at least 276."), "AOORE msg 0");
ex = Assert.Throws<ArgumentOutOfRangeException> (() => new MidiEventList (MidiProtocolId.Protocol_1_0, 275), "AOORE 275");
Assert.That (ex.Message, Does.Contain ("size must be at least 276."), "AOORE msg 275");

var obj = new MidiEventList (MidiProtocolId.Protocol_1_0, 276);
Assert.That (obj.Protocol, Is.EqualTo (MidiProtocolId.Protocol_1_0), "Protocol");
Assert.That (obj.PacketCount, Is.EqualTo (0), "PacketCount");
var packets = obj.ToArray ();
Assert.That (packets.Length, Is.EqualTo (0), "ToArray ().Length");
});

Copilot AI Feb 18, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The MidiEventList instances created in these tests are not being disposed. Since MidiEventList allocates unmanaged memory when owns=true, these should be wrapped in using statements to ensure proper cleanup. For example: using var obj = new MidiEventList (MidiProtocolId.Protocol_1_0, 276);

Copilot uses AI. Check for mistakes.
Comment on lines +58 to +76
public void AddTest ()
{
Assert.Multiple (() => {
var obj = new MidiEventList (MidiProtocolId.Protocol_2_0);
Assert.That (obj.Protocol, Is.EqualTo (MidiProtocolId.Protocol_2_0), "Protocol");
Assert.That (obj.PacketCount, Is.EqualTo (0), "PacketCount");

var rv = obj.Add (123, new uint [] { 1, 2, 3 });
Assert.That (rv, Is.EqualTo (true), "Add B");
Assert.That (obj.Protocol, Is.EqualTo (MidiProtocolId.Protocol_2_0), "Protocol B");
Assert.That (obj.PacketCount, Is.EqualTo (1), "PacketCount B");

var packets = obj.ToArray ();
Assert.That (packets.Length, Is.EqualTo (1), "ToArray ().Length");
Assert.That (packets [0].Timestamp, Is.EqualTo (123), "Item[0].Timestamp");
Assert.That (packets [0].WordCount, Is.EqualTo (3), "Item[0].WordCount");
Assert.That (packets [0].Words, Is.EqualTo (new uint [] { 1, 2, 3 }), "Item[0].Words");
});
}

Copilot AI Feb 18, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The MidiEventList instance created in this test is not being disposed. Since MidiEventList allocates unmanaged memory when owns=true, this should be wrapped in a using statement to ensure proper cleanup. For example: using var obj = new MidiEventList (MidiProtocolId.Protocol_2_0);

Copilot uses AI. Check for mistakes.
Comment on lines +78 to +90
[Test]
public void AddTest_ManyWords ()
{
Assert.Multiple (() => {
var obj = new MidiEventList (MidiProtocolId.Protocol_2_0);
Assert.That (obj.Protocol, Is.EqualTo (MidiProtocolId.Protocol_2_0), "Protocol");
Assert.That (obj.PacketCount, Is.EqualTo (0), "PacketCount");

var manyWords = Enumerable.Range (1, 65).Select (v => (uint) v).ToArray ();
var rv = obj.Add (123, manyWords);
Assert.That (rv, Is.EqualTo (false), "Add B");
});
}

Copilot AI Feb 18, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The MidiEventList instance created in this test is not being disposed. Since MidiEventList allocates unmanaged memory when owns=true, this should be wrapped in a using statement to ensure proper cleanup.

Copilot uses AI. Check for mistakes.
Comment on lines +92 to +108
[Test]
public void AddTest_NotEnoughSpace ()
{
Assert.Multiple (() => {
var obj = new MidiEventList (MidiProtocolId.Protocol_2_0);
Assert.That (obj.Protocol, Is.EqualTo (MidiProtocolId.Protocol_2_0), "Protocol");
Assert.That (obj.PacketCount, Is.EqualTo (0), "PacketCount");

var fitsTwice = Enumerable.Range (1, 24).Select (v => (uint) v).ToArray ();
var rv = obj.Add (123, fitsTwice);
Assert.That (rv, Is.EqualTo (true), "Add B");
rv = obj.Add (456, fitsTwice);
Assert.That (rv, Is.EqualTo (true), "Add C");
rv = obj.Add (789, fitsTwice);
Assert.That (rv, Is.EqualTo (false), "Add C");
});
}

Copilot AI Feb 18, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The MidiEventList instance created in this test is not being disposed. Since MidiEventList allocates unmanaged memory when owns=true, this should be wrapped in a using statement to ensure proper cleanup.

Copilot uses AI. Check for mistakes.
Comment on lines +110 to +126
[Test]
public void EnumeratorTest ()
{
Assert.Multiple (() => {
var obj = new MidiEventList (MidiProtocolId.Protocol_2_0);
var rv = obj.Add (789, new uint [] { 4, 5, 6 });
Assert.That (rv, Is.EqualTo (true), "Add B");
Assert.That (obj.Protocol, Is.EqualTo (MidiProtocolId.Protocol_2_0), "Protocol B");
Assert.That (obj.PacketCount, Is.EqualTo (1), "PacketCount B");

var packets = obj.ToArray ();
Assert.That (packets.Length, Is.EqualTo (1), "ToArray ().Length");
Assert.That (packets [0].Timestamp, Is.EqualTo (789), "Item[0].Timestamp");
Assert.That (packets [0].WordCount, Is.EqualTo (3), "Item[0].WordCount");
Assert.That (packets [0].Words, Is.EqualTo (new uint [] { 4, 5, 6 }), "Item[0].Words");
});
}

Copilot AI Feb 18, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The MidiEventList instance created in this test is not being disposed. Since MidiEventList allocates unmanaged memory when owns=true, this should be wrapped in a using statement to ensure proper cleanup.

Copilot uses AI. Check for mistakes.
Comment on lines +128 to +153
[Test]
public void IteratorTest ()
{
Assert.Multiple (() => {
var obj = new MidiEventList (MidiProtocolId.Protocol_2_0);
var rv = obj.Add (456, new uint [] { 1, 2, 3, 4, 5, 6 });
Assert.That (rv, Is.EqualTo (true), "Add B");
Assert.That (obj.Protocol, Is.EqualTo (MidiProtocolId.Protocol_2_0), "Protocol B");
Assert.That (obj.PacketCount, Is.EqualTo (1), "PacketCount B");

var packets = obj.ToArray ();
Assert.That (packets.Length, Is.EqualTo (1), "ToArray ().Length");
Assert.That (packets [0].Timestamp, Is.EqualTo (456), "Item[0].Timestamp");
Assert.That (packets [0].WordCount, Is.EqualTo (6), "Item[0].WordCount");
Assert.That (packets [0].Words, Is.EqualTo (new uint [] { 1, 2, 3, 4, 5, 6 }), "Item[0].Words");

var packetList = new List<MidiEventPacket> ();
obj.Iterate ((ref MidiEventPacket packet) => {
packetList.Add (packet);
});
Assert.That (packetList.Count, Is.EqualTo (1), "packetList.Length");
Assert.That (packetList [0].Timestamp, Is.EqualTo (456), "packetList[0].Timestamp");
Assert.That (packetList [0].WordCount, Is.EqualTo (6), "packetList[0].WordCount");
Assert.That (packetList [0].Words, Is.EqualTo (new uint [] { 1, 2, 3, 4, 5, 6 }), "packetList[0].Words");
});
}

Copilot AI Feb 18, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The MidiEventList instance created in this test is not being disposed. Since MidiEventList allocates unmanaged memory when owns=true, this should be wrapped in a using statement to ensure proper cleanup.

Copilot uses AI. Check for mistakes.
}
#endif

/// <summary>Add a new <see cref="MidiEventPacket" /> to this lis.</summary>

Copilot AI Feb 18, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a typo in the XML documentation: "lis" should be "list".

Suggested change
/// <summary>Add a new <see cref="MidiEventPacket" /> to this lis.</summary>
/// <summary>Add a new <see cref="MidiEventPacket" /> to this list.</summary>

Copilot uses AI. Check for mistakes.
}

/// <summary>Distribute the packets from the specified <paramref name="source" />.</summary>
/// <param name="source">The endpoint where the packates come from.</param>

Copilot AI Feb 18, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a typo in the XML documentation: "packates" should be "packets".

Suggested change
/// <param name="source">The endpoint where the packates come from.</param>
/// <param name="source">The endpoint where the packets come from.</param>

Copilot uses AI. Check for mistakes.
return 0;
}

static List<MidiDriver> strongReferences = new List<MidiDriver> ();

Copilot AI Feb 18, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The static List<MidiDriver> field should be initialized as readonly to prevent accidental reassignment. Consider: static readonly List&lt;MidiDriver&gt; strongReferences = new List&lt;MidiDriver&gt; ();

Suggested change
static List<MidiDriver> strongReferences = new List<MidiDriver> ();
static readonly List<MidiDriver> strongReferences = new List<MidiDriver> ();

Copilot uses AI. Check for mistakes.
Comment on lines +23 to +31
public void CtorTest ()
{
Assert.Multiple (() => {
var obj = new MidiEventList (MidiProtocolId.Protocol_1_0);
Assert.That (obj.Protocol, Is.EqualTo (MidiProtocolId.Protocol_1_0), "Protocol");
Assert.That (obj.PacketCount, Is.EqualTo (0), "PacketCount");
var packets = obj.ToArray ();
Assert.That (packets.Length, Is.EqualTo (0), "ToArray ().Length");
});

Copilot AI Feb 18, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The MidiEventList instances created in these tests are not being disposed. Since MidiEventList allocates unmanaged memory when owns=true, these should be wrapped in using statements to ensure proper cleanup. For example: using var obj = new MidiEventList (MidiProtocolId.Protocol_1_0);

Copilot uses AI. Check for mistakes.
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

rolfbjarne and others added 3 commits June 25, 2026 08:28
Bind the following missing CoreMIDI APIs:
- MIDIDeviceCreate/MIDIDeviceDispose
- MIDIExternalDeviceCreate
- MIDISetupAddDevice/MIDISetupRemoveDevice
- MIDISetupAddExternalDevice/MIDISetupRemoveExternalDevice
- MIDIEntityAddOrRemoveEndpoints
- MIDIDeviceRemoveEntity
- MIDIEndPointGetRefCons/MIDIEndPointSetRefCons
- MIDIDriverEnableMonitoring
- MIDIGetDriverDeviceList/MIDIGetDriverIORunLoop
- MIDISendSysex/MIDISendUMPSysex
- MIDIDestinationCreateWithProtocol
- MIDISourceCreateWithProtocol
- MIDIInputPortCreateWithProtocol
- MIDIClientCreateWithBlock
- MIDIEventPacketSysexBytesForGroup
- MIDI 2.0 structs (MIDI2DeviceManufacturer, MIDI2DeviceRevisionLevel,
  MIDICIProfileID, MIDISysexSendRequest, MIDISysexSendRequestUMP)
- MidiDriver abstract class for implementing custom MIDI drivers

Add MidiEventList and MidiEventPacket classes for MIDI 2.0 Universal MIDI
Packet (UMP) support (MIDIEventList/MIDIEventPacket structs).

Add comprehensive tests including a Happy Birthday melody test.

There's a sample project in progress here: dotnet/macios-samples#10.

Fixes #4452
Fixes #12489
…sage.

Add a binding for the native MIDIEventListForEachEvent function, which
parses each Universal MIDI Packet (UMP) in a MidiEventList and invokes a
callback with the parsed message.

This adds:
* A faithful managed MidiUniversalMessage struct (and its variant structs)
  mirroring the native MIDIUniversalMessage union.
* A MidiEventList.ForEachEvent method + MidiUniversalMessageVisitor delegate.
* Thorough tests, including parsing a MIDI 1.0 note on, a MIDI 2.0 note on,
  and the Happy Birthday melody.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Explicit struct layout (with overlapping union fields) makes a struct
non-blittable, which forces the runtime to generate marshaling code and
prevents passing the struct by value through a 'delegate* unmanaged'
function pointer without overhead.

Rewrite MidiUniversalMessage and its variant structs to use sequential
blittable layout with opaque storage fields, exposing the native unions
through unsafe accessor properties that reinterpret the storage. Also
replace fixed buffers / array fields with named byte fields.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@rolfbjarne rolfbjarne force-pushed the dev/rolf/coremidi-copilot branch from 9db33b7 to 01b1410 Compare June 25, 2026 06:59
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@rolfbjarne rolfbjarne left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Code Review — CoreMIDI bindings

Verdict: ⚠️ Needs Changes (minor) — No bugs, breaking changes, or memory-safety issues found. The COM-style driver ref-counting, blittable union emulation (MidiUniversalMessage/MidiEventPacket avoid explicit layout/arrays to stay blittable for delegate* unmanaged), and the sysex async lifetime management (disposing the CancellationTokenRegistration before freeing native memory) are all sound. A few correctness/polish items inline.

Positive callouts

  • No API-breaking changes; removals handled via [ObsoletedOSPlatform] with actionable "Call 'X' instead." messages.
  • MidiDriver COM ref-counting (AddRef/Release under lock, weak GCHandle, finalizer releasing the managed ref) is coherent; experimental surface gated behind APL0004 and documented in docs/preview-apis.md.
  • .ignore entries for the now-bound MIDIEventListForEachEvent/Init/Add and the tvOS enums are correctly removed.
  • Thorough XML docs replacing "To be added." stubs; Happy Birthday test present. 🎂

Severity counts: 0 ❌ · 1 ⚠️ · 4 💡

Reviewed against origin/main (HEAD 01b1410). CI status not evaluated in this review.

Comment thread src/CoreMidi/MidiEventPacket.cs Outdated
get => wordCount;
set {
if (value > 64)
throw new ArgumentOutOfRangeException ($"WordCount can't be higher than 64.");

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 ⚠️ Error handlingnew ArgumentOutOfRangeException ($"WordCount can't be higher than 64.") uses the single-string constructor, which treats the string as paramName, not the message. The thrown text becomes "Specified argument was out of the range of valid values. (Parameter 'WordCount can't be higher than 64.')" — misleading. Use the two-arg form, e.g. throw new ArgumentOutOfRangeException (nameof (value), "WordCount can't be higher than 64.") (or nameof (index)).

This pattern repeats throughout this file (lines 104, 115, 131, 149, 151, 153, 161, 163, 165) and in src/CoreMidi/MidiEventList.cs:86.

Rule: Error handling — use correct exception constructor

@@ -0,0 +1,23 @@
namespace CoreFoundation {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 💡 Patterns — This new file is missing the repo's MIT license header and #nullable enable. New files should start with:

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

Rule: New-file conventions

Comment thread src/CoreMidi/MidiServices.cs Outdated
/// <param name="protocol">The MIDI protocol for the data this port will receive.</param>
/// <param name="readBlock">The callback that will be called when the port receives MIDI data.</param>
/// <param name="status">A status code that describes the result of this operation. This will be <see cref="MidiError.Ok" /> in case of success.</param>
/// <returns>A newly created <see cref="MidiEndpoint" /> if successful, otherwise null.</returns>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 💡 DocumentationCreateInputPort returns MidiPort?, but this <returns> says "A newly created MidiEndpoint…". Likely copy-pasted from the virtual-source/destination overloads. The local var handle = default (MidiEndpointRef); in the method body is also semantically a MidiPortRef (both alias int, so it compiles). Fix the doc and the alias for clarity.

Rule: Documentation accuracy

Comment thread src/CoreMidi/MidiStructs.cs Outdated


/*!
@struct MIDISysexSendRequestUMP

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 💡 Code organization — This raw Objective-C header block (@struct MIDISysexSendRequestUMP …) duplicates the XML docs added just below for MidiSysexSendRequestUmp. Consider removing the leftover native comment to reduce noise.

Rule: Avoid redundant comments

// These APIs returns -50 (GeneralParamError) no matter what I do :/

Assert.AreEqual (AudioQueueStatus.GeneralParamError, (AudioQueueStatus) ep.GetRefCons (out var ref1, out var ref2), "GetRefCons A");
Assert.AreEqual (ref1, IntPtr.Zero, "GetRefCons A 1");

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 💡 TestingAssert.AreEqual (ref1, IntPtr.Zero, …) has actual/expected swapped (NUnit's signature is (expected, actual)), so failure messages will read backwards. Prefer the constraint form: Assert.That (ref1, Is.EqualTo (IntPtr.Zero), …). Same applies to the sibling assertions in this block.

Rule: Assertion style for good failure messages

* Fix ArgumentOutOfRangeException constructor misuse (string was passed
  as paramName instead of message) in MidiEventPacket and MidiEventList.
* Add MIT license header and #nullable enable to CFUuidBytes.cs.
* Fix CreateInputPort <returns> doc and local alias (MidiPort, not
  MidiEndpoint).
* Remove redundant native @struct comment block in MidiStructs.cs.
* Use Assert.That/Is.EqualTo with correct argument order in
  MidiEndpointTest.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #a8f368c] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: a8f368c4af4d8f06d0a7612b95d861cb269c4504 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #a8f368c] Build passed (Build packages) ✅

Pipeline on Agent
Hash: a8f368c4af4d8f06d0a7612b95d861cb269c4504 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: a8f368c4af4d8f06d0a7612b95d861cb269c4504 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #a8f368c] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: a8f368c4af4d8f06d0a7612b95d861cb269c4504 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🔥 [CI Build #a8f368c] Test results 🔥

Test results

❌ Tests failed on VSTS: test results

0 tests crashed, 8 tests failed, 199 tests passed.

Failures

❌ introspection tests

2 tests failed, 2 tests passed.

Failed tests

  • introspection/iOS - simulator/Debug: LaunchTimedOut
  • introspection/tvOS - simulator/Debug: LaunchTimedOut

Html Report (VSDrops) Download

❌ monotouch tests (MacCatalyst)

4 tests failed, 15 tests passed.

Failed tests

  • monotouch-test/Mac Catalyst/Release (NativeAOT, x64): Failed (Test run failed.
    Tests run: 3854 Passed: 3658 Inconclusive: 11 Failed: 20 Ignored: 176)
  • monotouch-test/Mac Catalyst/Release (trimmable static registrar, NativeAOT): Failed (Test run failed.
    Tests run: 3854 Passed: 3661 Inconclusive: 11 Failed: 20 Ignored: 173)
  • monotouch-test/Mac Catalyst/Release (trimmable static registrar, NativeAOT, x64): Failed (Test run failed.
    Tests run: 3854 Passed: 3658 Inconclusive: 11 Failed: 20 Ignored: 176)
  • monotouch-test/Mac Catalyst/Debug (interpreter): Failed (Test run failed.
    Tests run: 3857 Passed: 3676 Inconclusive: 11 Failed: 20 Ignored: 161)

Html Report (VSDrops) Download

❌ monotouch tests (macOS)

2 tests failed, 18 tests passed.

Failed tests

  • monotouch-test/macOS/Debug (managed static registrar): Failed (Test run failed.
    Tests run: 3804 Passed: 3698 Inconclusive: 4 Failed: 1 Ignored: 105)
  • monotouch-test/macOS/Debug (trimmable static registrar): Failed (Test run failed.
    Tests run: 3804 Passed: 3698 Inconclusive: 4 Failed: 1 Ignored: 105)

Html Report (VSDrops) Download

Successes

✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ linker (iOS): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (tvOS): All 15 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 20 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 20 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

macOS tests

✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Ventura (13): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. Html Report (VSDrops) Download

Linux Build Verification

Linux build succeeded

Pipeline on Agent
Hash: a8f368c4af4d8f06d0a7612b95d861cb269c4504 [PR build]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[AudioToolbox] Some AudioToolbox APIs not yet implemented in Xcode13 Old CoreMIDI APIs are missing

3 participants