From: <an...@us...> - 2007-05-19 16:14:36
|
Revision: 409 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=409&view=rev Author: and-81 Date: 2007-05-19 09:14:30 -0700 (Sat, 19 May 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Program.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs trunk/plugins/IR Server Suite/Common/MPUtils/ExternalChannelConfig.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MPBlastZonePlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/InputMapper/InputMappingForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MappedEvent.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs trunk/plugins/MCEReplacement/Forms/SetupForm.cs trunk/plugins/MCEReplacement/InputMapper/InputMappingForm.cs trunk/plugins/MCEReplacement/MCEReplacement.cs trunk/plugins/MCEReplacement/MappedEvent.cs Modified: trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-05-19 06:45:44 UTC (rev 408) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-05-19 16:14:30 UTC (rev 409) @@ -446,7 +446,7 @@ void RemoteButtonPressed(string keyCode) { - IrssLog.Info("Remote Button Pressed: {0}", keyCode); + IrssLog.Debug("Remote Button Pressed: {0}", keyCode); byte[] bytes = Encoding.ASCII.GetBytes(keyCode); @@ -468,7 +468,7 @@ case IRServerMode.RepeaterMode: { - IrssLog.Info("Remote button press ignored, IR Server is in Repeater Mode."); + IrssLog.Debug("Remote button press ignored, IR Server is in Repeater Mode."); break; } } @@ -478,8 +478,6 @@ { IrssLog.Debug("SendToAll({0})", message.ToString()); - IrssLog.Info("Message out: {0}", message.Name); - List<Client> unregister = new List<Client>(); lock (_registeredClients) @@ -512,8 +510,6 @@ { IrssLog.Debug("SendToAllExcept({0}, {1}, {2})", exceptPipe, exceptServer, message.ToString()); - IrssLog.Info("Message out: {0}", message.Name); - List<Client> unregister = new List<Client>(); lock (_registeredClients) @@ -549,8 +545,6 @@ { IrssLog.Debug("SendTo({0}, {1}, {2})", pipe, server, message.ToString()); - IrssLog.Info("Message out: {0}", message.Name); - try { PipeAccess.SendMessage(pipe, server, message.ToString()); @@ -567,8 +561,6 @@ { IrssLog.Debug("SendToRepeaters({0})", message.ToString()); - IrssLog.Info("Message out: {0}", message.Name); - List<Client> unregister = new List<Client>(); lock (_registeredRepeaters) @@ -828,8 +820,6 @@ { IrssLog.Debug("Message received from client \\\\{0}\\pipe\\{1} = {2}", received.FromServer, received.FromPipe, received.ToString()); - IrssLog.Info("Message in: {0}", received.Name); - try { switch (received.Name) @@ -929,6 +919,8 @@ case "Shutdown": { + IrssLog.Info("Shutdown command received"); + if (_mode == IRServerMode.ServerMode) { PipeMessage response = new PipeMessage(Common.ServerPipeName, Environment.MachineName, "Server Shutdown", null); @@ -995,6 +987,7 @@ case "Server Shutdown": { + IrssLog.Info("Host server shut down"); _registered = false; break; } Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2007-05-19 06:45:44 UTC (rev 408) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2007-05-19 16:14:30 UTC (rev 409) @@ -17,7 +17,7 @@ { [STAThread] - static int Main(string[] args) + static int Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2007-05-19 06:45:44 UTC (rev 408) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2007-05-19 16:14:30 UTC (rev 409) @@ -664,7 +664,7 @@ } private void buttonSetCommand_Click(object sender, EventArgs e) { - if (comboBoxCommands.SelectedIndex == -1) + if (comboBoxCommands.SelectedIndex == -1 || listViewEventMap.SelectedItems.Count == 0) return; string selected = comboBoxCommands.SelectedItem as string; Modified: trunk/plugins/IR Server Suite/Applications/Translator/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2007-05-19 06:45:44 UTC (rev 408) +++ trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2007-05-19 16:14:30 UTC (rev 409) @@ -511,8 +511,6 @@ while (_keepAlive && _registered && !reconnect) { - IrssLog.Info("Ping ({0})", _config.ServerHost); - int pingID = random.Next(); long pingTime = DateTime.Now.Ticks; @@ -547,15 +545,13 @@ if (receivedEcho) // Received ping echo ... { - IrssLog.Info("Echo received"); - // Wait 60 seconds before re-pinging ... for (int sleeps = 0; sleeps < 60 && _keepAlive && _registered; sleeps++) Thread.Sleep(1000); } else // Didn't receive ping echo ... { - IrssLog.Warn("No echo, attempting to reconnect ..."); + IrssLog.Warn("No echo to ping, attempting to reconnect ..."); // Break out of pinging cycle ... _registered = false; Modified: trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs 2007-05-19 06:45:44 UTC (rev 408) +++ trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs 2007-05-19 16:14:30 UTC (rev 409) @@ -86,7 +86,9 @@ bool didSetup = false; if (String.IsNullOrEmpty(_programFile) || String.IsNullOrEmpty(_serverHost)) { - ClickSetup(null, null); + if (!Configure()) + return false; + didSetup = true; } @@ -349,8 +351,6 @@ while (_keepAlive && _registered && !reconnect) { - IrssLog.Info("Ping ({0})", _serverHost); - int pingID = random.Next(); long pingTime = DateTime.Now.Ticks; @@ -385,15 +385,13 @@ if (receivedEcho) // Received ping echo ... { - IrssLog.Info("Echo received"); - // Wait 60 seconds before re-pinging ... for (int sleeps = 0; sleeps < 60 && _keepAlive && _registered; sleeps++) Thread.Sleep(1000); } else // Didn't receive ping echo ... { - IrssLog.Warn("No echo, attempting to reconnect ..."); + IrssLog.Warn("No echo to ping, attempting to reconnect ..."); // Break out of pinging cycle ... _registered = false; @@ -411,7 +409,7 @@ { PipeMessage received = PipeMessage.FromString(message); - IrssLog.Info(received.Name); + IrssLog.Debug("Received Message \"{0}\"", received.Name); try { @@ -483,23 +481,18 @@ ClickLaunch(null, null); } - void ClickSetup(object sender, EventArgs e) + bool Configure() { - IrssLog.Info("Setup"); - Setup setup = new Setup(); setup.AutoRun = _autoRun; setup.ServerHost = _serverHost; setup.ProgramFile = _programFile; setup.LaunchOnLoad = _launchOnLoad; - setup.LaunchKeyCode = _launchKeyCode; + setup.LaunchKeyCode = _launchKeyCode; - if (setup.ShowDialog() == DialogResult.OK) + if (setup.ShowDialog(this) == DialogResult.OK) { - if (PipeAccess.ServerRunning && _serverHost != setup.ServerHost) - MessageBox.Show(this, "Changes to the server host address may not take effect until you restart Tray Launcher", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); - _autoRun = setup.AutoRun; _serverHost = setup.ServerHost; _programFile = setup.ProgramFile; @@ -507,8 +500,24 @@ _launchKeyCode = setup.LaunchKeyCode; SaveSettings(); + + return true; } + + return false; } + + void ClickSetup(object sender, EventArgs e) + { + IrssLog.Info("Setup"); + + if (Configure()) + { + Stop(); + Thread.Sleep(500); + Start(); + } + } void ClickLaunch(object sender, EventArgs e) { IrssLog.Info("Launch"); Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs 2007-05-19 06:45:44 UTC (rev 408) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs 2007-05-19 16:14:30 UTC (rev 409) @@ -21,7 +21,7 @@ #region Constants - const string DefaultSkin = "MCE"; + const string DefaultSkin = "MCE"; public static readonly string ConfigurationFile = Common.FolderAppData + "Virtual Remote\\Virtual Remote.xml"; @@ -172,7 +172,7 @@ writer.WriteStartElement("settings"); // <settings> writer.WriteAttributeString("ServerHost", _serverHost); - writer.WriteAttributeString("Skin", _remoteSkin); + writer.WriteAttributeString("RemoteSkin", _remoteSkin); writer.WriteEndElement(); // </settings> writer.WriteEndDocument(); @@ -473,8 +473,6 @@ while (_keepAlive && _registered && !reconnect) { - IrssLog.Info("Ping ({0})", _serverHost); - int pingID = random.Next(); long pingTime = DateTime.Now.Ticks; @@ -509,15 +507,13 @@ if (receivedEcho) // Received ping echo ... { - IrssLog.Info("Echo received"); - // Wait 60 seconds before re-pinging ... for (int sleeps = 0; sleeps < 60 && _keepAlive && _registered; sleeps++) Thread.Sleep(1000); } else // Didn't receive ping echo ... { - IrssLog.Warn("No echo, attempting to reconnect ..."); + IrssLog.Warn("No echo to ping, attempting to reconnect ..."); // Break out of pinging cycle ... _registered = false; Modified: trunk/plugins/IR Server Suite/Common/MPUtils/ExternalChannelConfig.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/MPUtils/ExternalChannelConfig.cs 2007-05-19 06:45:44 UTC (rev 408) +++ trunk/plugins/IR Server Suite/Common/MPUtils/ExternalChannelConfig.cs 2007-05-19 16:14:30 UTC (rev 409) @@ -113,8 +113,10 @@ #region Constructor - public ExternalChannelConfig() + public ExternalChannelConfig(string fileName) { + _fileName = fileName; + _cardID = DefaultCardID; _pauseTime = DefaultPauseTime; @@ -207,8 +209,7 @@ public static ExternalChannelConfig Load(string fileName) { - ExternalChannelConfig newECC = new ExternalChannelConfig(); - newECC._fileName = fileName; + ExternalChannelConfig newECC = new ExternalChannelConfig(fileName); XmlDocument doc = new XmlDocument(); doc.Load(newECC._fileName); Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/MacroEditor.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/MacroEditor.cs 2007-05-19 06:45:44 UTC (rev 408) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/MacroEditor.cs 2007-05-19 16:14:30 UTC (rev 409) @@ -36,7 +36,10 @@ textBoxName.Enabled = newMacro; if (!newMacro) - ReadFromFile(name); + { + string fileName = MPBlastZonePlugin.FolderMacros + name + Common.FileExtensionMacro; + ReadFromFile(fileName); + } } #endregion Constructor @@ -70,7 +73,7 @@ /// <param name="fileName">Name of Macro to write (macro name, not file path).</param> void WriteToFile(string fileName) { - XmlTextWriter writer = new XmlTextWriter(MPBlastZonePlugin.FolderMacros + fileName + Common.FileExtensionMacro, System.Text.Encoding.UTF8); + XmlTextWriter writer = new XmlTextWriter(fileName, System.Text.Encoding.UTF8); writer.Formatting = Formatting.Indented; writer.Indentation = 1; writer.IndentChar = (char)9; @@ -169,7 +172,7 @@ void ReadFromFile(string fileName) { XmlDocument doc = new XmlDocument(); - doc.Load(MPBlastZonePlugin.FolderMacros + fileName + Common.FileExtensionMacro); + doc.Load(fileName); listBoxMacro.Items.Clear(); @@ -370,6 +373,8 @@ return; } + fileName = MPBlastZonePlugin.FolderMacros + fileName + Common.FileExtensionMacro; + WriteToFile(fileName); try @@ -398,6 +403,8 @@ return; } + fileName = MPBlastZonePlugin.FolderMacros + fileName + Common.FileExtensionMacro; + WriteToFile(fileName); this.DialogResult = DialogResult.OK; Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MPBlastZonePlugin.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MPBlastZonePlugin.cs 2007-05-19 06:45:44 UTC (rev 408) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MPBlastZonePlugin.cs 2007-05-19 16:14:30 UTC (rev 409) @@ -496,8 +496,6 @@ while (_keepAlive && _registered && !reconnect) { - Log.Debug("MPBlastZonePlugin: Ping ({0})", _serverHost); - int pingID = random.Next(); long pingTime = DateTime.Now.Ticks; @@ -532,15 +530,13 @@ if (receivedEcho) // Received ping echo ... { - Log.Debug("MPBlastZonePlugin: Echo received"); - // Wait 60 seconds before re-pinging ... for (int sleeps = 0; sleeps < 60 && _keepAlive && _registered; sleeps++) Thread.Sleep(1000); } else // Didn't receive ping echo ... { - Log.Warn("MPBlastZonePlugin: No echo, attempting to reconnect ..."); + Log.Warn("MPBlastZonePlugin: No echo to ping, attempting to reconnect ..."); // Break out of pinging cycle ... _registered = false; @@ -559,7 +555,7 @@ PipeMessage received = PipeMessage.FromString(message); if (LogVerbose) - Log.Info("MPBlastZonePlugin: Received Message \"{0}\"", received.Name); + Log.Debug("MPBlastZonePlugin: Received Message \"{0}\"", received.Name); try { Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/MacroEditor.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/MacroEditor.cs 2007-05-19 06:45:44 UTC (rev 408) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/MacroEditor.cs 2007-05-19 16:14:30 UTC (rev 409) @@ -33,7 +33,7 @@ if (!newMacro) { string fileName = MPControlPlugin.FolderMacros + name + Common.FileExtensionMacro; - ReadFromFile(name); + ReadFromFile(fileName); } } @@ -481,6 +481,8 @@ return; } + fileName = MPControlPlugin.FolderMacros + fileName + Common.FileExtensionMacro; + WriteToFile(fileName); this.DialogResult = DialogResult.OK; Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.cs 2007-05-19 06:45:44 UTC (rev 408) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.cs 2007-05-19 16:14:30 UTC (rev 409) @@ -74,13 +74,7 @@ listBoxMappings.Items.Add(map); // Event Mapper ... - comboBoxCommands.Items.Clear(); - comboBoxCommands.Items.Add(Common.UITextRun); - comboBoxCommands.Items.Add(Common.UITextSerial); - comboBoxCommands.Items.Add(Common.UITextMessage); - comboBoxCommands.Items.Add(Common.UITextKeys); - comboBoxCommands.Items.Add(Common.UITextGoto); - comboBoxCommands.Items.AddRange(MPControlPlugin.GetFileList(true)); + RefreshEventMapperCommands(); comboBoxEvents.Items.Clear(); foreach (string eventType in Enum.GetNames(typeof(MappedEvent.MappingEvent))) @@ -254,6 +248,17 @@ listBoxMacro.Items.AddRange(MPControlPlugin.GetMacroList(false)); } + void RefreshEventMapperCommands() + { + comboBoxCommands.Items.Clear(); + comboBoxCommands.Items.Add(Common.UITextRun); + comboBoxCommands.Items.Add(Common.UITextSerial); + comboBoxCommands.Items.Add(Common.UITextMessage); + comboBoxCommands.Items.Add(Common.UITextKeys); + comboBoxCommands.Items.Add(Common.UITextGoto); + comboBoxCommands.Items.AddRange(MPControlPlugin.GetFileList(true)); + } + void EditIR() { if (listBoxIR.SelectedIndex != -1) @@ -270,6 +275,7 @@ { MessageBox.Show(this, "File not found: " + fileName, "File missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); RefreshIRList(); + RefreshEventMapperCommands(); } } } @@ -289,6 +295,7 @@ { MessageBox.Show(this, "File not found: " + fileName, "File missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); RefreshMacroList(); + RefreshEventMapperCommands(); } } } @@ -378,6 +385,7 @@ learnIR.ShowDialog(this); RefreshIRList(); + RefreshEventMapperCommands(); } private void buttonEditIR_Click(object sender, EventArgs e) { @@ -400,6 +408,7 @@ } RefreshIRList(); + RefreshEventMapperCommands(); } } @@ -409,6 +418,7 @@ macroEditor.ShowDialog(this); RefreshMacroList(); + RefreshEventMapperCommands(); } private void buttonEditMacro_Click(object sender, EventArgs e) { @@ -431,6 +441,7 @@ } RefreshMacroList(); + RefreshEventMapperCommands(); } } private void buttonTestMacro_Click(object sender, EventArgs e) Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/InputMapper/InputMappingForm.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/InputMapper/InputMappingForm.cs 2007-05-19 06:45:44 UTC (rev 408) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/InputMapper/InputMappingForm.cs 2007-05-19 16:14:30 UTC (rev 409) @@ -586,6 +586,7 @@ this.comboBoxCmdProperty.Sorted = true; this.comboBoxCmdProperty.TabIndex = 7; this.comboBoxCmdProperty.SelectionChangeCommitted += new System.EventHandler(this.comboBoxCmdProperty_SelectionChangeCommitted); + this.comboBoxCmdProperty.KeyUp += new System.Windows.Forms.KeyEventHandler(this.comboBoxCmdProperty_KeyUp); // // groupBoxCondition // @@ -663,6 +664,7 @@ this.comboBoxCondProperty.Sorted = true; this.comboBoxCondProperty.TabIndex = 4; this.comboBoxCondProperty.SelectionChangeCommitted += new System.EventHandler(this.comboBoxCondProperty_SelectionChangeCommitted); + this.comboBoxCondProperty.KeyUp += new System.Windows.Forms.KeyEventHandler(this.comboBoxCondProperty_KeyUp); // // groupBoxLayer // @@ -824,8 +826,11 @@ switch (condition) { case "WINDOW": - conditionString = GetFriendlyName(Enum.GetName(typeof(GUIWindow.Window), Convert.ToInt32(conProperty))); - break; + { + try { conditionString = GetFriendlyName(Enum.GetName(typeof(GUIWindow.Window), Convert.ToInt32(conProperty))); } + catch { conditionString = conProperty; } + break; + } case "FULLSCREEN": if (conProperty == "TRUE") conditionString = "Fullscreen"; @@ -852,8 +857,11 @@ commandString = "Key \"" + cmdProperty + "\""; break; case "WINDOW": - commandString = "Window \"" + GetFriendlyName(Enum.GetName(typeof(GUIWindow.Window), Convert.ToInt32(cmdProperty))) + "\""; - break; + { + try { commandString = "Window \"" + GetFriendlyName(Enum.GetName(typeof(GUIWindow.Window), Convert.ToInt32(cmdProperty))) + "\""; } + catch { commandString = "Window \"" + cmdProperty + "\""; } + break; + } case "TOGGLE": commandString = "Toggle Layer"; break; @@ -896,7 +904,7 @@ TreeNode soundNode = new TreeNode(sound); soundNode.Tag = new Data("SOUND", null, sound); - if (sound == String.Empty) + if (String.IsNullOrEmpty(sound)) soundNode.Text = "No Sound"; soundNode.ForeColor = Color.DarkRed; conditionNode.Nodes.Add(soundNode); @@ -1009,7 +1017,7 @@ writer.WriteAttributeString("cmdproperty", cmdProperty); if (cmdProperty == Convert.ToInt32(Action.ActionType.ACTION_KEY_PRESSED).ToString()) { - if (cmdKeyChar != String.Empty) + if (!String.IsNullOrEmpty(cmdKeyChar)) { writer.WriteAttributeString("cmdkeychar", cmdKeyChar); } @@ -1017,7 +1025,7 @@ { writer.WriteAttributeString("cmdkeychar", "0"); } - if (cmdKeyCode != String.Empty) + if (!String.IsNullOrEmpty(cmdKeyCode)) { writer.WriteAttributeString("cmdkeycode", cmdKeyCode); } @@ -1027,7 +1035,7 @@ } } - if (sound != String.Empty) + if (!String.IsNullOrEmpty(sound)) writer.WriteAttributeString("sound", sound); if (focus) writer.WriteAttributeString("focus", focus.ToString()); @@ -1187,11 +1195,21 @@ switch ((string)data.Parameter) { case "WINDOW": - radioButtonWindow.Checked = true; - comboBoxCondProperty.Enabled = true; - UpdateCombo(ref comboBoxCondProperty, windowsList, GetFriendlyName(Enum.GetName(typeof(GUIWindow.Window), Convert.ToInt32(data.Value)))); - break; + { + comboBoxCondProperty.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDown; + + radioButtonWindow.Checked = true; + comboBoxCondProperty.Enabled = true; + + string friendlyName; + try { friendlyName = GetFriendlyName(Enum.GetName(typeof(GUIWindow.Window), Convert.ToInt32(data.Value))); } + catch { friendlyName = Convert.ToInt32(data.Value).ToString(); } + UpdateCombo(ref comboBoxCondProperty, windowsList, friendlyName); + break; + } case "FULLSCREEN": + comboBoxCondProperty.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + radioButtonFullscreen.Checked = true; comboBoxCondProperty.Enabled = true; if (Convert.ToBoolean(data.Value)) @@ -1200,11 +1218,15 @@ UpdateCombo(ref comboBoxCondProperty, fullScreenList, "No Fullscreen"); break; case "PLAYER": + comboBoxCondProperty.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + radioButtonPlaying.Checked = true; comboBoxCondProperty.Enabled = true; UpdateCombo(ref comboBoxCondProperty, playerList, playerList[Array.IndexOf(nativePlayerList, (string)data.Value)]); break; case "*": + comboBoxCondProperty.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + comboBoxCondProperty.Text = "none"; radioButtonNoCondition.Checked = true; comboBoxCondProperty.Enabled = false; @@ -1217,7 +1239,7 @@ switch (data.Type) { case "SOUND": - if ((string)data.Value != String.Empty) + if (!String.IsNullOrEmpty(data.Value as string)) comboBoxSound.SelectedItem = data.Value; else comboBoxSound.SelectedItem = "none"; @@ -1245,14 +1267,20 @@ UpdateCombo(ref comboBoxCmdProperty, actionList, "Key Pressed"); break; case "WINDOW": - comboBoxCmdProperty.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - radioButtonActWindow.Checked = true; - comboBoxSound.Enabled = true; - comboBoxCmdProperty.Enabled = true; - textBoxKeyChar.Enabled = textBoxKeyCode.Enabled = false; - textBoxKeyChar.Text = textBoxKeyCode.Text = String.Empty; - UpdateCombo(ref comboBoxCmdProperty, windowsListFiltered, GetFriendlyName(Enum.GetName(typeof(GUIWindow.Window), Convert.ToInt32(data.Value)))); - break; + { + comboBoxCmdProperty.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDown; + radioButtonActWindow.Checked = true; + comboBoxSound.Enabled = true; + comboBoxCmdProperty.Enabled = true; + textBoxKeyChar.Enabled = textBoxKeyCode.Enabled = false; + textBoxKeyChar.Text = textBoxKeyCode.Text = String.Empty; + + string friendlyName; + try { friendlyName = GetFriendlyName(Enum.GetName(typeof(GUIWindow.Window), Convert.ToInt32(data.Value))); } + catch { friendlyName = Convert.ToInt32(data.Value).ToString(); } + UpdateCombo(ref comboBoxCmdProperty, windowsListFiltered, friendlyName); + break; + } case "TOGGLE": radioButtonToggle.Checked = true; comboBoxSound.Enabled = true; @@ -1269,7 +1297,6 @@ comboBoxCmdProperty.Enabled = true; textBoxKeyChar.Enabled = textBoxKeyCode.Enabled = false; textBoxKeyChar.Text = textBoxKeyCode.Text = String.Empty; - string friendlyName = String.Empty; UpdateCombo(ref comboBoxCmdProperty, powerList, powerList[Array.IndexOf(nativePowerList, (string)data.Value)]); break; case "PROCESS": @@ -1299,7 +1326,7 @@ } } - void UpdateCombo(ref MediaPortal.UserInterface.Controls.MPComboBox comboBox, Array list, string hilight) + static void UpdateCombo(ref MediaPortal.UserInterface.Controls.MPComboBox comboBox, Array list, string hilight) { comboBox.Items.Clear(); foreach (object item in list) @@ -1309,12 +1336,12 @@ comboBox.Enabled = true; } - void UpdateCombo(ref MediaPortal.UserInterface.Controls.MPComboBox comboBox, ArrayList list, string hilight) + static void UpdateCombo(ref MediaPortal.UserInterface.Controls.MPComboBox comboBox, ArrayList list, string hilight) { UpdateCombo(ref comboBox, list.ToArray(), hilight); } - string GetFriendlyName(string name) + static string GetFriendlyName(string name) { if ((name.IndexOf("ACTION") != -1) || (name.IndexOf("WINDOW") != -1)) name = name.Substring(7); @@ -1355,12 +1382,12 @@ return newName; } - string GetWindowName(string friendlyName) + static string GetWindowName(string friendlyName) { return "WINDOW_" + friendlyName.Replace(' ', '_').ToUpper(); } - string GetActionName(string friendlyName) + static string GetActionName(string friendlyName) { string actionName = String.Empty; @@ -1384,7 +1411,7 @@ } - void CleanAbbreviation(ref string name, string abbreviation) + static void CleanAbbreviation(ref string name, string abbreviation) { int index = name.ToUpper().IndexOf(abbreviation.ToUpper()); if (index != -1) @@ -1393,6 +1420,7 @@ private void radioButtonWindow_Click(object sender, System.EventArgs e) { + comboBoxCondProperty.DropDownStyle = ComboBoxStyle.DropDown; comboBoxCondProperty.Enabled = true; TreeNode node = getNode("CONDITION"); node.Tag = new Data("CONDITION", "WINDOW", "0"); @@ -1403,6 +1431,7 @@ private void radioButtonFullscreen_Click(object sender, System.EventArgs e) { + comboBoxCondProperty.DropDownStyle = ComboBoxStyle.DropDownList; comboBoxCondProperty.Enabled = true; TreeNode node = getNode("CONDITION"); node.Tag = new Data("CONDITION", "FULLSCREEN", "true"); @@ -1413,6 +1442,7 @@ private void radioButtonPlaying_Click(object sender, System.EventArgs e) { + comboBoxCondProperty.DropDownStyle = ComboBoxStyle.DropDownList; comboBoxCondProperty.Enabled = true; TreeNode node = getNode("CONDITION"); node.Tag = new Data("CONDITION", "PLAYER", "TV"); @@ -1423,6 +1453,7 @@ private void radioButtonNoCondition_Click(object sender, System.EventArgs e) { + comboBoxCondProperty.DropDownStyle = ComboBoxStyle.DropDownList; comboBoxCondProperty.Enabled = false; comboBoxCondProperty.Items.Clear(); comboBoxCondProperty.Text = "none"; @@ -1450,14 +1481,19 @@ private void radioButtonActWindow_Click(object sender, System.EventArgs e) { - comboBoxCmdProperty.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + comboBoxCmdProperty.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDown; comboBoxSound.Enabled = true; comboBoxCmdProperty.Enabled = true; TreeNode node = getNode("COMMAND"); Data data = new Data("COMMAND", "WINDOW", "0"); node.Tag = data; - UpdateCombo(ref comboBoxCmdProperty, windowsListFiltered, GetFriendlyName(Enum.GetName(typeof(GUIWindow.Window), Convert.ToInt32(data.Value)))); - node.Text = "Window \"" + (string)comboBoxCmdProperty.SelectedItem + "\""; + + string friendlyName; + try { friendlyName = GetFriendlyName(Enum.GetName(typeof(GUIWindow.Window), Convert.ToInt32(data.Value))); } + catch { friendlyName = Convert.ToInt32(data.Value).ToString(); } + UpdateCombo(ref comboBoxCmdProperty, windowsListFiltered, friendlyName); + + node.Text = "Window \"" + comboBoxCmdProperty.Text + "\""; ((Data)node.Tag).Focus = checkBoxGainFocus.Checked; changedSettings = true; } @@ -1699,81 +1735,14 @@ private void comboBoxCondProperty_SelectionChangeCommitted(object sender, EventArgs e) { - TreeNode node = getNode("CONDITION"); - Data data = (Data)node.Tag; - switch ((string)data.Parameter) - { - case "WINDOW": - node.Tag = new Data("CONDITION", "WINDOW", (int)Enum.Parse(typeof(GUIWindow.Window), GetWindowName((string)comboBoxCondProperty.SelectedItem))); - node.Text = (string)comboBoxCondProperty.SelectedItem; - break; - case "FULLSCREEN": - if ((string)comboBoxCondProperty.SelectedItem == "Fullscreen") - node.Tag = new Data("CONDITION", "FULLSCREEN", "true"); - else - node.Tag = new Data("CONDITION", "FULLSCREEN", "false"); - node.Text = (string)comboBoxCondProperty.SelectedItem; - break; - case "PLAYER": - { - node.Tag = new Data("CONDITION", "PLAYER", nativePlayerList[Array.IndexOf(playerList, (string)comboBoxCondProperty.SelectedItem)]); - node.Text = (string)comboBoxCondProperty.SelectedItem; - break; - } - case "*": - break; - } - changedSettings = true; + if (comboBoxCondProperty.DropDownStyle == ComboBoxStyle.DropDownList) + ConditionPropChanged(); } private void comboBoxCmdProperty_SelectionChangeCommitted(object sender, EventArgs e) { - if ((string)comboBoxCmdProperty.SelectedItem == "Key Pressed") - textBoxKeyChar.Enabled = textBoxKeyCode.Enabled = true; - else - { - textBoxKeyChar.Enabled = textBoxKeyCode.Enabled = false; - textBoxKeyChar.Text = textBoxKeyCode.Text = String.Empty; - } - - TreeNode node = getNode("COMMAND"); - Data data = (Data)node.Tag; - switch ((string)data.Parameter) - { - case "ACTION": - if ((string)comboBoxCmdProperty.SelectedItem != "Key Pressed") - { - node.Tag = new Data("COMMAND", "ACTION", (int)Enum.Parse(typeof(Action.ActionType), GetActionName((string)comboBoxCmdProperty.SelectedItem))); - node.Text = "Action \"" + (string)comboBoxCmdProperty.SelectedItem + "\""; - } - else - { - textBoxKeyChar.Text = "0"; - textBoxKeyCode.Text = "0"; - Key key = new Key(Convert.ToInt32(textBoxKeyChar.Text), Convert.ToInt32(textBoxKeyCode.Text)); - node.Tag = new Data("COMMAND", "KEY", key); - node.Text = String.Format("Key Pressed: {0} [{1}]", textBoxKeyChar.Text, textBoxKeyCode.Text); - } - break; - case "WINDOW": - node.Tag = new Data("COMMAND", "WINDOW", (int)Enum.Parse(typeof(GUIWindow.Window), GetWindowName((string)comboBoxCmdProperty.SelectedItem))); - node.Text = "Window \"" + (string)comboBoxCmdProperty.SelectedItem + "\""; - break; - case "POWER": - node.Tag = new Data("COMMAND", "POWER", nativePowerList[Array.IndexOf(powerList, (string)comboBoxCmdProperty.SelectedItem)]); - node.Text = (string)comboBoxCmdProperty.SelectedItem; - break; - case "PROCESS": - node.Tag = new Data("COMMAND", "PROCESS", nativeProcessList[Array.IndexOf(processList, (string)comboBoxCmdProperty.SelectedItem)]); - node.Text = (string)comboBoxCmdProperty.SelectedItem; - break; - case "BLAST": - node.Tag = new Data("COMMAND", "BLAST", (string)comboBoxCmdProperty.SelectedItem); - node.Text = "Blast IR: \"" + (string)comboBoxCmdProperty.SelectedItem + "\""; - break; - } - ((Data)node.Tag).Focus = checkBoxGainFocus.Checked; - changedSettings = true; + if (comboBoxCmdProperty.DropDownStyle == ComboBoxStyle.DropDownList) + CommandPropChanged(); } private void comboBoxSound_SelectionChangeCommitted(object sender, EventArgs e) @@ -1795,9 +1764,9 @@ string keyChar = textBoxKeyChar.Text; string keyCode = textBoxKeyCode.Text; TreeNode node = getNode("COMMAND"); - if (keyChar == String.Empty) + if (String.IsNullOrEmpty(keyChar)) keyChar = "0"; - if (keyCode == String.Empty) + if (String.IsNullOrEmpty(keyCode)) keyCode = "0"; Key key = new Key(Convert.ToInt32(keyChar), Convert.ToInt32(keyCode)); node.Tag = new Data("COMMAND", "KEY", key); @@ -1842,6 +1811,109 @@ changedSettings = true; } + private void comboBoxCondProperty_KeyUp(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Enter && comboBoxCondProperty.DropDownStyle == ComboBoxStyle.DropDown) + ConditionPropChanged(); + } + + private void comboBoxCmdProperty_KeyUp(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Enter && comboBoxCmdProperty.DropDownStyle == ComboBoxStyle.DropDown) + CommandPropChanged(); + } + + private void CommandPropChanged() + { + if ((string)comboBoxCmdProperty.SelectedItem == "Key Pressed") + textBoxKeyChar.Enabled = textBoxKeyCode.Enabled = true; + else + { + textBoxKeyChar.Enabled = textBoxKeyCode.Enabled = false; + textBoxKeyChar.Text = textBoxKeyCode.Text = String.Empty; + } + + TreeNode node = getNode("COMMAND"); + Data data = (Data)node.Tag; + switch ((string)data.Parameter) + { + case "ACTION": + if ((string)comboBoxCmdProperty.SelectedItem != "Key Pressed") + { + node.Tag = new Data("COMMAND", "ACTION", (int)Enum.Parse(typeof(Action.ActionType), GetActionName((string)comboBoxCmdProperty.SelectedItem))); + node.Text = "Action \"" + (string)comboBoxCmdProperty.SelectedItem + "\""; + } + else + { + textBoxKeyChar.Text = "0"; + textBoxKeyCode.Text = "0"; + Key key = new Key(Convert.ToInt32(textBoxKeyChar.Text), Convert.ToInt32(textBoxKeyCode.Text)); + node.Tag = new Data("COMMAND", "KEY", key); + node.Text = String.Format("Key Pressed: {0} [{1}]", textBoxKeyChar.Text, textBoxKeyCode.Text); + } + break; + case "WINDOW": + { + int windowID; + try { windowID = (int)Enum.Parse(typeof(GUIWindow.Window), GetWindowName(comboBoxCmdProperty.Text)); } + catch { windowID = Convert.ToInt32(comboBoxCmdProperty.Text); } + + node.Tag = new Data("COMMAND", "WINDOW", windowID); + node.Text = "Window \"" + comboBoxCmdProperty.Text + "\""; + break; + } + case "POWER": + node.Tag = new Data("COMMAND", "POWER", nativePowerList[Array.IndexOf(powerList, (string)comboBoxCmdProperty.SelectedItem)]); + node.Text = (string)comboBoxCmdProperty.SelectedItem; + break; + case "PROCESS": + node.Tag = new Data("COMMAND", "PROCESS", nativeProcessList[Array.IndexOf(processList, (string)comboBoxCmdProperty.SelectedItem)]); + node.Text = (string)comboBoxCmdProperty.SelectedItem; + break; + case "BLAST": + node.Tag = new Data("COMMAND", "BLAST", (string)comboBoxCmdProperty.SelectedItem); + node.Text = "Blast IR: \"" + (string)comboBoxCmdProperty.SelectedItem + "\""; + break; + } + ((Data)node.Tag).Focus = checkBoxGainFocus.Checked; + changedSettings = true; + } + + private void ConditionPropChanged() + { + TreeNode node = getNode("CONDITION"); + Data data = (Data)node.Tag; + switch ((string)data.Parameter) + { + case "WINDOW": + { + int windowID; + try { windowID = (int)Enum.Parse(typeof(GUIWindow.Window), GetWindowName(comboBoxCondProperty.Text)); } + catch { windowID = Convert.ToInt32(comboBoxCondProperty.Text); } + + node.Tag = new Data("CONDITION", "WINDOW", windowID); + node.Text = comboBoxCondProperty.Text; + break; + } + case "FULLSCREEN": + if ((string)comboBoxCondProperty.SelectedItem == "Fullscreen") + node.Tag = new Data("CONDITION", "FULLSCREEN", "true"); + else + node.Tag = new Data("CONDITION", "FULLSCREEN", "false"); + node.Text = (string)comboBoxCondProperty.SelectedItem; + break; + case "PLAYER": + { + node.Tag = new Data("CONDITION", "PLAYER", nativePlayerList[Array.IndexOf(playerList, (string)comboBoxCondProperty.SelectedItem)]); + node.Text = (string)comboBoxCondProperty.SelectedItem; + break; + } + case "*": + break; + } + changedSettings = true; + } + // private TreeNode tn; // // private void treeMapping_ItemDrag(object sender, System.Windows.Forms.ItemDragEventArgs e) Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs 2007-05-19 06:45:44 UTC (rev 408) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs 2007-05-19 16:14:30 UTC (rev 409) @@ -52,7 +52,6 @@ internal static readonly string MultiMappingFile = Common.FolderAppData + "MP Control Plugin\\MultiMapping.xml"; internal static readonly string EventMappingFile = Common.FolderAppData + "MP Control Plugin\\EventMapping.xml"; - internal static readonly string ExtCfgFolder = Common.FolderAppData + "MP Control Plugin\\"; internal static readonly string RemotePresetsFolder = Common.FolderAppData + "MP Control Plugin\\Remote Presets\\"; #endregion Constants @@ -111,11 +110,6 @@ #region Properties - internal static bool IsRegistered - { - get { return _registered; } - } - internal static string ServerHost { get { return _serverHost; } @@ -762,8 +756,6 @@ while (_keepAlive && _registered && !reconnect) { - Log.Debug("MPControlPlugin: Ping ({0})", _serverHost); - int pingID = random.Next(); long pingTime = DateTime.Now.Ticks; @@ -798,15 +790,13 @@ if (receivedEcho) // Received ping echo ... { - Log.Debug("MPControlPlugin: Echo received"); - // Wait 60 seconds before re-pinging ... for (int sleeps = 0; sleeps < 60 && _keepAlive && _registered; sleeps++) Thread.Sleep(1000); } else // Didn't receive ping echo ... { - Log.Warn("MPControlPlugin: No echo, attempting to reconnect ..."); + Log.Warn("MPControlPlugin: No echo to ping, attempting to reconnect ..."); // Break out of pinging cycle ... _registered = false; @@ -825,7 +815,7 @@ PipeMessage received = PipeMessage.FromString(message); if (LogVerbose) - Log.Info("MPControlPlugin: Received Message \"{0}\"", received.Name); + Log.Debug("MPControlPlugin: Received Message \"{0}\"", received.Name); try { @@ -949,6 +939,14 @@ } static void ChangeMultiMapping(string multiMapping) { + Log.Debug("ChangeMultiMapping: {0}", multiMapping); + + if (multiMapping == "TOGGLE") + { + ChangeMultiMapping(); + return; + } + for (int index = 0; index < MultiMaps.Length; index++) { if (MultiMaps[index] == multiMapping) @@ -1087,6 +1085,8 @@ static void MapEvent(GUIMessage msg) { MappedEvent.MappingEvent eventType = MappedEvent.GetEventType(msg.Message); + if (eventType == MappedEvent.MappingEvent.None) + return; foreach (MappedEvent mappedEvent in EventMappings) { @@ -1104,45 +1104,22 @@ switch (mappedEvent.Param) { - case "Label 1": - matched = (msg.Label == paramValueString); + case "Label 1": matched = (msg.Label == paramValueString); break; + case "Label 2": matched = (msg.Label2 == paramValueString); break; + case "Label 3": matched = (msg.Label3 == paramValueString); break; + case "Label 4": matched = (msg.Label4 == paramValueString); break; + case "Parameter 1": matched = (msg.Param1 == paramValueInt); break; + case "Parameter 2": matched = (msg.Param2 == paramValueInt); break; + case "Parameter 3": matched = (msg.Param3 == paramValueInt); break; + case "Parameter 4": matched = (msg.Param4 == paramValueInt); break; + case "Sender Control ID": matched = (msg.SenderControlId == paramValueInt); break; + case "Send To Target Window": matched = (msg.SendToTargetWindow == paramValueBool); break; + case "Target Control ID": matched = (msg.TargetControlId == paramValueInt); break; + case "Target Window ID": matched = (msg.TargetWindowId == paramValueInt); break; + + default: + matched = false; break; - case "Label 2": - matched = (msg.Label2 == paramValueString); - break; - case "Label 3": - matched = (msg.Label3 == paramValueString); - break; - case "Label 4": - matched = (msg.Label4 == paramValueString); - break; - case "Parameter 1": - matched = (msg.Param1 == paramValueInt); - break; - case "Parameter 2": - matched = (msg.Param2 == paramValueInt); - break; - case "Parameter 3": - matched = (msg.Param3 == paramValueInt); - break; - case "Parameter 4": - matched = (msg.Param4 == paramValueInt); - break; - case "Sender Control ID": - matched = (msg.SenderControlId == paramValueInt); - break; - case "Send To Target Window": - matched = (msg.SendToTargetWindow == paramValueBool); - break; - case "Target Control ID": - matched = (msg.TargetControlId == paramValueInt); - break; - case "Target Window ID": - matched = (msg.TargetWindowId == paramValueInt); - break; - default: - matched = false; - break; } } Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MappedEvent.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MappedEvent.cs 2007-05-19 06:45:44 UTC (rev 408) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MappedEvent.cs 2007-05-19 16:14:30 UTC (rev 409) @@ -58,6 +58,7 @@ Tune_External_Channel, Clicked, Item_Selected, + Go_To_Window, } @@ -119,70 +120,39 @@ { switch (messageType) { - case GUIMessage.MessageType.GUI_MSG_CD_INSERTED: - return MappingEvent.CD_Inserted; - case GUIMessage.MessageType.GUI_MSG_CD_REMOVED: - return MappingEvent.CD_Ejected; - case GUIMessage.MessageType.GUI_MSG_FILE_DOWNLOADED: - return MappingEvent.File_Downloaded; - case GUIMessage.MessageType.GUI_MSG_FILE_DOWNLOADING: - return MappingEvent.File_Downloading; - case GUIMessage.MessageType.GUI_MSG_LOSTFOCUS: - return MappingEvent.Focus_Lost; - case GUIMessage.MessageType.GUI_MSG_MSN_CLOSECONVERSATION: - return MappingEvent.MSN_Close_Conversation; - case GUIMessage.MessageType.GUI_MSG_MSN_MESSAGE: - return MappingEvent.MSN_Message; - case GUIMessage.MessageType.GUI_MSG_MSN_STATUS_MESSAGE: - return MappingEvent.MSN_Status_Message; - case GUIMessage.MessageType.GUI_MSG_PLAY_AUDIO_CD: - return MappingEvent.Play_Audio_CD; - case GUIMessage.MessageType.GUI_MSG_PLAY_FILE: - return MappingEvent.Play_File; - case GUIMessage.MessageType.GUI_MSG_PLAY_ITEM: - return MappingEvent.Play_Item; - case GUIMessage.MessageType.GUI_MSG_PLAY_RADIO_STATION: - return MappingEvent.Play_Radio_Station; - case GUIMessage.MessageType.GUI_MSG_PLAYBACK_ENDED: - return MappingEvent.Playback_Ended; - case GUIMessage.MessageType.GUI_MSG_PLAYBACK_STARTED: - return MappingEvent.Playback_Started; - case GUIMessage.MessageType.GUI_MSG_PLAYBACK_STOPPED: - return MappingEvent.Playback_Stopped; - case GUIMessage.MessageType.GUI_MSG_RECORD: - return MappingEvent.Record; - case GUIMessage.MessageType.GUI_MSG_RECORDER_ABOUT_TO_START_RECORDING: - return MappingEvent.About_To_Record; - case GUIMessage.MessageType.GUI_MSG_RECORDER_START: - return MappingEvent.Recorder_Start; - case GUIMessage.MessageType.GUI_MSG_RECORDER_STOP: - return MappingEvent.Recorder_Stop; - case GUIMessage.MessageType.GUI_MSG_RECORDER_STOP_RADIO: - return MappingEvent.Recorder_Stop_Radio; - case GUIMessage.MessageType.GUI_MSG_RECORDER_STOP_TIMESHIFT: - return MappingEvent.Recorder_Stop_Timeshift; - case GUIMessage.MessageType.GUI_MSG_RECORDER_STOP_TV: - return MappingEvent.Recorder_Stop_TV; - case GUIMessage.MessageType.GUI_MSG_RECORDER_STOP_VIEWING: - return MappingEvent.Recorder_Stop_Viewing; - case GUIMessage.MessageType.GUI_MSG_RECORDER_TUNE_RADIO: - return MappingEvent.Recorder_Tune_Radio; - case GUIMessage.MessageType.GUI_MSG_RECORDER_VIEW_CHANNEL: - return MappingEvent.Recorder_View_Channel; - case GUIMessage.MessageType.GUI_MSG_RESUME_TV: - return MappingEvent.Resume_TV; - case GUIMessage.MessageType.GUI_MSG_START_SLIDESHOW: - return MappingEvent.Slideshow_Start; - case GUIMessage.MessageType.GUI_MSG_STOP_FILE: - return MappingEvent.File_Stop; - case GUIMessage.MessageType.GUI_MSG_SWITCH_FULL_WINDOWED: - return MappingEvent.Switch_Full_Windowed; - case GUIMessage.MessageType.GUI_MSG_TUNE_EXTERNAL_CHANNEL: - return MappingEvent.Tune_External_Channel; - case GUIMessage.MessageType.GUI_MSG_CLICKED: - return MappingEvent.Clicked; - case GUIMessage.MessageType.GUI_MSG_ITEM_SELECTED: - return MappingEvent.Item_Selected; + case GUIMessage.MessageType.GUI_MSG_CD_INSERTED: return MappingEvent.CD_Inserted; + case GUIMessage.MessageType.GUI_MSG_CD_REMOVED: return MappingEvent.CD_Ejected; + case GUIMessage.MessageType.GUI_MSG_FILE_DOWNLOADED: return MappingEvent.File_Downloaded; + case GUIMessage.MessageType.GUI_MSG_FILE_DOWNLOADING: return MappingEvent.File_Downloading; + case GUIMessage.MessageType.GUI_MSG_LOSTFOCUS: return MappingEvent.Focus_Lost; + case GUIMessage.MessageType.GUI_MSG_MSN_CLOSECONVERSATION: return MappingEvent.MSN_Close_Conversation; + case GUIMessage.MessageType.GUI_MSG_MSN_MESSAGE: return MappingEvent.MSN_Message; + case GUIMessage.MessageType.GUI_MSG_MSN_STATUS_MESSAGE: return MappingEvent.MSN_Status_Message; + case GUIMessage.MessageType.GUI_MSG_PLAY_AUDIO_CD: return MappingEvent.Play_Audio_CD; + case GUIMessage.MessageType.GUI_MSG_PLAY_FILE: return MappingEvent.Play_File; + case GUIMessage.MessageType.GUI_MSG_PLAY_ITEM: return MappingEvent.Play_Item; + case GUIMessage.MessageType.GUI_MSG_PLAY_RADIO_STATION: return MappingEvent.Play_Radio_Station; + case GUIMessage.MessageType.GUI_MSG_PLAYBACK_ENDED: return MappingEvent.Playback_Ended; + case GUIMessage.MessageType.GUI_MSG_PLAYBACK_STARTED: return MappingEvent.Playback_Started; + case GUIMessage.MessageType.GUI_MSG_PLAYBACK_STOPPED: return MappingEvent.Playback_Stopped; + case GUIMessage.MessageType.GUI_MSG_RECORD: return MappingEvent.Record; + case GUIMessage.MessageType.GUI_MSG_RECORDER_ABOUT_TO_START_RECORDING: return MappingEvent.About_To_Record; + case GUIMessage.MessageType.GUI_MSG_RECORDER_START: return MappingEvent.Recorder_Start; + case GUIMessage.MessageType.GUI_MSG_RECORDER_STOP: return MappingEvent.Recorder_Stop; + case GUIMessage.MessageType.GUI_MSG_RECORDER_STOP_RADIO: return MappingEvent.Recorder_Stop_Radio; + case GUIMessage.MessageType.GUI_MSG_RECORDER_STOP_TIMESHIFT: return MappingEvent.Recorder_Stop_Timeshift; + case GUIMessage.MessageType.GUI_MSG_RECORDER_STOP_TV: return MappingEvent.Recorder_Stop_TV; + case GUIMessage.MessageType.GUI_MSG_RECORDER_STOP_VIEWING: return MappingEvent.Recorder_Stop_Viewing; + case GUIMessage.MessageType.GUI_MSG_RECORDER_TUNE_RADIO: return MappingEvent.Recorder_Tune_Radio; + case GUIMessage.MessageType.GUI_MSG_RECORDER_VIEW_CHANNEL: return MappingEvent.Recorder_View_Channel; + case GUIMessage.MessageType.GUI_MSG_RESUME_TV: return MappingEvent.Resume_TV; + case GUIMessage.MessageType.GUI_MSG_START_SLIDESHOW: return MappingEvent.Slideshow_Start; + case GUIMessage.MessageType.GUI_MSG_STOP_FILE: return MappingEvent.File_Stop; + case GUIMessage.MessageType.GUI_MSG_SWITCH_FULL_WINDOWED: return MappingEvent.Switch_Full_Windowed; + case GUIMessage.MessageType.GUI_MSG_TUNE_EXTERNAL_CHANNEL: return MappingEvent.Tune_External_Channel; + case GUIMessage.MessageType.GUI_MSG_CLICKED: return MappingEvent.Clicked; + case GUIMessage.MessageType.GUI_MSG_ITEM_SELECTED: return MappingEvent.Item_Selected; + case GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW: return MappingEvent.Go_To_Window; default: return MappingEvent.None; Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs 2007-05-19 06:45:44 UTC (rev 408) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs 2007-05-19 16:14:30 UTC (rev 409) @@ -368,8 +368,6 @@ while (_keepAlive && _registered && !reconnect) { - Log.Debug("TV2BlasterPlugin: Ping ({0})", _serverHost); - int pingID = random.Next(); long pingTime = DateTime.Now.Ticks; @@ -404,15 +402,13 @@ if (receivedEcho) // Received ping echo ... { - Log.Debug("TV2BlasterPlugin: Echo received"); - // Wait 60 seconds before re-pinging ... for (int sleeps = 0; sleeps < 60 && _keepAlive && _registered; sleeps++) Thread.Sleep(1000); } else // Didn't receive ping echo ... { - Log.Warn("TV2BlasterPlugin: No echo, attempting to reconnect ..."); + Log.Warn("TV2BlasterPlugin: No echo to ping, attempting to reconnect ..."); // Break out of pinging cycle ... _registered = false; @@ -431,7 +427,7 @@ PipeMessage received = PipeMessage.FromString(message); if (LogVerbose) - Log.Info("TV2BlasterPlugin: Received Message \"{0}\"", received.Name); + Log.Debug("TV2BlasterPlugin: Received Message \"{0}\"", received.Name); try { @@ -558,7 +554,7 @@ } catch (Exception ex) { - ExternalChannelConfigs[index] = new ExternalChannelConfig(); + ExternalChannelConfigs[index] = new ExternalChannelConfig(fileName); Log.Error(ex); } } Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/MacroEditor.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/MacroEditor.cs 2007-05-19 06:45:44 UTC (rev 408) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/MacroEditor.cs 2007-05-19 16:14:30 UTC (rev 409) @@ -290,6 +290,8 @@ return; } + fileName = TV3BlasterPlugin.FolderMacros + fileName + Common.FileExtensionMacro; + WriteToFile(fileName); this.DialogResult = DialogResult.OK; Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs 2007-05-19 06:45:44 UTC (rev 408) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs 2007-05-19 16:14:30 UTC (rev 409) @@ -345,8 +345,6 @@ while (_keepAlive && _registered && !reconnect) { - Log.Debug("TV3BlasterPlugin: Ping ({0})", _serverHost); - int pingID = random.Next(); long pingTime = DateTime.Now.Ticks; @@ -381,15 +379,13 @@ if (receivedEcho) // Received ping echo ... { - Log.Debug("TV3BlasterPlugin: Echo received"); - // Wait 60 seconds before re-pinging ... for (int sleeps = 0; sleeps < 60 && _keepAlive && _registered; sleeps++) Thread.Sleep(1000); } else // Didn't receive ping echo ... { - Log.Error("TV3BlasterPlugin: No echo, attempting to reconnect ..."); + Log.Error("TV3BlasterPlugin: No echo to ping, attempting to reconnect ..."); // Break out of pinging cycle ... _registered = false; @@ -408,7 +404,7 @@ PipeMessage received =... [truncated message content] |