From 1ba07177dfe57913a28d1dc2031e638dc39d34ee Mon Sep 17 00:00:00 2001 From: Jerker Dahlblom Date: Tue, 31 Aug 2021 20:11:10 +0300 Subject: [PATCH] #35 --- src/StreamDeckSharp/Hardware.cs | 9 +++++++++ .../Internals/HidDeviceExtensions.cs | 1 + .../Internals/StreamDeckMK2HardwareInfo.cs | 17 +++++++++++++++++ src/StreamDeckSharp/UsbConstants.cs | 1 + 4 files changed, 28 insertions(+) create mode 100644 src/StreamDeckSharp/Internals/StreamDeckMK2HardwareInfo.cs diff --git a/src/StreamDeckSharp/Hardware.cs b/src/StreamDeckSharp/Hardware.cs index 96dce43..c22a62d 100644 --- a/src/StreamDeckSharp/Hardware.cs +++ b/src/StreamDeckSharp/Hardware.cs @@ -13,6 +13,12 @@ public static class Hardware public static IUsbHidHardware StreamDeck => Internal_StreamDeck; + /// + /// Details about the updated Stream Deck MK.2 + /// + public static IUsbHidHardware StreamDeckMK2 + => Internal_StreamDeckMK2; + /// /// Details about the classic Stream Deck Rev 2 /// @@ -37,6 +43,9 @@ public static IUsbHidHardware StreamDeckMini internal static IHardwareInternalInfos Internal_StreamDeckRev2 { get; } = new StreamDeckRev2HardwareInfo(); + internal static IHardwareInternalInfos Internal_StreamDeckMK2 { get; } + = new StreamDeckMK2HardwareInfo(); + internal static IHardwareInternalInfos Internal_StreamDeckXL { get; } = new StreamDeckXlHardwareInfo(); diff --git a/src/StreamDeckSharp/Internals/HidDeviceExtensions.cs b/src/StreamDeckSharp/Internals/HidDeviceExtensions.cs index 84aa41c..6560393 100644 --- a/src/StreamDeckSharp/Internals/HidDeviceExtensions.cs +++ b/src/StreamDeckSharp/Internals/HidDeviceExtensions.cs @@ -19,6 +19,7 @@ public static IHardwareInternalInfos GetDeviceDetails(int vendorId, int productI { case ProductIds.StreamDeck: return Hardware.Internal_StreamDeck; case ProductIds.StreamDeckRev2: return Hardware.Internal_StreamDeckRev2; + case ProductIds.StreamDeckMK2: return Hardware.Internal_StreamDeckMK2; case ProductIds.StreamDeckXL: return Hardware.Internal_StreamDeckXL; case ProductIds.StreamDeckMini: return Hardware.Internal_StreamDeckMini; } diff --git a/src/StreamDeckSharp/Internals/StreamDeckMK2HardwareInfo.cs b/src/StreamDeckSharp/Internals/StreamDeckMK2HardwareInfo.cs new file mode 100644 index 0000000..ed2616a --- /dev/null +++ b/src/StreamDeckSharp/Internals/StreamDeckMK2HardwareInfo.cs @@ -0,0 +1,17 @@ +using OpenMacroBoard.SDK; +using static StreamDeckSharp.UsbConstants; + +namespace StreamDeckSharp.Internals +{ + internal sealed class StreamDeckMK2HardwareInfo + : StreamDeckJpgHardwareBase + { + public StreamDeckMK2HardwareInfo() + : base(new GridKeyPositionCollection(5, 3, 72, 32)) + { + } + + public override string DeviceName => "Stream Deck MK.2"; + public override int UsbProductId => ProductIds.StreamDeckMK2; + } +} diff --git a/src/StreamDeckSharp/UsbConstants.cs b/src/StreamDeckSharp/UsbConstants.cs index a690a6b..9c3cfa8 100644 --- a/src/StreamDeckSharp/UsbConstants.cs +++ b/src/StreamDeckSharp/UsbConstants.cs @@ -11,6 +11,7 @@ internal static class ProductIds { public const int StreamDeck = 0x0060; public const int StreamDeckRev2 = 0x006d; + public const int StreamDeckMK2 = 0x0080; public const int StreamDeckXL = 0x006c; public const int StreamDeckMini = 0x0063; }