From: <an...@us...> - 2007-08-16 05:22:47
|
Revision: 841 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=841&view=rev Author: and-81 Date: 2007-08-15 22:22:46 -0700 (Wed, 15 Aug 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs trunk/plugins/IR Server Suite/IPC/Named Pipes/PipeMessage.cs Modified: trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2007-08-15 14:22:31 UTC (rev 840) +++ trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2007-08-16 05:22:46 UTC (rev 841) @@ -28,7 +28,6 @@ static string _localPipeName; static string _blastPort = "None"; - static string _blastSpeed = "None"; static bool _treatAsChannelNumber = false; static int _padChannelNumber = 0; @@ -66,10 +65,6 @@ _blastPort = args[++index]; continue; - case "-speed": - _blastSpeed = args[++index]; - continue; - case "-channel": _treatAsChannelNumber = true; continue; @@ -126,14 +121,14 @@ foreach (char digit in channelNumber.ToString()) { - if (digit == '~') + if (digit.Equals('~')) { Thread.Sleep(500); } else { fileName = Common.FolderIRCommands + digit + Common.FileExtensionIR; - BlastIR(fileName, _blastPort, _blastSpeed); + BlastIR(fileName, _blastPort); } } } @@ -144,7 +139,7 @@ else { fileName = Common.FolderIRCommands + command; - BlastIR(fileName, _blastPort, _blastSpeed); + BlastIR(fileName, _blastPort); } } @@ -512,18 +507,16 @@ } } - static void BlastIR(string fileName, string port, string speed) + static void BlastIR(string fileName, string port) { FileStream file = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); - byte[] outData = new byte[8 + port.Length + speed.Length + file.Length]; + byte[] outData = new byte[4 + port.Length + file.Length]; BitConverter.GetBytes(port.Length).CopyTo(outData, 0); Encoding.ASCII.GetBytes(port).CopyTo(outData, 4); - BitConverter.GetBytes(speed.Length).CopyTo(outData, 4 + port.Length); - Encoding.ASCII.GetBytes(speed).CopyTo(outData, 8 + port.Length); - file.Read(outData, 8 + port.Length + speed.Length, (int)file.Length); + file.Read(outData, 4 + port.Length, (int)file.Length); file.Close(); PipeMessage message = new PipeMessage(_localPipeName, Environment.MachineName, "Blast", outData); Modified: trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2007-08-15 14:22:31 UTC (rev 840) +++ trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2007-08-16 05:22:46 UTC (rev 841) @@ -29,7 +29,6 @@ static string _localPipeName; static string _blastPort = "None"; - static string _blastSpeed = "None"; static bool _treatAsChannelNumber = false; static int _padChannelNumber = 0; @@ -65,10 +64,6 @@ _blastPort = args[++index]; continue; - case "-speed": - _blastSpeed = args[++index]; - continue; - case "-channel": _treatAsChannelNumber = true; continue; @@ -125,14 +120,14 @@ foreach (char digit in channelNumber.ToString()) { - if (digit == '~') + if (digit.Equals('~')) { Thread.Sleep(500); } else { fileName = Common.FolderIRCommands + digit + Common.FileExtensionIR; - BlastIR(fileName, _blastPort, _blastSpeed); + BlastIR(fileName, _blastPort); } } } @@ -143,7 +138,7 @@ else { fileName = Common.FolderIRCommands + command; - BlastIR(fileName, _blastPort, _blastSpeed); + BlastIR(fileName, _blastPort); } } @@ -474,18 +469,16 @@ } } - static void BlastIR(string fileName, string port, string speed) + static void BlastIR(string fileName, string port) { FileStream file = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); - byte[] outData = new byte[8 + port.Length + speed.Length + file.Length]; + byte[] outData = new byte[4 + port.Length + file.Length]; BitConverter.GetBytes(port.Length).CopyTo(outData, 0); Encoding.ASCII.GetBytes(port).CopyTo(outData, 4); - BitConverter.GetBytes(speed.Length).CopyTo(outData, 4 + port.Length); - Encoding.ASCII.GetBytes(speed).CopyTo(outData, 8 + port.Length); - file.Read(outData, 8 + port.Length + speed.Length, (int)file.Length); + file.Read(outData, 4 + port.Length, (int)file.Length); file.Close(); PipeMessage message = new PipeMessage(_localPipeName, Environment.MachineName, "Blast", outData); Modified: trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-08-15 14:22:31 UTC (rev 840) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-08-16 05:22:46 UTC (rev 841) @@ -1005,7 +1005,8 @@ break; } - SendToRepeaters(received); + if (_registeredRepeaters.Count > 0) + SendToRepeaters(received); PipeMessage response = new PipeMessage(Common.ServerPipeName, Environment.MachineName, received.Name + " Failure", null); Modified: trunk/plugins/IR Server Suite/IPC/Named Pipes/PipeMessage.cs =================================================================== --- trunk/plugins/IR Server Suite/IPC/Named Pipes/PipeMessage.cs 2007-08-15 14:22:31 UTC (rev 840) +++ trunk/plugins/IR Server Suite/IPC/Named Pipes/PipeMessage.cs 2007-08-16 05:22:46 UTC (rev 841) @@ -33,13 +33,16 @@ ForwardMouseEvent, } - public enum MessageType + [Flags] + public enum MessageTypes { - Request, - Response, - Success, - Failure, - Other, + None = 0, + Request = 1, + Response = 2, + Success = 4, + Failure = 8, + DoResponse = 16, + DontRespond = 32, } */ #endregion Enumerations This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-08-19 14:44:48
|
Revision: 846 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=846&view=rev Author: and-81 Date: 2007-08-19 07:44:46 -0700 (Sun, 19 Aug 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.Designer.cs trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.resx trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.Designer.cs trunk/plugins/IR Server Suite/Applications/Translator/Program.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/Program.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/Program.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/MessageCommand.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/SerialCommand.cs trunk/plugins/IR Server Suite/Common/IrssUtils/IrssLog.cs trunk/plugins/IR Server Suite/Common/IrssUtils/SystemRegistry.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs trunk/plugins/IR Server Suite/IR Server Suite.sln trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.Designer.cs 2007-08-18 00:46:02 UTC (rev 845) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.Designer.cs 2007-08-19 14:44:46 UTC (rev 846) @@ -53,7 +53,8 @@ this.comboBoxComputer = new System.Windows.Forms.ComboBox(); this.groupBoxCommands = new System.Windows.Forms.GroupBox(); this.comboBoxPort = new System.Windows.Forms.ComboBox(); - this.toolTip = new System.Windows.Forms.ToolTip(this.components); + this.toolTips = new System.Windows.Forms.ToolTip(this.components); + this.buttonIRBlastAutoTest = new System.Windows.Forms.Button(); this.buttonHelp = new System.Windows.Forms.Button(); this.groupBoxGenerateMessage.SuspendLayout(); this.groupBoxStatus.SuspendLayout(); @@ -70,7 +71,7 @@ this.buttonBlast.Size = new System.Drawing.Size(64, 24); this.buttonBlast.TabIndex = 2; this.buttonBlast.Text = "Blast IR"; - this.toolTip.SetToolTip(this.buttonBlast, "Blast learned IR code"); + this.toolTips.SetToolTip(this.buttonBlast, "Blast learned IR code"); this.buttonBlast.UseVisualStyleBackColor = true; this.buttonBlast.Click += new System.EventHandler(this.buttonBlast_Click); // @@ -81,7 +82,7 @@ this.buttonLearnIR.Size = new System.Drawing.Size(64, 24); this.buttonLearnIR.TabIndex = 0; this.buttonLearnIR.Text = "Learn IR"; - this.toolTip.SetToolTip(this.buttonLearnIR, "Learn an IR code"); + this.toolTips.SetToolTip(this.buttonLearnIR, "Learn an IR code"); this.buttonLearnIR.UseVisualStyleBackColor = true; this.buttonLearnIR.Click += new System.EventHandler(this.buttonLearnIR_Click); // @@ -103,7 +104,7 @@ this.buttonConnect.Size = new System.Drawing.Size(80, 24); this.buttonConnect.TabIndex = 2; this.buttonConnect.Text = "Connect"; - this.toolTip.SetToolTip(this.buttonConnect, "Connect to server"); + this.toolTips.SetToolTip(this.buttonConnect, "Connect to server"); this.buttonConnect.UseVisualStyleBackColor = true; this.buttonConnect.Click += new System.EventHandler(this.buttonConnect_Click); // @@ -115,7 +116,7 @@ this.buttonDisconnect.Size = new System.Drawing.Size(80, 24); this.buttonDisconnect.TabIndex = 3; this.buttonDisconnect.Text = "Disconnect"; - this.toolTip.SetToolTip(this.buttonDisconnect, "Disconnect from server"); + this.toolTips.SetToolTip(this.buttonDisconnect, "Disconnect from server"); this.buttonDisconnect.UseVisualStyleBackColor = true; this.buttonDisconnect.Click += new System.EventHandler(this.buttonDisconnect_Click); // @@ -127,7 +128,7 @@ this.buttonShutdownServer.Size = new System.Drawing.Size(64, 24); this.buttonShutdownServer.TabIndex = 5; this.buttonShutdownServer.Text = "Shutdown"; - this.toolTip.SetToolTip(this.buttonShutdownServer, "Shutdown server"); + this.toolTips.SetToolTip(this.buttonShutdownServer, "Shutdown server"); this.buttonShutdownServer.UseVisualStyleBackColor = true; this.buttonShutdownServer.Click += new System.EventHandler(this.buttonShutdownServer_Click); // @@ -144,7 +145,7 @@ this.listBoxStatus.ScrollAlwaysVisible = true; this.listBoxStatus.Size = new System.Drawing.Size(424, 192); this.listBoxStatus.TabIndex = 0; - this.toolTip.SetToolTip(this.listBoxStatus, "Status messages"); + this.toolTips.SetToolTip(this.listBoxStatus, "Status messages"); // // buttonCrash // @@ -154,7 +155,7 @@ this.buttonCrash.Size = new System.Drawing.Size(64, 24); this.buttonCrash.TabIndex = 6; this.buttonCrash.Text = "Crash"; - this.toolTip.SetToolTip(this.buttonCrash, "Crash this program"); + this.toolTips.SetToolTip(this.buttonCrash, "Crash this program"); this.buttonCrash.UseVisualStyleBackColor = true; this.buttonCrash.Click += new System.EventHandler(this.buttonCrash_Click); // @@ -166,7 +167,7 @@ this.buttonListConnected.Size = new System.Drawing.Size(64, 24); this.buttonListConnected.TabIndex = 8; this.buttonListConnected.Text = "# clients"; - this.toolTip.SetToolTip(this.buttonListConnected, "Get client count from server"); + this.toolTips.SetToolTip(this.buttonListConnected, "Get client count from server"); this.buttonListConnected.UseVisualStyleBackColor = true; this.buttonListConnected.Click += new System.EventHandler(this.buttonListConnected_Click); // @@ -178,7 +179,7 @@ this.buttonPing.Size = new System.Drawing.Size(64, 24); this.buttonPing.TabIndex = 7; this.buttonPing.Text = "Ping"; - this.toolTip.SetToolTip(this.buttonPing, "Ping the server"); + this.toolTips.SetToolTip(this.buttonPing, "Ping the server"); this.buttonPing.UseVisualStyleBackColor = true; this.buttonPing.Click += new System.EventHandler(this.buttonPing_Click); // @@ -205,7 +206,7 @@ this.textBoxCustom.Name = "textBoxCustom"; this.textBoxCustom.Size = new System.Drawing.Size(352, 56); this.textBoxCustom.TabIndex = 0; - this.toolTip.SetToolTip(this.textBoxCustom, "Create a custom message to send to the server"); + this.toolTips.SetToolTip(this.textBoxCustom, "Create a custom message to send to the server"); // // buttonSendCustom // @@ -215,7 +216,7 @@ this.buttonSendCustom.Size = new System.Drawing.Size(56, 24); this.buttonSendCustom.TabIndex = 1; this.buttonSendCustom.Text = "Send"; - this.toolTip.SetToolTip(this.buttonSendCustom, "Send custom message to server"); + this.toolTips.SetToolTip(this.buttonSendCustom, "Send custom message to server"); this.buttonSendCustom.UseVisualStyleBackColor = true; this.buttonSendCustom.Click += new System.EventHandler(this.buttonSendCustom_Click); // @@ -271,7 +272,7 @@ this.numericUpDownButton.TabIndex = 2; this.numericUpDownButton.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.numericUpDownButton.ThousandsSeparator = true; - this.toolTip.SetToolTip(this.numericUpDownButton, "Specify a custom button code to forward to the server"); + this.toolTips.SetToolTip(this.numericUpDownButton, "Specify a custom button code to forward to the server"); // // comboBoxRemoteButtons // @@ -283,7 +284,7 @@ this.comboBoxRemoteButtons.Name = "comboBoxRemoteButtons"; this.comboBoxRemoteButtons.Size = new System.Drawing.Size(120, 21); this.comboBoxRemoteButtons.TabIndex = 0; - this.toolTip.SetToolTip(this.comboBoxRemoteButtons, "Choose a remote control button to forward to the server"); + this.toolTips.SetToolTip(this.comboBoxRemoteButtons, "Choose a remote control button to forward to the server"); this.comboBoxRemoteButtons.SelectedIndexChanged += new System.EventHandler(this.comboBoxRemoteButtons_SelectedIndexChanged); // // buttonSendRemoteButton @@ -350,8 +351,21 @@ this.comboBoxPort.Name = "comboBoxPort"; this.comboBoxPort.Size = new System.Drawing.Size(80, 21); this.comboBoxPort.TabIndex = 3; - this.toolTip.SetToolTip(this.comboBoxPort, "Port for blasting IR"); + this.toolTips.SetToolTip(this.comboBoxPort, "Port for blasting IR"); // + // buttonIRBlastAutoTest + // + this.buttonIRBlastAutoTest.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonIRBlastAutoTest.Location = new System.Drawing.Point(336, 536); + this.buttonIRBlastAutoTest.Name = "buttonIRBlastAutoTest"; + this.buttonIRBlastAutoTest.Size = new System.Drawing.Size(112, 24); + this.buttonIRBlastAutoTest.TabIndex = 8; + this.buttonIRBlastAutoTest.Text = "IRBlast Auto-Test"; + this.toolTips.SetToolTip(this.buttonIRBlastAutoTest, "Runs a random number blasting test"); + this.buttonIRBlastAutoTest.UseVisualStyleBackColor = true; + this.buttonIRBlastAutoTest.Visible = false; + this.buttonIRBlastAutoTest.Click += new System.EventHandler(this.buttonAutoTest_Click); + // // buttonHelp // this.buttonHelp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); @@ -368,6 +382,7 @@ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(456, 566); + this.Controls.Add(this.buttonIRBlastAutoTest); this.Controls.Add(this.buttonHelp); this.Controls.Add(this.groupBoxCommands); this.Controls.Add(this.groupBoxSetup); @@ -415,10 +430,11 @@ private System.Windows.Forms.Label labelCustomButton; private System.Windows.Forms.GroupBox groupBoxSetup; private System.Windows.Forms.GroupBox groupBoxCommands; - private System.Windows.Forms.ToolTip toolTip; + private System.Windows.Forms.ToolTip toolTips; private System.Windows.Forms.ComboBox comboBoxPort; private System.Windows.Forms.ComboBox comboBoxComputer; private System.Windows.Forms.Button buttonHelp; + private System.Windows.Forms.Button buttonIRBlastAutoTest; } } Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-08-18 00:46:02 UTC (rev 845) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-08-19 14:44:46 UTC (rev 846) @@ -3,11 +3,13 @@ using System.Collections.Generic; using System.ComponentModel; using System.Data; +using System.Diagnostics; using System.Drawing; using System.IO; using System.Runtime.InteropServices; using System.Security; using System.Text; +using System.Threading; using System.Windows.Forms; using NamedPipes; @@ -587,6 +589,40 @@ #endregion Controls + Thread AutoTest; + + private void buttonAutoTest_Click(object sender, EventArgs e) + { + AutoTest = new Thread(new ThreadStart(AutoTestThread)); + AutoTest.IsBackground = true; + AutoTest.Start(); + } + + void AutoTestThread() + { + Random rand = new Random(); + + int randomNumber; + + Process process = new Process(); + process.StartInfo.FileName = "IRBlast-NoWindow.exe"; + process.StartInfo.WorkingDirectory = "C:\\Program Files\\IR Server Suite\\IR Blast\\"; + + while (true) + { + randomNumber = rand.Next(100000); + + this.Invoke(_AddStatusLine, new Object[] { String.Format("AutoTest: {0}", randomNumber) }); + + process.StartInfo.Arguments = "-host localhost -pad 4 -channel " + randomNumber.ToString(); + + process.Start(); + process.WaitForExit(); + + Thread.Sleep(10000); + } + } + } } Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.resx =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.resx 2007-08-18 00:46:02 UTC (rev 845) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.resx 2007-08-19 14:44:46 UTC (rev 846) @@ -117,7 +117,7 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <metadata name="toolTips.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>17, 17</value> </metadata> <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> Modified: trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2007-08-18 00:46:02 UTC (rev 845) +++ trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2007-08-19 14:44:46 UTC (rev 846) @@ -42,7 +42,7 @@ { // TODO: Change log level to info for release. IrssLog.LogLevel = IrssLog.Level.Debug; - IrssLog.Open(Common.FolderIrssLogs + "IR Blast.log"); + IrssLog.Append(Common.FolderIrssLogs + "IR Blast.log"); ShowHeader(); Modified: trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2007-08-18 00:46:02 UTC (rev 845) +++ trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2007-08-19 14:44:46 UTC (rev 846) @@ -43,7 +43,7 @@ { // TODO: Change log level to info for release. IrssLog.LogLevel = IrssLog.Level.Debug; - IrssLog.Open(Common.FolderIrssLogs + "IR Blast (No Window).log"); + IrssLog.Append(Common.FolderIrssLogs + "IR Blast (No Window).log"); try { Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2007-08-18 00:46:02 UTC (rev 845) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2007-08-19 14:44:46 UTC (rev 846) @@ -3,6 +3,7 @@ using System.Diagnostics; using System.IO; using System.Reflection; +using System.Threading; using System.Windows.Forms; using Microsoft.Win32; @@ -34,30 +35,34 @@ return; } - // Open log file - try - { - // TODO: Change log level to info for release. - IrssLog.LogLevel = IrssLog.Level.Debug; - IrssLog.Open(Common.FolderIrssLogs + "IR Server.log"); - } - catch (Exception ex) - { - Console.WriteLine(ex.Message); - return; - } + // TODO: Change log level to info for release. + IrssLog.LogLevel = IrssLog.Level.Debug; + IrssLog.Open(Common.FolderIrssLogs + "IR Server.log"); + Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException); + // Start Server IRServer irServer = new IRServer(); if (irServer.Start()) Application.Run(); + Application.ThreadException -= new ThreadExceptionEventHandler(Application_ThreadException); + IrssLog.Close(); - return; } /// <summary> + /// Handles unhandled exceptions. + /// </summary> + /// <param name="sender">Sender.</param> + /// <param name="e">Event args.</param> + public static void Application_ThreadException(object sender, ThreadExceptionEventArgs e) + { + IrssLog.Error(e.Exception.ToString()); + } + + /// <summary> /// Retreives a list of available IR Server plugins. /// </summary> /// <returns>Array of plugin instances.</returns> Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs 2007-08-18 00:46:02 UTC (rev 845) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs 2007-08-19 14:44:46 UTC (rev 846) @@ -81,12 +81,15 @@ void InsertKeystroke(string keystroke) { - string clipboardWas = Clipboard.GetText(); + //string clipboardWas = Clipboard.GetText(); - Clipboard.SetText(keystroke); - textBoxKeys.Paste(); + //Clipboard.SetText(keystroke); + textBoxKeys.Paste(keystroke); - Clipboard.SetText(clipboardWas); + //if (String.IsNullOrEmpty(clipboardWas)) +// Clipboard.SetText(String.Empty); + //else +// Clipboard.SetText(clipboardWas); } private void ButtonMappingForm_Load(object sender, EventArgs e) Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.Designer.cs 2007-08-18 00:46:02 UTC (rev 845) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.Designer.cs 2007-08-19 14:44:46 UTC (rev 846) @@ -75,13 +75,13 @@ this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.importToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.exportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.serverToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.quitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.translatorHelpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); - this.serverToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); this.saveFileDialog = new System.Windows.Forms.SaveFileDialog(); this.groupBoxProgram.SuspendLayout(); @@ -573,46 +573,58 @@ this.toolStripSeparator2, this.quitToolStripMenuItem}); this.configurationToolStripMenuItem.Name = "configurationToolStripMenuItem"; - this.configurationToolStripMenuItem.Size = new System.Drawing.Size(35, 20); + this.configurationToolStripMenuItem.Size = new System.Drawing.Size(37, 20); this.configurationToolStripMenuItem.Text = "&File"; // // newToolStripMenuItem // this.newToolStripMenuItem.Name = "newToolStripMenuItem"; - this.newToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.newToolStripMenuItem.Size = new System.Drawing.Size(122, 22); this.newToolStripMenuItem.Text = "&New"; this.newToolStripMenuItem.Click += new System.EventHandler(this.newToolStripMenuItem_Click); // // openToolStripMenuItem // this.openToolStripMenuItem.Name = "openToolStripMenuItem"; - this.openToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.openToolStripMenuItem.Size = new System.Drawing.Size(122, 22); this.openToolStripMenuItem.Text = "&Open ..."; this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click); // // importToolStripMenuItem // this.importToolStripMenuItem.Name = "importToolStripMenuItem"; - this.importToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.importToolStripMenuItem.Size = new System.Drawing.Size(122, 22); this.importToolStripMenuItem.Text = "&Import ..."; this.importToolStripMenuItem.Click += new System.EventHandler(this.importToolStripMenuItem_Click); // // exportToolStripMenuItem // this.exportToolStripMenuItem.Name = "exportToolStripMenuItem"; - this.exportToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.exportToolStripMenuItem.Size = new System.Drawing.Size(122, 22); this.exportToolStripMenuItem.Text = "&Export ..."; this.exportToolStripMenuItem.Click += new System.EventHandler(this.exportToolStripMenuItem_Click); // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(119, 6); + // + // serverToolStripMenuItem + // + this.serverToolStripMenuItem.Name = "serverToolStripMenuItem"; + this.serverToolStripMenuItem.Size = new System.Drawing.Size(122, 22); + this.serverToolStripMenuItem.Text = "&Server ..."; + this.serverToolStripMenuItem.Click += new System.EventHandler(this.serverToolStripMenuItem_Click); + // // toolStripSeparator2 // this.toolStripSeparator2.Name = "toolStripSeparator2"; - this.toolStripSeparator2.Size = new System.Drawing.Size(149, 6); + this.toolStripSeparator2.Size = new System.Drawing.Size(119, 6); // // quitToolStripMenuItem // this.quitToolStripMenuItem.Name = "quitToolStripMenuItem"; - this.quitToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.quitToolStripMenuItem.Size = new System.Drawing.Size(122, 22); this.quitToolStripMenuItem.Text = "&Quit"; this.quitToolStripMenuItem.Click += new System.EventHandler(this.quitToolStripMenuItem_Click); // @@ -622,35 +634,23 @@ this.translatorHelpToolStripMenuItem, this.aboutToolStripMenuItem}); this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; - this.helpToolStripMenuItem.Size = new System.Drawing.Size(40, 20); + this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20); this.helpToolStripMenuItem.Text = "&Help"; // // translatorHelpToolStripMenuItem // this.translatorHelpToolStripMenuItem.Name = "translatorHelpToolStripMenuItem"; - this.translatorHelpToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.translatorHelpToolStripMenuItem.Size = new System.Drawing.Size(122, 22); this.translatorHelpToolStripMenuItem.Text = "&Contents"; this.translatorHelpToolStripMenuItem.Click += new System.EventHandler(this.translatorHelpToolStripMenuItem_Click); // // aboutToolStripMenuItem // this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; - this.aboutToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.aboutToolStripMenuItem.Size = new System.Drawing.Size(122, 22); this.aboutToolStripMenuItem.Text = "&About"; this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click); // - // toolStripSeparator1 - // - this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(149, 6); - // - // serverToolStripMenuItem - // - this.serverToolStripMenuItem.Name = "serverToolStripMenuItem"; - this.serverToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.serverToolStripMenuItem.Text = "&Server ..."; - this.serverToolStripMenuItem.Click += new System.EventHandler(this.serverToolStripMenuItem_Click); - // // openFileDialog // this.openFileDialog.FileName = "openFileDialog1"; Modified: trunk/plugins/IR Server Suite/Applications/Translator/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2007-08-18 00:46:02 UTC (rev 845) +++ trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2007-08-19 14:44:46 UTC (rev 846) @@ -105,6 +105,8 @@ IrssLog.LogLevel = IrssLog.Level.Debug; IrssLog.Open(Common.FolderIrssLogs + "Translator.log"); + Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException); + _config = Configuration.Load(ConfigFile); if (_config == null) _config = new Configuration(); @@ -161,6 +163,8 @@ //if (_focusWatcher.IsAlive) //_focusWatcher.Abort(); + Application.ThreadException -= new ThreadExceptionEventHandler(Application_ThreadException); + IrssLog.Close(); } @@ -168,6 +172,16 @@ #region Implementation + /// <summary> + /// Handles unhandled exceptions. + /// </summary> + /// <param name="sender">Sender.</param> + /// <param name="e">Event args.</param> + public static void Application_ThreadException(object sender, ThreadExceptionEventArgs e) + { + IrssLog.Error(e.Exception.ToString()); + } + /*static void FocusWatcherThread() { try @@ -255,11 +269,11 @@ static void ShowTranslatorMenu() { UpdateForegroundWindow(); - + + //Program._mainForm.Focus(); + _notifyIcon.ContextMenuStrip.Show(Screen.PrimaryScreen.Bounds.Width / 4, Screen.PrimaryScreen.Bounds.Height / 4); - - //Win32.SetForegroundWindow(_notifyIcon.ContextMenuStrip.Handle, true); - + //_notifyIcon.ContextMenuStrip.Focus(); } Modified: trunk/plugins/IR Server Suite/Applications/Tray Launcher/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Tray Launcher/Program.cs 2007-08-18 00:46:02 UTC (rev 845) +++ trunk/plugins/IR Server Suite/Applications/Tray Launcher/Program.cs 2007-08-19 14:44:46 UTC (rev 846) @@ -1,5 +1,6 @@ using System; using System.Diagnostics; +using System.Threading; using System.Windows.Forms; using IrssUtils; @@ -9,7 +10,10 @@ static class Program { - + + /// <summary> + /// The main entry point for the application. + /// </summary> [STAThread] static void Main() { @@ -24,14 +28,28 @@ IrssLog.LogLevel = IrssLog.Level.Debug; IrssLog.Open(Common.FolderIrssLogs + "Tray Launcher.log"); + Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException); + Tray tray = new Tray(); if (tray.Start()) Application.Run(); + Application.ThreadException -= new ThreadExceptionEventHandler(Application_ThreadException); + IrssLog.Close(); } + /// <summary> + /// Handles unhandled exceptions. + /// </summary> + /// <param name="sender">Sender.</param> + /// <param name="e">Event args.</param> + public static void Application_ThreadException(object sender, ThreadExceptionEventArgs e) + { + IrssLog.Error(e.Exception.ToString()); + } + } } Modified: trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs 2007-08-18 00:46:02 UTC (rev 845) +++ trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs 2007-08-19 14:44:46 UTC (rev 846) @@ -535,7 +535,10 @@ { if (Path.GetFileName(process.MainModule.ModuleName).Equals(Path.GetFileName(_programFile), StringComparison.InvariantCultureIgnoreCase)) { - IrssLog.Info("Program already running"); + IrssLog.Info("Program already running, attempting to give focus."); + + Win32.SetForegroundWindow(process.MainWindowHandle, true); + return; } } @@ -545,7 +548,7 @@ // Launch program Process launch = new Process(); launch.StartInfo.FileName = _programFile; - launch.StartInfo.UseShellExecute = true; + launch.StartInfo.UseShellExecute = false; launch.Start(); } catch (Exception ex) Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs 2007-08-18 00:46:02 UTC (rev 845) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs 2007-08-19 14:44:46 UTC (rev 846) @@ -88,6 +88,8 @@ IrssLog.LogLevel = IrssLog.Level.Debug; IrssLog.Open(Common.FolderIrssLogs + "Virtual Remote.log"); + Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException); + LoadSettings(); if (args.Length > 0) // Command Line Start ... @@ -170,9 +172,21 @@ StopComms(); + Application.ThreadException -= new ThreadExceptionEventHandler(Application_ThreadException); + IrssLog.Close(); } + /// <summary> + /// Handles unhandled exceptions. + /// </summary> + /// <param name="sender">Sender.</param> + /// <param name="e">Event args.</param> + public static void Application_ThreadException(object sender, ThreadExceptionEventArgs e) + { + IrssLog.Error(e.Exception.ToString()); + } + static void LoadSettings() { try Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs 2007-08-18 00:46:02 UTC (rev 845) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs 2007-08-19 14:44:46 UTC (rev 846) @@ -279,10 +279,6 @@ private void MainForm_Load(object sender, EventArgs e) { - // TODO: Change log level to info for release. - IrssLog.LogLevel = IrssLog.Level.Debug; - IrssLog.Open(Common.FolderIrssLogs + "Virtual Remote Skin Editor.log"); - UpdateWindowTitle(); comboBoxShortcut.Items.Clear(); Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/Program.cs 2007-08-18 00:46:02 UTC (rev 845) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/Program.cs 2007-08-19 14:44:46 UTC (rev 846) @@ -1,7 +1,10 @@ using System; using System.Collections.Generic; +using System.Threading; using System.Windows.Forms; +using IrssUtils; + namespace SkinEditor { @@ -16,9 +19,32 @@ { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new MainForm()); + + // TODO: Change log level to info for release. + IrssLog.LogLevel = IrssLog.Level.Debug; + IrssLog.Open(Common.FolderIrssLogs + "Virtual Remote Skin Editor.log"); + + Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException); + + MainForm mainForm = new MainForm(); + + Application.Run(mainForm); + + Application.ThreadException -= new ThreadExceptionEventHandler(Application_ThreadException); + + IrssLog.Close(); } + /// <summary> + /// Handles unhandled exceptions. + /// </summary> + /// <param name="sender">Sender.</param> + /// <param name="e">Event args.</param> + public static void Application_ThreadException(object sender, ThreadExceptionEventArgs e) + { + IrssLog.Error(e.Exception.ToString()); + } + } } Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/MessageCommand.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/MessageCommand.cs 2007-08-18 00:46:02 UTC (rev 845) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/MessageCommand.cs 2007-08-19 14:44:46 UTC (rev 846) @@ -148,7 +148,7 @@ } private void radioButtonWindowTitle_CheckedChanged(object sender, EventArgs e) { - buttonFindMsgTarget.Enabled = false; + buttonFindMsgTarget.Enabled = true; textBoxMsgTarget.Enabled = true; } Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/SerialCommand.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/SerialCommand.cs 2007-08-18 00:46:02 UTC (rev 845) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/SerialCommand.cs 2007-08-19 14:44:46 UTC (rev 846) @@ -90,7 +90,7 @@ comboBoxStopBits.Items.Clear(); comboBoxStopBits.Items.AddRange(Enum.GetNames(typeof(StopBits))); - comboBoxStopBits.SelectedIndex = 0; + comboBoxStopBits.SelectedIndex = 1; } private void buttonParamQuestion_Click(object sender, EventArgs e) Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/IrssLog.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/IrssLog.cs 2007-08-18 00:46:02 UTC (rev 845) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/IrssLog.cs 2007-08-19 14:44:46 UTC (rev 846) @@ -90,6 +90,46 @@ } } } + + /// <summary> + /// Open a log file to append log entries to. + /// </summary> + /// <param name="fileName">File path, absolute.</param> + public static void Append(string fileName) + { + if (_streamWriter == null && _logLevel > Level.Off) + { + try + { + if (File.Exists(fileName) && File.GetCreationTime(fileName).Ticks < DateTime.Now.Subtract(TimeSpan.FromDays(7)).Ticks) + { + string backup = Path.ChangeExtension(fileName, ".bak"); + + if (File.Exists(backup)) + File.Delete(backup); + + File.Move(fileName, backup); + } + } + catch (Exception ex) + { + Console.WriteLine(ex.Message); + } + + try + { + _streamWriter = new StreamWriter(fileName, true); + _streamWriter.AutoFlush = true; + + string message = DateTime.Now.ToString() + ":\tLog Opened"; + _streamWriter.WriteLine(message); + } + catch (Exception ex) + { + Console.WriteLine(ex.Message); + } + } + } /// <summary> /// Close the currently open log file. @@ -100,6 +140,7 @@ { string message = DateTime.Now.ToString() + ":\tLog Closed"; _streamWriter.WriteLine(message); + _streamWriter.WriteLine(); _streamWriter.Close(); _streamWriter = null; Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/SystemRegistry.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/SystemRegistry.cs 2007-08-18 00:46:02 UTC (rev 845) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/SystemRegistry.cs 2007-08-19 14:44:46 UTC (rev 846) @@ -6,7 +6,7 @@ { /// <summary> - /// Used for accessing the Windows System Registry + /// Used for accessing the Windows System Registry. /// </summary> public static class SystemRegistry { Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs 2007-08-18 00:46:02 UTC (rev 845) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs 2007-08-19 14:44:46 UTC (rev 846) @@ -367,45 +367,21 @@ try { doc.Load(ConfigurationFile); } catch { return; } - try { _blasterType = (BlasterType)Enum.Parse(typeof(BlasterType), doc.DocumentElement.Attributes["BlastType"].Value); } - catch { _blasterType = BlasterType.Microsoft; } + try { _blasterType = (BlasterType)Enum.Parse(typeof(BlasterType), doc.DocumentElement.Attributes["BlastType"].Value); } catch {} + try { _learnTimeout = int.Parse(doc.DocumentElement.Attributes["LearnTimeout"].Value); } catch {} - try { _learnTimeout = int.Parse(doc.DocumentElement.Attributes["LearnTimeout"].Value); } - catch { _learnTimeout = 10000; } + try { _enableRemoteInput = bool.Parse(doc.DocumentElement.Attributes["EnableRemoteInput"].Value); } catch {} + try { _remoteFirstRepeat = int.Parse(doc.DocumentElement.Attributes["RemoteFirstRepeat"].Value); } catch {} + try { _remoteHeldRepeats = int.Parse(doc.DocumentElement.Attributes["RemoteHeldRepeats"].Value); } catch {} + try { _enableKeyboardInput = bool.Parse(doc.DocumentElement.Attributes["EnableKeyboardInput"].Value); } catch {} + try { _keyboardFirstRepeat = int.Parse(doc.DocumentElement.Attributes["KeyboardFirstRepeat"].Value); } catch {} + try { _keyboardHeldRepeats = int.Parse(doc.DocumentElement.Attributes["KeyboardHeldRepeats"].Value); } catch {} + try { _handleKeyboardLocally = bool.Parse(doc.DocumentElement.Attributes["HandleKeyboardLocally"].Value); } catch {} - try { _enableRemoteInput = bool.Parse(doc.DocumentElement.Attributes["EnableRemoteInput"].Value); } - catch { _enableRemoteInput = true; } - - try { _remoteFirstRepeat = int.Parse(doc.DocumentElement.Attributes["RemoteFirstRepeat"].Value); } - catch { _remoteFirstRepeat = 400; } - - try { _remoteHeldRepeats = int.Parse(doc.DocumentElement.Attributes["RemoteHeldRepeats"].Value); } - catch { _remoteHeldRepeats = 250; } - - - try { _enableKeyboardInput = bool.Parse(doc.DocumentElement.Attributes["EnableKeyboardInput"].Value); } - catch { _enableKeyboardInput = true; } - - try { _keyboardFirstRepeat = int.Parse(doc.DocumentElement.Attributes["KeyboardFirstRepeat"].Value); } - catch { _keyboardFirstRepeat = 350; } - - try { _keyboardHeldRepeats = int.Parse(doc.DocumentElement.Attributes["KeyboardHeldRepeats"].Value); } - catch { _keyboardHeldRepeats = 0; } - - try { _handleKeyboardLocally = bool.Parse(doc.DocumentElement.Attributes["HandleKeyboardLocally"].Value); } - catch { _handleKeyboardLocally = true; } - - - try { _enableMouseInput = bool.Parse(doc.DocumentElement.Attributes["EnableMouseInput"].Value); } - catch { _enableMouseInput = true; } - - try { _handleMouseLocally = bool.Parse(doc.DocumentElement.Attributes["HandleMouseLocally"].Value); } - catch { _handleMouseLocally = true; } - - try { _mouseSensitivity = double.Parse(doc.DocumentElement.Attributes["MouseSensitivity"].Value); } - catch { _mouseSensitivity = 1.0d; } - + try { _enableMouseInput = bool.Parse(doc.DocumentElement.Attributes["EnableMouseInput"].Value); } catch {} + try { _handleMouseLocally = bool.Parse(doc.DocumentElement.Attributes["HandleMouseLocally"].Value); } catch {} + try { _mouseSensitivity = double.Parse(doc.DocumentElement.Attributes["MouseSensitivity"].Value); } catch {} } void SaveSettings() { @@ -472,7 +448,7 @@ Guid deviceClass; string devicePath = null; - // Try eHome driver ... + // Try XP eHome driver ... deviceClass = new Guid(0x7951772d, 0xcd50, 0x49b7, 0xb1, 0x03, 0x2b, 0xaa, 0xc4, 0x94, 0xfc, 0x57); _replacementDriver = false; try @@ -493,6 +469,17 @@ catch { } } + // Try Vista eHome driver ... + /*if (devicePath == null) + { + deviceClass = new Guid(0x36fc9e60, 0xc465, 0x11cf, 0x80, 0x56, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00); + try + { + devicePath = DeviceAccess.FindDevice(deviceClass); + } + catch { } + }*/ + if (devicePath == null) throw new Exception("No MCE Transceiver detected"); @@ -692,7 +679,7 @@ if (_remoteButtonHandler != null) _remoteButtonHandler(keyCode.ToString()); - //Console.WriteLine("Remote button: {0} - {1}", codeType, keyCode); + //String.Format("{0}: {1}", Enum.GetName(typeof(IRProtocol), codeType), keyCode); } void KeyboardEvent(uint keyCode, uint modifiers) { Modified: trunk/plugins/IR Server Suite/IR Server Suite.sln =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite.sln 2007-08-18 00:46:02 UTC (rev 845) +++ trunk/plugins/IR Server Suite/IR Server Suite.sln 2007-08-19 14:44:46 UTC (rev 846) @@ -2,75 +2,233 @@ Microsoft Visual Studio Solution File, Format Version 9.00 # Visual Studio 2005 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Applications", "Applications", "{0C209E91-5AD5-4662-AD0E-976A940D4806}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IR Server", "Applications\IR Server\IR Server.csproj", "{D2A1F8D6-A9D3-4BFA-913B-8806642BD0DA}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tray Launcher", "Applications\Tray Launcher\Tray Launcher.csproj", "{0C894165-4BE8-4CF7-8F92-2B6DF68EB43A}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Debug Client", "Applications\Debug Client\Debug Client.csproj", "{4CD051F4-F2B5-47B3-8647-F47C2E4DC131}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Translator", "Applications\Translator\Translator.csproj", "{A8B8B9C6-9E88-486B-AE9C-F2D945ED05A6}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Virtual Remote", "Applications\Virtual Remote\Virtual Remote.csproj", "{46C08F6B-F3C8-461B-9B6F-3BFD4AAAFD63}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Virtual Remote Skin Editor", "Applications\Virtual Remote Skin Editor\Virtual Remote Skin Editor.csproj", "{D871AB9A-71B3-4D63-8320-084BAD75064E}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IR Server Plugins", "IR Server Plugins", "{0D1620EE-01B9-43B5-9FAA-E983BD9EBDBD}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IPC", "IPC", "{0E9CCB69-CEF0-4680-816B-18E949DEA727}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppModule.InterProcessComm", "IPC\AppModule.InterProcessComm\AppModule.InterProcessComm.csproj", "{E98F1F7E-40B6-44C8-AC66-EC867B141FA1}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppModule.NamedPipes", "IPC\AppModule.NamedPipes\AppModule.NamedPipes.csproj", "{077B53BB-404A-4B2F-BA17-AAE98C5E9C66}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Named Pipes", "IPC\Named Pipes\Named Pipes.csproj", "{F4EA6055-7133-4F18-8971-E19ADEB482C1}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MediaPortal Plugins", "MediaPortal Plugins", "{6C18D808-E5ED-4CFB-A7CD-E2BDBB1D9BDA}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MP Control Plugin", "MediaPortal Plugins\MP Control Plugin\MP Control Plugin.csproj", "{E8BEBBCC-1EE0-488D-8806-98ADCB7F0479}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TV2 Blaster Plugin", "MediaPortal Plugins\TV2 Blaster Plugin\TV2 Blaster Plugin.csproj", "{7946D42A-4BCB-4D79-80EB-BA9B17CE2E90}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TV3 Blaster Plugin", "MediaPortal Plugins\TV3 Blaster Plugin\TV3 Blaster Plugin.csproj", "{CD395FC2-70E2-42C4-8A20-5469A0C5EB50}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IgorPlug USB Receiver", "IR Server Plugins\IgorPlug USB Receiver\IgorPlug USB Receiver.csproj", "{A4023992-CCD6-461E-8E14-219A496734C5}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IRMan Receiver", "IR Server Plugins\IRMan Receiver\IRMan Receiver.csproj", "{7C686499-7517-4338-8837-7E8617549D9A}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft MCE Transceiver", "IR Server Plugins\Microsoft MCE Transceiver\Microsoft MCE Transceiver.csproj", "{BABC30EB-7D0F-4398-9FCB-E517EA8D2AA9}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "USB-UIRT Transceiver", "IR Server Plugins\USB-UIRT Transceiver\USB-UIRT Transceiver.csproj", "{99B5CA78-3E0B-477F-A7D3-EE1B65E85DE4}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Windows Message Receiver", "IR Server Plugins\Windows Message Receiver\Windows Message Receiver.csproj", "{4CBA81F9-F0C2-4242-8D72-204597285042}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XBCDRC Receiver", "IR Server Plugins\XBCDRC Receiver\XBCDRC Receiver.csproj", "{2B9C6BE9-98D0-4D69-B041-57EE5D2DFB97}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MP Blast Zone Plugin", "MediaPortal Plugins\MP Blast Zone Plugin\MP Blast Zone Plugin.csproj", "{907DCA39-A5E0-4EFA-B1F6-5FBE2C1BCD25}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IRTrans Transceiver", "IR Server Plugins\IRTrans Transceiver\IRTrans Transceiver.csproj", "{883913F6-F4A7-4DE2-846A-C2102FAF499E}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "X10 Transceiver", "IR Server Plugins\X10 Transceiver\X10 Transceiver.csproj", "{253FFB14-AB8E-49AB-A005-A42428C3F452}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FusionREMOTE Receiver", "IR Server Plugins\FusionRemote Receiver\FusionREMOTE Receiver.csproj", "{9FDD649E-0502-4FED-9AC1-AA0346394375}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common", "Common", "{E757F80C-23C5-4AD6-B178-16799E337E03}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IrssUtils", "Common\IrssUtils\IrssUtils.csproj", "{CA15769C-232E-4CA7-94FD-206A06CA3ABB}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MPUtils", "Common\MPUtils\MPUtils.csproj", "{08F57DD7-2C6E-484E-9CC5-835F70C5BC64}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IR Server Plugin Interface", "IR Server Plugins\IR Server Plugin Interface\IR Server Plugin Interface.csproj", "{D8B3D28F-62CE-4CA7-86CE-B7EAD614A94C}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinLirc Receiver", "IR Server Plugins\WinLirc Receiver\WinLirc Receiver.csproj", "{E6A68244-8C31-44A9-9F85-B4A102B5F209}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Custom HID Receiver", "IR Server Plugins\Custom HID Receiver\Custom HID Receiver.csproj", "{0F6576B4-C88E-4E79-B7E9-9480498C5A32}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IR Blast", "Applications\IR Blast\IR Blast.csproj", "{C6B0CF12-01D3-439A-9FB4-DEFD5B32F6FB}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IR Blast (No Window)", "Applications\IR Blast (No Window)\IR Blast (No Window).csproj", "{54E0E8FA-09C3-4755-B9CE-E7E5DDA3E932}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IrssComms", "Common\IrssComms\IrssComms.csproj", "{BCAFDF45-70DD-46FD-8B98-880DDA585AD2}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sage Setup", "Applications\SageSetup\Sage Setup.csproj", "{905131F8-F8AC-4A65-A722-37783902D7B8}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SMS Keyboard", "Applications\SMS Keyboard\SMS Keyboard.csproj", "{A533F58F-2402-47CF-A258-377A669DB56F}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IR File Tool", "Applications\IR File Tool\IR File Tool.csproj", "{B5E711A2-E6D0-4BEA-B66B-7A8B0BCA6A4D}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -306,11 +464,32 @@ {54E0E8FA-09C3-4755-B9CE-E7E5DDA3E932}.Release|x86.ActiveCfg = Release|x86 {54E0E8FA-09C3-4755-B9CE-E7E5DDA3E932}.Release|x86.Build.0 = Release|x86 {BCAFDF45-70DD-46FD-8B98-880DDA585AD2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BCAFDF45-70DD-46FD-8B98-880DDA585AD2}.Debug|Any CPU.Build.0 = Debug|Any CPU {BCAFDF45-70DD-46FD-8B98-880DDA585AD2}.Debug|x86.ActiveCfg = Debug|Any CPU {BCAFDF45-70DD-46FD-8B98-880DDA585AD2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BCAFDF45-70DD-46FD-8B98-880DDA585AD2}.Release|Any CPU.Build.0 = Release|Any CPU {BCAFDF45-70DD-46FD-8B98-880DDA585AD2}.Release|x86.ActiveCfg = Release|Any CPU + {905131F8-F8AC-4A65-A722-37783902D7B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {905131F8-F8AC-4A65-A722-37783902D7B8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {905131F8-F8AC-4A65-A722-37783902D7B8}.Debug|x86.ActiveCfg = Debug|x86 + {905131F8-F8AC-4A65-A722-37783902D7B8}.Debug|x86.Build.0 = Debug|x86 + {905131F8-F8AC-4A65-A722-37783902D7B8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {905131F8-F8AC-4A65-A722-37783902D7B8}.Release|Any CPU.Build.0 = Release|Any CPU + {905131F8-F8AC-4A65-A722-37783902D7B8}.Release|x86.ActiveCfg = Release|x86 + {905131F8-F8AC-4A65-A722-37783902D7B8}.Release|x86.Build.0 = Release|x86 + {A533F58F-2402-47CF-A258-377A669DB56F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A533F58F-2402-47CF-A258-377A669DB56F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A533F58F-2402-47CF-A258-377A669DB56F}.Debug|x86.ActiveCfg = Debug|x86 + {A533F58F-2402-47CF-A258-377A669DB56F}.Debug|x86.Build.0 = Debug|x86 + {A533F58F-2402-47CF-A258-377A669DB56F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A533F58F-2402-47CF-A258-377A669DB56F}.Release|Any CPU.Build.0 = Release|Any CPU + {A533F58F-2402-47CF-A258-377A669DB56F}.Release|x86.ActiveCfg = Release|x86 + {A533F58F-2402-47CF-A258-377A669DB56F}.Release|x86.Build.0 = Release|x86 + {B5E711A2-E6D0-4BEA-B66B-7A8B0BCA6A4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B5E711A2-E6D0-4BEA-B66B-7A8B0BCA6A4D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B5E711A2-E6D0-4BEA-B66B-7A8B0BCA6A4D}.Debug|x86.ActiveCfg = Debug|Any CPU + {B5E711A2-E6D0-4BEA-B66B-7A8B0BCA6A4D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B5E711A2-E6D0-4BEA-B66B-7A8B0BCA6A4D}.Release|Any CPU.Build.0 = Release|Any CPU + {B5E711A2-E6D0-4BEA-B66B-7A8B0BCA6A4D}.Release|x86.ActiveCfg = Release|x86 + {B5E711A2-E6D0-4BEA-B66B-7A8B0BCA6A4D}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -324,6 +503,9 @@ {D871AB9A-71B3-4D63-8320-084BAD75064E} = {0C209E91-5AD5-4662-AD0E-976A940D4806} {C6B0CF12-01D3-439A-9FB4-DEFD5B32F6FB} = {0C209E91-5AD5-4662-AD0E-976A940D4806} {54E0E8FA-09C3-4755-B9CE-E7E5DDA3E932} = {0C209E91-5AD5-4662-AD0E-976A940D4806} + {905131F8-F8AC-4A65-A722-37783902D7B8} = {0C209E91-5AD5-4662-AD0E-976A940D4806} + {A533F58F-2402-47CF-A258-377A669DB56F} = {0C209E91-5AD5-4662-AD0E-976A940D4806} + {B5E711A2-E6D0-4BEA-B66B-7A8B0BCA6A4D} = {0C209E91-5AD5-4662-AD0E-976A940D4806} {A4023992-CCD6-461E-8E14-219A496734C5} = {0D1620EE-01B9-43B5-9FAA-E983BD9EBDBD} {7C686499-7517-4338-8837-7E8617549D9A} = {0D1620EE-01B9-43B5-9FAA-E983BD9EBDBD} {BABC30EB-7D0F-4398-9FCB-E517EA8D2AA9} = {0D1620EE-01B9-43B5-9FAA-E983BD9EBDBD} 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-08-18 00:46:02 UTC (rev 845) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs 2007-08-19 14:44:46 UTC (rev 846) @@ -862,6 +862,11 @@ string[] commands = Common.SplitBlastCommand(command.Substring(Common.CmdPrefixBlast.Length)); BlastIR(Common.FolderIRCommands + commands[0] + Common.FileExtensionIR, commands[1]); } + else if (command.StartsWith(Common.CmdPrefixSTB)) // STB IR Code + { + string[] commands = Common.SplitBlastCommand(command.Substring(Common.CmdPrefixSTB.Length)); + BlastIR(Common.FolderSTB + commands[0], commands[1]); + } else if (command.StartsWith(Common.CmdPrefixRun)) // External Program { string[] commands = Common.SplitRunCommand(command.Substring(Common.CmdPrefixRun.Length)); 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-08-18 00:46:02 UTC (rev 845) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs 2007-08-19 14:44:46 UTC (rev 846) @@ -802,6 +802,11 @@ string[] commands = Common.SplitBlastCommand(command.Substring(Common.CmdPrefixBlast.Length)); BlastIR(Common.FolderIRCommands + commands[0] + Common.FileExtensionIR, commands[1]); } + else if (command.StartsWith(Common.CmdPrefixSTB)) // STB IR Code + { + string[] commands = Common.SplitBlastCommand(command.Substring(Common.CmdPrefixSTB.Length)); + BlastIR(Common.FolderSTB + commands[0], commands[1]); + } else if (command.StartsWith(Common.CmdPrefixRun)) // External Program { string[] commands = Common.SplitRunCommand(command.Substring(Common.CmdPrefixRun.Length)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Sourc... [truncated message content] |
From: <an...@us...> - 2007-08-21 07:08:18
|
Revision: 849 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=849&view=rev Author: and-81 Date: 2007-08-21 00:08:08 -0700 (Tue, 21 Aug 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 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/Program.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/LearnIR.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/LearnIR.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/LearnIR.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/LearnIR.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-08-20 08:53:11 UTC (rev 848) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-08-21 07:08:08 UTC (rev 849) @@ -171,7 +171,6 @@ { case "Blast Success": case "Blast Failure": - case "Start Learn": case "Keyboard Event": case "Mouse Event": return; Modified: trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-08-20 08:53:11 UTC (rev 848) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-08-21 07:08:08 UTC (rev 849) @@ -878,14 +878,14 @@ { IrssLog.Debug("Learn IR"); - Thread.Sleep(500); - if (_pluginTransmit == null || !_pluginTransmit.CanLearn) { IrssLog.Debug("Active transceiver doesn't support learn"); return null; } + Thread.Sleep(500); + byte[] data = null; try @@ -902,7 +902,7 @@ break; case LearnStatus.Timeout: - IrssLog.Error("IR Code learn timed out"); + IrssLog.Warn("IR Code learn timed out"); break; } } @@ -1026,13 +1026,6 @@ break; } - // Pause half a second before instructing the client to start the IR learning ... - Thread.Sleep(500); - - // Send back a "Start Learn" trigger ... - PipeMessage trigger = new PipeMessage(Common.ServerPipeName, Environment.MachineName, "Start Learn", null); - SendTo(received.FromPipe, received.FromServer, trigger); - // Prepare response ... PipeMessage response = new PipeMessage(Common.ServerPipeName, Environment.MachineName, received.Name + " Failure", null); Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2007-08-20 08:53:11 UTC (rev 848) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2007-08-21 07:08:08 UTC (rev 849) @@ -104,7 +104,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString(), "IR Server Unexpected Error"); + MessageBox.Show(ex.ToString(), "IR Server Plugin Error"); } } Modified: trunk/plugins/IR Server Suite/Applications/Translator/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2007-08-20 08:53:11 UTC (rev 848) +++ trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2007-08-21 07:08:08 UTC (rev 849) @@ -912,7 +912,6 @@ { switch (received.Name) { - case "Start Learn": case "Blast Success": break; Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs 2007-08-20 08:53:11 UTC (rev 848) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs 2007-08-21 07:08:08 UTC (rev 849) @@ -106,12 +106,12 @@ int _remoteFirstRepeat = 400; int _remoteHeldRepeats = 250; - bool _enableKeyboardInput = true; + bool _enableKeyboardInput = false; int _keyboardFirstRepeat = 350; int _keyboardHeldRepeats = 0; bool _handleKeyboardLocally = true; - bool _enableMouseInput = true; + bool _enableMouseInput = false; bool _handleMouseLocally = true; double _mouseSensitivity = 1.0d; @@ -315,31 +315,20 @@ Thread.Sleep(100); } - LearnStatus status = LearnStatus.Failure; - if (_learning) { _learning = false; - try - { - DeviceAccess.CancelDeviceIo(_readStream.SafeFileHandle); - } - catch { } - - status = LearnStatus.Timeout; + return LearnStatus.Timeout; } else if (_learnedNativeData != null && _learnedNativeData.Count > 0) { data = _learnedNativeData.ToArray(); - status = LearnStatus.Success; + return LearnStatus.Success; } - - // Start a new read ... - _readStream.BeginRead(_deviceBuffer, 0, _deviceBuffer.Length, new AsyncCallback(OnReadComplete), null); - return status; + return LearnStatus.Failure; } public bool SetPort(string port) @@ -469,17 +458,6 @@ catch { } } - // Try Vista eHome driver ... - /*if (devicePath == null) - { - deviceClass = new Guid(0x36fc9e60, 0xc465, 0x11cf, 0x80, 0x56, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00); - try - { - devicePath = DeviceAccess.FindDevice(deviceClass); - } - catch { } - }*/ - if (devicePath == null) throw new Exception("No MCE Transceiver detected"); Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/LearnIR.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/LearnIR.cs 2007-08-20 08:53:11 UTC (rev 848) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/LearnIR.cs 2007-08-21 07:08:08 UTC (rev 849) @@ -101,6 +101,8 @@ } } + #region Buttons + private void buttonLearn_Click(object sender, EventArgs e) { string command = textBoxName.Text.Trim(); @@ -164,6 +166,8 @@ } } + #endregion Buttons + } } 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-08-20 08:53:11 UTC (rev 848) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MPBlastZonePlugin.cs 2007-08-21 07:08:08 UTC (rev 849) @@ -563,7 +563,6 @@ { switch (received.Name) { - case "Start Learn": case "Blast Success": case "Remote Event": case "Keyboard Event": Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/LearnIR.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/LearnIR.cs 2007-08-20 08:53:11 UTC (rev 848) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/LearnIR.cs 2007-08-21 07:08:08 UTC (rev 849) @@ -101,6 +101,8 @@ } } + #region Buttons + private void buttonLearn_Click(object sender, EventArgs e) { string command = textBoxName.Text.Trim(); @@ -153,9 +155,18 @@ if (command.Length == 0) return; - MPControlPlugin.BlastIR(Common.FolderIRCommands + command + Common.FileExtensionIR, - comboBoxPort.SelectedItem as string); + try + { + MPControlPlugin.BlastIR(Common.FolderIRCommands + command + Common.FileExtensionIR, + comboBoxPort.SelectedItem as string); + } + catch (Exception ex) + { + MessageBox.Show(this, ex.Message, "Test failed", MessageBoxButtons.OK, MessageBoxIcon.Error); + } } + + #endregion Buttons } 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-08-20 08:53:11 UTC (rev 848) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs 2007-08-21 07:08:08 UTC (rev 849) @@ -823,7 +823,6 @@ { switch (received.Name) { - case "Start Learn": case "Blast Success": case "Keyboard Event": case "Mouse Event": @@ -1538,7 +1537,7 @@ BitConverter.GetBytes(port.Length).CopyTo(outData, 0); Encoding.ASCII.GetBytes(port).CopyTo(outData, 4); - file.Read(outData, 8 + port.Length, (int)file.Length); + file.Read(outData, 4 + port.Length, (int)file.Length); file.Close(); PipeMessage message = new PipeMessage(_localPipeName, Environment.MachineName, "Blast", outData); Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/LearnIR.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/LearnIR.cs 2007-08-20 08:53:11 UTC (rev 848) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/LearnIR.cs 2007-08-21 07:08:08 UTC (rev 849) @@ -101,6 +101,8 @@ } } + #region Buttons + private void buttonLearn_Click(object sender, EventArgs e) { string command = textBoxName.Text.Trim(); @@ -164,6 +166,8 @@ } } + #endregion Buttons + } } 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-08-20 08:53:11 UTC (rev 848) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs 2007-08-21 07:08:08 UTC (rev 849) @@ -436,7 +436,6 @@ { switch (received.Name) { - case "Start Learn": case "Blast Success": case "Remote Event": case "Keyboard Event": Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/LearnIR.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/LearnIR.cs 2007-08-20 08:53:11 UTC (rev 848) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/LearnIR.cs 2007-08-21 07:08:08 UTC (rev 849) @@ -101,6 +101,8 @@ } } + #region Buttons + private void buttonLearn_Click(object sender, EventArgs e) { string command = textBoxName.Text.Trim(); @@ -164,6 +166,8 @@ } } + #endregion Buttons + } } 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-08-20 08:53:11 UTC (rev 848) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs 2007-08-21 07:08:08 UTC (rev 849) @@ -413,7 +413,6 @@ { switch (received.Name) { - case "Start Learn": case "Blast Success": case "Remote Event": case "Keyboard Event": This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-08-22 14:37:57
|
Revision: 855 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=855&view=rev Author: and-81 Date: 2007-08-22 07:37:54 -0700 (Wed, 22 Aug 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs 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/EditProgramForm.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/Applications/Virtual Remote/Program.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/ExternalProgram.cs trunk/plugins/IR Server Suite/Common/IrssUtils/IrssUtils.csproj trunk/plugins/IR Server Suite/Common/MPUtils/ExternalChannelConfig.cs trunk/plugins/IR Server Suite/Common/MPUtils/MPCommands.cs trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IRServerPluginInterface.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/UirtTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Receiver/WinLirc Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Receiver/WinLircServer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Windows Message Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Windows Message Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/X10Transceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/XBCDRC Receiver/XBCDRC Receiver.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/SetupForm.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/MP Control Plugin/MappedKeyCode.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs Added Paths: ----------- trunk/plugins/IR Server Suite/Common/IrssUtils/IRServerInfo.cs Removed Paths: ------------- trunk/plugins/IR Server Suite/Common/IrssUtils/TransceiverInfo.cs Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -110,7 +110,7 @@ //static bool _keepAlive = true; static int _echoID = -1; - TransceiverInfo _transceiverInfo = new TransceiverInfo(); + IRServerInfo _irServerInfo = new IRServerInfo(); #endregion Variables @@ -184,10 +184,10 @@ case "Register Success": { - _transceiverInfo = TransceiverInfo.FromBytes(received.Data); + _irServerInfo = IRServerInfo.FromBytes(received.Data); comboBoxPort.Items.Clear(); - comboBoxPort.Items.AddRange(_transceiverInfo.Ports); + comboBoxPort.Items.AddRange(_irServerInfo.Ports); comboBoxPort.SelectedIndex = 0; return; } @@ -418,9 +418,9 @@ return; } - if (!_transceiverInfo.CanTransmit) + if (!_irServerInfo.CanTransmit) { - AddStatusLine(String.Format("Transceiver: \"{0}\" doesn't blast.", _transceiverInfo.Name)); + AddStatusLine("IR Server is not setup to blast"); return; } @@ -437,9 +437,9 @@ return; } - if (!_transceiverInfo.CanLearn) + if (!_irServerInfo.CanLearn) { - AddStatusLine(String.Format("Transceiver: \"{0}\" doesn't support learning", _transceiverInfo.Name)); + AddStatusLine("IR Server is not setup to support learning"); return; } @@ -556,7 +556,7 @@ return; } - int keyCode = (int)Enum.Parse(typeof(MceButton), comboBoxRemoteButtons.SelectedItem.ToString()); + int keyCode = (int)Enum.Parse(typeof(MceButton), comboBoxRemoteButtons.SelectedItem.ToString(), true); if (keyCode == -1) keyCode = Decimal.ToInt32(numericUpDownButton.Value); Modified: trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -464,7 +464,7 @@ { Info("Registered to IR Server"); _registered = true; - //_transceiverInfo = TransceiverInfo.FromBytes(received.Data); + //_irServerInfo = TransceiverInfo.FromBytes(received.Data); break; } Modified: trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -426,7 +426,7 @@ { IrssLog.Info("Registered to IR Server"); _registered = true; - //_transceiverInfo = TransceiverInfo.FromBytes(received.Data); + //_irServerInfo = TransceiverInfo.FromBytes(received.Data); break; } Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -20,7 +20,7 @@ #region Variables - IIRServerPlugin[] _transceivers; + IRServerPlugin[] _transceivers; #endregion Variables @@ -185,7 +185,7 @@ row++; - foreach (IIRServerPlugin transceiver in _transceivers) + foreach (IRServerPlugin transceiver in _transceivers) { gridPlugins.Rows.Insert(row); @@ -200,7 +200,7 @@ gridPlugins[row, 0] = nameCell; - if (transceiver.CanReceive) + if (transceiver is IRemoteReceiver) { SourceGrid.Cells.CheckBox checkbox = new SourceGrid.Cells.CheckBox(); @@ -213,7 +213,7 @@ else gridPlugins[row, 1] = new SourceGrid.Cells.Cell(); - if (transceiver.CanTransmit) + if (transceiver is ITransmitIR) { SourceGrid.Cells.CheckBox checkbox = new SourceGrid.Cells.CheckBox(); @@ -226,7 +226,7 @@ else gridPlugins[row, 2] = new SourceGrid.Cells.Cell(); - if (transceiver.CanConfigure) + if (transceiver is IConfigure) { SourceGrid.Cells.Button button = new SourceGrid.Cells.Button("Configure"); @@ -282,9 +282,9 @@ string plugin = gridPlugins[cell.Row.Index, 0].DisplayText; - foreach (IIRServerPlugin transceiver in _transceivers) + foreach (IRServerPlugin transceiver in _transceivers) if (transceiver.Name == plugin) - transceiver.Configure(); + (transceiver as IConfigure).Configure(); } private void ReceiveChanged(object sender, EventArgs e) Modified: trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -69,10 +69,10 @@ bool _registered = false; string _pluginNameReceive = String.Empty; - IIRServerPlugin _pluginReceive = null; + IRServerPlugin _pluginReceive = null; string _pluginNameTransmit = String.Empty; - IIRServerPlugin _pluginTransmit = null; + IRServerPlugin _pluginTransmit = null; bool _inConfiguration = false; @@ -204,11 +204,16 @@ } } - if (_pluginReceive != null && _pluginReceive.CanReceive) + if (_pluginReceive != null) { - _pluginReceive.RemoteCallback += new RemoteHandler(RemoteHandlerCallback); - _pluginReceive.KeyboardCallback += new KeyboardHandler(KeyboardHandlerCallback); - _pluginReceive.MouseCallback += new MouseHandler(MouseHandlerCallback); + if (_pluginReceive is IRemoteReceiver) + (_pluginReceive as IRemoteReceiver).RemoteCallback += new RemoteHandler(RemoteHandlerCallback); + + if (_pluginReceive is IKeyboardReceiver) + (_pluginReceive as IKeyboardReceiver).KeyboardCallback += new KeyboardHandler(KeyboardHandlerCallback); + + if (_pluginReceive is IMouseReceiver) + (_pluginReceive as IMouseReceiver).MouseCallback += new MouseHandler(MouseHandlerCallback); } _notifyIcon.Visible = true; @@ -239,11 +244,16 @@ SendToAll(message); } - if (_pluginReceive != null && _pluginReceive.CanReceive) + if (_pluginReceive != null) { - _pluginReceive.RemoteCallback -= new RemoteHandler(RemoteHandlerCallback); - _pluginReceive.KeyboardCallback -= new KeyboardHandler(KeyboardHandlerCallback); - _pluginReceive.MouseCallback -= new MouseHandler(MouseHandlerCallback); + if (_pluginReceive is IRemoteReceiver) + (_pluginReceive as IRemoteReceiver).RemoteCallback -= new RemoteHandler(RemoteHandlerCallback); + + if (_pluginReceive is IKeyboardReceiver) + (_pluginReceive as IKeyboardReceiver).KeyboardCallback -= new KeyboardHandler(KeyboardHandlerCallback); + + if (_pluginReceive is IMouseReceiver) + (_pluginReceive as IMouseReceiver).MouseCallback -= new MouseHandler(MouseHandlerCallback); } // Stop Plugin(s) @@ -301,7 +311,7 @@ } } - bool Configure() + void Configure() { _inConfiguration = true; @@ -315,14 +325,23 @@ if (config.ShowDialog() == DialogResult.OK) { - _mode = config.Mode; - _hostComputer = config.HostComputer; - _pluginNameReceive = config.PluginReceive; - _pluginNameTransmit = config.PluginTransmit; + if ((_mode != config.Mode) || + (_hostComputer != config.HostComputer) || + (_pluginNameReceive != config.PluginReceive) || + (_pluginNameTransmit != config.PluginTransmit) ) + { + Stop(); // Shut down communications - _inConfiguration = false; + // Change settings ... + _mode = config.Mode; + _hostComputer = config.HostComputer; + _pluginNameReceive = config.PluginReceive; + _pluginNameTransmit = config.PluginTransmit; - return true; + SaveSettings(); // Save Settings + + Start(); // Restart communications + } } } catch (Exception ex) @@ -331,8 +350,6 @@ } _inConfiguration = false; - - return false; } void StartMessageQueue() @@ -843,42 +860,31 @@ { IrssLog.Debug("Blast IR"); - if (_pluginTransmit == null || !_pluginTransmit.CanTransmit) + if (_pluginTransmit == null || !(_pluginTransmit is ITransmitIR)) return false; + string port = "Default"; + int portLen = BitConverter.ToInt32(data, 0); if (portLen > 0) - _pluginTransmit.SetPort(Encoding.ASCII.GetString(data, 4, portLen)); + port = Encoding.ASCII.GetString(data, 4, portLen); - byte[] fileData = new byte[data.Length - (4 + portLen)]; - for (int index = 4 + portLen; index < data.Length; index++) - fileData[index - (4 + portLen)] = data[index]; + byte[] codeData = new byte[data.Length - (4 + portLen)]; + Array.Copy(data, 4 + portLen, codeData, 0, codeData.Length); - string tempFile = Path.GetTempFileName(); - - FileStream fileStream = new FileStream(tempFile, FileMode.Create, FileAccess.ReadWrite, FileShare.None); - fileStream.Write(fileData, 0, fileData.Length); - fileStream.Flush(); - fileStream.Close(); - - bool result = _pluginTransmit.Transmit(tempFile); - - File.Delete(tempFile); - - return result; + return (_pluginTransmit as ITransmitIR).Transmit(port, codeData); } catch (Exception ex) { IrssLog.Error(ex.ToString()); + return false; } - - return false; } byte[] LearnIR() { IrssLog.Debug("Learn IR"); - if (_pluginTransmit == null || !_pluginTransmit.CanLearn) + if (_pluginTransmit == null || !(_pluginTransmit is ILearnIR)) { IrssLog.Debug("Active transceiver doesn't support learn"); return null; @@ -890,7 +896,7 @@ try { - LearnStatus status = _pluginTransmit.Learn(out data); + LearnStatus status = (_pluginTransmit as ILearnIR).Learn(out data); switch (status) { case LearnStatus.Success: @@ -1064,23 +1070,19 @@ { response.Name = received.Name + " Success"; - TransceiverInfo transceiverInfo = new TransceiverInfo(); + IRServerInfo irServerInfo = new IRServerInfo(); if (_pluginReceive != null) - { - transceiverInfo.Name = _pluginReceive.Name; - transceiverInfo.CanReceive = _pluginReceive.CanReceive; - } + irServerInfo.CanReceive = true; if (_pluginTransmit != null) { - transceiverInfo.Name = _pluginTransmit.Name; - transceiverInfo.Ports = _pluginTransmit.AvailablePorts; - transceiverInfo.CanLearn = _pluginTransmit.CanLearn; - transceiverInfo.CanTransmit = _pluginTransmit.CanTransmit; - } + irServerInfo.CanLearn = (_pluginTransmit is ILearnIR); + irServerInfo.CanTransmit = true; + irServerInfo.Ports = (_pluginTransmit as ITransmitIR).AvailablePorts; + } - response.Data = TransceiverInfo.ToBytes(transceiverInfo); + response.Data = irServerInfo.ToBytes(); } SendTo(received.FromPipe, received.FromServer, response); @@ -1157,14 +1159,9 @@ if (_inConfiguration) return; - Stop(); - IrssLog.Info("Setup"); - if (Configure()) - SaveSettings(); - - Start(); + Configure(); } void ClickQuit(object sender, EventArgs e) { @@ -1184,7 +1181,7 @@ XmlDocument doc = new XmlDocument(); doc.Load(ConfigurationFile); - _mode = (IRServerMode)Enum.Parse(typeof(IRServerMode), doc.DocumentElement.Attributes["Mode"].Value); + _mode = (IRServerMode)Enum.Parse(typeof(IRServerMode), doc.DocumentElement.Attributes["Mode"].Value, true); _hostComputer = doc.DocumentElement.Attributes["HostComputer"].Value; _pluginNameReceive = doc.DocumentElement.Attributes["PluginReceive"].Value; _pluginNameTransmit = doc.DocumentElement.Attributes["PluginTransmit"].Value; Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -20,10 +20,7 @@ [STAThread] static void Main() { - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - - // Check for multiple instances + // Check for multiple instances ... try { if (Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName).Length != 1) @@ -35,6 +32,9 @@ return; } + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + // TODO: Change log level to info for release. IrssLog.LogLevel = IrssLog.Level.Debug; IrssLog.Open(Common.FolderIrssLogs + "IR Server.log"); @@ -66,11 +66,11 @@ /// Retreives a list of available IR Server plugins. /// </summary> /// <returns>Array of plugin instances.</returns> - internal static IIRServerPlugin[] AvailablePlugins() + internal static IRServerPlugin[] AvailablePlugins() { try { - List<IIRServerPlugin> plugins = new List<IIRServerPlugin>(); + List<IRServerPlugin> plugins = new List<IRServerPlugin>(); string installFolder = SystemRegistry.GetInstallFolder(); if (String.IsNullOrEmpty(installFolder)) @@ -88,9 +88,9 @@ foreach (Type type in types) { - if (type.IsClass && !type.IsAbstract && type.GetInterface(typeof(IIRServerPlugin).Name) == typeof(IIRServerPlugin)) + if (type.IsClass && !type.IsAbstract && type.GetInterface(typeof(IRServerPlugin).Name) == typeof(IRServerPlugin)) { - IIRServerPlugin plugin = (IIRServerPlugin)Activator.CreateInstance(type); + IRServerPlugin plugin = (IRServerPlugin)Activator.CreateInstance(type); if (plugin == null) continue; @@ -122,16 +122,16 @@ /// </summary> /// <param name="pluginName">Name of plugin to instantiate.</param> /// <returns>Plugin instance.</returns> - internal static IIRServerPlugin GetPlugin(string pluginName) + internal static IRServerPlugin GetPlugin(string pluginName) { if (String.IsNullOrEmpty(pluginName)) return null; - IIRServerPlugin[] serverPlugins = AvailablePlugins(); + IRServerPlugin[] serverPlugins = AvailablePlugins(); if (serverPlugins == null) return null; - foreach (IIRServerPlugin plugin in serverPlugins) + foreach (IRServerPlugin plugin in serverPlugins) if (plugin.Name.Equals(pluginName, StringComparison.InvariantCultureIgnoreCase)) return plugin; Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/EditProgramForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/EditProgramForm.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/EditProgramForm.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -41,7 +41,7 @@ } public ProcessWindowStyle StartState { - get { return (ProcessWindowStyle)Enum.Parse(typeof(ProcessWindowStyle), comboBoxWindowStyle.SelectedItem as string); } + get { return (ProcessWindowStyle)Enum.Parse(typeof(ProcessWindowStyle), comboBoxWindowStyle.SelectedItem as string, true); } set { comboBoxWindowStyle.SelectedItem = Enum.GetName(typeof(ProcessWindowStyle), value); } } public bool UseShellExecute Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -290,7 +290,7 @@ { try { - eventType = (MappingEvent)Enum.Parse(typeof(MappingEvent), item.SubItems[0].Text); + eventType = (MappingEvent)Enum.Parse(typeof(MappingEvent), item.SubItems[0].Text, true); command = item.SubItems[1].Text; Program.Config.Events.Add(new MappedEvent(eventType, command)); @@ -459,7 +459,7 @@ string description = String.Empty; try { - MceButton temp = (MceButton)Enum.Parse(typeof(MceButton), keyCode); + MceButton temp = (MceButton)Enum.Parse(typeof(MceButton), keyCode, true); description = Enum.GetName(typeof(MceButton), temp); } catch Modified: trunk/plugins/IR Server Suite/Applications/Translator/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -45,7 +45,7 @@ static bool _inConfiguration; - static TransceiverInfo _transceiverInfo = new TransceiverInfo(); + static IRServerInfo _irServerInfo = new IRServerInfo(); //static Thread _focusWatcher; static IntPtr _currentForegroundWindow = IntPtr.Zero; @@ -66,9 +66,9 @@ set { _handleMessage = value; } } - internal static TransceiverInfo TransceiverInformation + internal static IRServerInfo TransceiverInformation { - get { return _transceiverInfo; } + get { return _irServerInfo; } } #endregion Properties @@ -949,7 +949,7 @@ { IrssLog.Info("Registered to IR Server"); _registered = true; - _transceiverInfo = TransceiverInfo.FromBytes(received.Data); + _irServerInfo = IRServerInfo.FromBytes(received.Data); break; } Modified: trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -423,7 +423,7 @@ { IrssLog.Info("Registered to IR Server"); _registered = true; - //_transceiverInfo = TransceiverInfo.FromBytes(received.Data); + //_irServerInfo = TransceiverInfo.FromBytes(received.Data); break; } Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -107,7 +107,7 @@ try { key = item.Attributes["shortcut"].Value; - temp.Shortcut = (Keys)Enum.Parse(typeof(Keys), key); + temp.Shortcut = (Keys)Enum.Parse(typeof(Keys), key, true); } catch (ArgumentException) { Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -486,7 +486,7 @@ { IrssLog.Info("Registered to IR Server"); _registered = true; - //_transceiverInfo = TransceiverInfo.FromBytes(received.Data); + //_irServerInfo = TransceiverInfo.FromBytes(received.Data); break; } Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -310,7 +310,7 @@ process.StartInfo.FileName = commands[0]; process.StartInfo.WorkingDirectory = commands[1]; process.StartInfo.Arguments = commands[2]; - process.StartInfo.WindowStyle = (ProcessWindowStyle)Enum.Parse(typeof(ProcessWindowStyle), commands[3]); + process.StartInfo.WindowStyle = (ProcessWindowStyle)Enum.Parse(typeof(ProcessWindowStyle), commands[3], true); process.StartInfo.CreateNoWindow = bool.Parse(commands[4]); process.StartInfo.UseShellExecute = bool.Parse(commands[5]); @@ -352,9 +352,9 @@ string comPort = commands[1]; int baudRate = int.Parse(commands[2]); - Parity parity = (Parity)Enum.Parse(typeof(Parity), commands[3]); + Parity parity = (Parity)Enum.Parse(typeof(Parity), commands[3], true); int dataBits = int.Parse(commands[4]); - StopBits stopBits = (StopBits)Enum.Parse(typeof(StopBits), commands[5]); + StopBits stopBits = (StopBits)Enum.Parse(typeof(StopBits), commands[5], true); bool waitForResponse = bool.Parse(commands[6]); SerialPort serialPort = new SerialPort(comPort, baudRate, parity, dataBits, stopBits); Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/ExternalProgram.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/ExternalProgram.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/ExternalProgram.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -80,7 +80,7 @@ checkBoxWaitForExit.Checked = bool.Parse(commands[6]); checkBoxForceFocus.Checked = bool.Parse(commands[7]); - comboBoxWindowStyle.SelectedItem = ((ProcessWindowStyle)Enum.Parse(typeof(ProcessWindowStyle), commands[3])).ToString(); + comboBoxWindowStyle.SelectedItem = ((ProcessWindowStyle)Enum.Parse(typeof(ProcessWindowStyle), commands[3], true)).ToString(); } else { @@ -156,7 +156,7 @@ process.StartInfo.FileName = textBoxProgram.Text; process.StartInfo.WorkingDirectory = textBoxStartup.Text; process.StartInfo.Arguments = textBoxParameters.Text; - process.StartInfo.WindowStyle = (ProcessWindowStyle)Enum.Parse(typeof(ProcessWindowStyle), comboBoxWindowStyle.SelectedItem as string); + process.StartInfo.WindowStyle = (ProcessWindowStyle)Enum.Parse(typeof(ProcessWindowStyle), comboBoxWindowStyle.SelectedItem as string, true); process.StartInfo.CreateNoWindow = checkBoxNoWindow.Checked; process.StartInfo.UseShellExecute = checkBoxShellExecute.Checked; Added: trunk/plugins/IR Server Suite/Common/IrssUtils/IRServerInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/IRServerInfo.cs (rev 0) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/IRServerInfo.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -0,0 +1,148 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace IrssUtils +{ + + /// <summary> + /// Holds data on an the current capabilities of the IR Server. + /// This class is used to pass information about the IR Server's current capabilities on to the clients. + /// </summary> + public class IRServerInfo + { + + #region Variables + + bool _canLearn; + bool _canReceive; + bool _canTransmit; + + string[] _ports; + + #endregion Variables + + #region Properties + + /// <summary> + /// Can the IR Server learn IR Commands. + /// </summary> + public bool CanLearn + { + get { return _canLearn; } + set { _canLearn = value; } + } + + /// <summary> + /// Can the IR Server receive IR commands. + /// </summary> + public bool CanReceive + { + get { return _canReceive; } + set { _canReceive = value; } + } + + /// <summary> + /// Can the IR Server transmit IR Commands. + /// </summary> + public bool CanTransmit + { + get { return _canTransmit; } + set { _canTransmit = value; } + } + + /// <summary> + /// Available IR transmit ports. + /// </summary> + public string[] Ports + { + get { return _ports; } + set { _ports = value; } + } + + #endregion Properties + + #region Constructors + + public IRServerInfo() + { + _canLearn = false; + _canReceive = false; + _canTransmit = false; + + _ports = new string[] { "None" }; + } + + #endregion Construcors + + #region Methods + + /// <summary> + /// This method returns the byte array representation of this instance. + /// </summary> + /// <returns>Byte array of serialized IRServerInfo object.</returns> + public byte[] ToBytes() + { + try + { + StringBuilder ports = new StringBuilder(); + for (int index = 0; index < _ports.Length; index++) + { + ports.Append(_ports[index]); + if (index < _ports.Length - 1) + ports.Append(','); + } + + string data = String.Format("{0},{1},{2},{3},{4}", + _canLearn, // 0 + _canReceive, // 1 + _canTransmit, // 2 + _ports.Length, // 3 + ports.ToString() // 4 + ); + + return Encoding.ASCII.GetBytes(data); + } + catch + { + return null; + } + } + + /// <summary> + /// Given a byte array this method returns the deserialized IRServerInfo object. + /// </summary> + /// <param name="dataBytes">Byte array of serialized IRServerInfo object.</param> + /// <returns>IRServerInfo object.</returns> + public static IRServerInfo FromBytes(byte[] dataBytes) + { + try + { + string dataString = Encoding.ASCII.GetString(dataBytes); + + string[] data = dataString.Split(new char[] { ',' }); + + IRServerInfo irServerInfo = new IRServerInfo(); + irServerInfo.CanLearn = bool.Parse(data[0]); + irServerInfo.CanReceive = bool.Parse(data[1]); + irServerInfo.CanTransmit = bool.Parse(data[2]); + + int portIndex = 3; + int portCount = int.Parse(data[portIndex]); + irServerInfo.Ports = new string[portCount]; + for (int index = portIndex + 1; index <= portIndex + portCount; index++) + irServerInfo.Ports[index - (portIndex + 1)] = data[index]; + + return irServerInfo; + } + catch + { + return null; + } + } + + #endregion Methods + + } + +} Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/IrssUtils.csproj =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/IrssUtils.csproj 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/IrssUtils.csproj 2007-08-22 14:37:54 UTC (rev 855) @@ -135,7 +135,7 @@ <DependentUpon>Resources.resx</DependentUpon> </Compile> <Compile Include="SystemRegistry.cs" /> - <Compile Include="TransceiverInfo.cs" /> + <Compile Include="IRServerInfo.cs" /> <Compile Include="Win32.cs" /> <Compile Include="XML.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> Deleted: trunk/plugins/IR Server Suite/Common/IrssUtils/TransceiverInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/TransceiverInfo.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/TransceiverInfo.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -1,161 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace IrssUtils -{ - - /// <summary> - /// Holds data on an IR Transceiver Device. - /// </summary> - public class TransceiverInfo - { - - #region Variables - - string[] _ports; - - string _name; - bool _canLearn; - bool _canReceive; - bool _canTransmit; - - #endregion Variables - - #region Properties - - /// <summary> - /// Available transmit ports. - /// </summary> - public string[] Ports - { - get { return _ports; } - set { _ports = value; } - } - - /// <summary> - /// Transceiver name. - /// </summary> - public string Name - { - get { return _name; } - set { _name = value; } - } - - /// <summary> - /// Can this transceiver learn IR Commands. - /// </summary> - public bool CanLearn - { - get { return _canLearn; } - set { _canLearn = value; } - } - - /// <summary> - /// Can this transceiver receive button presses. - /// </summary> - public bool CanReceive - { - get { return _canReceive; } - set { _canReceive = value; } - } - - /// <summary> - /// Can this transceiver transmit IR Commands. - /// </summary> - public bool CanTransmit - { - get { return _canTransmit; } - set { _canTransmit = value; } - } - - #endregion Properties - - #region Constructors - - public TransceiverInfo() - { - _ports = new string[] { "None" }; - - _name = "None"; - _canLearn = false; - _canReceive = false; - _canTransmit = false; - } - - #endregion Construcors - - #region Static Methods - - /// <summary> - /// Given a TransceiverInfo object this method returns the byte array representation. - /// </summary> - /// <param name="transceiverInfo">TransceiverInfo object to convert.</param> - /// <returns>Byte array of serialized TransceiverInfo object.</returns> - public static byte[] ToBytes(TransceiverInfo transceiverInfo) - { - try - { - StringBuilder ports = new StringBuilder(); - for (int index = 0; index < transceiverInfo.Ports.Length; index++) - { - ports.Append(transceiverInfo.Ports[index]); - if (index < transceiverInfo.Ports.Length - 1) - ports.Append(','); - } - - string data = String.Format("{0},{1},{2},{3},{4},{5}", - transceiverInfo.Name, // 0 - transceiverInfo.CanLearn, // 1 - transceiverInfo.CanReceive, // 2 - transceiverInfo.CanTransmit, // 3 - transceiverInfo.Ports.Length, // 4 - ports.ToString() // 5 - ); - - return Encoding.ASCII.GetBytes(data); - } - catch - { - return null; - } - } - - /// <summary> - /// Given a byte array this method returns the deserialized TransceiverInfo object. - /// </summary> - /// <param name="dataBytes">Byte array of serialized TransceiverInfo object.</param> - /// <returns>TransceiverInfo object.</returns> - public static TransceiverInfo FromBytes(byte[] dataBytes) - { - try - { - string dataString = Encoding.ASCII.GetString(dataBytes); - - string[] data = dataString.Split(new char[] { ',' }); - - TransceiverInfo transceiverInfo = new TransceiverInfo(); - transceiverInfo.Name = data[0]; - transceiverInfo.CanLearn = bool.Parse(data[1]); - transceiverInfo.CanReceive = bool.Parse(data[2]); - transceiverInfo.CanTransmit = bool.Parse(data[3]); - - int portIndex = 4; - int portCount = int.Parse(data[portIndex]); - transceiverInfo.Ports = new string[portCount]; - for (int index = portIndex + 1; index <= portIndex + portCount; index++) - transceiverInfo.Ports[index - (portIndex + 1)] = data[index]; - - return transceiverInfo; - } - catch - { - return null; - } - } - - #endregion Static Methods - - } - -} Modified: trunk/plugins/IR Server Suite/Common/MPUtils/ExternalChannelConfig.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/MPUtils/ExternalChannelConfig.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/Common/MPUtils/ExternalChannelConfig.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -149,16 +149,16 @@ writer.WriteStartDocument(true); writer.WriteStartElement("config"); // <config> - writer.WriteElementString("PauseTime", PauseTime.ToString()); - writer.WriteElementString("UsePreChangeCommand", UsePreChangeCommand.ToString()); - writer.WriteElementString("SendSelect", SendSelect.ToString()); - writer.WriteElementString("DoubleChannelSelect", DoubleChannelSelect.ToString()); - writer.WriteElementString("ChannelDigits", ChannelDigits.ToString()); - writer.WriteElementString("RepeatChannelCommands", RepeatChannelCommands.ToString()); - writer.WriteElementString("RepeatDelay", RepeatPauseTime.ToString()); + writer.WriteElementString("PauseTime", PauseTime.ToString()); + writer.WriteElementString("UsePreChangeCommand", UsePreChangeCommand.ToString()); + writer.WriteElementString("SendSelect", SendSelect.ToString()); + writer.WriteElementString("DoubleChannelSelect", DoubleChannelSelect.ToString()); + writer.WriteElementString("ChannelDigits", ChannelDigits.ToString()); + writer.WriteElementString("RepeatChannelCommands", RepeatChannelCommands.ToString()); + writer.WriteElementString("RepeatDelay", RepeatPauseTime.ToString()); - writer.WriteElementString("SelectCommand", SelectCommand); - writer.WriteElementString("PreChangeCommand", PreChangeCommand); + writer.WriteElementString("SelectCommand", SelectCommand); + writer.WriteElementString("PreChangeCommand", PreChangeCommand); for (int i = 0; i < 10; i++) writer.WriteElementString("Digit" + i.ToString(), Digits[i]); @@ -217,19 +217,19 @@ XmlDocument doc = new XmlDocument(); doc.Load(fileName); - newECC.PauseTime = GetInt(doc, "PauseTime", DefaultPauseTime); - newECC.UsePreChangeCommand = GetBool(doc, "UsePreChangeCommand", DefaultUsePreChangeCommand); - newECC.SendSelect = GetBool(doc, "SendSelect", DefaultSendSelect); - newECC.DoubleChannelSelect = GetBool(doc, "DoubleChannelSelect", DefaultDoubleChannelSelect); - newECC.RepeatChannelCommands = GetInt(doc, "RepeatChannelCommands", DefaultRepeatChannelCommands); - newECC.ChannelDigits = GetInt(doc, "ChannelDigits", DefaultChannelDigits); - newECC.RepeatPauseTime = GetInt(doc, "RepeatDelay", DefaultRepeatPauseTime); + newECC.PauseTime = GetInt(doc, "PauseTime", DefaultPauseTime); + newECC.UsePreChangeCommand = GetBool(doc, "UsePreChangeCommand", DefaultUsePreChangeCommand); + newECC.SendSelect = GetBool(doc, "SendSelect", DefaultSendSelect); + newECC.DoubleChannelSelect = GetBool(doc, "DoubleChannelSelect", DefaultDoubleChannelSelect); + newECC.RepeatChannelCommands = GetInt(doc, "RepeatChannelCommands", DefaultRepeatChannelCommands); + newECC.ChannelDigits = GetInt(doc, "ChannelDigits", DefaultChannelDigits); + newECC.RepeatPauseTime = GetInt(doc, "RepeatDelay", DefaultRepeatPauseTime); - newECC.SelectCommand = GetString(doc, "SelectCommand", String.Empty); - newECC.PreChangeCommand = GetString(doc, "PreChangeCommand", String.Empty); + newECC.SelectCommand = GetString(doc, "SelectCommand", String.Empty); + newECC.PreChangeCommand = GetString(doc, "PreChangeCommand", String.Empty); for (int index = 0; index < 10; index++) - newECC.Digits[index] = GetString(doc, "Digit" + index.ToString(), String.Empty); + newECC.Digits[index] = GetString(doc, "Digit" + index.ToString(), String.Empty); return newECC; } Modified: trunk/plugins/IR Server Suite/Common/MPUtils/MPCommands.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/MPUtils/MPCommands.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/Common/MPUtils/MPCommands.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -48,7 +48,7 @@ try { - window = (int)Enum.Parse(typeof(GUIWindow.Window), "WINDOW_" + screen); + window = (int)Enum.Parse(typeof(GUIWindow.Window), "WINDOW_" + screen, true); } catch { Modified: trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -17,13 +17,7 @@ namespace FusionRemoteReceiver { - #region Delegates - - delegate void RemoteEventHandler(byte[] data); - - #endregion Delegates - - public class FusionRemoteReceiver : IIRServerPlugin + public class FusionRemoteReceiver : IRServerPlugin, IRemoteReceiver { #region Constants @@ -32,8 +26,6 @@ Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\IR Server Suite\\IR Server\\FusionRemote Receiver.xml"; - static readonly string[] Ports = new string[] { "None" }; - const string DeviceID = "VID_0FE9&PID_9010"; const UInt32 DIGCF_ALLCLASSES = 0x00000004; @@ -51,7 +43,7 @@ #region Interop - [DllImport("kernel32", SetLastError = true, CharSet = CharSet.Auto)] + [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)] static extern SafeFileHandle CreateFile( [MarshalAs(UnmanagedType.LPTStr)] string fileName, uint fileAccess, @@ -62,12 +54,12 @@ [MarshalAs(UnmanagedType.U4)] EFileAttributes flags, IntPtr templateFile); - [DllImport("kernel32")] + [DllImport("kernel32.dll")] [return: MarshalAs(UnmanagedType.Bool)] static extern bool CancelIo(SafeFileHandle handle); [Flags] - public enum EFileShares + enum EFileShares { None = 0x00000000, Read = 0x00000001, @@ -75,7 +67,7 @@ Delete = 0x00000004, } - public enum ECreationDisposition + enum ECreationDisposition { New = 1, CreateAlways = 2, @@ -140,25 +132,25 @@ public string DevicePath; } - [DllImport("hid")] + [DllImport("hid.dll")] static extern void HidD_GetHidGuid( ref Guid guid); - [DllImport("setupapi", CharSet = CharSet.Auto)] + [DllImport("setupapi.dll", CharSet = CharSet.Auto)] static extern IntPtr SetupDiGetClassDevs( ref Guid ClassGuid, [MarshalAs(UnmanagedType.LPTStr)] string Enumerator, IntPtr hwndParent, UInt32 Flags); - [DllImport("setupapi", SetLastError = true)] + [DllImport("setupapi.dll", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] static extern bool SetupDiEnumDeviceInfo( IntPtr handle, int Index, ref DeviceInfoData deviceInfoData); - [DllImport("setupapi", SetLastError = true)] + [DllImport("setupapi.dll", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] static extern bool SetupDiEnumDeviceInterfaces( IntPtr handle, @@ -167,7 +159,7 @@ int MemberIndex, ref DeviceInterfaceData deviceInterfaceData); - [DllImport("setupapi", SetLastError = true)] + [DllImport("setupapi.dll", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] static extern bool SetupDiGetDeviceInterfaceDetail( IntPtr handle, @@ -177,7 +169,7 @@ ref uint requiredSize, IntPtr unused3); - [DllImport("setupapi", SetLastError = true)] + [DllImport("setupapi.dll", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] static extern bool SetupDiGetDeviceInterfaceDetail( IntPtr handle, @@ -187,7 +179,7 @@ IntPtr unused1, IntPtr unused2); - [DllImport("setupapi")] + [DllImport("setupapi.dll")] [return: MarshalAs(UnmanagedType.Bool)] static extern bool SetupDiDestroyDeviceInfoList(IntPtr handle); @@ -202,36 +194,16 @@ static DateTime _lastCodeTime = DateTime.Now; #endregion Variables - - #region IIRServerPlugin Members - public string Name { get { return "FusionREMOTE"; } } - public string Version { get { return "1.0.3.3"; } } - public string Author { get { return "and-81"; } } - public string Description { get { return "DViCO FusionREMOTE Receiver"; } } - public bool CanReceive { get { return true; } } - public bool CanTransmit { get { return false; } } - public bool CanLearn { get { return false; } } - public bool CanConfigure { get { return false; } } + #region Implementation - public RemoteHandler RemoteCallback - { - get { return _remoteButtonHandler; } - set { _remoteButtonHandler = value; } - } + public override string Name { get { return "FusionREMOTE"; } } + public override string Version { get { return "1.0.3.3"; } } + public override string Author { get { return "and-81"; } } + public override string Description { get { return "DViCO FusionREMOTE Receiver"; } } - public KeyboardHandler KeyboardCallback { get { return null; } set { } } - - public MouseHandler MouseCallback { get { return null; } set { } } - - public string[] AvailablePorts + public override bool Start() { - get { return Ports; } - } - - public void Configure() { } - public bool Start() - { try { OpenDevice(); @@ -248,10 +220,16 @@ return false; } } - public void Suspend() { } - public void Resume() { } - public void Stop() + public override void Suspend() { + Stop(); + } + public override void Resume() + { + Start(); + } + public override void Stop() + { try { _deviceStream.Close(); @@ -263,25 +241,12 @@ } } - public bool Transmit(string file) + public RemoteHandler RemoteCallback { - return false; + get { return _remoteButtonHandler; } + set { _remoteButtonHandler = value; } } - public LearnStatus Learn(out byte[] data) - { - data = null; - return LearnStatus.Failure; - } - public bool SetPort(string port) - { - return true; - } - - #endregion - - #region Implementation - static void OpenDevice() { Guid hidGuid = new Guid(); Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IRServerPluginInterface.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IRServerPluginInterface.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IRServerPluginInterface.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -1,9 +1,7 @@ namespace IRServerPluginInterface { - // TODO: Break out Transmit and Receive interfaces into new Interface classes. // TODO: Implement Async learning with callbacks (LearnStart, LearnStatus, LearnDone) or... - // TODO: Implement Learning dialog in each IR Server plugin #region Delegates @@ -54,10 +52,7 @@ #endregion Enumerations - /// <summary> - /// Interface for IR Server plugins to interact with the IR Server. - /// </summary> - public interface IIRServerPlugin + public abstract class IRServerPlugin { #region Properties @@ -65,100 +60,82 @@ /// <summary> /// Name of the IR Server plugin. /// </summary> - string Name { get; } + public abstract string Name { get; } /// <summary> /// IR Server plugin version. /// </summary> - string Version { get; } + public abstract string Version { get; } /// <summary> /// The IR Server plugin's author. /// </summary> - string Author { get; } + public abstract string Author { get; } /// <summary> /// A description of the IR Server plugin. /// </summary> - string Description { get; } + public abstract string Description { get; } - /// <summary> - /// Can this IR Server plugin receive remote button presses. - /// </summary> - bool CanReceive { get; } + #endregion Properties - /// <summary> - /// Can this IR Server plugin transmit infrared commands. - /// </summary> - bool CanTransmit { get; } - - /// <summary> - /// Can this IR Server plugin learn infrared commands. - /// </summary> - bool CanLearn { get; } + #region Methods /// <summary> - /// Does this IR Server plugin have configuration options. + /// Start the IR Server plugin. /// </summary> - bool CanConfigure { get; } + /// <returns>Success.</returns> + public abstract bool Start(); /// <summary> - /// Callback for remote button presses. + /// Suspend the IR Server plugin when computer enters standby. /// </summary> - RemoteHandler RemoteCallback { get; set; } + public abstract void Suspend(); /// <summary> - /// Callback for keyboard presses. + /// Resume the IR Server plugin when the computer returns from standby. /// </summary> - KeyboardHandler KeyboardCallback { get; set; } + public abstract void Resume(); /// <summary> - /// Callback for mouse events. + /// Stop the IR Server plugin. /// </summary> - MouseHandler MouseCallback { get; set; } + public abstract void Stop(); - /// <summary> - /// Lists the available blaster ports. - /// </summary> - string[] AvailablePorts { get; } + #endregion Methods - #endregion + } - #region Interface + public interface IConfigure + { /// <summary> /// Configure the IR Server plugin. /// </summary> void Configure(); - /// <summary> - /// Start the IR Server plugin. - /// </summary> - /// <returns>Success.</returns> - bool Start(); + } - /// <summary> - /// Suspend the IR Server plugin when computer enters standby. - /// </summary> - void Suspend(); + public interface ITransmitIR + { /// <summary> - /// Resume the IR Server plugin when the computer returns from standby. + /// Lists the available blaster ports. /// </summary> - void Resume(); + string[] AvailablePorts { get; } /// <summary> - /// Stop the IR Server plugin. - /// </summary> - void Stop(); - - /// <summary> /// Transmit an infrared command. /// </summary> /// <param name="file">Infrared command file.</param> /// <returns>Success.</returns> - bool Transmit(string file); + bool Transmit(string port, byte[] data); + } + + public interface ILearnIR + { + /// <summary> /// Learn an infrared command. /// </summary> @@ -166,48 +143,36 @@ /// <returns>Tells the calling code if the learn was Successful, Failed or Timed Out.</returns> LearnStatus Learn(out byte[] data); - /// <summary> - /// Set the transmit port to use for infrared command output. - /// </summary> - /// <param name="port">Port to use.</param> - /// <returns>Success.</returns> - bool SetPort(string port); - - #endregion Interface - } - /* - - public interface IConfigurable + public interface IRemoteReceiver { - } + /// <summary> + /// Callback for remote button presses. + /// </summary> + RemoteHandler RemoteCallback { get; set; } - public interface ITransmitIR - { - } - public interface ILearnIR + public interface IKeyboardReceiver { - } + /// <summary> + /// Callback for keyboard presses. + /// </summary> + KeyboardHandler KeyboardCallback { get; set; } - public interface IRemoteReceiver - { - } - public interface IKeyboardReceiver - { - - } - public interface IMouseReceiver { + /// <summary> + /// Callback for mouse events. + /// </summary> + MouseHandler MouseCallback { get; set; } + } - */ } Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -13,7 +13,7 @@ namespace IRManReceiver { - public class IRManReceiver : IIRServerPlugin + public class IRManReceiver : IRServerPlugin, IConfigure, IRemoteReceiver { #region Constants @@ -22,8 +22,6 @@ Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\IR Server Suite\\IR Server\\IRMan Receiver.xml"; - static readonly string[] Ports = new string[] { "None" }; - const int DeviceBufferSize = 6; #endregion Constants @@ -45,50 +43,17 @@ #endregion Variables - #region IIRServerPlugin Members + #region Implementation - public string Name { get { return "IRMan"; } } - public string Version { get { return "1.0.3.3"; } } - public string Author { get { return "and-81"; } } - public string Description { get { return "Receiver support for the Serial IRMan device"; } } - public bool CanReceive { get { return true; } } - public bool CanTransmit { get { return false; } } - public bool CanLearn { get { return false; } } - public bool CanConfigure { get { return true; } } + public override string Name { get { return "IRMan"; } } + public override string Version { get { return "1.0.3.3"; } } + public override string Author { get { return "and-81"; } } + public override string Description { get { return "Receiver support for the Serial IRMan device"; } } - public RemoteHandler RemoteCallback + public override bool Start() { - get { return _remoteButtonHandler; } - set { _remoteButtonHandler = value; } - } - - public KeyboardHandler KeyboardCallback { get { return null; } set { } } - - public MouseHandler MouseCallback { get { return null; } set { } } - - public string[] AvailablePorts { get { return Ports; } } - - public void Configure() - { LoadSettings(); - Configure config = new Configure(); - - config.RepeatDelay = _repeatDelay; - config.CommPort = _serialPortName; - - if (config.ShowDialog() == DialogResult.OK) - { - _repeatDelay = config.RepeatDelay; - _serialPortName = config.CommPort; - - SaveSettings(); - } - } - public bool Start() - { - LoadSettings(); - _deviceBuffer = new byte[DeviceBufferSize]; _serialPort = new SerialPort(_serialPortName, 9600, Parity.None, 8, StopBits.One); @@ -118,10 +83,16 @@ return false; } - public void Suspend() { } - public void Resume() { } - public void Stop() + public override void Suspend() { + Stop(); + } + public override void Resume() + { + Start(); + } + public override void Stop() + { if (_serialPort == null) return; @@ -135,19 +106,30 @@ _serialPort = null; } - public bool Transmit(string file) { return false; } - public LearnStatus Learn(out byte[] data) + public RemoteHandler RemoteCallback { - data = null; - return LearnStatus.Failure; + get { return _remoteButtonHandler; } + set { _remoteButtonHandler = value; } } - public bool SetPort(string port) { return true; } + public void Configure() + { + LoadSettings(); - #endregion IIRServerPlugin Members + Configure config = new Configure(); - #region Implementation + config.RepeatDelay = _repeatDelay; + config.CommPort = _serialPortName; + if (config.ShowDialog() == DialogResult.OK) + { + _repeatDelay = config.RepeatDelay; + _serialPortName = config.CommPort; + + SaveSettings(); + } + } + void SerialPort_DataReceived(object sender, SerialDataReceivedEventArgs e) { try @@ -210,14 +192,14 @@ XmlDocument doc = new XmlDocument(); doc.Load(ConfigurationFile); - _repeatDelay = int.Parse(doc.DocumentElement.Attributes["RepeatDelay"].Value); + _repeatDelay = int.Parse(doc.DocumentElement.Attributes["RepeatDelay"].Value); _serialPortName = doc.DocumentElement.Attributes["SerialPortName"].Value; } catch (Exception ex) { Console.WriteLine(ex.ToString()); - _repeatDelay = 500; + _repeatDelay = 500; _serialPortName = "COM1"; } } Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -18,12 +18,6 @@ namespace IRTransTransceiver { - #region Delegates - - delegate void RemoteEventHandler(byte[] data); - - #endregion Delegates - #region Enumerations public enum IrTransStatus @@ -181,7 +175,7 @@ */ #endregion Interop Structures - public class IRTransTransceiver : IIRServerPlugin + public class IRTransTransceiver : IRServerPlugin, IConfigure, IRemoteReceiver { #region Constants @@ -190,8 +184,6 @@ Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\IR Server Suite\\IR Server\\IRTrans Transceiver.xml"; - static readonly string[] Ports = new string[] { "Default" }; - const string DefaultRemoteModel = "mediacenter"; const string DefaultServerAddress = "localhost"; const int DefaultServerPort = 21000; @@ -205,8 +197,6 @@ static RemoteHandler _remoteButtonHandler = null; - static string _blasterPort = Ports[0]; - static Socket _socket; static IAsyncResult _asynResult; static AsyncCallback _pfnCallBack; @@ -215,56 +205,18 @@ static int _irTransServerPort; #endregion Variables - - #region IIRServerPlugin Members - public string Name { get { return "IRTrans (Experimental)"; } } - public string Version { get { return "1.0.3.3"; } } - public string Author { get { return "and-81"; } } - public string Description { get { return "IRTra... [truncated message content] |
From: <an...@us...> - 2007-08-23 15:02:59
|
Revision: 861 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=861&view=rev Author: and-81 Date: 2007-08-23 08:02:52 -0700 (Thu, 23 Aug 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/CreateIRFile.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Suite.sln Modified: trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/CreateIRFile.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/CreateIRFile.Designer.cs 2007-08-23 15:02:04 UTC (rev 860) +++ trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/CreateIRFile.Designer.cs 2007-08-23 15:02:52 UTC (rev 861) @@ -28,9 +28,19 @@ /// </summary> private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); + this.SuspendLayout(); + // + // CreateIRFile + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Text = "CreateIRFile"; + this.ClientSize = new System.Drawing.Size(284, 264); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.Name = "CreateIRFile"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Create IR File"; + this.ResumeLayout(false); + } #endregion Modified: trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.csproj 2007-08-23 15:02:04 UTC (rev 860) +++ trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.csproj 2007-08-23 15:02:52 UTC (rev 861) @@ -88,6 +88,10 @@ <DependentUpon>Configure.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> + <EmbeddedResource Include="CreateIRFile.resx"> + <SubType>Designer</SubType> + <DependentUpon>CreateIRFile.cs</DependentUpon> + </EmbeddedResource> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Modified: trunk/plugins/IR Server Suite/IR Server Suite.sln =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite.sln 2007-08-23 15:02:04 UTC (rev 860) +++ trunk/plugins/IR Server Suite/IR Server Suite.sln 2007-08-23 15:02:52 UTC (rev 861) @@ -181,12 +181,6 @@ Release.AspNetCompiler.Debug = "False" EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinLirc Receiver", "IR Server Plugins\WinLirc Receiver\WinLirc Receiver.csproj", "{E6A68244-8C31-44A9-9F85-B4A102B5F209}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Custom HID Receiver", "IR Server Plugins\Custom HID Receiver\Custom HID Receiver.csproj", "{0F6576B4-C88E-4E79-B7E9-9480498C5A32}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" @@ -229,6 +223,18 @@ Release.AspNetCompiler.Debug = "False" EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HCW Transceiver", "IR Server Plugins\HCW Transceiver\HCW Transceiver.csproj", "{EE8F2C22-8BD3-4832-85F0-E6F67ED3AADB}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinLirc Transceiver", "IR Server Plugins\WinLirc Transceiver\WinLirc Transceiver.csproj", "{E6A68244-8C31-44A9-9F85-B4A102B5F209}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -435,14 +441,6 @@ {D8B3D28F-62CE-4CA7-86CE-B7EAD614A94C}.Release|Any CPU.Build.0 = Release|Any CPU {D8B3D28F-62CE-4CA7-86CE-B7EAD614A94C}.Release|x86.ActiveCfg = Release|x86 {D8B3D28F-62CE-4CA7-86CE-B7EAD614A94C}.Release|x86.Build.0 = Release|x86 - {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Debug|x86.ActiveCfg = Debug|x86 - {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Debug|x86.Build.0 = Debug|x86 - {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Release|Any CPU.Build.0 = Release|Any CPU - {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Release|x86.ActiveCfg = Release|x86 - {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Release|x86.Build.0 = Release|x86 {0F6576B4-C88E-4E79-B7E9-9480498C5A32}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0F6576B4-C88E-4E79-B7E9-9480498C5A32}.Debug|x86.ActiveCfg = Debug|Any CPU {0F6576B4-C88E-4E79-B7E9-9480498C5A32}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -490,6 +488,22 @@ {B5E711A2-E6D0-4BEA-B66B-7A8B0BCA6A4D}.Release|Any CPU.Build.0 = Release|Any CPU {B5E711A2-E6D0-4BEA-B66B-7A8B0BCA6A4D}.Release|x86.ActiveCfg = Release|x86 {B5E711A2-E6D0-4BEA-B66B-7A8B0BCA6A4D}.Release|x86.Build.0 = Release|x86 + {EE8F2C22-8BD3-4832-85F0-E6F67ED3AADB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EE8F2C22-8BD3-4832-85F0-E6F67ED3AADB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EE8F2C22-8BD3-4832-85F0-E6F67ED3AADB}.Debug|x86.ActiveCfg = Debug|x86 + {EE8F2C22-8BD3-4832-85F0-E6F67ED3AADB}.Debug|x86.Build.0 = Debug|x86 + {EE8F2C22-8BD3-4832-85F0-E6F67ED3AADB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EE8F2C22-8BD3-4832-85F0-E6F67ED3AADB}.Release|Any CPU.Build.0 = Release|Any CPU + {EE8F2C22-8BD3-4832-85F0-E6F67ED3AADB}.Release|x86.ActiveCfg = Release|x86 + {EE8F2C22-8BD3-4832-85F0-E6F67ED3AADB}.Release|x86.Build.0 = Release|x86 + {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Debug|x86.ActiveCfg = Debug|x86 + {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Debug|x86.Build.0 = Debug|x86 + {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Release|Any CPU.Build.0 = Release|Any CPU + {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Release|x86.ActiveCfg = Release|x86 + {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -516,8 +530,9 @@ {253FFB14-AB8E-49AB-A005-A42428C3F452} = {0D1620EE-01B9-43B5-9FAA-E983BD9EBDBD} {9FDD649E-0502-4FED-9AC1-AA0346394375} = {0D1620EE-01B9-43B5-9FAA-E983BD9EBDBD} {D8B3D28F-62CE-4CA7-86CE-B7EAD614A94C} = {0D1620EE-01B9-43B5-9FAA-E983BD9EBDBD} + {0F6576B4-C88E-4E79-B7E9-9480498C5A32} = {0D1620EE-01B9-43B5-9FAA-E983BD9EBDBD} + {EE8F2C22-8BD3-4832-85F0-E6F67ED3AADB} = {0D1620EE-01B9-43B5-9FAA-E983BD9EBDBD} {E6A68244-8C31-44A9-9F85-B4A102B5F209} = {0D1620EE-01B9-43B5-9FAA-E983BD9EBDBD} - {0F6576B4-C88E-4E79-B7E9-9480498C5A32} = {0D1620EE-01B9-43B5-9FAA-E983BD9EBDBD} {E98F1F7E-40B6-44C8-AC66-EC867B141FA1} = {0E9CCB69-CEF0-4680-816B-18E949DEA727} {077B53BB-404A-4B2F-BA17-AAE98C5E9C66} = {0E9CCB69-CEF0-4680-816B-18E949DEA727} {F4EA6055-7133-4F18-8971-E19ADEB482C1} = {0E9CCB69-CEF0-4680-816B-18E949DEA727} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-08-27 13:37:18
|
Revision: 871 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=871&view=rev Author: and-81 Date: 2007-08-27 05:46:19 -0700 (Mon, 27 Aug 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs trunk/plugins/IR Server Suite/Applications/Debug Client/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/IR Blast/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Properties/AssemblyInfo.cs 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/IR Server/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.Designer.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/EditProgramForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs trunk/plugins/IR Server Suite/Applications/Translator/ProgramSettings.cs trunk/plugins/IR Server Suite/Applications/Translator/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Common/IrssUtils/IrssUtils.csproj trunk/plugins/IR Server Suite/Common/IrssUtils/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/Common/MPUtils/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IPC/Named Pipes/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionREMOTE Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/Configure.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/Configure.resx trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/HcwTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/irremote.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTrans Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug USB Receiver/IgorPlug USB Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug USB Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/USB-UIRT Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/UirtTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/CreateIRFile.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/CreateIRFile.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/CreateIRFile.resx trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Windows Message Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Windows Message Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/X10 Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/X10Transceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/XBCDRC Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/XBCDRC Receiver/XBCDRC Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/XBCDRC Receiver/XBCDRC Receiver.csproj trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MPBlastZonePlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs Added Paths: ----------- trunk/plugins/IR Server Suite/Applications/IR File Tool/ trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.Designer.cs trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.cs trunk/plugins/IR Server Suite/Applications/IR File Tool/IR File Tool.csproj trunk/plugins/IR Server Suite/Applications/IR File Tool/Program.cs trunk/plugins/IR Server Suite/Applications/IR File Tool/Properties/ trunk/plugins/IR Server Suite/Applications/IR File Tool/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/SageSetup/ trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.Designer.cs trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.cs trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.resx trunk/plugins/IR Server Suite/Applications/SageSetup/Program.cs trunk/plugins/IR Server Suite/Applications/SageSetup/Properties/ trunk/plugins/IR Server Suite/Applications/SageSetup/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/SageSetup/Sage Setup.csproj trunk/plugins/IR Server Suite/Applications/Translator/EventSchedule.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Win32ErrorCodes.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Advanced.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Advanced.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Advanced.resx trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Win32ErrorCodes.cs trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/ReceiverWindow.cs Property Changed: ---------------- trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/ Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-08-27 10:30:17 UTC (rev 870) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-08-27 12:46:19 UTC (rev 871) @@ -97,7 +97,7 @@ #region Constants - const string TempIRFile = "test.IR"; + static readonly string DebugIRFile = IrssUtils.Common.FolderIRCommands + "DebugClient.IR"; #endregion @@ -424,7 +424,7 @@ return; } - if (BlastIR(TempIRFile, comboBoxPort.SelectedItem as string)) + if (BlastIR(DebugIRFile, comboBoxPort.SelectedItem as string)) AddStatusLine("Blasting"); else AddStatusLine("Can't Blast"); @@ -443,7 +443,7 @@ return; } - if (LearnIR(TempIRFile)) + if (LearnIR(DebugIRFile)) AddStatusLine("Learning IR"); else AddStatusLine("Learn IR Busy"); Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/Properties/AssemblyInfo.cs 2007-08-27 10:30:17 UTC (rev 870) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/Properties/AssemblyInfo.cs 2007-08-27 12:46:19 UTC (rev 871) @@ -33,7 +33,7 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.3.3")] -[assembly: AssemblyFileVersion("1.0.3.3")] +[assembly: AssemblyVersion("1.0.3.4")] +[assembly: AssemblyFileVersion("1.0.3.4")] [assembly: CLSCompliant(true)] Modified: trunk/plugins/IR Server Suite/Applications/IR Blast/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast/Properties/AssemblyInfo.cs 2007-08-27 10:30:17 UTC (rev 870) +++ trunk/plugins/IR Server Suite/Applications/IR Blast/Properties/AssemblyInfo.cs 2007-08-27 12:46:19 UTC (rev 871) @@ -33,7 +33,7 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.3.3")] -[assembly: AssemblyFileVersion("1.0.3.3")] +[assembly: AssemblyVersion("1.0.3.4")] +[assembly: AssemblyFileVersion("1.0.3.4")] [assembly: CLSCompliant(true)] \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Properties/AssemblyInfo.cs 2007-08-27 10:30:17 UTC (rev 870) +++ trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Properties/AssemblyInfo.cs 2007-08-27 12:46:19 UTC (rev 871) @@ -33,7 +33,7 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.3.3")] -[assembly: AssemblyFileVersion("1.0.3.3")] +[assembly: AssemblyVersion("1.0.3.4")] +[assembly: AssemblyFileVersion("1.0.3.4")] [assembly: CLSCompliant(true)] \ No newline at end of file Added: trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.Designer.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.Designer.cs 2007-08-27 12:46:19 UTC (rev 871) @@ -0,0 +1,39 @@ +namespace IR_File_Tool +{ + partial class FormMain + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Text = "Form1"; + } + + #endregion + } +} + Added: trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.cs 2007-08-27 12:46:19 UTC (rev 871) @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace IR_File_Tool +{ + public partial class FormMain : Form + { + public FormMain() + { + InitializeComponent(); + } + } +} \ No newline at end of file Added: trunk/plugins/IR Server Suite/Applications/IR File Tool/IR File Tool.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR File Tool/IR File Tool.csproj (rev 0) +++ trunk/plugins/IR Server Suite/Applications/IR File Tool/IR File Tool.csproj 2007-08-27 12:46:19 UTC (rev 871) @@ -0,0 +1,72 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{B5E711A2-E6D0-4BEA-B66B-7A8B0BCA6A4D}</ProjectGuid> + <OutputType>WinExe</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>IR_File_Tool</RootNamespace> + <AssemblyName>IR File Tool</AssemblyName> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> + <DebugSymbols>true</DebugSymbols> + <OutputPath>bin\x86\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <DebugType>full</DebugType> + <PlatformTarget>x86</PlatformTarget> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> + <OutputPath>bin\x86\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <Optimize>true</Optimize> + <DebugType>pdbonly</DebugType> + <PlatformTarget>x86</PlatformTarget> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Deployment" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="FormMain.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="FormMain.Designer.cs"> + <DependentUpon>FormMain.cs</DependentUpon> + </Compile> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Added: trunk/plugins/IR Server Suite/Applications/IR File Tool/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR File Tool/Program.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/IR File Tool/Program.cs 2007-08-27 12:46:19 UTC (rev 871) @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Windows.Forms; + +namespace IR_File_Tool +{ + static class Program + { + /// <summary> + /// The main entry point for the application. + /// </summary> + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new FormMain()); + } + } +} \ No newline at end of file Added: trunk/plugins/IR Server Suite/Applications/IR File Tool/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR File Tool/Properties/AssemblyInfo.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/IR File Tool/Properties/AssemblyInfo.cs 2007-08-27 12:46:19 UTC (rev 871) @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("IR File Tool")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("IR File Tool")] +[assembly: AssemblyCopyright("Copyright © 2007")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("74144852-ec06-4af4-925f-459e8053b2f8")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] Modified: trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-08-27 10:30:17 UTC (rev 870) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-08-27 12:46:19 UTC (rev 871) @@ -218,6 +218,8 @@ _notifyIcon.Visible = true; + SystemEvents.PowerModeChanged += new PowerModeChangedEventHandler(SystemEvents_PowerModeChanged); + IrssLog.Info("IR Server started"); return true; @@ -236,6 +238,8 @@ { IrssLog.Info("Stopping IR Server ..."); + SystemEvents.PowerModeChanged -= new PowerModeChangedEventHandler(SystemEvents_PowerModeChanged); + _notifyIcon.Visible = false; if (_mode == IRServerMode.ServerMode) @@ -268,7 +272,7 @@ } try { - if (_pluginTransmit != null) + if (_pluginTransmit != null && _pluginTransmit != _pluginReceive) _pluginTransmit.Stop(); } catch (Exception ex) @@ -609,7 +613,45 @@ } } + void SystemEvents_PowerModeChanged(object sender, PowerModeChangedEventArgs e) + { + switch (e.Mode) + { + case PowerModes.Resume: + { + IrssLog.Info("Resume from standby ..."); + if (_pluginReceive != null) + _pluginReceive.Resume(); + if (_pluginTransmit != null && _pluginTransmit != _pluginReceive) + _pluginTransmit.Resume(); + + // TODO: Inform clients + break; + } + + case PowerModes.Suspend: + { + IrssLog.Info("Enter low-power standby ..."); + + if (_pluginReceive != null) + _pluginReceive.Suspend(); + if (_pluginTransmit != null && _pluginTransmit != _pluginReceive) + _pluginTransmit.Suspend(); + + // TODO: Inform clients + /* + if (_mode == IRServerMode.ServerMode) + { + PipeMessage message = new PipeMessage(Common.ServerPipeName, Environment.MachineName, "Server Shutdown", null); + SendToAll(message); + } + */ + break; + } + } + } + void SendToAll(PipeMessage message) { IrssLog.Debug("SendToAll({0})", message.ToString()); Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2007-08-27 10:30:17 UTC (rev 870) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2007-08-27 12:46:19 UTC (rev 871) @@ -88,7 +88,7 @@ foreach (Type type in types) { - if (type.IsClass && !type.IsAbstract && type.GetInterface(typeof(IRServerPlugin).Name) == typeof(IRServerPlugin)) + if (type.IsClass && !type.IsAbstract && type.IsSubclassOf(typeof(IRServerPlugin))) { IRServerPlugin plugin = (IRServerPlugin)Activator.CreateInstance(type); if (plugin == null) Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Properties/AssemblyInfo.cs 2007-08-27 10:30:17 UTC (rev 870) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Properties/AssemblyInfo.cs 2007-08-27 12:46:19 UTC (rev 871) @@ -34,8 +34,8 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.3.3")] -[assembly: AssemblyFileVersion("1.0.3.3")] +[assembly: AssemblyVersion("1.0.3.4")] +[assembly: AssemblyFileVersion("1.0.3.4")] [assembly: CLSCompliant(true)] Added: trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.Designer.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.Designer.cs 2007-08-27 12:46:19 UTC (rev 871) @@ -0,0 +1,246 @@ +namespace SageSetup +{ + partial class FormMain + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.buttonSet = new System.Windows.Forms.Button(); + this.groupBoxIRBlast = new System.Windows.Forms.GroupBox(); + this.radioButtonConsole = new System.Windows.Forms.RadioButton(); + this.radioButtonWindowless = new System.Windows.Forms.RadioButton(); + this.groupBoxSagePlugin = new System.Windows.Forms.GroupBox(); + this.radioButtonExeTuner = new System.Windows.Forms.RadioButton(); + this.radioButtonExeMultiTuner = new System.Windows.Forms.RadioButton(); + this.groupBoxIRServer = new System.Windows.Forms.GroupBox(); + this.comboBoxComputer = new System.Windows.Forms.ComboBox(); + this.groupBoxChannelFormat = new System.Windows.Forms.GroupBox(); + this.checkBoxPad = new System.Windows.Forms.CheckBox(); + this.numericUpDownPad = new System.Windows.Forms.NumericUpDown(); + this.toolTips = new System.Windows.Forms.ToolTip(this.components); + this.groupBoxIRBlast.SuspendLayout(); + this.groupBoxSagePlugin.SuspendLayout(); + this.groupBoxIRServer.SuspendLayout(); + this.groupBoxChannelFormat.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownPad)).BeginInit(); + this.SuspendLayout(); + // + // buttonSet + // + this.buttonSet.Location = new System.Drawing.Point(184, 312); + this.buttonSet.Name = "buttonSet"; + this.buttonSet.Size = new System.Drawing.Size(56, 24); + this.buttonSet.TabIndex = 4; + this.buttonSet.Text = "Set!"; + this.toolTips.SetToolTip(this.buttonSet, "Put the setttings in place"); + this.buttonSet.UseVisualStyleBackColor = true; + this.buttonSet.Click += new System.EventHandler(this.buttonSet_Click); + // + // groupBoxIRBlast + // + this.groupBoxIRBlast.Controls.Add(this.radioButtonWindowless); + this.groupBoxIRBlast.Controls.Add(this.radioButtonConsole); + this.groupBoxIRBlast.Location = new System.Drawing.Point(8, 96); + this.groupBoxIRBlast.Name = "groupBoxIRBlast"; + this.groupBoxIRBlast.Size = new System.Drawing.Size(232, 80); + this.groupBoxIRBlast.TabIndex = 1; + this.groupBoxIRBlast.TabStop = false; + this.groupBoxIRBlast.Text = "IR Blast"; + // + // radioButtonConsole + // + this.radioButtonConsole.AutoSize = true; + this.radioButtonConsole.Checked = true; + this.radioButtonConsole.Location = new System.Drawing.Point(8, 24); + this.radioButtonConsole.Name = "radioButtonConsole"; + this.radioButtonConsole.Size = new System.Drawing.Size(121, 17); + this.radioButtonConsole.TabIndex = 0; + this.radioButtonConsole.TabStop = true; + this.radioButtonConsole.Text = "Use console version"; + this.toolTips.SetToolTip(this.radioButtonConsole, "Use the console version of IR Blast"); + this.radioButtonConsole.UseVisualStyleBackColor = true; + // + // radioButtonWindowless + // + this.radioButtonWindowless.AutoSize = true; + this.radioButtonWindowless.Location = new System.Drawing.Point(8, 48); + this.radioButtonWindowless.Name = "radioButtonWindowless"; + this.radioButtonWindowless.Size = new System.Drawing.Size(138, 17); + this.radioButtonWindowless.TabIndex = 1; + this.radioButtonWindowless.Text = "Use windowless version"; + this.toolTips.SetToolTip(this.radioButtonWindowless, "Use the No Window version of IR Blast"); + this.radioButtonWindowless.UseVisualStyleBackColor = true; + // + // groupBoxSagePlugin + // + this.groupBoxSagePlugin.Controls.Add(this.radioButtonExeMultiTuner); + this.groupBoxSagePlugin.Controls.Add(this.radioButtonExeTuner); + this.groupBoxSagePlugin.Location = new System.Drawing.Point(8, 8); + this.groupBoxSagePlugin.Name = "groupBoxSagePlugin"; + this.groupBoxSagePlugin.Size = new System.Drawing.Size(232, 80); + this.groupBoxSagePlugin.TabIndex = 0; + this.groupBoxSagePlugin.TabStop = false; + this.groupBoxSagePlugin.Text = "Sage Plugin"; + // + // radioButtonExeTuner + // + this.radioButtonExeTuner.AutoSize = true; + this.radioButtonExeTuner.Checked = true; + this.radioButtonExeTuner.Location = new System.Drawing.Point(8, 24); + this.radioButtonExeTuner.Name = "radioButtonExeTuner"; + this.radioButtonExeTuner.Size = new System.Drawing.Size(96, 17); + this.radioButtonExeTuner.TabIndex = 0; + this.radioButtonExeTuner.TabStop = true; + this.radioButtonExeTuner.Text = "Use EXETuner"; + this.toolTips.SetToolTip(this.radioButtonExeTuner, "Use the Sage EXE Tuner plugin"); + this.radioButtonExeTuner.UseVisualStyleBackColor = true; + // + // radioButtonExeMultiTuner + // + this.radioButtonExeMultiTuner.AutoSize = true; + this.radioButtonExeMultiTuner.Location = new System.Drawing.Point(8, 48); + this.radioButtonExeMultiTuner.Name = "radioButtonExeMultiTuner"; + this.radioButtonExeMultiTuner.Size = new System.Drawing.Size(118, 17); + this.radioButtonExeMultiTuner.TabIndex = 1; + this.radioButtonExeMultiTuner.Text = "Use EXEMultiTuner"; + this.toolTips.SetToolTip(this.radioButtonExeMultiTuner, "Use the Sage EXE Multi Tuner plugin"); + this.radioButtonExeMultiTuner.UseVisualStyleBackColor = true; + // + // groupBoxIRServer + // + this.groupBoxIRServer.Controls.Add(this.comboBoxComputer); + this.groupBoxIRServer.Location = new System.Drawing.Point(8, 184); + this.groupBoxIRServer.Name = "groupBoxIRServer"; + this.groupBoxIRServer.Size = new System.Drawing.Size(232, 56); + this.groupBoxIRServer.TabIndex = 2; + this.groupBoxIRServer.TabStop = false; + this.groupBoxIRServer.Text = "IR Server"; + // + // comboBoxComputer + // + this.comboBoxComputer.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.comboBoxComputer.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.comboBoxComputer.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.comboBoxComputer.FormattingEnabled = true; + this.comboBoxComputer.Location = new System.Drawing.Point(8, 24); + this.comboBoxComputer.Name = "comboBoxComputer"; + this.comboBoxComputer.Size = new System.Drawing.Size(216, 21); + this.comboBoxComputer.TabIndex = 0; + this.toolTips.SetToolTip(this.comboBoxComputer, "Host computer for IR Server"); + // + // groupBoxChannelFormat + // + this.groupBoxChannelFormat.Controls.Add(this.numericUpDownPad); + this.groupBoxChannelFormat.Controls.Add(this.checkBoxPad); + this.groupBoxChannelFormat.Location = new System.Drawing.Point(8, 248); + this.groupBoxChannelFormat.Name = "groupBoxChannelFormat"; + this.groupBoxChannelFormat.Size = new System.Drawing.Size(232, 56); + this.groupBoxChannelFormat.TabIndex = 3; + this.groupBoxChannelFormat.TabStop = false; + this.groupBoxChannelFormat.Text = "Channel Format"; + // + // checkBoxPad + // + this.checkBoxPad.Location = new System.Drawing.Point(8, 24); + this.checkBoxPad.Name = "checkBoxPad"; + this.checkBoxPad.Size = new System.Drawing.Size(144, 20); + this.checkBoxPad.TabIndex = 0; + this.checkBoxPad.Text = "Pad channel number"; + this.toolTips.SetToolTip(this.checkBoxPad, "Do you want to pad channel numbers?"); + this.checkBoxPad.UseVisualStyleBackColor = true; + // + // numericUpDownPad + // + this.numericUpDownPad.Location = new System.Drawing.Point(152, 24); + this.numericUpDownPad.Maximum = new decimal(new int[] { + 9, + 0, + 0, + 0}); + this.numericUpDownPad.Minimum = new decimal(new int[] { + 2, + 0, + 0, + 0}); + this.numericUpDownPad.Name = "numericUpDownPad"; + this.numericUpDownPad.Size = new System.Drawing.Size(72, 20); + this.numericUpDownPad.TabIndex = 1; + this.numericUpDownPad.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.toolTips.SetToolTip(this.numericUpDownPad, "Pad out channel numbers to this many digits"); + this.numericUpDownPad.Value = new decimal(new int[] { + 4, + 0, + 0, + 0}); + // + // FormMain + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(248, 344); + this.Controls.Add(this.groupBoxChannelFormat); + this.Controls.Add(this.groupBoxIRServer); + this.Controls.Add(this.groupBoxSagePlugin); + this.Controls.Add(this.groupBoxIRBlast); + this.Controls.Add(this.buttonSet); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "FormMain"; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.Text = "IR Server - Sage Setup"; + this.Load += new System.EventHandler(this.FormMain_Load); + this.groupBoxIRBlast.ResumeLayout(false); + this.groupBoxIRBlast.PerformLayout(); + this.groupBoxSagePlugin.ResumeLayout(false); + this.groupBoxSagePlugin.PerformLayout(); + this.groupBoxIRServer.ResumeLayout(false); + this.groupBoxChannelFormat.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownPad)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Button buttonSet; + private System.Windows.Forms.GroupBox groupBoxIRBlast; + private System.Windows.Forms.RadioButton radioButtonWindowless; + private System.Windows.Forms.RadioButton radioButtonConsole; + private System.Windows.Forms.GroupBox groupBoxSagePlugin; + private System.Windows.Forms.RadioButton radioButtonExeMultiTuner; + private System.Windows.Forms.RadioButton radioButtonExeTuner; + private System.Windows.Forms.GroupBox groupBoxIRServer; + private System.Windows.Forms.ComboBox comboBoxComputer; + private System.Windows.Forms.GroupBox groupBoxChannelFormat; + private System.Windows.Forms.CheckBox checkBoxPad; + private System.Windows.Forms.ToolTip toolTips; + private System.Windows.Forms.NumericUpDown numericUpDownPad; + } +} + Added: trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.cs 2007-08-27 12:46:19 UTC (rev 871) @@ -0,0 +1,108 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +using Microsoft.Win32; +using IrssUtils; + +namespace SageSetup +{ + + public partial class FormMain : Form + { + string _irBlastLocation = null; + + public FormMain() + { + InitializeComponent(); + } + + private void FormMain_Load(object sender, EventArgs e) + { + ArrayList networkPCs = Win32.GetNetworkComputers(); + if (networkPCs == null) + { + MessageBox.Show(this, "No server names detected.", "Network Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + Application.Exit(); + return; + } + else + { + comboBoxComputer.Items.AddRange(networkPCs.ToArray()); + } + + _irBlastLocation = SystemRegistry.GetInstallFolder(); + + if (String.IsNullOrEmpty(_irBlastLocation)) + { + MessageBox.Show(this, "IR Server Suite install location not found, please re-install IR Server Suite", "Application Location Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + Application.Exit(); + return; + } + } + + private void buttonSet_Click(object sender, EventArgs e) + { +/* +[HKEY_LOCAL_MACHINE\SOFTWARE\Sage\EXETunerPlugin] +"Command"="\"C:\\Program Files\\IR Server Suite\\IR Blast\\IRBlast.exe\" -host localhost -channel %CHANNEL%" + +[HKEY_LOCAL_MACHINE\SOFTWARE\Frey Technologies\Common\EXEMultiTunerPlugin] +"Command"="\"C:\\Program Files\\IR Server Suite\\IR Blast\\IRBlast.exe\" -host localhost -port Port_%DEVICE% -channel %CHANNEL%" +*/ + string hostComputer = comboBoxComputer.Text; + + if (String.IsNullOrEmpty(hostComputer)) + { + MessageBox.Show(this, "You must specify an IR Server host computer", "No Server Host", MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + + try + { + RegistryKey mainKey; + if (radioButtonExeTuner.Checked) + mainKey = Registry.LocalMachine.CreateSubKey("SOFTWARE\\Sage\\EXETunerPlugin"); + else + mainKey = Registry.LocalMachine.CreateSubKey("SOFTWARE\\Frey Technologies\\Common\\EXEMultiTunerPlugin"); + + StringBuilder command = new StringBuilder(); + command.Append("\""); + command.Append(_irBlastLocation); + command.Append("\\IR Blast\\"); + if (radioButtonConsole.Checked) + command.Append("IRBlast.exe"); + else + command.Append("IRBlast-NoWindow.exe"); + command.Append("\""); + + command.Append(" -host "); + command.Append(hostComputer); + + if (radioButtonExeMultiTuner.Checked) + command.Append(" -port Port_%DEVICE%"); + + if (checkBoxPad.Checked) + command.AppendFormat(" -pad {0}", numericUpDownPad.Value); + + command.Append(" -channel %CHANNEL%"); + + mainKey.SetValue("Command", command.ToString(), RegistryValueKind.String); + mainKey.Close(); + + MessageBox.Show(this, "Sage plugin setup complete", "Done", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + catch (Exception ex) + { + MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + } + +} Added: trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.resx =================================================================== --- trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.resx (rev 0) +++ trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.resx 2007-08-27 12:46:19 UTC (rev 871) @@ -0,0 +1,123 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <metadata name="toolTips.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> +</root> \ No newline at end of file Added: trunk/plugins/IR Server Suite/Applications/SageSetup/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/SageSetup/Program.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/SageSetup/Program.cs 2007-08-27 12:46:19 UTC (rev 871) @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Windows.Forms; + +namespace SageSetup +{ + + static class Program + { + + /// <summary> + /// The main entry point for the application. + /// </summary> + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new FormMain()); + } + + } + +} Added: trunk/plugins/IR Server Suite/Applications/SageSetup/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/SageSetup/Properties/AssemblyInfo.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/SageSetup/Properties/AssemblyInfo.cs 2007-08-27 12:46:19 UTC (rev 871) @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("IR Server - Sage Setup")] +[assembly: AssemblyDescription("Setup the Sage EXE Tuner plugins for use with IR Server")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("SageSetup")] +[assembly: AssemblyCopyright("Copyright © Aaron Dinnage, 2007")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("98cabc3d-5464-4122-aa78-483535991e02")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.3.4")] +[assembly: AssemblyFileVersion("1.0.3.4")] Added: trunk/plugins/IR Server Suite/Applications/SageSetup/Sage Setup.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/SageSetup/Sage Setup.csproj (rev 0) +++ trunk/plugins/IR Server Suite/Applications/SageSetup/Sage Setup.csproj 2007-08-27 12:46:19 UTC (rev 871) @@ -0,0 +1,88 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{905131F8-F8AC-4A65-A722-37783902D7B8}</ProjectGuid> + <OutputType>WinExe</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>SageSetup</RootNamespace> + <AssemblyName>SageSetup</AssemblyName> + <StartupObject>SageSetup.Program</StartupObject> + <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> + <DebugSymbols>true</DebugSymbols> + <OutputPath>bin\x86\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <DebugType>full</DebugType> + <PlatformTarget>x86</PlatformTarget> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> + <OutputPath>bin\x86\Release\</OutputPath> + <Optimize>true</Optimize> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <DebugType>none</DebugType> + <PlatformTarget>x86</PlatformTarget> + <UseVSHostingProcess>false</UseVSHostingProcess> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <DebugType>full</DebugType> + <PlatformTarget>AnyCPU</PlatformTarget> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <OutputPath>bin\Release\</OutputPath> + <Optimize>true</Optimize> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <DebugType>pdbonly</DebugType> + <PlatformTarget>AnyCPU</PlatformTarget> + <UseVSHostingProcess>false</UseVSHostingProcess> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Deployment" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="FormMain.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="FormMain.Designer.cs"> + <DependentUpon>FormMain.cs</DependentUpon> + </Compile> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <EmbeddedResource Include="FormMain.resx"> + <SubType>Designer</SubType> + <DependentUpon>FormMain.cs</DependentUpon> + </EmbeddedResource> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\Common\IrssUtils\IrssUtils.csproj"> + <Project>{CA15769C-232E-4CA7-94FD-206A06CA3ABB}</Project> + <Name>IrssUtils</Name> + </ProjectReference> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> + <PropertyGroup> + <PostBuildEvent>copy "*.*" "\MediaPortal Development\Plugin Releases\IR Server Suite\$(ProjectName)\"</PostBuildEvent> + </PropertyGroup> +</Project> \ No newline at end of file Added: trunk/plugins/IR Server Suite/Applications/Translator/EventSchedule.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/EventSchedule.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Translator/EventSchedule.cs 2007-08-27 12:46:19 UTC (rev 871) @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Translator +{ + + #region Enumerations + + public enum ScheduleRepeat + { + Never, + Minutes, + Hours, + Days, + Weeks, + Months, + Years, + } + + [Flags] + public enum ScheduleDays + { + None, + Monday, + Tuesday, + Wednesday, + Thursday, + Friday, + Saturday, + Sunday, + } + + [Flags] + public enum ScheduleMonths + { + None, + January, + February, + March, + April, + May, + June, + July, + August, + September, + October, + November, + December, + } + + #endregion Enumerations + + public class EventSchedule + { + //DateTime _start; + + //ScheduleRepeat _repeat = ScheduleRepeat.Never; + //ScheduleDays _days = ScheduleDays.None; + //ScheduleMonths _months = ScheduleMonths.None; + + } + +} Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.Designer.cs 2007-08-27 10:30:17 UTC (rev 870) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.Designer.cs 2007-08-27 12:46:19 UTC (rev 871) @@ -174,6 +174,7 @@ this.buttonCancel = new System.Windows.Forms.Button(); this.buttonOK = new System.Windows.Forms.Button(); this.toolTips = new System.Windows.Forms.ToolTip(this.components); + this.checkBoxForceFocus = new System.Windows.Forms.CheckBox(); this.groupBoxButton.SuspendLayout(); this.groupBoxSet.SuspendLayout(); this.tabControl.SuspendLayout(); @@ -326,7 +327,7 @@ this.tabPageBlastIR.Location = new System.Drawing.Point(4, 22); this.tabPageBlastIR.Name = "tabPageBlastIR"; this.tabPageBlastIR.Padding = new System.Windows.Forms.Padding(3); - this.tabPageBlastIR.Size = new System.Drawing.Size(432, 206); + this.tabPageBlastIR.Size = new System.Drawing.Size(440, 206); this.tabPageBlastIR.TabIndex = 0; this.tabPageBlastIR.Text = "Blast IR"; this.tabPageBlastIR.UseVisualStyleBackColor = true; @@ -389,7 +390,7 @@ this.tabPageMacro.Location = new System.Drawing.Point(4, 22); this.tabPageMacro.Name = "tabPageMacro"; this.tabPageMacro.Padding = new System.Windows.Forms.Padding(3); - this.tabPageMacro.Size = new System.Drawing.Size(432, 206); + this.tabPageMacro.Size = new System.Drawing.Size(440, 206); this.tabPageMacro.TabIndex = 1; this.tabPageMacro.Text = "Macro"; this.tabPageMacro.UseVisualStyleBackColor = true; @@ -428,6 +429,7 @@ // // tabPageProgram // + this.tabPageProgram.Controls.Add(this.checkBoxForceFocus); this.tabPageProgram.Controls.Add(this.checkBoxNoWindow); this.tabPageProgram.Controls.Add(this.checkBoxShellExecute); this.tabPageProgram.Controls.Add(this.comboBoxWindowStyle); @@ -443,14 +445,14 @@ this.tabPageProgram.Location = new System.Drawing.Point(4, 22); this.tabPageProgram.Name = "tabPageProgram"; this.tabPageProgram.Padding = new System.Windows.Forms.Padding(3); - this.tabPageProgram.Size = new System.Drawing.Size(432, 206); + this.tabPageProgram.Size = new System.Drawing.Size(440, 206); this.tabPageProgram.TabIndex = 3; this.tabPageProgram.Text = "Run"; this.tabPageProgram.UseVisualStyleBackColor = true; // // checkBoxNoWindow // - this.checkBoxNoWindow.Location = new System.Drawing.Point(216, 112); + this.checkBoxNoWindow.Location = new System.Drawing.Point(232, 112); this.checkBoxNoWindow.Name = "checkBoxNoWindow"; this.checkBoxNoWindow.Size = new System.Drawing.Size(104, 21); this.checkBoxNoWindow.TabIndex = 10; @@ -460,9 +462,10 @@ // checkBoxShellExecute // this.checkBoxShellExecute.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.checkBoxShellExecute.AutoSize = true; this.checkBoxShellExecute.Location = new System.Drawing.Point(8, 144); this.checkBoxShellExecute.Name = "checkBoxShellExecute"; - this.checkBoxShellExecute.Size = new System.Drawing.Size(168, 20); + this.checkBoxShellExecute.Size = new System.Drawing.Size(141, 17); this.checkBoxShellExecute.TabIndex = 11; this.checkBoxShellExecute.Text = "Start using ShellExecute"; this.checkBoxShellExecute.UseVisualStyleBackColor = true; @@ -575,7 +578,7 @@ this.tabPageSerial.Location = new System.Drawing.Point(4, 22); this.tabPageSerial.Name = "tabPageSerial"; this.tabPageSerial.Padding = new System.Windows.Forms.Padding(3); - this.tabPageSerial.Size = new System.Drawing.Size(432, 206); + this.tabPageSerial.Size = new System.Drawing.Size(440, 206); this.tabPageSerial.TabIndex = 2; this.tabPageSerial.Text = "Serial"; this.tabPageSerial.UseVisualStyleBackColor = true; @@ -757,7 +760,7 @@ this.tabPageMessage.Location = new System.Drawing.Point(4, 22); this.tabPageMessage.Name = "tabPageMessage"; this.tabPageMessage.Padding = new System.Windows.Forms.Padding(3); - this.tabPageMessage.Size = new System.Drawing.Size(432, 206); + this.tabPageMessage.Size = new System.Drawing.Size(440, 206); this.tabPageMessage.TabIndex = 4; this.tabPageMessage.Text = "Window Message"; this.tabPageMessage.UseVisualStyleBackColor = true; @@ -936,7 +939,7 @@ this.tabPageKeystrokes.Location = new System.Drawing.Point(4, 22); this.tabPageKeystrokes.Name = "tabPageKeystrokes"; this.tabPageKeystrokes.Padding = new System.Windows.Forms.Padding(3); - this.tabPageKeystrokes.Size = new System.Drawing.Size(432, 206); + this.tabPageKeystrokes.Size = new System.Drawing.Size(440, 206); this.tabPageKeystrokes.TabIndex = 5; this.tabPageKeystrokes.Text = "Keystrokes"; this.tabPageKeystrokes.UseVisualStyleBackColor = true; @@ -1427,7 +1430,7 @@ this.tabPageMouse.Location = new System.Drawing.Point(4, 22); this.tabPageMouse.Name = "tabPageMouse"; this.tabPageMouse.Padding = new System.Windows.Forms.Padding(3); - this.tabPageMouse.Size = new System.Drawing.Size(432, 206); + this.tabPageMouse.Size = new System.Drawing.Size(440, 206); this.tabPageMouse.TabIndex = 6; this.tabPageMouse.Text = "Mouse"; this.tabPageMouse.UseVisualStyleBackColor = true; @@ -1684,6 +1687,16 @@ this.buttonOK.UseVisualStyleBackColor = true; this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); // + // checkBoxForceFocus + // + this.checkBoxForceFocus.AutoSize = true; + this.checkBoxForceFocus.Location = new System.Drawing.Point(232, 144); + this.checkBoxForceFocus.Name = "checkBoxForceFocus"; + this.checkBoxForceFocus.Size = new System.Drawing.Size(121, 17); + this.checkBoxForceFocus.TabIndex = 12; + this.checkBoxForceFocus.Text = "Force window focus"; + this.checkBoxForceFocus.UseVisualStyleBackColor = true; + // // ButtonMappingForm // this.AcceptButton = this.buttonOK; @@ -1883,6 +1896,7 @@ private System.Windows.Forms.TabPage tabPageMisc; private System.Windows.Forms.Label labelMiscCommand; private System.Windows.Forms.ComboBox comboBoxMiscCommand; + private System.Windows.Forms.CheckBox checkBoxForceFocus; } } \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications... [truncated message content] |
From: <an...@us...> - 2007-09-02 17:09:50
|
Revision: 882 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=882&view=rev Author: and-81 Date: 2007-09-02 10:09:43 -0700 (Sun, 02 Sep 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/HcwTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug USB Receiver/IgorPlug USB Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.resx trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Microsoft MCE Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Pronto.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/XBCDRC Receiver/XBCDRC Receiver.cs trunk/plugins/IR Server Suite/IR Server Suite.sln Added Paths: ----------- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrCode.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrDecoder.cs Removed Paths: ------------- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DeviceAccess.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IRCodeConversion.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MceIrCode.cs Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs 2007-08-31 15:38:37 UTC (rev 881) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs 2007-09-02 17:09:43 UTC (rev 882) @@ -30,7 +30,7 @@ #region Variables - RemoteButtonHandler _remoteButtonHandler = null; + RemoteHandler _remoteHandler = null; FileStream _deviceStream; byte[] _deviceBuffer; @@ -79,21 +79,17 @@ #endregion - #region IIRServerPlugin Members + #region Implementation - public string Name { get { return "Custom HID Receiver"; } } - public string Version { get { return "1.0.3.4"; } } - public string Author { get { return "and-81"; } } - public string Description { get { return "Supports HID USB devices."; } } - public bool CanReceive { get { return true; } } - public bool CanTransmit { get { return false; } } - public bool CanLearn { get { return false; } } - public bool CanConfigure { get { return true; } } + public override string Name { get { return "Custom HID Receiver"; } } + public override string Version { get { return "1.0.3.4"; } } + public override string Author { get { return "and-81"; } } + public override string Description { get { return "Supports HID USB devices."; } } - public RemoteButtonHandler RemoteButtonCallback + public RemoteHandler RemoteCallback { - get { return _remoteButtonHandler; } - set { _remoteButtonHandler = value; } + get { return _remoteHandler; } + set { _remoteHandler = value; } } public string[] AvailablePorts { get { return Ports; } } @@ -108,7 +104,7 @@ } } - public bool Start() + public override bool Start() { if (String.IsNullOrEmpty(_deviceID)) throw new Exception("No HID Device selected for use"); @@ -134,9 +130,9 @@ return true; } - public void Suspend() { } - public void Resume() { } - public void Stop() + public override void Suspend() { } + public override void Resume() { } + public override void Stop() { if (_deviceStream == null) return; @@ -156,12 +152,6 @@ public bool Transmit(string file) { return false; } public LearnStatus Learn(string file) { return LearnStatus.Failure; } - public bool SetPort(string port) { return true; } - - #endregion IIRServerPlugin Members - - #region Implementation - protected virtual void Dispose(bool disposeManagedResources) { // process only if mananged and unmanaged resources have @@ -312,7 +302,7 @@ if (bytesRead == 0) throw new Exception("Error reading from HID Device, zero bytes read"); - if (_remoteButtonHandler != null) + if (_remoteHandler != null) { string keyCode = String.Empty; @@ -333,13 +323,13 @@ if (timeSpan.Milliseconds >= _repeatDelay) { - _remoteButtonHandler(keyCode); + _remoteHandler(keyCode); _lastCodeTime = DateTime.Now; } } else { - _remoteButtonHandler(keyCode); + _remoteHandler(keyCode); _lastCodeTime = DateTime.Now; _lastKeyCode = keyCode; } Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.csproj 2007-08-31 15:38:37 UTC (rev 881) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.csproj 2007-09-02 17:09:43 UTC (rev 882) @@ -33,6 +33,25 @@ <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <UseVSHostingProcess>false</UseVSHostingProcess> </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> + <OutputPath>bin\x86\Debug\</OutputPath> + <DefineConstants>DEBUG</DefineConstants> + <TreatWarningsAsErrors>false</TreatWarningsAsErrors> + <DebugType>full</DebugType> + <PlatformTarget>x86</PlatformTarget> + <UseVSHostingProcess>false</UseVSHostingProcess> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> + <OutputPath>bin\x86\Release\</OutputPath> + <Optimize>true</Optimize> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <DebugType> + </DebugType> + <PlatformTarget>x86</PlatformTarget> + <UseVSHostingProcess>false</UseVSHostingProcess> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> <ItemGroup> <Reference Include="System" /> <Reference Include="System.Data" /> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs 2007-08-31 15:38:37 UTC (rev 881) +++ trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs 2007-09-02 17:09:43 UTC (rev 882) @@ -187,7 +187,7 @@ #region Variables - static RemoteHandler _remoteButtonHandler = null; + static RemoteHandler _remoteHandler = null; static FileStream _deviceStream; static byte[] _deviceBuffer; @@ -243,8 +243,8 @@ public RemoteHandler RemoteCallback { - get { return _remoteButtonHandler; } - set { _remoteButtonHandler = value; } + get { return _remoteHandler; } + set { _remoteHandler = value; } } static void OpenDevice() @@ -354,8 +354,8 @@ { _lastCodeTime = DateTime.Now; - if (_remoteButtonHandler != null) - _remoteButtonHandler(keyCode.ToString()); + if (_remoteHandler != null) + _remoteHandler(keyCode.ToString()); } else { @@ -366,8 +366,8 @@ { _lastCodeTime = DateTime.Now; - if (_remoteButtonHandler != null) - _remoteButtonHandler(keyCode.ToString()); + if (_remoteHandler != null) + _remoteHandler(keyCode.ToString()); } } Modified: trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/HcwTransceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/HcwTransceiver.cs 2007-08-31 15:38:37 UTC (rev 881) +++ trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/HcwTransceiver.cs 2007-09-02 17:09:43 UTC (rev 882) @@ -38,7 +38,7 @@ //Sets up callback so that other forms can catch a key press public delegate void HCWEvent(int keypress); - public event HCWEvent HCWKeyPressed; + //public event HCWEvent HCWKeyPressed; #endregion Delegates @@ -77,11 +77,6 @@ string _lastCode = String.Empty; DateTime _lastCodeTime = DateTime.Now; - // ------- - - int _abortLearn = AllowLearn; - bool _learnTimedOut; - #endregion Variables #region Implementation Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug USB Receiver/IgorPlug USB Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug USB Receiver/IgorPlug USB Receiver.cs 2007-08-31 15:38:37 UTC (rev 881) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug USB Receiver/IgorPlug USB Receiver.cs 2007-09-02 17:09:43 UTC (rev 882) @@ -13,7 +13,7 @@ namespace IgorPlugUSBReceiver { - public class IgorPlugUSBReceiver : IRServerPlugin + public class IgorPlugUSBReceiver : IRServerPlugin, IRemoteReceiver { #region Constants @@ -59,17 +59,28 @@ #endregion Interop - #region IIRServerPlugin Members + #region Implementation - public string Name { get { return "IgorPlug USB"; } } - public string Version { get { return "1.0.3.4"; } } - public string Author { get { return "and-81"; } } - public string Description { get { return "IgorPlug USB Receiver"; } } - public bool CanReceive { get { return true; } } - public bool CanTransmit { get { return false; } } - public bool CanLearn { get { return false; } } - public bool CanConfigure { get { return false; } } + public override string Name { get { return "IgorPlug USB"; } } + public override string Version { get { return "1.0.3.4"; } } + public override string Author { get { return "and-81"; } } + public override string Description { get { return "IgorPlug USB Receiver"; } } + public override bool Start() + { + ThreadStart readThreadStart = new ThreadStart(ReadThread); + _readThread = new Thread(readThreadStart); + _readThread.Start(); + + return true; + } + public override void Suspend() { } + public override void Resume() { } + public override void Stop() + { + _readThread.Abort(); + } + public RemoteHandler RemoteCallback { get { return _remoteButtonHandler; } @@ -83,21 +94,7 @@ public string[] AvailablePorts { get { return Ports; } } public void Configure() { } - public bool Start() - { - ThreadStart readThreadStart = new ThreadStart(ReadThread); - _readThread = new Thread(readThreadStart); - _readThread.Start(); - return true; - } - public void Suspend() { } - public void Resume() { } - public void Stop() - { - _readThread.Abort(); - } - public bool Transmit(string file) { return false; } public LearnStatus Learn(out byte[] data) { @@ -105,12 +102,6 @@ return LearnStatus.Failure; } - public bool SetPort(string port) { return true; } - - #endregion IIRServerPlugin Members - - #region Implementation - void ReadThread() { try Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.Designer.cs 2007-08-31 15:38:37 UTC (rev 881) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.Designer.cs 2007-09-02 17:09:43 UTC (rev 882) @@ -37,14 +37,14 @@ this.buttonCancel = new System.Windows.Forms.Button(); this.groupBoxTimes = new System.Windows.Forms.GroupBox(); this.toolTips = new System.Windows.Forms.ToolTip(this.components); - this.comboBoxBlasterType = new System.Windows.Forms.ComboBox(); this.numericUpDownLearnTimeout = new System.Windows.Forms.NumericUpDown(); this.numericUpDownKeyHeldDelay = new System.Windows.Forms.NumericUpDown(); this.numericUpDownKeyRepeatDelay = new System.Windows.Forms.NumericUpDown(); this.checkBoxHandleKeyboardLocal = new System.Windows.Forms.CheckBox(); this.checkBoxHandleMouseLocal = new System.Windows.Forms.CheckBox(); this.numericUpDownMouseSensitivity = new System.Windows.Forms.NumericUpDown(); - this.labelBlasterType = new System.Windows.Forms.Label(); + this.checkBoxDisableMCEServices = new System.Windows.Forms.CheckBox(); + this.buttonAdvanced = new System.Windows.Forms.Button(); this.labelLearnIRTimeout = new System.Windows.Forms.Label(); this.tabControl = new System.Windows.Forms.TabControl(); this.tabPageBasic = new System.Windows.Forms.TabPage(); @@ -58,7 +58,6 @@ this.tabPageMouse = new System.Windows.Forms.TabPage(); this.labelMouseSensitivity = new System.Windows.Forms.Label(); this.checkBoxEnableMouse = new System.Windows.Forms.CheckBox(); - this.checkBoxLearnAsPronto = new System.Windows.Forms.CheckBox(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownButtonRepeatDelay)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownButtonHeldDelay)).BeginInit(); this.groupBoxTimes.SuspendLayout(); @@ -148,7 +147,7 @@ this.buttonOK.Location = new System.Drawing.Point(120, 208); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(64, 24); - this.buttonOK.TabIndex = 1; + this.buttonOK.TabIndex = 2; this.buttonOK.Text = "OK"; this.buttonOK.UseVisualStyleBackColor = true; this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); @@ -159,7 +158,7 @@ this.buttonCancel.Location = new System.Drawing.Point(192, 208); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(64, 24); - this.buttonCancel.TabIndex = 2; + this.buttonCancel.TabIndex = 3; this.buttonCancel.Text = "Cancel"; this.buttonCancel.UseVisualStyleBackColor = true; this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); @@ -177,16 +176,6 @@ this.groupBoxTimes.TabStop = false; this.groupBoxTimes.Text = "Remote button timing (in milliseconds)"; // - // comboBoxBlasterType - // - this.comboBoxBlasterType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.comboBoxBlasterType.FormattingEnabled = true; - this.comboBoxBlasterType.Location = new System.Drawing.Point(144, 40); - this.comboBoxBlasterType.Name = "comboBoxBlasterType"; - this.comboBoxBlasterType.Size = new System.Drawing.Size(88, 21); - this.comboBoxBlasterType.TabIndex = 1; - this.toolTips.SetToolTip(this.comboBoxBlasterType, "Choose between Microsoft or SMK manufactured MCE IR transceivers"); - // // numericUpDownLearnTimeout // this.numericUpDownLearnTimeout.Increment = new decimal(new int[] { @@ -194,7 +183,7 @@ 0, 0, 0}); - this.numericUpDownLearnTimeout.Location = new System.Drawing.Point(144, 72); + this.numericUpDownLearnTimeout.Location = new System.Drawing.Point(144, 40); this.numericUpDownLearnTimeout.Maximum = new decimal(new int[] { 60000, 0, @@ -207,7 +196,7 @@ 0}); this.numericUpDownLearnTimeout.Name = "numericUpDownLearnTimeout"; this.numericUpDownLearnTimeout.Size = new System.Drawing.Size(88, 20); - this.numericUpDownLearnTimeout.TabIndex = 3; + this.numericUpDownLearnTimeout.TabIndex = 1; this.numericUpDownLearnTimeout.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.numericUpDownLearnTimeout.ThousandsSeparator = true; this.toolTips.SetToolTip(this.numericUpDownLearnTimeout, "When teaching IR commands this is how long before the process times out"); @@ -321,21 +310,36 @@ 0, 65536}); // - // labelBlasterType + // checkBoxDisableMCEServices // - this.labelBlasterType.Location = new System.Drawing.Point(8, 40); - this.labelBlasterType.Name = "labelBlasterType"; - this.labelBlasterType.Size = new System.Drawing.Size(136, 21); - this.labelBlasterType.TabIndex = 0; - this.labelBlasterType.Text = "Blaster manufacturer:"; - this.labelBlasterType.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.checkBoxDisableMCEServices.Checked = true; + this.checkBoxDisableMCEServices.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkBoxDisableMCEServices.Location = new System.Drawing.Point(8, 80); + this.checkBoxDisableMCEServices.Name = "checkBoxDisableMCEServices"; + this.checkBoxDisableMCEServices.Size = new System.Drawing.Size(224, 24); + this.checkBoxDisableMCEServices.TabIndex = 2; + this.checkBoxDisableMCEServices.Text = "Disable Windows Media Center services"; + this.toolTips.SetToolTip(this.checkBoxDisableMCEServices, "Disable Microsoft Windows Media Center services to prevent interference with IR S" + + "erver"); + this.checkBoxDisableMCEServices.UseVisualStyleBackColor = true; // + // buttonAdvanced + // + this.buttonAdvanced.Location = new System.Drawing.Point(8, 208); + this.buttonAdvanced.Name = "buttonAdvanced"; + this.buttonAdvanced.Size = new System.Drawing.Size(72, 24); + this.buttonAdvanced.TabIndex = 1; + this.buttonAdvanced.Text = "Advanced"; + this.toolTips.SetToolTip(this.buttonAdvanced, "Click here for advanced driver settings"); + this.buttonAdvanced.UseVisualStyleBackColor = true; + this.buttonAdvanced.Click += new System.EventHandler(this.buttonAdvanced_Click); + // // labelLearnIRTimeout // - this.labelLearnIRTimeout.Location = new System.Drawing.Point(8, 72); + this.labelLearnIRTimeout.Location = new System.Drawing.Point(8, 40); this.labelLearnIRTimeout.Name = "labelLearnIRTimeout"; this.labelLearnIRTimeout.Size = new System.Drawing.Size(136, 20); - this.labelLearnIRTimeout.TabIndex = 2; + this.labelLearnIRTimeout.TabIndex = 0; this.labelLearnIRTimeout.Text = "Learn IR timeout:"; this.labelLearnIRTimeout.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // @@ -353,11 +357,9 @@ // // tabPageBasic // - this.tabPageBasic.Controls.Add(this.checkBoxLearnAsPronto); + this.tabPageBasic.Controls.Add(this.checkBoxDisableMCEServices); this.tabPageBasic.Controls.Add(this.labelLearnIRTimeout); - this.tabPageBasic.Controls.Add(this.labelBlasterType); this.tabPageBasic.Controls.Add(this.numericUpDownLearnTimeout); - this.tabPageBasic.Controls.Add(this.comboBoxBlasterType); this.tabPageBasic.Location = new System.Drawing.Point(4, 22); this.tabPageBasic.Name = "tabPageBasic"; this.tabPageBasic.Padding = new System.Windows.Forms.Padding(3); @@ -478,17 +480,6 @@ this.checkBoxEnableMouse.Text = "Enable mouse input"; this.checkBoxEnableMouse.UseVisualStyleBackColor = true; // - // checkBoxLearnAsPronto - // - this.checkBoxLearnAsPronto.Enabled = false; - this.checkBoxLearnAsPronto.Location = new System.Drawing.Point(8, 104); - this.checkBoxLearnAsPronto.Name = "checkBoxLearnAsPronto"; - this.checkBoxLearnAsPronto.Size = new System.Drawing.Size(224, 24); - this.checkBoxLearnAsPronto.TabIndex = 4; - this.checkBoxLearnAsPronto.Text = "Store learned codes in Pronto format"; - this.toolTips.SetToolTip(this.checkBoxLearnAsPronto, "Store learned IR commands in Philips Pronto format"); - this.checkBoxLearnAsPronto.UseVisualStyleBackColor = true; - // // Configure // this.AcceptButton = this.buttonOK; @@ -497,6 +488,7 @@ this.CancelButton = this.buttonCancel; this.ClientSize = new System.Drawing.Size(264, 239); this.ControlBox = false; + this.Controls.Add(this.buttonAdvanced); this.Controls.Add(this.tabControl); this.Controls.Add(this.buttonCancel); this.Controls.Add(this.buttonOK); @@ -531,8 +523,6 @@ private System.Windows.Forms.Button buttonCancel; private System.Windows.Forms.GroupBox groupBoxTimes; private System.Windows.Forms.ToolTip toolTips; - private System.Windows.Forms.ComboBox comboBoxBlasterType; - private System.Windows.Forms.Label labelBlasterType; private System.Windows.Forms.Label labelLearnIRTimeout; private System.Windows.Forms.NumericUpDown numericUpDownLearnTimeout; private System.Windows.Forms.TabControl tabControl; @@ -552,6 +542,7 @@ private System.Windows.Forms.NumericUpDown numericUpDownMouseSensitivity; private System.Windows.Forms.CheckBox checkBoxHandleMouseLocal; private System.Windows.Forms.CheckBox checkBoxEnableMouse; - private System.Windows.Forms.CheckBox checkBoxLearnAsPronto; + private System.Windows.Forms.CheckBox checkBoxDisableMCEServices; + private System.Windows.Forms.Button buttonAdvanced; } } \ No newline at end of file Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.cs 2007-08-31 15:38:37 UTC (rev 881) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.cs 2007-09-02 17:09:43 UTC (rev 882) @@ -13,22 +13,15 @@ #region Properties - public BlasterType BlastType - { - get { return (BlasterType)Enum.Parse(typeof(BlasterType), comboBoxBlasterType.SelectedItem as string, true); } - set { comboBoxBlasterType.SelectedItem = Enum.GetName(typeof(BlasterType), value); } - } - public int LearnTimeout { get { return Decimal.ToInt32(numericUpDownLearnTimeout.Value); } set { numericUpDownLearnTimeout.Value = new Decimal(value); } } - - public bool LearnAsPronto + public bool DisableMceServices { - get { return checkBoxLearnAsPronto.Checked; } - set { checkBoxLearnAsPronto.Checked = value; } + get { return checkBoxDisableMCEServices.Checked; } + set { checkBoxDisableMCEServices.Checked = value; } } public bool EnableRemote @@ -91,15 +84,18 @@ public Configure() { InitializeComponent(); - - comboBoxBlasterType.Items.Clear(); - comboBoxBlasterType.Items.AddRange(Enum.GetNames(typeof(BlasterType))); } #endregion Constructor #region Buttons + private void buttonAdvanced_Click(object sender, EventArgs e) + { + Advanced advanced = new Advanced(); + advanced.ShowDialog(this); + } + private void buttonOK_Click(object sender, EventArgs e) { this.DialogResult = DialogResult.OK; Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.resx =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.resx 2007-08-31 15:38:37 UTC (rev 881) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.resx 2007-09-02 17:09:43 UTC (rev 882) @@ -120,7 +120,4 @@ <metadata name="toolTips.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>17, 17</value> </metadata> - <metadata name="toolTips.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> - <value>17, 17</value> - </metadata> </root> \ No newline at end of file Deleted: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DeviceAccess.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DeviceAccess.cs 2007-08-31 15:38:37 UTC (rev 881) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DeviceAccess.cs 2007-09-02 17:09:43 UTC (rev 882) @@ -1,303 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Runtime.InteropServices; -using System.Text; - -using Microsoft.Win32.SafeHandles; - -namespace MicrosoftMceTransceiver -{ - - /// <summary> - /// Provides access to the MCE driver. - /// </summary> - public static class DeviceAccess - { - - #region Enumerations - - [Flags] - enum Digcfs - { - None = 0x00, - Default = 0x01, - Present = 0x02, - AllClasses = 0x04, - Profile = 0x08, - DeviceInterface = 0x10, - } - - [Flags] - public enum FileShares - { - None = 0x00, - Read = 0x01, - Write = 0x02, - Delete = 0x04, - } - - public enum CreationDisposition - { - None = 0, - New = 1, - CreateAlways = 2, - OpenExisting = 3, - OpenAlways = 4, - TruncateExisting = 5, - } - - [Flags] - public enum FileAttributes : uint - { - Readonly = 0x00000001, - Hidden = 0x00000002, - System = 0x00000004, - Directory = 0x00000010, - Archive = 0x00000020, - Device = 0x00000040, - Normal = 0x00000080, - Temporary = 0x00000100, - SparseFile = 0x00000200, - ReparsePoint = 0x00000400, - Compressed = 0x00000800, - Offline = 0x00001000, - NotContentIndexed = 0x00002000, - Encrypted = 0x00004000, - Write_Through = 0x80000000, - Overlapped = 0x40000000, - NoBuffering = 0x20000000, - RandomAccess = 0x10000000, - SequentialScan = 0x08000000, - DeleteOnClose = 0x04000000, - BackupSemantics = 0x02000000, - PosixSemantics = 0x01000000, - OpenReparsePoint = 0x00200000, - OpenNoRecall = 0x00100000, - FirstPipeInstance = 0x00080000, - } - - [Flags] - public enum FileAccessTypes : uint - { - GenericRead = 0x80000000, - GenericWrite = 0x40000000, - GenericExecute = 0x20000000, - GenericAll = 0x10000000, - } - - #endregion Enumerations - - #region Structures - - [StructLayout(LayoutKind.Sequential)] - struct DeviceInfoData - { - public int Size; - public Guid Class; - public uint DevInst; - public IntPtr Reserved; - } - - [StructLayout(LayoutKind.Sequential)] - struct DeviceInterfaceData - { - public int Size; - public Guid Class; - public uint Flags; - public uint Reserved; - } - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] - struct DeviceInterfaceDetailData - { - public int Size; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - public string DevicePath; - } - - #endregion Structures - - #region Interop - - [DllImport("kernel32", SetLastError = true, CharSet = CharSet.Auto)] - static extern SafeFileHandle CreateFile( - [MarshalAs(UnmanagedType.LPTStr)] string fileName, - [MarshalAs(UnmanagedType.U4)] FileAccessTypes fileAccess, - [MarshalAs(UnmanagedType.U4)] FileShares fileShare, - IntPtr securityAttributes, - [MarshalAs(UnmanagedType.U4)] CreationDisposition creationDisposition, - [MarshalAs(UnmanagedType.U4)] FileAttributes flags, - IntPtr templateFile); - - [DllImport("kernel32")] - [return: MarshalAs(UnmanagedType.Bool)] - static extern bool CancelIo( - SafeFileHandle handle); - - [DllImport("setupapi", CharSet = CharSet.Auto)] - static extern IntPtr SetupDiGetClassDevs( - ref Guid classGuid, - [MarshalAs(UnmanagedType.LPTStr)] string enumerator, - IntPtr hwndParent, - [MarshalAs(UnmanagedType.U4)] Digcfs flags); - - [DllImport("setupapi", SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - static extern bool SetupDiEnumDeviceInfo( - IntPtr handle, - int index, - ref DeviceInfoData deviceInfoData); - - [DllImport("setupapi", SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - static extern bool SetupDiEnumDeviceInterfaces( - IntPtr handle, - ref DeviceInfoData deviceInfoData, - ref Guid guidClass, - int memberIndex, - ref DeviceInterfaceData deviceInterfaceData); - - [DllImport("setupapi", SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - static extern bool SetupDiGetDeviceInterfaceDetail( - IntPtr handle, - ref DeviceInterfaceData deviceInterfaceData, - IntPtr unused1, - int unused2, - ref uint requiredSize, - IntPtr unused3); - - [DllImport("setupapi", SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - static extern bool SetupDiGetDeviceInterfaceDetail( - IntPtr handle, - ref DeviceInterfaceData deviceInterfaceData, - ref DeviceInterfaceDetailData deviceInterfaceDetailData, - uint detailSize, - IntPtr unused1, - IntPtr unused2); - - [DllImport("setupapi")] - [return: MarshalAs(UnmanagedType.Bool)] - static extern bool SetupDiDestroyDeviceInfoList( - IntPtr handle); - - #endregion Interop - - #region Methods - - /// <summary> - /// Find the device path for the supplied Device Class Guid. - /// </summary> - /// <param name="classGuid">GUID to locate device with.</param> - /// <returns>Device path.</returns> - public static string FindDevice(Guid classGuid) - { - string devicePath = null; - - IntPtr handle = SetupDiGetClassDevs(ref classGuid, null, IntPtr.Zero, Digcfs.DeviceInterface | Digcfs.Present); - - if (handle.ToInt32() == -1) - return null; - - for (int deviceIndex = 0; ; deviceIndex++) - { - DeviceInfoData deviceInfoData = new DeviceInfoData(); - deviceInfoData.Size = Marshal.SizeOf(deviceInfoData); - - if (!SetupDiEnumDeviceInfo(handle, deviceIndex, ref deviceInfoData)) - { - int lastError = Marshal.GetLastWin32Error(); - - // out of devices or do we have an error? - if (lastError != 0x0103 && lastError != 0x007E) - { - SetupDiDestroyDeviceInfoList(handle); - throw new Win32Exception(lastError); - } - - SetupDiDestroyDeviceInfoList(handle); - break; - } - - DeviceInterfaceData deviceInterfaceData = new DeviceInterfaceData(); - deviceInterfaceData.Size = Marshal.SizeOf(deviceInterfaceData); - - if (!SetupDiEnumDeviceInterfaces(handle, ref deviceInfoData, ref classGuid, 0, ref deviceInterfaceData)) - { - SetupDiDestroyDeviceInfoList(handle); - throw new Win32Exception(Marshal.GetLastWin32Error()); - } - - uint cbData = 0; - - if (!SetupDiGetDeviceInterfaceDetail(handle, ref deviceInterfaceData, IntPtr.Zero, 0, ref cbData, IntPtr.Zero) && cbData == 0) - { - SetupDiDestroyDeviceInfoList(handle); - throw new Win32Exception(Marshal.GetLastWin32Error()); - } - - DeviceInterfaceDetailData deviceInterfaceDetailData = new DeviceInterfaceDetailData(); - deviceInterfaceDetailData.Size = 5; - - if (!SetupDiGetDeviceInterfaceDetail(handle, ref deviceInterfaceData, ref deviceInterfaceDetailData, cbData, IntPtr.Zero, IntPtr.Zero)) - { - SetupDiDestroyDeviceInfoList(handle); - throw new Win32Exception(Marshal.GetLastWin32Error()); - } - - if ((deviceInterfaceDetailData.DevicePath.IndexOf("#vid_03ee&pid_2501") != -1) || // Mitsumi MCE remote - (deviceInterfaceDetailData.DevicePath.IndexOf("#vid_043e&pid_9803") != -1) || // LG - (deviceInterfaceDetailData.DevicePath.IndexOf("#vid_045e&pid_00a0") != -1) || // Microsoft - (deviceInterfaceDetailData.DevicePath.IndexOf("#vid_0471&pid_0815") != -1) || // Microsoft/Philips 2005 - (deviceInterfaceDetailData.DevicePath.IndexOf("#vid_0471&pid_060c") != -1) || // Philips (HP branded) - (deviceInterfaceDetailData.DevicePath.IndexOf("#vid_045e&pid_006d") != -1) || // Microsoft/Philips 2004 - (deviceInterfaceDetailData.DevicePath.IndexOf("#vid_0609&pid_031d") != -1) || // SMK/Toshiba G83C0004D410 (Hauppauge) - (deviceInterfaceDetailData.DevicePath.IndexOf("#vid_0609&pid_0322") != -1) || // SMK (Sony VAIO) - (deviceInterfaceDetailData.DevicePath.IndexOf("#vid_107b&pid_3009") != -1) || // FIC Spectra/Mycom Mediacenter - (deviceInterfaceDetailData.DevicePath.IndexOf("#vid_1308&pid_c001") != -1) || // Shuttle - (deviceInterfaceDetailData.DevicePath.IndexOf("#vid_1460&pid_9150") != -1) || // HP - (deviceInterfaceDetailData.DevicePath.IndexOf("#vid_1509&pid_9242") != -1) || // Fujitsu Scaleo-E - (deviceInterfaceDetailData.DevicePath.IndexOf("#vid_1784&pid_0001") != -1) || // Topseed - (deviceInterfaceDetailData.DevicePath.IndexOf("#vid_179d&pid_0010") != -1) || // Ricavision internal - (deviceInterfaceDetailData.DevicePath.IndexOf("#vid_195d&pid_7002") != -1) || // Itron ione Libra Q-11 - (deviceInterfaceDetailData.DevicePath.StartsWith(@"\\?\hid#irdevice&col01#2"))) // Microsoft/Philips 2005 (Vista) - { - SetupDiDestroyDeviceInfoList(handle); - devicePath = deviceInterfaceDetailData.DevicePath; - break; - } - } - - return devicePath; - } - - /// <summary> - /// Open a handle to the device driver. - /// </summary> - /// <param name="devicePath">Device path.</param> - /// <param name="access">Access type.</param> - /// <param name="share">Share type.</param> - /// <returns>Handle to device driver.</returns> - public static SafeFileHandle OpenHandle(string devicePath, FileAccessTypes access, FileShares share) - { - return CreateFile(devicePath, access, share, - IntPtr.Zero, CreationDisposition.OpenExisting, FileAttributes.Overlapped, IntPtr.Zero); - } - - /// <summary> - /// Cancel IO for device. - /// </summary> - /// <param name="deviceHandle">Handle to device.</param> - /// <returns>Success.</returns> - public static bool CancelDeviceIo(SafeFileHandle deviceHandle) - { - return CancelIo(deviceHandle); - } - - #endregion Methods - - } - -} Added: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs 2007-09-02 17:09:43 UTC (rev 882) @@ -0,0 +1,283 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.IO; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading; + +using Microsoft.Win32.SafeHandles; + +namespace MicrosoftMceTransceiver +{ + + public abstract class Driver + { + + #region Enumerations + + [Flags] + enum Digcfs + { + None = 0x00, + Default = 0x01, + Present = 0x02, + AllClasses = 0x04, + Profile = 0x08, + DeviceInterface = 0x10, + } + + [Flags] + public enum FileShares + { + None = 0x00, + Read = 0x01, + Write = 0x02, + Delete = 0x04, + } + + public enum CreationDisposition + { + None = 0, + New = 1, + CreateAlways = 2, + OpenExisting = 3, + OpenAlways = 4, + TruncateExisting = 5, + } + + [Flags] + public enum FileAttributes : uint + { + Readonly = 0x00000001, + Hidden = 0x00000002, + System = 0x00000004, + Directory = 0x00000010, + Archive = 0x00000020, + Device = 0x00000040, + Normal = 0x00000080, + Temporary = 0x00000100, + SparseFile = 0x00000200, + ReparsePoint = 0x00000400, + Compressed = 0x00000800, + Offline = 0x00001000, + NotContentIndexed = 0x00002000, + Encrypted = 0x00004000, + Write_Through = 0x80000000, + Overlapped = 0x40000000, + NoBuffering = 0x20000000, + RandomAccess = 0x10000000, + SequentialScan = 0x08000000, + DeleteOnClose = 0x04000000, + BackupSemantics = 0x02000000, + PosixSemantics = 0x01000000, + OpenReparsePoint = 0x00200000, + OpenNoRecall = 0x00100000, + FirstPipeInstance = 0x00080000, + } + + [Flags] + public enum FileAccessTypes : uint + { + GenericRead = 0x80000000, + GenericWrite = 0x40000000, + GenericExecute = 0x20000000, + GenericAll = 0x10000000, + } + + #endregion Enumerations + + #region Structures + + [StructLayout(LayoutKind.Sequential)] + struct DeviceInfoData + { + public int Size; + public Guid Class; + public uint DevInst; + public IntPtr Reserved; + } + + [StructLayout(LayoutKind.Sequential)] + struct DeviceInterfaceData + { + public int Size; + public Guid Class; + public uint Flags; + public uint Reserved; + } + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] + struct DeviceInterfaceDetailData + { + public int Size; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string DevicePath; + } + + #endregion Structures + + #region Interop + + [DllImport("setupapi.dll", CharSet = CharSet.Auto)] + static extern IntPtr SetupDiGetClassDevs( + ref Guid classGuid, + [MarshalAs(UnmanagedType.LPTStr)] string enumerator, + IntPtr hwndParent, + [MarshalAs(UnmanagedType.U4)] Digcfs flags); + + [DllImport("setupapi.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool SetupDiEnumDeviceInfo( + IntPtr handle, + int index, + ref DeviceInfoData deviceInfoData); + + [DllImport("setupapi.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool SetupDiEnumDeviceInterfaces( + IntPtr handle, + ref DeviceInfoData deviceInfoData, + ref Guid guidClass, + int memberIndex, + ref DeviceInterfaceData deviceInterfaceData); + + [DllImport("setupapi.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool SetupDiGetDeviceInterfaceDetail( + IntPtr handle, + ref DeviceInterfaceData deviceInterfaceData, + IntPtr unused1, + int unused2, + ref uint requiredSize, + IntPtr unused3); + + [DllImport("setupapi.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool SetupDiGetDeviceInterfaceDetail( + IntPtr handle, + ref DeviceInterfaceData deviceInterfaceData, + ref DeviceInterfaceDetailData deviceInterfaceDetailData, + uint detailSize, + IntPtr unused1, + IntPtr unused2); + + [DllImport("setupapi.dll")] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool SetupDiDestroyDeviceInfoList( + IntPtr handle); + + #endregion Interop + + #region Variables + + protected Guid _deviceGuid; + protected string _devicePath; + + protected RemoteCallback _remoteCallback = null; + protected KeyboardCallback _keyboardCallback = null; + protected MouseCallback _mouseCallback = null; + + #endregion Variables + + #region Constructors + + public Driver() { } + public Driver(Guid deviceGuid, string devicePath, RemoteCallback remoteCallback, KeyboardCallback keyboardCallback, MouseCallback mouseCallback) + { + _deviceGuid = deviceGuid; + _devicePath = devicePath; + + _remoteCallback = remoteCallback; + _keyboardCallback = keyboardCallback; + _mouseCallback = mouseCallback; + } + + #endregion Constructors + + #region Abstract Methods + + public abstract void Start(); + + public abstract void Stop(); + + public abstract IrCode Learn(int learnTimeout); + + public abstract void Send(IrCode code, uint port); + + #endregion Abstract Methods + + #region Static Methods + + /// <summary> + /// Find the device path for the supplied Device Class Guid. + /// </summary> + /// <param name="classGuid">GUID to locate device with.</param> + /// <returns>Device path.</returns> + public static string Find(Guid classGuid) + { + IntPtr handle = SetupDiGetClassDevs(ref classGuid, null, IntPtr.Zero, Digcfs.DeviceInterface | Digcfs.Present); + + if (handle.ToInt32() == -1) + return null; + + for (int deviceIndex = 0; ; deviceIndex++) + { + DeviceInfoData deviceInfoData = new DeviceInfoData(); + deviceInfoData.Size = Marshal.SizeOf(deviceInfoData); + + if (!SetupDiEnumDeviceInfo(handle, deviceIndex, ref deviceInfoData)) + { + int lastError = Marshal.GetLastWin32Error(); + + // out of devices or do we have an error? + if (lastError != Win32ErrorCodes.ERROR_NO_MORE_ITEMS && lastError != Win32ErrorCodes.ERROR_MOD_NOT_FOUND) + { + SetupDiDestroyDeviceInfoList(handle); + throw new Win32Exception(lastError); + } + + SetupDiDestroyDeviceInfoList(handle); + break; + } + + DeviceInterfaceData deviceInterfaceData = new DeviceInterfaceData(); + deviceInterfaceData.Size = Marshal.SizeOf(deviceInterfaceData); + + if (!SetupDiEnumDeviceInterfaces(handle, ref deviceInfoData, ref classGuid, 0, ref deviceInterfaceData)) + { + SetupDiDestroyDeviceInfoList(handle); + throw new Win32Exception(Marshal.GetLastWin32Error()); + } + + uint cbData = 0; + + if (!SetupDiGetDeviceInterfaceDetail(handle, ref deviceInterfaceData, IntPtr.Zero, 0, ref cbData, IntPtr.Zero) && cbData == 0) + { + SetupDiDestroyDeviceInfoList(handle); + throw new Win32Exception(Marshal.GetLastWin32Error()); + } + + DeviceInterfaceDetailData deviceInterfaceDetailData = new DeviceInterfaceDetailData(); + deviceInterfaceDetailData.Size = 5; + + if (!SetupDiGetDeviceInterfaceDetail(handle, ref deviceInterfaceData, ref deviceInterfaceDetailData, cbData, IntPtr.Zero, IntPtr.Zero)) + { + SetupDiDestroyDeviceInfoList(handle); + throw new Win32Exception(Marshal.GetLastWin32Error()); + } + + if (!String.IsNullOrEmpty(deviceInterfaceDetailData.DevicePath)) + { + SetupDiDestroyDeviceInfoList(handle); + return deviceInterfaceDetailData.DevicePath; + } + } + + return null; + } + + #endregion Static Methods + + } + +} Deleted: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IRCodeConversion.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IRCodeConversion.cs 2007-08-31 15:38:37 UTC (rev 881) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IRCodeConversion.cs 2007-09-02 17:09:43 UTC (rev 882) @@ -1,121 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace MicrosoftMceTransceiver -{ - - public static class IRCodeConversion - { - - #region Member Variables - - static uint[] timingData = null; - static int timingDataCount = 0; - static uint lastSpace = IRDecoder.PulseMask; - - #endregion Member Variables - - public static byte[] ConvertRawPacketToNativeData(byte[] rawPacket) - { - List<byte> nativeData = new List<byte>(); - byte packetByte; - int jump = 0; - - for (int index = 0; index < rawPacket.Length; index += jump + 1) - { - packetByte = rawPacket[index]; - - if (packetByte == 0x9F) - { - // Packet is finished - break; - } - - if (packetByte >= 0x81 && packetByte <= 0x84) - { - jump = packetByte & 0x7F; - - if (index + jump + 1 > rawPacket.Length) - { - // bad packet - return null; - } - - for (int get = index + 1; get < index + jump + 1; get++) - nativeData.Add(rawPacket[get]); - } - else - { - // Bad packet - return null; - } - } - - return nativeData.ToArray(); - } - - // TODO: Rewrite - public static uint[] ConvertNativeDataToTimingData(byte[] nativeData) - { - int index = 0; - uint code; - - if (timingData == null || nativeData == null) - { - timingData = new uint[100]; - timingData[1] = lastSpace; - timingData[2] = 0; - timingDataCount = 2; - } - - if (nativeData == null) - return null; - - bool pulse; - - while (index < nativeData.Length) - { - pulse = false; - code = nativeData[index++]; - - if ((code & 0x80) != 0) - { - pulse = true; - code &= 0x7F; - } - code *= 50; - - if (pulse) - { - if (lastSpace != 0) - { - timingData[timingDataCount++] = lastSpace; - lastSpace = 0; - timingData[timingDataCount] = 0; - } - - timingData[timingDataCount] += code; - timingData[timingDataCount] |= IRDecoder.PulseBit; - } - else - { - if (timingData[timingDataCount] != 0 && lastSpace == 0) - timingDataCount++; - - lastSpace += code; - } - } - - uint[] outData = new uint[timingDataCount]; - Array.Copy(timingData, outData, outData.Length); - - timingData[0] = timingData[timingDataCount]; - timingDataCount = 0; - - return outData; - } - - } - -} Added: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrCode.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrCode.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrCode.cs 2007-09-02 17:09:43 UTC (rev 882) @@ -0,0 +1,206 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; + +// Remember: Pulse is Positive, Space is Negative. + +namespace MicrosoftMceTransceiver +{ + + /// <summary> + /// Encapsulates an MCE compatible IR code. + /// </summary> + public class IrCode + { + + #region Constants + + public const int CarrierFrequencyUnknown = -1; + public const int CarrierFrequencyPulseMode = 0; + public const int CarrierFrequencyDefault = 36000; + + const int LongestSpace = -10000; + + #endregion Constants + + #region Member Variables + + int _carrier; + int[] _timingData; + + #endregion Member Variables + + #region Properties + + /// <summary> + /// The IR carrier frequency. + /// </summary> + public int Carrier + { + get { return _carrier; } + set { _carrier = value; } + } + + /// <summary> + /// The IR timing data. + /// </summary> + public int[] TimingData + { + get { return _timingData; } + set { _timingData = value; } + } + + #endregion Properties + + #region Constructors + + public IrCode() : this(CarrierFrequencyUnknown, new int[] { }) { } + public IrCode(int carrier) : this(carrier, new int[] { }) { } + public IrCode(int[] timingData) : this(CarrierFrequencyUnknown, timingData) { } + public IrCode(int carrier, int[] timingData) + { + _carrier = carrier; + _timingData = timingData; + } + + #endregion Constructors + + #region Methods + + public bool Finalize() + { + if (_timingData.Length == 0) + return false; + + List<int> newData = new List<int>(); + + for (int index = 0; index < _timingData.Length; index++) + { + int time = _timingData[index]; + + if (time < LongestSpace) + { + newData.Add(LongestSpace); + break; + } + else + { + newData.Add(time); + } + } + + _timingData = newData.ToArray(); + return true; + } + + /// <summary> + /// Add timing data to this IR code. + /// </summary> + /// <param name="addTimingData">Addition timing data.</param> + public void AddTimingData(int[] addTimingData) + { + List<int> newTimingData = new List<int>(); + + int index = 0; + + if (_timingData.Length > 1) + { + for (index = 0; index < _timingData.Length - 1; index++) + newTimingData.Add(_timingData[index]); + } + else if (_timingData.Length == 0) + { + _timingData = new int[addTimingData.Length]; + addTimingData.CopyTo(_timingData, 0); + return; + } + + if (addTimingData.Length == 0 || index >= _timingData.Length) + { + return; + } + + + if (Math.Sign(addTimingData[0]) == Math.Sign(_timingData[index])) + { + newTimingData.Add(_timingData[index] + addTimingData[0]); + + for (index = 1; index < addTimingData.Length; index++) + newTimingData.Add(addTimingData[index]); + } + else + { + newTimingData.Add(_timingData[index]); + newTimingData.AddRange(addTimingData); + } + + _timingData = newTimingData.ToArray(); + } + + public override string ToString() + { + ushort[] prontoData = Pronto.ConvertIrCodeToProntoRaw(this); + + StringBuilder output = new StringBuilder(); + + for (int index = 0; index < prontoData.Length; index++) + { + output.Append(prontoData[index].ToString("X4")); + if (index != prontoData.Length - 1) + output.Append(' '); + } + + return output.ToString(); + } + + #endregion Methods + + #region Static Methods + + /// <summary> + /// Takes old IR file bytes. + /// </summary> + /// <param name="data">IR file bytes.</param> + /// <returns>New IrCode object.</returns> + public static IrCode FromBytes(byte[] data) + { + List<int> timingData = new List<int>(); + + int len = 0; + + for (int index = 0; index < data.Length; index++) + { + byte curByte = data[index]; + + if ((curByte & 0x80) != 0) + len += (int)(curByte & 0x7F); + else + len -= (int)(curByte & 0x7F); + + if ((curByte & 0x7F) != 0x7F) + { + timingData.Add(len * 50); + len = 0; + } + } + + return new IrCode(timingData.ToArray()); + } + + public static IrCode FromString(string code) + { + string[] stringData = code.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); + + ushort[] prontoData = new ushort[stringData.Length]; + for (int i = 0; i < stringData.Length; i++) + prontoData[i] = ushort.Parse(stringData[i], System.Globalization.NumberStyles.HexNumber); + + return Pronto.ConvertProntoDataToIrCode(prontoData); + } + + #endregion Static Methods + + } + +} Added: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrDecoder.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrDecoder.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrDecoder.cs 2007-09-02 17:09:43 UTC (rev 882) @@ -0,0 +1,1353 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace MicrosoftMceTransceiver +{ + + #region Enumerations + + /// <summary> + /// Protocol of IR Code. + /// </summary> + public enum IRProtocol + { + None, + //ITT, + JVC, + NEC, + //NRC17, + RC5, + RC6, + RCA, + //RCMM, + RECS80, + //Sharp, + SIRC, + //XSAT, + } + + #endregion Enumerations + + #region Delegates + + public delegate void RemoteCallback(IRProtocol codeType, uint keyCode); + public delegate void KeyboardCallback(uint keyCode, uint modifiers); + public delegate void MouseCallback(int deltaX, int deltaY, bool rightButton, bool leftButton); + + #endregion Delegates + + /// <summary> + /// Used for decoding received IR codes. + /// </summary> + public static class IrDecoder + { + + #region Constants + + //public const uint PulseBit = 0x01000000; + //public const uint PulseMask = 0x00FFFFFF; + + //const UInt16 ToggleBitMce = 0x8000; + const UInt16 ToggleMaskMce = 0x7FFF; + const UInt16 CustomerMce = 0x800F; + + const UInt16 ToggleMaskRC5 = 0xF7FF; + const UInt16 ToggleMaskRC5X = 0xFFFF; + + const uint PrefixRC6 = 0x000FC950; + const uint PrefixRC6A = 0x000FCA90; + + const uint MceMouse = 1; + const uint MceKeyboard = 4; + + #endregion Constants + + #region Detection Data + + static RemoteDetectionData JVC_Data = null; + static RemoteDetectionData NEC_Data = null; + static RemoteDetectionData RC5_Data = null; + static RemoteDetectionData RC6_Data = null; + static RemoteDetectionData RCA_Data = null; + static RemoteDetectionData RECS80_Data = null; + static RemoteDetectionData SIRC_Data = null; + + static MceDetectionData MCE_Data = null; + + #endregion Detection Data + + #region Methods + + /// <summary> + /// Decode timing data to discover IR Protocol and button code. + /// </summary> + /// <param name="timingData">Input timing data.</param> + /// <param name="remoteCallback">Method to call when Remote button decoded.</param> + /// <param name="keyboardCallback">Method to call when Keyboard event decoded.</param> + /// <param name="mouseCallback">Method to call when Mouse event decoded.</param> + public static void DecodeIR(int[] timingData, RemoteCallback remoteCallback, KeyboardCallback keyboardCallback, MouseCallback mouseCallback) + { +// DetectITT(timingData, remoteCallback); + DetectJVC(timingData, remoteCallback); + DetectNEC(timingData, remoteCallback); +// DetectNRC17(timingData, remoteCallback); + DetectRC5(timingData, remoteCallback); + DetectRC6(timingData, remoteCallback); + DetectRCA(timingData, remoteCallback); +// DetectRCMM(timingData, remoteCallback); + DetectRECS80(timingData, remoteCallback); +// DetectSharp(timingData, remoteCallback); + DetectSIRC(timingData, remoteCallback); // 15 Bit +// DetectXSAT(timingData, remoteCallback); + + DetectMCE(timingData, keyboardCallback, mouseCallback); + } + + static void DetectJVC(int[] timingData, RemoteCallback remoteCallback) + { + if (JVC_Data == null || timingData == null) + JVC_Data = new RemoteDetectionData(); + + if (timingData == null) + return; + + for (int i = 0; i < timingData.Length; i++) + { + int duration = Math.Abs(timingData[i]); + bool pulse = (timingData[i] > 0); + bool ignored = true; + + switch (JVC_Data.State) + { + + #region HeaderPulse + case RemoteDetectionState.HeaderPulse: + //Console.WriteLine("JVC HeaderPulse"); + + if (pulse && duration >= 8200 && duration <= 8600) + { + JVC_Data.State = RemoteDetectionState.HeaderSpace; + ignored = false; + } + break; + #endregion HeaderPulse + + #region HeaderSpace + case RemoteDetectionState.HeaderSpace: + //Console.WriteLine("JVC HeaderSpace"); + + if (!pulse && duration >= 4000 && duration <= 4400) + { + JVC_Data.State = RemoteDetectionState.Data; + JVC_Data.HalfBit = 0; + JVC_Data.Bit = 0; + JVC_Data.Code = 0; + ignored = false; + } + break; + #endregion HeaderSpace + + #region Data + case RemoteDetectionState.Data: + //Console.WriteLine("JVC Data"); + + if (pulse && duration >= 350 && duration <= 750) + { + JVC_Data.HalfBit = 1; + ignored = false; + } + else if (!pulse && duration >= 250 && duration <= 650 && JVC_Data.HalfBit == 1) + { + JVC_Data.Code <<= 1; + JVC_Data.Bit++; + JVC_Data.HalfBit = 0; + ignored = false; + } + else if (!pulse && duration >= 1450 && duration <= 1850 && JVC_Data.HalfBit == 1) + { + JVC_Data.Code <<= 1; + JVC_Data.Code |= 1; + JVC_Data.Bit++; + JVC_Data.HalfBit = 0; + ignored = false; + } + else + { + //Console.WriteLine("JVC Error"); + } + + if (JVC_Data.Bit == 16) + { + remoteCallback(IRProtocol.JVC, JVC_Data.Code); + JVC_Data.State = RemoteDetectionState.Leading; + } + break; + #endregion Data + + #region Leading + case RemoteDetectionState.Leading: + //Console.WriteLine("JVC Leading"); + + if (pulse && duration >= 350 && duration <= 750) + { + JVC_Data = new RemoteDetectionData(); + JVC_Data.State = RemoteDetectionState.Data; + ignored = false; + } + break; + #endregion Leading + + } + + if (ignored && (JVC_Data.State != RemoteDetectionState.HeaderPulse)) + JVC_Data = new RemoteDetectionData(); + } + } + static void DetectNEC(int[] timingData, RemoteCallback remoteCallback) + { + if (NEC_Data == null || timingData == null) + NEC_Data = new RemoteDetectionData(); + + if (timingData == null) + return; + + for (int i = 0; i < timingData.Length; i++) + { + int duration = Math.Abs(timingData[i]); + bool pulse = (timingData[i] > 0); + bool ignored = true; + + switch (NEC_Data.State) + { + + #region HeaderPulse + case RemoteDetectionState.HeaderPulse: + //Console.WriteLine("NEC HeaderPulse"); + + if (pulse && duration >= 8800 && durati... [truncated message content] |
From: <an...@us...> - 2007-09-10 16:07:08
|
Revision: 910 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=910&view=rev Author: and-81 Date: 2007-09-10 09:07:01 -0700 (Mon, 10 Sep 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Debug Client/Debug Client.csproj trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.Designer.cs trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs trunk/plugins/IR Server Suite/Applications/Debug Client/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/IR Blast/IR Blast.csproj trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs trunk/plugins/IR Server Suite/Applications/IR Blast/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/IR Blast (No Window).csproj trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.Designer.cs trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.cs trunk/plugins/IR Server Suite/Applications/IR File Tool/IR File Tool.csproj trunk/plugins/IR Server Suite/Applications/IR File Tool/Program.cs trunk/plugins/IR Server Suite/Applications/IR File Tool/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs trunk/plugins/IR Server Suite/Applications/IR Server/IR Server.csproj 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/IR Server/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/SageSetup/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/GetKeyCodeForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/LearnIR.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/Applications/Translator/Program.cs trunk/plugins/IR Server Suite/Applications/Translator/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Translator/Translator.csproj trunk/plugins/IR Server Suite/Applications/Tray Launcher/GetKeyCodeForm.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray Launcher.csproj 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/Applications/Virtual Remote/Program.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/Virtual Remote.csproj trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/Virtual Remote Skin Editor.csproj trunk/plugins/IR Server Suite/IPC/AppModule.InterProcessComm/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IPC/AppModule.NamedPipes/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IPC/Named Pipes/PipeAccess.cs trunk/plugins/IR Server Suite/IPC/Named Pipes/PipeMessage.cs trunk/plugins/IR Server Suite/IPC/Named Pipes/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IR Server Plugin Interface.csproj trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/XBCDRC Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Suite.sln trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/LearnIR.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 Blast Zone Plugin/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/LearnIR.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/LearnIR.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/LearnIR.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/Debug Client.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/Debug Client.csproj 2007-09-10 14:16:47 UTC (rev 909) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/Debug Client.csproj 2007-09-10 16:07:01 UTC (rev 910) @@ -47,7 +47,7 @@ <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <DebugType> </DebugType> - <PlatformTarget>AnyCPU</PlatformTarget> + <PlatformTarget>x86</PlatformTarget> <ErrorReport>prompt</ErrorReport> </PropertyGroup> <ItemGroup> Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.Designer.cs 2007-09-10 14:16:47 UTC (rev 909) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.Designer.cs 2007-09-10 16:07:01 UTC (rev 910) @@ -38,7 +38,6 @@ this.buttonShutdownServer = new System.Windows.Forms.Button(); this.listBoxStatus = new System.Windows.Forms.ListBox(); this.buttonCrash = new System.Windows.Forms.Button(); - this.buttonListConnected = new System.Windows.Forms.Button(); this.buttonPing = new System.Windows.Forms.Button(); this.groupBoxGenerateMessage = new System.Windows.Forms.GroupBox(); this.textBoxCustom = new System.Windows.Forms.TextBox(); @@ -69,7 +68,7 @@ this.buttonBlast.Location = new System.Drawing.Point(8, 48); this.buttonBlast.Name = "buttonBlast"; this.buttonBlast.Size = new System.Drawing.Size(64, 24); - this.buttonBlast.TabIndex = 2; + this.buttonBlast.TabIndex = 1; this.buttonBlast.Text = "Blast IR"; this.toolTips.SetToolTip(this.buttonBlast, "Blast learned IR code"); this.buttonBlast.UseVisualStyleBackColor = true; @@ -123,10 +122,10 @@ // buttonShutdownServer // this.buttonShutdownServer.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonShutdownServer.Location = new System.Drawing.Point(296, 16); + this.buttonShutdownServer.Location = new System.Drawing.Point(296, 48); this.buttonShutdownServer.Name = "buttonShutdownServer"; this.buttonShutdownServer.Size = new System.Drawing.Size(64, 24); - this.buttonShutdownServer.TabIndex = 5; + this.buttonShutdownServer.TabIndex = 4; this.buttonShutdownServer.Text = "Shutdown"; this.toolTips.SetToolTip(this.buttonShutdownServer, "Shutdown server"); this.buttonShutdownServer.UseVisualStyleBackColor = true; @@ -150,34 +149,22 @@ // buttonCrash // this.buttonCrash.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonCrash.Location = new System.Drawing.Point(368, 16); + this.buttonCrash.Location = new System.Drawing.Point(368, 48); this.buttonCrash.Name = "buttonCrash"; this.buttonCrash.Size = new System.Drawing.Size(64, 24); - this.buttonCrash.TabIndex = 6; + this.buttonCrash.TabIndex = 5; this.buttonCrash.Text = "Crash"; this.toolTips.SetToolTip(this.buttonCrash, "Crash this program"); this.buttonCrash.UseVisualStyleBackColor = true; this.buttonCrash.Click += new System.EventHandler(this.buttonCrash_Click); // - // buttonListConnected - // - this.buttonListConnected.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonListConnected.Location = new System.Drawing.Point(368, 48); - this.buttonListConnected.Name = "buttonListConnected"; - this.buttonListConnected.Size = new System.Drawing.Size(64, 24); - this.buttonListConnected.TabIndex = 8; - this.buttonListConnected.Text = "# clients"; - this.toolTips.SetToolTip(this.buttonListConnected, "Get client count from server"); - this.buttonListConnected.UseVisualStyleBackColor = true; - this.buttonListConnected.Click += new System.EventHandler(this.buttonListConnected_Click); - // // buttonPing // this.buttonPing.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonPing.Location = new System.Drawing.Point(296, 48); + this.buttonPing.Location = new System.Drawing.Point(368, 16); this.buttonPing.Name = "buttonPing"; this.buttonPing.Size = new System.Drawing.Size(64, 24); - this.buttonPing.TabIndex = 7; + this.buttonPing.TabIndex = 3; this.buttonPing.Text = "Ping"; this.toolTips.SetToolTip(this.buttonPing, "Ping the server"); this.buttonPing.UseVisualStyleBackColor = true; @@ -334,7 +321,6 @@ this.groupBoxCommands.Controls.Add(this.buttonBlast); this.groupBoxCommands.Controls.Add(this.buttonLearnIR); this.groupBoxCommands.Controls.Add(this.buttonShutdownServer); - this.groupBoxCommands.Controls.Add(this.buttonListConnected); this.groupBoxCommands.Controls.Add(this.buttonPing); this.groupBoxCommands.Location = new System.Drawing.Point(8, 80); this.groupBoxCommands.Name = "groupBoxCommands"; @@ -350,7 +336,7 @@ this.comboBoxPort.Location = new System.Drawing.Point(80, 50); this.comboBoxPort.Name = "comboBoxPort"; this.comboBoxPort.Size = new System.Drawing.Size(80, 21); - this.comboBoxPort.TabIndex = 3; + this.comboBoxPort.TabIndex = 2; this.toolTips.SetToolTip(this.comboBoxPort, "Port for blasting IR"); // // buttonIRBlastAutoTest @@ -417,7 +403,6 @@ private System.Windows.Forms.Button buttonShutdownServer; private System.Windows.Forms.ListBox listBoxStatus; private System.Windows.Forms.Button buttonCrash; - private System.Windows.Forms.Button buttonListConnected; private System.Windows.Forms.Button buttonPing; private System.Windows.Forms.GroupBox groupBoxGenerateMessage; private System.Windows.Forms.TextBox textBoxCustom; Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-09-10 14:16:47 UTC (rev 909) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-09-10 16:07:01 UTC (rev 910) @@ -163,91 +163,57 @@ { PipeMessage received = PipeMessage.FromString(message); - this.Invoke(_AddStatusLine, new Object[] { String.Format("Received Message: \"{0}\"", received.Name) }); + this.Invoke(_AddStatusLine, new Object[] { String.Format("Received Message: \"{0}\"", Enum.GetName(typeof(PipeMessageType), received.Type)) }); try { - switch (received.Name) + switch (received.Type) { - case "Blast Success": - case "Blast Failure": - case "Keyboard Event": - case "Mouse Event": + case PipeMessageType.RegisterClient: + if ((received.Flags & PipeMessageFlags.Success) == PipeMessageFlags.Success) + { + _irServerInfo = IRServerInfo.FromBytes(received.DataAsBytes); + comboBoxPort.Items.Clear(); + comboBoxPort.Items.AddRange(_irServerInfo.Ports); + comboBoxPort.SelectedIndex = 0; + } + else if ((received.Flags & PipeMessageFlags.Failure) == PipeMessageFlags.Failure) + { + if (PipeAccess.ServerRunning) + PipeAccess.StopServer(); + } return; - case "Clients": - { - string clients = String.Format("There are {0} client(s) attached to the server", BitConverter.ToInt32(received.Data, 0)); - this.Invoke(_AddStatusLine, new Object[] { clients }); + case PipeMessageType.RemoteEvent: + RemoteHandlerCallback(received.DataAsString); return; - } - case "Register Success": - { - _irServerInfo = IRServerInfo.FromBytes(received.Data); + case PipeMessageType.LearnIR: + if ((received.Flags & PipeMessageFlags.Success) == PipeMessageFlags.Success) + { + byte[] dataBytes = received.DataAsBytes; - comboBoxPort.Items.Clear(); - comboBoxPort.Items.AddRange(_irServerInfo.Ports); - comboBoxPort.SelectedIndex = 0; - return; - } + FileStream file = new FileStream(_learnIRFilename, FileMode.Create); + file.Write(dataBytes, 0, dataBytes.Length); + file.Close(); + } - case "Register Failure": - { - if (PipeAccess.ServerRunning) - PipeAccess.StopServer(); - return; - } - - case "Remote Event": - { - string keyCode = Encoding.ASCII.GetString(received.Data); - RemoteHandlerCallback(keyCode); - return; - } - - case "Learn Success": - { - FileStream file = new FileStream(_learnIRFilename, FileMode.Create, FileAccess.Write, FileShare.None); - file.Write(received.Data, 0, received.Data.Length); - file.Flush(); - file.Close(); - _learnIRFilename = null; - return; - } + break; - case "Learn Failure": - { - _learnIRFilename = null; - return; - } - - - case "Server Shutdown": - { + case PipeMessageType.ServerShutdown: if (PipeAccess.ServerRunning) PipeAccess.StopServer(); return; - } - case "Echo": - { - _echoID = BitConverter.ToInt32(received.Data, 0); - break; - } - - case "Error": - { - this.Invoke(_AddStatusLine, new Object[] { Encoding.ASCII.GetString(received.Data) }); + case PipeMessageType.Echo: + _echoID = BitConverter.ToInt32(received.DataAsBytes, 0); return; - } - default: - { - this.Invoke(_AddStatusLine, new Object[] { "Unknown message received: " + received.Name }); + case PipeMessageType.Error: + _learnIRFilename = null; + this.Invoke(_AddStatusLine, new Object[] { received.DataAsString }); return; - } } } catch (Exception ex) @@ -292,8 +258,8 @@ } while (retry); - PipeMessage message = new PipeMessage(_localPipeName, Environment.MachineName, "Register", null); - PipeAccess.SendMessage(Common.ServerPipeName, _serverAddress, message.ToString()); + PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.RegisterClient, PipeMessageFlags.Request); + PipeAccess.SendMessage(Common.ServerPipeName, _serverAddress, message); return true; } @@ -307,8 +273,8 @@ _learnIRFilename = fileName; - PipeMessage message = new PipeMessage(_localPipeName, Environment.MachineName, "Learn", null); - PipeAccess.SendMessage(Common.ServerPipeName, _serverAddress, message.ToString()); + PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.LearnIR, PipeMessageFlags.Request); + PipeAccess.SendMessage(Common.ServerPipeName, _serverAddress, message); AddStatusLine("Learning"); } @@ -337,8 +303,8 @@ file.Read(outData, 4 + port.Length, (int)file.Length); file.Close(); - PipeMessage message = new PipeMessage(_localPipeName, Environment.MachineName, "Blast", outData); - PipeAccess.SendMessage(Common.ServerPipeName, _serverAddress, message.ToString()); + PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.BlastIR, PipeMessageFlags.Request, outData); + PipeAccess.SendMessage(Common.ServerPipeName, _serverAddress, message); } catch (Exception ex) { @@ -392,8 +358,8 @@ try { - PipeMessage message = new PipeMessage(_localPipeName, Environment.MachineName, "Unregister", null); - PipeAccess.SendMessage(Common.ServerPipeName, _serverAddress, message.ToString()); + PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.UnregisterClient, PipeMessageFlags.Request); + PipeAccess.SendMessage(Common.ServerPipeName, _serverAddress, message); } catch (Exception ex) { @@ -460,8 +426,8 @@ try { - PipeMessage message = new PipeMessage(_localPipeName, Environment.MachineName, "Shutdown", null); - PipeAccess.SendMessage(Common.ServerPipeName, _serverAddress, message.ToString()); + PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.ServerShutdown, PipeMessageFlags.Request); + PipeAccess.SendMessage(Common.ServerPipeName, _serverAddress, message); } catch (Exception ex) { @@ -472,26 +438,6 @@ { throw new System.InvalidOperationException("User initiated exception thrown"); } - private void buttonListConnected_Click(object sender, EventArgs e) - { - AddStatusLine("List Clients"); - - if (!PipeAccess.ServerRunning) - { - AddStatusLine(" - Not connected"); - return; - } - - try - { - PipeMessage message = new PipeMessage(_localPipeName, Environment.MachineName, "List", null); - PipeAccess.SendMessage(Common.ServerPipeName, _serverAddress, message.ToString()); - } - catch (Exception ex) - { - AddStatusLine(ex.Message); - } - } private void buttonPing_Click(object sender, EventArgs e) { AddStatusLine("Ping Server"); @@ -504,8 +450,8 @@ try { - PipeMessage message = new PipeMessage(_localPipeName, Environment.MachineName, "Ping", BitConverter.GetBytes(24)); - PipeAccess.SendMessage(Common.ServerPipeName, _serverAddress, message.ToString()); + PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.Ping, PipeMessageFlags.Request, BitConverter.GetBytes(24)); + PipeAccess.SendMessage(Common.ServerPipeName, _serverAddress, message); } catch (Exception ex) { @@ -522,8 +468,10 @@ if (PipeMessage.FromString(textBoxCustom.Text) == null) AddStatusLine("Warning: The specified custom message is not a valid message structure"); - PipeAccess.SendMessage(Common.ServerPipeName, _serverAddress, textBoxCustom.Text); + PipeMessage customMessage = PipeMessage.FromString(textBoxCustom.Text); + PipeAccess.SendMessage(Common.ServerPipeName, _serverAddress, customMessage); + AddStatusLine("Custom message sent"); } catch (Exception ex) @@ -565,8 +513,8 @@ BitConverter.GetBytes(keyCode).CopyTo(data, 0); BitConverter.GetBytes(0).CopyTo(data, 4); - PipeMessage message = new PipeMessage(_localPipeName, Environment.MachineName, "Forward Remote Event", data); - PipeAccess.SendMessage(Common.ServerPipeName, _serverAddress, message.ToString()); + PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.ForwardRemoteEvent, PipeMessageFlags.None, data); + PipeAccess.SendMessage(Common.ServerPipeName, _serverAddress, message); } catch (Exception ex) { Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/Properties/AssemblyInfo.cs 2007-09-10 14:16:47 UTC (rev 909) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/Properties/AssemblyInfo.cs 2007-09-10 16:07:01 UTC (rev 910) @@ -37,3 +37,4 @@ [assembly: AssemblyFileVersion("1.0.3.4")] [assembly: CLSCompliant(true)] +[assembly: GuidAttribute("8eeb5fcb-322c-45ee-80a9-3d30cc08a48c")] Modified: trunk/plugins/IR Server Suite/Applications/IR Blast/IR Blast.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast/IR Blast.csproj 2007-09-10 14:16:47 UTC (rev 909) +++ trunk/plugins/IR Server Suite/Applications/IR Blast/IR Blast.csproj 2007-09-10 16:07:01 UTC (rev 910) @@ -49,7 +49,7 @@ <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <DebugType> </DebugType> - <PlatformTarget>AnyCPU</PlatformTarget> + <PlatformTarget>x86</PlatformTarget> <UseVSHostingProcess>false</UseVSHostingProcess> <ErrorReport>prompt</ErrorReport> </PropertyGroup> Modified: trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2007-09-10 14:16:47 UTC (rev 909) +++ trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2007-09-10 16:07:01 UTC (rev 910) @@ -249,8 +249,8 @@ { _registered = false; - PipeMessage message = new PipeMessage(_localPipeName, Environment.MachineName, "Unregister", null); - PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message.ToString()); + PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.UnregisterClient, PipeMessageFlags.Request); + PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message); } } catch { } @@ -305,8 +305,8 @@ { try { - PipeMessage message = new PipeMessage(_localPipeName, Environment.MachineName, "Register", null); - PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message.ToString()); + PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.RegisterClient, PipeMessageFlags.Request); + PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message); return true; } catch (AppModule.NamedPipes.NamedPipeIOException) @@ -388,8 +388,8 @@ try { - PipeMessage message = new PipeMessage(_localPipeName, Environment.MachineName, "Ping", BitConverter.GetBytes(pingID)); - PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message.ToString()); + PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.Ping, PipeMessageFlags.Request, BitConverter.GetBytes(pingID)); + PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message); } catch { @@ -441,64 +441,45 @@ { PipeMessage received = PipeMessage.FromString(message); - IrssLog.Debug("Received Message \"{0}\"", received.Name); + IrssLog.Debug("Received Message \"{0}\"", Enum.GetName(typeof(PipeMessageType), received.Type)); try { - switch (received.Name) + switch (received.Type) { - case "Remote Event": - case "Keyboard Event": - case "Mouse Event": + case PipeMessageType.BlastIR: + if ((received.Flags & PipeMessageFlags.Success) == PipeMessageFlags.Success) + Info("Blast Success"); + else if ((received.Flags & PipeMessageFlags.Failure) == PipeMessageFlags.Failure) + Warn("Blast Failed!"); break; - case "Blast Success": - Info("Blast Success"); - break; - - case "Blast Failure": - Warn("Blast Failed!"); - break; - - case "Register Success": + case PipeMessageType.RegisterClient: + if ((received.Flags & PipeMessageFlags.Success) == PipeMessageFlags.Success) { Info("Registered to IR Server"); _registered = true; - //_irServerInfo = TransceiverInfo.FromBytes(received.Data); - break; + //_irServerInfo = TransceiverInfo.FromString(received.Data); } - - case "Register Failure": + else if ((received.Flags & PipeMessageFlags.Failure) == PipeMessageFlags.Failure) { - Warn("IR Server refused to register"); _registered = false; - break; + Warn("IR Server refused to register"); } + break; - case "Server Shutdown": - { - Warn("IR Server Shutdown - Blasting disabled until IR Server returns"); - _registered = false; - break; - } + case PipeMessageType.ServerShutdown: + _registered = false; + Warn("IR Server Shutdown - Blasting disabled until IR Server returns"); + break; - case "Echo": - { - _echoID = BitConverter.ToInt32(received.Data, 0); - break; - } + case PipeMessageType.Echo: + _echoID = BitConverter.ToInt32(received.DataAsBytes, 0); + break; - case "Error": - { - Warn(Encoding.ASCII.GetString(received.Data)); - break; - } - - default: - { - Warn("Unknown message received from server: " + received.Name); - break; - } + case PipeMessageType.Error: + Warn(received.DataAsString); + break; } } catch (Exception ex) @@ -519,8 +500,8 @@ file.Read(outData, 4 + port.Length, (int)file.Length); file.Close(); - PipeMessage message = new PipeMessage(_localPipeName, Environment.MachineName, "Blast", outData); - PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message.ToString()); + PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.BlastIR, PipeMessageFlags.Request, outData); + PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message); } #region Log Commands Modified: trunk/plugins/IR Server Suite/Applications/IR Blast/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast/Properties/AssemblyInfo.cs 2007-09-10 14:16:47 UTC (rev 909) +++ trunk/plugins/IR Server Suite/Applications/IR Blast/Properties/AssemblyInfo.cs 2007-09-10 16:07:01 UTC (rev 910) @@ -36,4 +36,5 @@ [assembly: AssemblyVersion("1.0.3.4")] [assembly: AssemblyFileVersion("1.0.3.4")] -[assembly: CLSCompliant(true)] \ No newline at end of file +[assembly: CLSCompliant(true)] +[assembly: GuidAttribute("5eeca936-da49-4952-ab3b-9f11ec57e4aa")] Modified: trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/IR Blast (No Window).csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/IR Blast (No Window).csproj 2007-09-10 14:16:47 UTC (rev 909) +++ trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/IR Blast (No Window).csproj 2007-09-10 16:07:01 UTC (rev 910) @@ -49,7 +49,7 @@ <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <DebugType> </DebugType> - <PlatformTarget>AnyCPU</PlatformTarget> + <PlatformTarget>x86</PlatformTarget> <UseVSHostingProcess>false</UseVSHostingProcess> <ErrorReport>prompt</ErrorReport> </PropertyGroup> Modified: trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2007-09-10 14:16:47 UTC (rev 909) +++ trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2007-09-10 16:07:01 UTC (rev 910) @@ -211,8 +211,8 @@ { _registered = false; - PipeMessage message = new PipeMessage(_localPipeName, Environment.MachineName, "Unregister", null); - PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message.ToString()); + PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.UnregisterClient, PipeMessageFlags.Request); + PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message); } } catch { } @@ -267,8 +267,8 @@ { try { - PipeMessage message = new PipeMessage(_localPipeName, Environment.MachineName, "Register", null); - PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message.ToString()); + PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.RegisterClient, PipeMessageFlags.Request); + PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message); return true; } catch (AppModule.NamedPipes.NamedPipeIOException) @@ -350,8 +350,8 @@ try { - PipeMessage message = new PipeMessage(_localPipeName, Environment.MachineName, "Ping", BitConverter.GetBytes(pingID)); - PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message.ToString()); + PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.Ping, PipeMessageFlags.Request, BitConverter.GetBytes(pingID)); + PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message); } catch { @@ -403,64 +403,45 @@ { PipeMessage received = PipeMessage.FromString(message); - IrssLog.Debug("Received Message \"{0}\"", received.Name); + IrssLog.Debug("Received Message \"{0}\"", Enum.GetName(typeof(PipeMessageType), received.Type)); try { - switch (received.Name) + switch (received.Type) { - case "Remote Event": - case "Keyboard Event": - case "Mouse Event": + case PipeMessageType.BlastIR: + if ((received.Flags & PipeMessageFlags.Success) == PipeMessageFlags.Success) + IrssLog.Info("Blast Success"); + else if ((received.Flags & PipeMessageFlags.Failure) == PipeMessageFlags.Failure) + IrssLog.Warn("Blast Failed!"); break; - case "Blast Success": - IrssLog.Info("Blast Success"); - break; - - case "Blast Failure": - IrssLog.Warn("Blast Failed!"); - break; - - case "Register Success": + case PipeMessageType.RegisterClient: + if ((received.Flags & PipeMessageFlags.Success) == PipeMessageFlags.Success) { IrssLog.Info("Registered to IR Server"); _registered = true; - //_irServerInfo = TransceiverInfo.FromBytes(received.Data); - break; + //_irServerInfo = TransceiverInfo.FromString(received.Data); } - - case "Register Failure": + else if ((received.Flags & PipeMessageFlags.Failure) == PipeMessageFlags.Failure) { - IrssLog.Warn("IR Server refused to register"); _registered = false; - break; + IrssLog.Warn("IR Server refused to register"); } + break; - case "Server Shutdown": - { - IrssLog.Warn("IR Server Shutdown - Blasting disabled until IR Server returns"); - _registered = false; - break; - } + case PipeMessageType.ServerShutdown: + _registered = false; + IrssLog.Warn("IR Server Shutdown - Blasting disabled until IR Server returns"); + break; - case "Echo": - { - _echoID = BitConverter.ToInt32(received.Data, 0); - break; - } + case PipeMessageType.Echo: + _echoID = BitConverter.ToInt32(received.DataAsBytes, 0); + break; - case "Error": - { - IrssLog.Warn(Encoding.ASCII.GetString(received.Data)); - break; - } - - default: - { - IrssLog.Warn("Unknown message received from server: " + received.Name); - break; - } + case PipeMessageType.Error: + IrssLog.Warn(received.DataAsString); + break; } } catch (Exception ex) @@ -481,8 +462,8 @@ file.Read(outData, 4 + port.Length, (int)file.Length); file.Close(); - PipeMessage message = new PipeMessage(_localPipeName, Environment.MachineName, "Blast", outData); - PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message.ToString()); + PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.BlastIR, PipeMessageFlags.Request, outData); + PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message); } } Modified: trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Properties/AssemblyInfo.cs 2007-09-10 14:16:47 UTC (rev 909) +++ trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Properties/AssemblyInfo.cs 2007-09-10 16:07:01 UTC (rev 910) @@ -36,4 +36,5 @@ [assembly: AssemblyVersion("1.0.3.4")] [assembly: AssemblyFileVersion("1.0.3.4")] -[assembly: CLSCompliant(true)] \ No newline at end of file +[assembly: CLSCompliant(true)] +[assembly: GuidAttribute("81eb136b-cc74-4eed-976d-f96ebccd1ce4")] Modified: trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.Designer.cs 2007-09-10 14:16:47 UTC (rev 909) +++ trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.Designer.cs 2007-09-10 16:07:01 UTC (rev 910) @@ -1,4 +1,4 @@ -namespace IR_File_Tool +namespace IrFileTool { partial class FormMain { @@ -28,9 +28,17 @@ /// </summary> private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); + this.SuspendLayout(); + // + // FormMain + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Text = "Form1"; + this.ClientSize = new System.Drawing.Size(284, 264); + this.Name = "FormMain"; + this.Text = "IR File Tool"; + this.ResumeLayout(false); + } #endregion Modified: trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.cs 2007-09-10 14:16:47 UTC (rev 909) +++ trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.cs 2007-09-10 16:07:01 UTC (rev 910) @@ -6,7 +6,7 @@ using System.Text; using System.Windows.Forms; -namespace IR_File_Tool +namespace IrFileTool { public partial class FormMain : Form { Modified: trunk/plugins/IR Server Suite/Applications/IR File Tool/IR File Tool.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR File Tool/IR File Tool.csproj 2007-09-10 14:16:47 UTC (rev 909) +++ trunk/plugins/IR Server Suite/Applications/IR File Tool/IR File Tool.csproj 2007-09-10 16:07:01 UTC (rev 910) @@ -7,8 +7,11 @@ <ProjectGuid>{B5E711A2-E6D0-4BEA-B66B-7A8B0BCA6A4D}</ProjectGuid> <OutputType>WinExe</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>IR_File_Tool</RootNamespace> + <RootNamespace>IRFileTool</RootNamespace> <AssemblyName>IR File Tool</AssemblyName> + <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent> + <StartupObject> + </StartupObject> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> @@ -37,11 +40,14 @@ </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> <OutputPath>bin\x86\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> + <DefineConstants> + </DefineConstants> <Optimize>true</Optimize> <DebugType>pdbonly</DebugType> <PlatformTarget>x86</PlatformTarget> <ErrorReport>prompt</ErrorReport> + <UseVSHostingProcess>false</UseVSHostingProcess> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <ItemGroup> <Reference Include="System" /> @@ -61,6 +67,12 @@ <Compile Include="Program.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="FormMain.resx"> + <SubType>Designer</SubType> + <DependentUpon>FormMain.cs</DependentUpon> + </EmbeddedResource> + </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. Modified: trunk/plugins/IR Server Suite/Applications/IR File Tool/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR File Tool/Program.cs 2007-09-10 14:16:47 UTC (rev 909) +++ trunk/plugins/IR Server Suite/Applications/IR File Tool/Program.cs 2007-09-10 16:07:01 UTC (rev 910) @@ -2,10 +2,12 @@ using System.Collections.Generic; using System.Windows.Forms; -namespace IR_File_Tool +namespace IrFileTool { + static class Program { + /// <summary> /// The main entry point for the application. /// </summary> @@ -16,5 +18,7 @@ Application.SetCompatibleTextRenderingDefault(false); Application.Run(new FormMain()); } + } -} \ No newline at end of file + +} Modified: trunk/plugins/IR Server Suite/Applications/IR File Tool/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR File Tool/Properties/AssemblyInfo.cs 2007-09-10 14:16:47 UTC (rev 909) +++ trunk/plugins/IR Server Suite/Applications/IR File Tool/Properties/AssemblyInfo.cs 2007-09-10 16:07:01 UTC (rev 910) @@ -8,9 +8,9 @@ [assembly: AssemblyTitle("IR File Tool")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] +[assembly: AssemblyCompany("and-81")] [assembly: AssemblyProduct("IR File Tool")] -[assembly: AssemblyCopyright("Copyright © 2007")] +[assembly: AssemblyCopyright("Aaron Dinnage")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs 2007-09-10 14:16:47 UTC (rev 909) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs 2007-09-10 16:07:01 UTC (rev 910) @@ -144,8 +144,9 @@ { checkBoxRunAtBoot.Checked = SystemRegistry.GetAutoRun("IR Server"); } - catch + catch (Exception ex) { + IrssLog.Error(ex.ToString()); } ArrayList networkPCs = IrssUtils.Win32.GetNetworkComputers(); Modified: trunk/plugins/IR Server Suite/Applications/IR Server/IR Server.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/IR Server.csproj 2007-09-10 14:16:47 UTC (rev 909) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IR Server.csproj 2007-09-10 16:07:01 UTC (rev 910) @@ -71,7 +71,7 @@ <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <DebugType> </DebugType> - <PlatformTarget>AnyCPU</PlatformTarget> + <PlatformTarget>x86</PlatformTarget> <UseVSHostingProcess>false</UseVSHostingProcess> <ErrorReport>prompt</ErrorReport> </PropertyGroup> Modified: trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-09-10 14:16:47 UTC (rev 909) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-09-10 16:07:01 UTC (rev 910) @@ -116,21 +116,33 @@ if (String.IsNullOrEmpty(_pluginNameReceive) && String.IsNullOrEmpty(_pluginNameTransmit)) { - IrssLog.Warn("No transmit/receive plugin loaded"); + IrssLog.Warn("No transmit or receive plugin loaded"); } else { - if (!String.IsNullOrEmpty(_pluginNameReceive)) - _pluginReceive = Program.GetPlugin(_pluginNameReceive); - else + if (String.IsNullOrEmpty(_pluginNameReceive)) + { IrssLog.Warn("No receiver plugin loaded"); + } + else + { + _pluginReceive = Program.GetPlugin(_pluginNameReceive); + } if (_pluginNameTransmit.Equals(_pluginNameReceive, StringComparison.InvariantCultureIgnoreCase)) + { _pluginTransmit = _pluginReceive; - else if (!String.IsNullOrEmpty(_pluginNameTransmit)) - _pluginTransmit = Program.GetPlugin(_pluginNameTransmit); - else + IrssLog.Info("Using the same plugin for transmit and receive"); + } + else if (String.IsNullOrEmpty(_pluginNameTransmit)) + { IrssLog.Warn("No transmit plugin loaded"); + } + else + { + _pluginTransmit = Program.GetPlugin(_pluginNameTransmit); + } + } StartMessageQueue(); @@ -185,6 +197,7 @@ IrssLog.Error(ex.ToString()); } } + if (!_pluginNameTransmit.Equals(_pluginNameReceive, StringComparison.InvariantCultureIgnoreCase)) { if (_pluginTransmit != null) @@ -244,7 +257,7 @@ if (_mode == IRServerMode.ServerMode) { - PipeMessage message = new PipeMessage(Common.ServerPipeName, Environment.MachineName, "Server Shutdown", null); + PipeMessage message = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.ServerShutdown, PipeMessageFlags.Request); SendToAll(message); } @@ -418,8 +431,8 @@ } while (retry); - PipeMessage message = new PipeMessage(_localPipeName, Environment.MachineName, "Register", null); - PipeAccess.SendMessage(Common.ServerPipeName, _hostComputer, message.ToString()); + PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.RegisterClient, PipeMessageFlags.Request); + PipeAccess.SendMessage(Common.ServerPipeName, _hostComputer, message); } catch (Exception ex) { @@ -437,8 +450,8 @@ { _registered = false; - PipeMessage message = new PipeMessage(_localPipeName, Environment.MachineName, "Unregister", null); - PipeAccess.SendMessage(Common.ServerPipeName, _hostComputer, message.ToString()); + PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.UnregisterClient, PipeMessageFlags.Request); + PipeAccess.SendMessage(Common.ServerPipeName, _hostComputer, message); } } catch { } @@ -485,8 +498,8 @@ } while (retry); - PipeMessage message = new PipeMessage(_localPipeName, Environment.MachineName, "Register Repeater", null); - PipeAccess.SendMessage(Common.ServerPipeName, _hostComputer, message.ToString()); + PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.RegisterRepeater); + PipeAccess.SendMessage(Common.ServerPipeName, _hostComputer, message); } catch (Exception ex) { @@ -504,8 +517,8 @@ { _registered = false; - PipeMessage message = new PipeMessage(_localPipeName, Environment.MachineName, "Unregister Repeater", null); - PipeAccess.SendMessage(Common.ServerPipeName, _hostComputer, message.ToString()); + PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.UnregisterRepeater); + PipeAccess.SendMessage(Common.ServerPipeName, _hostComputer, message); } } catch { } @@ -528,14 +541,14 @@ { case IRServerMode.ServerMode: { - PipeMessage message = new PipeMessage(Common.ServerPipeName, Environment.MachineName, "Remote Event", bytes); + PipeMessage message = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.RemoteEvent, PipeMessageFlags.None, bytes); SendToAll(message); break; } case IRServerMode.RelayMode: { - PipeMessage message = new PipeMessage(_localPipeName, Environment.MachineName, "Forward Remote Event", bytes); + PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.ForwardRemoteEvent, PipeMessageFlags.None, bytes); SendTo(Common.ServerPipeName, _hostComputer, message); break; } @@ -560,14 +573,14 @@ { case IRServerMode.ServerMode: { - PipeMessage message = new PipeMessage(Common.ServerPipeName, Environment.MachineName, "Keyboard Event", bytes); + PipeMessage message = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.KeyboardEvent, PipeMessageFlags.None, bytes); SendToAll(message); break; } case IRServerMode.RelayMode: { - PipeMessage message = new PipeMessage(_localPipeName, Environment.MachineName, "Forward Keyboard Event", bytes); + PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.ForwardKeyboardEvent, PipeMessageFlags.None, bytes); SendTo(Common.ServerPipeName, _hostComputer, message); break; } @@ -593,14 +606,14 @@ { case IRServerMode.ServerMode: { - PipeMessage message = new PipeMessage(Common.ServerPipeName, Environment.MachineName, "Mouse Event", bytes); + PipeMessage message = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.MouseEvent, PipeMessageFlags.None, bytes); SendToAll(message); break; } case IRServerMode.RelayMode: { - PipeMessage message = new PipeMessage(_localPipeName, Environment.MachineName, "Forward Mouse Event", bytes); + PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.ForwardMouseEvent, PipeMessageFlags.None, bytes); SendTo(Common.ServerPipeName, _hostComputer, message); break; } @@ -623,10 +636,11 @@ if (_pluginReceive != null) _pluginReceive.Resume(); + if (_pluginTransmit != null && _pluginTransmit != _pluginReceive) _pluginTransmit.Resume(); - // TODO: Inform clients + // TODO: Inform clients ? break; } @@ -636,17 +650,16 @@ if (_pluginReceive != null) _pluginReceive.Suspend(); + if (_pluginTransmit != null && _pluginTransmit != _pluginReceive) _pluginTransmit.Suspend(); - // TODO: Inform clients - /* + // Inform clients ... if (_mode == IRServerMode.ServerMode) { - PipeMessage message = new PipeMessage(Common.ServerPipeName, Environment.MachineName, "Server Shutdown", null); + PipeMessage message = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.ServerShutdown); SendToAll(message); } - */ break; } } @@ -654,7 +667,7 @@ void SendToAll(PipeMessage message) { - IrssLog.Debug("SendToAll({0})", message.ToString()); + IrssLog.Debug("SendToAll({0})", message); List<Client> unregister = new List<Client>(); @@ -664,7 +677,7 @@ { try { - PipeAccess.SendMessage(client.Pipe, client.Server, message.ToString()); + PipeAccess.SendMessage(client.Pipe, client.Server, message); } catch (Exception ex) { @@ -686,7 +699,7 @@ } void SendToAllExcept(string exceptPipe, string exceptServer, PipeMessage message) { - IrssLog.Debug("SendToAllExcept({0}, {1}, {2})", exceptPipe, exceptServer, message.ToString()); + IrssLog.Debug("SendToAllExcept({0}, {1}, {2})", exceptPipe, exceptServer, message); List<Client> unregister = new List<Client>(); @@ -699,7 +712,7 @@ if (client.Pipe == exceptPipe && client.Server == exceptServer) continue; - PipeAccess.SendMessage(client.Pipe, client.Server, message.ToString()); + PipeAccess.SendMessage(client.Pipe, client.Server, message); } catch (Exception ex) { @@ -721,11 +734,11 @@ } void SendTo(string pipe, string server, PipeMessage message) { - IrssLog.Debug("SendTo({0}, {1}, {2})", pipe, server, message.ToString()); + IrssLog.Debug("SendTo({0}, {1}, {2})", pipe, server, message); try { - PipeAccess.SendMessage(pipe, server, message.ToString()); + PipeAccess.SendMessage(pipe, server, message); } catch (Exception ex) { @@ -737,7 +750,7 @@ } void SendToRepeaters(PipeMessage message) { - IrssLog.Debug("SendToRepeaters({0})", message.ToString()); + IrssLog.Debug("SendToRepeaters({0})", message); List<Client> unregister = new List<Client>(); @@ -747,7 +760,7 @@ { try { - PipeAccess.SendMessage(client.Pipe, client.Server, message.ToString()); + PipeAccess.SendMessage(client.Pipe, client.Server, message); } catch (Exception ex) { @@ -968,203 +981,189 @@ try { - switch (received.Name) + switch (received.Type) { - case "Remote Event": - case "Keyboard Event": - case "Mouse Event": - break; - - case "Register Success": + case PipeMessageType.ForwardRemoteEvent: + { + PipeMessage forward = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.RemoteEvent, PipeMessageFlags.None, received.DataAsBytes); + if (_mode == IRServerMode.RelayMode) { - IrssLog.Info("Registered with host server"); - _registered = true; - break; + forward.Type = received.Type; + SendTo(Common.ServerPipeName, _hostComputer, forward); } - - case "Register Failure": + else { - IrssLog.Warn("Host server refused registration"); - _registered = false; - break; + SendToAllExcept(received.FromPipe, received.FromServer, forward); } + break; + } - case "Forward Remote Event": + case PipeMessageType.ForwardKeyboardEvent: + { + PipeMessage forward = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.KeyboardEvent, PipeMessageFlags.None, received.DataAsBytes); + if (_mode == IRServerMode.RelayMode) { - PipeMessage forward = new PipeMessage(Common.ServerPipeName, Environment.MachineName, "Remote Event", received.Data); - if (_mode == IRServerMode.RelayMode) - { - forward.Name = received.Name; - SendTo(Common.ServerPipeName, _hostComputer, forward); - } - else - { - SendToAllExcept(received.FromPipe, received.FromServer, forward); - } - break; + forward.Type = received.Type; + SendTo(Common.ServerPipeName, _hostComputer, forward); } - - case "Forward Keyboard Event": + else { - PipeMessage forward = new PipeMessage(Common.ServerPipeName, Environment.MachineName, "Keyboard Event", received.Data); - if (_mode == IRServerMode.RelayMode) - { - forward.Name = received.Name; - SendTo(Common.ServerPipeName, _hostComputer, forward); - } - else - { - SendToAllExcept(received.FromPipe, received.FromServer, forward); - } - break; + SendToAllExcept(received.FromPipe, received.FromServer, forward); } + break; + } - case "Forward Mouse Event": + case PipeMessageType.ForwardMouseEvent: + { + PipeMessage forward = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.MouseEvent, PipeMessageFlags.None, received.DataAsBytes); + if (_mode == IRServerMode.RelayMode) { - PipeMessage forward = new PipeMessage(Common.ServerPipeName, Environment.MachineName, "Mouse Event", received.Data); - if (_mode == IRServerMode.RelayMode) - { - forward.Name = received.Name; - SendTo(Common.ServerPipeName, _hostComputer, forward); - } - else - { - SendToAllExcept(received.FromPipe, received.FromServer, forward); - } - break; + forward.Type = received.Type; + SendTo(Common.ServerPipeName, _hostComputer, forward); } - - case "List": + else { - if (_mode != IRServerMode.RelayMode) - { - PipeMessage response = new PipeMessage(Common.ServerPipeName, Environment.MachineName, "Clients", BitConverter.GetBytes(_registeredClients.Count)); - SendTo(received.FromPipe, received.FromServer, response); - } - break; + SendToAllExcept(received.FromPipe, received.FromServer, forward); } + break; + } - case "Blast": - { - if (_mode == IRServerMode.RelayMode) - { - PipeMessage reply = new PipeMessage(Common.ServerPipeName, Environment.MachineName, received.Name + " Failure", null); - SendTo(received.FromPipe, received.FromServer, reply); - break; - } + case PipeMessageType.BlastIR: + { + PipeMessage response = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.BlastIR, PipeMessageFlags.Response); + if (_mode == IRServerMode.RelayMode) + { + response.Flags |= PipeMessageFlags.Failure; + } + else + { if (_registeredRepeaters.Count > 0) SendToRepeaters(received); - PipeMessage response = new PipeMessage(Common.ServerPipeName, Environment.MachineName, received.Name + " Failure", null); + if (BlastIR(received.DataAsBytes)) + response.Flags |= PipeMessageFlags.Success; + else + response.Flags |= PipeMessageFlags.Failure; + } - if (BlastIR(received.Data)) - response.Name = received.Name + " Success"; + SendTo(received.FromPipe, received.FromServer, response); + break; + } - SendTo(received.FromPipe, received.FromServer, response); - break; - } + case PipeMessageType.LearnIR: + { + PipeMessage response = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.LearnIR, PipeMessageFlags.Response); - case "Learn": + if (_mode == IRServerMode.RelayMode) { - if (_mode == IRServerMode.RelayMode) - { - PipeMessage reply = new PipeMessage(Common.ServerPipeName, Environment.MachineName, received.Name + " Failure", null); - SendTo(received.FromPipe, received.FromServer, reply); - break; - } - - // Prepare response ... - PipeMessage response = new PipeMessage(Common.ServerPipeName, Environment.MachineName, received.Name + " Failure", null); - + response.Flags |= PipeMessageFlags.Failure; + } + else + { byte[] bytes = LearnIR(); - if (bytes != null) - { - response.Name = received.Name + " Success"; - response.Data = bytes; - } - - SendTo(received.FromPipe, received.FromServer, response); - ... [truncated message content] |
From: <an...@us...> - 2007-09-12 12:28:36
|
Revision: 916 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=916&view=rev Author: and-81 Date: 2007-09-12 05:28:29 -0700 (Wed, 12 Sep 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.Designer.cs trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.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/Program.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs trunk/plugins/IR Server Suite/IPC/Named Pipes/PipeMessage.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverReplacement.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverVista.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverXP.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/UirtTransceiver.cs trunk/plugins/IR Server Suite/IR Server Suite.sln trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MPBlastZonePlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.Designer.cs 2007-09-11 19:30:37 UTC (rev 915) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.Designer.cs 2007-09-12 12:28:29 UTC (rev 916) @@ -349,7 +349,6 @@ this.buttonIRBlastAutoTest.Text = "IRBlast Auto-Test"; this.toolTips.SetToolTip(this.buttonIRBlastAutoTest, "Runs a random number blasting test"); this.buttonIRBlastAutoTest.UseVisualStyleBackColor = true; - this.buttonIRBlastAutoTest.Visible = false; this.buttonIRBlastAutoTest.Click += new System.EventHandler(this.buttonAutoTest_Click); // // buttonHelp Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-09-11 19:30:37 UTC (rev 915) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-09-12 12:28:29 UTC (rev 916) @@ -163,7 +163,7 @@ { PipeMessage received = PipeMessage.FromString(message); - this.Invoke(_AddStatusLine, new Object[] { String.Format("Received Message: \"{0}\"", Enum.GetName(typeof(PipeMessageType), received.Type)) }); + this.Invoke(_AddStatusLine, new Object[] { String.Format("Received Message: \"{0}, {1}\"", received.Type, received.Flags) }); try { Modified: trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2007-09-11 19:30:37 UTC (rev 915) +++ trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2007-09-12 12:28:29 UTC (rev 916) @@ -441,7 +441,7 @@ { PipeMessage received = PipeMessage.FromString(message); - IrssLog.Debug("Received Message \"{0}\"", Enum.GetName(typeof(PipeMessageType), received.Type)); + IrssLog.Debug("Received Message \"{0}\"", received.Type); try { @@ -500,7 +500,7 @@ file.Read(outData, 4 + port.Length, (int)file.Length); file.Close(); - PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.BlastIR, PipeMessageFlags.Request, outData); + PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.BlastIR, PipeMessageFlags.Request | PipeMessageFlags.ForceNotRespond, outData); PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message); } Modified: trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2007-09-11 19:30:37 UTC (rev 915) +++ trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2007-09-12 12:28:29 UTC (rev 916) @@ -403,7 +403,7 @@ { PipeMessage received = PipeMessage.FromString(message); - IrssLog.Debug("Received Message \"{0}\"", Enum.GetName(typeof(PipeMessageType), received.Type)); + IrssLog.Debug("Received Message \"{0}\"", received.Type); try { @@ -462,7 +462,7 @@ file.Read(outData, 4 + port.Length, (int)file.Length); file.Close(); - PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.BlastIR, PipeMessageFlags.Request, outData); + PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.BlastIR, PipeMessageFlags.Request | PipeMessageFlags.ForceNotRespond, outData); PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message); } Modified: trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-09-11 19:30:37 UTC (rev 915) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-09-12 12:28:29 UTC (rev 916) @@ -257,7 +257,7 @@ if (_mode == IRServerMode.ServerMode) { - PipeMessage message = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.ServerShutdown, PipeMessageFlags.Request); + PipeMessage message = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.ServerShutdown, PipeMessageFlags.Notify); SendToAll(message); } @@ -498,7 +498,7 @@ } while (retry); - PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.RegisterRepeater); + PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.RegisterRepeater, PipeMessageFlags.Request); PipeAccess.SendMessage(Common.ServerPipeName, _hostComputer, message); } catch (Exception ex) @@ -517,7 +517,7 @@ { _registered = false; - PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.UnregisterRepeater); + PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.UnregisterRepeater, PipeMessageFlags.Request); PipeAccess.SendMessage(Common.ServerPipeName, _hostComputer, message); } } @@ -541,14 +541,14 @@ { case IRServerMode.ServerMode: { - PipeMessage message = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.RemoteEvent, PipeMessageFlags.None, bytes); + PipeMessage message = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.RemoteEvent, PipeMessageFlags.Notify, bytes); SendToAll(message); break; } case IRServerMode.RelayMode: { - PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.ForwardRemoteEvent, PipeMessageFlags.None, bytes); + PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.ForwardRemoteEvent, PipeMessageFlags.Request, bytes); SendTo(Common.ServerPipeName, _hostComputer, message); break; } @@ -573,14 +573,14 @@ { case IRServerMode.ServerMode: { - PipeMessage message = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.KeyboardEvent, PipeMessageFlags.None, bytes); + PipeMessage message = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.KeyboardEvent, PipeMessageFlags.Notify, bytes); SendToAll(message); break; } case IRServerMode.RelayMode: { - PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.ForwardKeyboardEvent, PipeMessageFlags.None, bytes); + PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.ForwardKeyboardEvent, PipeMessageFlags.Request, bytes); SendTo(Common.ServerPipeName, _hostComputer, message); break; } @@ -606,14 +606,14 @@ { case IRServerMode.ServerMode: { - PipeMessage message = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.MouseEvent, PipeMessageFlags.None, bytes); + PipeMessage message = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.MouseEvent, PipeMessageFlags.Notify, bytes); SendToAll(message); break; } case IRServerMode.RelayMode: { - PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.ForwardMouseEvent, PipeMessageFlags.None, bytes); + PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.ForwardMouseEvent, PipeMessageFlags.Request, bytes); SendTo(Common.ServerPipeName, _hostComputer, message); break; } @@ -657,7 +657,7 @@ // Inform clients ... if (_mode == IRServerMode.ServerMode) { - PipeMessage message = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.ServerShutdown); + PipeMessage message = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.ServerShutdown, PipeMessageFlags.Notify); SendToAll(message); } break; @@ -935,23 +935,30 @@ return false; } } - byte[] LearnIR() + LearnStatus LearnIR(out byte[] data) { IrssLog.Debug("Learn IR"); - if (_pluginTransmit == null || !(_pluginTransmit is ILearnIR)) + data = null; + + if (_pluginTransmit == null) { - IrssLog.Debug("Active transceiver doesn't support learn"); - return null; + IrssLog.Debug("No transmit plugin loaded, can't learn"); + return LearnStatus.Failure; } + else if (!(_pluginTransmit is ILearnIR)) + { + IrssLog.Debug("Active transmit plugin doesn't support learn"); + return LearnStatus.Failure; + } - Thread.Sleep(500); + Thread.Sleep(250); - byte[] data = null; + LearnStatus status = LearnStatus.Failure; try { - LearnStatus status = (_pluginTransmit as ILearnIR).Learn(out data); + status = (_pluginTransmit as ILearnIR).Learn(out data); switch (status) { case LearnStatus.Success: @@ -972,7 +979,7 @@ IrssLog.Error(ex.ToString()); } - return data; + return status; } void HandlePipeMessage(PipeMessage received) @@ -984,49 +991,43 @@ switch (received.Type) { case PipeMessageType.ForwardRemoteEvent: - { - PipeMessage forward = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.RemoteEvent, PipeMessageFlags.None, received.DataAsBytes); if (_mode == IRServerMode.RelayMode) { - forward.Type = received.Type; + PipeMessage forward = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.ForwardRemoteEvent, PipeMessageFlags.Request, received.DataAsBytes); SendTo(Common.ServerPipeName, _hostComputer, forward); } else { + PipeMessage forward = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.RemoteEvent, PipeMessageFlags.Notify, received.DataAsBytes); SendToAllExcept(received.FromPipe, received.FromServer, forward); } break; - } case PipeMessageType.ForwardKeyboardEvent: - { - PipeMessage forward = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.KeyboardEvent, PipeMessageFlags.None, received.DataAsBytes); if (_mode == IRServerMode.RelayMode) { - forward.Type = received.Type; + PipeMessage forward = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.ForwardKeyboardEvent, PipeMessageFlags.Request, received.DataAsBytes); SendTo(Common.ServerPipeName, _hostComputer, forward); } else { + PipeMessage forward = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.KeyboardEvent, PipeMessageFlags.Notify, received.DataAsBytes); SendToAllExcept(received.FromPipe, received.FromServer, forward); } break; - } case PipeMessageType.ForwardMouseEvent: - { - PipeMessage forward = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.MouseEvent, PipeMessageFlags.None, received.DataAsBytes); if (_mode == IRServerMode.RelayMode) { - forward.Type = received.Type; + PipeMessage forward = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.ForwardMouseEvent, PipeMessageFlags.Request, received.DataAsBytes); SendTo(Common.ServerPipeName, _hostComputer, forward); } else { + PipeMessage forward = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.MouseEvent, PipeMessageFlags.Notify, received.DataAsBytes); SendToAllExcept(received.FromPipe, received.FromServer, forward); } break; - } case PipeMessageType.BlastIR: { @@ -1047,7 +1048,9 @@ response.Flags |= PipeMessageFlags.Failure; } - SendTo(received.FromPipe, received.FromServer, response); + if ((received.Flags & PipeMessageFlags.ForceNotRespond) != PipeMessageFlags.ForceNotRespond) + SendTo(received.FromPipe, received.FromServer, response); + break; } @@ -1061,12 +1064,25 @@ } else { - byte[] bytes = LearnIR(); + byte[] bytes = null; - if (bytes == null) - response.Flags |= PipeMessageFlags.Failure; - else - response.Flags |= PipeMessageFlags.Success; + LearnStatus status = LearnIR(out bytes); + + switch (status) + { + case LearnStatus.Success: + response.Flags |= PipeMessageFlags.Success; + response.DataAsBytes = bytes; + break; + + case LearnStatus.Failure: + response.Flags |= PipeMessageFlags.Failure; + break; + + case LearnStatus.Timeout: + response.Flags |= PipeMessageFlags.Timeout; + break; + } } SendTo(received.FromPipe, received.FromServer, response); @@ -1076,14 +1092,21 @@ case PipeMessageType.ServerShutdown: if (_mode == IRServerMode.ServerMode) { - IrssLog.Info("Shutdown command received"); - Stop(); - Application.Exit(); + if ((received.Flags & PipeMessageFlags.Request) == PipeMessageFlags.Request) + { + IrssLog.Info("Shutdown command received"); + Stop(); + Application.Exit(); + } } else { - IrssLog.Warn("Host server has shut down"); - _registered = false; + if ((received.Flags & PipeMessageFlags.Notify) == PipeMessageFlags.Notify) + { + + IrssLog.Warn("Host server has shut down"); + _registered = false; + } } break; @@ -1095,47 +1118,50 @@ } case PipeMessageType.RegisterClient: - if ((received.Flags & PipeMessageFlags.Response) == PipeMessageFlags.Response) + if (_mode == IRServerMode.ServerMode) { - if ((received.Flags & PipeMessageFlags.Success) == PipeMessageFlags.Success) + if ((received.Flags & PipeMessageFlags.Request) == PipeMessageFlags.Request) { - IrssLog.Info("Registered with host server"); - _registered = true; - } - else - { - IrssLog.Warn("Host server refused registration"); - _registered = false; - } - } - else if ((received.Flags & PipeMessageFlags.Request) == PipeMessageFlags.Request) - { - PipeMessage response = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.RegisterClient, PipeMessageFlags.Response); + PipeMessage response = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.RegisterClient, PipeMessageFlags.Response); - if (RegisterClient(received.FromPipe, received.FromServer)) - { - IRServerInfo irServerInfo = new IRServerInfo(); + if (RegisterClient(received.FromPipe, received.FromServer)) + { + IRServerInfo irServerInfo = new IRServerInfo(); - if (_pluginReceive != null) - irServerInfo.CanReceive = true; + if (_pluginReceive != null) + irServerInfo.CanReceive = true; - if (_pluginTransmit != null) + if (_pluginTransmit != null) + { + irServerInfo.CanLearn = (_pluginTransmit is ILearnIR); + irServerInfo.CanTransmit = true; + irServerInfo.Ports = (_pluginTransmit as ITransmitIR).AvailablePorts; + } + + response.DataAsBytes = irServerInfo.ToBytes(); + response.Flags |= PipeMessageFlags.Success; + } + else { - irServerInfo.CanLearn = (_pluginTransmit is ILearnIR); - irServerInfo.CanTransmit = true; - irServerInfo.Ports = (_pluginTransmit as ITransmitIR).AvailablePorts; + response.Flags |= PipeMessageFlags.Failure; } - response.DataAsBytes = irServerInfo.ToBytes(); - response.Flags |= PipeMessageFlags.Success; + SendTo(received.FromPipe, received.FromServer, response); } + } + else if ((received.Flags & PipeMessageFlags.Response) == PipeMessageFlags.Response) + { + if ((received.Flags & PipeMessageFlags.Success) == PipeMessageFlags.Success) + { + IrssLog.Info("Registered with host server"); + _registered = true; + } else { - response.Flags |= PipeMessageFlags.Failure; + IrssLog.Warn("Host server refused registration"); + _registered = false; } - - SendTo(received.FromPipe, received.FromServer, response); - } + } break; case PipeMessageType.UnregisterClient: @@ -1163,7 +1189,7 @@ catch (Exception ex) { IrssLog.Error(ex.ToString()); - PipeMessage response = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.Error, PipeMessageFlags.None, ex.Message); + PipeMessage response = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.Error, PipeMessageFlags.Notify, ex.Message); SendTo(received.FromPipe, received.FromServer, response); } Modified: trunk/plugins/IR Server Suite/Applications/Translator/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2007-09-11 19:30:37 UTC (rev 915) +++ trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2007-09-12 12:28:29 UTC (rev 916) @@ -906,7 +906,7 @@ { PipeMessage received = PipeMessage.FromString(message); - IrssLog.Debug("Received Message \"{0}\"", Enum.GetName(typeof(PipeMessageType), received.Type)); + IrssLog.Debug("Received Message \"{0}\"", received.Type); try { Modified: trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs 2007-09-11 19:30:37 UTC (rev 915) +++ trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs 2007-09-12 12:28:29 UTC (rev 916) @@ -409,7 +409,7 @@ { PipeMessage received = PipeMessage.FromString(message); - IrssLog.Debug("Received Message \"{0}\"", Enum.GetName(typeof(PipeMessageType), received.Type)); + IrssLog.Debug("Received Message \"{0}\"", received.Type); try { Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs 2007-09-11 19:30:37 UTC (rev 915) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs 2007-09-12 12:28:29 UTC (rev 916) @@ -471,7 +471,7 @@ { PipeMessage received = PipeMessage.FromString(message); - IrssLog.Debug("Received Message \"{0}\"", Enum.GetName(typeof(PipeMessageType), received.Type)); + IrssLog.Debug("Received Message \"{0}\"", received.Type); try { Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs 2007-09-11 19:30:37 UTC (rev 915) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs 2007-09-12 12:28:29 UTC (rev 916) @@ -528,7 +528,7 @@ { PipeMessage received = PipeMessage.FromString(message); - IrssLog.Debug("Received Message \"{0}\"", Enum.GetName(typeof(PipeMessageType), received.Type)); + IrssLog.Debug("Received Message \"{0}\"", received.Type); try { Modified: trunk/plugins/IR Server Suite/IPC/Named Pipes/PipeMessage.cs =================================================================== --- trunk/plugins/IR Server Suite/IPC/Named Pipes/PipeMessage.cs 2007-09-11 19:30:37 UTC (rev 915) +++ trunk/plugins/IR Server Suite/IPC/Named Pipes/PipeMessage.cs 2007-09-12 12:28:29 UTC (rev 916) @@ -43,18 +43,18 @@ Request = 0x0001, Response = 0x0002, - //Notify = 0x0004, + Notify = 0x0004, Success = 0x0008, Failure = 0x0010, Timeout = 0x0020, - Error = 0x0040, + //Error = 0x0040, //DataString = 0x0080, //DataBytes = 0x0100, //ForceRespond = 0x0200, - //ForceNotRespond = 0x0400, + ForceNotRespond = 0x0400, } #endregion Enumerations @@ -182,10 +182,9 @@ if (_data != null && _data.Length != 0) data = ByteArrayToByteString(_data); - string messageType = Enum.GetName(typeof(PipeMessageType), _type); + string messageType = ((int)_type).ToString(); + string flags = ((int)_flags).ToString(); - string flags = _flags.ToString(); - return String.Format( "{0},{1},{2},{3},{4}", _fromServer, @@ -213,8 +212,8 @@ if (stringItems.Length != 5) return null; - PipeMessageType type = (PipeMessageType)Enum.Parse(typeof(PipeMessageType), stringItems[2]); - PipeMessageFlags flags = (PipeMessageFlags)Enum.Parse(typeof(PipeMessageFlags), stringItems[3]); + PipeMessageType type = (PipeMessageType)int.Parse(stringItems[2]); + PipeMessageFlags flags = (PipeMessageFlags)int.Parse(stringItems[3]); if (String.IsNullOrEmpty(stringItems[4])) { Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs 2007-09-11 19:30:37 UTC (rev 915) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs 2007-09-12 12:28:29 UTC (rev 916) @@ -8,6 +8,8 @@ using Microsoft.Win32.SafeHandles; +using IRServerPluginInterface; + namespace MicrosoftMceTransceiver { @@ -212,13 +214,14 @@ /// Stop access to the device. /// </summary> public abstract void Stop(); - // TODO: Change learn interface to return LearnStatus + /// <summary> /// Learn an IR Command. /// </summary> /// <param name="learnTimeout">How long to wait before aborting learn.</param> - /// <returns>Newly learned IR Command.</returns> - public abstract IrCode Learn(int learnTimeout); + /// <param name="learned">Newly learned IR Command.</param> + /// <returns>Learn status.</returns> + public abstract LearnStatus Learn(int learnTimeout, out IrCode learned); /// <summary> /// Send an IR Command. Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverReplacement.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverReplacement.cs 2007-09-11 19:30:37 UTC (rev 915) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverReplacement.cs 2007-09-12 12:28:29 UTC (rev 916) @@ -9,6 +9,8 @@ using Microsoft.Win32.SafeHandles; +using IRServerPluginInterface; + namespace MicrosoftMceTransceiver { @@ -222,10 +224,11 @@ //_debugFile.Close(); } - public override IrCode Learn(int learnTimeout) + public override LearnStatus Learn(int learnTimeout, out IrCode learned) { //_debugFile.WriteLine("Start Learn"); + learned = null; _learningCode = new IrCode(); SetInputPort(InputPort.Learning); @@ -244,27 +247,31 @@ _readThreadMode = ReadThreadMode.Receiving; SetInputPort(InputPort.Receive); + LearnStatus status = LearnStatus.Failure; + switch (modeWas) { case ReadThreadMode.Learning: - // Timeout. - return null; + status = LearnStatus.Timeout; + break; case ReadThreadMode.LearningFailed: - // Failure. - return null; + status = LearnStatus.Failure; + break; case ReadThreadMode.LearningDone: //_debugFile.WriteLine(_learningCode.ToByteArray()); if (_learningCode.FinalizeData()) - return _learningCode; // Success. - else - return null; // Failure. + { + learned = _learningCode; + status = LearnStatus.Success; + } + break; + } - default: - return null; - } + _learningCode = null; + return status; } public override void Send(IrCode code, uint port) Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverVista.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverVista.cs 2007-09-11 19:30:37 UTC (rev 915) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverVista.cs 2007-09-12 12:28:29 UTC (rev 916) @@ -9,6 +9,8 @@ using Microsoft.Win32.SafeHandles; +using IRServerPluginInterface; + namespace MicrosoftMceTransceiver { @@ -537,12 +539,13 @@ //_debugFile.Close(); } - public override IrCode Learn(int learnTimeout) + public override LearnStatus Learn(int learnTimeout, out IrCode learned) { //_debugFile.WriteLine("Learn"); StopReadThread(); + learned = null; _learningCode = new IrCode(); StartReceive(_learnPort, PacketTimeout); @@ -569,29 +572,33 @@ StartReadThread(); + LearnStatus status = LearnStatus.Failure; + switch (modeWas) { case ReadThreadMode.Learning: - // Timeout. - return null; + status = LearnStatus.Timeout; + break; case ReadThreadMode.LearningFailed: - // Failure. - return null; + status = LearnStatus.Failure; + break; case ReadThreadMode.LearningDone: //_debugFile.WriteLine(_learningCode.ToByteArray()); if (_learningCode.FinalizeData()) - return _learningCode; // Success. - else - return null; // Failure. - - default: - return null; + { + learned = _learningCode; + status = LearnStatus.Success; + } + break; } + + _learningCode = null; + return status; } - + public override void Send(IrCode code, uint port) { byte[] data = DataPacket(code); Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverXP.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverXP.cs 2007-09-11 19:30:37 UTC (rev 915) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverXP.cs 2007-09-12 12:28:29 UTC (rev 916) @@ -9,6 +9,8 @@ using Microsoft.Win32.SafeHandles; +using IRServerPluginInterface; + namespace MicrosoftMceTransceiver { @@ -216,10 +218,11 @@ //_debugFile.Close(); } - public override IrCode Learn(int learnTimeout) + public override LearnStatus Learn(int learnTimeout, out IrCode learned) { //_debugFile.WriteLine("Start Learn"); + learned = null; _learningCode = new IrCode(); SetInputPort(InputPort.Learning); @@ -238,27 +241,31 @@ _readThreadMode = ReadThreadMode.Receiving; SetInputPort(InputPort.Receive); + LearnStatus status = LearnStatus.Failure; + switch (modeWas) { case ReadThreadMode.Learning: - // Timeout. - return null; + status = LearnStatus.Timeout; + break; case ReadThreadMode.LearningFailed: - // Failure. - return null; + status = LearnStatus.Failure; + break; case ReadThreadMode.LearningDone: //_debugFile.WriteLine(_learningCode.ToByteArray()); if (_learningCode.FinalizeData()) - return _learningCode; // Success. - else - return null; // Failure. + { + learned = _learningCode; + status = LearnStatus.Success; + } + break; + } - default: - return null; - } + _learningCode = null; + return status; } public override void Send(IrCode code, uint port) Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs 2007-09-11 19:30:37 UTC (rev 915) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs 2007-09-12 12:28:29 UTC (rev 916) @@ -245,18 +245,16 @@ } public LearnStatus Learn(out byte[] data) { - IrCode code = _driver.Learn(_learnTimeout); + IrCode code = null; + LearnStatus status = _driver.Learn(_learnTimeout, out code); + if (code != null) - { data = code.ToByteArray(); - return LearnStatus.Success; - } else - { data = null; - return LearnStatus.Failure; - } + + return status; } void LoadSettings() Modified: trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/UirtTransceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/UirtTransceiver.cs 2007-09-11 19:30:37 UTC (rev 915) +++ trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/UirtTransceiver.cs 2007-09-12 12:28:29 UTC (rev 916) @@ -86,13 +86,14 @@ static extern bool UUIRTLearnIR( IntPtr hHandle, int codeFormat, - [MarshalAs(UnmanagedType.LPStr)] StringBuilder ircode, + //[MarshalAs(UnmanagedType.LPStr)] + StringBuilder ircode, IRLearnCallbackDelegate progressProc, - int userData, - ref int pAbort, + IntPtr userData, + IntPtr abort, int param1, - [MarshalAs(UnmanagedType.AsAny)] Object o, - [MarshalAs(UnmanagedType.AsAny)] Object oo); + IntPtr reserved1, + IntPtr reserved2); [DllImport("uuirtdrv.dll")] [return: MarshalAs(UnmanagedType.Bool)] @@ -132,7 +133,7 @@ static readonly string[] Ports = new string[] { "Default", "Port 1", "Port 2", "Port 3" }; - const int AbortLearn = -1; + const int AbortLearn = 1; const int AllowLearn = 0; #endregion Constants @@ -147,14 +148,12 @@ int _blastRepeats; int _learnTimeout; - //ulong _learnCarrierFreq; - string _lastCode = String.Empty; DateTime _lastCodeTime = DateTime.Now; // ------- - int _abortLearn = AllowLearn; + IntPtr _abortLearn = IntPtr.Zero; bool _learnTimedOut; UUIRTReceiveCallbackDelegate _receiveCallback = null; bool _isUsbUirtLoaded = false; @@ -236,7 +235,11 @@ } public override void Stop() { - UUIRTClose(_usbUirtHandle); + if (_abortLearn != IntPtr.Zero) + Marshal.WriteInt32(_abortLearn, AbortLearn); + + if (_usbUirtHandle != new IntPtr(-1)) + UUIRTClose(_usbUirtHandle); _usbUirtHandle = IntPtr.Zero; _isUsbUirtLoaded = false; @@ -303,35 +306,34 @@ data = null; - StringBuilder irCode = new StringBuilder("1", 2048); - _abortLearn = AllowLearn; + StringBuilder irCode = new StringBuilder(4096); _learnTimedOut = false; - //_learnCarrierFreq = 0; - Timer timer = new Timer(); timer.Interval = _learnTimeout; timer.Tick += new EventHandler(timer_Tick); timer.Enabled = true; timer.Start(); - //IRLearnCallbackDelegate learnCallback = new IRLearnCallbackDelegate(UUIRTLearnCallback); - + _abortLearn = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(int))); + Marshal.WriteInt32(_abortLearn, AllowLearn); + result = UirtTransceiver.UUIRTLearnIR( _usbUirtHandle, // Handle to USB-UIRT - UirtTransceiver.UUIRTDRV_IRFMT_PRONTO | UirtTransceiver.UUIRTDRV_IRFMT_LEARN_FREQDETECT, // | UirtTransceiver.UUIRTDRV_IRFMT_LEARN_FORCERAW + UirtTransceiver.UUIRTDRV_IRFMT_PRONTO, irCode, // Where to put the IR Code null, // Learn status callback - 0, // User data - ref _abortLearn, // Abort flag? + IntPtr.Zero, // User data + _abortLearn, // Abort flag? 0, - null, - null); + IntPtr.Zero, + IntPtr.Zero); + Marshal.FreeHGlobal(_abortLearn); + _abortLearn = IntPtr.Zero; + timer.Stop(); - //MessageBox.Show(_learnCarrierFreq.ToString()); - if (_learnTimedOut) { return LearnStatus.Timeout; @@ -364,7 +366,7 @@ Console.WriteLine(ex.ToString()); _repeatDelay = 500; - _blastRepeats = 4; + _blastRepeats = 3; _learnTimeout = 10000; } } @@ -425,7 +427,9 @@ */ void timer_Tick(object sender, EventArgs e) { - _abortLearn = AbortLearn; + if (_abortLearn != IntPtr.Zero) + Marshal.WriteInt32(_abortLearn, AbortLearn); + _learnTimedOut = true; ((Timer)sender).Stop(); Modified: trunk/plugins/IR Server Suite/IR Server Suite.sln =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite.sln 2007-09-11 19:30:37 UTC (rev 915) +++ trunk/plugins/IR Server Suite/IR Server Suite.sln 2007-09-12 12:28:29 UTC (rev 916) @@ -247,6 +247,12 @@ Release.AspNetCompiler.Debug = "False" EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Named Pipes Tool", "Applications\NamedPipesTool\Named Pipes Tool.csproj", "{6E7C6F27-DA95-4F2F-A97D-1EA8E1517A4C}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -534,6 +540,12 @@ {8ADDE1CB-2D23-4AB1-88B1-A241C60C16BA}.Release|Any CPU.Build.0 = Release|Any CPU {8ADDE1CB-2D23-4AB1-88B1-A241C60C16BA}.Release|x86.ActiveCfg = Release|x86 {8ADDE1CB-2D23-4AB1-88B1-A241C60C16BA}.Release|x86.Build.0 = Release|x86 + {6E7C6F27-DA95-4F2F-A97D-1EA8E1517A4C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6E7C6F27-DA95-4F2F-A97D-1EA8E1517A4C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6E7C6F27-DA95-4F2F-A97D-1EA8E1517A4C}.Debug|x86.ActiveCfg = Debug|Any CPU + {6E7C6F27-DA95-4F2F-A97D-1EA8E1517A4C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6E7C6F27-DA95-4F2F-A97D-1EA8E1517A4C}.Release|Any CPU.Build.0 = Release|Any CPU + {6E7C6F27-DA95-4F2F-A97D-1EA8E1517A4C}.Release|x86.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -550,6 +562,7 @@ {905131F8-F8AC-4A65-A722-37783902D7B8} = {0C209E91-5AD5-4662-AD0E-976A940D4806} {A533F58F-2402-47CF-A258-377A669DB56F} = {0C209E91-5AD5-4662-AD0E-976A940D4806} {B5E711A2-E6D0-4BEA-B66B-7A8B0BCA6A4D} = {0C209E91-5AD5-4662-AD0E-976A940D4806} + {6E7C6F27-DA95-4F2F-A97D-1EA8E1517A4C} = {0C209E91-5AD5-4662-AD0E-976A940D4806} {A4023992-CCD6-461E-8E14-219A496734C5} = {0D1620EE-01B9-43B5-9FAA-E983BD9EBDBD} {7C686499-7517-4338-8837-7E8617549D9A} = {0D1620EE-01B9-43B5-9FAA-E983BD9EBDBD} {BABC30EB-7D0F-4398-9FCB-E517EA8D2AA9} = {0D1620EE-01B9-43B5-9FAA-E983BD9EBDBD} 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-09-11 19:30:37 UTC (rev 915) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MPBlastZonePlugin.cs 2007-09-12 12:28:29 UTC (rev 916) @@ -557,7 +557,7 @@ PipeMessage received = PipeMessage.FromString(message); if (LogVerbose) - Log.Debug("MPBlastZonePlugin: Received Message \"{0}\"", Enum.GetName(typeof(PipeMessageType), received.Type)); + Log.Debug("MPBlastZonePlugin: Received Message \"{0}\"", received.Type); try { 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-09-11 19:30:37 UTC (rev 915) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs 2007-09-12 12:28:29 UTC (rev 916) @@ -817,7 +817,7 @@ PipeMessage received = PipeMessage.FromString(message); if (LogVerbose) - Log.Debug("MPControlPlugin: Received Message \"{0}\"", Enum.GetName(typeof(PipeMessageType), received.Type)); + Log.Debug("MPControlPlugin: Received Message \"{0}\"", received.Type); try { 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-09-11 19:30:37 UTC (rev 915) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs 2007-09-12 12:28:29 UTC (rev 916) @@ -152,7 +152,7 @@ public bool CanEnable() { return true; } public bool HasSetup() { return true; } - public string PluginName() { return "TV2 STB Blaster Plugin for IR Server"; } + public string PluginName() { return "TV2 Blaster Plugin for IR Server"; } public bool DefaultEnabled() { return true; } public int GetWindowId() { return 0; } public string Author() { return "and-81"; } @@ -430,7 +430,7 @@ PipeMessage received = PipeMessage.FromString(message); if (LogVerbose) - Log.Debug("TV2BlasterPlugin: Received Message \"{0}\"", Enum.GetName(typeof(PipeMessageType), received.Type)); + Log.Debug("TV2BlasterPlugin: Received Message \"{0}\"", received.Type); try { 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-09-11 19:30:37 UTC (rev 915) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs 2007-09-12 12:28:29 UTC (rev 916) @@ -66,7 +66,7 @@ /// <summary> /// Returns the name of the plugin. /// </summary> - public string Name { get { return "TV3 STB Blaster Plugin for IR Server"; } } + public string Name { get { return "TV3 Blaster Plugin for IR Server"; } } /// <summary> /// Returns the version of the plugin. /// </summary> @@ -407,7 +407,7 @@ PipeMessage received = PipeMessage.FromString(message); if (LogVerbose) - Log.Debug("TV3BlasterPlugin: Received Message \"{0}\"", Enum.GetName(typeof(PipeMessageType), received.Type)); + Log.Debug("TV3BlasterPlugin: Received Message \"{0}\"", received.Type); try { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-09-12 16:02:24
|
Revision: 917 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=917&view=rev Author: and-81 Date: 2007-09-12 09:02:09 -0700 (Wed, 12 Sep 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/IR Server/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Translator/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverVista.cs trunk/plugins/IR Server Suite/IR Server Suite.sln trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Properties/AssemblyInfo.cs Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Properties/AssemblyInfo.cs 2007-09-12 12:28:29 UTC (rev 916) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Properties/AssemblyInfo.cs 2007-09-12 16:02:09 UTC (rev 917) @@ -2,7 +2,6 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using System.Security.Permissions; // // General Information about an assembly is controlled through the following @@ -39,5 +38,4 @@ [assembly: CLSCompliant(true)] -[assembly: SecurityPermission(SecurityAction.RequestMinimum, UnmanagedCode = true)] [assembly: GuidAttribute("a94fbaf3-2d68-45da-8f4f-7dee41f00040")] Modified: trunk/plugins/IR Server Suite/Applications/Translator/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Properties/AssemblyInfo.cs 2007-09-12 12:28:29 UTC (rev 916) +++ trunk/plugins/IR Server Suite/Applications/Translator/Properties/AssemblyInfo.cs 2007-09-12 16:02:09 UTC (rev 917) @@ -2,7 +2,6 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using System.Security.Permissions; // // General Information about an assembly is controlled through the following @@ -39,5 +38,4 @@ [assembly: CLSCompliant(true)] -[assembly: SecurityPermission(SecurityAction.RequestMinimum, UnmanagedCode = true)] [assembly: GuidAttribute("00506894-d61e-47b9-9039-879c543a73e1")] Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverVista.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverVista.cs 2007-09-12 12:28:29 UTC (rev 916) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverVista.cs 2007-09-12 16:02:09 UTC (rev 917) @@ -28,7 +28,7 @@ #region Enumerations - public enum IoCtrl : uint + enum IoCtrl : uint { StartReceive = 0x0F608028, StopReceive = 0x0F60802C, @@ -42,7 +42,7 @@ /// IR Device Capability Flags. /// </summary> [Flags] - public enum DeviceCapabilityFlags : uint + enum DeviceCapabilityFlags : uint { /// <summary> /// Hardware supports legacy key signing. @@ -83,7 +83,7 @@ } [Flags] - public enum TransmitFlags : uint + enum TransmitFlags : uint { /// <summary> /// Pulse Mode. @@ -112,7 +112,7 @@ #region Structures [StructLayout(LayoutKind.Sequential)] - public struct TransmitChunk + struct TransmitChunk { /// <summary> /// Next chunk offset. @@ -129,7 +129,7 @@ } [StructLayout(LayoutKind.Sequential)] - public struct TransmitParams + struct TransmitParams { /// <summary> /// Bitmask containing ports to transmit on. @@ -151,7 +151,7 @@ } [StructLayout(LayoutKind.Sequential)] - public struct ReceiveParams + struct ReceiveParams { /// <summary> /// Last packet in block? @@ -168,7 +168,7 @@ } [StructLayout(LayoutKind.Sequential)] - public struct StartReceiveParams + struct StartReceiveParams { /// <summary> /// Index of the receiver to use. @@ -181,7 +181,7 @@ } [StructLayout(LayoutKind.Sequential)] - public struct DeviceCapabilities + struct DeviceCapabilities { /// <summary> /// Protocol version. Currently must be 100 (1.0). @@ -306,7 +306,7 @@ { Marshal.StructureToPtr(structure, structPtr, false); - IoControlSync(IoCtrl.StartReceive, structPtr, Marshal.SizeOf(structure), IntPtr.Zero, 0, out bytesReturned); + IoControl(IoCtrl.StartReceive, structPtr, Marshal.SizeOf(structure), IntPtr.Zero, 0, out bytesReturned); } catch { @@ -321,7 +321,7 @@ void StopReceive() { int bytesReturned; - IoControlSync(IoCtrl.StopReceive, IntPtr.Zero, 0, IntPtr.Zero, 0, out bytesReturned); + IoControl(IoCtrl.StopReceive, IntPtr.Zero, 0, IntPtr.Zero, 0, out bytesReturned); } void GetDeviceCapabilities() @@ -336,7 +336,7 @@ { Marshal.StructureToPtr(structure, structPtr, false); - IoControlSync(IoCtrl.GetDetails, IntPtr.Zero, 0, structPtr, Marshal.SizeOf(structure), out bytesReturned); + IoControl(IoCtrl.GetDetails, IntPtr.Zero, 0, structPtr, Marshal.SizeOf(structure), out bytesReturned); structure = (DeviceCapabilities)Marshal.PtrToStructure(structPtr, typeof(DeviceCapabilities)); } @@ -387,7 +387,7 @@ { Marshal.StructureToPtr(data, pointerToData, false); - IoControlSync(IoCtrl.GetBlasters, IntPtr.Zero, 0, pointerToData, sizeof(uint), out bytesReturned); + IoControl(IoCtrl.GetBlasters, IntPtr.Zero, 0, pointerToData, sizeof(uint), out bytesReturned); data = (uint)Marshal.PtrToStructure(pointerToData, typeof(uint)); } @@ -447,7 +447,7 @@ Marshal.Copy(buffer, 0, bufferPtr, buffer.Length); - IoControlSync(IoCtrl.Transmit, structurePtr, Marshal.SizeOf(typeof(TransmitParams)), bufferPtr, bufferSize, out bytesReturned); + IoControl(IoCtrl.Transmit, structurePtr, Marshal.SizeOf(typeof(TransmitParams)), bufferPtr, bufferSize, out bytesReturned); } catch { @@ -460,7 +460,7 @@ } } - void IoControlSync(IoCtrl ioControlCode, IntPtr inBuffer, int inBufferSize, IntPtr outBuffer, int outBufferSize, out int bytesReturned) + void IoControl(IoCtrl ioControlCode, IntPtr inBuffer, int inBufferSize, IntPtr outBuffer, int outBufferSize, out int bytesReturned) { NativeOverlapped overlapped; overlapped.InternalLow = IntPtr.Zero; @@ -708,7 +708,7 @@ while (_readThreadMode != ReadThreadMode.Stop) { - IoControlSync(IoCtrl.Receive, IntPtr.Zero, 0, receiveParamsPtr, receiveParamsSize, out bytesRead); + IoControl(IoCtrl.Receive, IntPtr.Zero, 0, receiveParamsPtr, receiveParamsSize, out bytesRead); if (bytesRead > Marshal.SizeOf(receiveParams)) { Modified: trunk/plugins/IR Server Suite/IR Server Suite.sln =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite.sln 2007-09-12 12:28:29 UTC (rev 916) +++ trunk/plugins/IR Server Suite/IR Server Suite.sln 2007-09-12 16:02:09 UTC (rev 917) @@ -253,6 +253,18 @@ Release.AspNetCompiler.Debug = "False" EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MediaPortal 2 Plugins", "MediaPortal 2 Plugins", "{925C6589-16EF-4B2B-A184-FA44FF04C2F6}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MP2 Control Plugin", "MediaPortal 2 Plugins\MP2 Control Plugin\MP2 Control Plugin.csproj", "{E5A37205-4AA5-4697-BF16-D2F560F2314E}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -546,6 +558,12 @@ {6E7C6F27-DA95-4F2F-A97D-1EA8E1517A4C}.Release|Any CPU.ActiveCfg = Release|Any CPU {6E7C6F27-DA95-4F2F-A97D-1EA8E1517A4C}.Release|Any CPU.Build.0 = Release|Any CPU {6E7C6F27-DA95-4F2F-A97D-1EA8E1517A4C}.Release|x86.ActiveCfg = Release|Any CPU + {E5A37205-4AA5-4697-BF16-D2F560F2314E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E5A37205-4AA5-4697-BF16-D2F560F2314E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E5A37205-4AA5-4697-BF16-D2F560F2314E}.Debug|x86.ActiveCfg = Debug|Any CPU + {E5A37205-4AA5-4697-BF16-D2F560F2314E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E5A37205-4AA5-4697-BF16-D2F560F2314E}.Release|Any CPU.Build.0 = Release|Any CPU + {E5A37205-4AA5-4697-BF16-D2F560F2314E}.Release|x86.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -587,5 +605,6 @@ {CA15769C-232E-4CA7-94FD-206A06CA3ABB} = {E757F80C-23C5-4AD6-B178-16799E337E03} {08F57DD7-2C6E-484E-9CC5-835F70C5BC64} = {E757F80C-23C5-4AD6-B178-16799E337E03} {BCAFDF45-70DD-46FD-8B98-880DDA585AD2} = {E757F80C-23C5-4AD6-B178-16799E337E03} + {E5A37205-4AA5-4697-BF16-D2F560F2314E} = {925C6589-16EF-4B2B-A184-FA44FF04C2F6} EndGlobalSection EndGlobal Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Properties/AssemblyInfo.cs 2007-09-12 12:28:29 UTC (rev 916) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Properties/AssemblyInfo.cs 2007-09-12 16:02:09 UTC (rev 917) @@ -2,7 +2,6 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using System.Security.Permissions; // // General Information about an assembly is controlled through the following @@ -68,5 +67,4 @@ [assembly: CLSCompliant(false)] -[assembly: SecurityPermission(SecurityAction.RequestMinimum, UnmanagedCode = true)] [assembly: GuidAttribute("59123d08-2c0c-4220-b9e6-1944e218892b")] Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Properties/AssemblyInfo.cs 2007-09-12 12:28:29 UTC (rev 916) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Properties/AssemblyInfo.cs 2007-09-12 16:02:09 UTC (rev 917) @@ -2,7 +2,6 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using System.Security.Permissions; // // General Information about an assembly is controlled through the following @@ -68,5 +67,4 @@ [assembly: CLSCompliant(true)] -[assembly: SecurityPermission(SecurityAction.RequestMinimum, UnmanagedCode = true)] [assembly: GuidAttribute("0f4a15ea-ff0f-4031-87bd-eebfd5d0e7da")] Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Properties/AssemblyInfo.cs 2007-09-12 12:28:29 UTC (rev 916) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Properties/AssemblyInfo.cs 2007-09-12 16:02:09 UTC (rev 917) @@ -2,7 +2,6 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using System.Security.Permissions; // // General Information about an assembly is controlled through the following @@ -68,5 +67,4 @@ [assembly: CLSCompliant(true)] -[assembly: SecurityPermission(SecurityAction.RequestMinimum, UnmanagedCode = true)] [assembly: GuidAttribute("5bdbc5bc-1085-4c12-9056-f6fade27d919")] Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Properties/AssemblyInfo.cs 2007-09-12 12:28:29 UTC (rev 916) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Properties/AssemblyInfo.cs 2007-09-12 16:02:09 UTC (rev 917) @@ -2,7 +2,6 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using System.Security.Permissions; // // General Information about an assembly is controlled through the following @@ -68,5 +67,4 @@ [assembly: CLSCompliant(true)] -[assembly: SecurityPermission(SecurityAction.RequestMinimum, UnmanagedCode = true)] [assembly: GuidAttribute("d9a51585-70cf-47cc-a787-7a784d46a36f")] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-09-14 10:17:14
|
Revision: 920 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=920&view=rev Author: and-81 Date: 2007-09-14 03:17:12 -0700 (Fri, 14 Sep 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Debug Client/Debug Client.csproj trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs trunk/plugins/IR Server Suite/Applications/IR Blast/IR Blast.csproj trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/IR Blast (No Window).csproj trunk/plugins/IR Server Suite/Applications/IR Server/Client.cs trunk/plugins/IR Server Suite/Applications/IR Server/Config.Designer.cs trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs trunk/plugins/IR Server Suite/Applications/IR Server/IR Server.csproj 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/Translator.csproj trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray Launcher.csproj trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/Virtual Remote.csproj trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/Virtual Remote Skin Editor.csproj trunk/plugins/IR Server Suite/Common/IrssUtils/IrssLog.cs trunk/plugins/IR Server Suite/IPC/AppModule.InterProcessComm/AppModule.InterProcessComm.csproj trunk/plugins/IR Server Suite/IPC/AppModule.NamedPipes/AppModule.NamedPipes.csproj trunk/plugins/IR Server Suite/IPC/Named Pipes/Named Pipes.csproj trunk/plugins/IR Server Suite/IPC/Named Pipes/PipeMessage.cs trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionREMOTE Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IR Server Plugin Interface.csproj trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTrans Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrDecoder.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Microsoft MCE Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/USB-UIRT Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/UirtTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLircServer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Windows Message Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Windows Message Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/X10 Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/X10Transceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/XBCDRC Receiver/XBCDRC Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/XBCDRC Receiver/XBCDRC Receiver.csproj trunk/plugins/IR Server Suite/IR Server Suite.sln trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/Debug Client.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/Debug Client.csproj 2007-09-14 04:47:21 UTC (rev 919) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/Debug Client.csproj 2007-09-14 10:17:12 UTC (rev 920) @@ -35,7 +35,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> <OutputPath>bin\x86\Debug\</OutputPath> - <DefineConstants>DEBUG</DefineConstants> + <DefineConstants>TRACE;DEBUG</DefineConstants> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <DebugType>full</DebugType> <PlatformTarget>x86</PlatformTarget> Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-09-14 04:47:21 UTC (rev 919) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-09-14 10:17:12 UTC (rev 920) @@ -513,7 +513,7 @@ BitConverter.GetBytes(keyCode).CopyTo(data, 0); BitConverter.GetBytes(0).CopyTo(data, 4); - PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.ForwardRemoteEvent, PipeMessageFlags.None, data); + PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.ForwardRemoteEvent, PipeMessageFlags.Notify, data); PipeAccess.SendMessage(Common.ServerPipeName, _serverAddress, message); } catch (Exception ex) Modified: trunk/plugins/IR Server Suite/Applications/IR Blast/IR Blast.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast/IR Blast.csproj 2007-09-14 04:47:21 UTC (rev 919) +++ trunk/plugins/IR Server Suite/Applications/IR Blast/IR Blast.csproj 2007-09-14 10:17:12 UTC (rev 920) @@ -37,7 +37,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> <OutputPath>bin\x86\Debug\</OutputPath> - <DefineConstants>DEBUG</DefineConstants> + <DefineConstants>TRACE;DEBUG</DefineConstants> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <DebugType>full</DebugType> <PlatformTarget>x86</PlatformTarget> Modified: trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/IR Blast (No Window).csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/IR Blast (No Window).csproj 2007-09-14 04:47:21 UTC (rev 919) +++ trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/IR Blast (No Window).csproj 2007-09-14 10:17:12 UTC (rev 920) @@ -37,7 +37,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> <OutputPath>bin\x86\Debug\</OutputPath> - <DefineConstants>DEBUG</DefineConstants> + <DefineConstants>TRACE;DEBUG</DefineConstants> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <DebugType>full</DebugType> <PlatformTarget>x86</PlatformTarget> Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Client.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Client.cs 2007-09-14 04:47:21 UTC (rev 919) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Client.cs 2007-09-14 10:17:12 UTC (rev 920) @@ -3,39 +3,18 @@ namespace IRServer { - class Client + struct Client { - #region Variables - - string _pipe; - string _server; + public string Pipe; + public string Server; - #endregion - - #region Properties - - public string Pipe - { - get { return _pipe; } - } - public string Server - { - get { return _server; } - } - - #endregion - - #region Constructor - public Client(string pipe, string server) { - _pipe = pipe; - _server = server; + Pipe = pipe; + Server = server; } - #endregion Constructor - } } Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Config.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Config.Designer.cs 2007-09-14 04:47:21 UTC (rev 919) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Config.Designer.cs 2007-09-14 10:17:12 UTC (rev 920) @@ -34,23 +34,17 @@ this.buttonCancel = new System.Windows.Forms.Button(); this.toolTips = new System.Windows.Forms.ToolTip(this.components); this.checkBoxRunAtBoot = new System.Windows.Forms.CheckBox(); - this.radioButtonServer = new System.Windows.Forms.RadioButton(); - this.radioButtonRelay = new System.Windows.Forms.RadioButton(); - this.radioButtonRepeater = new System.Windows.Forms.RadioButton(); this.groupBoxTransceiver = new System.Windows.Forms.GroupBox(); this.gridPlugins = new SourceGrid.Grid(); - this.groupBoxMode = new System.Windows.Forms.GroupBox(); - this.labelComputer = new System.Windows.Forms.Label(); - this.comboBoxComputer = new System.Windows.Forms.ComboBox(); this.buttonHelp = new System.Windows.Forms.Button(); + this.buttonAdvanced = new System.Windows.Forms.Button(); this.groupBoxTransceiver.SuspendLayout(); - this.groupBoxMode.SuspendLayout(); this.SuspendLayout(); // // buttonOK // this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonOK.Location = new System.Drawing.Point(296, 408); + this.buttonOK.Location = new System.Drawing.Point(352, 280); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(64, 24); this.buttonOK.TabIndex = 4; @@ -62,7 +56,7 @@ // this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.buttonCancel.Location = new System.Drawing.Point(368, 408); + this.buttonCancel.Location = new System.Drawing.Point(424, 280); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(64, 24); this.buttonCancel.TabIndex = 5; @@ -72,51 +66,16 @@ // // checkBoxRunAtBoot // - this.checkBoxRunAtBoot.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.checkBoxRunAtBoot.Location = new System.Drawing.Point(16, 408); + this.checkBoxRunAtBoot.Anchor = System.Windows.Forms.AnchorStyles.Bottom; + this.checkBoxRunAtBoot.AutoSize = true; + this.checkBoxRunAtBoot.Location = new System.Drawing.Point(168, 288); this.checkBoxRunAtBoot.Name = "checkBoxRunAtBoot"; - this.checkBoxRunAtBoot.Size = new System.Drawing.Size(176, 24); - this.checkBoxRunAtBoot.TabIndex = 2; + this.checkBoxRunAtBoot.Size = new System.Drawing.Size(165, 17); + this.checkBoxRunAtBoot.TabIndex = 3; this.checkBoxRunAtBoot.Text = "&Start IR Server with Windows"; this.toolTips.SetToolTip(this.checkBoxRunAtBoot, "Run IR Server when windows boots up?"); this.checkBoxRunAtBoot.UseVisualStyleBackColor = true; // - // radioButtonServer - // - this.radioButtonServer.Location = new System.Drawing.Point(16, 24); - this.radioButtonServer.Name = "radioButtonServer"; - this.radioButtonServer.Size = new System.Drawing.Size(128, 24); - this.radioButtonServer.TabIndex = 0; - this.radioButtonServer.TabStop = true; - this.radioButtonServer.Text = "Server mode"; - this.toolTips.SetToolTip(this.radioButtonServer, "Server mode (default)"); - this.radioButtonServer.UseVisualStyleBackColor = true; - this.radioButtonServer.CheckedChanged += new System.EventHandler(this.radioButtonServer_CheckedChanged); - // - // radioButtonRelay - // - this.radioButtonRelay.Location = new System.Drawing.Point(16, 56); - this.radioButtonRelay.Name = "radioButtonRelay"; - this.radioButtonRelay.Size = new System.Drawing.Size(128, 24); - this.radioButtonRelay.TabIndex = 1; - this.radioButtonRelay.TabStop = true; - this.radioButtonRelay.Text = "Button relay mode"; - this.toolTips.SetToolTip(this.radioButtonRelay, "Relays button presses to another IR Server"); - this.radioButtonRelay.UseVisualStyleBackColor = true; - this.radioButtonRelay.CheckedChanged += new System.EventHandler(this.radioButtonRelay_CheckedChanged); - // - // radioButtonRepeater - // - this.radioButtonRepeater.Location = new System.Drawing.Point(16, 88); - this.radioButtonRepeater.Name = "radioButtonRepeater"; - this.radioButtonRepeater.Size = new System.Drawing.Size(128, 24); - this.radioButtonRepeater.TabIndex = 2; - this.radioButtonRepeater.TabStop = true; - this.radioButtonRepeater.Text = "IR repeater mode"; - this.toolTips.SetToolTip(this.radioButtonRepeater, "Acts as a repeater for another IR Server\'s IR blasting"); - this.radioButtonRepeater.UseVisualStyleBackColor = true; - this.radioButtonRepeater.CheckedChanged += new System.EventHandler(this.radioButtonRepeater_CheckedChanged); - // // groupBoxTransceiver // this.groupBoxTransceiver.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) @@ -125,10 +84,10 @@ this.groupBoxTransceiver.Controls.Add(this.gridPlugins); this.groupBoxTransceiver.Location = new System.Drawing.Point(8, 8); this.groupBoxTransceiver.Name = "groupBoxTransceiver"; - this.groupBoxTransceiver.Size = new System.Drawing.Size(424, 256); + this.groupBoxTransceiver.Size = new System.Drawing.Size(480, 256); this.groupBoxTransceiver.TabIndex = 0; this.groupBoxTransceiver.TabStop = false; - this.groupBoxTransceiver.Text = "Device plugin"; + this.groupBoxTransceiver.Text = "Device plugins"; // // gridPlugins // @@ -141,83 +100,53 @@ this.gridPlugins.Name = "gridPlugins"; this.gridPlugins.OptimizeMode = SourceGrid.CellOptimizeMode.ForRows; this.gridPlugins.SelectionMode = SourceGrid.GridSelectionMode.Row; - this.gridPlugins.Size = new System.Drawing.Size(392, 216); + this.gridPlugins.Size = new System.Drawing.Size(448, 216); this.gridPlugins.TabIndex = 0; this.gridPlugins.TabStop = true; this.gridPlugins.ToolTipText = ""; // - // groupBoxMode - // - this.groupBoxMode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.groupBoxMode.Controls.Add(this.labelComputer); - this.groupBoxMode.Controls.Add(this.radioButtonRepeater); - this.groupBoxMode.Controls.Add(this.radioButtonRelay); - this.groupBoxMode.Controls.Add(this.radioButtonServer); - this.groupBoxMode.Controls.Add(this.comboBoxComputer); - this.groupBoxMode.Location = new System.Drawing.Point(8, 272); - this.groupBoxMode.Name = "groupBoxMode"; - this.groupBoxMode.Size = new System.Drawing.Size(424, 120); - this.groupBoxMode.TabIndex = 1; - this.groupBoxMode.TabStop = false; - this.groupBoxMode.Text = "Mode"; - // - // labelComputer - // - this.labelComputer.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.labelComputer.Location = new System.Drawing.Point(160, 56); - this.labelComputer.Name = "labelComputer"; - this.labelComputer.Size = new System.Drawing.Size(248, 32); - this.labelComputer.TabIndex = 3; - this.labelComputer.Text = "Button Relay / IR Repeater mode host computer:"; - this.labelComputer.TextAlign = System.Drawing.ContentAlignment.BottomLeft; - // - // comboBoxComputer - // - this.comboBoxComputer.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.comboBoxComputer.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; - this.comboBoxComputer.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; - this.comboBoxComputer.Enabled = false; - this.comboBoxComputer.FormattingEnabled = true; - this.comboBoxComputer.Location = new System.Drawing.Point(160, 88); - this.comboBoxComputer.Name = "comboBoxComputer"; - this.comboBoxComputer.Size = new System.Drawing.Size(248, 21); - this.comboBoxComputer.TabIndex = 4; - // // buttonHelp // - this.buttonHelp.Anchor = System.Windows.Forms.AnchorStyles.Bottom; - this.buttonHelp.Location = new System.Drawing.Point(208, 408); + this.buttonHelp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonHelp.Location = new System.Drawing.Point(8, 280); this.buttonHelp.Name = "buttonHelp"; this.buttonHelp.Size = new System.Drawing.Size(64, 24); - this.buttonHelp.TabIndex = 3; + this.buttonHelp.TabIndex = 1; this.buttonHelp.Text = "Help"; this.buttonHelp.UseVisualStyleBackColor = true; this.buttonHelp.Click += new System.EventHandler(this.buttonHelp_Click); // + // buttonAdvanced + // + this.buttonAdvanced.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonAdvanced.Location = new System.Drawing.Point(80, 280); + this.buttonAdvanced.Name = "buttonAdvanced"; + this.buttonAdvanced.Size = new System.Drawing.Size(64, 24); + this.buttonAdvanced.TabIndex = 2; + this.buttonAdvanced.Text = "Advanced"; + this.toolTips.SetToolTip(this.buttonAdvanced, "Click here for advanced options"); + this.buttonAdvanced.UseVisualStyleBackColor = true; + this.buttonAdvanced.Click += new System.EventHandler(this.buttonAdvanced_Click); + // // Config // - this.AcceptButton = this.buttonOK; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.buttonCancel; - this.ClientSize = new System.Drawing.Size(440, 440); + this.ClientSize = new System.Drawing.Size(496, 319); + this.Controls.Add(this.buttonAdvanced); this.Controls.Add(this.buttonHelp); this.Controls.Add(this.checkBoxRunAtBoot); - this.Controls.Add(this.groupBoxMode); this.Controls.Add(this.groupBoxTransceiver); this.Controls.Add(this.buttonCancel); this.Controls.Add(this.buttonOK); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MinimumSize = new System.Drawing.Size(448, 474); + this.MinimumSize = new System.Drawing.Size(504, 346); this.Name = "Config"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "IR Server - Configuration"; this.groupBoxTransceiver.ResumeLayout(false); - this.groupBoxMode.ResumeLayout(false); this.ResumeLayout(false); + this.PerformLayout(); } @@ -227,14 +156,9 @@ private System.Windows.Forms.Button buttonCancel; private System.Windows.Forms.ToolTip toolTips; private System.Windows.Forms.GroupBox groupBoxTransceiver; - private System.Windows.Forms.GroupBox groupBoxMode; private System.Windows.Forms.CheckBox checkBoxRunAtBoot; - private System.Windows.Forms.ComboBox comboBoxComputer; private System.Windows.Forms.Button buttonHelp; - private System.Windows.Forms.RadioButton radioButtonRelay; - private System.Windows.Forms.RadioButton radioButtonServer; - private System.Windows.Forms.RadioButton radioButtonRepeater; - private System.Windows.Forms.Label labelComputer; private SourceGrid.Grid gridPlugins; + private System.Windows.Forms.Button buttonAdvanced; } } \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs 2007-09-14 04:47:21 UTC (rev 919) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs 2007-09-14 10:17:12 UTC (rev 920) @@ -22,44 +22,24 @@ IRServerPlugin[] _transceivers; + IRServerMode _mode = IRServerMode.ServerMode; + string _hostComputer = String.Empty; + #endregion Variables #region Properties public IRServerMode Mode { - get - { - if (radioButtonRelay.Checked) - return IRServerMode.RelayMode; - else if (radioButtonRepeater.Checked) - return IRServerMode.RepeaterMode; - else - return IRServerMode.ServerMode; - } - set - { - switch (value) - { - case IRServerMode.ServerMode: - radioButtonServer.Checked = true; - break; - - case IRServerMode.RelayMode: - radioButtonRelay.Checked = true; - break; - - case IRServerMode.RepeaterMode: - radioButtonRepeater.Checked = true; - break; - } - } + get { return _mode; } + set { _mode = value; } } public string HostComputer { - get { return comboBoxComputer.Text; } - set { comboBoxComputer.Text = value; } + get { return _hostComputer; } + set { _hostComputer = value; } } + public string PluginReceive { get @@ -148,14 +128,6 @@ { IrssLog.Error(ex.ToString()); } - - ArrayList networkPCs = IrssUtils.Win32.GetNetworkComputers(); - if (networkPCs != null) - { - foreach (string computer in networkPCs.ToArray(typeof(string))) - if (computer != Environment.MachineName) - comboBoxComputer.Items.Add(computer); - } } #endregion Constructor @@ -347,22 +319,24 @@ MessageBox.Show(this, ex.Message, "Failed to load help", MessageBoxButtons.OK, MessageBoxIcon.Error); } } - - private void radioButtonServer_CheckedChanged(object sender, EventArgs e) + + private void buttonAdvanced_Click(object sender, EventArgs e) { - comboBoxComputer.Enabled = false; + Advanced advanced = new Advanced(); + + advanced.Mode = _mode; + advanced.HostComputer = _hostComputer; + + if (advanced.ShowDialog(this) == DialogResult.OK) + { + _mode = advanced.Mode; + _hostComputer = advanced.HostComputer; + } } - private void radioButtonRelay_CheckedChanged(object sender, EventArgs e) - { - comboBoxComputer.Enabled = true; - } - private void radioButtonRepeater_CheckedChanged(object sender, EventArgs e) - { - comboBoxComputer.Enabled = true; - } #endregion Controls + } } Modified: trunk/plugins/IR Server Suite/Applications/IR Server/IR Server.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/IR Server.csproj 2007-09-14 04:47:21 UTC (rev 919) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IR Server.csproj 2007-09-14 10:17:12 UTC (rev 920) @@ -59,7 +59,7 @@ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> <DebugSymbols>true</DebugSymbols> <OutputPath>bin\x86\Debug\</OutputPath> - <DefineConstants>DEBUG</DefineConstants> + <DefineConstants>TRACE;DEBUG</DefineConstants> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <DebugType>full</DebugType> <PlatformTarget>x86</PlatformTarget> @@ -95,6 +95,12 @@ <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> + <Compile Include="Advanced.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="Advanced.Designer.cs"> + <DependentUpon>Advanced.cs</DependentUpon> + </Compile> <Compile Include="Client.cs" /> <Compile Include="Properties\Resources.Designer.cs"> <AutoGen>True</AutoGen> @@ -117,6 +123,10 @@ <Content Include="Icon16.ico" /> </ItemGroup> <ItemGroup> + <EmbeddedResource Include="Advanced.resx"> + <SubType>Designer</SubType> + <DependentUpon>Advanced.cs</DependentUpon> + </EmbeddedResource> <EmbeddedResource Include="Config.resx"> <DependentUpon>Config.cs</DependentUpon> <SubType>Designer</SubType> Modified: trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-09-14 04:47:21 UTC (rev 919) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-09-14 10:17:12 UTC (rev 920) @@ -57,16 +57,13 @@ List<Client> _registeredClients; List<Client> _registeredRepeaters; - Thread _messageHandlerThread; + MessageQueue _messageQueue; - Queue _messageQueue; - bool _processMessageQueue; - IRServerMode _mode; string _hostComputer; string _localPipeName = String.Empty; - bool _registered = false; + bool _registered = false; // Used for relay and repeater modes. string _pluginNameReceive = String.Empty; IRServerPlugin _pluginReceive = null; @@ -82,6 +79,8 @@ public IRServer() { + _messageQueue = new MessageQueue(new MessageQueueSink(HandlePipeMessage)); + // Setup taskbar icon _notifyIcon = new NotifyIcon(); _notifyIcon.ContextMenuStrip = new ContextMenuStrip(); @@ -145,7 +144,7 @@ } - StartMessageQueue(); + _messageQueue.Start(); switch (_mode) { @@ -156,7 +155,7 @@ _registeredRepeaters = new List<Client>(); // Start server pipe - PipeAccess.StartServer(Common.ServerPipeName, new PipeMessageHandler(QueueMessage)); + PipeAccess.StartServer(Common.ServerPipeName, new PipeMessageHandler(_messageQueue.Enqueue)); IrssLog.Info("Server Mode: \\\\" + Environment.MachineName + "\\pipe\\" + Common.ServerPipeName); break; @@ -293,15 +292,7 @@ IrssLog.Error(ex.ToString()); } - // Stop Message Queue - try - { - StopMessageQueue(); - } - catch (Exception ex) - { - IrssLog.Error(ex.ToString()); - } + _messageQueue.Stop(); // Stop Server try @@ -369,34 +360,6 @@ _inConfiguration = false; } - void StartMessageQueue() - { - _processMessageQueue = true; - - // Create a FIFO message queue - _messageQueue = Queue.Synchronized(new Queue()); - - // Start message queue handling thread - _messageHandlerThread = new Thread(new ThreadStart(MessageHandlerThread)); - _messageHandlerThread.IsBackground = true; - _messageHandlerThread.Name = "IR Server Message Queue"; - _messageHandlerThread.Start(); - } - void StopMessageQueue() - { - _processMessageQueue = false; - - try - { - if (_messageHandlerThread != null && _messageHandlerThread.IsAlive) - _messageHandlerThread.Abort(); - } - catch { } - - _messageQueue.Clear(); - _messageQueue = null; - } - bool StartRelay() { bool retry = false; @@ -424,7 +387,7 @@ } else { - PipeAccess.StartServer(localPipeTest, new PipeMessageHandler(QueueMessage)); + PipeAccess.StartServer(localPipeTest, new PipeMessageHandler(_messageQueue.Enqueue)); _localPipeName = localPipeTest; retry = false; } @@ -491,7 +454,7 @@ } else { - PipeAccess.StartServer(localPipeTest, new PipeMessageHandler(QueueMessage)); + PipeAccess.StartServer(localPipeTest, new PipeMessageHandler(_messageQueue.Enqueue)); _localPipeName = localPipeTest; retry = false; } @@ -822,23 +785,14 @@ if (_mode != IRServerMode.ServerMode) return false; - Client removeClient = null; + Client removeClient = new Client(pipe, server); lock (_registeredClients) { - foreach (Client client in _registeredClients) - { - if (client.Pipe == pipe && client.Server == server) - { - removeClient = client; - break; - } - } - - if (removeClient != null) - _registeredClients.Remove(removeClient); - else + if (!_registeredClients.Contains(removeClient)) return false; + + _registeredClients.Remove(removeClient); } IrssLog.Info("Unregistered: \\\\{0}\\pipe\\{1}", server, pipe); @@ -883,26 +837,17 @@ if (String.IsNullOrEmpty(pipe) || String.IsNullOrEmpty(server)) return false; - if (_mode != IRServerMode.ServerMode) + if (_mode != IRServerMode.RepeaterMode) return false; - Client removeClient = null; + Client removeClient = new Client(pipe, server); lock (_registeredRepeaters) { - foreach (Client client in _registeredRepeaters) - { - if (client.Pipe == pipe && client.Server == server) - { - removeClient = client; - break; - } - } - - if (removeClient != null) - _registeredRepeaters.Remove(removeClient); - else + if (!_registeredRepeaters.Contains(removeClient)) return false; + + _registeredRepeaters.Remove(removeClient); } IrssLog.Info("Unregistered Repeater: \\\\{0}\\pipe\\{1}", server, pipe); @@ -982,10 +927,17 @@ return status; } - void HandlePipeMessage(PipeMessage received) + void HandlePipeMessage(string message) { - IrssLog.Debug("Message received from client \\\\{0}\\pipe\\{1} = {2}", received.FromServer, received.FromPipe, received.ToString()); + PipeMessage received = PipeMessage.FromString(message); + if (received == null) + { + IrssLog.Warn("Invalid message received: {0}", message); + return; + } + IrssLog.Debug("Message received from client \\\\{0}\\pipe\\{1} = {2}", received.FromServer, received.FromPipe, message); + try { switch (received.Type) @@ -1194,33 +1146,7 @@ } } - void QueueMessage(string message) - { - PipeMessage pipeMessage = PipeMessage.FromString(message); - if (pipeMessage == null) - return; - lock (((ICollection)_messageQueue).SyncRoot) - _messageQueue.Enqueue(pipeMessage); - } - void MessageHandlerThread() - { - try - { - while (_processMessageQueue) - { - Thread.Sleep(50); - - lock (((ICollection)_messageQueue).SyncRoot) - { - if (_messageQueue.Count > 0) - HandlePipeMessage((PipeMessage)_messageQueue.Dequeue()); - } - } - } - catch { } - } - void ClickSetup(object sender, EventArgs e) { if (_inConfiguration) Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2007-09-14 04:47:21 UTC (rev 919) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2007-09-14 10:17:12 UTC (rev 920) @@ -28,7 +28,7 @@ } catch (Exception ex) { - Console.WriteLine(ex.Message); + Trace.WriteLine(ex.Message); return; } @@ -112,7 +112,7 @@ } catch (Exception ex) { - Console.WriteLine(ex.ToString()); + Trace.WriteLine(ex.ToString()); return null; } } Modified: trunk/plugins/IR Server Suite/Applications/Translator/Translator.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Translator.csproj 2007-09-14 04:47:21 UTC (rev 919) +++ trunk/plugins/IR Server Suite/Applications/Translator/Translator.csproj 2007-09-14 10:17:12 UTC (rev 920) @@ -48,7 +48,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> <OutputPath>bin\x86\Debug\</OutputPath> - <DefineConstants>DEBUG</DefineConstants> + <DefineConstants>TRACE;DEBUG</DefineConstants> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <DebugType>full</DebugType> <PlatformTarget>x86</PlatformTarget> Modified: trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray Launcher.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray Launcher.csproj 2007-09-14 04:47:21 UTC (rev 919) +++ trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray Launcher.csproj 2007-09-14 10:17:12 UTC (rev 920) @@ -38,7 +38,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> <OutputPath>bin\x86\Debug\</OutputPath> - <DefineConstants>DEBUG</DefineConstants> + <DefineConstants>TRACE;DEBUG</DefineConstants> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <DebugType>full</DebugType> <PlatformTarget>x86</PlatformTarget> Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs 2007-09-14 04:47:21 UTC (rev 919) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs 2007-09-14 10:17:12 UTC (rev 920) @@ -188,7 +188,7 @@ if (!PipeAccess.ServerRunning) return; - PipeMessage message = new PipeMessage(Program.LocalPipeName, Environment.MachineName, PipeMessageType.ForwardRemoteEvent, PipeMessageFlags.None, keyCode); + PipeMessage message = new PipeMessage(Program.LocalPipeName, Environment.MachineName, PipeMessageType.ForwardRemoteEvent, PipeMessageFlags.Notify, keyCode); PipeAccess.SendMessage(Common.ServerPipeName, Program.ServerHost, message); } Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs 2007-09-14 04:47:21 UTC (rev 919) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs 2007-09-14 10:17:12 UTC (rev 920) @@ -140,7 +140,7 @@ } else { - PipeMessage message = new PipeMessage(Program.LocalPipeName, Environment.MachineName, PipeMessageType.ForwardRemoteEvent, PipeMessageFlags.None, button); + PipeMessage message = new PipeMessage(Program.LocalPipeName, Environment.MachineName, PipeMessageType.ForwardRemoteEvent, PipeMessageFlags.Notify, button); PipeAccess.SendMessage(Common.ServerPipeName, Program.ServerHost, message); } } Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote/Virtual Remote.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote/Virtual Remote.csproj 2007-09-14 04:47:21 UTC (rev 919) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote/Virtual Remote.csproj 2007-09-14 10:17:12 UTC (rev 920) @@ -46,7 +46,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> <OutputPath>bin\x86\Debug\</OutputPath> - <DefineConstants>DEBUG</DefineConstants> + <DefineConstants>TRACE;DEBUG</DefineConstants> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <DebugType>full</DebugType> <PlatformTarget>x86</PlatformTarget> Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs 2007-09-14 04:47:21 UTC (rev 919) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs 2007-09-14 10:17:12 UTC (rev 920) @@ -510,7 +510,7 @@ { _registered = false; - PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.UnregisterClient); + PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.UnregisterClient, PipeMessageFlags.Request); PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message); } } Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/Virtual Remote Skin Editor.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/Virtual Remote Skin Editor.csproj 2007-09-14 04:47:21 UTC (rev 919) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/Virtual Remote Skin Editor.csproj 2007-09-14 10:17:12 UTC (rev 920) @@ -35,7 +35,7 @@ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> <DebugSymbols>true</DebugSymbols> <OutputPath>bin\x86\Debug\</OutputPath> - <DefineConstants>DEBUG</DefineConstants> + <DefineConstants>TRACE;DEBUG</DefineConstants> <DebugType>full</DebugType> <PlatformTarget>x86</PlatformTarget> <ErrorReport>prompt</ErrorReport> Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/IrssLog.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/IrssLog.cs 2007-09-14 04:47:21 UTC (rev 919) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/IrssLog.cs 2007-09-14 10:17:12 UTC (rev 920) @@ -72,7 +72,7 @@ } catch (Exception ex) { - Console.WriteLine(ex.Message); + Trace.WriteLine(ex.Message); } } @@ -86,7 +86,7 @@ } catch (Exception ex) { - Console.WriteLine(ex.Message); + Trace.WriteLine(ex.Message); } } } @@ -113,7 +113,7 @@ } catch (Exception ex) { - Console.WriteLine(ex.Message); + Trace.WriteLine(ex.Message); } try @@ -126,7 +126,7 @@ } catch (Exception ex) { - Console.WriteLine(ex.Message); + Trace.WriteLine(ex.Message); } } } Modified: trunk/plugins/IR Server Suite/IPC/AppModule.InterProcessComm/AppModule.InterProcessComm.csproj =================================================================== --- trunk/plugins/IR Server Suite/IPC/AppModule.InterProcessComm/AppModule.InterProcessComm.csproj 2007-09-14 04:47:21 UTC (rev 919) +++ trunk/plugins/IR Server Suite/IPC/AppModule.InterProcessComm/AppModule.InterProcessComm.csproj 2007-09-14 10:17:12 UTC (rev 920) @@ -78,7 +78,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> <OutputPath>bin\x86\Debug\</OutputPath> - <DefineConstants>DEBUG</DefineConstants> + <DefineConstants>TRACE;DEBUG</DefineConstants> <BaseAddress>285212672</BaseAddress> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <DebugType>full</DebugType> Modified: trunk/plugins/IR Server Suite/IPC/AppModule.NamedPipes/AppModule.NamedPipes.csproj =================================================================== --- trunk/plugins/IR Server Suite/IPC/AppModule.NamedPipes/AppModule.NamedPipes.csproj 2007-09-14 04:47:21 UTC (rev 919) +++ trunk/plugins/IR Server Suite/IPC/AppModule.NamedPipes/AppModule.NamedPipes.csproj 2007-09-14 10:17:12 UTC (rev 920) @@ -78,7 +78,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> <OutputPath>bin\x86\Debug\</OutputPath> - <DefineConstants>DEBUG</DefineConstants> + <DefineConstants>TRACE;DEBUG</DefineConstants> <BaseAddress>285212672</BaseAddress> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <DebugType>full</DebugType> Modified: trunk/plugins/IR Server Suite/IPC/Named Pipes/Named Pipes.csproj =================================================================== --- trunk/plugins/IR Server Suite/IPC/Named Pipes/Named Pipes.csproj 2007-09-14 04:47:21 UTC (rev 919) +++ trunk/plugins/IR Server Suite/IPC/Named Pipes/Named Pipes.csproj 2007-09-14 10:17:12 UTC (rev 920) @@ -40,7 +40,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> <OutputPath>bin\x86\Debug\</OutputPath> - <DefineConstants>DEBUG</DefineConstants> + <DefineConstants>TRACE;DEBUG</DefineConstants> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <DebugType>full</DebugType> <PlatformTarget>x86</PlatformTarget> @@ -63,6 +63,7 @@ <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> + <Compile Include="MessageQueue.cs" /> <Compile Include="PipeAccess.cs" /> <Compile Include="PipeManager.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> Modified: trunk/plugins/IR Server Suite/IPC/Named Pipes/PipeMessage.cs =================================================================== --- trunk/plugins/IR Server Suite/IPC/Named Pipes/PipeMessage.cs 2007-09-14 04:47:21 UTC (rev 919) +++ trunk/plugins/IR Server Suite/IPC/Named Pipes/PipeMessage.cs 2007-09-14 10:17:12 UTC (rev 920) @@ -146,7 +146,7 @@ _data = null; } - public PipeMessage(string fromServer, string fromPipe, PipeMessageType type) + PipeMessage(string fromServer, string fromPipe, PipeMessageType type) : this() { _fromServer = fromServer; Modified: trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionREMOTE Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionREMOTE Receiver.csproj 2007-09-14 04:47:21 UTC (rev 919) +++ trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionREMOTE Receiver.csproj 2007-09-14 10:17:12 UTC (rev 920) @@ -36,7 +36,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> <OutputPath>bin\x86\Debug\</OutputPath> - <DefineConstants>DEBUG</DefineConstants> + <DefineConstants>TRACE;DEBUG</DefineConstants> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <DebugType>full</DebugType> <PlatformTarget>x86</PlatformTarget> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs 2007-09-14 04:47:21 UTC (rev 919) +++ trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs 2007-09-14 10:17:12 UTC (rev 920) @@ -216,7 +216,7 @@ } catch (Exception ex) { - Console.WriteLine(ex.Message); + Trace.WriteLine(ex.Message); return false; } } @@ -377,7 +377,7 @@ } catch (Exception ex) { - Console.WriteLine(ex.ToString()); + Trace.WriteLine(ex.ToString()); } } Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IR Server Plugin Interface.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IR Server Plugin Interface.csproj 2007-09-14 04:47:21 UTC (rev 919) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IR Server Plugin Interface.csproj 2007-09-14 10:17:12 UTC (rev 920) @@ -37,7 +37,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> <OutputPath>bin\x86\Debug\</OutputPath> - <DefineConstants>DEBUG</DefineConstants> + <DefineConstants>TRACE;DEBUG</DefineConstants> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <DebugType>full</DebugType> <PlatformTarget>x86</PlatformTarget> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.cs 2007-09-14 04:47:21 UTC (rev 919) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.cs 2007-09-14 10:17:12 UTC (rev 920) @@ -160,7 +160,7 @@ } catch (Exception ex) { - Console.WriteLine(ex.ToString()); + Trace.WriteLine(ex.ToString()); } } @@ -197,7 +197,7 @@ } catch (Exception ex) { - Console.WriteLine(ex.ToString()); + Trace.WriteLine(ex.ToString()); _repeatDelay = 500; _serialPortName = "COM1"; @@ -223,7 +223,7 @@ } catch (Exception ex) { - Console.WriteLine(ex.ToString()); + Trace.WriteLine(ex.ToString()); } } Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.csproj 2007-09-14 04:47:21 UTC (rev 919) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.csproj 2007-09-14 10:17:12 UTC (rev 920) @@ -35,7 +35,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> <OutputPath>bin\x86\Debug\</OutputPath> - <DefineConstants>DEBUG</DefineConstants> + <DefineConstants>TRACE;DEBUG</DefineConstants> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <DebugType>full</DebugType> <PlatformTarget>x86</PlatformTarget> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTrans Transceiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTrans Transceiver.csproj 2007-09-14 04:47:21 UTC (rev 919) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTrans Transceiver.csproj 2007-09-14 10:17:12 UTC (rev 920) @@ -36,7 +36,7 @@ </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> <OutputPath>bin\x86\Debug\</OutputPath> - <DefineConstants>DEBUG</DefineConstants> + <DefineConstants>TRACE;DEBUG</DefineConstants> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <DebugType>full</DebugType> <PlatformTarget>x86</PlatformTarget> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs 2007-09-14 04:47:21 UTC (rev 919) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs 2007-09-14 10:17:12 UTC (rev 920) @@ -242,7 +242,7 @@ catch (SocketException ex) { // Nothing to worry about - Console.WriteLine(ex.ToString()); + Trace.WriteLine(ex.ToString()); } } @@ -285,7 +285,7 @@ } catch (Exception ex) { - Console.WriteLine(ex.ToString()); + Trace.WriteLine(ex.ToString()); _irTransRemoteModel = DefaultRemoteModel; _irTransServerAddress = DefaultServerAddress; @@ -313,7 +313,7 @@ } catch (Exception ex) { - Console.WriteLine(ex.ToString()); + Trace.WriteLine(ex.ToString()); } } @@ -330,7 +330,7 @@ } catch (SocketException ex) { - Console.WriteLine(ex.ToString()); + Trace.WriteLine(ex.ToString()); return false; } @@ -350,7 +350,7 @@ } catch (SocketException ex) { - Console.WriteLine(ex.ToString()); + Trace.WriteLine(ex.ToString()); } } static void OnDataReceived(IAsyncResult asyn) @@ -390,7 +390,7 @@ } catch (Exception ex) { - Console.WriteLine(ex.ToString()); + Trace.WriteLine(ex.ToString()); } } break; @@ -409,7 +409,7 @@ } catch (SocketException ex) { - Console.WriteLine(ex.ToString()); + Trace.WriteLine(ex.ToString()); } } Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrDecoder.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrDecoder.cs 2007-09-14 04:47:21 UTC (rev 919) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrDecoder.cs 2007-09-14 10:17:12 UTC (rev 920) @@ -123,7 +123,7 @@ #region HeaderPulse case RemoteDetectionState.HeaderPulse: - //Console.WriteLine("JVC HeaderPulse"); + //Trace.WriteLine("JVC HeaderPulse"); if (pulse && duration >= 8200 && duration <= 8600) { @@ -135,7 +135,7 @@ #region HeaderSpace case RemoteDetectionState.HeaderSpace: - //Console.WriteLine("JVC HeaderSpace"); + //Trace.WriteLine("JVC HeaderSpace"); if (!pulse && duration >= 4000 && duration <= 4400) { @@ -150,7 +150,7 @@ #region Data case RemoteDetectionState.Data: - //Console.WriteLine("JVC Data"); + //Trace.WriteLine("JVC Data"); if (pulse && duration >= 350 && duration <= 750) { @@ -174,7 +174,7 @@ } else { - //Console.WriteLine("JVC Error"); + //Trace.WriteLine("JVC Error"); } if (JVC_Data.Bit == 16) @@ -187,7 +187,7 @@ #region Leading case RemoteDetectionState.Leading: - //Console.WriteLine("JVC Leading"); + //Trace.WriteLine("JVC Leading"); if (pulse && duration >= 350 && duration <= 750) { @@ -223,7 +223,7 @@ #region HeaderPulse case RemoteDetectionState.HeaderPulse: - //Console.WriteLine("NEC HeaderPulse"); + //Trace.WriteLine("NEC HeaderPulse"); if (pulse && duration >= 8800 && duration <= 9200) { @@ -235,7 +235,7 @@ #region HeaderSpace case RemoteDetectionState.HeaderSpace: - //Console.WriteLine("NEC HeaderSpace"); + //Trace.WriteLine("NEC HeaderSpace"); if (!pulse && duration >= 4300 && duration <= 4700) { @@ -257,7 +257,7 @@ #region Data case RemoteDetectionState.Data: - //Console.WriteLine("NEC Data"); + //Trace.WriteLine("NEC Data"); if (pulse && duration >= 350 && duration <= 750) { @@ -281,7 +281,7 @@ } else { - //Console.WriteLine("NEC Error"); + //Trace.WriteLine("NEC Error"); } if (NEC_Data.Bit == 32) @@ -317,7 +317,7 @@ #region HeaderPulse case RemoteDetectionState.HeaderPulse: - //Console.WriteLine("RC5 HeaderPulse"); + //Trace.WriteLine("RC5 HeaderPulse"); if (pulse) { @@ -342,7 +342,7 @@ #region HeaderSpace case RemoteDetectionState.HeaderSpace: - //Console.WriteLine("RC5 HeaderSpace"); + //Trace.WriteLine("RC5 HeaderSpace"); if (!pulse && (duration >= 750) && (duration <= 1000)) { @@ -355,7 +355,7 @@ #region Data case RemoteDetectionState.Data: - //Console.WriteLine("RC5 Data"); + //Trace.WriteLine("RC5 Data"); if (RC5_Data.HalfBit == 0) { @@ -373,7 +373,7 @@ } else { - //Console.WriteLine("RC5 Error {0} on bit {1}", duration, bit); + //Trace.WriteLine("RC5 Error {0} on bit {1}", duration, bit); } } else @@ -396,7 +396,7 @@ } else { - //Console.WriteLine("RC5 Space Error {0} on bit {1}", duration, bit); + //Trace.WriteLine("RC5 Space Error {0} on bit {1}", duration, bit); } } break; @@ -419,14 +419,14 @@ } else { - //Console.WriteLine("RC5 Duration Error {0} on bit {1}", duration, bit); + //Trace.WriteLine("RC5 Duration Error {0} on bit {1}", duration, bit); } break; #endregion Data #region Leading case RemoteDetectionState.Leading: - //Console.WriteLine("RC5 Leading"); + //Trace.WriteLine("RC5 Leading"); if (pulse) break; @@ -477,7 +477,7 @@ #region HeaderPulse case RemoteDetectionState.HeaderPulse: - //Console.WriteLine("RC6 HeaderPulse"); + //Trace.WriteLine("RC6 HeaderPulse"); if (pulse && (duration >= 2600) && (duration <= 3300)) { @@ -495,7 +495,7 @@ #region HeaderSpace case RemoteDetectionState.HeaderSpace: - //Console.WriteLine("RC6 HeaderSpace"); + //Trace.WriteLine("RC6 HeaderSpace"); if (!pulse && (duration >= 750) && (duration <= 1000)) { @@ -508,7 +508,7 @@ #region PreData case RemoteDetectionState.PreData: - //Console.WriteLine("RC6 PreData"); + //Trace.WriteLine("RC6 PreData"); if (pulse) { @@ -537,7 +537,7 @@ } else { - //Console.WriteLine(string.Format("RC6 Error Bit {0} {1} {2}", bit, pulse ? "Pulse" : "Space", duration)); + //Trace.WriteLine(string.Format("RC6 Error Bit {0} {1} {2}", bit, pulse ? "Pulse" : "Space", duration)); } } else @@ -571,7 +571,7 @@ } else { - //Console.WriteLine(string.Format("RC6 Error Bit {0} {1} {2}", bit, pulse ? "Pulse" : "Space", duration)); + //Trace.WriteLine(string.Format("RC6 Error Bit {0} {1} {2}", bit, pulse ? "Pulse" : "Space", duration)); } } @@ -598,7 +598,7 @@ #region Data case RemoteDetectionState.Data: - //Console.WriteLine("RC6 Data"); + //Trace.WriteLine("RC6 Data"); if ((RC6_Data.HalfBit % 2) == 0) { @@ -619,7 +619,7 @@ } else { - //Console.WriteLine(string.Format("RC6 Error Halfbit0 {0} {1}", pulse ? "Pulse" : "Space", duration)); + //Trace.WriteLine(string.Format("RC6 Error Halfbit0 {0} {1}", pulse ? "Pulse" : "Space", duration)); } break; } @@ -629,7 +629,7 @@ RC6_Data.LongPulse = false; if (pulse) { - //Console.WriteLine(string.Format("RC6 Error Pulse after LongPulse {0} {1}", pulse ? "Pulse" : "Space", duration)); + //Trace.WriteLine(string.Format("RC6 Error Pulse after LongPulse {0} {1}", pulse ? "Pulse" : "Space", duration)); break; } @@ -648,7 +648,7 @@ } else { - //Console.WriteLine(string.Format("RC6 Error Pulse LongPulse {0} {1}", pulse ? "Pulse" : "Space", duration)); + //Trace.WriteLine(string.Format("RC6 Error Pulse LongPulse {0} {1}", pulse ? "Pulse" : "Space", duration)); } } else if (RC6_Data.LongSpace) @@ -657,7 +657,7 @@ if (!pulse) { - //Console.WriteLine(string.Format("RC6 Error Pulse after LongPulse {0} {1}", pulse ? "Pulse" : "Space", duration)); + //Trace.WriteLine(string.Format("RC6 Error Pulse after LongPulse {0} {1}", pulse ? "Pulse" : "Space", duration)); break; } @@ -687,7 +687,7 @@ } else { - //Console.WriteLine(string.Format("RC6 Error LongPulse {0} {1}", pulse ? "Pulse" : "Space", duration)); + //Trace.WriteLine(string.Format("RC6 Error LongPulse {0} {1}", pulse ? "Pulse" : "Space", duration)); } } break; @@ -729,7 +729,7 @@ #region HeaderPulse case RemoteDetectionState.HeaderPulse: - //Console.WriteLine("RCA HeaderPulse"); + //Trace.WriteLine("RCA HeaderPulse"); if (pulse && duration >= 3800 && duration <= 4200) { @@ -741,7 +741,7 @@ #region HeaderSpace case RemoteDetectionState.HeaderSpace: - //Console.WriteLine("RCA HeaderSpace"); + //Trace.WriteLine("RCA HeaderSpace"); if (!pulse && duration >= 3800 && duration <= 4200) { @@ -756,7 +756,7 @@ #region Data case RemoteDetectionState.Data: - //Console.WriteLine("RCA Data"); + //Trace.WriteLine("RCA Data"); if (pulse && duration >= 300 && duration <= 700) { @@ -780,7 +780,7 @@ } else { - //Console.WriteLine("RCA Error"); + //Trace.WriteLine("RCA Error"); } if (RCA_Data.Bit == 12) @@ -816,7 +816,7 @@ #region HeaderPulse case RemoteDetectionState.HeaderPulse: - //Console.WriteLine("RECS80 HeaderPulse"); + //Trace.WriteLine("RECS80 HeaderPulse"); if (pulse && (duration >= 3300) && (duration <= 4100)) { @@ -828,7 +828,7 @@ #region HeaderSpace case RemoteDetectionState.HeaderSpace: - //Console.WriteLine("RECS80 HeaderSpace"); + //Trace.WriteLine("RECS80 HeaderSpace"); if (!pulse && (duration >= 1400) && (duration <= 1800)) { @@ -844,7 +844,7 @@ #region Data case RemoteDetectionState.Data: - //Console.WriteLine("RECS80 Data"); + //Trace.WriteLine("RECS80 Data"); if ((RECS80_Data.HalfBit % 2) == 0) { @@ -919,7 +919,7 @@ #region HeaderPulse case RemoteDetectionState.HeaderPulse: - /... [truncated message content] |
From: <an...@us...> - 2007-09-15 16:36:51
|
Revision: 928 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=928&view=rev Author: and-81 Date: 2007-09-15 09:36:50 -0700 (Sat, 15 Sep 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Debug Client/Debug Client.csproj trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.Designer.cs trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs trunk/plugins/IR Server Suite/Applications/IR Server/Client.cs trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.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/Applications/Virtual Remote/Program.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/Virtual Remote Skin Editor.csproj trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs trunk/plugins/IR Server Suite/Common/IrssUtils/IrssUtils.csproj trunk/plugins/IR Server Suite/IR Server Suite.sln trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MPBlastZonePlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MappedKeyCode.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs Added Paths: ----------- trunk/plugins/IR Server Suite/Common/IrssComms/ trunk/plugins/IR Server Suite/Common/IrssComms/Client.cs trunk/plugins/IR Server Suite/Common/IrssComms/ClientManager.cs trunk/plugins/IR Server Suite/Common/IrssComms/IrssComms.csproj trunk/plugins/IR Server Suite/Common/IrssComms/Message.cs trunk/plugins/IR Server Suite/Common/IrssComms/Properties/ trunk/plugins/IR Server Suite/Common/IrssComms/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Common/IrssComms/Server.cs Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/Debug Client.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/Debug Client.csproj 2007-09-15 16:30:02 UTC (rev 927) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/Debug Client.csproj 2007-09-15 16:36:50 UTC (rev 928) @@ -81,6 +81,14 @@ <Project>{CA15769C-232E-4CA7-94FD-206A06CA3ABB}</Project> <Name>IrssUtils</Name> </ProjectReference> + <ProjectReference Include="..\..\IPC\AppModule.InterProcessComm\AppModule.InterProcessComm.csproj"> + <Project>{E98F1F7E-40B6-44C8-AC66-EC867B141FA1}</Project> + <Name>AppModule.InterProcessComm</Name> + </ProjectReference> + <ProjectReference Include="..\..\IPC\AppModule.NamedPipes\AppModule.NamedPipes.csproj"> + <Project>{077B53BB-404A-4B2F-BA17-AAE98C5E9C66}</Project> + <Name>AppModule.NamedPipes</Name> + </ProjectReference> <ProjectReference Include="..\..\IPC\Named Pipes\Named Pipes.csproj"> <Project>{F4EA6055-7133-4F18-8971-E19ADEB482C1}</Project> <Name>Named Pipes</Name> Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.Designer.cs 2007-09-15 16:30:02 UTC (rev 927) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.Designer.cs 2007-09-15 16:36:50 UTC (rev 928) @@ -37,11 +37,7 @@ this.buttonDisconnect = new System.Windows.Forms.Button(); this.buttonShutdownServer = new System.Windows.Forms.Button(); this.listBoxStatus = new System.Windows.Forms.ListBox(); - this.buttonCrash = new System.Windows.Forms.Button(); this.buttonPing = new System.Windows.Forms.Button(); - this.groupBoxGenerateMessage = new System.Windows.Forms.GroupBox(); - this.textBoxCustom = new System.Windows.Forms.TextBox(); - this.buttonSendCustom = new System.Windows.Forms.Button(); this.groupBoxStatus = new System.Windows.Forms.GroupBox(); this.groupBoxRemoteButton = new System.Windows.Forms.GroupBox(); this.labelCustomButton = new System.Windows.Forms.Label(); @@ -55,7 +51,6 @@ this.toolTips = new System.Windows.Forms.ToolTip(this.components); this.buttonIRBlastAutoTest = new System.Windows.Forms.Button(); this.buttonHelp = new System.Windows.Forms.Button(); - this.groupBoxGenerateMessage.SuspendLayout(); this.groupBoxStatus.SuspendLayout(); this.groupBoxRemoteButton.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownButton)).BeginInit(); @@ -65,7 +60,7 @@ // // buttonBlast // - this.buttonBlast.Location = new System.Drawing.Point(8, 48); + this.buttonBlast.Location = new System.Drawing.Point(80, 16); this.buttonBlast.Name = "buttonBlast"; this.buttonBlast.Size = new System.Drawing.Size(64, 24); this.buttonBlast.TabIndex = 1; @@ -122,12 +117,12 @@ // buttonShutdownServer // this.buttonShutdownServer.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonShutdownServer.Location = new System.Drawing.Point(296, 48); + this.buttonShutdownServer.Location = new System.Drawing.Point(368, 16); this.buttonShutdownServer.Name = "buttonShutdownServer"; this.buttonShutdownServer.Size = new System.Drawing.Size(64, 24); this.buttonShutdownServer.TabIndex = 4; this.buttonShutdownServer.Text = "Shutdown"; - this.toolTips.SetToolTip(this.buttonShutdownServer, "Shutdown server"); + this.toolTips.SetToolTip(this.buttonShutdownServer, "Shutdown the server"); this.buttonShutdownServer.UseVisualStyleBackColor = true; this.buttonShutdownServer.Click += new System.EventHandler(this.buttonShutdownServer_Click); // @@ -142,26 +137,14 @@ this.listBoxStatus.Location = new System.Drawing.Point(8, 16); this.listBoxStatus.Name = "listBoxStatus"; this.listBoxStatus.ScrollAlwaysVisible = true; - this.listBoxStatus.Size = new System.Drawing.Size(424, 192); + this.listBoxStatus.Size = new System.Drawing.Size(424, 185); this.listBoxStatus.TabIndex = 0; this.toolTips.SetToolTip(this.listBoxStatus, "Status messages"); // - // buttonCrash - // - this.buttonCrash.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonCrash.Location = new System.Drawing.Point(368, 48); - this.buttonCrash.Name = "buttonCrash"; - this.buttonCrash.Size = new System.Drawing.Size(64, 24); - this.buttonCrash.TabIndex = 5; - this.buttonCrash.Text = "Crash"; - this.toolTips.SetToolTip(this.buttonCrash, "Crash this program"); - this.buttonCrash.UseVisualStyleBackColor = true; - this.buttonCrash.Click += new System.EventHandler(this.buttonCrash_Click); - // // buttonPing // this.buttonPing.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonPing.Location = new System.Drawing.Point(368, 16); + this.buttonPing.Location = new System.Drawing.Point(296, 16); this.buttonPing.Name = "buttonPing"; this.buttonPing.Size = new System.Drawing.Size(64, 24); this.buttonPing.TabIndex = 3; @@ -170,53 +153,16 @@ this.buttonPing.UseVisualStyleBackColor = true; this.buttonPing.Click += new System.EventHandler(this.buttonPing_Click); // - // groupBoxGenerateMessage - // - this.groupBoxGenerateMessage.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.groupBoxGenerateMessage.Controls.Add(this.textBoxCustom); - this.groupBoxGenerateMessage.Controls.Add(this.buttonSendCustom); - this.groupBoxGenerateMessage.Location = new System.Drawing.Point(8, 224); - this.groupBoxGenerateMessage.Name = "groupBoxGenerateMessage"; - this.groupBoxGenerateMessage.Size = new System.Drawing.Size(440, 80); - this.groupBoxGenerateMessage.TabIndex = 3; - this.groupBoxGenerateMessage.TabStop = false; - this.groupBoxGenerateMessage.Text = "Generate message"; - // - // textBoxCustom - // - this.textBoxCustom.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxCustom.Location = new System.Drawing.Point(8, 16); - this.textBoxCustom.Multiline = true; - this.textBoxCustom.Name = "textBoxCustom"; - this.textBoxCustom.Size = new System.Drawing.Size(352, 56); - this.textBoxCustom.TabIndex = 0; - this.toolTips.SetToolTip(this.textBoxCustom, "Create a custom message to send to the server"); - // - // buttonSendCustom - // - this.buttonSendCustom.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonSendCustom.Location = new System.Drawing.Point(376, 48); - this.buttonSendCustom.Name = "buttonSendCustom"; - this.buttonSendCustom.Size = new System.Drawing.Size(56, 24); - this.buttonSendCustom.TabIndex = 1; - this.buttonSendCustom.Text = "Send"; - this.toolTips.SetToolTip(this.buttonSendCustom, "Send custom message to server"); - this.buttonSendCustom.UseVisualStyleBackColor = true; - this.buttonSendCustom.Click += new System.EventHandler(this.buttonSendCustom_Click); - // // groupBoxStatus // this.groupBoxStatus.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.groupBoxStatus.Controls.Add(this.listBoxStatus); - this.groupBoxStatus.Location = new System.Drawing.Point(8, 312); + this.groupBoxStatus.Location = new System.Drawing.Point(8, 192); this.groupBoxStatus.Name = "groupBoxStatus"; this.groupBoxStatus.Size = new System.Drawing.Size(440, 216); - this.groupBoxStatus.TabIndex = 4; + this.groupBoxStatus.TabIndex = 3; this.groupBoxStatus.TabStop = false; this.groupBoxStatus.Text = "Status"; // @@ -228,7 +174,7 @@ this.groupBoxRemoteButton.Controls.Add(this.numericUpDownButton); this.groupBoxRemoteButton.Controls.Add(this.comboBoxRemoteButtons); this.groupBoxRemoteButton.Controls.Add(this.buttonSendRemoteButton); - this.groupBoxRemoteButton.Location = new System.Drawing.Point(8, 168); + this.groupBoxRemoteButton.Location = new System.Drawing.Point(8, 136); this.groupBoxRemoteButton.Name = "groupBoxRemoteButton"; this.groupBoxRemoteButton.Size = new System.Drawing.Size(440, 48); this.groupBoxRemoteButton.TabIndex = 2; @@ -310,21 +256,20 @@ this.comboBoxComputer.Location = new System.Drawing.Point(8, 32); this.comboBoxComputer.Name = "comboBoxComputer"; this.comboBoxComputer.Size = new System.Drawing.Size(240, 21); - this.comboBoxComputer.TabIndex = 5; + this.comboBoxComputer.TabIndex = 1; // // groupBoxCommands // this.groupBoxCommands.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.groupBoxCommands.Controls.Add(this.comboBoxPort); - this.groupBoxCommands.Controls.Add(this.buttonCrash); this.groupBoxCommands.Controls.Add(this.buttonBlast); this.groupBoxCommands.Controls.Add(this.buttonLearnIR); this.groupBoxCommands.Controls.Add(this.buttonShutdownServer); this.groupBoxCommands.Controls.Add(this.buttonPing); this.groupBoxCommands.Location = new System.Drawing.Point(8, 80); this.groupBoxCommands.Name = "groupBoxCommands"; - this.groupBoxCommands.Size = new System.Drawing.Size(440, 80); + this.groupBoxCommands.Size = new System.Drawing.Size(440, 48); this.groupBoxCommands.TabIndex = 1; this.groupBoxCommands.TabStop = false; this.groupBoxCommands.Text = "Commands"; @@ -333,7 +278,7 @@ // this.comboBoxPort.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxPort.FormattingEnabled = true; - this.comboBoxPort.Location = new System.Drawing.Point(80, 50); + this.comboBoxPort.Location = new System.Drawing.Point(152, 18); this.comboBoxPort.Name = "comboBoxPort"; this.comboBoxPort.Size = new System.Drawing.Size(80, 21); this.comboBoxPort.TabIndex = 2; @@ -342,10 +287,10 @@ // buttonIRBlastAutoTest // this.buttonIRBlastAutoTest.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonIRBlastAutoTest.Location = new System.Drawing.Point(336, 536); + this.buttonIRBlastAutoTest.Location = new System.Drawing.Point(336, 416); this.buttonIRBlastAutoTest.Name = "buttonIRBlastAutoTest"; this.buttonIRBlastAutoTest.Size = new System.Drawing.Size(112, 24); - this.buttonIRBlastAutoTest.TabIndex = 8; + this.buttonIRBlastAutoTest.TabIndex = 5; this.buttonIRBlastAutoTest.Text = "IRBlast Auto-Test"; this.toolTips.SetToolTip(this.buttonIRBlastAutoTest, "Runs a random number blasting test"); this.buttonIRBlastAutoTest.UseVisualStyleBackColor = true; @@ -354,10 +299,10 @@ // buttonHelp // this.buttonHelp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.buttonHelp.Location = new System.Drawing.Point(8, 536); + this.buttonHelp.Location = new System.Drawing.Point(8, 416); this.buttonHelp.Name = "buttonHelp"; this.buttonHelp.Size = new System.Drawing.Size(56, 24); - this.buttonHelp.TabIndex = 5; + this.buttonHelp.TabIndex = 4; this.buttonHelp.Text = "Help"; this.buttonHelp.UseVisualStyleBackColor = true; this.buttonHelp.Click += new System.EventHandler(this.buttonHelp_Click); @@ -366,23 +311,20 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(456, 566); + this.ClientSize = new System.Drawing.Size(456, 446); this.Controls.Add(this.buttonIRBlastAutoTest); this.Controls.Add(this.buttonHelp); this.Controls.Add(this.groupBoxCommands); this.Controls.Add(this.groupBoxSetup); this.Controls.Add(this.groupBoxRemoteButton); this.Controls.Add(this.groupBoxStatus); - this.Controls.Add(this.groupBoxGenerateMessage); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MinimumSize = new System.Drawing.Size(464, 600); + this.MinimumSize = new System.Drawing.Size(472, 482); this.Name = "MainForm"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Debug Client"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing); this.Load += new System.EventHandler(this.MainForm_Load); - this.groupBoxGenerateMessage.ResumeLayout(false); - this.groupBoxGenerateMessage.PerformLayout(); this.groupBoxStatus.ResumeLayout(false); this.groupBoxRemoteButton.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownButton)).EndInit(); @@ -401,11 +343,7 @@ private System.Windows.Forms.Button buttonDisconnect; private System.Windows.Forms.Button buttonShutdownServer; private System.Windows.Forms.ListBox listBoxStatus; - private System.Windows.Forms.Button buttonCrash; private System.Windows.Forms.Button buttonPing; - private System.Windows.Forms.GroupBox groupBoxGenerateMessage; - private System.Windows.Forms.TextBox textBoxCustom; - private System.Windows.Forms.Button buttonSendCustom; private System.Windows.Forms.GroupBox groupBoxStatus; private System.Windows.Forms.GroupBox groupBoxRemoteButton; private System.Windows.Forms.NumericUpDown numericUpDownButton; Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-09-15 16:30:02 UTC (rev 927) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-09-15 16:36:50 UTC (rev 928) @@ -91,6 +91,8 @@ public MainForm() { InitializeComponent(); + + _messageQueue = new MessageQueue(new MessageQueueSink(ReceivedMessage)); } #endregion @@ -103,12 +105,16 @@ #region Variables - string _serverAddress = Environment.MachineName; + MessageQueue _messageQueue; + + string _serverHost = Environment.MachineName; string _localPipeName = null; string _learnIRFilename = null; - //static bool _keepAlive = true; - static int _echoID = -1; + bool _registered = false; + bool _keepAlive = true; + int _echoID = -1; + Thread _keepAliveThread; IRServerInfo _irServerInfo = new IRServerInfo(); @@ -131,9 +137,6 @@ IrssLog.LogLevel = IrssLog.Level.Debug; IrssLog.Open(Common.FolderIrssLogs + "Debug Client.log"); - string customTemp = String.Format(Common.LocalPipeFormat, 1); - textBoxCustom.Text = String.Format("{0},{1},Register,null", customTemp, Environment.MachineName); - _AddStatusLine = new DelegateAddStatusLine(AddStatusLine); comboBoxRemoteButtons.Items.AddRange(Enum.GetNames(typeof(MceButton))); @@ -147,7 +150,7 @@ if (networkPCs != null) { comboBoxComputer.Items.AddRange(networkPCs.ToArray()); - comboBoxComputer.Text = _serverAddress; + comboBoxComputer.Text = _serverHost; } } private void MainForm_FormClosing(object sender, FormClosingEventArgs e) @@ -172,6 +175,7 @@ case PipeMessageType.RegisterClient: if ((received.Flags & PipeMessageFlags.Success) == PipeMessageFlags.Success) { + _registered = true; _irServerInfo = IRServerInfo.FromBytes(received.DataAsBytes); comboBoxPort.Items.Clear(); comboBoxPort.Items.AddRange(_irServerInfo.Ports); @@ -179,8 +183,7 @@ } else if ((received.Flags & PipeMessageFlags.Failure) == PipeMessageFlags.Failure) { - if (PipeAccess.ServerRunning) - PipeAccess.StopServer(); + _registered = false; } return; @@ -202,8 +205,7 @@ break; case PipeMessageType.ServerShutdown: - if (PipeAccess.ServerRunning) - PipeAccess.StopServer(); + _registered = false; return; case PipeMessageType.Echo: @@ -222,48 +224,6 @@ } } - bool ConnectToServer(string server) - { - _serverAddress = server; - - bool retry = false; - int pipeNumber = 1; - string localPipeTest; - - do - { - localPipeTest = String.Format(Common.LocalPipeFormat, pipeNumber); - AddStatusLine("Trying pipe: " + localPipeTest); - listBoxStatus.Update(); - - if (PipeAccess.PipeExists(String.Format("\\\\.\\pipe\\{0}", localPipeTest))) - { - pipeNumber++; - if (pipeNumber <= Common.MaximumLocalClientCount) - { - retry = true; - } - else - { - AddStatusLine("Maximum local client limit reached"); - return false; - } - } - else - { - PipeAccess.StartServer(localPipeTest, new PipeMessageHandler(ReceivedMessage)); - _localPipeName = localPipeTest; - retry = false; - } - } - while (retry); - - PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.RegisterClient, PipeMessageFlags.Request); - PipeAccess.SendMessage(Common.ServerPipeName, _serverAddress, message); - - return true; - } - bool LearnIR(string fileName) { try @@ -274,7 +234,7 @@ _learnIRFilename = fileName; PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.LearnIR, PipeMessageFlags.Request); - PipeAccess.SendMessage(Common.ServerPipeName, _serverAddress, message); + PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message); AddStatusLine("Learning"); } @@ -304,7 +264,7 @@ file.Close(); PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.BlastIR, PipeMessageFlags.Request, outData); - PipeAccess.SendMessage(Common.ServerPipeName, _serverAddress, message); + PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message); } catch (Exception ex) { @@ -321,55 +281,272 @@ this.Invoke(_AddStatusLine, new Object[] { text }); } - #region Controls + bool StartComms() + { + try + { + if (OpenLocalPipe()) + { + _messageQueue.Start(); - private void buttonConnect_Click(object sender, EventArgs e) + _keepAliveThread = new Thread(new ThreadStart(KeepAliveThread)); + _keepAliveThread.Start(); + return true; + } + } + catch (Exception ex) + { + IrssLog.Error(ex.ToString()); + } + + return false; + } + void StopComms() { + _keepAlive = false; + try { - AddStatusLine("Connect"); - listBoxStatus.Update(); + if (_keepAliveThread != null && _keepAliveThread.IsAlive) + _keepAliveThread.Abort(); + } + catch { } + try + { + if (_registered) + { + _registered = false; + + PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.UnregisterClient, PipeMessageFlags.Request); + PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message); + } + } + catch { } + + _messageQueue.Stop(); + + try + { if (PipeAccess.ServerRunning) + PipeAccess.StopServer(); + } + catch { } + } + + bool OpenLocalPipe() + { + try + { + int pipeNumber = 1; + bool retry = false; + + do { - AddStatusLine("Already connected"); - return; + string localPipeTest = String.Format("irserver\\debug{0:00}", pipeNumber); + + if (PipeAccess.PipeExists(Common.LocalPipePrefix + localPipeTest)) + { + if (++pipeNumber <= Common.MaximumLocalClientCount) + retry = true; + else + throw new Exception(String.Format("Maximum local client limit ({0}) reached", Common.MaximumLocalClientCount)); + } + else + { + if (!PipeAccess.StartServer(localPipeTest, new PipeMessageHandler(_messageQueue.Enqueue))) + throw new Exception(String.Format("Failed to start local pipe server \"{0}\"", localPipeTest)); + + _localPipeName = localPipeTest; + retry = false; + } } + while (retry); - ConnectToServer(comboBoxComputer.Text); + return true; } catch (Exception ex) { - AddStatusLine(ex.Message); + IrssLog.Error(ex.ToString()); + return false; + } + } - if (PipeAccess.ServerRunning) - PipeAccess.StopServer(); + bool ConnectToServer() + { + try + { + PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.RegisterClient, PipeMessageFlags.Request); + PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message); + return true; } + catch (AppModule.NamedPipes.NamedPipeIOException) + { + return false; + } + catch (Exception ex) + { + IrssLog.Error(ex.ToString()); + return false; + } } - private void buttonDisconnect_Click(object sender, EventArgs e) + + void KeepAliveThread() { - AddStatusLine("Disconnect"); + Random random = new Random((int)DateTime.Now.Ticks); + bool reconnect; + int attempt; - if (!PipeAccess.ServerRunning) + _registered = false; + _keepAlive = true; + while (_keepAlive) { - AddStatusLine(" - Not connected"); - return; + reconnect = true; + + #region Connect to server + + IrssLog.Info("Connecting ({0}) ...", _serverHost); + attempt = 0; + while (_keepAlive && reconnect) + { + if (ConnectToServer()) + { + reconnect = false; + } + else + { + int wait; + + if (attempt <= 50) + attempt++; + + if (attempt > 50) + wait = 30; // 30 seconds + else if (attempt > 20) + wait = 10; // 10 seconds + else if (attempt > 10) + wait = 5; // 5 seconds + else + wait = 1; // 1 second + + for (int sleeps = 0; sleeps < wait && _keepAlive; sleeps++) + Thread.Sleep(1000); + } + } + + #endregion Connect to server + + #region Wait for registered + + // Give up after 10 seconds ... + attempt = 0; + while (_keepAlive && !_registered && !reconnect) + { + if (++attempt >= 10) + reconnect = true; + else + Thread.Sleep(1000); + } + + #endregion Wait for registered + + #region Ping the server repeatedly + + while (_keepAlive && _registered && !reconnect) + { + int pingID = random.Next(); + long pingTime = DateTime.Now.Ticks; + + try + { + PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.Ping, PipeMessageFlags.Request, BitConverter.GetBytes(pingID)); + PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message); + } + catch + { + // Failed to ping ... reconnect ... + IrssLog.Warn("Failed to ping, attempting to reconnect ..."); + _registered = false; + reconnect = true; + break; + } + + // Wait 10 seconds for a ping echo ... + bool receivedEcho = false; + while (_keepAlive && _registered && !reconnect && + !receivedEcho && DateTime.Now.Ticks - pingTime < 10 * 1000 * 10000) + { + if (_echoID == pingID) + { + receivedEcho = true; + } + else + { + Thread.Sleep(1000); + } + } + + if (receivedEcho) // Received ping echo ... + { + // 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 to ping, attempting to reconnect ..."); + + // Break out of pinging cycle ... + _registered = false; + reconnect = true; + } + } + + #endregion Ping the server repeatedly + } + } + + + + #region Controls + + private void buttonConnect_Click(object sender, EventArgs e) + { try { - PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.UnregisterClient, PipeMessageFlags.Request); - PipeAccess.SendMessage(Common.ServerPipeName, _serverAddress, message); + AddStatusLine("Connect"); + listBoxStatus.Update(); + + if (PipeAccess.ServerRunning) + { + AddStatusLine("Already connected"); + return; + } + + _serverHost = comboBoxComputer.Text; + + StartComms(); } catch (Exception ex) { AddStatusLine(ex.Message); } + } + private void buttonDisconnect_Click(object sender, EventArgs e) + { + AddStatusLine("Disconnect"); try { - if (PipeAccess.ServerRunning) - PipeAccess.StopServer(); + if (!PipeAccess.ServerRunning) + { + AddStatusLine(" - Not connected"); + return; + } + + StopComms(); } catch (Exception ex) { @@ -427,17 +604,13 @@ try { PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.ServerShutdown, PipeMessageFlags.Request); - PipeAccess.SendMessage(Common.ServerPipeName, _serverAddress, message); + PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message); } catch (Exception ex) { AddStatusLine(ex.Message); } } - private void buttonCrash_Click(object sender, EventArgs e) - { - throw new System.InvalidOperationException("User initiated exception thrown"); - } private void buttonPing_Click(object sender, EventArgs e) { AddStatusLine("Ping Server"); @@ -451,7 +624,7 @@ try { PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.Ping, PipeMessageFlags.Request, BitConverter.GetBytes(24)); - PipeAccess.SendMessage(Common.ServerPipeName, _serverAddress, message); + PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message); } catch (Exception ex) { @@ -459,27 +632,6 @@ } } - private void buttonSendCustom_Click(object sender, EventArgs e) - { - try - { - AddStatusLine("Sending custom message to server ..."); - - if (PipeMessage.FromString(textBoxCustom.Text) == null) - AddStatusLine("Warning: The specified custom message is not a valid message structure"); - - PipeMessage customMessage = PipeMessage.FromString(textBoxCustom.Text); - - PipeAccess.SendMessage(Common.ServerPipeName, _serverAddress, customMessage); - - AddStatusLine("Custom message sent"); - } - catch (Exception ex) - { - AddStatusLine(ex.Message); - } - } - private void comboBoxRemoteButtons_SelectedIndexChanged(object sender, EventArgs e) { if (comboBoxRemoteButtons.SelectedItem.ToString() == "Custom") @@ -514,7 +666,7 @@ BitConverter.GetBytes(0).CopyTo(data, 4); PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.ForwardRemoteEvent, PipeMessageFlags.Notify, data); - PipeAccess.SendMessage(Common.ServerPipeName, _serverAddress, message); + PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message); } catch (Exception ex) { @@ -536,6 +688,8 @@ #endregion Controls + + Thread AutoTest; private void buttonAutoTest_Click(object sender, EventArgs e) Modified: trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2007-09-15 16:30:02 UTC (rev 927) +++ trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2007-09-15 16:36:50 UTC (rev 928) @@ -19,6 +19,8 @@ #region Variables + static MessageQueue _messageQueue; + static bool _registered = false; static bool _keepAlive = true; static int _echoID = -1; @@ -79,6 +81,8 @@ } } + _messageQueue = new MessageQueue(new MessageQueueSink(ReceivedMessage)); + if (String.IsNullOrEmpty(_serverHost) || irCommands.Count == 0) { Console.WriteLine("Malformed command line parameters ..."); @@ -220,6 +224,8 @@ { if (OpenLocalPipe()) { + _messageQueue.Start(); + _keepAliveThread = new Thread(new ThreadStart(KeepAliveThread)); _keepAliveThread.Start(); return true; @@ -255,6 +261,8 @@ } catch { } + _messageQueue.Stop(); + try { if (PipeAccess.ServerRunning) @@ -272,9 +280,9 @@ do { - string localPipeTest = String.Format(Common.LocalPipeFormat, pipeNumber); + string localPipeTest = String.Format("irserver\\blast{0:00}", pipeNumber); - if (PipeAccess.PipeExists(String.Format("\\\\.\\pipe\\{0}", localPipeTest))) + if (PipeAccess.PipeExists(Common.LocalPipePrefix + localPipeTest)) { if (++pipeNumber <= Common.MaximumLocalClientCount) retry = true; @@ -283,7 +291,7 @@ } else { - if (!PipeAccess.StartServer(localPipeTest, new PipeMessageHandler(ReceivedMessage))) + if (!PipeAccess.StartServer(localPipeTest, new PipeMessageHandler(_messageQueue.Enqueue))) throw new Exception(String.Format("Failed to start local pipe server \"{0}\"", localPipeTest)); _localPipeName = localPipeTest; Modified: trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2007-09-15 16:30:02 UTC (rev 927) +++ trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2007-09-15 16:36:50 UTC (rev 928) @@ -20,6 +20,8 @@ #region Variables + static MessageQueue _messageQueue; + static bool _registered = false; static bool _keepAlive = true; static int _echoID = -1; @@ -78,6 +80,8 @@ } } + _messageQueue = new MessageQueue(new MessageQueueSink(ReceivedMessage)); + if (String.IsNullOrEmpty(_serverHost) || irCommands.Count == 0) { Console.WriteLine("Malformed command line parameters ..."); @@ -182,6 +186,8 @@ { if (OpenLocalPipe()) { + _messageQueue.Start(); + _keepAliveThread = new Thread(new ThreadStart(KeepAliveThread)); _keepAliveThread.Start(); return true; @@ -217,6 +223,8 @@ } catch { } + _messageQueue.Stop(); + try { if (PipeAccess.ServerRunning) @@ -234,9 +242,9 @@ do { - string localPipeTest = String.Format(Common.LocalPipeFormat, pipeNumber); + string localPipeTest = String.Format("irserver\\blast{0:00}", pipeNumber); - if (PipeAccess.PipeExists(String.Format("\\\\.\\pipe\\{0}", localPipeTest))) + if (PipeAccess.PipeExists(Common.LocalPipePrefix + localPipeTest)) { if (++pipeNumber <= Common.MaximumLocalClientCount) retry = true; @@ -245,7 +253,7 @@ } else { - if (!PipeAccess.StartServer(localPipeTest, new PipeMessageHandler(ReceivedMessage))) + if (!PipeAccess.StartServer(localPipeTest, new PipeMessageHandler(_messageQueue.Enqueue))) throw new Exception(String.Format("Failed to start local pipe server \"{0}\"", localPipeTest)); _localPipeName = localPipeTest; Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Client.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Client.cs 2007-09-15 16:30:02 UTC (rev 927) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Client.cs 2007-09-15 16:36:50 UTC (rev 928) @@ -15,6 +15,11 @@ Server = server; } + public override string ToString() + { + return String.Format("({0}, {1})", Server, Pipe); + } + } } Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs 2007-09-15 16:30:02 UTC (rev 927) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs 2007-09-15 16:36:50 UTC (rev 928) @@ -336,7 +336,6 @@ #endregion Controls - } } Modified: trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-09-15 16:30:02 UTC (rev 927) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-09-15 16:36:50 UTC (rev 928) @@ -79,7 +79,7 @@ public IRServer() { - _messageQueue = new MessageQueue(new MessageQueueSink(HandlePipeMessage)); + _messageQueue = new MessageQueue(new MessageQueueSink(ReceivedMessage)); // Setup taskbar icon _notifyIcon = new NotifyIcon(); @@ -256,7 +256,7 @@ if (_mode == IRServerMode.ServerMode) { - PipeMessage message = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.ServerShutdown, PipeMessageFlags.Notify); + PipeMessage message = new PipeMessage(Environment.MachineName, Common.ServerPipeName, PipeMessageType.ServerShutdown, PipeMessageFlags.Notify); SendToAll(message); } @@ -370,9 +370,9 @@ { do { - localPipeTest = String.Format(Common.LocalPipeFormat, pipeNumber); + localPipeTest = String.Format("irserver\\relay{0:00}", pipeNumber); - if (PipeAccess.PipeExists(String.Format("\\\\.\\pipe\\{0}", localPipeTest))) + if (PipeAccess.PipeExists(Common.LocalPipePrefix + localPipeTest)) { pipeNumber++; if (pipeNumber <= Common.MaximumLocalClientCount) @@ -437,9 +437,9 @@ { do { - localPipeTest = String.Format(Common.LocalPipeFormat, pipeNumber); + localPipeTest = String.Format("irserver\\repeat{0:00}", pipeNumber); - if (PipeAccess.PipeExists(String.Format("\\\\.\\pipe\\{0}", localPipeTest))) + if (PipeAccess.PipeExists(Common.LocalPipePrefix + localPipeTest)) { pipeNumber++; if (pipeNumber <= Common.MaximumLocalClientCount) @@ -504,7 +504,7 @@ { case IRServerMode.ServerMode: { - PipeMessage message = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.RemoteEvent, PipeMessageFlags.Notify, bytes); + PipeMessage message = new PipeMessage(Environment.MachineName, Common.ServerPipeName, PipeMessageType.RemoteEvent, PipeMessageFlags.Notify, bytes); SendToAll(message); break; } @@ -512,7 +512,7 @@ case IRServerMode.RelayMode: { PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.ForwardRemoteEvent, PipeMessageFlags.Request, bytes); - SendTo(Common.ServerPipeName, _hostComputer, message); + SendTo(new Client(Common.ServerPipeName, _hostComputer), message); break; } @@ -536,7 +536,7 @@ { case IRServerMode.ServerMode: { - PipeMessage message = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.KeyboardEvent, PipeMessageFlags.Notify, bytes); + PipeMessage message = new PipeMessage(Environment.MachineName, Common.ServerPipeName, PipeMessageType.KeyboardEvent, PipeMessageFlags.Notify, bytes); SendToAll(message); break; } @@ -544,7 +544,7 @@ case IRServerMode.RelayMode: { PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.ForwardKeyboardEvent, PipeMessageFlags.Request, bytes); - SendTo(Common.ServerPipeName, _hostComputer, message); + SendTo(new Client(Common.ServerPipeName, _hostComputer), message); break; } @@ -569,7 +569,7 @@ { case IRServerMode.ServerMode: { - PipeMessage message = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.MouseEvent, PipeMessageFlags.Notify, bytes); + PipeMessage message = new PipeMessage(Environment.MachineName, Common.ServerPipeName, PipeMessageType.MouseEvent, PipeMessageFlags.Notify, bytes); SendToAll(message); break; } @@ -577,7 +577,7 @@ case IRServerMode.RelayMode: { PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.ForwardMouseEvent, PipeMessageFlags.Request, bytes); - SendTo(Common.ServerPipeName, _hostComputer, message); + SendTo(new Client(Common.ServerPipeName, _hostComputer), message); break; } @@ -620,7 +620,7 @@ // Inform clients ... if (_mode == IRServerMode.ServerMode) { - PipeMessage message = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.ServerShutdown, PipeMessageFlags.Notify); + PipeMessage message = new PipeMessage(Environment.MachineName, Common.ServerPipeName, PipeMessageType.ServerShutdown, PipeMessageFlags.Notify); SendToAll(message); } break; @@ -656,13 +656,13 @@ // while enumerating it. foreach (Client client in unregister) { - UnregisterClient(client.Pipe, client.Server); + UnregisterClient(client); } } } - void SendToAllExcept(string exceptPipe, string exceptServer, PipeMessage message) + void SendToAllExcept(Client exceptClient, PipeMessage message) { - IrssLog.Debug("SendToAllExcept({0}, {1}, {2})", exceptPipe, exceptServer, message); + IrssLog.Debug("SendToAllExcept({0}, {1})", exceptClient.ToString(), message); List<Client> unregister = new List<Client>(); @@ -670,11 +670,11 @@ { foreach (Client client in _registeredClients) { + if (client.Server.Equals(exceptClient.Server, StringComparison.InvariantCultureIgnoreCase) && client.Pipe.Equals(exceptClient.Pipe, StringComparison.InvariantCultureIgnoreCase)) + continue; + try { - if (client.Pipe == exceptPipe && client.Server == exceptServer) - continue; - PipeAccess.SendMessage(client.Pipe, client.Server, message); } catch (Exception ex) @@ -691,24 +691,24 @@ // while enumerating it. foreach (Client client in unregister) { - UnregisterClient(client.Pipe, client.Server); + UnregisterClient(client); } } } - void SendTo(string pipe, string server, PipeMessage message) + void SendTo(Client receiver, PipeMessage message) { - IrssLog.Debug("SendTo({0}, {1}, {2})", pipe, server, message); + IrssLog.Debug("SendTo({0}, {1})", receiver.ToString(), message); try { - PipeAccess.SendMessage(pipe, server, message); + PipeAccess.SendMessage(receiver.Pipe, receiver.Server, message); } catch (Exception ex) { - IrssLog.Warn("Failed to send message to client ({0}\\{1}): {2}", server, pipe, ex.Message); + IrssLog.Warn("Failed to send message to client ({0}): {1}", receiver.ToString(), ex.Message); // If a message doesn't get through then unregister that client - UnregisterClient(pipe, server); + UnregisterClient(receiver); } } void SendToRepeaters(PipeMessage message) @@ -739,54 +739,34 @@ // while enumerating it. foreach (Client client in unregister) { - UnregisterRepeater(client.Pipe, client.Server); + UnregisterRepeater(client); } } } - bool RegisterClient(string pipe, string server) + bool RegisterClient(Client addClient) { - if (String.IsNullOrEmpty(pipe) || String.IsNullOrEmpty(server)) - return false; - if (_mode != IRServerMode.ServerMode) return false; - bool alreadyRegistered = false; - lock (_registeredClients) { - foreach (Client client in _registeredClients) - { - if (client.Pipe == pipe && client.Server == server) - { - alreadyRegistered = true; - break; - } - } + if (_registeredClients.Contains(addClient)) + return true; + else if (_registeredClients.Count >= Common.MaximumLocalClientCount) + return false; - if (!alreadyRegistered) - { - if (_registeredClients.Count >= Common.MaximumLocalClientCount) - return false; - else - _registeredClients.Add(new Client(pipe, server)); - } + _registeredClients.Add(addClient); } - IrssLog.Info("Registered: \\\\{0}\\pipe\\{1}", server, pipe); + IrssLog.Info("Registered: {0}", addClient.ToString()); return true; } - bool UnregisterClient(string pipe, string server) + bool UnregisterClient(Client removeClient) { - if (String.IsNullOrEmpty(pipe) || String.IsNullOrEmpty(server)) - return false; - if (_mode != IRServerMode.ServerMode) return false; - Client removeClient = new Client(pipe, server); - lock (_registeredClients) { if (!_registeredClients.Contains(removeClient)) @@ -795,62 +775,42 @@ _registeredClients.Remove(removeClient); } - IrssLog.Info("Unregistered: \\\\{0}\\pipe\\{1}", server, pipe); + IrssLog.Info("Unregistered: {0}", removeClient.ToString()); return true; } - bool RegisterRepeater(string pipe, string server) + bool RegisterRepeater(Client addRepeater) { - if (String.IsNullOrEmpty(pipe) || String.IsNullOrEmpty(server)) - return false; - if (_mode != IRServerMode.ServerMode) return false; - bool alreadyRegistered = false; - lock (_registeredRepeaters) { - foreach (Client client in _registeredRepeaters) - { - if (client.Pipe == pipe && client.Server == server) - { - alreadyRegistered = true; - break; - } - } + if (_registeredRepeaters.Contains(addRepeater)) + return true; + else if (_registeredRepeaters.Count >= Common.MaximumLocalClientCount) + return false; - if (!alreadyRegistered) - { - if (_registeredRepeaters.Count >= Common.MaximumLocalClientCount) - return false; - else - _registeredRepeaters.Add(new Client(pipe, server)); - } + _registeredRepeaters.Add(addRepeater); } - IrssLog.Info("Registered Repeater: \\\\{0}\\pipe\\{1}", server, pipe); + IrssLog.Info("Registered Repeater: {0}", addRepeater.ToString()); return true; } - bool UnregisterRepeater(string pipe, string server) + bool UnregisterRepeater(Client removeRepeater) { - if (String.IsNullOrEmpty(pipe) || String.IsNullOrEmpty(server)) - return false; - if (_mode != IRServerMode.RepeaterMode) return false; - Client removeClient = new Client(pipe, server); - lock (_registeredRepeaters) { - if (!_registeredRepeaters.Contains(removeClient)) + if (!_registeredRepeaters.Contains(removeRepeater)) return false; - _registeredRepeaters.Remove(removeClient); + _registeredRepeaters.Remove(removeRepeater); } - IrssLog.Info("Unregistered Repeater: \\\\{0}\\pipe\\{1}", server, pipe); + IrssLog.Info("Unregistered Repeater: {0}", removeRepeater.ToString()); return true; } @@ -927,17 +887,20 @@ return status; } - void HandlePipeMessage(string message) + void ReceivedMessage(string message) { PipeMessage received = PipeMessage.FromString(message); + if (received == null) { IrssLog.Warn("Invalid message received: {0}", message); return; } - IrssLog.Debug("Message received from client \\\\{0}\\pipe\\{1} = {2}", received.FromServer, received.FromPipe, message); + Client receivedFromClient = new Client(received.FromPipe, received.FromServer); + IrssLog.Debug("Message received from client {0} = {1}", receivedFromClient.ToString(), message); + try { switch (received.Type) @@ -945,45 +908,45 @@ case PipeMessageType.ForwardRemoteEvent: if (_mode == IRServerMode.RelayMode) { - PipeMessage forward = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.ForwardRemoteEvent, PipeMessageFlags.Request, received.DataAsBytes); - SendTo(Common.ServerPipeName, _hostComputer, forward); + PipeMessage forward = new PipeMessage(Environment.MachineName, Common.ServerPipeName, PipeMessageType.ForwardRemoteEvent, PipeMessageFlags.Request, received.DataAsBytes); + SendTo(new Client(Common.ServerPipeName, _hostComputer), forward); } else { - PipeMessage forward = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.RemoteEvent, PipeMessageFlags.Notify, received.DataAsBytes); - SendToAllExcept(received.FromPipe, received.FromServer, forward); + PipeMessage forward = new PipeMessage(Environment.MachineName, Common.ServerPipeName, PipeMessageType.RemoteEvent, PipeMessageFlags.Notify, received.DataAsBytes); + SendToAllExcept(receivedFromClient, forward); } break; case PipeMessageType.ForwardKeyboardEvent: if (_mode == IRServerMode.RelayMode) { - PipeMessage forward = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.ForwardKeyboardEvent, PipeMessageFlags.Request, received.DataAsBytes); - SendTo(Common.ServerPipeName, _hostComputer, forward); + PipeMessage forward = new PipeMessage(Environment.MachineName, Common.ServerPipeName, PipeMessageType.ForwardKeyboardEvent, PipeMessageFlags.Request, received.DataAsBytes); + SendTo(new Client(Common.ServerPipeName, _hostComputer), forward); } else { - PipeMessage forward = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.KeyboardEvent, PipeMessageFlags.Notify, received.DataAsBytes); - SendToAllExcept(received.FromPipe, received.FromServer, forward); + PipeMessage forward = new PipeMessage(Environment.MachineName, Common.ServerPipeName, PipeMessageType.KeyboardEvent, PipeMessageFlags.Notify, received.DataAsBytes); + SendToAllExcept(receivedFromClient, forward); } break; case PipeMessageType.ForwardMouseEvent: if (_mode == IRServerMode.RelayMode) { - PipeMessage forward = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.ForwardMouseEvent, PipeMessageFlags.Request, received.DataAsBytes); - SendTo(Common.ServerPipeName, _hostComputer, forward); + PipeMessage forward = new PipeMessage(Environment.MachineName, Common.ServerPipeName, PipeMessageType.ForwardMouseEvent, PipeMessageFlags.Request, received.DataAsBytes); + SendTo(new Client(Common.ServerPipeName, _hostComputer), forward); } else { - PipeMessage forward = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.MouseEvent, PipeMessageFlags.Notify, received.DataAsBytes); - SendToAllExcept(received.FromPipe, received.FromServer, forward); + PipeMessage forward = new PipeMessage(Environment.MachineName, Common.ServerPipeName, PipeMessageType.MouseEvent, PipeMessageFlags.Notify, received.DataAsBytes); + SendToAllExcept(receivedFromClient, forward); } break; case PipeMessageType.BlastIR: { - PipeMessage response = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.BlastIR, PipeMessageFlags.Response); + PipeMessage response = new PipeMessage(Environment.MachineName, Common.ServerPipeName, PipeMessageType.BlastIR, PipeMessageFlags.Response); if (_mode == IRServerMode.RelayMode) { @@ -1001,14 +964,14 @@ } if ((received.Flags & PipeMessageFlags.ForceNotRespond) != PipeMessageFlags.ForceNotRespond) - SendTo(received.FromPipe, received.FromServer, response); + SendTo(receivedFromClient, response); break; } case PipeMessageType.LearnIR: { - PipeMessage response = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.LearnIR, PipeMessageFlags.Response); + PipeMessage response = new PipeMessage(Environment.MachineName, Common.ServerPipeName, PipeMessageType.LearnIR, PipeMessageFlags.Response); if (_mode == IRServerMode.RelayMode) { @@ -1037,7 +1000,7 @@ } } - SendTo(received.FromPipe, received.FromServer, response); + SendTo(receivedFromClient, response); break; } @@ -1064,8 +1027,8 @@ case PipeMessageType.Ping: { - PipeMessage response = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.Echo, PipeMessageFlags.Response, received.DataAsBytes); - SendTo(received.FromPipe, received.FromServer, response); + PipeMessage response = new PipeMessage(Environment.MachineName, Common.ServerPipeName, PipeMessageType.Echo, PipeMessageFlags.Response, received.DataAsBytes); + SendTo(receivedFromClient, response); break; } @@ -1074,9 +1037,9 @@ { if ((received.Flags & PipeMessageFlags.Request) == PipeMessageFlags.Request) { - PipeMessage response = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.RegisterClient, PipeMessageFlags.Response); + PipeMessage response = new PipeMessage(Environment.MachineName, Common.ServerPipeName, PipeMessageType.RegisterClient, PipeMessageFlags.Response); - if (RegisterClient(received.FromPipe, received.FromServer)) + if (RegisterClient(receivedFromClient)) { IRServerInfo irServerInfo = new IRServerInfo(); @@ -1098,7 +1061,7 @@ response.Flags |= PipeMessageFlags.Failure; } - SendTo(received.FromPipe, received.FromServer, response); + SendTo(receivedFromClient, response); } } else if ((received.Flags & PipeMessageFlags.Response) == PipeMessageFlags.Response) @@ -1117,32 +1080,32 @@ break; case PipeMessageType.UnregisterClient: - UnregisterClient(received.FromPipe, received.FromServer); + UnregisterClient(receivedFromClient); break; case PipeMessageType.RegisterRepeater: { - PipeMessage response = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.RegisterRepeater, PipeMessageFlags.Response); - - if (RegisterRepeater(received.FromPipe, received.FromServer)) + PipeMessage response = new PipeMessage(Environment.MachineName, Common.ServerPipeName, PipeMessageType.RegisterRepeater, PipeMessageFlags.Response); + + if (RegisterRepeater(receivedFromClient)) response.Flags |= PipeMessageFlags.Success; else response.Flags |= PipeMessageFlags.Failure; - SendTo(received.FromPipe, received.FromServer, response); + SendTo(receivedFromClient, response); break; } case PipeMessageType.UnregisterRepeater: - UnregisterRepeater(received.FromPipe, received.FromServer); + UnregisterRepeater(receivedFromClient); break; } } catch (Exception ex) { IrssLog.Error(ex.ToString()); - PipeMessage response = new PipeMessage(Common.ServerPipeName, Environment.MachineName, PipeMessageType.Error, PipeMessageFlags.Notify, ex.Message); - SendTo(received.FromPipe, received.FromServer, response); + PipeMessage response = new PipeMessage(Environment.MachineName, Common.ServerPipeName, PipeMessageType.Error, PipeMessageFlags.Notify, ex.Message); + SendTo(receivedFromClient, response); } } Modified: trunk/plugins/IR Server Suite/Applications/Translator/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2007-09-15 16:30:02 UTC (rev 927) +++ trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2007-09-15 16:36:50 UTC (rev 928) @@ -31,6 +31,8 @@ #region Variables + static MessageQueue _messageQueue; + static Configuration _config; static string _localPipeName = String.Empty; @@ -141,6 +143,8 @@ _focusWatcher.Start(); */ + _messageQueue = new MessageQueue(new MessageQueueSink(ReceivedMessage)); + // Start server communications ... if (StartComms()) { @@ -660,6 +664,8 @@ { _notifyIcon.Visible = true; + _messageQueue.Start(); + _keepAliveThread = new Thread(new ThreadStart(KeepAliveThread)); _keepAliveThread.Start(); @@ -698,6 +704,8 @@ } catch { } + _messageQueue.Stop(); + try { if (PipeAccess.ServerRunning) @@ -715,9 +723,9 @@ do { - string localPipeTest = String.Format(Common.LocalPipeFormat, pipeNumber); + string localPipeTest = String.Format("irserver\\trans{0:00}", pipeNumber); - if (PipeAccess.PipeExists(String.Format("\\\\.\\pipe\\{0}", localPipeTest))) + if (PipeAccess.PipeExists(Common.LocalPipePrefix + localPipeTest)) { if (++pipeNumber <= Common.MaximumLocalClientCount) retry = true; @@ -726,7 +734,7 @@ } else { - if (!PipeAccess.StartServer(localPipeTest, new PipeMessageHandler(ReceivedMe... [truncated message content] |
From: <an...@us...> - 2007-12-04 00:45:10
|
Revision: 1119 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1119&view=rev Author: and-81 Date: 2007-12-03 16:45:02 -0800 (Mon, 03 Dec 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Display.cs trunk/plugins/IR Server Suite/Documentation/legal.html Added Paths: ----------- trunk/plugins/IR Server Suite/Applications/Web Remote/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/Applications/Web Remote/Properties/Resources.resx trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/DisplayModeCommand.Designer.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/DisplayModeCommand.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/DisplayModeCommand.resx Property Changed: ---------------- trunk/plugins/IR Server Suite/Applications/Debug Client/ trunk/plugins/IR Server Suite/Applications/IR Blast/ trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/ trunk/plugins/IR Server Suite/Applications/IR File Tool/ trunk/plugins/IR Server Suite/Applications/IR Server/ trunk/plugins/IR Server Suite/Applications/SageSetup/ trunk/plugins/IR Server Suite/Applications/Translator/ trunk/plugins/IR Server Suite/Applications/Tray Launcher/ trunk/plugins/IR Server Suite/Applications/Virtual Remote/ trunk/plugins/IR Server Suite/Applications/Virtual Remote/Skins/ trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/ trunk/plugins/IR Server Suite/Applications/Web Remote/ trunk/plugins/IR Server Suite/Common/IrssComms/ trunk/plugins/IR Server Suite/Common/IrssUtils/ trunk/plugins/IR Server Suite/Documentation/ trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/ trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/ trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/ trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/ trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/ trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/ trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/ trunk/plugins/IR Server Suite/IR Server Plugins/RedEye Blaster/ trunk/plugins/IR Server Suite/IR Server Plugins/Serial IR Blaster/ trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/ trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/ trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/ trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/ trunk/plugins/IR Server Suite/IR Server Plugins/XBCDRC Receiver/ trunk/plugins/IR Server Suite/Input Service/Input Service/ trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/ Property changes on: trunk/plugins/IR Server Suite/Applications/Debug Client ___________________________________________________________________ Name: svn:ignore - *.suo *.user thumbs.db + *.suo *.user thumbs.db bin obj Property changes on: trunk/plugins/IR Server Suite/Applications/IR Blast ___________________________________________________________________ Name: svn:ignore + bin obj Property changes on: trunk/plugins/IR Server Suite/Applications/IR Blast (No Window) ___________________________________________________________________ Name: svn:ignore + bin obj Property changes on: trunk/plugins/IR Server Suite/Applications/IR File Tool ___________________________________________________________________ Name: svn:ignore + bin obj Property changes on: trunk/plugins/IR Server Suite/Applications/IR Server ___________________________________________________________________ Name: svn:ignore - *.suo *.user thumbs.db + *.suo *.user thumbs.db bin obj Property changes on: trunk/plugins/IR Server Suite/Applications/SageSetup ___________________________________________________________________ Name: svn:ignore + bin obj Property changes on: trunk/plugins/IR Server Suite/Applications/Translator ___________________________________________________________________ Name: svn:ignore - *.suo *.user thumbs.db + *.suo *.user thumbs.db bin obj Property changes on: trunk/plugins/IR Server Suite/Applications/Tray Launcher ___________________________________________________________________ Name: svn:ignore - *.suo *.user thumbs.db + *.suo *.user thumbs.db bin obj Property changes on: trunk/plugins/IR Server Suite/Applications/Virtual Remote ___________________________________________________________________ Name: svn:ignore - *.suo *.user thumbs.db + *.suo *.user thumbs.db bin obj Property changes on: trunk/plugins/IR Server Suite/Applications/Virtual Remote/Skins ___________________________________________________________________ Name: svn:ignore + Backup Property changes on: trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor ___________________________________________________________________ Name: svn:ignore - *.suo *.user thumbs.db + *.suo *.user thumbs.db bin obj Property changes on: trunk/plugins/IR Server Suite/Applications/Web Remote ___________________________________________________________________ Name: svn:ignore + bin obj Added: trunk/plugins/IR Server Suite/Applications/Web Remote/Properties/Resources.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Web Remote/Properties/Resources.Designer.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Web Remote/Properties/Resources.Designer.cs 2007-12-04 00:45:02 UTC (rev 1119) @@ -0,0 +1,70 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:2.0.50727.832 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace WebRemote.Properties { + using System; + + + /// <summary> + /// A strongly-typed resource class, for looking up localized strings, etc. + /// </summary> + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// <summary> + /// Returns the cached ResourceManager instance used by this class. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WebRemote.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// <summary> + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + internal static System.Drawing.Icon Icon { + get { + object obj = ResourceManager.GetObject("Icon", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + } +} Added: trunk/plugins/IR Server Suite/Applications/Web Remote/Properties/Resources.resx =================================================================== --- trunk/plugins/IR Server Suite/Applications/Web Remote/Properties/Resources.resx (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Web Remote/Properties/Resources.resx 2007-12-04 00:45:02 UTC (rev 1119) @@ -0,0 +1,124 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> + <data name="Icon" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\icon.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> +</root> \ No newline at end of file Property changes on: trunk/plugins/IR Server Suite/Common/IrssComms ___________________________________________________________________ Name: svn:ignore + bin obj Property changes on: trunk/plugins/IR Server Suite/Common/IrssUtils ___________________________________________________________________ Name: svn:ignore - *.suo *.user thumbs.db + *.suo *.user thumbs.db bin obj Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs 2007-12-03 15:51:38 UTC (rev 1118) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs 2007-12-04 00:45:02 UTC (rev 1119) @@ -461,8 +461,14 @@ if (waitForResponse) { - serialPort.ReadTimeout = 5000; - serialPort.ReadByte(); + try + { + serialPort.ReadTimeout = 5000; + serialPort.ReadByte(); + } + catch + { + } } } finally Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Display.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Display.cs 2007-12-03 15:51:38 UTC (rev 1118) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Display.cs 2007-12-04 00:45:02 UTC (rev 1119) @@ -98,6 +98,10 @@ return devMode; } + /// <summary> + /// Gets the resolution. + /// </summary> + /// <returns>The current screen resolution.</returns> public static Size GetResolution() { DEVMODE devMode = GetDevMode(); @@ -105,6 +109,10 @@ return new Size(devMode.dmPelsWidth, devMode.dmPelsHeight); } + /// <summary> + /// Gets the BPP. + /// </summary> + /// <returns>The current screen Bits Per Pixel.</returns> public static int GetBpp() { DEVMODE devMode = GetDevMode(); @@ -112,6 +120,10 @@ return devMode.dmBitsPerPel; } + /// <summary> + /// Gets the refresh rate. + /// </summary> + /// <returns>The current refresh rate in Hertz.</returns> public static int GetRefreshRate() { DEVMODE devMode = GetDevMode(); @@ -119,16 +131,34 @@ return devMode.dmDisplayFrequency; } + /// <summary> + /// Changes the display mode. + /// </summary> + /// <param name="width">The width.</param> + /// <param name="height">The height.</param> public static void ChangeDisplayMode(int width, int height) { ChangeDisplayMode(height, width, -1, -1); } + /// <summary> + /// Changes the display mode. + /// </summary> + /// <param name="width">The width.</param> + /// <param name="height">The height.</param> + /// <param name="bpp">The BPP.</param> public static void ChangeDisplayMode(int width, int height, short bpp) { ChangeDisplayMode(height, width, bpp, -1); } + /// <summary> + /// Changes the display mode. + /// </summary> + /// <param name="width">The width.</param> + /// <param name="height">The height.</param> + /// <param name="bpp">The BPP.</param> + /// <param name="refreshRate">The refresh rate in Hertz.</param> public static void ChangeDisplayMode(int width, int height, short bpp, int refreshRate) { DEVMODE devMode = GetDevMode(); Added: trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/DisplayModeCommand.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/DisplayModeCommand.Designer.cs (rev 0) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/DisplayModeCommand.Designer.cs 2007-12-04 00:45:02 UTC (rev 1119) @@ -0,0 +1,187 @@ +namespace IrssUtils.Forms +{ + + partial class DisplayModeCommand + { + + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.buttonCancel = new System.Windows.Forms.Button(); + this.buttonOK = new System.Windows.Forms.Button(); + this.textBoxWidth = new System.Windows.Forms.TextBox(); + this.labelWidth = new System.Windows.Forms.Label(); + this.labelHeight = new System.Windows.Forms.Label(); + this.textBoxHeight = new System.Windows.Forms.TextBox(); + this.labelX = new System.Windows.Forms.Label(); + this.textBoxRefresh = new System.Windows.Forms.TextBox(); + this.textBoxBpp = new System.Windows.Forms.TextBox(); + this.checkBoxBpp = new System.Windows.Forms.CheckBox(); + this.checkBoxRefresh = new System.Windows.Forms.CheckBox(); + this.SuspendLayout(); + // + // buttonCancel + // + this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.buttonCancel.Location = new System.Drawing.Point(120, 112); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(64, 24); + this.buttonCancel.TabIndex = 10; + this.buttonCancel.Text = "Cancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); + // + // buttonOK + // + this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonOK.Location = new System.Drawing.Point(48, 112); + this.buttonOK.Name = "buttonOK"; + this.buttonOK.Size = new System.Drawing.Size(64, 24); + this.buttonOK.TabIndex = 9; + this.buttonOK.Text = "OK"; + this.buttonOK.UseVisualStyleBackColor = true; + this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); + // + // textBoxWidth + // + this.textBoxWidth.Location = new System.Drawing.Point(8, 24); + this.textBoxWidth.Name = "textBoxWidth"; + this.textBoxWidth.Size = new System.Drawing.Size(80, 20); + this.textBoxWidth.TabIndex = 1; + this.textBoxWidth.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // labelWidth + // + this.labelWidth.Location = new System.Drawing.Point(8, 8); + this.labelWidth.Name = "labelWidth"; + this.labelWidth.Size = new System.Drawing.Size(80, 16); + this.labelWidth.TabIndex = 0; + this.labelWidth.Text = "Width:"; + // + // labelHeight + // + this.labelHeight.Location = new System.Drawing.Point(104, 8); + this.labelHeight.Name = "labelHeight"; + this.labelHeight.Size = new System.Drawing.Size(80, 16); + this.labelHeight.TabIndex = 3; + this.labelHeight.Text = "Height:"; + // + // textBoxHeight + // + this.textBoxHeight.Location = new System.Drawing.Point(104, 24); + this.textBoxHeight.Name = "textBoxHeight"; + this.textBoxHeight.Size = new System.Drawing.Size(80, 20); + this.textBoxHeight.TabIndex = 4; + this.textBoxHeight.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // labelX + // + this.labelX.Location = new System.Drawing.Point(88, 24); + this.labelX.Name = "labelX"; + this.labelX.Size = new System.Drawing.Size(16, 24); + this.labelX.TabIndex = 2; + this.labelX.Text = "x"; + this.labelX.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // textBoxRefresh + // + this.textBoxRefresh.Location = new System.Drawing.Point(104, 80); + this.textBoxRefresh.Name = "textBoxRefresh"; + this.textBoxRefresh.Size = new System.Drawing.Size(80, 20); + this.textBoxRefresh.TabIndex = 8; + this.textBoxRefresh.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // textBoxBpp + // + this.textBoxBpp.Location = new System.Drawing.Point(8, 80); + this.textBoxBpp.Name = "textBoxBpp"; + this.textBoxBpp.Size = new System.Drawing.Size(80, 20); + this.textBoxBpp.TabIndex = 6; + this.textBoxBpp.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // checkBoxBpp + // + this.checkBoxBpp.Location = new System.Drawing.Point(8, 64); + this.checkBoxBpp.Name = "checkBoxBpp"; + this.checkBoxBpp.Size = new System.Drawing.Size(80, 16); + this.checkBoxBpp.TabIndex = 5; + this.checkBoxBpp.Text = "Bit depth"; + this.checkBoxBpp.UseVisualStyleBackColor = true; + // + // checkBoxRefresh + // + this.checkBoxRefresh.Location = new System.Drawing.Point(104, 64); + this.checkBoxRefresh.Name = "checkBoxRefresh"; + this.checkBoxRefresh.Size = new System.Drawing.Size(80, 16); + this.checkBoxRefresh.TabIndex = 7; + this.checkBoxRefresh.Text = "Refresh Hz"; + this.checkBoxRefresh.UseVisualStyleBackColor = true; + // + // DisplayModeCommand + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(192, 145); + this.Controls.Add(this.checkBoxRefresh); + this.Controls.Add(this.checkBoxBpp); + this.Controls.Add(this.textBoxRefresh); + this.Controls.Add(this.textBoxBpp); + this.Controls.Add(this.labelX); + this.Controls.Add(this.labelHeight); + this.Controls.Add(this.textBoxHeight); + this.Controls.Add(this.labelWidth); + this.Controls.Add(this.textBoxWidth); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.buttonOK); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(160, 116); + this.Name = "DisplayModeCommand"; + this.ShowIcon = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Display Mode Command"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button buttonCancel; + private System.Windows.Forms.Button buttonOK; + private System.Windows.Forms.TextBox textBoxWidth; + private System.Windows.Forms.Label labelWidth; + private System.Windows.Forms.Label labelHeight; + private System.Windows.Forms.TextBox textBoxHeight; + private System.Windows.Forms.Label labelX; + private System.Windows.Forms.TextBox textBoxRefresh; + private System.Windows.Forms.TextBox textBoxBpp; + private System.Windows.Forms.CheckBox checkBoxBpp; + private System.Windows.Forms.CheckBox checkBoxRefresh; + } + +} Added: trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/DisplayModeCommand.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/DisplayModeCommand.cs (rev 0) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/DisplayModeCommand.cs 2007-12-04 00:45:02 UTC (rev 1119) @@ -0,0 +1,91 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.IO; +using System.Text; +using System.Windows.Forms; + +namespace IrssUtils.Forms +{ + + /// <summary> + /// Display Mode Command form. + /// </summary> + public partial class DisplayModeCommand : Form + { + + #region Properties + + /// <summary> + /// Gets the command string. + /// </summary> + /// <value>The command string.</value> + public string CommandString + { + get + { + return String.Format("{0}|{1}|{2}|{3}", + textBoxWidth.Text, + textBoxHeight.Text, + checkBoxBpp.Checked ? textBoxBpp.Text : "-1", + checkBoxRefresh.Checked ? textBoxRefresh.Text : "-1"); + } + } + + #endregion Properties + + #region Constructors + + /// <summary> + /// Initializes a new instance of the <see cref="DisplayModeCommand"/> class. + /// </summary> + public DisplayModeCommand() + { + InitializeComponent(); + + Size res = Display.GetResolution(); + + textBoxWidth.Text = res.Width.ToString(); + textBoxHeight.Text = res.Height.ToString(); + + textBoxBpp.Text = Display.GetBpp().ToString(); + textBoxRefresh.Text = Display.GetRefreshRate().ToString(); + } + + /// <summary> + /// Initializes a new instance of the <see cref="DisplayModeCommand"/> class. + /// </summary> + /// <param name="commands">The command elements.</param> + public DisplayModeCommand(string[] commands) + { + InitializeComponent(); + + textBoxWidth.Text = commands[0]; + textBoxHeight.Text = commands[1]; + textBoxBpp.Text = commands[2]; + textBoxRefresh.Text = commands[3]; + } + + #endregion + + #region Buttons + + private void buttonOK_Click(object sender, EventArgs e) + { + this.DialogResult = DialogResult.OK; + this.Close(); + } + + private void buttonCancel_Click(object sender, EventArgs e) + { + this.DialogResult = DialogResult.Cancel; + this.Close(); + } + + #endregion Buttons + + } + +} Added: trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/DisplayModeCommand.resx =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/DisplayModeCommand.resx (rev 0) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/DisplayModeCommand.resx 2007-12-04 00:45:02 UTC (rev 1119) @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root> \ No newline at end of file Property changes on: trunk/plugins/IR Server Suite/Documentation ___________________________________________________________________ Name: svn:ignore + IR Server Suite.chm Modified: trunk/plugins/IR Server Suite/Documentation/legal.html =================================================================== --- trunk/plugins/IR Server Suite/Documentation/legal.html 2007-12-03 15:51:38 UTC (rev 1118) +++ trunk/plugins/IR Server Suite/Documentation/legal.html 2007-12-04 00:45:02 UTC (rev 1119) @@ -24,10 +24,13 @@ <I>Red-Eye</I> is a trademark of <a href="http://www.redremote.co.uk/">White Wing Logic</a>.<br> <I>MediaPortal</I> is a trademark of <a href="http://www.team-mediaportal.com/">Team MediaPortal</a>.<br> <I>USB-UIRT</I> is a trademark of <a href="http://www.usbuirt.com/">Jon Rhees</a>.<br> +<I>Nintendo</I> and <I>Wii</I> are trademarks of <a href="http://www.nintendo.com/">Nintendo</a>.<br> <br> Other product and company names mentioned may be the trademarks of their respective owners. All efforts are made to ensure correctness and attribution, however errors or ommisions may occur. Please report any errors or ommisions to: AaronDinnage at Hotmail dot com<br> </P> +<P>Wii Remote support uses <a href="http://blogs.msdn.com/coding4fun/archive/2007/03/14/1879033.aspx">WiimoteLib</a>.</P> + </BODY> </HTML> Property changes on: trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver ___________________________________________________________________ Name: svn:ignore + bin obj Property changes on: trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver ___________________________________________________________________ Name: svn:ignore - *.suo *.user thumbs.db + *.suo *.user thumbs.db bin obj Property changes on: trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin ___________________________________________________________________ Name: svn:ignore + bin obj Property changes on: trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface ___________________________________________________________________ Name: svn:ignore - *.suo *.user thumbs.db + *.suo *.user thumbs.db bin obj Property changes on: trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver ___________________________________________________________________ Name: svn:ignore - *.suo *.user thumbs.db + *.suo *.user thumbs.db bin obj Property changes on: trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver ___________________________________________________________________ Name: svn:ignore - *.suo *.user thumbs.db + *.suo *.user thumbs.db bin obj Property changes on: trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver ___________________________________________________________________ Name: svn:ignore + bin obj Property changes on: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver ___________________________________________________________________ Name: svn:ignore - *.suo *.user thumbs.db + *.suo *.user thumbs.db bin obj Property changes on: trunk/plugins/IR Server Suite/IR Server Plugins/RedEye Blaster ___________________________________________________________________ Name: svn:ignore + bin obj Property changes on: trunk/plugins/IR Server Suite/IR Server Plugins/Serial IR Blaster ___________________________________________________________________ Name: svn:ignore + bin obj Property changes on: trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver ___________________________________________________________________ Name: svn:ignore - *.suo *.user thumbs.db + *.suo *.user thumbs.db bin obj Property changes on: trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver ___________________________________________________________________ Name: svn:ignore + bin obj Property changes on: trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver ___________________________________________________________________ Name: svn:ignore - *.suo *.user thumbs.db + *.suo *.user thumbs.db bin obj Property changes on: trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver ___________________________________________________________________ Name: svn:ignore - *.suo *.user thumbs.db + *.suo *.user thumbs.db bin obj Property changes on: trunk/plugins/IR Server Suite/IR Server Plugins/XBCDRC Receiver ___________________________________________________________________ Name: svn:ignore - *.suo *.user thumbs.db + *.suo *.user thumbs.db bin obj Property changes on: trunk/plugins/IR Server Suite/Input Service/Input Service ___________________________________________________________________ Name: svn:ignore + bin obj Property changes on: trunk/plugins/IR Server Suite/Input Service/Input Service Configuration ___________________________________________________________________ Name: svn:ignore + bin obj Property changes on: trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin ___________________________________________________________________ Name: svn:ignore - *.suo *.user thumbs.db + *.suo *.user thumbs.db bin obj Property changes on: trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin ___________________________________________________________________ Name: svn:ignore - *.suo *.user thumbs.db + *.suo *.user thumbs.db bin obj Property changes on: trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin ___________________________________________________________________ Name: svn:ignore - *.suo *.user thumbs.db + *.suo *.user thumbs.db bin obj This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2008-01-04 23:10:14
|
Revision: 1206 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1206&view=rev Author: and-81 Date: 2008-01-04 15:10:04 -0800 (Fri, 04 Jan 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs trunk/plugins/IR Server Suite/Applications/Debug Client/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs trunk/plugins/IR Server Suite/Applications/IR Blast/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/IR Server/Config.Designer.cs trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs trunk/plugins/IR Server Suite/Applications/Translator/Configuration.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MacroEditor.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/Translator/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/Properties/AssemblyInfo.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/Applications/Virtual Remote/Program.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Web Remote/Program.cs trunk/plugins/IR Server Suite/Applications/Web Remote/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Web Remote/Setup.cs trunk/plugins/IR Server Suite/Applications/Web Remote/WebServer.cs trunk/plugins/IR Server Suite/Common/IrssComms/Client.cs trunk/plugins/IR Server Suite/Common/IrssComms/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Common/IrssComms/Server.cs trunk/plugins/IR Server Suite/Common/IrssUtils/IrssLog.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Win32.cs trunk/plugins/IR Server Suite/Common/MPUtils/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Girder Plugin.cs trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IRServerPluginBase.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/ITransmitIR.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/IgorPlug Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverVista.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverXP.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrCode.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/RedEye Blaster/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/RedEye Blaster/RedEye Blaster.cs trunk/plugins/IR Server Suite/IR Server Plugins/Serial IR Blaster/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/Serial IR Blaster/Serial IR Blaster.cs trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/UirtTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Wii Remote Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/Wii Remote Receiver/Wii Remote Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Windows Message Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/X10Transceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/XBCDRC Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/XBCDRC Receiver/XBCDRC Receiver.cs trunk/plugins/IR Server Suite/IR Server Suite.sln trunk/plugins/IR Server Suite/Input Service/Input Service/InputService.cs trunk/plugins/IR Server Suite/Input Service/Input Service/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Config.Designer.cs trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Input Service Configuration.exe.manifest trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Program.cs trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Properties/AssemblyInfo.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/Forms/SetupForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MPBlastZonePlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Properties/AssemblyInfo.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/MPControlPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/ExternalChannels.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/SetupForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/StbSetup.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Properties/AssemblyInfo.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/Forms/PluginSetup.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/StbSetup.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs Added Paths: ----------- trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/ trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/Direct Input Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/DirectInputListener.cs trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/DirectInputReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/Properties/ trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/Properties/AssemblyInfo.cs Removed Paths: ------------- trunk/plugins/IR Server Suite/Set Top Boxes/Dreambox HTTP TEST.xml Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2008-01-04 23:08:43 UTC (rev 1205) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2008-01-04 23:10:04 UTC (rev 1206) @@ -521,6 +521,7 @@ } catch (Exception ex) { + IrssLog.Error(ex); MessageBox.Show(this, ex.Message, "Failed to load help", MessageBoxButtons.OK, MessageBoxIcon.Error); } } Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/Properties/AssemblyInfo.cs 2008-01-04 23:08:43 UTC (rev 1205) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/Properties/AssemblyInfo.cs 2008-01-04 23:10:04 UTC (rev 1206) @@ -33,8 +33,8 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.4.0")] -[assembly: AssemblyFileVersion("1.0.4.0")] +[assembly: AssemblyVersion("1.0.4.1")] +[assembly: AssemblyFileVersion("1.0.4.1")] [assembly: CLSCompliant(true)] [assembly: GuidAttribute("8eeb5fcb-322c-45ee-80a9-3d30cc08a48c")] Modified: trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2008-01-04 23:08:43 UTC (rev 1205) +++ trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2008-01-04 23:10:04 UTC (rev 1206) @@ -358,7 +358,7 @@ static void Error(Exception ex) { Console.WriteLine(ex.Message); - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); } #endregion Log Commands Modified: trunk/plugins/IR Server Suite/Applications/IR Blast/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast/Properties/AssemblyInfo.cs 2008-01-04 23:08:43 UTC (rev 1205) +++ trunk/plugins/IR Server Suite/Applications/IR Blast/Properties/AssemblyInfo.cs 2008-01-04 23:10:04 UTC (rev 1206) @@ -33,8 +33,8 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.4.0")] -[assembly: AssemblyFileVersion("1.0.4.0")] +[assembly: AssemblyVersion("1.0.4.1")] +[assembly: AssemblyFileVersion("1.0.4.1")] [assembly: CLSCompliant(true)] [assembly: GuidAttribute("5eeca936-da49-4952-ab3b-9f11ec57e4aa")] Modified: trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2008-01-04 23:08:43 UTC (rev 1205) +++ trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2008-01-04 23:10:04 UTC (rev 1206) @@ -169,7 +169,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); } StopClient(); @@ -284,7 +284,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); } } Modified: trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Properties/AssemblyInfo.cs 2008-01-04 23:08:43 UTC (rev 1205) +++ trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Properties/AssemblyInfo.cs 2008-01-04 23:10:04 UTC (rev 1206) @@ -33,8 +33,8 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.4.0")] -[assembly: AssemblyFileVersion("1.0.4.0")] +[assembly: AssemblyVersion("1.0.4.1")] +[assembly: AssemblyFileVersion("1.0.4.1")] [assembly: CLSCompliant(true)] [assembly: GuidAttribute("81eb136b-cc74-4eed-976d-f96ebccd1ce4")] Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Config.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Config.Designer.cs 2008-01-04 23:08:43 UTC (rev 1205) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Config.Designer.cs 2008-01-04 23:10:04 UTC (rev 1206) @@ -28,139 +28,139 @@ /// </summary> private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Config)); - this.buttonOK = new System.Windows.Forms.Button(); - this.buttonCancel = new System.Windows.Forms.Button(); - this.toolTips = new System.Windows.Forms.ToolTip(this.components); - this.checkBoxRunAtBoot = new System.Windows.Forms.CheckBox(); - this.buttonAdvanced = new System.Windows.Forms.Button(); - this.buttonDetect = new System.Windows.Forms.Button(); - this.groupBoxTransceiver = new System.Windows.Forms.GroupBox(); - this.gridPlugins = new SourceGrid.Grid(); - this.buttonHelp = new System.Windows.Forms.Button(); - this.groupBoxTransceiver.SuspendLayout(); - this.SuspendLayout(); - // - // buttonOK - // - this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonOK.Location = new System.Drawing.Point(352, 304); - this.buttonOK.Name = "buttonOK"; - this.buttonOK.Size = new System.Drawing.Size(64, 24); - this.buttonOK.TabIndex = 5; - this.buttonOK.Text = "OK"; - this.buttonOK.UseVisualStyleBackColor = true; - this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); - // - // buttonCancel - // - this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.buttonCancel.Location = new System.Drawing.Point(424, 304); - this.buttonCancel.Name = "buttonCancel"; - this.buttonCancel.Size = new System.Drawing.Size(64, 24); - this.buttonCancel.TabIndex = 6; - this.buttonCancel.Text = "Cancel"; - this.buttonCancel.UseVisualStyleBackColor = true; - this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); - // - // checkBoxRunAtBoot - // - this.checkBoxRunAtBoot.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.checkBoxRunAtBoot.AutoSize = true; - this.checkBoxRunAtBoot.Location = new System.Drawing.Point(8, 272); - this.checkBoxRunAtBoot.Name = "checkBoxRunAtBoot"; - this.checkBoxRunAtBoot.Size = new System.Drawing.Size(165, 17); - this.checkBoxRunAtBoot.TabIndex = 1; - this.checkBoxRunAtBoot.Text = "&Start IR Server with Windows"; - this.toolTips.SetToolTip(this.checkBoxRunAtBoot, "Run IR Server when windows boots up?"); - this.checkBoxRunAtBoot.UseVisualStyleBackColor = true; - // - // buttonAdvanced - // - this.buttonAdvanced.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.buttonAdvanced.Location = new System.Drawing.Point(80, 304); - this.buttonAdvanced.Name = "buttonAdvanced"; - this.buttonAdvanced.Size = new System.Drawing.Size(64, 24); - this.buttonAdvanced.TabIndex = 3; - this.buttonAdvanced.Text = "Advanced"; - this.toolTips.SetToolTip(this.buttonAdvanced, "Click here for advanced options"); - this.buttonAdvanced.UseVisualStyleBackColor = true; - this.buttonAdvanced.Click += new System.EventHandler(this.buttonAdvanced_Click); - // - // buttonDetect - // - this.buttonDetect.Anchor = System.Windows.Forms.AnchorStyles.Bottom; - this.buttonDetect.Location = new System.Drawing.Point(216, 304); - this.buttonDetect.Name = "buttonDetect"; - this.buttonDetect.Size = new System.Drawing.Size(80, 24); - this.buttonDetect.TabIndex = 4; - this.buttonDetect.Text = "Auto-Detect"; - this.toolTips.SetToolTip(this.buttonDetect, "Click here to automatically detect attached devices"); - this.buttonDetect.UseVisualStyleBackColor = true; - this.buttonDetect.Click += new System.EventHandler(this.buttonDetect_Click); - // - // groupBoxTransceiver - // - this.groupBoxTransceiver.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.groupBoxTransceiver.Controls.Add(this.gridPlugins); - this.groupBoxTransceiver.Location = new System.Drawing.Point(8, 8); - this.groupBoxTransceiver.Name = "groupBoxTransceiver"; - this.groupBoxTransceiver.Size = new System.Drawing.Size(480, 256); - this.groupBoxTransceiver.TabIndex = 0; - this.groupBoxTransceiver.TabStop = false; - this.groupBoxTransceiver.Text = "Device plugins"; - // - // gridPlugins - // - this.gridPlugins.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.gridPlugins.BackColor = System.Drawing.SystemColors.Window; - this.gridPlugins.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.gridPlugins.Location = new System.Drawing.Point(16, 24); - this.gridPlugins.Name = "gridPlugins"; - this.gridPlugins.OptimizeMode = SourceGrid.CellOptimizeMode.ForRows; - this.gridPlugins.SelectionMode = SourceGrid.GridSelectionMode.Row; - this.gridPlugins.Size = new System.Drawing.Size(448, 216); - this.gridPlugins.TabIndex = 0; - this.gridPlugins.TabStop = true; - this.gridPlugins.ToolTipText = ""; - // - // buttonHelp - // - this.buttonHelp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.buttonHelp.Location = new System.Drawing.Point(8, 304); - this.buttonHelp.Name = "buttonHelp"; - this.buttonHelp.Size = new System.Drawing.Size(64, 24); - this.buttonHelp.TabIndex = 2; - this.buttonHelp.Text = "Help"; - this.buttonHelp.UseVisualStyleBackColor = true; - this.buttonHelp.Click += new System.EventHandler(this.buttonHelp_Click); - // - // Config - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(496, 343); - this.Controls.Add(this.buttonDetect); - this.Controls.Add(this.buttonAdvanced); - this.Controls.Add(this.buttonHelp); - this.Controls.Add(this.checkBoxRunAtBoot); - this.Controls.Add(this.groupBoxTransceiver); - this.Controls.Add(this.buttonCancel); - this.Controls.Add(this.buttonOK); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MinimumSize = new System.Drawing.Size(504, 370); - this.Name = "Config"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "IR Server - Configuration"; - this.groupBoxTransceiver.ResumeLayout(false); - this.ResumeLayout(false); - this.PerformLayout(); + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Config)); + this.buttonOK = new System.Windows.Forms.Button(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.toolTips = new System.Windows.Forms.ToolTip(this.components); + this.checkBoxRunAtBoot = new System.Windows.Forms.CheckBox(); + this.buttonAdvanced = new System.Windows.Forms.Button(); + this.buttonDetect = new System.Windows.Forms.Button(); + this.groupBoxTransceiver = new System.Windows.Forms.GroupBox(); + this.gridPlugins = new SourceGrid.Grid(); + this.buttonHelp = new System.Windows.Forms.Button(); + this.groupBoxTransceiver.SuspendLayout(); + this.SuspendLayout(); + // + // buttonOK + // + this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonOK.Location = new System.Drawing.Point(352, 304); + this.buttonOK.Name = "buttonOK"; + this.buttonOK.Size = new System.Drawing.Size(64, 24); + this.buttonOK.TabIndex = 5; + this.buttonOK.Text = "OK"; + this.buttonOK.UseVisualStyleBackColor = true; + this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); + // + // buttonCancel + // + this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.buttonCancel.Location = new System.Drawing.Point(424, 304); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(64, 24); + this.buttonCancel.TabIndex = 6; + this.buttonCancel.Text = "Cancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); + // + // checkBoxRunAtBoot + // + this.checkBoxRunAtBoot.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.checkBoxRunAtBoot.AutoSize = true; + this.checkBoxRunAtBoot.Location = new System.Drawing.Point(8, 272); + this.checkBoxRunAtBoot.Name = "checkBoxRunAtBoot"; + this.checkBoxRunAtBoot.Size = new System.Drawing.Size(165, 17); + this.checkBoxRunAtBoot.TabIndex = 1; + this.checkBoxRunAtBoot.Text = "&Start IR Server with Windows"; + this.toolTips.SetToolTip(this.checkBoxRunAtBoot, "Run IR Server when windows boots up?"); + this.checkBoxRunAtBoot.UseVisualStyleBackColor = true; + // + // buttonAdvanced + // + this.buttonAdvanced.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonAdvanced.Location = new System.Drawing.Point(80, 304); + this.buttonAdvanced.Name = "buttonAdvanced"; + this.buttonAdvanced.Size = new System.Drawing.Size(64, 24); + this.buttonAdvanced.TabIndex = 3; + this.buttonAdvanced.Text = "Advanced"; + this.toolTips.SetToolTip(this.buttonAdvanced, "Click here for advanced options"); + this.buttonAdvanced.UseVisualStyleBackColor = true; + this.buttonAdvanced.Click += new System.EventHandler(this.buttonAdvanced_Click); + // + // buttonDetect + // + this.buttonDetect.Anchor = System.Windows.Forms.AnchorStyles.Bottom; + this.buttonDetect.Location = new System.Drawing.Point(216, 304); + this.buttonDetect.Name = "buttonDetect"; + this.buttonDetect.Size = new System.Drawing.Size(80, 24); + this.buttonDetect.TabIndex = 4; + this.buttonDetect.Text = "Detect"; + this.toolTips.SetToolTip(this.buttonDetect, "Click here to automatically detect attached devices"); + this.buttonDetect.UseVisualStyleBackColor = true; + this.buttonDetect.Click += new System.EventHandler(this.buttonDetect_Click); + // + // groupBoxTransceiver + // + this.groupBoxTransceiver.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxTransceiver.Controls.Add(this.gridPlugins); + this.groupBoxTransceiver.Location = new System.Drawing.Point(8, 8); + this.groupBoxTransceiver.Name = "groupBoxTransceiver"; + this.groupBoxTransceiver.Size = new System.Drawing.Size(480, 256); + this.groupBoxTransceiver.TabIndex = 0; + this.groupBoxTransceiver.TabStop = false; + this.groupBoxTransceiver.Text = "Device plugins"; + // + // gridPlugins + // + this.gridPlugins.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.gridPlugins.BackColor = System.Drawing.SystemColors.Window; + this.gridPlugins.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.gridPlugins.Location = new System.Drawing.Point(16, 24); + this.gridPlugins.Name = "gridPlugins"; + this.gridPlugins.OptimizeMode = SourceGrid.CellOptimizeMode.ForRows; + this.gridPlugins.SelectionMode = SourceGrid.GridSelectionMode.Row; + this.gridPlugins.Size = new System.Drawing.Size(448, 216); + this.gridPlugins.TabIndex = 0; + this.gridPlugins.TabStop = true; + this.gridPlugins.ToolTipText = ""; + // + // buttonHelp + // + this.buttonHelp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonHelp.Location = new System.Drawing.Point(8, 304); + this.buttonHelp.Name = "buttonHelp"; + this.buttonHelp.Size = new System.Drawing.Size(64, 24); + this.buttonHelp.TabIndex = 2; + this.buttonHelp.Text = "Help"; + this.buttonHelp.UseVisualStyleBackColor = true; + this.buttonHelp.Click += new System.EventHandler(this.buttonHelp_Click); + // + // Config + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(496, 343); + this.Controls.Add(this.buttonDetect); + this.Controls.Add(this.buttonAdvanced); + this.Controls.Add(this.buttonHelp); + this.Controls.Add(this.checkBoxRunAtBoot); + this.Controls.Add(this.groupBoxTransceiver); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.buttonOK); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MinimumSize = new System.Drawing.Size(504, 370); + this.Name = "Config"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "IR Server - Configuration"; + this.groupBoxTransceiver.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); } Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs 2008-01-04 23:08:43 UTC (rev 1205) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs 2008-01-04 23:10:04 UTC (rev 1206) @@ -133,7 +133,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); checkBoxRunAtBoot.Checked = false; } @@ -245,7 +245,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); } this.DialogResult = DialogResult.OK; Modified: trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2008-01-04 23:08:43 UTC (rev 1205) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2008-01-04 23:10:04 UTC (rev 1206) @@ -147,7 +147,7 @@ /// <summary> /// Start the server. /// </summary> - /// <returns>success.</returns> + /// <returns><c>true</c> if successful, otherwise <c>false</c>.</returns> internal bool Start() { try @@ -274,7 +274,7 @@ catch (Exception ex) { IrssLog.Error("Failed to start receive plugin: \"{0}\"", plugin.Name); - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); removePlugins.Add(plugin); } @@ -299,7 +299,7 @@ catch (Exception ex) { IrssLog.Error("Failed to start transmit plugin: \"{0}\"", _pluginNameTransmit); - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); _pluginTransmit = null; } @@ -315,7 +315,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); return false; } } @@ -372,7 +372,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); } } @@ -386,7 +386,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); } finally { @@ -413,7 +413,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); } } @@ -454,7 +454,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); } _inConfiguration = false; @@ -484,7 +484,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); } } } @@ -497,7 +497,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); } } @@ -529,7 +529,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); } } } @@ -542,7 +542,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); } } @@ -681,7 +681,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); return false; } } @@ -710,7 +710,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); return false; } } @@ -1004,7 +1004,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); return false; } } @@ -1049,7 +1049,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); } return status; @@ -1411,7 +1411,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); IrssMessage response = new IrssMessage(MessageType.Error, MessageFlags.Notify, ex.Message); SendTo(combo.Manager, response); } @@ -1451,7 +1451,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); IrssMessage response = new IrssMessage(MessageType.Error, MessageFlags.Notify, ex.Message); _client.Send(response); } @@ -1508,7 +1508,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); return; } @@ -1571,7 +1571,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); } } void CreateDefaultSettings() @@ -1594,7 +1594,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); } } Modified: trunk/plugins/IR Server Suite/Applications/Translator/Configuration.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Configuration.cs 2008-01-04 23:08:43 UTC (rev 1205) +++ trunk/plugins/IR Server Suite/Applications/Translator/Configuration.cs 2008-01-04 23:10:04 UTC (rev 1206) @@ -91,7 +91,7 @@ /// </summary> /// <param name="config">Configuration to save.</param> /// <param name="fileName">File to save to.</param> - /// <returns>true if successful, otherwise false.</returns> + /// <returns><c>true</c> if successful, otherwise <c>false</c>.</returns> internal static bool Save(Configuration config, string fileName) { try @@ -104,7 +104,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); return false; } } @@ -128,7 +128,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); } return null; Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs 2008-01-04 23:08:43 UTC (rev 1205) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs 2008-01-04 23:10:04 UTC (rev 1206) @@ -621,6 +621,7 @@ } catch (Exception ex) { + IrssLog.Error(ex); MessageBox.Show(this, ex.Message, "Failed to load help", MessageBoxButtons.OK, MessageBoxIcon.Error); } } Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MacroEditor.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MacroEditor.cs 2008-01-04 23:08:43 UTC (rev 1205) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MacroEditor.cs 2008-01-04 23:10:04 UTC (rev 1206) @@ -114,7 +114,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); } } @@ -138,7 +138,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); } } @@ -287,7 +287,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); MessageBox.Show(this, ex.Message, "Failed to add macro command", MessageBoxButtons.OK, MessageBoxIcon.Error); } } @@ -347,7 +347,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); MessageBox.Show(this, ex.Message, "Test failed", MessageBoxButtons.OK, MessageBoxIcon.Error); } } @@ -382,7 +382,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); MessageBox.Show(this, ex.Message, "Failed writing macro to file", MessageBoxButtons.OK, MessageBoxIcon.Error); } @@ -522,7 +522,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); MessageBox.Show(this, ex.Message, "Failed to edit macro item", MessageBoxButtons.OK, MessageBoxIcon.Error); } } Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2008-01-04 23:08:43 UTC (rev 1205) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2008-01-04 23:10:04 UTC (rev 1206) @@ -127,7 +127,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); checkBoxAutoRun.Checked = false; } @@ -839,6 +839,7 @@ } catch (Exception ex) { + IrssLog.Error(ex); MessageBox.Show(this, ex.Message, "Test failed", MessageBoxButtons.OK, MessageBoxIcon.Error); } } @@ -894,8 +895,8 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); - MessageBox.Show(ex.ToString(), "Failed to rename file", MessageBoxButtons.OK, MessageBoxIcon.Error); + IrssLog.Error(ex); + MessageBox.Show(ex.Message, "Failed to rename file", MessageBoxButtons.OK, MessageBoxIcon.Error); } } private void listViewMacro_AfterLabelEdit(object sender, LabelEditEventArgs e) @@ -940,8 +941,8 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); - MessageBox.Show(ex.ToString(), "Failed to rename file", MessageBoxButtons.OK, MessageBoxIcon.Error); + IrssLog.Error(ex); + MessageBox.Show(ex.Message, "Failed to rename file", MessageBoxButtons.OK, MessageBoxIcon.Error); } } @@ -1204,12 +1205,13 @@ } catch (Exception ex) { + IrssLog.Error(ex); MessageBox.Show(this, ex.Message, "Failed to load help", MessageBoxButtons.OK, MessageBoxIcon.Error); } } private void aboutToolStripMenuItem_Click(object sender, EventArgs e) { - MessageBox.Show(this, "Translator\nVersion 1.0.4.0 for IR Server Suite\nBy Aaron Dinnage, 2007", "About Translator", MessageBoxButtons.OK, MessageBoxIcon.Information); + MessageBox.Show(this, "Translator\nVersion 1.0.4.1 for IR Server Suite\nBy Aaron Dinnage, 2007", "About Translator", MessageBoxButtons.OK, MessageBoxIcon.Information); } private void addProgramToolStripMenuItem_Click(object sender, EventArgs e) Modified: trunk/plugins/IR Server Suite/Applications/Translator/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2008-01-04 23:08:43 UTC (rev 1205) +++ trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2008-01-04 23:10:04 UTC (rev 1206) @@ -158,7 +158,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); clientStarted = false; } @@ -315,6 +315,7 @@ { Thread thread = new Thread(new ThreadStart(MenuThread)); thread.Name = "Translator OSD"; + thread.IsBackground = true; thread.Start(); } } @@ -326,7 +327,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); } } @@ -466,7 +467,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); MessageBox.Show(ex.Message, "Macro failed", MessageBoxButtons.OK, MessageBoxIcon.Error); } } @@ -534,7 +535,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); MessageBox.Show(ex.Message, "Action failed", MessageBoxButtons.OK, MessageBoxIcon.Error); } } @@ -763,7 +764,7 @@ catch (Exception ex) { _learnIRFilename = null; - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); } } @@ -790,7 +791,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); } IrssLog.Debug("Active program not found in Translator program list"); @@ -815,7 +816,7 @@ { ProcessCommand(buttonMap.Command, true); } - catch (Exception ex) { IrssLog.Error(ex.ToString()); } + catch (Exception ex) { IrssLog.Error(ex); } return; } } @@ -832,7 +833,7 @@ { ProcessCommand(buttonMap.Command, true); } - catch (Exception ex) { IrssLog.Error(ex.ToString()); } + catch (Exception ex) { IrssLog.Error(ex); } return; } } @@ -849,7 +850,7 @@ { ProcessCommand(buttonMap.Command, true); } - catch (Exception ex) { IrssLog.Error(ex.ToString()); } + catch (Exception ex) { IrssLog.Error(ex); } return; } } @@ -906,7 +907,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); } } } @@ -917,7 +918,7 @@ /// Learn an IR command. /// </summary> /// <param name="fileName">File to place learned IR command in (absolute path).</param> - /// <returns>true if successful, otherwise false.</returns> + /// <returns><c>true</c> if successful, otherwise <c>false</c>.</returns> internal static bool LearnIR(string fileName) { try @@ -948,7 +949,7 @@ catch (Exception ex) { _learnIRFilename = null; - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); return false; } @@ -996,12 +997,12 @@ { Thread newThread = new Thread(new ParameterizedThreadStart(ProcCommand)); newThread.Name = ProcessCommandThreadName; - newThread.Priority = ThreadPriority.BelowNormal; + newThread.IsBackground = true; newThread.Start(command); } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); } } else @@ -1183,7 +1184,7 @@ catch (Exception ex) { if (Thread.CurrentThread.Name.Equals(ProcessCommandThreadName, StringComparison.OrdinalIgnoreCase)) - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); else throw; } Modified: trunk/plugins/IR Server Suite/Applications/Translator/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Properties/AssemblyInfo.cs 2008-01-04 23:08:43 UTC (rev 1205) +++ trunk/plugins/IR Server Suite/Applications/Translator/Properties/AssemblyInfo.cs 2008-01-04 23:10:04 UTC (rev 1206) @@ -33,8 +33,8 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.4.0")] -[assembly: AssemblyFileVersion("1.0.4.0")] +[assembly: AssemblyVersion("1.0.4.1")] +[assembly: AssemblyFileVersion("1.0.4.1")] [assembly: CLSCompliant(true)] Modified: trunk/plugins/IR Server Suite/Applications/Tray Launcher/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Tray Launcher/Properties/AssemblyInfo.cs 2008-01-04 23:08:43 UTC (rev 1205) +++ trunk/plugins/IR Server Suite/Applications/Tray Launcher/Properties/AssemblyInfo.cs 2008-01-04 23:10:04 UTC (rev 1206) @@ -33,8 +33,8 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.4.0")] -[assembly: AssemblyFileVersion("1.0.4.0")] +[assembly: AssemblyVersion("1.0.4.1")] +[assembly: AssemblyFileVersion("1.0.4.1")] [assembly: CLSCompliant(true)] [assembly: GuidAttribute("2011f0d4-cec8-43d2-8678-79f24cd6c517")] Modified: trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs 2008-01-04 23:08:43 UTC (rev 1205) +++ trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs 2008-01-04 23:10:04 UTC (rev 1206) @@ -124,7 +124,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); MessageBox.Show("Failed to start IR Server communications, refer to log file for more details.", "Tray Launcher - Error", MessageBoxButtons.OK, MessageBoxIcon.Error); clientStarted = false; } @@ -145,7 +145,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); } return false; @@ -178,7 +178,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); _autoRun = false; } @@ -195,7 +195,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); _serverHost = "localhost"; _programFile = String.Empty; @@ -214,7 +214,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); } try @@ -238,7 +238,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); } } @@ -427,11 +427,11 @@ catch (Win32Exception ex) { if (ex.ErrorCode != -2147467259) // Ignore "Unable to enumerate the process modules" errors. - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); } } @@ -458,7 +458,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); MessageBox.Show(ex.Message, "Tray Launcher", MessageBoxButtons.OK, MessageBoxIcon.Error); } } Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs 2008-01-04 23:08:43 UTC (rev 1205) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs 2008-01-04 23:10:04 UTC (rev 1206) @@ -123,7 +123,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); } } @@ -159,6 +159,7 @@ } catch (Exception ex) { + IrssLog.Error(ex); MessageBox.Show(this, ex.Message, "Virtual Remote - Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } @@ -208,6 +209,7 @@ } catch (Exception ex) { + IrssLog.Error(ex); MessageBox.Show(this, ex.Message, "Failed to load help", MessageBoxButtons.OK, MessageBoxIcon.Error); } } Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs 2008-01-04 23:08:43 UTC (rev 1205) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs 2008-01-04 23:10:04 UTC (rev 1206) @@ -184,7 +184,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); clientStarted = false; } @@ -223,7 +223,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); _installFolder = "."; } @@ -236,7 +236,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); _serverHost = "localhost"; _remoteSkin = DefaultSkin; @@ -268,7 +268,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); } } @@ -403,7 +403,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); } } Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote/Properties/AssemblyInfo.cs 2008-01-04 23:08:43 UTC (rev 1205) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote/Properties/AssemblyInfo.cs 2008-01-04 23:10:04 UTC (rev 1206) @@ -33,8 +33,8 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.4.0")] -[assembly: AssemblyFileVersion("1.0.4.0")] +[assembly: AssemblyVersion("1.0.4.1")] +[assembly: AssemblyFileVersion("1.0.4.1")] [assembly: CLSCompliant(true)] [assembly: GuidAttribute("b9084277-405c-48e6-80d1-c0d0e1dae27d")] Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs 2008-01-04 23:08:43 UTC (rev 1205) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs 2008-01-04 23:10:04 UTC (rev 1206) @@ -135,6 +135,7 @@ } catch (Exception ex) { + IrssLog.Error(ex); MessageBox.Show(this, ex.Message, "Failed to load help", MessageBoxButtons.OK, MessageBoxIcon.Error); } } @@ -485,7 +486,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); _serverHost = "localhost"; } @@ -510,7 +511,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); } } @@ -610,6 +611,7 @@ } catch (Exception ex) { + IrssLog.Error(ex); MessageBox.Show(this, ex.Message, "Virtual Remote Skin Editor Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/Properties/AssemblyInfo.cs 2008-01-04 23:08:43 UTC (rev 1205) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/Properties/AssemblyInfo.cs 2008-01-04 23:10:04 UTC (rev 1206) @@ -30,7 +30,7 @@ // Build Number // Revision // -[assembly: AssemblyVersion("1.0.4.0")] -[assembly: AssemblyFileVersion("1.0.4.0")] +[assembly: AssemblyVersion("1.0.4.1")] +[assembly: AssemblyFileVersion("1.0.4.1")] [assembly: CLSCompliant(true)] \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Applications/Web Remote/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Web Remote/Program.cs 2008-01-04 23:08:43 UTC (rev 1205) +++ trunk/plugins/IR Server Suite/Applications/Web Remote/Program.cs 2008-01-04 23:10:04 UTC (rev 1206) @@ -136,7 +136,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); clientStarted = false; } @@ -161,7 +161,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); } _notifyIcon.Visible = true; @@ -239,8 +239,8 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); - MessageBox.Show(ex.ToString(), "Web Remote - Setup Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + IrssLog.Error(ex); + MessageBox.Show(ex.Message, "Web Remote - Setup Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } _inConfiguration = false; @@ -378,7 +378,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); _installFolder = "."; } @@ -391,7 +391,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); _serverHost = "localhost"; _remoteSkin = DefaultSkin; @@ -429,7 +429,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); } } @@ -535,7 +535,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); } } Modified: trunk/plugins/IR Server Suite/Applications/Web Remote/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Web Remote/Properties/AssemblyInfo.cs 2008-01-04 23:08:43 UTC (rev 1205) +++ trunk/plugins/IR Server Suite/Applications/Web Remote/Properties/AssemblyInfo.cs 2008-01-04 23:10:04 UTC (rev 1206) @@ -29,5 +29,5 @@ // Build Number // Revision // -[assembly: AssemblyVersion("1.0.4.0")] -[assembly: AssemblyFileVersion("1.0.4.0")] +[assembly: AssemblyVersion("1.0.4.1")] +[assembly: AssemblyFileVersion("1.0.4.1")] Modified: trunk/plugins/IR Server Suite/Applications/Web Remote/Setup.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Web Remote/Setup.cs 2008-01-04 23:08:43 UTC (rev 1205) +++ trunk/plugins/IR Server Suite/Applications/Web Remote/Setup.cs 2008-01-04 23:10:04 UTC (rev 1206) @@ -113,7 +113,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.Message); + IrssLog.Error(ex); } } Modified: trunk/plugins/IR Server Suite/Applications/Web Remote/WebServer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Web Remote/WebServer.cs 2008-01-04 23:08:43 UTC (rev 1205) +++ trunk/plugins/IR Server Suite/Applications/Web Remote/WebServer.cs 2008-01-04 23:10:04 UTC (rev 1206) @@ -119,7 +119,7 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); + IrssLog.Error(ex); } finally { Modified: trunk/plugins/IR Server Suite/Common/IrssComms/Client.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssComms/Client.cs 2008-01-04 23:08:43 UTC (rev 1205) +++ trunk/plugins/IR Server Suite/Common/IrssComms/Client.cs 2008-01-04 23:10:04 UTC (rev 1206) @@ -134,7 +134,7 @@ /// <summary> /// Start the client communications. /// </summary> - /// <returns>true if successful, otherwise false.</returns> + /// <returns><c>true</c> if successful, otherwise <c>false</c>.</returns> public bool Start() { if (_processConnectionThread) @@ -194,7 +194,7 @@ /// Send a message to the server. /// </summary> /// <param name="message">Message to send.</param> - /// <returns>true if successful, otherwise false.</returns> + /// <returns><c>true</c> if successful, otherwise <c>false</c>.</returns> public bool Send(IrssMessage message) { if (message == null) Modified: trunk/plugins/IR Server Suite/Common/IrssComms/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssComms/Properties/AssemblyInfo.cs 2008-01-04 23:08:43 UTC (rev 1205) +++ trunk/plugins/IR Server Suite/Common/IrssComms/Properties/AssemblyInfo.cs 2008-01-04 23:10:04 UTC (rev 1206) @@ -33,8 +33,8 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.4.0")] -[assembly: AssemblyFileVersion("1.0.4.0")] +[assembly: AssemblyVersion("1.0.4.1")] +[assembly: AssemblyFileVersion("1.0.4.1")] [assembly: CLSCompliant(true)] Modified: trunk/plugins/IR Server Suite/Common/IrssComms/Server.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssComms/Server.cs 2008-01-04 23:08:43 UTC (rev 1205) +++ trunk/plugins/IR Server Suite/Common/IrssComms/Server.cs 2008-01-04 23:10:04 UTC (rev 1206) @@ -125,7 +125,7 @@ /// <summary> /// Start the server. /// </summary> - /// <returns>true if successful, otherwise false.</returns> + /// <returns><c>true</c> if successful, otherwise <c>false</c>.</returns> public bool Start() { if (_processConnectionThread) @@ -215,7 +215,7 @@ /// </summary> /// <param name="sendTo">Client to send to.</param> /// <param name="message">Message to send.</param> - /// <returns>true if successful, otherwise false.</returns> + /// <returns><c>true</c> if successful, otherwise <c>false</c>.</returns> public bool Send(ClientManager sendTo, IrssMessage message) { if (!_clientManagers.Contains(sendTo)) Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/IrssLog.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/IrssLog.cs 2008-01-04 23:08:43 UTC (rev 1205) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/IrssLog.cs 2008-01-04 23:10:04 UTC (rev 1206) @@ -208,13 +208,31 @@ /// <summary> /// Log an Error. /// </summary> + /// <param name="ex">Exception to log.</param> + public static void Error(Exception ex) + { + if (_streamWriter != null && _logLevel >= Level.Error) + { + string message = String.Format("{0:yyyy-MM-dd HH:mm:ss.ffffff} - Error:\t{1}", DateTime.Now, ex.ToString()); + + _streamWriter.WriteLine(message); +#if TRACE + Trace.WriteLine(message); +#endif + } + } + + /// <summary> + /// Log an Error. + /// </summary> /// <param name="format">String format.</param> /// <param name="args">String format arguments.</param> public static void Error(string format, params object[] args) { if (_streamWriter != null && _logLevel >= Level.Error) { - string message = DateTime... [truncated message content] |
From: <an...@us...> - 2008-04-04 15:50:01
|
Revision: 1603 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1603&view=rev Author: and-81 Date: 2008-04-04 08:49:58 -0700 (Fri, 04 Apr 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/MediaPortalCommands.csproj trunk/plugins/IR Server Suite/Common/ShellLink/ShellLink.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Imon Receiver/Imon Receiver.cs Modified: trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/MediaPortalCommands.csproj =================================================================== --- trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/MediaPortalCommands.csproj 2008-04-04 12:43:01 UTC (rev 1602) +++ trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/MediaPortalCommands.csproj 2008-04-04 15:49:58 UTC (rev 1603) @@ -10,7 +10,7 @@ <RootNamespace>Commands.MediaPortal</RootNamespace> <AssemblyName>MediaPortalCommands</AssemblyName> <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent> - <SignAssembly>true</SignAssembly> + <SignAssembly>false</SignAssembly> <AssemblyOriginatorKeyFile>..\..\IR Server Suite.snk</AssemblyOriginatorKeyFile> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> Modified: trunk/plugins/IR Server Suite/Common/ShellLink/ShellLink.csproj =================================================================== --- trunk/plugins/IR Server Suite/Common/ShellLink/ShellLink.csproj 2008-04-04 12:43:01 UTC (rev 1602) +++ trunk/plugins/IR Server Suite/Common/ShellLink/ShellLink.csproj 2008-04-04 15:49:58 UTC (rev 1603) @@ -66,7 +66,7 @@ <Optimize>true</Optimize> <RegisterForComInterop>false</RegisterForComInterop> <RemoveIntegerChecks>false</RemoveIntegerChecks> - <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <TreatWarningsAsErrors>false</TreatWarningsAsErrors> <WarningLevel>4</WarningLevel> <DebugType>none</DebugType> <ErrorReport>prompt</ErrorReport> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Imon Receiver/Imon Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Imon Receiver/Imon Receiver.cs 2008-04-04 12:43:01 UTC (rev 1602) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Imon Receiver/Imon Receiver.cs 2008-04-04 15:49:58 UTC (rev 1603) @@ -623,7 +623,29 @@ break; case 0xCE: // MCE Keyboard mouse report - //MouseEvent(0, 0, false, false); + int x = 0; + int y = 0; + bool right = false; + bool left = false; + /* + if (dataBytes[2] & 0x20 != 0) x |= 1 << 7; // sign bit + if (dataBytes[2] & 0x80 != 0) x |= 1 << 4; + if (dataBytes[2] & 0x40 != 0) x |= 1 << 3; + if (dataBytes[3] & 0x08 != 0) x |= 1 << 2; + if (dataBytes[3] & 0x04 != 0) x |= 1 << 1; + if (dataBytes[3] & 0x02 != 0) x |= 1; + + if (dataBytes[1] & 0x10 != 0) y |= 1 << 7; // sign bit + if (dataBytes[1] & 0x20 != 0) y |= 1 << 4; + if (dataBytes[2] & 0x08 != 0) y |= 1 << 3; + if (dataBytes[2] & 0x04 != 0) y |= 1 << 2; + if (dataBytes[2] & 0x02 != 0) y |= 1 << 1; + if (dataBytes[2] & 0x01 != 0) y |= 1; + */ + //if (dataBytes[1] & 0x80 != 0) right = true; + //if (dataBytes[1] & 0x40 != 0) left = true; + + MouseEvent(x, y, right, left); break; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-09-18 06:39:01
|
Revision: 935 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=935&view=rev Author: and-81 Date: 2007-09-17 23:38:59 -0700 (Mon, 17 Sep 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Debug Client/Debug Client.csproj trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs trunk/plugins/IR Server Suite/Applications/IR Blast/IR Blast.csproj trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/IR Blast (No Window).csproj trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs trunk/plugins/IR Server Suite/Applications/IR Server/IR Server.csproj 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/ButtonMappingForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/GetKeyCodeForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/LearnIR.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/Translator/Translator.csproj trunk/plugins/IR Server Suite/Applications/Tray Launcher/GetKeyCodeForm.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/Setup.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray Launcher.csproj trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.Designer.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/Virtual Remote.csproj trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/Virtual Remote Skin Editor.csproj trunk/plugins/IR Server Suite/Common/IrssComms/Client.cs trunk/plugins/IR Server Suite/Common/IrssComms/ClientManager.cs trunk/plugins/IR Server Suite/Common/IrssComms/IrssComms.csproj trunk/plugins/IR Server Suite/Common/IrssComms/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Common/IrssComms/Server.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Win32.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Pronto.cs trunk/plugins/IR Server Suite/IR Server Suite.sln trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/LearnIR.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/SetupForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MP Blast Zone Plugin.csproj trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MPBlastZonePlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/LearnIR.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MP Control Plugin.csproj trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/LearnIR.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/SetupForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2 Blaster Plugin.csproj trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/LearnIR.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/PluginSetup.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3 Blaster Plugin.csproj trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs Added Paths: ----------- trunk/plugins/IR Server Suite/Common/IrssComms/GenericMessageQueue.cs trunk/plugins/IR Server Suite/Common/IrssComms/IrssMessage.cs trunk/plugins/IR Server Suite/Common/IrssComms/MessageManagerCombo.cs Removed Paths: ------------- trunk/plugins/IR Server Suite/Applications/IR Server/Client.cs trunk/plugins/IR Server Suite/IPC/ Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/Debug Client.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/Debug Client.csproj 2007-09-16 18:08:48 UTC (rev 934) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/Debug Client.csproj 2007-09-18 06:38:59 UTC (rev 935) @@ -77,22 +77,14 @@ <Content Include="Icon.ico" /> </ItemGroup> <ItemGroup> + <ProjectReference Include="..\..\Common\IrssComms\IrssComms.csproj"> + <Project>{BCAFDF45-70DD-46FD-8B98-880DDA585AD2}</Project> + <Name>IrssComms</Name> + </ProjectReference> <ProjectReference Include="..\..\Common\irssUtils\IrssUtils.csproj"> <Project>{CA15769C-232E-4CA7-94FD-206A06CA3ABB}</Project> <Name>IrssUtils</Name> </ProjectReference> - <ProjectReference Include="..\..\IPC\AppModule.InterProcessComm\AppModule.InterProcessComm.csproj"> - <Project>{E98F1F7E-40B6-44C8-AC66-EC867B141FA1}</Project> - <Name>AppModule.InterProcessComm</Name> - </ProjectReference> - <ProjectReference Include="..\..\IPC\AppModule.NamedPipes\AppModule.NamedPipes.csproj"> - <Project>{077B53BB-404A-4B2F-BA17-AAE98C5E9C66}</Project> - <Name>AppModule.NamedPipes</Name> - </ProjectReference> - <ProjectReference Include="..\..\IPC\Named Pipes\Named Pipes.csproj"> - <Project>{F4EA6055-7133-4F18-8971-E19ADEB482C1}</Project> - <Name>Named Pipes</Name> - </ProjectReference> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-09-16 18:08:48 UTC (rev 934) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-09-18 06:38:59 UTC (rev 935) @@ -6,13 +6,15 @@ using System.Diagnostics; using System.Drawing; using System.IO; +using System.Net; +using System.Net.Sockets; using System.Runtime.InteropServices; using System.Security; using System.Text; using System.Threading; using System.Windows.Forms; -using NamedPipes; +using IrssComms; using IrssUtils; namespace DebugClient @@ -91,8 +93,6 @@ public MainForm() { InitializeComponent(); - - _messageQueue = new MessageQueue(new MessageQueueSink(ReceivedMessage)); } #endregion @@ -105,23 +105,20 @@ #region Variables - MessageQueue _messageQueue; + Client _client = null; string _serverHost = Environment.MachineName; - string _localPipeName = null; string _learnIRFilename = null; bool _registered = false; - bool _keepAlive = true; int _echoID = -1; - Thread _keepAliveThread; IRServerInfo _irServerInfo = new IRServerInfo(); #endregion Variables delegate void DelegateAddStatusLine(string status); - DelegateAddStatusLine _AddStatusLine = null; + DelegateAddStatusLine _addStatusLine = null; void AddStatusLine(string status) { @@ -137,7 +134,7 @@ IrssLog.LogLevel = IrssLog.Level.Debug; IrssLog.Open(Common.FolderIrssLogs + "Debug Client.log"); - _AddStatusLine = new DelegateAddStatusLine(AddStatusLine); + _addStatusLine = new DelegateAddStatusLine(AddStatusLine); comboBoxRemoteButtons.Items.AddRange(Enum.GetNames(typeof(MceButton))); comboBoxRemoteButtons.SelectedIndex = 0; @@ -157,23 +154,22 @@ { buttonDisconnect_Click(null, null); - _AddStatusLine = null; + _addStatusLine = null; IrssLog.Close(); } - void ReceivedMessage(string message) + void ReceivedMessage(IrssMessage received) { - PipeMessage received = PipeMessage.FromString(message); - this.Invoke(_AddStatusLine, new Object[] { String.Format("Received Message: \"{0}, {1}\"", received.Type, received.Flags) }); + this.Invoke(_addStatusLine, new Object[] { String.Format("Received Message: \"{0}, {1}\"", received.Type, received.Flags) }); try { switch (received.Type) { - case PipeMessageType.RegisterClient: - if ((received.Flags & PipeMessageFlags.Success) == PipeMessageFlags.Success) + case MessageType.RegisterClient: + if ((received.Flags & MessageFlags.Success) == MessageFlags.Success) { _registered = true; _irServerInfo = IRServerInfo.FromBytes(received.DataAsBytes); @@ -181,18 +177,18 @@ comboBoxPort.Items.AddRange(_irServerInfo.Ports); comboBoxPort.SelectedIndex = 0; } - else if ((received.Flags & PipeMessageFlags.Failure) == PipeMessageFlags.Failure) + else if ((received.Flags & MessageFlags.Failure) == MessageFlags.Failure) { _registered = false; } return; - case PipeMessageType.RemoteEvent: + case MessageType.RemoteEvent: RemoteHandlerCallback(received.DataAsString); return; - case PipeMessageType.LearnIR: - if ((received.Flags & PipeMessageFlags.Success) == PipeMessageFlags.Success) + case MessageType.LearnIR: + if ((received.Flags & MessageFlags.Success) == MessageFlags.Success) { byte[] dataBytes = received.DataAsBytes; @@ -204,23 +200,23 @@ _learnIRFilename = null; break; - case PipeMessageType.ServerShutdown: + case MessageType.ServerShutdown: _registered = false; return; - case PipeMessageType.Echo: + case MessageType.Echo: _echoID = BitConverter.ToInt32(received.DataAsBytes, 0); return; - case PipeMessageType.Error: + case MessageType.Error: _learnIRFilename = null; - this.Invoke(_AddStatusLine, new Object[] { received.DataAsString }); + this.Invoke(_addStatusLine, new Object[] { received.DataAsString }); return; } } catch (Exception ex) { - this.Invoke(_AddStatusLine, new Object[] { ex.Message }); + this.Invoke(_addStatusLine, new Object[] { ex.Message }); } } @@ -232,14 +228,15 @@ return false; _learnIRFilename = fileName; - - PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.LearnIR, PipeMessageFlags.Request); - PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message); + IrssMessage message = new IrssMessage(MessageType.LearnIR, MessageFlags.Request); + _client.Send(message); + AddStatusLine("Learning"); } catch (Exception ex) { + _learnIRFilename = null; AddStatusLine(ex.Message); return false; } @@ -253,7 +250,7 @@ if (!File.Exists(fileName)) return false; - FileStream file = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); + FileStream file = new FileStream(fileName, FileMode.Open); byte[] outData = new byte[4 + port.Length + file.Length]; @@ -263,8 +260,8 @@ file.Read(outData, 4 + port.Length, (int)file.Length); file.Close(); - PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.BlastIR, PipeMessageFlags.Request, outData); - PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message); + IrssMessage message = new IrssMessage(MessageType.BlastIR, MessageFlags.Request, outData); + _client.Send(message); } catch (Exception ex) { @@ -278,238 +275,67 @@ { string text = String.Format("Remote Event \"{0}\"", keyCode); - this.Invoke(_AddStatusLine, new Object[] { text }); + this.Invoke(_addStatusLine, new Object[] { text }); } - bool StartComms() + void CommsFailure(object obj) { - try - { - if (OpenLocalPipe()) - { - _messageQueue.Start(); + Exception ex = obj as Exception; + + if (ex != null) + this.Invoke(_addStatusLine, new Object[] { String.Format("Communications failure: {0}", ex.Message) }); + else + this.Invoke(_addStatusLine, new Object[] { "Communications failure" }); - _keepAliveThread = new Thread(new ThreadStart(KeepAliveThread)); - _keepAliveThread.Start(); - return true; - } - } - catch (Exception ex) - { - IrssLog.Error(ex.ToString()); - } + StopClient(); + } + void Connected(object obj) + { + IrssLog.Info("Connected to server"); - return false; + IrssMessage message = new IrssMessage(MessageType.RegisterClient, MessageFlags.Request); + _client.Send(message); } - void StopComms() + void Disconnected(object obj) { - _keepAlive = false; + IrssLog.Warn("Communications with server has been lost"); - try - { - if (_keepAliveThread != null && _keepAliveThread.IsAlive) - _keepAliveThread.Abort(); - } - catch { } - - try - { - if (_registered) - { - _registered = false; - - PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.UnregisterClient, PipeMessageFlags.Request); - PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message); - } - } - catch { } - - _messageQueue.Stop(); - - try - { - if (PipeAccess.ServerRunning) - PipeAccess.StopServer(); - } - catch { } + Thread.Sleep(1000); } - bool OpenLocalPipe() + bool StartClient() { - try - { - int pipeNumber = 1; - bool retry = false; + if (_client != null) + return false; - do - { - string localPipeTest = String.Format("irserver\\debug{0:00}", pipeNumber); + ClientMessageSink sink = new ClientMessageSink(ReceivedMessage); - if (PipeAccess.PipeExists(Common.LocalPipePrefix + localPipeTest)) - { - if (++pipeNumber <= Common.MaximumLocalClientCount) - retry = true; - else - throw new Exception(String.Format("Maximum local client limit ({0}) reached", Common.MaximumLocalClientCount)); - } - else - { - if (!PipeAccess.StartServer(localPipeTest, new PipeMessageHandler(_messageQueue.Enqueue))) - throw new Exception(String.Format("Failed to start local pipe server \"{0}\"", localPipeTest)); + IPAddress serverAddress = Client.GetIPFromName(_serverHost); - _localPipeName = localPipeTest; - retry = false; - } - } - while (retry); - - return true; - } - catch (Exception ex) + _client = new Client(serverAddress, 24000, sink); + _client.CommsFailureCallback = new WaitCallback(CommsFailure); + _client.ConnectCallback = new WaitCallback(Connected); + _client.DisconnectCallback = new WaitCallback(Disconnected); + + if (_client.Start()) { - IrssLog.Error(ex.ToString()); - return false; - } - } - - bool ConnectToServer() - { - try - { - PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.RegisterClient, PipeMessageFlags.Request); - PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message); return true; } - catch (AppModule.NamedPipes.NamedPipeIOException) + else { + _client = null; return false; } - catch (Exception ex) - { - IrssLog.Error(ex.ToString()); - return false; - } } - - void KeepAliveThread() + void StopClient() { - Random random = new Random((int)DateTime.Now.Ticks); - bool reconnect; - int attempt; + if (_client == null) + return; - _registered = false; - _keepAlive = true; - while (_keepAlive) - { - reconnect = true; - - #region Connect to server - - IrssLog.Info("Connecting ({0}) ...", _serverHost); - attempt = 0; - while (_keepAlive && reconnect) - { - if (ConnectToServer()) - { - reconnect = false; - } - else - { - int wait; - - if (attempt <= 50) - attempt++; - - if (attempt > 50) - wait = 30; // 30 seconds - else if (attempt > 20) - wait = 10; // 10 seconds - else if (attempt > 10) - wait = 5; // 5 seconds - else - wait = 1; // 1 second - - for (int sleeps = 0; sleeps < wait && _keepAlive; sleeps++) - Thread.Sleep(1000); - } - } - - #endregion Connect to server - - #region Wait for registered - - // Give up after 10 seconds ... - attempt = 0; - while (_keepAlive && !_registered && !reconnect) - { - if (++attempt >= 10) - reconnect = true; - else - Thread.Sleep(1000); - } - - #endregion Wait for registered - - #region Ping the server repeatedly - - while (_keepAlive && _registered && !reconnect) - { - int pingID = random.Next(); - long pingTime = DateTime.Now.Ticks; - - try - { - PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.Ping, PipeMessageFlags.Request, BitConverter.GetBytes(pingID)); - PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message); - } - catch - { - // Failed to ping ... reconnect ... - IrssLog.Warn("Failed to ping, attempting to reconnect ..."); - _registered = false; - reconnect = true; - break; - } - - // Wait 10 seconds for a ping echo ... - bool receivedEcho = false; - while (_keepAlive && _registered && !reconnect && - !receivedEcho && DateTime.Now.Ticks - pingTime < 10 * 1000 * 10000) - { - if (_echoID == pingID) - { - receivedEcho = true; - } - else - { - Thread.Sleep(1000); - } - } - - if (receivedEcho) // Received ping echo ... - { - // 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 to ping, attempting to reconnect ..."); - - // Break out of pinging cycle ... - _registered = false; - reconnect = true; - } - } - - #endregion Ping the server repeatedly - - } - + _client.Stop(); + _client = null; } - - #region Controls private void buttonConnect_Click(object sender, EventArgs e) @@ -519,15 +345,15 @@ AddStatusLine("Connect"); listBoxStatus.Update(); - if (PipeAccess.ServerRunning) + if (_client != null) { - AddStatusLine("Already connected"); + AddStatusLine("Already connected/connecting"); return; } _serverHost = comboBoxComputer.Text; - StartComms(); + StartClient(); } catch (Exception ex) { @@ -540,13 +366,19 @@ try { - if (!PipeAccess.ServerRunning) + if (_client == null) { AddStatusLine(" - Not connected"); return; } - StopComms(); + if (_registered) + { + IrssMessage message = new IrssMessage(MessageType.UnregisterClient, MessageFlags.Request); + _client.Send(message); + } + + StopClient(); } catch (Exception ex) { @@ -555,56 +387,78 @@ } private void buttonBlast_Click(object sender, EventArgs e) { - if (!PipeAccess.ServerRunning) + AddStatusLine("Blast IR"); + + if (_client == null) { - AddStatusLine("Not connected"); + AddStatusLine(" - Not connected"); return; } + if (!_client.Connected) + { + AddStatusLine(" - Connecting..."); + return; + } + if (!_irServerInfo.CanTransmit) { - AddStatusLine("IR Server is not setup to blast"); + AddStatusLine(" - IR Server is not setup to blast"); return; } if (BlastIR(DebugIRFile, comboBoxPort.SelectedItem as string)) - AddStatusLine("Blasting"); + AddStatusLine(" - Blasting ..."); else - AddStatusLine("Can't Blast"); + AddStatusLine(" - Can't Blast"); } private void buttonLearnIR_Click(object sender, EventArgs e) { - if (!PipeAccess.ServerRunning) + AddStatusLine("Learn IR"); + + if (_client == null) { - AddStatusLine("Not connected"); + AddStatusLine(" - Not connected"); return; } + if (!_client.Connected) + { + AddStatusLine(" - Connecting..."); + return; + } + if (!_irServerInfo.CanLearn) { - AddStatusLine("IR Server is not setup to support learning"); + AddStatusLine(" - IR Server is not setup to support learning"); return; } if (LearnIR(DebugIRFile)) - AddStatusLine("Learning IR"); + AddStatusLine(" - Learning IR ..."); else - AddStatusLine("Learn IR Busy"); + AddStatusLine(" - Learn IR Busy"); } private void buttonShutdownServer_Click(object sender, EventArgs e) { AddStatusLine("Shutdown"); - if (!PipeAccess.ServerRunning) + if (_client == null) { AddStatusLine(" - Not connected"); return; } + if (!_client.Connected) + { + AddStatusLine(" - Connecting..."); + return; + } + try { - PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.ServerShutdown, PipeMessageFlags.Request); - PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message); + IrssMessage message = new IrssMessage(MessageType.ServerShutdown, MessageFlags.Request); + _client.Send(message); } catch (Exception ex) { @@ -615,16 +469,22 @@ { AddStatusLine("Ping Server"); - if (!PipeAccess.ServerRunning) + if (_client == null) { AddStatusLine(" - Not connected"); return; } + if (!_client.Connected) + { + AddStatusLine(" - Connecting..."); + return; + } + try { - PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.Ping, PipeMessageFlags.Request, BitConverter.GetBytes(24)); - PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message); + IrssMessage message = new IrssMessage(MessageType.Ping, MessageFlags.Request, BitConverter.GetBytes(24)); + _client.Send(message); } catch (Exception ex) { @@ -635,13 +495,9 @@ private void comboBoxRemoteButtons_SelectedIndexChanged(object sender, EventArgs e) { if (comboBoxRemoteButtons.SelectedItem.ToString() == "Custom") - { numericUpDownButton.Enabled = true; - } else - { numericUpDownButton.Enabled = false; - } } private void buttonSendRemoteButton_Click(object sender, EventArgs e) @@ -650,23 +506,24 @@ try { - if (!PipeAccess.ServerRunning) + if (_client == null) { AddStatusLine(" - Not connected"); return; } + if (!_client.Connected) + { + AddStatusLine(" - Connecting..."); + return; + } + int keyCode = (int)Enum.Parse(typeof(MceButton), comboBoxRemoteButtons.SelectedItem.ToString(), true); if (keyCode == -1) keyCode = Decimal.ToInt32(numericUpDownButton.Value); - byte[] data = new byte[8]; - - BitConverter.GetBytes(keyCode).CopyTo(data, 0); - BitConverter.GetBytes(0).CopyTo(data, 4); - - PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.ForwardRemoteEvent, PipeMessageFlags.Notify, data); - PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message); + IrssMessage message = new IrssMessage(MessageType.ForwardRemoteEvent, MessageFlags.Notify, keyCode.ToString()); + _client.Send(message); } catch (Exception ex) { @@ -688,8 +545,6 @@ #endregion Controls - - Thread AutoTest; private void buttonAutoTest_Click(object sender, EventArgs e) @@ -713,7 +568,7 @@ { randomNumber = rand.Next(100000); - this.Invoke(_AddStatusLine, new Object[] { String.Format("AutoTest: {0}", randomNumber) }); + this.Invoke(_addStatusLine, new Object[] { String.Format("AutoTest: {0}", randomNumber) }); process.StartInfo.Arguments = "-host localhost -pad 4 -channel " + randomNumber.ToString(); Modified: trunk/plugins/IR Server Suite/Applications/IR Blast/IR Blast.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast/IR Blast.csproj 2007-09-16 18:08:48 UTC (rev 934) +++ trunk/plugins/IR Server Suite/Applications/IR Blast/IR Blast.csproj 2007-09-18 06:38:59 UTC (rev 935) @@ -63,22 +63,14 @@ <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> <ItemGroup> + <ProjectReference Include="..\..\Common\IrssComms\IrssComms.csproj"> + <Project>{BCAFDF45-70DD-46FD-8B98-880DDA585AD2}</Project> + <Name>IrssComms</Name> + </ProjectReference> <ProjectReference Include="..\..\Common\irssUtils\IrssUtils.csproj"> <Project>{CA15769C-232E-4CA7-94FD-206A06CA3ABB}</Project> <Name>IrssUtils</Name> </ProjectReference> - <ProjectReference Include="..\..\IPC\AppModule.InterProcessComm\AppModule.InterProcessComm.csproj"> - <Project>{E98F1F7E-40B6-44C8-AC66-EC867B141FA1}</Project> - <Name>AppModule.InterProcessComm</Name> - </ProjectReference> - <ProjectReference Include="..\..\IPC\AppModule.NamedPipes\AppModule.NamedPipes.csproj"> - <Project>{077B53BB-404A-4B2F-BA17-AAE98C5E9C66}</Project> - <Name>AppModule.NamedPipes</Name> - </ProjectReference> - <ProjectReference Include="..\..\IPC\Named Pipes\Named Pipes.csproj"> - <Project>{F4EA6055-7133-4F18-8971-E19ADEB482C1}</Project> - <Name>Named Pipes</Name> - </ProjectReference> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Modified: trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2007-09-16 18:08:48 UTC (rev 934) +++ trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2007-09-18 06:38:59 UTC (rev 935) @@ -4,11 +4,13 @@ using System.ComponentModel; using System.Data; using System.IO; +using System.Net; +using System.Net.Sockets; using System.Text; using System.Threading; using System.Xml; -using NamedPipes; +using IrssComms; using IrssUtils; namespace IRBlast @@ -19,17 +21,14 @@ #region Variables - static MessageQueue _messageQueue; + static Client _client = null; static bool _registered = false; - static bool _keepAlive = true; static int _echoID = -1; - static Thread _keepAliveThread; static string _serverHost = null; - static string _localPipeName; - static string _blastPort = "None"; + static string _blastPort = "Default"; static bool _treatAsChannelNumber = false; static int _padChannelNumber = 0; @@ -81,8 +80,6 @@ } } - _messageQueue = new MessageQueue(new MessageQueueSink(ReceivedMessage)); - if (String.IsNullOrEmpty(_serverHost) || irCommands.Count == 0) { Console.WriteLine("Malformed command line parameters ..."); @@ -90,7 +87,7 @@ ShowHelp(); } - else if (StartComms()) + else if (StartClient()) { Thread.Sleep(250); @@ -166,7 +163,7 @@ Error(ex); } - StopComms(); + StopClient(); IrssLog.Close(); } @@ -218,274 +215,103 @@ Console.WriteLine(""); } - static bool StartComms() + static void CommsFailure(object obj) { - try - { - if (OpenLocalPipe()) - { - _messageQueue.Start(); + Exception ex = obj as Exception; + + if (ex != null) + IrssLog.Error("Communications failure: {0}", ex.Message); + else + IrssLog.Error("Communications failure"); - _keepAliveThread = new Thread(new ThreadStart(KeepAliveThread)); - _keepAliveThread.Start(); - return true; - } - } - catch (Exception ex) - { - Error(ex); - } + StopClient(); + } + static void Connected(object obj) + { + IrssLog.Info("Connected to server"); - return false; + IrssMessage message = new IrssMessage(MessageType.RegisterClient, MessageFlags.Request); + _client.Send(message); } - static void StopComms() + static void Disconnected(object obj) { - _keepAlive = false; + IrssLog.Warn("Communications with server has been lost"); - try - { - if (_keepAliveThread != null && _keepAliveThread.IsAlive) - _keepAliveThread.Abort(); - } - catch { } - - try - { - if (_registered) - { - _registered = false; - - PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.UnregisterClient, PipeMessageFlags.Request); - PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message); - } - } - catch { } - - _messageQueue.Stop(); - - try - { - if (PipeAccess.ServerRunning) - PipeAccess.StopServer(); - } - catch { } + Thread.Sleep(1000); } - static bool OpenLocalPipe() + static bool StartClient() { - try - { - int pipeNumber = 1; - bool retry = false; + if (_client != null) + return false; - do - { - string localPipeTest = String.Format("irserver\\blast{0:00}", pipeNumber); + ClientMessageSink sink = new ClientMessageSink(ReceivedMessage); - if (PipeAccess.PipeExists(Common.LocalPipePrefix + localPipeTest)) - { - if (++pipeNumber <= Common.MaximumLocalClientCount) - retry = true; - else - throw new Exception(String.Format("Maximum local client limit ({0}) reached", Common.MaximumLocalClientCount)); - } - else - { - if (!PipeAccess.StartServer(localPipeTest, new PipeMessageHandler(_messageQueue.Enqueue))) - throw new Exception(String.Format("Failed to start local pipe server \"{0}\"", localPipeTest)); + IPAddress serverAddress = Client.GetIPFromName(_serverHost); - _localPipeName = localPipeTest; - retry = false; - } - } - while (retry); - - return true; - } - catch (Exception ex) + _client = new Client(serverAddress, 24000, sink); + _client.CommsFailureCallback = new WaitCallback(CommsFailure); + _client.ConnectCallback = new WaitCallback(Connected); + _client.DisconnectCallback = new WaitCallback(Disconnected); + + if (_client.Start()) { - Error(ex); - return false; - } - } - - static bool ConnectToServer() - { - try - { - PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.RegisterClient, PipeMessageFlags.Request); - PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message); return true; } - catch (AppModule.NamedPipes.NamedPipeIOException) + else { + _client = null; return false; } - catch (Exception ex) - { - Error(ex); - return false; - } } - - static void KeepAliveThread() + static void StopClient() { - Random random = new Random((int)DateTime.Now.Ticks); - bool reconnect; - int attempt; + if (_client == null) + return; - _registered = false; - _keepAlive = true; - while (_keepAlive) - { - reconnect = true; - - #region Connect to server - - Info("Connecting ({0}) ...", _serverHost); - attempt = 0; - while (_keepAlive && reconnect) - { - if (ConnectToServer()) - { - reconnect = false; - } - else - { - int wait; - - if (attempt <= 50) - attempt++; - - if (attempt > 50) - wait = 30; // 30 seconds - else if (attempt > 20) - wait = 10; // 10 seconds - else if (attempt > 10) - wait = 5; // 5 seconds - else - wait = 1; // 1 second - - for (int sleeps = 0; sleeps < wait && _keepAlive; sleeps++) - Thread.Sleep(1000); - } - } - - #endregion Connect to server - - #region Wait for registered - - // Give up after 10 seconds ... - attempt = 0; - while (_keepAlive && !_registered && !reconnect) - { - if (++attempt >= 10) - reconnect = true; - else - Thread.Sleep(1000); - } - - #endregion Wait for registered - - #region Ping the server repeatedly - - while (_keepAlive && _registered && !reconnect) - { - int pingID = random.Next(); - long pingTime = DateTime.Now.Ticks; - - try - { - PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.Ping, PipeMessageFlags.Request, BitConverter.GetBytes(pingID)); - PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message); - } - catch - { - // Failed to ping ... reconnect ... - Warn("Failed to ping, attempting to reconnect ..."); - _registered = false; - reconnect = true; - break; - } - - // Wait 10 seconds for a ping echo ... - bool receivedEcho = false; - while (_keepAlive && _registered && !reconnect && - !receivedEcho && DateTime.Now.Ticks - pingTime < 10 * 1000 * 10000) - { - if (_echoID == pingID) - { - receivedEcho = true; - } - else - { - Thread.Sleep(1000); - } - } - - if (receivedEcho) // Received ping echo ... - { - // Wait 60 seconds before re-pinging ... - for (int sleeps = 0; sleeps < 60 && _keepAlive && _registered; sleeps++) - Thread.Sleep(1000); - } - else // Didn't receive ping echo ... - { - Warn("No echo to ping, attempting to reconnect ..."); - - // Break out of pinging cycle ... - _registered = false; - reconnect = true; - } - } - - #endregion Ping the server repeatedly - - } - + _client.Stop(); + _client = null; } - static void ReceivedMessage(string message) + static void ReceivedMessage(IrssMessage received) { - PipeMessage received = PipeMessage.FromString(message); - IrssLog.Debug("Received Message \"{0}\"", received.Type); try { switch (received.Type) { - case PipeMessageType.BlastIR: - if ((received.Flags & PipeMessageFlags.Success) == PipeMessageFlags.Success) + case MessageType.BlastIR: + if ((received.Flags & MessageFlags.Success) == MessageFlags.Success) Info("Blast Success"); - else if ((received.Flags & PipeMessageFlags.Failure) == PipeMessageFlags.Failure) + else if ((received.Flags & MessageFlags.Failure) == MessageFlags.Failure) Warn("Blast Failed!"); break; - case PipeMessageType.RegisterClient: - if ((received.Flags & PipeMessageFlags.Success) == PipeMessageFlags.Success) + case MessageType.RegisterClient: + if ((received.Flags & MessageFlags.Success) == MessageFlags.Success) { Info("Registered to IR Server"); _registered = true; //_irServerInfo = TransceiverInfo.FromString(received.Data); } - else if ((received.Flags & PipeMessageFlags.Failure) == PipeMessageFlags.Failure) + else if ((received.Flags & MessageFlags.Failure) == MessageFlags.Failure) { _registered = false; Warn("IR Server refused to register"); } break; - case PipeMessageType.ServerShutdown: + case MessageType.ServerShutdown: _registered = false; Warn("IR Server Shutdown - Blasting disabled until IR Server returns"); break; - case PipeMessageType.Echo: + case MessageType.Echo: _echoID = BitConverter.ToInt32(received.DataAsBytes, 0); break; - case PipeMessageType.Error: + case MessageType.Error: Warn(received.DataAsString); break; } @@ -498,7 +324,7 @@ static void BlastIR(string fileName, string port) { - FileStream file = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); + FileStream file = new FileStream(fileName, FileMode.Open); byte[] outData = new byte[4 + port.Length + file.Length]; @@ -508,8 +334,8 @@ file.Read(outData, 4 + port.Length, (int)file.Length); file.Close(); - PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.BlastIR, PipeMessageFlags.Request | PipeMessageFlags.ForceNotRespond, outData); - PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message); + IrssMessage message = new IrssMessage(MessageType.BlastIR, MessageFlags.Request | MessageFlags.ForceNotRespond, outData); + _client.Send(message); } #region Log Commands Modified: trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/IR Blast (No Window).csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/IR Blast (No Window).csproj 2007-09-16 18:08:48 UTC (rev 934) +++ trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/IR Blast (No Window).csproj 2007-09-18 06:38:59 UTC (rev 935) @@ -64,22 +64,14 @@ <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> <ItemGroup> + <ProjectReference Include="..\..\Common\IrssComms\IrssComms.csproj"> + <Project>{BCAFDF45-70DD-46FD-8B98-880DDA585AD2}</Project> + <Name>IrssComms</Name> + </ProjectReference> <ProjectReference Include="..\..\Common\irssUtils\IrssUtils.csproj"> <Project>{CA15769C-232E-4CA7-94FD-206A06CA3ABB}</Project> <Name>IrssUtils</Name> </ProjectReference> - <ProjectReference Include="..\..\IPC\AppModule.InterProcessComm\AppModule.InterProcessComm.csproj"> - <Project>{E98F1F7E-40B6-44C8-AC66-EC867B141FA1}</Project> - <Name>AppModule.InterProcessComm</Name> - </ProjectReference> - <ProjectReference Include="..\..\IPC\AppModule.NamedPipes\AppModule.NamedPipes.csproj"> - <Project>{077B53BB-404A-4B2F-BA17-AAE98C5E9C66}</Project> - <Name>AppModule.NamedPipes</Name> - </ProjectReference> - <ProjectReference Include="..\..\IPC\Named Pipes\Named Pipes.csproj"> - <Project>{F4EA6055-7133-4F18-8971-E19ADEB482C1}</Project> - <Name>Named Pipes</Name> - </ProjectReference> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Modified: trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2007-09-16 18:08:48 UTC (rev 934) +++ trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2007-09-18 06:38:59 UTC (rev 935) @@ -4,12 +4,14 @@ using System.ComponentModel; using System.Data; using System.IO; +using System.Net; +using System.Net.Sockets; using System.Text; using System.Threading; using System.Windows.Forms; using System.Xml; -using NamedPipes; +using IrssComms; using IrssUtils; namespace IRBlast @@ -20,17 +22,14 @@ #region Variables - static MessageQueue _messageQueue; + static Client _client = null; static bool _registered = false; - static bool _keepAlive = true; static int _echoID = -1; - static Thread _keepAliveThread; static string _serverHost = null; - static string _localPipeName; - static string _blastPort = "None"; + static string _blastPort = "Default"; static bool _treatAsChannelNumber = false; static int _padChannelNumber = 0; @@ -80,8 +79,6 @@ } } - _messageQueue = new MessageQueue(new MessageQueueSink(ReceivedMessage)); - if (String.IsNullOrEmpty(_serverHost) || irCommands.Count == 0) { Console.WriteLine("Malformed command line parameters ..."); @@ -89,7 +86,7 @@ ShowHelp(); } - else if (StartComms()) + else if (StartClient()) { Thread.Sleep(250); @@ -165,7 +162,7 @@ IrssLog.Error(ex.ToString()); } - StopComms(); + StopClient(); IrssLog.Close(); } @@ -180,274 +177,103 @@ "IR Blast (No Window)", MessageBoxButtons.OK, MessageBoxIcon.Error); } - static bool StartComms() + static void CommsFailure(object obj) { - try - { - if (OpenLocalPipe()) - { - _messageQueue.Start(); + Exception ex = obj as Exception; + + if (ex != null) + IrssLog.Error("Communications failure: {0}", ex.Message); + else + IrssLog.Error("Communications failure"); - _keepAliveThread = new Thread(new ThreadStart(KeepAliveThread)); - _keepAliveThread.Start(); - return true; - } - } - catch (Exception ex) - { - IrssLog.Error(ex.ToString()); - } + StopClient(); + } + static void Connected(object obj) + { + IrssLog.Info("Connected to server"); - return false; + IrssMessage message = new IrssMessage(MessageType.RegisterClient, MessageFlags.Request); + _client.Send(message); } - static void StopComms() + static void Disconnected(object obj) { - _keepAlive = false; + IrssLog.Warn("Communications with server has been lost"); - try - { - if (_keepAliveThread != null && _keepAliveThread.IsAlive) - _keepAliveThread.Abort(); - } - catch { } - - try - { - if (_registered) - { - _registered = false; - - PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.UnregisterClient, PipeMessageFlags.Request); - PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message); - } - } - catch { } - - _messageQueue.Stop(); - - try - { - if (PipeAccess.ServerRunning) - PipeAccess.StopServer(); - } - catch { } + Thread.Sleep(1000); } - static bool OpenLocalPipe() + static bool StartClient() { - try - { - int pipeNumber = 1; - bool retry = false; + if (_client != null) + return false; - do - { - string localPipeTest = String.Format("irserver\\blast{0:00}", pipeNumber); + ClientMessageSink sink = new ClientMessageSink(ReceivedMessage); - if (PipeAccess.PipeExists(Common.LocalPipePrefix + localPipeTest)) - { - if (++pipeNumber <= Common.MaximumLocalClientCount) - retry = true; - else - throw new Exception(String.Format("Maximum local client limit ({0}) reached", Common.MaximumLocalClientCount)); - } - else - { - if (!PipeAccess.StartServer(localPipeTest, new PipeMessageHandler(_messageQueue.Enqueue))) - throw new Exception(String.Format("Failed to start local pipe server \"{0}\"", localPipeTest)); + IPAddress serverAddress = Client.GetIPFromName(_serverHost); - _localPipeName = localPipeTest; - retry = false; - } - } - while (retry); - - return true; - } - catch (Exception ex) + _client = new Client(serverAddress, 24000, sink); + _client.CommsFailureCallback = new WaitCallback(CommsFailure); + _client.ConnectCallback = new WaitCallback(Connected); + _client.DisconnectCallback = new WaitCallback(Disconnected); + + if (_client.Start()) { - IrssLog.Error(ex.ToString()); - return false; - } - } - - static bool ConnectToServer() - { - try - { - PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.RegisterClient, PipeMessageFlags.Request); - PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message); return true; } - catch (AppModule.NamedPipes.NamedPipeIOException) + else { + _client = null; return false; } - catch (Exception ex) - { - IrssLog.Error(ex.ToString()); - return false; - } } - - static void KeepAliveThread() + static void StopClient() { - Random random = new Random((int)DateTime.Now.Ticks); - bool reconnect; - int attempt; + if (_client == null) + return; - _registered = false; - _keepAlive = true; - while (_keepAlive) - { - reconnect = true; - - #region Connect to server - - IrssLog.Info("Connecting ({0}) ...", _serverHost); - attempt = 0; - while (_keepAlive && reconnect) - { - if (ConnectToServer()) - { - reconnect = false; - } - else - { - int wait; - - if (attempt <= 50) - attempt++; - - if (attempt > 50) - wait = 30; // 30 seconds - else if (attempt > 20) - wait = 10; // 10 seconds - else if (attempt > 10) - wait = 5; // 5 seconds - else - wait = 1; // 1 second - - for (int sleeps = 0; sleeps < wait && _keepAlive; sleeps++) - Thread.Sleep(1000); - } - } - - #endregion Connect to server - - #region Wait for registered - - // Give up after 10 seconds ... - attempt = 0; - while (_keepAlive && !_registered && !reconnect) - { - if (++attempt >= 10) - reconnect = true; - else - Thread.Sleep(1000); - } - - #endregion Wait for registered - - #region Ping the server repeatedly - - while (_keepAlive && _registered && !reconnect) - { - int pingID = random.Next(); - long pingTime = DateTime.Now.Ticks; - - try - { - PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.Ping, PipeMessageFlags.Request, BitConverter.GetBytes(pingID)); - PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message); - } - catch - { - // Failed to ping ... reconnect ... - IrssLog.Warn("Failed to ping, attempting to reconnect ..."); - _registered = false; - reconnect = true; - break; - } - - // Wait 10 seconds for a ping echo ... - bool receivedEcho = false; - while (_keepAlive && _registered && !reconnect && - !receivedEcho && DateTime.Now.Ticks - pingTime < 10 * 1000 * 10000) - { - if (_echoID == pingID) - { - receivedEcho = true; - } - else - { - Thread.Sleep(1000); - } - } - - if (receivedEcho) // Received ping echo ... - { - // 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 to ping, attempting to reconnect ..."); - - // Break out of pinging cycle ... - _registered = false; - reconnect = true; - } - } - - #endregion Ping the server repeatedly - - } - + _client.Stop(); + _client = null; } - static void ReceivedMessage(string message) + static void ReceivedMessage(IrssMessage received) { - PipeMessage received = PipeMessage.FromString(message); - IrssLog.Debug("Received Message \"{0}\"", received.Type); try { switch (received.Type) { - case PipeMessageType.BlastIR: - if ((received.Flags & PipeMessageFlags.Success) == PipeMessageFlags.Success) + case MessageType.BlastIR: + if ((received.Flags & MessageFlags.Success) == MessageFlags.Success) IrssLog.Info("Blast Success"); - else if ((received.Flags & PipeMessageFlags.Failure) == PipeMessageFlags.Failure) + else if ((received.Flags & MessageFlags.Failure) == MessageFlags.Failure) IrssLog.Warn("Blast Failed!"); break; - case PipeMessageType.RegisterClient: - if ((received.Flags & PipeMessageFlags.Success) == PipeMessageFlags.Success) + case MessageType.RegisterClient: + if ((received.Flags & MessageFlags.Success) == MessageFlags.Success) { IrssLog.Info("Registered to IR Server"); _registered = true; //_irServerInfo = TransceiverInfo.FromString(received.Data); } - else if ((received.Flags & PipeMessageFlags.Failure) == PipeMessageFlags.Failure) + else if ((received.Flags & MessageFlags.Failure) == MessageFlags.Failure) { _registered = false; IrssLog.Warn("IR Server refused to register"); } break; - case PipeMessageType.ServerShutdown: + case MessageType.ServerShutdown: _registered = false; IrssLog.Warn("IR Server Shutdown - Blasting disabled until IR Server returns"); break; - case PipeMessageType.Echo: + case MessageType.Echo: _echoID = BitConverter.ToInt32(received.DataAsBytes, 0); break; - case PipeMessageType.Error: + case MessageType.Error: IrssLog.Warn(received.DataAsString); break; } @@ -460,7 +286,7 @@ static void BlastIR(string fileName, string port) { - FileStream file = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); + FileStream file = new FileStream(fileName, FileMode.Open); byte[] outData = new byte[4 + port.Length + file.Length]; @@ -470,8 +296,8 @@ file.Read(outData, 4 + port.Length, (int)file.Length); file.Close(); - PipeMessage message = new PipeMessage(Environment.MachineName, _localPipeName, PipeMessageType.BlastIR, PipeMessageFlags.Request | PipeMessageFlags.ForceNotRespond, outData); - PipeAccess.SendMessage(Common.ServerPipeName, _serverHost, message); + IrssMessage message = new IrssMessage(MessageType.BlastIR, MessageFlags.Request | MessageFlags.ForceNotRespond, outData); + _client.Send(message); } } Deleted: trunk/plugins/IR Server Suite/Applications/IR Server/Client.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Client.cs 2007-09-16 18:08:48 UTC (rev 934) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Client.cs 2007-09-18 06:38:59 UTC (rev 935) @@ -1,25 +0,0 @@ -using System; - -namespace IRServer -{ - - struct Client - { - - public string Pipe; - public string Server; - - public Client(string pipe, string server) - { - Pipe = pipe; - Server = server; - } - - public override string ToString() - { - return String.Format("({0}, {1})", Server, Pipe); - } - - } - -} Modified: trunk/plugins/IR Server Suite/Applications/IR Server/IR Server.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/IR Server.csproj 2007-09-16 18:08:48 UTC (rev 934) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IR Server.csproj 2007-09-18 06:38:59 UTC (rev 935) @@ -101,7 +101,6 @@ <Compile Include="Advanced.Designer.cs"> <DependentUpon>Advanced.cs</DependentUpon> </Compile> - <Compile Include="Client.cs" /> <Compile Include="Properties\Resources.Designer.cs"> <AutoGen>True</AutoGen> <DesignTime>True</DesignTime> @@ -145,14 +144,14 @@ </BootstrapperPackage> </ItemGroup> <ItemGroup> + <ProjectReference Include="..\..\Common\IrssComms\IrssComms.csproj"> + <Project>{BCAFDF45-70DD-46FD-8B98-880DDA585AD2}</Project> + <Name>IrssComms</Name> + </ProjectReference> <ProjectReference Include="..\..\Common\irssUtils\IrssUtils.csproj"> <Project>{CA15769C-232E-4CA7-94FD-206A06CA3ABB}</Project> <Name>IrssUtils</Name> </ProjectReference> - <ProjectReference Include="..\..\IPC\Named Pipes\Named Pipes.csproj"> - <Project>{F4EA6055-7133-4F18-8971-E19ADEB482C1}</Project> - <Name>Named Pipes</Name> - </ProjectReference> <ProjectReference Include="..\..\IR Server Plugins\IR Server Plugin Interface\IR Server Plugin Interface.csproj"> <Project>{D8B3D28F-62CE-4CA7-86CE-B7EAD614A94C}</Project> <Name>IR Server Plugin Interface</Name> Modified: trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-09-16 18:08:48 UTC (rev 934) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-09-18 06:38:59 UTC (rev 935) @@ -2,6 +2,8 @@ using System.Collections; using System.Collections.Generic; using System.IO; +using System.Net; +using System.Net.Sockets; using System.Reflection; using System.Text; using System.Threading; @@ -11,8 +13,8 @@ using Microsoft.Win32; using Microsoft.Win32.SafeHandles; -using NamedPipes; using IRServerPluginInterface; +using IrssComms; using IrssUtils; namespace IRServer @@ -54,15 +56,17 @@ NotifyIcon _notifyIcon; - List<Client> _registeredClients; - List<Client> _registeredRepeaters; + List<ClientManager> _registeredClients; + List<ClientManager> _registeredRepeaters; - MessageQueue _messageQueue; + Server _server = null; + Client _client = null; + int _serverPort = 24000; + IRServerMode _mode; string _hostComputer; - string _localPipeName = String.Empty; bool _registered = false; // Used for relay and repeater modes. string _pluginNameReceive = String.Empty; @@ -79,8 +83,6 @@ public IRServer() { - _messageQueue = new MessageQueue(new MessageQueueSink(ReceivedMessage)); - // Setup taskbar icon _notifyIcon = new NotifyIcon(); _notifyIcon.ContextMenuStrip = new ContextMenuStrip(); @@ -140,24 +142,16 @@ else { _pluginTransmit = Program.GetPlugin(_pluginNameTransmit); - } - + } } - _messageQueue.Start(); - switch (_mode) { case IRServerMode.ServerMode: { - // Initialize registered client lists ... - _registeredClients = new List<Client>(); - _registeredRepeaters = new List<Client>(); + StartServer(); - // Start server pipe - PipeAccess.StartServer(Common.ServerPipeName, new PipeMessageHandler(_messageQueue.Enqueue)); - - IrssLog.Info("Server Mode: \\\\" + Environment.MachineName + "\\pipe\\" + Common.ServerPipeName); + IrssLog.Info("Started in Server Mode"); break; } @@ -256,7 +250,7 @@ if (_mode == IRServerMode.ServerMode) { - PipeMessage message = new PipeMessage(Environment.MachineName, Common.ServerPipeName, PipeMessageType.ServerShutdown, PipeMessageFlags.Notify); + IrssMessage message = new IrssMessage(MessageType.ServerShutdown, MessageFlags.Notify); SendToAll(message); } @@ -292,16 +286,13 @@ IrssLog.Error(ex.ToString()); } - _messageQueue.Stop(); - // Stop Server try { switch (_mode) { case IRServerMode.ServerMode: - if (PipeAccess.ServerRunning) - PipeAccess.StopServer(); + StopServer(); break; case IRServerMode.RelayMode: @@ -360,117 +351,137 @@ _inConfiguration = false; } - bool StartRelay() + void StartServer() { - bool retry = false; - int pipeNumber = 1; - string localPipeTest; + if (_server != null) + return; - try + // Initialize registered client lists ... + _registeredClients = new List<ClientManager>(); + _registeredRepeaters = new List<ClientManager>(); + + ServerMessageSink sink = new ServerMessageSink(ServerReceivedMessage); + _server = new Server(_serverPort, sink); + + _server.Start(); + } + void StopServer() + { + if (_server == null) + return; + + _server.Stop(); + _server = null; + + _registeredClients.Clear(); + ... [truncated message content] |
From: <an...@us...> - 2007-09-18 14:18:32
|
Revision: 937 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=937&view=rev Author: and-81 Date: 2007-09-18 07:00:39 -0700 (Tue, 18 Sep 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Common/IrssComms/Client.cs trunk/plugins/IR Server Suite/Common/IrssComms/IrssComms.csproj trunk/plugins/IR Server Suite/Common/IrssComms/Server.cs Added Paths: ----------- trunk/plugins/IR Server Suite/Common/IrssComms/GenericPCQueue.cs trunk/plugins/IR Server Suite/Input Service/ trunk/plugins/IR Server Suite/Input Service/Input Service.csproj trunk/plugins/IR Server Suite/Input Service/InputService.cs trunk/plugins/IR Server Suite/Input Service/InputServiceInstaller.cs trunk/plugins/IR Server Suite/Input Service/Program.cs trunk/plugins/IR Server Suite/Input Service/Properties/ trunk/plugins/IR Server Suite/Input Service/Properties/AssemblyInfo.cs Removed Paths: ------------- trunk/plugins/IR Server Suite/Common/IrssComms/GenericMessageQueue.cs Modified: trunk/plugins/IR Server Suite/Common/IrssComms/Client.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssComms/Client.cs 2007-09-18 12:40:31 UTC (rev 936) +++ trunk/plugins/IR Server Suite/Common/IrssComms/Client.cs 2007-09-18 14:00:39 UTC (rev 937) @@ -31,7 +31,7 @@ volatile bool _processConnectionThread = false; volatile bool _connected = false; - GenericMessageQueue<IrssMessage> _messageQueue; + GenericPCQueue<IrssMessage> _messageQueue; ClientMessageSink _messageSink; @@ -93,7 +93,7 @@ _messageSink = messageSink; - _messageQueue = new GenericMessageQueue<IrssMessage>(new GenericMessageQueueSink<IrssMessage>(QueueMessageSink)); + _messageQueue = new GenericPCQueue<IrssMessage>(new GenericPCQueueSink<IrssMessage>(QueueMessageSink)); } #endregion Constructor Deleted: trunk/plugins/IR Server Suite/Common/IrssComms/GenericMessageQueue.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssComms/GenericMessageQueue.cs 2007-09-18 12:40:31 UTC (rev 936) +++ trunk/plugins/IR Server Suite/Common/IrssComms/GenericMessageQueue.cs 2007-09-18 14:00:39 UTC (rev 937) @@ -1,200 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Diagnostics; -using System.Threading; - -namespace IrssComms -{ - - #region Delegates - - /// <summary> - /// Delegate for MessageQueue sink. - /// </summary> - /// <param name="obj">Generic object to process.</param> - public delegate void GenericMessageQueueSink<T>(T obj); - - #endregion Delegates - - /// <summary> - /// Implements a thread-safe Producer/Consumer Queue for messages. - /// </summary> - public class GenericMessageQueue<T> : IDisposable - { - - #region Variables - - Thread _workerThread; - Queue<T> _queue; - object _queueLock; - EventWaitHandle _queueWaitHandle; - volatile bool _processQueue; - - GenericMessageQueueSink<T> _messageSink; - - #endregion Variables - - #region Constructor - - /// <summary> - /// Create a new MessageQueue. - /// </summary> - /// <param name="sink">Where to send dequeued messages.</param> - public GenericMessageQueue(GenericMessageQueueSink<T> sink) - { - if (sink == null) - throw new ArgumentNullException("sink"); - - _messageSink = sink; - - // Create locking and control mechanisms ... - _queueLock = new object(); - _queueWaitHandle = new AutoResetEvent(false); - - // Create FIFO message queue - _queue = new Queue<T>(); - } - - #endregion Constructor - - #region IDisposable - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - protected virtual void Dispose(bool disposing) - { - if (disposing) - { - // Dispose managed resources ... - if (_processQueue) - Stop(); - - _workerThread = null; - - _queue.Clear(); - _queue = null; - - _queueLock = null; - - _queueWaitHandle.Close(); - } - - // Free native resources ... - - } - - #endregion IDisposable - - #region Implementation - - /// <summary> - /// Start processing the queue. - /// </summary> - public void Start() - { - if (_processQueue) - return; - - _processQueue = true; - - // Create the worker thread ... - _workerThread = new Thread(new ThreadStart(WorkerThread)); - _workerThread.IsBackground = true; - _workerThread.Name = "Message Queue"; - - _workerThread.Start(); - } - - /// <summary> - /// Stop processing the queue. - /// </summary> - public void Stop() - { - if (!_processQueue) - return; - - // Signal the worker thread to stop ... - _processQueue = false; - _queueWaitHandle.Set(); - - // Join the worker thread and wait for it to finish ... - if (_workerThread != null && _workerThread.IsAlive && !_workerThread.Join(1000)) - { - _workerThread.Abort(); - _workerThread.Join(); - } - - _workerThread = null; - } - - /// <summary> - /// Add a generic object to the queue. - /// </summary> - /// <param name="obj">Generic object to place in the queue.</param> - public void Enqueue(T obj) - { - if (obj == null) - throw new ArgumentNullException("obj"); - - lock (_queueLock) - _queue.Enqueue(obj); - - _queueWaitHandle.Set(); - } - - /// <summary> - /// Clears the queue of any messages. - /// </summary> - public void ClearQueue() - { - lock (_queueLock) - { - _queue.Clear(); - } - } - - /// <summary> - /// Queue processing worker thread. - /// </summary> - void WorkerThread() - { - try - { - T obj = default(T); - bool didDequeue; - - while (_processQueue) - { - didDequeue = false; - - lock (_queueLock) - { - if (_queue.Count > 0) - { - obj = _queue.Dequeue(); - didDequeue = true; - } - } - - if (didDequeue) - _messageSink(obj); - else - _queueWaitHandle.WaitOne(); - } - } - catch (ThreadAbortException threadAbortException) - { - Trace.WriteLine(threadAbortException.ToString()); - } - } - - #endregion Implementation - - } - -} Added: trunk/plugins/IR Server Suite/Common/IrssComms/GenericPCQueue.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssComms/GenericPCQueue.cs (rev 0) +++ trunk/plugins/IR Server Suite/Common/IrssComms/GenericPCQueue.cs 2007-09-18 14:00:39 UTC (rev 937) @@ -0,0 +1,200 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; +using System.Threading; + +namespace IrssComms +{ + + #region Delegates + + /// <summary> + /// Delegate for GenericPCQueue sink. + /// </summary> + /// <param name="obj">Generic object to process.</param> + public delegate void GenericPCQueueSink<T>(T obj); + + #endregion Delegates + + /// <summary> + /// Implements a thread-safe Producer/Consumer Queue for generics. + /// </summary> + public class GenericPCQueue<T> : IDisposable + { + + #region Variables + + Thread _workerThread; + Queue<T> _queue; + object _queueLock; + EventWaitHandle _queueWaitHandle; + volatile bool _processQueue; + + GenericPCQueueSink<T> _sink; + + #endregion Variables + + #region Constructor + + /// <summary> + /// Create a new MessageQueue. + /// </summary> + /// <param name="sink">Where to send dequeued messages.</param> + public GenericPCQueue(GenericPCQueueSink<T> sink) + { + if (sink == null) + throw new ArgumentNullException("sink"); + + _sink = sink; + + // Create locking and control mechanisms ... + _queueLock = new object(); + _queueWaitHandle = new AutoResetEvent(false); + + // Create FIFO generic queue + _queue = new Queue<T>(); + } + + #endregion Constructor + + #region IDisposable + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + // Dispose managed resources ... + if (_processQueue) + Stop(); + + _workerThread = null; + + _queue.Clear(); + _queue = null; + + _queueLock = null; + + _queueWaitHandle.Close(); + } + + // Free native resources ... + + } + + #endregion IDisposable + + #region Implementation + + /// <summary> + /// Start processing the queue. + /// </summary> + public void Start() + { + if (_processQueue) + return; + + _processQueue = true; + + // Create the worker thread ... + _workerThread = new Thread(new ThreadStart(WorkerThread)); + _workerThread.IsBackground = true; + _workerThread.Name = "IrssComms.GenericPCQueue"; + + _workerThread.Start(); + } + + /// <summary> + /// Stop processing the queue. + /// </summary> + public void Stop() + { + if (!_processQueue) + return; + + // Signal the worker thread to stop ... + _processQueue = false; + _queueWaitHandle.Set(); + + // Join the worker thread and wait for it to finish ... + if (_workerThread != null && _workerThread.IsAlive && !_workerThread.Join(1000)) + { + _workerThread.Abort(); + _workerThread.Join(); + } + + _workerThread = null; + } + + /// <summary> + /// Add a generic object to the queue. + /// </summary> + /// <param name="obj">Generic object to place in the queue.</param> + public void Enqueue(T obj) + { + if (obj == null) + throw new ArgumentNullException("obj"); + + lock (_queueLock) + _queue.Enqueue(obj); + + _queueWaitHandle.Set(); + } + + /// <summary> + /// Clears the queue of any messages. + /// </summary> + public void ClearQueue() + { + lock (_queueLock) + { + _queue.Clear(); + } + } + + /// <summary> + /// Queue processing worker thread. + /// </summary> + void WorkerThread() + { + try + { + T obj = default(T); + bool didDequeue; + + while (_processQueue) + { + didDequeue = false; + + lock (_queueLock) + { + if (_queue.Count > 0) + { + obj = _queue.Dequeue(); + didDequeue = true; + } + } + + if (didDequeue) + _sink(obj); + else + _queueWaitHandle.WaitOne(); + } + } + catch (ThreadAbortException threadAbortException) + { + Trace.WriteLine(threadAbortException.ToString()); + } + } + + #endregion Implementation + + } + +} Modified: trunk/plugins/IR Server Suite/Common/IrssComms/IrssComms.csproj =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssComms/IrssComms.csproj 2007-09-18 12:40:31 UTC (rev 936) +++ trunk/plugins/IR Server Suite/Common/IrssComms/IrssComms.csproj 2007-09-18 14:00:39 UTC (rev 937) @@ -59,7 +59,7 @@ <Compile Include="Client.cs" /> <Compile Include="ClientManager.cs" /> <Compile Include="IrssMessage.cs" /> - <Compile Include="GenericMessageQueue.cs" /> + <Compile Include="GenericPCQueue.cs" /> <Compile Include="MessageManagerCombo.cs" /> <Compile Include="Server.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> Modified: trunk/plugins/IR Server Suite/Common/IrssComms/Server.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssComms/Server.cs 2007-09-18 12:40:31 UTC (rev 936) +++ trunk/plugins/IR Server Suite/Common/IrssComms/Server.cs 2007-09-18 14:00:39 UTC (rev 937) @@ -46,7 +46,7 @@ List<ClientManager> _clientManagers; - GenericMessageQueue<MessageManagerCombo> _messageQueue; + GenericPCQueue<MessageManagerCombo> _messageQueue; #endregion Variables @@ -63,7 +63,7 @@ _messageSink = messageSink; - _messageQueue = new GenericMessageQueue<MessageManagerCombo>(new GenericMessageQueueSink<MessageManagerCombo>(QueueMessageSink)); + _messageQueue = new GenericPCQueue<MessageManagerCombo>(new GenericPCQueueSink<MessageManagerCombo>(QueueMessageSink)); } #endregion Constructor Added: trunk/plugins/IR Server Suite/Input Service/Input Service.csproj =================================================================== --- trunk/plugins/IR Server Suite/Input Service/Input Service.csproj (rev 0) +++ trunk/plugins/IR Server Suite/Input Service/Input Service.csproj 2007-09-18 14:00:39 UTC (rev 937) @@ -0,0 +1,94 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{8ADDE1CB-2D23-4AB1-88B1-A241C60C16BA}</ProjectGuid> + <OutputType>WinExe</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>InputService</RootNamespace> + <AssemblyName>Input Service</AssemblyName> + <StartupObject>InputService.Program</StartupObject> + <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <PlatformTarget>AnyCPU</PlatformTarget> + <UseVSHostingProcess>false</UseVSHostingProcess> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> + <DebugSymbols>true</DebugSymbols> + <OutputPath>bin\x86\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <DebugType>full</DebugType> + <PlatformTarget>x86</PlatformTarget> + <ErrorReport>prompt</ErrorReport> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <UseVSHostingProcess>false</UseVSHostingProcess> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> + <OutputPath>bin\x86\Release\</OutputPath> + <DefineConstants> + </DefineConstants> + <DebugType>pdbonly</DebugType> + <PlatformTarget>x86</PlatformTarget> + <UseVSHostingProcess>false</UseVSHostingProcess> + <ErrorReport>prompt</ErrorReport> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Configuration.Install" /> + <Reference Include="System.Data" /> + <Reference Include="System.Management" /> + <Reference Include="System.ServiceProcess" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="InputService.cs"> + <SubType>Component</SubType> + </Compile> + <Compile Include="InputServiceInstaller.cs"> + <SubType>Component</SubType> + </Compile> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\Common\IrssComms\IrssComms.csproj"> + <Project>{BCAFDF45-70DD-46FD-8B98-880DDA585AD2}</Project> + <Name>IrssComms</Name> + </ProjectReference> + <ProjectReference Include="..\Common\IrssUtils\IrssUtils.csproj"> + <Project>{CA15769C-232E-4CA7-94FD-206A06CA3ABB}</Project> + <Name>IrssUtils</Name> + </ProjectReference> + <ProjectReference Include="..\IR Server Plugins\IR Server Plugin Interface\IR Server Plugin Interface.csproj"> + <Project>{D8B3D28F-62CE-4CA7-86CE-B7EAD614A94C}</Project> + <Name>IR Server Plugin Interface</Name> + </ProjectReference> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Added: trunk/plugins/IR Server Suite/Input Service/InputService.cs =================================================================== --- trunk/plugins/IR Server Suite/Input Service/InputService.cs (rev 0) +++ trunk/plugins/IR Server Suite/Input Service/InputService.cs 2007-09-18 14:00:39 UTC (rev 937) @@ -0,0 +1,1125 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Diagnostics; +using System.IO; +using System.Net; +using System.Net.Sockets; +using System.Reflection; +using System.ServiceProcess; +using System.Text; +using System.Threading; +using System.Xml; + +using Microsoft.Win32; +using Microsoft.Win32.SafeHandles; + +using IRServerPluginInterface; +using IrssComms; +using IrssUtils; + +namespace InputService +{ + + #region Enumerations + + /// <summary> + /// Describes the operation mode of the IR Server. + /// </summary> + public enum IRServerMode + { + /// <summary> + /// Acts as a standard IR Server (Default). + /// </summary> + ServerMode = 0, + /// <summary> + /// Relays button presses to another IR Server. + /// </summary> + RelayMode = 1, + /// <summary> + /// Acts as a repeater for another IR Server's IR blasting. + /// </summary> + RepeaterMode = 2, + } + + #endregion Enumerations + + public class InputService : ServiceBase + { + + #region Constants + + static readonly string ConfigurationFile = Common.FolderAppData + "Input Service\\Input Service.xml"; + + #endregion Constants + + #region Variables + + List<ClientManager> _registeredClients; + List<ClientManager> _registeredRepeaters; + + Server _server = null; + Client _client = null; + + int _serverPort = 24000; + + IRServerMode _mode; + string _hostComputer; + + bool _registered = false; // Used for relay and repeater modes. + + string _pluginNameReceive = String.Empty; + IRServerPlugin _pluginReceive = null; + + string _pluginNameTransmit = String.Empty; + IRServerPlugin _pluginTransmit = null; + + #endregion Variables + + #region Constructor + + public InputService() + { + this.ServiceName = Program.ServiceName; + + //this.EventLog.Log = "Application"; + //this.AutoLog = true; + + this.CanHandlePowerEvent = true; + this.CanHandleSessionChangeEvent = false; + this.CanPauseAndContinue = false; + this.CanShutdown = true; + this.CanStop = true; + } + + #endregion Constructor + + #region Dispose + + protected override void Dispose(bool disposing) + { + base.Dispose(disposing); + } + + #endregion Dispose + + #region Service Methods + + protected override void OnStart(string[] args) + { + // TODO: Change log level to info for release. + IrssLog.LogLevel = IrssLog.Level.Debug; + IrssLog.Open(Common.FolderIrssLogs + "Input Service.log"); + + try + { + IrssLog.Info("Starting IR Server ..."); + + LoadSettings(); + + // Load IR Plugins ... + _pluginReceive = null; + _pluginTransmit = null; + + if (String.IsNullOrEmpty(_pluginNameReceive) && String.IsNullOrEmpty(_pluginNameTransmit)) + { + IrssLog.Warn("No transmit or receive plugin loaded"); + } + else + { + if (String.IsNullOrEmpty(_pluginNameReceive)) + { + IrssLog.Warn("No receiver plugin loaded"); + } + else + { + _pluginReceive = Program.GetPlugin(_pluginNameReceive); + } + + if (_pluginNameTransmit.Equals(_pluginNameReceive, StringComparison.InvariantCultureIgnoreCase)) + { + _pluginTransmit = _pluginReceive; + IrssLog.Info("Using the same plugin for transmit and receive"); + } + else if (String.IsNullOrEmpty(_pluginNameTransmit)) + { + IrssLog.Warn("No transmit plugin loaded"); + } + else + { + _pluginTransmit = Program.GetPlugin(_pluginNameTransmit); + } + } + + switch (_mode) + { + case IRServerMode.ServerMode: + { + StartServer(); + + IrssLog.Info("Started in Server Mode"); + break; + } + + case IRServerMode.RelayMode: + { + if (StartRelay()) + IrssLog.Info("Started in Relay Mode"); + else + IrssLog.Error("Failed to start in Relay Mode"); + break; + } + + case IRServerMode.RepeaterMode: + { + if (StartRepeater()) + IrssLog.Info("Started in Repeater Mode"); + else + IrssLog.Error("Failed to start in Repeater Mode"); + break; + } + } + + // Start plugin(s) ... + if (_pluginReceive != null) + { + try + { + if (_pluginReceive.Start()) + IrssLog.Info("Receiver plugin started: \"{0}\"", _pluginNameReceive); + else + IrssLog.Error("Failed to start receive plugin: \"{0}\"", _pluginNameReceive); + } + catch (Exception ex) + { + IrssLog.Error("Failed to start receive plugin: \"{0}\"", _pluginNameReceive); + IrssLog.Error(ex.ToString()); + } + } + + if (!_pluginNameTransmit.Equals(_pluginNameReceive, StringComparison.InvariantCultureIgnoreCase)) + { + if (_pluginTransmit != null) + { + try + { + if (_pluginTransmit.Start()) + IrssLog.Info("Transmit plugin started: \"{0}\"", _pluginNameTransmit); + else + IrssLog.Error("Failed to start transmit plugin: \"{0}\"", _pluginNameTransmit); + } + catch (Exception ex) + { + IrssLog.Error("Failed to start transmit plugin: \"{0}\"", _pluginNameTransmit); + IrssLog.Error(ex.ToString()); + } + } + } + + if (_pluginReceive != null) + { + if (_pluginReceive is IRemoteReceiver) + (_pluginReceive as IRemoteReceiver).RemoteCallback += new RemoteHandler(RemoteHandlerCallback); + + if (_pluginReceive is IKeyboardReceiver) + (_pluginReceive as IKeyboardReceiver).KeyboardCallback += new KeyboardHandler(KeyboardHandlerCallback); + + if (_pluginReceive is IMouseReceiver) + (_pluginReceive as IMouseReceiver).MouseCallback += new MouseHandler(MouseHandlerCallback); + } + + IrssLog.Info("IR Server started"); + } + catch (Exception ex) + { + IrssLog.Error(ex.ToString()); + } + } + + protected override void OnStop() + { + IrssLog.Info("Stopping IR Server ..."); + + if (_mode == IRServerMode.ServerMode) + { + IrssMessage message = new IrssMessage(MessageType.ServerShutdown, MessageFlags.Notify); + SendToAll(message); + } + + if (_pluginReceive != null) + { + if (_pluginReceive is IRemoteReceiver) + (_pluginReceive as IRemoteReceiver).RemoteCallback -= new RemoteHandler(RemoteHandlerCallback); + + if (_pluginReceive is IKeyboardReceiver) + (_pluginReceive as IKeyboardReceiver).KeyboardCallback -= new KeyboardHandler(KeyboardHandlerCallback); + + if (_pluginReceive is IMouseReceiver) + (_pluginReceive as IMouseReceiver).MouseCallback -= new MouseHandler(MouseHandlerCallback); + } + + // Stop Plugin(s) + try + { + if (_pluginReceive != null) + _pluginReceive.Stop(); + } + catch (Exception ex) + { + IrssLog.Error(ex.ToString()); + } + try + { + if (_pluginTransmit != null && _pluginTransmit != _pluginReceive) + _pluginTransmit.Stop(); + } + catch (Exception ex) + { + IrssLog.Error(ex.ToString()); + } + + // Stop Server + try + { + switch (_mode) + { + case IRServerMode.ServerMode: + StopServer(); + break; + + case IRServerMode.RelayMode: + StopRelay(); + break; + + case IRServerMode.RepeaterMode: + StopRepeater(); + break; + } + } + catch (Exception ex) + { + IrssLog.Error(ex.ToString()); + } + + IrssLog.Close(); + } + + protected override void OnShutdown() + { + OnStop(); + } + + protected override bool OnPowerEvent(PowerBroadcastStatus powerStatus) + { + switch (powerStatus) + { + case PowerBroadcastStatus.Suspend: + IrssLog.Info("Entering standby ..."); + + if (_pluginReceive != null) + _pluginReceive.Suspend(); + + if (_pluginTransmit != null && _pluginTransmit != _pluginReceive) + _pluginTransmit.Suspend(); + + // Inform clients ... + if (_mode == IRServerMode.ServerMode) + { + IrssMessage message = new IrssMessage(MessageType.ServerShutdown, MessageFlags.Notify); + SendToAll(message); + } + break; + + case PowerBroadcastStatus.ResumeAutomatic: + case PowerBroadcastStatus.ResumeCritical: + case PowerBroadcastStatus.ResumeSuspend: + IrssLog.Info("Resume from standby ..."); + + if (_pluginReceive != null) + _pluginReceive.Resume(); + + if (_pluginTransmit != null && _pluginTransmit != _pluginReceive) + _pluginTransmit.Resume(); + + // TODO: Inform clients ? + break; + } + + return true; + } + + #region Unused + + protected override void OnPause() + { + } + + protected override void OnContinue() + { + } + + protected override void OnSessionChange(SessionChangeDescription changeDescription) + { + switch (changeDescription.Reason) + { + case SessionChangeReason.SessionLogon: + break; + + case SessionChangeReason.SessionLogoff: + break; + } + } + + protected override void OnCustomCommand(int command) + { + switch (command) + { + case 128: + break; + } + } + + #endregion Unused + + #endregion Service Methods + + void StartServer() + { + if (_server != null) + return; + + // Initialize registered client lists ... + _registeredClients = new List<ClientManager>(); + _registeredRepeaters = new List<ClientManager>(); + + ServerMessageSink sink = new ServerMessageSink(ServerReceivedMessage); + _server = new Server(_serverPort, sink); + + _server.Start(); + } + void StopServer() + { + if (_server == null) + return; + + _server.Stop(); + _server = null; + + _registeredClients.Clear(); + _registeredClients = null; + + _registeredRepeaters.Clear(); + _registeredRepeaters = null; + } + + void CommsFailure(object obj) + { + Exception ex = obj as Exception; + + if (ex != null) + IrssLog.Error("Communications failure: {0}", ex.Message); + else + IrssLog.Error("Communications failure"); + + StopClient(); + } + void Connected(object obj) + { + IrssLog.Info("Connected to another server"); + + if (_mode == IRServerMode.RepeaterMode) + { + IrssMessage message = new IrssMessage(MessageType.RegisterRepeater, MessageFlags.Request); + _client.Send(message); + } + } + void Disconnected(object obj) + { + IrssLog.Warn("Communications with other server has been lost"); + + Thread.Sleep(1000); + } + + bool StartClient() + { + if (_client != null) + return false; + + ClientMessageSink sink = new ClientMessageSink(ClientReceivedMessage); + + IPAddress serverAddress = Client.GetIPFromName(_hostComputer); + + _client = new Client(serverAddress, 24000, sink); + _client.CommsFailureCallback = new WaitCallback(CommsFailure); + _client.ConnectCallback = new WaitCallback(Connected); + _client.DisconnectCallback = new WaitCallback(Disconnected); + + if (_client.Start()) + { + return true; + } + else + { + _client = null; + return false; + } + } + void StopClient() + { + if (_client == null) + return; + + _client.Stop(); + _client = null; + } + + bool StartRelay() + { + try + { + StartServer(); + StartClient(); + + return true; + } + catch (Exception ex) + { + IrssLog.Error(ex.ToString()); + return false; + } + } + void StopRelay() + { + try + { + StopServer(); + StopClient(); + } + catch { } + } + + bool StartRepeater() + { + try + { + StartServer(); + StartClient(); + + return true; + } + catch (Exception ex) + { + IrssLog.Error(ex.ToString()); + return false; + } + } + void StopRepeater() + { + try + { + if (_registered) + { + _registered = false; + + IrssMessage message = new IrssMessage(MessageType.UnregisterRepeater, MessageFlags.Request); + _client.Send(message); + } + + StopServer(); + StopClient(); + } + catch { } + } + + void RemoteHandlerCallback(string keyCode) + { + IrssLog.Debug("Remote Event: {0}", keyCode); + + byte[] bytes = Encoding.ASCII.GetBytes(keyCode); + + switch (_mode) + { + case IRServerMode.ServerMode: + { + IrssMessage message = new IrssMessage(MessageType.RemoteEvent, MessageFlags.Notify, bytes); + SendToAll(message); + break; + } + + case IRServerMode.RelayMode: + { + IrssMessage message = new IrssMessage(MessageType.ForwardRemoteEvent, MessageFlags.Request, bytes); + _client.Send(message); + break; + } + + case IRServerMode.RepeaterMode: + { + IrssLog.Debug("Remote event ignored, IR Server is in Repeater Mode."); + break; + } + } + } + void KeyboardHandlerCallback(int vKey, bool keyUp) + { + IrssLog.Debug("Keyboard Event: {0}, keyUp: {1}", vKey, keyUp); + + byte[] bytes = new byte[8]; + BitConverter.GetBytes(vKey).CopyTo(bytes, 0); + BitConverter.GetBytes(keyUp).CopyTo(bytes, 4); + + switch (_mode) + { + case IRServerMode.ServerMode: + { + IrssMessage message = new IrssMessage(MessageType.KeyboardEvent, MessageFlags.Notify, bytes); + SendToAll(message); + break; + } + + case IRServerMode.RelayMode: + { + IrssMessage message = new IrssMessage(MessageType.ForwardKeyboardEvent, MessageFlags.Request, bytes); + _client.Send(message); + break; + } + + case IRServerMode.RepeaterMode: + { + IrssLog.Debug("Keyboard event ignored, IR Server is in Repeater Mode."); + break; + } + } + } + void MouseHandlerCallback(int deltaX, int deltaY, int buttons) + { + IrssLog.Debug("Mouse Event - deltaX: {0}, deltaY: {1}, buttons: {2}", deltaX, deltaY, buttons); + + byte[] bytes = new byte[12]; + BitConverter.GetBytes(deltaX).CopyTo(bytes, 0); + BitConverter.GetBytes(deltaY).CopyTo(bytes, 4); + BitConverter.GetBytes(buttons).CopyTo(bytes, 8); + + switch (_mode) + { + case IRServerMode.ServerMode: + { + IrssMessage message = new IrssMessage(MessageType.MouseEvent, MessageFlags.Notify, bytes); + SendToAll(message); + break; + } + + case IRServerMode.RelayMode: + { + IrssMessage message = new IrssMessage(MessageType.ForwardMouseEvent, MessageFlags.Request, bytes); + _client.Send(message); + break; + } + + case IRServerMode.RepeaterMode: + { + IrssLog.Debug("Mouse event ignored, IR Server is in Repeater Mode."); + break; + } + } + } + + void SendToAll(IrssMessage message) + { + IrssLog.Debug("SendToAll({0}, {1})", message.Type, message.Flags); + + List<ClientManager> unregister = new List<ClientManager>(); + + lock (_registeredClients) + { + foreach (ClientManager client in _registeredClients) + { + if (!_server.Send(client, message)) + { + IrssLog.Warn("Failed to send message to a client, unregistering client"); + + // If a message doesn't get through then unregister that client + unregister.Add(client); + } + } + + // Unregistering clients must be done as a two part process because otherwise the + // foreach statement above would fail if you modified the _registeredClients list + // while enumerating it. + foreach (ClientManager client in unregister) + { + UnregisterClient(client); + } + } + } + void SendToAllExcept(ClientManager exceptClient, IrssMessage message) + { + IrssLog.Debug("SendToAllExcept({0}, {1})", message.Type, message.Flags); + + List<ClientManager> unregister = new List<ClientManager>(); + + lock (_registeredClients) + { + foreach (ClientManager client in _registeredClients) + { + if (client == exceptClient) + continue; + + if (!_server.Send(client, message)) + { + IrssLog.Warn("Failed to send message to a client, unregistering client"); + + // If a message doesn't get through then unregister that client + unregister.Add(client); + } + } + + // Unregistering clients must be done as a two part process because otherwise the + // foreach statement above would fail if you modified the _registeredClients list + // while enumerating it. + foreach (ClientManager client in unregister) + { + UnregisterClient(client); + } + } + } + void SendTo(ClientManager receiver, IrssMessage message) + { + IrssLog.Debug("SendTo({0}, {1})", message.Type, message.Flags); + + if (!_server.Send(receiver, message)) + { + IrssLog.Warn("Failed to send message to a client, unregistering client"); + + // If a message doesn't get through then unregister that client + UnregisterClient(receiver); + } + } + void SendToRepeaters(IrssMessage message) + { + IrssLog.Debug("SendToRepeaters({0}, {1})", message.Type, message.Flags); + + List<ClientManager> unregister = new List<ClientManager>(); + + lock (_registeredRepeaters) + { + foreach (ClientManager client in _registeredRepeaters) + { + if (!_server.Send(client, message)) + { + IrssLog.Warn("Failed to send message to a repeater, unregistering repeater"); + + // If a message doesn't get through then unregister that repeater + unregister.Add(client); + } + } + + // Unregistering repeaters must be done as a two part process because otherwise the + // foreach statement above would fail if you modified the _registeredRepeaters list + // while enumerating it. + foreach (ClientManager repeater in unregister) + { + UnregisterRepeater(repeater); + } + } + } + + bool RegisterClient(ClientManager addClient) + { + lock (_registeredClients) + { + if (!_registeredClients.Contains(addClient)) + _registeredClients.Add(addClient); + } + + IrssLog.Info("Registered a client"); + return true; + } + bool UnregisterClient(ClientManager removeClient) + { + lock (_registeredClients) + { + if (!_registeredClients.Contains(removeClient)) + return false; + + _registeredClients.Remove(removeClient); + } + + IrssLog.Info("Unregistered a client"); + return true; + } + + bool RegisterRepeater(ClientManager addRepeater) + { + lock (_registeredRepeaters) + { + if (!_registeredRepeaters.Contains(addRepeater)) + _registeredRepeaters.Add(addRepeater); + } + + IrssLog.Info("Registered a repeater"); + return true; + } + bool UnregisterRepeater(ClientManager removeRepeater) + { + lock (_registeredRepeaters) + { + if (!_registeredRepeaters.Contains(removeRepeater)) + return false; + + _registeredRepeaters.Remove(removeRepeater); + } + + IrssLog.Info("Unregistered a repeater"); + return true; + } + + bool BlastIR(byte[] data) + { + try + { + IrssLog.Debug("Blast IR"); + + if (_pluginTransmit == null || !(_pluginTransmit is ITransmitIR)) + return false; + + string port = "Default"; + + int portLen = BitConverter.ToInt32(data, 0); + if (portLen > 0) + port = Encoding.ASCII.GetString(data, 4, portLen); + + byte[] codeData = new byte[data.Length - (4 + portLen)]; + Array.Copy(data, 4 + portLen, codeData, 0, codeData.Length); + + return (_pluginTransmit as ITransmitIR).Transmit(port, codeData); + } + catch (Exception ex) + { + IrssLog.Error(ex.ToString()); + return false; + } + } + LearnStatus LearnIR(out byte[] data) + { + IrssLog.Debug("Learn IR"); + + data = null; + + if (_pluginTransmit == null) + { + IrssLog.Debug("No transmit plugin loaded, can't learn"); + return LearnStatus.Failure; + } + else if (!(_pluginTransmit is ILearnIR)) + { + IrssLog.Debug("Active transmit plugin doesn't support learn"); + return LearnStatus.Failure; + } + + Thread.Sleep(250); + + LearnStatus status = LearnStatus.Failure; + + try + { + status = (_pluginTransmit as ILearnIR).Learn(out data); + switch (status) + { + case LearnStatus.Success: + IrssLog.Info("Learn IR success"); + break; + + case LearnStatus.Failure: + IrssLog.Error("Failed to learn IR Code"); + break; + + case LearnStatus.Timeout: + IrssLog.Warn("IR Code learn timed out"); + break; + } + } + catch (Exception ex) + { + IrssLog.Error(ex.ToString()); + } + + return status; + } + + void ServerReceivedMessage(MessageManagerCombo combo) + { + IrssLog.Debug("Server message received: {0}, {1}", combo.Message.Type, combo.Message.Flags); + + try + { + switch (combo.Message.Type) + { + case MessageType.ForwardRemoteEvent: + if (_mode == IRServerMode.RelayMode) + { + IrssMessage forward = new IrssMessage(MessageType.ForwardRemoteEvent, MessageFlags.Request, combo.Message.DataAsBytes); + _client.Send(forward); + } + else + { + IrssMessage forward = new IrssMessage(MessageType.RemoteEvent, MessageFlags.Notify, combo.Message.DataAsBytes); + SendToAllExcept(combo.Manager, forward); + } + break; + + case MessageType.ForwardKeyboardEvent: + if (_mode == IRServerMode.RelayMode) + { + IrssMessage forward = new IrssMessage(MessageType.ForwardKeyboardEvent, MessageFlags.Request, combo.Message.DataAsBytes); + _client.Send(forward); + } + else + { + IrssMessage forward = new IrssMessage(MessageType.KeyboardEvent, MessageFlags.Notify, combo.Message.DataAsBytes); + SendToAllExcept(combo.Manager, forward); + } + break; + + case MessageType.ForwardMouseEvent: + if (_mode == IRServerMode.RelayMode) + { + IrssMessage forward = new IrssMessage(MessageType.ForwardMouseEvent, MessageFlags.Request, combo.Message.DataAsBytes); + _client.Send(forward); + } + else + { + IrssMessage forward = new IrssMessage(MessageType.MouseEvent, MessageFlags.Notify, combo.Message.DataAsBytes); + SendToAllExcept(combo.Manager, forward); + } + break; + + case MessageType.BlastIR: + { + IrssMessage response = new IrssMessage(MessageType.BlastIR, MessageFlags.Response); + + if (_mode == IRServerMode.RelayMode) + { + response.Flags |= MessageFlags.Failure; + } + else + { + if (_registeredRepeaters.Count > 0) + SendToRepeaters(combo.Message); + + if (BlastIR(combo.Message.DataAsBytes)) + response.Flags |= MessageFlags.Success; + else + response.Flags |= MessageFlags.Failure; + } + + if ((combo.Message.Flags & MessageFlags.ForceNotRespond) != MessageFlags.ForceNotRespond) + SendTo(combo.Manager, response); + + break; + } + + case MessageType.LearnIR: + { + IrssMessage response = new IrssMessage(MessageType.LearnIR, MessageFlags.Response); + + if (_mode == IRServerMode.RelayMode) + { + response.Flags |= MessageFlags.Failure; + } + else + { + byte[] bytes = null; + + LearnStatus status = LearnIR(out bytes); + + switch (status) + { + case LearnStatus.Success: + response.Flags |= MessageFlags.Success; + response.DataAsBytes = bytes; + break; + + case LearnStatus.Failure: + response.Flags |= MessageFlags.Failure; + break; + + case LearnStatus.Timeout: + response.Flags |= MessageFlags.Timeout; + break; + } + } + + SendTo(combo.Manager, response); + break; + } + + case MessageType.ServerShutdown: + if ((combo.Message.Flags & MessageFlags.Request) == MessageFlags.Request) + { + IrssLog.Info("Shutdown command received"); + Stop(); + } + + break; + + case MessageType.Ping: + { + IrssMessage response = new IrssMessage(MessageType.Echo, MessageFlags.Response, combo.Message.DataAsBytes); + SendTo(combo.Manager, response); + break; + } + + case MessageType.RegisterClient: + { + IrssMessage response = new IrssMessage(MessageType.RegisterClient, MessageFlags.Response); + + if (RegisterClient(combo.Manager)) + { + IRServerInfo irServerInfo = new IRServerInfo(); + + if (_pluginReceive != null) + irServerInfo.CanReceive = true; + + if (_pluginTransmit != null) + { + irServerInfo.CanLearn = (_pluginTransmit is ILearnIR); + irServerInfo.CanTransmit = true; + irServerInfo.Ports = (_pluginTransmit as ITransmitIR).AvailablePorts; + } + + response.DataAsBytes = irServerInfo.ToBytes(); + response.Flags |= MessageFlags.Success; + } + else + { + response.Flags |= MessageFlags.Failure; + } + + SendTo(combo.Manager, response); + break; + } + + case MessageType.UnregisterClient: + UnregisterClient(combo.Manager); + break; + + case MessageType.RegisterRepeater: + { + IrssMessage response = new IrssMessage(MessageType.RegisterRepeater, MessageFlags.Response); + + if (RegisterRepeater(combo.Manager)) + response.Flags |= MessageFlags.Success; + else + response.Flags |= MessageFlags.Failure; + + SendTo(combo.Manager, response); + break; + } + + case MessageType.UnregisterRepeater: + UnregisterRepeater(combo.Manager); + break; + } + } + catch (Exception ex) + { + IrssLog.Error(ex.ToString()); + IrssMessage response = new IrssMessage(MessageType.Error, MessageFlags.Notify, ex.Message); + SendTo(combo.Manager, response); + } + } + void ClientReceivedMessage(IrssMessage received) + { + IrssLog.Debug("Client message received: {0}, {1}", received.Type, received.Flags); + + try + { + switch (received.Type) + { + case MessageType.RegisterClient: + if ((received.Flags & MessageFlags.Response) == MessageFlags.Response) + { + if ((received.Flags & MessageFlags.Success) == MessageFlags.Success) + { + IrssLog.Info("Registered with host server"); + _registered = true; + } + else + { + IrssLog.Warn("Host server refused registration"); + _registered = false; + } + } + break; + + case MessageType.ServerShutdown: + if ((received.Flags & MessageFlags.Notify) == MessageFlags.Notify) + { + IrssLog.Warn("Host server has shut down"); + _registered = false; + } + break; + } + } + catch (Exception ex) + { + IrssLog.Error(ex.ToString()); + IrssMessage response = new IrssMessage(MessageType.Error, MessageFlags.Notify, ex.Message); + _client.Send(response); + } + } + + void LoadSettings() + { + try + { + XmlDocument doc = new XmlDocument(); + doc.Load(ConfigurationFile); + + _mode = (IRServerMode)Enum.Parse(typeof(IRServerMode), doc.DocumentElement.Attributes["Mode"].Value, true); + _hostComputer = doc.DocumentElement.Attributes["HostComputer"].Value; + _pluginNameReceive = doc.DocumentElement.Attributes["PluginReceive"].Value; + _pluginNameTransmit = doc.DocumentElement.Attributes["PluginTransmit"].Value; + } + catch (Exception ex) + { + IrssLog.Error(ex.ToString()); + + _mode = IRServerMode.ServerMode; + _hostComputer = String.Empty; + _pluginNameReceive = String.Empty; + _pluginNameTransmit = String.Empty; + } + } + void SaveSettings() + { + try + { + XmlTextWriter writer = new XmlTextWriter(ConfigurationFile, System.Text.Encoding.UTF8); + writer.Formatting = Formatting.Indented; + writer.Indentation = 1; + writer.IndentChar = (char)9; + writer.WriteStartDocument(true); + writer.WriteStartElement("settings"); // <settings> + + writer.WriteAttributeString("Mode", Enum.GetName(typeof(IRServerMode), _mode)); + writer.WriteAttributeString("HostComputer", _hostComputer); + writer.WriteAttributeString("PluginReceive", _pluginNameReceive); + writer.WriteAttributeString("PluginTransmit", _pluginNameTransmit); + + writer.WriteEndElement(); // </settings> + writer.WriteEndDocument(); + writer.Close(); + } + catch (Exception ex) + { + IrssLog.Error(ex.ToString()); + } + } + + } + +} Added: trunk/plugins/IR Server Suite/Input Service/InputServiceInstaller.cs =================================================================== --- trunk/plugins/IR Server Suite/Input Service/InputServiceInstaller.cs (rev 0) +++ trunk/plugins/IR Server Suite/Input Service/InputServiceInstaller.cs 2007-09-18 14:00:39 UTC (rev 937) @@ -0,0 +1,90 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Configuration.Install; +using System.Diagnostics; +using System.Management; +using System.ServiceProcess; + +namespace InputService +{ + + [RunInstaller(true)] + public class InputServiceInstaller : Installer + { + + public InputServiceInstaller() + { + //this.Committing += new InstallEventHandler(InputServiceInstaller_Committing); + this.AfterInstall += new InstallEventHandler(InputServiceInstaller_AfterInstall); + + ServiceProcessInstaller serviceProcessInstaller = new ServiceProcessInstaller(); + ServiceInstaller serviceInstaller = new ServiceInstaller(); + + // Service Account Information + serviceProcessInstaller.Account = ServiceAccount.LocalSystem; + serviceProcessInstaller.Username = null; + serviceProcessInstaller.Password = null; + + // Service Information + serviceInstaller.ServiceName = Program.ServiceName; + serviceInstaller.DisplayName = Program.ServiceDisplayName; + serviceInstaller.Description = Program.ServiceDescription; + serviceInstaller.StartType = ServiceStartMode.Automatic; + + this.Installers.Add(serviceProcessInstaller); + this.Installers.Add(serviceInstaller); + } + + /// <summary> + /// Code to execute after the install has completed. + /// </summary> + void InputServiceInstaller_AfterInstall(object sender, InstallEventArgs e) + { + // Start the service ... + using (ServiceController serviceController = new ServiceController(Program.ServiceName)) + serviceController.Start(); + } + + /// <summary> + /// Used to set the "Allow service to interact with the desktop" setting. + /// </summary> + void InputServiceInstaller_Committing(object sender, InstallEventArgs e) + { + ManagementBaseObject InParam = null; + ManagementBaseObject OutParam = null; + + try + { + ConnectionOptions coOptions = new ConnectionOptions(); + coOptions.Impersonation = ImpersonationLevel.Impersonate; + + ManagementScope mgmtScope = new ManagementScope(@"root\CIMV2", coOptions); + mgmtScope.Connect(); + + string path = string.Format("Win32_Service.Name='{0}'", Program.ServiceName); + + using (ManagementObject wmiService = new ManagementObject(path)) + { + InParam = wmiService.GetMethodParameters("Change"); + InParam["DesktopInteract"] = true; + OutParam = wmiService.InvokeMethod("Change", InParam, null); + } + } + catch (Exception ex) + { + Trace.WriteLine(ex.ToString()); + } + finally + { + if (InParam != null) + InParam.Dispose(); + + if (OutParam != null) + OutParam.Dispose(); + } + } + + } + +} Added: trunk/plugins/IR Server Suite/Input Service/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Input Service/Program.cs (rev 0) +++ trunk/plugins/IR Server Suite/Input Service/Program.cs 2007-09-18 14:00:39 UTC (rev 937) @@ -0,0 +1,134 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Configuration.Install; +using System.Diagnostics; +using System.IO; +using System.Reflection; +using System.ServiceProcess; +using System.Text; + +using Microsoft.Win32; + +using IrssUtils; +using IRServerPluginInterface; + +namespace InputService +{ + + static class Program + { + + #region Constants + + public const string ServiceName = "MPInputService"; + public const string ServiceDisplayName = "MediaPortal Input Service"; + public const string ServiceDescription = "Provides access to input devices"; + + #endregion Constants + + static void Main(string[] args) + { + if (args.Length >= 1) + { + TransactedInstaller transactedInstaller = new TransactedInstaller(); + InputServiceInstaller inputServiceInstaller = new InputServiceInstaller(); + transactedInstaller.Installers.Add(inputServiceInstaller); + + String path = String.Format("/assemblypath={0}", Assembly.GetExecutingAssembly().Location); + String[] cmdline = { path }; + + InstallContext installContext = new InstallContext(String.Empty, cmdline); + transactedInstaller.Context = installContext; + + if (args[0].Equals("/install", System.StringComparison.InvariantCultureIgnoreCase)) + transactedInstaller.Install(new Hashtable()); + else if (args[0].Equals("/uninstall", System.StringComparison.InvariantCultureIgnoreCase)) + transactedInstaller.Uninstall(null); + + return; + } + + InputService inputService = new InputService(); + ServiceBase.Run(inputService); + } + + /// <summary> + /// Retreives a list of available IR Server plugins. + /// </summary> + /// <returns>Array of plugin instances.</returns> + internal static IRServerPlugin[] AvailablePlugins() + { + try + { + List<IRServerPlugin> plugins = new List<IRServerPlugin>(); + + string installFolder = SystemRegistry.GetInstallFolder(); + if (String.IsNullOrEmpty(installFolder)) + return null; + + string[] files = Directory.GetFiles(installFolder + "\\IR Server Plugins\\", "*.dll", SearchOption.TopDirectoryOnly); + + foreach (string file in files) + { + try + { + Assembly assembly = Assembly.LoadFrom(file); + + Type[] types = assembly.GetExportedTypes(); + + foreach (Type type in types) + { + if (type.IsClass && !type.IsAbstract && type.IsSubclassOf(typeof(IRServerPlugin))) + { + IRServerPlugin plugin = (IRServerPlugin)Activator.CreateInstance(type); + if (plugin == null) + continue; + + plugins.Add(plugin); + } + } + } + catch (BadImageFormatException) + { + // Ignore Bad Image Format Exceptions, just keep checking for IR Server Plugins + } + catch (Exception ex) + { + Trace.WriteLine(ex.ToString()); + } + } + + return plugins.ToArray(); + } + catch (Exception ex) + { + Trace.WriteLine(ex.ToString()); + return null; + } + } + + /// <summary> + /// Retreives a plugin instance given the plugin name. + /// </summary> + /// <param name="pluginName">Name of plugin to instantiate.</param> + /// <returns>Plugin instance.</returns> + internal static IRServerPlugin GetPlugin(string pluginName) + { + if (String.IsNullOrEmpty(pluginName)) + throw new ArgumentNullException("pluginName"); + + IRServerPlugin[] serverPlugins = AvailablePlugins(); + if (serverPlugins == null) + throw new ApplicationException("No available plugins found."); + + foreach (IRServerPlugin plugin in serverPlugins) + if (plugin.Name.Equals(pluginName, StringComparison.InvariantCultureIgnoreCase)) + return plugin; + + return null; + } + + } + +} Added: trunk/plugins/IR Server Suite/Input Service/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Input Service/Properties/AssemblyInfo.cs (rev 0) +++ trunk/plugins/IR Server Suite/Input Service/Properties/AssemblyInfo.cs 2007-09-18 14:00:39 UTC (rev 937) @@ -0,0 +1,36 @@ +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Input Service")] +[assembly: AssemblyDescription("MediaPortal Input Service")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("and-81")] +[assembly: AssemblyProduct("MediaPortal Input Service")] +[assembly: AssemblyCopyright("Aaron Dinnage")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("f32fa19c-ea93-408e-b438-6aa36862a20e")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.3.4")] +[assembly: AssemblyFileVersion("1.0.3.4")] + +[assembly: CLSCompliant(true)] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-09-19 14:51:58
|
Revision: 941 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=941&view=rev Author: and-81 Date: 2007-09-19 07:51:51 -0700 (Wed, 19 Sep 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs trunk/plugins/IR Server Suite/IR Server Suite.sln trunk/plugins/IR Server Suite/Input Service/InputService.cs trunk/plugins/IR Server Suite/Input Service/InputServiceInstaller.cs trunk/plugins/IR Server Suite/Input Service/Program.cs Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2007-09-19 14:07:27 UTC (rev 940) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2007-09-19 14:51:51 UTC (rev 941) @@ -129,7 +129,7 @@ IRServerPlugin[] serverPlugins = AvailablePlugins(); if (serverPlugins == null) - throw new ApplicationException("No available plugins found."); + throw new FileNotFoundException("No available plugins found"); foreach (IRServerPlugin plugin in serverPlugins) if (plugin.Name.Equals(pluginName, StringComparison.InvariantCultureIgnoreCase)) Modified: trunk/plugins/IR Server Suite/IR Server Suite.sln =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite.sln 2007-09-19 14:07:27 UTC (rev 940) +++ trunk/plugins/IR Server Suite/IR Server Suite.sln 2007-09-19 14:51:51 UTC (rev 941) @@ -436,7 +436,8 @@ {BCAFDF45-70DD-46FD-8B98-880DDA585AD2}.Debug|x86.ActiveCfg = Debug|x86 {BCAFDF45-70DD-46FD-8B98-880DDA585AD2}.Debug|x86.Build.0 = Debug|x86 {BCAFDF45-70DD-46FD-8B98-880DDA585AD2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BCAFDF45-70DD-46FD-8B98-880DDA585AD2}.Release|x86.ActiveCfg = Release|Any CPU + {BCAFDF45-70DD-46FD-8B98-880DDA585AD2}.Release|x86.ActiveCfg = Release|x86 + {BCAFDF45-70DD-46FD-8B98-880DDA585AD2}.Release|x86.Build.0 = Release|x86 {905131F8-F8AC-4A65-A722-37783902D7B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {905131F8-F8AC-4A65-A722-37783902D7B8}.Debug|Any CPU.Build.0 = Debug|Any CPU {905131F8-F8AC-4A65-A722-37783902D7B8}.Debug|x86.ActiveCfg = Debug|x86 @@ -491,14 +492,16 @@ {327F54E5-D1DC-4297-BF2F-4283EB30FFB1}.Debug|x86.Build.0 = Debug|x86 {327F54E5-D1DC-4297-BF2F-4283EB30FFB1}.Release|Any CPU.ActiveCfg = Release|Any CPU {327F54E5-D1DC-4297-BF2F-4283EB30FFB1}.Release|Any CPU.Build.0 = Release|Any CPU - {327F54E5-D1DC-4297-BF2F-4283EB30FFB1}.Release|x86.ActiveCfg = Release|Any CPU + {327F54E5-D1DC-4297-BF2F-4283EB30FFB1}.Release|x86.ActiveCfg = Release|x86 + {327F54E5-D1DC-4297-BF2F-4283EB30FFB1}.Release|x86.Build.0 = Release|x86 {DDB52A4D-A670-411A-8273-8B1707C67028}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {DDB52A4D-A670-411A-8273-8B1707C67028}.Debug|Any CPU.Build.0 = Debug|Any CPU {DDB52A4D-A670-411A-8273-8B1707C67028}.Debug|x86.ActiveCfg = Debug|x86 {DDB52A4D-A670-411A-8273-8B1707C67028}.Debug|x86.Build.0 = Debug|x86 {DDB52A4D-A670-411A-8273-8B1707C67028}.Release|Any CPU.ActiveCfg = Release|Any CPU {DDB52A4D-A670-411A-8273-8B1707C67028}.Release|Any CPU.Build.0 = Release|Any CPU - {DDB52A4D-A670-411A-8273-8B1707C67028}.Release|x86.ActiveCfg = Release|Any CPU + {DDB52A4D-A670-411A-8273-8B1707C67028}.Release|x86.ActiveCfg = Release|x86 + {DDB52A4D-A670-411A-8273-8B1707C67028}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE Modified: trunk/plugins/IR Server Suite/Input Service/InputService.cs =================================================================== --- trunk/plugins/IR Server Suite/Input Service/InputService.cs 2007-09-19 14:07:27 UTC (rev 940) +++ trunk/plugins/IR Server Suite/Input Service/InputService.cs 2007-09-19 14:51:51 UTC (rev 941) @@ -96,14 +96,28 @@ #endregion Constructor - #region Dispose + #region IDisposable protected override void Dispose(bool disposing) { - base.Dispose(disposing); + try + { + if (disposing) + { + if (_server != null) + _server.Dispose(); + + if (_client != null) + _client.Dispose(); + } + } + finally + { + base.Dispose(disposing); + } } - #endregion Dispose + #endregion IDisposable #region Service Methods Modified: trunk/plugins/IR Server Suite/Input Service/InputServiceInstaller.cs =================================================================== --- trunk/plugins/IR Server Suite/Input Service/InputServiceInstaller.cs 2007-09-19 14:07:27 UTC (rev 940) +++ trunk/plugins/IR Server Suite/Input Service/InputServiceInstaller.cs 2007-09-19 14:51:51 UTC (rev 941) @@ -49,6 +49,7 @@ /// <summary> /// Used to set the "Allow service to interact with the desktop" setting. /// </summary> + /* void InputServiceInstaller_Committing(object sender, InstallEventArgs e) { ManagementBaseObject InParam = null; @@ -71,9 +72,9 @@ OutParam = wmiService.InvokeMethod("Change", InParam, null); } } - catch (Exception ex) + catch { - Trace.WriteLine(ex.ToString()); + throw; } finally { @@ -84,7 +85,7 @@ OutParam.Dispose(); } } - + */ } } Modified: trunk/plugins/IR Server Suite/Input Service/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Input Service/Program.cs 2007-09-19 14:07:27 UTC (rev 940) +++ trunk/plugins/IR Server Suite/Input Service/Program.cs 2007-09-19 14:51:51 UTC (rev 941) @@ -120,7 +120,7 @@ IRServerPlugin[] serverPlugins = AvailablePlugins(); if (serverPlugins == null) - throw new ApplicationException("No available plugins found."); + throw new FileNotFoundException("No available plugins found"); foreach (IRServerPlugin plugin in serverPlugins) if (plugin.Name.Equals(pluginName, StringComparison.InvariantCultureIgnoreCase)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-09-26 07:34:30
|
Revision: 956 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=956&view=rev Author: and-81 Date: 2007-09-26 00:34:18 -0700 (Wed, 26 Sep 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.Designer.cs trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs 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/Configuration.cs trunk/plugins/IR Server Suite/Applications/Translator/EventSchedule.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.Designer.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/EditProgramForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/GetKeyCodeForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MacroEditor.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/Translator/Translator.csproj trunk/plugins/IR Server Suite/Applications/Tray Launcher/GetKeyCodeForm.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/Setup.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/Applications/Virtual Remote/Program.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/RemoteButton.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs trunk/plugins/IR Server Suite/Common/IrssComms/Client.cs trunk/plugins/IR Server Suite/Common/IrssComms/ClientManager.cs trunk/plugins/IR Server Suite/Common/IrssComms/IrssMessage.cs trunk/plugins/IR Server Suite/Common/IrssComms/MessageManagerCombo.cs trunk/plugins/IR Server Suite/Common/IrssComms/Server.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/ServerAddress.Designer.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/ServerAddress.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/ServerAddress.resx trunk/plugins/IR Server Suite/Common/IrssUtils/IrssLog.cs trunk/plugins/IR Server Suite/Common/IrssUtils/IrssUtils.csproj trunk/plugins/IR Server Suite/Common/IrssUtils/Win32.cs trunk/plugins/IR Server Suite/Common/MPUtils/ExternalChannelConfig.cs trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IRServerPluginInterface.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/CSocketPacket.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Advanced.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverReplacement.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverVista.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverXP.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrCode.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrDecoder.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Keyboard.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MceDetectionData.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Mouse.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/NotifyWindow.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Pronto.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/RemoteDetectionData.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Win32ErrorCodes.cs trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/UirtTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/CreateIRFile.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLircServer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/ReceiverWindow.cs trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Windows Message Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/X10Transceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/XBCDRC Receiver/XBCDRC Receiver.cs trunk/plugins/IR Server Suite/IR Server Suite.sln trunk/plugins/IR Server Suite/Input Service/InputService.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/Forms/SetupForm.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/SetupForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MP Blast Zone Plugin.csproj trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MPBlastZonePlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Menu.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/MultiMapNameBox.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/InputHandler.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/InputMapper/InputMappingForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MP Control Plugin.csproj 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/Forms/ExternalChannels.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/SetupForm.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/SetupForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/SetupForm.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/StbSetup.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2 Blaster Plugin.csproj trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/ExternalChannels.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/PluginSetup.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/PluginSetup.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/StbSetup.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3 Blaster Plugin.csproj trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs Removed Paths: ------------- trunk/plugins/IR Server Suite/Applications/Translator/Forms/BlastCommand.Designer.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/BlastCommand.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/BlastCommand.resx trunk/plugins/IR Server Suite/Applications/Translator/Forms/LearnIR.Designer.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/LearnIR.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/LearnIR.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/BlastCommand.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/BlastCommand.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/BlastCommand.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/LearnIR.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/LearnIR.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/LearnIR.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/BlastCommand.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/BlastCommand.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/BlastCommand.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/LearnIR.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/LearnIR.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/LearnIR.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/BlastCommand.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/BlastCommand.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/BlastCommand.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/LearnIR.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/LearnIR.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/LearnIR.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/BlastCommand.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/BlastCommand.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/BlastCommand.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/LearnIR.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/LearnIR.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/LearnIR.resx Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.Designer.cs 2007-09-24 19:20:56 UTC (rev 955) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.Designer.cs 2007-09-26 07:34:18 UTC (rev 956) @@ -37,7 +37,6 @@ this.buttonDisconnect = new System.Windows.Forms.Button(); this.buttonShutdownServer = new System.Windows.Forms.Button(); this.listBoxStatus = new System.Windows.Forms.ListBox(); - this.buttonPing = new System.Windows.Forms.Button(); this.groupBoxStatus = new System.Windows.Forms.GroupBox(); this.groupBoxRemoteButton = new System.Windows.Forms.GroupBox(); this.labelCustomButton = new System.Windows.Forms.Label(); @@ -141,18 +140,6 @@ this.listBoxStatus.TabIndex = 0; this.toolTips.SetToolTip(this.listBoxStatus, "Status messages"); // - // buttonPing - // - this.buttonPing.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonPing.Location = new System.Drawing.Point(296, 16); - this.buttonPing.Name = "buttonPing"; - this.buttonPing.Size = new System.Drawing.Size(64, 24); - this.buttonPing.TabIndex = 3; - this.buttonPing.Text = "Ping"; - this.toolTips.SetToolTip(this.buttonPing, "Ping the server"); - this.buttonPing.UseVisualStyleBackColor = true; - this.buttonPing.Click += new System.EventHandler(this.buttonPing_Click); - // // groupBoxStatus // this.groupBoxStatus.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) @@ -266,7 +253,6 @@ this.groupBoxCommands.Controls.Add(this.buttonBlast); this.groupBoxCommands.Controls.Add(this.buttonLearnIR); this.groupBoxCommands.Controls.Add(this.buttonShutdownServer); - this.groupBoxCommands.Controls.Add(this.buttonPing); this.groupBoxCommands.Location = new System.Drawing.Point(8, 80); this.groupBoxCommands.Name = "groupBoxCommands"; this.groupBoxCommands.Size = new System.Drawing.Size(440, 48); @@ -343,7 +329,6 @@ private System.Windows.Forms.Button buttonDisconnect; private System.Windows.Forms.Button buttonShutdownServer; private System.Windows.Forms.ListBox listBoxStatus; - private System.Windows.Forms.Button buttonPing; private System.Windows.Forms.GroupBox groupBoxStatus; private System.Windows.Forms.GroupBox groupBoxRemoteButton; private System.Windows.Forms.NumericUpDown numericUpDownButton; Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-09-24 19:20:56 UTC (rev 955) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-09-26 07:34:18 UTC (rev 956) @@ -20,7 +20,7 @@ namespace DebugClient { - public partial class MainForm : Form + partial class MainForm : Form { #region Enumerations @@ -107,11 +107,10 @@ Client _client = null; - string _serverHost = Environment.MachineName; + string _serverHost = "localhost"; string _learnIRFilename = null; bool _registered = false; - int _echoID = -1; IRServerInfo _irServerInfo = new IRServerInfo(); @@ -143,12 +142,14 @@ comboBoxPort.Items.Add("None"); comboBoxPort.SelectedIndex = 0; + comboBoxComputer.Items.Clear(); + comboBoxComputer.Items.Add("localhost"); + ArrayList networkPCs = IrssUtils.Win32.GetNetworkComputers(); if (networkPCs != null) - { comboBoxComputer.Items.AddRange(networkPCs.ToArray()); - comboBoxComputer.Text = _serverHost; - } + + comboBoxComputer.Text = _serverHost; } private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { @@ -192,9 +193,8 @@ { byte[] dataBytes = received.DataAsBytes; - FileStream file = new FileStream(_learnIRFilename, FileMode.Create); - file.Write(dataBytes, 0, dataBytes.Length); - file.Close(); + using (FileStream file = File.Create(_learnIRFilename)) + file.Write(dataBytes, 0, dataBytes.Length); } _learnIRFilename = null; @@ -204,10 +204,6 @@ _registered = false; return; - case MessageType.Echo: - _echoID = BitConverter.ToInt32(received.DataAsBytes, 0); - return; - case MessageType.Error: _learnIRFilename = null; this.Invoke(_addStatusLine, new Object[] { received.DataAsString }); @@ -247,21 +243,21 @@ { try { - if (!File.Exists(fileName)) - return false; + using (FileStream file = File.OpenRead(fileName)) + { + if (file.Length == 0) + throw new IOException(String.Format("Cannot Blast. IR file \"{0}\" has no data, possible IR learn failure", fileName)); - FileStream file = new FileStream(fileName, FileMode.Open); + byte[] outData = new byte[4 + port.Length + file.Length]; - byte[] outData = new byte[4 + port.Length + file.Length]; + BitConverter.GetBytes(port.Length).CopyTo(outData, 0); + Encoding.ASCII.GetBytes(port).CopyTo(outData, 4); - BitConverter.GetBytes(port.Length).CopyTo(outData, 0); - Encoding.ASCII.GetBytes(port).CopyTo(outData, 4); + file.Read(outData, 4 + port.Length, (int)file.Length); - file.Read(outData, 4 + port.Length, (int)file.Length); - file.Close(); - - IrssMessage message = new IrssMessage(MessageType.BlastIR, MessageFlags.Request, outData); - _client.Send(message); + IrssMessage message = new IrssMessage(MessageType.BlastIR, MessageFlags.Request, outData); + _client.Send(message); + } } catch (Exception ex) { @@ -303,16 +299,14 @@ Thread.Sleep(1000); } - bool StartClient() + bool StartClient(IPEndPoint endPoint) { if (_client != null) return false; ClientMessageSink sink = new ClientMessageSink(ReceivedMessage); - IPAddress serverAddress = Client.GetIPFromName(_serverHost); - - _client = new Client(serverAddress, 24000, sink); + _client = new Client(endPoint, sink); _client.CommsFailureCallback = new WaitCallback(CommsFailure); _client.ConnectCallback = new WaitCallback(Connected); _client.DisconnectCallback = new WaitCallback(Disconnected); @@ -332,7 +326,7 @@ if (_client == null) return; - _client.Stop(); + _client.Dispose(); _client = null; } @@ -353,7 +347,10 @@ _serverHost = comboBoxComputer.Text; - StartClient(); + IPAddress serverIP = Client.GetIPFromName(_serverHost); + IPEndPoint endPoint = new IPEndPoint(serverIP, IrssComms.Server.DefaultPort); + + StartClient(endPoint); } catch (Exception ex) { @@ -465,33 +462,7 @@ AddStatusLine(ex.Message); } } - private void buttonPing_Click(object sender, EventArgs e) - { - AddStatusLine("Ping Server"); - if (_client == null) - { - AddStatusLine(" - Not connected"); - return; - } - - if (!_client.Connected) - { - AddStatusLine(" - Connecting..."); - return; - } - - try - { - IrssMessage message = new IrssMessage(MessageType.Ping, MessageFlags.Request, BitConverter.GetBytes(24)); - _client.Send(message); - } - catch (Exception ex) - { - AddStatusLine(ex.Message); - } - } - private void comboBoxRemoteButtons_SelectedIndexChanged(object sender, EventArgs e) { if (comboBoxRemoteButtons.SelectedItem.ToString() == "Custom") Modified: trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2007-09-24 19:20:56 UTC (rev 955) +++ trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2007-09-26 07:34:18 UTC (rev 956) @@ -24,7 +24,6 @@ static Client _client = null; static bool _registered = false; - static int _echoID = -1; static string _serverHost = null; @@ -87,70 +86,76 @@ ShowHelp(); } - else if (StartClient()) + else { - Thread.Sleep(250); + IPAddress serverIP = Client.GetIPFromName(_serverHost); - // Wait for registered ... Give up after 10 seconds ... - int attempt = 0; - while (!_registered) + IPEndPoint endPoint = new IPEndPoint(serverIP, IrssComms.Server.DefaultPort); + + if (StartClient(endPoint)) { - if (++attempt >= 10) - break; - else - Thread.Sleep(1000); - } + Thread.Sleep(250); - if (_registered) - { - string fileName; - foreach (String command in irCommands) + // Wait for registered ... Give up after 10 seconds ... + int attempt = 0; + while (!_registered) { - if (_treatAsChannelNumber) + if (++attempt >= 10) + break; + else + Thread.Sleep(1000); + } + + if (_registered) + { + string fileName; + foreach (String command in irCommands) { - Info("Processing channel: {0}", command); - - StringBuilder channelNumber = new StringBuilder(command); - - if (_padChannelNumber > 0) + if (_treatAsChannelNumber) { - for (int index = 0; index < _padChannelNumber - command.Length; index++) - channelNumber.Insert(0, '0'); + Info("Processing channel: {0}", command); - Info("Padding channel number: {0} becomes {1}", command, channelNumber.ToString()); - } + StringBuilder channelNumber = new StringBuilder(command); - foreach (char digit in channelNumber.ToString()) - { - if (digit.Equals('~')) + if (_padChannelNumber > 0) { - Thread.Sleep(500); + for (int index = 0; index < _padChannelNumber - command.Length; index++) + channelNumber.Insert(0, '0'); + + Info("Padding channel number: {0} becomes {1}", command, channelNumber.ToString()); } - else + + foreach (char digit in channelNumber.ToString()) { - fileName = Common.FolderIRCommands + digit + Common.FileExtensionIR; - BlastIR(fileName, _blastPort); + if (digit.Equals('~')) + { + Thread.Sleep(500); + } + else + { + fileName = Common.FolderIRCommands + digit + Common.FileExtensionIR; + BlastIR(fileName, _blastPort); + } } } + else if (command.StartsWith("~")) + { + Thread.Sleep(command.Length * 500); + } + else + { + fileName = Common.FolderIRCommands + command; + BlastIR(fileName, _blastPort); + } } - else if (command.StartsWith("~")) - { - Thread.Sleep(command.Length * 500); - } - else - { - fileName = Common.FolderIRCommands + command; - BlastIR(fileName, _blastPort); - } + + Thread.Sleep(500); } - - Thread.Sleep(500); + else + { + Warn("Failed to register with server host \"{0}\", blasting not sent", _serverHost); + } } - else - { - Warn("Failed to register with server host \"{0}\", blasting not sent", _serverHost); - } - } } else // Give help ... @@ -240,16 +245,14 @@ Thread.Sleep(1000); } - static bool StartClient() + static bool StartClient(IPEndPoint endPoint) { if (_client != null) return false; ClientMessageSink sink = new ClientMessageSink(ReceivedMessage); - IPAddress serverAddress = Client.GetIPFromName(_serverHost); - - _client = new Client(serverAddress, 24000, sink); + _client = new Client(endPoint, sink); _client.CommsFailureCallback = new WaitCallback(CommsFailure); _client.ConnectCallback = new WaitCallback(Connected); _client.DisconnectCallback = new WaitCallback(Disconnected); @@ -269,7 +272,7 @@ if (_client == null) return; - _client.Stop(); + _client.Dispose(); _client = null; } @@ -307,10 +310,6 @@ Warn("IR Server Shutdown - Blasting disabled until IR Server returns"); break; - case MessageType.Echo: - _echoID = BitConverter.ToInt32(received.DataAsBytes, 0); - break; - case MessageType.Error: Warn(received.DataAsString); break; @@ -324,18 +323,21 @@ static void BlastIR(string fileName, string port) { - FileStream file = new FileStream(fileName, FileMode.Open); + using (FileStream file = File.OpenRead(fileName)) + { + if (file.Length == 0) + throw new IOException(String.Format("Cannot Blast. IR file \"{0}\" has no data, possible IR learn failure", fileName)); - byte[] outData = new byte[4 + port.Length + file.Length]; + byte[] outData = new byte[4 + port.Length + file.Length]; - BitConverter.GetBytes(port.Length).CopyTo(outData, 0); - Encoding.ASCII.GetBytes(port).CopyTo(outData, 4); + BitConverter.GetBytes(port.Length).CopyTo(outData, 0); + Encoding.ASCII.GetBytes(port).CopyTo(outData, 4); - file.Read(outData, 4 + port.Length, (int)file.Length); - file.Close(); + file.Read(outData, 4 + port.Length, (int)file.Length); - IrssMessage message = new IrssMessage(MessageType.BlastIR, MessageFlags.Request | MessageFlags.ForceNotRespond, outData); - _client.Send(message); + IrssMessage message = new IrssMessage(MessageType.BlastIR, MessageFlags.Request | MessageFlags.ForceNotRespond, outData); + _client.Send(message); + } } #region Log Commands Modified: trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2007-09-24 19:20:56 UTC (rev 955) +++ trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2007-09-26 07:34:18 UTC (rev 956) @@ -25,7 +25,6 @@ static Client _client = null; static bool _registered = false; - static int _echoID = -1; static string _serverHost = null; @@ -86,69 +85,77 @@ ShowHelp(); } - else if (StartClient()) + else { - Thread.Sleep(250); + IPAddress serverIP = Client.GetIPFromName(_serverHost); - // Wait for registered ... Give up after 10 seconds ... - int attempt = 0; - while (!_registered) + IPEndPoint endPoint = new IPEndPoint(serverIP, IrssComms.Server.DefaultPort); + + if (StartClient(endPoint)) { - if (++attempt >= 10) - break; - else - Thread.Sleep(1000); - } + Thread.Sleep(250); - if (_registered) - { - string fileName; - foreach (String command in irCommands) + // Wait for registered ... Give up after 10 seconds ... + int attempt = 0; + while (!_registered) { - if (_treatAsChannelNumber) + if (++attempt >= 10) + break; + else + Thread.Sleep(1000); + } + + if (_registered) + { + string fileName; + foreach (String command in irCommands) { - IrssLog.Info("Processing channel: {0}", command); - - StringBuilder channelNumber = new StringBuilder(command); - - if (_padChannelNumber > 0) + if (_treatAsChannelNumber) { - for (int index = 0; index < _padChannelNumber - command.Length; index++) - channelNumber.Insert(0, '0'); + IrssLog.Info("Processing channel: {0}", command); - IrssLog.Info("Padding channel number: {0} becomes {1}", command, channelNumber.ToString()); - } + StringBuilder channelNumber = new StringBuilder(command); - foreach (char digit in channelNumber.ToString()) - { - if (digit.Equals('~')) + if (_padChannelNumber > 0) { - Thread.Sleep(500); + for (int index = 0; index < _padChannelNumber - command.Length; index++) + channelNumber.Insert(0, '0'); + + IrssLog.Info("Padding channel number: {0} becomes {1}", command, channelNumber.ToString()); } - else + + foreach (char digit in channelNumber.ToString()) { - fileName = Common.FolderIRCommands + digit + Common.FileExtensionIR; - BlastIR(fileName, _blastPort); + if (digit.Equals('~')) + { + Thread.Sleep(500); + } + else + { + fileName = Common.FolderIRCommands + digit + Common.FileExtensionIR; + BlastIR(fileName, _blastPort); + } } } + else if (command.StartsWith("~")) + { + Thread.Sleep(command.Length * 500); + } + else + { + fileName = Common.FolderIRCommands + command; + BlastIR(fileName, _blastPort); + } } - else if (command.StartsWith("~")) - { - Thread.Sleep(command.Length * 500); - } - else - { - fileName = Common.FolderIRCommands + command; - BlastIR(fileName, _blastPort); - } + + Thread.Sleep(500); } + else + { + IrssLog.Warn("Failed to register with server host \"{0}\", blasting not sent", _serverHost); + } - Thread.Sleep(500); } - else - { - IrssLog.Warn("Failed to register with server host \"{0}\", blasting not sent", _serverHost); - } } } @@ -202,16 +209,14 @@ Thread.Sleep(1000); } - static bool StartClient() + static bool StartClient(IPEndPoint endPoint) { if (_client != null) return false; ClientMessageSink sink = new ClientMessageSink(ReceivedMessage); - IPAddress serverAddress = Client.GetIPFromName(_serverHost); - - _client = new Client(serverAddress, 24000, sink); + _client = new Client(endPoint, sink); _client.CommsFailureCallback = new WaitCallback(CommsFailure); _client.ConnectCallback = new WaitCallback(Connected); _client.DisconnectCallback = new WaitCallback(Disconnected); @@ -231,7 +236,7 @@ if (_client == null) return; - _client.Stop(); + _client.Dispose(); _client = null; } @@ -269,10 +274,6 @@ IrssLog.Warn("IR Server Shutdown - Blasting disabled until IR Server returns"); break; - case MessageType.Echo: - _echoID = BitConverter.ToInt32(received.DataAsBytes, 0); - break; - case MessageType.Error: IrssLog.Warn(received.DataAsString); break; @@ -286,18 +287,21 @@ static void BlastIR(string fileName, string port) { - FileStream file = new FileStream(fileName, FileMode.Open); + using (FileStream file = File.OpenRead(fileName)) + { + if (file.Length == 0) + throw new IOException(String.Format("Cannot Blast. IR file \"{0}\" has no data, possible IR learn failure", fileName)); - byte[] outData = new byte[4 + port.Length + file.Length]; + byte[] outData = new byte[4 + port.Length + file.Length]; - BitConverter.GetBytes(port.Length).CopyTo(outData, 0); - Encoding.ASCII.GetBytes(port).CopyTo(outData, 4); + BitConverter.GetBytes(port.Length).CopyTo(outData, 0); + Encoding.ASCII.GetBytes(port).CopyTo(outData, 4); - file.Read(outData, 4 + port.Length, (int)file.Length); - file.Close(); + file.Read(outData, 4 + port.Length, (int)file.Length); - IrssMessage message = new IrssMessage(MessageType.BlastIR, MessageFlags.Request | MessageFlags.ForceNotRespond, outData); - _client.Send(message); + IrssMessage message = new IrssMessage(MessageType.BlastIR, MessageFlags.Request | MessageFlags.ForceNotRespond, outData); + _client.Send(message); + } } } Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs 2007-09-24 19:20:56 UTC (rev 955) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs 2007-09-26 07:34:18 UTC (rev 956) @@ -15,7 +15,7 @@ namespace IRServer { - public partial class Config : Form + partial class Config : Form { #region Variables @@ -40,19 +40,24 @@ set { _hostComputer = value; } } - public string PluginReceive + public string[] PluginReceive { get { + List<string> receivers = new List<string>(); + SourceGrid.Cells.CheckBox checkBox; for (int row = 1; row < gridPlugins.RowsCount; row++) { checkBox = gridPlugins[row, 1] as SourceGrid.Cells.CheckBox; if (checkBox != null && checkBox.Checked) - return gridPlugins[row, 0].DisplayText; + receivers.Add(gridPlugins[row, 0].DisplayText); } - return String.Empty; + if (receivers.Count == 0) + return null; + else + return receivers.ToArray(); } set { @@ -63,7 +68,9 @@ if (checkBox == null) continue; - if (gridPlugins[row, 0].DisplayText.Equals(value, StringComparison.InvariantCultureIgnoreCase)) + if (value == null) + checkBox.Checked = false; + else if (Array.IndexOf<string>(value, gridPlugins[row, 0].DisplayText) != -1) checkBox.Checked = true; else checkBox.Checked = false; @@ -173,13 +180,13 @@ gridPlugins[row, 0] = nameCell; - if (transceiver is IRemoteReceiver) + if (transceiver is IRemoteReceiver || transceiver is IMouseReceiver || transceiver is IKeyboardReceiver) { SourceGrid.Cells.CheckBox checkbox = new SourceGrid.Cells.CheckBox(); - SourceGrid.Cells.Controllers.CustomEvents checkboxcontroller = new SourceGrid.Cells.Controllers.CustomEvents(); - checkboxcontroller.ValueChanged += new EventHandler(ReceiveChanged); - checkbox.Controller.AddController(checkboxcontroller); + //SourceGrid.Cells.Controllers.CustomEvents checkboxcontroller = new SourceGrid.Cells.Controllers.CustomEvents(); + //checkboxcontroller.ValueChanged += new EventHandler(ReceiveChanged); + //checkbox.Controller.AddController(checkboxcontroller); gridPlugins[row, 1] = checkbox; } @@ -259,7 +266,7 @@ if (transceiver.Name == plugin) (transceiver as IConfigure).Configure(); } - + /* private void ReceiveChanged(object sender, EventArgs e) { SourceGrid.CellContext context = (SourceGrid.CellContext)sender; @@ -277,6 +284,7 @@ checkBox.Checked = false; } } + */ private void TransmitChanged(object sender, EventArgs e) { SourceGrid.CellContext context = (SourceGrid.CellContext)sender; Modified: trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-09-24 19:20:56 UTC (rev 955) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-09-26 07:34:18 UTC (rev 956) @@ -62,18 +62,16 @@ Server _server = null; Client _client = null; - int _serverPort = 24000; - IRServerMode _mode; string _hostComputer; bool _registered = false; // Used for relay and repeater modes. - string _pluginNameReceive = String.Empty; - IRServerPlugin _pluginReceive = null; + string[] _pluginNameReceive; + IRServerPlugin[] _pluginReceive; - string _pluginNameTransmit = String.Empty; - IRServerPlugin _pluginTransmit = null; + string _pluginNameTransmit; + IRServerPlugin _pluginTransmit; bool _inConfiguration = false; @@ -115,111 +113,132 @@ _pluginReceive = null; _pluginTransmit = null; - if (String.IsNullOrEmpty(_pluginNameReceive) && String.IsNullOrEmpty(_pluginNameTransmit)) + if (_pluginNameReceive == null && String.IsNullOrEmpty(_pluginNameTransmit)) { - IrssLog.Warn("No transmit or receive plugin loaded"); + IrssLog.Warn("No transmit or receive plugins loaded"); } else { - if (String.IsNullOrEmpty(_pluginNameReceive)) + if (_pluginNameReceive == null) { - IrssLog.Warn("No receiver plugin loaded"); + IrssLog.Warn("No receiver plugins loaded"); } else { - _pluginReceive = Program.GetPlugin(_pluginNameReceive); + List<IRServerPlugin> plugins = new List<IRServerPlugin>(_pluginNameReceive.Length); + + for (int index = 0; index < _pluginNameReceive.Length; index++) + { + string pluginName = _pluginNameReceive[index]; + + IRServerPlugin plugin = Program.GetPlugin(pluginName); + + if (plugin == null) + { + IrssLog.Warn("Receiver plugin not found: {0}", pluginName); + } + else + { + plugins.Add(plugin); + + if (!String.IsNullOrEmpty(_pluginNameTransmit) && plugin.Name.Equals(_pluginNameTransmit)) + _pluginTransmit = plugin; + } + } + + _pluginReceive = plugins.ToArray(); } - if (_pluginNameTransmit.Equals(_pluginNameReceive, StringComparison.InvariantCultureIgnoreCase)) + if (String.IsNullOrEmpty(_pluginNameTransmit)) { - _pluginTransmit = _pluginReceive; - IrssLog.Info("Using the same plugin for transmit and receive"); - } - else if (String.IsNullOrEmpty(_pluginNameTransmit)) - { IrssLog.Warn("No transmit plugin loaded"); } - else + else if (_pluginTransmit != null) { _pluginTransmit = Program.GetPlugin(_pluginNameTransmit); - } + } } switch (_mode) { case IRServerMode.ServerMode: - { - StartServer(); + StartServer(); + IrssLog.Info("Started in Server Mode"); + break; - IrssLog.Info("Started in Server Mode"); - break; - } - case IRServerMode.RelayMode: - { - if (StartRelay()) - IrssLog.Info("Started in Relay Mode"); - else - IrssLog.Error("Failed to start in Relay Mode"); - break; - } + if (StartRelay()) + IrssLog.Info("Started in Relay Mode"); + else + IrssLog.Error("Failed to start in Relay Mode"); + break; case IRServerMode.RepeaterMode: - { - if (StartRepeater()) - IrssLog.Info("Started in Repeater Mode"); - else - IrssLog.Error("Failed to start in Repeater Mode"); - break; - } + if (StartRepeater()) + IrssLog.Info("Started in Repeater Mode"); + else + IrssLog.Error("Failed to start in Repeater Mode"); + break; } // Start plugin(s) ... + + bool startedTransmit = false; + if (_pluginReceive != null) { - try + foreach (IRServerPlugin plugin in _pluginReceive) { - if (_pluginReceive.Start()) - IrssLog.Info("Receiver plugin started: \"{0}\"", _pluginNameReceive); - else - IrssLog.Error("Failed to start receive plugin: \"{0}\"", _pluginNameReceive); - } - catch (Exception ex) - { - IrssLog.Error("Failed to start receive plugin: \"{0}\"", _pluginNameReceive); - IrssLog.Error(ex.ToString()); - } - } - - if (!_pluginNameTransmit.Equals(_pluginNameReceive, StringComparison.InvariantCultureIgnoreCase)) - { - if (_pluginTransmit != null) - { try { - if (_pluginTransmit.Start()) - IrssLog.Info("Transmit plugin started: \"{0}\"", _pluginNameTransmit); + if (plugin.Start()) + { + if (plugin is IRemoteReceiver) + (plugin as IRemoteReceiver).RemoteCallback += new RemoteHandler(RemoteHandlerCallback); + + if (plugin is IKeyboardReceiver) + (plugin as IKeyboardReceiver).KeyboardCallback += new KeyboardHandler(KeyboardHandlerCallback); + + if (plugin is IMouseReceiver) + (plugin as IMouseReceiver).MouseCallback += new MouseHandler(MouseHandlerCallback); + + if (plugin.Name.Equals(_pluginTransmit.Name)) + { + startedTransmit = true; + IrssLog.Info("Transmit and Receive plugin started: \"{0}\"", plugin.Name); + } + else + { + IrssLog.Info("Receiver plugin started: \"{0}\"", plugin.Name); + } + } else - IrssLog.Error("Failed to start transmit plugin: \"{0}\"", _pluginNameTransmit); + { + IrssLog.Error("Failed to start receive plugin: \"{0}\"", plugin.Name); + } } catch (Exception ex) { - IrssLog.Error("Failed to start transmit plugin: \"{0}\"", _pluginNameTransmit); + IrssLog.Error("Failed to start receive plugin: \"{0}\"", plugin.Name); IrssLog.Error(ex.ToString()); } } } - - if (_pluginReceive != null) + + if (_pluginTransmit != null && !startedTransmit) { - if (_pluginReceive is IRemoteReceiver) - (_pluginReceive as IRemoteReceiver).RemoteCallback += new RemoteHandler(RemoteHandlerCallback); - - if (_pluginReceive is IKeyboardReceiver) - (_pluginReceive as IKeyboardReceiver).KeyboardCallback += new KeyboardHandler(KeyboardHandlerCallback); - - if (_pluginReceive is IMouseReceiver) - (_pluginReceive as IMouseReceiver).MouseCallback += new MouseHandler(MouseHandlerCallback); + try + { + if (_pluginTransmit.Start()) + IrssLog.Info("Transmit plugin started: \"{0}\"", _pluginNameTransmit); + else + IrssLog.Error("Failed to start transmit plugin: \"{0}\"", _pluginNameTransmit); + } + catch (Exception ex) + { + IrssLog.Error("Failed to start transmit plugin: \"{0}\"", _pluginNameTransmit); + IrssLog.Error(ex.ToString()); + } } _notifyIcon.Visible = true; @@ -254,32 +273,52 @@ SendToAll(message); } + // Stop Plugin(s) ... + + bool stoppedTransmit = false; + if (_pluginReceive != null) { - if (_pluginReceive is IRemoteReceiver) - (_pluginReceive as IRemoteReceiver).RemoteCallback -= new RemoteHandler(RemoteHandlerCallback); - - if (_pluginReceive is IKeyboardReceiver) - (_pluginReceive as IKeyboardReceiver).KeyboardCallback -= new KeyboardHandler(KeyboardHandlerCallback); - - if (_pluginReceive is IMouseReceiver) - (_pluginReceive as IMouseReceiver).MouseCallback -= new MouseHandler(MouseHandlerCallback); + foreach (IRServerPlugin plugin in _pluginReceive) + { + try + { + if (plugin is IRemoteReceiver) + (plugin as IRemoteReceiver).RemoteCallback -= new RemoteHandler(RemoteHandlerCallback); + + if (plugin is IKeyboardReceiver) + (plugin as IKeyboardReceiver).KeyboardCallback -= new KeyboardHandler(KeyboardHandlerCallback); + + if (plugin is IMouseReceiver) + (plugin as IMouseReceiver).MouseCallback -= new MouseHandler(MouseHandlerCallback); + + plugin.Stop(); + + if (plugin == _pluginTransmit) + { + stoppedTransmit = true; + IrssLog.Info("Transmit and Receive plugin stopped: \"{0}\"", plugin.Name); + } + else + { + IrssLog.Info("Receiver plugin stopped: \"{0}\"", plugin.Name); + } + } + catch (Exception ex) + { + IrssLog.Error(ex.ToString()); + } + } + + _pluginReceive = null; } - - // Stop Plugin(s) + try { - if (_pluginReceive != null) - _pluginReceive.Stop(); - } - catch (Exception ex) - { - IrssLog.Error(ex.ToString()); - } - try - { - if (_pluginTransmit != null && _pluginTransmit != _pluginReceive) + if (_pluginTransmit != null && !stoppedTransmit) _pluginTransmit.Stop(); + + _pluginTransmit = null; } catch (Exception ex) { @@ -337,7 +376,7 @@ _pluginNameReceive = config.PluginReceive; _pluginNameTransmit = config.PluginTransmit; - SaveSettings(); // Save Settings + SaveSettings(); Start(); // Restart communications } @@ -361,7 +400,7 @@ _registeredRepeaters = new List<ClientManager>(); ServerMessageSink sink = new ServerMessageSink(ServerReceivedMessage); - _server = new Server(_serverPort, sink); + _server = new Server(Server.DefaultPort, sink); _server.Start(); } @@ -370,7 +409,7 @@ if (_server == null) return; - _server.Stop(); + _server.Dispose(); _server = null; _registeredClients.Clear(); @@ -410,16 +449,14 @@ Thread.Sleep(1000); } - bool StartClient() + bool StartClient(IPEndPoint endPoint) { if (_client != null) return false; ClientMessageSink sink = new ClientMessageSink(ClientReceivedMessage); - IPAddress serverAddress = Client.GetIPFromName(_hostComputer); - - _client = new Client(serverAddress, 24000, sink); + _client = new Client(endPoint, sink); _client.CommsFailureCallback = new WaitCallback(CommsFailure); _client.ConnectCallback = new WaitCallback(Connected); _client.DisconnectCallback = new WaitCallback(Disconnected); @@ -439,17 +476,21 @@ if (_client == null) return; - _client.Stop(); + _client.Dispose(); _client = null; } - + bool StartRelay() { try { StartServer(); - StartClient(); + IPAddress serverIP = Client.GetIPFromName(_hostComputer); + IPEndPoint endPoint = new IPEndPoint(serverIP, IrssComms.Server.DefaultPort); + + StartClient(endPoint); + return true; } catch (Exception ex) @@ -473,8 +514,12 @@ try { StartServer(); - StartClient(); + IPAddress serverIP = Client.GetIPFromName(_hostComputer); + IPEndPoint endPoint = new IPEndPoint(serverIP, IrssComms.Server.DefaultPort); + + StartClient(endPoint); + return true; } catch (Exception ex) @@ -604,30 +649,55 @@ { IrssLog.Info("Resume from standby ..."); + bool resumedTransmit = false; + if (_pluginReceive != null) - _pluginReceive.Resume(); + { + foreach (IRServerPlugin plugin in _pluginReceive) + { + if (_pluginTransmit == plugin) + resumedTransmit = true; - if (_pluginTransmit != null && _pluginTransmit != _pluginReceive) + plugin.Resume(); + } + } + + if (_pluginTransmit != null && !resumedTransmit) _pluginTransmit.Resume(); - // TODO: Inform clients ? + // Inform clients ... + if (_mode == IRServerMode.ServerMode) + { + IrssMessage message = new IrssMessage(MessageType.ServerResume, MessageFlags.Notify); + SendToAll(message); + } break; } case PowerModes.Suspend: { - IrssLog.Info("Enter low-power standby ..."); + IrssLog.Info("Enter standby ..."); + bool suspendedTransmit = false; + if (_pluginReceive != null) - _pluginReceive.Suspend(); + { + foreach (IRServerPlugin plugin in _pluginReceive) + { + if (_pluginTransmit == plugin) + suspendedTransmit = true; - if (_pluginTransmit != null && _pluginTransmit != _pluginReceive) + plugin.Suspend(); + } + } + + if (_pluginTransmit != null && !suspendedTransmit) _pluginTransmit.Suspend(); // Inform clients ... if (_mode == IRServerMode.ServerMode) { - IrssMessage message = new IrssMessage(MessageType.ServerShutdown, MessageFlags.Notify); + IrssMessage message = new IrssMessage(MessageType.ServerSuspend, MessageFlags.Notify); SendToAll(message); } break; @@ -975,13 +1045,6 @@ break; - case MessageType.Ping: - { - IrssMessage response = new IrssMessage(MessageType.Echo, MessageFlags.Response, combo.Message.DataAsBytes); - SendTo(combo.Manager, response); - break; - } - case MessageType.RegisterClient: { IrssMessage response = new IrssMessage(MessageType.RegisterClient, MessageFlags.Response); @@ -1104,45 +1167,85 @@ void LoadSettings() { + _mode = IRServerMode.ServerMode; + _hostComputer = String.Empty; + _pluginNameReceive = null; + _pluginNameTransmit = String.Empty; + + XmlDocument doc = new XmlDocument(); + try { - XmlDocument doc = new XmlDocument(); doc.Load(ConfigurationFile); - - _mode = (IRServerMode)Enum.Parse(typeof(IRServerMode), doc.DocumentElement.Attributes["Mode"].Value, true); - _hostComputer = doc.DocumentElement.Attributes["HostComputer"].Value; - _pluginNameReceive = doc.DocumentElement.Attributes["PluginReceive"].Value; - _pluginNameTransmit = doc.DocumentElement.Attributes["PluginTransmit"].Value; } + catch (FileNotFoundException) + { + IrssLog.Warn("No configuration file found ({0}), creating default configuration file", ConfigurationFile); + SaveSettings(); + return; + } catch (Exception ex) { IrssLog.Error(ex.ToString()); + return; + } - _mode = IRServerMode.ServerMode; - _hostComputer = String.Empty; - _pluginNameReceive = String.Empty; - _pluginNameTransmit = String.Empty; + try { _mode = (IRServerMode)Enum.Parse(typeof(IRServerMode), doc.DocumentElement.Attributes["Mode"].Value, true); } + catch (Exception ex) { IrssLog.Warn(ex.ToString()); } + + try { _hostComputer = doc.DocumentElement.Attributes["HostComputer"].Value; } + catch (Exception ex) { IrssLog.Warn(ex.ToString()); } + + try { _pluginNameTransmit = doc.DocumentElement.Attributes["PluginTransmit"].Value; } + catch (Exception ex) { IrssLog.Warn(ex.ToString()); } + + try + { + string receivers = doc.DocumentElement.Attributes["PluginReceive"].Value; + if (!String.IsNullOrEmpty(receivers)) + _pluginNameReceive = receivers.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); } + catch (Exception ex) + { + IrssLog.Warn(ex.ToString()); + } } void SaveSettings() { try { - XmlTextWriter writer = new XmlTextWriter(ConfigurationFile, System.Text.Encoding.UTF8); - writer.Formatting = Formatting.Indented; - writer.Indentation = 1; - writer.IndentChar = (char)9; - writer.WriteStartDocument(true); - writer.WriteStartElement("settings"); // <settings> + using (XmlTextWriter writer = new XmlTextWriter(ConfigurationFile, System.Text.Encoding.UTF8)) + { + writer.Formatting = Formatting.Indented; + writer.Indentation = 1; + writer.IndentChar = (char)9; + writer.WriteStartDocument(true); + writer.WriteStartElement("settings"); // <settings> - writer.WriteAttributeString("Mode", Enum.GetName(typeof(IRServerMode), _mode)); - writer.WriteAttributeString("HostComputer", _hostComputer); - writer.WriteAttributeString("PluginReceive", _pluginNameReceive); - writer.WriteAttributeString("PluginTransmit", _pluginNameTransmit); + writer.WriteAttributeString("Mode", Enum.GetName(typeof(IRServerMode), _mode)); + writer.WriteAttributeString("HostComputer", _hostComputer); + writer.WriteAttributeString("PluginTransmit", _pluginNameTransmit); - writer.WriteEndElement(); // </settings> - writer.WriteEndDocument(); - writer.Close(); + if (_pluginNameReceive != null) + { + StringBuilder receivers = new StringBuilder(); + for (int index = 0; index < _pluginNameReceive.Length; index++) + { + receivers.Append(_pluginNameReceive[index]); + + if (index < _pluginNameReceive.Length - 1) + receivers.Append(','); + } + writer.WriteAttributeString("PluginReceive", receivers.ToString()); + } + else + { + writer.WriteAttributeString("PluginReceive", String.Empty); + } + + writer.WriteEndElement(); // </settings> + writer.WriteEndDocument(); + } } catch (Exception ex) { Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2007-09-24 19:20:56 UTC (rev 955) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2007-09-26 07:34:18 UTC (rev 956) @@ -83,18 +83,16 @@ try { Assembly assembly = Assembly.LoadFrom(file); - Type[] types = assembly.GetExportedTypes(); foreach (Type type in types) { if (type.IsClass && !type.IsAbstract && type.IsSubclassOf(typeof(IRServerPlugin))) { - IRServerPlugin plugin = (IRServerPlugin)Activator.CreateInstance(type); - if (plugin == null) - continue; - - plugins.Add(plugin); + IRServerPlugin plugin = (IRServerPlugin)assembly.CreateInstance(type.FullName); + + if (plugin != null) + plugins.Add(plugin); } } } Modified: trunk/plugins/IR Server Suite/Applications/Translator/Configuration.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Configuration.cs 2007-09-24 19:20:56 UTC (rev 955) +++ trunk/plugins/IR Server Suite/Applications/Translator/Configuration.cs 2007-09-26 07:34:18 UTC (rev 956) @@ -75,7 +75,7 @@ public Configuration() { - _serverHost = String.Empty; + _serverHost = "localhost"; _systemWideMappings = new List<ButtonMapping>(); _programSettings = new List<ProgramSettings>(); @@ -122,6 +122,11 @@ using (StreamReader file = new StreamReader(fileName)) return (Configuration)reader.Deserialize(file); } + catch (FileNotFoundException) + { + IrssLog.Warn("No configuration file found ({0}), using default configuration", fileName); + return new Configuration(); + } catch (Exception ex) { IrssLog.Error(ex.ToString()); Modified: trunk/plugins/IR Server Suite/Applications/Translator/EventSchedule.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/EventSchedule.cs 2007-09-24 19:20:56 UTC (rev 955) +++ trunk/plugins/IR Server Suite/Applications/Translator/EventSchedule.cs 2007-09-26 07:34:18 UTC (rev 956) @@ -51,7 +51,7 @@ #endregion Enumerations - public class EventSchedule + class EventSchedule { //DateTime _start; Deleted: trunk/plugins/IR Server Suite/Applications/Translator/Forms/BlastCommand.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/BlastCommand.Designer.cs 2007-09-24 19:20:56 UTC (rev 955) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/BlastCommand.Designer.cs 2007-09-26 07:34:18 UTC (rev 956) @@ -1,150 +0,0 @@ -namespace Translator -{ - partial class BlastCommand - { - /// <summary> - /// Required designer variable. - /// </summary> - private System.ComponentModel.IContainer components = null; - - /// <summary> - /// Clean up any resources being used. - /// </summary> - /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disp... [truncated message content] |
From: <an...@us...> - 2007-09-28 16:31:52
|
Revision: 959 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=959&view=rev Author: and-81 Date: 2007-09-28 09:31:49 -0700 (Fri, 28 Sep 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 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/GetKeyCodeForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.Designer.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.resx trunk/plugins/IR Server Suite/Applications/Translator/Program.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/GetKeyCodeForm.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/Applications/Virtual Remote/Program.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs trunk/plugins/IR Server Suite/Common/IrssComms/Client.cs trunk/plugins/IR Server Suite/Common/IrssComms/ClientManager.cs trunk/plugins/IR Server Suite/Common/IrssComms/GenericPCQueue.cs trunk/plugins/IR Server Suite/Common/IrssComms/IrssMessage.cs trunk/plugins/IR Server Suite/Common/IrssComms/MessageManagerCombo.cs trunk/plugins/IR Server Suite/Common/IrssComms/Server.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs trunk/plugins/IR Server Suite/Common/IrssUtils/IrssLog.cs trunk/plugins/IR Server Suite/Common/IrssUtils/SystemRegistry.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Win32.cs trunk/plugins/IR Server Suite/Common/MPUtils/MPCommands.cs trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IRServerPluginInterface.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverReplacement.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverVista.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverXP.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrDecoder.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MceDetectionData.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/NotifyWindow.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/RemoteDetectionData.cs trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/UirtTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLircServer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Windows Message Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/X10Transceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/XBCDRC Receiver/XBCDRC Receiver.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/MPControlPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -173,7 +173,7 @@ if ((received.Flags & MessageFlags.Success) == MessageFlags.Success) { _registered = true; - _irServerInfo = IRServerInfo.FromBytes(received.DataAsBytes); + _irServerInfo = IRServerInfo.FromBytes(received.GetDataAsBytes()); comboBoxPort.Items.Clear(); comboBoxPort.Items.AddRange(_irServerInfo.Ports); comboBoxPort.SelectedIndex = 0; @@ -185,13 +185,13 @@ return; case MessageType.RemoteEvent: - RemoteHandlerCallback(received.DataAsString); + RemoteHandlerCallback(received.GetDataAsString()); return; case MessageType.LearnIR: if ((received.Flags & MessageFlags.Success) == MessageFlags.Success) { - byte[] dataBytes = received.DataAsBytes; + byte[] dataBytes = received.GetDataAsBytes(); using (FileStream file = File.Create(_learnIRFilename)) file.Write(dataBytes, 0, dataBytes.Length); @@ -206,7 +206,7 @@ case MessageType.Error: _learnIRFilename = null; - this.Invoke(_addStatusLine, new Object[] { received.DataAsString }); + this.Invoke(_addStatusLine, new Object[] { received.GetDataAsString() }); return; } } Modified: trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -311,7 +311,7 @@ break; case MessageType.Error: - Warn(received.DataAsString); + Warn(received.GetDataAsString()); break; } } Modified: trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -275,7 +275,7 @@ break; case MessageType.Error: - IrssLog.Warn(received.DataAsString); + IrssLog.Warn(received.GetDataAsString()); break; } } Modified: trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -43,7 +43,7 @@ #endregion Enumerations - internal class IRServer + internal class IRServer : IDisposable { #region Constants @@ -59,8 +59,8 @@ List<ClientManager> _registeredClients; List<ClientManager> _registeredRepeaters; - Server _server = null; - Client _client = null; + Server _server; + Client _client; IRServerMode _mode; string _hostComputer; @@ -77,7 +77,7 @@ #endregion Variables - #region Constructor + #region Constructor / Destructor public IRServer() { @@ -93,8 +93,38 @@ _notifyIcon.Text = "IR Server"; } - #endregion Constructor + /* + ~IRServer() + { + Dispose(false); + } + */ + #endregion Constructor / Destructor + + #region IDisposable + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposeManagedResources) + { + if (disposeManagedResources) + { + // Dispose managed resources ... + _notifyIcon.Dispose(); + _notifyIcon = null; + } + + // Free native resources ... + + } + + #endregion IDisposable + #region Implementation /// <summary> @@ -159,6 +189,7 @@ } } + // Mode select ... switch (_mode) { case IRServerMode.ServerMode: @@ -193,14 +224,17 @@ { if (plugin.Start()) { - if (plugin is IRemoteReceiver) - (plugin as IRemoteReceiver).RemoteCallback += new RemoteHandler(RemoteHandlerCallback); + IRemoteReceiver remoteReceiver = plugin as IRemoteReceiver; + if (remoteReceiver != null) + remoteReceiver.RemoteCallback += new RemoteHandler(RemoteHandlerCallback); - if (plugin is IKeyboardReceiver) - (plugin as IKeyboardReceiver).KeyboardCallback += new KeyboardHandler(KeyboardHandlerCallback); + IKeyboardReceiver keyboardReceiver = plugin as IKeyboardReceiver; + if (keyboardReceiver != null) + keyboardReceiver.KeyboardCallback += new KeyboardHandler(KeyboardHandlerCallback); - if (plugin is IMouseReceiver) - (plugin as IMouseReceiver).MouseCallback += new MouseHandler(MouseHandlerCallback); + IMouseReceiver mouseReceiver = plugin as IMouseReceiver; + if (mouseReceiver != null) + mouseReceiver.MouseCallback += new MouseHandler(MouseHandlerCallback); if (plugin.Name.Equals(_pluginTransmit.Name)) { @@ -274,7 +308,6 @@ } // Stop Plugin(s) ... - bool stoppedTransmit = false; if (_pluginReceive != null) @@ -283,14 +316,17 @@ { try { - if (plugin is IRemoteReceiver) - (plugin as IRemoteReceiver).RemoteCallback -= new RemoteHandler(RemoteHandlerCallback); + IRemoteReceiver remoteReceiver = plugin as IRemoteReceiver; + if (remoteReceiver != null) + remoteReceiver.RemoteCallback -= new RemoteHandler(RemoteHandlerCallback); - if (plugin is IKeyboardReceiver) - (plugin as IKeyboardReceiver).KeyboardCallback -= new KeyboardHandler(KeyboardHandlerCallback); + IKeyboardReceiver keyboardReceiver = plugin as IKeyboardReceiver; + if (keyboardReceiver != null) + keyboardReceiver.KeyboardCallback -= new KeyboardHandler(KeyboardHandlerCallback); - if (plugin is IMouseReceiver) - (plugin as IMouseReceiver).MouseCallback -= new MouseHandler(MouseHandlerCallback); + IMouseReceiver mouseReceiver = plugin as IMouseReceiver; + if (mouseReceiver != null) + mouseReceiver.MouseCallback -= new MouseHandler(MouseHandlerCallback); plugin.Stop(); @@ -406,17 +442,23 @@ } void StopServer() { - if (_server == null) - return; + if (_server != null) + { + _server.Dispose(); + _server = null; + } - _server.Dispose(); - _server = null; + if (_registeredClients != null) + { + _registeredClients.Clear(); + _registeredClients = null; + } - _registeredClients.Clear(); - _registeredClients = null; - - _registeredRepeaters.Clear(); - _registeredRepeaters = null; + if (_registeredRepeaters != null) + { + _registeredRepeaters.Clear(); + _registeredRepeaters = null; + } } void CommsFailure(object obj) @@ -473,11 +515,11 @@ } void StopClient() { - if (_client == null) - return; - - _client.Dispose(); - _client = null; + if (_client != null) + { + _client.Dispose(); + _client = null; + } } bool StartRelay() @@ -539,11 +581,16 @@ IrssMessage message = new IrssMessage(MessageType.UnregisterRepeater, MessageFlags.Request); _client.Send(message); } - + } + catch + { + throw; + } + finally + { StopServer(); StopClient(); } - catch { } } void RemoteHandlerCallback(string keyCode) @@ -939,12 +986,12 @@ case MessageType.ForwardRemoteEvent: if (_mode == IRServerMode.RelayMode) { - IrssMessage forward = new IrssMessage(MessageType.ForwardRemoteEvent, MessageFlags.Request, combo.Message.DataAsBytes); + IrssMessage forward = new IrssMessage(MessageType.ForwardRemoteEvent, MessageFlags.Request, combo.Message.GetDataAsBytes()); _client.Send(forward); } else { - IrssMessage forward = new IrssMessage(MessageType.RemoteEvent, MessageFlags.Notify, combo.Message.DataAsBytes); + IrssMessage forward = new IrssMessage(MessageType.RemoteEvent, MessageFlags.Notify, combo.Message.GetDataAsBytes()); SendToAllExcept(combo.Manager, forward); } break; @@ -952,12 +999,12 @@ case MessageType.ForwardKeyboardEvent: if (_mode == IRServerMode.RelayMode) { - IrssMessage forward = new IrssMessage(MessageType.ForwardKeyboardEvent, MessageFlags.Request, combo.Message.DataAsBytes); + IrssMessage forward = new IrssMessage(MessageType.ForwardKeyboardEvent, MessageFlags.Request, combo.Message.GetDataAsBytes()); _client.Send(forward); } else { - IrssMessage forward = new IrssMessage(MessageType.KeyboardEvent, MessageFlags.Notify, combo.Message.DataAsBytes); + IrssMessage forward = new IrssMessage(MessageType.KeyboardEvent, MessageFlags.Notify, combo.Message.GetDataAsBytes()); SendToAllExcept(combo.Manager, forward); } break; @@ -965,12 +1012,12 @@ case MessageType.ForwardMouseEvent: if (_mode == IRServerMode.RelayMode) { - IrssMessage forward = new IrssMessage(MessageType.ForwardMouseEvent, MessageFlags.Request, combo.Message.DataAsBytes); + IrssMessage forward = new IrssMessage(MessageType.ForwardMouseEvent, MessageFlags.Request, combo.Message.GetDataAsBytes()); _client.Send(forward); } else { - IrssMessage forward = new IrssMessage(MessageType.MouseEvent, MessageFlags.Notify, combo.Message.DataAsBytes); + IrssMessage forward = new IrssMessage(MessageType.MouseEvent, MessageFlags.Notify, combo.Message.GetDataAsBytes()); SendToAllExcept(combo.Manager, forward); } break; @@ -988,7 +1035,7 @@ if (_registeredRepeaters.Count > 0) SendToRepeaters(combo.Message); - if (BlastIR(combo.Message.DataAsBytes)) + if (BlastIR(combo.Message.GetDataAsBytes())) response.Flags |= MessageFlags.Success; else response.Flags |= MessageFlags.Failure; @@ -1018,7 +1065,7 @@ { case LearnStatus.Success: response.Flags |= MessageFlags.Success; - response.DataAsBytes = bytes; + response.SetDataAsBytes(bytes); break; case LearnStatus.Failure: @@ -1063,7 +1110,7 @@ irServerInfo.Ports = (_pluginTransmit as ITransmitIR).AvailablePorts; } - response.DataAsBytes = irServerInfo.ToBytes(); + response.SetDataAsBytes(irServerInfo.ToBytes()); response.Flags |= MessageFlags.Success; } else Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -26,11 +26,18 @@ if (Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName).Length != 1) return; } +#if TRACE catch (Exception ex) { - Trace.WriteLine(ex.Message); + Trace.WriteLine(ex.ToString()); return; } +#else + catch + { + return; + } +#endif Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); @@ -42,10 +49,11 @@ Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException); // Start Server - IRServer irServer = new IRServer(); - - if (irServer.Start()) - Application.Run(); + using (IRServer irServer = new IRServer()) + { + if (irServer.Start()) + Application.Run(); + } Application.ThreadException -= new ThreadExceptionEventHandler(Application_ThreadException); @@ -108,11 +116,18 @@ return plugins.ToArray(); } +#if TRACE catch (Exception ex) { Trace.WriteLine(ex.ToString()); return null; } +#else + catch + { + return null; + } +#endif } /// <summary> Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/GetKeyCodeForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/GetKeyCodeForm.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/GetKeyCodeForm.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -61,7 +61,7 @@ { if (received.Type == MessageType.RemoteEvent) { - _keyCode = received.DataAsString; + _keyCode = received.GetDataAsString(); this.Invoke(_keyCodeSet); } Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.Designer.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.Designer.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -573,58 +573,58 @@ this.toolStripSeparator2, this.quitToolStripMenuItem}); this.configurationToolStripMenuItem.Name = "configurationToolStripMenuItem"; - this.configurationToolStripMenuItem.Size = new System.Drawing.Size(37, 20); + this.configurationToolStripMenuItem.Size = new System.Drawing.Size(35, 20); this.configurationToolStripMenuItem.Text = "&File"; // // newToolStripMenuItem // this.newToolStripMenuItem.Name = "newToolStripMenuItem"; - this.newToolStripMenuItem.Size = new System.Drawing.Size(122, 22); + this.newToolStripMenuItem.Size = new System.Drawing.Size(132, 22); this.newToolStripMenuItem.Text = "&New"; this.newToolStripMenuItem.Click += new System.EventHandler(this.newToolStripMenuItem_Click); // // openToolStripMenuItem // this.openToolStripMenuItem.Name = "openToolStripMenuItem"; - this.openToolStripMenuItem.Size = new System.Drawing.Size(122, 22); + this.openToolStripMenuItem.Size = new System.Drawing.Size(132, 22); this.openToolStripMenuItem.Text = "&Open ..."; this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click); // // importToolStripMenuItem // this.importToolStripMenuItem.Name = "importToolStripMenuItem"; - this.importToolStripMenuItem.Size = new System.Drawing.Size(122, 22); + this.importToolStripMenuItem.Size = new System.Drawing.Size(132, 22); this.importToolStripMenuItem.Text = "&Import ..."; this.importToolStripMenuItem.Click += new System.EventHandler(this.importToolStripMenuItem_Click); // // exportToolStripMenuItem // this.exportToolStripMenuItem.Name = "exportToolStripMenuItem"; - this.exportToolStripMenuItem.Size = new System.Drawing.Size(122, 22); + this.exportToolStripMenuItem.Size = new System.Drawing.Size(132, 22); this.exportToolStripMenuItem.Text = "&Export ..."; this.exportToolStripMenuItem.Click += new System.EventHandler(this.exportToolStripMenuItem_Click); // // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(119, 6); + this.toolStripSeparator1.Size = new System.Drawing.Size(129, 6); // // serverToolStripMenuItem // this.serverToolStripMenuItem.Name = "serverToolStripMenuItem"; - this.serverToolStripMenuItem.Size = new System.Drawing.Size(122, 22); + this.serverToolStripMenuItem.Size = new System.Drawing.Size(132, 22); this.serverToolStripMenuItem.Text = "&Server ..."; this.serverToolStripMenuItem.Click += new System.EventHandler(this.serverToolStripMenuItem_Click); // // toolStripSeparator2 // this.toolStripSeparator2.Name = "toolStripSeparator2"; - this.toolStripSeparator2.Size = new System.Drawing.Size(119, 6); + this.toolStripSeparator2.Size = new System.Drawing.Size(129, 6); // // quitToolStripMenuItem // this.quitToolStripMenuItem.Name = "quitToolStripMenuItem"; - this.quitToolStripMenuItem.Size = new System.Drawing.Size(122, 22); + this.quitToolStripMenuItem.Size = new System.Drawing.Size(132, 22); this.quitToolStripMenuItem.Text = "&Quit"; this.quitToolStripMenuItem.Click += new System.EventHandler(this.quitToolStripMenuItem_Click); // @@ -634,20 +634,20 @@ this.translatorHelpToolStripMenuItem, this.aboutToolStripMenuItem}); this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; - this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20); + this.helpToolStripMenuItem.Size = new System.Drawing.Size(40, 20); this.helpToolStripMenuItem.Text = "&Help"; // // translatorHelpToolStripMenuItem // this.translatorHelpToolStripMenuItem.Name = "translatorHelpToolStripMenuItem"; - this.translatorHelpToolStripMenuItem.Size = new System.Drawing.Size(122, 22); + this.translatorHelpToolStripMenuItem.Size = new System.Drawing.Size(129, 22); this.translatorHelpToolStripMenuItem.Text = "&Contents"; this.translatorHelpToolStripMenuItem.Click += new System.EventHandler(this.translatorHelpToolStripMenuItem_Click); // // aboutToolStripMenuItem // this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; - this.aboutToolStripMenuItem.Size = new System.Drawing.Size(122, 22); + this.aboutToolStripMenuItem.Size = new System.Drawing.Size(129, 22); this.aboutToolStripMenuItem.Text = "&About"; this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click); // @@ -679,6 +679,7 @@ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Translator"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing); + this.Load += new System.EventHandler(this.MainForm_Load); this.groupBoxProgram.ResumeLayout(false); this.tabControl.ResumeLayout(false); this.tabPagePrograms.ResumeLayout(false); Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -86,7 +86,7 @@ #region Variables - IrssUtils.Forms.LearnIR _learnIR; + LearnIR _learnIR; #endregion Variables @@ -258,7 +258,7 @@ if (File.Exists(fileName)) { - _learnIR = new IrssUtils.Forms.LearnIR( + _learnIR = new LearnIR( new LearnIrDelegate(Program.LearnIR), new BlastIrDelegate(Program.BlastIR), Program.TransceiverInformation.Ports, @@ -317,13 +317,38 @@ } } + private void MainForm_Load(object sender, EventArgs e) + { + Program.HandleMessage += new ClientMessageSink(ReceivedMessage); + } private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { + Program.HandleMessage -= new ClientMessageSink(ReceivedMessage); + CommitEvents(); Configuration.Save(Program.Config, Program.ConfigFile); } + void ReceivedMessage(IrssMessage received) + { + if (_learnIR != null && received.Type == MessageType.LearnIR) + { + if ((received.Flags & MessageFlags.Success) == MessageFlags.Success) + { + _learnIR.LearnStatus("Learned IR successfully", true); + } + else if ((received.Flags & MessageFlags.Timeout) == MessageFlags.Timeout) + { + _learnIR.LearnStatus("Learn IR timed out", false); + } + else if ((received.Flags & MessageFlags.Failure) == MessageFlags.Failure) + { + _learnIR.LearnStatus("Learn IR failed", false); + } + } + } + protected override void WndProc(ref Message m) { try @@ -600,7 +625,7 @@ private void buttonNewIR_Click(object sender, EventArgs e) { - _learnIR = new IrssUtils.Forms.LearnIR( + _learnIR = new LearnIR( new LearnIrDelegate(Program.LearnIR), new BlastIrDelegate(Program.BlastIR), Program.TransceiverInformation.Ports); @@ -616,7 +641,7 @@ if (listBoxIR.SelectedIndex == -1) return; - _learnIR = new IrssUtils.Forms.LearnIR( + _learnIR = new LearnIR( new LearnIrDelegate(Program.LearnIR), new BlastIrDelegate(Program.BlastIR), Program.TransceiverInformation.Ports, Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.resx =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.resx 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.resx 2007-09-28 16:31:49 UTC (rev 959) @@ -120,9 +120,6 @@ <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>17, 17</value> </metadata> - <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> - <value>17, 17</value> - </metadata> <metadata name="menuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>102, 17</value> </metadata> Modified: trunk/plugins/IR Server Suite/Applications/Translator/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -618,7 +618,7 @@ break; default: - throw new Exception("Unknown action: " + menuItem.Text); + throw new ArgumentException(String.Format("Unknown action: {0}", menuItem.Text), "sender"); } } catch (Exception ex) @@ -740,11 +740,11 @@ } internal static void StopClient() { - if (_client == null) - return; - - _client.Dispose(); - _client = null; + if (_client != null) + { + _client.Dispose(); + _client = null; + } } static void ReceivedMessage(IrssMessage received) @@ -756,24 +756,28 @@ switch (received.Type) { case MessageType.RemoteEvent: - RemoteHandlerCallback(received.DataAsString); + RemoteHandlerCallback(received.GetDataAsString()); break; case MessageType.KeyboardEvent: { - int vKey = BitConverter.ToInt32(received.DataAsBytes, 0); - bool keyUp = BitConverter.ToBoolean(received.DataAsBytes, 4); + byte[] dataBytes = received.GetDataAsBytes(); + int vKey = BitConverter.ToInt32(dataBytes, 0); + bool keyUp = BitConverter.ToBoolean(dataBytes, 4); + KeyboardHandlerCallback(vKey, keyUp); break; } case MessageType.MouseEvent: { - int deltaX = BitConverter.ToInt32(received.DataAsBytes, 0); - int deltaY = BitConverter.ToInt32(received.DataAsBytes, 4); - int buttons = BitConverter.ToInt32(received.DataAsBytes, 8); + byte[] dataBytes = received.GetDataAsBytes(); + int deltaX = BitConverter.ToInt32(dataBytes, 0); + int deltaY = BitConverter.ToInt32(dataBytes, 4); + int buttons = BitConverter.ToInt32(dataBytes, 8); + MouseHandlerCallback(deltaX, deltaY, buttons); break; } @@ -788,7 +792,7 @@ case MessageType.RegisterClient: if ((received.Flags & MessageFlags.Success) == MessageFlags.Success) { - _irServerInfo = IRServerInfo.FromBytes(received.DataAsBytes); + _irServerInfo = IRServerInfo.FromBytes(received.GetDataAsBytes()); _registered = true; IrssLog.Info("Registered to IR Server"); @@ -805,7 +809,7 @@ { IrssLog.Info("Learned IR Successfully"); - byte[] dataBytes = received.DataAsBytes; + byte[] dataBytes = received.GetDataAsBytes(); using (FileStream file = File.Create(_learnIRFilename)) file.Write(dataBytes, 0, dataBytes.Length); @@ -833,7 +837,7 @@ case MessageType.Error: _learnIRFilename = null; - IrssLog.Error("Received error: {0}", received.DataAsString); + IrssLog.Error("Received error: {0}", received.GetDataAsString()); break; } @@ -1027,7 +1031,7 @@ doc.Load(fileName); if (doc.DocumentElement.InnerText.Contains(Common.XmlTagBlast) && !_registered) - throw new Exception("Cannot process Macro with Blast commands when not registered to an active IR Server"); + throw new ApplicationException("Cannot process Macro with Blast commands when not registered to an active IR Server"); XmlNodeList commandSequence = doc.DocumentElement.SelectNodes("action"); string commandProperty; @@ -1171,7 +1175,7 @@ internal static void BlastIR(string fileName, string port) { if (!_registered) - throw new Exception("Cannot Blast, not registered to an active IR Server"); + throw new ApplicationException("Cannot Blast, not registered to an active IR Server"); using (FileStream file = File.OpenRead(fileName)) { Modified: trunk/plugins/IR Server Suite/Applications/Tray Launcher/GetKeyCodeForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Tray Launcher/GetKeyCodeForm.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Applications/Tray Launcher/GetKeyCodeForm.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -60,7 +60,7 @@ { if (received.Type == MessageType.RemoteEvent) { - _keyCode = received.DataAsString; + _keyCode = received.GetDataAsString(); this.Invoke(_keyCodeSet); } Modified: trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -323,7 +323,7 @@ break; case MessageType.RemoteEvent: - RemoteHandlerCallback(received.DataAsString); + RemoteHandlerCallback(received.GetDataAsString()); break; case MessageType.ServerShutdown: @@ -332,7 +332,7 @@ break; case MessageType.Error: - IrssLog.Error("Received error: {0}", received.DataAsString); + IrssLog.Error("Received error: {0}", received.GetDataAsString()); break; } Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -176,7 +176,7 @@ Program.RemoteSkin = skin; } else - throw new Exception(String.Format("Failed to load skin file not found \"{0}\"", xmlFile)); + throw new FileNotFoundException("Failed to load skin, file not found", xmlFile); } catch (Exception ex) { Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -354,7 +354,7 @@ break; case MessageType.Error: - IrssLog.Error(received.DataAsString); + IrssLog.Error(received.GetDataAsString()); break; } } Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -581,7 +581,7 @@ { case MessageType.RemoteEvent: if (listViewButtons.SelectedItems.Count == 1) - listViewButtons.SelectedItems[0].SubItems[1].Text = received.DataAsString; + listViewButtons.SelectedItems[0].SubItems[1].Text = received.GetDataAsString(); return; case MessageType.RegisterClient: @@ -603,7 +603,7 @@ return; case MessageType.Error: - MessageBox.Show(this, received.DataAsString, "Virtual Remote Skin Editor Error from Server", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show(this, received.GetDataAsString(), "Virtual Remote Skin Editor Error from Server", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } Modified: trunk/plugins/IR Server Suite/Common/IrssComms/Client.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssComms/Client.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Common/IrssComms/Client.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -25,8 +25,8 @@ #region Variables - IPEndPoint _serverEndPoint; - Socket _serverSocket = null; + IPEndPoint _serverEndpoint; + Socket _serverSocket; volatile bool _processConnectionThread = false; volatile bool _connected = false; @@ -35,9 +35,9 @@ ClientMessageSink _messageSink; - WaitCallback _connectCallback = null; - WaitCallback _disconnectCallback = null; - WaitCallback _commsFailureCallback = null; + WaitCallback _connectCallback; + WaitCallback _disconnectCallback; + WaitCallback _commsFailureCallback; #endregion Variables @@ -88,7 +88,7 @@ /// <param name="serverEndPoint">IP Address and Port combination of Server.</param> public Client(IPEndPoint serverEndPoint, ClientMessageSink messageSink) { - _serverEndPoint = serverEndPoint; + _serverEndpoint = serverEndPoint; _messageSink = messageSink; @@ -105,13 +105,12 @@ GC.SuppressFinalize(this); } - protected virtual void Dispose(bool disposing) + protected virtual void Dispose(bool disposeManagedResources) { - if (disposing) + if (disposeManagedResources) { // Dispose managed resources ... - if (_processConnectionThread) - Stop(); + Stop(); _messageQueue.Dispose(); } @@ -238,7 +237,7 @@ { try { - _serverSocket.Connect(_serverEndPoint); + _serverSocket.Connect(_serverEndpoint); break; } catch (SocketException socketException) @@ -290,8 +289,8 @@ // Read data from socket ... while (_processConnectionThread) { - bytesRead = _serverSocket.Receive(buffer, 4, SocketFlags.None); - if (bytesRead == 0) + bytesRead = _serverSocket.Receive(buffer, buffer.Length, SocketFlags.None); + if (bytesRead != buffer.Length) break; int readSize = BitConverter.ToInt32(buffer, 0); @@ -299,12 +298,11 @@ byte[] packet = new byte[readSize]; - bytesRead = _serverSocket.Receive(packet, readSize, SocketFlags.None); - if (bytesRead == 0) + bytesRead = _serverSocket.Receive(packet, packet.Length, SocketFlags.None); + if (bytesRead != packet.Length) break; IrssMessage message = IrssMessage.FromBytes(packet); - _messageQueue.Enqueue(message); } Modified: trunk/plugins/IR Server Suite/Common/IrssComms/ClientManager.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssComms/ClientManager.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Common/IrssComms/ClientManager.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -12,7 +12,7 @@ /// <summary> /// Manages Server socket connections. /// </summary> - public class ClientManager + public class ClientManager : IDisposable { #region Variables @@ -36,6 +36,28 @@ #endregion Constructor + #region IDisposable + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposeManagedResources) + { + if (disposeManagedResources) + { + // Dispose managed resources ... + Stop(); + } + + // Free native resources ... + + } + + #endregion IDisposable + #region Implementation internal void Start() @@ -59,6 +81,7 @@ _processReceiveThread = false; _connection.Close(); + _connection = null; //_receiveThread.Abort(); //_receiveThread.Join(); @@ -89,8 +112,8 @@ while (_processReceiveThread) { - bytesRead = _connection.Receive(buffer, 4, SocketFlags.None); - if (bytesRead == 0) + bytesRead = _connection.Receive(buffer, buffer.Length, SocketFlags.None); + if (bytesRead != buffer.Length) break; // TODO: Inform server to remove clientmanager from list? (Low) int readSize = BitConverter.ToInt32(buffer, 0); @@ -98,8 +121,8 @@ byte[] packet = new byte[readSize]; - bytesRead = _connection.Receive(packet, readSize, SocketFlags.None); - if (bytesRead == 0) + bytesRead = _connection.Receive(packet, packet.Length, SocketFlags.None); + if (bytesRead != packet.Length) break; IrssMessage message = IrssMessage.FromBytes(packet); @@ -107,10 +130,16 @@ _messageSink(combo); } } +#if TRACE catch (SocketException socketException) { Trace.WriteLine(socketException.ToString()); } +#else + catch (SocketException) + { + } +#endif } #endregion Implementation Modified: trunk/plugins/IR Server Suite/Common/IrssComms/GenericPCQueue.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssComms/GenericPCQueue.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Common/IrssComms/GenericPCQueue.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -66,13 +66,12 @@ GC.SuppressFinalize(this); } - protected virtual void Dispose(bool disposing) + protected virtual void Dispose(bool disposeManagedResources) { - if (disposing) + if (disposeManagedResources) { // Dispose managed resources ... - if (_processQueue) - Stop(); + Stop(); _workerThread = null; @@ -82,6 +81,7 @@ _queueLock = null; _queueWaitHandle.Close(); + _queueWaitHandle = null; } // Free native resources ... @@ -142,9 +142,11 @@ throw new ArgumentNullException("obj"); lock (_queueLock) + { _queue.Enqueue(obj); - _queueWaitHandle.Set(); + _queueWaitHandle.Set(); + } } /// <summary> @@ -166,12 +168,10 @@ try { T obj = default(T); - bool didDequeue; + bool didDequeue = false; while (_processQueue) { - didDequeue = false; - lock (_queueLock) { if (_queue.Count > 0) @@ -182,15 +182,27 @@ } if (didDequeue) + { _sink(obj); + obj = default(T); + didDequeue = false; + } else + { _queueWaitHandle.WaitOne(); + } } } +#if TRACE catch (ThreadAbortException threadAbortException) { Trace.WriteLine(threadAbortException.ToString()); } +#else + catch (ThreadAbortException) + { + } +#endif } #endregion Implementation Modified: trunk/plugins/IR Server Suite/Common/IrssComms/IrssMessage.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssComms/IrssMessage.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Common/IrssComms/IrssMessage.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -93,36 +93,6 @@ set { _flags = value; } } - /// <summary> - /// Message data as bytes. - /// </summary> - public byte[] DataAsBytes - { - get { return _data; } - set { _data = value; } - } - - /// <summary> - /// Message data as string. - /// </summary> - public string DataAsString - { - get - { - if (_data == null) - return String.Empty; - else - return Encoding.ASCII.GetString(_data); - } - set - { - if (String.IsNullOrEmpty(value)) - _data = null; - else - _data = Encoding.ASCII.GetBytes(value); - } - } - #endregion Properties #region Constructors @@ -144,13 +114,13 @@ public IrssMessage(MessageType type, MessageFlags flags, byte[] data) : this(type, flags) { - _data = data; + SetDataAsBytes(data); } public IrssMessage(MessageType type, MessageFlags flags, string data) : this(type, flags) { - _data = Encoding.ASCII.GetBytes(data); + SetDataAsString(data); } #endregion Constructors @@ -158,6 +128,47 @@ #region Implementation /// <summary> + /// Get message data as bytes. + /// </summary> + public byte[] GetDataAsBytes() + { + return _data; + } + + /// <summary> + /// Set message data as bytes. + /// </summary> + public void SetDataAsBytes(byte[] data) + { + if (data == null) + _data = null; + else + _data = (byte[])data.Clone(); + } + + /// <summary> + /// Get message data as string. + /// </summary> + public string GetDataAsString() + { + if (_data == null) + return String.Empty; + else + return Encoding.ASCII.GetString(_data); + } + + /// <summary> + /// Set message data as string. + /// </summary> + public void SetDataAsString(string data) + { + if (String.IsNullOrEmpty(data)) + _data = null; + else + _data = Encoding.ASCII.GetBytes(data); + } + + /// <summary> /// Turn this Message instance into a byte array. /// </summary> /// <returns>Byte array representation of this Message instance.</returns> Modified: trunk/plugins/IR Server Suite/Common/IrssComms/MessageManagerCombo.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssComms/MessageManagerCombo.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Common/IrssComms/MessageManagerCombo.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -6,7 +6,7 @@ /// <summary> /// Encapsulates an IrssMessage and a ClientManager object instance for queueing. /// </summary> - public struct MessageManagerCombo : IEquatable<MessageManagerCombo> + public class MessageManagerCombo : IEquatable<MessageManagerCombo> { #region Variables @@ -53,6 +53,8 @@ #endregion Properties + #region IEquatable<MessageManagerCombo> Members + /// <summary> /// Indicates whether the current object is equal to another object of the same type. /// </summary> @@ -105,6 +107,8 @@ return _message.GetHashCode() + _manager.GetHashCode(); } + #endregion + } } Modified: trunk/plugins/IR Server Suite/Common/IrssComms/Server.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssComms/Server.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Common/IrssComms/Server.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -81,13 +81,12 @@ GC.SuppressFinalize(this); } - protected virtual void Dispose(bool disposing) + protected virtual void Dispose(bool disposeManagedResources) { - if (disposing) + if (disposeManagedResources) { // Dispose managed resources ... - if (_processConnectionThread) - Stop(); + Stop(); _messageQueue.Dispose(); } @@ -177,7 +176,7 @@ lock (_clientManagers) { foreach (ClientManager manager in _clientManagers) - manager.Stop(); + manager.Dispose(); _clientManagers.Clear(); _clientManagers = null; @@ -239,10 +238,16 @@ manager.Start(); } } +#if TRACE catch (SocketException socketException) { - Trace.Write(socketException.ToString()); + Trace.WriteLine(socketException.ToString()); } +#else + catch (SocketException) + { + } +#endif } #endregion Implementation Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -193,6 +193,8 @@ #region Command Segments + public static readonly char[] SegmentSeparator = new char[] { '|' }; + public const int SegmentsBlastCommand = 2; public const int SegmentsRunCommand = 8; public const int SegmentsSerialCommand = 7; @@ -273,7 +275,7 @@ if (String.IsNullOrEmpty(command)) throw new ArgumentNullException("command"); - string[] commands = command.Split(new char[] { '|' }, StringSplitOptions.None); + string[] commands = command.Split(SegmentSeparator, StringSplitOptions.None); if (commands.Length != elements) throw new ArgumentException(String.Format("Command structure is invalid: {0}", command), "command"); @@ -291,6 +293,9 @@ /// <param name="command">An array of arguments for the method (the output of SplitRunCommand).</param> public static void ProcessRunCommand(string[] commands) { + if (commands == null) + throw new ArgumentNullException("commands"); + Process process = new Process(); process.StartInfo.FileName = commands[0]; process.StartInfo.WorkingDirectory = commands[1]; @@ -333,6 +338,9 @@ /// <param name="commands">An array of arguments for the method (the output of SplitSerialCommand).</param> public static void ProcessSerialCommand(string[] commands) { + if (commands == null) + throw new ArgumentNullException("commands"); + string command = Common.ReplaceEscapeCodes(commands[0]); string comPort = commands[1]; @@ -369,6 +377,9 @@ /// <param name="commands">An array of arguments for the method (the output of SplitWindowMessageCommand).</param> public static void ProcessWindowMessageCommand(string[] commands) { + if (commands == null) + throw new ArgumentNullException("commands"); + IntPtr windowHandle = IntPtr.Zero; string matchType = commands[0].ToLowerInvariant(); @@ -425,6 +436,9 @@ /// <param name="command">The keystrokes to send.</param> public static void ProcessKeyCommand(string command) { + if (String.IsNullOrEmpty(command)) + throw new ArgumentNullException("command"); + SendKeys.SendWait(command); } @@ -434,6 +448,9 @@ /// <param name="commands">An array of arguments for the method (the output of SplitTcpMessageCommand).</param> public static void ProcessTcpMessageCommand(string[] commands) { + if (commands == null) + throw new ArgumentNullException("commands"); + using (TcpClient tcpClient = new TcpClient()) { tcpClient.Connect(commands[0], int.Parse(commands[1])); @@ -457,6 +474,9 @@ /// <param name="command">The Mouse Command string.</param> public static void ProcessMouseCommand(string command) { + if (String.IsNullOrEmpty(command)) + throw new ArgumentNullException("command"); + switch (command) { case MouseClickLeft: @@ -503,6 +523,9 @@ /// <param name="command">The drive letter of the CD-ROM drive to eject the tray on.</param> public static void ProcessEjectCommand(string command) { + if (String.IsNullOrEmpty(command)) + throw new ArgumentNullException("command"); + if (CDRom.IsCDRom(command)) CDRom.Open(command); } Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/IrssLog.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/IrssLog.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/IrssLog.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -70,10 +70,16 @@ File.Move(fileName, backup); } +#if TRACE catch (Exception ex) { - Trace.WriteLine(ex.Message); + Trace.WriteLine(ex.ToString()); } +#else + catch + { + } +#endif } try @@ -84,10 +90,16 @@ string message = DateTime.Now.ToString() + ":\tLog Opened"; _streamWriter.WriteLine(message); } +#if TRACE catch (Exception ex) { - Trace.WriteLine(ex.Message); + Trace.WriteLine(ex.ToString()); } +#else + catch + { + } +#endif } } @@ -109,12 +121,18 @@ File.Delete(backup); File.Move(fileName, backup); - } + } } +#if TRACE catch (Exception ex) { - Trace.WriteLine(ex.Message); + Trace.WriteLine(ex.ToString()); } +#else + catch + { + } +#endif try { @@ -124,10 +142,16 @@ string message = DateTime.Now.ToString() + ":\tLog Opened"; _streamWriter.WriteLine(message); } +#if TRACE catch (Exception ex) { - Trace.WriteLine(ex.Message); + Trace.WriteLine(ex.ToString()); } +#else + catch + { + } +#endif } } Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/SystemRegistry.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/SystemRegistry.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/SystemRegistry.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -17,6 +17,8 @@ #endregion Constants + #region Methods + /// <summary> /// Get the install folder for IR Server Suite. /// </summary> @@ -37,6 +39,9 @@ /// <returns>If key of name exists return true else return false.</returns> public static bool GetAutoRun(string name) { + if (String.IsNullOrEmpty(name)) + throw new ArgumentNullException("name"); + RegistryKey key = Registry.CurrentUser.CreateSubKey(AutoRunPath); bool autoRun = (key.GetValue(name, null) != null); key.Close(); @@ -51,6 +56,12 @@ /// <param name="executablePath">Executable Path for program.</param> public static void SetAutoRun(string name, string executablePath) { + if (String.IsNullOrEmpty(name)) + throw new ArgumentNullException("name"); + + if (String.IsNullOrEmpty(executablePath)) + throw new ArgumentNullException("executablePath"); + RegistryKey key = Registry.CurrentUser.CreateSubKey(AutoRunPath); key.SetValue(name, executablePath, RegistryValueKind.String); key.Close(); @@ -62,11 +73,16 @@ /// <param name="name">Auto-run program name.</param> public static void RemoveAutoRun(string name) { + if (String.IsNullOrEmpty(name)) + throw new ArgumentNullException("name"); + RegistryKey key = Registry.CurrentUser.CreateSubKey(AutoRunPath); key.DeleteValue(name, false); key.Close(); } - + + #endregion Methods + } } Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Win32.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Win32.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Win32.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -364,6 +364,12 @@ #region Delegates + /// <summary> + /// Delegate for enumerating open Windows with EnumWindows method. + /// </summary> + /// <param name="hWnd">Window Handle.</param> + /// <param name="lParam">lParam.</param> + /// <returns>Success.</returns> public delegate bool EnumWindowsProc(IntPtr hWnd, int lParam); #endregion Delegates @@ -640,9 +646,9 @@ /// </summary> /// <param name="o">Object to get pointer for.</param> /// <returns>Pointer to object.</returns> - public static IntPtr VarPtr(object o) + public static IntPtr VarPtr(object obj) { - GCHandle handle = GCHandle.Alloc(o, GCHandleType.Pinned); + GCHandle handle = GCHandle.Alloc(obj, GCHandleType.Pinned); IntPtr ptr = handle.AddrOfPinnedObject(); handle.Free(); return ptr; Modified: trunk/plugins/IR Server Suite/Common/MPUtils/MPCommands.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/MPUtils/MPCommands.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Common/MPUtils/MPCommands.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -27,7 +27,7 @@ { GUIDialogNotify dlgNotify = (GUIDialogNotify)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_NOTIFY); if (dlgNotify == null) - throw new Exception("Failed to create GUIDialogNotify"); + throw new ApplicationException("Failed to create GUIDialogNotify"); dlgNotify.Reset(); dlgNotify.ClearAll(); @@ -44,6 +44,9 @@ /// <param name="useBasicHome">Use the basic home screen when home is requested.</param> public static void ProcessGoTo(string screen, bool useBasicHome) { + if (String.IsNullOrEmpty(screen)) + throw new ArgumentNullException("screen"); + int window = (int)GUIWindow.Window.WINDOW_INVALID; try @@ -66,7 +69,7 @@ } if (window == (int)GUIWindow.Window.WINDOW_INVALID) - throw new Exception(String.Format("Failed to parse Goto command window id \"{0}\"", screen)); + throw new ArgumentException(String.Format("Failed to parse Goto command window id \"{0}\"", screen), "screen"); if (window == (int)GUIWindow.Window.WINDOW_HOME && useBasicHome) window = (int)GUIWindow.Window.WINDOW_SECOND_HOME; Modified: trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -214,11 +214,18 @@ return true; } +#if TRACE catch (Exception ex) { - Trace.WriteLine(ex.Message); + Trace.WriteLine(ex.ToString()); return false; } +#else + catch + { + return false; + } +#endif } public override void Suspend() { @@ -261,7 +268,7 @@ string devicePath = FindDevice(hidGuid, DeviceID); if (devicePath == null) - throw new Exception("No device detected"); + throw new ApplicationException("No device detected"); SafeFileHandle deviceHandle = CreateFile(devicePath, GENERIC_READ, EFileShares.Read | EFileShares.Write, IntPtr.Zero, ECreationDisposition.OpenExisting, EFileAttributes.Overlapped, IntPtr.Zero); int lastError = Marshal.GetLastWin32Error(); @@ -381,10 +388,16 @@ if (_deviceStream != null) _deviceStream.BeginRead(_deviceBuffer, 0, _deviceBuffer.Length, new AsyncCallback(OnReadComplete), null); } +#if TRACE catch (Exception ex) { Trace.WriteLine(ex.ToString()); } +#else + catch + { + } +#endif } #endregion Implementation Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IRServerPluginInterface.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IRServerPluginInterface.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IRServerPluginInterface.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -50,6 +50,9 @@ #endregion Enumerations + /// <summary> + /// Base cla... [truncated message content] |
From: <an...@us...> - 2007-09-28 18:10:54
|
Revision: 961 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=961&view=rev Author: and-81 Date: 2007-09-28 11:10:48 -0700 (Fri, 28 Sep 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs Modified: trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-09-28 16:34:14 UTC (rev 960) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-09-28 18:10:48 UTC (rev 961) @@ -43,7 +43,7 @@ #endregion Enumerations - internal class IRServer : IDisposable + public class IRServer : IDisposable { #region Constants @@ -115,6 +115,10 @@ if (disposeManagedResources) { // Dispose managed resources ... + + StopServer(); + StopClient(); + _notifyIcon.Dispose(); _notifyIcon = null; } @@ -183,7 +187,7 @@ { IrssLog.Warn("No transmit plugin loaded"); } - else if (_pluginTransmit != null) + else if (_pluginTransmit == null) { _pluginTransmit = Program.GetPlugin(_pluginNameTransmit); } Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs 2007-09-28 16:34:14 UTC (rev 960) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs 2007-09-28 18:10:48 UTC (rev 961) @@ -252,7 +252,7 @@ } public LearnStatus Learn(out byte[] data) { - IrCode code = null; + IrCode code; LearnStatus status = _driver.Learn(_learnTimeout, out code); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-10-05 16:35:48
|
Revision: 978 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=978&view=rev Author: and-81 Date: 2007-10-05 09:35:46 -0700 (Fri, 05 Oct 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs trunk/plugins/IR Server Suite/IR Server Suite.sln trunk/plugins/IR Server Suite/Input Service/Input Service/InputService.cs trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Config.Designer.cs trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Config.cs trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Config.resx trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Configuration.csproj trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Icon.ico trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Program.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MPBlastZonePlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs Added Paths: ----------- trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Input Service Configuration.exe.manifest Modified: trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs 2007-10-05 15:41:56 UTC (rev 977) +++ trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs 2007-10-05 16:35:46 UTC (rev 978) @@ -194,7 +194,7 @@ { IrssLog.Error(ex.ToString()); - _serverHost = String.Empty; + _serverHost = "localhost"; _programFile = String.Empty; _launchOnLoad = false; _launchKeyCode = DefaultKeyCode; Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs 2007-10-05 15:41:56 UTC (rev 977) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs 2007-10-05 16:35:46 UTC (rev 978) @@ -228,7 +228,7 @@ { IrssLog.Error(ex.ToString()); - _serverHost = String.Empty; + _serverHost = "localhost"; _remoteSkin = DefaultSkin; } } Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs 2007-10-05 15:41:56 UTC (rev 977) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs 2007-10-05 16:35:46 UTC (rev 978) @@ -486,7 +486,7 @@ { IrssLog.Error(ex.ToString()); - _serverHost = String.Empty; + _serverHost = "localhost"; } } void SaveSettings() Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs 2007-10-05 15:41:56 UTC (rev 977) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs 2007-10-05 16:35:46 UTC (rev 978) @@ -88,18 +88,18 @@ Driver _driver; - IrProtocol _lastRemoteButtonCodeType = IrProtocol.None; - uint _lastRemoteButtonKeyCode = 0; - DateTime _lastRemoteButtonTime = DateTime.Now; - bool _remoteButtonRepeated = false; + IrProtocol _lastRemoteButtonCodeType = IrProtocol.None; + uint _lastRemoteButtonKeyCode = 0; + DateTime _lastRemoteButtonTime = DateTime.Now; + bool _remoteButtonRepeated = false; - bool _keyboardKeyRepeated = false; - DateTime _lastKeyboardKeyTime = DateTime.Now; + bool _keyboardKeyRepeated = false; + DateTime _lastKeyboardKeyTime = DateTime.Now; - uint _lastKeyboardKeyCode = 0; - uint _lastKeyboardModifiers = 0; + uint _lastKeyboardKeyCode = 0; + uint _lastKeyboardModifiers = 0; - Mouse.MouseEvents _mouseButtons = Mouse.MouseEvents.None; + Mouse.MouseEvents _mouseButtons = Mouse.MouseEvents.None; RemoteHandler _remoteHandler; KeyboardHandler _keyboardHandler; Modified: trunk/plugins/IR Server Suite/IR Server Suite.sln =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite.sln 2007-10-05 15:41:56 UTC (rev 977) +++ trunk/plugins/IR Server Suite/IR Server Suite.sln 2007-10-05 16:35:46 UTC (rev 978) @@ -211,185 +211,334 @@ Release.AspNetCompiler.Debug = "False" EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Input Service", "Input Service\Input Service.csproj", "{8ADDE1CB-2D23-4AB1-88B1-A241C60C16BA}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestServer", "TestServer\TestServer.csproj", "{327F54E5-D1DC-4297-BF2F-4283EB30FFB1}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.Debug = "False" EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestServer", "TestServer\TestServer.csproj", "{327F54E5-D1DC-4297-BF2F-4283EB30FFB1}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestClient", "TestClient\TestClient.csproj", "{DDB52A4D-A670-411A-8273-8B1707C67028}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.Debug = "False" EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestClient", "TestClient\TestClient.csproj", "{DDB52A4D-A670-411A-8273-8B1707C67028}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MCEReplacement", "..\MCEReplacement\MCEReplacement.csproj", "{B45E87BC-AC5A-4923-A911-79C95DCC5602}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.Debug = "False" EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MCEReplacement", "..\MCEReplacement\MCEReplacement.csproj", "{B45E87BC-AC5A-4923-A911-79C95DCC5602}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serial IR Blaster", "IR Server Plugins\Serial IR Blaster\Serial IR Blaster.csproj", "{1D4B9ABE-F37D-4C38-9BC5-EDD43F271F4E}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.Debug = "False" EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serial IR Blaster", "IR Server Plugins\Serial IR Blaster\Serial IR Blaster.csproj", "{1D4B9ABE-F37D-4C38-9BC5-EDD43F271F4E}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Input Service", "Input Service", "{DEE5AAD1-0110-4681-8FF9-662CEA72FD94}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" Release.AspNetCompiler.Debug = "False" EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Input Service", "Input Service\Input Service\Input Service.csproj", "{8ADDE1CB-2D23-4AB1-88B1-A241C60C16BA}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Configuration", "Input Service\Input Service Configuration\Configuration.csproj", "{DC79E2EC-7D1B-4359-A285-38AC8154166B}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D2A1F8D6-A9D3-4BFA-913B-8806642BD0DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D2A1F8D6-A9D3-4BFA-913B-8806642BD0DA}.Debug|Any CPU.Build.0 = Debug|Any CPU {D2A1F8D6-A9D3-4BFA-913B-8806642BD0DA}.Debug|x86.ActiveCfg = Debug|x86 {D2A1F8D6-A9D3-4BFA-913B-8806642BD0DA}.Debug|x86.Build.0 = Debug|x86 + {D2A1F8D6-A9D3-4BFA-913B-8806642BD0DA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D2A1F8D6-A9D3-4BFA-913B-8806642BD0DA}.Release|Any CPU.Build.0 = Release|Any CPU {D2A1F8D6-A9D3-4BFA-913B-8806642BD0DA}.Release|x86.ActiveCfg = Release|x86 {D2A1F8D6-A9D3-4BFA-913B-8806642BD0DA}.Release|x86.Build.0 = Release|x86 + {0C894165-4BE8-4CF7-8F92-2B6DF68EB43A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0C894165-4BE8-4CF7-8F92-2B6DF68EB43A}.Debug|Any CPU.Build.0 = Debug|Any CPU {0C894165-4BE8-4CF7-8F92-2B6DF68EB43A}.Debug|x86.ActiveCfg = Debug|x86 {0C894165-4BE8-4CF7-8F92-2B6DF68EB43A}.Debug|x86.Build.0 = Debug|x86 + {0C894165-4BE8-4CF7-8F92-2B6DF68EB43A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0C894165-4BE8-4CF7-8F92-2B6DF68EB43A}.Release|Any CPU.Build.0 = Release|Any CPU {0C894165-4BE8-4CF7-8F92-2B6DF68EB43A}.Release|x86.ActiveCfg = Release|x86 {0C894165-4BE8-4CF7-8F92-2B6DF68EB43A}.Release|x86.Build.0 = Release|x86 + {4CD051F4-F2B5-47B3-8647-F47C2E4DC131}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4CD051F4-F2B5-47B3-8647-F47C2E4DC131}.Debug|Any CPU.Build.0 = Debug|Any CPU {4CD051F4-F2B5-47B3-8647-F47C2E4DC131}.Debug|x86.ActiveCfg = Debug|x86 {4CD051F4-F2B5-47B3-8647-F47C2E4DC131}.Debug|x86.Build.0 = Debug|x86 + {4CD051F4-F2B5-47B3-8647-F47C2E4DC131}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4CD051F4-F2B5-47B3-8647-F47C2E4DC131}.Release|Any CPU.Build.0 = Release|Any CPU {4CD051F4-F2B5-47B3-8647-F47C2E4DC131}.Release|x86.ActiveCfg = Release|x86 {4CD051F4-F2B5-47B3-8647-F47C2E4DC131}.Release|x86.Build.0 = Release|x86 + {A8B8B9C6-9E88-486B-AE9C-F2D945ED05A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A8B8B9C6-9E88-486B-AE9C-F2D945ED05A6}.Debug|Any CPU.Build.0 = Debug|Any CPU {A8B8B9C6-9E88-486B-AE9C-F2D945ED05A6}.Debug|x86.ActiveCfg = Debug|x86 {A8B8B9C6-9E88-486B-AE9C-F2D945ED05A6}.Debug|x86.Build.0 = Debug|x86 + {A8B8B9C6-9E88-486B-AE9C-F2D945ED05A6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A8B8B9C6-9E88-486B-AE9C-F2D945ED05A6}.Release|Any CPU.Build.0 = Release|Any CPU {A8B8B9C6-9E88-486B-AE9C-F2D945ED05A6}.Release|x86.ActiveCfg = Release|x86 {A8B8B9C6-9E88-486B-AE9C-F2D945ED05A6}.Release|x86.Build.0 = Release|x86 + {46C08F6B-F3C8-461B-9B6F-3BFD4AAAFD63}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {46C08F6B-F3C8-461B-9B6F-3BFD4AAAFD63}.Debug|Any CPU.Build.0 = Debug|Any CPU {46C08F6B-F3C8-461B-9B6F-3BFD4AAAFD63}.Debug|x86.ActiveCfg = Debug|x86 {46C08F6B-F3C8-461B-9B6F-3BFD4AAAFD63}.Debug|x86.Build.0 = Debug|x86 + {46C08F6B-F3C8-461B-9B6F-3BFD4AAAFD63}.Release|Any CPU.ActiveCfg = Release|Any CPU + {46C08F6B-F3C8-461B-9B6F-3BFD4AAAFD63}.Release|Any CPU.Build.0 = Release|Any CPU {46C08F6B-F3C8-461B-9B6F-3BFD4AAAFD63}.Release|x86.ActiveCfg = Release|x86 {46C08F6B-F3C8-461B-9B6F-3BFD4AAAFD63}.Release|x86.Build.0 = Release|x86 + {D871AB9A-71B3-4D63-8320-084BAD75064E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D871AB9A-71B3-4D63-8320-084BAD75064E}.Debug|Any CPU.Build.0 = Debug|Any CPU {D871AB9A-71B3-4D63-8320-084BAD75064E}.Debug|x86.ActiveCfg = Debug|x86 {D871AB9A-71B3-4D63-8320-084BAD75064E}.Debug|x86.Build.0 = Debug|x86 + {D871AB9A-71B3-4D63-8320-084BAD75064E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D871AB9A-71B3-4D63-8320-084BAD75064E}.Release|Any CPU.Build.0 = Release|Any CPU {D871AB9A-71B3-4D63-8320-084BAD75064E}.Release|x86.ActiveCfg = Release|x86 {D871AB9A-71B3-4D63-8320-084BAD75064E}.Release|x86.Build.0 = Release|x86 + {E8BEBBCC-1EE0-488D-8806-98ADCB7F0479}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E8BEBBCC-1EE0-488D-8806-98ADCB7F0479}.Debug|Any CPU.Build.0 = Debug|Any CPU {E8BEBBCC-1EE0-488D-8806-98ADCB7F0479}.Debug|x86.ActiveCfg = Debug|x86 {E8BEBBCC-1EE0-488D-8806-98ADCB7F0479}.Debug|x86.Build.0 = Debug|x86 + {E8BEBBCC-1EE0-488D-8806-98ADCB7F0479}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E8BEBBCC-1EE0-488D-8806-98ADCB7F0479}.Release|Any CPU.Build.0 = Release|Any CPU {E8BEBBCC-1EE0-488D-8806-98ADCB7F0479}.Release|x86.ActiveCfg = Release|x86 {E8BEBBCC-1EE0-488D-8806-98ADCB7F0479}.Release|x86.Build.0 = Release|x86 + {7946D42A-4BCB-4D79-80EB-BA9B17CE2E90}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7946D42A-4BCB-4D79-80EB-BA9B17CE2E90}.Debug|Any CPU.Build.0 = Debug|Any CPU {7946D42A-4BCB-4D79-80EB-BA9B17CE2E90}.Debug|x86.ActiveCfg = Debug|x86 {7946D42A-4BCB-4D79-80EB-BA9B17CE2E90}.Debug|x86.Build.0 = Debug|x86 + {7946D42A-4BCB-4D79-80EB-BA9B17CE2E90}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7946D42A-4BCB-4D79-80EB-BA9B17CE2E90}.Release|Any CPU.Build.0 = Release|Any CPU {7946D42A-4BCB-4D79-80EB-BA9B17CE2E90}.Release|x86.ActiveCfg = Release|x86 {7946D42A-4BCB-4D79-80EB-BA9B17CE2E90}.Release|x86.Build.0 = Release|x86 + {CD395FC2-70E2-42C4-8A20-5469A0C5EB50}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CD395FC2-70E2-42C4-8A20-5469A0C5EB50}.Debug|Any CPU.Build.0 = Debug|Any CPU {CD395FC2-70E2-42C4-8A20-5469A0C5EB50}.Debug|x86.ActiveCfg = Debug|x86 {CD395FC2-70E2-42C4-8A20-5469A0C5EB50}.Debug|x86.Build.0 = Debug|x86 + {CD395FC2-70E2-42C4-8A20-5469A0C5EB50}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CD395FC2-70E2-42C4-8A20-5469A0C5EB50}.Release|Any CPU.Build.0 = Release|Any CPU {CD395FC2-70E2-42C4-8A20-5469A0C5EB50}.Release|x86.ActiveCfg = Release|x86 {CD395FC2-70E2-42C4-8A20-5469A0C5EB50}.Release|x86.Build.0 = Release|x86 + {A4023992-CCD6-461E-8E14-219A496734C5}.Debug|Any CPU.ActiveCfg = Debug|x86 {A4023992-CCD6-461E-8E14-219A496734C5}.Debug|x86.ActiveCfg = Debug|x86 {A4023992-CCD6-461E-8E14-219A496734C5}.Debug|x86.Build.0 = Debug|x86 + {A4023992-CCD6-461E-8E14-219A496734C5}.Release|Any CPU.ActiveCfg = Release|x86 {A4023992-CCD6-461E-8E14-219A496734C5}.Release|x86.ActiveCfg = Release|x86 {A4023992-CCD6-461E-8E14-219A496734C5}.Release|x86.Build.0 = Release|x86 + {7C686499-7517-4338-8837-7E8617549D9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7C686499-7517-4338-8837-7E8617549D9A}.Debug|Any CPU.Build.0 = Debug|Any CPU {7C686499-7517-4338-8837-7E8617549D9A}.Debug|x86.ActiveCfg = Debug|x86 {7C686499-7517-4338-8837-7E8617549D9A}.Debug|x86.Build.0 = Debug|x86 + {7C686499-7517-4338-8837-7E8617549D9A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7C686499-7517-4338-8837-7E8617549D9A}.Release|Any CPU.Build.0 = Release|Any CPU {7C686499-7517-4338-8837-7E8617549D9A}.Release|x86.ActiveCfg = Release|x86 {7C686499-7517-4338-8837-7E8617549D9A}.Release|x86.Build.0 = Release|x86 + {BABC30EB-7D0F-4398-9FCB-E517EA8D2AA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BABC30EB-7D0F-4398-9FCB-E517EA8D2AA9}.Debug|Any CPU.Build.0 = Debug|Any CPU {BABC30EB-7D0F-4398-9FCB-E517EA8D2AA9}.Debug|x86.ActiveCfg = Debug|x86 {BABC30EB-7D0F-4398-9FCB-E517EA8D2AA9}.Debug|x86.Build.0 = Debug|x86 + {BABC30EB-7D0F-4398-9FCB-E517EA8D2AA9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BABC30EB-7D0F-4398-9FCB-E517EA8D2AA9}.Release|Any CPU.Build.0 = Release|Any CPU {BABC30EB-7D0F-4398-9FCB-E517EA8D2AA9}.Release|x86.ActiveCfg = Release|x86 {BABC30EB-7D0F-4398-9FCB-E517EA8D2AA9}.Release|x86.Build.0 = Release|x86 + {99B5CA78-3E0B-477F-A7D3-EE1B65E85DE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {99B5CA78-3E0B-477F-A7D3-EE1B65E85DE4}.Debug|Any CPU.Build.0 = Debug|Any CPU {99B5CA78-3E0B-477F-A7D3-EE1B65E85DE4}.Debug|x86.ActiveCfg = Debug|x86 {99B5CA78-3E0B-477F-A7D3-EE1B65E85DE4}.Debug|x86.Build.0 = Debug|x86 + {99B5CA78-3E0B-477F-A7D3-EE1B65E85DE4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {99B5CA78-3E0B-477F-A7D3-EE1B65E85DE4}.Release|Any CPU.Build.0 = Release|Any CPU {99B5CA78-3E0B-477F-A7D3-EE1B65E85DE4}.Release|x86.ActiveCfg = Release|x86 {99B5CA78-3E0B-477F-A7D3-EE1B65E85DE4}.Release|x86.Build.0 = Release|x86 + {4CBA81F9-F0C2-4242-8D72-204597285042}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4CBA81F9-F0C2-4242-8D72-204597285042}.Debug|Any CPU.Build.0 = Debug|Any CPU {4CBA81F9-F0C2-4242-8D72-204597285042}.Debug|x86.ActiveCfg = Debug|x86 {4CBA81F9-F0C2-4242-8D72-204597285042}.Debug|x86.Build.0 = Debug|x86 + {4CBA81F9-F0C2-4242-8D72-204597285042}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4CBA81F9-F0C2-4242-8D72-204597285042}.Release|Any CPU.Build.0 = Release|Any CPU {4CBA81F9-F0C2-4242-8D72-204597285042}.Release|x86.ActiveCfg = Release|x86 {4CBA81F9-F0C2-4242-8D72-204597285042}.Release|x86.Build.0 = Release|x86 + {2B9C6BE9-98D0-4D69-B041-57EE5D2DFB97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2B9C6BE9-98D0-4D69-B041-57EE5D2DFB97}.Debug|Any CPU.Build.0 = Debug|Any CPU {2B9C6BE9-98D0-4D69-B041-57EE5D2DFB97}.Debug|x86.ActiveCfg = Debug|x86 {2B9C6BE9-98D0-4D69-B041-57EE5D2DFB97}.Debug|x86.Build.0 = Debug|x86 + {2B9C6BE9-98D0-4D69-B041-57EE5D2DFB97}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2B9C6BE9-98D0-4D69-B041-57EE5D2DFB97}.Release|Any CPU.Build.0 = Release|Any CPU {2B9C6BE9-98D0-4D69-B041-57EE5D2DFB97}.Release|x86.ActiveCfg = Release|x86 {2B9C6BE9-98D0-4D69-B041-57EE5D2DFB97}.Release|x86.Build.0 = Release|x86 + {907DCA39-A5E0-4EFA-B1F6-5FBE2C1BCD25}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {907DCA39-A5E0-4EFA-B1F6-5FBE2C1BCD25}.Debug|Any CPU.Build.0 = Debug|Any CPU {907DCA39-A5E0-4EFA-B1F6-5FBE2C1BCD25}.Debug|x86.ActiveCfg = Debug|x86 {907DCA39-A5E0-4EFA-B1F6-5FBE2C1BCD25}.Debug|x86.Build.0 = Debug|x86 + {907DCA39-A5E0-4EFA-B1F6-5FBE2C1BCD25}.Release|Any CPU.ActiveCfg = Release|Any CPU + {907DCA39-A5E0-4EFA-B1F6-5FBE2C1BCD25}.Release|Any CPU.Build.0 = Release|Any CPU {907DCA39-A5E0-4EFA-B1F6-5FBE2C1BCD25}.Release|x86.ActiveCfg = Release|x86 {907DCA39-A5E0-4EFA-B1F6-5FBE2C1BCD25}.Release|x86.Build.0 = Release|x86 + {883913F6-F4A7-4DE2-846A-C2102FAF499E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {883913F6-F4A7-4DE2-846A-C2102FAF499E}.Debug|Any CPU.Build.0 = Debug|Any CPU {883913F6-F4A7-4DE2-846A-C2102FAF499E}.Debug|x86.ActiveCfg = Debug|x86 {883913F6-F4A7-4DE2-846A-C2102FAF499E}.Debug|x86.Build.0 = Debug|x86 + {883913F6-F4A7-4DE2-846A-C2102FAF499E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {883913F6-F4A7-4DE2-846A-C2102FAF499E}.Release|Any CPU.Build.0 = Release|Any CPU {883913F6-F4A7-4DE2-846A-C2102FAF499E}.Release|x86.ActiveCfg = Release|x86 {883913F6-F4A7-4DE2-846A-C2102FAF499E}.Release|x86.Build.0 = Release|x86 + {253FFB14-AB8E-49AB-A005-A42428C3F452}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {253FFB14-AB8E-49AB-A005-A42428C3F452}.Debug|Any CPU.Build.0 = Debug|Any CPU {253FFB14-AB8E-49AB-A005-A42428C3F452}.Debug|x86.ActiveCfg = Debug|x86 {253FFB14-AB8E-49AB-A005-A42428C3F452}.Debug|x86.Build.0 = Debug|x86 + {253FFB14-AB8E-49AB-A005-A42428C3F452}.Release|Any CPU.ActiveCfg = Release|Any CPU + {253FFB14-AB8E-49AB-A005-A42428C3F452}.Release|Any CPU.Build.0 = Release|Any CPU {253FFB14-AB8E-49AB-A005-A42428C3F452}.Release|x86.ActiveCfg = Release|x86 {253FFB14-AB8E-49AB-A005-A42428C3F452}.Release|x86.Build.0 = Release|x86 + {9FDD649E-0502-4FED-9AC1-AA0346394375}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9FDD649E-0502-4FED-9AC1-AA0346394375}.Debug|Any CPU.Build.0 = Debug|Any CPU {9FDD649E-0502-4FED-9AC1-AA0346394375}.Debug|x86.ActiveCfg = Debug|x86 {9FDD649E-0502-4FED-9AC1-AA0346394375}.Debug|x86.Build.0 = Debug|x86 + {9FDD649E-0502-4FED-9AC1-AA0346394375}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9FDD649E-0502-4FED-9AC1-AA0346394375}.Release|Any CPU.Build.0 = Release|Any CPU {9FDD649E-0502-4FED-9AC1-AA0346394375}.Release|x86.ActiveCfg = Release|x86 {9FDD649E-0502-4FED-9AC1-AA0346394375}.Release|x86.Build.0 = Release|x86 + {CA15769C-232E-4CA7-94FD-206A06CA3ABB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CA15769C-232E-4CA7-94FD-206A06CA3ABB}.Debug|Any CPU.Build.0 = Debug|Any CPU {CA15769C-232E-4CA7-94FD-206A06CA3ABB}.Debug|x86.ActiveCfg = Debug|x86 {CA15769C-232E-4CA7-94FD-206A06CA3ABB}.Debug|x86.Build.0 = Debug|x86 + {CA15769C-232E-4CA7-94FD-206A06CA3ABB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CA15769C-232E-4CA7-94FD-206A06CA3ABB}.Release|Any CPU.Build.0 = Release|Any CPU {CA15769C-232E-4CA7-94FD-206A06CA3ABB}.Release|x86.ActiveCfg = Release|x86 {CA15769C-232E-4CA7-94FD-206A06CA3ABB}.Release|x86.Build.0 = Release|x86 + {08F57DD7-2C6E-484E-9CC5-835F70C5BC64}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {08F57DD7-2C6E-484E-9CC5-835F70C5BC64}.Debug|Any CPU.Build.0 = Debug|Any CPU {08F57DD7-2C6E-484E-9CC5-835F70C5BC64}.Debug|x86.ActiveCfg = Debug|x86 {08F57DD7-2C6E-484E-9CC5-835F70C5BC64}.Debug|x86.Build.0 = Debug|x86 + {08F57DD7-2C6E-484E-9CC5-835F70C5BC64}.Release|Any CPU.ActiveCfg = Release|Any CPU + {08F57DD7-2C6E-484E-9CC5-835F70C5BC64}.Release|Any CPU.Build.0 = Release|Any CPU {08F57DD7-2C6E-484E-9CC5-835F70C5BC64}.Release|x86.ActiveCfg = Release|x86 {08F57DD7-2C6E-484E-9CC5-835F70C5BC64}.Release|x86.Build.0 = Release|x86 + {D8B3D28F-62CE-4CA7-86CE-B7EAD614A94C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D8B3D28F-62CE-4CA7-86CE-B7EAD614A94C}.Debug|Any CPU.Build.0 = Debug|Any CPU {D8B3D28F-62CE-4CA7-86CE-B7EAD614A94C}.Debug|x86.ActiveCfg = Debug|x86 {D8B3D28F-62CE-4CA7-86CE-B7EAD614A94C}.Debug|x86.Build.0 = Debug|x86 + {D8B3D28F-62CE-4CA7-86CE-B7EAD614A94C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D8B3D28F-62CE-4CA7-86CE-B7EAD614A94C}.Release|Any CPU.Build.0 = Release|Any CPU {D8B3D28F-62CE-4CA7-86CE-B7EAD614A94C}.Release|x86.ActiveCfg = Release|x86 {D8B3D28F-62CE-4CA7-86CE-B7EAD614A94C}.Release|x86.Build.0 = Release|x86 + {0F6576B4-C88E-4E79-B7E9-9480498C5A32}.Debug|Any CPU.ActiveCfg = Debug|x86 {0F6576B4-C88E-4E79-B7E9-9480498C5A32}.Debug|x86.ActiveCfg = Debug|x86 {0F6576B4-C88E-4E79-B7E9-9480498C5A32}.Debug|x86.Build.0 = Debug|x86 + {0F6576B4-C88E-4E79-B7E9-9480498C5A32}.Release|Any CPU.ActiveCfg = Release|Any CPU {0F6576B4-C88E-4E79-B7E9-9480498C5A32}.Release|x86.ActiveCfg = Release|Any CPU + {C6B0CF12-01D3-439A-9FB4-DEFD5B32F6FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C6B0CF12-01D3-439A-9FB4-DEFD5B32F6FB}.Debug|Any CPU.Build.0 = Debug|Any CPU {C6B0CF12-01D3-439A-9FB4-DEFD5B32F6FB}.Debug|x86.ActiveCfg = Debug|x86 {C6B0CF12-01D3-439A-9FB4-DEFD5B32F6FB}.Debug|x86.Build.0 = Debug|x86 + {C6B0CF12-01D3-439A-9FB4-DEFD5B32F6FB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C6B0CF12-01D3-439A-9FB4-DEFD5B32F6FB}.Release|Any CPU.Build.0 = Release|Any CPU {C6B0CF12-01D3-439A-9FB4-DEFD5B32F6FB}.Release|x86.ActiveCfg = Release|x86 {C6B0CF12-01D3-439A-9FB4-DEFD5B32F6FB}.Release|x86.Build.0 = Release|x86 + {54E0E8FA-09C3-4755-B9CE-E7E5DDA3E932}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {54E0E8FA-09C3-4755-B9CE-E7E5DDA3E932}.Debug|Any CPU.Build.0 = Debug|Any CPU {54E0E8FA-09C3-4755-B9CE-E7E5DDA3E932}.Debug|x86.ActiveCfg = Debug|x86 {54E0E8FA-09C3-4755-B9CE-E7E5DDA3E932}.Debug|x86.Build.0 = Debug|x86 + {54E0E8FA-09C3-4755-B9CE-E7E5DDA3E932}.Release|Any CPU.ActiveCfg = Release|Any CPU + {54E0E8FA-09C3-4755-B9CE-E7E5DDA3E932}.Release|Any CPU.Build.0 = Release|Any CPU {54E0E8FA-09C3-4755-B9CE-E7E5DDA3E932}.Release|x86.ActiveCfg = Release|x86 {54E0E8FA-09C3-4755-B9CE-E7E5DDA3E932}.Release|x86.Build.0 = Release|x86 + {BCAFDF45-70DD-46FD-8B98-880DDA585AD2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BCAFDF45-70DD-46FD-8B98-880DDA585AD2}.Debug|Any CPU.Build.0 = Debug|Any CPU {BCAFDF45-70DD-46FD-8B98-880DDA585AD2}.Debug|x86.ActiveCfg = Debug|x86 {BCAFDF45-70DD-46FD-8B98-880DDA585AD2}.Debug|x86.Build.0 = Debug|x86 + {BCAFDF45-70DD-46FD-8B98-880DDA585AD2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BCAFDF45-70DD-46FD-8B98-880DDA585AD2}.Release|Any CPU.Build.0 = Release|Any CPU {BCAFDF45-70DD-46FD-8B98-880DDA585AD2}.Release|x86.ActiveCfg = Release|x86 {BCAFDF45-70DD-46FD-8B98-880DDA585AD2}.Release|x86.Build.0 = Release|x86 + {905131F8-F8AC-4A65-A722-37783902D7B8}.Debug|Any CPU.ActiveCfg = Debug|x86 {905131F8-F8AC-4A65-A722-37783902D7B8}.Debug|x86.ActiveCfg = Debug|x86 {905131F8-F8AC-4A65-A722-37783902D7B8}.Debug|x86.Build.0 = Debug|x86 + {905131F8-F8AC-4A65-A722-37783902D7B8}.Release|Any CPU.ActiveCfg = Release|x86 {905131F8-F8AC-4A65-A722-37783902D7B8}.Release|x86.ActiveCfg = Release|x86 {905131F8-F8AC-4A65-A722-37783902D7B8}.Release|x86.Build.0 = Release|x86 + {B5E711A2-E6D0-4BEA-B66B-7A8B0BCA6A4D}.Debug|Any CPU.ActiveCfg = Debug|x86 {B5E711A2-E6D0-4BEA-B66B-7A8B0BCA6A4D}.Debug|x86.ActiveCfg = Debug|x86 {B5E711A2-E6D0-4BEA-B66B-7A8B0BCA6A4D}.Debug|x86.Build.0 = Debug|x86 + {B5E711A2-E6D0-4BEA-B66B-7A8B0BCA6A4D}.Release|Any CPU.ActiveCfg = Release|x86 {B5E711A2-E6D0-4BEA-B66B-7A8B0BCA6A4D}.Release|x86.ActiveCfg = Release|x86 {B5E711A2-E6D0-4BEA-B66B-7A8B0BCA6A4D}.Release|x86.Build.0 = Release|x86 + {EE8F2C22-8BD3-4832-85F0-E6F67ED3AADB}.Debug|Any CPU.ActiveCfg = Debug|x86 {EE8F2C22-8BD3-4832-85F0-E6F67ED3AADB}.Debug|x86.ActiveCfg = Debug|x86 {EE8F2C22-8BD3-4832-85F0-E6F67ED3AADB}.Debug|x86.Build.0 = Debug|x86 + {EE8F2C22-8BD3-4832-85F0-E6F67ED3AADB}.Release|Any CPU.ActiveCfg = Release|x86 {EE8F2C22-8BD3-4832-85F0-E6F67ED3AADB}.Release|x86.ActiveCfg = Release|x86 {EE8F2C22-8BD3-4832-85F0-E6F67ED3AADB}.Release|x86.Build.0 = Release|x86 + {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Debug|Any CPU.Build.0 = Debug|Any CPU {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Debug|x86.ActiveCfg = Debug|x86 {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Debug|x86.Build.0 = Debug|x86 + {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Release|Any CPU.Build.0 = Release|Any CPU {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Release|x86.ActiveCfg = Release|x86 {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Release|x86.Build.0 = Release|x86 + {0C291BE9-5D15-4097-9119-4FFE19C23113}.Debug|Any CPU.ActiveCfg = Debug|x86 {0C291BE9-5D15-4097-9119-4FFE19C23113}.Debug|x86.ActiveCfg = Debug|x86 {0C291BE9-5D15-4097-9119-4FFE19C23113}.Debug|x86.Build.0 = Debug|x86 + {0C291BE9-5D15-4097-9119-4FFE19C23113}.Release|Any CPU.ActiveCfg = Release|x86 {0C291BE9-5D15-4097-9119-4FFE19C23113}.Release|x86.ActiveCfg = Release|x86 {0C291BE9-5D15-4097-9119-4FFE19C23113}.Release|x86.Build.0 = Release|x86 - {8ADDE1CB-2D23-4AB1-88B1-A241C60C16BA}.Debug|x86.ActiveCfg = Debug|x86 - {8ADDE1CB-2D23-4AB1-88B1-A241C60C16BA}.Debug|x86.Build.0 = Debug|x86 - {8ADDE1CB-2D23-4AB1-88B1-A241C60C16BA}.Release|x86.ActiveCfg = Release|x86 - {8ADDE1CB-2D23-4AB1-88B1-A241C60C16BA}.Release|x86.Build.0 = Release|x86 + {327F54E5-D1DC-4297-BF2F-4283EB30FFB1}.Debug|Any CPU.ActiveCfg = Debug|x86 {327F54E5-D1DC-4297-BF2F-4283EB30FFB1}.Debug|x86.ActiveCfg = Debug|x86 {327F54E5-D1DC-4297-BF2F-4283EB30FFB1}.Debug|x86.Build.0 = Debug|x86 + {327F54E5-D1DC-4297-BF2F-4283EB30FFB1}.Release|Any CPU.ActiveCfg = Release|x86 {327F54E5-D1DC-4297-BF2F-4283EB30FFB1}.Release|x86.ActiveCfg = Release|x86 {327F54E5-D1DC-4297-BF2F-4283EB30FFB1}.Release|x86.Build.0 = Release|x86 + {DDB52A4D-A670-411A-8273-8B1707C67028}.Debug|Any CPU.ActiveCfg = Debug|x86 {DDB52A4D-A670-411A-8273-8B1707C67028}.Debug|x86.ActiveCfg = Debug|x86 {DDB52A4D-A670-411A-8273-8B1707C67028}.Debug|x86.Build.0 = Debug|x86 + {DDB52A4D-A670-411A-8273-8B1707C67028}.Release|Any CPU.ActiveCfg = Release|x86 {DDB52A4D-A670-411A-8273-8B1707C67028}.Release|x86.ActiveCfg = Release|x86 {DDB52A4D-A670-411A-8273-8B1707C67028}.Release|x86.Build.0 = Release|x86 + {B45E87BC-AC5A-4923-A911-79C95DCC5602}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B45E87BC-AC5A-4923-A911-79C95DCC5602}.Debug|Any CPU.Build.0 = Debug|Any CPU {B45E87BC-AC5A-4923-A911-79C95DCC5602}.Debug|x86.ActiveCfg = Debug|x86 {B45E87BC-AC5A-4923-A911-79C95DCC5602}.Debug|x86.Build.0 = Debug|x86 + {B45E87BC-AC5A-4923-A911-79C95DCC5602}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B45E87BC-AC5A-4923-A911-79C95DCC5602}.Release|Any CPU.Build.0 = Release|Any CPU {B45E87BC-AC5A-4923-A911-79C95DCC5602}.Release|x86.ActiveCfg = Release|x86 {B45E87BC-AC5A-4923-A911-79C95DCC5602}.Release|x86.Build.0 = Release|x86 + {1D4B9ABE-F37D-4C38-9BC5-EDD43F271F4E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1D4B9ABE-F37D-4C38-9BC5-EDD43F271F4E}.Debug|Any CPU.Build.0 = Debug|Any CPU {1D4B9ABE-F37D-4C38-9BC5-EDD43F271F4E}.Debug|x86.ActiveCfg = Debug|x86 {1D4B9ABE-F37D-4C38-9BC5-EDD43F271F4E}.Debug|x86.Build.0 = Debug|x86 + {1D4B9ABE-F37D-4C38-9BC5-EDD43F271F4E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1D4B9ABE-F37D-4C38-9BC5-EDD43F271F4E}.Release|Any CPU.Build.0 = Release|Any CPU {1D4B9ABE-F37D-4C38-9BC5-EDD43F271F4E}.Release|x86.ActiveCfg = Release|x86 {1D4B9ABE-F37D-4C38-9BC5-EDD43F271F4E}.Release|x86.Build.0 = Release|x86 + {8ADDE1CB-2D23-4AB1-88B1-A241C60C16BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8ADDE1CB-2D23-4AB1-88B1-A241C60C16BA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8ADDE1CB-2D23-4AB1-88B1-A241C60C16BA}.Debug|x86.ActiveCfg = Debug|x86 + {8ADDE1CB-2D23-4AB1-88B1-A241C60C16BA}.Debug|x86.Build.0 = Debug|x86 + {8ADDE1CB-2D23-4AB1-88B1-A241C60C16BA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8ADDE1CB-2D23-4AB1-88B1-A241C60C16BA}.Release|Any CPU.Build.0 = Release|Any CPU + {8ADDE1CB-2D23-4AB1-88B1-A241C60C16BA}.Release|x86.ActiveCfg = Release|x86 + {8ADDE1CB-2D23-4AB1-88B1-A241C60C16BA}.Release|x86.Build.0 = Release|x86 + {DC79E2EC-7D1B-4359-A285-38AC8154166B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DC79E2EC-7D1B-4359-A285-38AC8154166B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DC79E2EC-7D1B-4359-A285-38AC8154166B}.Debug|x86.ActiveCfg = Debug|Any CPU + {DC79E2EC-7D1B-4359-A285-38AC8154166B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DC79E2EC-7D1B-4359-A285-38AC8154166B}.Release|Any CPU.Build.0 = Release|Any CPU + {DC79E2EC-7D1B-4359-A285-38AC8154166B}.Release|x86.ActiveCfg = Release|x86 + {DC79E2EC-7D1B-4359-A285-38AC8154166B}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -429,5 +578,7 @@ {BCAFDF45-70DD-46FD-8B98-880DDA585AD2} = {E757F80C-23C5-4AD6-B178-16799E337E03} {327F54E5-D1DC-4297-BF2F-4283EB30FFB1} = {E757F80C-23C5-4AD6-B178-16799E337E03} {DDB52A4D-A670-411A-8273-8B1707C67028} = {E757F80C-23C5-4AD6-B178-16799E337E03} + {8ADDE1CB-2D23-4AB1-88B1-A241C60C16BA} = {DEE5AAD1-0110-4681-8FF9-662CEA72FD94} + {DC79E2EC-7D1B-4359-A285-38AC8154166B} = {DEE5AAD1-0110-4681-8FF9-662CEA72FD94} EndGlobalSection EndGlobal Modified: trunk/plugins/IR Server Suite/Input Service/Input Service/InputService.cs =================================================================== --- trunk/plugins/IR Server Suite/Input Service/Input Service/InputService.cs 2007-10-05 15:41:56 UTC (rev 977) +++ trunk/plugins/IR Server Suite/Input Service/Input Service/InputService.cs 2007-10-05 16:35:46 UTC (rev 978) @@ -471,6 +471,8 @@ #endregion Service Methods + #region Implementation + void StartServer() { if (_server != null) @@ -1469,6 +1471,8 @@ } } + #endregion Implementation + } } Modified: trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Config.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Config.Designer.cs 2007-10-05 15:41:56 UTC (rev 977) +++ trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Config.Designer.cs 2007-10-05 16:35:46 UTC (rev 978) @@ -33,7 +33,6 @@ this.buttonOK = new System.Windows.Forms.Button(); this.buttonCancel = new System.Windows.Forms.Button(); this.toolTips = new System.Windows.Forms.ToolTip(this.components); - this.checkBoxRunAtBoot = new System.Windows.Forms.CheckBox(); this.buttonAdvanced = new System.Windows.Forms.Button(); this.buttonDetect = new System.Windows.Forms.Button(); this.groupBoxTransceiver = new System.Windows.Forms.GroupBox(); @@ -45,10 +44,10 @@ // buttonOK // this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonOK.Location = new System.Drawing.Point(352, 304); + this.buttonOK.Location = new System.Drawing.Point(352, 272); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(64, 24); - this.buttonOK.TabIndex = 5; + this.buttonOK.TabIndex = 4; this.buttonOK.Text = "OK"; this.buttonOK.UseVisualStyleBackColor = true; this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); @@ -57,33 +56,21 @@ // this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.buttonCancel.Location = new System.Drawing.Point(424, 304); + this.buttonCancel.Location = new System.Drawing.Point(424, 272); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(64, 24); - this.buttonCancel.TabIndex = 6; + this.buttonCancel.TabIndex = 5; this.buttonCancel.Text = "Cancel"; this.buttonCancel.UseVisualStyleBackColor = true; this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); // - // checkBoxRunAtBoot - // - this.checkBoxRunAtBoot.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.checkBoxRunAtBoot.AutoSize = true; - this.checkBoxRunAtBoot.Location = new System.Drawing.Point(8, 272); - this.checkBoxRunAtBoot.Name = "checkBoxRunAtBoot"; - this.checkBoxRunAtBoot.Size = new System.Drawing.Size(165, 17); - this.checkBoxRunAtBoot.TabIndex = 1; - this.checkBoxRunAtBoot.Text = "&Start IR Server with Windows"; - this.toolTips.SetToolTip(this.checkBoxRunAtBoot, "Run IR Server when windows boots up?"); - this.checkBoxRunAtBoot.UseVisualStyleBackColor = true; - // // buttonAdvanced // this.buttonAdvanced.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.buttonAdvanced.Location = new System.Drawing.Point(80, 304); + this.buttonAdvanced.Location = new System.Drawing.Point(80, 272); this.buttonAdvanced.Name = "buttonAdvanced"; this.buttonAdvanced.Size = new System.Drawing.Size(64, 24); - this.buttonAdvanced.TabIndex = 3; + this.buttonAdvanced.TabIndex = 2; this.buttonAdvanced.Text = "Advanced"; this.toolTips.SetToolTip(this.buttonAdvanced, "Click here for advanced options"); this.buttonAdvanced.UseVisualStyleBackColor = true; @@ -92,10 +79,10 @@ // buttonDetect // this.buttonDetect.Anchor = System.Windows.Forms.AnchorStyles.Bottom; - this.buttonDetect.Location = new System.Drawing.Point(216, 304); + this.buttonDetect.Location = new System.Drawing.Point(216, 272); this.buttonDetect.Name = "buttonDetect"; this.buttonDetect.Size = new System.Drawing.Size(80, 24); - this.buttonDetect.TabIndex = 4; + this.buttonDetect.TabIndex = 3; this.buttonDetect.Text = "Auto-Detect"; this.toolTips.SetToolTip(this.buttonDetect, "Click here to automatically detect attached devices"); this.buttonDetect.UseVisualStyleBackColor = true; @@ -103,8 +90,7 @@ // // groupBoxTransceiver // - this.groupBoxTransceiver.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) + this.groupBoxTransceiver.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.groupBoxTransceiver.Controls.Add(this.gridPlugins); this.groupBoxTransceiver.Location = new System.Drawing.Point(8, 8); @@ -133,10 +119,10 @@ // buttonHelp // this.buttonHelp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.buttonHelp.Location = new System.Drawing.Point(8, 304); + this.buttonHelp.Location = new System.Drawing.Point(8, 272); this.buttonHelp.Name = "buttonHelp"; this.buttonHelp.Size = new System.Drawing.Size(64, 24); - this.buttonHelp.TabIndex = 2; + this.buttonHelp.TabIndex = 1; this.buttonHelp.Text = "Help"; this.buttonHelp.UseVisualStyleBackColor = true; this.buttonHelp.Click += new System.EventHandler(this.buttonHelp_Click); @@ -145,22 +131,20 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(496, 343); + this.ClientSize = new System.Drawing.Size(496, 306); this.Controls.Add(this.buttonDetect); this.Controls.Add(this.buttonAdvanced); this.Controls.Add(this.buttonHelp); - this.Controls.Add(this.checkBoxRunAtBoot); this.Controls.Add(this.groupBoxTransceiver); this.Controls.Add(this.buttonCancel); this.Controls.Add(this.buttonOK); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MinimumSize = new System.Drawing.Size(504, 370); + this.MinimumSize = new System.Drawing.Size(512, 342); this.Name = "Config"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "IR Server - Configuration"; + this.Text = "Input Service Configuration"; this.groupBoxTransceiver.ResumeLayout(false); this.ResumeLayout(false); - this.PerformLayout(); } @@ -170,7 +154,6 @@ private System.Windows.Forms.Button buttonCancel; private System.Windows.Forms.ToolTip toolTips; private System.Windows.Forms.GroupBox groupBoxTransceiver; - private System.Windows.Forms.CheckBox checkBoxRunAtBoot; private System.Windows.Forms.Button buttonHelp; private SourceGrid.Grid gridPlugins; private System.Windows.Forms.Button buttonAdvanced; Modified: trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Config.cs =================================================================== --- trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Config.cs 2007-10-05 15:41:56 UTC (rev 977) +++ trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Config.cs 2007-10-05 16:35:46 UTC (rev 978) @@ -126,15 +126,6 @@ { CreateGrid(); } - - try - { - checkBoxRunAtBoot.Checked = SystemRegistry.GetAutoRun("IR Server"); - } - catch (Exception ex) - { - IrssLog.Error(ex.ToString()); - } } #endregion Constructor @@ -234,18 +225,6 @@ private void buttonOK_Click(object sender, EventArgs e) { - try - { - if (checkBoxRunAtBoot.Checked) - SystemRegistry.SetAutoRun("IR Server", Application.ExecutablePath); - else - SystemRegistry.RemoveAutoRun("IR Server"); - } - catch (Exception ex) - { - IrssLog.Error(ex.ToString()); - } - this.DialogResult = DialogResult.OK; this.Close(); } Modified: trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Config.resx =================================================================== --- trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Config.resx 2007-10-05 15:41:56 UTC (rev 977) +++ trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Config.resx 2007-10-05 16:35:46 UTC (rev 978) @@ -123,49 +123,158 @@ <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> - AAABAAIAICAAAAEACACoCAAAJgAAABAQEAABAAQAKAEAAM4IAAAoAAAAIAAAAEAAAAABAAgAAAAAAIAE - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAgAAAAICAAIAAAACAAIAAgIAAAMDAwADA3MAA8MqmANTw - /wCx4v8AjtT/AGvG/wBIuP8AJar/AACq/wAAktwAAHq5AABilgAASnMAADJQANTj/wCxx/8Ajqv/AGuP - /wBIc/8AJVf/AABV/wAASdwAAD25AAAxlgAAJXMAABlQANTU/wCxsf8Ajo7/AGtr/wBISP8AJSX/AAAA - /gAAANwAAAC5AAAAlgAAAHMAAABQAOPU/wDHsf8Aq47/AI9r/wBzSP8AVyX/AFUA/wBJANwAPQC5ADEA - lgAlAHMAGQBQAPDU/wDisf8A1I7/AMZr/wC4SP8AqiX/AKoA/wCSANwAegC5AGIAlgBKAHMAMgBQAP/U - /wD/sf8A/47/AP9r/wD/SP8A/yX/AP4A/gDcANwAuQC5AJYAlgBzAHMAUABQAP/U8AD/seIA/47UAP9r - xgD/SLgA/yWqAP8AqgDcAJIAuQB6AJYAYgBzAEoAUAAyAP/U4wD/sccA/46rAP9rjwD/SHMA/yVXAP8A - VQDcAEkAuQA9AJYAMQBzACUAUAAZAP/U1AD/sbEA/46OAP9rawD/SEgA/yUlAP4AAADcAAAAuQAAAJYA - AABzAAAAUAAAAP/j1AD/x7EA/6uOAP+PawD/c0gA/1clAP9VAADcSQAAuT0AAJYxAABzJQAAUBkAAP/w - 1AD/4rEA/9SOAP/GawD/uEgA/6olAP+qAADckgAAuXoAAJZiAABzSgAAUDIAAP//1AD//7EA//+OAP// - awD//0gA//8lAP7+AADc3AAAubkAAJaWAABzcwAAUFAAAPD/1ADi/7EA1P+OAMb/awC4/0gAqv8lAKr/ - AACS3AAAerkAAGKWAABKcwAAMlAAAOP/1ADH/7EAq/+OAI//awBz/0gAV/8lAFX/AABJ3AAAPbkAADGW - AAAlcwAAGVAAANT/1ACx/7EAjv+OAGv/awBI/0gAJf8lAAD+AAAA3AAAALkAAACWAAAAcwAAAFAAANT/ - 4wCx/8cAjv+rAGv/jwBI/3MAJf9XAAD/VQAA3EkAALk9AACWMQAAcyUAAFAZANT/8ACx/+IAjv/UAGv/ - xgBI/7gAJf+qAAD/qgAA3JIAALl6AACWYgAAc0oAAFAyANT//wCx//8Ajv//AGv//wBI//8AJf//AAD+ - /gAA3NwAALm5AACWlgAAc3MAAFBQAPLy8gDm5uYA2traAM7OzgDCwsIAtra2AKqqqgCenp4AkpKSAIaG - hgB6enoAbm5uAGJiYgBWVlYASkpKAD4+PgAyMjIAJiYmABoaGgAODg4A8Pv/AKSgoACAgIAAAAD/AAD/ - AAAA//8A/wAAAP8A/wD//wAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAABAAQAICAAAAEACACoCAAARgAAABAQAAABAAgAaAUAAO4IAAAgIAAAAQAgAKgQAABWDgAAEBAAAAEA + IABoBAAA/h4AACgAAAAgAAAAQAAAAAEACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYGBAIWF + hQCIiIgAjo6OAJGRkQCVlZUAmpqaAJucnACdnZ0AoaKiAKWmpgCnqKgAqKmpAKusrACsra0AsbGxALW1 + tQC4ubkAu7y8ALy9vQDDw8MAxcXFAMnJyQDNzs4A0dLSANPU1ADV1dUA2NnZAN3d3QDg4OAA5OXlAOjp + 6QDu7u4A8fHxAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - /PwAAPz8/PwA/AAA/AAAAPwAAAD8/Pz8APwAAPwAAAAAAPwA/AAAAAD8AAD8AAD8APwAAPwAAAAA/AAA - /AAAAAAA/AD8AAAAAPwAAPwAAPwA/AAA/AAAAAD8AAD8AAAAAAD8APwAAAAA/AAA/AD8AAAA/AD8AAAA - APwAAPwAAAAAAPwA/AAAAAD8AAD8APwAAAD8APwAAAAA/AAA/AAAAPz8AAD8/PwAAPz8/AAA/AAAAPwA - /Pz8AAD8/PwAAAD8AAAAAPwAAAAA/AAA/AD8AAAA/AD8AAAAAPwAAPwAAPwAAAAA/AAAAAD8AAD8APwA - AAD8APwAAAAA/AAA/AAA/AAAAAD8AAAAAPwAAPwA/AAAAPwA/AAAAAD8AAD8AAD8AAAAAPwAAAAA/AAA - /AD8AAAA/AD8AAAAAPwAAPwAAAD8/AAA/Pz8/AD8/PwAAPwAAAD8APz8/PwA/Pz8AAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - APn5+fn5+fn5AAAA+fn5AAAAAAD5+fkAAAAAAAAAAAAAAPn5+fn5+QAAAAAA+fkAAAAAAPn5AAAAAAAA - AAAAAAAAAAD5+QAAAAAAAAD5+QAAAAAA+fkAAAAAAAAAAAAAAAAAAPn5AAAAAAAAAPn5+fn5+fn5AAAA - AAAAAAAAAAAAAAAA+fkAAAAAAAAA+fn5+fn5+fkAAAAAAAAAAAAAAAAAAAD5+QAAAAAAAAD5+QAAAAAA - +fkAAAAAAAAAAAAAAAAAAPn5AAAAAAAAAPn5AAAAAAD5+QAAAAAAAAAAAAAAAAAA+fkAAAAAAAAA+fkA - AAAAAPn5AAAAAAAAAAAAAAAA+fn5+fn5AAAAAAD5+fn5+fn5+fkAAAAAAAAAAAAAAPn5+fn5+fn5AAAA - +fn5+fn5+fn5AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAPj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+AAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////AAAAAP/////MLdwt9e2t7fXtre317XXt9e117cxj - dGO97XXtve117b3tde297XXtzCN0I//////////////////////gHHx/8D58//z+fP/8/gH//P4B//z+ - fP/8/nz//P58//A+AP/gHAH///////////8AAAAf/////ygAAAAQAAAAIAAAAAEABAAAAAAAwAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAwMDAAICAgAAAAP8AAP8AAAD/ - /wD/AAAA/wD/AP//AAD///8AAAAAAAAAAAAKq77t2ZzAAAAAAAAAAAAAAAAAAAAAAAAAzMDAwAwAAAAA - wMDAwMAAAMzAzADAwAAAwADAwMDAAADMwMwAwMAAAAAAAAAAAAAAmZCQCQAAAAAJAJCQAAAAAAkAmQAA - AAAACQCQkAAAAACZkJmQAAAAAAAAAAAAAAD//wAAgAcAAP//AAD//wAAxW8AAPVXAADE1wAA3VcAAMTX - AAD//wAAxb8AAO1/AADs/wAA7X8AAMR/AAD//wAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8AAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAACQYGAgMAAAAAAAAJBgYCAAAAAAAAAAAAAAAAAAAAAA8PDAwMBgMAAAAADw8MDAkG + AwAAAAAAAAAAAAAAAAAAFg8PDw8MBgAAAAAWDw8PDwwGAAAAAAAAAAAAAAAAAAARDw8PDw8MAAAAABEP + Dw8PDwwAAAAAAAAAAAAAAAAAABEPDw8PDw8AAAAAEQ8PDw8PDwAAAAAAAAAAAAAAAAAAEQ8PDw8PDwAA + AAARDw8PDw8PAAAAAAAAAAAAAAAAAAARDw8PDw8PAAAAABEPDw8PDw8AAAAAAAAAAAAAAAAAABEPDw8P + Dw8AAAAAEQ8PDw8PDwAAAAAAAAAAAAAAAAAAEQ8PDw8PDwAAAAARDw8PDw8PAAAAAAkJCQkGAgAAAAAR + Dw8PDw8PAAAAABEPDw8PDw8AAAAPDwwPDwwJAwAAABEPDw8PDw8AAAAAEQ8PDw8PDwAAABIPDw8PDw8J + AgAAEQ8PDw8PDwAAAAARDw8PDw8PAAAWDw8PHh8RDwwJAAARDw8PDw8PAAAAABEPDw8PDw8AABoPDxr/ + /x8PDw8AABEPDw8PDw8AAAAAEQ8PDw8PDwAAHg8PF///Hg8PEQAAEg8PDw8PEQAAAAASDw8PDw8RAAAg + EQ8PFhcPDw8SAAAeDw8PDxESAAAAABoPDw8PERIAAAAaDw8PDw8PEgAAAAAaEhESGgAAAAAAABoRERIa + AAAAAAAaEQ8PERYaAAAAAAAAIAAAAAAAAAAAACIgAAAAAAAAAAAgHx4gAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP// + ////////////////////////////////////////wfh//4DwH/+A8B//gPAf/4DwH/+A8B//gPAf/4Dw + H/+A8B4HgPAcA4DwHAGA8BgBgPAYAYDwGAGA8BgBgPAcA8H4PgP3/P8P//////////////////////// + ////////KAAAABAAAAAgAAAAAQAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACDhIQAhoaGAIuL + iwCWl5cAmZqaAJ2dnQChoqIAo6SkAKWmpgCnqKgAqampAKusrACtrq4AsbKyALa3twC3uLgAuLm5ALu8 + vADCw8MAxcXFAMnKygDLzMwAz8/PANbX1wDZ2dkA4eHhAOXl5QDv7+8AAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUEAwAA + CAUCAAAAAAAAABMLCwgAAA4LCgQAAAAAAAATCwsLAAALCwsEAAAAAAAAEwsLCwAACwsLBAAAAAAAABML + CwsAAAsLCwQACAgFAgATCwsLAAALCwsEAAsQEggEFQsLCwAACwsLBQALGxwLBRsLCw4AABILCwAADg4O + CwAAGxkAAAAAGBsAAAAVFQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA//8AAP//AAD//wAA//8AAIx/AAAMPwAADD8AAAw/AAAMIQAADCAAAAwgAAAMYQAAnnMAAP// + AAD//wAA//8AACgAAAAgAAAAQAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAABwAA + AAYAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAGAAAABQAAAAEAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQEBAAAAEwAA + ADYAAABMAAAASAAAACwAAAAKAAAAAAAAAAAAAAAAAAAAAAEBAQEAAAATAAAANgAAAEkAAABDAAAAJwAA + AAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcH + BxZMTEyLh4iI3ZGRkfBqa2vSISEhhwAAAEAAAAAJAAAAAAAAAAAAAAAABgcHGEtLS4yCg4PZioqK6WJi + YskZGRl+AAAAOgAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAgICAFfH19nK6vr/+mp6f/pqen/6Chof+UlZX7KysrjQAAACYAAAAAAAAAACUlJQWCg4Olra6u/6Wm + pv+lpqb/n5+f/5GRkfchISGBAAAAIQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAGVlZTDExMT9qqqq/6mqqv+pqqr/qaqq/6SkpP+JiormAAAAPQAAAAMAAAAAdXV1OcPD + w/6qqqr/qaqq/6mqqv+pqqr/oqOj/3+AgNsAAAA3AAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAsLGxdrS1tf+pqqr/qaqq/6mqqv+pqqr/qamp/6anp/4SEhJOAAAABAAA + AADExcV0tLS0/6mqqv+pqqr/qaqq/6mqqv+oqan/paam+woKCkIAAAADAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACztLR9sbKy/6mqqv+pqqr/qaqq/6mqqv+pqqr/qKmp/xYW + FlEAAAAEAAAAANXW1nyxsrL/qaqq/6mqqv+pqqr/qaqq/6mqqv+oqan9Dw8PRgAAAAMAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALOzs32xsbH/qaqq/6mqqv+pqqr/qaqq/6mq + qv+pqan/FhYWUQAAAAQAAAAA1dbWfLGxsf+pqqr/qaqq/6mqqv+pqqr/qaqq/6ioqP0PDw9GAAAAAwAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAs7OzfbGxsf+pqqr/qaqq/6mq + qv+pqqr/qaqq/6mpqf8WFhZRAAAABAAAAADV1tZ8sbGx/6mqqv+pqqr/qaqq/6mqqv+pqqr/qKio/Q8P + D0YAAAADAAAAAAAAAAAAAAAAAAAABAAAAA0AAAASAAAADwAAAAYAAAAAAAAAAAAAAACzs7N9sbGx/6mq + qv+pqqr/qaqq/6mqqv+pqqr/qamp/xYWFlEAAAAEAAAAANXW1nyxsbH/qaqq/6mqqv+pqqr/qaqq/6mq + qv+oqKj9Dw8PRgAAAAMAAAAAAQEBAQAAABQBAQE9FBQUZhYWFnEDBARcAAAARAAAAB0AAAADAAAAALOz + s32xsbH/qaqq/6mqqv+pqqr/qaqq/6mqqv+pqan/FhYWUQAAAAQAAAAA1dbWfLGxsf+pqqr/qaqq/6mq + qv+pqqr/qaqq/6ioqP0PDw9GAAAAAwAAAAAGBgYaU1NTkpaXl+uen5/+mpqa/o2NjfRTVFS8BwcHZAAA + ACYAAAACs7OzfbGxsf+pqqr/qaqq/6mqqv+pqqr/qaqq/6mpqf8WFhZRAAAABAAAAADV1tZ8sbGx/6mq + qv+pqqr/qaqq/6mqqv+pqqr/qKio/Q8PD0YCAgIDFxcXC4ODg62srKz/p6io/6mpqf+pqan/pqen/5uc + nP94eHjgCAgIXwAAABSzs7N9sbGx/6mqqv+pqqr/qaqq/6mqqv+pqqr/qamp/xYWFlEAAAAEAAAAANXW + 1nyxsbH/qaqq/6mqqv+pqqr/qaqq/6mqqv+oqKj9Dw8PRhISEgNjZGRfuLm5/qmqqv+pqqr/qaqq/6mp + qf+pqqr/qKmp/52env9aWlq6AAAAMLOzs32xsbH/qaqq/6mqqv+pqqr/qaqq/6mqqv+pqan/FhYWUQAA + AAQAAAAA1dbWfLGxsf+pqqr/qaqq/6mqqv+pqqr/qaqq/6ioqP0PDw9GMDAwBLKzs76sra3/qaqq/62u + rv/f39//5eXl/7a3t/+pqqr/p6io/5qamvQFBQVEs7S0fbGxsf+pqqr/qaqq/6mqqv+pqqr/qaqq/6mp + qf8WFhZRAAAABAAAAADV1tZ8sbGx/6mqqv+pqqr/qaqq/6mqqv+pqqr/qKio/Q8PD0ZFRUUEz9DQ56us + rP+pqqr/0dHR////////////5OXl/6mqqv+pqqr/qKmp/hsbG1THyMh8srKy/6mqqv+pqqr/qaqq/6mq + qv+pqqr/qqur/xcXF0wAAAADAAAAANna2nuysrL/qaqq/6mqqv+pqqr/qaqq/6mqqv+qq6v9Dw8PQFNU + VALU1dXgrK2t/6mqqv/Jycn////////////c3Nz/qaqq/6mqqv+xsbH+GhoaQOLj42a7vLz/qaqq/6mq + qv+pqqr/qaqq/6mqqv+1trb8ExMTLwAAAAAAAAAA4eLiabm5uf+pqqr/qaqq/6mqqv+pqqr/qaqq/7S1 + tfcLCwsmAAAAAN7f36Sys7P/qaqq/6mqqv/Hx8f/zc7O/6ytrf+pqqr/qqur/7CxseIPDw8U4+TkE9bX + 1/Gur6//qaqq/6mqqv+pqqr/sLCw/6Slpb8fHx8JAAAAAAAAAADk5OQg09PT+K2urv+pqqr/qaqq/6mq + qv+wsbH/m5yctR8fHwgAAAAA5OTkL9DR0fmtrq7/qaqq/6mqqv+pqqr/qaqq/6qrq/+8vb3/b3Bwbykp + KQIAAAAA5ebmU9XW1va5ubn/s7Oz/7u8vP/Pz8/deHl5JQAAAAAAAAAAAAAAAAAAAADm5+dl0dLS+7a3 + t/+ysrL/u7y8/8vMzNp1dnYgAAAAAAAAAAAAAAAA5eXlW9LS0ve0tbX/ra6u/6ytrf+wsbH/xMTE/ra3 + t5FnZ2cDAAAAAAAAAAAAAAAA5ufnI+bn537k5eWV4uLias/Q0A0AAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AADm5+cw5ubmiuLj453h4uJsysvLDQAAAAAAAAAAAAAAAAAAAAAAAAAA5eXlKuTk5Jna2trT19jY193d + 3azZ2tpFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA////////////////////////////////4fw//4DwH/+AcA//AGAP/wAgB/8AIAf/ACAH/wAg + B/8AIAcHACAEAQAgBAAAIAAAACAAAAAgAAAAIAAAACAAAABgCAAAYAgAgPAcAcH4Pgf///////////// + //////////////////8oAAAAEAAAACAAAAABACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAABMAAAAoAAAADgAAAAAAAAAAAAAABQAAACIAAAAcAAAAAgAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAACorKy6KiorZkJGR8Dg4OJQAAAAMDAwMAWBhYZKWlpbwa2trzwgICDkAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAACjpKSoqaqq/6mqqv+foKD4BAQEJGhoaCuys7P+qaqq/6eoqP9LTEyUAAAAAQAA + AAAAAAAAAAAAAAAAAAAAAAAAsrOzvqmqqv+pqqr/qamp/wsLCyqdnp4+ra6u/6mqqv+pqqr/W1xcogAA + AAEAAAAAAAAAAAAAAAAAAAAAAAAAALKysr6pqqr/qaqq/6mpqf8LCwsqnp6ePq2urv+pqqr/qaqq/1tc + XKIAAAABAAAABQUFBS0GBgY8AAAAGgAAAACysrK+qaqq/6mqqv+pqan/CwsLKp6enj6trq7/qaqq/6mq + qv9bXFyiCAgIBGJiYpahoqL5nZ6e/FtcXMACAgInsrKyvqmqqv+pqqr/qamp/wsLCyqenp4+ra6u/6mq + qv+pqqr/W1xcolZWVkmurq7+t7i4/7u8vP+lpqb/Pj4+ibe4uL2pqqr/qaqq/6mqqv8LCwspoKCgPq2u + rv+pqqr/qaqq/1xcXKCPkJBzqqur/+bm5v/v7+//qaqq/2NkZKTW1taaqqur/6mqqv+tra3uDQ0NDqOk + pCK4ubn9qaqq/6usrP9eX193nJycNLa3t/2wsbH/s7Oz/66vr/9WVlZavL29FNfX16bNzc2/qqurRAAA + AAAAAAAA4eLiZMzNzcnMzc2UTExMCAAAAADg4eFfyMjI2sTFxeDExcV1AAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP// + nEH//5xB//+cQYw/nEEAP5xBAB+cQQAfnEEAAZxBAACcQQAAnEEAAJxBAACcQQwhnEH//5xB//+cQf// + nEE= </value> </data> </root> \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Configuration.csproj =================================================================== --- trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Configuration.csproj 2007-10-05 15:41:56 UTC (rev 977) +++ trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Configuration.csproj 2007-10-05 16:35:46 UTC (rev 978) @@ -33,6 +33,22 @@ <PlatformTarget>x86</PlatformTarget> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> + <DebugSymbols>true</DebugSymbols> + <OutputPath>bin\x86\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <DebugType>full</DebugType> + <PlatformTarget>x86</PlatformTarget> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> + <OutputPath>bin\x86\Release\</OutputPath> + <Optimize>true</Optimize> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <PlatformTarget>x86</PlatformTarget> + <ErrorReport>prompt</ErrorReport> + <UseVSHostingProcess>true</UseVSHostingProcess> + </PropertyGroup> <ItemGroup> <Reference Include="DevAge.Core, Version=4.6.2660.128, Culture=neutral, PublicKeyToken=faad465d84242dbf, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> @@ -49,6 +65,7 @@ <Reference Include="System" /> <Reference Include="System.Data" /> <Reference Include="System.Drawing" /> + <Reference Include="System.ServiceProcess" /> <Reference Include="System.Windows.Forms" /> <Reference Include="System.Xml" /> </ItemGroup> @@ -93,6 +110,11 @@ <Name>IR Server Plugin Interface</Name> </ProjectReference> </ItemGroup> + <ItemGroup> + <Content Include="Input Service Configuration.exe.manifest"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process,... [truncated message content] |
From: <an...@us...> - 2007-10-07 17:28:43
|
Revision: 981 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=981&view=rev Author: and-81 Date: 2007-10-07 10:28:41 -0700 (Sun, 07 Oct 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverReplacement.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverVista.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverXP.cs trunk/plugins/IR Server Suite/Input Service/Input Service/InputService.cs trunk/plugins/IR Server Suite/Input Service/Input Service/Program.cs trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Advanced.Designer.cs trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Advanced.cs trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Advanced.resx trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Config.cs trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Program.cs Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs 2007-10-07 12:28:20 UTC (rev 980) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs 2007-10-07 17:28:41 UTC (rev 981) @@ -356,7 +356,6 @@ #endregion Debug - } } Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverReplacement.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverReplacement.cs 2007-10-07 12:28:20 UTC (rev 980) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverReplacement.cs 2007-10-07 17:28:41 UTC (rev 981) @@ -223,6 +223,7 @@ _notifyWindow.UnregisterDeviceRemoval(); _notifyWindow.Dispose(); + _notifyWindow = null; CloseDevice(); Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverVista.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverVista.cs 2007-10-07 12:28:20 UTC (rev 980) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverVista.cs 2007-10-07 17:28:41 UTC (rev 981) @@ -539,6 +539,7 @@ _notifyWindow.UnregisterDeviceRemoval(); _notifyWindow.Dispose(); + _notifyWindow = null; CloseDevice(); Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverXP.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverXP.cs 2007-10-07 12:28:20 UTC (rev 980) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverXP.cs 2007-10-07 17:28:41 UTC (rev 981) @@ -217,6 +217,7 @@ _notifyWindow.UnregisterDeviceRemoval(); _notifyWindow.Dispose(); + _notifyWindow = null; CloseDevice(); Modified: trunk/plugins/IR Server Suite/Input Service/Input Service/InputService.cs =================================================================== --- trunk/plugins/IR Server Suite/Input Service/Input Service/InputService.cs 2007-10-07 12:28:20 UTC (rev 980) +++ trunk/plugins/IR Server Suite/Input Service/Input Service/InputService.cs 2007-10-07 17:28:41 UTC (rev 981) @@ -26,20 +26,20 @@ #region Enumerations /// <summary> - /// Describes the operation mode of the IR Server. + /// Describes the operation mode of the Input Service. /// </summary> - public enum IRServerMode + public enum InputServiceMode { /// <summary> - /// Acts as a standard IR Server (Default). + /// Acts as a standard Server (Default). /// </summary> ServerMode = 0, /// <summary> - /// Relays button presses to another IR Server. + /// Relays button presses to another Input Service. /// </summary> RelayMode = 1, /// <summary> - /// Acts as a repeater for another IR Server's IR blasting. + /// Acts as a repeater for another Input Service's blasting. /// </summary> RepeaterMode = 2, } @@ -63,7 +63,7 @@ Server _server; Client _client; - IRServerMode _mode; + InputServiceMode _mode; string _hostComputer; bool _registered; // Used for relay and repeater modes. @@ -96,22 +96,24 @@ #region IDisposable - protected override void Dispose(bool disposing) + protected override void Dispose(bool disposeManagedResources) { try { - if (disposing) + if (disposeManagedResources) { - if (_server != null) - _server.Dispose(); + // Dispose managed resources ... - if (_client != null) - _client.Dispose(); + StopServer(); + StopClient(); } + + // Free native resources ... + } finally { - base.Dispose(disposing); + base.Dispose(disposeManagedResources); } } @@ -127,7 +129,7 @@ try { - IrssLog.Info("Starting IR Server ..."); + IrssLog.Info("Starting Input Service ..."); LoadSettings(); @@ -184,19 +186,19 @@ // Mode select ... switch (_mode) { - case IRServerMode.ServerMode: + case InputServiceMode.ServerMode: StartServer(); IrssLog.Info("Started in Server Mode"); break; - case IRServerMode.RelayMode: + case InputServiceMode.RelayMode: if (StartRelay()) IrssLog.Info("Started in Relay Mode"); else IrssLog.Error("Failed to start in Relay Mode"); break; - case IRServerMode.RepeaterMode: + case InputServiceMode.RepeaterMode: if (StartRepeater()) IrssLog.Info("Started in Repeater Mode"); else @@ -268,7 +270,7 @@ } - IrssLog.Info("IR Server started"); + IrssLog.Info("Input Service started"); } catch (Exception ex) { @@ -278,9 +280,9 @@ protected override void OnStop() { - IrssLog.Info("Stopping IR Server ..."); + IrssLog.Info("Stopping Input Service ..."); - if (_mode == IRServerMode.ServerMode) + if (_mode == InputServiceMode.ServerMode) { IrssMessage message = new IrssMessage(MessageType.ServerShutdown, MessageFlags.Notify); SendToAll(message); @@ -340,20 +342,20 @@ IrssLog.Error(ex.ToString()); } - // Stop Server + // Stop Service try { switch (_mode) { - case IRServerMode.ServerMode: + case InputServiceMode.ServerMode: StopServer(); break; - case IRServerMode.RelayMode: + case InputServiceMode.RelayMode: StopRelay(); break; - case IRServerMode.RepeaterMode: + case InputServiceMode.RepeaterMode: StopRepeater(); break; } @@ -375,6 +377,8 @@ { switch (powerStatus) { + + #region Suspend case PowerBroadcastStatus.Suspend: IrssLog.Info("Entering standby ..."); @@ -384,24 +388,42 @@ { foreach (IRServerPluginBase plugin in _pluginReceive) { - if (plugin == _pluginTransmit) - suspendedTransmit = true; - - plugin.Suspend(); + try + { + plugin.Suspend(); + + if (plugin == _pluginTransmit) + suspendedTransmit = true; + } + catch (Exception ex) + { + IrssLog.Error(ex.ToString()); + } } } if (_pluginTransmit != null && !suspendedTransmit) - _pluginTransmit.Suspend(); + { + try + { + _pluginTransmit.Suspend(); + } + catch (Exception ex) + { + IrssLog.Error(ex.ToString()); + } + } // Inform clients ... - if (_mode == IRServerMode.ServerMode) + if (_mode == InputServiceMode.ServerMode) { - IrssMessage message = new IrssMessage(MessageType.ServerShutdown, MessageFlags.Notify); + IrssMessage message = new IrssMessage(MessageType.ServerSuspend, MessageFlags.Notify); SendToAll(message); } break; + #endregion Suspend + #region Resume case PowerBroadcastStatus.ResumeAutomatic: case PowerBroadcastStatus.ResumeCritical: case PowerBroadcastStatus.ResumeSuspend: @@ -413,18 +435,41 @@ { foreach (IRServerPluginBase plugin in _pluginReceive) { - if (plugin == _pluginTransmit) - resumedTransmit = true; + try + { + plugin.Resume(); - plugin.Resume(); + if (plugin == _pluginTransmit) + resumedTransmit = true; + } + catch (Exception ex) + { + IrssLog.Error(ex.ToString()); + } } } if (_pluginTransmit != null && !resumedTransmit) - _pluginTransmit.Resume(); + { + try + { + _pluginTransmit.Resume(); + } + catch (Exception ex) + { + IrssLog.Error(ex.ToString()); + } + } - // TODO: Inform clients ? + // Inform clients ... + if (_mode == InputServiceMode.ServerMode) + { + IrssMessage message = new IrssMessage(MessageType.ServerResume, MessageFlags.Notify); + SendToAll(message); + } break; + #endregion Resume + } return true; @@ -519,12 +564,14 @@ IrssLog.Error("Communications failure"); StopClient(); + + IrssLog.Error("Please report this error"); } void Connected(object obj) { IrssLog.Info("Connected to another server"); - if (_mode == IRServerMode.RepeaterMode) + if (_mode == InputServiceMode.RepeaterMode) { IrssMessage message = new IrssMessage(MessageType.RegisterRepeater, MessageFlags.Request); _client.Send(message); @@ -658,23 +705,23 @@ switch (_mode) { - case IRServerMode.ServerMode: + case InputServiceMode.ServerMode: { IrssMessage message = new IrssMessage(MessageType.RemoteEvent, MessageFlags.Notify, bytes); SendToAll(message); break; } - case IRServerMode.RelayMode: + case InputServiceMode.RelayMode: { IrssMessage message = new IrssMessage(MessageType.ForwardRemoteEvent, MessageFlags.Request, bytes); _client.Send(message); break; } - case IRServerMode.RepeaterMode: + case InputServiceMode.RepeaterMode: { - IrssLog.Debug("Remote event ignored, IR Server is in Repeater Mode."); + IrssLog.Debug("Remote event ignored, Input Service is in Repeater Mode."); break; } } @@ -690,23 +737,23 @@ switch (_mode) { - case IRServerMode.ServerMode: + case InputServiceMode.ServerMode: { IrssMessage message = new IrssMessage(MessageType.KeyboardEvent, MessageFlags.Notify, bytes); SendToAll(message); break; } - case IRServerMode.RelayMode: + case InputServiceMode.RelayMode: { IrssMessage message = new IrssMessage(MessageType.ForwardKeyboardEvent, MessageFlags.Request, bytes); _client.Send(message); break; } - case IRServerMode.RepeaterMode: + case InputServiceMode.RepeaterMode: { - IrssLog.Debug("Keyboard event ignored, IR Server is in Repeater Mode."); + IrssLog.Debug("Keyboard event ignored, Input Service is in Repeater Mode."); break; } } @@ -723,23 +770,23 @@ switch (_mode) { - case IRServerMode.ServerMode: + case InputServiceMode.ServerMode: { IrssMessage message = new IrssMessage(MessageType.MouseEvent, MessageFlags.Notify, bytes); SendToAll(message); break; } - case IRServerMode.RelayMode: + case InputServiceMode.RelayMode: { IrssMessage message = new IrssMessage(MessageType.ForwardMouseEvent, MessageFlags.Request, bytes); _client.Send(message); break; } - case IRServerMode.RepeaterMode: + case InputServiceMode.RepeaterMode: { - IrssLog.Debug("Mouse event ignored, IR Server is in Repeater Mode."); + IrssLog.Debug("Mouse event ignored, Input Service is in Repeater Mode."); break; } } @@ -979,7 +1026,7 @@ #region ForwardRemoteEvent case MessageType.ForwardRemoteEvent: - if (_mode == IRServerMode.RelayMode) + if (_mode == InputServiceMode.RelayMode) { IrssMessage forward = new IrssMessage(MessageType.ForwardRemoteEvent, MessageFlags.Request, combo.Message.GetDataAsBytes()); _client.Send(forward); @@ -994,7 +1041,7 @@ #region ForwardKeyboardEvent case MessageType.ForwardKeyboardEvent: - if (_mode == IRServerMode.RelayMode) + if (_mode == InputServiceMode.RelayMode) { IrssMessage forward = new IrssMessage(MessageType.ForwardKeyboardEvent, MessageFlags.Request, combo.Message.GetDataAsBytes()); _client.Send(forward); @@ -1009,7 +1056,7 @@ #region ForwardMouseEvent case MessageType.ForwardMouseEvent: - if (_mode == IRServerMode.RelayMode) + if (_mode == InputServiceMode.RelayMode) { IrssMessage forward = new IrssMessage(MessageType.ForwardMouseEvent, MessageFlags.Request, combo.Message.GetDataAsBytes()); _client.Send(forward); @@ -1027,7 +1074,7 @@ { IrssMessage response = new IrssMessage(MessageType.BlastIR, MessageFlags.Response); - if (_mode == IRServerMode.RelayMode) + if (_mode == InputServiceMode.RelayMode) { response.Flags |= MessageFlags.Failure; } @@ -1054,7 +1101,7 @@ { IrssMessage response = new IrssMessage(MessageType.LearnIR, MessageFlags.Response); - if (_mode == IRServerMode.RelayMode) + if (_mode == InputServiceMode.RelayMode) { response.Flags |= MessageFlags.Failure; } @@ -1372,7 +1419,7 @@ void LoadSettings() { - _mode = IRServerMode.ServerMode; + _mode = InputServiceMode.ServerMode; _hostComputer = String.Empty; _pluginNameReceive = null; _pluginNameTransmit = String.Empty; @@ -1408,7 +1455,7 @@ return; } - try { _mode = (IRServerMode)Enum.Parse(typeof(IRServerMode), doc.DocumentElement.Attributes["Mode"].Value, true); } + try { _mode = (InputServiceMode)Enum.Parse(typeof(InputServiceMode), doc.DocumentElement.Attributes["Mode"].Value, true); } catch (Exception ex) { IrssLog.Warn(ex.ToString()); } try { _hostComputer = doc.DocumentElement.Attributes["HostComputer"].Value; } @@ -1440,7 +1487,7 @@ writer.WriteStartDocument(true); writer.WriteStartElement("settings"); // <settings> - writer.WriteAttributeString("Mode", Enum.GetName(typeof(IRServerMode), _mode)); + writer.WriteAttributeString("Mode", Enum.GetName(typeof(InputServiceMode), _mode)); writer.WriteAttributeString("HostComputer", _hostComputer); writer.WriteAttributeString("PluginTransmit", _pluginNameTransmit); Modified: trunk/plugins/IR Server Suite/Input Service/Input Service/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Input Service/Input Service/Program.cs 2007-10-07 12:28:20 UTC (rev 980) +++ trunk/plugins/IR Server Suite/Input Service/Input Service/Program.cs 2007-10-07 17:28:41 UTC (rev 981) @@ -54,7 +54,7 @@ } /// <summary> - /// Retreives a list of available IR Server plugins. + /// Retreives a list of available Input Service plugins. /// </summary> /// <returns>Array of plugin instances.</returns> internal static IRServerPluginBase[] AvailablePlugins() @@ -89,11 +89,11 @@ } catch (BadImageFormatException) { - // Ignore Bad Image Format Exceptions, just keep checking for IR Server Plugins + // Ignore Bad Image Format Exceptions, just keep checking for Input Service Plugins } catch (TypeLoadException) { - // Ignore Type Load Exceptions, just keep checking for IR Server Plugins + // Ignore Type Load Exceptions, just keep checking for Input Service Plugins } } Modified: trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Advanced.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Advanced.Designer.cs 2007-10-07 12:28:20 UTC (rev 980) +++ trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Advanced.Designer.cs 2007-10-07 17:28:41 UTC (rev 981) @@ -56,7 +56,7 @@ this.groupBoxMode.Size = new System.Drawing.Size(384, 120); this.groupBoxMode.TabIndex = 0; this.groupBoxMode.TabStop = false; - this.groupBoxMode.Text = "IR Server Mode"; + this.groupBoxMode.Text = "Input Service Mode"; // // labelComputer // @@ -78,7 +78,7 @@ this.radioButtonRepeater.TabIndex = 2; this.radioButtonRepeater.TabStop = true; this.radioButtonRepeater.Text = "Repeater mode"; - this.toolTips.SetToolTip(this.radioButtonRepeater, "All output commands from a host IR Server are repeated"); + this.toolTips.SetToolTip(this.radioButtonRepeater, "All output commands from a host Input Service are repeated"); this.radioButtonRepeater.UseVisualStyleBackColor = true; this.radioButtonRepeater.CheckedChanged += new System.EventHandler(this.radioButtonRepeater_CheckedChanged); // @@ -91,7 +91,7 @@ this.radioButtonRelay.TabIndex = 1; this.radioButtonRelay.TabStop = true; this.radioButtonRelay.Text = "Input relay mode"; - this.toolTips.SetToolTip(this.radioButtonRelay, "All input is relayed to another IR Server instance"); + this.toolTips.SetToolTip(this.radioButtonRelay, "All input is relayed to another Input Service instance"); this.radioButtonRelay.UseVisualStyleBackColor = true; this.radioButtonRelay.CheckedChanged += new System.EventHandler(this.radioButtonRelay_CheckedChanged); // @@ -104,7 +104,7 @@ this.radioButtonServer.TabIndex = 0; this.radioButtonServer.TabStop = true; this.radioButtonServer.Text = "Server mode (default)"; - this.toolTips.SetToolTip(this.radioButtonServer, "IR Server operates as a device server (default)"); + this.toolTips.SetToolTip(this.radioButtonServer, "Input Service operates as a device server (default)"); this.radioButtonServer.UseVisualStyleBackColor = true; this.radioButtonServer.CheckedChanged += new System.EventHandler(this.radioButtonServer_CheckedChanged); // @@ -158,7 +158,7 @@ this.MinimumSize = new System.Drawing.Size(418, 213); this.Name = "Advanced"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "IR Server - Advanced Configuration"; + this.Text = "Input Service Configuration - Advanced"; this.groupBoxMode.ResumeLayout(false); this.groupBoxMode.PerformLayout(); this.ResumeLayout(false); Modified: trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Advanced.cs =================================================================== --- trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Advanced.cs 2007-10-07 12:28:20 UTC (rev 980) +++ trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Advanced.cs 2007-10-07 17:28:41 UTC (rev 981) @@ -15,30 +15,30 @@ #region Properties - public IRServerMode Mode + public InputServiceMode Mode { get { if (radioButtonRelay.Checked) - return IRServerMode.RelayMode; + return InputServiceMode.RelayMode; else if (radioButtonRepeater.Checked) - return IRServerMode.RepeaterMode; + return InputServiceMode.RepeaterMode; else - return IRServerMode.ServerMode; + return InputServiceMode.ServerMode; } set { switch (value) { - case IRServerMode.ServerMode: + case InputServiceMode.ServerMode: radioButtonServer.Checked = true; break; - case IRServerMode.RelayMode: + case InputServiceMode.RelayMode: radioButtonRelay.Checked = true; break; - case IRServerMode.RepeaterMode: + case InputServiceMode.RepeaterMode: radioButtonRepeater.Checked = true; break; } Modified: trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Advanced.resx =================================================================== --- trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Advanced.resx 2007-10-07 12:28:20 UTC (rev 980) +++ trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Advanced.resx 2007-10-07 17:28:41 UTC (rev 981) @@ -123,49 +123,158 @@ <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> - AAABAAIAICAAAAEACACoCAAAJgAAABAQEAABAAQAKAEAAM4IAAAoAAAAIAAAAEAAAAABAAgAAAAAAIAE - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAgAAAAICAAIAAAACAAIAAgIAAAMDAwADA3MAA8MqmANTw - /wCx4v8AjtT/AGvG/wBIuP8AJar/AACq/wAAktwAAHq5AABilgAASnMAADJQANTj/wCxx/8Ajqv/AGuP - /wBIc/8AJVf/AABV/wAASdwAAD25AAAxlgAAJXMAABlQANTU/wCxsf8Ajo7/AGtr/wBISP8AJSX/AAAA - /gAAANwAAAC5AAAAlgAAAHMAAABQAOPU/wDHsf8Aq47/AI9r/wBzSP8AVyX/AFUA/wBJANwAPQC5ADEA - lgAlAHMAGQBQAPDU/wDisf8A1I7/AMZr/wC4SP8AqiX/AKoA/wCSANwAegC5AGIAlgBKAHMAMgBQAP/U - /wD/sf8A/47/AP9r/wD/SP8A/yX/AP4A/gDcANwAuQC5AJYAlgBzAHMAUABQAP/U8AD/seIA/47UAP9r - xgD/SLgA/yWqAP8AqgDcAJIAuQB6AJYAYgBzAEoAUAAyAP/U4wD/sccA/46rAP9rjwD/SHMA/yVXAP8A - VQDcAEkAuQA9AJYAMQBzACUAUAAZAP/U1AD/sbEA/46OAP9rawD/SEgA/yUlAP4AAADcAAAAuQAAAJYA - AABzAAAAUAAAAP/j1AD/x7EA/6uOAP+PawD/c0gA/1clAP9VAADcSQAAuT0AAJYxAABzJQAAUBkAAP/w - 1AD/4rEA/9SOAP/GawD/uEgA/6olAP+qAADckgAAuXoAAJZiAABzSgAAUDIAAP//1AD//7EA//+OAP// - awD//0gA//8lAP7+AADc3AAAubkAAJaWAABzcwAAUFAAAPD/1ADi/7EA1P+OAMb/awC4/0gAqv8lAKr/ - AACS3AAAerkAAGKWAABKcwAAMlAAAOP/1ADH/7EAq/+OAI//awBz/0gAV/8lAFX/AABJ3AAAPbkAADGW - AAAlcwAAGVAAANT/1ACx/7EAjv+OAGv/awBI/0gAJf8lAAD+AAAA3AAAALkAAACWAAAAcwAAAFAAANT/ - 4wCx/8cAjv+rAGv/jwBI/3MAJf9XAAD/VQAA3EkAALk9AACWMQAAcyUAAFAZANT/8ACx/+IAjv/UAGv/ - xgBI/7gAJf+qAAD/qgAA3JIAALl6AACWYgAAc0oAAFAyANT//wCx//8Ajv//AGv//wBI//8AJf//AAD+ - /gAA3NwAALm5AACWlgAAc3MAAFBQAPLy8gDm5uYA2traAM7OzgDCwsIAtra2AKqqqgCenp4AkpKSAIaG - hgB6enoAbm5uAGJiYgBWVlYASkpKAD4+PgAyMjIAJiYmABoaGgAODg4A8Pv/AKSgoACAgIAAAAD/AAD/ - AAAA//8A/wAAAP8A/wD//wAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAABAAQAICAAAAEACACoCAAARgAAABAQAAABAAgAaAUAAO4IAAAgIAAAAQAgAKgQAABWDgAAEBAAAAEA + IABoBAAA/h4AACgAAAAgAAAAQAAAAAEACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgYGBAIWF + hQCIiIgAjo6OAJGRkQCVlZUAmpqaAJucnACdnZ0AoaKiAKWmpgCnqKgAqKmpAKusrACsra0AsbGxALW1 + tQC4ubkAu7y8ALy9vQDDw8MAxcXFAMnJyQDNzs4A0dLSANPU1ADV1dUA2NnZAN3d3QDg4OAA5OXlAOjp + 6QDu7u4A8fHxAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - /PwAAPz8/PwA/AAA/AAAAPwAAAD8/Pz8APwAAPwAAAAAAPwA/AAAAAD8AAD8AAD8APwAAPwAAAAA/AAA - /AAAAAAA/AD8AAAAAPwAAPwAAPwA/AAA/AAAAAD8AAD8AAAAAAD8APwAAAAA/AAA/AD8AAAA/AD8AAAA - APwAAPwAAAAAAPwA/AAAAAD8AAD8APwAAAD8APwAAAAA/AAA/AAAAPz8AAD8/PwAAPz8/AAA/AAAAPwA - /Pz8AAD8/PwAAAD8AAAAAPwAAAAA/AAA/AD8AAAA/AD8AAAAAPwAAPwAAPwAAAAA/AAAAAD8AAD8APwA - AAD8APwAAAAA/AAA/AAA/AAAAAD8AAAAAPwAAPwA/AAAAPwA/AAAAAD8AAD8AAD8AAAAAPwAAAAA/AAA - /AD8AAAA/AD8AAAAAPwAAPwAAAD8/AAA/Pz8/AD8/PwAAPwAAAD8APz8/PwA/Pz8AAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - APn5+fn5+fn5AAAA+fn5AAAAAAD5+fkAAAAAAAAAAAAAAPn5+fn5+QAAAAAA+fkAAAAAAPn5AAAAAAAA - AAAAAAAAAAD5+QAAAAAAAAD5+QAAAAAA+fkAAAAAAAAAAAAAAAAAAPn5AAAAAAAAAPn5+fn5+fn5AAAA - AAAAAAAAAAAAAAAA+fkAAAAAAAAA+fn5+fn5+fkAAAAAAAAAAAAAAAAAAAD5+QAAAAAAAAD5+QAAAAAA - +fkAAAAAAAAAAAAAAAAAAPn5AAAAAAAAAPn5AAAAAAD5+QAAAAAAAAAAAAAAAAAA+fkAAAAAAAAA+fkA - AAAAAPn5AAAAAAAAAAAAAAAA+fn5+fn5AAAAAAD5+fn5+fn5+fkAAAAAAAAAAAAAAPn5+fn5+fn5AAAA - +fn5+fn5+fn5AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAPj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+AAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////AAAAAP/////MLdwt9e2t7fXtre317XXt9e117cxj - dGO97XXtve117b3tde297XXtzCN0I//////////////////////gHHx/8D58//z+fP/8/gH//P4B//z+ - fP/8/nz//P58//A+AP/gHAH///////////8AAAAf/////ygAAAAQAAAAIAAAAAEABAAAAAAAwAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAwMDAAICAgAAAAP8AAP8AAAD/ - /wD/AAAA/wD/AP//AAD///8AAAAAAAAAAAAKq77t2ZzAAAAAAAAAAAAAAAAAAAAAAAAAzMDAwAwAAAAA - wMDAwMAAAMzAzADAwAAAwADAwMDAAADMwMwAwMAAAAAAAAAAAAAAmZCQCQAAAAAJAJCQAAAAAAkAmQAA - AAAACQCQkAAAAACZkJmQAAAAAAAAAAAAAAD//wAAgAcAAP//AAD//wAAxW8AAPVXAADE1wAA3VcAAMTX - AAD//wAAxb8AAO1/AADs/wAA7X8AAMR/AAD//wAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8AAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAABcQAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASGRgEAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAMDAEABgIbGwUBAAAIAQAAAAAAAAAAAAAAAAAAAAAAAB4WDwQSGBgbGBEC + BxgVAAAAAAAAAAAAAAAAAAAAAAAAHhcVFRUWGBgYHhwYGxgAAAAAAAAAAAAAAAAAAAAAAAAAERMTExUW + GBYcGxgUBgAAAAAAAAAAAAAAAAAAAAAAAAATERETFxseGx4YFRIBAAAAAAAAAAAAAAAAAAAAAAADBA8P + EBUAAAAAHhsTEgIAAAAAAAAAAAAAAAAAAAAADwEBAQMPBQAAAAAbHhMRDwcFAAAACAgIAwEAAAAAAAAO + CAgDAQIBAAAAAAAbGxMQEBUAABAODA4KCAEAAAAAEA4MDAoGAQEAAAAADBMSGxQXHgAAFQ4ODg4KCAAA + AAAVDg4ODgoFAQEBAwQQCwsVBwAAAAAQDg4ODg4MAAAAABAODg4ODgoBCAcJCwkJCwgAAAAAABAODg4O + Dg4AAAAAEA4ODg4ODgQFBgYHBwcJBgEAAAAAEA4ODg4ODgAAAAAQDg4ODg4OBAUFBQUKDgkHBwAAAAAQ + Dg4ODg4OAAAAABAODg4ODg4FDwUFCgwAEBASAAAAABAODg4ODg4AAAAAEA4ODg4ODgASBwUCAAADAQAA + AAAAEA4ODg4ODgAAAAAQDg4ODg4OAAAVCgUKCggGAQAAAAAQDg4ODg4OAAAAABAODg4ODg4AABcUDg4O + DgwIAwAAABAODg4ODg4AAAAAEA4ODg4ODgAAABAODg4ODg4IAwAAEA4ODg4ODgAAAAAQDg4ODg4OAAAX + Dg4QICISDgwKAAAQDg4ODg4OAAAAABAODg4ODg4AABsODhv//x4ODg4AABAODg4ODg4AAAAAEA4ODg4O + DgAAHA4OFf//Gw4OEAAAEg4ODg4OEgAAAAASDg4ODg4SAAAgEA4OEhUODg4SAAAcEA4ODhASAAAAABwO + Dg4OEBIAAAAbEA4ODg4OFQAAAAAcFBIVHAAAAAAAABwSEBUbAAAAAAAcEhAOEBcAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAHh4gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP// + ///////////4////8P///iBn//4AB//+AAf//wAH//8AB//8Dwf/+A8BwfgPgYDwDwGA8AAHgPAAD4Dw + AAeA8AAHgPAAR4DwEM+A8BgHgPAYA4DwHAGA8BgBgPAYAYDwGAGA8BgBgPAcA8H4Pgf///+P//////// + ////////KAAAABAAAAAgAAAAAQAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACDhIQAhoaGAIuL + iwCWl5cAmZqaAJ2dnQChoqIAo6SkAKWmpgCnqKgAqampAKusrACtrq4AsbKyALa3twC3uLgAuLm5ALu8 + vADCw8MAxcXFAMnKygDLzMwAz8/PANbX1wDZ2dkA4eHhAOXl5QDv7+8AAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///wAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAABIHAAAAAAAAAAAAAAAABwQSEgMHBAAAAAAAAAAAABMTFBUZFQAAAAAAAAAA + AAAOExUAGBMDAAAAAwAAAA4DAQMAABQUCwUACwoDAAAOCwcBAAALEw4AFAsLCwAACwsLBAQGBgUAABQL + CwsAAAsLCwUEBAcJCwAUCwsLAAALCwsEDgMDAwAAFAsLCwAACwsLBAAOCwsFABQLCwsAAAsLCwQACxkb + CwQYCwsLAAAOCwsHAAsVGAsLABIOFAAAGQ4SAAAZDQsUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA//8AAP/PAAD/AQAA/wMAAP8RAADcMAAAjDEAAAwDAAAMAQAADAMAAAwhAAAMIAAADCAAAIxh + AAD//wAA//8AACgAAAAgAAAAQAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAJAAAAEwAAAA4AAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAABsbGwIODg4FBgYGCxoZGVAWFRVyBQQEUgAAABUCAgIGBgYGAwMDAwEAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAQEBAknJycNS0tLElZWVh9oZ2c/zsfI/rivsf9aWFixOTk5PkBAQB4nJycSEBAQCQIC + AgcAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAADAwMUExISUisrK1FnZ2c7dXV1SH98fIjezNH/3cfP/4F5edZPT09taWlpRWdn + Zy4rKys3AwMDQgAAABYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAMzExA2NgYI2ppKT3SEZFri4uLnRYVFSef3Fw3OTP1v/gyNH/mYuM80hE + Q640NDR3Pj09bomFhdFQTk63AAAARwAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACuqagl6eHi/djBxv+8qq3/lIWF88e0uP/cxs3/4MfP/+HI + 0P/dxs7/wbG1/4N3eOmhk5Xy2sfO/8e9wP4+PDt5AwMDBgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADUzc2U3snM/9i9wf/Zv8P/2r/E/9vB + xv/cwsj/3cPJ/+DJz//q2+D/5NPY/9/Hz//jy9P/0cfJ7iopKScAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEtHRxrFtLP51bq7/9W6 + vP/Wu73/173A/9vDxv/dxMj/28HF/+bU2P/jzdL/3cPJ/8+8v/9APDuMBwcHDwAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkCAgIUW1dWetS/ + vv/QtLP/0bW1/9e9vv/azMz80snIwt3U1L/h1tb67N7g/+HMzv/ZvsL/yra5/0I+PacAAAAsAAAADAAA + AAUAAAAAAAAAAAAAAAAAAAAFAAAADAAAAAoAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAfHR0GDQ0NRyUj + I4OIe3nex62q/8qtqv/Nsa//z8G/+EVCQk4AAAAAAAAAANnS0TPh2Njx5NPU/9S5uv/Qt7n/em9v3woK + Cm4AAABWAAAAOAAAAAABAQECAAAAGQQEBEMLCwtdAAAAUgAAADYAAAAPAAAAAAAAAAAAAAAAAAAAAIN/ + fkK0raz+hnh1/4h5dv+KdXL/oYmF/8Stqv9ya2q5BwcHFAAAAAAAAAAAAAAAAL61tIvs4eH/176+/9C0 + tP/Aq6v/ppeX/piSkfEtLCx7AAAAAAsLCx5jY2Okl5iY7piZmfp8fX3jMTIymQAAAEcAAAAMAAAAAAAA + AAAAAAAAS0lJVa2rqv+enJz/mJiY/4yJiP96bmr/lYWB/0xHRrEAAAApAAAAAgAAAAAZGBcCbGZlfOPT + 0f/k1NP/1Lu5/86ysP/Ps7L/08TD/0dFRHgjIyMGkJGRsqytrf+nqKj/qKmp/6Ojo/+YmJj+OTk5mgAA + ACoAAAABAAAAACkpKQeWlpa6q6ys/6eoqP+nqKj/oaKi/5eXl/9/dHL/amRi5AMCAl4AAAAtAAAAGgIC + AiyflZPR1L25/9G4tP/i0tD/z7u5/9jLyfXg2djKgX19L3R1dTvCwsL+qqqq/6mqqv+pqqr/qaqq/6Wm + pv+QkZHsAQEBPwAAAAMAAAAAg4ODRMDBwf6pqqr/qaqq/6mqqv+pqqr/pKSk/5iVlP+Qgn7/Z2Bf1iUj + I5EoJiaKeXFwzcm1r//DpJ3/xKWe/9bCvv91bGqrSkdGDAAAAAAAAAAAsrOzebO0tP+pqqr/qaqq/6mq + qv+pqqr/qaqq/6eoqP4UFBRQAAAABAAAAADKysp3s7Oz/6mqqv+pqqr/qaqq/6mqqv+oqan/p6en/5B5 + cP+1nJL/rZuU/7KfmP/Ap57/vZ6U/7+flf/AoZj/r5uW+x4cHGMDAwIMAAAAAAAAAACztLR9sbKy/6mq + qv+pqqr/qaqq/6mqqv+pqqr/qamp/xYWFlEAAAAEAAAAANXW1nyxsrL/qaqq/6mqqv+pqqr/qaqq/6mq + qv+pqan/no2G/7OThP+3loj/uJeJ/7mYi/+6mY3/u5qO/7yckf+plY7+LSsqlQAAADAAAAACAAAAALOz + s32xsbH/qaqq/6mqqv+pqqr/qaqq/6mqqv+pqan/FhYWUQAAAAQAAAAA1dbWfLGxsf+pqqr/qaqq/6mq + qv+pqqr/qaqq/6ipqf+aiID/sZCA/7ORgf+zkoL/tpWG/8Cjl//ErKL/vZ+T/7aZjf+jmpfyFRQUQgEB + AQIAAAAAs7OzfbGxsf+pqqr/qaqq/6mqqv+pqqr/qaqq/6mpqf8WFhZRAAAABAAAAADV1tZ8sbGx/6mq + qv+pqqr/qaqq/6mqqv+pqqr/qKio/nx3dsK8qqL0s5KB/7KRgP+1oJf4joSBtFZRT3S0qaXowrKq/6+p + p9ApKCcUAAAAAAAAAACzs7N9sbGx/6mqqv+pqqr/qaqq/6mqqv+pqqr/qamp/xYWFlEAAAAEAAAAANXW + 1nyxsbH/qaqq/6mqqv+pqqr/qaqq/6mqqv+oqKj9Dw8PRoyEgZG4mon/r5GA/2BXVb0KCgpZKCgofzU1 + NZRcW1rADAsLWgEBASUAAAAFAAAAALOzs32xsbH/qaqq/6mqqv+pqqr/qaqq/6mqqv+pqan/FhYWUQAA + AAQAAAAA1dbWfLGxsf+pqqr/qaqq/6mqqv+pqqr/qaqq/6ioqP0PDw9GgX18Y9PCt/+zopj/jo2N6KGh + ofifoKD/m5yc/5WVlfxmZmbPDw8PcAAAAC0AAAADs7OzfbGxsf+pqqr/qaqq/6mqqv+pqqr/qaqq/6mp + qf8WFhZRAAAABAAAAADV1tZ8sbGx/6mqqv+pqqr/qaqq/6mqqv+pqqr/qKio/Q8PD0ZSUE8bnJiXiL69 + vfWqq6v/qKmp/6mqqv+pqqr/p6io/56env+DhITrDg4OaQAAABezs7N9sbGx/6mqqv+pqqr/qaqq/6mq + qv+pqqr/qamp/xYWFlEAAAAEAAAAANXW1nyxsbH/qaqq/6mqqv+pqqr/qaqq/6mqqv+oqKj9Dw8PRiEg + IAN1dnZutre3/6mqqv+pqqr/qKmp/6ipqf+pqqr/qamp/5+fn/9kZWXEAAAAM7Ozs32xsbH/qaqq/6mq + qv+pqqr/qaqq/6mqqv+pqan/FhYWUQAAAAQAAAAA1dbWfLGxsf+pqqr/qaqq/6mqqv+pqqr/qaqq/6io + qP0PDw9GMzQ0BLm6usesra3/qaqq/7Gysv/q6ur/8PDw/7y9vf+pqqr/p6io/56envgHBwdHtLS0fLGx + sf+pqqr/qaqq/6mqqv+pqqr/qaqq/6mpqf8WFhZRAAAABAAAAADW1tZ8sbKy/6mqqv+pqqr/qaqq/6mq + qv+pqqr/qKmp/Q8PD0VHR0cE0NHR6KusrP+pqqr/09PT////////////5ufn/6mqqv+pqqr/qaqq/xwd + HVTMzc18srOz/6mqqv+pqqr/qaqq/6mqqv+pqqr/q6ur/xcXF0sAAAACAAAAANrb23uysrL/qaqq/6mq + qv+pqqr/qaqq/6mqqv+rrKz9Dw8PP1VVVQLV1tbcrK2t/6mqqv/DxMT//v7+///////W19f/qaqq/6mq + qv+ys7P+GBgYO+Pk5F69vr7/qaqq/6mqqv+pqqr/qaqq/6qqqv+3uLj6ERERKQAAAAAAAAAA4uLiY7u7 + u/+pqqr/qaqq/6mqqv+pqqr/qqqq/7W1tfQLCwshAAAAAODh4Zi0tbX/qaqq/6ipqf+8vb3/wsPD/6mq + qv+pqqr/q6ys/6ysrNkREREQ5OTkDNrb2+ewsbH/qaqq/6mqqv+qq6v/s7Oz/5qbm68lJSUHAAAAAAAA + AADk5OQW19fX8a+vr/+pqqr/qaqq/6qrq/+0tLT/k5SUpSQlJQYAAAAA5OTkIdXV1fGvsLD/qaqq/6mq + qv+pqqr/qaqq/6usrP/BwsL+ZmZmWioqKgEAAAAA5ebmPNvb2+q/wMD/t7i4/8PDw//Q0NDHfn5+FwAA + AAAAAAAAAAAAAAAAAADm5uZM2NjY8ry9vf+2trb/wsPD/8vMzMR5enoUAAAAAAAAAAAAAAAA5OXlQtjZ + 2ey6urr/sLCw/6+vr/+ztLT/ysvL+rCxsXJra2sBAAAAAAAAAAAAAAAA5+fnEOfo6F7n5+d14eLiStLS + 0gMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADm5+cZ5+joaubm5n7h4eFMzs7OAwAAAAAAAAAAAAAAAAAA + AAAAAAAA5eXlFebm5nnd3t6z29zct9/g4IzY2dkpAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA///4f///wA///wAD//4AA//8AAH//AAB//4AA//+AAP/+AAA4fAGAIDwBwCAcAIAACAAAAAg + AAMAIAADACAAAQAgAAEAIAADACAAAQAgAAAAIAAAACAAAAAgAAAAIAAAACAAAABgCAAAYAgAgPAcAcH4 + Pgf///////////////8oAAAAEAAAACAAAAABACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgoKAQgICBkGBgY5AAAABwICAgEAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQEFGhoaLl9fXy2lnp+xnJKU4UxMTEMyMjIgAQEBGAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAi4eHbaKVl+h4b3DByLS59s64v/xwaGnDkYeJzFVR + Up0AAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAImFhSvUvb/9173A/9vBxf/dxMn/5tTY/9vE + yv9RTU1sAAAAAAAAAAAAAAABAAAABQAAAAAAAAAAAAAAAAsKChVDPj18zbOx/9G5uP2dlZWD29LSe+TV + 1vvSubv/MS4tiAAAACgFBQUIPz8/fEhISKMMDAxJAAAAAwAAAACMiIelkYmI/4x9ev+GeXbaAwICEAAA + AAC+tLPB2MDA/8Gqqf54cnG4ent7fKmqqv+nqKj/gYKC4QAAABs1NTUSq6ur7aipqf+hoqL/hHx5+CMh + IX0pJiZnwKum89O8uP+ajoyrsKqpPrKzs72pqqr/qaqq/6ipqf4KCgoqlJWVPK2urv+pqqr/qamp/5+W + kv+zmIz/uZ2T/7yckf+1m5P+ExISTQAAAACysrK+qaqq/6mqqv+pqan/CwsLKp6enj6trq7/qaqq/6mq + qv+alJLvtZeJ/LSWiP2aiYLJuqWc+WRgXoYAAAAAsrKyvqmqqv+pqqr/qamp/wsLCyqenp4+ra6u/6mq + qv+pqqr/W1xcoqaXj7yUhn7oXV1dtHBwcNQgICBvAAAADbKysr6pqqr/qaqq/6mpqf8LCwsqnp6ePq2u + rv+pqqr/qaqq/1tcXKJhX19FsrKy/Kipqf+oqan/mpub+hwcHF6ys7O9qaqq/6mqqv+pqan/CwsLKp6f + nz6trq7/qaqq/6mqqv9bXFyigYGBbqqrq//b29v/5OTk/6ipqf9bW1ukyMjItqmqqv+pqqr/ra6u/QoK + Ch6kpaU3sLCw/6mqqv+pqqr/Xl9flJiZmV2sra3/ysrK/9DR0f+pqqr/YmJiiN3e3ky9vr75s7S0/6en + p6MUFRUBi4uLBdHR0cyxsrL/u7u78FdXVzCNjo4I0NHRx6+wsP+trq7/urq62kNDQxcAAAAAs7OzG7q6 + ujAAAAAAAAAAAAAAAACYmJgGvL29OqanpxQAAAAAAAAAAJiYmAXIyclLxMXFUJmamgoAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP+D + nEH+AZxB/gCcQf4BnEGcAJxBBBCcQQAAnEEAAZxBAAGcQQAAnEEAAJxBAACcQQAAnEEAAJxBnGGcQf// + nEE= </value> </data> </root> \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Config.cs =================================================================== --- trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Config.cs 2007-10-07 12:28:20 UTC (rev 980) +++ trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Config.cs 2007-10-07 17:28:41 UTC (rev 981) @@ -22,14 +22,14 @@ IRServerPluginBase[] _transceivers; - IRServerMode _mode = IRServerMode.ServerMode; + InputServiceMode _mode = InputServiceMode.ServerMode; string _hostComputer = String.Empty; #endregion Variables #region Properties - public IRServerMode Mode + public InputServiceMode Mode { get { return _mode; } set { _mode = value; } @@ -120,7 +120,7 @@ _transceivers = Program.AvailablePlugins(); if (_transceivers == null || _transceivers.Length == 0) { - MessageBox.Show(this, "No IR Server Plugins found!", "IR Server Configuration", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show(this, "No Input Service Plugins found!", "Input Service Configuration", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { @@ -299,7 +299,7 @@ { try { - Help.ShowHelp(this, SystemRegistry.GetInstallFolder() + "\\IR Server Suite.chm", HelpNavigator.Topic, "IR Server\\index.html"); + Help.ShowHelp(this, SystemRegistry.GetInstallFolder() + "\\Input Service.chm", HelpNavigator.Topic, "Input Service\\index.html"); } catch (Exception ex) { Modified: trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Program.cs 2007-10-07 12:28:20 UTC (rev 980) +++ trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Program.cs 2007-10-07 17:28:41 UTC (rev 981) @@ -16,20 +16,20 @@ #region Enumerations /// <summary> - /// Describes the operation mode of the IR Server. + /// Describes the operation mode of the Input Service. /// </summary> - public enum IRServerMode + public enum InputServiceMode { /// <summary> - /// Acts as a standard IR Server (Default). + /// Acts as a standard Server (Default). /// </summary> ServerMode = 0, /// <summary> - /// Relays button presses to another IR Server. + /// Relays button presses to another Input Service. /// </summary> RelayMode = 1, /// <summary> - /// Acts as a repeater for another IR Server's IR blasting. + /// Acts as a repeater for another Input Service's blasting. /// </summary> RepeaterMode = 2, } @@ -47,7 +47,7 @@ #region Variables - static IRServerMode _mode; + static InputServiceMode _mode; static string _hostComputer; static string[] _pluginNameReceive; static string _pluginNameTransmit; @@ -108,7 +108,7 @@ { IrssLog.Info("Loading settings ..."); - _mode = IRServerMode.ServerMode; + _mode = InputServiceMode.ServerMode; _hostComputer = String.Empty; _pluginNameReceive = null; _pluginNameTransmit = String.Empty; @@ -144,7 +144,7 @@ return; } - try { _mode = (IRServerMode)Enum.Parse(typeof(IRServerMode), doc.DocumentElement.Attributes["Mode"].Value, true); } + try { _mode = (InputServiceMode)Enum.Parse(typeof(InputServiceMode), doc.DocumentElement.Attributes["Mode"].Value, true); } catch (Exception ex) { IrssLog.Warn(ex.ToString()); } try { _hostComputer = doc.DocumentElement.Attributes["HostComputer"].Value; } @@ -178,7 +178,7 @@ writer.WriteStartDocument(true); writer.WriteStartElement("settings"); // <settings> - writer.WriteAttributeString("Mode", Enum.GetName(typeof(IRServerMode), _mode)); + writer.WriteAttributeString("Mode", Enum.GetName(typeof(InputServiceMode), _mode)); writer.WriteAttributeString("HostComputer", _hostComputer); writer.WriteAttributeString("PluginTransmit", _pluginNameTransmit); @@ -239,7 +239,7 @@ } /// <summary> - /// Retreives a list of available IR Server plugins. + /// Retreives a list of available Input Service plugins. /// </summary> /// <returns>Array of plugin instances.</returns> internal static IRServerPluginBase[] AvailablePlugins() @@ -274,11 +274,11 @@ } catch (BadImageFormatException) { - // Ignore Bad Image Format Exceptions, just keep checking for IR Server Plugins + // Ignore Bad Image Format Exceptions, just keep checking for Input Service Plugins } catch (TypeLoadException) { - // Ignore Type Load Exceptions, just keep checking for IR Server Plugins + // Ignore Type Load Exceptions, just keep checking for Input Service Plugins } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-10-27 13:36:06
|
Revision: 1007 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1007&view=rev Author: and-81 Date: 2007-10-27 06:36:02 -0700 (Sat, 27 Oct 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Debug Client/Debug Client.csproj trunk/plugins/IR Server Suite/Applications/Debug Client/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/IR Blast/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.exe.manifest trunk/plugins/IR Server Suite/Applications/IR Server/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.cs trunk/plugins/IR Server Suite/Applications/SageSetup/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/SageSetup/Sage Setup.csproj 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/Translator/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Translator/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/Applications/Translator/Translator.csproj trunk/plugins/IR Server Suite/Applications/Tray Launcher/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray Launcher.csproj trunk/plugins/IR Server Suite/Applications/Virtual Remote/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/Virtual Remote.csproj trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/Virtual Remote Skin Editor.csproj trunk/plugins/IR Server Suite/Common/IrssComms/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Keyboard.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Common/MPUtils/MPUtils.csproj trunk/plugins/IR Server Suite/Common/MPUtils/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.resx trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverReplacement.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverVista.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverXP.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrCode.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrDecoder.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Pronto.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/RemoteDetectionData.cs trunk/plugins/IR Server Suite/IR Server Plugins/Serial IR Blaster/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/Serial IR Blaster/Serial IR Blaster.cs trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/UirtTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Windows Message Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/X10Transceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/XBCDRC Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/XBCDRC Receiver/XBCDRC Receiver.cs trunk/plugins/IR Server Suite/Input Service/Input Service/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Configuration.csproj trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Input Service Configuration.exe.manifest trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/SetupForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MP Blast Zone Plugin.csproj trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MPBlastZonePlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MP Control Plugin.csproj trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/SetupForm.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/SetupForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2 Blaster Plugin.csproj trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/PluginSetup.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/PluginSetup.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3 Blaster Plugin.csproj trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs Added Paths: ----------- trunk/plugins/IR Server Suite/Applications/SageSetup/SageSetup.exe.manifest trunk/plugins/IR Server Suite/Applications/Translator/CopyDataWM.cs Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/Debug Client.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/Debug Client.csproj 2007-10-26 14:59:29 UTC (rev 1006) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/Debug Client.csproj 2007-10-27 13:36:02 UTC (rev 1007) @@ -49,6 +49,7 @@ </DebugType> <PlatformTarget>x86</PlatformTarget> <ErrorReport>prompt</ErrorReport> + <UseVSHostingProcess>false</UseVSHostingProcess> </PropertyGroup> <ItemGroup> <Reference Include="System" /> Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/Properties/AssemblyInfo.cs 2007-10-26 14:59:29 UTC (rev 1006) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/Properties/AssemblyInfo.cs 2007-10-27 13:36:02 UTC (rev 1007) @@ -33,8 +33,8 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.3.4")] -[assembly: AssemblyFileVersion("1.0.3.4")] +[assembly: AssemblyVersion("1.0.3.5")] +[assembly: AssemblyFileVersion("1.0.3.5")] [assembly: CLSCompliant(true)] [assembly: GuidAttribute("8eeb5fcb-322c-45ee-80a9-3d30cc08a48c")] Modified: trunk/plugins/IR Server Suite/Applications/IR Blast/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast/Properties/AssemblyInfo.cs 2007-10-26 14:59:29 UTC (rev 1006) +++ trunk/plugins/IR Server Suite/Applications/IR Blast/Properties/AssemblyInfo.cs 2007-10-27 13:36:02 UTC (rev 1007) @@ -33,8 +33,8 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.3.4")] -[assembly: AssemblyFileVersion("1.0.3.4")] +[assembly: AssemblyVersion("1.0.3.5")] +[assembly: AssemblyFileVersion("1.0.3.5")] [assembly: CLSCompliant(true)] [assembly: GuidAttribute("5eeca936-da49-4952-ab3b-9f11ec57e4aa")] Modified: trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Properties/AssemblyInfo.cs 2007-10-26 14:59:29 UTC (rev 1006) +++ trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Properties/AssemblyInfo.cs 2007-10-27 13:36:02 UTC (rev 1007) @@ -33,8 +33,8 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.3.4")] -[assembly: AssemblyFileVersion("1.0.3.4")] +[assembly: AssemblyVersion("1.0.3.5")] +[assembly: AssemblyFileVersion("1.0.3.5")] [assembly: CLSCompliant(true)] [assembly: GuidAttribute("81eb136b-cc74-4eed-976d-f96ebccd1ce4")] Modified: trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.exe.manifest =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.exe.manifest 2007-10-26 14:59:29 UTC (rev 1006) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.exe.manifest 2007-10-27 13:36:02 UTC (rev 1007) @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" ?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" > - <assemblyIdentity version="1.0.3.4" processorArchitecture="X86" name="IRServer" type="win32" /> + <assemblyIdentity version="1.0.3.5" processorArchitecture="X86" name="IRServer" type="win32" /> <description>Provides multiple connections for local and network access to a remote control transceiver</description> <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> <security> Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Properties/AssemblyInfo.cs 2007-10-26 14:59:29 UTC (rev 1006) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Properties/AssemblyInfo.cs 2007-10-27 13:36:02 UTC (rev 1007) @@ -34,8 +34,8 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.3.4")] -[assembly: AssemblyFileVersion("1.0.3.4")] +[assembly: AssemblyVersion("1.0.3.5")] +[assembly: AssemblyFileVersion("1.0.3.5")] [assembly: CLSCompliant(true)] Modified: trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.cs 2007-10-26 14:59:29 UTC (rev 1006) +++ trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.cs 2007-10-27 13:36:02 UTC (rev 1007) @@ -24,7 +24,7 @@ private void FormMain_Load(object sender, EventArgs e) { - ArrayList networkPCs = Win32.GetNetworkComputers(); + string[] networkPCs = Win32.GetNetworkComputers(false); if (networkPCs == null) { MessageBox.Show(this, "No server names detected.", "Network Error", MessageBoxButtons.OK, MessageBoxIcon.Error); @@ -33,7 +33,7 @@ } else { - comboBoxComputer.Items.AddRange(networkPCs.ToArray()); + comboBoxComputer.Items.AddRange(networkPCs); } _irBlastLocation = SystemRegistry.GetInstallFolder(); @@ -63,9 +63,10 @@ return; } + RegistryKey mainKey = null; + try { - RegistryKey mainKey; if (radioButtonExeTuner.Checked) mainKey = Registry.LocalMachine.CreateSubKey("SOFTWARE\\Sage\\EXETunerPlugin"); else @@ -93,7 +94,6 @@ command.Append(" -channel %CHANNEL%"); mainKey.SetValue("Command", command.ToString(), RegistryValueKind.String); - mainKey.Close(); MessageBox.Show(this, "Sage plugin setup complete", "Done", MessageBoxButtons.OK, MessageBoxIcon.Information); } @@ -101,6 +101,11 @@ { MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } + finally + { + if (mainKey != null) + mainKey.Close(); + } } } Modified: trunk/plugins/IR Server Suite/Applications/SageSetup/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/SageSetup/Properties/AssemblyInfo.cs 2007-10-26 14:59:29 UTC (rev 1006) +++ trunk/plugins/IR Server Suite/Applications/SageSetup/Properties/AssemblyInfo.cs 2007-10-27 13:36:02 UTC (rev 1007) @@ -29,5 +29,5 @@ // Build Number // Revision // -[assembly: AssemblyVersion("1.0.3.4")] -[assembly: AssemblyFileVersion("1.0.3.4")] +[assembly: AssemblyVersion("1.0.3.5")] +[assembly: AssemblyFileVersion("1.0.3.5")] Modified: trunk/plugins/IR Server Suite/Applications/SageSetup/Sage Setup.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/SageSetup/Sage Setup.csproj 2007-10-26 14:59:29 UTC (rev 1006) +++ trunk/plugins/IR Server Suite/Applications/SageSetup/Sage Setup.csproj 2007-10-27 13:36:02 UTC (rev 1007) @@ -74,6 +74,11 @@ <Name>IrssUtils</Name> </ProjectReference> </ItemGroup> + <ItemGroup> + <Content Include="SageSetup.exe.manifest"> + <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> + </Content> + </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. Added: trunk/plugins/IR Server Suite/Applications/SageSetup/SageSetup.exe.manifest =================================================================== --- trunk/plugins/IR Server Suite/Applications/SageSetup/SageSetup.exe.manifest (rev 0) +++ trunk/plugins/IR Server Suite/Applications/SageSetup/SageSetup.exe.manifest 2007-10-27 13:36:02 UTC (rev 1007) @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8" ?> +<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" > + <assemblyIdentity version="1.0.3.5" processorArchitecture="X86" name="SageSetup" type="win32" /> + <description>Setup the Sage EXE Tuner plugins for use with IR Server</description> + <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> + <security> + <requestedPrivileges> + <requestedExecutionLevel level="requireAdministrator" /> + </requestedPrivileges> + </security> + </trustInfo> +</assembly> Added: trunk/plugins/IR Server Suite/Applications/Translator/CopyDataWM.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/CopyDataWM.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Translator/CopyDataWM.cs 2007-10-27 13:36:02 UTC (rev 1007) @@ -0,0 +1,153 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Windows.Forms; + +using IrssUtils; + +namespace Translator +{ + + class CopyDataWM : NativeWindow, IDisposable + { + + #region Constants + + static readonly string CopyDataTarget = "Translator CopyData Target"; + + const int CopyDataID = 24; + + #endregion Constants + + #region Constructor / Destructor + + /// <summary> + /// Initializes a new instance of the <see cref="NotifyWindow"/> class. + /// </summary> + public CopyDataWM() + { + Create(); + } + + /// <summary> + /// Releases unmanaged resources and performs other cleanup operations before the + /// <see cref="NotifyWindow"/> is reclaimed by garbage collection. + /// </summary> + ~CopyDataWM() + { + // Call Dispose with false. Since we're in the destructor call, the managed resources will be disposed of anyway. + Dispose(false); + } + + #endregion Constructor / Destructor + + #region IDisposable Members + + /// <summary> + /// Releases unmanaged and - optionally - managed resources + /// </summary> + public void Dispose() + { + // Dispose of the managed and unmanaged resources + Dispose(true); + + // Tell the GC that the Finalize process no longer needs to be run for this object. + GC.SuppressFinalize(this); + } + + /// <summary> + /// Releases unmanaged and - optionally - managed resources + /// </summary> + /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param> + private void Dispose(bool disposing) + { + if (disposing) + { + // Dispose managed resources ... + + Destroy(); + } + + // Free native resources ... + } + + #endregion IDisposable Members + + #region Methods + + void Create() + { + if (Handle != IntPtr.Zero) + return; + + CreateParams Params = new CreateParams(); + Params.ExStyle = 0x80; + Params.Style = unchecked((int)0x80000000); + Params.Caption = CopyDataTarget; + + CreateHandle(Params); + } + + void Destroy() + { + if (Handle == IntPtr.Zero) + return; + + DestroyHandle(); + } + + #endregion Methods + + #region Overrides + + protected override void WndProc(ref Message m) + { + if (m.Msg == (int)Win32.WindowsMessage.WM_COPYDATA) + { + IrssLog.Info("Received WM_COPYDATA message"); + + try + { + Win32.COPYDATASTRUCT dataStructure = (Win32.COPYDATASTRUCT)m.GetLParam(typeof(Win32.COPYDATASTRUCT)); + + if (dataStructure.dwData != CopyDataID) + { + IrssLog.Warn("WM_COPYDATA ID ({0}) does not match expected ID ({1})", dataStructure.dwData, CopyDataID); + return; + } + + byte[] dataBytes = new byte[dataStructure.cbData]; + IntPtr lpData = new IntPtr(dataStructure.lpData); + Marshal.Copy(lpData, dataBytes, 0, dataStructure.cbData); + string strData = Encoding.ASCII.GetString(dataBytes); + + Program.ProcessCommand(strData); + } + catch (Exception ex) + { + IrssLog.Error("Error processing WM_COPYDATA message: {0}", ex.ToString()); + } + } + } + + #endregion Overrides + + internal static void SendCopyDataMessage(string data) + { + Win32.COPYDATASTRUCT copyData; + + byte[] dataBytes = Encoding.ASCII.GetBytes(data); + + copyData.dwData = CopyDataID; + copyData.lpData = Win32.VarPtr(dataBytes).ToInt32(); + copyData.cbData = dataBytes.Length; + + IntPtr windowHandle = Win32.FindWindowByTitle(CopyDataTarget); + + if (windowHandle != IntPtr.Zero) + Win32.SendWindowsMessage(windowHandle, (int)Win32.WindowsMessage.WM_COPYDATA, IntPtr.Zero, Win32.VarPtr(copyData)); + } + + } + +} Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2007-10-26 14:59:29 UTC (rev 1006) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2007-10-27 13:36:02 UTC (rev 1007) @@ -351,36 +351,6 @@ } } - // TODO: Move to a notify window - protected override void WndProc(ref Message m) - { - try - { - if (m.Msg == (int)Win32.WindowsMessage.WM_COPYDATA) - { - IrssLog.Info("Received WM_COPYDATA message"); - - Win32.COPYDATASTRUCT dataStructure = (Win32.COPYDATASTRUCT)m.GetLParam(typeof(Win32.COPYDATASTRUCT)); - - if (dataStructure.dwData != 24) - return; - - byte[] dataBytes = new byte[dataStructure.cbData]; - IntPtr lpData = new IntPtr(dataStructure.lpData); - System.Runtime.InteropServices.Marshal.Copy(lpData, dataBytes, 0, dataStructure.cbData); - string strData = Encoding.ASCII.GetString(dataBytes); - - Program.ProcessCommand(strData); - } - } - catch (Exception ex) - { - IrssLog.Error(ex.ToString()); - } - - base.WndProc(ref m); - } - #region Controls private void listViewButtons_DoubleClick(object sender, EventArgs e) @@ -716,12 +686,26 @@ { EditIR(); } + private void listViewMacro_DoubleClick(object sender, EventArgs e) + { + EditMacro(); + } + private void listViewIR_AfterLabelEdit(object sender, LabelEditEventArgs e) { ListView origin = sender as ListView; if (origin == null) + { + e.CancelEdit = true; return; + } + if (String.IsNullOrEmpty(e.Label)) + { + e.CancelEdit = true; + return; + } + ListViewItem originItem = origin.Items[e.Item]; string oldFileName = Common.FolderIRCommands + originItem.Text + Common.FileExtensionIR; @@ -732,7 +716,7 @@ return; } - if (String.IsNullOrEmpty(e.Label) || !Common.IsValidFileName(e.Label)) + if (!Common.IsValidFileName(e.Label)) { MessageBox.Show("File name not valid: " + e.Label, "Cannot rename, New file name not valid", MessageBoxButtons.OK, MessageBoxIcon.Error); e.CancelEdit = true; @@ -751,17 +735,21 @@ MessageBox.Show(ex.ToString(), "Failed to rename file", MessageBoxButtons.OK, MessageBoxIcon.Error); } } - - private void listViewMacro_DoubleClick(object sender, EventArgs e) - { - EditMacro(); - } private void listViewMacro_AfterLabelEdit(object sender, LabelEditEventArgs e) { ListView origin = sender as ListView; if (origin == null) + { + e.CancelEdit = true; return; + } + if (String.IsNullOrEmpty(e.Label)) + { + e.CancelEdit = true; + return; + } + ListViewItem originItem = origin.Items[e.Item]; string oldFileName = Program.FolderMacros + originItem.Text + Common.FileExtensionMacro; @@ -772,7 +760,7 @@ return; } - if (String.IsNullOrEmpty(e.Label) || !Common.IsValidFileName(e.Label)) + if (!Common.IsValidFileName(e.Label)) { MessageBox.Show("File name not valid: " + e.Label, "Cannot rename, New file name not valid", MessageBoxButtons.OK, MessageBoxIcon.Error); e.CancelEdit = true; @@ -1043,7 +1031,7 @@ } private void aboutToolStripMenuItem_Click(object sender, EventArgs e) { - MessageBox.Show(this, "Translator\nVersion 1.0.3.4 for IR Server Suite\nBy Aaron Dinnage, 2007", "About Translator", MessageBoxButtons.OK, MessageBoxIcon.Information); + MessageBox.Show(this, "Translator\nVersion 1.0.3.5 for IR Server Suite\nBy Aaron Dinnage, 2007", "About Translator", MessageBoxButtons.OK, MessageBoxIcon.Information); } #endregion Menu Modified: trunk/plugins/IR Server Suite/Applications/Translator/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2007-10-26 14:59:29 UTC (rev 1006) +++ trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2007-10-27 13:36:02 UTC (rev 1007) @@ -54,6 +54,8 @@ static List<string> _macroStack; + static CopyDataWM _copyDataWM; + #endregion Variables #region Properties @@ -94,10 +96,17 @@ { if (args.Length > 0) { - ProcessCommandLine(args); + try + { + ProcessCommandLine(args); + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + } return; } - + // Check for multiple instances. if (Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName).Length != 1) return; @@ -160,8 +169,23 @@ SystemEvents.SessionEnding += new SessionEndingEventHandler(SystemEvents_SessionEnding); SystemEvents.PowerModeChanged += new PowerModeChangedEventHandler(SystemEvents_PowerModeChanged); + try + { + _copyDataWM = new CopyDataWM(); + } + catch (Win32Exception ex) + { + IrssLog.Error("Error enabling CopyData messages: {0}", ex.ToString()); + } + Application.Run(); + if (_copyDataWM != null) + { + _copyDataWM.Dispose(); + _copyDataWM = null; + } + SystemEvents.SessionEnding -= new SessionEndingEventHandler(SystemEvents_SessionEnding); SystemEvents.PowerModeChanged -= new PowerModeChangedEventHandler(SystemEvents_PowerModeChanged); @@ -197,7 +221,7 @@ /// </summary> /// <param name="sender">Sender.</param> /// <param name="e">Event args.</param> - public static void Application_ThreadException(object sender, ThreadExceptionEventArgs e) + static void Application_ThreadException(object sender, ThreadExceptionEventArgs e) { IrssLog.Error(e.Exception.ToString()); } @@ -259,32 +283,45 @@ switch (command) { + case "-blast": + if (args.Length > index + 2) + CopyDataWM.SendCopyDataMessage(Common.CmdPrefixBlast + args[++index] + '|' + args[++index]); + else + Console.WriteLine("Blast command requires two parameters."); + continue; + case "-macro": - SendCopyDataMessage("Translator", Common.CmdPrefixMacro + args[++index]); + if (args.Length > index + 1) + CopyDataWM.SendCopyDataMessage(Common.CmdPrefixMacro + args[++index]); + else + Console.WriteLine("Macro command requires a parameter."); continue; case "-eject": - SendCopyDataMessage("Translator", Common.CmdPrefixEject + args[++index]); + if (args.Length > index + 1) + CopyDataWM.SendCopyDataMessage(Common.CmdPrefixEject + args[++index]); + else + Console.WriteLine("Eject command requires a parameter."); continue; case "-shutdown": - SendCopyDataMessage("Translator", Common.CmdPrefixShutdown); + CopyDataWM.SendCopyDataMessage(Common.CmdPrefixShutdown); continue; case "-reboot": - SendCopyDataMessage("Translator", Common.CmdPrefixReboot); + CopyDataWM.SendCopyDataMessage(Common.CmdPrefixReboot); continue; case "-standby": - SendCopyDataMessage("Translator", Common.CmdPrefixStandby); + CopyDataWM.SendCopyDataMessage(Common.CmdPrefixStandby); continue; case "-hibernate": - SendCopyDataMessage("Translator", Common.CmdPrefixHibernate); + CopyDataWM.SendCopyDataMessage(Common.CmdPrefixHibernate); continue; case "-logoff": - SendCopyDataMessage("Translator", Common.CmdPrefixLogOff); + CopyDataWM.SendCopyDataMessage(Common.CmdPrefixLogOff); continue; //TODO: Add more command line options. @@ -303,21 +340,6 @@ //_notifyIcon.ContextMenuStrip.Focus(); } - static void SendCopyDataMessage(string targetWindow, string data) - { - Win32.COPYDATASTRUCT copyData; - - byte[] dataBytes = Encoding.ASCII.GetBytes(data); - - copyData.dwData = 24; - copyData.lpData = Win32.VarPtr(dataBytes).ToInt32(); - copyData.cbData = dataBytes.Length; - - IntPtr windowHandle = Win32.FindWindowByTitle(targetWindow); - if (windowHandle != IntPtr.Zero) - Win32.SendWindowsMessage(windowHandle, (int)Win32.WindowsMessage.WM_COPYDATA, IntPtr.Zero, Win32.VarPtr(copyData)); - } - static void SystemEvents_PowerModeChanged(object sender, PowerModeChangedEventArgs e) { switch (e.Mode) @@ -1006,6 +1028,10 @@ } } + /// <summary> + /// Adds to the Macro Stack. + /// </summary> + /// <param name="fileName">Name of the macro file.</param> static void MacroStackAdd(string fileName) { string lowerCasedFileName = fileName.ToLowerInvariant(); @@ -1036,6 +1062,10 @@ _macroStack.Add(lowerCasedFileName); } + /// <summary> + /// Removes from the Macro Stack. + /// </summary> + /// <param name="fileName">Name of the macro file.</param> static void MacroStackRemove(string fileName) { string lowerCasedFileName = fileName.ToLowerInvariant(); Modified: trunk/plugins/IR Server Suite/Applications/Translator/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Properties/AssemblyInfo.cs 2007-10-26 14:59:29 UTC (rev 1006) +++ trunk/plugins/IR Server Suite/Applications/Translator/Properties/AssemblyInfo.cs 2007-10-27 13:36:02 UTC (rev 1007) @@ -33,8 +33,8 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.3.4")] -[assembly: AssemblyFileVersion("1.0.3.4")] +[assembly: AssemblyVersion("1.0.3.5")] +[assembly: AssemblyFileVersion("1.0.3.5")] [assembly: CLSCompliant(true)] Modified: trunk/plugins/IR Server Suite/Applications/Translator/Properties/Resources.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Properties/Resources.Designer.cs 2007-10-26 14:59:29 UTC (rev 1006) +++ trunk/plugins/IR Server Suite/Applications/Translator/Properties/Resources.Designer.cs 2007-10-27 13:36:02 UTC (rev 1007) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. -// Runtime Version:2.0.50727.312 +// Runtime Version:2.0.50727.832 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. Modified: trunk/plugins/IR Server Suite/Applications/Translator/Translator.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Translator.csproj 2007-10-26 14:59:29 UTC (rev 1006) +++ trunk/plugins/IR Server Suite/Applications/Translator/Translator.csproj 2007-10-27 13:36:02 UTC (rev 1007) @@ -53,7 +53,7 @@ <DebugType>full</DebugType> <PlatformTarget>x86</PlatformTarget> <ErrorReport>prompt</ErrorReport> - <UseVSHostingProcess>false</UseVSHostingProcess> + <UseVSHostingProcess>true</UseVSHostingProcess> </PropertyGroup> <ItemGroup> <Reference Include="System" /> @@ -96,6 +96,7 @@ <DependentUpon>MainForm.cs</DependentUpon> </Compile> <Compile Include="MappedEvent.cs" /> + <Compile Include="CopyDataWM.cs" /> <Compile Include="Program.cs" /> <Compile Include="ProgramSettings.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> Modified: trunk/plugins/IR Server Suite/Applications/Tray Launcher/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Tray Launcher/Properties/AssemblyInfo.cs 2007-10-26 14:59:29 UTC (rev 1006) +++ trunk/plugins/IR Server Suite/Applications/Tray Launcher/Properties/AssemblyInfo.cs 2007-10-27 13:36:02 UTC (rev 1007) @@ -33,8 +33,8 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.3.4")] -[assembly: AssemblyFileVersion("1.0.3.4")] +[assembly: AssemblyVersion("1.0.3.5")] +[assembly: AssemblyFileVersion("1.0.3.5")] [assembly: CLSCompliant(true)] [assembly: GuidAttribute("2011f0d4-cec8-43d2-8678-79f24cd6c517")] Modified: trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray Launcher.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray Launcher.csproj 2007-10-26 14:59:29 UTC (rev 1006) +++ trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray Launcher.csproj 2007-10-27 13:36:02 UTC (rev 1007) @@ -42,7 +42,7 @@ <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <DebugType>full</DebugType> <PlatformTarget>x86</PlatformTarget> - <UseVSHostingProcess>false</UseVSHostingProcess> + <UseVSHostingProcess>true</UseVSHostingProcess> <ErrorReport>prompt</ErrorReport> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote/Properties/AssemblyInfo.cs 2007-10-26 14:59:29 UTC (rev 1006) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote/Properties/AssemblyInfo.cs 2007-10-27 13:36:02 UTC (rev 1007) @@ -33,8 +33,8 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.3.4")] -[assembly: AssemblyFileVersion("1.0.3.4")] +[assembly: AssemblyVersion("1.0.3.5")] +[assembly: AssemblyFileVersion("1.0.3.5")] [assembly: CLSCompliant(true)] [assembly: GuidAttribute("b9084277-405c-48e6-80d1-c0d0e1dae27d")] Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote/Virtual Remote.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote/Virtual Remote.csproj 2007-10-26 14:59:29 UTC (rev 1006) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote/Virtual Remote.csproj 2007-10-27 13:36:02 UTC (rev 1007) @@ -51,7 +51,7 @@ <DebugType>full</DebugType> <PlatformTarget>x86</PlatformTarget> <ErrorReport>prompt</ErrorReport> - <UseVSHostingProcess>false</UseVSHostingProcess> + <UseVSHostingProcess>true</UseVSHostingProcess> </PropertyGroup> <ItemGroup> <Reference Include="System" /> Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/Properties/AssemblyInfo.cs 2007-10-26 14:59:29 UTC (rev 1006) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/Properties/AssemblyInfo.cs 2007-10-27 13:36:02 UTC (rev 1007) @@ -30,7 +30,7 @@ // Build Number // Revision // -[assembly: AssemblyVersion("1.0.3.4")] -[assembly: AssemblyFileVersion("1.0.3.4")] +[assembly: AssemblyVersion("1.0.3.5")] +[assembly: AssemblyFileVersion("1.0.3.5")] [assembly: CLSCompliant(true)] \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/Virtual Remote Skin Editor.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/Virtual Remote Skin Editor.csproj 2007-10-26 14:59:29 UTC (rev 1006) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/Virtual Remote Skin Editor.csproj 2007-10-27 13:36:02 UTC (rev 1007) @@ -49,6 +49,7 @@ </DebugType> <PlatformTarget>x86</PlatformTarget> <ErrorReport>prompt</ErrorReport> + <UseVSHostingProcess>false</UseVSHostingProcess> </PropertyGroup> <ItemGroup> <Reference Include="System" /> Modified: trunk/plugins/IR Server Suite/Common/IrssComms/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssComms/Properties/AssemblyInfo.cs 2007-10-26 14:59:29 UTC (rev 1006) +++ trunk/plugins/IR Server Suite/Common/IrssComms/Properties/AssemblyInfo.cs 2007-10-27 13:36:02 UTC (rev 1007) @@ -33,8 +33,8 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.3.4")] -[assembly: AssemblyFileVersion("1.0.3.4")] +[assembly: AssemblyVersion("1.0.3.5")] +[assembly: AssemblyFileVersion("1.0.3.5")] [assembly: CLSCompliant(true)] Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Keyboard.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Keyboard.cs 2007-10-26 14:59:29 UTC (rev 1006) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Keyboard.cs 2007-10-27 13:36:02 UTC (rev 1007) @@ -1,11 +1,13 @@ using System; using System.Runtime.InteropServices; +using System.Windows.Forms; namespace IrssUtils { /// <summary> /// Win32 native method wrapper for Keyboard control functions. + /// http://msdn2.microsoft.com/en-us/library/ms646304.aspx /// </summary> public static class Keyboard { @@ -19,6 +21,10 @@ uint dwFlags, IntPtr dwExtraInfo); + [DllImport("user32.dll")] + static extern short VkKeyScan( + char ch); + #endregion Interop #region Enumerations @@ -623,7 +629,7 @@ #region Public Methods /// <summary> - /// Simulate a key being pressed down + /// Simulate a key being pressed down. /// </summary> /// <param name="vKey">Virtual key to press.</param> public static void KeyDown(VKey vKey) @@ -632,7 +638,7 @@ } /// <summary> - /// Simulate a key being released + /// Simulate a key being released. /// </summary> /// <param name="vKey">Virtual key to release.</param> public static void KeyUp(VKey vKey) @@ -641,7 +647,7 @@ } /// <summary> - /// Simulate a Virtual Key event + /// Simulate a Virtual Key event. /// </summary> /// <param name="vKey">Virtual Key.</param> /// <param name="scan">Scan code.</param> @@ -652,6 +658,52 @@ keybd_event((byte)vKey, scan, (uint)flags, extraInfo); } + /// <summary> + /// Simulate a Virtual Key event. + /// </summary> + /// <param name="vKey">Virtual key code.</param> + /// <param name="scan">Scan code.</param> + /// <param name="flags">Event type.</param> + /// <param name="extraInfo">Pointer to additional information.</param> + public static void Event(byte vKey, byte scan, KeyEvents flags, IntPtr extraInfo) + { + keybd_event(vKey, scan, (uint)flags, extraInfo); + } + + + public static void Process(string keystrokes) + { + if (String.IsNullOrEmpty(keystrokes)) + throw new ArgumentNullException("keystrokes"); + + + + for (int index = 0; index < keystrokes.Length; index++) + { + char curChar = keystrokes[index]; + + short keyScan = VkKeyScan(curChar); + + byte keyCode = (byte)curChar; + byte scanCode = 0; + + bool isExtended = false; + + if (isExtended) + { + Event(keyCode, scanCode, KeyEvents.ExtendedKey | KeyEvents.KeyDown, IntPtr.Zero); + Event(keyCode, scanCode, KeyEvents.ExtendedKey | KeyEvents.KeyUp, IntPtr.Zero); + } + else + { + Event(keyCode, scanCode, KeyEvents.KeyDown, IntPtr.Zero); + Event(keyCode, scanCode, KeyEvents.KeyUp, IntPtr.Zero); + } + } + + + } + #endregion Public Methods } Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Properties/AssemblyInfo.cs 2007-10-26 14:59:29 UTC (rev 1006) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Properties/AssemblyInfo.cs 2007-10-27 13:36:02 UTC (rev 1007) @@ -33,8 +33,8 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.3.4")] -[assembly: AssemblyFileVersion("1.0.3.4")] +[assembly: AssemblyVersion("1.0.3.5")] +[assembly: AssemblyFileVersion("1.0.3.5")] [assembly: CLSCompliant(true)] Modified: trunk/plugins/IR Server Suite/Common/MPUtils/MPUtils.csproj =================================================================== --- trunk/plugins/IR Server Suite/Common/MPUtils/MPUtils.csproj 2007-10-26 14:59:29 UTC (rev 1006) +++ trunk/plugins/IR Server Suite/Common/MPUtils/MPUtils.csproj 2007-10-27 13:36:02 UTC (rev 1007) @@ -43,6 +43,7 @@ <RegisterForComInterop>false</RegisterForComInterop> <DocumentationFile>bin\x86\Debug\MPUtils.XML</DocumentationFile> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <UseVSHostingProcess>false</UseVSHostingProcess> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> <OutputPath>bin\x86\Release\</OutputPath> Modified: trunk/plugins/IR Server Suite/Common/MPUtils/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/MPUtils/Properties/AssemblyInfo.cs 2007-10-26 14:59:29 UTC (rev 1006) +++ trunk/plugins/IR Server Suite/Common/MPUtils/Properties/AssemblyInfo.cs 2007-10-27 13:36:02 UTC (rev 1007) @@ -33,8 +33,8 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.3.4")] -[assembly: AssemblyFileVersion("1.0.3.4")] +[assembly: AssemblyVersion("1.0.3.5")] +[assembly: AssemblyFileVersion("1.0.3.5")] [assembly: CLSCompliant(true)] Modified: trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs 2007-10-26 14:59:29 UTC (rev 1006) +++ trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs 2007-10-27 13:36:02 UTC (rev 1007) @@ -209,7 +209,7 @@ /// IR Server plugin version. /// </summary> /// <value>The version.</value> - public override string Version { get { return "1.0.3.4"; } } + public override string Version { get { return "1.0.3.5"; } } /// <summary> /// The IR Server plugin's author. /// </summary> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/Properties/AssemblyInfo.cs 2007-10-26 14:59:29 UTC (rev 1006) +++ trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/Properties/AssemblyInfo.cs 2007-10-27 13:36:02 UTC (rev 1007) @@ -30,8 +30,8 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.3.4")] -[assembly: AssemblyFileVersion("1.0.3.4")] +[assembly: AssemblyVersion("1.0.3.5")] +[assembly: AssemblyFileVersion("1.0.3.5")] [assembly: CLSCompliant(true)] [assembly: GuidAttribute("db244336-eeac-4789-af94-6fbe53df225f")] Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/Properties/AssemblyInfo.cs 2007-10-26 14:59:29 UTC (rev 1006) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/Properties/AssemblyInfo.cs 2007-10-27 13:36:02 UTC (rev 1007) @@ -29,8 +29,8 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.3.4")] -[assembly: AssemblyFileVersion("1.0.3.4")] +[assembly: AssemblyVersion("1.0.3.5")] +[assembly: AssemblyFileVersion("1.0.3.5")] [assembly: CLSCompliant(true)] [assembly: GuidAttribute("efdc4eaa-6ccc-4928-a1e7-f4b634780081")] Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.cs 2007-10-26 14:59:29 UTC (rev 1006) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.cs 2007-10-27 13:36:02 UTC (rev 1007) @@ -57,7 +57,7 @@ /// IR Server plugin version. /// </summary> /// <value>The version.</value> - public override string Version { get { return "1.0.3.4"; } } + public override string Version { get { return "1.0.3.5"; } } /// <summary> /// The IR Server plugin's author. /// </summary> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/Properties/AssemblyInfo.cs 2007-10-26 14:59:29 UTC (rev 1006) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/Properties/AssemblyInfo.cs 2007-10-27 13:36:02 UTC (rev 1007) @@ -29,8 +29,8 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.3.4")] -[assembly: AssemblyFileVersion("1.0.3.4")] +[assembly: AssemblyVersion("1.0.3.5")] +[assembly: AssemblyFileVersion("1.0.3.5")] [assembly: CLSCompliant(true)] [assembly: GuidAttribute("a50e930e-1653-40d5-ba5a-3c0315868c1b")] Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs 2007-10-26 14:59:29 UTC (rev 1006) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs 2007-10-27 13:36:02 UTC (rev 1007) @@ -220,7 +220,7 @@ /// IR Server plugin version. /// </summary> /// <value>The version.</value> - public override string Version { get { return "1.0.3.4"; } } + public override string Version { get { return "1.0.3.5"; } } /// <summary> /// The IR Server plugin's author. /// </summary> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/Properties/AssemblyInfo.cs 2007-10-26 14:59:29 UTC (rev 1006) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/Properties/AssemblyInfo.cs 2007-10-27 13:36:02 UTC (rev 1007) @@ -29,8 +29,8 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.3.4")] -[assembly: AssemblyFileVersion("1.0.3.4")] +[assembly: AssemblyVersion("1.0.3.5")] +[assembly: AssemblyFileVersion("1.0.3.5")] [assembly: CLSCompliant(true)] [assembly: GuidAttribute("fef45a20-12af-4750-b7fa-8c8b6ea42a15")] Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.Designer.cs 2007-10-26 14:59:29 UTC (rev 1006) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.Designer.cs 2007-10-27 13:36:02 UTC (rev 1007) @@ -183,7 +183,7 @@ 0, 0, 0}); - this.numericUpDownLearnTimeout.Location = new System.Drawing.Point(152, 40); + this.numericUpDownLearnTimeout.Location = new System.Drawing.Point(152, 64); this.numericUpDownLearnTimeout.Maximum = new decimal(new int[] { 60000, 0, @@ -317,7 +317,7 @@ this.checkBoxDisableMCEServices.AutoSize = true; this.checkBoxDisableMCEServices.Checked = true; this.checkBoxDisableMCEServices.CheckState = System.Windows.Forms.CheckState.Checked; - this.checkBoxDisableMCEServices.Location = new System.Drawing.Point(8, 80); + this.checkBoxDisableMCEServices.Location = new System.Drawing.Point(8, 96); this.checkBoxDisableMCEServices.Name = "checkBoxDisableMCEServices"; this.checkBoxDisableMCEServices.Size = new System.Drawing.Size(216, 17); this.checkBoxDisableMCEServices.TabIndex = 2; @@ -339,7 +339,7 @@ // // labelLearnIRTimeout // - this.labelLearnIRTimeout.Location = new System.Drawing.Point(8, 40); + this.labelLearnIRTimeout.Location = new System.Drawing.Point(8, 64); this.labelLearnIRTimeout.Name = "labelLearnIRTimeout"; this.labelLearnIRTimeout.Size = new System.Drawing.Size(136, 20); this.labelLearnIRTimeout.TabIndex = 0; @@ -492,7 +492,7 @@ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.buttonCancel; - this.ClientSize = new System.Drawing.Size(272, 239); + this.ClientSize = new System.Drawing.Size(272, 258); this.ControlBox = false; this.Controls.Add(this.buttonAdvanced); this.Controls.Add(this.tabControl); Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.resx =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.resx 2007-10-26 14:59:29 UTC (rev 1006) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.resx 2007-10-27 13:36:02 UTC (rev 1007) @@ -120,4 +120,7 @@ <metadata name="toolTips.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>17, 17</value> </metadata> + <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>58</value> + </metadata> </root> \ No newline at end of file Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs 2007-10-26 14:59:29 UTC (rev 1006) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs 2007-10-27 13:36:02 UTC (rev 1007) @@ -318,13 +318,13 @@ #if DEBUG - protected StreamWriter _debugFile; + protected static StreamWriter _debugFile; /// <summary> /// Opens a debug output file. /// </summary> /// <param name="fileName">Name of the file.</param> - protected void DebugOpen(string fileName) + protected static void DebugOpen(string fileName) { try { @@ -340,7 +340,7 @@ /// <summary> /// Closes the debug output file. /// </summary> - protected void DebugClose() + protected static void DebugClose() { if (_debugFile != null) { @@ -353,24 +353,47 @@ /// Writes a line to the debug output file. /// </summary> /// <param name="line">The line.</param> - protected void DebugWriteLine(string line) + protected static void DebugWriteLine(string line) { if (_debugFile != null) _debugFile.WriteLine(line); } /// <summary> + /// Writes a string to the debug output file. + /// </summary> + /// <param name="text">The string to write.</param> + protected static void DebugWrite(string text) + { + if (_debugFile != null) + _debugFile.Write(text); + } + + /// <summary> + /// Writes a new line to the debug output file. + /// </summary> + protected static void DebugWriteNewLine() + { + if (_debugFile != null) + _debugFile.WriteLine(); + } + + /// <summary> /// Dumps an Array to the debug output file. /// </summary> /// <param name="array">The array.</param> - protected void DebugDump(Array array) + protected static void DebugDump(Array array) { if (_debugFile == null) return; foreach (object item in array) { - _debugFile.Write(item); + if (item is byte) _debugFile.Write("{0:X2}", (byte) item); + else if (item is ushort) _debugFile.Write("{0:X4}", (ushort) item); + else if (item is int) _debugFile.Write("{1}{0}", (int) item, (int)item > 0 ? "+" : ""); + else _debugFile.Write("{0}", item); + _debugFile.Write(", "); } Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverReplacement.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverReplacement.cs 2007-10-26 14:59:29 UTC (rev 1006) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverReplacement.cs 2007-10-27 13:36:02 UTC (rev 1007) @@ -60,6 +60,11 @@ static extern bool CancelIo( SafeFileHandle handle); + [DllImport("kernel32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool CloseHandle( + SafeFileHandle handle); + #endregion Interop #region Enumerations @@ -112,7 +117,7 @@ // Device variables const int DeviceBufferSize = 100; const int PacketTimeout = 100; - const int WriteSyncTimeout = 5000; + const int WriteSyncTimeout = 10000; // Microsoft Port Packets static readonly byte[][] MicrosoftPorts = new byte[][] @@ -200,7 +205,7 @@ { #if DEBUG DebugOpen("\\MicrosoftMceTransceiver_DriverReplacement.log"); - DebugWriteLine("DriverReplacement.Start()"); + DebugWriteLine("Start()"); #endif _notifyWindow = new NotifyWindow(); @@ -237,7 +242,7 @@ public override void Stop() { #if DEBUG - DebugWriteLine("DriverReplacement.Stop()"); + DebugWriteLine("Stop()"); #endif _notifyWindow.DeviceArrival -= new DeviceEventHandler(OnDeviceArrival); @@ -263,8 +268,11 @@ /// </summary> public override void Suspend() { - Stop(); - //WriteSync(StopPacket); +#if DEBUG + DebugWriteLine("Suspend()"); +#endif + + Stop(); // Unlike the default driver, the replacement driver requires this. } /// <summary> @@ -272,8 +280,11 @@ /// </summary> public override void Resume() { - Start(); - //WriteSync(StartPacket); +#if DEBUG + DebugWriteLine("Resume()"); +#endif + + Start(); // Unlike the default driver, the replacement driver requires this. } /// <summary> @@ -285,7 +296,7 @@ public override LearnStatus Learn(int learnTimeout, out IrCode learned) { #if DEBUG - DebugWriteLine("Start Learn"); + DebugWriteLine("Learn()"); #endif learned = null; @@ -298,7 +309,7 @@ // Wait for the learning to finish ... while (_readThreadMode == ReadThreadMode.Learning && Environment.TickCount < learnStartTick + learnTimeout) - Thread.Sleep(100); + Thread.Sleep(PacketTimeout); #if DEBUG DebugWriteLine("End Learn"); @@ -345,7 +356,8 @@ public override void Send(IrCode code, uint port) { #if DEBUG - DebugWriteLine("Send"); + DebugWriteLine("Send()"); + DebugDump(code.TimingData); #endif byte[] portPacket; @@ -376,14 +388,24 @@ byte[] carrierPacket = new byte[SetCarrierFreqPacket.Length]; SetCarrierFreqPacket.CopyTo(carrierPacket, 0); - if (code.Carrier == IrCode.CarrierFrequencyUnknown || code.Carrier == IrCode.CarrierFrequencyDCMode) + if (code.Carrier == IrCode.CarrierFrequencyDCMode) return carrierPacket; + int carrier = code.Carrier; + + if (code.Carrier == IrCode.CarrierFrequencyUnknown) + { + carrier = IrCode.CarrierFrequencyDefault; +#if DEBUG + DebugWriteLine(String.Format("CarrierPacket(): No carrier frequency specificied, using default ({0})", carrier)); +#endif + } + for (int scaler = 1; scaler <= 4; scaler++) { - int divisor = (10000000 >> (2 * scaler)) / code.Carrier; + int divisor = (10000000 >> (2 * scaler)) / carrier; - if (divisor <= 0xFF) + if (divisor < 0xFF) { carrierPacket[2] = (byte)scaler; carrierPacket[3] = (byte)divisor; @@ -402,6 +424,10 @@ // Construct data bytes into "packet" ... List<byte> packet = new List<byte>(); +#if DEBUG + DebugWriteLine("DataPacket()"); +#endif + for (int index = 0; index < code.TimingData.Length; index++) { double time = (double)code.TimingData[index]; @@ -409,6 +435,10 @@ byte duration = (byte)Math.Abs(Math.Round(time / 50)); bool pulse = (time > 0); +#if DEBUG + DebugWrite(String.Format("{0}{1}, ", pulse ? '+' : '-', duration * 50)); +#endif + while (duration > 0x7F) { packet.Add((byte)(pulse ? 0xFF : 0x7F)); @@ -419,6 +449,10 @@ packet.Add((byte)(pulse ? 0x80 | duration : duration)); } +#if DEBUG + DebugWriteNewLine(); +#endif + // Insert byte count markers into packet data bytes ... int subpackets = (int)Math.Ceiling(packet.Count / (double)4); @@ -471,7 +505,7 @@ void StartReadThread() { #if DEBUG - DebugWriteLine("DriverReplacement.StartReadThread()"); + DebugWriteLine("StartReadThread()"); #endif _stopReadThread = new ManualResetEvent(false); @@ -485,7 +519,7 @@ void StopReadThread() { #if DEBUG - DebugWriteLine("DriverReplacement.StopReadThread()"); + DebugWriteLine("StopReadThread()"); #endif if (_readThread != null) @@ -493,8 +527,6 @@ _readThreadMode = ReadThreadMode.Stop; _stopReadThread.Set(); - //_readThread.Abort(); - if (Thread.CurrentThread != _readThread) _readThread.Join(); @@ -508,17 +540,21 @@ void CloseDevice() { #if DEBUG - DebugWriteLin... [truncated message content] |
From: <an...@us...> - 2007-11-03 12:41:56
|
Revision: 1018 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1018&view=rev Author: and-81 Date: 2007-11-03 05:41:55 -0700 (Sat, 03 Nov 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/EditProgramForm.Designer.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.Designer.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.resx trunk/plugins/IR Server Suite/Applications/Translator/MappedEvent.cs trunk/plugins/IR Server Suite/Applications/Translator/Program.cs trunk/plugins/IR Server Suite/Applications/Translator/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/Applications/Translator/Properties/Resources.resx trunk/plugins/IR Server Suite/Applications/Translator/Translator.csproj trunk/plugins/IR Server Suite/Common/IrssComms/Server.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/MouseCommand.Designer.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/MouseCommand.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/MouseCommand.resx trunk/plugins/IR Server Suite/Common/IrssUtils/IrssUtils.csproj trunk/plugins/IR Server Suite/Common/IrssUtils/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Properties/Resources.resx trunk/plugins/IR Server Suite/Common/IrssUtils/Win32.cs trunk/plugins/IR Server Suite/Common/MPUtils/MPUtils.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/AdvancedSettings.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/AdvancedSettings.cs trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/DeviceSelect.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/DeviceSelect.cs trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IRServerPluginBase.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverReplacement.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverVista.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverXP.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrCode.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrDecoder.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Program.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/Forms/SetupForm.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/SetupForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/SetupForm.resx 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/InputHandler.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/SetupForm.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/Forms/PluginSetup.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs Added Paths: ----------- trunk/plugins/IR Server Suite/Applications/Translator/Graphics/Edit.png trunk/plugins/IR Server Suite/Applications/Translator/Graphics/WinLogo.png trunk/plugins/IR Server Suite/Common/MPUtils/MPCommon.cs trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/RawInput.cs trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/ReceiverWindow.cs Removed Paths: ------------- trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/NativeMethods.cs Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs 2007-11-02 14:13:28 UTC (rev 1017) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs 2007-11-03 12:41:55 UTC (rev 1018) @@ -612,15 +612,15 @@ if (!origin.Checked) return; - if (origin != checkBoxMouseClickLeft) checkBoxMouseClickLeft.Checked = false; - if (origin != checkBoxMouseClickRight) checkBoxMouseClickRight.Checked = false; - if (origin != checkBoxMouseClickMiddle) checkBoxMouseClickMiddle.Checked = false; - if (origin != checkBoxMouseMoveUp) checkBoxMouseMoveUp.Checked = false; - if (origin != checkBoxMouseMoveDown) checkBoxMouseMoveDown.Checked = false; - if (origin != checkBoxMouseMoveLeft) checkBoxMouseMoveLeft.Checked = false; - if (origin != checkBoxMouseMoveRight) checkBoxMouseMoveRight.Checked = false; - if (origin != checkBoxMouseScrollUp) checkBoxMouseScrollUp.Checked = false; - if (origin != checkBoxMouseScrollDown) checkBoxMouseScrollDown.Checked = false; + if (origin != checkBoxMouseClickLeft) checkBoxMouseClickLeft.Checked = false; + if (origin != checkBoxMouseClickRight) checkBoxMouseClickRight.Checked = false; + if (origin != checkBoxMouseClickMiddle) checkBoxMouseClickMiddle.Checked = false; + if (origin != checkBoxMouseMoveUp) checkBoxMouseMoveUp.Checked = false; + if (origin != checkBoxMouseMoveDown) checkBoxMouseMoveDown.Checked = false; + if (origin != checkBoxMouseMoveLeft) checkBoxMouseMoveLeft.Checked = false; + if (origin != checkBoxMouseMoveRight) checkBoxMouseMoveRight.Checked = false; + if (origin != checkBoxMouseScrollUp) checkBoxMouseScrollUp.Checked = false; + if (origin != checkBoxMouseScrollDown) checkBoxMouseScrollDown.Checked = false; } private void KeystrokeToolStripMenuItem_Click(object sender, EventArgs e) Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/EditProgramForm.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/EditProgramForm.Designer.cs 2007-11-02 14:13:28 UTC (rev 1017) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/EditProgramForm.Designer.cs 2007-11-03 12:41:55 UTC (rev 1018) @@ -269,7 +269,7 @@ this.Controls.Add(this.textBoxApp); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MinimizeBox = false; - this.MinimumSize = new System.Drawing.Size(392, 308); + this.MinimumSize = new System.Drawing.Size(392, 396); this.Name = "EditProgramForm"; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MacroEditor.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MacroEditor.cs 2007-11-02 14:13:28 UTC (rev 1017) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MacroEditor.cs 2007-11-03 12:41:55 UTC (rev 1018) @@ -62,6 +62,7 @@ comboBoxCommands.Items.Add(Common.UITextWindowMsg); comboBoxCommands.Items.Add(Common.UITextTcpMsg); comboBoxCommands.Items.Add(Common.UITextKeys); + comboBoxCommands.Items.Add(Common.UITextMouse); comboBoxCommands.Items.Add(Common.UITextEject); comboBoxCommands.Items.Add(Common.UITextStandby); comboBoxCommands.Items.Add(Common.UITextHibernate); @@ -137,6 +138,11 @@ writer.WriteAttributeString("command", Common.XmlTagKeys); writer.WriteAttributeString("cmdproperty", item.Substring(Common.CmdPrefixKeys.Length)); } + else if (item.StartsWith(Common.CmdPrefixMouse)) + { + writer.WriteAttributeString("command", Common.XmlTagMouse); + writer.WriteAttributeString("cmdproperty", item.Substring(Common.CmdPrefixMouse.Length)); + } else if (item.StartsWith(Common.CmdPrefixEject)) { writer.WriteAttributeString("command", Common.XmlTagEject); @@ -234,6 +240,10 @@ listBoxMacro.Items.Add(Common.CmdPrefixKeys + commandProperty); break; + case Common.XmlTagMouse: + listBoxMacro.Items.Add(Common.CmdPrefixMouse + commandProperty); + break; + case Common.XmlTagEject: listBoxMacro.Items.Add(Common.CmdPrefixEject + commandProperty); break; @@ -312,6 +322,12 @@ if (keysCommand.ShowDialog(this) == DialogResult.OK) listBoxMacro.Items.Add(Common.CmdPrefixKeys + keysCommand.CommandString); } + else if (selected == Common.UITextMouse) + { + MouseCommand mouseCommand = new MouseCommand(); + if (mouseCommand.ShowDialog(this) == DialogResult.OK) + listBoxMacro.Items.Add(Common.CmdPrefixMouse + mouseCommand.CommandString); + } else if (selected == Common.UITextEject) { EjectCommand ejectCommand = new EjectCommand(); @@ -528,6 +544,17 @@ listBoxMacro.Items.Insert(index, Common.CmdPrefixKeys + keysCommand.CommandString); listBoxMacro.SelectedIndex = index; } + else if (selected.StartsWith(Common.CmdPrefixMouse)) + { + MouseCommand mouseCommand = new MouseCommand(selected.Substring(Common.CmdPrefixMouse.Length)); + if (mouseCommand.ShowDialog(this) == DialogResult.Cancel) + return; + + int index = listBoxMacro.SelectedIndex; + listBoxMacro.Items.RemoveAt(index); + listBoxMacro.Items.Insert(index, Common.CmdPrefixMouse + mouseCommand.CommandString); + listBoxMacro.SelectedIndex = index; + } else if (selected.StartsWith(Common.CmdPrefixEject)) { EjectCommand ejectCommand = new EjectCommand(selected.Substring(Common.CmdPrefixEject.Length)); Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.Designer.cs 2007-11-02 14:13:28 UTC (rev 1017) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.Designer.cs 2007-11-03 12:41:55 UTC (rev 1018) @@ -1,7 +1,9 @@ namespace Translator { + partial class MainForm { + /// <summary> /// Required designer variable. /// </summary> @@ -30,11 +32,9 @@ { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); - this.comboBoxProgram = new System.Windows.Forms.ComboBox(); - this.groupBoxProgram = new System.Windows.Forms.GroupBox(); - this.buttonEditProgram = new System.Windows.Forms.Button(); - this.buttonRemoveProgram = new System.Windows.Forms.Button(); - this.buttonAddProgram = new System.Windows.Forms.Button(); + this.listViewPrograms = new System.Windows.Forms.ListView(); + this.contextMenuStripPrograms = new System.Windows.Forms.ContextMenuStrip(this.components); + this.imageListPrograms = new System.Windows.Forms.ImageList(this.components); this.buttonClear = new System.Windows.Forms.Button(); this.buttonModify = new System.Windows.Forms.Button(); this.buttonDelete = new System.Windows.Forms.Button(); @@ -55,18 +55,20 @@ this.comboBoxEvents = new System.Windows.Forms.ComboBox(); this.listViewEventMap = new System.Windows.Forms.ListView(); this.columnHeaderEvent = new System.Windows.Forms.ColumnHeader(); - this.columnHeader1 = new System.Windows.Forms.ColumnHeader(); - this.tabPageIRCommands = new System.Windows.Forms.TabPage(); - this.listViewIR = new System.Windows.Forms.ListView(); - this.buttonNewIR = new System.Windows.Forms.Button(); - this.buttonEditIR = new System.Windows.Forms.Button(); - this.buttonDeleteIR = new System.Windows.Forms.Button(); + this.columnHeaderEventCommand = new System.Windows.Forms.ColumnHeader(); + this.contextMenuStripEvents = new System.Windows.Forms.ContextMenuStrip(this.components); + this.removeEventToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.tabPageMacro = new System.Windows.Forms.TabPage(); this.listViewMacro = new System.Windows.Forms.ListView(); this.buttonTestMacro = new System.Windows.Forms.Button(); this.buttonDeleteMacro = new System.Windows.Forms.Button(); this.buttonNewMacro = new System.Windows.Forms.Button(); this.buttonEditMacro = new System.Windows.Forms.Button(); + this.tabPageIRCommands = new System.Windows.Forms.TabPage(); + this.listViewIR = new System.Windows.Forms.ListView(); + this.buttonNewIR = new System.Windows.Forms.Button(); + this.buttonEditIR = new System.Windows.Forms.Button(); + this.buttonDeleteIR = new System.Windows.Forms.Button(); this.toolTip = new System.Windows.Forms.ToolTip(this.components); this.checkBoxAutoRun = new System.Windows.Forms.CheckBox(); this.menuStrip = new System.Windows.Forms.MenuStrip(); @@ -84,83 +86,53 @@ this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); this.saveFileDialog = new System.Windows.Forms.SaveFileDialog(); - this.groupBoxProgram.SuspendLayout(); this.tabControl.SuspendLayout(); this.tabPagePrograms.SuspendLayout(); this.tabPageEvents.SuspendLayout(); - this.tabPageIRCommands.SuspendLayout(); + this.contextMenuStripEvents.SuspendLayout(); this.tabPageMacro.SuspendLayout(); + this.tabPageIRCommands.SuspendLayout(); this.menuStrip.SuspendLayout(); this.SuspendLayout(); // - // comboBoxProgram + // listViewPrograms // - this.comboBoxProgram.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.listViewPrograms.Alignment = System.Windows.Forms.ListViewAlignment.Left; + this.listViewPrograms.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.comboBoxProgram.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.comboBoxProgram.FormattingEnabled = true; - this.comboBoxProgram.Location = new System.Drawing.Point(8, 16); - this.comboBoxProgram.Name = "comboBoxProgram"; - this.comboBoxProgram.Size = new System.Drawing.Size(288, 21); - this.comboBoxProgram.TabIndex = 0; - this.toolTip.SetToolTip(this.comboBoxProgram, "Select a program to setup button mappings for"); - this.comboBoxProgram.SelectedIndexChanged += new System.EventHandler(this.comboBoxProgram_SelectedIndexChanged); + this.listViewPrograms.ContextMenuStrip = this.contextMenuStripPrograms; + this.listViewPrograms.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; + this.listViewPrograms.HideSelection = false; + this.listViewPrograms.LargeImageList = this.imageListPrograms; + this.listViewPrograms.Location = new System.Drawing.Point(8, 8); + this.listViewPrograms.MultiSelect = false; + this.listViewPrograms.Name = "listViewPrograms"; + this.listViewPrograms.ShowGroups = false; + this.listViewPrograms.ShowItemToolTips = true; + this.listViewPrograms.Size = new System.Drawing.Size(504, 80); + this.listViewPrograms.TabIndex = 0; + this.listViewPrograms.TileSize = new System.Drawing.Size(128, 48); + this.toolTip.SetToolTip(this.listViewPrograms, "Choose a Program to modify mappings for here"); + this.listViewPrograms.UseCompatibleStateImageBehavior = false; + this.listViewPrograms.DoubleClick += new System.EventHandler(this.listViewPrograms_DoubleClick); + this.listViewPrograms.SelectedIndexChanged += new System.EventHandler(this.listViewPrograms_SelectedIndexChanged); // - // groupBoxProgram + // contextMenuStripPrograms // - this.groupBoxProgram.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.groupBoxProgram.Controls.Add(this.buttonEditProgram); - this.groupBoxProgram.Controls.Add(this.buttonRemoveProgram); - this.groupBoxProgram.Controls.Add(this.buttonAddProgram); - this.groupBoxProgram.Controls.Add(this.comboBoxProgram); - this.groupBoxProgram.Location = new System.Drawing.Point(8, 8); - this.groupBoxProgram.Name = "groupBoxProgram"; - this.groupBoxProgram.Size = new System.Drawing.Size(416, 48); - this.groupBoxProgram.TabIndex = 0; - this.groupBoxProgram.TabStop = false; - this.groupBoxProgram.Text = "Program"; + this.contextMenuStripPrograms.Name = "contextMenuStripPrograms"; + this.contextMenuStripPrograms.Size = new System.Drawing.Size(61, 4); + this.contextMenuStripPrograms.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStripPrograms_Opening); // - // buttonEditProgram + // imageListPrograms // - this.buttonEditProgram.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonEditProgram.Location = new System.Drawing.Point(368, 16); - this.buttonEditProgram.Name = "buttonEditProgram"; - this.buttonEditProgram.Size = new System.Drawing.Size(40, 24); - this.buttonEditProgram.TabIndex = 3; - this.buttonEditProgram.Text = "Edit"; - this.toolTip.SetToolTip(this.buttonEditProgram, "Edit the current program"); - this.buttonEditProgram.UseVisualStyleBackColor = true; - this.buttonEditProgram.Click += new System.EventHandler(this.buttonEditProgram_Click); + this.imageListPrograms.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit; + this.imageListPrograms.ImageSize = new System.Drawing.Size(32, 32); + this.imageListPrograms.TransparentColor = System.Drawing.Color.Transparent; // - // buttonRemoveProgram - // - this.buttonRemoveProgram.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonRemoveProgram.Image = global::Translator.Properties.Resources.Delete; - this.buttonRemoveProgram.Location = new System.Drawing.Point(336, 16); - this.buttonRemoveProgram.Name = "buttonRemoveProgram"; - this.buttonRemoveProgram.Size = new System.Drawing.Size(24, 24); - this.buttonRemoveProgram.TabIndex = 2; - this.toolTip.SetToolTip(this.buttonRemoveProgram, "Remove the current program from the list"); - this.buttonRemoveProgram.UseVisualStyleBackColor = true; - this.buttonRemoveProgram.Click += new System.EventHandler(this.buttonRemoveProgram_Click); - // - // buttonAddProgram - // - this.buttonAddProgram.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonAddProgram.Image = global::Translator.Properties.Resources.Plus; - this.buttonAddProgram.Location = new System.Drawing.Point(304, 16); - this.buttonAddProgram.Name = "buttonAddProgram"; - this.buttonAddProgram.Size = new System.Drawing.Size(24, 24); - this.buttonAddProgram.TabIndex = 1; - this.toolTip.SetToolTip(this.buttonAddProgram, "Add a program to the list"); - this.buttonAddProgram.UseVisualStyleBackColor = true; - this.buttonAddProgram.Click += new System.EventHandler(this.buttonAddProgram_Click); - // // buttonClear // this.buttonClear.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonClear.Location = new System.Drawing.Point(368, 344); + this.buttonClear.Location = new System.Drawing.Point(456, 344); this.buttonClear.Name = "buttonClear"; this.buttonClear.Size = new System.Drawing.Size(56, 24); this.buttonClear.TabIndex = 5; @@ -217,10 +189,10 @@ this.listViewButtons.FullRowSelect = true; this.listViewButtons.GridLines = true; this.listViewButtons.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; - this.listViewButtons.Location = new System.Drawing.Point(8, 64); + this.listViewButtons.Location = new System.Drawing.Point(8, 96); this.listViewButtons.MultiSelect = false; this.listViewButtons.Name = "listViewButtons"; - this.listViewButtons.Size = new System.Drawing.Size(416, 272); + this.listViewButtons.Size = new System.Drawing.Size(504, 240); this.listViewButtons.TabIndex = 1; this.listViewButtons.UseCompatibleStateImageBehavior = false; this.listViewButtons.View = System.Windows.Forms.View.Details; @@ -230,23 +202,23 @@ // columnHeaderButton // this.columnHeaderButton.Text = "Code"; - this.columnHeaderButton.Width = 50; + this.columnHeaderButton.Width = 100; // // columnHeaderDescription // this.columnHeaderDescription.Text = "Description"; - this.columnHeaderDescription.Width = 102; + this.columnHeaderDescription.Width = 180; // // columnHeaderCommand // this.columnHeaderCommand.Text = "Command"; - this.columnHeaderCommand.Width = 239; + this.columnHeaderCommand.Width = 200; // // buttonOK // this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK; - this.buttonOK.Location = new System.Drawing.Point(384, 440); + this.buttonOK.Location = new System.Drawing.Point(472, 440); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(64, 24); this.buttonOK.TabIndex = 3; @@ -261,27 +233,27 @@ | System.Windows.Forms.AnchorStyles.Right))); this.tabControl.Controls.Add(this.tabPagePrograms); this.tabControl.Controls.Add(this.tabPageEvents); - this.tabControl.Controls.Add(this.tabPageIRCommands); this.tabControl.Controls.Add(this.tabPageMacro); + this.tabControl.Controls.Add(this.tabPageIRCommands); this.tabControl.Location = new System.Drawing.Point(8, 32); this.tabControl.Name = "tabControl"; this.tabControl.SelectedIndex = 0; - this.tabControl.Size = new System.Drawing.Size(440, 400); + this.tabControl.Size = new System.Drawing.Size(528, 400); this.tabControl.TabIndex = 1; this.tabControl.SelectedIndexChanged += new System.EventHandler(this.tabControl_SelectedIndexChanged); // // tabPagePrograms // this.tabPagePrograms.Controls.Add(this.buttonClear); - this.tabPagePrograms.Controls.Add(this.groupBoxProgram); this.tabPagePrograms.Controls.Add(this.buttonModify); - this.tabPagePrograms.Controls.Add(this.listViewButtons); this.tabPagePrograms.Controls.Add(this.buttonDelete); this.tabPagePrograms.Controls.Add(this.buttonNew); + this.tabPagePrograms.Controls.Add(this.listViewButtons); + this.tabPagePrograms.Controls.Add(this.listViewPrograms); this.tabPagePrograms.Location = new System.Drawing.Point(4, 22); this.tabPagePrograms.Name = "tabPagePrograms"; this.tabPagePrograms.Padding = new System.Windows.Forms.Padding(3); - this.tabPagePrograms.Size = new System.Drawing.Size(432, 374); + this.tabPagePrograms.Size = new System.Drawing.Size(520, 374); this.tabPagePrograms.TabIndex = 0; this.tabPagePrograms.Text = "Programs"; this.tabPagePrograms.UseVisualStyleBackColor = true; @@ -298,15 +270,15 @@ this.tabPageEvents.Location = new System.Drawing.Point(4, 22); this.tabPageEvents.Name = "tabPageEvents"; this.tabPageEvents.Padding = new System.Windows.Forms.Padding(3); - this.tabPageEvents.Size = new System.Drawing.Size(432, 374); - this.tabPageEvents.TabIndex = 2; + this.tabPageEvents.Size = new System.Drawing.Size(520, 374); + this.tabPageEvents.TabIndex = 1; this.tabPageEvents.Text = "Events"; this.tabPageEvents.UseVisualStyleBackColor = true; // // buttonSetCommand // this.buttonSetCommand.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonSetCommand.Location = new System.Drawing.Point(368, 344); + this.buttonSetCommand.Location = new System.Drawing.Point(456, 344); this.buttonSetCommand.Name = "buttonSetCommand"; this.buttonSetCommand.Size = new System.Drawing.Size(56, 24); this.buttonSetCommand.TabIndex = 6; @@ -317,7 +289,7 @@ // buttonAddEvent // this.buttonAddEvent.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonAddEvent.Location = new System.Drawing.Point(368, 312); + this.buttonAddEvent.Location = new System.Drawing.Point(456, 312); this.buttonAddEvent.Name = "buttonAddEvent"; this.buttonAddEvent.Size = new System.Drawing.Size(56, 24); this.buttonAddEvent.TabIndex = 3; @@ -343,7 +315,7 @@ this.comboBoxCommands.FormattingEnabled = true; this.comboBoxCommands.Location = new System.Drawing.Point(88, 344); this.comboBoxCommands.Name = "comboBoxCommands"; - this.comboBoxCommands.Size = new System.Drawing.Size(272, 21); + this.comboBoxCommands.Size = new System.Drawing.Size(352, 21); this.comboBoxCommands.TabIndex = 5; // // labelEvent @@ -364,7 +336,7 @@ this.comboBoxEvents.FormattingEnabled = true; this.comboBoxEvents.Location = new System.Drawing.Point(88, 312); this.comboBoxEvents.Name = "comboBoxEvents"; - this.comboBoxEvents.Size = new System.Drawing.Size(272, 21); + this.comboBoxEvents.Size = new System.Drawing.Size(352, 21); this.comboBoxEvents.TabIndex = 2; // // listViewEventMap @@ -374,14 +346,15 @@ | System.Windows.Forms.AnchorStyles.Right))); this.listViewEventMap.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.columnHeaderEvent, - this.columnHeader1}); + this.columnHeaderEventCommand}); + this.listViewEventMap.ContextMenuStrip = this.contextMenuStripEvents; this.listViewEventMap.FullRowSelect = true; this.listViewEventMap.GridLines = true; this.listViewEventMap.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; this.listViewEventMap.HideSelection = false; this.listViewEventMap.Location = new System.Drawing.Point(8, 8); this.listViewEventMap.Name = "listViewEventMap"; - this.listViewEventMap.Size = new System.Drawing.Size(416, 296); + this.listViewEventMap.Size = new System.Drawing.Size(504, 296); this.listViewEventMap.TabIndex = 0; this.listViewEventMap.UseCompatibleStateImageBehavior = false; this.listViewEventMap.View = System.Windows.Forms.View.Details; @@ -391,83 +364,29 @@ // columnHeaderEvent // this.columnHeaderEvent.Text = "Event"; - this.columnHeaderEvent.Width = 163; + this.columnHeaderEvent.Width = 200; // - // columnHeader1 + // columnHeaderEventCommand // - this.columnHeader1.Text = "Command"; - this.columnHeader1.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; - this.columnHeader1.Width = 230; + this.columnHeaderEventCommand.Text = "Command"; + this.columnHeaderEventCommand.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.columnHeaderEventCommand.Width = 280; // - // tabPageIRCommands + // contextMenuStripEvents // - this.tabPageIRCommands.Controls.Add(this.listViewIR); - this.tabPageIRCommands.Controls.Add(this.buttonNewIR); - this.tabPageIRCommands.Controls.Add(this.buttonEditIR); - this.tabPageIRCommands.Controls.Add(this.buttonDeleteIR); - this.tabPageIRCommands.Location = new System.Drawing.Point(4, 22); - this.tabPageIRCommands.Name = "tabPageIRCommands"; - this.tabPageIRCommands.Padding = new System.Windows.Forms.Padding(3); - this.tabPageIRCommands.Size = new System.Drawing.Size(432, 374); - this.tabPageIRCommands.TabIndex = 2; - this.tabPageIRCommands.Text = "IR Commands"; - this.tabPageIRCommands.UseVisualStyleBackColor = true; + this.contextMenuStripEvents.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.removeEventToolStripMenuItem}); + this.contextMenuStripEvents.Name = "contextMenuStripEvents"; + this.contextMenuStripEvents.Size = new System.Drawing.Size(125, 26); // - // listViewIR + // removeEventToolStripMenuItem // - this.listViewIR.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.listViewIR.FullRowSelect = true; - this.listViewIR.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; - this.listViewIR.HideSelection = false; - this.listViewIR.LabelEdit = true; - this.listViewIR.Location = new System.Drawing.Point(8, 8); - this.listViewIR.MultiSelect = false; - this.listViewIR.Name = "listViewIR"; - this.listViewIR.Size = new System.Drawing.Size(416, 328); - this.listViewIR.TabIndex = 0; - this.listViewIR.UseCompatibleStateImageBehavior = false; - this.listViewIR.View = System.Windows.Forms.View.List; - this.listViewIR.DoubleClick += new System.EventHandler(this.listViewIR_DoubleClick); - this.listViewIR.AfterLabelEdit += new System.Windows.Forms.LabelEditEventHandler(this.listViewIR_AfterLabelEdit); + this.removeEventToolStripMenuItem.Image = global::Translator.Properties.Resources.Delete; + this.removeEventToolStripMenuItem.Name = "removeEventToolStripMenuItem"; + this.removeEventToolStripMenuItem.Size = new System.Drawing.Size(124, 22); + this.removeEventToolStripMenuItem.Text = "&Remove"; + this.removeEventToolStripMenuItem.Click += new System.EventHandler(this.removeEventToolStripMenuItem_Click); // - // buttonNewIR - // - this.buttonNewIR.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.buttonNewIR.Location = new System.Drawing.Point(8, 344); - this.buttonNewIR.Name = "buttonNewIR"; - this.buttonNewIR.Size = new System.Drawing.Size(56, 24); - this.buttonNewIR.TabIndex = 1; - this.buttonNewIR.Text = "New"; - this.toolTip.SetToolTip(this.buttonNewIR, "Learn a new IR Command"); - this.buttonNewIR.UseVisualStyleBackColor = true; - this.buttonNewIR.Click += new System.EventHandler(this.buttonNewIR_Click); - // - // buttonEditIR - // - this.buttonEditIR.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.buttonEditIR.Location = new System.Drawing.Point(72, 344); - this.buttonEditIR.Name = "buttonEditIR"; - this.buttonEditIR.Size = new System.Drawing.Size(56, 24); - this.buttonEditIR.TabIndex = 2; - this.buttonEditIR.Text = "Edit"; - this.toolTip.SetToolTip(this.buttonEditIR, "Re-Learn the currently selected IR Command"); - this.buttonEditIR.UseVisualStyleBackColor = true; - this.buttonEditIR.Click += new System.EventHandler(this.buttonEditIR_Click); - // - // buttonDeleteIR - // - this.buttonDeleteIR.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.buttonDeleteIR.Location = new System.Drawing.Point(136, 344); - this.buttonDeleteIR.Name = "buttonDeleteIR"; - this.buttonDeleteIR.Size = new System.Drawing.Size(56, 24); - this.buttonDeleteIR.TabIndex = 3; - this.buttonDeleteIR.Text = "Delete"; - this.toolTip.SetToolTip(this.buttonDeleteIR, "Delete the currently selected IR Command"); - this.buttonDeleteIR.UseVisualStyleBackColor = true; - this.buttonDeleteIR.Click += new System.EventHandler(this.buttonDeleteIR_Click); - // // tabPageMacro // this.tabPageMacro.Controls.Add(this.listViewMacro); @@ -478,8 +397,8 @@ this.tabPageMacro.Location = new System.Drawing.Point(4, 22); this.tabPageMacro.Name = "tabPageMacro"; this.tabPageMacro.Padding = new System.Windows.Forms.Padding(3); - this.tabPageMacro.Size = new System.Drawing.Size(432, 374); - this.tabPageMacro.TabIndex = 3; + this.tabPageMacro.Size = new System.Drawing.Size(520, 374); + this.tabPageMacro.TabIndex = 2; this.tabPageMacro.Text = "Macros"; this.tabPageMacro.UseVisualStyleBackColor = true; // @@ -495,7 +414,7 @@ this.listViewMacro.Location = new System.Drawing.Point(8, 8); this.listViewMacro.MultiSelect = false; this.listViewMacro.Name = "listViewMacro"; - this.listViewMacro.Size = new System.Drawing.Size(416, 328); + this.listViewMacro.Size = new System.Drawing.Size(504, 328); this.listViewMacro.TabIndex = 5; this.listViewMacro.UseCompatibleStateImageBehavior = false; this.listViewMacro.View = System.Windows.Forms.View.List; @@ -550,6 +469,75 @@ this.buttonEditMacro.UseVisualStyleBackColor = true; this.buttonEditMacro.Click += new System.EventHandler(this.buttonEditMacro_Click); // + // tabPageIRCommands + // + this.tabPageIRCommands.Controls.Add(this.listViewIR); + this.tabPageIRCommands.Controls.Add(this.buttonNewIR); + this.tabPageIRCommands.Controls.Add(this.buttonEditIR); + this.tabPageIRCommands.Controls.Add(this.buttonDeleteIR); + this.tabPageIRCommands.Location = new System.Drawing.Point(4, 22); + this.tabPageIRCommands.Name = "tabPageIRCommands"; + this.tabPageIRCommands.Padding = new System.Windows.Forms.Padding(3); + this.tabPageIRCommands.Size = new System.Drawing.Size(520, 374); + this.tabPageIRCommands.TabIndex = 3; + this.tabPageIRCommands.Text = "IR Commands"; + this.tabPageIRCommands.UseVisualStyleBackColor = true; + // + // listViewIR + // + this.listViewIR.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.listViewIR.FullRowSelect = true; + this.listViewIR.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; + this.listViewIR.HideSelection = false; + this.listViewIR.LabelEdit = true; + this.listViewIR.Location = new System.Drawing.Point(8, 8); + this.listViewIR.MultiSelect = false; + this.listViewIR.Name = "listViewIR"; + this.listViewIR.Size = new System.Drawing.Size(504, 328); + this.listViewIR.TabIndex = 0; + this.listViewIR.UseCompatibleStateImageBehavior = false; + this.listViewIR.View = System.Windows.Forms.View.List; + this.listViewIR.DoubleClick += new System.EventHandler(this.listViewIR_DoubleClick); + this.listViewIR.AfterLabelEdit += new System.Windows.Forms.LabelEditEventHandler(this.listViewIR_AfterLabelEdit); + // + // buttonNewIR + // + this.buttonNewIR.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonNewIR.Location = new System.Drawing.Point(8, 344); + this.buttonNewIR.Name = "buttonNewIR"; + this.buttonNewIR.Size = new System.Drawing.Size(56, 24); + this.buttonNewIR.TabIndex = 1; + this.buttonNewIR.Text = "New"; + this.toolTip.SetToolTip(this.buttonNewIR, "Learn a new IR Command"); + this.buttonNewIR.UseVisualStyleBackColor = true; + this.buttonNewIR.Click += new System.EventHandler(this.buttonNewIR_Click); + // + // buttonEditIR + // + this.buttonEditIR.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonEditIR.Location = new System.Drawing.Point(72, 344); + this.buttonEditIR.Name = "buttonEditIR"; + this.buttonEditIR.Size = new System.Drawing.Size(56, 24); + this.buttonEditIR.TabIndex = 2; + this.buttonEditIR.Text = "Edit"; + this.toolTip.SetToolTip(this.buttonEditIR, "Re-Learn the currently selected IR Command"); + this.buttonEditIR.UseVisualStyleBackColor = true; + this.buttonEditIR.Click += new System.EventHandler(this.buttonEditIR_Click); + // + // buttonDeleteIR + // + this.buttonDeleteIR.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonDeleteIR.Location = new System.Drawing.Point(136, 344); + this.buttonDeleteIR.Name = "buttonDeleteIR"; + this.buttonDeleteIR.Size = new System.Drawing.Size(56, 24); + this.buttonDeleteIR.TabIndex = 3; + this.buttonDeleteIR.Text = "Delete"; + this.toolTip.SetToolTip(this.buttonDeleteIR, "Delete the currently selected IR Command"); + this.buttonDeleteIR.UseVisualStyleBackColor = true; + this.buttonDeleteIR.Click += new System.EventHandler(this.buttonDeleteIR_Click); + // // checkBoxAutoRun // this.checkBoxAutoRun.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); @@ -570,7 +558,7 @@ this.helpToolStripMenuItem}); this.menuStrip.Location = new System.Drawing.Point(0, 0); this.menuStrip.Name = "menuStrip"; - this.menuStrip.Size = new System.Drawing.Size(456, 24); + this.menuStrip.Size = new System.Drawing.Size(544, 24); this.menuStrip.TabIndex = 0; this.menuStrip.Text = "menuStrip"; // @@ -586,58 +574,58 @@ this.toolStripSeparator2, this.quitToolStripMenuItem}); this.configurationToolStripMenuItem.Name = "configurationToolStripMenuItem"; - this.configurationToolStripMenuItem.Size = new System.Drawing.Size(37, 20); + this.configurationToolStripMenuItem.Size = new System.Drawing.Size(35, 20); this.configurationToolStripMenuItem.Text = "&File"; // // newToolStripMenuItem // this.newToolStripMenuItem.Name = "newToolStripMenuItem"; - this.newToolStripMenuItem.Size = new System.Drawing.Size(122, 22); + this.newToolStripMenuItem.Size = new System.Drawing.Size(132, 22); this.newToolStripMenuItem.Text = "&New"; this.newToolStripMenuItem.Click += new System.EventHandler(this.newToolStripMenuItem_Click); // // openToolStripMenuItem // this.openToolStripMenuItem.Name = "openToolStripMenuItem"; - this.openToolStripMenuItem.Size = new System.Drawing.Size(122, 22); + this.openToolStripMenuItem.Size = new System.Drawing.Size(132, 22); this.openToolStripMenuItem.Text = "&Open ..."; this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click); // // importToolStripMenuItem // this.importToolStripMenuItem.Name = "importToolStripMenuItem"; - this.importToolStripMenuItem.Size = new System.Drawing.Size(122, 22); + this.importToolStripMenuItem.Size = new System.Drawing.Size(132, 22); this.importToolStripMenuItem.Text = "&Import ..."; this.importToolStripMenuItem.Click += new System.EventHandler(this.importToolStripMenuItem_Click); // // exportToolStripMenuItem // this.exportToolStripMenuItem.Name = "exportToolStripMenuItem"; - this.exportToolStripMenuItem.Size = new System.Drawing.Size(122, 22); + this.exportToolStripMenuItem.Size = new System.Drawing.Size(132, 22); this.exportToolStripMenuItem.Text = "&Export ..."; this.exportToolStripMenuItem.Click += new System.EventHandler(this.exportToolStripMenuItem_Click); // // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(119, 6); + this.toolStripSeparator1.Size = new System.Drawing.Size(129, 6); // // serverToolStripMenuItem // this.serverToolStripMenuItem.Name = "serverToolStripMenuItem"; - this.serverToolStripMenuItem.Size = new System.Drawing.Size(122, 22); + this.serverToolStripMenuItem.Size = new System.Drawing.Size(132, 22); this.serverToolStripMenuItem.Text = "&Server ..."; this.serverToolStripMenuItem.Click += new System.EventHandler(this.serverToolStripMenuItem_Click); // // toolStripSeparator2 // this.toolStripSeparator2.Name = "toolStripSeparator2"; - this.toolStripSeparator2.Size = new System.Drawing.Size(119, 6); + this.toolStripSeparator2.Size = new System.Drawing.Size(129, 6); // // quitToolStripMenuItem // this.quitToolStripMenuItem.Name = "quitToolStripMenuItem"; - this.quitToolStripMenuItem.Size = new System.Drawing.Size(122, 22); + this.quitToolStripMenuItem.Size = new System.Drawing.Size(132, 22); this.quitToolStripMenuItem.Text = "&Quit"; this.quitToolStripMenuItem.Click += new System.EventHandler(this.quitToolStripMenuItem_Click); // @@ -647,20 +635,20 @@ this.translatorHelpToolStripMenuItem, this.aboutToolStripMenuItem}); this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; - this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20); + this.helpToolStripMenuItem.Size = new System.Drawing.Size(40, 20); this.helpToolStripMenuItem.Text = "&Help"; // // translatorHelpToolStripMenuItem // this.translatorHelpToolStripMenuItem.Name = "translatorHelpToolStripMenuItem"; - this.translatorHelpToolStripMenuItem.Size = new System.Drawing.Size(122, 22); + this.translatorHelpToolStripMenuItem.Size = new System.Drawing.Size(129, 22); this.translatorHelpToolStripMenuItem.Text = "&Contents"; this.translatorHelpToolStripMenuItem.Click += new System.EventHandler(this.translatorHelpToolStripMenuItem_Click); // // aboutToolStripMenuItem // this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; - this.aboutToolStripMenuItem.Size = new System.Drawing.Size(122, 22); + this.aboutToolStripMenuItem.Size = new System.Drawing.Size(129, 22); this.aboutToolStripMenuItem.Text = "&About"; this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click); // @@ -679,26 +667,26 @@ this.AcceptButton = this.buttonOK; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(456, 472); - this.Controls.Add(this.checkBoxAutoRun); + this.ClientSize = new System.Drawing.Size(544, 472); this.Controls.Add(this.tabControl); this.Controls.Add(this.buttonOK); + this.Controls.Add(this.checkBoxAutoRun); this.Controls.Add(this.menuStrip); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MainMenuStrip = this.menuStrip; this.MinimizeBox = false; - this.MinimumSize = new System.Drawing.Size(472, 508); + this.MinimumSize = new System.Drawing.Size(472, 448); this.Name = "MainForm"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Translator"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing); this.Load += new System.EventHandler(this.MainForm_Load); - this.groupBoxProgram.ResumeLayout(false); this.tabControl.ResumeLayout(false); this.tabPagePrograms.ResumeLayout(false); this.tabPageEvents.ResumeLayout(false); - this.tabPageIRCommands.ResumeLayout(false); + this.contextMenuStripEvents.ResumeLayout(false); this.tabPageMacro.ResumeLayout(false); + this.tabPageIRCommands.ResumeLayout(false); this.menuStrip.ResumeLayout(false); this.menuStrip.PerformLayout(); this.ResumeLayout(false); @@ -708,18 +696,13 @@ #endregion - private System.Windows.Forms.ComboBox comboBoxProgram; - private System.Windows.Forms.GroupBox groupBoxProgram; - private System.Windows.Forms.Button buttonAddProgram; private System.Windows.Forms.ListView listViewButtons; private System.Windows.Forms.ColumnHeader columnHeaderButton; private System.Windows.Forms.ColumnHeader columnHeaderCommand; private System.Windows.Forms.Button buttonNew; private System.Windows.Forms.Button buttonModify; private System.Windows.Forms.Button buttonDelete; - private System.Windows.Forms.Button buttonRemoveProgram; private System.Windows.Forms.Button buttonClear; - private System.Windows.Forms.Button buttonEditProgram; private System.Windows.Forms.Button buttonOK; private System.Windows.Forms.TabControl tabControl; private System.Windows.Forms.TabPage tabPagePrograms; @@ -740,7 +723,7 @@ private System.Windows.Forms.ComboBox comboBoxEvents; private System.Windows.Forms.ListView listViewEventMap; private System.Windows.Forms.ColumnHeader columnHeaderEvent; - private System.Windows.Forms.ColumnHeader columnHeader1; + private System.Windows.Forms.ColumnHeader columnHeaderEventCommand; private System.Windows.Forms.Button buttonSetCommand; private System.Windows.Forms.Button buttonAddEvent; private System.Windows.Forms.Label labelCommand; @@ -762,6 +745,11 @@ private System.Windows.Forms.SaveFileDialog saveFileDialog; private System.Windows.Forms.ListView listViewIR; private System.Windows.Forms.ListView listViewMacro; + private System.Windows.Forms.ListView listViewPrograms; + private System.Windows.Forms.ImageList imageListPrograms; + private System.Windows.Forms.ContextMenuStrip contextMenuStripPrograms; + private System.Windows.Forms.ContextMenuStrip contextMenuStripEvents; + private System.Windows.Forms.ToolStripMenuItem removeEventToolStripMenuItem; } } Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2007-11-02 14:13:28 UTC (rev 1017) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2007-11-03 12:41:55 UTC (rev 1018) @@ -19,6 +19,12 @@ partial class MainForm : Form { + #region Constants + + const string SystemWide = "System Wide"; + + #endregion Constants + #region Enumerations /// <summary> @@ -87,6 +93,10 @@ #region Variables LearnIR _learnIR; + + ToolStripMenuItem _addProgramToolStripMenuItem; + ToolStripMenuItem _editProgramToolStripMenuItem; + ToolStripMenuItem _removeProgramToolStripMenuItem; #endregion Variables @@ -97,12 +107,16 @@ InitializeComponent(); RefreshProgramList(); + listViewPrograms.Items[0].Selected = true; + RefreshButtonList(); RefreshEventList(); RefreshEventCommands(); RefreshIRList(); RefreshMacroList(); + SetupProgramsContextMenu(); + try { checkBoxAutoRun.Checked = SystemRegistry.GetAutoRun("Translator"); @@ -114,14 +128,27 @@ void RefreshProgramList() { - comboBoxProgram.Items.Clear(); - comboBoxProgram.Items.Add("System wide"); + imageListPrograms.Images.Clear(); + imageListPrograms.Images.Add(Properties.Resources.WinLogo); + listViewPrograms.Items.Clear(); + + ListViewItem newItem = new ListViewItem(SystemWide, 0); + newItem.ToolTipText = "Defines mappings that effect the whole computer"; + listViewPrograms.Items.Add(newItem); + + int imageIndex = 1; foreach (ProgramSettings progSettings in Program.Config.Programs) - comboBoxProgram.Items.Add(progSettings.Name); + { + Icon icon = Win32.GetIconFor(progSettings.Filename); - comboBoxProgram.SelectedIndex = 0; + imageListPrograms.Images.Add(icon); + newItem = new ListViewItem(progSettings.Name, imageIndex++); + newItem.ToolTipText = progSettings.Filename; + listViewPrograms.Items.Add(newItem); + } + Program.UpdateNotifyMenu(); } void RefreshButtonList() @@ -210,14 +237,13 @@ List<ButtonMapping> GetCurrentSettings() { - string selectedItem = comboBoxProgram.SelectedItem as string; + if (listViewPrograms.SelectedItems.Count == 0) + return null; - if (selectedItem == null) + string selectedItem = listViewPrograms.SelectedItems[0].Text; + + if (selectedItem == SystemWide) { - return null; - } - else if (selectedItem == "System wide") - { return Program.Config.SystemWideMappings; } else @@ -230,6 +256,59 @@ return null; } + void SetupProgramsContextMenu() + { + _addProgramToolStripMenuItem = new ToolStripMenuItem("&Add Program", Properties.Resources.Plus, new EventHandler(addProgramToolStripMenuItem_Click)); + _editProgramToolStripMenuItem = new ToolStripMenuItem("&Edit Program", Properties.Resources.Edit, new EventHandler(editProgramToolStripMenuItem_Click)); + _removeProgramToolStripMenuItem = new ToolStripMenuItem("&Remove Program", Properties.Resources.Delete, new EventHandler(removeProgramToolStripMenuItem_Click)); + + contextMenuStripPrograms.Items.Add(_addProgramToolStripMenuItem); + contextMenuStripPrograms.Items.Add(_editProgramToolStripMenuItem); + contextMenuStripPrograms.Items.Add(_removeProgramToolStripMenuItem); + } + void RefreshProgramsContextMenu() + { + if (listViewPrograms.SelectedItems.Count == 0 || + listViewPrograms.SelectedItems[0].Text == SystemWide) + { + _editProgramToolStripMenuItem.Enabled = false; + _removeProgramToolStripMenuItem.Enabled = false; + } + else + { + _editProgramToolStripMenuItem.Enabled = true; + _removeProgramToolStripMenuItem.Enabled = true; + } + + if (listViewPrograms.SelectedItems.Count == 0) + { + _editProgramToolStripMenuItem.Text = "&Edit ..."; + _removeProgramToolStripMenuItem.Text = "&Remove ..."; + }/* + else if (listViewPrograms.SelectedItems[0].Text == SystemWide) + { + }*/ + else + { + string program = listViewPrograms.SelectedItems[0].Text; + _editProgramToolStripMenuItem.Text = "&Edit \"" + program + "\""; + _removeProgramToolStripMenuItem.Text = "&Remove \"" + program + "\""; + } + + } + + void AddProgram() + { + ProgramSettings progSettings = new ProgramSettings(); + + if (EditProgram(progSettings)) + { + Program.Config.Programs.Add(progSettings); + + RefreshProgramList(); + } + } + bool EditProgram(ProgramSettings progSettings) { EditProgramForm editProg = new EditProgramForm(progSettings); @@ -250,7 +329,27 @@ return false; } + bool EditProgram(string programName) + { + foreach (ProgramSettings progSettings in Program.Config.Programs) + { + if (progSettings.Name.Equals(programName)) + { + if (EditProgram(progSettings)) + { + RefreshProgramList(); + return true; + } + else + { + return false; + } + } + } + return false; + } + void EditIR() { if (listViewIR.SelectedItems.Count != 1) @@ -378,71 +477,6 @@ } } - private void comboBoxProgram_SelectedIndexChanged(object sender, EventArgs e) - { - if ((comboBoxProgram.SelectedItem as string) == "System wide") - { - buttonRemoveProgram.Enabled = false; - buttonEditProgram.Enabled = false; - } - else - { - buttonRemoveProgram.Enabled = true; - buttonEditProgram.Enabled = true; - } - - RefreshButtonList(); - } - - private void buttonAddProgram_Click(object sender, EventArgs e) - { - ProgramSettings progSettings = new ProgramSettings(); - - if (EditProgram(progSettings)) - { - // TODO: check for duplicates in Program.Config.Programs ... - - comboBoxProgram.Items.Add(progSettings.Name); - Program.Config.Programs.Add(progSettings); - comboBoxProgram.SelectedIndex = comboBoxProgram.Items.Count - 1; - } - } - private void buttonRemoveProgram_Click(object sender, EventArgs e) - { - ProgramSettings progSettings = null; - - foreach (ProgramSettings settings in Program.Config.Programs) - { - if (settings.Name == comboBoxProgram.SelectedItem as string) - { - progSettings = settings; - } - } - - if (progSettings != null) - { - if (MessageBox.Show(this, String.Format("Are you sure you want to remove all mappings for {0}?", progSettings.Name), String.Format("Remove {0}?", progSettings.Name), MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - Program.Config.Programs.Remove(progSettings); - comboBoxProgram.Items.Remove(comboBoxProgram.SelectedItem); - comboBoxProgram.SelectedIndex = 0; - - Program.UpdateNotifyMenu(); - } - } - } - private void buttonEditProgram_Click(object sender, EventArgs e) - { - foreach (ProgramSettings progSettings in Program.Config.Programs) - if (progSettings.Name == comboBoxProgram.SelectedItem as string) - if (EditProgram(progSettings)) - { - comboBoxProgram.Items.Remove(comboBoxProgram.SelectedItem); - comboBoxProgram.Items.Add(progSettings.Name); - comboBoxProgram.SelectedItem = progSettings.Name; - } - } - private void buttonNew_Click(object sender, EventArgs e) { GetKeyCodeForm getKeyCode = new GetKeyCodeForm(); @@ -716,16 +750,18 @@ return; } - if (!Common.IsValidFileName(e.Label)) + string name = e.Label.Trim(); + + if (!Common.IsValidFileName(name)) { - MessageBox.Show("File name not valid: " + e.Label, "Cannot rename, New file name not valid", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show("File name not valid: " + name, "Cannot rename, New file name not valid", MessageBoxButtons.OK, MessageBoxIcon.Error); e.CancelEdit = true; return; } try { - string newFileName = Common.FolderIRCommands + e.Label + Common.FileExtensionIR; + string newFileName = Common.FolderIRCommands + name + Common.FileExtensionIR; File.Move(oldFileName, newFileName); } @@ -760,16 +796,18 @@ return; } - if (!Common.IsValidFileName(e.Label)) + string name = e.Label.Trim(); + + if (!Common.IsValidFileName(name)) { - MessageBox.Show("File name not valid: " + e.Label, "Cannot rename, New file name not valid", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show("File name not valid: " + name, "Cannot rename, New file name not valid", MessageBoxButtons.OK, MessageBoxIcon.Error); e.CancelEdit = true; return; } try { - string newFileName = Program.FolderMacros + e.Label + Common.FileExtensionMacro; + string newFileName = Program.FolderMacros + name + Common.FileExtensionMacro; File.Move(oldFileName, newFileName); } @@ -790,11 +828,12 @@ private void buttonAddEvent_Click(object sender, EventArgs e) { - listViewEventMap.Items.Add( - new ListViewItem( - new string[] { comboBoxEvents.SelectedItem as string, String.Empty } - ) - ); + ListViewItem newItem = + new ListViewItem(new string[] { comboBoxEvents.SelectedItem as string, String.Empty }); + + listViewEventMap.SelectedIndices.Clear(); + listViewEventMap.Items.Add(newItem); + newItem.Selected = true; } private void buttonSetCommand_Click(object sender, EventArgs e) { @@ -870,7 +909,6 @@ foreach (ListViewItem listViewItem in listViewEventMap.SelectedItems) listViewEventMap.Items.Remove(listViewItem); } - private void listViewEventMap_DoubleClick(object sender, EventArgs e) { if (listViewEventMap.SelectedItems.Count != 1) @@ -936,6 +974,20 @@ listViewEventMap.SelectedItems[0].SubItems[1].Text = command; } + private void listViewPrograms_DoubleClick(object sender, EventArgs e) + { + if (listViewPrograms.SelectedItems.Count == 1 && listViewPrograms.SelectedItems[0].Text != SystemWide) + { + string selectedItem = listViewPrograms.SelectedItems[0].Text; + + EditProgram(selectedItem); + } + } + private void listViewPrograms_SelectedIndexChanged(object sender, EventArgs e) + { + RefreshButtonList(); + } + #endregion Controls #region Menu @@ -1034,6 +1086,55 @@ MessageBox.Show(this, "Translator\nVersion 1.0.3.5 for IR Server Suite\nBy Aaron Dinnage, 2007", "About Translator", MessageBoxButtons.OK, MessageBoxIcon.Information); } + private void addProgramToolStripMenuItem_Click(object sender, EventArgs e) + { + AddProgram(); + } + private void editProgramToolStripMenuItem_Click(object sender, EventArgs e) + { + if (listViewPrograms.SelectedItems.Count == 0) + return; + + stri... [truncated message content] |