Ejemplo n.º 1
0
        protected void UpdateDeviceList()
        {
            _deviceList.Clear();
            MappableDeviceItem noDeviceItem = new MappableDeviceItem("[Emulators.LibRetro.InputDevice.None]", null);

            _deviceList.Add(noDeviceItem);
            foreach (IMappableDevice device in _deviceProxy.GetDevices(true))
            {
                MappableDeviceItem deviceItem = new MappableDeviceItem(device.DeviceName, device);
                _deviceList.Add(deviceItem);
            }
            _deviceList.FireChange();
        }
Ejemplo n.º 2
0
        protected void InitializeControllerWrapper()
        {
            _controllerWrapper = new ControllerWrapper(_settings.MaxPlayers);
            DeviceProxy            deviceProxy  = new DeviceProxy();
            List <IMappableDevice> deviceList   = deviceProxy.GetDevices(false);
            MappingProxy           mappingProxy = new MappingProxy();

            foreach (PortMapping port in mappingProxy.PortMappings)
            {
                IMappableDevice device = deviceProxy.GetDevice(port.DeviceId, port.SubDeviceId, deviceList);
                if (device != null)
                {
                    RetroPadMapping mapping = mappingProxy.GetDeviceMapping(device);
                    device.Map(mapping);
                    _controllerWrapper.AddController(device, port.Port);
                    Logger.Debug("LibRetroFrontend: Mapped controller {0} to port {1}", device.DeviceName, port.Port);
                }
            }
        }