public async void BlinkLight(IAuraSyncDevice device, int lightId) { if (tokenSource != null && !tokenSource.Token.IsCancellationRequested) { tokenSource.Cancel(); } tokenSource = new CancellationTokenSource(); for (int i = 0; i < BlinkCount; i++) { if (tokenSource.IsCancellationRequested || device == null) { return; } // set everything to black foreach (IAuraRgbLight light in device.Lights) { light.Color = 0; } // set this one key to white if (i % 2 == 1) { device.Lights[lightId].Red = 255; device.Lights[lightId].Green = 255; device.Lights[lightId].Blue = 255; } device.Apply(); await Task.Delay(200); // ms } }
public AsusConfigDevice(IAuraSyncDevice device) { Name = device.Name; Enabled = true; Type = device.Type; KeyCount = device.Lights.Count; KeyMapper = new Dictionary <int, DeviceKeys>(); }
/// <summary> /// Internal constructor of managed <see cref="AsusRGBDeviceInfo"/>. /// </summary> /// <param name="deviceType">The type of the <see cref="IRGBDevice"/>.</param> /// <param name="device">The <see cref="IAuraSyncDevice"/> backing this RGB.NET device.</param> /// <param name="manufacturer">The manufacturer-name of the <see cref="IRGBDevice"/>.</param> /// <param name="model">The model-name of the <see cref="IRGBDevice"/>.</param> internal AsusRGBDeviceInfo(RGBDeviceType deviceType, IAuraSyncDevice device, string model = null, string manufacturer = "Asus") { this.DeviceType = deviceType; this.Device = device; this.Model = model ?? device.Name; this.Manufacturer = manufacturer; DeviceName = $"{Manufacturer} {Model}"; }
public AsusSdkAdapter() { var sdk = (IAuraSdk2) new AuraSdk(); sdk.SwitchMode(); var devices = sdk.Enumerate(528384); this._sdk = sdk; this._notebookKeyboard = devices.Count > 0 ? devices[0] : null; }
/// <summary> /// Creates an Asus device /// </summary> /// <param name="device">The device</param> /// <param name="logger">The logger</param> internal AsusDevice(IAuraSyncDevice device, ILogger <AsusDeviceProvider> logger) { _device = device; _lights = new List <AsusDeviceLight>(); _logger = logger; foreach (IAuraRgbLight light in _device.Lights) { _lights.Add(new AsusDeviceLight(light)); } }
/// <summary> /// Constructor for ASUS Rog Strix G15 (2021) laptop adapter. /// </summary> public AsusRogStrix_G15_2021_Adapter() { try { var sdk = (IAuraSdk2) new AuraSdk(); sdk.SwitchMode(); var devices = sdk.Enumerate(528384); this._sdk = sdk; this._notebookKeyboard = devices.Count > 0 ? devices[0] : throw new Exception("No Asus device attached."); this.Initialized = true; } catch (Exception) { this.Initialized = false; } }
public AuraSyncRgbLed(IAuraSyncDevice dev, int lightIdx) { this.dev = dev; light = dev.Lights[(int)lightIdx]; }
/// <inheritdoc /> public AsusSyncConfiguredDevice(AsusHandler asusHandler, IAuraSyncDevice device, AsusConfig.AsusConfigDevice config, int frameRate = 30) : base(asusHandler, device, frameRate) { this.config = config; allConfigDevices.Add(this); }
/// <summary> /// Initializes the queue. /// </summary> /// <param name="device">The device to be updated.</param> public void Initialize(IAuraSyncDevice device) { Device = device; }
/// <inheritdoc /> /// <summary> /// Internal constructor of managed <see cref="T:RGB.NET.Devices.Asus.AsusKeyboardRGBDeviceInfo" />. /// </summary> /// <param name="device">The <see cref="IAuraSyncDevice"/> backing this RGB.NET device.</param> /// <param name="culture">The <see cref="T:System.Globalization.CultureInfo" /> of the layout this keyboard is using.</param> internal AsusKeyboardRGBDeviceInfo(IAuraSyncDevice device, CultureInfo culture) : base(RGBDeviceType.Keyboard, device, "Claymore") { SetLayouts(culture.KeyboardLayoutId); }
public AuraSyncDevice(AsusHandler asusHandler, IAuraSyncDevice device, int frameRate = 30) { this.asusHandler = asusHandler; this.device = device; frameRateMillis = (int)((1f / frameRate) * 1000f); }
public AuraDevice(IAuraSyncDevice device) { RawDevice = device; UpdateRequired = true; }
/// <inheritdoc /> public AsusSyncClaymoreDevice(AsusHandler asusHandler, IAuraSyncDevice device, int frameRate = 30) : base( asusHandler, device, frameRate) { }
public WrappedDevice(IAuraSyncDevice thisDevice) { device = thisDevice; name = thisDevice.Name; }