using RGB.NET.Core; using RGB.NET.Devices.Asus.Native; namespace RGB.NET.Devices.Asus { /// /// /// Represents a Asus mainboard. /// public class AsusMainboardRGBDevice : AsusRGBDevice { #region Constructors /// /// /// Initializes a new instance of the class. /// /// The specific information provided by Asus for the mainboard. internal AsusMainboardRGBDevice(AsusMainboardRGBDeviceInfo info) : base(info) { } #endregion #region Methods /// protected override void InitializeLayout() { //TODO DarthAffe 07.10.2017: Look for a good default layout int ledCount = _AsusSDK.GetMbLedCount(DeviceInfo.Handle); for (int i = 0; i < ledCount; i++) InitializeLed(new AsusLedId(this, AsusLedIds.MainboardLed1 + i, i), new Rectangle(i * 40, 0, 40, 8)); //TODO DarthAffe 07.10.2017: We don'T know the model, how to save layouts and images? ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Asus\Mainboards\{DeviceInfo.Model.Replace(" ", string.Empty).ToUpper()}.xml"), null, PathHelper.GetAbsolutePath(@"Images\Asus\Mainboards")); } /// public override void SyncBack() { byte[] colorData = _AsusSDK.GetMbColor(DeviceInfo.Handle); for (int i = 0; i < LedMapping.Count; i++) LedMapping[new AsusLedId(this, AsusLedIds.MainboardLed1 + i)].Color = new Color(colorData[(i * 3)], colorData[(i * 3) + 2], colorData[(i * 3) + 1]); } /// protected override void ApplyColorData() => _AsusSDK.SetMbColor(DeviceInfo.Handle, ColorData); #endregion } }