Skip to content

Commit c55fa64

Browse files
authored
Merge pull request #5 from dend/january-2025-update
December 2024 Update Batch 2
2 parents 6b6ce6c + dccb412 commit c55fa64

16 files changed

+289
-27
lines changed

src/DeckSurf.SDK.StartBoard/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ static void Main(string[] args)
1919

2020
foreach (var connectedDevice in devices)
2121
{
22-
Console.WriteLine(connectedDevice.Name);
22+
Console.WriteLine($"{connectedDevice.Name} ({connectedDevice.Serial})");
2323
}
2424

2525
var device = ((List<ConnectedDevice>)devices)[0];

src/DeckSurf.SDK/Core/DeviceManager.cs

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,54 @@ public static IEnumerable<ConnectedDevice> GetDeviceList()
3838
{
3939
case DeviceModel.XL:
4040
{
41-
connectedDevices.Add(new StreamDeckXL(device.VendorID, device.ProductID, device.DevicePath, device.GetFriendlyName()));
41+
connectedDevices.Add(new StreamDeckXL(device.VendorID, device.ProductID, device.DevicePath, device.GetFriendlyName(), device.GetSerialNumber()));
4242
break;
4343
}
4444

45-
case DeviceModel.PLUS:
45+
case DeviceModel.XL2022:
4646
{
47-
connectedDevices.Add(new StreamDeckPlus(device.VendorID, device.ProductID, device.DevicePath, device.GetFriendlyName()));
47+
connectedDevices.Add(new StreamDeckXL2022(device.VendorID, device.ProductID, device.DevicePath, device.GetFriendlyName(), device.GetSerialNumber()));
4848
break;
4949
}
5050

51-
case DeviceModel.MINI:
52-
case DeviceModel.ORIGINAL:
53-
case DeviceModel.ORIGINAL_V2:
51+
case DeviceModel.Plus:
52+
{
53+
connectedDevices.Add(new StreamDeckPlus(device.VendorID, device.ProductID, device.DevicePath, device.GetFriendlyName(), device.GetSerialNumber()));
54+
break;
55+
}
56+
57+
case DeviceModel.Mini:
58+
{
59+
connectedDevices.Add(new StreamDeckMini(device.VendorID, device.ProductID, device.DevicePath, device.GetFriendlyName(), device.GetSerialNumber()));
60+
break;
61+
}
62+
63+
case DeviceModel.Mini2022:
64+
{
65+
connectedDevices.Add(new StreamDeckMini2022(device.VendorID, device.ProductID, device.DevicePath, device.GetFriendlyName(), device.GetSerialNumber()));
66+
break;
67+
}
68+
69+
case DeviceModel.Original:
70+
{
71+
connectedDevices.Add(new StreamDeckOriginal(device.VendorID, device.ProductID, device.DevicePath, device.GetFriendlyName(), device.GetSerialNumber()));
72+
break;
73+
}
74+
75+
case DeviceModel.Original2019:
76+
{
77+
connectedDevices.Add(new StreamDeckOriginal2019(device.VendorID, device.ProductID, device.DevicePath, device.GetFriendlyName(), device.GetSerialNumber()));
78+
break;
79+
}
80+
81+
case DeviceModel.Neo:
82+
{
83+
connectedDevices.Add(new StreamDeckNeo(device.VendorID, device.ProductID, device.DevicePath, device.GetFriendlyName(), device.GetSerialNumber()
84+
));
85+
break;
86+
}
87+
88+
case DeviceModel.MK2Scissor:
5489
default:
5590
{
5691
// Haven't yet implemented support for other Stream Deck device classes.

src/DeckSurf.SDK/DeckSurf.SDK.csproj

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<Platforms>x64</Platforms>
66
<Company>Den Delimarsky</Company>
77
<Authors>Den Delimarsky</Authors>
8-
<Version>0.0.4</Version>
8+
<Version>0.0.5</Version>
99
<ApplicationIcon>piglet.ico</ApplicationIcon>
1010
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
1111
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
@@ -22,10 +22,11 @@
2222
<RepositoryUrl>https://github.com/dend/decksurf-sdk</RepositoryUrl>
2323
<PackageTags>streamdeck,sdk,decksurf,hid,buttons</PackageTags>
2424
<NeutralLanguage>en-US</NeutralLanguage>
25-
<AssemblyVersion>0.0.4.0</AssemblyVersion>
26-
<FileVersion>0.0.4.0</FileVersion>
25+
<AssemblyVersion>0.0.5.0</AssemblyVersion>
26+
<FileVersion>0.0.5.0</FileVersion>
2727
<Description>Open-source SDK to manage your Stream Deck device from .NET.</Description>
2828
<RepositoryType>git</RepositoryType>
29+
<PackageReadmeFile>README.md</PackageReadmeFile>
2930
</PropertyGroup>
3031

3132
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@@ -50,6 +51,10 @@
5051
<Pack>True</Pack>
5152
<PackagePath></PackagePath>
5253
</None>
54+
<None Include="..\..\README.md">
55+
<Pack>True</Pack>
56+
<PackagePath>\</PackagePath>
57+
</None>
5358
</ItemGroup>
5459

5560
<ItemGroup>

src/DeckSurf.SDK/Models/ConfigurationProfile.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ public ConfigurationProfile()
3232
[JsonPropertyName("device_model")]
3333
public DeviceModel DeviceModel { get; set; }
3434

35+
/// <summary>
36+
/// Gets or sets the device serial number associated with the configuration profile.
37+
/// </summary>
38+
[JsonPropertyName("device_serial")]
39+
public string DeviceSerial { get; set; }
40+
3541
/// <summary>
3642
/// Gets or sets the mapping between buttons and the commands they trigger.
3743
/// </summary>

src/DeckSurf.SDK/Models/ConnectedDevice.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,13 @@ public ConnectedDevice()
4040
/// <param name="pid">Product ID.</param>
4141
/// <param name="path">Path to the USB HID device.</param>
4242
/// <param name="name">Name of the USB HID device.</param>
43-
public ConnectedDevice(int vid, int pid, string path, string name)
43+
/// <param name="serial">Serial number for the device.</param>
44+
public ConnectedDevice(int vid, int pid, string path, string name, string serial)
4445
{
4546
this.VId = vid;
4647
this.Path = path;
4748
this.Name = name;
49+
this.Serial = serial;
4850
this.UnderlyingDevice = DeviceList.Local.GetHidDeviceOrNull(vid, pid);
4951
}
5052

@@ -75,6 +77,11 @@ public ConnectedDevice(int vid, int pid, string path, string name)
7577
/// </summary>
7678
public string Name { get; }
7779

80+
/// <summary>
81+
/// Gets the device serial number.
82+
/// </summary>
83+
public string Serial { get; }
84+
7885
/// <summary>
7986
/// Gets the Stream Deck device model.
8087
/// </summary>
@@ -139,6 +146,7 @@ public ConnectedDevice(int vid, int pid, string path, string name)
139146
/// </remarks>
140147
public abstract int ScreenSegmentWidth { get; }
141148

149+
142150
private HidDevice UnderlyingDevice { get; }
143151

144152
private HidStream UnderlyingInputStream { get; set; }

src/DeckSurf.SDK/Models/DeviceModel.cs

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,54 @@ public enum DeviceModel : byte
1212
/// <summary>
1313
/// The original model of the Stream Deck device.
1414
/// </summary>
15-
ORIGINAL = 0x0060,
15+
Original = 0x0060,
1616

1717
/// <summary>
1818
/// The <see href="https://www.elgato.com/en/stream-deck">updated original model</see> of the Stream Deck device.
1919
/// </summary>
20-
ORIGINAL_V2 = 0x006D,
20+
Original2019 = 0x006D,
21+
22+
/// <summary>
23+
/// The <see href="https://www.elgato.com/us/en/p/stream-deck-mk2-black">MK.2</see> of the Stream Deck device.
24+
/// </summary>
25+
MK2 = 0x0080,
26+
27+
/// <summary>
28+
/// The MK.2 Scissor of the Stream Deck device.
29+
/// </summary>
30+
/// <remarks>
31+
/// Need to document what the "Scissor" variant actually is.
32+
/// </remarks>
33+
MK2Scissor = 0x00A5,
2134

2235
/// <summary>
2336
/// The <see href="https://www.elgato.com/us/en/p/stream-deck-mini">Mini model</see> of the Stream Deck device.
2437
/// </summary>
25-
MINI = 0x0063,
38+
Mini = 0x0063,
39+
40+
/// <summary>
41+
/// The <see href="https://www.elgato.com/us/en/p/stream-deck-mini">Mini (2022) model</see> of the Stream Deck device.
42+
/// </summary>
43+
Mini2022 = 0x0090,
2644

2745
/// <summary>
2846
/// The <see href="https://www.elgato.com/us/en/p/stream-deck-xl">XL model</see> of the Stream Deck device.
2947
/// </summary>
3048
XL = 0x006C,
3149

3250
/// <summary>
33-
/// The <see href="https://www.elgato.com/us/en/p/stream-deck-plus-black">XL model</see> of the Stream Deck device.
51+
/// The <see href="https://www.elgato.com/us/en/p/stream-deck-xl">XL (2022) model</see> of the Stream Deck device.
52+
/// </summary>
53+
XL2022 = 0x008F,
54+
55+
/// <summary>
56+
/// The <see href="https://www.elgato.com/us/en/p/stream-deck-plus-black">Plus model</see> of the Stream Deck device.
57+
/// </summary>
58+
Plus = 0x0084,
59+
60+
/// <summary>
61+
/// The <see href="https://www.elgato.com/us/en/p/stream-deck-neo">Neo model</see> of the Stream Deck device.
3462
/// </summary>
35-
PLUS = 0x0084,
63+
Neo = 0x009A,
3664
}
3765
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// Copyright (c) Den Delimarsky
2+
// Den Delimarsky licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
namespace DeckSurf.SDK.Models.Devices
6+
{
7+
/// <summary>
8+
/// Implementation for a Stream Deck MK.2 connected device.
9+
/// </summary>
10+
public class StreamDeckMK2(int vid, int pid, string path, string name, string serial) : ConnectedDevice(vid, pid, path, name, serial)
11+
{
12+
/// <inheritdoc/>
13+
public override DeviceModel Model => DeviceModel.MK2;
14+
15+
/// <inheritdoc/>
16+
public override int ButtonCount => 6;
17+
18+
/// <inheritdoc/>
19+
public override bool IsButtonImageFlipRequired => true;
20+
21+
/// <inheritdoc/>
22+
public override bool IsScreenSupported => false;
23+
24+
/// <inheritdoc/>
25+
public override bool IsKnobSupported => false;
26+
27+
/// <inheritdoc/>
28+
public override int ButtonResolution => 72;
29+
30+
/// <inheritdoc/>
31+
public override int ButtonColumns => 5;
32+
33+
/// <inheritdoc/>
34+
public override int ButtonRows => 3;
35+
36+
/// <inheritdoc/>
37+
public override int ScreenWidth => -1;
38+
39+
/// <inheritdoc/>
40+
public override int ScreenHeight => -1;
41+
42+
/// <inheritdoc/>
43+
public override int ScreenSegmentWidth => -1;
44+
}
45+
}

src/DeckSurf.SDK/Models/Devices/StreamDeckMini.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ namespace DeckSurf.SDK.Models.Devices
77
/// <summary>
88
/// Implementation for a Stream Deck Mini connected device.
99
/// </summary>
10-
public class StreamDeckMini(int vid, int pid, string path, string name) : ConnectedDevice(vid, pid, path, name)
10+
public class StreamDeckMini(int vid, int pid, string path, string name, string serial) : ConnectedDevice(vid, pid, path, name, serial)
1111
{
1212
/// <inheritdoc/>
13-
public override DeviceModel Model => DeviceModel.MINI;
13+
public override DeviceModel Model => DeviceModel.Mini;
1414

1515
/// <inheritdoc/>
1616
public override int ButtonCount => 6;
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// Copyright (c) Den Delimarsky
2+
// Den Delimarsky licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
namespace DeckSurf.SDK.Models.Devices
6+
{
7+
/// <summary>
8+
/// Implementation for a Stream Deck Mini (2022) connected device.
9+
/// </summary>
10+
public class StreamDeckMini2022(int vid, int pid, string path, string name, string serial) : ConnectedDevice(vid, pid, path, name, serial)
11+
{
12+
/// <inheritdoc/>
13+
public override DeviceModel Model => DeviceModel.Mini2022;
14+
15+
/// <inheritdoc/>
16+
public override int ButtonCount => 6;
17+
18+
/// <inheritdoc/>
19+
public override bool IsButtonImageFlipRequired => true;
20+
21+
/// <inheritdoc/>
22+
public override bool IsScreenSupported => false;
23+
24+
/// <inheritdoc/>
25+
public override bool IsKnobSupported => false;
26+
27+
/// <inheritdoc/>
28+
public override int ButtonResolution => 80;
29+
30+
/// <inheritdoc/>
31+
public override int ButtonColumns => 3;
32+
33+
/// <inheritdoc/>
34+
public override int ButtonRows => 2;
35+
36+
/// <inheritdoc/>
37+
public override int ScreenWidth => -1;
38+
39+
/// <inheritdoc/>
40+
public override int ScreenHeight => -1;
41+
42+
/// <inheritdoc/>
43+
public override int ScreenSegmentWidth => -1;
44+
}
45+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// Copyright (c) Den Delimarsky
2+
// Den Delimarsky licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
namespace DeckSurf.SDK.Models.Devices
6+
{
7+
/// <summary>
8+
/// Implementation for a Stream Deck Neo connected device.
9+
/// </summary>
10+
public class StreamDeckNeo(int vid, int pid, string path, string name, string serial) : ConnectedDevice(vid, pid, path, name, serial)
11+
{
12+
/// <inheritdoc/>
13+
public override DeviceModel Model => DeviceModel.Neo;
14+
15+
/// <inheritdoc/>
16+
public override int ButtonCount => 8;
17+
18+
/// <inheritdoc/>
19+
public override bool IsButtonImageFlipRequired => false;
20+
21+
/// <inheritdoc/>
22+
public override bool IsScreenSupported => true;
23+
24+
/// <inheritdoc/>
25+
public override bool IsKnobSupported => false;
26+
27+
/// <inheritdoc/>
28+
public override int ButtonResolution => 96;
29+
30+
/// <inheritdoc/>
31+
public override int ButtonColumns => 4;
32+
33+
/// <inheritdoc/>
34+
public override int ButtonRows => 2;
35+
36+
/// <inheritdoc/>
37+
public override int ScreenWidth => 248;
38+
39+
/// <inheritdoc/>
40+
public override int ScreenHeight => 58;
41+
42+
/// <inheritdoc/>
43+
public override int ScreenSegmentWidth => -1;
44+
}
45+
}

0 commit comments

Comments
 (0)