Skip to content

Commit

Permalink
Merge pull request #36 from jdahlblom/master
Browse files Browse the repository at this point in the history
#35 Stream Deck MK.2 support added.
  • Loading branch information
wischi-chr committed Sep 16, 2021
2 parents 6413196 + 1ba0717 commit 6c02acc
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/StreamDeckSharp/Hardware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ public static class Hardware
public static IUsbHidHardware StreamDeck
=> Internal_StreamDeck;

/// <summary>
/// Details about the updated Stream Deck MK.2
/// </summary>
public static IUsbHidHardware StreamDeckMK2
=> Internal_StreamDeckMK2;

/// <summary>
/// Details about the classic Stream Deck Rev 2
/// </summary>
Expand All @@ -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();

Expand Down
1 change: 1 addition & 0 deletions src/StreamDeckSharp/Internals/HidDeviceExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
17 changes: 17 additions & 0 deletions src/StreamDeckSharp/Internals/StreamDeckMK2HardwareInfo.cs
Original file line number Diff line number Diff line change
@@ -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;
}
}
1 change: 1 addition & 0 deletions src/StreamDeckSharp/UsbConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 6c02acc

Please sign in to comment.