public void MapLights(Usb.GameControllers.Microsoft.Sidewinder.GameVoice.Joystick swgv) { swgv.Lights = 0; // Turn lights on and off SharedState.GearChanged.Subscribe(x => swgv.Lights = x ? (byte)(swgv.Lights | (byte)Button.Button1) : (byte)(swgv.Lights & ~(byte)Button.Button1)); }
public static void UpdateLights(Usb.GameControllers.Microsoft.Sidewinder.GameVoice.Joystick swgv) { float button1 = VoiceMeeter.Remote.GetParameter(EliteDangerous); float button2 = VoiceMeeter.Remote.GetParameter(VoiceAttack); float button3 = VoiceMeeter.Remote.GetParameter(Spotify); float button4 = VoiceMeeter.Remote.GetParameter(BassShaker); byte lights = 0; if (button1 == 0) { lights = (byte)(lights | (byte)Button.Button1); } if (button2 == 0) { lights = (byte)(lights | (byte)Button.Button2); } if (button3 == 0) { lights = (byte)(lights | (byte)Button.Button3); } if (button4 == 0) { lights = (byte)(lights | (byte)Button.Button4); } swgv.Lights = lights; }
public void MapControls(Usb.GameControllers.Microsoft.Sidewinder.GameVoice.Joystick swgv) { // Add in the mappings Disposables = new List <IDisposable> { //swgv.Where(x => Reactive.ButtonsChanged(x)).Subscribe(x => SwGameButtonStateHandler.Process(x, this), ex => log.Error($"Exception : {ex}")), //swgv.Where(x => Reactive.ButtonsChanged(x)).Subscribe(x => SwGameLandingGearHandler.Process(x, this), ex => log.Error($"Exception : {ex}")), swgv.Where(x => Reactive.ButtonsChanged(x)).Subscribe(x => SwGameVoicemeeterHandler.Process(x, this), ex => Logger.LogError($"Exception : {ex}")), //swgv.Where(x => Reactive.ButtonsChanged(x)).Subscribe(x => SwGameMuteHandler.Process(x, this), ex => log.Error($"Exception : {ex}")) }; }
public void Initialize(string devicePath) { joystick = new Usb.GameControllers.Microsoft.Sidewinder.GameVoice.Joystick(devicePath, Logger); MapControls(joystick); //MapLights(joystick); // Initialize Voicemeeter and Login Disposables.Add(VoiceMeeter.Remote.Initialize(Voicemeeter.RunVoicemeeterParam.VoicemeeterBanana).Result); joystick.Initialize(); //WatchChanges(); SwGameVoicemeeterHandler.UpdateLights(joystick); }