RGBController/RGBController2/Boards/ChromaDeviceBoard.cs

58 lines
1.5 KiB
C#
Raw Normal View History

2020-11-08 13:08:52 +00:00
using Corale.Colore.Core;
using System;
using System.Collections.Generic;
using System.Text;
using ColoreColor = Corale.Colore.Core.Color;
namespace RGBController2.Boards
{
public class ChromaDeviceBoard : IBoard
{
enum deviceTypes
{
Mousepad,
Keypad,
Headset,
Keyboard,
Mouse
}
private bool _connected;
//private IChroma _device;
public bool Connected
{
get { return _connected; }
}
public ChromaDeviceBoard()
{
// ToDo add device type selection here
_connected = true;
// ConnectToDevice();
}
public async void ConnectToDevice()
{
// _device = await ColoreProvider.CreateNativeAsync();
}
/// <summary>
/// Sets all of the LEDs to the chosen RGB colour.
/// </summary>
/// <param name="red">The red value</param>
/// <param name="green">The green value</param>
/// <param name="blue">The blue value</param>
public async void SetAllLeds(byte red, byte green, byte blue)
{
//if (_device.Initialized)
//{
// var colour = new ColoreColor((byte)red, (byte)green, (byte)blue);
// await _device.Mouse.SetAllAsync(colour);
//}
var colour = new ColoreColor((byte)red, (byte)green, (byte)blue);
Chroma.Instance.SetAll(colour);
}
}
}