1
0
mirror of https://github.com/DarthAffe/RGB.NET.git synced 2025-12-12 17:48:31 +00:00

Added LampArray-project (WIP)

This commit is contained in:
Darth Affe 2023-08-16 21:09:20 +02:00
parent 7415c6b4ef
commit 2647d8059a
4 changed files with 143 additions and 0 deletions

View File

@ -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;
/// <inheritdoc />
/// <summary>
/// Represents a device provider responsible for PicoPi-devices.
/// </summary>
// ReSharper disable once InconsistentNaming
public sealed class HIDLampArrayDeviceProvider : AbstractRGBDeviceProvider
{
#region Properties & Fields
private static HIDLampArrayDeviceProvider? _instance;
/// <summary>
/// Gets the singleton <see cref="HIDLampArrayDeviceProvider"/> instance.
/// </summary>
public static HIDLampArrayDeviceProvider Instance => _instance ?? new HIDLampArrayDeviceProvider();
#endregion
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="HIDLampArrayDeviceProvider"/> class.
/// </summary>
/// <exception cref="InvalidOperationException">Thrown if this constructor is called even if there is already an instance of this class.</exception>
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<IRGBDevice> LoadDevices()
{
foreach (HidDevice? device in DeviceList.Local.GetHidDevices())
{
}
yield break;
}
#endregion
}

View File

@ -0,0 +1,64 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<Authors>Darth Affe</Authors>
<Company>Wyrez</Company>
<Language>en-US</Language>
<NeutralLanguage>en-US</NeutralLanguage>
<Title>RGB.NET.Devices.HIDLampArray</Title>
<AssemblyName>RGB.NET.Devices.HIDLampArray</AssemblyName>
<AssemblyTitle>RGB.NET.Devices.HIDLampArray</AssemblyTitle>
<PackageId>RGB.NET.Devices.HIDLampArray</PackageId>
<RootNamespace>RGB.NET.Devices.HIDLampArray</RootNamespace>
<Description>HID-LampArray-Device-Implementations of RGB.NET</Description>
<Summary>HID-LampArray-Device-Implementations of RGB.NET, a C# (.NET) library for accessing various RGB-peripherals</Summary>
<Copyright>Copyright © Darth Affe 2023</Copyright>
<PackageCopyright>Copyright © Darth Affe 2023</PackageCopyright>
<PackageIcon>icon.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageProjectUrl>https://github.com/DarthAffe/RGB.NET</PackageProjectUrl>
<PackageLicenseExpression>LGPL-2.1-only</PackageLicenseExpression>
<RepositoryType>Github</RepositoryType>
<RepositoryUrl>https://github.com/DarthAffe/RGB.NET</RepositoryUrl>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<PackageReleaseNotes></PackageReleaseNotes>
<Version>0.0.1</Version>
<AssemblyVersion>0.0.1</AssemblyVersion>
<FileVersion>0.0.1</FileVersion>
<OutputPath>..\bin\</OutputPath>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<IncludeSource>True</IncludeSource>
<IncludeSymbols>True</IncludeSymbols>
<DebugType>portable</DebugType>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<DefineConstants>TRACE;DEBUG</DefineConstants>
<DebugSymbols>true</DebugSymbols>
<Optimize>false</Optimize>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<Optimize>true</Optimize>
<NoWarn>$(NoWarn);CS1591;CS1572;CS1573</NoWarn>
<DefineConstants>RELEASE</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Content Include="..\Resources\icon.png" Link="icon.png" Pack="true" PackagePath="\" />
<None Include="README.md" Pack="true" PackagePath="\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RGB.NET.Core\RGB.NET.Core.csproj" />
<ProjectReference Include="..\RGB.NET.HID\RGB.NET.HID.csproj" />
<PackageReference Include="HidSharp" Version="2.1.0" />
</ItemGroup>
</Project>

View File

@ -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.

View File

@ -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}