private void SetHid(RemoteMode mode) { DebugWriteLine("Force_HID_RemoteMode({0})", Enum.GetName(typeof(RemoteMode), mode)); byte[][] modeData = new Byte[0][]; switch (mode) { case RemoteMode.iMON: modeData = SetHidRemotePAD; break; case RemoteMode.MCE: modeData = SetHidRemoteMCE; break; } SetHid(modeData); }
private void SetDos(RemoteMode mode) { DebugWriteLine("SetRemoteMode({0})", Enum.GetName(typeof(RemoteMode), mode)); byte[][] modeData = new byte[0][]; switch (mode) { case RemoteMode.iMON: modeData = (firmwareVersion < 0x98) ? SetDosRemotePADold : SetDosRemotePADnew; break; case RemoteMode.MCE: modeData = (firmwareVersion < 0x98) ? SetDosRemoteMCEold : SetDosRemoteMCEnew; break; } SetDos(modeData); }
/// <summary> /// Loads the settings. /// </summary> private void LoadSettings() { DebugWriteLine("LoadSettings()"); try { XmlDocument doc = new XmlDocument(); doc.Load(ConfigurationFile); _remoteMode = (RemoteMode)Enum.Parse(typeof(RemoteMode), doc.DocumentElement.Attributes["RemoteMode"].Value); _padMode = (PadMode)Enum.Parse(typeof(PadMode), doc.DocumentElement.Attributes["PadMode"].Value); _enableRemoteInput = bool.Parse(doc.DocumentElement.Attributes["EnableRemoteInput"].Value); _usePadSwitch = bool.Parse(doc.DocumentElement.Attributes["UsePadSwitch"].Value); _useSystemRatesRemote = bool.Parse(doc.DocumentElement.Attributes["UseSystemRatesRemote"].Value); _remoteFirstRepeat = int.Parse(doc.DocumentElement.Attributes["RemoteFirstRepeat"].Value); _remoteHeldRepeats = int.Parse(doc.DocumentElement.Attributes["RemoteHeldRepeats"].Value); _enableKeyboardInput = bool.Parse(doc.DocumentElement.Attributes["EnableKeyboardInput"].Value); _useSystemRatesKeyboard = bool.Parse(doc.DocumentElement.Attributes["UseSystemRatesKeyboard"].Value); _keyboardFirstRepeat = int.Parse(doc.DocumentElement.Attributes["KeyboardFirstRepeat"].Value); _keyboardHeldRepeats = int.Parse(doc.DocumentElement.Attributes["KeyboardHeldRepeats"].Value); _handleKeyboardLocally = bool.Parse(doc.DocumentElement.Attributes["HandleKeyboardLocally"].Value); _enableMouseInput = bool.Parse(doc.DocumentElement.Attributes["EnableMouseInput"].Value); _handleMouseLocally = bool.Parse(doc.DocumentElement.Attributes["HandleMouseLocally"].Value); _mouseSensitivity = double.Parse(doc.DocumentElement.Attributes["MouseSensitivity"].Value); _keyPadSensitivity = int.Parse(doc.DocumentElement.Attributes["KeyPadSensitivity"].Value); } catch (Exception ex) { DebugWriteLine(ex.ToString()); _remoteMode = RemoteMode.iMON; _padMode = PadMode.Keyboard; _enableRemoteInput = true; _useSystemRatesRemote = false; _remoteFirstRepeat = 400; _remoteHeldRepeats = 250; _enableKeyboardInput = true; _useSystemRatesKeyboard = true; _keyboardFirstRepeat = 350; _keyboardHeldRepeats = 0; _handleKeyboardLocally = true; _enableMouseInput = true; _handleMouseLocally = true; _mouseSensitivity = 1.0d; } }