From: <an...@us...> - 2007-02-10 10:33:00
|
Revision: 108 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=108&view=rev Author: and-81 Date: 2007-02-10 02:32:57 -0800 (Sat, 10 Feb 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/MCEReplacement.cs Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-02-10 06:48:49 UTC (rev 107) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-02-10 10:32:57 UTC (rev 108) @@ -1776,11 +1776,14 @@ } /// <summary> - /// Given a command name this method checks if the file exists as an IR code - /// or a macro and then processes the request accordingly. + /// Given a command this method checks if the file exists as an IR + /// command, macro or other command and then processes the request + /// accordingly. /// </summary> - /// <param name="command">The command name stored in the mapping XML</param> - /// <returns>success</returns> + /// <param name="command">Command to process.</param> + /// <param name="port">Blaster port to IR commands to.</param> + /// <param name="speed">Blaster speed to execute IR commands at.</param> + /// <returns>Success.</returns> public static bool ProcessCommand(string command, MceIrApi.BlasterPort port, MceIrApi.BlasterSpeed speed) { if (String.IsNullOrEmpty(command)) @@ -1874,15 +1877,15 @@ } else if (command.StartsWith(KeyCommandPrefix)) // Keystroke Command { - string commands = command.Substring(KeyCommandPrefix.Length); + string keyCommand = command.Substring(KeyCommandPrefix.Length); if (InConfiguration) { - MessageBox.Show(commands, "Keystroke Command", MessageBoxButtons.OK, MessageBoxIcon.Information); + MessageBox.Show(keyCommand, "Keystroke Command", MessageBoxButtons.OK, MessageBoxIcon.Information); return true; } else { - return ProcessKeyCommand(commands); + return ProcessKeyCommand(keyCommand); } } else if (command.StartsWith(GoToCommandPrefix)) // Go To Screen @@ -2098,14 +2101,22 @@ /// <returns>string[] of IR Commands</returns> public static string[] GetIRList() { - string[] files = Directory.GetFiles(AppDataFolder + IRFolder, "*" + IRExtension); - string[] list = new string[files.Length]; + try + { + string[] files = Directory.GetFiles(AppDataFolder + IRFolder, "*" + IRExtension); + string[] list = new string[files.Length]; - int i = 0; - foreach (string file in files) - list[i++] = IRFolder + Path.GetFileNameWithoutExtension(file).ToUpperInvariant(); + int i = 0; + foreach (string file in files) + list[i++] = IRFolder + Path.GetFileNameWithoutExtension(file).ToUpperInvariant(); - return list; + return list; + } + catch (Exception ex) + { + Log.Error(ex.Message); + return null; + } } /// <summary> @@ -2114,14 +2125,22 @@ /// <returns>string[] of Macros</returns> public static string[] GetMacroList() { - string[] files = Directory.GetFiles(AppDataFolder + MacroFolder, "*" + MacroExtension); - string[] list = new string[files.Length]; + try + { + string[] files = Directory.GetFiles(AppDataFolder + MacroFolder, "*" + MacroExtension); + string[] list = new string[files.Length]; - int i = 0; - foreach (string file in files) - list[i++] = MacroFolder + Path.GetFileNameWithoutExtension(file).ToUpperInvariant(); + int i = 0; + foreach (string file in files) + list[i++] = MacroFolder + Path.GetFileNameWithoutExtension(file).ToUpperInvariant(); - return list; + return list; + } + catch (Exception ex) + { + Log.Error(ex.Message); + return null; + } } /// <summary> @@ -2151,16 +2170,11 @@ /// <returns>Modified string with escape codes processed</returns> public static string ReplaceEscapeCodes(string input) { - if (input == null) + if (String.IsNullOrEmpty(input)) { - Log.Error("MCEReplacement: Null escape code string"); + Log.Error("MCEReplacement: Null or empty escape code string"); return ""; } - else if (input.Length == 0) - { - Log.Warn("MCEReplacement: Empty escape code string"); - return ""; - } bool inEscapeCode = false; bool inHexCode = false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-02-18 10:56:39
|
Revision: 122 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=122&view=rev Author: and-81 Date: 2007-02-18 02:56:12 -0800 (Sun, 18 Feb 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/MCEReplacement.cs Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-02-18 09:42:47 UTC (rev 121) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-02-18 10:56:12 UTC (rev 122) @@ -839,7 +839,8 @@ if (LogVerbose) Log.Info("MCEReplacement: Tune External Channel: {0}, Tuner card: {1}", msg.Label, msg.Label2); - if (!ProcessExternalChannel(msg.Label, msg.Label2)) + //if (!ProcessExternalChannel(msg.Label, msg.Label2)) + if (!ProcessExternalChannel(msg.Label, "0")) Log.Error("MCEReplacement: Failed to process external channel request"); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2008-01-08 13:42:26
|
Revision: 1226 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1226&view=rev Author: and-81 Date: 2008-01-08 05:42:09 -0800 (Tue, 08 Jan 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/MCEReplacement.cs Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2008-01-08 13:40:21 UTC (rev 1225) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2008-01-08 13:42:09 UTC (rev 1226) @@ -1591,6 +1591,11 @@ string[] commands = Common.SplitBlastCommand(command.Substring(Common.CmdPrefixSTB.Length)); BlastIR(STBFolder + commands[0] + Common.FileExtensionIR, commands[1]); } + else if (command.StartsWith(Common.CmdPrefixPause, StringComparison.OrdinalIgnoreCase)) + { + int pauseTime = int.Parse(command.Substring(Common.CmdPrefixPause.Length)); + Thread.Sleep(pauseTime); + } else if (command.StartsWith(Common.CmdPrefixRun, StringComparison.OrdinalIgnoreCase)) { string[] commands = Common.SplitRunCommand(command.Substring(Common.CmdPrefixRun.Length)); @@ -1720,7 +1725,7 @@ } catch (Exception ex) { - if (Thread.CurrentThread.Name.Equals(ProcessCommandThreadName, StringComparison.OrdinalIgnoreCase)) + if (!String.IsNullOrEmpty(Thread.CurrentThread.Name) && Thread.CurrentThread.Name.Equals(ProcessCommandThreadName, StringComparison.OrdinalIgnoreCase)) Log.Error(ex); else throw; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |