Esempio n. 1
0
        public SystemTrayViewModel()
        {
            ActiveIcon = "Resources/octopode_icon.ico";
            device     = new KrakenDevice(DeviceEnumerator.EnumerateKrakenX62Devices().First());
            Task.Run(() => RefreshControllerState());
            device.StartReading();


            var key = Registry.CurrentUser.OpenSubKey("Software", true);

            if (key == null)
            {
                Console.Error.WriteLine("Could not open Registry Key");
                return;
            }

            appKey = key.OpenSubKey("Octopode", true);
            if (appKey == null)
            {
                appKey = key.CreateSubKey("Octopode", true, RegistryOptions.None);
            }

            LoadProfile();

            logoManager = new LightningManager(LightChannel.Logo);
            rimManager  = new LightningManager(LightChannel.Rim);

            logoManager.OnNewLightSetting += LightingManagerCallback;
            rimManager.OnNewLightSetting  += LightingManagerCallback;

            commander = new CommandController(device.usbDevice);
        }
Esempio n. 2
0
 private void LightingManagerCallback(LightningManager sender, LightSetting setting)
 {
     commander.AddCommand(KrakenDevice.GenerateLightMessage(setting.mode,
                                                            new ControlBlock(false, false, sender.lightChannel),
                                                            new LEDConfiguration(0, 0, AnimationSpeed.Normal),
                                                            new[] {
         0xFFFFFF, 0xFFFFFF, 0xFFFFFF, 0xFFFFFF, 0xFFFFFF,
         0xFFFFFF, 0xFFFFFF, 0xFFFFFF, 0xFFFFFF, 0xFFFFFF
     }));
 }