From 768b1fddd0f29b706740c801b226d2da15ffba59 Mon Sep 17 00:00:00 2001 From: Darth Affe Date: Mon, 25 Mar 2024 21:06:58 +0100 Subject: [PATCH] Added dynamic lighting device provider (not working) --- RGB.NET.Core/Devices/RGBDeviceType.cs | 20 + RGB.NET.Core/Devices/TypeInterfaces/IArt.cs | 6 + .../Devices/TypeInterfaces/IChassis.cs | 6 + .../Devices/TypeInterfaces/IFurniture.cs | 6 + .../Devices/TypeInterfaces/IWearable.cs | 6 + RGB.NET.Core/Leds/LedId.cs | 520 ++++++++++++++++++ .../Art/DynamicLightingArtRGBDevice.cs | 34 ++ .../Art/DynamicLightingArtRGBDeviceInfo.cs | 19 + .../DynamicLightingChassisRGBDevice.cs | 34 ++ .../DynamicLightingChassisRGBDeviceInfo.cs | 19 + .../DynamicLightingDeviceProvider.cs | 136 +++++ .../DynamicLightingFurnitureRGBDevice.cs | 34 ++ .../DynamicLightingFurnitureRGBDeviceInfo.cs | 19 + .../DynamicLightingGameControllerRGBDevice.cs | 34 ++ ...amicLightingGameControllerRGBDeviceInfo.cs | 19 + .../DynamicLightingDeviceUpdateQueue.cs | 81 +++ .../Generic/DynamicLightingRGBDevice.cs | 79 +++ .../Generic/DynamicLightingRGBDeviceInfo.cs | 63 +++ .../Generic/IDynamicLightingRGBDevice.cs | 11 + .../Generic/LedMapping.cs | 102 ++++ .../DynamicLightingKeyboardRGBDevice.cs | 73 +++ .../DynamicLightingKeyboardRGBDeviceInfo.cs | 26 + .../Mouse/DynamicLightingMouseRGBDevice.cs | 34 ++ .../DynamicLightingMouseRGBDeviceInfo.cs | 19 + .../DynamicLightingNotificationRGBDevice.cs | 34 ++ ...ynamicLightingNotificationRGBDeviceInfo.cs | 19 + .../DynamicLightingPeripheralRGBDevice.cs | 34 ++ .../DynamicLightingPeripheralRGBDeviceInfo.cs | 19 + RGB.NET.Devices.DynamicLighting/README.md | 9 + .../RGB.NET.Devices.DynamicLighting.csproj | 64 +++ ...Devices.DynamicLighting.csproj.DotSettings | 13 + .../Scene/DynamicLightingSceneRGBDevice.cs | 34 ++ .../DynamicLightingSceneRGBDeviceInfo.cs | 19 + .../DynamicLightingUndefinedRGBDevice.cs | 34 ++ .../DynamicLightingUndefinedRGBDeviceInfo.cs | 19 + .../DynamicLightingWearableRGBDevice.cs | 34 ++ .../DynamicLightingWearableRGBDeviceInfo.cs | 19 + RGB.NET.sln | 7 + 38 files changed, 1758 insertions(+) create mode 100644 RGB.NET.Core/Devices/TypeInterfaces/IArt.cs create mode 100644 RGB.NET.Core/Devices/TypeInterfaces/IChassis.cs create mode 100644 RGB.NET.Core/Devices/TypeInterfaces/IFurniture.cs create mode 100644 RGB.NET.Core/Devices/TypeInterfaces/IWearable.cs create mode 100644 RGB.NET.Devices.DynamicLighting/Art/DynamicLightingArtRGBDevice.cs create mode 100644 RGB.NET.Devices.DynamicLighting/Art/DynamicLightingArtRGBDeviceInfo.cs create mode 100644 RGB.NET.Devices.DynamicLighting/Chassis/DynamicLightingChassisRGBDevice.cs create mode 100644 RGB.NET.Devices.DynamicLighting/Chassis/DynamicLightingChassisRGBDeviceInfo.cs create mode 100644 RGB.NET.Devices.DynamicLighting/DynamicLightingDeviceProvider.cs create mode 100644 RGB.NET.Devices.DynamicLighting/Furniture/DynamicLightingFurnitureRGBDevice.cs create mode 100644 RGB.NET.Devices.DynamicLighting/Furniture/DynamicLightingFurnitureRGBDeviceInfo.cs create mode 100644 RGB.NET.Devices.DynamicLighting/GameController/DynamicLightingGameControllerRGBDevice.cs create mode 100644 RGB.NET.Devices.DynamicLighting/GameController/DynamicLightingGameControllerRGBDeviceInfo.cs create mode 100644 RGB.NET.Devices.DynamicLighting/Generic/DynamicLightingDeviceUpdateQueue.cs create mode 100644 RGB.NET.Devices.DynamicLighting/Generic/DynamicLightingRGBDevice.cs create mode 100644 RGB.NET.Devices.DynamicLighting/Generic/DynamicLightingRGBDeviceInfo.cs create mode 100644 RGB.NET.Devices.DynamicLighting/Generic/IDynamicLightingRGBDevice.cs create mode 100644 RGB.NET.Devices.DynamicLighting/Generic/LedMapping.cs create mode 100644 RGB.NET.Devices.DynamicLighting/Keyboard/DynamicLightingKeyboardRGBDevice.cs create mode 100644 RGB.NET.Devices.DynamicLighting/Keyboard/DynamicLightingKeyboardRGBDeviceInfo.cs create mode 100644 RGB.NET.Devices.DynamicLighting/Mouse/DynamicLightingMouseRGBDevice.cs create mode 100644 RGB.NET.Devices.DynamicLighting/Mouse/DynamicLightingMouseRGBDeviceInfo.cs create mode 100644 RGB.NET.Devices.DynamicLighting/Notification/DynamicLightingNotificationRGBDevice.cs create mode 100644 RGB.NET.Devices.DynamicLighting/Notification/DynamicLightingNotificationRGBDeviceInfo.cs create mode 100644 RGB.NET.Devices.DynamicLighting/Peripheral/DynamicLightingPeripheralRGBDevice.cs create mode 100644 RGB.NET.Devices.DynamicLighting/Peripheral/DynamicLightingPeripheralRGBDeviceInfo.cs create mode 100644 RGB.NET.Devices.DynamicLighting/README.md create mode 100644 RGB.NET.Devices.DynamicLighting/RGB.NET.Devices.DynamicLighting.csproj create mode 100644 RGB.NET.Devices.DynamicLighting/RGB.NET.Devices.DynamicLighting.csproj.DotSettings create mode 100644 RGB.NET.Devices.DynamicLighting/Scene/DynamicLightingSceneRGBDevice.cs create mode 100644 RGB.NET.Devices.DynamicLighting/Scene/DynamicLightingSceneRGBDeviceInfo.cs create mode 100644 RGB.NET.Devices.DynamicLighting/Undefined/DynamicLightingUndefinedRGBDevice.cs create mode 100644 RGB.NET.Devices.DynamicLighting/Undefined/DynamicLightingUndefinedRGBDeviceInfo.cs create mode 100644 RGB.NET.Devices.DynamicLighting/Wearable/DynamicLightingWearableRGBDevice.cs create mode 100644 RGB.NET.Devices.DynamicLighting/Wearable/DynamicLightingWearableRGBDeviceInfo.cs diff --git a/RGB.NET.Core/Devices/RGBDeviceType.cs b/RGB.NET.Core/Devices/RGBDeviceType.cs index 57be106..1650720 100644 --- a/RGB.NET.Core/Devices/RGBDeviceType.cs +++ b/RGB.NET.Core/Devices/RGBDeviceType.cs @@ -98,6 +98,26 @@ public enum RGBDeviceType /// GameController = 1 << 16, + /// + /// Represents a chassis + /// + Chassis = 1 << 17, + + /// + /// Represents a furniture + /// + Furniture = 1 << 18, + + /// + /// Represents a wearable + /// + Wearable = 1 << 19, + + /// + /// Represents a piece of art + /// + Art = 1 << 20, + /// /// Represents a device where the type is not known or not present in the list. /// diff --git a/RGB.NET.Core/Devices/TypeInterfaces/IArt.cs b/RGB.NET.Core/Devices/TypeInterfaces/IArt.cs new file mode 100644 index 0000000..587a3e6 --- /dev/null +++ b/RGB.NET.Core/Devices/TypeInterfaces/IArt.cs @@ -0,0 +1,6 @@ +namespace RGB.NET.Core; + +/// +/// Represents a art-device +/// +public interface IArt : IRGBDevice; \ No newline at end of file diff --git a/RGB.NET.Core/Devices/TypeInterfaces/IChassis.cs b/RGB.NET.Core/Devices/TypeInterfaces/IChassis.cs new file mode 100644 index 0000000..392d623 --- /dev/null +++ b/RGB.NET.Core/Devices/TypeInterfaces/IChassis.cs @@ -0,0 +1,6 @@ +namespace RGB.NET.Core; + +/// +/// Represents a chassis-device +/// +public interface IChassis : IRGBDevice; \ No newline at end of file diff --git a/RGB.NET.Core/Devices/TypeInterfaces/IFurniture.cs b/RGB.NET.Core/Devices/TypeInterfaces/IFurniture.cs new file mode 100644 index 0000000..e15121c --- /dev/null +++ b/RGB.NET.Core/Devices/TypeInterfaces/IFurniture.cs @@ -0,0 +1,6 @@ +namespace RGB.NET.Core; + +/// +/// Represents a furniture-device +/// +public interface IFurniture : IRGBDevice; \ No newline at end of file diff --git a/RGB.NET.Core/Devices/TypeInterfaces/IWearable.cs b/RGB.NET.Core/Devices/TypeInterfaces/IWearable.cs new file mode 100644 index 0000000..c8281c3 --- /dev/null +++ b/RGB.NET.Core/Devices/TypeInterfaces/IWearable.cs @@ -0,0 +1,6 @@ +namespace RGB.NET.Core; + +/// +/// Represents a art-device +/// +public interface IWearable : IRGBDevice; \ No newline at end of file diff --git a/RGB.NET.Core/Leds/LedId.cs b/RGB.NET.Core/Leds/LedId.cs index a0b12c9..25c35d6 100644 --- a/RGB.NET.Core/Leds/LedId.cs +++ b/RGB.NET.Core/Leds/LedId.cs @@ -6424,6 +6424,526 @@ public enum LedId GameController127 = 0x00E0007F, GameController128 = 0x00E00080, + /*### Chassis ###*/ + Chassis1 = 0x00F00001, + Chassis2 = 0x00F00002, + Chassis3 = 0x00F00003, + Chassis4 = 0x00F00004, + Chassis5 = 0x00F00005, + Chassis6 = 0x00F00006, + Chassis7 = 0x00F00007, + Chassis8 = 0x00F00008, + Chassis9 = 0x00F00009, + Chassis10 = 0x00F0000A, + Chassis11 = 0x00F0000B, + Chassis12 = 0x00F0000C, + Chassis13 = 0x00F0000D, + Chassis14 = 0x00F0000E, + Chassis15 = 0x00F0000F, + Chassis16 = 0x00F00010, + Chassis17 = 0x00F00011, + Chassis18 = 0x00F00012, + Chassis19 = 0x00F00013, + Chassis20 = 0x00F00014, + Chassis21 = 0x00F00015, + Chassis22 = 0x00F00016, + Chassis23 = 0x00F00017, + Chassis24 = 0x00F00018, + Chassis25 = 0x00F00019, + Chassis26 = 0x00F0001A, + Chassis27 = 0x00F0001B, + Chassis28 = 0x00F0001C, + Chassis29 = 0x00F0001D, + Chassis30 = 0x00F0001E, + Chassis31 = 0x00F0001F, + Chassis32 = 0x00F00020, + Chassis33 = 0x00F00021, + Chassis34 = 0x00F00022, + Chassis35 = 0x00F00023, + Chassis36 = 0x00F00024, + Chassis37 = 0x00F00025, + Chassis38 = 0x00F00026, + Chassis39 = 0x00F00027, + Chassis40 = 0x00F00028, + Chassis41 = 0x00F00029, + Chassis42 = 0x00F0002A, + Chassis43 = 0x00F0002B, + Chassis44 = 0x00F0002C, + Chassis45 = 0x00F0002D, + Chassis46 = 0x00F0002E, + Chassis47 = 0x00F0002F, + Chassis48 = 0x00F00030, + Chassis49 = 0x00F00031, + Chassis50 = 0x00F00032, + Chassis51 = 0x00F00033, + Chassis52 = 0x00F00034, + Chassis53 = 0x00F00035, + Chassis54 = 0x00F00036, + Chassis55 = 0x00F00037, + Chassis56 = 0x00F00038, + Chassis57 = 0x00F00039, + Chassis58 = 0x00F0003A, + Chassis59 = 0x00F0003B, + Chassis60 = 0x00F0003C, + Chassis61 = 0x00F0003D, + Chassis62 = 0x00F0003E, + Chassis63 = 0x00F0003F, + Chassis64 = 0x00F00040, + Chassis65 = 0x00F00041, + Chassis66 = 0x00F00042, + Chassis67 = 0x00F00043, + Chassis68 = 0x00F00044, + Chassis69 = 0x00F00045, + Chassis70 = 0x00F00046, + Chassis71 = 0x00F00047, + Chassis72 = 0x00F00048, + Chassis73 = 0x00F00049, + Chassis74 = 0x00F0004A, + Chassis75 = 0x00F0004B, + Chassis76 = 0x00F0004C, + Chassis77 = 0x00F0004D, + Chassis78 = 0x00F0004E, + Chassis79 = 0x00F0004F, + Chassis80 = 0x00F00050, + Chassis81 = 0x00F00051, + Chassis82 = 0x00F00052, + Chassis83 = 0x00F00053, + Chassis84 = 0x00F00054, + Chassis85 = 0x00F00055, + Chassis86 = 0x00F00056, + Chassis87 = 0x00F00057, + Chassis88 = 0x00F00058, + Chassis89 = 0x00F00059, + Chassis90 = 0x00F0005A, + Chassis91 = 0x00F0005B, + Chassis92 = 0x00F0005C, + Chassis93 = 0x00F0005D, + Chassis94 = 0x00F0005E, + Chassis95 = 0x00F0005F, + Chassis96 = 0x00F00060, + Chassis97 = 0x00F00061, + Chassis98 = 0x00F00062, + Chassis99 = 0x00F00063, + Chassis100 = 0x00F00064, + Chassis101 = 0x00F00065, + Chassis102 = 0x00F00066, + Chassis103 = 0x00F00067, + Chassis104 = 0x00F00068, + Chassis105 = 0x00F00069, + Chassis106 = 0x00F0006A, + Chassis107 = 0x00F0006B, + Chassis108 = 0x00F0006C, + Chassis109 = 0x00F0006D, + Chassis110 = 0x00F0006E, + Chassis111 = 0x00F0006F, + Chassis112 = 0x00F00070, + Chassis113 = 0x00F00071, + Chassis114 = 0x00F00072, + Chassis115 = 0x00F00073, + Chassis116 = 0x00F00074, + Chassis117 = 0x00F00075, + Chassis118 = 0x00F00076, + Chassis119 = 0x00F00077, + Chassis120 = 0x00F00078, + Chassis121 = 0x00F00079, + Chassis122 = 0x00F0007A, + Chassis123 = 0x00F0007B, + Chassis124 = 0x00F0007C, + Chassis125 = 0x00F0007D, + Chassis126 = 0x00F0007E, + Chassis127 = 0x00F0007F, + Chassis128 = 0x00F00080, + + /*### Furniture ###*/ + Furniture1 = 0x01000001, + Furniture2 = 0x01000002, + Furniture3 = 0x01000003, + Furniture4 = 0x01000004, + Furniture5 = 0x01000005, + Furniture6 = 0x01000006, + Furniture7 = 0x01000007, + Furniture8 = 0x01000008, + Furniture9 = 0x01000009, + Furniture10 = 0x0100000A, + Furniture11 = 0x0100000B, + Furniture12 = 0x0100000C, + Furniture13 = 0x0100000D, + Furniture14 = 0x0100000E, + Furniture15 = 0x0100000F, + Furniture16 = 0x01000010, + Furniture17 = 0x01000011, + Furniture18 = 0x01000012, + Furniture19 = 0x01000013, + Furniture20 = 0x01000014, + Furniture21 = 0x01000015, + Furniture22 = 0x01000016, + Furniture23 = 0x01000017, + Furniture24 = 0x01000018, + Furniture25 = 0x01000019, + Furniture26 = 0x0100001A, + Furniture27 = 0x0100001B, + Furniture28 = 0x0100001C, + Furniture29 = 0x0100001D, + Furniture30 = 0x0100001E, + Furniture31 = 0x0100001F, + Furniture32 = 0x01000020, + Furniture33 = 0x01000021, + Furniture34 = 0x01000022, + Furniture35 = 0x01000023, + Furniture36 = 0x01000024, + Furniture37 = 0x01000025, + Furniture38 = 0x01000026, + Furniture39 = 0x01000027, + Furniture40 = 0x01000028, + Furniture41 = 0x01000029, + Furniture42 = 0x0100002A, + Furniture43 = 0x0100002B, + Furniture44 = 0x0100002C, + Furniture45 = 0x0100002D, + Furniture46 = 0x0100002E, + Furniture47 = 0x0100002F, + Furniture48 = 0x01000030, + Furniture49 = 0x01000031, + Furniture50 = 0x01000032, + Furniture51 = 0x01000033, + Furniture52 = 0x01000034, + Furniture53 = 0x01000035, + Furniture54 = 0x01000036, + Furniture55 = 0x01000037, + Furniture56 = 0x01000038, + Furniture57 = 0x01000039, + Furniture58 = 0x0100003A, + Furniture59 = 0x0100003B, + Furniture60 = 0x0100003C, + Furniture61 = 0x0100003D, + Furniture62 = 0x0100003E, + Furniture63 = 0x0100003F, + Furniture64 = 0x01000040, + Furniture65 = 0x01000041, + Furniture66 = 0x01000042, + Furniture67 = 0x01000043, + Furniture68 = 0x01000044, + Furniture69 = 0x01000045, + Furniture70 = 0x01000046, + Furniture71 = 0x01000047, + Furniture72 = 0x01000048, + Furniture73 = 0x01000049, + Furniture74 = 0x0100004A, + Furniture75 = 0x0100004B, + Furniture76 = 0x0100004C, + Furniture77 = 0x0100004D, + Furniture78 = 0x0100004E, + Furniture79 = 0x0100004F, + Furniture80 = 0x01000050, + Furniture81 = 0x01000051, + Furniture82 = 0x01000052, + Furniture83 = 0x01000053, + Furniture84 = 0x01000054, + Furniture85 = 0x01000055, + Furniture86 = 0x01000056, + Furniture87 = 0x01000057, + Furniture88 = 0x01000058, + Furniture89 = 0x01000059, + Furniture90 = 0x0100005A, + Furniture91 = 0x0100005B, + Furniture92 = 0x0100005C, + Furniture93 = 0x0100005D, + Furniture94 = 0x0100005E, + Furniture95 = 0x0100005F, + Furniture96 = 0x01000060, + Furniture97 = 0x01000061, + Furniture98 = 0x01000062, + Furniture99 = 0x01000063, + Furniture100 = 0x01000064, + Furniture101 = 0x01000065, + Furniture102 = 0x01000066, + Furniture103 = 0x01000067, + Furniture104 = 0x01000068, + Furniture105 = 0x01000069, + Furniture106 = 0x0100006A, + Furniture107 = 0x0100006B, + Furniture108 = 0x0100006C, + Furniture109 = 0x0100006D, + Furniture110 = 0x0100006E, + Furniture111 = 0x0100006F, + Furniture112 = 0x01000070, + Furniture113 = 0x01000071, + Furniture114 = 0x01000072, + Furniture115 = 0x01000073, + Furniture116 = 0x01000074, + Furniture117 = 0x01000075, + Furniture118 = 0x01000076, + Furniture119 = 0x01000077, + Furniture120 = 0x01000078, + Furniture121 = 0x01000079, + Furniture122 = 0x0100007A, + Furniture123 = 0x0100007B, + Furniture124 = 0x0100007C, + Furniture125 = 0x0100007D, + Furniture126 = 0x0100007E, + Furniture127 = 0x0100007F, + Furniture128 = 0x01000080, + + /*### Wearable ###*/ + Wearable1 = 0x01100001, + Wearable2 = 0x01100002, + Wearable3 = 0x01100003, + Wearable4 = 0x01100004, + Wearable5 = 0x01100005, + Wearable6 = 0x01100006, + Wearable7 = 0x01100007, + Wearable8 = 0x01100008, + Wearable9 = 0x01100009, + Wearable10 = 0x0110000A, + Wearable11 = 0x0110000B, + Wearable12 = 0x0110000C, + Wearable13 = 0x0110000D, + Wearable14 = 0x0110000E, + Wearable15 = 0x0110000F, + Wearable16 = 0x01100010, + Wearable17 = 0x01100011, + Wearable18 = 0x01100012, + Wearable19 = 0x01100013, + Wearable20 = 0x01100014, + Wearable21 = 0x01100015, + Wearable22 = 0x01100016, + Wearable23 = 0x01100017, + Wearable24 = 0x01100018, + Wearable25 = 0x01100019, + Wearable26 = 0x0110001A, + Wearable27 = 0x0110001B, + Wearable28 = 0x0110001C, + Wearable29 = 0x0110001D, + Wearable30 = 0x0110001E, + Wearable31 = 0x0110001F, + Wearable32 = 0x01100020, + Wearable33 = 0x01100021, + Wearable34 = 0x01100022, + Wearable35 = 0x01100023, + Wearable36 = 0x01100024, + Wearable37 = 0x01100025, + Wearable38 = 0x01100026, + Wearable39 = 0x01100027, + Wearable40 = 0x01100028, + Wearable41 = 0x01100029, + Wearable42 = 0x0110002A, + Wearable43 = 0x0110002B, + Wearable44 = 0x0110002C, + Wearable45 = 0x0110002D, + Wearable46 = 0x0110002E, + Wearable47 = 0x0110002F, + Wearable48 = 0x01100030, + Wearable49 = 0x01100031, + Wearable50 = 0x01100032, + Wearable51 = 0x01100033, + Wearable52 = 0x01100034, + Wearable53 = 0x01100035, + Wearable54 = 0x01100036, + Wearable55 = 0x01100037, + Wearable56 = 0x01100038, + Wearable57 = 0x01100039, + Wearable58 = 0x0110003A, + Wearable59 = 0x0110003B, + Wearable60 = 0x0110003C, + Wearable61 = 0x0110003D, + Wearable62 = 0x0110003E, + Wearable63 = 0x0110003F, + Wearable64 = 0x01100040, + Wearable65 = 0x01100041, + Wearable66 = 0x01100042, + Wearable67 = 0x01100043, + Wearable68 = 0x01100044, + Wearable69 = 0x01100045, + Wearable70 = 0x01100046, + Wearable71 = 0x01100047, + Wearable72 = 0x01100048, + Wearable73 = 0x01100049, + Wearable74 = 0x0110004A, + Wearable75 = 0x0110004B, + Wearable76 = 0x0110004C, + Wearable77 = 0x0110004D, + Wearable78 = 0x0110004E, + Wearable79 = 0x0110004F, + Wearable80 = 0x01100050, + Wearable81 = 0x01100051, + Wearable82 = 0x01100052, + Wearable83 = 0x01100053, + Wearable84 = 0x01100054, + Wearable85 = 0x01100055, + Wearable86 = 0x01100056, + Wearable87 = 0x01100057, + Wearable88 = 0x01100058, + Wearable89 = 0x01100059, + Wearable90 = 0x0110005A, + Wearable91 = 0x0110005B, + Wearable92 = 0x0110005C, + Wearable93 = 0x0110005D, + Wearable94 = 0x0110005E, + Wearable95 = 0x0110005F, + Wearable96 = 0x01100060, + Wearable97 = 0x01100061, + Wearable98 = 0x01100062, + Wearable99 = 0x01100063, + Wearable100 = 0x01100064, + Wearable101 = 0x01100065, + Wearable102 = 0x01100066, + Wearable103 = 0x01100067, + Wearable104 = 0x01100068, + Wearable105 = 0x01100069, + Wearable106 = 0x0110006A, + Wearable107 = 0x0110006B, + Wearable108 = 0x0110006C, + Wearable109 = 0x0110006D, + Wearable110 = 0x0110006E, + Wearable111 = 0x0110006F, + Wearable112 = 0x01100070, + Wearable113 = 0x01100071, + Wearable114 = 0x01100072, + Wearable115 = 0x01100073, + Wearable116 = 0x01100074, + Wearable117 = 0x01100075, + Wearable118 = 0x01100076, + Wearable119 = 0x01100077, + Wearable120 = 0x01100078, + Wearable121 = 0x01100079, + Wearable122 = 0x0110007A, + Wearable123 = 0x0110007B, + Wearable124 = 0x0110007C, + Wearable125 = 0x0110007D, + Wearable126 = 0x0110007E, + Wearable127 = 0x0110007F, + Wearable128 = 0x01100080, + + /*### Wearable ###*/ + Art1 = 0x01200001, + Art2 = 0x01200002, + Art3 = 0x01200003, + Art4 = 0x01200004, + Art5 = 0x01200005, + Art6 = 0x01200006, + Art7 = 0x01200007, + Art8 = 0x01200008, + Art9 = 0x01200009, + Art10 = 0x0120000A, + Art11 = 0x0120000B, + Art12 = 0x0120000C, + Art13 = 0x0120000D, + Art14 = 0x0120000E, + Art15 = 0x0120000F, + Art16 = 0x01200010, + Art17 = 0x01200011, + Art18 = 0x01200012, + Art19 = 0x01200013, + Art20 = 0x01200014, + Art21 = 0x01200015, + Art22 = 0x01200016, + Art23 = 0x01200017, + Art24 = 0x01200018, + Art25 = 0x01200019, + Art26 = 0x0120001A, + Art27 = 0x0120001B, + Art28 = 0x0120001C, + Art29 = 0x0120001D, + Art30 = 0x0120001E, + Art31 = 0x0120001F, + Art32 = 0x01200020, + Art33 = 0x01200021, + Art34 = 0x01200022, + Art35 = 0x01200023, + Art36 = 0x01200024, + Art37 = 0x01200025, + Art38 = 0x01200026, + Art39 = 0x01200027, + Art40 = 0x01200028, + Art41 = 0x01200029, + Art42 = 0x0120002A, + Art43 = 0x0120002B, + Art44 = 0x0120002C, + Art45 = 0x0120002D, + Art46 = 0x0120002E, + Art47 = 0x0120002F, + Art48 = 0x01200030, + Art49 = 0x01200031, + Art50 = 0x01200032, + Art51 = 0x01200033, + Art52 = 0x01200034, + Art53 = 0x01200035, + Art54 = 0x01200036, + Art55 = 0x01200037, + Art56 = 0x01200038, + Art57 = 0x01200039, + Art58 = 0x0120003A, + Art59 = 0x0120003B, + Art60 = 0x0120003C, + Art61 = 0x0120003D, + Art62 = 0x0120003E, + Art63 = 0x0120003F, + Art64 = 0x01200040, + Art65 = 0x01200041, + Art66 = 0x01200042, + Art67 = 0x01200043, + Art68 = 0x01200044, + Art69 = 0x01200045, + Art70 = 0x01200046, + Art71 = 0x01200047, + Art72 = 0x01200048, + Art73 = 0x01200049, + Art74 = 0x0120004A, + Art75 = 0x0120004B, + Art76 = 0x0120004C, + Art77 = 0x0120004D, + Art78 = 0x0120004E, + Art79 = 0x0120004F, + Art80 = 0x01200050, + Art81 = 0x01200051, + Art82 = 0x01200052, + Art83 = 0x01200053, + Art84 = 0x01200054, + Art85 = 0x01200055, + Art86 = 0x01200056, + Art87 = 0x01200057, + Art88 = 0x01200058, + Art89 = 0x01200059, + Art90 = 0x0120005A, + Art91 = 0x0120005B, + Art92 = 0x0120005C, + Art93 = 0x0120005D, + Art94 = 0x0120005E, + Art95 = 0x0120005F, + Art96 = 0x01200060, + Art97 = 0x01200061, + Art98 = 0x01200062, + Art99 = 0x01200063, + Art100 = 0x01200064, + Art101 = 0x01200065, + Art102 = 0x01200066, + Art103 = 0x01200067, + Art104 = 0x01200068, + Art105 = 0x01200069, + Art106 = 0x0120006A, + Art107 = 0x0120006B, + Art108 = 0x0120006C, + Art109 = 0x0120006D, + Art110 = 0x0120006E, + Art111 = 0x0120006F, + Art112 = 0x01200070, + Art113 = 0x01200071, + Art114 = 0x01200072, + Art115 = 0x01200073, + Art116 = 0x01200074, + Art117 = 0x01200075, + Art118 = 0x01200076, + Art119 = 0x01200077, + Art120 = 0x01200078, + Art121 = 0x01200079, + Art122 = 0x0120007A, + Art123 = 0x0120007B, + Art124 = 0x0120007C, + Art125 = 0x0120007D, + Art126 = 0x0120007E, + Art127 = 0x0120007F, + Art128 = 0x01200080, + /*### Custom ###*/ Custom1 = 0x0FE00001, Custom2 = 0x0FE00002, diff --git a/RGB.NET.Devices.DynamicLighting/Art/DynamicLightingArtRGBDevice.cs b/RGB.NET.Devices.DynamicLighting/Art/DynamicLightingArtRGBDevice.cs new file mode 100644 index 0000000..04fbdc7 --- /dev/null +++ b/RGB.NET.Devices.DynamicLighting/Art/DynamicLightingArtRGBDevice.cs @@ -0,0 +1,34 @@ +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedMember.Global + +using RGB.NET.Core; + +namespace RGB.NET.Devices.DynamicLighting; + +/// +/// +/// Represents a Dynamic Lighting Art-device. +/// +public sealed class DynamicLightingArtRGBDevice : DynamicLightingRGBDevice, IArt +{ + #region Properties & Fields + + /// + protected override LedId ReferenceLedId => LedId.Art1; + + #endregion + + #region Constructors + + /// + /// + /// Initializes a new instance of the class. + /// + /// The meta data for this device. + /// The queue used to update this device. + internal DynamicLightingArtRGBDevice(DynamicLightingArtRGBDeviceInfo info, DynamicLightingDeviceUpdateQueue updateQueue) + : base(info, updateQueue) + { } + + #endregion +} \ No newline at end of file diff --git a/RGB.NET.Devices.DynamicLighting/Art/DynamicLightingArtRGBDeviceInfo.cs b/RGB.NET.Devices.DynamicLighting/Art/DynamicLightingArtRGBDeviceInfo.cs new file mode 100644 index 0000000..5ee84c3 --- /dev/null +++ b/RGB.NET.Devices.DynamicLighting/Art/DynamicLightingArtRGBDeviceInfo.cs @@ -0,0 +1,19 @@ +using RGB.NET.Core; + +namespace RGB.NET.Devices.DynamicLighting; + +/// +/// +/// Represents a generic information for a . +/// +public sealed class DynamicLightingArtRGBDeviceInfo : DynamicLightingRGBDeviceInfo +{ + #region Constructors + + /// + internal DynamicLightingArtRGBDeviceInfo(LampArrayInfo lampArrayInfo) + : base(RGBDeviceType.Art, lampArrayInfo) + { } + + #endregion +} \ No newline at end of file diff --git a/RGB.NET.Devices.DynamicLighting/Chassis/DynamicLightingChassisRGBDevice.cs b/RGB.NET.Devices.DynamicLighting/Chassis/DynamicLightingChassisRGBDevice.cs new file mode 100644 index 0000000..3502538 --- /dev/null +++ b/RGB.NET.Devices.DynamicLighting/Chassis/DynamicLightingChassisRGBDevice.cs @@ -0,0 +1,34 @@ +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedMember.Global + +using RGB.NET.Core; + +namespace RGB.NET.Devices.DynamicLighting; + +/// +/// +/// Represents a Dynamic Lighting Chassis-device. +/// +public sealed class DynamicLightingChassisRGBDevice : DynamicLightingRGBDevice, IChassis +{ + #region Properties & Fields + + /// + protected override LedId ReferenceLedId => LedId.Chassis1; + + #endregion + + #region Constructors + + /// + /// + /// Initializes a new instance of the class. + /// + /// The meta data for this device. + /// The queue used to update this device. + internal DynamicLightingChassisRGBDevice(DynamicLightingChassisRGBDeviceInfo info, DynamicLightingDeviceUpdateQueue updateQueue) + : base(info, updateQueue) + { } + + #endregion +} \ No newline at end of file diff --git a/RGB.NET.Devices.DynamicLighting/Chassis/DynamicLightingChassisRGBDeviceInfo.cs b/RGB.NET.Devices.DynamicLighting/Chassis/DynamicLightingChassisRGBDeviceInfo.cs new file mode 100644 index 0000000..daeacc4 --- /dev/null +++ b/RGB.NET.Devices.DynamicLighting/Chassis/DynamicLightingChassisRGBDeviceInfo.cs @@ -0,0 +1,19 @@ +using RGB.NET.Core; + +namespace RGB.NET.Devices.DynamicLighting; + +/// +/// +/// Represents a generic information for a . +/// +public sealed class DynamicLightingChassisRGBDeviceInfo : DynamicLightingRGBDeviceInfo +{ + #region Constructors + + /// + internal DynamicLightingChassisRGBDeviceInfo(LampArrayInfo lampArrayInfo) + : base(RGBDeviceType.Chassis, lampArrayInfo) + { } + + #endregion +} \ No newline at end of file diff --git a/RGB.NET.Devices.DynamicLighting/DynamicLightingDeviceProvider.cs b/RGB.NET.Devices.DynamicLighting/DynamicLightingDeviceProvider.cs new file mode 100644 index 0000000..6e50b83 --- /dev/null +++ b/RGB.NET.Devices.DynamicLighting/DynamicLightingDeviceProvider.cs @@ -0,0 +1,136 @@ +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedMember.Global + +using System; +using System.Collections.Generic; +using System.Threading; +using RGB.NET.Core; +using Windows.Devices.Enumeration; +using Windows.Devices.Lights; + +namespace RGB.NET.Devices.DynamicLighting; + +internal record LampArrayInfo(string Id, string DisplayName, LampArray LampArray); + +/// +/// +/// Represents a device provider responsible for Microsoft Dynamic Lighting devices. +/// +public sealed class DynamicLightingDeviceProvider : AbstractRGBDeviceProvider +{ + #region Properties & Fields + + // ReSharper disable once InconsistentNaming + private static readonly object _lock = new(); + + private static DynamicLightingDeviceProvider? _instance; + /// + /// Gets the singleton instance. + /// + public static DynamicLightingDeviceProvider Instance + { + get + { + lock (_lock) + return _instance ?? new DynamicLightingDeviceProvider(); + } + } + + #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 DynamicLightingDeviceProvider() + { + lock (_lock) + { + if (_instance != null) throw new InvalidOperationException($"There can be only one instance of type {nameof(DynamicLightingDeviceProvider)}"); + _instance = this; + } + } + + #endregion + + #region Methods + + /// + protected override void InitializeSDK() { } + + /// + protected override IEnumerable LoadDevices() + { + ManualResetEventSlim waitEvent = new(false); + List lampArrays = []; + + DeviceWatcher? watcher = DeviceInformation.CreateWatcher(LampArray.GetDeviceSelector()); + watcher.EnumerationCompleted += OnEnumerationCompleted; + watcher.Added += OnDeviceAdded; + watcher.Start(); + + waitEvent.Wait(); + + watcher.Stop(); + watcher.EnumerationCompleted -= OnEnumerationCompleted; + watcher.Added -= OnDeviceAdded; + + int updateTriggerId = 0; + + foreach (LampArrayInfo lampArrayInfo in lampArrays) + { + IDynamicLightingRGBDevice? device = null; + try + { + device = CreateDevice(lampArrayInfo); + device.Initialize(); + } + catch (Exception ex) { Throw(ex); } + + if (device != null) + yield return device; + } + + yield break; + + IDynamicLightingRGBDevice CreateDevice(LampArrayInfo lampArrayInfo) + => lampArrayInfo.LampArray.LampArrayKind switch + { + LampArrayKind.Undefined => new DynamicLightingUndefinedRGBDevice(new DynamicLightingUndefinedRGBDeviceInfo(lampArrayInfo), new DynamicLightingDeviceUpdateQueue(GetUpdateTrigger(updateTriggerId++, lampArrayInfo.LampArray.MinUpdateInterval.TotalSeconds), lampArrayInfo.LampArray)), + LampArrayKind.Keyboard => new DynamicLightingKeyboardRGBDevice(new DynamicLightingKeyboardRGBDeviceInfo(lampArrayInfo), new DynamicLightingDeviceUpdateQueue(GetUpdateTrigger(updateTriggerId++, lampArrayInfo.LampArray.MinUpdateInterval.TotalSeconds), lampArrayInfo.LampArray)), + LampArrayKind.Mouse => new DynamicLightingMouseRGBDevice(new DynamicLightingMouseRGBDeviceInfo(lampArrayInfo), new DynamicLightingDeviceUpdateQueue(GetUpdateTrigger(updateTriggerId++, lampArrayInfo.LampArray.MinUpdateInterval.TotalSeconds), lampArrayInfo.LampArray)), + LampArrayKind.GameController => new DynamicLightingGameControllerRGBDevice(new DynamicLightingGameControllerRGBDeviceInfo(lampArrayInfo), new DynamicLightingDeviceUpdateQueue(GetUpdateTrigger(updateTriggerId++, lampArrayInfo.LampArray.MinUpdateInterval.TotalSeconds), lampArrayInfo.LampArray)), + LampArrayKind.Peripheral => new DynamicLightingPeripheralRGBDevice(new DynamicLightingPeripheralRGBDeviceInfo(lampArrayInfo), new DynamicLightingDeviceUpdateQueue(GetUpdateTrigger(updateTriggerId++, lampArrayInfo.LampArray.MinUpdateInterval.TotalSeconds), lampArrayInfo.LampArray)), + LampArrayKind.Scene => new DynamicLightingSceneRGBDevice(new DynamicLightingSceneRGBDeviceInfo(lampArrayInfo), new DynamicLightingDeviceUpdateQueue(GetUpdateTrigger(updateTriggerId++, lampArrayInfo.LampArray.MinUpdateInterval.TotalSeconds), lampArrayInfo.LampArray)), + LampArrayKind.Notification => new DynamicLightingNotificationRGBDevice(new DynamicLightingNotificationRGBDeviceInfo(lampArrayInfo), new DynamicLightingDeviceUpdateQueue(GetUpdateTrigger(updateTriggerId++, lampArrayInfo.LampArray.MinUpdateInterval.TotalSeconds), lampArrayInfo.LampArray)), + LampArrayKind.Chassis => new DynamicLightingChassisRGBDevice(new DynamicLightingChassisRGBDeviceInfo(lampArrayInfo), new DynamicLightingDeviceUpdateQueue(GetUpdateTrigger(updateTriggerId++, lampArrayInfo.LampArray.MinUpdateInterval.TotalSeconds), lampArrayInfo.LampArray)), + LampArrayKind.Wearable => new DynamicLightingWearableRGBDevice(new DynamicLightingWearableRGBDeviceInfo(lampArrayInfo), new DynamicLightingDeviceUpdateQueue(GetUpdateTrigger(updateTriggerId++, lampArrayInfo.LampArray.MinUpdateInterval.TotalSeconds), lampArrayInfo.LampArray)), + LampArrayKind.Furniture => new DynamicLightingFurnitureRGBDevice(new DynamicLightingFurnitureRGBDeviceInfo(lampArrayInfo), new DynamicLightingDeviceUpdateQueue(GetUpdateTrigger(updateTriggerId++, lampArrayInfo.LampArray.MinUpdateInterval.TotalSeconds), lampArrayInfo.LampArray)), + LampArrayKind.Art => new DynamicLightingArtRGBDevice(new DynamicLightingArtRGBDeviceInfo(lampArrayInfo), new DynamicLightingDeviceUpdateQueue(GetUpdateTrigger(updateTriggerId++, lampArrayInfo.LampArray.MinUpdateInterval.TotalSeconds), lampArrayInfo.LampArray)), + _ => throw new ArgumentOutOfRangeException() + }; + + void OnEnumerationCompleted(DeviceWatcher sender, object o) => waitEvent.Set(); + + void OnDeviceAdded(DeviceWatcher sender, DeviceInformation args) + { + try { lampArrays.Add(new LampArrayInfo(args.Id, args.Name, LampArray.FromIdAsync(args.Id).GetAwaiter().GetResult())); } + catch (Exception ex) { Throw(ex); } + } + } + + /// + protected override void Dispose(bool disposing) + { + lock (_lock) + { + base.Dispose(disposing); + + _instance = null; + } + } + + #endregion +} \ No newline at end of file diff --git a/RGB.NET.Devices.DynamicLighting/Furniture/DynamicLightingFurnitureRGBDevice.cs b/RGB.NET.Devices.DynamicLighting/Furniture/DynamicLightingFurnitureRGBDevice.cs new file mode 100644 index 0000000..d413644 --- /dev/null +++ b/RGB.NET.Devices.DynamicLighting/Furniture/DynamicLightingFurnitureRGBDevice.cs @@ -0,0 +1,34 @@ +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedMember.Global + +using RGB.NET.Core; + +namespace RGB.NET.Devices.DynamicLighting; + +/// +/// +/// Represents a Dynamic Lighting Furniture-device. +/// +public sealed class DynamicLightingFurnitureRGBDevice : DynamicLightingRGBDevice, IFurniture +{ + #region Properties & Fields + + /// + protected override LedId ReferenceLedId => LedId.Furniture1; + + #endregion + + #region Constructors + + /// + /// + /// Initializes a new instance of the class. + /// + /// The meta data for this device. + /// The queue used to update this device. + internal DynamicLightingFurnitureRGBDevice(DynamicLightingFurnitureRGBDeviceInfo info, DynamicLightingDeviceUpdateQueue updateQueue) + : base(info, updateQueue) + { } + + #endregion +} \ No newline at end of file diff --git a/RGB.NET.Devices.DynamicLighting/Furniture/DynamicLightingFurnitureRGBDeviceInfo.cs b/RGB.NET.Devices.DynamicLighting/Furniture/DynamicLightingFurnitureRGBDeviceInfo.cs new file mode 100644 index 0000000..0b8fa49 --- /dev/null +++ b/RGB.NET.Devices.DynamicLighting/Furniture/DynamicLightingFurnitureRGBDeviceInfo.cs @@ -0,0 +1,19 @@ +using RGB.NET.Core; + +namespace RGB.NET.Devices.DynamicLighting; + +/// +/// +/// Represents a generic information for a . +/// +public sealed class DynamicLightingFurnitureRGBDeviceInfo : DynamicLightingRGBDeviceInfo +{ + #region Constructors + + /// + internal DynamicLightingFurnitureRGBDeviceInfo(LampArrayInfo lampArrayInfo) + : base(RGBDeviceType.Furniture, lampArrayInfo) + { } + + #endregion +} \ No newline at end of file diff --git a/RGB.NET.Devices.DynamicLighting/GameController/DynamicLightingGameControllerRGBDevice.cs b/RGB.NET.Devices.DynamicLighting/GameController/DynamicLightingGameControllerRGBDevice.cs new file mode 100644 index 0000000..dbc7615 --- /dev/null +++ b/RGB.NET.Devices.DynamicLighting/GameController/DynamicLightingGameControllerRGBDevice.cs @@ -0,0 +1,34 @@ +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedMember.Global + +using RGB.NET.Core; + +namespace RGB.NET.Devices.DynamicLighting; + +/// +/// +/// Represents a Dynamic Lighting GameController-device. +/// +public sealed class DynamicLightingGameControllerRGBDevice : DynamicLightingRGBDevice, IGameController +{ + #region Properties & Fields + + /// + protected override LedId ReferenceLedId => LedId.GameController1; + + #endregion + + #region Constructors + + /// + /// + /// Initializes a new instance of the class. + /// + /// The meta data for this device. + /// The queue used to update this device. + internal DynamicLightingGameControllerRGBDevice(DynamicLightingGameControllerRGBDeviceInfo info, DynamicLightingDeviceUpdateQueue updateQueue) + : base(info, updateQueue) + { } + + #endregion +} \ No newline at end of file diff --git a/RGB.NET.Devices.DynamicLighting/GameController/DynamicLightingGameControllerRGBDeviceInfo.cs b/RGB.NET.Devices.DynamicLighting/GameController/DynamicLightingGameControllerRGBDeviceInfo.cs new file mode 100644 index 0000000..3eb1d93 --- /dev/null +++ b/RGB.NET.Devices.DynamicLighting/GameController/DynamicLightingGameControllerRGBDeviceInfo.cs @@ -0,0 +1,19 @@ +using RGB.NET.Core; + +namespace RGB.NET.Devices.DynamicLighting; + +/// +/// +/// Represents a generic information for a . +/// +public sealed class DynamicLightingGameControllerRGBDeviceInfo : DynamicLightingRGBDeviceInfo +{ + #region Constructors + + /// + internal DynamicLightingGameControllerRGBDeviceInfo(LampArrayInfo lampArrayInfo) + : base(RGBDeviceType.GameController, lampArrayInfo) + { } + + #endregion +} \ No newline at end of file diff --git a/RGB.NET.Devices.DynamicLighting/Generic/DynamicLightingDeviceUpdateQueue.cs b/RGB.NET.Devices.DynamicLighting/Generic/DynamicLightingDeviceUpdateQueue.cs new file mode 100644 index 0000000..56510b3 --- /dev/null +++ b/RGB.NET.Devices.DynamicLighting/Generic/DynamicLightingDeviceUpdateQueue.cs @@ -0,0 +1,81 @@ +using System; +using Windows.Devices.Lights; +using RGB.NET.Core; +using System.Linq; + +namespace RGB.NET.Devices.DynamicLighting; + +/// +/// +/// Represents the update-queue performing updates for dynamic lightning devices. +/// +public sealed class DynamicLightingDeviceUpdateQueue : UpdateQueue +{ + #region Properties & Fields + + private bool _isDisposed = false; + + private readonly LampArray _lampArray; + private readonly int[] _indices; + private readonly Windows.UI.Color[] _colors; + + #endregion + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + /// The update trigger used by this queue. + /// The lamp array to update. + internal DynamicLightingDeviceUpdateQueue(IDeviceUpdateTrigger updateTrigger, LampArray lampArray) + : base(updateTrigger) + { + this._lampArray = lampArray; + + _colors = new Windows.UI.Color[lampArray.LampCount]; + _indices = Enumerable.Range(0, lampArray.LampCount).ToArray(); + } + + #endregion + + #region Methods + + /// + protected override bool Update(in ReadOnlySpan<(object key, Color color)> dataSet) + { + try + { + if (_isDisposed) throw new ObjectDisposedException(nameof(DynamicLightingDeviceUpdateQueue)); + if (!_lampArray.IsConnected) return false; + + // ReSharper disable once ForCanBeConvertedToForeach - Prevent a possible allocation of an enumerator + for (int i = 0; i < dataSet.Length; i++) + { + (object key, Color color) = dataSet[i]; + (byte a, byte r, byte g, byte b) = color.GetRGBBytes(); + _colors[(int)key] = Windows.UI.Color.FromArgb(a, r, g, b); + } + + _lampArray.SetColorsForIndices(_colors, _indices); + + return true; + } + catch (Exception ex) + { + DynamicLightingDeviceProvider.Instance.Throw(ex); + } + + return false; + } + + /// + public override void Dispose() + { + base.Dispose(); + + _isDisposed = true; + } + + #endregion +} \ No newline at end of file diff --git a/RGB.NET.Devices.DynamicLighting/Generic/DynamicLightingRGBDevice.cs b/RGB.NET.Devices.DynamicLighting/Generic/DynamicLightingRGBDevice.cs new file mode 100644 index 0000000..c7c4db6 --- /dev/null +++ b/RGB.NET.Devices.DynamicLighting/Generic/DynamicLightingRGBDevice.cs @@ -0,0 +1,79 @@ +using Windows.Devices.Lights; +using RGB.NET.Core; + +namespace RGB.NET.Devices.DynamicLighting; + +/// +/// +/// Represents a generic Dynamic Lighting-device. +/// +public abstract class DynamicLightingRGBDevice : AbstractRGBDevice, IDynamicLightingRGBDevice + where TDeviceInfo : DynamicLightingRGBDeviceInfo +{ + #region Properties & Fields + + /// + /// Gets the mapping of to the index of the led used to update the LEDs of this device. + /// + protected LedMapping Mapping { get; private set; } = []; + + /// + /// Gets the reference led id. + /// + protected abstract LedId ReferenceLedId { get; } + + #endregion + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + /// The meta data for this device. + /// The queue used to update this device. + protected DynamicLightingRGBDevice(TDeviceInfo info, DynamicLightingDeviceUpdateQueue updateQueue) + : base(info, updateQueue) { } + + #endregion + + #region Methods + + void IDynamicLightingRGBDevice.Initialize() + { + Mapping = CreateMapping(); + InitializeLayout(); + } + + /// + /// Initializes the LEDs of the device based on the data provided by the SDK. + /// + protected virtual void InitializeLayout() + { + for (int i = 0; i < DeviceInfo.LedCount; i++) + { + LampInfo lampInfo = DeviceInfo.LampArray.GetLampInfo(i); + + LedId ledId = Mapping.TryGetValue(i, out LedId id) ? id : LedId.Invalid; + Rectangle rectangle = new(new Point(lampInfo.Position.X, lampInfo.Position.Y), new Size(10, 10)); + AddLed(ledId, rectangle.Location, rectangle.Size); + } + } + + /// + /// Creates a mapping for this device. + /// + /// The mapping. + protected virtual LedMapping CreateMapping() + { + LedMapping mapping = []; + for (int i = 0; i < DeviceInfo.LedCount; i++) + mapping.Add(ReferenceLedId + i, i); + + return mapping; + } + + /// + protected override object GetLedCustomData(LedId ledId) => Mapping.TryGetValue(ledId, out int index) ? index : 0; + + #endregion +} \ No newline at end of file diff --git a/RGB.NET.Devices.DynamicLighting/Generic/DynamicLightingRGBDeviceInfo.cs b/RGB.NET.Devices.DynamicLighting/Generic/DynamicLightingRGBDeviceInfo.cs new file mode 100644 index 0000000..28ac7d4 --- /dev/null +++ b/RGB.NET.Devices.DynamicLighting/Generic/DynamicLightingRGBDeviceInfo.cs @@ -0,0 +1,63 @@ +using Windows.Devices.Lights; +using RGB.NET.Core; + +namespace RGB.NET.Devices.DynamicLighting; + +/// +/// +/// Represents a generic information for a DynamicLighting-. +/// +public class DynamicLightingRGBDeviceInfo : IRGBDeviceInfo +{ + #region Properties & Fields + + /// + public RGBDeviceType DeviceType { get; } + + /// + public string DeviceName { get; } + + /// + public string Manufacturer => "Dynamic Lighting"; + + /// + public string Model { get; } + + /// + /// Returns the unique ID of the device + /// + public string DeviceId { get; } + + /// + public object? LayoutMetadata { get; set; } + + /// + /// Gets the amount of LEDs this device contains. + /// + public int LedCount { get; } + + internal LampArray LampArray { get; } + + #endregion + + #region Constructors + + /// + /// Internal constructor of managed . + /// + /// The type of the . + /// The low level information for this device. + internal DynamicLightingRGBDeviceInfo(RGBDeviceType deviceType, LampArrayInfo lampArrayInfo) + { + this.DeviceType = deviceType; + + LampArray = lampArrayInfo.LampArray; + DeviceId = lampArrayInfo.Id; + Model = lampArrayInfo.DisplayName; + LedCount = lampArrayInfo.LampArray.LampCount; + + DeviceName = DeviceHelper.CreateDeviceName(Manufacturer, Model); + } + + #endregion +} \ No newline at end of file diff --git a/RGB.NET.Devices.DynamicLighting/Generic/IDynamicLightingRGBDevice.cs b/RGB.NET.Devices.DynamicLighting/Generic/IDynamicLightingRGBDevice.cs new file mode 100644 index 0000000..dc26cb3 --- /dev/null +++ b/RGB.NET.Devices.DynamicLighting/Generic/IDynamicLightingRGBDevice.cs @@ -0,0 +1,11 @@ +using RGB.NET.Core; + +namespace RGB.NET.Devices.DynamicLighting; + +/// +/// Represents a DynamicLighting RGB-device. +/// +public interface IDynamicLightingRGBDevice : IRGBDevice +{ + internal void Initialize(); +} \ No newline at end of file diff --git a/RGB.NET.Devices.DynamicLighting/Generic/LedMapping.cs b/RGB.NET.Devices.DynamicLighting/Generic/LedMapping.cs new file mode 100644 index 0000000..d3fce9b --- /dev/null +++ b/RGB.NET.Devices.DynamicLighting/Generic/LedMapping.cs @@ -0,0 +1,102 @@ +using System.Collections.Generic; +using Windows.System; +using RGB.NET.Core; + +namespace RGB.NET.Devices.DynamicLighting; + +internal static class LedMappings +{ + public static Dictionary KeyboardMapping = new() + { + [VirtualKey.Back] = LedId.Keyboard_Backspace, + [VirtualKey.Tab] = LedId.Keyboard_Tab, + [VirtualKey.Enter] = LedId.Keyboard_Enter, + [VirtualKey.Pause] = LedId.Keyboard_PauseBreak, + [VirtualKey.CapitalLock] = LedId.Keyboard_CapsLock, + [VirtualKey.Escape] = LedId.Keyboard_Escape, + [VirtualKey.Space] = LedId.Keyboard_Space, + [VirtualKey.PageUp] = LedId.Keyboard_PageUp, + [VirtualKey.PageDown] = LedId.Keyboard_PageDown, + [VirtualKey.End] = LedId.Keyboard_End, + [VirtualKey.Home] = LedId.Keyboard_Home, + [VirtualKey.Left] = LedId.Keyboard_ArrowLeft, + [VirtualKey.Up] = LedId.Keyboard_ArrowUp, + [VirtualKey.Right] = LedId.Keyboard_ArrowRight, + [VirtualKey.Down] = LedId.Keyboard_ArrowDown, + [VirtualKey.Print] = LedId.Keyboard_PrintScreen, + [VirtualKey.Insert] = LedId.Keyboard_Insert, + [VirtualKey.Delete] = LedId.Keyboard_Delete, + [VirtualKey.Number0] = LedId.Keyboard_0, + [VirtualKey.Number1] = LedId.Keyboard_1, + [VirtualKey.Number2] = LedId.Keyboard_2, + [VirtualKey.Number3] = LedId.Keyboard_3, + [VirtualKey.Number4] = LedId.Keyboard_4, + [VirtualKey.Number5] = LedId.Keyboard_5, + [VirtualKey.Number6] = LedId.Keyboard_6, + [VirtualKey.Number7] = LedId.Keyboard_7, + [VirtualKey.Number8] = LedId.Keyboard_8, + [VirtualKey.Number9] = LedId.Keyboard_9, + [VirtualKey.A] = LedId.Keyboard_A, + [VirtualKey.B] = LedId.Keyboard_B, + [VirtualKey.C] = LedId.Keyboard_C, + [VirtualKey.D] = LedId.Keyboard_D, + [VirtualKey.E] = LedId.Keyboard_E, + [VirtualKey.F] = LedId.Keyboard_F, + [VirtualKey.G] = LedId.Keyboard_G, + [VirtualKey.H] = LedId.Keyboard_H, + [VirtualKey.I] = LedId.Keyboard_I, + [VirtualKey.J] = LedId.Keyboard_J, + [VirtualKey.K] = LedId.Keyboard_K, + [VirtualKey.L] = LedId.Keyboard_L, + [VirtualKey.M] = LedId.Keyboard_M, + [VirtualKey.N] = LedId.Keyboard_N, + [VirtualKey.O] = LedId.Keyboard_O, + [VirtualKey.P] = LedId.Keyboard_P, + [VirtualKey.Q] = LedId.Keyboard_Q, + [VirtualKey.R] = LedId.Keyboard_R, + [VirtualKey.S] = LedId.Keyboard_S, + [VirtualKey.T] = LedId.Keyboard_T, + [VirtualKey.U] = LedId.Keyboard_U, + [VirtualKey.V] = LedId.Keyboard_V, + [VirtualKey.W] = LedId.Keyboard_W, + [VirtualKey.X] = LedId.Keyboard_X, + [VirtualKey.Y] = LedId.Keyboard_Y, + [VirtualKey.Z] = LedId.Keyboard_Z, + [VirtualKey.LeftWindows] = LedId.Keyboard_LeftGui, + [VirtualKey.RightWindows] = LedId.Keyboard_RightGui, + [VirtualKey.Application] = LedId.Keyboard_Application, + [VirtualKey.NumberPad0] = LedId.Keyboard_Num0, + [VirtualKey.NumberPad1] = LedId.Keyboard_Num1, + [VirtualKey.NumberPad2] = LedId.Keyboard_Num2, + [VirtualKey.NumberPad3] = LedId.Keyboard_Num3, + [VirtualKey.NumberPad4] = LedId.Keyboard_Num4, + [VirtualKey.NumberPad5] = LedId.Keyboard_Num5, + [VirtualKey.NumberPad6] = LedId.Keyboard_Num6, + [VirtualKey.NumberPad7] = LedId.Keyboard_Num7, + [VirtualKey.NumberPad8] = LedId.Keyboard_Num8, + [VirtualKey.NumberPad9] = LedId.Keyboard_Num9, + [VirtualKey.Multiply] = LedId.Keyboard_NumAsterisk, + [VirtualKey.Add] = LedId.Keyboard_NumPlus, + [VirtualKey.Subtract] = LedId.Keyboard_NumMinus, + [VirtualKey.Decimal] = LedId.Keyboard_NumComma, + [VirtualKey.Divide] = LedId.Keyboard_NumSlash, + [VirtualKey.F1] = LedId.Keyboard_F1, + [VirtualKey.F2] = LedId.Keyboard_F2, + [VirtualKey.F3] = LedId.Keyboard_F3, + [VirtualKey.F4] = LedId.Keyboard_F4, + [VirtualKey.F5] = LedId.Keyboard_F5, + [VirtualKey.F6] = LedId.Keyboard_F6, + [VirtualKey.F7] = LedId.Keyboard_F7, + [VirtualKey.F8] = LedId.Keyboard_F8, + [VirtualKey.F9] = LedId.Keyboard_F9, + [VirtualKey.F10] = LedId.Keyboard_F10, + [VirtualKey.F11] = LedId.Keyboard_F11, + [VirtualKey.F12] = LedId.Keyboard_F12, + [VirtualKey.NumberKeyLock] = LedId.Keyboard_NumLock, + [VirtualKey.Scroll] = LedId.Keyboard_ScrollLock, + [VirtualKey.LeftShift] = LedId.Keyboard_LeftShift, + [VirtualKey.RightShift] = LedId.Keyboard_RightShift, + [VirtualKey.LeftControl] = LedId.Keyboard_LeftCtrl, + [VirtualKey.RightControl] = LedId.Keyboard_RightCtrl, + }; +} \ No newline at end of file diff --git a/RGB.NET.Devices.DynamicLighting/Keyboard/DynamicLightingKeyboardRGBDevice.cs b/RGB.NET.Devices.DynamicLighting/Keyboard/DynamicLightingKeyboardRGBDevice.cs new file mode 100644 index 0000000..9646c05 --- /dev/null +++ b/RGB.NET.Devices.DynamicLighting/Keyboard/DynamicLightingKeyboardRGBDevice.cs @@ -0,0 +1,73 @@ +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedMember.Global + +using System.Collections.Generic; +using System.Linq; +using Windows.System; +using RGB.NET.Core; + +namespace RGB.NET.Devices.DynamicLighting; + +/// +/// +/// Represents a Dynamic Lighting Keyboard-device. +/// +public sealed class DynamicLightingKeyboardRGBDevice : DynamicLightingRGBDevice, IKeyboard +{ + #region Properties & Fields + + /// + protected override LedId ReferenceLedId => LedId.Keyboard_Programmable1; + + IKeyboardDeviceInfo IKeyboard.DeviceInfo => DeviceInfo; + + #endregion + + #region Constructors + + /// + /// + /// Initializes a new instance of the class. + /// + /// The meta data for this device. + /// The queue used to update this device. + internal DynamicLightingKeyboardRGBDevice(DynamicLightingKeyboardRGBDeviceInfo info, DynamicLightingDeviceUpdateQueue updateQueue) + : base(info, updateQueue) + { } + + #endregion + + #region Methods + + /// + protected override LedMapping CreateMapping() + { + LedMapping ledMapping = []; + HashSet indices = Enumerable.Range(0, DeviceInfo.LedCount).ToHashSet(); + + if (DeviceInfo.LampArray.SupportsVirtualKeys) + { + foreach ((VirtualKey virtualKey, LedId ledId) in LedMappings.KeyboardMapping) + { + int[] virtualKeyIndices = DeviceInfo.LampArray.GetIndicesForKey(virtualKey); + if (virtualKeyIndices.Length > 0) + { + int? index = virtualKeyIndices.FirstOrDefault(indices.Contains); + if (index != null) + { + ledMapping.Add(ledId, index.Value); + indices.Remove(index.Value); + } + } + } + } + + LedId referenceLed = LedId.Keyboard_Custom1; + foreach (int index in indices.OrderBy(x => x)) + ledMapping.Add(referenceLed++, index); + + return ledMapping; + } + + #endregion +} \ No newline at end of file diff --git a/RGB.NET.Devices.DynamicLighting/Keyboard/DynamicLightingKeyboardRGBDeviceInfo.cs b/RGB.NET.Devices.DynamicLighting/Keyboard/DynamicLightingKeyboardRGBDeviceInfo.cs new file mode 100644 index 0000000..7c436a2 --- /dev/null +++ b/RGB.NET.Devices.DynamicLighting/Keyboard/DynamicLightingKeyboardRGBDeviceInfo.cs @@ -0,0 +1,26 @@ +using RGB.NET.Core; + +namespace RGB.NET.Devices.DynamicLighting; + +/// +/// +/// Represents a generic information for a . +/// +public sealed class DynamicLightingKeyboardRGBDeviceInfo : DynamicLightingRGBDeviceInfo, IKeyboardDeviceInfo +{ + #region Properties & Fields + + /// + public KeyboardLayoutType Layout => KeyboardLayoutType.Unknown; + + #endregion + + #region Constructors + + /// + internal DynamicLightingKeyboardRGBDeviceInfo(LampArrayInfo lampArrayInfo) + : base(RGBDeviceType.Keyboard, lampArrayInfo) + { } + + #endregion +} \ No newline at end of file diff --git a/RGB.NET.Devices.DynamicLighting/Mouse/DynamicLightingMouseRGBDevice.cs b/RGB.NET.Devices.DynamicLighting/Mouse/DynamicLightingMouseRGBDevice.cs new file mode 100644 index 0000000..304f760 --- /dev/null +++ b/RGB.NET.Devices.DynamicLighting/Mouse/DynamicLightingMouseRGBDevice.cs @@ -0,0 +1,34 @@ +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedMember.Global + +using RGB.NET.Core; + +namespace RGB.NET.Devices.DynamicLighting; + +/// +/// +/// Represents a Dynamic Lighting Mouse-device. +/// +public sealed class DynamicLightingMouseRGBDevice : DynamicLightingRGBDevice, IMouse +{ + #region Properties & Fields + + /// + protected override LedId ReferenceLedId => LedId.Mouse1; + + #endregion + + #region Constructors + + /// + /// + /// Initializes a new instance of the class. + /// + /// The meta data for this device. + /// The queue used to update this device. + internal DynamicLightingMouseRGBDevice(DynamicLightingMouseRGBDeviceInfo info, DynamicLightingDeviceUpdateQueue updateQueue) + : base(info, updateQueue) + { } + + #endregion +} \ No newline at end of file diff --git a/RGB.NET.Devices.DynamicLighting/Mouse/DynamicLightingMouseRGBDeviceInfo.cs b/RGB.NET.Devices.DynamicLighting/Mouse/DynamicLightingMouseRGBDeviceInfo.cs new file mode 100644 index 0000000..d1a861f --- /dev/null +++ b/RGB.NET.Devices.DynamicLighting/Mouse/DynamicLightingMouseRGBDeviceInfo.cs @@ -0,0 +1,19 @@ +using RGB.NET.Core; + +namespace RGB.NET.Devices.DynamicLighting; + +/// +/// +/// Represents a generic information for a . +/// +public sealed class DynamicLightingMouseRGBDeviceInfo : DynamicLightingRGBDeviceInfo +{ + #region Constructors + + /// + internal DynamicLightingMouseRGBDeviceInfo(LampArrayInfo lampArrayInfo) + : base(RGBDeviceType.Mouse, lampArrayInfo) + { } + + #endregion +} \ No newline at end of file diff --git a/RGB.NET.Devices.DynamicLighting/Notification/DynamicLightingNotificationRGBDevice.cs b/RGB.NET.Devices.DynamicLighting/Notification/DynamicLightingNotificationRGBDevice.cs new file mode 100644 index 0000000..00b8d7f --- /dev/null +++ b/RGB.NET.Devices.DynamicLighting/Notification/DynamicLightingNotificationRGBDevice.cs @@ -0,0 +1,34 @@ +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedMember.Global + +using RGB.NET.Core; + +namespace RGB.NET.Devices.DynamicLighting; + +/// +/// +/// Represents a Dynamic Lighting Notification-device. +/// +public sealed class DynamicLightingNotificationRGBDevice : DynamicLightingRGBDevice, IUnknownDevice +{ + #region Properties & Fields + + /// + protected override LedId ReferenceLedId => LedId.Unknown1; + + #endregion + + #region Constructors + + /// + /// + /// Initializes a new instance of the class. + /// + /// The meta data for this device. + /// The queue used to update this device. + internal DynamicLightingNotificationRGBDevice(DynamicLightingNotificationRGBDeviceInfo info, DynamicLightingDeviceUpdateQueue updateQueue) + : base(info, updateQueue) + { } + + #endregion +} \ No newline at end of file diff --git a/RGB.NET.Devices.DynamicLighting/Notification/DynamicLightingNotificationRGBDeviceInfo.cs b/RGB.NET.Devices.DynamicLighting/Notification/DynamicLightingNotificationRGBDeviceInfo.cs new file mode 100644 index 0000000..4d908e5 --- /dev/null +++ b/RGB.NET.Devices.DynamicLighting/Notification/DynamicLightingNotificationRGBDeviceInfo.cs @@ -0,0 +1,19 @@ +using RGB.NET.Core; + +namespace RGB.NET.Devices.DynamicLighting; + +/// +/// +/// Represents a generic information for a . +/// +public sealed class DynamicLightingNotificationRGBDeviceInfo : DynamicLightingRGBDeviceInfo +{ + #region Constructors + + /// + internal DynamicLightingNotificationRGBDeviceInfo(LampArrayInfo lampArrayInfo) + : base(RGBDeviceType.Unknown, lampArrayInfo) + { } + + #endregion +} \ No newline at end of file diff --git a/RGB.NET.Devices.DynamicLighting/Peripheral/DynamicLightingPeripheralRGBDevice.cs b/RGB.NET.Devices.DynamicLighting/Peripheral/DynamicLightingPeripheralRGBDevice.cs new file mode 100644 index 0000000..04b85b0 --- /dev/null +++ b/RGB.NET.Devices.DynamicLighting/Peripheral/DynamicLightingPeripheralRGBDevice.cs @@ -0,0 +1,34 @@ +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedMember.Global + +using RGB.NET.Core; + +namespace RGB.NET.Devices.DynamicLighting; + +/// +/// +/// Represents a Dynamic Lighting Peripheral-device. +/// +public sealed class DynamicLightingPeripheralRGBDevice : DynamicLightingRGBDevice, IUnknownDevice +{ + #region Properties & Fields + + /// + protected override LedId ReferenceLedId => LedId.Unknown1; + + #endregion + + #region Constructors + + /// + /// + /// Initializes a new instance of the class. + /// + /// The meta data for this device. + /// The queue used to update this device. + internal DynamicLightingPeripheralRGBDevice(DynamicLightingPeripheralRGBDeviceInfo info, DynamicLightingDeviceUpdateQueue updateQueue) + : base(info, updateQueue) + { } + + #endregion +} \ No newline at end of file diff --git a/RGB.NET.Devices.DynamicLighting/Peripheral/DynamicLightingPeripheralRGBDeviceInfo.cs b/RGB.NET.Devices.DynamicLighting/Peripheral/DynamicLightingPeripheralRGBDeviceInfo.cs new file mode 100644 index 0000000..5f05d83 --- /dev/null +++ b/RGB.NET.Devices.DynamicLighting/Peripheral/DynamicLightingPeripheralRGBDeviceInfo.cs @@ -0,0 +1,19 @@ +using RGB.NET.Core; + +namespace RGB.NET.Devices.DynamicLighting; + +/// +/// +/// Represents a generic information for a . +/// +public sealed class DynamicLightingPeripheralRGBDeviceInfo : DynamicLightingRGBDeviceInfo +{ + #region Constructors + + /// + internal DynamicLightingPeripheralRGBDeviceInfo(LampArrayInfo lampArrayInfo) + : base(RGBDeviceType.Unknown, lampArrayInfo) + { } + + #endregion +} \ No newline at end of file diff --git a/RGB.NET.Devices.DynamicLighting/README.md b/RGB.NET.Devices.DynamicLighting/README.md new file mode 100644 index 0000000..eea690e --- /dev/null +++ b/RGB.NET.Devices.DynamicLighting/README.md @@ -0,0 +1,9 @@ +[RGB.NET](https://github.com/DarthAffe/RGB.NET) Device-Provider-Package for Microsoft Dynamic Lighting-Devices. + +## Usage +This provider follows the default pattern and does not require additional setup. + +```csharp +surface.Load(DynamicLightingDeviceProvider.Instance); +``` + diff --git a/RGB.NET.Devices.DynamicLighting/RGB.NET.Devices.DynamicLighting.csproj b/RGB.NET.Devices.DynamicLighting/RGB.NET.Devices.DynamicLighting.csproj new file mode 100644 index 0000000..884a4c5 --- /dev/null +++ b/RGB.NET.Devices.DynamicLighting/RGB.NET.Devices.DynamicLighting.csproj @@ -0,0 +1,64 @@ + + + net8.0-windows10.0.17763.0;net7.0-windows10.0.17763.0 + 10.0.17763.0 + latest + enable + + Darth Affe + Wyrez + en-US + en-US + RGB.NET.Devices.DynamicLighting + RGB.NET.Devices.DynamicLighting + RGB.NET.Devices.DynamicLighting + RGB.NET.Devices.DynamicLighting + RGB.NET.Devices.DynamicLighting + Microsoft Dynamic Lighting-Device-Implementations of RGB.NET + Microsoft Dynamic Lighting-Device-Implementations of RGB.NET, a C# (.NET) library for accessing various RGB-peripherals + Copyright © Darth Affe 2024 + Copyright © Darth Affe 2024 + 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 + true + + + + TRACE;DEBUG + true + false + + + + true + $(NoWarn);CS1591;CS1572;CS1573 + RELEASE + + + + + + + + + + + \ No newline at end of file diff --git a/RGB.NET.Devices.DynamicLighting/RGB.NET.Devices.DynamicLighting.csproj.DotSettings b/RGB.NET.Devices.DynamicLighting/RGB.NET.Devices.DynamicLighting.csproj.DotSettings new file mode 100644 index 0000000..6ad9d4b --- /dev/null +++ b/RGB.NET.Devices.DynamicLighting/RGB.NET.Devices.DynamicLighting.csproj.DotSettings @@ -0,0 +1,13 @@ + + True + True + True + True + True + True + True + True + True + True + True + True \ No newline at end of file diff --git a/RGB.NET.Devices.DynamicLighting/Scene/DynamicLightingSceneRGBDevice.cs b/RGB.NET.Devices.DynamicLighting/Scene/DynamicLightingSceneRGBDevice.cs new file mode 100644 index 0000000..962f1c7 --- /dev/null +++ b/RGB.NET.Devices.DynamicLighting/Scene/DynamicLightingSceneRGBDevice.cs @@ -0,0 +1,34 @@ +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedMember.Global + +using RGB.NET.Core; + +namespace RGB.NET.Devices.DynamicLighting; + +/// +/// +/// Represents a Dynamic Lighting Scene-device. +/// +public sealed class DynamicLightingSceneRGBDevice : DynamicLightingRGBDevice, IUnknownDevice +{ + #region Properties & Fields + + /// + protected override LedId ReferenceLedId => LedId.Unknown1; + + #endregion + + #region Constructors + + /// + /// + /// Initializes a new instance of the class. + /// + /// The meta data for this device. + /// The queue used to update this device. + internal DynamicLightingSceneRGBDevice(DynamicLightingSceneRGBDeviceInfo info, DynamicLightingDeviceUpdateQueue updateQueue) + : base(info, updateQueue) + { } + + #endregion +} \ No newline at end of file diff --git a/RGB.NET.Devices.DynamicLighting/Scene/DynamicLightingSceneRGBDeviceInfo.cs b/RGB.NET.Devices.DynamicLighting/Scene/DynamicLightingSceneRGBDeviceInfo.cs new file mode 100644 index 0000000..27dbb87 --- /dev/null +++ b/RGB.NET.Devices.DynamicLighting/Scene/DynamicLightingSceneRGBDeviceInfo.cs @@ -0,0 +1,19 @@ +using RGB.NET.Core; + +namespace RGB.NET.Devices.DynamicLighting; + +/// +/// +/// Represents a generic information for a . +/// +public sealed class DynamicLightingSceneRGBDeviceInfo : DynamicLightingRGBDeviceInfo +{ + #region Constructors + + /// + internal DynamicLightingSceneRGBDeviceInfo(LampArrayInfo lampArrayInfo) + : base(RGBDeviceType.Unknown, lampArrayInfo) + { } + + #endregion +} \ No newline at end of file diff --git a/RGB.NET.Devices.DynamicLighting/Undefined/DynamicLightingUndefinedRGBDevice.cs b/RGB.NET.Devices.DynamicLighting/Undefined/DynamicLightingUndefinedRGBDevice.cs new file mode 100644 index 0000000..c5b15ce --- /dev/null +++ b/RGB.NET.Devices.DynamicLighting/Undefined/DynamicLightingUndefinedRGBDevice.cs @@ -0,0 +1,34 @@ +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedMember.Global + +using RGB.NET.Core; + +namespace RGB.NET.Devices.DynamicLighting; + +/// +/// +/// Represents a Dynamic Lighting Undefined-device. +/// +public sealed class DynamicLightingUndefinedRGBDevice : DynamicLightingRGBDevice, IUnknownDevice +{ + #region Properties & Fields + + /// + protected override LedId ReferenceLedId => LedId.Unknown1; + + #endregion + + #region Constructors + + /// + /// + /// Initializes a new instance of the class. + /// + /// The meta data for this device. + /// The queue used to update this device. + internal DynamicLightingUndefinedRGBDevice(DynamicLightingUndefinedRGBDeviceInfo info, DynamicLightingDeviceUpdateQueue updateQueue) + : base(info, updateQueue) + { } + + #endregion +} \ No newline at end of file diff --git a/RGB.NET.Devices.DynamicLighting/Undefined/DynamicLightingUndefinedRGBDeviceInfo.cs b/RGB.NET.Devices.DynamicLighting/Undefined/DynamicLightingUndefinedRGBDeviceInfo.cs new file mode 100644 index 0000000..ae92e8e --- /dev/null +++ b/RGB.NET.Devices.DynamicLighting/Undefined/DynamicLightingUndefinedRGBDeviceInfo.cs @@ -0,0 +1,19 @@ +using RGB.NET.Core; + +namespace RGB.NET.Devices.DynamicLighting; + +/// +/// +/// Represents a generic information for a . +/// +public sealed class DynamicLightingUndefinedRGBDeviceInfo : DynamicLightingRGBDeviceInfo +{ + #region Constructors + + /// + internal DynamicLightingUndefinedRGBDeviceInfo(LampArrayInfo lampArrayInfo) + : base(RGBDeviceType.Unknown, lampArrayInfo) + { } + + #endregion +} \ No newline at end of file diff --git a/RGB.NET.Devices.DynamicLighting/Wearable/DynamicLightingWearableRGBDevice.cs b/RGB.NET.Devices.DynamicLighting/Wearable/DynamicLightingWearableRGBDevice.cs new file mode 100644 index 0000000..0938bc8 --- /dev/null +++ b/RGB.NET.Devices.DynamicLighting/Wearable/DynamicLightingWearableRGBDevice.cs @@ -0,0 +1,34 @@ +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable UnusedMember.Global + +using RGB.NET.Core; + +namespace RGB.NET.Devices.DynamicLighting; + +/// +/// +/// Represents a Dynamic Lighting Wearable-device. +/// +public sealed class DynamicLightingWearableRGBDevice : DynamicLightingRGBDevice, IWearable +{ + #region Properties & Fields + + /// + protected override LedId ReferenceLedId => LedId.Wearable1; + + #endregion + + #region Constructors + + /// + /// + /// Initializes a new instance of the class. + /// + /// The meta data for this device. + /// The queue used to update this device. + internal DynamicLightingWearableRGBDevice(DynamicLightingWearableRGBDeviceInfo info, DynamicLightingDeviceUpdateQueue updateQueue) + : base(info, updateQueue) + { } + + #endregion +} \ No newline at end of file diff --git a/RGB.NET.Devices.DynamicLighting/Wearable/DynamicLightingWearableRGBDeviceInfo.cs b/RGB.NET.Devices.DynamicLighting/Wearable/DynamicLightingWearableRGBDeviceInfo.cs new file mode 100644 index 0000000..b6fbc24 --- /dev/null +++ b/RGB.NET.Devices.DynamicLighting/Wearable/DynamicLightingWearableRGBDeviceInfo.cs @@ -0,0 +1,19 @@ +using RGB.NET.Core; + +namespace RGB.NET.Devices.DynamicLighting; + +/// +/// +/// Represents a generic information for a . +/// +public sealed class DynamicLightingWearableRGBDeviceInfo : DynamicLightingRGBDeviceInfo +{ + #region Constructors + + /// + internal DynamicLightingWearableRGBDeviceInfo(LampArrayInfo lampArrayInfo) + : base(RGBDeviceType.Wearable, lampArrayInfo) + { } + + #endregion +} \ No newline at end of file diff --git a/RGB.NET.sln b/RGB.NET.sln index 44b786e..f8a47ef 100644 --- a/RGB.NET.sln +++ b/RGB.NET.sln @@ -51,6 +51,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RGB.NET.Devices.Corsair_Leg EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RGB.NET.Devices.WLED", "RGB.NET.Devices.WLED\RGB.NET.Devices.WLED.csproj", "{C533C5EA-66A8-4826-A814-80791E7593ED}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RGB.NET.Devices.DynamicLighting", "RGB.NET.Devices.DynamicLighting\RGB.NET.Devices.DynamicLighting.csproj", "{FF762C52-D84E-48C0-BEE7-2EA3B2C28F02}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -145,6 +147,10 @@ Global {C533C5EA-66A8-4826-A814-80791E7593ED}.Debug|Any CPU.Build.0 = Debug|Any CPU {C533C5EA-66A8-4826-A814-80791E7593ED}.Release|Any CPU.ActiveCfg = Release|Any CPU {C533C5EA-66A8-4826-A814-80791E7593ED}.Release|Any CPU.Build.0 = Release|Any CPU + {FF762C52-D84E-48C0-BEE7-2EA3B2C28F02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FF762C52-D84E-48C0-BEE7-2EA3B2C28F02}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FF762C52-D84E-48C0-BEE7-2EA3B2C28F02}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FF762C52-D84E-48C0-BEE7-2EA3B2C28F02}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -168,6 +174,7 @@ Global {F29A96E5-CDD0-469F-A871-A35A7519BC49} = {D13032C6-432E-4F43-8A32-071133C22B16} {66AF690C-27A1-4097-AC53-57C0ED89E286} = {D13032C6-432E-4F43-8A32-071133C22B16} {C533C5EA-66A8-4826-A814-80791E7593ED} = {D13032C6-432E-4F43-8A32-071133C22B16} + {FF762C52-D84E-48C0-BEE7-2EA3B2C28F02} = {D13032C6-432E-4F43-8A32-071133C22B16} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {7F222AD4-1F9E-4AAB-9D69-D62372D4C1BA}