1
0
mirror of https://github.com/DarthAffe/RGB.NET.git synced 2026-01-01 10:13:36 +00:00

Compare commits

..

No commits in common. "417b9be3f9eed26046e2695c9831421272beb2a5" and "a4bd79791223ff0c0b06c8c35378af8390ca44c3" have entirely different histories.

6 changed files with 35 additions and 54 deletions

View File

@ -14,11 +14,11 @@ jobs:
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- uses: actions/checkout@v4.1.1 - uses: actions/checkout@v3
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Setup .NET - name: Setup .NET
uses: actions/setup-dotnet@v4 uses: actions/setup-dotnet@v3
with: with:
dotnet-version: | dotnet-version: |
8.0.x 8.0.x
@ -26,7 +26,7 @@ jobs:
6.0.x 6.0.x
- name: Git Semantic Version - name: Git Semantic Version
id: versioning id: versioning
uses: PaulHatch/semantic-version@v5.4.0 uses: PaulHatch/semantic-version@v4.0.3
with: with:
short_tags: false short_tags: false
format: "${major}.${minor}.${patch}-prerelease.${increment}" format: "${major}.${minor}.${patch}-prerelease.${increment}"
@ -37,25 +37,25 @@ jobs:
- name: Test - name: Test
run: dotnet test --no-build --verbosity normal --configuration Release run: dotnet test --no-build --verbosity normal --configuration Release
- name: Upload a Build Artifact NET6 - name: Upload a Build Artifact NET6
uses: actions/upload-artifact@v4.3.1 uses: actions/upload-artifact@v2.2.4
with: with:
name: RGB.NET-NET6 name: RGB.NET-NET6
path: bin/net6.0/RGB.NET.*.dll path: bin/net6.0/RGB.NET.*.dll
if-no-files-found: error if-no-files-found: error
- name: Upload a Build Artifact NET7 - name: Upload a Build Artifact NET7
uses: actions/upload-artifact@v4.3.1 uses: actions/upload-artifact@v2.2.4
with: with:
name: RGB.NET-NET7 name: RGB.NET-NET7
path: bin/net7.0/RGB.NET.*.dll path: bin/net7.0/RGB.NET.*.dll
if-no-files-found: error if-no-files-found: error
- name: Upload a Build Artifact NET8 - name: Upload a Build Artifact NET8
uses: actions/upload-artifact@v4.3.1 uses: actions/upload-artifact@v2.2.4
with: with:
name: RGB.NET-NET8 name: RGB.NET-NET8
path: bin/net8.0/RGB.NET.*.dll path: bin/net8.0/RGB.NET.*.dll
if-no-files-found: error if-no-files-found: error
- name: Upload Nuget Build Artifact - name: Upload Nuget Build Artifact
uses: actions/upload-artifact@v4.3.1 uses: actions/upload-artifact@v2.2.4
with: with:
name: RGB.NET-Nugets name: RGB.NET-Nugets
path: bin/*nupkg path: bin/*nupkg

View File

@ -10,9 +10,9 @@ jobs:
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- uses: actions/checkout@v4.1.1 - uses: actions/checkout@v3
- name: Setup .NET - name: Setup .NET
uses: actions/setup-dotnet@v4 uses: actions/setup-dotnet@v3
with: with:
dotnet-version: | dotnet-version: |
8.0.x 8.0.x

View File

@ -13,11 +13,11 @@ jobs:
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- uses: actions/checkout@v4.1.1 - uses: actions/checkout@v3
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Setup .NET - name: Setup .NET
uses: actions/setup-dotnet@v4 uses: actions/setup-dotnet@v3
with: with:
dotnet-version: | dotnet-version: |
8.0.x 8.0.x
@ -25,7 +25,7 @@ jobs:
6.0.x 6.0.x
- name: Git Semantic Version - name: Git Semantic Version
id: versioning id: versioning
uses: PaulHatch/semantic-version@v5.4.0 uses: PaulHatch/semantic-version@v4.0.3
with: with:
short_tags: false short_tags: false
format: "${major}.${minor}.${patch}" format: "${major}.${minor}.${patch}"
@ -36,25 +36,25 @@ jobs:
- name: Test - name: Test
run: dotnet test --no-build --verbosity normal --configuration Release run: dotnet test --no-build --verbosity normal --configuration Release
- name: Upload a Build Artifact NET6 - name: Upload a Build Artifact NET6
uses: actions/upload-artifact@v4.3.1 uses: actions/upload-artifact@v2.2.4
with: with:
name: RGB.NET-NET6 name: RGB.NET-NET6
path: bin/net6.0/RGB.NET.*.dll path: bin/net6.0/RGB.NET.*.dll
if-no-files-found: error if-no-files-found: error
- name: Upload a Build Artifact NET7 - name: Upload a Build Artifact NET7
uses: actions/upload-artifact@v4.3.1 uses: actions/upload-artifact@v2.2.4
with: with:
name: RGB.NET-NET7 name: RGB.NET-NET7
path: bin/net7.0/RGB.NET.*.dll path: bin/net7.0/RGB.NET.*.dll
if-no-files-found: error if-no-files-found: error
- name: Upload a Build Artifact NET8 - name: Upload a Build Artifact NET8
uses: actions/upload-artifact@v4.3.1 uses: actions/upload-artifact@v2.2.4
with: with:
name: RGB.NET-NET8 name: RGB.NET-NET8
path: bin/net8.0/RGB.NET.*.dll path: bin/net8.0/RGB.NET.*.dll
if-no-files-found: error if-no-files-found: error
- name: Upload Nuget Build Artifact - name: Upload Nuget Build Artifact
uses: actions/upload-artifact@v4.3.1 uses: actions/upload-artifact@v2.2.4
with: with:
name: RGB.NET-Nugets name: RGB.NET-Nugets
path: bin/*nupkg path: bin/*nupkg

View File

@ -1,55 +1,42 @@
using System; namespace RGB.NET.Devices.Razer;
namespace RGB.NET.Devices.Razer;
/// <summary> /// <summary>
/// Represents a type of Razer SDK endpoint /// Represents a type of Razer SDK endpoint
/// </summary> /// </summary>
[Flags]
public enum RazerEndpointType public enum RazerEndpointType
{ {
/// <summary>
/// No endpoint
/// </summary>
None = 0,
/// <summary> /// <summary>
/// The keyboard endpoint /// The keyboard endpoint
/// </summary> /// </summary>
Keyboard = 1 << 0, Keyboard,
/// <summary> /// <summary>
/// The laptop keyboard endpoint, shares the <see cref="Keyboard"/> endpoint but has a different LED layout /// The laptop keyboard endpoint, shares the <see cref="Keyboard"/> endpoint but has a different LED layout
/// </summary> /// </summary>
LaptopKeyboard = 1 << 1, LaptopKeyboard,
/// <summary> /// <summary>
/// The mouse endpoint /// The mouse endpoint
/// </summary> /// </summary>
Mouse = 1 << 2, Mouse,
/// <summary> /// <summary>
/// The headset endpoint /// The headset endpoint
/// </summary> /// </summary>
Headset = 1 << 3, Headset,
/// <summary> /// <summary>
/// The mousepad endpoint /// The mousepad endpoint
/// </summary> /// </summary>
Mousepad = 1 << 4, Mousepad,
/// <summary> /// <summary>
/// The keypad endpoint /// The keypad endpoint
/// </summary> /// </summary>
Keypad = 1 << 5, Keypad,
/// <summary> /// <summary>
/// The Chroma Link endpoint /// The Chroma Link endpoint
/// </summary> /// </summary>
ChromaLink = 1 << 6, ChromaLink,
}
/// <summary>
/// All endpoints
/// </summary>
All = ~None
}

View File

@ -50,7 +50,7 @@ public sealed class RazerDeviceProvider : AbstractRGBDeviceProvider
/// <summary> /// <summary>
/// Forces to load the devices represented by the emulator even if they aren't reported to exist. /// Forces to load the devices represented by the emulator even if they aren't reported to exist.
/// </summary> /// </summary>
public RazerEndpointType LoadEmulatorDevices { get; set; } = RazerEndpointType.None; public bool LoadEmulatorDevices { get; set; } = false;
private const int VENDOR_ID = 0x1532; private const int VENDOR_ID = 0x1532;
@ -313,26 +313,21 @@ public sealed class RazerDeviceProvider : AbstractRGBDeviceProvider
{ {
DeviceDefinitions.LoadFilter = loadFilter; DeviceDefinitions.LoadFilter = loadFilter;
List<IRGBDevice> devices = base.GetLoadedDevices(loadFilter).ToList(); IList<IRGBDevice> devices = base.GetLoadedDevices(loadFilter).ToList();
if (LoadEmulatorDevices != RazerEndpointType.None) if (LoadEmulatorDevices)
{ {
if (loadFilter.HasFlag(RGBDeviceType.Keyboard) && (LoadEmulatorDevices.HasFlag(RazerEndpointType.Keyboard) || LoadEmulatorDevices.HasFlag(RazerEndpointType.LaptopKeyboard)) && devices.All(d => d is not RazerKeyboardRGBDevice)) if (loadFilter.HasFlag(RGBDeviceType.Keyboard) && devices.All(d => d is not RazerKeyboardRGBDevice))
devices.Add(new RazerKeyboardRGBDevice(new RazerKeyboardRGBDeviceInfo("Emulator Keyboard", RazerEndpointType.Keyboard), GetUpdateTrigger(), LedMappings.Keyboard)); devices.Add(new RazerKeyboardRGBDevice(new RazerKeyboardRGBDeviceInfo("Emulator Keyboard", RazerEndpointType.Keyboard), GetUpdateTrigger(), LedMappings.Keyboard));
if (loadFilter.HasFlag(RGBDeviceType.Mouse) && devices.All(d => d is not RazerMouseRGBDevice))
if (loadFilter.HasFlag(RGBDeviceType.Mouse) && LoadEmulatorDevices.HasFlag(RazerEndpointType.Mouse) && devices.All(d => d is not RazerMouseRGBDevice))
devices.Add(new RazerMouseRGBDevice(new RazerRGBDeviceInfo(RGBDeviceType.Mouse, RazerEndpointType.Mouse, "Emulator Mouse"), GetUpdateTrigger(), LedMappings.Mouse)); devices.Add(new RazerMouseRGBDevice(new RazerRGBDeviceInfo(RGBDeviceType.Mouse, RazerEndpointType.Mouse, "Emulator Mouse"), GetUpdateTrigger(), LedMappings.Mouse));
if (loadFilter.HasFlag(RGBDeviceType.Headset) && devices.All(d => d is not RazerHeadsetRGBDevice))
if (loadFilter.HasFlag(RGBDeviceType.Headset) && LoadEmulatorDevices.HasFlag(RazerEndpointType.Headset) && devices.All(d => d is not RazerHeadsetRGBDevice))
devices.Add(new RazerHeadsetRGBDevice(new RazerRGBDeviceInfo(RGBDeviceType.Headset, RazerEndpointType.Headset, "Emulator Headset"), GetUpdateTrigger())); devices.Add(new RazerHeadsetRGBDevice(new RazerRGBDeviceInfo(RGBDeviceType.Headset, RazerEndpointType.Headset, "Emulator Headset"), GetUpdateTrigger()));
if (loadFilter.HasFlag(RGBDeviceType.Mousepad) && devices.All(d => d is not RazerMousepadRGBDevice))
if (loadFilter.HasFlag(RGBDeviceType.Mousepad) && LoadEmulatorDevices.HasFlag(RazerEndpointType.Mousepad) && devices.All(d => d is not RazerMousepadRGBDevice))
devices.Add(new RazerMousepadRGBDevice(new RazerRGBDeviceInfo(RGBDeviceType.Mousepad, RazerEndpointType.Mousepad, "Emulator Mousepad"), GetUpdateTrigger())); devices.Add(new RazerMousepadRGBDevice(new RazerRGBDeviceInfo(RGBDeviceType.Mousepad, RazerEndpointType.Mousepad, "Emulator Mousepad"), GetUpdateTrigger()));
if (loadFilter.HasFlag(RGBDeviceType.Keypad) && devices.All(d => d is not RazerMousepadRGBDevice))
if (loadFilter.HasFlag(RGBDeviceType.Keypad) && LoadEmulatorDevices.HasFlag(RazerEndpointType.Keypad) && devices.All(d => d is not RazerMousepadRGBDevice))
devices.Add(new RazerKeypadRGBDevice(new RazerRGBDeviceInfo(RGBDeviceType.Keypad, RazerEndpointType.Keypad, "Emulator Keypad"), GetUpdateTrigger())); devices.Add(new RazerKeypadRGBDevice(new RazerRGBDeviceInfo(RGBDeviceType.Keypad, RazerEndpointType.Keypad, "Emulator Keypad"), GetUpdateTrigger()));
if (loadFilter.HasFlag(RGBDeviceType.Unknown) && devices.All(d => d is not RazerChromaLinkRGBDevice))
if (loadFilter.HasFlag(RGBDeviceType.Unknown) && LoadEmulatorDevices.HasFlag(RazerEndpointType.ChromaLink) && devices.All(d => d is not RazerChromaLinkRGBDevice))
devices.Add(new RazerChromaLinkRGBDevice(new RazerRGBDeviceInfo(RGBDeviceType.Unknown, RazerEndpointType.ChromaLink, "Emulator Chroma Link"), GetUpdateTrigger())); devices.Add(new RazerChromaLinkRGBDevice(new RazerRGBDeviceInfo(RGBDeviceType.Unknown, RazerEndpointType.ChromaLink, "Emulator Chroma Link"), GetUpdateTrigger()));
} }

View File

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using RGB.NET.Core; using RGB.NET.Core;
using RGB.NET.Devices.SteelSeries.API; using RGB.NET.Devices.SteelSeries.API;
@ -78,7 +78,6 @@ public sealed class SteelSeriesDeviceProvider : AbstractRGBDeviceProvider
{ 0x1614, RGBDeviceType.Keyboard, "Apex Pro TKL", LedMappings.KeyboardTklMappingUk, SteelSeriesDeviceType.PerKey }, { 0x1614, RGBDeviceType.Keyboard, "Apex Pro TKL", LedMappings.KeyboardTklMappingUk, SteelSeriesDeviceType.PerKey },
{ 0x2036, RGBDeviceType.Keyboard, "MSI Notebook", LedMappings.KeyboardNotebookMappingUk, SteelSeriesDeviceType.PerKey }, { 0x2036, RGBDeviceType.Keyboard, "MSI Notebook", LedMappings.KeyboardNotebookMappingUk, SteelSeriesDeviceType.PerKey },
{ 0x113A, RGBDeviceType.Keyboard, "MSI GE78HX", LedMappings.KeyboardMSIGE78Mapping, SteelSeriesDeviceType.PerKey }, { 0x113A, RGBDeviceType.Keyboard, "MSI GE78HX", LedMappings.KeyboardMSIGE78Mapping, SteelSeriesDeviceType.PerKey },
{ 0x1122, RGBDeviceType.Keyboard, "MSI Notebook", LedMappings.KeyboardNotebookMappingUk, SteelSeriesDeviceType.PerKey },
//Headsets //Headsets
{ 0x12AA, RGBDeviceType.Headset, "Arctis 5", LedMappings.HeadsetTwoZone, SteelSeriesDeviceType.TwoZone }, { 0x12AA, RGBDeviceType.Headset, "Arctis 5", LedMappings.HeadsetTwoZone, SteelSeriesDeviceType.TwoZone },