From 2647d8059adaddd3f8f9077fae03fc2ba0d5049b Mon Sep 17 00:00:00 2001 From: Darth Affe Date: Wed, 16 Aug 2023 21:09:20 +0200 Subject: [PATCH] Added LampArray-project (WIP) --- .../HIDLampArrayDeviceProvider.cs | 61 ++++++++++++++++++ .../RGB.NET.Devices.HIDLampArray.csproj | 64 +++++++++++++++++++ RGB.NET.Devices.HIDLampArray/ReadMe.md | 11 ++++ RGB.NET.sln | 7 ++ 4 files changed, 143 insertions(+) create mode 100644 RGB.NET.Devices.HIDLampArray/HIDLampArrayDeviceProvider.cs create mode 100644 RGB.NET.Devices.HIDLampArray/RGB.NET.Devices.HIDLampArray.csproj create mode 100644 RGB.NET.Devices.HIDLampArray/ReadMe.md diff --git a/RGB.NET.Devices.HIDLampArray/HIDLampArrayDeviceProvider.cs b/RGB.NET.Devices.HIDLampArray/HIDLampArrayDeviceProvider.cs new file mode 100644 index 0000000..3e3906b --- /dev/null +++ b/RGB.NET.Devices.HIDLampArray/HIDLampArrayDeviceProvider.cs @@ -0,0 +1,61 @@ +// ReSharper disable MemberCanBePrivate.Global + +using System; +using System.Collections.Generic; +using System.Linq; +using HidSharp; +using HidSharp.Reports; +using RGB.NET.Core; +using RGB.NET.HID; + +namespace RGB.NET.Devices.HIDLampArray; + +/// +/// +/// Represents a device provider responsible for PicoPi-devices. +/// +// ReSharper disable once InconsistentNaming +public sealed class HIDLampArrayDeviceProvider : AbstractRGBDeviceProvider +{ + #region Properties & Fields + + private static HIDLampArrayDeviceProvider? _instance; + /// + /// Gets the singleton instance. + /// + public static HIDLampArrayDeviceProvider Instance => _instance ?? new HIDLampArrayDeviceProvider(); + + #endregion + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + /// Thrown if this constructor is called even if there is already an instance of this class. + public HIDLampArrayDeviceProvider() + { + if (_instance != null) throw new InvalidOperationException($"There can be only one instance of type {nameof(HIDLampArrayDeviceProvider)}"); + _instance = this; + } + + #endregion + + #region Methods + + protected override void InitializeSDK() + { + } + + protected override IEnumerable LoadDevices() + { + foreach (HidDevice? device in DeviceList.Local.GetHidDevices()) + { + + } + + yield break; + } + + #endregion +} \ No newline at end of file diff --git a/RGB.NET.Devices.HIDLampArray/RGB.NET.Devices.HIDLampArray.csproj b/RGB.NET.Devices.HIDLampArray/RGB.NET.Devices.HIDLampArray.csproj new file mode 100644 index 0000000..d5944f2 --- /dev/null +++ b/RGB.NET.Devices.HIDLampArray/RGB.NET.Devices.HIDLampArray.csproj @@ -0,0 +1,64 @@ + + + net7.0;net6.0 + latest + enable + + Darth Affe + Wyrez + en-US + en-US + RGB.NET.Devices.HIDLampArray + RGB.NET.Devices.HIDLampArray + RGB.NET.Devices.HIDLampArray + RGB.NET.Devices.HIDLampArray + RGB.NET.Devices.HIDLampArray + HID-LampArray-Device-Implementations of RGB.NET + HID-LampArray-Device-Implementations of RGB.NET, a C# (.NET) library for accessing various RGB-peripherals + Copyright © Darth Affe 2023 + Copyright © Darth Affe 2023 + icon.png + README.md + https://github.com/DarthAffe/RGB.NET + LGPL-2.1-only + Github + https://github.com/DarthAffe/RGB.NET + True + + + + 0.0.1 + 0.0.1 + 0.0.1 + + ..\bin\ + true + True + True + portable + snupkg + + + + TRACE;DEBUG + true + false + + + + true + $(NoWarn);CS1591;CS1572;CS1573 + RELEASE + + + + + + + + + + + + + \ No newline at end of file diff --git a/RGB.NET.Devices.HIDLampArray/ReadMe.md b/RGB.NET.Devices.HIDLampArray/ReadMe.md new file mode 100644 index 0000000..527c879 --- /dev/null +++ b/RGB.NET.Devices.HIDLampArray/ReadMe.md @@ -0,0 +1,11 @@ +[RGB.NET](https://github.com/DarthAffe/RGB.NET) Device-Provider-Package for RGB.NET-Devices based on the LampArray-HID-Standard. + +## Usage +This provider follows the default pattern and does not require additional setup. + +```csharp +surface.Load(HIDLampArrayDeviceProvider.Instance); +``` + +# Required SDK +This provider does not require an additional SDK. diff --git a/RGB.NET.sln b/RGB.NET.sln index 257bf65..eb90df3 100644 --- a/RGB.NET.sln +++ b/RGB.NET.sln @@ -49,6 +49,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RGB.NET.Devices.OpenRGB", " EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RGB.NET.Devices.Corsair_Legacy", "RGB.NET.Devices.Corsair_Legacy\RGB.NET.Devices.Corsair_Legacy.csproj", "{66AF690C-27A1-4097-AC53-57C0ED89E286}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RGB.NET.Devices.HIDLampArray", "..\..\..\..\DarthAffe\Source\Repos\RGB.NET\RGB.NET.Devices.HIDLampArray\RGB.NET.Devices.HIDLampArray.csproj", "{4D097C5D-E41F-4215-877B-0EA4C0361A63}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -139,6 +141,10 @@ Global {66AF690C-27A1-4097-AC53-57C0ED89E286}.Debug|Any CPU.Build.0 = Debug|Any CPU {66AF690C-27A1-4097-AC53-57C0ED89E286}.Release|Any CPU.ActiveCfg = Release|Any CPU {66AF690C-27A1-4097-AC53-57C0ED89E286}.Release|Any CPU.Build.0 = Release|Any CPU + {4D097C5D-E41F-4215-877B-0EA4C0361A63}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4D097C5D-E41F-4215-877B-0EA4C0361A63}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4D097C5D-E41F-4215-877B-0EA4C0361A63}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4D097C5D-E41F-4215-877B-0EA4C0361A63}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -161,6 +167,7 @@ Global {EDBA49D6-AE96-4E96-9E6A-30154D93BD5F} = {92D7C263-D4C9-4D26-93E2-93C1F9C2CD16} {F29A96E5-CDD0-469F-A871-A35A7519BC49} = {D13032C6-432E-4F43-8A32-071133C22B16} {66AF690C-27A1-4097-AC53-57C0ED89E286} = {D13032C6-432E-4F43-8A32-071133C22B16} + {4D097C5D-E41F-4215-877B-0EA4C0361A63} = {D13032C6-432E-4F43-8A32-071133C22B16} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {7F222AD4-1F9E-4AAB-9D69-D62372D4C1BA}