public bool Remove(IMappedController controller) { lock (sync) { return(controllers.Remove(controller)); } }
public IMappedController Create(string id, string name, DeviceTypes deviceType) { IMappedController controller = deviceType switch { DeviceTypes.MicrosoftXbox360 => new XboxController(), DeviceTypes.SonyDualShock4 => new Ds4Controller(), _ => throw new NotImplementedException($"Unknown device type {deviceType}"), }; lock (sync) { controllers.Add(controller); } return(controller); }
public void Start(IMappedController controller) { switch (controller.Device.DeviceType) { case DeviceTypes.MicrosoftXbox360: (controller as XboxController).Start(emulatorService.FindBestXboxEmulator()); break; case DeviceTypes.SonyDualShock4: (controller as Ds4Controller).Start(emulatorService.FindBestDs4Emulator()); break; default: throw new ArgumentException("device.Device.DeviceType is not known"); } }
public EmulatedControllerFeedbackHandler(CloseFunction closeFunction, SenderFunction senderFunction, IMappedController emulatedController) : base(closeFunction, senderFunction) { this.emulatedController = emulatedController; threadContext = ThreadCreator.CreateLoop($"{emulatedController.Id} input device report thread", SendFeedback, 20); }
public void Stop(IMappedController controller) { controller.Stop(); }