-
Notifications
You must be signed in to change notification settings - Fork 75
/
Copy pathHelper.cs
56 lines (50 loc) · 2.59 KB
/
Helper.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
using OpenRGB.NET;
using RGB.NET.Core;
using OpenRGBDevice = OpenRGB.NET.Device;
namespace RGB.NET.Devices.OpenRGB;
internal static class Helper
{
public static LedId GetInitialLedIdForDeviceType(RGBDeviceType type)
=> type switch
{
RGBDeviceType.Mouse => LedId.Mouse1,
RGBDeviceType.Headset => LedId.Headset1,
RGBDeviceType.Mousepad => LedId.Mousepad1,
RGBDeviceType.LedStripe => LedId.LedStripe1,
RGBDeviceType.LedMatrix => LedId.LedMatrix1,
RGBDeviceType.Mainboard => LedId.Mainboard1,
RGBDeviceType.GraphicsCard => LedId.GraphicsCard1,
RGBDeviceType.DRAM => LedId.DRAM1,
RGBDeviceType.HeadsetStand => LedId.HeadsetStand1,
RGBDeviceType.Keypad => LedId.Keypad1,
RGBDeviceType.Fan => LedId.Fan1,
RGBDeviceType.Speaker => LedId.Speaker1,
RGBDeviceType.Cooler => LedId.Cooler1,
RGBDeviceType.Keyboard => LedId.Keyboard_Custom1,
_ => LedId.Custom1
};
public static RGBDeviceType GetRgbNetDeviceType(DeviceType type)
=> type switch
{
DeviceType.Motherboard => RGBDeviceType.Mainboard,
DeviceType.Dram => RGBDeviceType.DRAM,
DeviceType.Gpu => RGBDeviceType.GraphicsCard,
DeviceType.Cooler => RGBDeviceType.Cooler,
DeviceType.Ledstrip => RGBDeviceType.LedStripe,
DeviceType.Keyboard => RGBDeviceType.Keyboard,
DeviceType.Mouse => RGBDeviceType.Mouse,
DeviceType.Mousemat => RGBDeviceType.Mousepad,
DeviceType.Headset => RGBDeviceType.Headset,
DeviceType.Speaker => RGBDeviceType.Speaker,
DeviceType.HeadsetStand => RGBDeviceType.HeadsetStand,
_ => RGBDeviceType.Unknown
};
public static LedId GetInitialLedIdForDeviceType(DeviceType type)
=> GetInitialLedIdForDeviceType(GetRgbNetDeviceType(type));
public static string GetVendorName(OpenRGBDevice openRGBDevice) => string.IsNullOrWhiteSpace(openRGBDevice.Vendor)
? "OpenRGB"
: openRGBDevice.Vendor;
public static string GetModelName(OpenRGBDevice openRGBDevice) => string.IsNullOrWhiteSpace(openRGBDevice.Vendor)
? openRGBDevice.Name
: openRGBDevice.Name.Replace(openRGBDevice.Vendor, "").Trim();
}