Generic data structure and interface for RGB devices (brainstorming)
If this project (and others like it) is going to expand beyond just motherboard Aura controllers and Aura controller based DRAM modules, it will need to be able to handle controllers with functionality other than just the Aura functionality. Ideally we would be able to make a unified GUI for all types of RGB RAM, motherboards, GPUs, peripherals, etc. and to be able to do that we'll need some sort of generic data structure that can represent all the functionality of any RGB device out there.
I'm thinking it will need to contain the following:
-
Controller Name (for example, "LED_0116 at 0x4E", "Corsair Vengeance RGB", "Razer DeathAdder Chroma")
-
Number of LEDs on controller
-
Number of zones on controller (more on this later)
-
List of named modes on controller (use common names where possible for compatibility, for example "Custom", "Static", "Breathing", "Spectrum Cycle", etc. but then allow for uncommon modes specific to certain controllers like "Flash and Dash", etc.). Could also provide an enum of common modes, not sure.
-
Map of LEDs. This would give a name for each LED (for example, "Audio 1", "Chipset", "DRAM 4", "Key F", "Logo", etc) and which zone ID it is a part of.
-
Zones. Zones would be a way to represent multiple groups of LEDs on a single controller as well as to specify some information necessary for pattern generation. Zone types could be, for example, "Single Zone", "Linear", and "Matrix". These are the categories I use on Keyboard Visualizer to determine what effect to generate. Single zones would typically only have one logical LED and one single color. Linear (or 1D) zones would be for strips of addressable LEDs, so that patterns like chases, bars, etc. could be mapped to the zone. Matrix (or 2D) zones would be for grid layouts of LEDs and would support drawing shapes, bitmap graphics, etc. to the zone.
For Linear and Matrix zones, there would have to be some way to map LED IDs to X or X/Y coordinates. Maybe include X and Y parameters in the LED data structures and maximum X and Y coordinates in the zone data structures.
Some examples:
Razer BlackWidow Chroma (2 zones)
Zone 1: Keyboard, type Matrix
Zone 2: Logo, type Single
LED_0116 at 0x4E (2 zones)
Zone 1: Audio, type Linear
Zone 2: RGB Header, type Single
Razer Mamba Elite (4 zones)
Zone 1: Left Strip, type Linear
Zone 2: Right Strip, type Linear
Zone 3: Logo, type Single
Zone 4: Mouse Wheel, type Single
By writing this interface, it would make writing a coherent SDK for RGB devices easier, as you could write GUIs, CLIs, and game integration with just one API and then integrate any device you want into it.