using System; using RGB.NET.Core; using RGB.NET.Devices.Wooting.Native; namespace RGB.NET.Devices.Wooting.Generic { /// /// /// Represents the update-queue performing updates for cooler master devices. /// public class WootingUpdateQueue : UpdateQueue { #region Constructors /// /// Initializes a new instance of the class. /// /// The update trigger used by this queue. public WootingUpdateQueue(IDeviceUpdateTrigger updateTrigger) : base(updateTrigger) { } #endregion #region Methods /// protected override void Update(in ReadOnlySpan<(object key, Color color)> dataSet) { lock (_WootingSDK.SdkLock) { foreach ((object key, Color color) in dataSet) { (int row, int column) = ((int, int))key; _WootingSDK.ArraySetSingle((byte)row, (byte)column, color.GetR(), color.GetG(), color.GetB()); } _WootingSDK.ArrayUpdateKeyboard(); } } #endregion } }