-
Notifications
You must be signed in to change notification settings - Fork 564
Expand file tree
/
Copy pathMidiBluetoothDriver.cs
More file actions
40 lines (33 loc) · 1.4 KB
/
MidiBluetoothDriver.cs
File metadata and controls
40 lines (33 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// MidiBluetoothDriver.cs
//
// Authors: TJ Lambert (TJ.Lambert@microsoft.com)
//
// Copyright 2022 Microsoft Corp.
//
#nullable enable
using CoreFoundation;
namespace CoreMidi {
/// <summary>Provides access to the MIDI Bluetooth driver for managing Bluetooth MIDI connections.</summary>
[SupportedOSPlatform ("ios16.0")]
[SupportedOSPlatform ("maccatalyst16.0")]
[SupportedOSPlatform ("tvos16.0")]
[SupportedOSPlatform ("macos13.0")]
public partial class MidiBluetoothDriver {
[DllImport (Constants.CoreMidiLibrary)]
static extern int MIDIBluetoothDriverActivateAllConnections ();
/// <summary>Activates all Bluetooth MIDI connections.</summary>
/// <returns>A status code indicating the result of the operation (0 for success).</returns>
public static int ActivateAllConnections () => MIDIBluetoothDriverActivateAllConnections ();
[DllImport (Constants.CoreMidiLibrary)]
static extern unsafe int MIDIBluetoothDriverDisconnect (/* CFStringRef* */ NativeHandle uuid);
/// <summary>Disconnects a Bluetooth MIDI device identified by its UUID.</summary>
/// <param name="uuid">The UUID of the Bluetooth MIDI device to disconnect.</param>
/// <returns>A status code indicating the result of the operation (0 for success).</returns>
public static int Disconnect (NSString uuid)
{
int result = MIDIBluetoothDriverDisconnect (uuid.GetHandle ());
GC.KeepAlive (uuid);
return result;
}
}
}