public static List <Device> GetDevices(RGBSurface surface, string type) { IList <IRGBDevice> devices = null; RGBDeviceType deviceType = 0; switch (type) { case "keyboard": deviceType = RGBDeviceType.Keyboard; break; case "mouse": deviceType = RGBDeviceType.Mouse; break; case "ledstripe": deviceType = RGBDeviceType.LedStripe; break; case "graphiccard": deviceType = RGBDeviceType.GraphicsCard; break; case "motherboard": deviceType = RGBDeviceType.Mainboard; break; default: deviceType = RGBDeviceType.All; break; } //string exeDir = Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location); //Console.WriteLine(exeDir); //CoolerMasterDeviceProvider.PossibleX64NativePaths.Add(exeDir + "\\x64\\CMSDK.dll"); //CoolerMasterDeviceProvider.PossibleX86NativePaths.Add(exeDir + "\\x86\\CMSDK.dll"); AddDllPaths(); surface.LoadDevices(new CorsairDeviceProviderLoader().GetDeviceProvider(), deviceType); surface.LoadDevices(new CoolerMasterDeviceProviderLoader().GetDeviceProvider(), deviceType); surface.LoadDevices(new LogitechDeviceProviderLoader().GetDeviceProvider(), deviceType); surface.LoadDevices(new RazerDeviceProviderLoader().GetDeviceProvider(), deviceType); devices = surface.GetDevices(deviceType); var data = devices .Select(device => new Device() { id = device.DeviceInfo.Lighting, type = type, manufacturer = device.DeviceInfo.Manufacturer, model = device.DeviceInfo.Model, }).ToList(); return(data); }
static void Main(string[] args) { Surface = RGBSurface.Instance; // You should set some device filters here Surface.LoadDevices(CorsairDeviceProvider.Instance); Surface.AlignDevices(); foreach (IRGBDevice device in Surface.GetDevices <IRGBDevice>()) { Console.WriteLine("Found " + device.DeviceInfo.DeviceName); } CorsairGroup = new ListLedGroup(Surface.Leds); Thread UpdateThread = new Thread(UpdateLeds); RunUpdateThread = true; Stopwatch = new Stopwatch(); ActualFpsMeter = new Stopwatch(); PotentialFpsMeter = new Stopwatch(); UpdateThread.Start(); Console.WriteLine("Running Mediana. Press any key or close this window to exit.\n\n"); Console.ReadKey(); RunUpdateThread = false; }