From: <an...@us...> - 2008-03-05 06:14:55
|
Revision: 1427 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1427&view=rev Author: and-81 Date: 2008-03-04 22:14:54 -0800 (Tue, 04 Mar 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Abstractor/Abstractor.csproj trunk/plugins/IR Server Suite/Applications/Abstractor/MainForm.Designer.cs trunk/plugins/IR Server Suite/Applications/Abstractor/MainForm.cs trunk/plugins/IR Server Suite/Applications/Abstractor/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Program.cs trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/IR Server/Advanced.Designer.cs trunk/plugins/IR Server Suite/Applications/IR Server/Advanced.cs trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/GetKeyCodeForm.Designer.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/GetKeyCodeForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/LearnIR.Designer.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/LearnIR.cs trunk/plugins/IR Server Suite/Input Service/Input Service/InputService.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/Config.cs trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Program.cs Added Paths: ----------- trunk/plugins/IR Server Suite/Applications/Abstractor/Icon.ico Modified: trunk/plugins/IR Server Suite/Applications/Abstractor/Abstractor.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/Abstractor/Abstractor.csproj 2008-03-04 21:02:55 UTC (rev 1426) +++ trunk/plugins/IR Server Suite/Applications/Abstractor/Abstractor.csproj 2008-03-05 06:14:54 UTC (rev 1427) @@ -10,6 +10,7 @@ <RootNamespace>Abstractor</RootNamespace> <AssemblyName>Abstractor</AssemblyName> <StartupObject>Abstractor.Program</StartupObject> + <ApplicationIcon>Icon.ico</ApplicationIcon> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> @@ -64,6 +65,9 @@ <Name>IrssUtils</Name> </ProjectReference> </ItemGroup> + <ItemGroup> + <Content Include="Icon.ico" /> + </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/Abstractor/Icon.ico =================================================================== (Binary files differ) Property changes on: trunk/plugins/IR Server Suite/Applications/Abstractor/Icon.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/plugins/IR Server Suite/Applications/Abstractor/MainForm.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Abstractor/MainForm.Designer.cs 2008-03-04 21:02:55 UTC (rev 1426) +++ trunk/plugins/IR Server Suite/Applications/Abstractor/MainForm.Designer.cs 2008-03-05 06:14:54 UTC (rev 1427) @@ -36,6 +36,7 @@ this.groupBoxStatus = new System.Windows.Forms.GroupBox(); this.listBoxStatus = new System.Windows.Forms.ListBox(); this.groupBoxMapAbstract = new System.Windows.Forms.GroupBox(); + this.checkBoxToggle = new System.Windows.Forms.CheckBox(); this.buttonClear = new System.Windows.Forms.Button(); this.buttonLoad = new System.Windows.Forms.Button(); this.buttonSave = new System.Windows.Forms.Button(); @@ -46,8 +47,6 @@ this.listViewButtonMap = new System.Windows.Forms.ListView(); this.columnHeaderAbstractButton = new System.Windows.Forms.ColumnHeader(); this.columnHeaderKeyCode = new System.Windows.Forms.ColumnHeader(); - this.checkBoxToggle = new System.Windows.Forms.CheckBox(); - this.checkBoxForwardAbstract = new System.Windows.Forms.CheckBox(); this.groupBoxSetup.SuspendLayout(); this.groupBoxStatus.SuspendLayout(); this.groupBoxMapAbstract.SuspendLayout(); @@ -92,7 +91,7 @@ // // buttonConnect // - this.buttonConnect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonConnect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.buttonConnect.Location = new System.Drawing.Point(264, 32); this.buttonConnect.Name = "buttonConnect"; this.buttonConnect.Size = new System.Drawing.Size(80, 24); @@ -103,7 +102,7 @@ // // buttonDisconnect // - this.buttonDisconnect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonDisconnect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.buttonDisconnect.Location = new System.Drawing.Point(352, 32); this.buttonDisconnect.Name = "buttonDisconnect"; this.buttonDisconnect.Size = new System.Drawing.Size(80, 24); @@ -117,9 +116,9 @@ this.groupBoxStatus.Anchor = ((System.Windows.Forms.AnchorStyles)(((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, 344); + this.groupBoxStatus.Location = new System.Drawing.Point(8, 424); this.groupBoxStatus.Name = "groupBoxStatus"; - this.groupBoxStatus.Size = new System.Drawing.Size(440, 192); + this.groupBoxStatus.Size = new System.Drawing.Size(440, 136); this.groupBoxStatus.TabIndex = 2; this.groupBoxStatus.TabStop = false; this.groupBoxStatus.Text = "Status"; @@ -135,7 +134,7 @@ 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, 168); + this.listBoxStatus.Size = new System.Drawing.Size(424, 112); this.listBoxStatus.TabIndex = 0; // // groupBoxMapAbstract @@ -154,15 +153,26 @@ this.groupBoxMapAbstract.Controls.Add(this.listViewButtonMap); this.groupBoxMapAbstract.Location = new System.Drawing.Point(8, 80); this.groupBoxMapAbstract.Name = "groupBoxMapAbstract"; - this.groupBoxMapAbstract.Size = new System.Drawing.Size(440, 256); + this.groupBoxMapAbstract.Size = new System.Drawing.Size(440, 336); this.groupBoxMapAbstract.TabIndex = 1; this.groupBoxMapAbstract.TabStop = false; this.groupBoxMapAbstract.Text = "Abstract Remote Map"; // + // checkBoxToggle + // + this.checkBoxToggle.Anchor = System.Windows.Forms.AnchorStyles.Bottom; + this.checkBoxToggle.Location = new System.Drawing.Point(96, 304); + this.checkBoxToggle.Name = "checkBoxToggle"; + this.checkBoxToggle.Size = new System.Drawing.Size(160, 24); + this.checkBoxToggle.TabIndex = 6; + this.checkBoxToggle.Text = "Remote uses Toggle codes"; + this.checkBoxToggle.UseVisualStyleBackColor = true; + this.checkBoxToggle.Visible = false; + // // buttonClear // this.buttonClear.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.buttonClear.Location = new System.Drawing.Point(8, 224); + this.buttonClear.Location = new System.Drawing.Point(8, 304); this.buttonClear.Name = "buttonClear"; this.buttonClear.Size = new System.Drawing.Size(80, 24); this.buttonClear.TabIndex = 5; @@ -173,7 +183,7 @@ // buttonLoad // this.buttonLoad.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonLoad.Location = new System.Drawing.Point(264, 224); + this.buttonLoad.Location = new System.Drawing.Point(264, 304); this.buttonLoad.Name = "buttonLoad"; this.buttonLoad.Size = new System.Drawing.Size(80, 24); this.buttonLoad.TabIndex = 7; @@ -184,7 +194,7 @@ // buttonSave // this.buttonSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonSave.Location = new System.Drawing.Point(352, 224); + this.buttonSave.Location = new System.Drawing.Point(352, 304); this.buttonSave.Name = "buttonSave"; this.buttonSave.Size = new System.Drawing.Size(80, 24); this.buttonSave.TabIndex = 8; @@ -194,6 +204,7 @@ // // labelDevice // + this.labelDevice.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.labelDevice.Location = new System.Drawing.Point(232, 24); this.labelDevice.Name = "labelDevice"; this.labelDevice.Size = new System.Drawing.Size(72, 20); @@ -210,11 +221,14 @@ // // comboBoxDevice // + this.comboBoxDevice.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.comboBoxDevice.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxDevice.FormattingEnabled = true; this.comboBoxDevice.Location = new System.Drawing.Point(304, 24); this.comboBoxDevice.Name = "comboBoxDevice"; this.comboBoxDevice.Size = new System.Drawing.Size(128, 21); this.comboBoxDevice.TabIndex = 3; + this.comboBoxDevice.SelectedIndexChanged += new System.EventHandler(this.comboBoxDevice_SelectedIndexChanged); // // textBoxRemoteName // @@ -238,7 +252,7 @@ this.listViewButtonMap.Location = new System.Drawing.Point(8, 48); this.listViewButtonMap.MultiSelect = false; this.listViewButtonMap.Name = "listViewButtonMap"; - this.listViewButtonMap.Size = new System.Drawing.Size(424, 168); + this.listViewButtonMap.Size = new System.Drawing.Size(424, 248); this.listViewButtonMap.TabIndex = 4; this.listViewButtonMap.UseCompatibleStateImageBehavior = false; this.listViewButtonMap.View = System.Windows.Forms.View.Details; @@ -254,38 +268,16 @@ this.columnHeaderKeyCode.Text = "KeyCode"; this.columnHeaderKeyCode.Width = 288; // - // checkBoxToggle - // - this.checkBoxToggle.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.checkBoxToggle.Location = new System.Drawing.Point(96, 224); - this.checkBoxToggle.Name = "checkBoxToggle"; - this.checkBoxToggle.Size = new System.Drawing.Size(160, 24); - this.checkBoxToggle.TabIndex = 6; - this.checkBoxToggle.Text = "Remote uses Toggle codes"; - this.checkBoxToggle.UseVisualStyleBackColor = true; - this.checkBoxToggle.Visible = false; - // - // checkBoxForwardAbstract - // - this.checkBoxForwardAbstract.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.checkBoxForwardAbstract.Location = new System.Drawing.Point(8, 544); - this.checkBoxForwardAbstract.Name = "checkBoxForwardAbstract"; - this.checkBoxForwardAbstract.Size = new System.Drawing.Size(168, 24); - this.checkBoxForwardAbstract.TabIndex = 3; - this.checkBoxForwardAbstract.Text = "Forward abstract buttons"; - this.checkBoxForwardAbstract.UseVisualStyleBackColor = true; - // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(456, 569); - this.Controls.Add(this.checkBoxForwardAbstract); this.Controls.Add(this.groupBoxMapAbstract); this.Controls.Add(this.groupBoxSetup); this.Controls.Add(this.groupBoxStatus); this.Name = "MainForm"; - this.Text = "Abstractor"; + this.Text = "Abstract Remote Map Creator"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing); this.groupBoxSetup.ResumeLayout(false); this.groupBoxStatus.ResumeLayout(false); @@ -316,7 +308,6 @@ private System.Windows.Forms.ColumnHeader columnHeaderAbstractButton; private System.Windows.Forms.ColumnHeader columnHeaderKeyCode; private System.Windows.Forms.CheckBox checkBoxToggle; - private System.Windows.Forms.CheckBox checkBoxForwardAbstract; } } Modified: trunk/plugins/IR Server Suite/Applications/Abstractor/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Abstractor/MainForm.cs 2008-03-04 21:02:55 UTC (rev 1426) +++ trunk/plugins/IR Server Suite/Applications/Abstractor/MainForm.cs 2008-03-05 06:14:54 UTC (rev 1427) @@ -98,6 +98,10 @@ "Page Down" };*/ + static readonly string AbstractRemoteMapFolder = Path.Combine(Common.FolderAppData, "Input Service\\Abstract Remote Maps"); + static readonly string AbstractRemoteSchemaFile = Path.Combine(Common.FolderAppData, "Input Service\\Abstract Remote Maps\\RemoteTable.xsd"); + + public enum AbstractButton { Up, @@ -180,7 +184,7 @@ IRServerInfo _irServerInfo = new IRServerInfo(); - DataSet _abstractRemoteButtons; + string _selectedDevice; #endregion Variables @@ -230,7 +234,6 @@ ClearMap(); /* - DataTable table = new DataTable("RemoteTable"); DataColumn column; @@ -259,26 +262,10 @@ table.Rows.Add(button.ToString(), name); } - //table.WriteXmlSchema("RemoteTable.xsd"); + //table.WriteXmlSchema(AbstractRemoteSchemaFile); - table.WriteXml("Microsoft MCE.xml"); - table.WriteXml("XBCDRC.xml"); - - */ - - //_abstractRemoteButtons = new DataSet("AbstractRemoteButtons"); - //_abstractRemoteButtons.CaseSensitive = true; - - //_abstractRemoteButtons.ReadXmlSchema("RemoteTable.xsd"); - - - //_abstractRemoteButtons.Tables.Add(table); - //_abstractRemoteButtons.Tables.Add(table); - - - //_lookupTable.WriteXmlSchema("Abstract Remote Model 0.1.xsd"); - //_lookupTable.WriteXml("Abstract Remote Button List.xml", XmlWriteMode.WriteSchema); - //_abstractRemoteButtons.WriteXml("Abstract Remote Button List.xml", XmlWriteMode.WriteSchema); + table.WriteXml("Template.xml"); + */ } private void MainForm_FormClosing(object sender, FormClosingEventArgs e) @@ -306,9 +293,6 @@ _registered = true; _irServerInfo = IRServerInfo.FromBytes(received.GetDataAsBytes()); - _abstractRemoteButtons = new DataSet("AbstractRemoteButtons"); - _abstractRemoteButtons.CaseSensitive = true; - _client.Send(new IrssMessage(MessageType.ActiveReceivers, MessageFlags.Request)); _client.Send(new IrssMessage(MessageType.ActiveBlasters, MessageFlags.Request)); } @@ -328,8 +312,6 @@ string[] receivers = received.GetDataAsString().Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); this.Invoke(_setDevices, new Object[] { receivers }); - - LoadDeviceFiles(receivers); break; case MessageType.RemoteEvent: @@ -363,7 +345,7 @@ this.Invoke(_addStatusLine, text); // If this remote event matches the criteria then set it to an abstract button in the list view ... - if (deviceName.Equals(comboBoxDevice.Text, StringComparison.OrdinalIgnoreCase)) + if (deviceName.Equals(_selectedDevice, StringComparison.OrdinalIgnoreCase)) { if (listViewButtonMap.SelectedItems.Count == 1) { @@ -387,34 +369,6 @@ } } } - - // Determine abstract button details ... - string abstractButton = LookupAbstractButton(deviceName, keyCode); - - bool isAbstract = true; - if (String.IsNullOrEmpty(abstractButton)) - { - isAbstract = false; - abstractButton = String.Format("{0} ({1})", deviceName, keyCode); - } - - string abstractText = String.Format("Button: {0}", abstractButton); - this.Invoke(_addStatusLine, abstractText); - - if (checkBoxForwardAbstract.Checked && isAbstract) - { - byte[] deviceNameBytes = Encoding.ASCII.GetBytes("Abstract"); - byte[] keyCodeBytes = Encoding.ASCII.GetBytes(abstractButton); - - byte[] bytes = new byte[8 + deviceNameBytes.Length + keyCodeBytes.Length]; - - BitConverter.GetBytes(deviceNameBytes.Length).CopyTo(bytes, 0); - deviceNameBytes.CopyTo(bytes, 4); - BitConverter.GetBytes(keyCodeBytes.Length).CopyTo(bytes, 4 + deviceNameBytes.Length); - keyCodeBytes.CopyTo(bytes, 8 + deviceNameBytes.Length); - - _client.Send(new IrssMessage(MessageType.ForwardRemoteEvent, MessageFlags.Request, bytes)); - } } void CommsFailure(object obj) @@ -524,67 +478,6 @@ } } - string LookupAbstractButton(string deviceName, string keyCode) - { - foreach (DataTable table in _abstractRemoteButtons.Tables) - { - string device = table.ExtendedProperties["Device"] as string; - - if (device.Equals(deviceName, StringComparison.OrdinalIgnoreCase)) - { - string expression = String.Format("RawCode = '{0}'", keyCode); - - DataRow[] rows = table.Select(expression); - if (rows.Length == 1) - { - string button = rows[0]["AbstractButton"].ToString() as string; - if (!String.IsNullOrEmpty(button)) - { -#if TRACE - Trace.WriteLine(button + ", remote: " + table.ExtendedProperties["Remote"] as string + ", device: " + deviceName); -#endif - return button; - } - } - } - } - - return null; - //return String.Format("{0} ({1})", deviceName, keyCode); - } - - - void LoadDeviceFiles(string[] devices) - { - foreach (string device in devices) - { - string[] files = Directory.GetFiles(device, "*.xml", SearchOption.TopDirectoryOnly); - foreach (string file in files) - { - string remote = Path.GetFileNameWithoutExtension(file); - this.Invoke(_addStatusLine, String.Format("Loading {0} remote map \"{1}\"", device, remote)); - - string tableName = String.Format("{0}:{1}", device, remote); - - if (_abstractRemoteButtons.Tables.Contains(tableName)) - { - this.Invoke(_addStatusLine, "Table already loaded"); - continue; - } - - DataTable table = _abstractRemoteButtons.Tables.Add("RemoteTable"); - table.ReadXmlSchema("RemoteTable.xsd"); - table.ReadXml(file); - - - table.ExtendedProperties.Add("Device", device); - table.ExtendedProperties.Add("Remote", remote); - - table.TableName = tableName; - } - } - } - private void buttonClear_Click(object sender, EventArgs e) { ClearMap(); @@ -615,19 +508,18 @@ return; } - string device = comboBoxDevice.Text; + string directory = Path.Combine(AbstractRemoteMapFolder, _selectedDevice); - if (!Directory.Exists(device)) - Directory.CreateDirectory(device); + if (!Directory.Exists(directory)) + Directory.CreateDirectory(directory); string fileName = Path.ChangeExtension(textBoxRemoteName.Text, ".xml"); + string path = Path.Combine(directory, fileName); - string path = Path.Combine(device, fileName); - this.Invoke(_addStatusLine, String.Format("Writing to file \"{0}\"", path)); DataTable table = new DataTable("RemoteTable"); - table.ReadXmlSchema("RemoteTable.xsd"); + table.ReadXmlSchema(AbstractRemoteSchemaFile); foreach (ListViewItem item in listViewButtonMap.Items) { @@ -641,27 +533,24 @@ { if (String.IsNullOrEmpty(textBoxRemoteName.Text)) { - MessageBox.Show(this, "You must include a remote name before saving", "Missing remote name", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show(this, "You must include a remote name to load", "Missing remote name", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } - string device = comboBoxDevice.Text; - string fileName = Path.ChangeExtension(textBoxRemoteName.Text, ".xml"); + string directory = Path.Combine(AbstractRemoteMapFolder, _selectedDevice); + string path = Path.Combine(directory, fileName); - string path = Path.Combine(device, fileName); - if (!File.Exists(path)) { - MessageBox.Show(this, String.Format("Remote file not found ({0}) in device folder ({1})", fileName, device), "Remote file not found", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show(this, String.Format("Remote file not found ({0}) in device folder ({1})", fileName, _selectedDevice), "Remote file not found", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } - this.Invoke(_addStatusLine, String.Format("Reading from file \"{0}\"", path)); + this.Invoke(_addStatusLine, String.Format("Reading remote from file \"{0}\" (device: {1})", fileName, _selectedDevice)); DataTable table = new DataTable("RemoteTable"); - table.ReadXmlSchema("RemoteTable.xsd"); - + table.ReadXmlSchema(AbstractRemoteSchemaFile); table.ReadXml(path); string[] abstractButtons = Enum.GetNames(typeof(AbstractButton)); @@ -683,7 +572,7 @@ private void listViewButtonMap_KeyDown(object sender, KeyEventArgs e) { - if (e.KeyCode == Keys.Space) + if (e.KeyCode == Keys.Delete) { if (listViewButtonMap.SelectedItems.Count == 1) { @@ -692,7 +581,12 @@ } } + private void comboBoxDevice_SelectedIndexChanged(object sender, EventArgs e) + { + _selectedDevice = comboBoxDevice.Text; + } + } } Modified: trunk/plugins/IR Server Suite/Applications/Abstractor/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Abstractor/Properties/AssemblyInfo.cs 2008-03-04 21:02:55 UTC (rev 1426) +++ trunk/plugins/IR Server Suite/Applications/Abstractor/Properties/AssemblyInfo.cs 2008-03-05 06:14:54 UTC (rev 1427) @@ -1,4 +1,5 @@ -using System.Reflection; +using System; +using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -6,11 +7,11 @@ // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Abstractor")] -[assembly: AssemblyDescription("")] +[assembly: AssemblyDescription("Abstract Remote Map Creator")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] +[assembly: AssemblyCompany("and-81")] [assembly: AssemblyProduct("Abstractor")] -[assembly: AssemblyCopyright("Copyright © 2008")] +[assembly: AssemblyCopyright("Aaron Dinnage")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -31,3 +32,5 @@ // [assembly: AssemblyVersion("1.0.4.2")] [assembly: AssemblyFileVersion("1.0.4.2")] + +[assembly: CLSCompliant(true)] Modified: trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Program.cs 2008-03-04 21:02:55 UTC (rev 1426) +++ trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Program.cs 2008-03-05 06:14:54 UTC (rev 1427) @@ -35,7 +35,7 @@ internal const string UrlPrefix = "http://"; internal static readonly string ConfigurationFile = Path.Combine(Common.FolderAppData, "Dbox Tuner\\Dbox Tuner.xml"); - internal static readonly string DataFile = Path.Combine(Common.FolderAppData, "Dbox Tuner\\Data.xml"); + internal static readonly string DataFile = Path.Combine(Common.FolderAppData, "Dbox Tuner\\Data.xml"); #endregion Constants Modified: trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Properties/AssemblyInfo.cs 2008-03-04 21:02:55 UTC (rev 1426) +++ trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Properties/AssemblyInfo.cs 2008-03-05 06:14:54 UTC (rev 1427) @@ -3,35 +3,33 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// Allgemeine Informationen über eine Assembly werden über die folgenden -// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, -// die mit einer Assembly verknüpft sind. +// 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("Dbox Tuner")] [assembly: AssemblyDescription("Tune channels on a Dreambox - based on Mark Koenig's MediaPortal plugin")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] +[assembly: AssemblyCompany("and-81")] [assembly: AssemblyProduct("Dbox Tuner")] -[assembly: AssemblyCopyright("and-81")] +[assembly: AssemblyCopyright("Aaron Dinnage")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar -// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von -// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest. +// 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)] -// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird +// The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("C4021B4F-1451-4a84-BF3B-213C254290D8")] -// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: +// Version information for an assembly consists of the following four values: // -// Hauptversion -// Nebenversion -// Buildnummer +// Major Version +// Minor Version +// Build Number // Revision // -// Sie können alle Werte angeben oder die standardmäßigen Revisions- und Buildnummern -// übernehmen, indem Sie "*" eingeben: [assembly: AssemblyVersion("1.0.4.2")] [assembly: AssemblyFileVersion("1.0.4.2")] Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Advanced.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Advanced.Designer.cs 2008-03-04 21:02:55 UTC (rev 1426) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Advanced.Designer.cs 2008-03-05 06:14:54 UTC (rev 1427) @@ -39,6 +39,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.checkBoxAbstractRemoteMode = new System.Windows.Forms.CheckBox(); this.groupBoxMode.SuspendLayout(); this.SuspendLayout(); // @@ -125,7 +126,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(328, 144); + this.buttonCancel.Location = new System.Drawing.Point(328, 136); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(64, 24); this.buttonCancel.TabIndex = 2; @@ -136,7 +137,7 @@ // 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(256, 144); + this.buttonOK.Location = new System.Drawing.Point(256, 136); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(64, 24); this.buttonOK.TabIndex = 1; @@ -144,24 +145,39 @@ this.buttonOK.UseVisualStyleBackColor = true; this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); // + // checkBoxAbstractRemoteMode + // + this.checkBoxAbstractRemoteMode.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.checkBoxAbstractRemoteMode.AutoSize = true; + this.checkBoxAbstractRemoteMode.Location = new System.Drawing.Point(8, 136); + this.checkBoxAbstractRemoteMode.Name = "checkBoxAbstractRemoteMode"; + this.checkBoxAbstractRemoteMode.Size = new System.Drawing.Size(159, 17); + this.checkBoxAbstractRemoteMode.TabIndex = 3; + this.checkBoxAbstractRemoteMode.Text = "Use Abstract Remote Model"; + this.toolTips.SetToolTip(this.checkBoxAbstractRemoteMode, "Enable automatic abstract remote model translation"); + this.checkBoxAbstractRemoteMode.UseVisualStyleBackColor = true; + // // Advanced // 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(402, 177); + this.ClientSize = new System.Drawing.Size(398, 167); + this.Controls.Add(this.checkBoxAbstractRemoteMode); this.Controls.Add(this.buttonCancel); this.Controls.Add(this.buttonOK); this.Controls.Add(this.groupBoxMode); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MinimumSize = new System.Drawing.Size(418, 213); + this.MinimumSize = new System.Drawing.Size(406, 194); this.Name = "Advanced"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "IR Server - Advanced Configuration"; this.groupBoxMode.ResumeLayout(false); this.groupBoxMode.PerformLayout(); this.ResumeLayout(false); + this.PerformLayout(); } @@ -176,5 +192,6 @@ private System.Windows.Forms.Button buttonCancel; private System.Windows.Forms.Button buttonOK; private System.Windows.Forms.ToolTip toolTips; + private System.Windows.Forms.CheckBox checkBoxAbstractRemoteMode; } } \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Advanced.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Advanced.cs 2008-03-04 21:02:55 UTC (rev 1426) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Advanced.cs 2008-03-05 06:14:54 UTC (rev 1427) @@ -17,6 +17,11 @@ #region Properties + public bool AbstractRemoteMode + { + get { return checkBoxAbstractRemoteMode.Checked; } + set { checkBoxAbstractRemoteMode.Checked = value; } + } public IRServerMode Mode { get Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs 2008-03-04 21:02:55 UTC (rev 1426) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs 2008-03-05 06:14:54 UTC (rev 1427) @@ -4,6 +4,7 @@ using System.ComponentModel; using System.Data; using System.Drawing; +using System.IO; using System.Runtime.InteropServices; using System.Security; using System.Text; @@ -18,10 +19,21 @@ partial class Config : Form { + #region Constants + + const int ColIcon = 0; + const int ColName = 1; + const int ColReceive = 2; + const int ColTransmit = 3; + const int ColConfigure = 4; + + #endregion Constants + #region Variables PluginBase[] _transceivers; + bool _abstractRemoteMode; IRServerMode _mode = IRServerMode.ServerMode; string _hostComputer = String.Empty; @@ -29,6 +41,11 @@ #region Properties + public bool AbstractRemoteMode + { + get { return _abstractRemoteMode; } + set { _abstractRemoteMode = value; } + } public IRServerMode Mode { get { return _mode; } @@ -122,13 +139,9 @@ // Add transceivers to list ... _transceivers = Program.AvailablePlugins(); if (_transceivers == null || _transceivers.Length == 0) - { MessageBox.Show(this, "No IR Server Plugins found!", "IR Server Configuration", MessageBoxButtons.OK, MessageBoxIcon.Error); - } else - { CreateGrid(); - } try { @@ -147,33 +160,28 @@ void CreateGrid() { int row = 0; + gridPlugins.Rows.Clear(); + gridPlugins.Columns.SetCount(5); - gridPlugins.Columns.SetCount(4); - + // Setup Column Headers gridPlugins.Rows.Insert(row); - SourceGrid.Cells.ColumnHeader headerCell; - - headerCell = new SourceGrid.Cells.ColumnHeader("Name"); - gridPlugins[row, 0] = headerCell; - - headerCell = new SourceGrid.Cells.ColumnHeader("Receive"); - gridPlugins[row, 1] = headerCell; - - headerCell = new SourceGrid.Cells.ColumnHeader("Transmit"); - gridPlugins[row, 2] = headerCell; - - headerCell = new SourceGrid.Cells.ColumnHeader("Configure"); - gridPlugins[row, 3] = headerCell; - + gridPlugins[row, ColIcon] = new SourceGrid.Cells.ColumnHeader("*"); + gridPlugins[row, ColName] = new SourceGrid.Cells.ColumnHeader("Name"); + gridPlugins[row, ColReceive] = new SourceGrid.Cells.ColumnHeader("Receive"); + gridPlugins[row, ColTransmit] = new SourceGrid.Cells.ColumnHeader("Transmit"); + gridPlugins[row, ColConfigure] = new SourceGrid.Cells.ColumnHeader("Configure"); gridPlugins.FixedRows = 1; - row++; - foreach (PluginBase transceiver in _transceivers) { - gridPlugins.Rows.Insert(row); + gridPlugins.Rows.Insert(++row); + gridPlugins.Rows[row].Tag = transceiver; + // TODO: Icon Cell + gridPlugins[row, ColIcon] = new SourceGrid.Cells.Cell(); + + // Name Cell SourceGrid.Cells.Cell nameCell = new SourceGrid.Cells.Cell(transceiver.Name); SourceGrid.Cells.Controllers.CustomEvents nameCellController = new SourceGrid.Cells.Controllers.CustomEvents(); @@ -181,23 +189,21 @@ nameCell.AddController(nameCellController); nameCell.AddController(new SourceGrid.Cells.Controllers.ToolTipText()); - nameCell.ToolTipText = string.Format("{0}\nVersion: {1}\nAuthor: {2}\n{3}", transceiver.Name, transceiver.Version, transceiver.Author, transceiver.Description); + nameCell.ToolTipText = String.Format("{0}\nVersion: {1}\nAuthor: {2}\n{3}", transceiver.Name, transceiver.Version, transceiver.Author, transceiver.Description); - gridPlugins[row, 0] = nameCell; + gridPlugins[row, ColName] = nameCell; + // Receive Cell 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); - - gridPlugins[row, 1] = checkbox; + gridPlugins[row, ColReceive] = new SourceGrid.Cells.CheckBox(); } else - gridPlugins[row, 1] = new SourceGrid.Cells.Cell(); + { + gridPlugins[row, ColReceive] = new SourceGrid.Cells.Cell(); + } + // Transmit Cell if (transceiver is ITransmitIR) { SourceGrid.Cells.CheckBox checkbox = new SourceGrid.Cells.CheckBox(); @@ -206,11 +212,14 @@ checkboxcontroller.ValueChanged += new EventHandler(TransmitChanged); checkbox.Controller.AddController(checkboxcontroller); - gridPlugins[row, 2] = checkbox; + gridPlugins[row, ColTransmit] = checkbox; } else - gridPlugins[row, 2] = new SourceGrid.Cells.Cell(); + { + gridPlugins[row, ColTransmit] = new SourceGrid.Cells.Cell(); + } + // Configure Cell if (transceiver is IConfigure) { SourceGrid.Cells.Button button = new SourceGrid.Cells.Button("Configure"); @@ -219,19 +228,20 @@ buttonClickEvent.Executed += new EventHandler(buttonClickEvent_Executed); button.Controller.AddController(buttonClickEvent); - gridPlugins[row, 3] = button; + gridPlugins[row, ColConfigure] = button; } else - gridPlugins[row, 3] = new SourceGrid.Cells.Cell(); - - row++; + { + gridPlugins[row, ColConfigure] = new SourceGrid.Cells.Cell(); + } } - gridPlugins.Columns[0].AutoSizeMode = SourceGrid.AutoSizeMode.Default; - gridPlugins.Columns[1].AutoSizeMode = SourceGrid.AutoSizeMode.EnableAutoSize; - gridPlugins.Columns[2].AutoSizeMode = SourceGrid.AutoSizeMode.EnableAutoSize; - gridPlugins.Columns[3].AutoSizeMode = SourceGrid.AutoSizeMode.EnableAutoSize; - gridPlugins.AutoStretchColumnsToFitWidth = true; + gridPlugins.Columns[ColIcon].AutoSizeMode = SourceGrid.AutoSizeMode.EnableAutoSize; + gridPlugins.Columns[ColName].AutoSizeMode = SourceGrid.AutoSizeMode.Default; + gridPlugins.Columns[ColReceive].AutoSizeMode = SourceGrid.AutoSizeMode.EnableAutoSize; + gridPlugins.Columns[ColTransmit].AutoSizeMode = SourceGrid.AutoSizeMode.EnableAutoSize; + gridPlugins.Columns[ColConfigure].AutoSizeMode = SourceGrid.AutoSizeMode.EnableAutoSize; + gridPlugins.AutoStretchColumnsToFitWidth = true; gridPlugins.AutoSizeCells(); } @@ -265,31 +275,10 @@ SourceGrid.CellContext context = (SourceGrid.CellContext)sender; SourceGrid.Cells.Button cell = (SourceGrid.Cells.Button)context.Cell; - string plugin = gridPlugins[cell.Row.Index, 0].DisplayText; - - foreach (PluginBase transceiver in _transceivers) - if (transceiver.Name.Equals(plugin, StringComparison.OrdinalIgnoreCase)) - (transceiver as IConfigure).Configure(this); + IConfigure plugin = cell.Row.Tag as IConfigure; + if (plugin != null) + plugin.Configure(this); } - /* - private void ReceiveChanged(object sender, EventArgs e) - { - SourceGrid.CellContext context = (SourceGrid.CellContext)sender; - SourceGrid.Cells.CheckBox cell = (SourceGrid.Cells.CheckBox)context.Cell; - - if (!cell.Checked) - return; - - string plugin = gridPlugins[cell.Row.Index, 0].DisplayText; - - for (int row = 1; row < gridPlugins.RowsCount; row++) - { - SourceGrid.Cells.CheckBox checkBox = gridPlugins[row, 1] as SourceGrid.Cells.CheckBox; - if (checkBox != null && checkBox.Checked && !gridPlugins[row, 0].DisplayText.Equals(plugin, StringComparison.OrdinalIgnoreCase)) - checkBox.Checked = false; - } - } - */ private void TransmitChanged(object sender, EventArgs e) { SourceGrid.CellContext context = (SourceGrid.CellContext)sender; @@ -298,12 +287,13 @@ if (!cell.Checked) return; - string plugin = gridPlugins[cell.Row.Index, 0].DisplayText; + PluginBase plugin = cell.Row.Tag as PluginBase; for (int row = 1; row < gridPlugins.RowsCount; row++) { - SourceGrid.Cells.CheckBox checkBox = gridPlugins[row, 2] as SourceGrid.Cells.CheckBox; - if (checkBox != null && checkBox.Checked && !gridPlugins[row, 0].DisplayText.Equals(plugin, StringComparison.OrdinalIgnoreCase)) + SourceGrid.Cells.CheckBox checkBox = gridPlugins[row, ColTransmit] as SourceGrid.Cells.CheckBox; + + if (checkBox != null && checkBox.Checked && !gridPlugins[row, ColName].DisplayText.Equals(plugin.Name, StringComparison.OrdinalIgnoreCase)) checkBox.Checked = false; } } @@ -312,11 +302,11 @@ SourceGrid.CellContext context = (SourceGrid.CellContext)sender; SourceGrid.Cells.Cell cell = (SourceGrid.Cells.Cell)context.Cell; - SourceGrid.Cells.CheckBox checkBoxReceive = gridPlugins[cell.Row.Index, 1] as SourceGrid.Cells.CheckBox; + SourceGrid.Cells.CheckBox checkBoxReceive = gridPlugins[cell.Row.Index, ColReceive] as SourceGrid.Cells.CheckBox; if (checkBoxReceive != null) checkBoxReceive.Checked = true; - SourceGrid.Cells.CheckBox checkBoxTransmit = gridPlugins[cell.Row.Index, 2] as SourceGrid.Cells.CheckBox; + SourceGrid.Cells.CheckBox checkBoxTransmit = gridPlugins[cell.Row.Index, ColTransmit] as SourceGrid.Cells.CheckBox; if (checkBoxTransmit != null) checkBoxTransmit.Checked = true; } @@ -325,8 +315,8 @@ { try { - string helpFile = System.IO.Path.Combine(SystemRegistry.GetInstallFolder(), "IR Server Suite.chm"); - Help.ShowHelp(this, helpFile, HelpNavigator.Topic, "IR Server\\index.html"); + string file = Path.Combine(SystemRegistry.GetInstallFolder(), "IR Server Suite.chm"); + Help.ShowHelp(this, file, HelpNavigator.Topic, "IR Server\\index.html"); } catch (Exception ex) { @@ -337,14 +327,16 @@ private void buttonAdvanced_Click(object sender, EventArgs e) { Advanced advanced = new Advanced(); - - advanced.Mode = _mode; - advanced.HostComputer = _hostComputer; + advanced.AbstractRemoteMode = _abstractRemoteMode; + advanced.Mode = _mode; + advanced.HostComputer = _hostComputer; + if (advanced.ShowDialog(this) == DialogResult.OK) { - _mode = advanced.Mode; - _hostComputer = advanced.HostComputer; + _abstractRemoteMode = advanced.AbstractRemoteMode; + _mode = advanced.Mode; + _hostComputer = advanced.HostComputer; } } @@ -355,19 +347,17 @@ SourceGrid.Cells.CheckBox checkBox; for (int row = 1; row < gridPlugins.RowsCount; row++) { - string name = gridPlugins[row, 0].DisplayText; - - PluginBase plugin = Program.GetPlugin(name); + PluginBase plugin = gridPlugins.Rows[row].Tag as PluginBase; bool detected = plugin.Detect(); // Receive - checkBox = gridPlugins[row, 1] as SourceGrid.Cells.CheckBox; + checkBox = gridPlugins[row, ColReceive] as SourceGrid.Cells.CheckBox; if (checkBox != null) checkBox.Checked = detected; // Transmit - checkBox = gridPlugins[row, 2] as SourceGrid.Cells.CheckBox; + checkBox = gridPlugins[row, ColTransmit] as SourceGrid.Cells.CheckBox; if (checkBox != null) checkBox.Checked = detected; } Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/GetKeyCodeForm.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/GetKeyCodeForm.Designer.cs 2008-03-04 21:02:55 UTC (rev 1426) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/GetKeyCodeForm.Designer.cs 2008-03-05 06:14:54 UTC (rev 1427) @@ -37,6 +37,7 @@ // labelStatus // this.labelStatus.Dock = System.Windows.Forms.DockStyle.Fill; + this.labelStatus.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.labelStatus.Location = new System.Drawing.Point(0, 0); this.labelStatus.Name = "labelStatus"; this.labelStatus.Size = new System.Drawing.Size(288, 57); Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/GetKeyCodeForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/GetKeyCodeForm.cs 2008-03-04 21:02:55 UTC (rev 1426) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/GetKeyCodeForm.cs 2008-03-05 06:14:54 UTC (rev 1427) @@ -3,6 +3,7 @@ using System.Data; using System.Drawing; using System.Text; +using System.Threading; using System.Windows.Forms; using IrssComms; @@ -48,7 +49,8 @@ private void GetKeyCodeForm_Load(object sender, EventArgs e) { - labelStatus.Text = "Press the remote button to map"; + labelStatus.Text = "Press the remote button you want to map"; + labelStatus.ForeColor = Color.Blue; _keyCodeSet = new DelegateKeyCodeSet(KeyCodeSet); @@ -68,13 +70,6 @@ string keyCode = Encoding.ASCII.GetString(data, 8 + deviceNameSize, keyCodeSize); _keyCode = keyCode; - ///* - if (!deviceName.Equals("Abstract", StringComparison.OrdinalIgnoreCase)) - { - _keyCode = String.Format("{0} ({1})", deviceName, keyCode); - // TODO: REMOVE! - return; - }//*/ this.Invoke(_keyCodeSet); } @@ -83,15 +78,27 @@ void KeyCodeSet() { timer.Stop(); - Program.HandleMessage -= new ClientMessageSink(MessageReceiver); + labelStatus.Text = String.Format("Received: {0}", _keyCode); + labelStatus.ForeColor = Color.Green; + labelStatus.Update(); + + Thread.Sleep(1000); this.Close(); } private void timer_Tick(object sender, EventArgs e) { - KeyCodeSet(); + timer.Stop(); + Program.HandleMessage -= new ClientMessageSink(MessageReceiver); + + labelStatus.Text = "Timed out"; + labelStatus.ForeColor = Color.Red; + labelStatus.Update(); + + Thread.Sleep(2000); + this.Close(); } } Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2008-03-04 21:02:55 UTC (rev 1426) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2008-03-05 06:14:54 UTC (rev 1427) @@ -531,7 +531,7 @@ if (map.ShowDialog(this) == DialogResult.OK) { - if (existing == null) + if (existing == null) // Create new mapping { listViewButtons.Items.Add( new ListViewItem( @@ -540,7 +540,7 @@ currentMappings.Add(new ButtonMapping(map.KeyCode, map.Description, map.Command)); } - else + else // Replace existing mapping { for (int index = 0; index < listViewButtons.Items.Count; index++) { Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/LearnIR.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/LearnIR.Designer.cs 2008-03-04 21:02:55 UTC (rev 1426) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/LearnIR.Designer.cs 2008-03-05 06:14:54 UTC (rev 1427) @@ -30,16 +30,14 @@ private void InitializeComponent() { this.buttonDone = new System.Windows.Forms.Button(); - this.labelLearned = new System.Windows.Forms.Label(); this.buttonLearn = new System.Windows.Forms.Button(); this.labelName = new System.Windows.Forms.Label(); this.textBoxName = new System.Windows.Forms.TextBox(); this.buttonTest = new System.Windows.Forms.Button(); - this.groupBoxStatus = new System.Windows.Forms.GroupBox(); this.comboBoxPort = new System.Windows.Forms.ComboBox(); this.labelPort = new System.Windows.Forms.Label(); this.groupBoxTest = new System.Windows.Forms.GroupBox(); - this.groupBoxStatus.SuspendLayout(); + this.labelStatus = new System.Windows.Forms.Label(); this.groupBoxTest.SuspendLayout(); this.SuspendLayout(); // @@ -54,20 +52,6 @@ this.buttonDone.UseVisualStyleBackColor = true; this.buttonDone.Click += new System.EventHandler(this.buttonDone_Click); // - // labelLearned - // - this.labelLearned.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.labelLearned.BackColor = System.Drawing.Color.WhiteSmoke; - this.labelLearned.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.labelLearned.Location = new System.Drawing.Point(8, 16); - this.labelLearned.Name = "labelLearned"; - this.labelLearned.Size = new System.Drawing.Size(248, 24); - this.labelLearned.TabIndex = 0; - this.labelLearned.Text = "Status"; - this.labelLearned.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // // buttonLearn // this.buttonLearn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); @@ -100,7 +84,7 @@ // buttonTest // this.buttonTest.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonTest.Enabled = false; + this.buttonTest.Enabled = true; this.buttonTest.Location = new System.Drawing.Point(200, 16); this.buttonTest.Name = "buttonTest"; this.buttonTest.Size = new System.Drawing.Size(56, 24); @@ -109,19 +93,6 @@ this.buttonTest.UseVisualStyleBackColor = true; this.buttonTest.Click += new System.EventHandler(this.buttonTest_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.labelLearned); - this.groupBoxStatus.Location = new System.Drawing.Point(8, 40); - this.groupBoxStatus.Name = "groupBoxStatus"; - this.groupBoxStatus.Size = new System.Drawing.Size(264, 48); - this.groupBoxStatus.TabIndex = 2; - this.groupBoxStatus.TabStop = false; - this.groupBoxStatus.Text = "Status"; - // // comboBoxPort // this.comboBoxPort.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) @@ -149,22 +120,35 @@ this.groupBoxTest.Controls.Add(this.comboBoxPort); this.groupBoxTest.Controls.Add(this.buttonTest); this.groupBoxTest.Controls.Add(this.labelPort); - this.groupBoxTest.Location = new System.Drawing.Point(8, 96); + this.groupBoxTest.Location = new System.Drawing.Point(8, 40); this.groupBoxTest.Name = "groupBoxTest"; this.groupBoxTest.Size = new System.Drawing.Size(264, 48); this.groupBoxTest.TabIndex = 3; this.groupBoxTest.TabStop = false; this.groupBoxTest.Text = "Test"; // + // labelStatus + // + this.labelStatus.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.labelStatus.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.labelStatus.Location = new System.Drawing.Point(8, 96); + this.labelStatus.Name = "labelStatus"; + this.labelStatus.Size = new System.Drawing.Size(264, 48); + this.labelStatus.TabIndex = 6; + this.labelStatus.Text = "Status"; + this.labelStatus.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // LearnIR // this.AcceptButton = this.buttonDone; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(280, 185); + this.Controls.Add(this.labelStatus); this.Controls.Add(this.groupBoxTest); this.Controls.Add(this.buttonDone); - this.Controls.Add(this.groupBoxStatus); this.Controls.Add(this.buttonLearn); this.Controls.Add(this.labelName); this.Controls.Add(this.textBoxName); @@ -176,7 +160,6 @@ this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Learn IR Command"; - this.groupBoxStatus.ResumeLayout(false); this.groupBoxTest.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); @@ -186,15 +169,14 @@ #endregion private System.Windows.Forms.Button buttonDone; - private System.Windows.Forms.Label labelLearned; private System.Windows.Forms.Button buttonLearn; private System.Windows.Forms.Label labelName; private System.Windows.Forms.TextBox textBoxName; private System.Windows.Forms.Button buttonTest; - private System.Windows.Forms.GroupBox groupBoxStatus; private System.Windows.Forms.ComboBox comboBoxPort; private System.Windows.Forms.Label labelPort; private System.Windows.Forms.GroupBox groupBoxTest; + private System.Windows.Forms.Label labelStatus; } } Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/LearnIR.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/LearnIR.cs 2008-03-04 21:02:55 UTC (rev 1426) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/LearnIR.cs 2008-03-05 06:14:54 UTC (rev 1427) @@ -20,7 +20,7 @@ LearnIrDelegate _learnIrDelegate; BlastIrDelegate _blastIrDelegate; - bool _resetTextBoxNameEnabled; + bool _isNewCode; #endregion Variables @@ -52,11 +52,11 @@ comboBoxPort.Items.AddRange(ports); comboBoxPort.SelectedIndex = 0; - labelLearned.Text = "Not yet learned"; - buttonTest.Enabled = false; + labelStatus.Text = "Nothing learned yet"; + groupBoxTest.Enabled = false; textBoxName.Text = "New"; textBoxName.Enabled = true; - _resetTextBoxNameEnabled = true; + _isNewCode = true; } /// <summary> @@ -72,11 +72,11 @@ if (String.IsNullOrEmpty(existingCodeName)) throw new ArgumentNullException("existingCodeName"); - labelLearned.Text = "Not yet re-learned"; - buttonTest.Enabled = true; + labelStatus.Text = "IR Command is unchanged"; + groupBoxTest.Enabled = true; textBoxName.Text = existingCodeName; textBoxName.Enabled = false; - _resetTextBoxNameEnabled = false; + _isNewCode = false; } #endregion Constructor @@ -90,20 +90,20 @@ /// <param name="success">Success status.</param> public void LearnStatus(string status, bool success) { - if (labelLearned.InvokeRequired) + if (labelStatus.InvokeRequired) { this.Invoke(new LearnStatusDelegate(LearnStatus), new object[] { status, success }); } else { - labelLearned.Text = status; - labelLearned.ForeColor = success ? Color.Green : Color.Red; - labelLearned.Update(); + labelStatus.Text = status; + labelStatus.ForeColor = success ? Color.Green : Color.Red; + labelStatus.Update(); - textBoxName.Enabled = _resetTextBoxNameEnabled; - buttonLearn.Enabled = true; - buttonTest.Enabled = success; - buttonDone.Enabled = true; + textBoxName.Enabled = _isNewCode; + buttonLearn.Enabled = true; + groupBoxTest.Enabled = success || !_isNewCode; + buttonDone.Enabled = true; } } @@ -127,28 +127,27 @@ return; } - textBoxName.Enabled = false; - buttonLearn.Enabled = false; - buttonTest.Enabled = false; - buttonDone.Enabled = false; + textBoxName.Enabled = false; + buttonLearn.Enabled = false; + groupBoxTest.Enabled = false; + buttonDone.Enabled = false; string fileName = Path.Combine(Common.FolderIRCommands, name + Common.FileExtensionIR); - if (_learnIrDelegate(fileName)) { - labelLearned.Text = "Press button to learn now"; - labelLearned.ForeColor = Color.Blue; - labelLearned.Update(); + labelStatus.Text = "Hold your remote close to the receiver and tap the button to learn"; + labelStatus.ForeColor = Color.Blue; + labelStatus.Update(); } else { - labelLearned.Text = "Failed to learn IR"; - labelLearned.ForeColor = Color.Red; + labelStatus.Text = "Failed to learn IR"; + labelStatus.ForeColor = Color.Red; - textBoxName.Enabled = _resetTextBoxNameEnabled; - buttonLearn.Enabled = true; - buttonTest.Enabled = false; - buttonDone.Enabled = true; + textBoxName.Enabled = _isNewCode; + buttonLearn.Enabled = true; + groupBoxTest.Enabled = !_isNewCode; + buttonDone.Enabled = true; } } Modified: trunk/plugins/IR Server Suite/Input Service/Input Service/InputService.cs =================================================================== --- trunk/plugins/IR Server Suite/Input Service/Input Service/InputService.cs 2008-03-04 21:02:55 UTC (rev 1426) +++ trunk/plugins/IR Server Suite/Input Service/Input Service/InputService.cs 2008-03-05 06:14:54 UTC (rev 1427) @@ -59,7 +59,6 @@ static readonly string ConfigurationFile = Path.Combine(Common.FolderAppData, "Input Service\\Input Service.xml"); static readonly string AbstractRemoteMapFolder = Path.Combine(Common.FolderAppData, "Input Service\\Abstract Remote Maps"); - static readonly string AbstractRemoteSchemaFile = Path.Combine(Common.FolderAppData, "Input Service\\Abstract Remote Maps\\RemoteTable.xsd"); #endregion Constants 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 2008... [truncated message content] |