public void Configure(DriverDetails driverDetails) { client = new OpenRGBClient(name: "RGB Sync Studio", autoconnect: true, timeout: 1000); var deviceCount = client.GetControllerCount(); var devices = client.GetAllControllerData(); for (int devId = 0; devId < devices.Length; devId++) { ORGBControlDevice slsDevice = new ORGBControlDevice(); slsDevice.id = devId; slsDevice.Driver = this; slsDevice.Name = devices[devId].Name; slsDevice.DeviceType = DeviceTypeConverter.GetType(devices[devId].Type); slsDevice.Has2DSupport = false; slsDevice.ProductImage = (Bitmap)Image.FromStream(orgbImage); List <ControlDevice.LedUnit> deviceLeds = new List <ControlDevice.LedUnit>(); int i = 0; foreach (Led orgbLed in devices[devId].Leds) { ControlDevice.LedUnit slsLed = new ControlDevice.LedUnit(); slsLed.LEDName = orgbLed.Name; deviceLeds.Add(slsLed); } slsDevice.LEDs = deviceLeds.ToArray(); DeviceAdded?.Invoke(slsDevice, new Events.DeviceChangeEventArgs(slsDevice)); } }
public void Push(ControlDevice controlDevice) { ORGBControlDevice orgbControlDevice = controlDevice as ORGBControlDevice; Device orgbDevice = client.GetAllControllerData().First(dev => dev.Name == controlDevice.Name); var leds = Enumerable.Range(0, orgbDevice.Colors.Length) .Select(_ => new Color((byte)controlDevice.LEDs[0].Color.Red, (byte)controlDevice.LEDs[0].Color.Green, (byte)controlDevice.LEDs[0].Color.Blue)) .ToArray(); client.UpdateLeds(orgbControlDevice.id, leds); }