From: <an...@us...> - 2008-01-19 08:44:55
|
Revision: 1271 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1271&view=rev Author: and-81 Date: 2008-01-19 00:44:47 -0800 (Sat, 19 Jan 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Commands/Macro/CommandBlastIR.cs trunk/plugins/IR Server Suite/Commands/Macro/CommandCallMacro.cs trunk/plugins/IR Server Suite/Commands/Macro/EditMacro.cs trunk/plugins/IR Server Suite/Commands/Macro/Macro.cs trunk/plugins/IR Server Suite/Commands/Macro/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Commands/TestApp/Program.cs trunk/plugins/IR Server Suite/Commands/TestApp/TestApp.csproj trunk/plugins/IR Server Suite/IR Server Suite.sln trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MP Blast Zone Plugin.csproj Added Paths: ----------- trunk/plugins/IR Server Suite/Commands/Macro/CommandProcessor.csproj trunk/plugins/IR Server Suite/Commands/Macro/EditBlastIR.Designer.cs trunk/plugins/IR Server Suite/Commands/Macro/EditBlastIR.cs trunk/plugins/IR Server Suite/Commands/Macro/EditBlastIR.resx trunk/plugins/IR Server Suite/Commands/Macro/Processor.cs Removed Paths: ------------- trunk/plugins/IR Server Suite/Commands/Macro/Macro.csproj trunk/plugins/IR Server Suite/Commands/TestApp/Form1.Designer.cs trunk/plugins/IR Server Suite/Commands/TestApp/Form1.cs Modified: trunk/plugins/IR Server Suite/Commands/Macro/CommandBlastIR.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/Macro/CommandBlastIR.cs 2008-01-19 08:02:20 UTC (rev 1270) +++ trunk/plugins/IR Server Suite/Commands/Macro/CommandBlastIR.cs 2008-01-19 08:44:47 UTC (rev 1271) @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.IO; using System.Text; using System.Windows.Forms; @@ -35,7 +36,7 @@ /// Gets the category of this command. /// </summary> /// <returns>The category of this command.</returns> - public override string GetCategory() { return Macro.Category; } + public override string GetCategory() { return Processor.CategoryHidden; } /// <summary> /// Gets the user interface text. @@ -49,12 +50,24 @@ /// <returns>The user display text.</returns> public override string GetUserDisplayText() { - return String.Format("{0} ({1})", GetUserInterfaceText(), String.Join(", ", Parameters)); + string fileName = _parameters[0]; + + if (_parameters[0].StartsWith(Common.FolderAppData, StringComparison.OrdinalIgnoreCase)) + fileName = _parameters[0].Substring(Common.FolderAppData.Length); + + return String.Format("{0} ({1}, {2})", GetUserInterfaceText(), fileName, _parameters[1]); } - /* + + /// <summary> + /// Edit this command. + /// </summary> + /// <param name="parent">The parent window.</param> + /// <param name="blastIrDelegate">The blast ir delegate.</param> + /// <param name="blastPorts">The blast ports.</param> + /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> public bool Edit(IWin32Window parent, BlastIrDelegate blastIrDelegate, string[] blastPorts) { - EditBlastIR edit = new EditBlastIR(_parameters, blastIrDelegate, blastPorts); + EditBlastIR edit = new EditBlastIR(blastIrDelegate, blastPorts, _parameters); if (edit.ShowDialog(parent) == DialogResult.OK) { _parameters = edit.Parameters; @@ -64,16 +77,21 @@ return false; } + /// <summary> + /// Execute this command. + /// </summary> + /// <param name="blastIrDelegate">The blast ir delegate.</param> public void Execute(BlastIrDelegate blastIrDelegate) { - string irFile = Common.FolderIRCommands + _parameters[0] + Common.FileExtensionIR; + string irFile = _parameters[0] + Common.FileExtensionIR; string port = _parameters[1]; blastIrDelegate(irFile, port); } - */ + #endregion Implementation + } } Modified: trunk/plugins/IR Server Suite/Commands/Macro/CommandCallMacro.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/Macro/CommandCallMacro.cs 2008-01-19 08:02:20 UTC (rev 1270) +++ trunk/plugins/IR Server Suite/Commands/Macro/CommandCallMacro.cs 2008-01-19 08:44:47 UTC (rev 1271) @@ -3,6 +3,8 @@ using System.Text; using System.Windows.Forms; +using IrssUtils; + namespace Commands { @@ -33,7 +35,7 @@ /// Gets the category of this command. /// </summary> /// <returns>The category of this command.</returns> - public override string GetCategory() { return Macro.HiddenCategory; } + public override string GetCategory() { return Processor.CategoryHidden; } /// <summary> /// Gets the user interface text. @@ -54,10 +56,11 @@ /// Execute this command. /// </summary> /// <param name="variables">The variable list of the calling code.</param> - public override void Execute(VariableList variables) + /// <param name="blastIrDelegate">The blast ir delegate.</param> + public void Execute(VariableList variables, BlastIrDelegate blastIrDelegate) { Macro macro = new Macro(_parameters[0]); - macro.Execute(variables); + macro.Execute(variables, blastIrDelegate); } #endregion Implementation Added: trunk/plugins/IR Server Suite/Commands/Macro/CommandProcessor.csproj =================================================================== --- trunk/plugins/IR Server Suite/Commands/Macro/CommandProcessor.csproj (rev 0) +++ trunk/plugins/IR Server Suite/Commands/Macro/CommandProcessor.csproj 2008-01-19 08:44:47 UTC (rev 1271) @@ -0,0 +1,142 @@ +<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>{49CF376E-811C-4EB4-817F-A39C9529B608}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>Commands</RootNamespace> + <AssemblyName>CommandProcessor</AssemblyName> + <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> + <UseVSHostingProcess>false</UseVSHostingProcess> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <DocumentationFile>bin\Debug\CommandProcessor.xml</DocumentationFile> + </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> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Processor.cs" /> + <Compile Include="EditBlastIR.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="EditBlastIR.Designer.cs"> + <DependentUpon>EditBlastIR.cs</DependentUpon> + </Compile> + <Compile Include="CommandClearVariables.cs" /> + <Compile Include="CommandIf.cs" /> + <Compile Include="CommandLabel.cs" /> + <Compile Include="CommandGotoLabel.cs" /> + <Compile Include="CommandSetVariable.cs" /> + <Compile Include="CommandSaveVariables.cs" /> + <Compile Include="CommandLoadVariables.cs" /> + <Compile Include="CommandCallMacro.cs" /> + <Compile Include="CommandBlastIR.cs" /> + <Compile Include="EditIf.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="EditIf.Designer.cs"> + <DependentUpon>EditIf.cs</DependentUpon> + </Compile> + <Compile Include="EditLabel.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="EditLabel.Designer.cs"> + <DependentUpon>EditLabel.cs</DependentUpon> + </Compile> + <Compile Include="Macro.cs" /> + <Compile Include="EditMacro.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="EditMacro.Designer.cs"> + <DependentUpon>EditMacro.cs</DependentUpon> + </Compile> + <Compile Include="MacroStructureException.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="EditSetVariable.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="EditSetVariable.Designer.cs"> + <DependentUpon>EditSetVariable.cs</DependentUpon> + </Compile> + <Compile Include="EditVariablesFile.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="EditVariablesFile.Designer.cs"> + <DependentUpon>EditVariablesFile.cs</DependentUpon> + </Compile> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="EditBlastIR.resx"> + <DependentUpon>EditBlastIR.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> + <EmbeddedResource Include="EditIf.resx"> + <DependentUpon>EditIf.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> + <EmbeddedResource Include="EditMacro.resx"> + <DependentUpon>EditMacro.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> + <EmbeddedResource Include="EditLabel.resx"> + <DependentUpon>EditLabel.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> + <EmbeddedResource Include="EditSetVariable.resx"> + <DependentUpon>EditSetVariable.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> + <EmbeddedResource Include="EditVariablesFile.resx"> + <DependentUpon>EditVariablesFile.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\Common\IrssUtils\IrssUtils.csproj"> + <Project>{CA15769C-232E-4CA7-94FD-206A06CA3ABB}</Project> + <Name>IrssUtils</Name> + <Private>False</Private> + </ProjectReference> + <ProjectReference Include="..\Command\Command.csproj"> + <Project>{21E04B17-D850-43E7-AAD3-876C0E062BDB}</Project> + <Name>Command</Name> + <Private>False</Private> + </ProjectReference> + <ProjectReference Include="..\VariableList\VariableList.csproj"> + <Project>{106A69D2-670C-4DE5-A81C-A3CD5D3F21EB}</Project> + <Name>VariableList</Name> + <Private>False</Private> + </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/Commands/Macro/EditBlastIR.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/Macro/EditBlastIR.Designer.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/Macro/EditBlastIR.Designer.cs 2008-01-19 08:44:47 UTC (rev 1271) @@ -0,0 +1,174 @@ +namespace Commands +{ + + partial class EditBlastIR + { + /// <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.labelIRFile = new System.Windows.Forms.Label(); + this.labelBlasterPort = new System.Windows.Forms.Label(); + this.comboBoxPort = new System.Windows.Forms.ComboBox(); + this.labelIRCommandFile = new System.Windows.Forms.Label(); + this.buttonTest = new System.Windows.Forms.Button(); + this.buttonOK = new System.Windows.Forms.Button(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.checkBoxUseForAll = new System.Windows.Forms.CheckBox(); + this.toolTips = new System.Windows.Forms.ToolTip(this.components); + this.SuspendLayout(); + // + // labelIRFile + // + this.labelIRFile.Location = new System.Drawing.Point(8, 8); + this.labelIRFile.Name = "labelIRFile"; + this.labelIRFile.Size = new System.Drawing.Size(88, 20); + this.labelIRFile.TabIndex = 0; + this.labelIRFile.Text = "IR Command:"; + this.labelIRFile.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // labelBlasterPort + // + this.labelBlasterPort.Location = new System.Drawing.Point(8, 40); + this.labelBlasterPort.Name = "labelBlasterPort"; + this.labelBlasterPort.Size = new System.Drawing.Size(88, 21); + this.labelBlasterPort.TabIndex = 2; + this.labelBlasterPort.Text = "Blaster port:"; + this.labelBlasterPort.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // comboBoxPort + // + this.comboBoxPort.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.comboBoxPort.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxPort.FormattingEnabled = true; + this.comboBoxPort.Location = new System.Drawing.Point(96, 40); + this.comboBoxPort.Name = "comboBoxPort"; + this.comboBoxPort.Size = new System.Drawing.Size(160, 21); + this.comboBoxPort.TabIndex = 3; + this.toolTips.SetToolTip(this.comboBoxPort, "Choose the blaster port to transmit this command to"); + // + // labelIRCommandFile + // + this.labelIRCommandFile.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.labelIRCommandFile.AutoEllipsis = true; + this.labelIRCommandFile.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + this.labelIRCommandFile.Location = new System.Drawing.Point(96, 8); + this.labelIRCommandFile.Name = "labelIRCommandFile"; + this.labelIRCommandFile.Size = new System.Drawing.Size(248, 20); + this.labelIRCommandFile.TabIndex = 1; + this.labelIRCommandFile.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // buttonTest + // + this.buttonTest.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonTest.Location = new System.Drawing.Point(8, 72); + this.buttonTest.Name = "buttonTest"; + this.buttonTest.Size = new System.Drawing.Size(56, 24); + this.buttonTest.TabIndex = 4; + this.buttonTest.Text = "Test"; + this.toolTips.SetToolTip(this.buttonTest, "Test this blast command"); + this.buttonTest.UseVisualStyleBackColor = true; + this.buttonTest.Click += new System.EventHandler(this.buttonTest_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(224, 72); + this.buttonOK.Name = "buttonOK"; + this.buttonOK.Size = new System.Drawing.Size(56, 24); + this.buttonOK.TabIndex = 6; + 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(288, 72); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(56, 24); + this.buttonCancel.TabIndex = 7; + this.buttonCancel.Text = "Cancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); + // + // checkBoxUseForAll + // + this.checkBoxUseForAll.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.checkBoxUseForAll.Location = new System.Drawing.Point(72, 72); + this.checkBoxUseForAll.Name = "checkBoxUseForAll"; + this.checkBoxUseForAll.Size = new System.Drawing.Size(144, 24); + this.checkBoxUseForAll.TabIndex = 5; + this.checkBoxUseForAll.Text = "Use this port for all"; + this.toolTips.SetToolTip(this.checkBoxUseForAll, "Use the selected blaster port for all blast commands in this group"); + this.checkBoxUseForAll.UseVisualStyleBackColor = true; + this.checkBoxUseForAll.Visible = false; + // + // BlastCommand + // + 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(352, 105); + this.Controls.Add(this.checkBoxUseForAll); + this.Controls.Add(this.buttonOK); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.buttonTest); + this.Controls.Add(this.labelIRCommandFile); + this.Controls.Add(this.labelBlasterPort); + this.Controls.Add(this.comboBoxPort); + this.Controls.Add(this.labelIRFile); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(360, 132); + this.Name = "BlastCommand"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Blast Command"; + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Label labelIRFile; + private System.Windows.Forms.Label labelBlasterPort; + private System.Windows.Forms.ComboBox comboBoxPort; + private System.Windows.Forms.Label labelIRCommandFile; + private System.Windows.Forms.Button buttonTest; + private System.Windows.Forms.Button buttonOK; + private System.Windows.Forms.Button buttonCancel; + private System.Windows.Forms.CheckBox checkBoxUseForAll; + private System.Windows.Forms.ToolTip toolTips; + } + +} Added: trunk/plugins/IR Server Suite/Commands/Macro/EditBlastIR.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/Macro/EditBlastIR.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/Macro/EditBlastIR.cs 2008-01-19 08:44:47 UTC (rev 1271) @@ -0,0 +1,162 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +using IrssUtils; + +namespace Commands +{ + + /// <summary> + /// Edit Blast IR Command form. + /// </summary> + public partial class EditBlastIR : Form + { + + #region Properties + + /// <summary> + /// Gets the command parameters. + /// </summary> + /// <value>The command parameters.</value> + public string[] Parameters + { + get + { + return new string[] { + _fileName, + comboBoxPort.SelectedItem as string }; + } + } + + /// <summary> + /// Gets or sets the blaster port. + /// </summary> + /// <value>The blaster port.</value> + public string BlasterPort + { + get { return comboBoxPort.SelectedItem as string; } + set { comboBoxPort.SelectedItem = value; } + } + + /// <summary> + /// Gets a value indicating whether to use this commands details for all in the batch. + /// </summary> + /// <value><c>true</c> if use for all; otherwise, <c>false</c>.</value> + public bool UseForAll + { + get { return checkBoxUseForAll.Checked; } + } + + #endregion Properties + + #region Variables + + BlastIrDelegate _blastIrDelegate; + string _fileName; + + #endregion Variables + + #region Constructors + + /// <summary> + /// Initializes a new instance of the <see cref="EditBlastIR"/> class. + /// </summary> + /// <param name="blastIrDelegate">The blast IR delegate.</param> + /// <param name="ports">The available ports.</param> + EditBlastIR(BlastIrDelegate blastIrDelegate, string[] ports) + { + if (blastIrDelegate == null) + throw new ArgumentNullException("blastIrDelegate"); + + if (ports == null) + throw new ArgumentNullException("ports"); + + InitializeComponent(); + + _blastIrDelegate = blastIrDelegate; + + comboBoxPort.Items.AddRange(ports); + comboBoxPort.SelectedIndex = 0; + } + + /// <summary> + /// Initializes a new instance of the <see cref="EditBlastIR"/> class. + /// </summary> + /// <param name="blastIrDelegate">The blast IR delegate.</param> + /// <param name="ports">The available ports.</param> + /// <param name="parameters">The command parameters.</param> + public EditBlastIR(BlastIrDelegate blastIrDelegate, string[] ports, string[] parameters) + : this(blastIrDelegate, ports) + { + if (parameters == null) + throw new ArgumentNullException("parameters"); + + _fileName = parameters[0]; + + string displayName = _fileName; + if (_fileName.StartsWith(Common.FolderAppData, StringComparison.OrdinalIgnoreCase)) + displayName = _fileName.Substring(Common.FolderAppData.Length); + + labelIRCommandFile.Text = displayName; + + if (comboBoxPort.Items.Contains(parameters[1])) + comboBoxPort.SelectedItem = parameters[1]; + } + + /// <summary> + /// Initializes a new instance of the <see cref="EditBlastIR"/> class. + /// </summary> + /// <param name="blastIrDelegate">The blast IR delegate.</param> + /// <param name="ports">The available ports.</param> + /// <param name="parameters">The command parameters.</param> + /// <param name="commandCount">The command count for this batch of commands.</param> + public EditBlastIR(BlastIrDelegate blastIrDelegate, string[] ports, string[] parameters, int commandCount) + : this(blastIrDelegate, ports, parameters) + { + if (commandCount > 1) + { + checkBoxUseForAll.Text = String.Format("Use this port for all ({0})", commandCount); + checkBoxUseForAll.Visible = true; + } + } + + #endregion Constructors + + #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(); + } + + private void buttonTest_Click(object sender, EventArgs e) + { + try + { + string fileName = _fileName + Common.FileExtensionIR; + string port = comboBoxPort.SelectedItem as string; + + _blastIrDelegate(fileName, port); + } + catch (Exception ex) + { + MessageBox.Show(this, ex.Message, "Test failed", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + #endregion Buttons + + } + +} Added: trunk/plugins/IR Server Suite/Commands/Macro/EditBlastIR.resx =================================================================== --- trunk/plugins/IR Server Suite/Commands/Macro/EditBlastIR.resx (rev 0) +++ trunk/plugins/IR Server Suite/Commands/Macro/EditBlastIR.resx 2008-01-19 08:44:47 UTC (rev 1271) @@ -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 Modified: trunk/plugins/IR Server Suite/Commands/Macro/EditMacro.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/Macro/EditMacro.cs 2008-01-19 08:02:20 UTC (rev 1270) +++ trunk/plugins/IR Server Suite/Commands/Macro/EditMacro.cs 2008-01-19 08:44:47 UTC (rev 1271) @@ -11,7 +11,6 @@ using System.Xml; using IrssUtils; -//using IrssUtils.Forms; namespace Commands { @@ -24,10 +23,10 @@ #region Variables + Processor _commandProcessor; + string _macroFolder; - VariableList _variableList; - IrssUtils.BlastIrDelegate _blastIrDelegate; - string[] _blastIrPorts; + string _fileName; Dictionary<string, Type> _commands; @@ -38,34 +37,24 @@ /// <summary> /// Creates a Macro Editor windows form. /// </summary> + /// <param name="commandProcessor">The command processor.</param> /// <param name="macroFolder">The macro folder.</param> - /// <param name="variables">The variable list.</param> - /// <param name="blastIrDelegate">The blast ir delegate.</param> - /// <param name="blastIrPorts">The blast ir ports.</param> /// <param name="categories">The command categories to include.</param> - public EditMacro(string macroFolder, VariableList variables, IrssUtils.BlastIrDelegate blastIrDelegate, string[] blastIrPorts, string[] categories) + public EditMacro(Processor commandProcessor, string macroFolder, string[] categories) { + if (commandProcessor == null) + throw new ArgumentNullException("commandProcessor"); + if (String.IsNullOrEmpty(macroFolder)) throw new ArgumentNullException("macroFolder"); - if (variables == null) - throw new ArgumentNullException("variables"); - - if (blastIrDelegate == null) - throw new ArgumentNullException("blastIrDelegate"); - - if (blastIrPorts == null) - throw new ArgumentNullException("blastIrPorts"); - if (categories == null) throw new ArgumentNullException("categories"); InitializeComponent(); - _macroFolder = macroFolder; - _variableList = variables; - _blastIrDelegate = blastIrDelegate; - _blastIrPorts = blastIrPorts; + _commandProcessor = commandProcessor; + _macroFolder = macroFolder; PopulateCommandList(categories); @@ -76,46 +65,36 @@ /// <summary> /// Creates a Macro Editor windows form. /// </summary> - /// <param name="macroFolder">The macro folder.</param> - /// <param name="variables">The variable list.</param> - /// <param name="blastIrDelegate">The blast ir delegate.</param> - /// <param name="blastIrPorts">The blast ir ports.</param> + /// <param name="commandProcessor">The command processor.</param> /// <param name="categories">The command categories to include.</param> - /// <param name="name">The existing macro name.</param> - public EditMacro(string macroFolder, VariableList variables, IrssUtils.BlastIrDelegate blastIrDelegate, string[] blastIrPorts, string[] categories, string name) + /// <param name="fileName">Name of the macro file.</param> + public EditMacro(Processor commandProcessor, string[] categories, string fileName) { - if (String.IsNullOrEmpty(macroFolder)) - throw new ArgumentNullException("macroFolder"); + if (commandProcessor == null) + throw new ArgumentNullException("commandProcessor"); - if (variables == null) - throw new ArgumentNullException("variables"); - - if (blastIrDelegate == null) - throw new ArgumentNullException("blastIrDelegate"); - - if (blastIrPorts == null) - throw new ArgumentNullException("blastIrPorts"); - if (categories == null) throw new ArgumentNullException("categories"); - if (String.IsNullOrEmpty(name)) - throw new ArgumentNullException("name"); + if (String.IsNullOrEmpty(fileName)) + throw new ArgumentNullException("fileName"); InitializeComponent(); - _macroFolder = macroFolder; - _variableList = variables; - _blastIrDelegate = blastIrDelegate; - _blastIrPorts = blastIrPorts; + _commandProcessor = commandProcessor; + _fileName = fileName; PopulateCommandList(categories); - textBoxName.Text = name; + string macroName = fileName; + + if (macroName.StartsWith(Common.FolderAppData, StringComparison.OrdinalIgnoreCase)) + macroName = fileName.Substring(Common.FolderAppData.Length); + + textBoxName.Text = macroName; textBoxName.Enabled = false; - string fileName = macroFolder + name + Macro.FileExtension; - Macro macro = new Macro(fileName); + Macro macro = new Macro(fileName + Processor.FileExtensionMacro); foreach (Command command in macro.Commands) { ListViewItem item = new ListViewItem(command.GetUserDisplayText()); @@ -131,23 +110,18 @@ void PopulateCommandList(string[] categories) { _commands = new Dictionary<string, Type>(); - treeViewCommandList.Nodes.Clear(); - Dictionary<string, TreeNode> treeNodes = new Dictionary<string,TreeNode>(categories.Length); TreeNode macroCommands = new TreeNode(Macro.Category); - - Type[] specialCommands = Macro.GetSpecialCommands(); - + Type[] specialCommands = Processor.GetSpecialCommands(); foreach (Type type in specialCommands) { Command command = (Command)Activator.CreateInstance(type); - if (command.GetCategory().Equals(Macro.HiddenCategory, StringComparison.OrdinalIgnoreCase)) - continue; - - macroCommands.Nodes.Add(command.GetUserInterfaceText()); + if (!command.GetCategory().Equals(Processor.CategoryHidden, StringComparison.OrdinalIgnoreCase)) + macroCommands.Nodes.Add(command.GetUserInterfaceText()); + _commands.Add(command.GetUserInterfaceText(), type); } @@ -174,7 +148,23 @@ } } - string[] macros = Macro.GetList(_macroFolder); + string[] irFiles = Processor.GetListIR(); + if (irFiles != null) + { + TreeNode irCommands = new TreeNode("IR Commands"); + + foreach (string irFile in irFiles) + { + TreeNode newNode = new TreeNode(irFile); + newNode.Tag = Common.FolderIRCommands + irFile; + irCommands.Nodes.Add(newNode); + } + + treeNodes.Add(irCommands.Text, irCommands); + } + + + string[] macros = Processor.GetListMacro(_macroFolder); if (macros != null) { TreeNode otherMacros = new TreeNode("Macros"); @@ -204,8 +194,21 @@ ListViewItem newCommand = new ListViewItem(); Command command; - if (treeViewCommandList.SelectedNode.Parent.Text.Equals("Macros", StringComparison.OrdinalIgnoreCase)) + if (treeViewCommandList.SelectedNode.Parent.Text.Equals("IR Commands", StringComparison.OrdinalIgnoreCase)) { + string selectedTag = treeViewCommandList.SelectedNode.Tag as string; + + command = new CommandBlastIR(new string[] { selectedTag, _commandProcessor.BlastIrPorts[0] }); + + if (_commandProcessor.Edit(command, this)) + { + newCommand.Text = command.GetUserDisplayText(); + newCommand.Tag = command.ToString(); + listViewMacro.Items.Add(newCommand); + } + } + else if (treeViewCommandList.SelectedNode.Parent.Text.Equals("Macros", StringComparison.OrdinalIgnoreCase)) + { command = new CommandCallMacro(new string[] { selected }); newCommand.Text = command.GetUserDisplayText(); @@ -214,28 +217,14 @@ } else if (_commands.ContainsKey(selected)) { - command = (Command)Activator.CreateInstance(_commands[selected]); - /*if (command is CommandBlast) + if (_commandProcessor.Edit(command, this)) { - if (command.Edit(this, _blastIrDelegate, _blastIrPorts)) - { - newCommand.Text = command.GetUserDisplayText(); - newCommand.Tag = command.ToXml(); - listViewMacro.Items.Add(newCommand); - } - + newCommand.Text = command.GetUserDisplayText(); + newCommand.Tag = command.ToString(); + listViewMacro.Items.Add(newCommand); } - else*/ - { - if (command.Edit(this)) - { - newCommand.Text = command.GetUserDisplayText(); - newCommand.Tag = command.ToString(); - listViewMacro.Items.Add(newCommand); - } - } } else { @@ -310,11 +299,11 @@ foreach (ListViewItem item in listViewMacro.Items) { string itemTag = item.Tag as string; - Command command = Macro.CreateCommand(itemTag); + Command command = Processor.CreateCommand(itemTag); newMacro.Commands.Add(command); } - newMacro.Execute(_variableList); + newMacro.Execute(_commandProcessor.Variables, _commandProcessor.BlastIr); } catch (Exception ex) { @@ -355,11 +344,11 @@ foreach (ListViewItem item in listViewMacro.Items) { string itemTag = item.Tag as string; - Command command = Macro.CreateCommand(itemTag); + Command command = Processor.CreateCommand(itemTag); newMacro.Commands.Add(command); } - newMacro.Save(_macroFolder + name + Macro.FileExtension); + newMacro.Save(_macroFolder + name + Processor.FileExtensionMacro); } catch (Exception ex) { @@ -380,18 +369,12 @@ ListViewItem selected = listViewMacro.SelectedItems[0]; string selectedTag = selected.Tag as string; - Command command = Macro.CreateCommand(selectedTag); + Command command = Processor.CreateCommand(selectedTag); - //if (command is CommandBlast) - //{ - //} - //else + if (_commandProcessor.Edit(command, this)) { - if (command.Edit(this)) - { - selected.Text = command.GetUserDisplayText(); - selected.Tag = command.ToString(); - } + selected.Text = command.GetUserDisplayText(); + selected.Tag = command.ToString(); } } catch (Exception ex) Modified: trunk/plugins/IR Server Suite/Commands/Macro/Macro.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/Macro/Macro.cs 2008-01-19 08:02:20 UTC (rev 1270) +++ trunk/plugins/IR Server Suite/Commands/Macro/Macro.cs 2008-01-19 08:44:47 UTC (rev 1271) @@ -20,21 +20,11 @@ #region Constants /// <summary> - /// Macro file extension. - /// </summary> - public const string FileExtension = ".Macro"; - - /// <summary> /// Category for Macro Commands. /// </summary> public const string Category = "Macro Commands"; /// <summary> - /// Category for commands that should not be visible in command lists. - /// </summary> - public const string HiddenCategory = "Hidden"; - - /// <summary> /// User Interface Text. /// </summary> public const string UserInterfaceText = "Macro"; @@ -84,7 +74,7 @@ foreach (XmlNode item in commandSequence) { string xml = item.Attributes["xml"].Value; - Command command = Macro.CreateCommand(xml); + Command command = Processor.CreateCommand(xml); _commands.Add(command); } } @@ -121,7 +111,8 @@ /// Exceutes this macro the specified variables and process command method. /// </summary> /// <param name="variables">The variables to use.</param> - public void Execute(VariableList variables) + /// <param name="blastIrDelegate">The blast ir delegate.</param> + public void Execute(VariableList variables, BlastIrDelegate blastIrDelegate) { for (int position = 0; position < _commands.Count; position++) { @@ -137,7 +128,7 @@ command.Parameters[2] = variables.GetVariable(command.Parameters[2].Substring(VariableList.VariablePrefix.Length)); command.Parameters[2] = Common.ReplaceSpecial(command.Parameters[2]); - if (((CommandIf)command).Evaluate()) + if ((command as CommandIf).Evaluate()) position = FindLabel(command.Parameters[3]); else if (!String.IsNullOrEmpty(command.Parameters[4])) position = FindLabel(command.Parameters[4]); @@ -148,8 +139,12 @@ } else if (command is CommandBlastIR) { - //((CommandBlastIR)command).Execute(_blastIrDelegate); + (command as CommandBlastIR).Execute(blastIrDelegate); } + else if (command is CommandCallMacro) + { + (command as CommandCallMacro).Execute(variables, blastIrDelegate); + } else { command.Execute(variables); @@ -182,23 +177,8 @@ #endregion Implementation #region Static Methods - + /* /// <summary> - /// Returns a list of Macros in the specified folder. - /// </summary> - /// <returns>List of Macros.</returns> - public static string[] GetList(string folder) - { - string[] files = Directory.GetFiles(folder, '*' + FileExtension); - - for (int index = 0; index < files.Length; index++) - files[index] = Path.GetFileNameWithoutExtension(files[index]); - - return files; - } - - - /// <summary> /// Creates a new <c>Command</c> from the supplied information. /// </summary> /// <param name="commandString">The command string representation.</param> @@ -277,8 +257,6 @@ { List<Type> specialCommands = new List<Type>(); - specialCommands.Add(typeof(CommandBlastIR)); - specialCommands.Add(typeof(CommandIf)); specialCommands.Add(typeof(CommandLabel)); specialCommands.Add(typeof(CommandGotoLabel)); @@ -287,13 +265,13 @@ specialCommands.Add(typeof(CommandSaveVariables)); specialCommands.Add(typeof(CommandLoadVariables)); - // Hidden commands ... + specialCommands.Add(typeof(CommandBlastIR)); specialCommands.Add(typeof(CommandCallMacro)); return specialCommands.ToArray(); } - + */ #endregion Static Methods } Deleted: trunk/plugins/IR Server Suite/Commands/Macro/Macro.csproj =================================================================== --- trunk/plugins/IR Server Suite/Commands/Macro/Macro.csproj 2008-01-19 08:02:20 UTC (rev 1270) +++ trunk/plugins/IR Server Suite/Commands/Macro/Macro.csproj 2008-01-19 08:44:47 UTC (rev 1271) @@ -1,131 +0,0 @@ -<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>{49CF376E-811C-4EB4-817F-A39C9529B608}</ProjectGuid> - <OutputType>Library</OutputType> - <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>Commands</RootNamespace> - <AssemblyName>Macro</AssemblyName> - <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> - <UseVSHostingProcess>false</UseVSHostingProcess> - <TreatWarningsAsErrors>true</TreatWarningsAsErrors> - <DocumentationFile>bin\Debug\Macro.XML</DocumentationFile> - </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> - <ItemGroup> - <Reference Include="System" /> - <Reference Include="System.Drawing" /> - <Reference Include="System.Windows.Forms" /> - <Reference Include="System.Xml" /> - </ItemGroup> - <ItemGroup> - <Compile Include="CommandClearVariables.cs" /> - <Compile Include="CommandIf.cs" /> - <Compile Include="CommandLabel.cs" /> - <Compile Include="CommandGotoLabel.cs" /> - <Compile Include="CommandSetVariable.cs" /> - <Compile Include="CommandSaveVariables.cs" /> - <Compile Include="CommandLoadVariables.cs" /> - <Compile Include="CommandCallMacro.cs" /> - <Compile Include="CommandBlastIR.cs" /> - <Compile Include="EditIf.cs"> - <SubType>Form</SubType> - </Compile> - <Compile Include="EditIf.Designer.cs"> - <DependentUpon>EditIf.cs</DependentUpon> - </Compile> - <Compile Include="EditLabel.cs"> - <SubType>Form</SubType> - </Compile> - <Compile Include="EditLabel.Designer.cs"> - <DependentUpon>EditLabel.cs</DependentUpon> - </Compile> - <Compile Include="Macro.cs" /> - <Compile Include="EditMacro.cs"> - <SubType>Form</SubType> - </Compile> - <Compile Include="EditMacro.Designer.cs"> - <DependentUpon>EditMacro.cs</DependentUpon> - </Compile> - <Compile Include="MacroStructureException.cs" /> - <Compile Include="Properties\AssemblyInfo.cs" /> - <Compile Include="EditSetVariable.cs"> - <SubType>Form</SubType> - </Compile> - <Compile Include="EditSetVariable.Designer.cs"> - <DependentUpon>EditSetVariable.cs</DependentUpon> - </Compile> - <Compile Include="EditVariablesFile.cs"> - <SubType>Form</SubType> - </Compile> - <Compile Include="EditVariablesFile.Designer.cs"> - <DependentUpon>EditVariablesFile.cs</DependentUpon> - </Compile> - </ItemGroup> - <ItemGroup> - <EmbeddedResource Include="EditIf.resx"> - <DependentUpon>EditIf.cs</DependentUpon> - <SubType>Designer</SubType> - </EmbeddedResource> - <EmbeddedResource Include="EditMacro.resx"> - <DependentUpon>EditMacro.cs</DependentUpon> - <SubType>Designer</SubType> - </EmbeddedResource> - <EmbeddedResource Include="EditLabel.resx"> - <DependentUpon>EditLabel.cs</DependentUpon> - <SubType>Designer</SubType> - </EmbeddedResource> - <EmbeddedResource Include="EditSetVariable.resx"> - <DependentUpon>EditSetVariable.cs</DependentUpon> - <SubType>Designer</SubType> - </EmbeddedResource> - <EmbeddedResource Include="EditVariablesFile.resx"> - <DependentUpon>EditVariablesFile.cs</DependentUpon> - <SubType>Designer</SubType> - </EmbeddedResource> - </ItemGroup> - <ItemGroup> - <ProjectReference Include="..\..\Common\IrssUtils\IrssUtils.csproj"> - <Project>{CA15769C-232E-4CA7-94FD-206A06CA3ABB}</Project> - <Name>IrssUtils</Name> - <Private>False</Private> - </ProjectReference> - <ProjectReference Include="..\Command\Command.csproj"> - <Project>{21E04B17-D850-43E7-AAD3-876C0E062BDB}</Project> - <Name>Command</Name> - <Private>False</Private> - </ProjectReference> - <ProjectReference Include="..\VariableList\VariableList.csproj"> - <Project>{106A69D2-670C-4DE5-A81C-A3CD5D3F21EB}</Project> - <Name>VariableList</Name> - <Private>False</Private> - </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/Commands/Macro/Processor.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/Macro/Processor.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/Macro/Processor.cs 2008-01-19 08:44:47 UTC (rev 1271) @@ -0,0 +1,282 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Windows.Forms; +using System.Xml; +using System.Xml.Serialization; + +namespace Commands +{ + + /// <summary> + /// Provides a delegate to call to execute an IR Command. + /// </summary> + /// <param name="fileName">Full file path to the IR Command file.</param> + /// <param name="port">IR Blaster port to transmit on.</param> + public delegate void BlastIrDelegate(string fileName, string port); + + /// <summary> + /// Encapsulates all Command Processing. + /// </summary> + public class Processor + { + + #region Constants + + /// <summary> + /// Macro file extension. + /// </summary> + public const string FileExtensionMacro = ".Macro"; + + /// <summary> + /// IR Command file extension. + /// </summary> + public const string FileExtensionIR = ".IR"; + + + /// <summary> + /// Standard text for the Macro Category. + /// </summary> + public const string CategoryMacro = "Macro Commands"; + /// <summary> + /// Standard text for the Macro Category. + /// </summary> + public const string CategoryGeneral = "General Commands"; + /// <summary> + /// Standard text for the Macro Category. + /// </summary> + public const string CategoryMediaPortal = "MediaPortal Commands"; + /// <summary> + /// Standard text for the Macro Category. + /// </summary> + public const string CategoryHidden = "Hidden"; + + #endregion Constants + + #region Variables + + VariableList _variables; + + BlastIrDelegate _blastIrDelegate; + string[] _blastIrPorts; + + #endregion Variables + + #region Properties + + /// <summary> + /// Gets the variable list. + /// </summary> + /// <value>The variable list.</value> + public VariableList Variables + { + get { return _variables; } + } + + /// <summary> + /// Gets the blast ir delegate. + /// </summary> + /// <value>The blast ir delegate.</value> + public BlastIrDelegate BlastIr + { + get { return _blastIrDelegate; } + } + + /// <summary> + /// Gets the blast ir ports. + /// </summary> + /// <value>The blast ir ports.</value> + public string[] BlastIrPorts + { + get { return _blastIrPorts; } + } + + #endregion Properties + + #region Constructor + + /// <summary> + /// Initializes a new instance of the <see cref="Processor"/> class. + /// </summary> + /// <param name="blastIrDelegate">The blast ir delegate.</param> + /// <param name="blastIrPorts">The blast ir ports.</param> + public Processor(BlastIrDelegate blastIrDelegate, string[] blastIrPorts) + { + _variables = new VariableList(); + + _blastIrDelegate = blastIrDelegate; + _blastIrPorts = blastIrPorts; + } + + #endregion Constructor + + #region Implementation + + /// <summary> + /// Executes the specified command. + /// </summary> + /// <param name="command">The command.</param> + public void Execute(Command command) + { + if (command is CommandBlastIR) + (command as CommandBlastIR).Execute(_blastIrDelegate); + else if (command is CommandCallMacro) + (command as CommandCallMacro).Execute(_variables, _blastIrDelegate); + else + command.Execute(_variables); + } + + /// <summary> + /// Edits the specified command. + /// </summary> + /// <param name="command">The command.</param> + /// <param name="parent">The parent window.</param> + /// <returns><c>true</c> if the edit </returns> + public bool Edit(Command command, IWin32Window parent) + { + if (command is CommandBlastIR) + return (command as CommandBlastIR).Edit(parent, _blastIrDelegate, _blastIrPorts); + else + return command.Edit(parent); + } + + #endregion Implementation + + #region Static Methods + + /// <summary> + /// Returns a list of IR Command files. + /// </summary> + /// <returns>List of IR Command files.</returns> + public static string[] GetListIR() + { + string[] files = Directory.GetFiles(IrssUtils.Common.FolderIRCommands, '*' + FileExtensionIR); + + for (int index = 0; index < files.Length; index++) + files[index] = Path.GetFileNameWithoutExtension(files[index]); + + return files; + } + + /// <summary> + /// Returns a list of Macros in the specified folder. + /// </summary> + /// <param name="folder">The folder.</param> + /// <returns>List of Macros.</returns> + public static string[] GetListMacro(string folder) + { + string[] files = Directory.GetFiles(folder, '*' + FileExtensionMacro); + + for (int index = 0; index < files.Length; index++) + files[index] = Path.GetFileNameWithoutExtension(files[index]); + + return files; + } + + + /// <summary> + /// Creates a new <c>Command</c> from the supplied information. + /// </summary> + /// <param name="commandString">The command string representation.</param> + /// <returns>A new <c>Command</c>.</returns> + public static Command CreateCommand(string commandString) + { + if (String.IsNullOrEmpty(commandString)) + throw new ArgumentNullException("commandString"); + + string splitAt = ", "; + + int splitPoint = commandString.IndexOf(splitAt); + if (splitPoint == -1) + throw new ArgumentException("Invalid command string", "commandString"); + + string commandType = commandString.Substring(0, splitPoint); + string parametersXml = commandString.Substring(splitPoint + splitAt.Length); + + return CreateCommand(commandType, parametersXml); + } + + /// <summary> + /// Creates a new <c>Command</c> from the supplied information. + /// </summary> + /// <param name="commandType">Type of command to create (FullName).</param> + /// <param name="parametersXml">The parameters of this command in XML.</param> + /// <returns>A new <c>Command</c>.</returns> + public static Command CreateCommand(string commandType, string parametersXml) + { + if (String.IsNullOrEmpty(commandType)) + throw new ArgumentNullException("commandType"); + + if (String.IsNullOrEmpty(parametersXml)) + throw new ArgumentNullException("parametersXml"); + + string[] parameters; + using (StringReader stringReader = new StringReader(parametersXml)) + { + XmlSerializer xmlSerializer = new XmlSerializer(typeof(string[])); + parameters = (string[])xmlSerializer.Deserialize(stringReader); + } + + return CreateCommand(commandType, parameters); + } + + /// <summary> + /// Creates a new <c>Command</c> from the supplied information. + /// </summary> + /// <param name="commandType">Type of command to create (FullName).</param> + /// <param name="parameters">The command parameters.</param> + /// <returns>A new <c>Command</c>.</returns> + public static Command CreateCommand(string commandType, string[] parameters) + { + List<Type> allCommands = new List<Type>(); + + Type[] specialCommands = GetSpecialCommands(); + if (specialCommands != null) + allCommands.AddRange(specialCommands); + + Type[] libraryCommands = IrssUtils.Common.GetLibraryCommands(); + if (libraryCommands != null) + allCommands.AddRange(libraryCommands); + + foreach (Type type in allCommands) + if (type.FullName.Equals(commandType)) + return (Command)Activator.CreateInstance(type, new object[] { parameters }); + + throw new InvalidOperationException(String.Format("Could not find command type: {0}", commandType)); + } + + /// <summary> + /// Gets the special commands. + /// </summary> + /// <returns>List of special command types.</returns> + public static Type[] GetSpecialCommands() + { + List<Type> specialCommands = new List<Type>(); + + specialCommands.Add(typeof(CommandIf)); + specialCommands.Add(typeof(CommandLabel)); + specialCommands.Add(typeof(CommandGotoLabel)); + specialCommands.Add(typeof(CommandSetVariable)); + specialCommands.Add(typeof(CommandClearVariables)); + specialCommands.Add(typeof(CommandSaveVariables)); + specialCommands.Add(typeof(CommandLoadVariables)); + + // Hidden commands ... + specialCommands.Add(typeof(CommandBlastIR)); + specialCommands.Add(typeof(CommandCallMacro)); + + return specialCommands.ToArray(); + } + + #endregion Static Methods + + + + + + } + + +} Modified: trunk/plugins/IR Server Suite/Commands/Macro/Properties/AssemblyInfo.cs =... [truncated message content] |
From: <an...@us...> - 2008-01-19 09:11:19
|
Revision: 1272 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1272&view=rev Author: and-81 Date: 2008-01-19 01:11:17 -0800 (Sat, 19 Jan 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Commands/TestApp/TestApp.csproj trunk/plugins/IR Server Suite/IR Server Suite.sln Added Paths: ----------- trunk/plugins/IR Server Suite/Commands/CommandProcessor/ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandBlastIR.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandCallMacro.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandProcessor.csproj trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditBlastIR.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditBlastIR.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditBlastIR.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMacro.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Macro.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Processor.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Properties/AssemblyInfo.cs Removed Paths: ------------- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandBlastIR.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandCallMacro.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMacro.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Macro.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Macro.csproj trunk/plugins/IR Server Suite/Commands/CommandProcessor/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Commands/Macro/ Copied: trunk/plugins/IR Server Suite/Commands/CommandProcessor (from rev 1270, trunk/plugins/IR Server Suite/Commands/Macro) Deleted: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandBlastIR.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/Macro/CommandBlastIR.cs 2008-01-19 08:02:20 UTC (rev 1270) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandBlastIR.cs 2008-01-19 09:11:17 UTC (rev 1272) @@ -1,79 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows.Forms; - -using IrssUtils; - -namespace Commands -{ - - /// <summary> - /// Blast IR macro command. - /// </summary> - public class CommandBlastIR : Command - { - - #region Constructors - - /// <summary> - /// Initializes a new instance of the <see cref="CommandBlastIR"/> class. - /// </summary> - public CommandBlastIR() { InitParameters(2); } - - /// <summary> - /// Initializes a new instance of the <see cref="CommandBlastIR"/> class. - /// </summary> - /// <param name="parameters">The parameters.</param> - public CommandBlastIR(string[] parameters) : base(parameters) { } - - #endregion Constructors - - #region Implementation - - /// <summary> - /// Gets the category of this command. - /// </summary> - /// <returns>The category of this command.</returns> - public override string GetCategory() { return Macro.Category; } - - /// <summary> - /// Gets the user interface text. - /// </summary> - /// <returns>User interface text.</returns> - public override string GetUserInterfaceText() { return "Blast IR"; } - - /// <summary> - /// Gets the user display text. - /// </summary> - /// <returns>The user display text.</returns> - public override string GetUserDisplayText() - { - return String.Format("{0} ({1})", GetUserInterfaceText(), String.Join(", ", Parameters)); - } - /* - public bool Edit(IWin32Window parent, BlastIrDelegate blastIrDelegate, string[] blastPorts) - { - EditBlastIR edit = new EditBlastIR(_parameters, blastIrDelegate, blastPorts); - if (edit.ShowDialog(parent) == DialogResult.OK) - { - _parameters = edit.Parameters; - return true; - } - - return false; - } - - public void Execute(BlastIrDelegate blastIrDelegate) - { - string irFile = Common.FolderIRCommands + _parameters[0] + Common.FileExtensionIR; - string port = _parameters[1]; - - blastIrDelegate(irFile, port); - } - */ - #endregion Implementation - - } - -} Copied: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandBlastIR.cs (from rev 1271, trunk/plugins/IR Server Suite/Commands/Macro/CommandBlastIR.cs) =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandBlastIR.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandBlastIR.cs 2008-01-19 09:11:17 UTC (rev 1272) @@ -0,0 +1,97 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Windows.Forms; + +using IrssUtils; + +namespace Commands +{ + + /// <summary> + /// Blast IR macro command. + /// </summary> + public class CommandBlastIR : Command + { + + #region Constructors + + /// <summary> + /// Initializes a new instance of the <see cref="CommandBlastIR"/> class. + /// </summary> + public CommandBlastIR() { InitParameters(2); } + + /// <summary> + /// Initializes a new instance of the <see cref="CommandBlastIR"/> class. + /// </summary> + /// <param name="parameters">The parameters.</param> + public CommandBlastIR(string[] parameters) : base(parameters) { } + + #endregion Constructors + + #region Implementation + + /// <summary> + /// Gets the category of this command. + /// </summary> + /// <returns>The category of this command.</returns> + public override string GetCategory() { return Processor.CategoryHidden; } + + /// <summary> + /// Gets the user interface text. + /// </summary> + /// <returns>User interface text.</returns> + public override string GetUserInterfaceText() { return "Blast IR"; } + + /// <summary> + /// Gets the user display text. + /// </summary> + /// <returns>The user display text.</returns> + public override string GetUserDisplayText() + { + string fileName = _parameters[0]; + + if (_parameters[0].StartsWith(Common.FolderAppData, StringComparison.OrdinalIgnoreCase)) + fileName = _parameters[0].Substring(Common.FolderAppData.Length); + + return String.Format("{0} ({1}, {2})", GetUserInterfaceText(), fileName, _parameters[1]); + } + + /// <summary> + /// Edit this command. + /// </summary> + /// <param name="parent">The parent window.</param> + /// <param name="blastIrDelegate">The blast ir delegate.</param> + /// <param name="blastPorts">The blast ports.</param> + /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> + public bool Edit(IWin32Window parent, BlastIrDelegate blastIrDelegate, string[] blastPorts) + { + EditBlastIR edit = new EditBlastIR(blastIrDelegate, blastPorts, _parameters); + if (edit.ShowDialog(parent) == DialogResult.OK) + { + _parameters = edit.Parameters; + return true; + } + + return false; + } + + /// <summary> + /// Execute this command. + /// </summary> + /// <param name="blastIrDelegate">The blast ir delegate.</param> + public void Execute(BlastIrDelegate blastIrDelegate) + { + string irFile = _parameters[0] + Common.FileExtensionIR; + string port = _parameters[1]; + + blastIrDelegate(irFile, port); + } + + #endregion Implementation + + + } + +} Deleted: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandCallMacro.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/Macro/CommandCallMacro.cs 2008-01-19 08:02:20 UTC (rev 1270) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandCallMacro.cs 2008-01-19 09:11:17 UTC (rev 1272) @@ -1,67 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows.Forms; - -namespace Commands -{ - - /// <summary> - /// Call Macro macro command. - /// </summary> - public class CommandCallMacro : Command - { - - #region Constructors - - /// <summary> - /// Initializes a new instance of the <see cref="CommandCallMacro"/> class. - /// </summary> - public CommandCallMacro() { InitParameters(1); } - - /// <summary> - /// Initializes a new instance of the <see cref="CommandCallMacro"/> class. - /// </summary> - /// <param name="parameters">The parameters.</param> - public CommandCallMacro(string [] parameters): base(parameters) { } - - #endregion Constructors - - #region Implementation - - /// <summary> - /// Gets the category of this command. - /// </summary> - /// <returns>The category of this command.</returns> - public override string GetCategory() { return Macro.HiddenCategory; } - - /// <summary> - /// Gets the user interface text. - /// </summary> - /// <returns>User interface text.</returns> - public override string GetUserInterfaceText() { return "Macro"; } - - /// <summary> - /// Gets the user display text. - /// </summary> - /// <returns>The user display text.</returns> - public override string GetUserDisplayText() - { - return String.Format("{0} ({1})", GetUserInterfaceText(), String.Join(", ", Parameters)); - } - - /// <summary> - /// Execute this command. - /// </summary> - /// <param name="variables">The variable list of the calling code.</param> - public override void Execute(VariableList variables) - { - Macro macro = new Macro(_parameters[0]); - macro.Execute(variables); - } - - #endregion Implementation - - } - -} Copied: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandCallMacro.cs (from rev 1271, trunk/plugins/IR Server Suite/Commands/Macro/CommandCallMacro.cs) =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandCallMacro.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandCallMacro.cs 2008-01-19 09:11:17 UTC (rev 1272) @@ -0,0 +1,70 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows.Forms; + +using IrssUtils; + +namespace Commands +{ + + /// <summary> + /// Call Macro macro command. + /// </summary> + public class CommandCallMacro : Command + { + + #region Constructors + + /// <summary> + /// Initializes a new instance of the <see cref="CommandCallMacro"/> class. + /// </summary> + public CommandCallMacro() { InitParameters(1); } + + /// <summary> + /// Initializes a new instance of the <see cref="CommandCallMacro"/> class. + /// </summary> + /// <param name="parameters">The parameters.</param> + public CommandCallMacro(string [] parameters): base(parameters) { } + + #endregion Constructors + + #region Implementation + + /// <summary> + /// Gets the category of this command. + /// </summary> + /// <returns>The category of this command.</returns> + public override string GetCategory() { return Processor.CategoryHidden; } + + /// <summary> + /// Gets the user interface text. + /// </summary> + /// <returns>User interface text.</returns> + public override string GetUserInterfaceText() { return "Macro"; } + + /// <summary> + /// Gets the user display text. + /// </summary> + /// <returns>The user display text.</returns> + public override string GetUserDisplayText() + { + return String.Format("{0} ({1})", GetUserInterfaceText(), String.Join(", ", Parameters)); + } + + /// <summary> + /// Execute this command. + /// </summary> + /// <param name="variables">The variable list of the calling code.</param> + /// <param name="blastIrDelegate">The blast ir delegate.</param> + public void Execute(VariableList variables, BlastIrDelegate blastIrDelegate) + { + Macro macro = new Macro(_parameters[0]); + macro.Execute(variables, blastIrDelegate); + } + + #endregion Implementation + + } + +} Copied: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandProcessor.csproj (from rev 1271, trunk/plugins/IR Server Suite/Commands/Macro/CommandProcessor.csproj) =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandProcessor.csproj (rev 0) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandProcessor.csproj 2008-01-19 09:11:17 UTC (rev 1272) @@ -0,0 +1,142 @@ +<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>{49CF376E-811C-4EB4-817F-A39C9529B608}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>Commands</RootNamespace> + <AssemblyName>CommandProcessor</AssemblyName> + <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> + <UseVSHostingProcess>false</UseVSHostingProcess> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <DocumentationFile>bin\Debug\CommandProcessor.xml</DocumentationFile> + </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> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Processor.cs" /> + <Compile Include="EditBlastIR.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="EditBlastIR.Designer.cs"> + <DependentUpon>EditBlastIR.cs</DependentUpon> + </Compile> + <Compile Include="CommandClearVariables.cs" /> + <Compile Include="CommandIf.cs" /> + <Compile Include="CommandLabel.cs" /> + <Compile Include="CommandGotoLabel.cs" /> + <Compile Include="CommandSetVariable.cs" /> + <Compile Include="CommandSaveVariables.cs" /> + <Compile Include="CommandLoadVariables.cs" /> + <Compile Include="CommandCallMacro.cs" /> + <Compile Include="CommandBlastIR.cs" /> + <Compile Include="EditIf.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="EditIf.Designer.cs"> + <DependentUpon>EditIf.cs</DependentUpon> + </Compile> + <Compile Include="EditLabel.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="EditLabel.Designer.cs"> + <DependentUpon>EditLabel.cs</DependentUpon> + </Compile> + <Compile Include="Macro.cs" /> + <Compile Include="EditMacro.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="EditMacro.Designer.cs"> + <DependentUpon>EditMacro.cs</DependentUpon> + </Compile> + <Compile Include="MacroStructureException.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="EditSetVariable.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="EditSetVariable.Designer.cs"> + <DependentUpon>EditSetVariable.cs</DependentUpon> + </Compile> + <Compile Include="EditVariablesFile.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="EditVariablesFile.Designer.cs"> + <DependentUpon>EditVariablesFile.cs</DependentUpon> + </Compile> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="EditBlastIR.resx"> + <DependentUpon>EditBlastIR.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> + <EmbeddedResource Include="EditIf.resx"> + <DependentUpon>EditIf.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> + <EmbeddedResource Include="EditMacro.resx"> + <DependentUpon>EditMacro.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> + <EmbeddedResource Include="EditLabel.resx"> + <DependentUpon>EditLabel.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> + <EmbeddedResource Include="EditSetVariable.resx"> + <DependentUpon>EditSetVariable.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> + <EmbeddedResource Include="EditVariablesFile.resx"> + <DependentUpon>EditVariablesFile.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\Common\IrssUtils\IrssUtils.csproj"> + <Project>{CA15769C-232E-4CA7-94FD-206A06CA3ABB}</Project> + <Name>IrssUtils</Name> + <Private>False</Private> + </ProjectReference> + <ProjectReference Include="..\Command\Command.csproj"> + <Project>{21E04B17-D850-43E7-AAD3-876C0E062BDB}</Project> + <Name>Command</Name> + <Private>False</Private> + </ProjectReference> + <ProjectReference Include="..\VariableList\VariableList.csproj"> + <Project>{106A69D2-670C-4DE5-A81C-A3CD5D3F21EB}</Project> + <Name>VariableList</Name> + <Private>False</Private> + </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 Copied: trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditBlastIR.Designer.cs (from rev 1271, trunk/plugins/IR Server Suite/Commands/Macro/EditBlastIR.Designer.cs) =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditBlastIR.Designer.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditBlastIR.Designer.cs 2008-01-19 09:11:17 UTC (rev 1272) @@ -0,0 +1,174 @@ +namespace Commands +{ + + partial class EditBlastIR + { + /// <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.labelIRFile = new System.Windows.Forms.Label(); + this.labelBlasterPort = new System.Windows.Forms.Label(); + this.comboBoxPort = new System.Windows.Forms.ComboBox(); + this.labelIRCommandFile = new System.Windows.Forms.Label(); + this.buttonTest = new System.Windows.Forms.Button(); + this.buttonOK = new System.Windows.Forms.Button(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.checkBoxUseForAll = new System.Windows.Forms.CheckBox(); + this.toolTips = new System.Windows.Forms.ToolTip(this.components); + this.SuspendLayout(); + // + // labelIRFile + // + this.labelIRFile.Location = new System.Drawing.Point(8, 8); + this.labelIRFile.Name = "labelIRFile"; + this.labelIRFile.Size = new System.Drawing.Size(88, 20); + this.labelIRFile.TabIndex = 0; + this.labelIRFile.Text = "IR Command:"; + this.labelIRFile.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // labelBlasterPort + // + this.labelBlasterPort.Location = new System.Drawing.Point(8, 40); + this.labelBlasterPort.Name = "labelBlasterPort"; + this.labelBlasterPort.Size = new System.Drawing.Size(88, 21); + this.labelBlasterPort.TabIndex = 2; + this.labelBlasterPort.Text = "Blaster port:"; + this.labelBlasterPort.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // comboBoxPort + // + this.comboBoxPort.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.comboBoxPort.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxPort.FormattingEnabled = true; + this.comboBoxPort.Location = new System.Drawing.Point(96, 40); + this.comboBoxPort.Name = "comboBoxPort"; + this.comboBoxPort.Size = new System.Drawing.Size(160, 21); + this.comboBoxPort.TabIndex = 3; + this.toolTips.SetToolTip(this.comboBoxPort, "Choose the blaster port to transmit this command to"); + // + // labelIRCommandFile + // + this.labelIRCommandFile.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.labelIRCommandFile.AutoEllipsis = true; + this.labelIRCommandFile.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + this.labelIRCommandFile.Location = new System.Drawing.Point(96, 8); + this.labelIRCommandFile.Name = "labelIRCommandFile"; + this.labelIRCommandFile.Size = new System.Drawing.Size(248, 20); + this.labelIRCommandFile.TabIndex = 1; + this.labelIRCommandFile.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // buttonTest + // + this.buttonTest.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonTest.Location = new System.Drawing.Point(8, 72); + this.buttonTest.Name = "buttonTest"; + this.buttonTest.Size = new System.Drawing.Size(56, 24); + this.buttonTest.TabIndex = 4; + this.buttonTest.Text = "Test"; + this.toolTips.SetToolTip(this.buttonTest, "Test this blast command"); + this.buttonTest.UseVisualStyleBackColor = true; + this.buttonTest.Click += new System.EventHandler(this.buttonTest_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(224, 72); + this.buttonOK.Name = "buttonOK"; + this.buttonOK.Size = new System.Drawing.Size(56, 24); + this.buttonOK.TabIndex = 6; + 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(288, 72); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(56, 24); + this.buttonCancel.TabIndex = 7; + this.buttonCancel.Text = "Cancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); + // + // checkBoxUseForAll + // + this.checkBoxUseForAll.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.checkBoxUseForAll.Location = new System.Drawing.Point(72, 72); + this.checkBoxUseForAll.Name = "checkBoxUseForAll"; + this.checkBoxUseForAll.Size = new System.Drawing.Size(144, 24); + this.checkBoxUseForAll.TabIndex = 5; + this.checkBoxUseForAll.Text = "Use this port for all"; + this.toolTips.SetToolTip(this.checkBoxUseForAll, "Use the selected blaster port for all blast commands in this group"); + this.checkBoxUseForAll.UseVisualStyleBackColor = true; + this.checkBoxUseForAll.Visible = false; + // + // BlastCommand + // + 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(352, 105); + this.Controls.Add(this.checkBoxUseForAll); + this.Controls.Add(this.buttonOK); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.buttonTest); + this.Controls.Add(this.labelIRCommandFile); + this.Controls.Add(this.labelBlasterPort); + this.Controls.Add(this.comboBoxPort); + this.Controls.Add(this.labelIRFile); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(360, 132); + this.Name = "BlastCommand"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Blast Command"; + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Label labelIRFile; + private System.Windows.Forms.Label labelBlasterPort; + private System.Windows.Forms.ComboBox comboBoxPort; + private System.Windows.Forms.Label labelIRCommandFile; + private System.Windows.Forms.Button buttonTest; + private System.Windows.Forms.Button buttonOK; + private System.Windows.Forms.Button buttonCancel; + private System.Windows.Forms.CheckBox checkBoxUseForAll; + private System.Windows.Forms.ToolTip toolTips; + } + +} Copied: trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditBlastIR.cs (from rev 1271, trunk/plugins/IR Server Suite/Commands/Macro/EditBlastIR.cs) =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditBlastIR.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditBlastIR.cs 2008-01-19 09:11:17 UTC (rev 1272) @@ -0,0 +1,162 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +using IrssUtils; + +namespace Commands +{ + + /// <summary> + /// Edit Blast IR Command form. + /// </summary> + public partial class EditBlastIR : Form + { + + #region Properties + + /// <summary> + /// Gets the command parameters. + /// </summary> + /// <value>The command parameters.</value> + public string[] Parameters + { + get + { + return new string[] { + _fileName, + comboBoxPort.SelectedItem as string }; + } + } + + /// <summary> + /// Gets or sets the blaster port. + /// </summary> + /// <value>The blaster port.</value> + public string BlasterPort + { + get { return comboBoxPort.SelectedItem as string; } + set { comboBoxPort.SelectedItem = value; } + } + + /// <summary> + /// Gets a value indicating whether to use this commands details for all in the batch. + /// </summary> + /// <value><c>true</c> if use for all; otherwise, <c>false</c>.</value> + public bool UseForAll + { + get { return checkBoxUseForAll.Checked; } + } + + #endregion Properties + + #region Variables + + BlastIrDelegate _blastIrDelegate; + string _fileName; + + #endregion Variables + + #region Constructors + + /// <summary> + /// Initializes a new instance of the <see cref="EditBlastIR"/> class. + /// </summary> + /// <param name="blastIrDelegate">The blast IR delegate.</param> + /// <param name="ports">The available ports.</param> + EditBlastIR(BlastIrDelegate blastIrDelegate, string[] ports) + { + if (blastIrDelegate == null) + throw new ArgumentNullException("blastIrDelegate"); + + if (ports == null) + throw new ArgumentNullException("ports"); + + InitializeComponent(); + + _blastIrDelegate = blastIrDelegate; + + comboBoxPort.Items.AddRange(ports); + comboBoxPort.SelectedIndex = 0; + } + + /// <summary> + /// Initializes a new instance of the <see cref="EditBlastIR"/> class. + /// </summary> + /// <param name="blastIrDelegate">The blast IR delegate.</param> + /// <param name="ports">The available ports.</param> + /// <param name="parameters">The command parameters.</param> + public EditBlastIR(BlastIrDelegate blastIrDelegate, string[] ports, string[] parameters) + : this(blastIrDelegate, ports) + { + if (parameters == null) + throw new ArgumentNullException("parameters"); + + _fileName = parameters[0]; + + string displayName = _fileName; + if (_fileName.StartsWith(Common.FolderAppData, StringComparison.OrdinalIgnoreCase)) + displayName = _fileName.Substring(Common.FolderAppData.Length); + + labelIRCommandFile.Text = displayName; + + if (comboBoxPort.Items.Contains(parameters[1])) + comboBoxPort.SelectedItem = parameters[1]; + } + + /// <summary> + /// Initializes a new instance of the <see cref="EditBlastIR"/> class. + /// </summary> + /// <param name="blastIrDelegate">The blast IR delegate.</param> + /// <param name="ports">The available ports.</param> + /// <param name="parameters">The command parameters.</param> + /// <param name="commandCount">The command count for this batch of commands.</param> + public EditBlastIR(BlastIrDelegate blastIrDelegate, string[] ports, string[] parameters, int commandCount) + : this(blastIrDelegate, ports, parameters) + { + if (commandCount > 1) + { + checkBoxUseForAll.Text = String.Format("Use this port for all ({0})", commandCount); + checkBoxUseForAll.Visible = true; + } + } + + #endregion Constructors + + #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(); + } + + private void buttonTest_Click(object sender, EventArgs e) + { + try + { + string fileName = _fileName + Common.FileExtensionIR; + string port = comboBoxPort.SelectedItem as string; + + _blastIrDelegate(fileName, port); + } + catch (Exception ex) + { + MessageBox.Show(this, ex.Message, "Test failed", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + #endregion Buttons + + } + +} Copied: trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditBlastIR.resx (from rev 1271, trunk/plugins/IR Server Suite/Commands/Macro/EditBlastIR.resx) =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditBlastIR.resx (rev 0) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditBlastIR.resx 2008-01-19 09:11:17 UTC (rev 1272) @@ -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 Deleted: trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMacro.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/Macro/EditMacro.cs 2008-01-19 08:02:20 UTC (rev 1270) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMacro.cs 2008-01-19 09:11:17 UTC (rev 1272) @@ -1,406 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -#if TRACE -using System.Diagnostics; -#endif -using System.Drawing; -using System.IO; -using System.Text; -using System.Windows.Forms; -using System.Xml; - -using IrssUtils; -//using IrssUtils.Forms; - -namespace Commands -{ - - /// <summary> - /// Edit Macro form. - /// </summary> - public partial class EditMacro : Form - { - - #region Variables - - string _macroFolder; - VariableList _variableList; - IrssUtils.BlastIrDelegate _blastIrDelegate; - string[] _blastIrPorts; - - Dictionary<string, Type> _commands; - - #endregion Variables - - #region Constructor - - /// <summary> - /// Creates a Macro Editor windows form. - /// </summary> - /// <param name="macroFolder">The macro folder.</param> - /// <param name="variables">The variable list.</param> - /// <param name="blastIrDelegate">The blast ir delegate.</param> - /// <param name="blastIrPorts">The blast ir ports.</param> - /// <param name="categories">The command categories to include.</param> - public EditMacro(string macroFolder, VariableList variables, IrssUtils.BlastIrDelegate blastIrDelegate, string[] blastIrPorts, string[] categories) - { - if (String.IsNullOrEmpty(macroFolder)) - throw new ArgumentNullException("macroFolder"); - - if (variables == null) - throw new ArgumentNullException("variables"); - - if (blastIrDelegate == null) - throw new ArgumentNullException("blastIrDelegate"); - - if (blastIrPorts == null) - throw new ArgumentNullException("blastIrPorts"); - - if (categories == null) - throw new ArgumentNullException("categories"); - - InitializeComponent(); - - _macroFolder = macroFolder; - _variableList = variables; - _blastIrDelegate = blastIrDelegate; - _blastIrPorts = blastIrPorts; - - PopulateCommandList(categories); - - textBoxName.Text = "New"; - textBoxName.Enabled = true; - } - - /// <summary> - /// Creates a Macro Editor windows form. - /// </summary> - /// <param name="macroFolder">The macro folder.</param> - /// <param name="variables">The variable list.</param> - /// <param name="blastIrDelegate">The blast ir delegate.</param> - /// <param name="blastIrPorts">The blast ir ports.</param> - /// <param name="categories">The command categories to include.</param> - /// <param name="name">The existing macro name.</param> - public EditMacro(string macroFolder, VariableList variables, IrssUtils.BlastIrDelegate blastIrDelegate, string[] blastIrPorts, string[] categories, string name) - { - if (String.IsNullOrEmpty(macroFolder)) - throw new ArgumentNullException("macroFolder"); - - if (variables == null) - throw new ArgumentNullException("variables"); - - if (blastIrDelegate == null) - throw new ArgumentNullException("blastIrDelegate"); - - if (blastIrPorts == null) - throw new ArgumentNullException("blastIrPorts"); - - if (categories == null) - throw new ArgumentNullException("categories"); - - if (String.IsNullOrEmpty(name)) - throw new ArgumentNullException("name"); - - InitializeComponent(); - - _macroFolder = macroFolder; - _variableList = variables; - _blastIrDelegate = blastIrDelegate; - _blastIrPorts = blastIrPorts; - - PopulateCommandList(categories); - - textBoxName.Text = name; - textBoxName.Enabled = false; - - string fileName = macroFolder + name + Macro.FileExtension; - Macro macro = new Macro(fileName); - foreach (Command command in macro.Commands) - { - ListViewItem item = new ListViewItem(command.GetUserDisplayText()); - item.Tag = command.ToString(); - listViewMacro.Items.Add(item); - } - } - - #endregion Constructor - - #region Implementation - - void PopulateCommandList(string[] categories) - { - _commands = new Dictionary<string, Type>(); - - treeViewCommandList.Nodes.Clear(); - - Dictionary<string, TreeNode> treeNodes = new Dictionary<string,TreeNode>(categories.Length); - - TreeNode macroCommands = new TreeNode(Macro.Category); - - Type[] specialCommands = Macro.GetSpecialCommands(); - - foreach (Type type in specialCommands) - { - Command command = (Command)Activator.CreateInstance(type); - - if (command.GetCategory().Equals(Macro.HiddenCategory, StringComparison.OrdinalIgnoreCase)) - continue; - - macroCommands.Nodes.Add(command.GetUserInterfaceText()); - _commands.Add(command.GetUserInterfaceText(), type); - } - - treeNodes.Add(Macro.Category, macroCommands); - - foreach (string category in categories) - treeNodes.Add(category, new TreeNode(category)); - - Type[] allCommands = Common.GetLibraryCommands(); - if (allCommands != null) - { - foreach (Type type in allCommands) - { - Command command = (Command)Activator.CreateInstance(type); - - string commandCategory = command.GetCategory(); - - if (treeNodes.ContainsKey(commandCategory)) - { - string uiText = command.GetUserInterfaceText(); - treeNodes[commandCategory].Nodes.Add(uiText); - _commands.Add(uiText, type); - } - } - } - - string[] macros = Macro.GetList(_macroFolder); - if (macros != null) - { - TreeNode otherMacros = new TreeNode("Macros"); - - foreach (string macro in macros) - otherMacros.Nodes.Add(macro); - - treeNodes.Add(otherMacros.Text, otherMacros); - } - - foreach (TreeNode treeNode in treeNodes.Values) - if (treeNode.Nodes.Count > 0) - treeViewCommandList.Nodes.Add(treeNode); - - treeViewCommandList.ExpandAll(); - } - - private void treeViewCommandList_DoubleClick(object sender, EventArgs e) - { - if (treeViewCommandList.SelectedNode == null || treeViewCommandList.SelectedNode.Level == 0) - return; - - try - { - string selected = treeViewCommandList.SelectedNode.Text as string; - - ListViewItem newCommand = new ListViewItem(); - Command command; - - if (treeViewCommandList.SelectedNode.Parent.Text.Equals("Macros", StringComparison.OrdinalIgnoreCase)) - { - command = new CommandCallMacro(new string[] { selected }); - - newCommand.Text = command.GetUserDisplayText(); - newCommand.Tag = command.ToString(); - listViewMacro.Items.Add(newCommand); - } - else if (_commands.ContainsKey(selected)) - { - - command = (Command)Activator.CreateInstance(_commands[selected]); - - /*if (command is CommandBlast) - { - if (command.Edit(this, _blastIrDelegate, _blastIrPorts)) - { - newCommand.Text = command.GetUserDisplayText(); - newCommand.Tag = command.ToXml(); - listViewMacro.Items.Add(newCommand); - } - - } - else*/ - { - if (command.Edit(this)) - { - newCommand.Text = command.GetUserDisplayText(); - newCommand.Tag = command.ToString(); - listViewMacro.Items.Add(newCommand); - } - } - } - else - { - throw new ApplicationException(String.Format("Unknown macro command ({0})", selected)); - } - } - catch (Exception ex) - { - IrssLog.Error(ex); - MessageBox.Show(this, ex.Message, "Failed to add macro command", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - - private void buttonMoveUp_Click(object sender, EventArgs e) - { - if (listViewMacro.SelectedItems.Count != 1) - return; - - int selected = listViewMacro.SelectedIndices[0]; - if (selected > 0) - { - ListViewItem item = listViewMacro.Items[selected]; - listViewMacro.Items.RemoveAt(selected); - listViewMacro.Items.Insert(selected - 1, item); - item.Selected = true; - } - } - private void buttonMoveDown_Click(object sender, EventArgs e) - { - if (listViewMacro.SelectedItems.Count != 1) - return; - - int selected = listViewMacro.SelectedIndices[0]; - if (selected < listViewMacro.Items.Count - 1) - { - ListViewItem item = listViewMacro.Items[selected]; - listViewMacro.Items.RemoveAt(selected); - listViewMacro.Items.Insert(selected + 1, item); - item.Selected = true; - } - } - - private void buttonRemove_Click(object sender, EventArgs e) - { - if (listViewMacro.SelectedItems.Count == 1) - listViewMacro.Items.RemoveAt(listViewMacro.SelectedIndices[0]); - } - - private void buttonTest_Click(object sender, EventArgs e) - { - string name = textBoxName.Text.Trim(); - - if (name.Length == 0) - { - MessageBox.Show(this, "You must supply a name for this Macro", "Name missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - textBoxName.Focus(); - return; - } - - if (!Common.IsValidFileName(name)) - { - MessageBox.Show(this, "You must supply a valid name for this Macro", "Invalid name", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - textBoxName.Focus(); - return; - } - - try - { - string[] commands = new string[listViewMacro.Items.Count]; - - Macro newMacro = new Macro(); - foreach (ListViewItem item in listViewMacro.Items) - { - string itemTag = item.Tag as string; - Command command = Macro.CreateCommand(itemTag); - newMacro.Commands.Add(command); - } - - newMacro.Execute(_variableList); - } - catch (Exception ex) - { - IrssLog.Error(ex); - MessageBox.Show(this, ex.Message, "Test failed", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - - private void buttonCancel_Click(object sender, EventArgs e) - { - this.DialogResult = DialogResult.Cancel; - this.Close(); - } - - private void buttonOK_Click(object sender, EventArgs e) - { - string name = textBoxName.Text.Trim(); - - if (name.Length == 0) - { - MessageBox.Show(this, "You must supply a name for this Macro", "Name missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - textBoxName.Focus(); - return; - } - - if (!Common.IsValidFileName(name)) - { - MessageBox.Show(this, "You must supply a valid name for this Macro", "Invalid name", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - textBoxName.Focus(); - return; - } - - try - { - string[] commands = new string[listViewMacro.Items.Count]; - - Macro newMacro = new Macro(); - foreach (ListViewItem item in listViewMacro.Items) - { - string itemTag = item.Tag as string; - Command command = Macro.CreateCommand(itemTag); - newMacro.Commands.Add(command); - } - - newMacro.Save(_macroFolder + name + Macro.FileExtension); - } - catch (Exception ex) - { - IrssLog.Error(ex); - MessageBox.Show(this, ex.Message, "Failed writing macro to file", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - - this.DialogResult = DialogResult.OK; - this.Close(); - } - - #endregion Implementation - - private void listViewMacro_DoubleClick(object sender, EventArgs e) - { - try - { - ListViewItem selected = listViewMacro.SelectedItems[0]; - - string selectedTag = selected.Tag as string; - Command command = Macro.CreateCommand(selectedTag); - - //if (command is CommandBlast) - //{ - //} - //else - { - if (command.Edit(this)) - { - selected.Text = command.GetUserDisplayText(); - selected.Tag = command.ToString(); - } - } - } - catch (Exception ex) - { - IrssLog.Error(ex); - MessageBox.Show(this, ex.Message, "Failed to edit macro command", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - - } - -} Copied: trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMacro.cs (from rev 1271, trunk/plugins/IR Server Suite/Commands/Macro/EditMacro.cs) =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMacro.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMacro.cs 2008-01-19 09:11:17 UTC (rev 1272) @@ -0,0 +1,389 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +#if TRACE +using System.Diagnostics; +#endif +using System.Drawing; +using System.IO; +using System.Text; +using System.Windows.Forms; +using System.Xml; + +using IrssUtils; + +namespace Commands +{ + + /// <summary> + /// Edit Macro form. + /// </summary> + public partial class EditMacro : Form + { + + #region Variables + + Processor _commandProcessor; + + string _macroFolder; + string _fileName; + + Dictionary<string, Type> _commands; + + #endregion Variables + + #region Constructor + + /// <summary> + /// Creates a Macro Editor windows form. + /// </summary> + /// <param name="commandProcessor">The command processor.</param> + /// <param name="macroFolder">The macro folder.</param> + /// <param name="categories">The command categories to include.</param> + public EditMacro(Processor commandProcessor, string macroFolder, string[] categories) + { + if (commandProcessor == null) + throw new ArgumentNullException("commandProcessor"); + + if (String.IsNullOrEmpty(macroFolder)) + throw new ArgumentNullException("macroFolder"); + + if (categories == null) + throw new ArgumentNullException("categories"); + + InitializeComponent(); + + _commandProcessor = commandProcessor; + _macroFolder = macroFolder; + + PopulateCommandList(categories); + + textBoxName.Text = "New"; + textBoxName.Enabled = true; + } + + /// <summary> + /// Creates a Macro Editor windows form. + /// </summary> + /// <param name="commandProcessor">The command processor.</param> + /// <param name="categories">The command categories to include.</param> + /// <param name="fileName">Name of the macro file.</param> + public EditMacro(Processor commandProcessor, string[] categories, string fileName) + { + if (commandProcessor == null) + throw new ArgumentNullException("commandProcessor"); + + if (categories == null) + throw new ArgumentNullException("categories"); + + if (String.IsNullOrEmpty(fileName)) + throw new ArgumentNullException("fileName"); + + InitializeComponent(); + + _commandProcessor = commandProcessor; + _fileName = fileName; + + PopulateCommandList(categories); + + string macroName = fileName; + + if (macroName.StartsWith(Common.FolderAppData, StringComparison.OrdinalIgnoreCase)) + macroName = fileName.Substring(Common.FolderAppData.Length); + + textBoxName.Text = macroName; + textBoxName.Enabled = false; + + Macro macro = new Macro(fileName + Processor.FileExtensionMacro); + foreach (Command command in macro.Commands) + { + ListViewItem item = new ListViewItem(command.GetUserDisplayText()); + item.Tag = command.ToString(); + listViewMacro.Items.Add(item); + } + } + + #endregion Constructor + + #region Implementation + + void PopulateCommandList(string[] categories) + { + _commands = new Dictionary<string, Type>(); + treeViewCommandList.Nodes.Clear(); + Dictionary<string, TreeNode> treeNodes = new Dictionary<string,TreeNode>(categories.Length); + + TreeNode macroCommands = new TreeNode(Macro.Category); + Type[] specialCommands = Processor.GetSpecialCommands(); + foreach (Type type in specialCommands) + { + Command command = (Command)Activator.CreateInstance(type); + + if (!command.GetCategory().Equals(Processor.CategoryHidden, StringComparison.OrdinalIgnoreCase)) + macroCommands.Nodes.Add(command.GetUserInterfaceText()); + + _commands.Add(command.GetUserInterfaceText(), type); + } + + treeNodes.Add(Macro.Category, macroCommands); + + foreach (string category in categories) + treeNodes.Add(category, new TreeNode(category)); + + Type[] allCommands = Common.GetLibraryCommands(); + if (allCommands != null) + { + foreach (Type type in allCommands) + { + Command command = (Command)Activator.CreateInstance(type); + + string commandCategory = command.GetCategory(); + + if (treeNodes.ContainsKey(commandCategory)) + { + string uiText = command.GetUserInterfaceText(); + treeNodes[commandCategory].Nodes.Add(uiText); + _commands.Add(uiText, type); + } + } + } + + string[] irFiles = Processor.GetListIR(); + if (irFiles != null) + { + TreeNode irCommands = new TreeNode("IR Commands"); + + foreach (string irFile in irFiles) + { + TreeNode newNode = new TreeNode(irFile); + newNode.Tag = Common.FolderIRCommands + irFile; + irCommands.Nodes.Add(newNode); + } + + treeNodes.Add(irCommands.Text, irCommands); + } + + + string[] macros = Processor.GetListMacro(_macroFolder); + if (macros != null) + { + TreeNode otherMacros = new TreeNode("Macros"); + + foreach (string macro in macros) + otherMacros.Nodes.Add(macro); + + treeNodes.Add(otherMacros.Text, otherMacros); + } + + foreach (TreeNode treeNode in treeNodes.Values) + if (treeNode.Nodes.Count > 0) + treeViewCommandList.Nodes.Add(treeNode); + + treeViewCommandList.ExpandAll(); + } + + private void treeViewCommandList_DoubleClick(object sender, EventArgs e) + { + if (treeViewCommandList.SelectedNode == null || treeViewCommandList.SelectedNode.Level == 0) + return; + + try + { + string selected = treeViewCommandList.SelectedNode.Text as string; + + ListViewItem newCommand = new ListViewItem(); + Command command; + + if (treeViewCommandList.SelectedNode.Parent.Text.Equals("IR Commands", StringComparison.OrdinalIgnoreCase)) + { + string selectedTag = treeViewCommandList.SelectedNode.Tag as string; + + command = new CommandBlastIR(new string[] { selectedTag, _commandProcessor.BlastIrPorts[0] }); + + if (_commandProcessor.Edit(command, this)) + { + newCommand.Text = command.GetUserDisplayText(); + newCommand.Tag = command.ToString(); + listViewMacro.Items.Add(newCommand); + } + } + else if (treeViewCommandList.SelectedNode.Parent.Text.Equals("Macros", StringComparison.OrdinalIgnoreCase)) + { + command = new CommandCallMacro(new string[] { selected }); + + newCommand.Text = command.GetUserDisplayText(); + newCommand.Tag = command.ToString(); + listViewMacro.Items.Add(newCommand); + } + else if (_commands.ContainsKey(selected)) + { + command = (Command)Activator.CreateInstance(_commands[selected]); + + if (_commandProcessor.Edit(command, this)) + { + newCommand.Text = command.GetUserDisplayText(); + newCommand.Tag = command.ToString(); + listViewMacro.Items.Add(newCommand); + } + } + else + { + throw new ApplicationException(String.Format("Unknown macro command ({0})", selected)); + } + } + catch (Exception ex) + { + IrssLog.Error(ex); + MessageBox.Show(this, ex.Message, "Failed to add macro command", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void buttonMoveUp_Click(object sender, EventArgs e) + { + if (listViewMacro.SelectedItems.Count != 1) + return; + + int selected = listViewMacro.SelectedIndices[0]; + if (selected > 0) + { + ListViewItem item = listViewMacro.Items[selected]; + listViewMacro.Items.RemoveAt(selected); + listViewMacro.Items.Insert(selected - 1, item); + item.Selected = true; + } + } + private void buttonMoveDown_Click(object sender, EventArgs e) + { + if (listViewMacro.SelectedItems.Count != 1) + return; + + int selected = listViewMacro.SelectedIndices[0]; + if (selected < listViewMacro.Items.Count - 1) + { + ListViewItem item = listViewMacro.Items[selected]; + listViewMacro.Items.RemoveAt(selected); + listViewMacro.Items.Insert(selected + 1, item); + item.Selected = true; + } + } + + private void buttonRemove_Click(object sender, EventArgs e) + { + if (listViewMacro.SelectedItems.Count == 1) + listViewMacro.Items.RemoveAt(listViewMacro.SelectedIndices[0]); + } + + private void buttonTest_Click(object sende... [truncated message content] |
From: <an...@us...> - 2008-01-19 15:24:47
|
Revision: 1274 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1274&view=rev Author: and-81 Date: 2008-01-19 07:24:40 -0800 (Sat, 19 Jan 2008) 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/MacroScope/MacroScope.csproj trunk/plugins/IR Server Suite/Commands/Command/Command.csproj trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandCallMacro.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandClearVariables.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandGotoLabel.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandIf.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandLabel.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandLoadVariables.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandProcessor.csproj trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSaveVariables.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSetVariable.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditBlastIR.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMacro.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMacro.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditSetVariable.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditVariablesFile.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Macro.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Processor.cs trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/MediaPortalCommands.csproj trunk/plugins/IR Server Suite/Commands/TestApp/Program.cs trunk/plugins/IR Server Suite/Documentation/new.html Added Paths: ----------- trunk/plugins/IR Server Suite/Commands/Command/CommandStructureException.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandMathsOperation.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandStringOperation.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSwapVariables.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMathsOperation.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMathsOperation.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMathsOperation.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditStringOperation.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditStringOperation.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditStringOperation.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditSwapVariables.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditSwapVariables.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditSwapVariables.resx trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/CommandGotoScreen.cs trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/EditGotoScreen.Designer.cs trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/EditGotoScreen.cs trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/EditGotoScreen.resx Modified: trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2008-01-19 09:25:43 UTC (rev 1273) +++ trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2008-01-19 15:24:40 UTC (rev 1274) @@ -25,7 +25,7 @@ static bool _registered; - static string _serverHost; + static string _serverHost = "localhost"; static string _blastPort = "Default"; @@ -82,7 +82,7 @@ } } - if (String.IsNullOrEmpty(_serverHost) || irCommands.Count == 0) + if (irCommands.Count == 0) { Console.WriteLine("Malformed command line parameters ..."); Console.WriteLine(); @@ -191,7 +191,7 @@ { IrssLog.Debug("Show Help"); - Console.WriteLine("IRBlast -host <server> [-port x] [-speed x] [-pad x] [-channel] <commands>"); + Console.WriteLine("IRBlast [-host x] [-port x] [-speed x] [-pad x] [-channel] <commands>"); Console.WriteLine(""); Console.WriteLine("Use -host to specify the computer that is hosting the IR Server."); Console.WriteLine("Use -port to blast to a particular blaster port (Optional)."); @@ -215,10 +215,10 @@ Console.WriteLine("This would blast the \"Turn on surround.IR\" command on the MEDIAPC computer"); Console.WriteLine("to blaster port 2 at the default blaster speed."); Console.WriteLine(""); - Console.WriteLine("IRBlast -host HTPC -pad 4 -channel 302"); + Console.WriteLine("IRBlast -pad 4 -channel 302"); Console.WriteLine(""); Console.WriteLine("This would blast the 0.IR (for padding), 3.IR, 0.IR, and 2.IR commands on"); - Console.WriteLine("the HTPC computer to the default blaster port at the default blaster speed."); + Console.WriteLine("the local computer to the default blaster port at the default blaster speed."); Console.WriteLine(""); Console.WriteLine(""); } 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-19 09:25:43 UTC (rev 1273) +++ trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2008-01-19 15:24:40 UTC (rev 1274) @@ -26,7 +26,7 @@ static bool _registered; - static string _serverHost; + static string _serverHost = "localhost"; static string _blastPort = "Default"; @@ -81,7 +81,7 @@ } } - if (String.IsNullOrEmpty(_serverHost) || irCommands.Count == 0) + if (irCommands.Count == 0) { Console.WriteLine("Malformed command line parameters ..."); Console.WriteLine(); Modified: trunk/plugins/IR Server Suite/Applications/MacroScope/MacroScope.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/MacroScope/MacroScope.csproj 2008-01-19 09:25:43 UTC (rev 1273) +++ trunk/plugins/IR Server Suite/Applications/MacroScope/MacroScope.csproj 2008-01-19 15:24:40 UTC (rev 1274) @@ -58,7 +58,7 @@ <Project>{21E04B17-D850-43E7-AAD3-876C0E062BDB}</Project> <Name>Command</Name> </ProjectReference> - <ProjectReference Include="..\..\Commands\Macro\Macro.csproj"> + <ProjectReference Include="..\..\Commands\CommandProcessor\CommandProcessor.csproj"> <Project>{49CF376E-811C-4EB4-817F-A39C9529B608}</Project> <Name>Macro</Name> </ProjectReference> Modified: trunk/plugins/IR Server Suite/Commands/Command/Command.csproj =================================================================== --- trunk/plugins/IR Server Suite/Commands/Command/Command.csproj 2008-01-19 09:25:43 UTC (rev 1273) +++ trunk/plugins/IR Server Suite/Commands/Command/Command.csproj 2008-01-19 15:24:40 UTC (rev 1274) @@ -39,6 +39,7 @@ <ItemGroup> <Compile Include="Command.cs" /> <Compile Include="CommandExecutionException.cs" /> + <Compile Include="CommandStructureException.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> <ItemGroup> Added: trunk/plugins/IR Server Suite/Commands/Command/CommandStructureException.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/Command/CommandStructureException.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/Command/CommandStructureException.cs 2008-01-19 15:24:40 UTC (rev 1274) @@ -0,0 +1,41 @@ +using System; +using System.Runtime.Serialization; + +namespace Commands +{ + + /// <summary> + /// The exception that is thrown when a structural error in a command is discovered. + /// </summary> + [Serializable] + public class CommandStructureException : ApplicationException + { + + /// <summary> + /// Initializes a new instance of the <see cref="CommandStructureException"/> class. + /// </summary> + public CommandStructureException() : base() { } + + /// <summary> + /// Initializes a new instance of the <see cref="CommandStructureException"/> class. + /// </summary> + /// <param name="message">The message.</param> + public CommandStructureException(string message) : base(message) { } + + /// <summary> + /// Initializes a new instance of the <see cref="CommandStructureException"/> class. + /// </summary> + /// <param name="message">The message.</param> + /// <param name="innerException">The inner exception.</param> + public CommandStructureException(string message, Exception innerException) : base(message, innerException) { } + + /// <summary> + /// Initializes a new instance of the <see cref="CommandStructureException"/> class. + /// </summary> + /// <param name="info">The object that holds the serialized object data.</param> + /// <param name="context">The contextual information about the source or destination.</param> + protected CommandStructureException(SerializationInfo info, StreamingContext context) : base(info, context) { } + + } + +} Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandCallMacro.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandCallMacro.cs 2008-01-19 09:25:43 UTC (rev 1273) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandCallMacro.cs 2008-01-19 15:24:40 UTC (rev 1274) @@ -49,18 +49,22 @@ /// <returns>The user display text.</returns> public override string GetUserDisplayText() { - return String.Format("{0} ({1})", GetUserInterfaceText(), String.Join(", ", Parameters)); + string fileName = _parameters[0]; + + if (_parameters[0].StartsWith(Common.FolderAppData, StringComparison.OrdinalIgnoreCase)) + fileName = _parameters[0].Substring(Common.FolderAppData.Length); + + return String.Format("{0} ({1})", GetUserInterfaceText(), fileName); } /// <summary> /// Execute this command. /// </summary> - /// <param name="variables">The variable list of the calling code.</param> - /// <param name="blastIrDelegate">The blast ir delegate.</param> - public void Execute(VariableList variables, BlastIrDelegate blastIrDelegate) + /// <param name="commandProcessor">The command processor.</param> + public void Execute(Processor commandProcessor) { Macro macro = new Macro(_parameters[0]); - macro.Execute(variables, blastIrDelegate); + macro.Execute(commandProcessor); } #endregion Implementation Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandClearVariables.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandClearVariables.cs 2008-01-19 09:25:43 UTC (rev 1273) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandClearVariables.cs 2008-01-19 15:24:40 UTC (rev 1274) @@ -33,7 +33,7 @@ /// Gets the category of this command. /// </summary> /// <returns>The category of this command.</returns> - public override string GetCategory() { return Macro.Category; } + public override string GetCategory() { return Processor.CategoryMacro; } /// <summary> /// Gets the user interface text. Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandGotoLabel.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandGotoLabel.cs 2008-01-19 09:25:43 UTC (rev 1273) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandGotoLabel.cs 2008-01-19 15:24:40 UTC (rev 1274) @@ -18,13 +18,13 @@ /// Initializes a new instance of the <see cref="CommandGotoLabel"/> class. /// </summary> public CommandGotoLabel() { InitParameters(1); } - + /// <summary> /// Initializes a new instance of the <see cref="CommandGotoLabel"/> class. /// </summary> /// <param name="parameters">The parameters.</param> public CommandGotoLabel(string[] parameters) : base(parameters) { } - + #endregion Constructors #region Implementation @@ -33,7 +33,7 @@ /// Gets the category of this command. /// </summary> /// <returns>The category of this command.</returns> - public override string GetCategory() { return Macro.Category; } + public override string GetCategory() { return Processor.CategoryMacro; } /// <summary> /// Gets the user interface text. @@ -42,15 +42,6 @@ public override string GetUserInterfaceText() { return "Goto Label"; } /// <summary> - /// Gets the user display text. - /// </summary> - /// <returns>The user display text.</returns> - public override string GetUserDisplayText() - { - return String.Format("{0} ({1})", GetUserInterfaceText(), String.Join(", ", Parameters)); - } - - /// <summary> /// Edit this command. /// </summary> /// <param name="parent">The parent window.</param> Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandIf.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandIf.cs 2008-01-19 09:25:43 UTC (rev 1273) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandIf.cs 2008-01-19 15:24:40 UTC (rev 1274) @@ -7,7 +7,7 @@ { /// <summary> - /// If macro command. + /// If Statement macro command. /// </summary> public class CommandIf : Command { @@ -50,24 +50,15 @@ /// Gets the category of this command. /// </summary> /// <returns>The category of this command.</returns> - public override string GetCategory() { return Macro.Category; } + public override string GetCategory() { return Processor.CategoryMacro; } /// <summary> /// Gets the user interface text. /// </summary> /// <returns>User interface text.</returns> public override string GetUserInterfaceText() { return "If Statement"; } -/* + /// <summary> - /// Gets the user display text. - /// </summary> - /// <returns>The user display text.</returns> - public override string GetUserDisplayText() - { - return String.Format("{0} ({1})", GetUserInterfaceText(), String.Join(", ", Parameters)); - } -*/ - /// <summary> /// Edit this command. /// </summary> /// <param name="parent">The parent window.</param> @@ -84,27 +75,34 @@ return false; } + #endregion Implementation + + #region Static Methods + /// <summary> - /// This method will determine if this If Command evaluates true. + /// This method will determine if an If Statement evaluates true. /// </summary> - /// <returns><c>true</c> if the command evaluates true, otherwise <c>false</c>.</returns> - public bool Evaluate() + /// <param name="value1">The first value for comparison.</param> + /// <param name="comparison">The comparison type.</param> + /// <param name="value2">The second value for comparison.</param> + /// <returns><c>true</c> if the parameters evaluates true, otherwise <c>false</c>.</returns> + public static bool Evaluate(string value1, string comparison, string value2) { int value1AsInt; - bool value1IsInt = int.TryParse(_parameters[0], out value1AsInt); + bool value1IsInt = int.TryParse(value1, out value1AsInt); int value2AsInt; - bool value2IsInt = int.TryParse(_parameters[2], out value2AsInt); + bool value2IsInt = int.TryParse(value2, out value2AsInt); bool comparisonResult = false; - switch (_parameters[1].ToUpperInvariant()) + switch (comparison.ToUpperInvariant()) { // Use string comparison ... - case IfEquals: comparisonResult = _parameters[0].Equals(_parameters[2], StringComparison.OrdinalIgnoreCase); break; - case IfNotEqual: comparisonResult = !_parameters[0].Equals(_parameters[2], StringComparison.OrdinalIgnoreCase); break; - case IfContains: comparisonResult = _parameters[0].ToUpperInvariant().Contains(_parameters[2].ToUpperInvariant()); break; - case IfStartsWith: comparisonResult = _parameters[0].ToUpperInvariant().StartsWith(_parameters[2].ToUpperInvariant()); break; - case IfEndsWith: comparisonResult = _parameters[0].ToUpperInvariant().EndsWith(_parameters[2].ToUpperInvariant()); break; + case IfEquals: comparisonResult = value1.Equals(value2, StringComparison.OrdinalIgnoreCase); break; + case IfNotEqual: comparisonResult = !value1.Equals(value2, StringComparison.OrdinalIgnoreCase); break; + case IfContains: comparisonResult = value1.ToUpperInvariant().Contains(value2.ToUpperInvariant()); break; + case IfStartsWith: comparisonResult = value1.ToUpperInvariant().StartsWith(value2.ToUpperInvariant()); break; + case IfEndsWith: comparisonResult = value1.ToUpperInvariant().EndsWith(value2.ToUpperInvariant()); break; // Use integer comparison ... case IfGreaterThan: @@ -128,14 +126,14 @@ break; default: - throw new InvalidOperationException(String.Format("Invalid variable comparison method: {0}", _parameters[1])); + throw new CommandStructureException(String.Format("Invalid variable comparison method: {0}", comparison)); } return comparisonResult; } - #endregion Implementation - + #endregion Static Methods + } } Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandLabel.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandLabel.cs 2008-01-19 09:25:43 UTC (rev 1273) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandLabel.cs 2008-01-19 15:24:40 UTC (rev 1274) @@ -33,7 +33,7 @@ /// Gets the category of this command. /// </summary> /// <returns>The category of this command.</returns> - public override string GetCategory() { return Macro.Category; } + public override string GetCategory() { return Processor.CategoryMacro; } /// <summary> /// Gets the user interface text. @@ -42,15 +42,6 @@ public override string GetUserInterfaceText() { return "Label"; } /// <summary> - /// Gets the user display text. - /// </summary> - /// <returns>The user display text.</returns> - public override string GetUserDisplayText() - { - return String.Format("{0} ({1})", GetUserInterfaceText(), String.Join(", ", Parameters)); - } - - /// <summary> /// Edit this command. /// </summary> /// <param name="parent">The parent window.</param> Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandLoadVariables.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandLoadVariables.cs 2008-01-19 09:25:43 UTC (rev 1273) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandLoadVariables.cs 2008-01-19 15:24:40 UTC (rev 1274) @@ -33,7 +33,7 @@ /// Gets the category of this command. /// </summary> /// <returns>The category of this command.</returns> - public override string GetCategory() { return Macro.Category; } + public override string GetCategory() { return Processor.CategoryMacro; } /// <summary> /// Gets the user interface text. @@ -42,15 +42,6 @@ public override string GetUserInterfaceText() { return "Load Variables"; } /// <summary> - /// Gets the user display text. - /// </summary> - /// <returns>The user display text.</returns> - public override string GetUserDisplayText() - { - return String.Format("{0} ({1})", GetUserInterfaceText(), String.Join(", ", Parameters)); - } - - /// <summary> /// Edit this command. /// </summary> /// <param name="parent">The parent window.</param> @@ -67,6 +58,15 @@ return false; } + /// <summary> + /// Execute this command. + /// </summary> + /// <param name="variables">The variable list of the calling code.</param> + public override void Execute(VariableList variables) + { + variables.Load(_parameters[0]); + } + #endregion Implementation } Added: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandMathsOperation.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandMathsOperation.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandMathsOperation.cs 2008-01-19 15:24:40 UTC (rev 1274) @@ -0,0 +1,123 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows.Forms; + +namespace Commands +{ + + /// <summary> + /// Maths Operation macro command. + /// </summary> + public class CommandMathsOperation : Command + { + + #region Maths Operations + + internal const string MathOpAdd = "Add"; + internal const string MathOpSubtract = "Subtract"; + internal const string MathOpMultiply = "Multiply"; + internal const string MathOpDivide = "Divide"; + internal const string MathOpModulo = "Modulo"; + internal const string MathOpPower = "Power"; + internal const string MathOpAbsolute = "Absolute"; + internal const string MathOpRoot = "Square Root"; + + // TODO: Add more maths operations + + //internal const string MathOpToBinary = "To Binary (Input 1)"; + //internal const string MathOpFromBinary = "From Binary (Input 1)"; + + //internal const string MathOpToHex = "To Hex (Input 1)"; + //internal const string MathOpFromHex = "From Hex (Input 1)"; + + //internal const string MathOpToOctal = "To Octal (Input 1)"; + //internal const string MathOpFromOctal = "From Octal (Input 1)"; + + #endregion Maths Operations + + #region Constructors + + /// <summary> + /// Initializes a new instance of the <see cref="CommandMathsOperation"/> class. + /// </summary> + public CommandMathsOperation() { InitParameters(4); } + + /// <summary> + /// Initializes a new instance of the <see cref="CommandMathsOperation"/> class. + /// </summary> + /// <param name="parameters">The parameters.</param> + public CommandMathsOperation(string[] parameters) : base(parameters) { } + + #endregion Constructors + + #region Implementation + + /// <summary> + /// Gets the category of this command. + /// </summary> + /// <returns>The category of this command.</returns> + public override string GetCategory() { return Processor.CategoryMacro; } + + /// <summary> + /// Gets the user interface text. + /// </summary> + /// <returns>User interface text.</returns> + public override string GetUserInterfaceText() { return "Maths Operation"; } + + /// <summary> + /// Edit this command. + /// </summary> + /// <param name="parent">The parent window.</param> + /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> + public override bool Edit(IWin32Window parent) + { + EditMathsOperation edit = new EditMathsOperation(_parameters); + if (edit.ShowDialog(parent) == DialogResult.OK) + { + _parameters = edit.Parameters; + return true; + } + + return false; + } + + /// <summary> + /// Execute this command. + /// </summary> + /// <param name="variables">The variable list of the calling code.</param> + public override void Execute(VariableList variables) + { + string input1 = Processor.ReplaceSpecial(_parameters[1]); + int input1Int = 0; + int.TryParse(input1, out input1Int); + + string input2 = Processor.ReplaceSpecial(_parameters[2]); + int input2Int = 0; + int.TryParse(input2, out input2Int); + + int output = 0; + + switch (_parameters[0]) + { + case MathOpAdd: output = input1Int + input2Int; break; + case MathOpDivide: output = input1Int / input2Int; break; + case MathOpModulo: output = input1Int % input2Int; break; + case MathOpMultiply: output = input1Int * input2Int; break; + case MathOpPower: output = (int)Math.Pow((double)input1Int, (double)input2Int); break; + case MathOpSubtract: output = input1Int - input2Int; break; + case MathOpAbsolute: output = Math.Abs(input1Int); break; + case MathOpRoot: output = (int)Math.Sqrt((double) input1Int); break; + + default: + throw new CommandStructureException(String.Format("Invalid Maths Operation: {0}", _parameters[0])); + } + + variables.SetVariable(_parameters[3], output.ToString()); + } + + #endregion Implementation + + } + +} Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandProcessor.csproj =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandProcessor.csproj 2008-01-19 09:25:43 UTC (rev 1273) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandProcessor.csproj 2008-01-19 15:24:40 UTC (rev 1274) @@ -38,6 +38,27 @@ <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> + <Compile Include="CommandStringOperation.cs" /> + <Compile Include="CommandSwapVariables.cs" /> + <Compile Include="CommandMathsOperation.cs" /> + <Compile Include="EditMathsOperation.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="EditMathsOperation.Designer.cs"> + <DependentUpon>EditMathsOperation.cs</DependentUpon> + </Compile> + <Compile Include="EditSwapVariables.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="EditSwapVariables.Designer.cs"> + <DependentUpon>EditSwapVariables.cs</DependentUpon> + </Compile> + <Compile Include="EditStringOperation.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="EditStringOperation.Designer.cs"> + <DependentUpon>EditStringOperation.cs</DependentUpon> + </Compile> <Compile Include="Processor.cs" /> <Compile Include="EditBlastIR.cs"> <SubType>Form</SubType> @@ -89,6 +110,18 @@ </Compile> </ItemGroup> <ItemGroup> + <EmbeddedResource Include="EditMathsOperation.resx"> + <DependentUpon>EditMathsOperation.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> + <EmbeddedResource Include="EditSwapVariables.resx"> + <DependentUpon>EditSwapVariables.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> + <EmbeddedResource Include="EditStringOperation.resx"> + <DependentUpon>EditStringOperation.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> <EmbeddedResource Include="EditBlastIR.resx"> <DependentUpon>EditBlastIR.cs</DependentUpon> <SubType>Designer</SubType> Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSaveVariables.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSaveVariables.cs 2008-01-19 09:25:43 UTC (rev 1273) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSaveVariables.cs 2008-01-19 15:24:40 UTC (rev 1274) @@ -33,7 +33,7 @@ /// Gets the category of this command. /// </summary> /// <returns>The category of this command.</returns> - public override string GetCategory() { return Macro.Category; } + public override string GetCategory() { return Processor.CategoryMacro; } /// <summary> /// Gets the user interface text. @@ -42,15 +42,6 @@ public override string GetUserInterfaceText() { return "Save Variables"; } /// <summary> - /// Gets the user display text. - /// </summary> - /// <returns>The user display text.</returns> - public override string GetUserDisplayText() - { - return String.Format("{0} ({1})", GetUserInterfaceText(), String.Join(", ", Parameters)); - } - - /// <summary> /// Edit this command. /// </summary> /// <param name="parent">The parent window.</param> @@ -67,6 +58,15 @@ return false; } + /// <summary> + /// Execute this command. + /// </summary> + /// <param name="variables">The variable list of the calling code.</param> + public override void Execute(VariableList variables) + { + variables.Save(_parameters[0]); + } + #endregion Implementation } Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSetVariable.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSetVariable.cs 2008-01-19 09:25:43 UTC (rev 1273) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSetVariable.cs 2008-01-19 15:24:40 UTC (rev 1274) @@ -33,7 +33,7 @@ /// Gets the category of this command. /// </summary> /// <returns>The category of this command.</returns> - public override string GetCategory() { return Macro.Category; } + public override string GetCategory() { return Processor.CategoryMacro; } /// <summary> /// Gets the user interface text. @@ -42,15 +42,6 @@ public override string GetUserInterfaceText() { return "Set Variable"; } /// <summary> - /// Gets the user display text. - /// </summary> - /// <returns>The user display text.</returns> - public override string GetUserDisplayText() - { - return String.Format("{0} ({1})", GetUserInterfaceText(), String.Join(", ", Parameters)); - } - - /// <summary> /// Edit this command. /// </summary> /// <param name="parent">The parent window.</param> @@ -67,6 +58,17 @@ return false; } + /// <summary> + /// Execute this command. + /// </summary> + /// <param name="variables">The variable list of the calling code.</param> + public override void Execute(VariableList variables) + { + string value = Processor.ReplaceSpecial(_parameters[1]); + + variables.SetVariable(_parameters[0], value); + } + #endregion Implementation } Added: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandStringOperation.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandStringOperation.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandStringOperation.cs 2008-01-19 15:24:40 UTC (rev 1274) @@ -0,0 +1,106 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows.Forms; + +namespace Commands +{ + + /// <summary> + /// String Operation macro command. + /// </summary> + public class CommandStringOperation : Command + { + + #region String Operations + + internal const string StrOpConcatenate = "Join"; + internal const string StrOpTrim = "Trim"; + internal const string StrOpUpper = "Upper Case"; + internal const string StrOpLower = "Lower Case"; + + // TODO: Add more string operations + + //internal const string StrOpTrimStart = "Trim Start (Input 1)"; + //internal const string StrOpTrimEnd = "Trim End (Input 1)"; + //internal const string StrOpLeft = "Left (Input 1 by Input 2)"; + //internal const string StrOpRight = "Right (Input 1 by Input 2)"; + + #endregion String Operations + + #region Constructors + + /// <summary> + /// Initializes a new instance of the <see cref="CommandStringOperation"/> class. + /// </summary> + public CommandStringOperation() { InitParameters(4); } + + /// <summary> + /// Initializes a new instance of the <see cref="CommandStringOperation"/> class. + /// </summary> + /// <param name="parameters">The parameters.</param> + public CommandStringOperation(string[] parameters) : base(parameters) { } + + #endregion Constructors + + #region Implementation + + /// <summary> + /// Gets the category of this command. + /// </summary> + /// <returns>The category of this command.</returns> + public override string GetCategory() { return Processor.CategoryMacro; } + + /// <summary> + /// Gets the user interface text. + /// </summary> + /// <returns>User interface text.</returns> + public override string GetUserInterfaceText() { return "String Operation"; } + + /// <summary> + /// Edit this command. + /// </summary> + /// <param name="parent">The parent window.</param> + /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> + public override bool Edit(IWin32Window parent) + { + EditStringOperation edit = new EditStringOperation(_parameters); + if (edit.ShowDialog(parent) == DialogResult.OK) + { + _parameters = edit.Parameters; + return true; + } + + return false; + } + + /// <summary> + /// Execute this command. + /// </summary> + /// <param name="variables">The variable list of the calling code.</param> + public override void Execute(VariableList variables) + { + string input1 = Processor.ReplaceSpecial(_parameters[1]); + string input2 = Processor.ReplaceSpecial(_parameters[2]); + + string output = String.Empty; + + switch (_parameters[0]) + { + case StrOpConcatenate: output = input1 + input2; break; + case StrOpTrim: output = input1.Trim(); break; + case StrOpUpper: output = input1.ToUpper(); break; + case StrOpLower: output = input1.ToLower(); break; + + default: + throw new CommandStructureException(String.Format("Invalid String Operation: {0}", _parameters[0])); + } + + variables.SetVariable(_parameters[3], output); + } + + #endregion Implementation + + } + +} Added: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSwapVariables.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSwapVariables.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSwapVariables.cs 2008-01-19 15:24:40 UTC (rev 1274) @@ -0,0 +1,78 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows.Forms; + +namespace Commands +{ + + /// <summary> + /// Swap Variables macro command. + /// </summary> + public class CommandSwapVariables : Command + { + + #region Constructors + + /// <summary> + /// Initializes a new instance of the <see cref="CommandSwapVariables"/> class. + /// </summary> + public CommandSwapVariables() { InitParameters(2); } + + /// <summary> + /// Initializes a new instance of the <see cref="CommandSwapVariables"/> class. + /// </summary> + /// <param name="parameters">The parameters.</param> + public CommandSwapVariables(string[] parameters) : base(parameters) { } + + #endregion Constructors + + #region Implementation + + /// <summary> + /// Gets the category of this command. + /// </summary> + /// <returns>The category of this command.</returns> + public override string GetCategory() { return Processor.CategoryMacro; } + + /// <summary> + /// Gets the user interface text. + /// </summary> + /// <returns>User interface text.</returns> + public override string GetUserInterfaceText() { return "Swap Variables"; } + + /// <summary> + /// Edit this command. + /// </summary> + /// <param name="parent">The parent window.</param> + /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> + public override bool Edit(IWin32Window parent) + { + EditSwapVariables edit = new EditSwapVariables(_parameters); + if (edit.ShowDialog(parent) == DialogResult.OK) + { + _parameters = edit.Parameters; + return true; + } + + return false; + } + + /// <summary> + /// Execute this command. + /// </summary> + /// <param name="variables">The variable list of the calling code.</param> + public override void Execute(VariableList variables) + { + string value0 = variables.GetVariable(_parameters[0]); + string value1 = variables.GetVariable(_parameters[1]); + + variables.SetVariable(_parameters[0], value1); + variables.SetVariable(_parameters[1], value0); + } + + #endregion Implementation + + } + +} Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditBlastIR.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditBlastIR.cs 2008-01-19 09:25:43 UTC (rev 1273) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditBlastIR.cs 2008-01-19 15:24:40 UTC (rev 1274) @@ -13,7 +13,7 @@ /// <summary> /// Edit Blast IR Command form. /// </summary> - public partial class EditBlastIR : Form + partial class EditBlastIR : Form { #region Properties Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMacro.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMacro.Designer.cs 2008-01-19 09:25:43 UTC (rev 1273) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMacro.Designer.cs 2008-01-19 15:24:40 UTC (rev 1274) @@ -60,7 +60,7 @@ this.textBoxName.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.textBoxName.Location = new System.Drawing.Point(8, 16); this.textBoxName.Name = "textBoxName"; - this.textBoxName.Size = new System.Drawing.Size(294, 22); + this.textBoxName.Size = new System.Drawing.Size(300, 22); this.textBoxName.TabIndex = 0; this.toolTips.SetToolTip(this.textBoxName, "Provide a name for this macro (must be a valid windows file name)"); // @@ -75,7 +75,7 @@ this.groupBoxCommandSequence.Controls.Add(this.buttonMoveUp); this.groupBoxCommandSequence.Location = new System.Drawing.Point(0, 56); this.groupBoxCommandSequence.Name = "groupBoxCommandSequence"; - this.groupBoxCommandSequence.Size = new System.Drawing.Size(310, 232); + this.groupBoxCommandSequence.Size = new System.Drawing.Size(316, 304); this.groupBoxCommandSequence.TabIndex = 1; this.groupBoxCommandSequence.TabStop = false; this.groupBoxCommandSequence.Text = "Macro"; @@ -94,7 +94,7 @@ this.listViewMacro.Location = new System.Drawing.Point(8, 16); this.listViewMacro.Name = "listViewMacro"; this.listViewMacro.ShowGroups = false; - this.listViewMacro.Size = new System.Drawing.Size(294, 176); + this.listViewMacro.Size = new System.Drawing.Size(300, 248); this.listViewMacro.TabIndex = 0; this.listViewMacro.UseCompatibleStateImageBehavior = false; this.listViewMacro.View = System.Windows.Forms.View.Details; @@ -108,7 +108,7 @@ // buttonRemove // this.buttonRemove.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonRemove.Location = new System.Drawing.Point(246, 200); + this.buttonRemove.Location = new System.Drawing.Point(252, 272); this.buttonRemove.Name = "buttonRemove"; this.buttonRemove.Size = new System.Drawing.Size(56, 24); this.buttonRemove.TabIndex = 3; @@ -120,7 +120,7 @@ // buttonMoveDown // this.buttonMoveDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.buttonMoveDown.Location = new System.Drawing.Point(64, 200); + this.buttonMoveDown.Location = new System.Drawing.Point(64, 272); this.buttonMoveDown.Name = "buttonMoveDown"; this.buttonMoveDown.Size = new System.Drawing.Size(48, 24); this.buttonMoveDown.TabIndex = 2; @@ -132,7 +132,7 @@ // buttonMoveUp // this.buttonMoveUp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.buttonMoveUp.Location = new System.Drawing.Point(8, 200); + this.buttonMoveUp.Location = new System.Drawing.Point(8, 272); this.buttonMoveUp.Name = "buttonMoveUp"; this.buttonMoveUp.Size = new System.Drawing.Size(48, 24); this.buttonMoveUp.TabIndex = 1; @@ -147,7 +147,7 @@ this.groupBoxCommands.Dock = System.Windows.Forms.DockStyle.Fill; this.groupBoxCommands.Location = new System.Drawing.Point(0, 0); this.groupBoxCommands.Name = "groupBoxCommands"; - this.groupBoxCommands.Size = new System.Drawing.Size(156, 288); + this.groupBoxCommands.Size = new System.Drawing.Size(166, 360); this.groupBoxCommands.TabIndex = 0; this.groupBoxCommands.TabStop = false; this.groupBoxCommands.Text = "Commands"; @@ -159,7 +159,7 @@ | System.Windows.Forms.AnchorStyles.Right))); this.treeViewCommandList.Location = new System.Drawing.Point(8, 16); this.treeViewCommandList.Name = "treeViewCommandList"; - this.treeViewCommandList.Size = new System.Drawing.Size(140, 264); + this.treeViewCommandList.Size = new System.Drawing.Size(150, 336); this.treeViewCommandList.TabIndex = 0; this.treeViewCommandList.DoubleClick += new System.EventHandler(this.treeViewCommandList_DoubleClick); // @@ -167,7 +167,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(424, 304); + this.buttonCancel.Location = new System.Drawing.Point(440, 376); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(56, 24); this.buttonCancel.TabIndex = 3; @@ -178,7 +178,7 @@ // buttonTest // this.buttonTest.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.buttonTest.Location = new System.Drawing.Point(8, 304); + this.buttonTest.Location = new System.Drawing.Point(8, 376); this.buttonTest.Name = "buttonTest"; this.buttonTest.Size = new System.Drawing.Size(56, 24); this.buttonTest.TabIndex = 1; @@ -190,7 +190,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(360, 304); + this.buttonOK.Location = new System.Drawing.Point(376, 376); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(56, 24); this.buttonOK.TabIndex = 2; @@ -204,7 +204,7 @@ this.groupBoxMacroName.Dock = System.Windows.Forms.DockStyle.Top; this.groupBoxMacroName.Location = new System.Drawing.Point(0, 0); this.groupBoxMacroName.Name = "groupBoxMacroName"; - this.groupBoxMacroName.Size = new System.Drawing.Size(310, 48); + this.groupBoxMacroName.Size = new System.Drawing.Size(316, 48); this.groupBoxMacroName.TabIndex = 0; this.groupBoxMacroName.TabStop = false; this.groupBoxMacroName.Text = "Macro Name"; @@ -228,8 +228,8 @@ // this.splitContainer.Panel2.Controls.Add(this.groupBoxCommands); this.splitContainer.Panel2MinSize = 128; - this.splitContainer.Size = new System.Drawing.Size(472, 288); - this.splitContainer.SplitterDistance = 310; + this.splitContainer.Size = new System.Drawing.Size(488, 360); + this.splitContainer.SplitterDistance = 316; this.splitContainer.SplitterWidth = 6; this.splitContainer.TabIndex = 0; // @@ -237,13 +237,13 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(488, 337); + this.ClientSize = new System.Drawing.Size(504, 409); this.Controls.Add(this.buttonTest); this.Controls.Add(this.splitContainer); this.Controls.Add(this.buttonCancel); this.Controls.Add(this.buttonOK); this.MinimizeBox = false; - this.MinimumSize = new System.Drawing.Size(496, 364); + this.MinimumSize = new System.Drawing.Size(512, 436); this.Name = "EditMacro"; this.ShowIcon = false; this.ShowInTaskbar = false; Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMacro.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMacro.cs 2008-01-19 09:25:43 UTC (rev 1273) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMacro.cs 2008-01-19 15:24:40 UTC (rev 1274) @@ -83,6 +83,7 @@ _commandProcessor = commandProcessor; _fileName = fileName; + _macroFolder = Path.GetDirectoryName(fileName); PopulateCommandList(categories); @@ -113,7 +114,7 @@ treeViewCommandList.Nodes.Clear(); Dictionary<string, TreeNode> treeNodes = new Dictionary<string,TreeNode>(categories.Length); - TreeNode macroCommands = new TreeNode(Macro.Category); + TreeNode macroCommands = new TreeNode(Processor.CategoryMacro); Type[] specialCommands = Processor.GetSpecialCommands(); foreach (Type type in specialCommands) { @@ -125,7 +126,7 @@ _commands.Add(command.GetUserInterfaceText(), type); } - treeNodes.Add(Macro.Category, macroCommands); + treeNodes.Add(Processor.CategoryMacro, macroCommands); foreach (string category in categories) treeNodes.Add(category, new TreeNode(category)); @@ -303,7 +304,7 @@ newMacro.Commands.Add(command); } - newMacro.Execute(_commandProcessor.Variables, _commandProcessor.BlastIr); + newMacro.Execute(_commandProcessor); } catch (Exception ex) { Added: trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMathsOperation.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMathsOperation.Designer.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMathsOperation.Designer.cs 2008-01-19 15:24:40 UTC (rev 1274) @@ -0,0 +1,204 @@ +namespace Commands +{ + + partial class EditMathsOperation + { + /// <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.buttonOK = new System.Windows.Forms.Button(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.toolTips = new System.Windows.Forms.ToolTip(this.components); + this.textBoxInput1 = new System.Windows.Forms.TextBox(); + this.comboBoxOperation = new System.Windows.Forms.ComboBox(); + this.textBoxInput2 = new System.Windows.Forms.TextBox(); + this.labelOperation = new System.Windows.Forms.Label(); + this.labelInput1 = new System.Windows.Forms.Label(); + this.labelInput2 = new System.Windows.Forms.Label(); + this.labelVarPrefix = new System.Windows.Forms.Label(); + this.labelOutput = new System.Windows.Forms.Label(); + this.textBoxOutputVar = new System.Windows.Forms.TextBox(); + 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(248, 136); + 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); + // + // 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(320, 136); + 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); + // + // textBoxInput1 + // + this.textBoxInput1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxInput1.Location = new System.Drawing.Point(80, 40); + this.textBoxInput1.Name = "textBoxInput1"; + this.textBoxInput1.Size = new System.Drawing.Size(304, 20); + this.textBoxInput1.TabIndex = 3; + this.toolTips.SetToolTip(this.textBoxInput1, "The first operation input"); + // + // comboBoxOperation + // + this.comboBoxOperation.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.comboBoxOperation.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxOperation.FormattingEnabled = true; + this.comboBoxOperation.Location = new System.Drawing.Point(80, 8); + this.comboBoxOperation.Name = "comboBoxOperation"; + this.comboBoxOperation.Size = new System.Drawing.Size(304, 21); + this.comboBoxOperation.TabIndex = 1; + this.toolTips.SetToolTip(this.comboBoxOperation, "The string operation to perform"); + // + // textBoxInput2 + // + this.textBoxInput2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxInput2.Location = new System.Drawing.Point(80, 72); + this.textBoxInput2.Name = "textBoxInput2"; + this.textBoxInput2.Size = new System.Drawing.Size(304, 20); + this.textBoxInput2.TabIndex = 5; + this.toolTips.SetToolTip(this.textBoxInput2, "The second operation input (sometimes optional)"); + // + // labelOperation + // + this.labelOperation.Location = new System.Drawing.Point(8, 8); + this.labelOperation.Name = "labelOperation"; + this.labelOperation.Size = new System.Drawing.Size(72, 21); + this.labelOperation.TabIndex = 0; + this.labelOperation.Text = "Operation:"; + this.labelOperation.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // labelInput1 + // + this.labelInput1.Location = new System.Drawing.Point(8, 40); + this.labelInput1.Name = "labelInput1"; + this.labelInput1.Size = new System.Drawing.Size(72, 21); + this.labelInput1.TabIndex = 2; + this.labelInput1.Text = "Input 1:"; + this.labelInput1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.toolTips.SetToolTip(this.labelInput1, "The first input string"); + // + // labelInput2 + // + this.labelInput2.Location = new System.Drawing.Point(8, 72); + this.labelInput2.Name = "labelInput2"; + this.labelInput2.Size = new System.Drawing.Size(72, 21); + this.labelInput2.TabIndex = 4; + this.labelInput2.Text = "Input 2:"; + this.labelInput2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.toolTips.SetToolTip(this.labelInput2, "The second input string"); + // + // labelVarPrefix + // + this.labelVarPrefix.Location = new System.Drawing.Point(80, 104); + this.labelVarPrefix.Name = "labelVarPrefix"; + this.labelVarPrefix.Size = new System.Drawing.Size(32, 21); + this.labelVarPrefix.TabIndex = 7; + this.labelVarPrefix.Text = "var_"; + this.labelVarPrefix.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // labelOutput + // + this.labelOutput.Location = new System.Drawing.Point(8, 104); + this.labelOutput.Name = "labelOutput"; + this.labelOutput.Size = new System.Drawing.Size(72, 21); + this.labelOutput.TabIndex = 6; + this.labelOutput.Text = "Output:"; + this.labelOutput.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // textBoxOutputVar + // + this.textBoxOutputVar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxOutputVar.Location = new System.Drawing.Point(112, 104); + this.textBoxOutputVar.Name = "textBoxOutputVar"; + this.textBoxOutputVar.Size = new System.Drawing.Size(272, 20); + this.textBoxOutputVar.TabIndex = 8; + this.toolTips.SetToolTip(this.textBoxOutputVar, "The variable to place the output of the operation into"); + // + // EditStringOperation + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(392, 169); + this.Controls.Add(this.labelVarPrefix); + this.Controls.Add(this.labelOutput); + this.Controls.Add(this.textBoxOutputVar); + this.Controls.Add(this.labelInput2); + this.Controls.Add(this.labelInput1); + this.Controls.Add(this.labelOperation); + this.Controls.Add(this.textBoxInput2); + this.Controls.Add(this.comboBoxOperation); + this.Controls.Add(this.textBoxInput1); + this.Controls.Add(this.buttonOK); + this.Controls.Add(this.buttonCancel); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(400, 196); + this.Name = "EditStringOperation"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "String Operation"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button buttonOK; + private System.Windows.Forms.Button buttonCancel; + private System.Windows.Forms.ToolTip toolTips; + private System.Windows.Forms.TextBox textBoxInput1; + private System.Windows.Forms.ComboBox comboBoxOperation; + private System.Windows.Forms.TextBox textBoxInput2; + private System.Windows.Forms.Label labelOperation; + private System.Windows.Forms.Label labelInput1; + private System.Windows.Forms.Label labelInput2; + private System.Windows.Forms.Label labelVarPrefix; + private System.Windows.Forms.Label labelOutput; + private System.Windows.Forms.TextBox textBoxOutputVar; + } + +} Added: trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMathsOperation.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMathsOperation.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMathsOperation.cs 2008-01-19 15:24:40 UTC (rev 1274) @@ -0,0 +1,107 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace Commands +{ + + /// <summary> + /// Edit Maths Operation Command form. + /// </summary> + partial class EditMathsOperation : Form + { + + #region Properties + + /// <summary> + /// Gets the command parameters. + /// </summary> + /// <value>The command parameters.</value> + public string[] Parameters + { + get + { + return new string[] { + comboBoxOperation.SelectedItem as string, + textBoxInput1.Text.Trim(), + textBoxInput2.Text.Trim(), + textBoxOutputVar.Text.Trim() + }; + } + } + + #endregion Properties + + #region Constructors + + /// <summary> + /// Initializes a new instance of the <see cref="EditMathsOperation"/> class. + /// </summary> + public EditMathsOperation() + { + InitializeComponent(); + + labelVarPrefix.Text = VariableList.VariablePrefix; + + comboBoxOperation.Items.Clear(); + comboBoxOperation.Items.Add(CommandMathsOperation.MathOpAbsolute); + comboBoxOperation.Items.Add(CommandMathsOperation.MathOpAdd); + comboBoxOperation.Items.Add(CommandMathsOperation.MathOpDivide); + comboBoxOperation.Items.Add(CommandMathsOperation.MathOpModulo); + comboBoxOperation.Items.Add(CommandMathsOperation.MathOpMultiply); + comboBoxOperation.Items.Add(CommandMathsOperation.MathOpPower); + comboBoxOperation.Items.Add(CommandMathsOperation.MathOpRoot); + comboBoxOperation.Items.Add(CommandMathsOperation.MathOpSubtract); + + comboBoxOperation.SelectedIndex = 0; + } + + /// <summary> + /// Initializes a new instance of the <see cref="EditMathsOperation"/> class. + /// </summary> + /// <param name="parameters">The parameters.</param> + public EditMathsOperation(string[] parameters) + : this() + { + comboBoxOperation.SelectedItem = parameters[0]; + textBoxInput1.Text = parameters[1]; + textBoxInput2.Text = parameters[2]; + textBoxOutputVar.Text = parameters[3]; + } + + #endregion Constructors + + #region Buttons + + private void buttonOK_Click(object sender, EventArgs e) + { + if (String.IsNullOrEmpty(textBoxInput1.Text.Trim())) + { + MessageBox.Show(this, "You must include at least the first input", "Missing first input", MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + + if (String.IsNullOrEmpty(textBoxOutputVar.Text.Trim())) + ... [truncated message content] |
From: <an...@us...> - 2008-01-20 13:38:23
|
Revision: 1285 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1285&view=rev Author: and-81 Date: 2008-01-20 05:38:06 -0800 (Sun, 20 Jan 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Commands/Command/Command.cs trunk/plugins/IR Server Suite/Commands/Command/CommandExecutionException.cs trunk/plugins/IR Server Suite/Commands/Command/CommandStructureException.cs trunk/plugins/IR Server Suite/Commands/Command/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandBlastIR.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandCallMacro.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandGotoLabel.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandIf.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandLabel.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandLoadVariables.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandMathsOperation.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandProcessor.csproj trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSaveVariables.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSetVariable.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandStringOperation.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSwapVariables.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMacro.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMacro.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMacro.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/MacroStructureException.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Processor.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandKeystrokes.cs trunk/plugins/IR Server Suite/Commands/GeneralCommands/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/CommandGotoScreen.cs trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Commands/TestApp/Program.cs trunk/plugins/IR Server Suite/Commands/TestApp/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Commands/VariableList/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 Control Plugin/InputMapping/MPControlPlugin.xml Added Paths: ----------- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSwitch.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Commands/ trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditSwitch.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditSwitch.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditSwitch.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/ trunk/plugins/IR Server Suite/Commands/CommandProcessor/Graphics/ trunk/plugins/IR Server Suite/Commands/CommandProcessor/Graphics/Delete.png trunk/plugins/IR Server Suite/Commands/CommandProcessor/Graphics/DeleteAll.png trunk/plugins/IR Server Suite/Commands/CommandProcessor/Graphics/Edit.png trunk/plugins/IR Server Suite/Commands/CommandProcessor/Graphics/MoveBottom.png trunk/plugins/IR Server Suite/Commands/CommandProcessor/Graphics/MoveDown.png trunk/plugins/IR Server Suite/Commands/CommandProcessor/Graphics/MoveTop.png trunk/plugins/IR Server Suite/Commands/CommandProcessor/Graphics/MoveUp.png trunk/plugins/IR Server Suite/Commands/CommandProcessor/Graphics/Plus.png trunk/plugins/IR Server Suite/Commands/CommandProcessor/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Properties/Resources.resx Modified: trunk/plugins/IR Server Suite/Commands/Command/Command.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/Command/Command.cs 2008-01-19 22:34:08 UTC (rev 1284) +++ trunk/plugins/IR Server Suite/Commands/Command/Command.cs 2008-01-20 13:38:06 UTC (rev 1285) @@ -19,17 +19,21 @@ /// <summary> /// Command parameters. /// </summary> - protected string[] _parameters; + string[] _parameters; #endregion Variables #region Properties /// <summary> - /// Gets the command parameters. + /// Gets or sets the command parameters. /// </summary> /// <value>The command parameters.</value> - public virtual string[] Parameters { get { return _parameters; } } + public virtual string[] Parameters + { + get { return _parameters; } + set { _parameters = value; } + } #endregion Properties @@ -38,13 +42,13 @@ /// <summary> /// Initializes a new instance of the <see cref="Command"/> class. /// </summary> - public Command() { } + protected Command() { } /// <summary> /// Initializes a new instance of the <see cref="Command"/> class. /// </summary> /// <param name="parameters">The command parameters.</param> - public Command(string[] parameters) { _parameters = parameters; } + protected Command(string[] parameters) { _parameters = parameters; } #endregion Constructors Modified: trunk/plugins/IR Server Suite/Commands/Command/CommandExecutionException.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/Command/CommandExecutionException.cs 2008-01-19 22:34:08 UTC (rev 1284) +++ trunk/plugins/IR Server Suite/Commands/Command/CommandExecutionException.cs 2008-01-20 13:38:06 UTC (rev 1285) @@ -8,7 +8,7 @@ /// The exception that is thrown when an error executing a command occurs. /// </summary> [Serializable] - public class CommandExecutionException : ApplicationException + public class CommandExecutionException : Exception { /// <summary> Modified: trunk/plugins/IR Server Suite/Commands/Command/CommandStructureException.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/Command/CommandStructureException.cs 2008-01-19 22:34:08 UTC (rev 1284) +++ trunk/plugins/IR Server Suite/Commands/Command/CommandStructureException.cs 2008-01-20 13:38:06 UTC (rev 1285) @@ -8,7 +8,7 @@ /// The exception that is thrown when a structural error in a command is discovered. /// </summary> [Serializable] - public class CommandStructureException : ApplicationException + public class CommandStructureException : Exception { /// <summary> Modified: trunk/plugins/IR Server Suite/Commands/Command/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/Command/Properties/AssemblyInfo.cs 2008-01-19 22:34:08 UTC (rev 1284) +++ trunk/plugins/IR Server Suite/Commands/Command/Properties/AssemblyInfo.cs 2008-01-20 13:38:06 UTC (rev 1285) @@ -1,4 +1,5 @@ -using System.Reflection; +using System; +using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -33,3 +34,5 @@ // by using the '*' as shown below: [assembly: AssemblyVersion("1.0.4.2")] [assembly: AssemblyFileVersion("1.0.4.2")] + +[assembly: CLSCompliant(true)] \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandBlastIR.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandBlastIR.cs 2008-01-19 22:34:08 UTC (rev 1284) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandBlastIR.cs 2008-01-20 13:38:06 UTC (rev 1285) @@ -50,12 +50,12 @@ /// <returns>The user display text.</returns> public override string GetUserDisplayText() { - string fileName = _parameters[0]; + string fileName = Parameters[0]; - if (_parameters[0].StartsWith(Common.FolderAppData, StringComparison.OrdinalIgnoreCase)) - fileName = _parameters[0].Substring(Common.FolderAppData.Length); + if (Parameters[0].StartsWith(Common.FolderAppData, StringComparison.OrdinalIgnoreCase)) + fileName = Parameters[0].Substring(Common.FolderAppData.Length); - return String.Format("{0} ({1}, {2})", GetUserInterfaceText(), fileName, _parameters[1]); + return String.Format("{0} ({1}, {2})", GetUserInterfaceText(), fileName, Parameters[1]); } /// <summary> @@ -67,10 +67,10 @@ /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> public bool Edit(IWin32Window parent, BlastIrDelegate blastIrDelegate, string[] blastPorts) { - EditBlastIR edit = new EditBlastIR(blastIrDelegate, blastPorts, _parameters); + EditBlastIR edit = new EditBlastIR(blastIrDelegate, blastPorts, Parameters); if (edit.ShowDialog(parent) == DialogResult.OK) { - _parameters = edit.Parameters; + Parameters = edit.Parameters; return true; } @@ -83,8 +83,8 @@ /// <param name="blastIrDelegate">The blast ir delegate.</param> public void Execute(BlastIrDelegate blastIrDelegate) { - string irFile = _parameters[0] + Common.FileExtensionIR; - string port = _parameters[1]; + string irFile = Parameters[0] + Common.FileExtensionIR; + string port = Parameters[1]; blastIrDelegate(irFile, port); } Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandCallMacro.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandCallMacro.cs 2008-01-19 22:34:08 UTC (rev 1284) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandCallMacro.cs 2008-01-20 13:38:06 UTC (rev 1285) @@ -50,10 +50,10 @@ /// <returns>The user display text.</returns> public override string GetUserDisplayText() { - string fileName = _parameters[0]; + string fileName = Parameters[0]; - if (_parameters[0].StartsWith(Common.FolderAppData, StringComparison.OrdinalIgnoreCase)) - fileName = _parameters[0].Substring(Common.FolderAppData.Length); + if (Parameters[0].StartsWith(Common.FolderAppData, StringComparison.OrdinalIgnoreCase)) + fileName = Parameters[0].Substring(Common.FolderAppData.Length); return String.Format("{0} ({1})", GetUserInterfaceText(), fileName); } @@ -64,7 +64,7 @@ /// <param name="commandProcessor">The command processor.</param> public void Execute(Processor commandProcessor) { - Macro macro = new Macro(_parameters[0]); + Macro macro = new Macro(Parameters[0]); macro.Execute(commandProcessor); } @@ -75,12 +75,12 @@ /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> public override bool Edit(IWin32Window parent) { - if (String.IsNullOrEmpty(_parameters[0])) + if (String.IsNullOrEmpty(Parameters[0])) { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = "Macro Files|*" + Processor.FileExtensionMacro; if (openFileDialog.ShowDialog(parent) == DialogResult.OK) - _parameters[0] = Path.Combine(Path.GetDirectoryName(openFileDialog.FileName), Path.GetFileNameWithoutExtension(openFileDialog.FileName)); + Parameters[0] = Path.Combine(Path.GetDirectoryName(openFileDialog.FileName), Path.GetFileNameWithoutExtension(openFileDialog.FileName)); } return true; Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandGotoLabel.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandGotoLabel.cs 2008-01-19 22:34:08 UTC (rev 1284) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandGotoLabel.cs 2008-01-20 13:38:06 UTC (rev 1285) @@ -48,10 +48,10 @@ /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> public override bool Edit(IWin32Window parent) { - EditLabel edit = new EditLabel(_parameters[0]); + EditLabel edit = new EditLabel(Parameters[0]); if (edit.ShowDialog(parent) == DialogResult.OK) { - _parameters[0] = edit.LabelName; + Parameters[0] = edit.LabelName; return true; } Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandIf.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandIf.cs 2008-01-19 22:34:08 UTC (rev 1284) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandIf.cs 2008-01-20 13:38:06 UTC (rev 1285) @@ -65,10 +65,10 @@ /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> public override bool Edit(IWin32Window parent) { - EditIf edit = new EditIf(_parameters); + EditIf edit = new EditIf(Parameters); if (edit.ShowDialog(parent) == DialogResult.OK) { - _parameters = edit.Parameters; + Parameters = edit.Parameters; return true; } @@ -101,8 +101,8 @@ case IfEquals: comparisonResult = value1.Equals(value2, StringComparison.OrdinalIgnoreCase); break; case IfNotEqual: comparisonResult = !value1.Equals(value2, StringComparison.OrdinalIgnoreCase); break; case IfContains: comparisonResult = value1.ToUpperInvariant().Contains(value2.ToUpperInvariant()); break; - case IfStartsWith: comparisonResult = value1.ToUpperInvariant().StartsWith(value2.ToUpperInvariant()); break; - case IfEndsWith: comparisonResult = value1.ToUpperInvariant().EndsWith(value2.ToUpperInvariant()); break; + case IfStartsWith: comparisonResult = value1.StartsWith(value2, StringComparison.OrdinalIgnoreCase); break; + case IfEndsWith: comparisonResult = value1.EndsWith(value2, StringComparison.OrdinalIgnoreCase); break; // Use integer comparison ... case IfGreaterThan: Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandLabel.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandLabel.cs 2008-01-19 22:34:08 UTC (rev 1284) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandLabel.cs 2008-01-20 13:38:06 UTC (rev 1285) @@ -48,10 +48,10 @@ /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> public override bool Edit(IWin32Window parent) { - EditLabel edit = new EditLabel(_parameters[0]); + EditLabel edit = new EditLabel(Parameters[0]); if (edit.ShowDialog(parent) == DialogResult.OK) { - _parameters[0] = edit.LabelName; + Parameters[0] = edit.LabelName; return true; } Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandLoadVariables.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandLoadVariables.cs 2008-01-19 22:34:08 UTC (rev 1284) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandLoadVariables.cs 2008-01-20 13:38:06 UTC (rev 1285) @@ -48,10 +48,10 @@ /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> public override bool Edit(IWin32Window parent) { - EditVariablesFile edit = new EditVariablesFile(_parameters[0]); + EditVariablesFile edit = new EditVariablesFile(Parameters[0]); if (edit.ShowDialog(parent) == DialogResult.OK) { - _parameters[0] = edit.FileName; + Parameters[0] = edit.FileName; return true; } @@ -64,7 +64,7 @@ /// <param name="variables">The variable list of the calling code.</param> public override void Execute(VariableList variables) { - variables.Load(_parameters[0]); + variables.Load(Parameters[0]); } #endregion Implementation Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandMathsOperation.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandMathsOperation.cs 2008-01-19 22:34:08 UTC (rev 1284) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandMathsOperation.cs 2008-01-20 13:38:06 UTC (rev 1285) @@ -72,10 +72,10 @@ /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> public override bool Edit(IWin32Window parent) { - EditMathsOperation edit = new EditMathsOperation(_parameters); + EditMathsOperation edit = new EditMathsOperation(Parameters); if (edit.ShowDialog(parent) == DialogResult.OK) { - _parameters = edit.Parameters; + Parameters = edit.Parameters; return true; } @@ -88,17 +88,17 @@ /// <param name="variables">The variable list of the calling code.</param> public override void Execute(VariableList variables) { - string input1 = Processor.ReplaceSpecial(_parameters[1]); + string input1 = Processor.ReplaceSpecial(Parameters[1]); int input1Int = 0; int.TryParse(input1, out input1Int); - string input2 = Processor.ReplaceSpecial(_parameters[2]); + string input2 = Processor.ReplaceSpecial(Parameters[2]); int input2Int = 0; int.TryParse(input2, out input2Int); int output = 0; - switch (_parameters[0]) + switch (Parameters[0]) { case MathOpAdd: output = input1Int + input2Int; break; case MathOpDivide: output = input1Int / input2Int; break; @@ -110,10 +110,10 @@ case MathOpRoot: output = (int)Math.Sqrt((double) input1Int); break; default: - throw new CommandStructureException(String.Format("Invalid Maths Operation: {0}", _parameters[0])); + throw new CommandStructureException(String.Format("Invalid Maths Operation: {0}", Parameters[0])); } - variables.SetVariable(_parameters[3], output.ToString()); + variables.SetVariable(Parameters[3], output.ToString()); } #endregion Implementation Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandProcessor.csproj =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandProcessor.csproj 2008-01-19 22:34:08 UTC (rev 1284) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandProcessor.csproj 2008-01-20 13:38:06 UTC (rev 1285) @@ -41,6 +41,13 @@ <Compile Include="CommandStringOperation.cs" /> <Compile Include="CommandSwapVariables.cs" /> <Compile Include="CommandMathsOperation.cs" /> + <Compile Include="CommandSwitch.cs" /> + <Compile Include="EditSwitch.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="EditSwitch.Designer.cs"> + <DependentUpon>EditSwitch.cs</DependentUpon> + </Compile> <Compile Include="EditMathsOperation.cs"> <SubType>Form</SubType> </Compile> @@ -108,8 +115,17 @@ <Compile Include="EditVariablesFile.Designer.cs"> <DependentUpon>EditVariablesFile.cs</DependentUpon> </Compile> + <Compile Include="Properties\Resources.Designer.cs"> + <AutoGen>True</AutoGen> + <DesignTime>True</DesignTime> + <DependentUpon>Resources.resx</DependentUpon> + </Compile> </ItemGroup> <ItemGroup> + <EmbeddedResource Include="EditSwitch.resx"> + <DependentUpon>EditSwitch.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> <EmbeddedResource Include="EditMathsOperation.resx"> <DependentUpon>EditMathsOperation.cs</DependentUpon> <SubType>Designer</SubType> @@ -146,6 +162,11 @@ <DependentUpon>EditVariablesFile.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> + <EmbeddedResource Include="Properties\Resources.resx"> + <SubType>Designer</SubType> + <Generator>ResXFileCodeGenerator</Generator> + <LastGenOutput>Resources.Designer.cs</LastGenOutput> + </EmbeddedResource> </ItemGroup> <ItemGroup> <ProjectReference Include="..\..\Common\IrssUtils\IrssUtils.csproj"> @@ -164,6 +185,16 @@ <Private>False</Private> </ProjectReference> </ItemGroup> + <ItemGroup> + <Content Include="Graphics\Delete.png" /> + <Content Include="Graphics\DeleteAll.png" /> + <Content Include="Graphics\Edit.png" /> + <Content Include="Graphics\MoveBottom.png" /> + <Content Include="Graphics\MoveDown.png" /> + <Content Include="Graphics\MoveTop.png" /> + <Content Include="Graphics\MoveUp.png" /> + <Content Include="Graphics\Plus.png" /> + </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/Commands/CommandProcessor/CommandSaveVariables.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSaveVariables.cs 2008-01-19 22:34:08 UTC (rev 1284) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSaveVariables.cs 2008-01-20 13:38:06 UTC (rev 1285) @@ -48,10 +48,10 @@ /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> public override bool Edit(IWin32Window parent) { - EditVariablesFile edit = new EditVariablesFile(_parameters[0]); + EditVariablesFile edit = new EditVariablesFile(Parameters[0]); if (edit.ShowDialog(parent) == DialogResult.OK) { - _parameters[0] = edit.FileName; + Parameters[0] = edit.FileName; return true; } @@ -64,7 +64,7 @@ /// <param name="variables">The variable list of the calling code.</param> public override void Execute(VariableList variables) { - variables.Save(_parameters[0]); + variables.Save(Parameters[0]); } #endregion Implementation Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSetVariable.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSetVariable.cs 2008-01-19 22:34:08 UTC (rev 1284) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSetVariable.cs 2008-01-20 13:38:06 UTC (rev 1285) @@ -48,10 +48,10 @@ /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> public override bool Edit(IWin32Window parent) { - EditSetVariable edit = new EditSetVariable(_parameters); + EditSetVariable edit = new EditSetVariable(Parameters); if (edit.ShowDialog(parent) == DialogResult.OK) { - _parameters = edit.Parameters; + Parameters = edit.Parameters; return true; } @@ -64,9 +64,9 @@ /// <param name="variables">The variable list of the calling code.</param> public override void Execute(VariableList variables) { - string value = Processor.ReplaceSpecial(_parameters[1]); + string value = Processor.ReplaceSpecial(Parameters[1]); - variables.SetVariable(_parameters[0], value); + variables.SetVariable(Parameters[0], value); } #endregion Implementation Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandStringOperation.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandStringOperation.cs 2008-01-19 22:34:08 UTC (rev 1284) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandStringOperation.cs 2008-01-20 13:38:06 UTC (rev 1285) @@ -64,10 +64,10 @@ /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> public override bool Edit(IWin32Window parent) { - EditStringOperation edit = new EditStringOperation(_parameters); + EditStringOperation edit = new EditStringOperation(Parameters); if (edit.ShowDialog(parent) == DialogResult.OK) { - _parameters = edit.Parameters; + Parameters = edit.Parameters; return true; } @@ -80,12 +80,12 @@ /// <param name="variables">The variable list of the calling code.</param> public override void Execute(VariableList variables) { - string input1 = Processor.ReplaceSpecial(_parameters[1]); - string input2 = Processor.ReplaceSpecial(_parameters[2]); + string input1 = Processor.ReplaceSpecial(Parameters[1]); + string input2 = Processor.ReplaceSpecial(Parameters[2]); string output = String.Empty; - switch (_parameters[0]) + switch (Parameters[0]) { case StrOpConcatenate: output = input1 + input2; break; case StrOpTrim: output = input1.Trim(); break; @@ -93,10 +93,10 @@ case StrOpLower: output = input1.ToLower(); break; default: - throw new CommandStructureException(String.Format("Invalid String Operation: {0}", _parameters[0])); + throw new CommandStructureException(String.Format("Invalid String Operation: {0}", Parameters[0])); } - variables.SetVariable(_parameters[3], output); + variables.SetVariable(Parameters[3], output); } #endregion Implementation Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSwapVariables.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSwapVariables.cs 2008-01-19 22:34:08 UTC (rev 1284) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSwapVariables.cs 2008-01-20 13:38:06 UTC (rev 1285) @@ -48,10 +48,10 @@ /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> public override bool Edit(IWin32Window parent) { - EditSwapVariables edit = new EditSwapVariables(_parameters); + EditSwapVariables edit = new EditSwapVariables(Parameters); if (edit.ShowDialog(parent) == DialogResult.OK) { - _parameters = edit.Parameters; + Parameters = edit.Parameters; return true; } @@ -64,11 +64,11 @@ /// <param name="variables">The variable list of the calling code.</param> public override void Execute(VariableList variables) { - string value0 = variables.GetVariable(_parameters[0]); - string value1 = variables.GetVariable(_parameters[1]); + string value0 = variables.GetVariable(Parameters[0]); + string value1 = variables.GetVariable(Parameters[1]); - variables.SetVariable(_parameters[0], value1); - variables.SetVariable(_parameters[1], value0); + variables.SetVariable(Parameters[0], value1); + variables.SetVariable(Parameters[1], value0); } #endregion Implementation Added: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSwitch.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSwitch.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSwitch.cs 2008-01-20 13:38:06 UTC (rev 1285) @@ -0,0 +1,94 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Windows.Forms; +using System.Xml; +using System.Xml.Serialization; + +namespace Commands +{ + + /// <summary> + /// Switch Statement macro command. + /// </summary> + public class CommandSwitch : Command + { + + #region Constructors + + /// <summary> + /// Initializes a new instance of the <see cref="CommandSwitch"/> class. + /// </summary> + public CommandSwitch() { InitParameters(3); } + + /// <summary> + /// Initializes a new instance of the <see cref="CommandSwitch"/> class. + /// </summary> + /// <param name="parameters">The parameters.</param> + public CommandSwitch(string[] parameters) : base(parameters) { } + + #endregion Constructors + + #region Implementation + + /// <summary> + /// Gets the category of this command. + /// </summary> + /// <returns>The category of this command.</returns> + public override string GetCategory() { return Processor.CategoryMacro; } + + /// <summary> + /// Gets the user interface text. + /// </summary> + /// <returns>User interface text.</returns> + public override string GetUserInterfaceText() { return "Switch Statement"; } + + /// <summary> + /// Edit this command. + /// </summary> + /// <param name="parent">The parent window.</param> + /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> + public override bool Edit(IWin32Window parent) + { + EditSwitch edit = new EditSwitch(Parameters); + if (edit.ShowDialog(parent) == DialogResult.OK) + { + Parameters = edit.Parameters; + return true; + } + + return false; + } + + #endregion Implementation + + #region Static Methods + + /// <summary> + /// This method will determine which (if any) case in a Switch Statement evaluates true. + /// </summary> + /// <param name="value">The value.</param> + /// <param name="casesXml">The cases XML.</param> + /// <returns>Label to goto (null for default).</returns> + public static string Evaluate(string value, string casesXml) + { + string[] cases; + using (StringReader stringReader = new StringReader(casesXml)) + { + XmlSerializer xmlSerializer = new XmlSerializer(typeof(string[])); + cases = (string[])xmlSerializer.Deserialize(stringReader); + } + + for (int index = 0; index < cases.Length; index += 2) + if (value.Equals(cases[index], StringComparison.OrdinalIgnoreCase)) + return cases[index + 1]; + + return null; + } + + #endregion Static Methods + + } + +} Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMacro.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMacro.Designer.cs 2008-01-19 22:34:08 UTC (rev 1284) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMacro.Designer.cs 2008-01-20 13:38:06 UTC (rev 1285) @@ -34,9 +34,6 @@ this.groupBoxCommandSequence = new System.Windows.Forms.GroupBox(); this.listViewMacro = new System.Windows.Forms.ListView(); this.columnHeader = new System.Windows.Forms.ColumnHeader(); - this.buttonRemove = new System.Windows.Forms.Button(); - this.buttonMoveDown = new System.Windows.Forms.Button(); - this.buttonMoveUp = new System.Windows.Forms.Button(); this.groupBoxCommands = new System.Windows.Forms.GroupBox(); this.treeViewCommandList = new System.Windows.Forms.TreeView(); this.buttonCancel = new System.Windows.Forms.Button(); @@ -45,12 +42,23 @@ this.groupBoxMacroName = new System.Windows.Forms.GroupBox(); this.toolTips = new System.Windows.Forms.ToolTip(this.components); this.splitContainer = new System.Windows.Forms.SplitContainer(); + this.toolStripCommandSequence = new System.Windows.Forms.ToolStrip(); + this.toolStripButtonTop = new System.Windows.Forms.ToolStripButton(); + this.toolStripButtonUp = new System.Windows.Forms.ToolStripButton(); + this.toolStripButtonEdit = new System.Windows.Forms.ToolStripButton(); + this.toolStripButtonDelete = new System.Windows.Forms.ToolStripButton(); + this.toolStripButtonDeleteAll = new System.Windows.Forms.ToolStripButton(); + this.toolStripButtonDown = new System.Windows.Forms.ToolStripButton(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); + this.toolStripButtonBottom = new System.Windows.Forms.ToolStripButton(); this.groupBoxCommandSequence.SuspendLayout(); this.groupBoxCommands.SuspendLayout(); this.groupBoxMacroName.SuspendLayout(); this.splitContainer.Panel1.SuspendLayout(); this.splitContainer.Panel2.SuspendLayout(); this.splitContainer.SuspendLayout(); + this.toolStripCommandSequence.SuspendLayout(); this.SuspendLayout(); // // textBoxName @@ -60,42 +68,36 @@ this.textBoxName.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.textBoxName.Location = new System.Drawing.Point(8, 16); this.textBoxName.Name = "textBoxName"; - this.textBoxName.Size = new System.Drawing.Size(324, 22); + this.textBoxName.Size = new System.Drawing.Size(488, 22); this.textBoxName.TabIndex = 0; this.toolTips.SetToolTip(this.textBoxName, "Provide a name for this macro (must be a valid windows file name)"); // // groupBoxCommandSequence // - this.groupBoxCommandSequence.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.groupBoxCommandSequence.Controls.Add(this.listViewMacro); - this.groupBoxCommandSequence.Controls.Add(this.buttonRemove); - this.groupBoxCommandSequence.Controls.Add(this.buttonMoveDown); - this.groupBoxCommandSequence.Controls.Add(this.buttonMoveUp); - this.groupBoxCommandSequence.Location = new System.Drawing.Point(0, 56); + this.groupBoxCommandSequence.Controls.Add(this.toolStripCommandSequence); + this.groupBoxCommandSequence.Dock = System.Windows.Forms.DockStyle.Fill; + this.groupBoxCommandSequence.Location = new System.Drawing.Point(0, 0); this.groupBoxCommandSequence.Name = "groupBoxCommandSequence"; - this.groupBoxCommandSequence.Size = new System.Drawing.Size(340, 304); - this.groupBoxCommandSequence.TabIndex = 1; + this.groupBoxCommandSequence.Size = new System.Drawing.Size(318, 232); + this.groupBoxCommandSequence.TabIndex = 0; this.groupBoxCommandSequence.TabStop = false; - this.groupBoxCommandSequence.Text = "Macro"; + this.groupBoxCommandSequence.Text = "Command Sequence"; // // listViewMacro // - this.listViewMacro.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.listViewMacro.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.columnHeader}); + this.listViewMacro.Dock = System.Windows.Forms.DockStyle.Fill; this.listViewMacro.FullRowSelect = true; this.listViewMacro.GridLines = true; - this.listViewMacro.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; + this.listViewMacro.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; this.listViewMacro.HideSelection = false; - this.listViewMacro.Location = new System.Drawing.Point(8, 16); + this.listViewMacro.Location = new System.Drawing.Point(3, 16); this.listViewMacro.MultiSelect = false; this.listViewMacro.Name = "listViewMacro"; this.listViewMacro.ShowGroups = false; - this.listViewMacro.Size = new System.Drawing.Size(324, 248); + this.listViewMacro.Size = new System.Drawing.Size(280, 213); this.listViewMacro.TabIndex = 0; this.listViewMacro.UseCompatibleStateImageBehavior = false; this.listViewMacro.View = System.Windows.Forms.View.Details; @@ -103,64 +105,26 @@ // // columnHeader // - this.columnHeader.Text = "Commands"; - this.columnHeader.Width = 300; + this.columnHeader.Text = "Command Sequence"; + this.columnHeader.Width = 268; // - // buttonRemove - // - this.buttonRemove.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonRemove.Location = new System.Drawing.Point(276, 272); - this.buttonRemove.Name = "buttonRemove"; - this.buttonRemove.Size = new System.Drawing.Size(56, 24); - this.buttonRemove.TabIndex = 3; - this.buttonRemove.Text = "Remove"; - this.toolTips.SetToolTip(this.buttonRemove, "Remove the selected command"); - this.buttonRemove.UseVisualStyleBackColor = true; - this.buttonRemove.Click += new System.EventHandler(this.buttonRemove_Click); - // - // buttonMoveDown - // - this.buttonMoveDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.buttonMoveDown.Location = new System.Drawing.Point(64, 272); - this.buttonMoveDown.Name = "buttonMoveDown"; - this.buttonMoveDown.Size = new System.Drawing.Size(48, 24); - this.buttonMoveDown.TabIndex = 2; - this.buttonMoveDown.Text = "Down"; - this.toolTips.SetToolTip(this.buttonMoveDown, "Move the selected command down one position"); - this.buttonMoveDown.UseVisualStyleBackColor = true; - this.buttonMoveDown.Click += new System.EventHandler(this.buttonMoveDown_Click); - // - // buttonMoveUp - // - this.buttonMoveUp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.buttonMoveUp.Location = new System.Drawing.Point(8, 272); - this.buttonMoveUp.Name = "buttonMoveUp"; - this.buttonMoveUp.Size = new System.Drawing.Size(48, 24); - this.buttonMoveUp.TabIndex = 1; - this.buttonMoveUp.Text = "Up"; - this.toolTips.SetToolTip(this.buttonMoveUp, "Move the selected command up one position"); - this.buttonMoveUp.UseVisualStyleBackColor = true; - this.buttonMoveUp.Click += new System.EventHandler(this.buttonMoveUp_Click); - // // groupBoxCommands // this.groupBoxCommands.Controls.Add(this.treeViewCommandList); this.groupBoxCommands.Dock = System.Windows.Forms.DockStyle.Fill; this.groupBoxCommands.Location = new System.Drawing.Point(0, 0); this.groupBoxCommands.Name = "groupBoxCommands"; - this.groupBoxCommands.Size = new System.Drawing.Size(190, 360); + this.groupBoxCommands.Size = new System.Drawing.Size(180, 232); this.groupBoxCommands.TabIndex = 0; this.groupBoxCommands.TabStop = false; this.groupBoxCommands.Text = "Commands"; // // treeViewCommandList // - this.treeViewCommandList.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.treeViewCommandList.Location = new System.Drawing.Point(8, 16); + this.treeViewCommandList.Dock = System.Windows.Forms.DockStyle.Fill; + this.treeViewCommandList.Location = new System.Drawing.Point(3, 16); this.treeViewCommandList.Name = "treeViewCommandList"; - this.treeViewCommandList.Size = new System.Drawing.Size(174, 336); + this.treeViewCommandList.Size = new System.Drawing.Size(174, 213); this.treeViewCommandList.TabIndex = 0; this.treeViewCommandList.DoubleClick += new System.EventHandler(this.treeViewCommandList_DoubleClick); // @@ -168,10 +132,10 @@ // 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(488, 376); + this.buttonCancel.Location = new System.Drawing.Point(456, 304); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(56, 24); - this.buttonCancel.TabIndex = 3; + this.buttonCancel.TabIndex = 4; this.buttonCancel.Text = "Cancel"; this.buttonCancel.UseVisualStyleBackColor = true; this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); @@ -179,10 +143,10 @@ // buttonTest // this.buttonTest.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.buttonTest.Location = new System.Drawing.Point(8, 376); + this.buttonTest.Location = new System.Drawing.Point(8, 304); this.buttonTest.Name = "buttonTest"; this.buttonTest.Size = new System.Drawing.Size(56, 24); - this.buttonTest.TabIndex = 1; + this.buttonTest.TabIndex = 2; this.buttonTest.Text = "Test"; this.toolTips.SetToolTip(this.buttonTest, "Test this macro"); this.buttonTest.UseVisualStyleBackColor = true; @@ -191,21 +155,22 @@ // 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(424, 376); + this.buttonOK.Location = new System.Drawing.Point(392, 304); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(56, 24); - this.buttonOK.TabIndex = 2; + this.buttonOK.TabIndex = 3; this.buttonOK.Text = "OK"; this.buttonOK.UseVisualStyleBackColor = true; this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); // // groupBoxMacroName // + this.groupBoxMacroName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.groupBoxMacroName.Controls.Add(this.textBoxName); - this.groupBoxMacroName.Dock = System.Windows.Forms.DockStyle.Top; - this.groupBoxMacroName.Location = new System.Drawing.Point(0, 0); + this.groupBoxMacroName.Location = new System.Drawing.Point(8, 8); this.groupBoxMacroName.Name = "groupBoxMacroName"; - this.groupBoxMacroName.Size = new System.Drawing.Size(340, 48); + this.groupBoxMacroName.Size = new System.Drawing.Size(504, 48); this.groupBoxMacroName.TabIndex = 0; this.groupBoxMacroName.TabStop = false; this.groupBoxMacroName.Text = "Macro Name"; @@ -215,48 +180,151 @@ this.splitContainer.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.splitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; - this.splitContainer.Location = new System.Drawing.Point(8, 8); + this.splitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; + this.splitContainer.Location = new System.Drawing.Point(8, 64); this.splitContainer.Name = "splitContainer"; // // splitContainer.Panel1 // - this.splitContainer.Panel1.Controls.Add(this.groupBoxCommandSequence); - this.splitContainer.Panel1.Controls.Add(this.groupBoxMacroName); - this.splitContainer.Panel1MinSize = 256; + this.splitContainer.Panel1.Controls.Add(this.groupBoxCommands); + this.splitContainer.Panel1MinSize = 128; // // splitContainer.Panel2 // - this.splitContainer.Panel2.Controls.Add(this.groupBoxCommands); + this.splitContainer.Panel2.Controls.Add(this.groupBoxCommandSequence); this.splitContainer.Panel2MinSize = 128; - this.splitContainer.Size = new System.Drawing.Size(536, 360); - this.splitContainer.SplitterDistance = 340; + this.splitContainer.Size = new System.Drawing.Size(504, 232); + this.splitContainer.SplitterDistance = 180; this.splitContainer.SplitterWidth = 6; - this.splitContainer.TabIndex = 0; + this.splitContainer.TabIndex = 1; // + // toolStripCommandSequence + // + this.toolStripCommandSequence.Dock = System.Windows.Forms.DockStyle.Right; + this.toolStripCommandSequence.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; + this.toolStripCommandSequence.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripButtonTop, + this.toolStripButtonUp, + this.toolStripSeparator1, + this.toolStripButtonEdit, + this.toolStripButtonDelete, + this.toolStripButtonDeleteAll, + this.toolStripSeparator2, + this.toolStripButtonDown, + this.toolStripButtonBottom}); + this.toolStripCommandSequence.Location = new System.Drawing.Point(283, 16); + this.toolStripCommandSequence.Name = "toolStripCommandSequence"; + this.toolStripCommandSequence.Size = new System.Drawing.Size(32, 213); + this.toolStripCommandSequence.TabIndex = 1; + this.toolStripCommandSequence.Text = "Command Sequence"; + // + // toolStripButtonTop + // + this.toolStripButtonTop.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButtonTop.Image = global::Commands.Properties.Resources.MoveTop; + this.toolStripButtonTop.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButtonTop.Name = "toolStripButtonTop"; + this.toolStripButtonTop.Size = new System.Drawing.Size(29, 20); + this.toolStripButtonTop.Text = "Move to Top"; + this.toolStripButtonTop.Click += new System.EventHandler(this.toolStripButtonTop_Click); + // + // toolStripButtonUp + // + this.toolStripButtonUp.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButtonUp.Image = global::Commands.Properties.Resources.MoveUp; + this.toolStripButtonUp.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButtonUp.Name = "toolStripButtonUp"; + this.toolStripButtonUp.Size = new System.Drawing.Size(29, 20); + this.toolStripButtonUp.Text = "Move Up"; + this.toolStripButtonUp.Click += new System.EventHandler(this.toolStripButtonUp_Click); + // + // toolStripButtonEdit + // + this.toolStripButtonEdit.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButtonEdit.Image = global::Commands.Properties.Resources.Edit; + this.toolStripButtonEdit.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButtonEdit.Name = "toolStripButtonEdit"; + this.toolStripButtonEdit.Size = new System.Drawing.Size(29, 20); + this.toolStripButtonEdit.Text = "Edit"; + this.toolStripButtonEdit.Click += new System.EventHandler(this.toolStripButtonEdit_Click); + // + // toolStripButtonDelete + // + this.toolStripButtonDelete.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButtonDelete.Image = global::Commands.Properties.Resources.Delete; + this.toolStripButtonDelete.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButtonDelete.Name = "toolStripButtonDelete"; + this.toolStripButtonDelete.Size = new System.Drawing.Size(29, 20); + this.toolStripButtonDelete.Text = "Delete"; + this.toolStripButtonDelete.Click += new System.EventHandler(this.toolStripButtonDelete_Click); + // + // toolStripButtonDeleteAll + // + this.toolStripButtonDeleteAll.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButtonDeleteAll.Image = global::Commands.Properties.Resources.DeleteAll; + this.toolStripButtonDeleteAll.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButtonDeleteAll.Name = "toolStripButtonDeleteAll"; + this.toolStripButtonDeleteAll.Size = new System.Drawing.Size(29, 20); + this.toolStripButtonDeleteAll.Text = "Delete All"; + this.toolStripButtonDeleteAll.Click += new System.EventHandler(this.toolStripButtonDeleteAll_Click); + // + // toolStripButtonDown + // + this.toolStripButtonDown.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButtonDown.Image = global::Commands.Properties.Resources.MoveDown; + this.toolStripButtonDown.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButtonDown.Name = "toolStripButtonDown"; + this.toolStripButtonDown.Size = new System.Drawing.Size(29, 20); + this.toolStripButtonDown.Text = "Move Down"; + this.toolStripButtonDown.Click += new System.EventHandler(this.toolStripButtonDown_Click); + // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(29, 6); + // + // toolStripSeparator2 + // + this.toolStripSeparator2.Name = "toolStripSeparator2"; + this.toolStripSeparator2.Size = new System.Drawing.Size(29, 6); + // + // toolStripButtonBottom + // + this.toolStripButtonBottom.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButtonBottom.Image = global::Commands.Properties.Resources.MoveBottom; + this.toolStripButtonBottom.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButtonBottom.Name = "toolStripButtonBottom"; + this.toolStripButtonBottom.Size = new System.Drawing.Size(29, 20); + this.toolStripButtonBottom.Text = "Move to Bottom"; + this.toolStripButtonBottom.Click += new System.EventHandler(this.toolStripButtonBottom_Click); + // // EditMacro // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(552, 409); + this.ClientSize = new System.Drawing.Size(520, 337); + this.Controls.Add(this.groupBoxMacroName); this.Controls.Add(this.buttonTest); this.Controls.Add(this.splitContainer); this.Controls.Add(this.buttonCancel); this.Controls.Add(this.buttonOK); this.MinimizeBox = false; - this.MinimumSize = new System.Drawing.Size(560, 436); + this.MinimumSize = new System.Drawing.Size(528, 364); this.Name = "EditMacro"; this.ShowIcon = false; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Macro Editor"; this.groupBoxCommandSequence.ResumeLayout(false); + this.groupBoxCommandSequence.PerformLayout(); this.groupBoxCommands.ResumeLayout(false); this.groupBoxMacroName.ResumeLayout(false); this.groupBoxMacroName.PerformLayout(); this.splitContainer.Panel1.ResumeLayout(false); this.splitContainer.Panel2.ResumeLayout(false); this.splitContainer.ResumeLayout(false); + this.toolStripCommandSequence.ResumeLayout(false); + this.toolStripCommandSequence.PerformLayout(); this.ResumeLayout(false); } @@ -265,9 +333,6 @@ private System.Windows.Forms.TextBox textBoxName; private System.Windows.Forms.GroupBox groupBoxCommandSequence; - private System.Windows.Forms.Button buttonRemove; - private System.Windows.Forms.Button buttonMoveDown; - private System.Windows.Forms.Button buttonMoveUp; private System.Windows.Forms.GroupBox groupBoxCommands; private System.Windows.Forms.Button buttonCancel; private System.Windows.Forms.Button buttonTest; @@ -278,6 +343,16 @@ private System.Windows.Forms.ListView listViewMacro; private System.Windows.Forms.ColumnHeader columnHeader; private System.Windows.Forms.SplitContainer splitContainer; + private System.Windows.Forms.ToolStrip toolStripCommandSequence; + private System.Windows.Forms.ToolStripButton toolStripButtonTop; + private System.Windows.Forms.ToolStripButton toolStripButtonUp; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; + private System.Windows.Forms.ToolStripButton toolStripButtonEdit; + private System.Windows.Forms.ToolStripButton toolStripButtonDelete; + private System.Windows.Forms.ToolStripButton toolStripButtonDeleteAll; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; + private System.Windows.Forms.ToolStripButton toolStripButtonDown; + private System.Windows.Forms.ToolStripButton toolStripButtonBottom; } } Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMacro.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMacro.cs 2008-01-19 22:34:08 UTC (rev 1284) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMacro.cs 2008-01-20 13:38:06 UTC (rev 1285) @@ -33,6 +33,7 @@ Processor _commandProcessor; string _macroFolder; + string _fileName; Dictionary<string, Type> _commands; @@ -62,8 +63,9 @@ _commandProcessor = commandProcessor; _macroFolder = macroFolder; + _fileName = "New Macro"; - textBoxName.Text = "New"; + textBoxName.Text = _fileName; textBoxName.Enabled = true; PopulateCommandList(categories); @@ -73,13 +75,17 @@ /// Creates a Macro Editor windows form. /// </summary> /// <param name="commandProcessor">The command processor.</param> + /// <param name="macroFolder">The macro folder.</param> /// <param name="categories">The command categories to include.</param> /// <param name="fileName">Name of the macro file.</param> - public EditMacro(Processor commandProcessor, string[] categories, string fileName) + public EditMacro(Processor commandProcessor, string macroFolder, string[] categories, string fileName) { if (commandProcessor == null) throw new ArgumentNullException("commandProcessor"); + if (String.IsNullOrEmpty(macroFolder)) + throw new ArgumentNullException("macroFolder"); + if (categories == null) throw new ArgumentNullException("categories"); @@ -89,14 +95,16 @@ InitializeComponent(); _commandProcessor = commandProcessor; + _macroFolder = macroFolder; _fileName = fileName; - string macroName = fileName; + if (_fileName.StartsWith(_macroFolder, StringComparison.OrdinalIgnoreCase)) + _fileName = _fileName.Substring(macroFolder.Length); + + string macroName = _fileName; if (macroName.StartsWith(Common.FolderAppData, StringComparison.OrdinalIgnoreCase)) - macroName = fileName.Substring(Common.FolderAppData.Length); + macroName = macroName.Substring(Common.FolderAppData.Length); - _macroFolder = fileName.Substring(0, fileName.Length - macroName.Length); - textBoxName.Text = macroName; textBoxName.Enabled = false; @@ -204,6 +212,99 @@ treeViewCommandList.SelectedNode.Expand(); } + void EditMacroCommand() + { + if (listViewMacro.SelectedItems.Count != 1) + return; + + try + { + ListViewItem selected = listViewMacro.SelectedItems[0]; + + string selectedTag = selected.Tag as string; + Command command = Processor.CreateCommand(selectedTag); + + if (_commandProcessor.Edit(command, this)) + { + selected.Text = command.GetUserDisplayText(); + selected.Tag = command.ToString(); + } + } + catch (Exception ex) + { + IrssLog.Error(ex); + MessageBox.Show(this, ex.Message, "Failed to edit macro command", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + void MoveToTop() + { + if (listViewMacro.SelectedItems.Count != 1) + return; + + int selected = listViewMacro.SelectedIndices[0]; + if (selected > 0) + { + ListViewItem item = listViewMacro.Items[selected]; + listViewMacro.Items.RemoveAt(selected); + listViewMacro.Items.Insert(0, item); + item.Selected = true; + } + } + void MoveUp() + { + if (listViewMacro.SelectedItems.Count != 1) + return; + + int selected = listViewMacro.SelectedIndices[0]; + if (selected > 0) + { + ListViewItem item = listViewMacro.Items[selected]; + listViewMacro.Items.RemoveAt(selected); + listViewMacro.Items.Insert(selected - 1, item); + item.Selected = true; + } + } + void MoveDown() + { + if (listViewMacro.SelectedItems.Count != 1) + return; + + int selected = listViewMacro.SelectedIndices[0]; + if (selected < listViewMacro.Items.Count - 1) + { + ListViewItem item = listViewMacro.Items[selected]; + listViewMacro.Items.RemoveAt(selected); + listViewMacro.Items.Insert(selected + 1, item); + item.Selected = true; + } + } + void MoveBottom() + { + if (listViewMacro.SelectedItems.Count != 1) + return; + + int selected = listViewMacro.SelectedIndices[0]; + if (selected < listViewMacro.Items.Count - 1) + { + ListViewItem item = listViewMacro.Items[selected]; + listViewMacro.Items.RemoveAt(selected); + listViewMacro.Items.Add(item); + item.Selected = true; + } + } + + void DeleteItem() + { + if (listViewMacro.SelectedItems.Count == 1) + listViewMacro.Items.RemoveAt(listViewMacro.SelectedIndices[0]); + } + void DeleteAllItems() + { + if (MessageBox.Show(this, "Are you sure you want to clear this entire macro?", "Clear macro", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) + listViewMacro.Clear(); + } + private void treeViewCommandList_DoubleClick(object sender, EventArgs e) { if (treeViewCommandList.SelectedNode == null || treeViewCommandList.SelectedNode.Level == 0) @@ -250,7 +351,7 @@ } else { - throw new ApplicationException(String.Format("Unknown macro command ({0})", selected)); + throw new MacroStructureException(String.Format("Unknown macro command ({0})", selected)); } } catch (Exception ex) @@ -259,41 +360,42 @@ MessageBox.Show(this, ex.Message, "Failed to add macro command", MessageBoxButtons.OK, MessageBoxIcon.Error); } } - - private void buttonMoveUp_Click(object sender, EventArgs e) + + private void listViewMacro_DoubleClick(object sender, EventArgs e) { - if (listViewMacro.SelectedItems.Count != 1) - return; - - int selected = listViewMacro.SelectedIndices[0]; - if (selected > 0) - { - ListViewItem item = listViewMacro.Items[selected]; - listViewMacro.Items.RemoveAt(selected); - listViewMacro.Items.Insert(selected - 1, item); - item.Selected = true; - } + EditMacroCommand(); } - private void buttonMoveDown_Click(object sender, EventArgs e) + + private void toolStripButtonTop_Click(object sender, EventArgs e) { - if (listViewMacro.SelectedItems.Count != 1) - return; + MoveToTop(); + } + private void toolStri... [truncated message content] |
From: <an...@us...> - 2008-01-20 15:50:07
|
Revision: 1288 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1288&view=rev Author: and-81 Date: 2008-01-20 07:49:40 -0800 (Sun, 20 Jan 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandProcessor.csproj trunk/plugins/IR Server Suite/Commands/CommandProcessor/Processor.cs trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandKeystrokes.cs trunk/plugins/IR Server Suite/Commands/GeneralCommands/EditKeystrokes.Designer.cs trunk/plugins/IR Server Suite/Commands/GeneralCommands/EditKeystrokes.cs trunk/plugins/IR Server Suite/Commands/GeneralCommands/GeneralCommands.csproj trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/CommandGotoScreen.cs trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/EditGotoScreen.Designer.cs trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/EditGotoScreen.cs trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/MediaPortalCommands.csproj trunk/plugins/IR Server Suite/Commands/TestApp/Program.cs trunk/plugins/IR Server Suite/Documentation/LICENSE.MIT trunk/plugins/IR Server Suite/Documentation/legal.html trunk/plugins/IR Server Suite/Documentation/new.html Added Paths: ----------- trunk/plugins/IR Server Suite/Commands/CommandProcessor/Commands/CommandBlastIR.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Commands/CommandCallMacro.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Commands/CommandClearVariables.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Commands/CommandGotoLabel.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Commands/CommandIf.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Commands/CommandLabel.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Commands/CommandLoadVariables.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Commands/CommandMathsOperation.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Commands/CommandSaveVariables.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Commands/CommandSetVariable.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Commands/CommandStringOperation.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Commands/CommandSwapVariables.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Commands/CommandSwitch.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditBlastIR.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditBlastIR.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditBlastIR.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditIf.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditIf.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditIf.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditLabel.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditLabel.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditLabel.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditMacro.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditMacro.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditMacro.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditMathsOperation.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditMathsOperation.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditMathsOperation.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditSetVariable.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditSetVariable.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditSetVariable.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditStringOperation.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditStringOperation.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditStringOperation.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditSwapVariables.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditSwapVariables.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditSwapVariables.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditSwitch.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditSwitch.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditSwitch.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditVariablesFile.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditVariablesFile.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditVariablesFile.resx trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/CommandExit.cs trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/CommandReboot.cs trunk/plugins/IR Server Suite/Documentation/LICENSE.MS-PL Removed Paths: ------------- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandBlastIR.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandCallMacro.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandClearVariables.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandGotoLabel.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandIf.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandLabel.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandLoadVariables.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandMathsOperation.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSaveVariables.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSetVariable.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandStringOperation.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSwapVariables.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSwitch.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditBlastIR.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditBlastIR.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditBlastIR.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditIf.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditIf.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditIf.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditLabel.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditLabel.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditLabel.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMacro.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMacro.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMacro.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMathsOperation.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMathsOperation.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditMathsOperation.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditSetVariable.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditSetVariable.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditSetVariable.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditStringOperation.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditStringOperation.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditStringOperation.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditSwapVariables.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditSwapVariables.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditSwapVariables.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditSwitch.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditSwitch.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditSwitch.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditVariablesFile.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditVariablesFile.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/EditVariablesFile.resx Deleted: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandBlastIR.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandBlastIR.cs 2008-01-20 15:12:37 UTC (rev 1287) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandBlastIR.cs 2008-01-20 15:49:40 UTC (rev 1288) @@ -1,97 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Windows.Forms; - -using IrssUtils; - -namespace Commands -{ - - /// <summary> - /// Blast IR macro command. - /// </summary> - public class CommandBlastIR : Command - { - - #region Constructors - - /// <summary> - /// Initializes a new instance of the <see cref="CommandBlastIR"/> class. - /// </summary> - public CommandBlastIR() { InitParameters(2); } - - /// <summary> - /// Initializes a new instance of the <see cref="CommandBlastIR"/> class. - /// </summary> - /// <param name="parameters">The parameters.</param> - public CommandBlastIR(string[] parameters) : base(parameters) { } - - #endregion Constructors - - #region Implementation - - /// <summary> - /// Gets the category of this command. - /// </summary> - /// <returns>The category of this command.</returns> - public override string GetCategory() { return Processor.CategoryHidden; } - - /// <summary> - /// Gets the user interface text. - /// </summary> - /// <returns>User interface text.</returns> - public override string GetUserInterfaceText() { return "Blast IR"; } - - /// <summary> - /// Gets the user display text. - /// </summary> - /// <returns>The user display text.</returns> - public override string GetUserDisplayText() - { - string fileName = Parameters[0]; - - if (Parameters[0].StartsWith(Common.FolderAppData, StringComparison.OrdinalIgnoreCase)) - fileName = Parameters[0].Substring(Common.FolderAppData.Length); - - return String.Format("{0} ({1}, {2})", GetUserInterfaceText(), fileName, Parameters[1]); - } - - /// <summary> - /// Edit this command. - /// </summary> - /// <param name="parent">The parent window.</param> - /// <param name="blastIrDelegate">The blast ir delegate.</param> - /// <param name="blastPorts">The blast ports.</param> - /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> - public bool Edit(IWin32Window parent, BlastIrDelegate blastIrDelegate, string[] blastPorts) - { - EditBlastIR edit = new EditBlastIR(blastIrDelegate, blastPorts, Parameters); - if (edit.ShowDialog(parent) == DialogResult.OK) - { - Parameters = edit.Parameters; - return true; - } - - return false; - } - - /// <summary> - /// Execute this command. - /// </summary> - /// <param name="blastIrDelegate">The blast ir delegate.</param> - public void Execute(BlastIrDelegate blastIrDelegate) - { - string irFile = Parameters[0] + Common.FileExtensionIR; - string port = Parameters[1]; - - blastIrDelegate(irFile, port); - } - - #endregion Implementation - - - } - -} Deleted: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandCallMacro.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandCallMacro.cs 2008-01-20 15:12:37 UTC (rev 1287) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandCallMacro.cs 2008-01-20 15:49:40 UTC (rev 1288) @@ -1,93 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Windows.Forms; - -using IrssUtils; - -namespace Commands -{ - - /// <summary> - /// Call Macro macro command. - /// </summary> - public class CommandCallMacro : Command - { - - #region Constructors - - /// <summary> - /// Initializes a new instance of the <see cref="CommandCallMacro"/> class. - /// </summary> - public CommandCallMacro() { InitParameters(1); } - - /// <summary> - /// Initializes a new instance of the <see cref="CommandCallMacro"/> class. - /// </summary> - /// <param name="parameters">The parameters.</param> - public CommandCallMacro(string [] parameters): base(parameters) { } - - #endregion Constructors - - #region Implementation - - /// <summary> - /// Gets the category of this command. - /// </summary> - /// <returns>The category of this command.</returns> - public override string GetCategory() { return Processor.CategoryHidden; } - - /// <summary> - /// Gets the user interface text. - /// </summary> - /// <returns>User interface text.</returns> - public override string GetUserInterfaceText() { return "Macro"; } - - /// <summary> - /// Gets the user display text. - /// </summary> - /// <returns>The user display text.</returns> - public override string GetUserDisplayText() - { - string fileName = Parameters[0]; - - if (Parameters[0].StartsWith(Common.FolderAppData, StringComparison.OrdinalIgnoreCase)) - fileName = Parameters[0].Substring(Common.FolderAppData.Length); - - return String.Format("{0} ({1})", GetUserInterfaceText(), fileName); - } - - /// <summary> - /// Execute this command. - /// </summary> - /// <param name="commandProcessor">The command processor.</param> - public void Execute(Processor commandProcessor) - { - Macro macro = new Macro(Parameters[0]); - macro.Execute(commandProcessor); - } - - /// <summary> - /// Edit this command. - /// </summary> - /// <param name="parent">The parent window.</param> - /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> - public override bool Edit(IWin32Window parent) - { - if (String.IsNullOrEmpty(Parameters[0])) - { - OpenFileDialog openFileDialog = new OpenFileDialog(); - openFileDialog.Filter = "Macro Files|*" + Processor.FileExtensionMacro; - if (openFileDialog.ShowDialog(parent) == DialogResult.OK) - Parameters[0] = Path.Combine(Path.GetDirectoryName(openFileDialog.FileName), Path.GetFileNameWithoutExtension(openFileDialog.FileName)); - } - - return true; - } - - #endregion Implementation - - } - -} Deleted: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandClearVariables.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandClearVariables.cs 2008-01-20 15:12:37 UTC (rev 1287) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandClearVariables.cs 2008-01-20 15:49:40 UTC (rev 1288) @@ -1,56 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows.Forms; - -namespace Commands -{ - - /// <summary> - /// Clear Variables special command. - /// </summary> - public class CommandClearVariables : Command - { - - #region Constructors - - /// <summary> - /// Initializes a new instance of the <see cref="CommandClearVariables"/> class. - /// </summary> - public CommandClearVariables() { InitParameters(0); } - - /// <summary> - /// Initializes a new instance of the <see cref="CommandClearVariables"/> class. - /// </summary> - /// <param name="parameters">The parameters.</param> - public CommandClearVariables(string[] parameters) : base(parameters) { } - - #endregion Constructors - - #region Implementation - - /// <summary> - /// Gets the category of this command. - /// </summary> - /// <returns>The category of this command.</returns> - public override string GetCategory() { return Processor.CategoryMacro; } - - /// <summary> - /// Gets the user interface text. - /// </summary> - /// <returns>User interface text.</returns> - public override string GetUserInterfaceText() { return "Clear Variables"; } - - /// <summary> - /// Execute this command. - /// </summary> - public override void Execute(VariableList variables) - { - variables.Clear(); - } - - #endregion Implementation - - } - -} Deleted: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandGotoLabel.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandGotoLabel.cs 2008-01-20 15:12:37 UTC (rev 1287) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandGotoLabel.cs 2008-01-20 15:49:40 UTC (rev 1288) @@ -1,65 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows.Forms; - -namespace Commands -{ - - /// <summary> - /// Goto Label macro command. - /// </summary> - public class CommandGotoLabel : Command - { - - #region Constructors - - /// <summary> - /// Initializes a new instance of the <see cref="CommandGotoLabel"/> class. - /// </summary> - public CommandGotoLabel() { InitParameters(1); } - - /// <summary> - /// Initializes a new instance of the <see cref="CommandGotoLabel"/> class. - /// </summary> - /// <param name="parameters">The parameters.</param> - public CommandGotoLabel(string[] parameters) : base(parameters) { } - - #endregion Constructors - - #region Implementation - - /// <summary> - /// Gets the category of this command. - /// </summary> - /// <returns>The category of this command.</returns> - public override string GetCategory() { return Processor.CategoryMacro; } - - /// <summary> - /// Gets the user interface text. - /// </summary> - /// <returns>User interface text.</returns> - public override string GetUserInterfaceText() { return "Goto Label"; } - - /// <summary> - /// Edit this command. - /// </summary> - /// <param name="parent">The parent window.</param> - /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> - public override bool Edit(IWin32Window parent) - { - EditLabel edit = new EditLabel(Parameters[0]); - if (edit.ShowDialog(parent) == DialogResult.OK) - { - Parameters[0] = edit.LabelName; - return true; - } - - return false; - } - - #endregion Implementation - - } - -} Deleted: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandIf.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandIf.cs 2008-01-20 15:12:37 UTC (rev 1287) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandIf.cs 2008-01-20 15:49:40 UTC (rev 1288) @@ -1,139 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows.Forms; - -namespace Commands -{ - - /// <summary> - /// If Statement macro command. - /// </summary> - public class CommandIf : Command - { - - #region Comparisons - - // String comparisons ... - internal const string IfEquals = "=="; - internal const string IfNotEqual = "!="; - internal const string IfContains = "CONTAINS"; - internal const string IfStartsWith = "STARTS WITH"; - internal const string IfEndsWith = "ENDS WITH"; - - // Integer comparisons ... - internal const string IfGreaterThan = ">"; - internal const string IfLessThan = "<"; - internal const string IfGreaterThanOrEqual = ">="; - internal const string IfLessThanOrEqual = "<="; - - #endregion Comparisons - - #region Constructors - - /// <summary> - /// Initializes a new instance of the <see cref="CommandIf"/> class. - /// </summary> - public CommandIf() { InitParameters(5); } - - /// <summary> - /// Initializes a new instance of the <see cref="CommandIf"/> class. - /// </summary> - /// <param name="parameters">The parameters.</param> - public CommandIf(string[] parameters) : base(parameters) { } - - #endregion Constructors - - #region Implementation - - /// <summary> - /// Gets the category of this command. - /// </summary> - /// <returns>The category of this command.</returns> - public override string GetCategory() { return Processor.CategoryMacro; } - - /// <summary> - /// Gets the user interface text. - /// </summary> - /// <returns>User interface text.</returns> - public override string GetUserInterfaceText() { return "If Statement"; } - - /// <summary> - /// Edit this command. - /// </summary> - /// <param name="parent">The parent window.</param> - /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> - public override bool Edit(IWin32Window parent) - { - EditIf edit = new EditIf(Parameters); - if (edit.ShowDialog(parent) == DialogResult.OK) - { - Parameters = edit.Parameters; - return true; - } - - return false; - } - - #endregion Implementation - - #region Static Methods - - /// <summary> - /// This method will determine if an If Statement evaluates true. - /// </summary> - /// <param name="value1">The first value for comparison.</param> - /// <param name="comparison">The comparison type.</param> - /// <param name="value2">The second value for comparison.</param> - /// <returns><c>true</c> if the parameters evaluates true, otherwise <c>false</c>.</returns> - public static bool Evaluate(string value1, string comparison, string value2) - { - int value1AsInt; - bool value1IsInt = int.TryParse(value1, out value1AsInt); - - int value2AsInt; - bool value2IsInt = int.TryParse(value2, out value2AsInt); - - bool comparisonResult = false; - switch (comparison.ToUpperInvariant()) - { - // Use string comparison ... - case IfEquals: comparisonResult = value1.Equals(value2, StringComparison.OrdinalIgnoreCase); break; - case IfNotEqual: comparisonResult = !value1.Equals(value2, StringComparison.OrdinalIgnoreCase); break; - case IfContains: comparisonResult = value1.ToUpperInvariant().Contains(value2.ToUpperInvariant()); break; - case IfStartsWith: comparisonResult = value1.StartsWith(value2, StringComparison.OrdinalIgnoreCase); break; - case IfEndsWith: comparisonResult = value1.EndsWith(value2, StringComparison.OrdinalIgnoreCase); break; - - // Use integer comparison ... - case IfGreaterThan: - if (value1IsInt && value2IsInt) - comparisonResult = (value1AsInt > value2AsInt); - break; - - case IfLessThan: - if (value1IsInt && value2IsInt) - comparisonResult = (value1AsInt < value2AsInt); - break; - - case IfGreaterThanOrEqual: - if (value1IsInt && value2IsInt) - comparisonResult = (value1AsInt >= value2AsInt); - break; - - case IfLessThanOrEqual: - if (value1IsInt && value2IsInt) - comparisonResult = (value1AsInt <= value2AsInt); - break; - - default: - throw new CommandStructureException(String.Format("Invalid variable comparison method: {0}", comparison)); - } - - return comparisonResult; - } - - #endregion Static Methods - - } - -} Deleted: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandLabel.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandLabel.cs 2008-01-20 15:12:37 UTC (rev 1287) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandLabel.cs 2008-01-20 15:49:40 UTC (rev 1288) @@ -1,65 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows.Forms; - -namespace Commands -{ - - /// <summary> - /// Label macro command. - /// </summary> - public class CommandLabel : Command - { - - #region Constructors - - /// <summary> - /// Initializes a new instance of the <see cref="CommandLabel"/> class. - /// </summary> - public CommandLabel() { InitParameters(1); } - - /// <summary> - /// Initializes a new instance of the <see cref="CommandLabel"/> class. - /// </summary> - /// <param name="parameters">The parameters.</param> - public CommandLabel(string[] parameters) : base(parameters) { } - - #endregion Constructors - - #region Implementation - - /// <summary> - /// Gets the category of this command. - /// </summary> - /// <returns>The category of this command.</returns> - public override string GetCategory() { return Processor.CategoryMacro; } - - /// <summary> - /// Gets the user interface text. - /// </summary> - /// <returns>User interface text.</returns> - public override string GetUserInterfaceText() { return "Label"; } - - /// <summary> - /// Edit this command. - /// </summary> - /// <param name="parent">The parent window.</param> - /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> - public override bool Edit(IWin32Window parent) - { - EditLabel edit = new EditLabel(Parameters[0]); - if (edit.ShowDialog(parent) == DialogResult.OK) - { - Parameters[0] = edit.LabelName; - return true; - } - - return false; - } - - #endregion Implementation - - } - -} Deleted: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandLoadVariables.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandLoadVariables.cs 2008-01-20 15:12:37 UTC (rev 1287) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandLoadVariables.cs 2008-01-20 15:49:40 UTC (rev 1288) @@ -1,74 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows.Forms; - -namespace Commands -{ - - /// <summary> - /// Load Variables macro command. - /// </summary> - public class CommandLoadVariables : Command - { - - #region Constructors - - /// <summary> - /// Initializes a new instance of the <see cref="CommandLoadVariables"/> class. - /// </summary> - public CommandLoadVariables() { InitParameters(1); } - - /// <summary> - /// Initializes a new instance of the <see cref="CommandLoadVariables"/> class. - /// </summary> - /// <param name="parameters">The parameters.</param> - public CommandLoadVariables(string[] parameters) : base(parameters) { } - - #endregion Constructors - - #region Implementation - - /// <summary> - /// Gets the category of this command. - /// </summary> - /// <returns>The category of this command.</returns> - public override string GetCategory() { return Processor.CategoryMacro; } - - /// <summary> - /// Gets the user interface text. - /// </summary> - /// <returns>User interface text.</returns> - public override string GetUserInterfaceText() { return "Load Variables"; } - - /// <summary> - /// Edit this command. - /// </summary> - /// <param name="parent">The parent window.</param> - /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> - public override bool Edit(IWin32Window parent) - { - EditVariablesFile edit = new EditVariablesFile(Parameters[0]); - if (edit.ShowDialog(parent) == DialogResult.OK) - { - Parameters[0] = edit.FileName; - return true; - } - - return false; - } - - /// <summary> - /// Execute this command. - /// </summary> - /// <param name="variables">The variable list of the calling code.</param> - public override void Execute(VariableList variables) - { - variables.Load(Parameters[0]); - } - - #endregion Implementation - - } - -} Deleted: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandMathsOperation.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandMathsOperation.cs 2008-01-20 15:12:37 UTC (rev 1287) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandMathsOperation.cs 2008-01-20 15:49:40 UTC (rev 1288) @@ -1,123 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows.Forms; - -namespace Commands -{ - - /// <summary> - /// Maths Operation macro command. - /// </summary> - public class CommandMathsOperation : Command - { - - #region Maths Operations - - internal const string MathOpAdd = "Add"; - internal const string MathOpSubtract = "Subtract"; - internal const string MathOpMultiply = "Multiply"; - internal const string MathOpDivide = "Divide"; - internal const string MathOpModulo = "Modulo"; - internal const string MathOpPower = "Power"; - internal const string MathOpAbsolute = "Absolute"; - internal const string MathOpRoot = "Square Root"; - - // TODO: Add more maths operations - - //internal const string MathOpToBinary = "To Binary (Input 1)"; - //internal const string MathOpFromBinary = "From Binary (Input 1)"; - - //internal const string MathOpToHex = "To Hex (Input 1)"; - //internal const string MathOpFromHex = "From Hex (Input 1)"; - - //internal const string MathOpToOctal = "To Octal (Input 1)"; - //internal const string MathOpFromOctal = "From Octal (Input 1)"; - - #endregion Maths Operations - - #region Constructors - - /// <summary> - /// Initializes a new instance of the <see cref="CommandMathsOperation"/> class. - /// </summary> - public CommandMathsOperation() { InitParameters(4); } - - /// <summary> - /// Initializes a new instance of the <see cref="CommandMathsOperation"/> class. - /// </summary> - /// <param name="parameters">The parameters.</param> - public CommandMathsOperation(string[] parameters) : base(parameters) { } - - #endregion Constructors - - #region Implementation - - /// <summary> - /// Gets the category of this command. - /// </summary> - /// <returns>The category of this command.</returns> - public override string GetCategory() { return Processor.CategoryMacro; } - - /// <summary> - /// Gets the user interface text. - /// </summary> - /// <returns>User interface text.</returns> - public override string GetUserInterfaceText() { return "Maths Operation"; } - - /// <summary> - /// Edit this command. - /// </summary> - /// <param name="parent">The parent window.</param> - /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> - public override bool Edit(IWin32Window parent) - { - EditMathsOperation edit = new EditMathsOperation(Parameters); - if (edit.ShowDialog(parent) == DialogResult.OK) - { - Parameters = edit.Parameters; - return true; - } - - return false; - } - - /// <summary> - /// Execute this command. - /// </summary> - /// <param name="variables">The variable list of the calling code.</param> - public override void Execute(VariableList variables) - { - string input1 = Processor.ReplaceSpecial(Parameters[1]); - int input1Int = 0; - int.TryParse(input1, out input1Int); - - string input2 = Processor.ReplaceSpecial(Parameters[2]); - int input2Int = 0; - int.TryParse(input2, out input2Int); - - int output = 0; - - switch (Parameters[0]) - { - case MathOpAdd: output = input1Int + input2Int; break; - case MathOpDivide: output = input1Int / input2Int; break; - case MathOpModulo: output = input1Int % input2Int; break; - case MathOpMultiply: output = input1Int * input2Int; break; - case MathOpPower: output = (int)Math.Pow((double)input1Int, (double)input2Int); break; - case MathOpSubtract: output = input1Int - input2Int; break; - case MathOpAbsolute: output = Math.Abs(input1Int); break; - case MathOpRoot: output = (int)Math.Sqrt((double) input1Int); break; - - default: - throw new CommandStructureException(String.Format("Invalid Maths Operation: {0}", Parameters[0])); - } - - variables.SetVariable(Parameters[3], output.ToString()); - } - - #endregion Implementation - - } - -} Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandProcessor.csproj =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandProcessor.csproj 2008-01-20 15:12:37 UTC (rev 1287) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandProcessor.csproj 2008-01-20 15:49:40 UTC (rev 1288) @@ -38,83 +38,83 @@ <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> - <Compile Include="CommandStringOperation.cs" /> - <Compile Include="CommandSwapVariables.cs" /> - <Compile Include="CommandMathsOperation.cs" /> - <Compile Include="CommandSwitch.cs" /> - <Compile Include="EditSwitch.cs"> + <Compile Include="Commands\CommandStringOperation.cs" /> + <Compile Include="Commands\CommandSwapVariables.cs" /> + <Compile Include="Commands\CommandMathsOperation.cs" /> + <Compile Include="Commands\CommandSwitch.cs" /> + <Compile Include="Forms\EditBlastIR.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="EditSwitch.Designer.cs"> - <DependentUpon>EditSwitch.cs</DependentUpon> + <Compile Include="Forms\EditBlastIR.designer.cs"> + <DependentUpon>EditBlastIR.cs</DependentUpon> </Compile> - <Compile Include="EditMathsOperation.cs"> + <Compile Include="Forms\EditIf.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="EditMathsOperation.Designer.cs"> - <DependentUpon>EditMathsOperation.cs</DependentUpon> + <Compile Include="Forms\EditIf.designer.cs"> + <DependentUpon>EditIf.cs</DependentUpon> </Compile> - <Compile Include="EditSwapVariables.cs"> + <Compile Include="Forms\EditLabel.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="EditSwapVariables.Designer.cs"> - <DependentUpon>EditSwapVariables.cs</DependentUpon> + <Compile Include="Forms\EditLabel.designer.cs"> + <DependentUpon>EditLabel.cs</DependentUpon> </Compile> - <Compile Include="EditStringOperation.cs"> + <Compile Include="Forms\EditMacro.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="EditStringOperation.Designer.cs"> - <DependentUpon>EditStringOperation.cs</DependentUpon> + <Compile Include="Forms\EditMacro.designer.cs"> + <DependentUpon>EditMacro.cs</DependentUpon> </Compile> - <Compile Include="Processor.cs" /> - <Compile Include="EditBlastIR.cs"> + <Compile Include="Forms\EditMathsOperation.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="EditBlastIR.Designer.cs"> - <DependentUpon>EditBlastIR.cs</DependentUpon> + <Compile Include="Forms\EditMathsOperation.designer.cs"> + <DependentUpon>EditMathsOperation.cs</DependentUpon> </Compile> - <Compile Include="CommandClearVariables.cs" /> - <Compile Include="CommandIf.cs" /> - <Compile Include="CommandLabel.cs" /> - <Compile Include="CommandGotoLabel.cs" /> - <Compile Include="CommandSetVariable.cs" /> - <Compile Include="CommandSaveVariables.cs" /> - <Compile Include="CommandLoadVariables.cs" /> - <Compile Include="CommandCallMacro.cs" /> - <Compile Include="CommandBlastIR.cs" /> - <Compile Include="EditIf.cs"> + <Compile Include="Forms\EditSetVariable.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="EditIf.Designer.cs"> - <DependentUpon>EditIf.cs</DependentUpon> + <Compile Include="Forms\EditSetVariable.designer.cs"> + <DependentUpon>EditSetVariable.cs</DependentUpon> </Compile> - <Compile Include="EditLabel.cs"> + <Compile Include="Forms\EditStringOperation.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="EditLabel.Designer.cs"> - <DependentUpon>EditLabel.cs</DependentUpon> + <Compile Include="Forms\EditStringOperation.designer.cs"> + <DependentUpon>EditStringOperation.cs</DependentUpon> </Compile> - <Compile Include="Macro.cs" /> - <Compile Include="EditMacro.cs"> + <Compile Include="Forms\EditSwapVariables.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="EditMacro.Designer.cs"> - <DependentUpon>EditMacro.cs</DependentUpon> + <Compile Include="Forms\EditSwapVariables.designer.cs"> + <DependentUpon>EditSwapVariables.cs</DependentUpon> </Compile> - <Compile Include="MacroStructureException.cs" /> - <Compile Include="Properties\AssemblyInfo.cs" /> - <Compile Include="EditSetVariable.cs"> + <Compile Include="Forms\EditSwitch.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="EditSetVariable.Designer.cs"> - <DependentUpon>EditSetVariable.cs</DependentUpon> + <Compile Include="Forms\EditSwitch.designer.cs"> + <DependentUpon>EditSwitch.cs</DependentUpon> </Compile> - <Compile Include="EditVariablesFile.cs"> + <Compile Include="Forms\EditVariablesFile.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="EditVariablesFile.Designer.cs"> + <Compile Include="Forms\EditVariablesFile.designer.cs"> <DependentUpon>EditVariablesFile.cs</DependentUpon> </Compile> + <Compile Include="Processor.cs" /> + <Compile Include="Commands\CommandClearVariables.cs" /> + <Compile Include="Commands\CommandIf.cs" /> + <Compile Include="Commands\CommandLabel.cs" /> + <Compile Include="Commands\CommandGotoLabel.cs" /> + <Compile Include="Commands\CommandSetVariable.cs" /> + <Compile Include="Commands\CommandSaveVariables.cs" /> + <Compile Include="Commands\CommandLoadVariables.cs" /> + <Compile Include="Commands\CommandCallMacro.cs" /> + <Compile Include="Commands\CommandBlastIR.cs" /> + <Compile Include="Macro.cs" /> + <Compile Include="MacroStructureException.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\Resources.Designer.cs"> <AutoGen>True</AutoGen> <DesignTime>True</DesignTime> @@ -122,43 +122,43 @@ </Compile> </ItemGroup> <ItemGroup> - <EmbeddedResource Include="EditSwitch.resx"> - <DependentUpon>EditSwitch.cs</DependentUpon> + <EmbeddedResource Include="Forms\EditBlastIR.resx"> + <DependentUpon>EditBlastIR.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> - <EmbeddedResource Include="EditMathsOperation.resx"> - <DependentUpon>EditMathsOperation.cs</DependentUpon> + <EmbeddedResource Include="Forms\EditIf.resx"> + <DependentUpon>EditIf.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> - <EmbeddedResource Include="EditSwapVariables.resx"> - <DependentUpon>EditSwapVariables.cs</DependentUpon> + <EmbeddedResource Include="Forms\EditLabel.resx"> + <DependentUpon>EditLabel.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> - <EmbeddedResource Include="EditStringOperation.resx"> - <DependentUpon>EditStringOperation.cs</DependentUpon> + <EmbeddedResource Include="Forms\EditMacro.resx"> + <DependentUpon>EditMacro.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> - <EmbeddedResource Include="EditBlastIR.resx"> - <DependentUpon>EditBlastIR.cs</DependentUpon> + <EmbeddedResource Include="Forms\EditMathsOperation.resx"> + <DependentUpon>EditMathsOperation.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> - <EmbeddedResource Include="EditIf.resx"> - <DependentUpon>EditIf.cs</DependentUpon> + <EmbeddedResource Include="Forms\EditSetVariable.resx"> + <DependentUpon>EditSetVariable.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> - <EmbeddedResource Include="EditMacro.resx"> - <DependentUpon>EditMacro.cs</DependentUpon> + <EmbeddedResource Include="Forms\EditStringOperation.resx"> + <DependentUpon>EditStringOperation.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> - <EmbeddedResource Include="EditLabel.resx"> - <DependentUpon>EditLabel.cs</DependentUpon> + <EmbeddedResource Include="Forms\EditSwapVariables.resx"> + <DependentUpon>EditSwapVariables.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> - <EmbeddedResource Include="EditSetVariable.resx"> - <DependentUpon>EditSetVariable.cs</DependentUpon> + <EmbeddedResource Include="Forms\EditSwitch.resx"> + <DependentUpon>EditSwitch.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> - <EmbeddedResource Include="EditVariablesFile.resx"> + <EmbeddedResource Include="Forms\EditVariablesFile.resx"> <DependentUpon>EditVariablesFile.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> Deleted: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSaveVariables.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSaveVariables.cs 2008-01-20 15:12:37 UTC (rev 1287) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSaveVariables.cs 2008-01-20 15:49:40 UTC (rev 1288) @@ -1,74 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows.Forms; - -namespace Commands -{ - - /// <summary> - /// Save Variables macro command. - /// </summary> - public class CommandSaveVariables : Command - { - - #region Constructors - - /// <summary> - /// Initializes a new instance of the <see cref="CommandSaveVariables"/> class. - /// </summary> - public CommandSaveVariables() { InitParameters(1); } - - /// <summary> - /// Initializes a new instance of the <see cref="CommandSaveVariables"/> class. - /// </summary> - /// <param name="parameters">The parameters.</param> - public CommandSaveVariables(string[] parameters) : base(parameters) { } - - #endregion Constructors - - #region Implementation - - /// <summary> - /// Gets the category of this command. - /// </summary> - /// <returns>The category of this command.</returns> - public override string GetCategory() { return Processor.CategoryMacro; } - - /// <summary> - /// Gets the user interface text. - /// </summary> - /// <returns>User interface text.</returns> - public override string GetUserInterfaceText() { return "Save Variables"; } - - /// <summary> - /// Edit this command. - /// </summary> - /// <param name="parent">The parent window.</param> - /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> - public override bool Edit(IWin32Window parent) - { - EditVariablesFile edit = new EditVariablesFile(Parameters[0]); - if (edit.ShowDialog(parent) == DialogResult.OK) - { - Parameters[0] = edit.FileName; - return true; - } - - return false; - } - - /// <summary> - /// Execute this command. - /// </summary> - /// <param name="variables">The variable list of the calling code.</param> - public override void Execute(VariableList variables) - { - variables.Save(Parameters[0]); - } - - #endregion Implementation - - } - -} Deleted: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSetVariable.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSetVariable.cs 2008-01-20 15:12:37 UTC (rev 1287) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSetVariable.cs 2008-01-20 15:49:40 UTC (rev 1288) @@ -1,76 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows.Forms; - -namespace Commands -{ - - /// <summary> - /// Set Variable macro command. - /// </summary> - public class CommandSetVariable : Command - { - - #region Constructors - - /// <summary> - /// Initializes a new instance of the <see cref="CommandSetVariable"/> class. - /// </summary> - public CommandSetVariable() { InitParameters(2); } - - /// <summary> - /// Initializes a new instance of the <see cref="CommandSetVariable"/> class. - /// </summary> - /// <param name="parameters">The parameters.</param> - public CommandSetVariable(string[] parameters) : base(parameters) { } - - #endregion Constructors - - #region Implementation - - /// <summary> - /// Gets the category of this command. - /// </summary> - /// <returns>The category of this command.</returns> - public override string GetCategory() { return Processor.CategoryMacro; } - - /// <summary> - /// Gets the user interface text. - /// </summary> - /// <returns>User interface text.</returns> - public override string GetUserInterfaceText() { return "Set Variable"; } - - /// <summary> - /// Edit this command. - /// </summary> - /// <param name="parent">The parent window.</param> - /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> - public override bool Edit(IWin32Window parent) - { - EditSetVariable edit = new EditSetVariable(Parameters); - if (edit.ShowDialog(parent) == DialogResult.OK) - { - Parameters = edit.Parameters; - return true; - } - - return false; - } - - /// <summary> - /// Execute this command. - /// </summary> - /// <param name="variables">The variable list of the calling code.</param> - public override void Execute(VariableList variables) - { - string value = Processor.ReplaceSpecial(Parameters[1]); - - variables.SetVariable(Parameters[0], value); - } - - #endregion Implementation - - } - -} Deleted: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandStringOperation.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandStringOperation.cs 2008-01-20 15:12:37 UTC (rev 1287) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandStringOperation.cs 2008-01-20 15:49:40 UTC (rev 1288) @@ -1,106 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows.Forms; - -namespace Commands -{ - - /// <summary> - /// String Operation macro command. - /// </summary> - public class CommandStringOperation : Command - { - - #region String Operations - - internal const string StrOpConcatenate = "Join"; - internal const string StrOpTrim = "Trim"; - internal const string StrOpUpper = "Upper Case"; - internal const string StrOpLower = "Lower Case"; - - // TODO: Add more string operations - - //internal const string StrOpTrimStart = "Trim Start (Input 1)"; - //internal const string StrOpTrimEnd = "Trim End (Input 1)"; - //internal const string StrOpLeft = "Left (Input 1 by Input 2)"; - //internal const string StrOpRight = "Right (Input 1 by Input 2)"; - - #endregion String Operations - - #region Constructors - - /// <summary> - /// Initializes a new instance of the <see cref="CommandStringOperation"/> class. - /// </summary> - public CommandStringOperation() { InitParameters(4); } - - /// <summary> - /// Initializes a new instance of the <see cref="CommandStringOperation"/> class. - /// </summary> - /// <param name="parameters">The parameters.</param> - public CommandStringOperation(string[] parameters) : base(parameters) { } - - #endregion Constructors - - #region Implementation - - /// <summary> - /// Gets the category of this command. - /// </summary> - /// <returns>The category of this command.</returns> - public override string GetCategory() { return Processor.CategoryMacro; } - - /// <summary> - /// Gets the user interface text. - /// </summary> - /// <returns>User interface text.</returns> - public override string GetUserInterfaceText() { return "String Operation"; } - - /// <summary> - /// Edit this command. - /// </summary> - /// <param name="parent">The parent window.</param> - /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> - public override bool Edit(IWin32Window parent) - { - EditStringOperation edit = new EditStringOperation(Parameters); - if (edit.ShowDialog(parent) == DialogResult.OK) - { - Parameters = edit.Parameters; - return true; - } - - return false; - } - - /// <summary> - /// Execute this command. - /// </summary> - /// <param name="variables">The variable list of the calling code.</param> - public override void Execute(VariableList variables) - { - string input1 = Processor.ReplaceSpecial(Parameters[1]); - string input2 = Processor.ReplaceSpecial(Parameters[2]); - - string output = String.Empty; - - switch (Parameters[0]) - { - case StrOpConcatenate: output = input1 + input2; break; - case StrOpTrim: output = input1.Trim(); break; - case StrOpUpper: output = input1.ToUpper(); break; - case StrOpLower: output = input1.ToLower(); break; - - default: - throw new CommandStructureException(String.Format("Invalid String Operation: {0}", Parameters[0])); - } - - variables.SetVariable(Parameters[3], output); - } - - #endregion Implementation - - } - -} Deleted: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSwapVariables.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSwapVariables.cs 2008-01-20 15:12:37 UTC (rev 1287) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSwapVariables.cs 2008-01-20 15:49:40 UTC (rev 1288) @@ -1,78 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows.Forms; - -namespace Commands -{ - - /// <summary> - /// Swap Variables macro command. - /// </summary> - public class CommandSwapVariables : Command - { - - #region Constructors - - /// <summary> - /// Initializes a new instance of the <see cref="CommandSwapVariables"/> class. - /// </summary> - public CommandSwapVariables() { InitParameters(2); } - - /// <summary> - /// Initializes a new instance of the <see cref="CommandSwapVariables"/> class. - /// </summary> - /// <param name="parameters">The parameters.</param> - public CommandSwapVariables(string[] parameters) : base(parameters) { } - - #endregion Constructors - - #region Implementation - - /// <summary> - /// Gets the category of this command. - /// </summary> - /// <returns>The category of this command.</returns> - public override string GetCategory() { return Processor.CategoryMacro; } - - /// <summary> - /// Gets the user interface text. - /// </summary> - /// <returns>User interface text.</returns> - public override string GetUserInterfaceText() { return "Swap Variables"; } - - /// <summary> - /// Edit this command. - /// </summary> - /// <param name="parent">The parent window.</param> - /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> - public override bool Edit(IWin32Window parent) - { - EditSwapVariables edit = new EditSwapVariables(Parameters); - if (edit.ShowDialog(parent) == DialogResult.OK) - { - Parameters = edit.Parameters; - return true; - } - - return false; - } - - /// <summary> - /// Execute this command. - /// </summary> - /// <param name="variables">The variable list of the calling code.</param> - public override void Execute(VariableList variables) - { - string value0 = variables.GetVariable(Parameters[0]); - string value1 = variables.GetVariable(Parameters[1]); - - variables.SetVariable(Parameters[0], value1); - variables.SetVariable(Parameters[1], value0); - } - - #endregion Implementation - - } - -} Deleted: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSwitch.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSwitch.cs 2008-01-20 15:12:37 UTC (rev 1287) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandSwitch.cs 2008-01-20 15:49:40 UTC (rev 1288) @@ -1,94 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Windows.Forms; -using System.Xml; -using System.Xml.Serialization; - -namespace Commands -{ - - /// <summary> - /// Switch Statement macro command. - /// </summary> - public class CommandSwitch : Command - { - - #region Constructors - - /// <summary> - /// Initializes a new instance of the <see cref="CommandSwitch"/> class. - /// </summary> - public CommandSwitch() { InitParameters(3); } - - /// <summary> - /// Initializes a new instance of the <see cref="CommandSwitch"/> class. - /// </summary> - /// <param name="parameters">The parameters.</param> - public CommandSwitch(string[] parameters) : base(parameters) { } - - #endregion Constructors - - #region Implementation - - /// <summary> - /// Gets the category of this command. - /// </summary> - /// <returns>The category of this command.</returns> - public override string GetCategory() { return Processor.CategoryMacro; } - - /// <summary> - /// Gets the user interface text. - /// </summary> - /// <returns>User interface text.</returns> - public override string GetUserInterfaceText() { return "Switch Statement"; } - - /// <summary> - /// Edit this command. - /// </summary> - /// <param name="parent">The parent window.</param> - /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> - public override bool Edit(IWin32Window parent) - { - EditSwitch edit = new EditSwitch(Parameters); - if (edit.ShowDialog(parent) == DialogResult.OK) - { - Parameters = edit.Parameters; - return true; - } - - return false; - } - - #endregion Implementation - - #region Static Methods - - /// <summary> - /// This method will determine which (if any) case in a Switch Statement evaluates true. - /// </summary> - /// <param name="value">The value.</param> - /// <param name="casesXml">The cases XML.</param> - /// <returns>Label to goto (null for default).</returns> - public static string Evaluate(string value, string casesXml) - { - string[] cases; - using (StringReader stringReader = new StringReader(casesXml)) - { - XmlSerializer xmlSerializer = new XmlSerializer(typeof(string[])); - cases = (string[])xmlSerializer.Deserialize(stringReader); - } - - for (int index = 0; index < cases.Length; index += 2) - if (value.Equals(cases[index], StringComparison.OrdinalIgnoreCase)) - return cases[index + 1]; - - return null; - } - - #endregion Static Methods - - } - -} Added: trunk/plugins/IR Server Suite/Commands/CommandProcessor/Commands/CommandBlastIR.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/Commands/CommandBlastIR.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/Commands/CommandBlastIR.cs 2008-01-20 15:49:40 UTC (rev 1288) @@ -0,0 +1,102 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Windows.Forms; + +using IrssUtils; + +namespace Commands +{ + + /// <summary> + /// Blast IR macro command. + /// </summary> + public class CommandBlastIR : Command + { + + #region Constructors + + /// <summary> + /// Initializes a new instance of the <see cref="CommandBlastIR"/> class. + /// </summary> + public CommandBlastIR() { InitParameters(2); } + + /// <summary> + /// Initializes a new instance of the <see cref="CommandBlastIR"/> class. + /// </summary> + /// <param name="parameters">The parameters.</param> + public CommandBlastIR(string[] parameters) : base(parameters) { } + + #endregion Constructors + + #region Implementation + + /// <summary> + /// Gets the category of this command. + /// </summary> + /// <returns>The category of this command.</returns> + public override string GetCategory() { return Processor.CategoryHidden; } + + /// <summary> + /// Gets the user interface text. + /// </summary> + /// <returns>User interface text.</returns> + public override string GetUserInterfaceText() { return "Blast IR"; } + + /// <summary> + /// Gets the user display text. + /// </summary> + /// <returns>The user display text.</returns> + public override string GetUserDisplayText() + { + string fileDir = Path.GetDirectoryName(Parameters[0]); + if (!fileDir.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.OrdinalIgnoreCase)) + fileDir += Path.DirectorySeparatorChar; + + string fileName = Path.GetFileNameWithoutExtension(Parameters[0]); + + if (fileDir.StartsWith(Common.FolderIRCommands, StringComparison.OrdinalIgnoreCase)) + fileDir = fileDir.Substring(Common.FolderIRCommands.Length); + else if (fileDir.StartsWith(Common.FolderAppData, StringComparison.OrdinalIgnoreCase)) + fileDir = fileDir.Substring(Common.FolderAppData.Length); + + return String.Format("{0} ({1}, {2})", GetUserInterfaceText(), Path.Combine(fileDir, fileName), Parameters[1]); + } + + /// <summary> + /// Edit this command. + /// </summary> + /// <param name="parent">The parent window.</param> + /// <param name="blastIrDelegate">The blast ir delegate.</param> + /// <param name="blastPorts">The blast ports.</param> + /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> + public bool Edit(IWin32Window parent, BlastIrDelegate blastIrDelegate, string[] blastPorts) + { + EditBlastIR edit = new EditBlastIR(blastIrDelegate, blastPorts, Parameters); + if (edit.ShowDialog(parent) == DialogResult.OK) + { + Parameters = edit.Parameters; + return true; + } + + return false; + } + + /// <summary> + /// Execute this command. + /// </summary> + /// <param name="blastIrDelegate">The blast ir delegate.</param> + public void Execute(BlastIrDelegate blastIrDelegate) + { + string irFile = Parameters[0] + Common.FileExtensionIR; + string port = Parameters[1]; + + blastIrDelegate(irFile, port); + } + + #endregion Implementation + + } + +} Added: trunk/plugins/IR Server Suite/Commands/CommandProcessor/Commands/CommandCallMacro.cs =================================================================== --- trunk/plugins/IR Server Suite/C... [truncated message content] |
From: <an...@us...> - 2008-01-21 14:07:39
|
Revision: 1291 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1291&view=rev Author: and-81 Date: 2008-01-21 06:07:12 -0800 (Mon, 21 Jan 2008) 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/Commands/CommandProcessor/CommandProcessor.csproj trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditBlastIR.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditMacro.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditMathsOperation.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditMathsOperation.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditStringOperation.Designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditStringOperation.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Macro.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Processor.cs trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandKeystrokes.cs trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/MediaPortalCommands.csproj trunk/plugins/IR Server Suite/Commands/TestApp/Program.cs trunk/plugins/IR Server Suite/Commands/TestApp/TestApp.csproj trunk/plugins/IR Server Suite/Commands/VariableList/VariableList.cs trunk/plugins/IR Server Suite/Documentation/new.html Added Paths: ----------- trunk/plugins/IR Server Suite/Commands/CommandProcessor/Control Statements/ trunk/plugins/IR Server Suite/Commands/CommandProcessor/Control Statements/CommandGotoLabel.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Control Statements/CommandIf.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Control Statements/CommandLabel.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Control Statements/CommandSwitch.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditStackFile.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditStackFile.designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditStackFile.resx trunk/plugins/IR Server Suite/Commands/CommandProcessor/MacroExecutionException.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/ trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsAbsolute.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsAdd.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsDivide.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsModulo.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsMultiply.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsPower.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsSquareRoot.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsSubtract.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Special Commands/ trunk/plugins/IR Server Suite/Commands/CommandProcessor/Special Commands/CommandBlastIR.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Special Commands/CommandCallMacro.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Stack Commands/ trunk/plugins/IR Server Suite/Commands/CommandProcessor/Stack Commands/CommandClearStack.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Stack Commands/CommandLoadStack.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Stack Commands/CommandPeekStack.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Stack Commands/CommandPopStack.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Stack Commands/CommandPushStack.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Stack Commands/CommandSaveStack.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/String Operations/ trunk/plugins/IR Server Suite/Commands/CommandProcessor/String Operations/CommandStringJoin.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/String Operations/CommandStringToLower.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/String Operations/CommandStringToUpper.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/String Operations/CommandStringTrim.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Variable Commands/ trunk/plugins/IR Server Suite/Commands/CommandProcessor/Variable Commands/CommandClearVariables.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Variable Commands/CommandLoadVariables.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Variable Commands/CommandSaveVariables.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Variable Commands/CommandSetVariable.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Variable Commands/CommandSwapVariables.cs Removed Paths: ------------- trunk/plugins/IR Server Suite/Commands/CommandProcessor/Commands/ Modified: trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2008-01-21 07:03:10 UTC (rev 1290) +++ trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2008-01-21 14:07:12 UTC (rev 1291) @@ -29,6 +29,8 @@ static string _blastPort = "Default"; + static int _delay = 50; + static bool _treatAsChannelNumber; static int _padChannelNumber; @@ -68,6 +70,10 @@ _blastPort = args[++index]; continue; + case "-DELAY": + _delay = int.Parse(args[++index]); + continue; + case "-CHANNEL": _treatAsChannelNumber = true; continue; @@ -139,6 +145,9 @@ fileName = Common.FolderIRCommands + digit + Common.FileExtensionIR; BlastIR(fileName, _blastPort); } + + if (_delay > 0) + Thread.Sleep(_delay); } } else if (command.StartsWith("~", StringComparison.OrdinalIgnoreCase)) @@ -150,6 +159,9 @@ fileName = Common.FolderIRCommands + command; BlastIR(fileName, _blastPort); } + + if (_delay > 0) + Thread.Sleep(_delay); } Thread.Sleep(500); 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-21 07:03:10 UTC (rev 1290) +++ trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2008-01-21 14:07:12 UTC (rev 1291) @@ -30,6 +30,8 @@ static string _blastPort = "Default"; + static int _delay = 50; + static bool _treatAsChannelNumber; static int _padChannelNumber; @@ -67,6 +69,10 @@ _blastPort = args[++index]; continue; + case "-DELAY": + _delay = int.Parse(args[++index]); + continue; + case "-CHANNEL": _treatAsChannelNumber = true; continue; @@ -138,6 +144,9 @@ fileName = Common.FolderIRCommands + digit + Common.FileExtensionIR; BlastIR(fileName, _blastPort); } + + if (_delay > 0) + Thread.Sleep(_delay); } } else if (command.StartsWith("~", StringComparison.OrdinalIgnoreCase)) @@ -149,6 +158,9 @@ fileName = Common.FolderIRCommands + command; BlastIR(fileName, _blastPort); } + + if (_delay > 0) + Thread.Sleep(_delay); } Thread.Sleep(500); @@ -157,9 +169,7 @@ { IrssLog.Warn("Failed to register with server host \"{0}\", blasting not sent", _serverHost); } - } - } } else // Give help ... Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandProcessor.csproj =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandProcessor.csproj 2008-01-21 07:03:10 UTC (rev 1290) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandProcessor.csproj 2008-01-21 14:07:12 UTC (rev 1291) @@ -38,10 +38,33 @@ <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> - <Compile Include="Commands\CommandStringOperation.cs" /> - <Compile Include="Commands\CommandSwapVariables.cs" /> - <Compile Include="Commands\CommandMathsOperation.cs" /> - <Compile Include="Commands\CommandSwitch.cs" /> + <Compile Include="MacroExecutionException.cs" /> + <Compile Include="Maths Operations\CommandMathsSubtract.cs" /> + <Compile Include="Maths Operations\CommandMathsMultiply.cs" /> + <Compile Include="Maths Operations\CommandMathsDivide.cs" /> + <Compile Include="Maths Operations\CommandMathsModulo.cs" /> + <Compile Include="Maths Operations\CommandMathsPower.cs" /> + <Compile Include="Maths Operations\CommandMathsAbsolute.cs" /> + <Compile Include="Maths Operations\CommandMathsSquareRoot.cs" /> + <Compile Include="String Operations\CommandStringJoin.cs" /> + <Compile Include="Forms\EditStackFile.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="Forms\EditStackFile.designer.cs"> + <DependentUpon>EditStackFile.cs</DependentUpon> + </Compile> + <Compile Include="Stack Commands\CommandClearStack.cs" /> + <Compile Include="Stack Commands\CommandLoadStack.cs" /> + <Compile Include="Stack Commands\CommandSaveStack.cs" /> + <Compile Include="Stack Commands\CommandPushStack.cs" /> + <Compile Include="Stack Commands\CommandPopStack.cs" /> + <Compile Include="Stack Commands\CommandPeekStack.cs" /> + <Compile Include="String Operations\CommandStringTrim.cs" /> + <Compile Include="String Operations\CommandStringToUpper.cs" /> + <Compile Include="String Operations\CommandStringToLower.cs" /> + <Compile Include="Variable Commands\CommandSwapVariables.cs" /> + <Compile Include="Maths Operations\CommandMathsAdd.cs" /> + <Compile Include="Control Statements\CommandSwitch.cs" /> <Compile Include="Forms\EditBlastIR.cs"> <SubType>Form</SubType> </Compile> @@ -103,15 +126,15 @@ <DependentUpon>EditVariablesFile.cs</DependentUpon> </Compile> <Compile Include="Processor.cs" /> - <Compile Include="Commands\CommandClearVariables.cs" /> - <Compile Include="Commands\CommandIf.cs" /> - <Compile Include="Commands\CommandLabel.cs" /> - <Compile Include="Commands\CommandGotoLabel.cs" /> - <Compile Include="Commands\CommandSetVariable.cs" /> - <Compile Include="Commands\CommandSaveVariables.cs" /> - <Compile Include="Commands\CommandLoadVariables.cs" /> - <Compile Include="Commands\CommandCallMacro.cs" /> - <Compile Include="Commands\CommandBlastIR.cs" /> + <Compile Include="Variable Commands\CommandClearVariables.cs" /> + <Compile Include="Control Statements\CommandIf.cs" /> + <Compile Include="Control Statements\CommandLabel.cs" /> + <Compile Include="Control Statements\CommandGotoLabel.cs" /> + <Compile Include="Variable Commands\CommandSetVariable.cs" /> + <Compile Include="Variable Commands\CommandSaveVariables.cs" /> + <Compile Include="Variable Commands\CommandLoadVariables.cs" /> + <Compile Include="Special Commands\CommandCallMacro.cs" /> + <Compile Include="Special Commands\CommandBlastIR.cs" /> <Compile Include="Macro.cs" /> <Compile Include="MacroStructureException.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> @@ -122,6 +145,10 @@ </Compile> </ItemGroup> <ItemGroup> + <EmbeddedResource Include="Forms\EditStackFile.resx"> + <DependentUpon>EditStackFile.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> <EmbeddedResource Include="Forms\EditBlastIR.resx"> <DependentUpon>EditBlastIR.cs</DependentUpon> <SubType>Designer</SubType> @@ -169,11 +196,6 @@ </EmbeddedResource> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\..\Common\IrssUtils\IrssUtils.csproj"> - <Project>{CA15769C-232E-4CA7-94FD-206A06CA3ABB}</Project> - <Name>IrssUtils</Name> - <Private>False</Private> - </ProjectReference> <ProjectReference Include="..\Command\Command.csproj"> <Project>{21E04B17-D850-43E7-AAD3-876C0E062BDB}</Project> <Name>Command</Name> Added: trunk/plugins/IR Server Suite/Commands/CommandProcessor/Control Statements/CommandGotoLabel.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/Control Statements/CommandGotoLabel.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/Control Statements/CommandGotoLabel.cs 2008-01-21 14:07:12 UTC (rev 1291) @@ -0,0 +1,74 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows.Forms; + +namespace Commands +{ + + /// <summary> + /// Goto Label macro command. + /// </summary> + public class CommandGotoLabel : Command + { + + #region Constructors + + /// <summary> + /// Initializes a new instance of the <see cref="CommandGotoLabel"/> class. + /// </summary> + public CommandGotoLabel() { InitParameters(1); } + + /// <summary> + /// Initializes a new instance of the <see cref="CommandGotoLabel"/> class. + /// </summary> + /// <param name="parameters">The parameters.</param> + public CommandGotoLabel(string[] parameters) : base(parameters) { } + + #endregion Constructors + + #region Implementation + + /// <summary> + /// Gets the category of this command. + /// </summary> + /// <returns>The category of this command.</returns> + public override string GetCategory() { return Processor.CategoryControl; } + + /// <summary> + /// Gets the user interface text. + /// </summary> + /// <returns>User interface text.</returns> + public override string GetUserInterfaceText() { return "Goto Label"; } + + /// <summary> + /// Gets the user display text. + /// </summary> + /// <returns>The user display text.</returns> + public override string GetUserDisplayText() + { + return String.Format("{0} \"{1}\"", GetUserInterfaceText(), Parameters[0]); + } + + /// <summary> + /// Edit this command. + /// </summary> + /// <param name="parent">The parent window.</param> + /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> + public override bool Edit(IWin32Window parent) + { + EditLabel edit = new EditLabel(Parameters[0]); + if (edit.ShowDialog(parent) == DialogResult.OK) + { + Parameters[0] = edit.LabelName; + return true; + } + + return false; + } + + #endregion Implementation + + } + +} Added: trunk/plugins/IR Server Suite/Commands/CommandProcessor/Control Statements/CommandIf.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/Control Statements/CommandIf.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/Control Statements/CommandIf.cs 2008-01-21 14:07:12 UTC (rev 1291) @@ -0,0 +1,151 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows.Forms; + +namespace Commands +{ + + /// <summary> + /// If Statement macro command. + /// </summary> + public class CommandIf : Command + { + + #region Comparisons + + // String comparisons ... + internal const string IfEquals = "=="; + internal const string IfNotEqual = "!="; + internal const string IfContains = "CONTAINS"; + internal const string IfStartsWith = "STARTS WITH"; + internal const string IfEndsWith = "ENDS WITH"; + + // Integer comparisons ... + internal const string IfGreaterThan = ">"; + internal const string IfLessThan = "<"; + internal const string IfGreaterThanOrEqual = ">="; + internal const string IfLessThanOrEqual = "<="; + + #endregion Comparisons + + #region Constructors + + /// <summary> + /// Initializes a new instance of the <see cref="CommandIf"/> class. + /// </summary> + public CommandIf() { InitParameters(5); } + + /// <summary> + /// Initializes a new instance of the <see cref="CommandIf"/> class. + /// </summary> + /// <param name="parameters">The parameters.</param> + public CommandIf(string[] parameters) : base(parameters) { } + + #endregion Constructors + + #region Implementation + + /// <summary> + /// Gets the category of this command. + /// </summary> + /// <returns>The category of this command.</returns> + public override string GetCategory() { return Processor.CategoryControl; } + + /// <summary> + /// Gets the user interface text. + /// </summary> + /// <returns>User interface text.</returns> + public override string GetUserInterfaceText() { return "If Statement"; } + + /// <summary> + /// Gets the user display text. + /// </summary> + /// <returns>The user display text.</returns> + public override string GetUserDisplayText() + { + if (String.IsNullOrEmpty(Parameters[4])) + return String.Format("If ({0} {1} {2}) then goto \"{3}\"", Parameters[0], Parameters[1], Parameters[2], Parameters[3]); + else + return String.Format("If ({0} {1} {2}) then goto \"{3}\" else goto \"{4}\"", Parameters[0], Parameters[1], Parameters[2], Parameters[3], Parameters[4]); + } + + /// <summary> + /// Edit this command. + /// </summary> + /// <param name="parent">The parent window.</param> + /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> + public override bool Edit(IWin32Window parent) + { + EditIf edit = new EditIf(Parameters); + if (edit.ShowDialog(parent) == DialogResult.OK) + { + Parameters = edit.Parameters; + return true; + } + + return false; + } + + #endregion Implementation + + #region Static Methods + + /// <summary> + /// This method will determine if an If Statement evaluates true. + /// </summary> + /// <param name="value1">The first value for comparison.</param> + /// <param name="comparison">The comparison type.</param> + /// <param name="value2">The second value for comparison.</param> + /// <returns><c>true</c> if the parameters evaluates true, otherwise <c>false</c>.</returns> + public static bool Evaluate(string value1, string comparison, string value2) + { + int value1AsInt; + bool value1IsInt = int.TryParse(value1, out value1AsInt); + + int value2AsInt; + bool value2IsInt = int.TryParse(value2, out value2AsInt); + + bool comparisonResult = false; + switch (comparison.ToUpperInvariant()) + { + // Use string comparison ... + case IfEquals: comparisonResult = value1.Equals(value2, StringComparison.OrdinalIgnoreCase); break; + case IfNotEqual: comparisonResult = !value1.Equals(value2, StringComparison.OrdinalIgnoreCase); break; + case IfContains: comparisonResult = value1.ToUpperInvariant().Contains(value2.ToUpperInvariant()); break; + case IfStartsWith: comparisonResult = value1.StartsWith(value2, StringComparison.OrdinalIgnoreCase); break; + case IfEndsWith: comparisonResult = value1.EndsWith(value2, StringComparison.OrdinalIgnoreCase); break; + + // Use integer comparison ... + case IfGreaterThan: + if (value1IsInt && value2IsInt) + comparisonResult = (value1AsInt > value2AsInt); + break; + + case IfLessThan: + if (value1IsInt && value2IsInt) + comparisonResult = (value1AsInt < value2AsInt); + break; + + case IfGreaterThanOrEqual: + if (value1IsInt && value2IsInt) + comparisonResult = (value1AsInt >= value2AsInt); + break; + + case IfLessThanOrEqual: + if (value1IsInt && value2IsInt) + comparisonResult = (value1AsInt <= value2AsInt); + break; + + default: + throw new CommandStructureException(String.Format("Invalid variable comparison method: {0}", comparison)); + } + + return comparisonResult; + } + + #endregion Static Methods + + } + +} Added: trunk/plugins/IR Server Suite/Commands/CommandProcessor/Control Statements/CommandLabel.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/Control Statements/CommandLabel.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/Control Statements/CommandLabel.cs 2008-01-21 14:07:12 UTC (rev 1291) @@ -0,0 +1,74 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows.Forms; + +namespace Commands +{ + + /// <summary> + /// Label macro command. + /// </summary> + public class CommandLabel : Command + { + + #region Constructors + + /// <summary> + /// Initializes a new instance of the <see cref="CommandLabel"/> class. + /// </summary> + public CommandLabel() { InitParameters(1); } + + /// <summary> + /// Initializes a new instance of the <see cref="CommandLabel"/> class. + /// </summary> + /// <param name="parameters">The parameters.</param> + public CommandLabel(string[] parameters) : base(parameters) { } + + #endregion Constructors + + #region Implementation + + /// <summary> + /// Gets the category of this command. + /// </summary> + /// <returns>The category of this command.</returns> + public override string GetCategory() { return Processor.CategoryControl; } + + /// <summary> + /// Gets the user interface text. + /// </summary> + /// <returns>User interface text.</returns> + public override string GetUserInterfaceText() { return "Label"; } + + /// <summary> + /// Gets the user display text. + /// </summary> + /// <returns>The user display text.</returns> + public override string GetUserDisplayText() + { + return String.Format("{0} \"{1}\"", GetUserInterfaceText(), Parameters[0]); + } + + /// <summary> + /// Edit this command. + /// </summary> + /// <param name="parent">The parent window.</param> + /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> + public override bool Edit(IWin32Window parent) + { + EditLabel edit = new EditLabel(Parameters[0]); + if (edit.ShowDialog(parent) == DialogResult.OK) + { + Parameters[0] = edit.LabelName; + return true; + } + + return false; + } + + #endregion Implementation + + } + +} Added: trunk/plugins/IR Server Suite/Commands/CommandProcessor/Control Statements/CommandSwitch.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/Control Statements/CommandSwitch.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/Control Statements/CommandSwitch.cs 2008-01-21 14:07:12 UTC (rev 1291) @@ -0,0 +1,103 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Windows.Forms; +using System.Xml; +using System.Xml.Serialization; + +namespace Commands +{ + + /// <summary> + /// Switch Statement macro command. + /// </summary> + public class CommandSwitch : Command + { + + #region Constructors + + /// <summary> + /// Initializes a new instance of the <see cref="CommandSwitch"/> class. + /// </summary> + public CommandSwitch() { InitParameters(3); } + + /// <summary> + /// Initializes a new instance of the <see cref="CommandSwitch"/> class. + /// </summary> + /// <param name="parameters">The parameters.</param> + public CommandSwitch(string[] parameters) : base(parameters) { } + + #endregion Constructors + + #region Implementation + + /// <summary> + /// Gets the category of this command. + /// </summary> + /// <returns>The category of this command.</returns> + public override string GetCategory() { return Processor.CategoryControl; } + + /// <summary> + /// Gets the user interface text. + /// </summary> + /// <returns>User interface text.</returns> + public override string GetUserInterfaceText() { return "Switch Statement"; } + + /// <summary> + /// Gets the user display text. + /// </summary> + /// <returns>The user display text.</returns> + public override string GetUserDisplayText() + { + return String.Format("Switch ({0}) ...", Parameters[0]); + } + + /// <summary> + /// Edit this command. + /// </summary> + /// <param name="parent">The parent window.</param> + /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> + public override bool Edit(IWin32Window parent) + { + EditSwitch edit = new EditSwitch(Parameters); + if (edit.ShowDialog(parent) == DialogResult.OK) + { + Parameters = edit.Parameters; + return true; + } + + return false; + } + + #endregion Implementation + + #region Static Methods + + /// <summary> + /// This method will determine which (if any) case in a Switch Statement evaluates true. + /// </summary> + /// <param name="value">The value.</param> + /// <param name="casesXml">The cases XML.</param> + /// <returns>Label to goto (null for default).</returns> + public static string Evaluate(string value, string casesXml) + { + string[] cases; + using (StringReader stringReader = new StringReader(casesXml)) + { + XmlSerializer xmlSerializer = new XmlSerializer(typeof(string[])); + cases = (string[])xmlSerializer.Deserialize(stringReader); + } + + for (int index = 0; index < cases.Length; index += 2) + if (value.Equals(cases[index], StringComparison.OrdinalIgnoreCase)) + return cases[index + 1]; + + return null; + } + + #endregion Static Methods + + } + +} Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditBlastIR.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditBlastIR.cs 2008-01-21 07:03:10 UTC (rev 1290) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditBlastIR.cs 2008-01-21 14:07:12 UTC (rev 1291) @@ -6,7 +6,7 @@ using System.Text; using System.Windows.Forms; -using IrssUtils; +//using IrssUtils; namespace Commands { Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditMacro.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditMacro.cs 2008-01-21 07:03:10 UTC (rev 1290) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditMacro.cs 2008-01-21 14:07:12 UTC (rev 1291) @@ -10,7 +10,7 @@ using System.Windows.Forms; using System.Xml; -using IrssUtils; +//using IrssUtils; namespace Commands { @@ -21,13 +21,6 @@ public partial class EditMacro : Form { - #region Special Categories - - const string CategoryIRCommands = "IR Commands"; - const string CategoryMacros = "Macros"; - - #endregion Special Categories - #region Variables Processor _commandProcessor; @@ -133,82 +126,64 @@ //categoryNode.NodeFont = new Font(treeViewCommandList.Font, FontStyle.Underline); categoryNodes.Add(category, categoryNode); } - - Type[] libCommands = Common.GetLibraryCommands(); - if (libCommands != null) - { - foreach (Type type in libCommands) - { - Command command = (Command)Activator.CreateInstance(type); - string commandCategory = command.GetCategory(); + List<Type> allCommands = new List<Type>(); - if (categoryNodes.ContainsKey(commandCategory)) - { - TreeNode newNode = new TreeNode(command.GetUserInterfaceText()); - newNode.Tag = type; + Type[] specialCommands = Processor.GetBuiltInCommands(); + allCommands.AddRange(specialCommands); - categoryNodes[commandCategory].Nodes.Add(newNode); - } - } - } + Type[] libCommands = Common.GetLibraryCommands(); + if (libCommands != null) + allCommands.AddRange(libCommands); - // Add built-in macro commands ... - TreeNode macroCommands = new TreeNode(Processor.CategoryMacro); - //macroCommands.NodeFont = new Font(treeViewCommandList.Font, FontStyle.Underline); - - Type[] specialCommands = Processor.GetSpecialCommands(); - foreach (Type type in specialCommands) + foreach (Type type in allCommands) { Command command = (Command)Activator.CreateInstance(type); - //if (!command.GetCategory().Equals(Processor.CategoryHidden, StringComparison.OrdinalIgnoreCase)) + string commandCategory = command.GetCategory(); + + if (categoryNodes.ContainsKey(commandCategory)) { TreeNode newNode = new TreeNode(command.GetUserInterfaceText()); newNode.Tag = type; - macroCommands.Nodes.Add(newNode); + categoryNodes[commandCategory].Nodes.Add(newNode); } } - categoryNodes.Add(Processor.CategoryMacro, macroCommands); // Add list of existing IR Commands ... - string[] irFiles = Processor.GetListIR(); - if (irFiles != null) + if (categoryNodes.ContainsKey(Processor.CategoryIRCommands)) { - TreeNode irCommands = new TreeNode(CategoryIRCommands); - //irCommands.NodeFont = new Font(treeViewCommandList.Font, FontStyle.Underline); - - foreach (string irFile in irFiles) + string[] irFiles = Processor.GetListIR(); + if (irFiles != null) { - TreeNode newNode = new TreeNode(Path.GetFileNameWithoutExtension(irFile)); - newNode.Tag = irFile; + foreach (string irFile in irFiles) + { + TreeNode newNode = new TreeNode(Path.GetFileNameWithoutExtension(irFile)); + newNode.Tag = irFile; - irCommands.Nodes.Add(newNode); + categoryNodes[Processor.CategoryIRCommands].Nodes.Add(newNode); + } } - - categoryNodes.Add(irCommands.Text, irCommands); } // Add list of existing Macros ... - string macroFolder = _macroFolder; - if (String.IsNullOrEmpty(_macroFolder)) - macroFolder = Path.GetDirectoryName(_fileName); - string[] macros = Processor.GetListMacro(macroFolder); - if (macros != null) + if (categoryNodes.ContainsKey(Processor.CategoryMacros)) { - TreeNode otherMacros = new TreeNode(CategoryMacros); - //otherMacros.NodeFont = new Font(treeViewCommandList.Font, FontStyle.Underline); - - foreach (string macro in macros) + string macroFolder = _macroFolder; + if (String.IsNullOrEmpty(_macroFolder)) + macroFolder = Path.GetDirectoryName(_fileName); + string[] macros = Processor.GetListMacro(macroFolder); + if (macros != null) { - TreeNode newNode = new TreeNode(Path.GetFileNameWithoutExtension(macro)); - newNode.Tag = macro; + foreach (string macro in macros) + { + TreeNode newNode = new TreeNode(Path.GetFileNameWithoutExtension(macro)); + newNode.Tag = macro; - otherMacros.Nodes.Add(newNode); + categoryNodes[Processor.CategoryMacros].Nodes.Add(newNode); + } } - - categoryNodes.Add(otherMacros.Text, otherMacros); } // Put all commands into tree view ... @@ -225,23 +200,15 @@ if (listViewMacro.SelectedItems.Count != 1) return; - try - { - ListViewItem selected = listViewMacro.SelectedItems[0]; + ListViewItem selected = listViewMacro.SelectedItems[0]; - string selectedTag = selected.Tag as string; - Command command = Processor.CreateCommand(selectedTag); + string selectedTag = selected.Tag as string; + Command command = Processor.CreateCommand(selectedTag); - if (_commandProcessor.Edit(command, this)) - { - selected.Text = command.GetUserDisplayText(); - selected.Tag = command.ToString(); - } - } - catch (Exception ex) + if (_commandProcessor.Edit(command, this)) { - IrssLog.Error(ex); - MessageBox.Show(this, ex.Message, "Failed to edit macro command", MessageBoxButtons.OK, MessageBoxIcon.Error); + selected.Text = command.GetUserDisplayText(); + selected.Tag = command.ToString(); } } @@ -318,49 +285,41 @@ if (treeViewCommandList.SelectedNode == null || treeViewCommandList.SelectedNode.Level == 0) return; - try - { - string selected = treeViewCommandList.SelectedNode.Text as string; + string selected = treeViewCommandList.SelectedNode.Text as string; - ListViewItem newCommand = new ListViewItem(); - Command command; + ListViewItem newCommand = new ListViewItem(); + Command command; - if (treeViewCommandList.SelectedNode.Parent.Text.Equals(CategoryIRCommands, StringComparison.OrdinalIgnoreCase)) - { - command = new CommandBlastIR(new string[] { treeViewCommandList.SelectedNode.Tag as string, _commandProcessor.BlastIrPorts[0] }); + if (treeViewCommandList.SelectedNode.Parent.Text.Equals(Processor.CategoryIRCommands, StringComparison.OrdinalIgnoreCase)) + { + command = new CommandBlastIR(new string[] { treeViewCommandList.SelectedNode.Tag as string, _commandProcessor.BlastIrPorts[0] }); - if (_commandProcessor.Edit(command, this)) - { - newCommand.Text = command.GetUserDisplayText(); - newCommand.Tag = command.ToString(); - listViewMacro.Items.Add(newCommand); - } - } - else if (treeViewCommandList.SelectedNode.Parent.Text.Equals(CategoryMacros, StringComparison.OrdinalIgnoreCase)) + if (_commandProcessor.Edit(command, this)) { - command = new CommandCallMacro(new string[] { treeViewCommandList.SelectedNode.Tag as string }); - newCommand.Text = command.GetUserDisplayText(); newCommand.Tag = command.ToString(); listViewMacro.Items.Add(newCommand); } - else - { - Type commandType = treeViewCommandList.SelectedNode.Tag as Type; - command = (Command)Activator.CreateInstance(commandType); + } + else if (treeViewCommandList.SelectedNode.Parent.Text.Equals(Processor.CategoryMacros, StringComparison.OrdinalIgnoreCase)) + { + command = new CommandCallMacro(new string[] { treeViewCommandList.SelectedNode.Tag as string }); - if (_commandProcessor.Edit(command, this)) - { - newCommand.Text = command.GetUserDisplayText(); - newCommand.Tag = command.ToString(); - listViewMacro.Items.Add(newCommand); - } - } + newCommand.Text = command.GetUserDisplayText(); + newCommand.Tag = command.ToString(); + listViewMacro.Items.Add(newCommand); } - catch (Exception ex) + else { - IrssLog.Error(ex); - MessageBox.Show(this, ex.Message, "Failed to add macro command", MessageBoxButtons.OK, MessageBoxIcon.Error); + Type commandType = treeViewCommandList.SelectedNode.Tag as Type; + command = (Command)Activator.CreateInstance(commandType); + + if (_commandProcessor.Edit(command, this)) + { + newCommand.Text = command.GetUserDisplayText(); + newCommand.Tag = command.ToString(); + listViewMacro.Items.Add(newCommand); + } } } @@ -432,7 +391,6 @@ } catch (Exception ex) { - IrssLog.Error(ex); MessageBox.Show(this, ex.Message, "Test failed", MessageBoxButtons.OK, MessageBoxIcon.Error); } } @@ -478,7 +436,6 @@ } catch (Exception ex) { - IrssLog.Error(ex); MessageBox.Show(this, ex.Message, "Failed writing macro to file", MessageBoxButtons.OK, MessageBoxIcon.Error); } Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditMathsOperation.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditMathsOperation.Designer.cs 2008-01-21 07:03:10 UTC (rev 1290) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditMathsOperation.Designer.cs 2008-01-21 14:07:12 UTC (rev 1291) @@ -34,23 +34,21 @@ this.buttonCancel = new System.Windows.Forms.Button(); this.toolTips = new System.Windows.Forms.ToolTip(this.components); this.textBoxInput1 = new System.Windows.Forms.TextBox(); - this.comboBoxOperation = new System.Windows.Forms.ComboBox(); this.textBoxInput2 = new System.Windows.Forms.TextBox(); - this.labelOperation = new System.Windows.Forms.Label(); this.labelInput1 = new System.Windows.Forms.Label(); this.labelInput2 = new System.Windows.Forms.Label(); + this.textBoxOutputVar = new System.Windows.Forms.TextBox(); this.labelVarPrefix = new System.Windows.Forms.Label(); this.labelOutput = new System.Windows.Forms.Label(); - this.textBoxOutputVar = new System.Windows.Forms.TextBox(); 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(248, 136); + this.buttonOK.Location = new System.Drawing.Point(248, 104); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(64, 24); - this.buttonOK.TabIndex = 9; + this.buttonOK.TabIndex = 7; this.buttonOK.Text = "OK"; this.buttonOK.UseVisualStyleBackColor = true; this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); @@ -59,10 +57,10 @@ // 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(320, 136); + this.buttonCancel.Location = new System.Drawing.Point(320, 104); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(64, 24); - this.buttonCancel.TabIndex = 10; + this.buttonCancel.TabIndex = 8; this.buttonCancel.Text = "Cancel"; this.buttonCancel.UseVisualStyleBackColor = true; this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); @@ -71,115 +69,92 @@ // this.textBoxInput1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxInput1.Location = new System.Drawing.Point(80, 40); + this.textBoxInput1.Location = new System.Drawing.Point(80, 8); this.textBoxInput1.Name = "textBoxInput1"; this.textBoxInput1.Size = new System.Drawing.Size(304, 20); - this.textBoxInput1.TabIndex = 3; + this.textBoxInput1.TabIndex = 1; this.toolTips.SetToolTip(this.textBoxInput1, "The first operation input"); // - // comboBoxOperation - // - this.comboBoxOperation.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.comboBoxOperation.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.comboBoxOperation.FormattingEnabled = true; - this.comboBoxOperation.Location = new System.Drawing.Point(80, 8); - this.comboBoxOperation.Name = "comboBoxOperation"; - this.comboBoxOperation.Size = new System.Drawing.Size(304, 21); - this.comboBoxOperation.TabIndex = 1; - this.toolTips.SetToolTip(this.comboBoxOperation, "The string operation to perform"); - // // textBoxInput2 // this.textBoxInput2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxInput2.Location = new System.Drawing.Point(80, 72); + this.textBoxInput2.Location = new System.Drawing.Point(80, 40); this.textBoxInput2.Name = "textBoxInput2"; this.textBoxInput2.Size = new System.Drawing.Size(304, 20); - this.textBoxInput2.TabIndex = 5; + this.textBoxInput2.TabIndex = 3; this.toolTips.SetToolTip(this.textBoxInput2, "The second operation input (sometimes optional)"); // - // labelOperation - // - this.labelOperation.Location = new System.Drawing.Point(8, 8); - this.labelOperation.Name = "labelOperation"; - this.labelOperation.Size = new System.Drawing.Size(72, 21); - this.labelOperation.TabIndex = 0; - this.labelOperation.Text = "Operation:"; - this.labelOperation.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // // labelInput1 // - this.labelInput1.Location = new System.Drawing.Point(8, 40); + this.labelInput1.Location = new System.Drawing.Point(8, 8); this.labelInput1.Name = "labelInput1"; this.labelInput1.Size = new System.Drawing.Size(72, 21); - this.labelInput1.TabIndex = 2; + this.labelInput1.TabIndex = 0; this.labelInput1.Text = "Input 1:"; this.labelInput1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.toolTips.SetToolTip(this.labelInput1, "The first input string"); // // labelInput2 // - this.labelInput2.Location = new System.Drawing.Point(8, 72); + this.labelInput2.Location = new System.Drawing.Point(8, 40); this.labelInput2.Name = "labelInput2"; this.labelInput2.Size = new System.Drawing.Size(72, 21); - this.labelInput2.TabIndex = 4; + this.labelInput2.TabIndex = 2; this.labelInput2.Text = "Input 2:"; this.labelInput2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.toolTips.SetToolTip(this.labelInput2, "The second input string"); // + // textBoxOutputVar + // + this.textBoxOutputVar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxOutputVar.Location = new System.Drawing.Point(112, 72); + this.textBoxOutputVar.Name = "textBoxOutputVar"; + this.textBoxOutputVar.Size = new System.Drawing.Size(272, 20); + this.textBoxOutputVar.TabIndex = 6; + this.toolTips.SetToolTip(this.textBoxOutputVar, "The variable to place the output of the operation into"); + // // labelVarPrefix // - this.labelVarPrefix.Location = new System.Drawing.Point(80, 104); + this.labelVarPrefix.Location = new System.Drawing.Point(80, 72); this.labelVarPrefix.Name = "labelVarPrefix"; this.labelVarPrefix.Size = new System.Drawing.Size(32, 21); - this.labelVarPrefix.TabIndex = 7; + this.labelVarPrefix.TabIndex = 5; this.labelVarPrefix.Text = "var_"; this.labelVarPrefix.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // labelOutput // - this.labelOutput.Location = new System.Drawing.Point(8, 104); + this.labelOutput.Location = new System.Drawing.Point(8, 72); this.labelOutput.Name = "labelOutput"; this.labelOutput.Size = new System.Drawing.Size(72, 21); - this.labelOutput.TabIndex = 6; + this.labelOutput.TabIndex = 4; this.labelOutput.Text = "Output:"; this.labelOutput.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // textBoxOutputVar + // EditMathsOperation // - this.textBoxOutputVar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxOutputVar.Location = new System.Drawing.Point(112, 104); - this.textBoxOutputVar.Name = "textBoxOutputVar"; - this.textBoxOutputVar.Size = new System.Drawing.Size(272, 20); - this.textBoxOutputVar.TabIndex = 8; - this.toolTips.SetToolTip(this.textBoxOutputVar, "The variable to place the output of the operation into"); - // - // EditStringOperation - // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(392, 169); + this.ClientSize = new System.Drawing.Size(392, 137); this.Controls.Add(this.labelVarPrefix); this.Controls.Add(this.labelOutput); this.Controls.Add(this.textBoxOutputVar); this.Controls.Add(this.labelInput2); this.Controls.Add(this.labelInput1); - this.Controls.Add(this.labelOperation); this.Controls.Add(this.textBoxInput2); - this.Controls.Add(this.comboBoxOperation); this.Controls.Add(this.textBoxInput1); this.Controls.Add(this.buttonOK); this.Controls.Add(this.buttonCancel); this.MaximizeBox = false; this.MinimizeBox = false; - this.MinimumSize = new System.Drawing.Size(400, 196); - this.Name = "EditStringOperation"; + this.MinimumSize = new System.Drawing.Size(400, 164); + this.Name = "EditMathsOperation"; this.ShowIcon = false; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "String Operation"; + this.Text = "Maths Operation"; this.ResumeLayout(false); this.PerformLayout(); @@ -191,9 +166,7 @@ private System.Windows.Forms.Button buttonCancel; private System.Windows.Forms.ToolTip toolTips; private System.Windows.Forms.TextBox textBoxInput1; - private System.Windows.Forms.ComboBox comboBoxOperation; private System.Windows.Forms.TextBox textBoxInput2; - private System.Windows.Forms.Label labelOperation; private System.Windows.Forms.Label labelInput1; private System.Windows.Forms.Label labelInput2; private System.Windows.Forms.Label labelVarPrefix; Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditMathsOperation.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditMathsOperation.cs 2008-01-21 07:03:10 UTC (rev 1290) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditMathsOperation.cs 2008-01-21 14:07:12 UTC (rev 1291) @@ -24,12 +24,10 @@ { get { - return new string[] { - comboBoxOperation.SelectedItem as string, - textBoxInput1.Text.Trim(), - textBoxInput2.Text.Trim(), - textBoxOutputVar.Text.Trim() - }; + if (labelInput2.Visible) + return new string[] { textBoxInput1.Text.Trim(), textBoxInput2.Text.Trim(), textBoxOutputVar.Text.Trim() }; + else + return new string[] { textBoxInput1.Text.Trim(), textBoxOutputVar.Text.Trim() }; } } @@ -45,18 +43,6 @@ InitializeComponent(); labelVarPrefix.Text = VariableList.VariablePrefix; - - comboBoxOperation.Items.Clear(); - comboBoxOperation.Items.Add(CommandMathsOperation.MathOpAbsolute); - comboBoxOperation.Items.Add(CommandMathsOperation.MathOpAdd); - comboBoxOperation.Items.Add(CommandMathsOperation.MathOpDivide); - comboBoxOperation.Items.Add(CommandMathsOperation.MathOpModulo); - comboBoxOperation.Items.Add(CommandMathsOperation.MathOpMultiply); - comboBoxOperation.Items.Add(CommandMathsOperation.MathOpPower); - comboBoxOperation.Items.Add(CommandMathsOperation.MathOpRoot); - comboBoxOperation.Items.Add(CommandMathsOperation.MathOpSubtract); - - comboBoxOperation.SelectedIndex = 0; } /// <summary> @@ -66,10 +52,23 @@ public EditMathsOperation(string[] parameters) : this() { - comboBoxOperation.SelectedItem = parameters[0]; - textBoxInput1.Text = parameters[1]; - textBoxInput2.Text = parameters[2]; - textBoxOutputVar.Text = parameters[3]; + if (parameters.Length == 3) + { + textBoxInput1.Text = parameters[0]; + textBoxInput2.Text = parameters[1]; + textBoxOutputVar.Text = parameters[2]; + } + else if (parameters.Length == 2) + { + textBoxInput1.Text = parameters[0]; + labelInput2.Visible = false; + textBoxInput2.Visible = false; + textBoxOutputVar.Text = parameters[1]; + } + else + { + throw new ArgumentException("Parameter array size must be 2 or 3", "parameters"); + } } #endregion Constructors Added: trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditStackFile.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditStackFile.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditStackFile.cs 2008-01-21 14:07:12 UTC (rev 1291) @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.IO; +using System.Text; +using System.Windows.Forms; + +namespace Commands +{ + + /// <summary> + /// Stack file filename collection form. + /// </summary> + partial class EditStackFile : Form + { + + #region Properties + + /// <summary> + /// Gets the file name. + /// </summary> + /// <value>The file name.</value> + public string FileName + { + get + { + return textBoxLabel.Text.Trim(); + } + } + + #endregion Properties + + #region Constructors + + /// <summary> + /// Initializes a new instance of the <see cref="EditStackFile"/> class. + /// </summary> + public EditStackFile() + { + InitializeComponent(); + } + + /// <summary> + /// Initializes a new instance of the <see cref="EditStackFile"/> class. + /// </summary> + /// <param name="name">The existing file name.</param> + public EditStackFile(string name) + : this() + { + if (!String.IsNullOrEmpty(name)) + textBoxLabel.Text = name; + } + + #endregion + + #region Buttons + + private void buttonOK_Click(object sender, EventArgs e) + { + if (String.IsNullOrEmpty(textBoxLabel.Text.Trim())) + { + MessageBox.Show(this, "You must include a stack file name", "Missing file name", MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + + 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/Commands/CommandProcessor/Forms/EditStackFile.designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditStackFile.designer.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditStackFile.designer.cs 2008-01-21 14:07:12 UTC (rev 1291) @@ -0,0 +1,111 @@ +namespace Commands +{ + + partial class EditStackFile + { + + /// <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.labelLabelName = new System.Windows.Forms.Label(); + this.textBoxLabel = new System.Windows.Forms.TextBox(); + 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, 40); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(64, 24); + this.buttonCancel.TabIndex = 3; + 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, 40); + this.buttonOK.Name = "buttonOK"; + this.buttonOK.Size = new System.Drawing.Size(64, 24); + this.buttonOK.TabIndex = 2; + this.buttonOK.Text = "OK"; + this.buttonOK.UseVisualStyleBackColor = true; + this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); + // + // labelLabelName + // + this.labelLabelName.Location = new System.Drawing.Point(8, 8); + this.labelLabelName.Name = "labelLabelName"; + this.labelLabelName.Size = new System.Drawing.Size(56, 20); + this.labelLabelName.TabIndex = 0; + this.labelLabelName.Text = "File:"; + this.labelLabelName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // textBoxLabel + // + this.textBoxLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxLabel.Location = new System.Drawing.Point(64, 8); + this.textBoxLabel.Name = "textBoxLabel"; + this.textBoxLabel.Size = new System.Drawing.Size(120, 20); + this.textBoxLabel.TabIndex = 1; + // + // EditStackFile + // + 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(192, 73); + this.Controls.Add(this.textBoxLabel); + this.Controls.Add(this.labelLabelName); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.buttonOK); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(160, 100); + this.Name = "EditStackFile"; + this.ShowIcon = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Stack File"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button buttonCancel; + private System.Windows.Forms.Button buttonOK; + private System.Windows.Forms.Label labelLabelName; + private System.Windows.Forms.TextBox textBoxLabel; + } + +} Added: trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditStackFile.resx =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditStackFile.resx (rev 0) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditStackFile.resx 2008-01-21 14:07:12 UTC (rev 1291) @@ -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 + ... [truncated message content] |
From: <an...@us...> - 2008-01-24 12:42:44
|
Revision: 1305 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1305&view=rev Author: and-81 Date: 2008-01-24 04:41:12 -0800 (Thu, 24 Jan 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandProcessor.csproj trunk/plugins/IR Server Suite/Commands/CommandProcessor/Processor.cs trunk/plugins/IR Server Suite/Commands/GeneralCommands/GeneralCommands.csproj trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs trunk/plugins/IR Server Suite/Common/MPUtils/Forms/MPAction.cs trunk/plugins/IR Server Suite/Common/MPUtils/MPCommon.cs trunk/plugins/IR Server Suite/Common/MPUtils/MPUtils.csproj trunk/plugins/IR Server Suite/Documentation/new.html 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/MultiMapNameBox.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/MultiMapNameBox.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/TV2BlasterPlugin.cs Added Paths: ----------- trunk/plugins/IR Server Suite/Commands/CommandProcessor/Control Statements/CommandAbortMacro.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditAbortMessage.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditAbortMessage.designer.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditAbortMessage.resx trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandHibernate.cs trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandLogOff.cs trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandReboot.cs trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandSendWOL.cs trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandShutdown.cs trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandStandBy.cs trunk/plugins/IR Server Suite/Commands/GeneralCommands/EditSendWOL.Designer.cs trunk/plugins/IR Server Suite/Commands/GeneralCommands/EditSendWOL.cs trunk/plugins/IR Server Suite/Commands/GeneralCommands/EditSendWOL.resx trunk/plugins/IR Server Suite/Commands/GeneralCommands/Win32.cs trunk/plugins/IR Server Suite/Common/MPUtils/Forms/MPMessage.Designer.cs trunk/plugins/IR Server Suite/Common/MPUtils/Forms/MPMessage.cs trunk/plugins/IR Server Suite/Common/MPUtils/Forms/MPMessage.resx Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandProcessor.csproj =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandProcessor.csproj 2008-01-23 18:07:48 UTC (rev 1304) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandProcessor.csproj 2008-01-24 12:41:12 UTC (rev 1305) @@ -38,6 +38,13 @@ <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> + <Compile Include="Control Statements\CommandAbortMacro.cs" /> + <Compile Include="Forms\EditAbortMessage.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="Forms\EditAbortMessage.designer.cs"> + <DependentUpon>EditAbortMessage.cs</DependentUpon> + </Compile> <Compile Include="MacroExecutionException.cs" /> <Compile Include="Maths Operations\CommandMathsSubtract.cs" /> <Compile Include="Maths Operations\CommandMathsMultiply.cs" /> @@ -145,6 +152,10 @@ </Compile> </ItemGroup> <ItemGroup> + <EmbeddedResource Include="Forms\EditAbortMessage.resx"> + <DependentUpon>EditAbortMessage.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> <EmbeddedResource Include="Forms\EditStackFile.resx"> <DependentUpon>EditStackFile.cs</DependentUpon> <SubType>Designer</SubType> Added: trunk/plugins/IR Server Suite/Commands/CommandProcessor/Control Statements/CommandAbortMacro.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/Control Statements/CommandAbortMacro.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/Control Statements/CommandAbortMacro.cs 2008-01-24 12:41:12 UTC (rev 1305) @@ -0,0 +1,88 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows.Forms; + +namespace Commands +{ + + /// <summary> + /// Abort special command. + /// </summary> + public class CommandAbortMacro : Command + { + + #region Constructors + + /// <summary> + /// Initializes a new instance of the <see cref="CommandAbortMacro"/> class. + /// </summary> + public CommandAbortMacro() { InitParameters(1); } + + /// <summary> + /// Initializes a new instance of the <see cref="CommandAbortMacro"/> class. + /// </summary> + /// <param name="parameters">The parameters.</param> + public CommandAbortMacro(string[] parameters) : base(parameters) { } + + #endregion Constructors + + #region Implementation + + /// <summary> + /// Gets the category of this command. + /// </summary> + /// <returns>The category of this command.</returns> + public override string GetCategory() { return Processor.CategoryControl; } + + /// <summary> + /// Gets the user interface text. + /// </summary> + /// <returns>User interface text.</returns> + public override string GetUserInterfaceText() { return "Abort Macro"; } + + /// <summary> + /// Gets the user display text. + /// </summary> + /// <returns>The user display text.</returns> + public override string GetUserDisplayText() + { + if (String.IsNullOrEmpty(Parameters[0])) + return GetUserInterfaceText(); + else + return String.Format("{0} \"{1}\"", GetUserInterfaceText(), Parameters[0]); + } + + /// <summary> + /// Edit this command. + /// </summary> + /// <param name="parent">The parent window.</param> + /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> + public override bool Edit(IWin32Window parent) + { + EditAbortMessage edit = new EditAbortMessage(Parameters[0]); + if (edit.ShowDialog(parent) == DialogResult.OK) + { + Parameters[0] = edit.AbortMessage; + return true; + } + + return false; + } + + /// <summary> + /// Execute this command. + /// </summary> + public override void Execute(VariableList variables) + { + if (String.IsNullOrEmpty(Parameters[0])) + throw new MacroExecutionException("Abort Macro Command"); + else + throw new MacroExecutionException("Abort Macro Command: " + Parameters[0]); + } + + #endregion Implementation + + } + +} Added: trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditAbortMessage.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditAbortMessage.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditAbortMessage.cs 2008-01-24 12:41:12 UTC (rev 1305) @@ -0,0 +1,75 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.IO; +using System.Text; +using System.Windows.Forms; + +namespace Commands +{ + + /// <summary> + /// Edit Abort Message form. + /// </summary> + partial class EditAbortMessage : Form + { + + #region Properties + + /// <summary> + /// Gets the abort message. + /// </summary> + /// <value>The abort message.</value> + public string AbortMessage + { + get + { + return textBoxMessage.Text.Trim(); + } + } + + #endregion Properties + + #region Constructors + + /// <summary> + /// Initializes a new instance of the <see cref="EditAbortMessage"/> class. + /// </summary> + public EditAbortMessage() + { + InitializeComponent(); + } + + /// <summary> + /// Initializes a new instance of the <see cref="EditAbortMessage"/> class. + /// </summary> + /// <param name="name">The existing label name.</param> + public EditAbortMessage(string name) + : this() + { + if (!String.IsNullOrEmpty(name)) + textBoxMessage.Text = name; + } + + #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/Commands/CommandProcessor/Forms/EditAbortMessage.designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditAbortMessage.designer.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditAbortMessage.designer.cs 2008-01-24 12:41:12 UTC (rev 1305) @@ -0,0 +1,111 @@ +namespace Commands +{ + + partial class EditAbortMessage + { + + /// <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.labelMessage = new System.Windows.Forms.Label(); + this.textBoxMessage = new System.Windows.Forms.TextBox(); + 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(320, 40); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(64, 24); + this.buttonCancel.TabIndex = 3; + 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(248, 40); + this.buttonOK.Name = "buttonOK"; + this.buttonOK.Size = new System.Drawing.Size(64, 24); + this.buttonOK.TabIndex = 2; + this.buttonOK.Text = "OK"; + this.buttonOK.UseVisualStyleBackColor = true; + this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); + // + // labelMessage + // + this.labelMessage.Location = new System.Drawing.Point(8, 8); + this.labelMessage.Name = "labelMessage"; + this.labelMessage.Size = new System.Drawing.Size(72, 20); + this.labelMessage.TabIndex = 0; + this.labelMessage.Text = "Message:"; + this.labelMessage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // textBoxMessage + // + this.textBoxMessage.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxMessage.Location = new System.Drawing.Point(80, 8); + this.textBoxMessage.Name = "textBoxMessage"; + this.textBoxMessage.Size = new System.Drawing.Size(304, 20); + this.textBoxMessage.TabIndex = 1; + // + // EditAbortMessage + // + 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(392, 73); + this.Controls.Add(this.textBoxMessage); + this.Controls.Add(this.labelMessage); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.buttonOK); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(400, 100); + this.Name = "EditAbortMessage"; + this.ShowIcon = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Abort Message"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button buttonCancel; + private System.Windows.Forms.Button buttonOK; + private System.Windows.Forms.Label labelMessage; + private System.Windows.Forms.TextBox textBoxMessage; + } + +} Added: trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditAbortMessage.resx =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditAbortMessage.resx (rev 0) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/Forms/EditAbortMessage.resx 2008-01-24 12:41:12 UTC (rev 1305) @@ -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 Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/Processor.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/Processor.cs 2008-01-23 18:07:48 UTC (rev 1304) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/Processor.cs 2008-01-24 12:41:12 UTC (rev 1305) @@ -493,6 +493,7 @@ specialCommands.Add(typeof(CommandLabel)); specialCommands.Add(typeof(CommandGotoLabel)); specialCommands.Add(typeof(CommandSwitch)); + specialCommands.Add(typeof(CommandAbortMacro)); // Variable Commands ... specialCommands.Add(typeof(CommandSetVariable)); Added: trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandHibernate.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandHibernate.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandHibernate.cs 2008-01-24 12:41:12 UTC (rev 1305) @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows.Forms; + +namespace Commands.General +{ + + /// <summary> + /// Hibernate macro command. + /// </summary> + public class CommandHibernate : Command + { + + #region Constructors + + /// <summary> + /// Initializes a new instance of the <see cref="CommandHibernate"/> class. + /// </summary> + public CommandHibernate() { InitParameters(0); } + + /// <summary> + /// Initializes a new instance of the <see cref="CommandHibernate"/> class. + /// </summary> + /// <param name="parameters">The parameters.</param> + public CommandHibernate(string[] parameters) : base(parameters) { } + + #endregion Constructors + + #region Implementation + + /// <summary> + /// Gets the category of this command. + /// </summary> + /// <returns>The category of this command.</returns> + public override string GetCategory() { return "General Commands"; } + + /// <summary> + /// Gets the user interface text. + /// </summary> + /// <returns>User interface text.</returns> + public override string GetUserInterfaceText() { return "Hibernate"; } + + /// <summary> + /// Execute this command. + /// </summary> + /// <param name="variables">The variable list of the calling code.</param> + public override void Execute(VariableList variables) + { + if (!Application.SetSuspendState(PowerState.Hibernate, false, false)) + throw new CommandExecutionException("Hibernate command refused"); + } + + #endregion Implementation + + } + +} Added: trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandLogOff.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandLogOff.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandLogOff.cs 2008-01-24 12:41:12 UTC (rev 1305) @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows.Forms; + +namespace Commands.General +{ + + /// <summary> + /// LogOff macro command. + /// </summary> + public class CommandLogOff : Command + { + + #region Constructors + + /// <summary> + /// Initializes a new instance of the <see cref="CommandLogOff"/> class. + /// </summary> + public CommandLogOff() { InitParameters(0); } + + /// <summary> + /// Initializes a new instance of the <see cref="CommandLogOff"/> class. + /// </summary> + /// <param name="parameters">The parameters.</param> + public CommandLogOff(string[] parameters) : base(parameters) { } + + #endregion Constructors + + #region Implementation + + /// <summary> + /// Gets the category of this command. + /// </summary> + /// <returns>The category of this command.</returns> + public override string GetCategory() { return "General Commands"; } + + /// <summary> + /// Gets the user interface text. + /// </summary> + /// <returns>User interface text.</returns> + public override string GetUserInterfaceText() { return "LogOff"; } + + /// <summary> + /// Execute this command. + /// </summary> + /// <param name="variables">The variable list of the calling code.</param> + public override void Execute(VariableList variables) + { + if (!Win32.WindowsExit(Win32.ExitWindows.LogOff, Win32.ShutdownReasons.FlagUserDefined)) + throw new CommandExecutionException("LogOff command refused"); + } + + #endregion Implementation + + } + +} Added: trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandReboot.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandReboot.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandReboot.cs 2008-01-24 12:41:12 UTC (rev 1305) @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows.Forms; + +namespace Commands.General +{ + + /// <summary> + /// Reboot macro command. + /// </summary> + public class CommandReboot : Command + { + + #region Constructors + + /// <summary> + /// Initializes a new instance of the <see cref="CommandReboot"/> class. + /// </summary> + public CommandReboot() { InitParameters(0); } + + /// <summary> + /// Initializes a new instance of the <see cref="CommandReboot"/> class. + /// </summary> + /// <param name="parameters">The parameters.</param> + public CommandReboot(string[] parameters) : base(parameters) { } + + #endregion Constructors + + #region Implementation + + /// <summary> + /// Gets the category of this command. + /// </summary> + /// <returns>The category of this command.</returns> + public override string GetCategory() { return "General Commands"; } + + /// <summary> + /// Gets the user interface text. + /// </summary> + /// <returns>User interface text.</returns> + public override string GetUserInterfaceText() { return "Reboot"; } + + /// <summary> + /// Execute this command. + /// </summary> + /// <param name="variables">The variable list of the calling code.</param> + public override void Execute(VariableList variables) + { + if (!Win32.WindowsExit(Win32.ExitWindows.Reboot, Win32.ShutdownReasons.FlagUserDefined)) + throw new CommandExecutionException("Shutdown command refused"); + } + + #endregion Implementation + + } + +} Added: trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandSendWOL.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandSendWOL.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandSendWOL.cs 2008-01-24 12:41:12 UTC (rev 1305) @@ -0,0 +1,168 @@ +using System; +using System.Collections.Generic; +using System.Net; +using System.Net.Sockets; +using System.Text; +using System.Windows.Forms; + +using IrssUtils; + +namespace Commands.General +{ + + /// <summary> + /// Send WakeOnLan general command. + /// </summary> + public class CommandSendWOL : Command + { + + #region Constants + + /// <summary> + /// WakeOnLan packet header. + /// </summary> + static readonly byte[] Header = new byte[] { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; + + #endregion Constants + + #region Constructors + + /// <summary> + /// Initializes a new instance of the <see cref="CommandSendWOL"/> class. + /// </summary> + public CommandSendWOL() { InitParameters(3); } + + /// <summary> + /// Initializes a new instance of the <see cref="CommandSendWOL"/> class. + /// </summary> + /// <param name="parameters">The parameters.</param> + public CommandSendWOL(string[] parameters) : base(parameters) { } + + #endregion Constructors + + #region Public Methods + + /// <summary> + /// Gets the category of this command. + /// </summary> + /// <returns>The category of this command.</returns> + public override string GetCategory() { return "General Commands"; } + + /// <summary> + /// Gets the user interface text. + /// </summary> + /// <returns>User interface text.</returns> + public override string GetUserInterfaceText() { return "Send WakeOnLan"; } + + /// <summary> + /// Gets the user display text. + /// </summary> + /// <returns>The user display text.</returns> + public override string GetUserDisplayText() + { + return String.Format("{0} ({1})", GetUserInterfaceText(), String.Join(", ", Parameters)); + } + + /// <summary> + /// Execute this command. + /// </summary> + /// <param name="variables">The variable list of the calling code.</param> + public override void Execute(VariableList variables) + { + string mac = Parameters[0]; + if (mac.StartsWith(VariableList.VariablePrefix, StringComparison.OrdinalIgnoreCase)) + mac = variables.VariableGet(mac); + mac = Common.ReplaceSpecial(mac); + + string port = Parameters[1]; + if (port.StartsWith(VariableList.VariablePrefix, StringComparison.OrdinalIgnoreCase)) + port = variables.VariableGet(port); + port = Common.ReplaceSpecial(port); + + string password = Parameters[2]; + if (!String.IsNullOrEmpty(password)) + { + if (password.StartsWith(VariableList.VariablePrefix, StringComparison.OrdinalIgnoreCase)) + password = variables.VariableGet(password); + password = Common.ReplaceSpecial(password); + } + + SendWOL(mac, int.Parse(port), password); + } + + /// <summary> + /// Edit this command. + /// </summary> + /// <param name="parent">The parent window.</param> + /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> + public override bool Edit(IWin32Window parent) + { + EditSendWOL edit = new EditSendWOL(Parameters); + if (edit.ShowDialog(parent) == DialogResult.OK) + { + Parameters = edit.Parameters; + return true; + } + + return false; + } + + #endregion Public Methods + + /// <summary> + /// Send a Wake On LAN packet. + /// </summary> + /// <param name="mac">The mac address.</param> + /// <param name="port">The destination port.</param> + /// <param name="password">Optional password. Must be null, 4 or 6 bytes.</param> + static void SendWOL(string mac, int port, string password) + { + // Convert mac address to byte[] + string[] macParts = mac.Split(new char[] { ':', '-', '.', ' ' }, StringSplitOptions.RemoveEmptyEntries); + if (macParts.Length != 6) + throw new ArgumentException("Not a valid mac address", "mac"); + + byte[] macAddress = new byte[macParts.Length]; + for (int index = 0; index < macAddress.Length; index++) + macAddress[index] = byte.Parse(macParts[5 - index], System.Globalization.NumberStyles.HexNumber); + + // Convert password to byte[] + byte[] pass = null; + if (!String.IsNullOrEmpty(password)) + pass = Encoding.ASCII.GetBytes(password); + + if (pass != null && pass.Length != 4 && pass.Length != 6) + throw new ArgumentException("Not a valid password (must be null, 4 or 6 bytes)", "password"); + + int packetLength = Header.Length + (16 * macAddress.Length); + if (pass != null) + packetLength += pass.Length; + + byte[] packet = new byte[packetLength]; + + // Packet Header ... + Buffer.BlockCopy(Header, 0, packet, 0, Header.Length); + + // MAC repeated 16 times ... + int offset = Header.Length; + for (int i = 0; i < 16; i++) + { + Buffer.BlockCopy(macAddress, 0, packet, offset, macAddress.Length); + offset += macAddress.Length; + } + + // Add password (optional) ... + if (pass != null) + Buffer.BlockCopy(pass, 0, packet, offset, pass.Length); + + // Create connection ... + UdpClient client = new UdpClient(); + client.Connect(IPAddress.Broadcast, port); + + // Send ... + client.Send(packet, packet.Length); + } + + } + +} Added: trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandShutdown.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandShutdown.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandShutdown.cs 2008-01-24 12:41:12 UTC (rev 1305) @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows.Forms; + +namespace Commands.General +{ + + /// <summary> + /// Shutdown macro command. + /// </summary> + public class CommandShutdown : Command + { + + #region Constructors + + /// <summary> + /// Initializes a new instance of the <see cref="CommandShutdown"/> class. + /// </summary> + public CommandShutdown() { InitParameters(0); } + + /// <summary> + /// Initializes a new instance of the <see cref="CommandShutdown"/> class. + /// </summary> + /// <param name="parameters">The parameters.</param> + public CommandShutdown(string[] parameters) : base(parameters) { } + + #endregion Constructors + + #region Implementation + + /// <summary> + /// Gets the category of this command. + /// </summary> + /// <returns>The category of this command.</returns> + public override string GetCategory() { return "General Commands"; } + + /// <summary> + /// Gets the user interface text. + /// </summary> + /// <returns>User interface text.</returns> + public override string GetUserInterfaceText() { return "Shutdown"; } + + /// <summary> + /// Execute this command. + /// </summary> + /// <param name="variables">The variable list of the calling code.</param> + public override void Execute(VariableList variables) + { + if (!Win32.WindowsExit(Win32.ExitWindows.ShutDown, Win32.ShutdownReasons.FlagUserDefined)) + throw new CommandExecutionException("Shutdown command refused"); + } + + #endregion Implementation + + } + +} Added: trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandStandBy.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandStandBy.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandStandBy.cs 2008-01-24 12:41:12 UTC (rev 1305) @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows.Forms; + +namespace Commands.General +{ + + /// <summary> + /// StandBy macro command. + /// </summary> + public class CommandStandBy : Command + { + + #region Constructors + + /// <summary> + /// Initializes a new instance of the <see cref="CommandStandBy"/> class. + /// </summary> + public CommandStandBy() { InitParameters(0); } + + /// <summary> + /// Initializes a new instance of the <see cref="CommandStandBy"/> class. + /// </summary> + /// <param name="parameters">The parameters.</param> + public CommandStandBy(string[] parameters) : base(parameters) { } + + #endregion Constructors + + #region Implementation + + /// <summary> + /// Gets the category of this command. + /// </summary> + /// <returns>The category of this command.</returns> + public override string GetCategory() { return "General Commands"; } + + /// <summary> + /// Gets the user interface text. + /// </summary> + /// <returns>User interface text.</returns> + public override string GetUserInterfaceText() { return "StandBy"; } + + /// <summary> + /// Execute this command. + /// </summary> + /// <param name="variables">The variable list of the calling code.</param> + public override void Execute(VariableList variables) + { + if (!Application.SetSuspendState(PowerState.Suspend, false, false)) + throw new CommandExecutionException("StandBy command refused"); + } + + #endregion Implementation + + } + +} Added: trunk/plugins/IR Server Suite/Commands/GeneralCommands/EditSendWOL.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/GeneralCommands/EditSendWOL.Designer.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/GeneralCommands/EditSendWOL.Designer.cs 2008-01-24 12:41:12 UTC (rev 1305) @@ -0,0 +1,184 @@ +namespace Commands.General +{ + + partial class EditSendWOL + { + + /// <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.buttonCancel = new System.Windows.Forms.Button(); + this.buttonOK = new System.Windows.Forms.Button(); + this.labelMac = new System.Windows.Forms.Label(); + this.textBoxMac = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.numericUpDownPort = new System.Windows.Forms.NumericUpDown(); + this.labelPassword = new System.Windows.Forms.Label(); + this.textBoxPassword = new System.Windows.Forms.TextBox(); + this.toolTips = new System.Windows.Forms.ToolTip(this.components); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownPort)).BeginInit(); + 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(176, 104); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(64, 24); + this.buttonCancel.TabIndex = 3; + 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(104, 104); + this.buttonOK.Name = "buttonOK"; + this.buttonOK.Size = new System.Drawing.Size(64, 24); + this.buttonOK.TabIndex = 2; + this.buttonOK.Text = "OK"; + this.buttonOK.UseVisualStyleBackColor = true; + this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); + // + // labelMac + // + this.labelMac.Location = new System.Drawing.Point(8, 8); + this.labelMac.Name = "labelMac"; + this.labelMac.Size = new System.Drawing.Size(88, 20); + this.labelMac.TabIndex = 0; + this.labelMac.Text = "MAC Address:"; + this.labelMac.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // textBoxMac + // + this.textBoxMac.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxMac.Location = new System.Drawing.Point(96, 8); + this.textBoxMac.Name = "textBoxMac"; + this.textBoxMac.Size = new System.Drawing.Size(144, 20); + this.textBoxMac.TabIndex = 4; + this.textBoxMac.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.toolTips.SetToolTip(this.textBoxMac, "MAC Address of machine to wake"); + // + // label1 + // + this.label1.Location = new System.Drawing.Point(8, 40); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(88, 20); + this.label1.TabIndex = 5; + this.label1.Text = "Port:"; + this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // numericUpDownPort + // + this.numericUpDownPort.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.numericUpDownPort.Location = new System.Drawing.Point(96, 40); + this.numericUpDownPort.Maximum = new decimal(new int[] { + 65535, + 0, + 0, + 0}); + this.numericUpDownPort.Minimum = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.numericUpDownPort.Name = "numericUpDownPort"; + this.numericUpDownPort.Size = new System.Drawing.Size(144, 20); + this.numericUpDownPort.TabIndex = 6; + this.numericUpDownPort.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.toolTips.SetToolTip(this.numericUpDownPort, "WakeOnLan port (default: 9)"); + this.numericUpDownPort.Value = new decimal(new int[] { + 9, + 0, + 0, + 0}); + // + // labelPassword + // + this.labelPassword.Location = new System.Drawing.Point(8, 72); + this.labelPassword.Name = "labelPassword"; + this.labelPassword.Size = new System.Drawing.Size(88, 20); + this.labelPassword.TabIndex = 7; + this.labelPassword.Text = "Password:"; + this.labelPassword.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // textBoxPassword + // + this.textBoxPassword.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxPassword.Location = new System.Drawing.Point(96, 72); + this.textBoxPassword.Name = "textBoxPassword"; + this.textBoxPassword.Size = new System.Drawing.Size(144, 20); + this.textBoxPassword.TabIndex = 8; + this.textBoxPassword.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.toolTips.SetToolTip(this.textBoxPassword, "Optional password (either 4 or 6 charactors)"); + // + // EditSendWOL + // + 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(248, 137); + this.Controls.Add(this.textBoxPassword); + this.Controls.Add(this.labelPassword); + this.Controls.Add(this.numericUpDownPort); + this.Controls.Add(this.label1); + this.Controls.Add(this.textBoxMac); + this.Controls.Add(this.labelMac); + this.Controls.Add(this.buttonOK); + this.Controls.Add(this.buttonCancel); + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(256, 164); + this.Name = "EditSendWOL"; + this.ShowIcon = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Wake On Lan Command"; + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownPort)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button buttonCancel; + private System.Windows.Forms.Button buttonOK; + private System.Windows.Forms.Label labelMac; + private System.Windows.Forms.TextBox textBoxMac; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.NumericUpDown numericUpDownPort; + private System.Windows.Forms.Label labelPassword; + private System.Windows.Forms.TextBox textBoxPassword; + private System.Windows.Forms.ToolTip toolTips; + } + +} Added: trunk/plugins/IR Server Suite/Commands/GeneralCommands/EditSendWOL.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/GeneralCommands/EditSendWOL.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/GeneralCommands/EditSendWOL.cs 2008-01-24 12:41:12 UTC (rev 1305) @@ -0,0 +1,75 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +using IrssUtils; + +namespace Commands.General +{ + + /// <summary> + /// Edit Send WOL Command form. + /// </summary> + partial class EditSendWOL : Form + { + + #region Properties + + /// <summary> + /// Gets the command parameters. + /// </summary> + /// <value>The command parameters.</value> + public string[] Parameters + { + get + { + return new string[] { + textBoxMac.Text.Trim(), + numericUpDownPort.Value.ToString(), + textBoxPassword.Text.Trim() + }; + } + } + + #endregion Properties + + #region Constructors + + /// <summary> + /// Initializes a new instance of the <see cref="EditSendWOL"/> class. + /// </summary> + /// <param name="parameters">The command parameters.</param> + public EditSendWOL(string[] parameters) + { + InitializeComponent(); + + textBoxMac.Text = parameters[0]; + if (!String.IsNullOrEmpty(parameters[1])) + numericUpDownPort.Value = Decimal.Parse(parameters[1]); + textBoxPassword.Text = parameters[2]; + } + + #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/Commands/GeneralCommands/EditSendWOL.resx =================================================================== --- trunk/plugins/IR Server Suite/Commands/GeneralCommands/EditSendWOL.resx (rev 0) +++ trunk/plugins/IR Server Suite/Commands/GeneralCommands/EditSendWOL.resx 2008-01-24 12:41:12 UTC (rev 1305) @@ -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 Modified: trunk/plugins/IR Server Suite/Commands/GeneralCommands/GeneralCommands.csproj =================================================================== --- trunk/plugins/IR Server Suite/Commands/GeneralCommands/GeneralCommands.csproj 2008-01-23 18:07:48 UTC (rev 1304) +++ trunk/plugins/IR Server Suite/Commands/GeneralCommands/GeneralCommands.csproj 2008-01-24 12:41:12 UTC (rev 1305) @@ -38,7 +38,19 @@ <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> + <Compile Include="CommandHibernate.cs" /> <Compile Include="CommandKeystrokes.cs" /> + <Compile Include="CommandReboot.cs" /> + <Compile Include="CommandShutdown.cs" /> + <Compile Include="CommandStandBy.cs" /> + <Compile Include="CommandLogOff.cs" /> + <Compile Include="CommandSendWOL.cs" /> + <Compile Include="EditSendWOL.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="EditSendWOL.Designer.cs"> + <DependentUpon>EditSendWOL.cs</DependentUpon> + </Compile> <Compile Include="EditKeystrokes.cs"> <SubType>Form</SubType> </Compile> @@ -46,6 +58,7 @@ <DependentUpon>EditKeystrokes.cs</DependentUpon> </Compile> <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="Win32.cs" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\..\Common\IrssUtils\IrssUtils.csproj"> @@ -65,6 +78,10 @@ </ProjectReference> </ItemGroup> <ItemGroup> + <EmbeddedResource Include="EditSendWOL.resx"> + <DependentUpon>EditSendWOL.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> <EmbeddedResource Include="EditKeystrokes.resx"> <DependentUpon>EditKeystrokes.cs</DependentUpon> <SubType>Designer</SubType> Added: trunk/plugins/IR Server Suite/Commands/GeneralCommands/Win32.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/GeneralCommands/Win32.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/GeneralCommands/Win32.cs 2008-01-24 12:41:12 UTC (rev 1305) @@ -0,0 +1,2339 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Runtime.InteropServices; +using System.Text; + +namespace Commands.General +{ + + /// <summary> + /// Win32 native method class. + /// </summary> + [CLSCompliant(false)] + public static class Win32 + { + + #region Constants + + /// <summary> + /// Maximum length of unmanaged Windows Path strings. + /// </summary> + const int MAX_PATH = 260; + + /// <summary> + /// Maximum length of unmanaged Typename. + /// </summary> + const int MAX_TYPE = 80; + + + const int GCL_HICON = -14; + const int GCL_HICONSM = -34; + + + const int ICON_SMALL = 0; + const int ICON_BIG = 1; + + const int WPF_RESTORETOMAXIMIZED = 2; + + const int MINIMIZE_ALL = 419; + const int MINIMIZE_ALL_UNDO = 416; + + #endregion Constants + + #region Enumerations + + [Flags] + enum SHGFI + { + /// <summary>get icon</summary> + Icon = 0x000000100, + /// <summary>get display name</summary> + DisplayName = 0x000000200, + /// <summary>get type name</summary> + TypeName = 0x000000400, + /// <summary>get attributes</summary> + Attributes = 0x000000800, + /// <summary>get icon location</summary> + IconLocation = 0x000001000, + /// <summary>return exe type</summary> + ExeType = 0x000002000, + /// <summary>get system icon index</summary> + SysIconIndex = 0x000004000, + /// <summary>put a link overlay on icon</summary> + LinkOverlay = 0x000008000, + /// <summary>show icon in selected state</summary> + Selected = 0x000010000, + /// <summary>get only specified attributes</summary> + Attr_Specified = 0x000020000, + /// <summary>get large icon</summary> + LargeIcon = 0x000000000, + /// <summary>get small icon</summary> + SmallIcon = 0x000000001, + /// <summary>get open icon</summary> + OpenIcon = 0x000000002, + /// <summary>get shell size icon</summary> + ShellIconSize = 0x000000004, + /// <summary>pszPath is a pidl</summary> + PIDL = 0x000000008, + /// <summary>use passed dwFileAttribute</summary> + UseFileAttributes = 0x000000010, + /// <summary>apply the appropriate overlays</summary> + AddOverlays = 0x000000020, + /// <summary>Get the index of the overlay in the upper 8 bits of the iIcon</summary> + OverlayIndex = 0x000000040, + } + + /// <summary> + /// Windows Message types. + /// </summary> + public enum WindowsMessage + { + /// <summary> + /// WM_ACTIVATE + /// </summary> + WM_ACTIVATE = 0x6, + /// <summary> + /// WM_ACTIVATEAPP + /// </summary> + WM_ACTIVATEAPP = 0x1C, + /// <summary> + /// WM_AFXFIRST + /// </summary> + WM_AFXFIRST = 0x360, + /// <summary> + /// WM_AFXLAST + /// </summary> + WM_AFXLAST = 0x37F, + /// <summary> + /// WM_APP + /// </summary> + WM_APP = 0x8000, + /// <summary> + /// WM_APPCOMMAND + /// </summary> + WM_APPCOMMAND = 0x319, + /// <summary> + /// WM_ASKCBFORMATNAME + /// </summary> + WM_ASKCBFORMATNAME = 0x30C, + /// <summary> + /// WM_CANCELJOURNAL + /// </summary> + WM_CANCELJOURNAL = 0x4B, + /// <summary> + /// WM_CANCELMODE + /// </summary> + WM_CANCELMODE = 0x1F, + /// <summary> + /// WM_CAPTURECHANGED + /// </summary> + WM_CAPTURECHANGED = 0x215, + /// <summary> + /// WM_CHANGECBCHAIN + /// </summary> + WM_CHANGECBCHAIN = 0x30D, + /// <summary> + /// WM_CHAR + /// </summary> + WM_CHAR = 0x102, + /// <summary> + /// + /// </summary> + WM_CHARTOITEM = 0x2F, + /// <summary> + /// + /// </summary> + WM_CHILDACTIVATE = 0x22, + /// <summary> + /// + /// </summary> + WM_CLEAR = 0x303, + /// <summary> + /// + /// </summary> + WM_CLOSE = 0x10, + /// <summary> + /// + /// </summary> + WM_COMMAND = 0x111, + /// <summary> + /// + /// </summary> + WM_COMPACTING = 0x41, + /// <summary> + /// + /// </summary> + WM_COMPAREITEM = 0x39, + /// <summary> + /// + /// </summary> + WM_CONTEXTMENU = 0x7B, + /// <summary> + /// + /// </summary> + WM_COPY = 0x301, + /// <summary> + /// + /// </summary> + WM_COPYDATA = 0x4A, + /// <summary> + /// + /// </summary> + WM_CREATE = 0x1, + /// <summary> + /// + /// </summary> + WM_CTLCOLORBTN = 0x135, + /// <summary> + /// + /// </summary> + WM_CTLCOLORDLG = 0x136, + /// <summary> + /// + /// </summary> + WM_CTLCOLOREDIT = 0x133, + /// <summary> + /// + /// </summary> + WM_CTLCOLORLISTBOX = 0x134, + /// <summary> + /// + /// </summary> + ... [truncated message content] |
From: <an...@us...> - 2008-01-24 14:28:08
|
Revision: 1306 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1306&view=rev Author: and-81 Date: 2008-01-24 06:11:33 -0800 (Thu, 24 Jan 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsAbsolute.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsAdd.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsDivide.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsModulo.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsMultiply.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsPower.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsSquareRoot.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsSubtract.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Stack Commands/CommandPushStack.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/String Operations/CommandStringJoin.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/String Operations/CommandStringToLower.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/String Operations/CommandStringToUpper.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/String Operations/CommandStringTrim.cs trunk/plugins/IR Server Suite/Commands/CommandProcessor/Variable Commands/CommandSetVariable.cs trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandKeystrokes.cs trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandSendWOL.cs trunk/plugins/IR Server Suite/Commands/GeneralCommands/GeneralCommands.csproj trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/CommandGotoScreen.cs trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/CommandSendAction.cs trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/MediaPortalCommands.csproj trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs trunk/plugins/IR Server Suite/Common/MPUtils/Forms/GoToScreen.cs trunk/plugins/IR Server Suite/Documentation/IR Server Suite.hhc trunk/plugins/IR Server Suite/Documentation/IR Server Suite.hhp Added Paths: ----------- trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandPopup.cs trunk/plugins/IR Server Suite/Commands/GeneralCommands/EditPopup.Designer.cs trunk/plugins/IR Server Suite/Commands/GeneralCommands/EditPopup.cs trunk/plugins/IR Server Suite/Commands/GeneralCommands/EditPopup.resx trunk/plugins/IR Server Suite/Commands/GeneralCommands/PopupMessage.Designer.cs trunk/plugins/IR Server Suite/Commands/GeneralCommands/PopupMessage.cs trunk/plugins/IR Server Suite/Commands/GeneralCommands/PopupMessage.resx trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/CommandGetFocus.cs trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/CommandPopup.cs trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/CommandSendMessage.cs trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/EditPopup.Designer.cs trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/EditPopup.cs trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/EditPopup.resx trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/EditSendMessage.Designer.cs trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/EditSendMessage.cs trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/EditSendMessage.resx Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsAbsolute.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsAbsolute.cs 2008-01-24 12:41:12 UTC (rev 1305) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsAbsolute.cs 2008-01-24 14:11:33 UTC (rev 1306) @@ -64,14 +64,15 @@ /// <param name="variables">The variable list of the calling code.</param> public override void Execute(VariableList variables) { - string input1 = Parameters[0]; - if (input1.StartsWith(VariableList.VariablePrefix, StringComparison.OrdinalIgnoreCase)) - input1 = variables.VariableGet(input1); + string input = Parameters[0]; + if (input.StartsWith(VariableList.VariablePrefix, StringComparison.OrdinalIgnoreCase)) + input = variables.VariableGet(input.Substring(VariableList.VariablePrefix.Length)); + input = IrssUtils.Common.ReplaceSpecial(input); - int input1Int = 0; - int.TryParse(input1, out input1Int); + int inputInt = 0; + int.TryParse(input, out inputInt); - int output = Math.Abs(input1Int); + int output = Math.Abs(inputInt); variables.VariableSet(Parameters[1], output.ToString()); } Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsAdd.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsAdd.cs 2008-01-24 12:41:12 UTC (rev 1305) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsAdd.cs 2008-01-24 14:11:33 UTC (rev 1306) @@ -66,14 +66,16 @@ { string input1 = Parameters[0]; if (input1.StartsWith(VariableList.VariablePrefix, StringComparison.OrdinalIgnoreCase)) - input1 = variables.VariableGet(input1); - + input1 = variables.VariableGet(input1.Substring(VariableList.VariablePrefix.Length)); + input1 = IrssUtils.Common.ReplaceSpecial(input1); + int input1Int = 0; int.TryParse(input1, out input1Int); string input2 = Parameters[1]; if (input2.StartsWith(VariableList.VariablePrefix, StringComparison.OrdinalIgnoreCase)) - input2 = variables.VariableGet(input2); + input2 = variables.VariableGet(input2.Substring(VariableList.VariablePrefix.Length)); + input2 = IrssUtils.Common.ReplaceSpecial(input2); int input2Int = 0; int.TryParse(input2, out input2Int); Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsDivide.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsDivide.cs 2008-01-24 12:41:12 UTC (rev 1305) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsDivide.cs 2008-01-24 14:11:33 UTC (rev 1306) @@ -66,14 +66,16 @@ { string input1 = Parameters[0]; if (input1.StartsWith(VariableList.VariablePrefix, StringComparison.OrdinalIgnoreCase)) - input1 = variables.VariableGet(input1); - + input1 = variables.VariableGet(input1.Substring(VariableList.VariablePrefix.Length)); + input1 = IrssUtils.Common.ReplaceSpecial(input1); + int input1Int = 0; int.TryParse(input1, out input1Int); string input2 = Parameters[1]; if (input2.StartsWith(VariableList.VariablePrefix, StringComparison.OrdinalIgnoreCase)) - input2 = variables.VariableGet(input2); + input2 = variables.VariableGet(input2.Substring(VariableList.VariablePrefix.Length)); + input2 = IrssUtils.Common.ReplaceSpecial(input2); int input2Int = 0; int.TryParse(input2, out input2Int); Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsModulo.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsModulo.cs 2008-01-24 12:41:12 UTC (rev 1305) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsModulo.cs 2008-01-24 14:11:33 UTC (rev 1306) @@ -66,14 +66,16 @@ { string input1 = Parameters[0]; if (input1.StartsWith(VariableList.VariablePrefix, StringComparison.OrdinalIgnoreCase)) - input1 = variables.VariableGet(input1); - + input1 = variables.VariableGet(input1.Substring(VariableList.VariablePrefix.Length)); + input1 = IrssUtils.Common.ReplaceSpecial(input1); + int input1Int = 0; int.TryParse(input1, out input1Int); string input2 = Parameters[1]; if (input2.StartsWith(VariableList.VariablePrefix, StringComparison.OrdinalIgnoreCase)) - input2 = variables.VariableGet(input2); + input2 = variables.VariableGet(input2.Substring(VariableList.VariablePrefix.Length)); + input2 = IrssUtils.Common.ReplaceSpecial(input2); int input2Int = 0; int.TryParse(input2, out input2Int); Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsMultiply.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsMultiply.cs 2008-01-24 12:41:12 UTC (rev 1305) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsMultiply.cs 2008-01-24 14:11:33 UTC (rev 1306) @@ -66,14 +66,16 @@ { string input1 = Parameters[0]; if (input1.StartsWith(VariableList.VariablePrefix, StringComparison.OrdinalIgnoreCase)) - input1 = variables.VariableGet(input1); - + input1 = variables.VariableGet(input1.Substring(VariableList.VariablePrefix.Length)); + input1 = IrssUtils.Common.ReplaceSpecial(input1); + int input1Int = 0; int.TryParse(input1, out input1Int); string input2 = Parameters[1]; if (input2.StartsWith(VariableList.VariablePrefix, StringComparison.OrdinalIgnoreCase)) - input2 = variables.VariableGet(input2); + input2 = variables.VariableGet(input2.Substring(VariableList.VariablePrefix.Length)); + input2 = IrssUtils.Common.ReplaceSpecial(input2); int input2Int = 0; int.TryParse(input2, out input2Int); Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsPower.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsPower.cs 2008-01-24 12:41:12 UTC (rev 1305) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsPower.cs 2008-01-24 14:11:33 UTC (rev 1306) @@ -66,14 +66,16 @@ { string input1 = Parameters[0]; if (input1.StartsWith(VariableList.VariablePrefix, StringComparison.OrdinalIgnoreCase)) - input1 = variables.VariableGet(input1); - + input1 = variables.VariableGet(input1.Substring(VariableList.VariablePrefix.Length)); + input1 = IrssUtils.Common.ReplaceSpecial(input1); + int input1Int = 0; int.TryParse(input1, out input1Int); string input2 = Parameters[1]; if (input2.StartsWith(VariableList.VariablePrefix, StringComparison.OrdinalIgnoreCase)) - input2 = variables.VariableGet(input2); + input2 = variables.VariableGet(input2.Substring(VariableList.VariablePrefix.Length)); + input2 = IrssUtils.Common.ReplaceSpecial(input2); int input2Int = 0; int.TryParse(input2, out input2Int); Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsSquareRoot.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsSquareRoot.cs 2008-01-24 12:41:12 UTC (rev 1305) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsSquareRoot.cs 2008-01-24 14:11:33 UTC (rev 1306) @@ -64,12 +64,13 @@ /// <param name="variables">The variable list of the calling code.</param> public override void Execute(VariableList variables) { - string input1 = Parameters[0]; - if (input1.StartsWith(VariableList.VariablePrefix, StringComparison.OrdinalIgnoreCase)) - input1 = variables.VariableGet(input1); - + string input = Parameters[0]; + if (input.StartsWith(VariableList.VariablePrefix, StringComparison.OrdinalIgnoreCase)) + input = variables.VariableGet(input.Substring(VariableList.VariablePrefix.Length)); + input = IrssUtils.Common.ReplaceSpecial(input); + int input1Int = 0; - int.TryParse(input1, out input1Int); + int.TryParse(input, out input1Int); int output = (int)Math.Sqrt((double)input1Int); Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsSubtract.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsSubtract.cs 2008-01-24 12:41:12 UTC (rev 1305) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/Maths Operations/CommandMathsSubtract.cs 2008-01-24 14:11:33 UTC (rev 1306) @@ -66,14 +66,16 @@ { string input1 = Parameters[0]; if (input1.StartsWith(VariableList.VariablePrefix, StringComparison.OrdinalIgnoreCase)) - input1 = variables.VariableGet(input1); - + input1 = variables.VariableGet(input1.Substring(VariableList.VariablePrefix.Length)); + input1 = IrssUtils.Common.ReplaceSpecial(input1); + int input1Int = 0; int.TryParse(input1, out input1Int); string input2 = Parameters[1]; if (input2.StartsWith(VariableList.VariablePrefix, StringComparison.OrdinalIgnoreCase)) - input2 = variables.VariableGet(input2); + input2 = variables.VariableGet(input2.Substring(VariableList.VariablePrefix.Length)); + input2 = IrssUtils.Common.ReplaceSpecial(input2); int input2Int = 0; int.TryParse(input2, out input2Int); Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/Stack Commands/CommandPushStack.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/Stack Commands/CommandPushStack.cs 2008-01-24 12:41:12 UTC (rev 1305) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/Stack Commands/CommandPushStack.cs 2008-01-24 14:11:33 UTC (rev 1306) @@ -67,6 +67,7 @@ if (value.StartsWith(VariableList.VariablePrefix, StringComparison.OrdinalIgnoreCase)) value = variables.VariableGet(value.Substring(VariableList.VariablePrefix.Length)); + value = IrssUtils.Common.ReplaceSpecial(value); variables.StackPush(value); } Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/String Operations/CommandStringJoin.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/String Operations/CommandStringJoin.cs 2008-01-24 12:41:12 UTC (rev 1305) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/String Operations/CommandStringJoin.cs 2008-01-24 14:11:33 UTC (rev 1306) @@ -66,11 +66,13 @@ { string input1 = Parameters[0]; if (input1.StartsWith(VariableList.VariablePrefix, StringComparison.OrdinalIgnoreCase)) - input1 = variables.VariableGet(input1); - + input1 = variables.VariableGet(input1.Substring(VariableList.VariablePrefix.Length)); + input1 = IrssUtils.Common.ReplaceSpecial(input1); + string input2 = Parameters[1]; if (input2.StartsWith(VariableList.VariablePrefix, StringComparison.OrdinalIgnoreCase)) - input2 = variables.VariableGet(input2); + input2 = variables.VariableGet(input2.Substring(VariableList.VariablePrefix.Length)); + input2 = IrssUtils.Common.ReplaceSpecial(input2); string output = String.Concat(input1, input2); Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/String Operations/CommandStringToLower.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/String Operations/CommandStringToLower.cs 2008-01-24 12:41:12 UTC (rev 1305) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/String Operations/CommandStringToLower.cs 2008-01-24 14:11:33 UTC (rev 1306) @@ -66,7 +66,8 @@ { string input = Parameters[0]; if (input.StartsWith(VariableList.VariablePrefix, StringComparison.OrdinalIgnoreCase)) - input = variables.VariableGet(input); + input = variables.VariableGet(input.Substring(VariableList.VariablePrefix.Length)); + input = IrssUtils.Common.ReplaceSpecial(input); string output = input.ToLower(System.Globalization.CultureInfo.CurrentCulture); Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/String Operations/CommandStringToUpper.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/String Operations/CommandStringToUpper.cs 2008-01-24 12:41:12 UTC (rev 1305) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/String Operations/CommandStringToUpper.cs 2008-01-24 14:11:33 UTC (rev 1306) @@ -66,7 +66,8 @@ { string input = Parameters[0]; if (input.StartsWith(VariableList.VariablePrefix, StringComparison.OrdinalIgnoreCase)) - input = variables.VariableGet(input); + input = variables.VariableGet(input.Substring(VariableList.VariablePrefix.Length)); + input = IrssUtils.Common.ReplaceSpecial(input); string output = input.ToUpper(System.Globalization.CultureInfo.CurrentCulture); Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/String Operations/CommandStringTrim.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/String Operations/CommandStringTrim.cs 2008-01-24 12:41:12 UTC (rev 1305) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/String Operations/CommandStringTrim.cs 2008-01-24 14:11:33 UTC (rev 1306) @@ -66,7 +66,8 @@ { string input = Parameters[0]; if (input.StartsWith(VariableList.VariablePrefix, StringComparison.OrdinalIgnoreCase)) - input = variables.VariableGet(input); + input = variables.VariableGet(input.Substring(VariableList.VariablePrefix.Length)); + input = IrssUtils.Common.ReplaceSpecial(input); string output = input.Trim(); Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/Variable Commands/CommandSetVariable.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/Variable Commands/CommandSetVariable.cs 2008-01-24 12:41:12 UTC (rev 1305) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/Variable Commands/CommandSetVariable.cs 2008-01-24 14:11:33 UTC (rev 1306) @@ -66,7 +66,8 @@ { string value = Parameters[1]; if (value.StartsWith(VariableList.VariablePrefix, StringComparison.OrdinalIgnoreCase)) - value = variables.VariableGet(value); + value = variables.VariableGet(value.Substring(VariableList.VariablePrefix.Length)); + value = IrssUtils.Common.ReplaceSpecial(value); variables.VariableSet(Parameters[0], value); } Modified: trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandKeystrokes.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandKeystrokes.cs 2008-01-24 12:41:12 UTC (rev 1305) +++ trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandKeystrokes.cs 2008-01-24 14:11:33 UTC (rev 1306) @@ -60,8 +60,7 @@ { string value = Parameters[0]; if (value.StartsWith(VariableList.VariablePrefix, StringComparison.OrdinalIgnoreCase)) - value = variables.VariableGet(value); - + value = variables.VariableGet(value.Substring(VariableList.VariablePrefix.Length)); value = Common.ReplaceSpecial(value); Keyboard.ProcessCommand(value); Added: trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandPopup.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandPopup.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandPopup.cs 2008-01-24 14:11:33 UTC (rev 1306) @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using System.Windows.Forms; + +namespace Commands.General +{ + + /// <summary> + /// Popup Message command. + /// </summary> + public class CommandPopup : Command + { + + #region Constructors + + /// <summary> + /// Initializes a new instance of the <see cref="CommandPopup"/> class. + /// </summary> + public CommandPopup() { InitParameters(3); } + + /// <summary> + /// Initializes a new instance of the <see cref="CommandPopup"/> class. + /// </summary> + /// <param name="parameters">The parameters.</param> + public CommandPopup(string[] parameters) : base(parameters) { } + + #endregion Constructors + + #region Public Methods + + /// <summary> + /// Gets the category of this command. + /// </summary> + /// <returns>The category of this command.</returns> + public override string GetCategory() { return "General Commands"; } + + /// <summary> + /// Gets the user interface text. + /// </summary> + /// <returns>User interface text.</returns> + public override string GetUserInterfaceText() { return "Popup Message"; } + + /// <summary> + /// Execute this command. + /// </summary> + /// <param name="variables">The variable list of the calling code.</param> + public override void Execute(VariableList variables) + { + string heading = Parameters[0]; + if (heading.StartsWith(VariableList.VariablePrefix, StringComparison.OrdinalIgnoreCase)) + heading = variables.VariableGet(heading.Substring(VariableList.VariablePrefix.Length)); + heading = IrssUtils.Common.ReplaceSpecial(heading); + + string text = Parameters[1]; + if (text.StartsWith(VariableList.VariablePrefix, StringComparison.OrdinalIgnoreCase)) + text = variables.VariableGet(text.Substring(VariableList.VariablePrefix.Length)); + text = IrssUtils.Common.ReplaceSpecial(text); + + string timeoutString = Parameters[2]; + if (timeoutString.StartsWith(VariableList.VariablePrefix, StringComparison.OrdinalIgnoreCase)) + timeoutString = variables.VariableGet(timeoutString.Substring(VariableList.VariablePrefix.Length)); + timeoutString = IrssUtils.Common.ReplaceSpecial(timeoutString); + + int timeout = int.Parse(timeoutString); + + PopupMessage popup = new PopupMessage(heading, text, timeout); + popup.ShowDialog(); + } + + /// <summary> + /// Edit this command. + /// </summary> + /// <param name="parent">The parent window.</param> + /// <returns><c>true</c> if the command was modified; otherwise <c>false</c>.</returns> + public override bool Edit(IWin32Window parent) + { + EditPopup edit = new EditPopup(Parameters); + if (edit.ShowDialog(parent) == DialogResult.OK) + { + Parameters = edit.Parameters; + return true; + } + + return false; + } + + #endregion Public Methods + + } + +} Modified: trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandSendWOL.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandSendWOL.cs 2008-01-24 12:41:12 UTC (rev 1305) +++ trunk/plugins/IR Server Suite/Commands/GeneralCommands/CommandSendWOL.cs 2008-01-24 14:11:33 UTC (rev 1306) @@ -71,19 +71,19 @@ { string mac = Parameters[0]; if (mac.StartsWith(VariableList.VariablePrefix, StringComparison.OrdinalIgnoreCase)) - mac = variables.VariableGet(mac); + mac = variables.VariableGet(mac.Substring(VariableList.VariablePrefix.Length)); mac = Common.ReplaceSpecial(mac); string port = Parameters[1]; if (port.StartsWith(VariableList.VariablePrefix, StringComparison.OrdinalIgnoreCase)) - port = variables.VariableGet(port); + port = variables.VariableGet(port.Substring(VariableList.VariablePrefix.Length)); port = Common.ReplaceSpecial(port); string password = Parameters[2]; if (!String.IsNullOrEmpty(password)) { if (password.StartsWith(VariableList.VariablePrefix, StringComparison.OrdinalIgnoreCase)) - password = variables.VariableGet(password); + password = variables.VariableGet(password.Substring(VariableList.VariablePrefix.Length)); password = Common.ReplaceSpecial(password); } Added: trunk/plugins/IR Server Suite/Commands/GeneralCommands/EditPopup.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/GeneralCommands/EditPopup.Designer.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/GeneralCommands/EditPopup.Designer.cs 2008-01-24 14:11:33 UTC (rev 1306) @@ -0,0 +1,204 @@ +namespace Commands.General +{ + partial class EditPopup + { + /// <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.groupBoxMessageDetails = new System.Windows.Forms.GroupBox(); + this.labelSeconds = new System.Windows.Forms.Label(); + this.numericUpDownTimeout = new System.Windows.Forms.NumericUpDown(); + this.labelTimeout = new System.Windows.Forms.Label(); + this.textBoxText = new System.Windows.Forms.TextBox(); + this.labelText = new System.Windows.Forms.Label(); + this.textBoxHeading = new System.Windows.Forms.TextBox(); + this.labelHeading = new System.Windows.Forms.Label(); + this.buttonOK = new System.Windows.Forms.Button(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.groupBoxMessageDetails.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownTimeout)).BeginInit(); + this.SuspendLayout(); + // + // groupBoxMessageDetails + // + this.groupBoxMessageDetails.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.groupBoxMessageDetails.Controls.Add(this.labelSeconds); + this.groupBoxMessageDetails.Controls.Add(this.numericUpDownTimeout); + this.groupBoxMessageDetails.Controls.Add(this.labelTimeout); + this.groupBoxMessageDetails.Controls.Add(this.textBoxText); + this.groupBoxMessageDetails.Controls.Add(this.labelText); + this.groupBoxMessageDetails.Controls.Add(this.textBoxHeading); + this.groupBoxMessageDetails.Controls.Add(this.labelHeading); + this.groupBoxMessageDetails.Location = new System.Drawing.Point(8, 8); + this.groupBoxMessageDetails.Name = "groupBoxMessageDetails"; + this.groupBoxMessageDetails.Size = new System.Drawing.Size(272, 103); + this.groupBoxMessageDetails.TabIndex = 0; + this.groupBoxMessageDetails.TabStop = false; + this.groupBoxMessageDetails.Text = "Message details"; + // + // labelSeconds + // + this.labelSeconds.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.labelSeconds.Location = new System.Drawing.Point(144, 72); + this.labelSeconds.Name = "labelSeconds"; + this.labelSeconds.Size = new System.Drawing.Size(120, 20); + this.labelSeconds.TabIndex = 6; + this.labelSeconds.Text = "seconds"; + this.labelSeconds.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // numericUpDownTimeout + // + this.numericUpDownTimeout.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.numericUpDownTimeout.Location = new System.Drawing.Point(72, 72); + this.numericUpDownTimeout.Maximum = new decimal(new int[] { + 60, + 0, + 0, + 0}); + this.numericUpDownTimeout.Minimum = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.numericUpDownTimeout.Name = "numericUpDownTimeout"; + this.numericUpDownTimeout.Size = new System.Drawing.Size(64, 20); + this.numericUpDownTimeout.TabIndex = 5; + this.numericUpDownTimeout.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.numericUpDownTimeout.Value = new decimal(new int[] { + 1, + 0, + 0, + 0}); + // + // labelTimeout + // + this.labelTimeout.Location = new System.Drawing.Point(8, 72); + this.labelTimeout.Name = "labelTimeout"; + this.labelTimeout.Size = new System.Drawing.Size(64, 20); + this.labelTimeout.TabIndex = 4; + this.labelTimeout.Text = "Timeout:"; + this.labelTimeout.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // textBoxText + // + this.textBoxText.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxText.Location = new System.Drawing.Point(72, 48); + this.textBoxText.Name = "textBoxText"; + this.textBoxText.Size = new System.Drawing.Size(192, 20); + this.textBoxText.TabIndex = 3; + // + // labelText + // + this.labelText.Location = new System.Drawing.Point(8, 48); + this.labelText.Name = "labelText"; + this.labelText.Size = new System.Drawing.Size(64, 20); + this.labelText.TabIndex = 2; + this.labelText.Text = "Text:"; + this.labelText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // textBoxHeading + // + this.textBoxHeading.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxHeading.Location = new System.Drawing.Point(72, 24); + this.textBoxHeading.Name = "textBoxHeading"; + this.textBoxHeading.Size = new System.Drawing.Size(192, 20); + this.textBoxHeading.TabIndex = 1; + // + // labelHeading + // + this.labelHeading.Location = new System.Drawing.Point(8, 24); + this.labelHeading.Name = "labelHeading"; + this.labelHeading.Size = new System.Drawing.Size(64, 20); + this.labelHeading.TabIndex = 0; + this.labelHeading.Text = "Heading:"; + this.labelHeading.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // 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(144, 120); + this.buttonOK.Name = "buttonOK"; + this.buttonOK.Size = new System.Drawing.Size(64, 24); + this.buttonOK.TabIndex = 1; + 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(216, 120); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(64, 24); + this.buttonCancel.TabIndex = 2; + this.buttonCancel.Text = "Cancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); + // + // PopupMessage + // + 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(288, 152); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.buttonOK); + this.Controls.Add(this.groupBoxMessageDetails); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(296, 186); + this.Name = "PopupMessage"; + this.ShowIcon = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Popup Message Command"; + this.groupBoxMessageDetails.ResumeLayout(false); + this.groupBoxMessageDetails.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownTimeout)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupBoxMessageDetails; + private System.Windows.Forms.Label labelHeading; + private System.Windows.Forms.Label labelSeconds; + private System.Windows.Forms.NumericUpDown numericUpDownTimeout; + private System.Windows.Forms.Label labelTimeout; + private System.Windows.Forms.TextBox textBoxText; + private System.Windows.Forms.Label labelText; + private System.Windows.Forms.TextBox textBoxHeading; + private System.Windows.Forms.Button buttonOK; + private System.Windows.Forms.Button buttonCancel; + } +} \ No newline at end of file Added: trunk/plugins/IR Server Suite/Commands/GeneralCommands/EditPopup.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/GeneralCommands/EditPopup.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/GeneralCommands/EditPopup.cs 2008-01-24 14:11:33 UTC (rev 1306) @@ -0,0 +1,78 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace Commands.General +{ + + /// <summary> + /// Popup Message Command form. + /// </summary> + public partial class EditPopup : Form + { + + #region Properties + + /// <summary> + /// Gets the command parameters. + /// </summary> + /// <value>The command parameters.</value> + public string[] Parameters + { + get + { + return new string[] { + textBoxHeading.Text.Trim(), + textBoxText.Text.Trim(), + numericUpDownTimeout.Value.ToString() + }; + } + } + + #endregion Properties + + #region Constructors + + /// <summary> + /// Initializes a new instance of the <see cref="EditPopup"/> class. + /// </summary> + public EditPopup() + { + InitializeComponent(); + } + + /// <summary> + /// Initializes a new instance of the <see cref="EditPopup"/> class. + /// </summary> + /// <param name="commands">The command elements.</param> + public EditPopup(string[] commands) + : this() + { + textBoxHeading.Text = commands[0]; + textBoxText.Text = commands[1]; + numericUpDownTimeout.Value = Convert.ToDecimal(commands[2]); + } + + #endregion Constructors + + #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/Commands/GeneralCommands/EditPopup.resx =================================================================== --- trunk/plugins/IR Server Suite/Commands/GeneralCommands/EditPopup.resx (rev 0) +++ trunk/plugins/IR Server Suite/Commands/GeneralCommands/EditPopup.resx 2008-01-24 14:11:33 UTC (rev 1306) @@ -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 Modified: trunk/plugins/IR Server Suite/Commands/GeneralCommands/GeneralCommands.csproj =================================================================== --- trunk/plugins/IR Server Suite/Commands/GeneralCommands/GeneralCommands.csproj 2008-01-24 12:41:12 UTC (rev 1305) +++ trunk/plugins/IR Server Suite/Commands/GeneralCommands/GeneralCommands.csproj 2008-01-24 14:11:33 UTC (rev 1306) @@ -40,11 +40,18 @@ <ItemGroup> <Compile Include="CommandHibernate.cs" /> <Compile Include="CommandKeystrokes.cs" /> + <Compile Include="CommandPopup.cs" /> <Compile Include="CommandReboot.cs" /> <Compile Include="CommandShutdown.cs" /> <Compile Include="CommandStandBy.cs" /> <Compile Include="CommandLogOff.cs" /> <Compile Include="CommandSendWOL.cs" /> + <Compile Include="EditPopup.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="EditPopup.Designer.cs"> + <DependentUpon>EditPopup.cs</DependentUpon> + </Compile> <Compile Include="EditSendWOL.cs"> <SubType>Form</SubType> </Compile> @@ -58,6 +65,12 @@ <DependentUpon>EditKeystrokes.cs</DependentUpon> </Compile> <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="PopupMessage.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="PopupMessage.Designer.cs"> + <DependentUpon>PopupMessage.cs</DependentUpon> + </Compile> <Compile Include="Win32.cs" /> </ItemGroup> <ItemGroup> @@ -78,6 +91,10 @@ </ProjectReference> </ItemGroup> <ItemGroup> + <EmbeddedResource Include="EditPopup.resx"> + <DependentUpon>EditPopup.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> <EmbeddedResource Include="EditSendWOL.resx"> <DependentUpon>EditSendWOL.cs</DependentUpon> <SubType>Designer</SubType> @@ -86,6 +103,10 @@ <DependentUpon>EditKeystrokes.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> + <EmbeddedResource Include="PopupMessage.resx"> + <DependentUpon>PopupMessage.cs</DependentUpon> + <SubType>Designer</SubType> + </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. Added: trunk/plugins/IR Server Suite/Commands/GeneralCommands/PopupMessage.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/GeneralCommands/PopupMessage.Designer.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/GeneralCommands/PopupMessage.Designer.cs 2008-01-24 14:11:33 UTC (rev 1306) @@ -0,0 +1,121 @@ +namespace Commands.General +{ + partial class PopupMessage + { + /// <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.buttonOK = new System.Windows.Forms.Button(); + this.timerOK = new System.Windows.Forms.Timer(this.components); + this.panel1 = new System.Windows.Forms.Panel(); + this.textBoxMessage = new System.Windows.Forms.TextBox(); + this.labelDiv = new System.Windows.Forms.Label(); + this.panel1.SuspendLayout(); + this.SuspendLayout(); + // + // buttonOK + // + this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.buttonOK.Location = new System.Drawing.Point(88, 8); + this.buttonOK.Name = "buttonOK"; + this.buttonOK.Size = new System.Drawing.Size(72, 24); + this.buttonOK.TabIndex = 0; + this.buttonOK.Text = "OK (100)"; + this.buttonOK.UseVisualStyleBackColor = true; + this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); + // + // timerOK + // + this.timerOK.Interval = 1000; + this.timerOK.Tick += new System.EventHandler(this.timerOK_Tick); + // + // panel1 + // + this.panel1.Controls.Add(this.buttonOK); + this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom; + this.panel1.Location = new System.Drawing.Point(0, 35); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(250, 40); + this.panel1.TabIndex = 2; + // + // textBoxMessage + // + this.textBoxMessage.BackColor = System.Drawing.SystemColors.Control; + this.textBoxMessage.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.textBoxMessage.Dock = System.Windows.Forms.DockStyle.Fill; + this.textBoxMessage.Location = new System.Drawing.Point(0, 16); + this.textBoxMessage.Multiline = true; + this.textBoxMessage.Name = "textBoxMessage"; + this.textBoxMessage.Size = new System.Drawing.Size(250, 19); + this.textBoxMessage.TabIndex = 3; + this.textBoxMessage.Text = "Message"; + this.textBoxMessage.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // labelDiv + // + this.labelDiv.Dock = System.Windows.Forms.DockStyle.Top; + this.labelDiv.Location = new System.Drawing.Point(0, 0); + this.labelDiv.Name = "labelDiv"; + this.labelDiv.Size = new System.Drawing.Size(250, 16); + this.labelDiv.TabIndex = 4; + this.labelDiv.Text = " "; + this.labelDiv.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // ShowPopupMessage + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(250, 75); + this.Controls.Add(this.textBoxMessage); + this.Controls.Add(this.labelDiv); + this.Controls.Add(this.panel1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(256, 100); + this.Name = "ShowPopupMessage"; + this.ShowIcon = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "Header"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ShowPopupMessage_FormClosing); + this.Load += new System.EventHandler(this.ShowPopupMessage_Load); + this.panel1.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button buttonOK; + private System.Windows.Forms.Timer timerOK; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.TextBox textBoxMessage; + private System.Windows.Forms.Label labelDiv; + } +} \ No newline at end of file Added: trunk/plugins/IR Server Suite/Commands/GeneralCommands/PopupMessage.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/GeneralCommands/PopupMessage.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/GeneralCommands/PopupMessage.cs 2008-01-24 14:11:33 UTC (rev 1306) @@ -0,0 +1,72 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace Commands.General +{ + + /// <summary> + /// Show a popup message. + /// </summary> + public partial class PopupMessage : Form + { + + #region Variables + + int _timeout; + + #endregion Variables + + #region Constructor + + /// <summary> + /// Initializes a new instance of the <see cref="PopupMessage"/> class. + /// </summary> + public PopupMessage(string header, string text, int timeout) + { + InitializeComponent(); + + this.Text = header; + textBoxMessage.Text = text; + _timeout = timeout; + + buttonOK.Text = String.Format("OK ({0})", _timeout); + } + + #endregion Constructor + + private void timerOK_Tick(object sender, EventArgs e) + { + _timeout--; + + if (_timeout <= 0) + { + this.DialogResult = DialogResult.Cancel; + this.Close(); + } + + buttonOK.Text = String.Format("OK ({0})", _timeout); + } + + private void ShowPopupMessage_Load(object sender, EventArgs e) + { + timerOK.Start(); + } + + private void ShowPopupMessage_FormClosing(object sender, FormClosingEventArgs e) + { + timerOK.Stop(); + } + + private void buttonOK_Click(object sender, EventArgs e) + { + this.DialogResult = DialogResult.OK; + this.Close(); + } + + } + +} Added: trunk/plugins/IR Server Suite/Commands/GeneralCommands/PopupMessage.resx =================================================================== --- trunk/plugins/IR Server Suite/Commands/GeneralCommands/PopupMessage.resx (rev 0) +++ trunk/plugins/IR Server Suite/Commands/GeneralCommands/PopupMessage.resx 2008-01-24 14:11:33 UTC (rev 1306) @@ -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="timerOK.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/Commands/MediaPortalCommands/CommandGetFocus.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/CommandGetFocus.cs (rev 0) +++ trunk/plugins/IR Server Suite/Commands/MediaPortalCommands/CommandGetFocus.cs 2008-01-24 14:11:33 UTC (rev 1306) @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows.Forms; + +using MediaPortal.GUI.Library; + +namespace Commands.MediaPortal +{ + + /// <summary> + /// Get Focus MediaPortal macro command. + /// </summary> + public class CommandGetFocus : Command + { + + #region Constructors + + /// <summary> + /// Initializes a new instance of the <see cref="CommandGetFocus"/> class. + /// </summary> + public CommandGetFocus() { InitParameters(0); } + + /// <summary> + /// Initializes a new instance of the <see cref="CommandGetFocus"/> class. + /// </summary> + /// <param name="parameters">The parameters.</param> + public CommandGetFocus(string[] parameters) : base(parameters) { } + + #endregion Constructors + + #region Implementation + + /// <summary> + /// Gets the category of this command. + /// </summary> + /// <returns>The category of this command.</returns> + public override string GetCategory() { return "MediaPortal Commands"; } + + /// <summary> + /// Gets the user interface text. + /// </s... [truncated message content] |
From: <an...@us...> - 2008-01-28 11:55:37
|
Revision: 1317 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1317&view=rev Author: and-81 Date: 2008-01-28 03:55:35 -0800 (Mon, 28 Jan 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Translator/CopyDataWM.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/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/Applications/Virtual Remote Skin Editor/MainForm.Designer.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/SmsKeyboard.Designer.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/VirtualKeyboard.Designer.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Win32.cs trunk/plugins/IR Server Suite/Documentation/Input Service/index.html trunk/plugins/IR Server Suite/Documentation/legal.html trunk/plugins/IR Server Suite/Documentation/new.html trunk/plugins/IR Server Suite/Documentation/troubleshooting.html trunk/plugins/IR Server Suite/IR Server Suite - Debug.nsi trunk/plugins/IR Server Suite/IR Server Suite - Release.nsi 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/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.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/FormMain.resx trunk/plugins/IR Server Suite/Applications/IR File Tool/IR File Tool.csproj trunk/plugins/IR Server Suite/Applications/IR File Tool/Icon.ico trunk/plugins/IR Server Suite/Applications/IR File Tool/IrCode.cs trunk/plugins/IR Server Suite/Applications/IR File Tool/IrDecoder.cs trunk/plugins/IR Server Suite/Applications/IR File Tool/MceDetectionData.cs trunk/plugins/IR Server Suite/Applications/IR File Tool/Program.cs trunk/plugins/IR Server Suite/Applications/IR File Tool/Pronto.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/IR File Tool/RemoteDetectionData.cs trunk/plugins/IR Server Suite/Applications/Translator/Graphics/Shortcut.png trunk/plugins/IR Server Suite/Common/ShellLink/ trunk/plugins/IR Server Suite/Common/ShellLink/AssemblyInfo.cs trunk/plugins/IR Server Suite/Common/ShellLink/ShellLink.csproj trunk/plugins/IR Server Suite/Common/ShellLink/ShellLinkNative.cs trunk/plugins/IR Server Suite/Common/ShellLink/ShellShortcut.cs Removed Paths: ------------- trunk/plugins/IR Server Suite/Util Apps/IR File Tool/ Property changes on: trunk/plugins/IR Server Suite/Applications/IR File Tool ___________________________________________________________________ Name: svn:ignore + bin obj 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 2008-01-28 11:55:35 UTC (rev 1317) @@ -0,0 +1,341 @@ +namespace IrFileTool +{ + 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(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormMain)); + this.menuStrip = new System.Windows.Forms.MenuStrip(); + this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.saveasToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.quitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.serverToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.connectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.disconnectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.changeServerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.textBoxPronto = new System.Windows.Forms.TextBox(); + this.toolTips = new System.Windows.Forms.ToolTip(this.components); + this.buttonSetCarrier = new System.Windows.Forms.Button(); + this.checkBoxStoreBinary = new System.Windows.Forms.CheckBox(); + this.buttonAttemptDecode = new System.Windows.Forms.Button(); + this.buttonBlast = new System.Windows.Forms.Button(); + this.buttonLearn = new System.Windows.Forms.Button(); + this.textBoxCarrier = new System.Windows.Forms.TextBox(); + this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); + this.saveFileDialog = new System.Windows.Forms.SaveFileDialog(); + this.groupBoxCarrier = new System.Windows.Forms.GroupBox(); + this.groupBoxTestBlast = new System.Windows.Forms.GroupBox(); + this.comboBoxPort = new System.Windows.Forms.ComboBox(); + this.menuStrip.SuspendLayout(); + this.groupBoxCarrier.SuspendLayout(); + this.groupBoxTestBlast.SuspendLayout(); + this.SuspendLayout(); + // + // menuStrip + // + this.menuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.fileToolStripMenuItem, + this.serverToolStripMenuItem}); + this.menuStrip.Location = new System.Drawing.Point(0, 0); + this.menuStrip.Name = "menuStrip"; + this.menuStrip.Size = new System.Drawing.Size(504, 24); + this.menuStrip.TabIndex = 0; + this.menuStrip.Text = "menuStrip"; + // + // fileToolStripMenuItem + // + this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.newToolStripMenuItem, + this.openToolStripMenuItem, + this.saveToolStripMenuItem, + this.saveasToolStripMenuItem, + this.toolStripSeparator1, + this.quitToolStripMenuItem}); + this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; + this.fileToolStripMenuItem.Size = new System.Drawing.Size(35, 20); + this.fileToolStripMenuItem.Text = "&File"; + // + // newToolStripMenuItem + // + this.newToolStripMenuItem.Name = "newToolStripMenuItem"; + this.newToolStripMenuItem.Size = new System.Drawing.Size(138, 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(138, 22); + this.openToolStripMenuItem.Text = "&Open ..."; + this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click); + // + // saveToolStripMenuItem + // + this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; + this.saveToolStripMenuItem.Size = new System.Drawing.Size(138, 22); + this.saveToolStripMenuItem.Text = "&Save"; + this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click); + // + // saveasToolStripMenuItem + // + this.saveasToolStripMenuItem.Name = "saveasToolStripMenuItem"; + this.saveasToolStripMenuItem.Size = new System.Drawing.Size(138, 22); + this.saveasToolStripMenuItem.Text = "Save &as ..."; + this.saveasToolStripMenuItem.Click += new System.EventHandler(this.saveasToolStripMenuItem_Click); + // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(135, 6); + // + // quitToolStripMenuItem + // + this.quitToolStripMenuItem.Name = "quitToolStripMenuItem"; + this.quitToolStripMenuItem.Size = new System.Drawing.Size(138, 22); + this.quitToolStripMenuItem.Text = "&Quit"; + this.quitToolStripMenuItem.Click += new System.EventHandler(this.quitToolStripMenuItem_Click); + // + // serverToolStripMenuItem + // + this.serverToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.connectToolStripMenuItem, + this.disconnectToolStripMenuItem, + this.changeServerToolStripMenuItem}); + this.serverToolStripMenuItem.Name = "serverToolStripMenuItem"; + this.serverToolStripMenuItem.Size = new System.Drawing.Size(51, 20); + this.serverToolStripMenuItem.Text = "&Server"; + // + // connectToolStripMenuItem + // + this.connectToolStripMenuItem.Name = "connectToolStripMenuItem"; + this.connectToolStripMenuItem.Size = new System.Drawing.Size(156, 22); + this.connectToolStripMenuItem.Text = "&Connect"; + this.connectToolStripMenuItem.Click += new System.EventHandler(this.connectToolStripMenuItem_Click); + // + // disconnectToolStripMenuItem + // + this.disconnectToolStripMenuItem.Name = "disconnectToolStripMenuItem"; + this.disconnectToolStripMenuItem.Size = new System.Drawing.Size(156, 22); + this.disconnectToolStripMenuItem.Text = "&Disconnect"; + this.disconnectToolStripMenuItem.Click += new System.EventHandler(this.disconnectToolStripMenuItem_Click); + // + // changeServerToolStripMenuItem + // + this.changeServerToolStripMenuItem.Name = "changeServerToolStripMenuItem"; + this.changeServerToolStripMenuItem.Size = new System.Drawing.Size(156, 22); + this.changeServerToolStripMenuItem.Text = "Change &server"; + this.changeServerToolStripMenuItem.Click += new System.EventHandler(this.changeServerToolStripMenuItem_Click); + // + // textBoxPronto + // + this.textBoxPronto.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.textBoxPronto.Font = new System.Drawing.Font("Courier New", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.textBoxPronto.Location = new System.Drawing.Point(8, 32); + this.textBoxPronto.Multiline = true; + this.textBoxPronto.Name = "textBoxPronto"; + this.textBoxPronto.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; + this.textBoxPronto.Size = new System.Drawing.Size(312, 264); + this.textBoxPronto.TabIndex = 1; + // + // buttonSetCarrier + // + this.buttonSetCarrier.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonSetCarrier.Location = new System.Drawing.Point(112, 24); + this.buttonSetCarrier.Name = "buttonSetCarrier"; + this.buttonSetCarrier.Size = new System.Drawing.Size(48, 24); + this.buttonSetCarrier.TabIndex = 1; + this.buttonSetCarrier.Text = "&Set"; + this.toolTips.SetToolTip(this.buttonSetCarrier, "Change the carrier frequency"); + this.buttonSetCarrier.UseVisualStyleBackColor = true; + this.buttonSetCarrier.Click += new System.EventHandler(this.buttonSetCarrier_Click); + // + // checkBoxStoreBinary + // + this.checkBoxStoreBinary.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.checkBoxStoreBinary.Location = new System.Drawing.Point(336, 272); + this.checkBoxStoreBinary.Name = "checkBoxStoreBinary"; + this.checkBoxStoreBinary.Size = new System.Drawing.Size(160, 24); + this.checkBoxStoreBinary.TabIndex = 6; + this.checkBoxStoreBinary.Text = "Store &mceir.dll compatible"; + this.toolTips.SetToolTip(this.checkBoxStoreBinary, "Store this IR Code in an MceIr.dll compatible form"); + this.checkBoxStoreBinary.UseVisualStyleBackColor = true; + // + // buttonAttemptDecode + // + this.buttonAttemptDecode.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonAttemptDecode.Location = new System.Drawing.Point(360, 208); + this.buttonAttemptDecode.Name = "buttonAttemptDecode"; + this.buttonAttemptDecode.Size = new System.Drawing.Size(112, 24); + this.buttonAttemptDecode.TabIndex = 5; + this.buttonAttemptDecode.Text = "&Attempt Decode"; + this.toolTips.SetToolTip(this.buttonAttemptDecode, "Try to decode the IR signal into a recognised format"); + this.buttonAttemptDecode.UseVisualStyleBackColor = true; + this.buttonAttemptDecode.Click += new System.EventHandler(this.buttonAttemptDecode_Click); + // + // buttonBlast + // + this.buttonBlast.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonBlast.Location = new System.Drawing.Point(112, 24); + this.buttonBlast.Name = "buttonBlast"; + this.buttonBlast.Size = new System.Drawing.Size(51, 24); + this.buttonBlast.TabIndex = 1; + this.buttonBlast.Text = "&Blast"; + this.toolTips.SetToolTip(this.buttonBlast, "Blast the current IR command for testing"); + this.buttonBlast.UseVisualStyleBackColor = true; + this.buttonBlast.Click += new System.EventHandler(this.buttonBlast_Click); + // + // buttonLearn + // + this.buttonLearn.Enabled = false; + this.buttonLearn.Location = new System.Drawing.Point(360, 168); + this.buttonLearn.Name = "buttonLearn"; + this.buttonLearn.Size = new System.Drawing.Size(112, 24); + this.buttonLearn.TabIndex = 4; + this.buttonLearn.Text = "&Learn IR"; + this.toolTips.SetToolTip(this.buttonLearn, "Learn a new IR command"); + this.buttonLearn.UseVisualStyleBackColor = true; + this.buttonLearn.Click += new System.EventHandler(this.buttonLearn_Click); + // + // textBoxCarrier + // + this.textBoxCarrier.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxCarrier.Location = new System.Drawing.Point(8, 24); + this.textBoxCarrier.Name = "textBoxCarrier"; + this.textBoxCarrier.Size = new System.Drawing.Size(96, 20); + this.textBoxCarrier.TabIndex = 0; + // + // openFileDialog + // + this.openFileDialog.DefaultExt = "IR"; + this.openFileDialog.Filter = "IR Files|*.IR"; + this.openFileDialog.Title = "Open an IR file ..."; + // + // saveFileDialog + // + this.saveFileDialog.DefaultExt = "IR"; + this.saveFileDialog.Filter = "IR Files|*.IR"; + this.saveFileDialog.Title = "Save an IR file ..."; + // + // groupBoxCarrier + // + this.groupBoxCarrier.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxCarrier.Controls.Add(this.textBoxCarrier); + this.groupBoxCarrier.Controls.Add(this.buttonSetCarrier); + this.groupBoxCarrier.Location = new System.Drawing.Point(328, 32); + this.groupBoxCarrier.Name = "groupBoxCarrier"; + this.groupBoxCarrier.Size = new System.Drawing.Size(168, 56); + this.groupBoxCarrier.TabIndex = 2; + this.groupBoxCarrier.TabStop = false; + this.groupBoxCarrier.Text = "Carrier frequency"; + // + // groupBoxTestBlast + // + this.groupBoxTestBlast.Controls.Add(this.buttonBlast); + this.groupBoxTestBlast.Controls.Add(this.comboBoxPort); + this.groupBoxTestBlast.Enabled = false; + this.groupBoxTestBlast.Location = new System.Drawing.Point(328, 96); + this.groupBoxTestBlast.Name = "groupBoxTestBlast"; + this.groupBoxTestBlast.Size = new System.Drawing.Size(168, 56); + this.groupBoxTestBlast.TabIndex = 3; + this.groupBoxTestBlast.TabStop = false; + this.groupBoxTestBlast.Text = "Test blast"; + // + // comboBoxPort + // + this.comboBoxPort.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.comboBoxPort.FormattingEnabled = true; + this.comboBoxPort.Location = new System.Drawing.Point(8, 24); + this.comboBoxPort.Name = "comboBoxPort"; + this.comboBoxPort.Size = new System.Drawing.Size(96, 21); + this.comboBoxPort.TabIndex = 0; + // + // FormMain + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(504, 305); + this.Controls.Add(this.buttonLearn); + this.Controls.Add(this.groupBoxTestBlast); + this.Controls.Add(this.groupBoxCarrier); + this.Controls.Add(this.buttonAttemptDecode); + this.Controls.Add(this.checkBoxStoreBinary); + this.Controls.Add(this.textBoxPronto); + this.Controls.Add(this.menuStrip); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MainMenuStrip = this.menuStrip; + this.MinimumSize = new System.Drawing.Size(512, 332); + this.Name = "FormMain"; + this.Text = "IR File Tool"; + this.menuStrip.ResumeLayout(false); + this.menuStrip.PerformLayout(); + this.groupBoxCarrier.ResumeLayout(false); + this.groupBoxCarrier.PerformLayout(); + this.groupBoxTestBlast.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.MenuStrip menuStrip; + private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem newToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem saveasToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; + private System.Windows.Forms.ToolStripMenuItem quitToolStripMenuItem; + private System.Windows.Forms.TextBox textBoxPronto; + private System.Windows.Forms.ToolTip toolTips; + private System.Windows.Forms.TextBox textBoxCarrier; + private System.Windows.Forms.Button buttonSetCarrier; + private System.Windows.Forms.CheckBox checkBoxStoreBinary; + private System.Windows.Forms.Button buttonAttemptDecode; + private System.Windows.Forms.OpenFileDialog openFileDialog; + private System.Windows.Forms.SaveFileDialog saveFileDialog; + private System.Windows.Forms.ToolStripMenuItem serverToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem connectToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem disconnectToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem changeServerToolStripMenuItem; + private System.Windows.Forms.GroupBox groupBoxCarrier; + private System.Windows.Forms.GroupBox groupBoxTestBlast; + private System.Windows.Forms.Button buttonBlast; + private System.Windows.Forms.ComboBox comboBoxPort; + private System.Windows.Forms.Button buttonLearn; + } +} + 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 2008-01-28 11:55:35 UTC (rev 1317) @@ -0,0 +1,468 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.IO; +using System.Net; +using System.Net.Sockets; +using System.Text; +using System.Threading; +using System.Windows.Forms; +using System.Xml; + +using IrssComms; +using IrssUtils; +using IrssUtils.Forms; + +namespace IrFileTool +{ + + /// <summary> + /// IR File Tool Main Form. + /// </summary> + partial class FormMain : Form + { + + #region Constants + + static readonly string ConfigurationFile = Common.FolderAppData + "IR File Tool\\IR File Tool.xml"; + + #endregion Constants + + #region Variables + + string _fileName = String.Empty; + + IrCode _code = new IrCode(); + + + Client _client; + + bool _registered; + + string _serverHost = String.Empty; + + + #endregion Variables + + #region Constructor + + /// <summary> + /// Initializes a new instance of the <see cref="FormMain"/> class. + /// </summary> + public FormMain() + { + InitializeComponent(); + + LoadSettings(); + } + + #endregion Constructor + + + void RefreshForm() + { + if (String.IsNullOrEmpty(_fileName)) + this.Text = "IR File Tool"; + else + this.Text = "IR File Tool - " + _fileName; + + textBoxPronto.Text = Encoding.ASCII.GetString(_code.ToByteArray(true)); + + switch (_code.Carrier) + { + case IrCode.CarrierFrequencyDCMode: + textBoxCarrier.Text = "DC Mode"; + break; + + case IrCode.CarrierFrequencyUnknown: + textBoxCarrier.Text = "Unknown"; + break; + + default: + textBoxCarrier.Text = _code.Carrier.ToString(); + break; + } + } + + void Save() + { + if (!checkBoxStoreBinary.Checked) + { + Pronto.WriteProntoFile(_fileName, Pronto.ConvertIrCodeToProntoRaw(_code)); + } + else + { + using (FileStream file = File.OpenWrite(_fileName)) + { + byte[] fileBytes = DataPacket(_code); + + file.Write(fileBytes, 0, fileBytes.Length); + } + } + } + + + void LoadSettings() + { + try + { + XmlDocument doc = new XmlDocument(); + doc.Load(ConfigurationFile); + + _serverHost = doc.DocumentElement.Attributes["ServerHost"].Value; + } + catch (Exception ex) + { + IrssLog.Error(ex); + + _serverHost = "localhost"; + } + } + void SaveSettings() + { + try + { + using (XmlTextWriter writer = new XmlTextWriter(ConfigurationFile, Encoding.UTF8)) + { + writer.Formatting = Formatting.Indented; + writer.Indentation = 1; + writer.IndentChar = (char)9; + writer.WriteStartDocument(true); + writer.WriteStartElement("settings"); // <settings> + + writer.WriteAttributeString("ServerHost", _serverHost); + + writer.WriteEndElement(); // </settings> + writer.WriteEndDocument(); + } + } + catch (Exception ex) + { + IrssLog.Error(ex); + } + } + + + + 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(); + + MessageBox.Show(this, "Please report this error.", "IR File Tool - Communications failure", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + void Connected(object obj) + { + IrssLog.Info("Connected to server"); + + IrssMessage message = new IrssMessage(MessageType.RegisterClient, MessageFlags.Request); + _client.Send(message); + } + void Disconnected(object obj) + { + IrssLog.Warn("Communications with server has been lost"); + + Thread.Sleep(1000); + } + + bool StartClient(IPEndPoint endPoint) + { + if (_client != null) + return false; + + ClientMessageSink sink = new ClientMessageSink(ReceivedMessage); + + _client = new Client(endPoint, 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.Dispose(); + _client = null; + } + + void ReceivedMessage(IrssMessage received) + { + IrssLog.Debug("Received Message \"{0}\"", received.Type); + + try + { + switch (received.Type) + { + case MessageType.RegisterClient: + if ((received.Flags & MessageFlags.Success) == MessageFlags.Success) + { + _registered = true; + + groupBoxTestBlast.Enabled = true; + buttonLearn.Enabled = true; + } + else if ((received.Flags & MessageFlags.Failure) == MessageFlags.Failure) + { + _registered = false; + + groupBoxTestBlast.Enabled = false; + buttonLearn.Enabled = false; + + MessageBox.Show(this, "Failed to register with server", "IR File Tool Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + return; + + case MessageType.ServerShutdown: + MessageBox.Show(this, "Server has been shut down", "IR File Tool Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + + case MessageType.Error: + MessageBox.Show(this, received.GetDataAsString(), "IR File Tool Error from Server", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + } + catch (Exception ex) + { + IrssLog.Error(ex); + MessageBox.Show(this, ex.Message, "IR File Tool Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + + + + + + + + + private void newToolStripMenuItem_Click(object sender, EventArgs e) + { + _code = new IrCode(); + _fileName = "New File.IR"; + + RefreshForm(); + } + private void openToolStripMenuItem_Click(object sender, EventArgs e) + { + if (openFileDialog.ShowDialog(this) != DialogResult.OK) + return; + + if (String.IsNullOrEmpty(openFileDialog.InitialDirectory)) + openFileDialog.InitialDirectory = Common.FolderIRCommands; + + using (FileStream file = File.OpenRead(openFileDialog.FileName)) + { + if (file.Length == 0) + { + MessageBox.Show(this, "The selected file is empty", "Empty file", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + byte[] fileData = new byte[file.Length]; + + file.Read(fileData, 0, (int)file.Length); + + _code = IrCode.FromByteArray(fileData); + } + + _fileName = openFileDialog.FileName; + + RefreshForm(); + } + private void saveToolStripMenuItem_Click(object sender, EventArgs e) + { + Save(); + } + private void saveasToolStripMenuItem_Click(object sender, EventArgs e) + { + if (String.IsNullOrEmpty(saveFileDialog.InitialDirectory)) + saveFileDialog.InitialDirectory = Common.FolderIRCommands; + + if (saveFileDialog.ShowDialog(this) != DialogResult.OK) + return; + + _fileName = saveFileDialog.FileName; + + Save(); + } + private void quitToolStripMenuItem_Click(object sender, EventArgs e) + { + this.Close(); + } + private void buttonAttemptDecode_Click(object sender, EventArgs e) + { + IrDecoder.DecodeIR(_code.TimingData, new RemoteCallback(RemoteEvent), new KeyboardCallback(KeyboardEvent), new MouseCallback(MouseEvent)); + } + + static byte[] DataPacket(IrCode code) + { + if (code.TimingData.Length == 0) + return null; + + // Construct data bytes into "packet" ... + List<byte> packet = new List<byte>(); + + for (int index = 0; index < code.TimingData.Length; index++) + { + double time = (double)code.TimingData[index]; + + byte duration = (byte)Math.Abs(Math.Round(time / 50)); + bool pulse = (time > 0); + + while (duration > 0x7F) + { + packet.Add((byte)(pulse ? 0xFF : 0x7F)); + + duration -= 0x7F; + } + + packet.Add((byte)(pulse ? 0x80 | duration : duration)); + } + + // Insert byte count markers into packet data bytes ... + int subpackets = (int)Math.Ceiling(packet.Count / (double)4); + + byte[] output = new byte[packet.Count + subpackets + 1]; + + int outputPos = 0; + + for (int packetPos = 0; packetPos < packet.Count; ) + { + byte copyCount = (byte)(packet.Count - packetPos < 4 ? packet.Count - packetPos : 0x04); + + output[outputPos++] = (byte)(0x80 | copyCount); + + for (int index = 0; index < copyCount; index++) + output[outputPos++] = packet[packetPos++]; + } + + output[outputPos] = 0x80; + + return output; + } + + void RemoteEvent(IrProtocol codeType, uint keyCode, bool firstPress) + { + MessageBox.Show(this, String.Format("Remote: {0}, {1}", Enum.GetName(typeof(IrProtocol), codeType), keyCode), "Decode IR", MessageBoxButtons.OK, MessageBoxIcon.Information); + + if (textBoxCarrier.Text.Equals("Unknown", StringComparison.OrdinalIgnoreCase)) + { + switch (codeType) + { + case IrProtocol.Daewoo: textBoxCarrier.Text = "38000"; break; + case IrProtocol.JVC: textBoxCarrier.Text = "38000"; break; + case IrProtocol.Matsushita: textBoxCarrier.Text = "56800"; break; + case IrProtocol.Mitsubishi: textBoxCarrier.Text = "40000"; break; + case IrProtocol.NEC: textBoxCarrier.Text = "38000"; break; + case IrProtocol.NRC17: textBoxCarrier.Text = "38000"; break; + case IrProtocol.Panasonic: textBoxCarrier.Text = "38000"; break; + case IrProtocol.RC5: textBoxCarrier.Text = "36000"; break; + case IrProtocol.RC5X: textBoxCarrier.Text = "36000"; break; + case IrProtocol.RC6: textBoxCarrier.Text = "36000"; break; + case IrProtocol.RC6A: textBoxCarrier.Text = "36000"; break; + case IrProtocol.RC6_MCE: textBoxCarrier.Text = "36000"; break; + case IrProtocol.RC6_Foxtel: textBoxCarrier.Text = "36000"; break; + case IrProtocol.RCA: textBoxCarrier.Text = "56000"; break; + case IrProtocol.RCMM: textBoxCarrier.Text = "36000"; break; + case IrProtocol.RECS80: textBoxCarrier.Text = "38000"; break; + case IrProtocol.Sharp: textBoxCarrier.Text = "38000"; break; + case IrProtocol.SIRC: textBoxCarrier.Text = "40000"; break; + case IrProtocol.Toshiba: textBoxCarrier.Text = "38000"; break; + case IrProtocol.XSAT: textBoxCarrier.Text = "38000"; break; + + default: + return; + } + + _code.Carrier = int.Parse(textBoxCarrier.Text); + + RefreshForm(); + } + } + void KeyboardEvent(uint keyCode, uint modifiers) + { + MessageBox.Show(this, String.Format("Keyboard: {0}, {1}", keyCode, modifiers), "Decode IR", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + void MouseEvent(int deltaX, int deltaY, bool right, bool left) + { + MessageBox.Show(this, String.Format("Mouse: DX {0}, DY {1}, Right: {2}, Left: {3}", deltaX, deltaY, right, left), "Decode IR", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + + private void buttonSetCarrier_Click(object sender, EventArgs e) + { + if (textBoxCarrier.Text == "Unknown") + return; + + if (textBoxCarrier.Text == "DC Mode") + _code.Carrier = IrCode.CarrierFrequencyDCMode; + + _code.Carrier = int.Parse(textBoxCarrier.Text); + + RefreshForm(); + } + + private void connectToolStripMenuItem_Click(object sender, EventArgs e) + { + IPAddress serverIP = Client.GetIPFromName(_serverHost); + IPEndPoint endPoint = new IPEndPoint(serverIP, IrssComms.Server.DefaultPort); + + StartClient(endPoint); + } + private void disconnectToolStripMenuItem_Click(object sender, EventArgs e) + { + if (_registered) + { + IrssMessage message = new IrssMessage(MessageType.UnregisterClient, MessageFlags.Request); + _client.Send(message); + + _registered = false; + } + + groupBoxTestBlast.Enabled = false; + buttonLearn.Enabled = false; + + StopClient(); + } + private void changeServerToolStripMenuItem_Click(object sender, EventArgs e) + { + ServerAddress serverAddress = new ServerAddress(_serverHost); + serverAddress.ShowDialog(this); + + _serverHost = serverAddress.ServerHost; + + SaveSettings(); + } + + private void buttonBlast_Click(object sender, EventArgs e) + { + + } + + private void buttonLearn_Click(object sender, EventArgs e) + { + + } + + + } + +} Added: trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.resx =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.resx (rev 0) +++ trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.resx 2008-01-28 11:55:35 UTC (rev 1317) @@ -0,0 +1,228 @@ +<?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="menuStrip.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>119, 17</value> + </metadata> + <metadata name="openFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>209, 17</value> + </metadata> + <metadata name="saveFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>333, 17</value> + </metadata> + <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> + AAABAAIAICAAAAEAIACoEAAAJgAAABAQAAABACAAaAQAAM4QAAAoAAAAIAAAAEAAAAABACAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAn4cp/52FKf+ehin/noYp/56GKf+ehin/nYUp/56GKf+fhyn/noYp/56G + Kf+dhSn/nYUp/56GKf+ehin/noYp/52FKf+fhyn/noYp/56GKf+ehin/nYUp/56GKf+ehin/noYp/5yE + KP+bhCj/noYp/56GKf+ehin/noYp/52FKf+ehin/n4cp/52FKf+fhyn/noYp/56GKf+dhSn/noYp/52F + Kf+ehin/noYp/56GKf+fhyn/nYUp/5+HKf+ehin/noYp/52FKf+ehin/noYp/52FKf+ehin/moMo/6CI + Kf+skiz/u54v/6CIKf+agyj/ookq/6OKKv+ehin/nYUp/56GKf+dhSn/noYp/52FKf+ehin/noYp/56G + Kf+dhSn/noYp/52FKf+ehin/n4cp/52FKf+fhyn/noYp/56GKf+dhSn/noYp/52FKf+fhyn/nYUp/5uE + KP+jiir/n4cp/3ZkIf9dUBz/rJIs/6mQK/+bhCj/noYp/56GKf+dhSn/nYUp/56GKf+ehin/nYUp/56G + Kf+dhSn/noYp/56GKf+ehin/nYUp/52FKf+ehin/noYp/56GKf+ehin/nYUp/5+HKf+dhSn/noYp/56G + Kf+dhSn/n4cp/6eNKv+DcCT/FxUH/wEBAP93ZSH/sJUt/6SLKv+dhSn/nYUp/52FKf+dhSn/n4cp/52F + Kf+dhSn/nYUp/52FKf+fhyn/noYp/5+HKf+dhSn/nYUp/52FKf+dhSn/n4cp/56GKf+dhSn/noYp/52F + Kf+ehin/nYUp/56GKf+dhSn/p40q/4RxJP8UEwb/AAAA/x0aCv+PeSb/t5su/6CIKf+bhCj/nYUp/5+H + Kf+dhSn/noYp/56GKf+fhyn/noYp/56GKf+dhSn/noYp/56GKf+ehin/n4cp/52FKf+ehin/nYUp/56G + Kf+ehin/noYp/5+HKf+iiSr/noYp/5uEKP+njSr/qZAr/2tbH/8QDwT/AAAA/1tOG/+skiz/pIsq/5uE + KP+dhSn/n4cp/52FKf+ehin/noYp/56GKf+dhSn/noYp/5+HKf+dhSn/noYp/56GKf+ehin/n4cp/56G + Kf+ehin/nYUp/52FKf+giCn/qI4r/6KJKv+jiir/pYwq/5+HKf+iiSr/loAn/zQtEf8BAQD/KiUP/5V/ + J/+tkyz/nYUp/52FKf+dhSn/nYUp/56GKf+ehin/noYp/56GKf+fhyn/nYUp/56GKf+ehin/noYp/5+H + Kf+dhSn/n4cp/56GKf+giCn/pYwq/5eBJ/9MQRj/IR0M/5qDKP+0mC3/nYUp/6OKKv+wlS3/fGki/wIC + AP8AAAD/cmIg/7GWLf+giCn/noYp/52FKf+ehin/noYp/56GKf+dhSn/nYUp/5+HKf+dhSn/nYUp/52F + Kf+dhSn/nYUp/56GKf+bhCj/noYp/52FKf+njSr/eWch/woJAv8BAQD/TUIY/6KJKv+pkCv/noYp/6SL + Kv+skiz/GBYI/wAAAP9OQxj/up0u/6OKKv+dhSn/nYUp/56GKf+ehin/nYUp/56GKf+dhSn/nYUp/56G + Kf+ehin/noYp/52FKf+bhCj/pIsq/6ySLP+jiir/oIgp/6mQK/+KdSX/KCQO/wICAP8NDAP/fmwi/7qd + Lv+giCn/moMo/76gL/9IPhf/AAAA/yMfDf+hiCn/p40q/52FKf+ehin/noYp/56GKf+dhSn/nYUp/5uE + KP+fhyn/nYUp/52FKf+bhCj/noYp/6SLKv+njir/iHQk/5F7Jv+iiSr/rJIs/6ySLP98aSL/EA8E/wAA + AP9WShr/rJIs/6KJKv+fhyn/tJgt/35sIv8JCQL/AAAA/21dH/+1mS3/noYp/52FKf+fhyn/nYUp/56G + Kv+dhiz/oIgu/6WNL/+dhiz/nYUq/56GKf+iiSr/pYwq/3RjIP8XFQf/SD4X/56GKf+qkSv/qZAr/6WM + Kv8vKRD/AAAA/zAqEP+Zgij/pYwq/52FKf+ljCr/ookq/zMsEf8AAAD/SD4X/8OmMf+giCn/n4cp/52F + Kf+WgCz/m4M3/6KJRf+chE3/k3xL/5eAQv+bgzb/nYUs/6SLKv+Vfyf/MSsR/wEBAP8hHQz/h3Mk/62T + LP+pkCv/rpQs/01CGP8AAAD/ERAF/4h0Jf+yly3/nYUp/6SLKv+0mC3/PTYV/wAAAP9AOBX/vJ8v/5qD + KP+dhSn/l4Es/5uEPv9yYVn/MSpw/xQSfP8WE3r/RDtt/39rUv+bgzb/powr/6CIKf9kVh3/CwsC/wAA + AP9pWh7/rZMs/6CIKf+ljCr/g3Ak/wkJAv8AAAD/b14f/7qdLv+dhSn/p40q/7CVLf9EOxb/AAAA/zEr + Ef+ulCz/ookq/52FKf+ZgTb/gW5b/yUgh/8AAK7/AADB/wAAv/8CAqL/NC1x/4p1Rv+jii7/qpEr/6WM + Kv8YFgj/AAAA/05DGP+tkyz/pIsq/6OKKv+giCn/HBkK/wAAAP9XSxr/t5su/52FKf+ehin/r5Us/1pN + G/8AAAD/JSAN/6OKKv+ljCr/mYIp/6KJQP9SRm3/AwOo/wAA0/8AAN7/AADc/wAAx/8KCY3/YlRV/5uD + NP+ulCz/v6Ev/ysmD/8AAAD/ODET/6KJKv+ljCr/o4oq/6iOK/8nIg7/AAAA/0tAF/+8ny//noYp/56G + Kf+wlS3/YFIc/wAAAP8hHQz/oIgp/6KJKv+dhSr/qo9C/0E4bf8BAa3/AADX/wAA4f8AAN//AADO/wUE + lv9YS1v/noc4/6ySLf++oC//LigQ/wAAAP81LhL/nYUp/6WMKv+kiyr/rpQs/yIeDP8AAAD/TkMY/7+h + MP+ehin/pIsq/7KXLf9dUBz/AAAA/yMfDf+giCn/nYUp/6CIKf+njTr/aVle/w8Nl/8AAMr/AADb/wAA + 1/8AALr/FxSB/3ZlUP+ojjb/qpEr/7aaLv8cGQr/AAAA/0Q7Fv+ojiv/p40q/6OKKv+qkSv/FxUH/wAA + AP9WShr/tZkt/56GKf+kiyr/spct/11QHP8AAAD/Ix8N/6GIKf+giCn/nYUp/6CIMP+YgEr/Ni9z/wAA + of8AALn/AACu/wcHhf9NQlz/kHs7/56GLP+ojiv/kXwm/xMSBv8AAAD/Vkoa/6mQK/+giCn/pYwq/5J8 + Jv8eGwv/AAAA/1hMG/+2mi7/noYp/52FKf+wlS3/WEwb/wAAAP8mIQ7/p40q/6SLKv+ehin/nIQq/5Z/ + Nf96aFD/RTxs/zApev85MXD/Y1VY/455Pv+agy3/p40q/6SLKv9WShr/BwcC/wAAAP9rWx//qpEr/6KJ + Kv+ljCr/emgh/w0MA/8AAAD/aFke/7ueL/+dhSn/o4oq/7ueL/9HPRb/AAAA/zcwEv+1mS3/nYUp/56G + Kf+fhyn/nIQs/5iANv+PeUD/hnJF/4p2Qf+YgTf/noYu/56GKf+iiSr/lX8n/0c9Fv8GBQH/Ix8N/4t2 + Jf+ulCz/pIsq/62TLP9SRxn/AAAA/xEQBf+HcyT/qpEr/52FKf+jiir/tZkt/zUuEv8AAAD/QzoW/8Cj + MP+agyj/noYp/56GKf+ehin/moMp/52GLP+giC7/n4ct/52FKv+ehin/nYUp/5+HKf+agyj/j3km/1dL + Gv9xYSD/o4oq/6qRK/+qkSv/noYp/ygkDv8AAAD/OzQU/6OKKv+kiyr/noYp/6ySLP+Vfyf/HhsL/wAA + AP9bThv/waQw/5qDKP+dhSn/noYp/52FKf+dhSn/noYp/56GKf+fhyn/noYp/52FKf+dhSn/nYUp/6OK + Kv+wlS3/oIgp/6KJKv+giCn/pYwq/6CIKf9cTxv/BwcC/wAAAP9lVh3/sZYt/6SLKv+bhCj/vJ8v/2RW + Hf8AAAD/Dw4E/39tI/+0mC3/nYUp/52FKf+dhSn/nYUp/52FKf+dhSn/noYp/52FKf+ehin/nYUp/52F + Kf+ehin/nYUp/5yEKP+iiSr/n4cp/56GKf+ljCr/jXgl/ysmD/8AAAD/HRoK/5B6Jv+xli3/noYp/56G + Kf+6nS7/NC0R/wAAAP81LhL/n4cp/6eNKv+dhSn/nYUp/5+HKf+dhSn/noYp/56GKf+dhSn/n4cp/52F + Kf+ehin/noYp/56GKf+ehin/noYp/52FKf+ehin/nYUp/6WMKv+KdSX/OzQU/wkJAv9VSRr/o4oq/6WM + Kv+ehin/pYwq/5iBJ/8eGwv/AAAA/1VJGv+yly3/p40q/52FKf+dhSn/noYp/56GKf+ehin/nYUp/5+H + Kf+ehin/n4cp/52FKf+ehin/noYp/52FKf+ehin/noYp/56GKf+ehin/noYp/5+HKf+Qeib/XVAc/5aA + J/+vlSz/n4cp/6WMKv+1mS3/Zlcd/wkJAv8CAgD/dWQh/7ebLv+bhCj/nYUp/52FKf+ehin/noYp/52F + Kf+fhyn/noYp/56GKf+ehin/noYp/52FKf+fhyn/noYp/52FKf+ehin/nYUp/56GKf+ehin/oIgp/6KJ + Kv+hiCn/powq/6CIKf+giCn/p40q/5J8Jv8vKRD/AAAA/ysmD/+dhSn/rJIs/5qDKP+dhSn/oIgp/5+H + Kf+dhSn/nYUp/56GKf+ehin/noYp/5+HKf+dhSn/noYp/56GKf+dhSn/noYp/52FKf+ehin/nYUp/52F + Kf+dhSn/noYp/6iOK/+ehin/moMo/6KJKv+WgCf/TEEY/wEBAP8BAQD/dGMg/7SYLf+ehin/nYUp/52F + Kf+jiir/noYp/52FKf+ehin/noYp/56GKf+fhyn/nYUp/5+HKf+dhSn/noYp/52FKf+ehin/nYUp/56G + Kf+ehin/nYUp/56GKf+ehin/noYp/52FKf+fhyn/o4oq/5F7Jv9DOhb/AgIA/zw1FP+ljCr/sZYt/5iB + J/+ehin/nYUp/52FKf+dhSn/n4cp/56GKf+ehin/noYp/52FKf+fhyn/nYUp/56GKf+ehin/noYp/52F + Kf+fhyn/nYUp/56GKf+ehin/noYp/56GKf+dhSn/n4cp/52FKf+giCn/n4cp/4NwJP9YTBv/lH4n/6iO + K/+jiir/m4Qo/52FKf+dhSn/nYUp/5+HKf+dhSn/noYp/5+HKf+dhSn/n4cp/52FKf+fhyn/noYp/56G + Kf+ehin/n4cp/52FKf+dhSn/nYUp/52FKf+dhSn/nYUp/5+HKf+dhSn/noYp/56GKf+fhyn/ookq/6SL + Kv+ojiv/ookq/5uEKP+ehin/nYUp/5+HKf+ehin/noYp/56GKf+dhSn/noYp/56GKf+ehin/nYUp/56G + Kf+ehir/nYUp/56GKf+ehin/noYp/56GKf+dhSn/noYp/52FKf+ehin/nYUp/52FKf+dhSn/noYp/56G + Kf+dhSn/n4cp/5uEKP+ehin/noYp/56GKf+ehin/nYUp/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKAAAABAAAAAgAAAAAQAgAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAJ6GKf+dhSn/noYp/52FKf+ehin/nYUp/52FKf+ehin/nYUp/56G + Kf+dhSn/nYUo/6iOKv+chSj/oIcp/52FKf+dhSn/nYUp/52FKf+dhSn/nYUp/52FKf+dhSn/nYUp/52F + Kf+dhSn/nYUo/5uDKP86MhH/noYp/56GKf+dhSn/noYp/52FKf+dhSn/nYUp/52FKf+dhSn/nYUp/52F + Kf+dhSn/noYp/52FKP+ehij/Ix8K/0E4Ev+pjyv/nIQo/52FKf+ehin/nYUp/56GKf+dhSn/noYp/56G + Kf+ehin/noYo/21dHv+ljCr/oIcp/31qIf8LCQP/mYIn/52FKf+dhSn/nYUp/52FKf+dhSn/nYUp/5yE + KP+iiSn/n4cp/5R+Jv8NCwT/XlAZ/6iOKv+qkCv/GBUH/3JhHv+hiCn/nYUp/5qCLf+SfDf/lX42/5qD + K/+iiSn/bl4d/4ZxI/+qkSv/V0sY/yEdCv+iiir/pYwq/1dKF/8tJg3/rZMs/5uDKv97aFf/Ni+N/zoy + iv+FcEv/noYq/ygjDP9EOhP/qI8r/4h0JP8GBgH/mIEn/6GIKf95ZyH/HBgJ/6mPK/+bhDL/LiiF/wAA + 0/8AAMz/PDNu/6SMLv9pWhv/IR0K/6WMKv+jiir/EA4G/4VxI/+dhSn/hnIj/xEPBv+iiSn/powx/ygi + df8AAM7/AADD/zUtYv+ojy//b14d/x4aCv+kiir/p44q/w4MBP+GcSP/oYgp/4dzJP8RDwb/n4cp/56F + Kv95Zkn/GBV9/yMebP+Dbzv/pYsp/0A3Ev8wKQ7/pYwq/5V/Jv8KCQP/jHcl/56GKf+CbiP/FxQI/6eN + Kv+ehin/nIQs/5Z+Nv+YgTL/nYUq/5uEKP9MQRX/cGAe/6mQKv9xYB7/ExEG/56GKP+iiSr/Z1gc/yci + DP+tkyz/nYUp/52FKf+dhSn/noYp/52FKf+ehin/o4op/5+HKf+dhij/Ix4L/0Q6E/+pjyv/q5Er/yYg + C/9YTBj/pYsq/52FKf+dhSn/nYUp/56GKf+dhSn/nYUp/52FKf+dhSn/moMo/0xBFv+PeSX/oYkp/5Z/ + Jv8KCQP/jHcl/5+GKf+ehin/nYUp/56GKf+ehin/nYUp/52FKf+dhSn/nYUp/52FKf+iiSn/n4co/5+H + KP9DORP/JyIL/6aNKv+chCj/noYp/56GKf+ehin/noYp/52FKf+dhSn/nYUp/52FKf+dhSn/nYUp/56G + Kf+chSj/SD4V/4dzI/+hiSn/nYUp/52FKf+dhSn/nYUp/52FKf+dhSr/nYUp/52FKf+dhSn/nYUp/52F + Kf+dhSn/noYp/6CIKf+giCn/nYUo/52FKf8AAJxBAACcQQAAnEEAAJxBAACcQQAAnEEAAJxBAACcQQAA + nEEAAJxBAACcQQAAnEEAAJxBAACcQQAAnEEAAJxB +</value> + </data> +</root> \ 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 2008-01-28 11:55:35 UTC (rev 1317) @@ -0,0 +1,105 @@ +<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>IRFileTool</RootNamespace> + <AssemblyName>IRFileTool</AssemblyName> + <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent> + <StartupObject>IrFileTool.Program</StartupObject> + <ApplicationIcon>Icon.ico</ApplicationIcon> + </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> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <UseVSHostingProcess>false</UseVSHostingProcess> + <DocumentationFile>bin\Debug\IRFileTool.xml</DocumentationFile> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>none</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants> + </DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <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> + <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" /> + <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="IrCode.cs" /> + <Compile Include="IrDecoder.cs" /> + <Compile Include="MceDetectionData.cs" /> + <Compile Include="Program.cs" /> + <Compile Include="Pronto.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="RemoteDetectionData.cs" /> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="FormMain.resx"> + <SubType>Designer</SubType> + <DependentUpon>FormMain.cs</DependentUpon> + </EmbeddedResource> + </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> + </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. + <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/Icon.ico =================================================================== (Binary files differ) Property changes on: trunk/plugins/IR Server Suite/Applications/IR File Tool/Icon.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/IR Server Suite/Applications/IR File Tool/IrCode.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR File Tool/IrCode.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/IR File Tool/IrCode.cs 2008-01-28 11:55:35 UTC (rev 1317) @@ -0,0 +1,291 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; + +// Remember: Pulse is Positive, Space is Negative. + +namespace IrFileTool +{ + + /// <summary> + /// Encapsulates an MCE compatible IR Code. + /// </summary> + class IrCode + { + + #region Constants + + /// <summary> + /// The carrier frequency for this code is Unknown. + /// </summary> + public const int CarrierFrequencyUnknown = -1; + /// <summary> + /// This code does not use a carrier wave. + /// </summary> + public const int CarrierFrequencyDCMode = 0; + /// <summary> + /// Default carrier frequency, 36kHz (the carrier frequency for RC5, RC6 and RC-MM). + /// </summary> + public const int CarrierFrequencyDefault = 36000; + + /// <summary> + /// How long the longest IR Code space should be (microseconds). + /// </summary> + const int LongestSpace = -100000; + + #endregion Constants + + #region Member Variables + + int _carrier; + int[] _timingData; + + #endregion Member Variables + + #region Properties + + /// <summary> + /// Gets or Sets the IR carrier frequency. + /// </summary> + public int Carrier + { + get { return _carrier; } + set { _carrier = value; } + } + + /// <summary> + /// Gets or Sets 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 + + /// <summary> + /// Locates the gap between button presses and reduces the data down to just the first press. + /// </summary> + /// <returns><c>true</c> if successful, otherwise <c>false</c>.</returns> + public bool FinalizeData() + { + if (_timingData.Length == 0) + return false; + + List<int> newData = new List<int>(); + + foreach (int time in _timingData) + { + 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="timingData">Addition timing data.</param> + public void AddTimingData(int[] timingData) + { + 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[timingData.Length]; + timingData.CopyTo(_timingData, 0); + return; + } + + if (timingData.Length == 0 || index >= _timingData.Length) + return; + + if (Math.Sign(timingData[0]) == Math.Sign(_timingData[index])) + { + newTimingData.Add(_timingData[index] + timingData[0]); + + for (index = 1; index < timingData.Length; index++) + newTimingData.Add(timingData[index]); + } + else + { + newTimingData.Add(_timingData[index]); + newTimingData.AddRange(timingData); + } + + _timingData = newTimingData.ToArray(); + } + + /// <summary> + /// Creates a byte array representation of this IR Code. + /// </summary> + /// <param name="asPronto">Set this parameter true to convert the IR Code into Pronto format.</param> + /// <returns>Byte array representation.</returns> + public byte[] ToByteArray(bool asPronto) + { + StringBuilder output = new StringBuilder(); + + if (asPronto) + { + ushort[] prontoData = Pronto.ConvertIrCodeToProntoRaw(this); + + for (int index = 0; index < prontoData.Length; index++) + { + output.Append(prontoData[index].ToString("X4")); + if (index != prontoData.Length - 1) + output.Append(' '); + } + } + else // Native format (only benefit is a slightly more accurate Carrier Frequency) + { + output.Append("MCE,"); + output.AppendFormat("{0},", _carrier); + + for (int ... [truncated message content] |
From: <an...@us...> - 2008-02-07 10:08:36
|
Revision: 1342 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1342&view=rev Author: and-81 Date: 2008-02-07 02:08:33 -0800 (Thu, 07 Feb 2008) Log Message: ----------- Modified Paths: -------------- 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/FormMain.resx trunk/plugins/IR Server Suite/Applications/IR File Tool/IR File Tool.csproj trunk/plugins/IR Server Suite/Applications/IR File Tool/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/Commands/TestApp/Program.cs trunk/plugins/IR Server Suite/Common/ShellLink/ShellLink.csproj 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 2008-02-07 08:27:37 UTC (rev 1341) +++ trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.Designer.cs 2008-02-07 10:08:33 UTC (rev 1342) @@ -55,9 +55,12 @@ this.groupBoxCarrier = new System.Windows.Forms.GroupBox(); this.groupBoxTestBlast = new System.Windows.Forms.GroupBox(); this.comboBoxPort = new System.Windows.Forms.ComboBox(); + this.statusStrip = new System.Windows.Forms.StatusStrip(); + this.toolStripStatusLabelConnected = new System.Windows.Forms.ToolStripStatusLabel(); this.menuStrip.SuspendLayout(); this.groupBoxCarrier.SuspendLayout(); this.groupBoxTestBlast.SuspendLayout(); + this.statusStrip.SuspendLayout(); this.SuspendLayout(); // // menuStrip @@ -165,7 +168,7 @@ this.textBoxPronto.Multiline = true; this.textBoxPronto.Name = "textBoxPronto"; this.textBoxPronto.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; - this.textBoxPronto.Size = new System.Drawing.Size(312, 264); + this.textBoxPronto.Size = new System.Drawing.Size(312, 240); this.textBoxPronto.TabIndex = 1; // // buttonSetCarrier @@ -183,7 +186,7 @@ // checkBoxStoreBinary // this.checkBoxStoreBinary.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.checkBoxStoreBinary.Location = new System.Drawing.Point(336, 272); + this.checkBoxStoreBinary.Location = new System.Drawing.Point(336, 248); this.checkBoxStoreBinary.Name = "checkBoxStoreBinary"; this.checkBoxStoreBinary.Size = new System.Drawing.Size(160, 24); this.checkBoxStoreBinary.TabIndex = 6; @@ -208,7 +211,7 @@ this.buttonBlast.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.buttonBlast.Location = new System.Drawing.Point(112, 24); this.buttonBlast.Name = "buttonBlast"; - this.buttonBlast.Size = new System.Drawing.Size(51, 24); + this.buttonBlast.Size = new System.Drawing.Size(48, 24); this.buttonBlast.TabIndex = 1; this.buttonBlast.Text = "&Blast"; this.toolTips.SetToolTip(this.buttonBlast, "Blast the current IR command for testing"); @@ -217,6 +220,7 @@ // // buttonLearn // + this.buttonLearn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.buttonLearn.Enabled = false; this.buttonLearn.Location = new System.Drawing.Point(360, 168); this.buttonLearn.Name = "buttonLearn"; @@ -262,6 +266,7 @@ // // groupBoxTestBlast // + this.groupBoxTestBlast.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.groupBoxTestBlast.Controls.Add(this.buttonBlast); this.groupBoxTestBlast.Controls.Add(this.comboBoxPort); this.groupBoxTestBlast.Enabled = false; @@ -276,17 +281,38 @@ // this.comboBoxPort.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); + this.comboBoxPort.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxPort.FormattingEnabled = true; this.comboBoxPort.Location = new System.Drawing.Point(8, 24); this.comboBoxPort.Name = "comboBoxPort"; this.comboBoxPort.Size = new System.Drawing.Size(96, 21); this.comboBoxPort.TabIndex = 0; // + // statusStrip + // + this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripStatusLabelConnected}); + this.statusStrip.Location = new System.Drawing.Point(0, 283); + this.statusStrip.Name = "statusStrip"; + this.statusStrip.Size = new System.Drawing.Size(504, 22); + this.statusStrip.TabIndex = 7; + this.statusStrip.Text = "statusStrip"; + // + // toolStripStatusLabelConnected + // + this.toolStripStatusLabelConnected.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.toolStripStatusLabelConnected.Name = "toolStripStatusLabelConnected"; + this.toolStripStatusLabelConnected.Size = new System.Drawing.Size(489, 17); + this.toolStripStatusLabelConnected.Spring = true; + this.toolStripStatusLabelConnected.Text = "Not connected"; + this.toolStripStatusLabelConnected.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // // FormMain // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(504, 305); + this.Controls.Add(this.statusStrip); this.Controls.Add(this.buttonLearn); this.Controls.Add(this.groupBoxTestBlast); this.Controls.Add(this.groupBoxCarrier); @@ -304,6 +330,8 @@ this.groupBoxCarrier.ResumeLayout(false); this.groupBoxCarrier.PerformLayout(); this.groupBoxTestBlast.ResumeLayout(false); + this.statusStrip.ResumeLayout(false); + this.statusStrip.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -336,6 +364,8 @@ private System.Windows.Forms.Button buttonBlast; private System.Windows.Forms.ComboBox comboBoxPort; private System.Windows.Forms.Button buttonLearn; + private System.Windows.Forms.StatusStrip statusStrip; + private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabelConnected; } } Modified: trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.cs 2008-02-07 08:27:37 UTC (rev 1341) +++ trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.cs 2008-02-07 10:08:33 UTC (rev 1342) @@ -42,6 +42,7 @@ string _serverHost = String.Empty; + IRServerInfo _irServerInfo = new IRServerInfo(); #endregion Variables @@ -87,6 +88,10 @@ void Save() { + if (String.IsNullOrEmpty(_fileName)) + if (!GetSaveFileName()) + return; + if (!checkBoxStoreBinary.Checked) { Pronto.WriteProntoFile(_fileName, Pronto.ConvertIrCodeToProntoRaw(_code)); @@ -102,7 +107,19 @@ } } + bool GetSaveFileName() + { + if (String.IsNullOrEmpty(saveFileDialog.InitialDirectory)) + saveFileDialog.InitialDirectory = Common.FolderIRCommands; + if (saveFileDialog.ShowDialog(this) != DialogResult.OK) + return false; + + _fileName = saveFileDialog.FileName; + return true; + } + + void LoadSettings() { try @@ -143,8 +160,28 @@ } } + delegate void UpdateWindowDel(string status); + void UpdateWindow(string status) + { + toolStripStatusLabelConnected.Text = status; + comboBoxPort.Items.Clear(); + comboBoxPort.Items.AddRange(_irServerInfo.Ports); + comboBoxPort.SelectedIndex = 0; + if (_registered) + { + groupBoxTestBlast.Enabled = _irServerInfo.CanTransmit; + buttonLearn.Enabled = _irServerInfo.CanLearn; + } + else + { + groupBoxTestBlast.Enabled = false; + buttonLearn.Enabled = false; + } + } + + void CommsFailure(object obj) { Exception ex = obj as Exception; @@ -214,28 +251,76 @@ case MessageType.RegisterClient: if ((received.Flags & MessageFlags.Success) == MessageFlags.Success) { + _irServerInfo = IRServerInfo.FromBytes(received.GetDataAsBytes()); _registered = true; - groupBoxTestBlast.Enabled = true; - buttonLearn.Enabled = true; + string message = "Connected"; + IrssLog.Info(message); + this.Invoke(new UpdateWindowDel(UpdateWindow), new string[] { message }); } else if ((received.Flags & MessageFlags.Failure) == MessageFlags.Failure) { _registered = false; - groupBoxTestBlast.Enabled = false; - buttonLearn.Enabled = false; - - MessageBox.Show(this, "Failed to register with server", "IR File Tool Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + string message = "Failed to connect"; + IrssLog.Warn(message); + this.Invoke(new UpdateWindowDel(UpdateWindow), new string[] { message }); } return; + case MessageType.BlastIR: + if ((received.Flags & MessageFlags.Success) == MessageFlags.Success) + { + string message = "Blast successful"; + IrssLog.Info(message); + this.Invoke(new UpdateWindowDel(UpdateWindow), new string[] { message }); + } + else if ((received.Flags & MessageFlags.Failure) == MessageFlags.Failure) + { + string message = "Failed to blast IR command"; + IrssLog.Error(message); + this.Invoke(new UpdateWindowDel(UpdateWindow), new string[] { message }); + } + break; + + case MessageType.LearnIR: + if ((received.Flags & MessageFlags.Success) == MessageFlags.Success) + { + byte[] dataBytes = received.GetDataAsBytes(); + + _code = IrCode.FromByteArray(dataBytes); + + _fileName = null; + + string message = "Learned IR Successfully"; + IrssLog.Info(message); + this.Invoke(new UpdateWindowDel(UpdateWindow), new string[] { message }); + + RefreshForm(); + } + else if ((received.Flags & MessageFlags.Failure) == MessageFlags.Failure) + { + string message = "Failed to learn IR command"; + + IrssLog.Warn(message); + this.Invoke(new UpdateWindowDel(UpdateWindow), new string[] { message }); + } + else if ((received.Flags & MessageFlags.Timeout) == MessageFlags.Timeout) + { + string message = "Learn IR command timed-out"; + + IrssLog.Warn(message); + this.Invoke(new UpdateWindowDel(UpdateWindow), new string[] { message }); + } + break; + case MessageType.ServerShutdown: - MessageBox.Show(this, "Server has been shut down", "IR File Tool Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + _registered = false; + this.Invoke(new UpdateWindowDel(UpdateWindow), new string[] { "Server shut down" }); return; case MessageType.Error: - MessageBox.Show(this, received.GetDataAsString(), "IR File Tool Error from Server", MessageBoxButtons.OK, MessageBoxIcon.Error); + IrssLog.Error("Error from server: " + received.GetDataAsString()); return; } } @@ -247,28 +332,21 @@ } - - - - - - - private void newToolStripMenuItem_Click(object sender, EventArgs e) { _code = new IrCode(); - _fileName = "New File.IR"; + _fileName = null; RefreshForm(); } private void openToolStripMenuItem_Click(object sender, EventArgs e) { + if (String.IsNullOrEmpty(openFileDialog.InitialDirectory)) + openFileDialog.InitialDirectory = Common.FolderIRCommands; + if (openFileDialog.ShowDialog(this) != DialogResult.OK) return; - if (String.IsNullOrEmpty(openFileDialog.InitialDirectory)) - openFileDialog.InitialDirectory = Common.FolderIRCommands; - using (FileStream file = File.OpenRead(openFileDialog.FileName)) { if (file.Length == 0) @@ -294,15 +372,8 @@ } private void saveasToolStripMenuItem_Click(object sender, EventArgs e) { - if (String.IsNullOrEmpty(saveFileDialog.InitialDirectory)) - saveFileDialog.InitialDirectory = Common.FolderIRCommands; - - if (saveFileDialog.ShowDialog(this) != DialogResult.OK) - return; - - _fileName = saveFileDialog.FileName; - - Save(); + if (GetSaveFileName()) + Save(); } private void quitToolStripMenuItem_Click(object sender, EventArgs e) { @@ -362,32 +433,30 @@ void RemoteEvent(IrProtocol codeType, uint keyCode, bool firstPress) { - MessageBox.Show(this, String.Format("Remote: {0}, {1}", Enum.GetName(typeof(IrProtocol), codeType), keyCode), "Decode IR", MessageBoxButtons.OK, MessageBoxIcon.Information); - - if (textBoxCarrier.Text.Equals("Unknown", StringComparison.OrdinalIgnoreCase)) + if (DialogResult.Yes == MessageBox.Show(this, String.Format("Remote: {0}, {1}\nUse this protocol's carrier frequency?", Enum.GetName(typeof(IrProtocol), codeType), keyCode), "Decode IR", MessageBoxButtons.YesNo, MessageBoxIcon.Question)) { switch (codeType) { - case IrProtocol.Daewoo: textBoxCarrier.Text = "38000"; break; - case IrProtocol.JVC: textBoxCarrier.Text = "38000"; break; + case IrProtocol.Daewoo: textBoxCarrier.Text = "38000"; break; + case IrProtocol.JVC: textBoxCarrier.Text = "38000"; break; case IrProtocol.Matsushita: textBoxCarrier.Text = "56800"; break; case IrProtocol.Mitsubishi: textBoxCarrier.Text = "40000"; break; - case IrProtocol.NEC: textBoxCarrier.Text = "38000"; break; - case IrProtocol.NRC17: textBoxCarrier.Text = "38000"; break; - case IrProtocol.Panasonic: textBoxCarrier.Text = "38000"; break; - case IrProtocol.RC5: textBoxCarrier.Text = "36000"; break; - case IrProtocol.RC5X: textBoxCarrier.Text = "36000"; break; - case IrProtocol.RC6: textBoxCarrier.Text = "36000"; break; - case IrProtocol.RC6A: textBoxCarrier.Text = "36000"; break; - case IrProtocol.RC6_MCE: textBoxCarrier.Text = "36000"; break; + case IrProtocol.NEC: textBoxCarrier.Text = "38000"; break; + case IrProtocol.NRC17: textBoxCarrier.Text = "38000"; break; + case IrProtocol.Panasonic: textBoxCarrier.Text = "38000"; break; + case IrProtocol.RC5: textBoxCarrier.Text = "36000"; break; + case IrProtocol.RC5X: textBoxCarrier.Text = "36000"; break; + case IrProtocol.RC6: textBoxCarrier.Text = "36000"; break; + case IrProtocol.RC6A: textBoxCarrier.Text = "36000"; break; + case IrProtocol.RC6_MCE: textBoxCarrier.Text = "36000"; break; case IrProtocol.RC6_Foxtel: textBoxCarrier.Text = "36000"; break; - case IrProtocol.RCA: textBoxCarrier.Text = "56000"; break; - case IrProtocol.RCMM: textBoxCarrier.Text = "36000"; break; - case IrProtocol.RECS80: textBoxCarrier.Text = "38000"; break; - case IrProtocol.Sharp: textBoxCarrier.Text = "38000"; break; - case IrProtocol.SIRC: textBoxCarrier.Text = "40000"; break; - case IrProtocol.Toshiba: textBoxCarrier.Text = "38000"; break; - case IrProtocol.XSAT: textBoxCarrier.Text = "38000"; break; + case IrProtocol.RCA: textBoxCarrier.Text = "56000"; break; + case IrProtocol.RCMM: textBoxCarrier.Text = "36000"; break; + case IrProtocol.RECS80: textBoxCarrier.Text = "38000"; break; + case IrProtocol.Sharp: textBoxCarrier.Text = "38000"; break; + case IrProtocol.SIRC: textBoxCarrier.Text = "40000"; break; + case IrProtocol.Toshiba: textBoxCarrier.Text = "38000"; break; + case IrProtocol.XSAT: textBoxCarrier.Text = "38000"; break; default: return; @@ -422,6 +491,8 @@ private void connectToolStripMenuItem_Click(object sender, EventArgs e) { + this.Invoke(new UpdateWindowDel(UpdateWindow), new string[] { "Connecting ..." }); + IPAddress serverIP = Client.GetIPFromName(_serverHost); IPEndPoint endPoint = new IPEndPoint(serverIP, IrssComms.Server.DefaultPort); @@ -437,8 +508,7 @@ _registered = false; } - groupBoxTestBlast.Enabled = false; - buttonLearn.Enabled = false; + this.Invoke(new UpdateWindowDel(UpdateWindow), new string[] { "Disconnected" }); StopClient(); } @@ -454,15 +524,35 @@ private void buttonBlast_Click(object sender, EventArgs e) { + if (!_registered) + MessageBox.Show(this, "Not registered to an active Input Service", "Cannot blast", MessageBoxButtons.OK, MessageBoxIcon.Warning); + this.Invoke(new UpdateWindowDel(UpdateWindow), new string[] { "Blasting ..." }); + + string port = comboBoxPort.Text; + byte[] codeBytes = _code.ToByteArray(true); + + byte[] outData = new byte[4 + port.Length + codeBytes.Length]; + + BitConverter.GetBytes(port.Length).CopyTo(outData, 0); + Encoding.ASCII.GetBytes(port).CopyTo(outData, 4); + + Array.Copy(codeBytes, 0, outData, 4 + port.Length, codeBytes.Length); + + IrssMessage message = new IrssMessage(MessageType.BlastIR, MessageFlags.Request, outData); + _client.Send(message); } - private void buttonLearn_Click(object sender, EventArgs e) { + if (!_registered) + MessageBox.Show(this, "Not registered to an active Input Service", "Cannot learn", MessageBoxButtons.OK, MessageBoxIcon.Warning); + this.Invoke(new UpdateWindowDel(UpdateWindow), new string[] { "Learning ..." }); + + IrssMessage message = new IrssMessage(MessageType.LearnIR, MessageFlags.Request); + _client.Send(message); } - } } Modified: trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.resx =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.resx 2008-02-07 08:27:37 UTC (rev 1341) +++ trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.resx 2008-02-07 10:08:33 UTC (rev 1342) @@ -129,6 +129,9 @@ <metadata name="saveFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>333, 17</value> </metadata> + <metadata name="statusStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>455, 17</value> + </metadata> <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> 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 2008-02-07 08:27:37 UTC (rev 1341) +++ trunk/plugins/IR Server Suite/Applications/IR File Tool/IR File Tool.csproj 2008-02-07 10:08:33 UTC (rev 1342) @@ -24,6 +24,8 @@ <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <UseVSHostingProcess>false</UseVSHostingProcess> <DocumentationFile>bin\Debug\IRFileTool.xml</DocumentationFile> + <NoWarn> + </NoWarn> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>none</DebugType> 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 2008-02-07 08:27:37 UTC (rev 1341) +++ trunk/plugins/IR Server Suite/Applications/IR File Tool/Properties/AssemblyInfo.cs 2008-02-07 10:08:33 UTC (rev 1342) @@ -6,7 +6,7 @@ // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("IR File Tool")] -[assembly: AssemblyDescription("")] +[assembly: AssemblyDescription("For learning, modifying, testing, correcting and converting IR command files")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("and-81")] [assembly: AssemblyProduct("IR File Tool")] Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.Designer.cs 2008-02-07 08:27:37 UTC (rev 1341) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.Designer.cs 2008-02-07 10:08:33 UTC (rev 1342) @@ -155,6 +155,7 @@ this.pageUpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.scrollLockToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.tabToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.windowsKeyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.tabPageMouse = new System.Windows.Forms.TabPage(); this.groupBoxMouseScroll = new System.Windows.Forms.GroupBox(); this.checkBoxMouseScrollDown = new System.Windows.Forms.CheckBox(); @@ -177,7 +178,6 @@ this.buttonCancel = new System.Windows.Forms.Button(); this.buttonOK = new System.Windows.Forms.Button(); this.toolTips = new System.Windows.Forms.ToolTip(this.components); - this.windowsKeyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.groupBoxButton.SuspendLayout(); this.groupBoxSet.SuspendLayout(); this.tabControl.SuspendLayout(); @@ -284,10 +284,11 @@ | System.Windows.Forms.AnchorStyles.Right))); this.textBoxCommand.BackColor = System.Drawing.SystemColors.Info; this.textBoxCommand.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.textBoxCommand.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.textBoxCommand.Location = new System.Drawing.Point(64, 264); this.textBoxCommand.Name = "textBoxCommand"; this.textBoxCommand.ReadOnly = true; - this.textBoxCommand.Size = new System.Drawing.Size(336, 20); + this.textBoxCommand.Size = new System.Drawing.Size(336, 22); this.textBoxCommand.TabIndex = 2; // // buttonSet @@ -295,10 +296,10 @@ this.buttonSet.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.buttonSet.Location = new System.Drawing.Point(8, 264); this.buttonSet.Name = "buttonSet"; - this.buttonSet.Size = new System.Drawing.Size(48, 20); + this.buttonSet.Size = new System.Drawing.Size(48, 22); this.buttonSet.TabIndex = 1; this.buttonSet.Text = "Set"; - this.toolTips.SetToolTip(this.buttonSet, "Click here to set the command"); + this.toolTips.SetToolTip(this.buttonSet, "Click here to set the selected command"); this.buttonSet.UseVisualStyleBackColor = true; this.buttonSet.Click += new System.EventHandler(this.buttonSet_Click); // @@ -1019,52 +1020,52 @@ this.toolStripSeparator2, this.specialKeysToolStripMenuItem}); this.contextMenuStripKeystrokes.Name = "contextMenuStripKeystrokes"; - this.contextMenuStripKeystrokes.Size = new System.Drawing.Size(153, 170); + this.contextMenuStripKeystrokes.Size = new System.Drawing.Size(145, 148); // // cutToolStripMenuItem // this.cutToolStripMenuItem.Name = "cutToolStripMenuItem"; - this.cutToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.cutToolStripMenuItem.Size = new System.Drawing.Size(144, 22); this.cutToolStripMenuItem.Text = "Cut"; this.cutToolStripMenuItem.Click += new System.EventHandler(this.cutToolStripMenuItem_Click); // // copyToolStripMenuItem // this.copyToolStripMenuItem.Name = "copyToolStripMenuItem"; - this.copyToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.copyToolStripMenuItem.Size = new System.Drawing.Size(144, 22); this.copyToolStripMenuItem.Text = "Copy"; this.copyToolStripMenuItem.Click += new System.EventHandler(this.copyToolStripMenuItem_Click); // // pasteToolStripMenuItem // this.pasteToolStripMenuItem.Name = "pasteToolStripMenuItem"; - this.pasteToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.pasteToolStripMenuItem.Size = new System.Drawing.Size(144, 22); this.pasteToolStripMenuItem.Text = "Paste"; this.pasteToolStripMenuItem.Click += new System.EventHandler(this.pasteToolStripMenuItem_Click); // // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(149, 6); + this.toolStripSeparator1.Size = new System.Drawing.Size(141, 6); // // selectAllToolStripMenuItem // this.selectAllToolStripMenuItem.Name = "selectAllToolStripMenuItem"; - this.selectAllToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.selectAllToolStripMenuItem.Size = new System.Drawing.Size(144, 22); this.selectAllToolStripMenuItem.Text = "Select All"; this.selectAllToolStripMenuItem.Click += new System.EventHandler(this.selectAllToolStripMenuItem_Click); // // selectNoneToolStripMenuItem // this.selectNoneToolStripMenuItem.Name = "selectNoneToolStripMenuItem"; - this.selectNoneToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.selectNoneToolStripMenuItem.Size = new System.Drawing.Size(144, 22); this.selectNoneToolStripMenuItem.Text = "Select None"; this.selectNoneToolStripMenuItem.Click += new System.EventHandler(this.selectNoneToolStripMenuItem_Click); // // toolStripSeparator2 // this.toolStripSeparator2.Name = "toolStripSeparator2"; - this.toolStripSeparator2.Size = new System.Drawing.Size(149, 6); + this.toolStripSeparator2.Size = new System.Drawing.Size(141, 6); // // specialKeysToolStripMenuItem // @@ -1091,7 +1092,7 @@ this.tabToolStripMenuItem, this.windowsKeyToolStripMenuItem}); this.specialKeysToolStripMenuItem.Name = "specialKeysToolStripMenuItem"; - this.specialKeysToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.specialKeysToolStripMenuItem.Size = new System.Drawing.Size(144, 22); this.specialKeysToolStripMenuItem.Text = "Special Keys"; // // arrowsToolStripMenuItem @@ -1321,28 +1322,28 @@ // altToolStripMenuItem // this.altToolStripMenuItem.Name = "altToolStripMenuItem"; - this.altToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.altToolStripMenuItem.Size = new System.Drawing.Size(128, 22); this.altToolStripMenuItem.Text = "Alt"; this.altToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); // // controlToolStripMenuItem // this.controlToolStripMenuItem.Name = "controlToolStripMenuItem"; - this.controlToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.controlToolStripMenuItem.Size = new System.Drawing.Size(128, 22); this.controlToolStripMenuItem.Text = "Control"; this.controlToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); // // shiftToolStripMenuItem // this.shiftToolStripMenuItem.Name = "shiftToolStripMenuItem"; - this.shiftToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.shiftToolStripMenuItem.Size = new System.Drawing.Size(128, 22); this.shiftToolStripMenuItem.Text = "Shift"; this.shiftToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); // // windowsToolStripMenuItem // this.windowsToolStripMenuItem.Name = "windowsToolStripMenuItem"; - this.windowsToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.windowsToolStripMenuItem.Size = new System.Drawing.Size(128, 22); this.windowsToolStripMenuItem.Text = "Windows"; this.windowsToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); // @@ -1456,6 +1457,13 @@ this.tabToolStripMenuItem.Text = "Tab"; this.tabToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); // + // windowsKeyToolStripMenuItem + // + this.windowsKeyToolStripMenuItem.Name = "windowsKeyToolStripMenuItem"; + this.windowsKeyToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.windowsKeyToolStripMenuItem.Text = "Windows Key"; + this.windowsKeyToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); + // // tabPageMouse // this.tabPageMouse.Controls.Add(this.groupBoxMouseScroll); @@ -1691,7 +1699,7 @@ this.buttonTest.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonTest.Location = new System.Drawing.Point(408, 264); this.buttonTest.Name = "buttonTest"; - this.buttonTest.Size = new System.Drawing.Size(48, 20); + this.buttonTest.Size = new System.Drawing.Size(48, 22); this.buttonTest.TabIndex = 3; this.buttonTest.Text = "Test"; this.toolTips.SetToolTip(this.buttonTest, "Click here to test the currently set command"); @@ -1721,13 +1729,6 @@ this.buttonOK.UseVisualStyleBackColor = true; this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); // - // windowsKeyToolStripMenuItem - // - this.windowsKeyToolStripMenuItem.Name = "windowsKeyToolStripMenuItem"; - this.windowsKeyToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.windowsKeyToolStripMenuItem.Text = "Windows Key"; - this.windowsKeyToolStripMenuItem.Click += new System.EventHandler(this.KeystrokeToolStripMenuItem_Click); - // // ButtonMappingForm // this.AcceptButton = this.buttonOK; Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs 2008-02-07 08:27:37 UTC (rev 1341) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs 2008-02-07 10:08:33 UTC (rev 1342) @@ -319,12 +319,20 @@ private void buttonOK_Click(object sender, EventArgs e) { - if (String.IsNullOrEmpty(_keyCode) || String.IsNullOrEmpty(_command)) + if (String.IsNullOrEmpty(_keyCode)) { - MessageBox.Show(this, "You must set a valid button mapping to press OK", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show(this, "You must provide a valid button key code to create a button mapping", "KeyCode Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + textBoxKeyCode.Focus(); return; } + if (String.IsNullOrEmpty(_command)) + { + MessageBox.Show(this, "You must click SET to confirm the command you want to assign to this button mapping", "Command Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + buttonSet.Focus(); + return; + } + this.DialogResult = DialogResult.OK; this.Close(); } Modified: trunk/plugins/IR Server Suite/Commands/TestApp/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Commands/TestApp/Program.cs 2008-02-07 08:27:37 UTC (rev 1341) +++ trunk/plugins/IR Server Suite/Commands/TestApp/Program.cs 2008-02-07 10:08:33 UTC (rev 1342) @@ -33,20 +33,34 @@ Processor.CategorySpecial }; - EditMacro edit1 = new EditMacro( - commandProcessor, - @"C:\Documents and Settings\All Users.WINDOWS\Application Data\IR Server Suite\MP Blast Zone Plugin\Macro\", - categories); + try + { + EditMacro edit1 = new EditMacro( + commandProcessor, + @"C:\Documents and Settings\All Users.WINDOWS\Application Data\IR Server Suite\MP Blast Zone Plugin\Macro\", + categories); - edit1.ShowDialog(); + edit1.ShowDialog(); + } + catch (Exception ex) + { + MessageBox.Show(ex.ToString()); + } - EditMacro edit2 = new EditMacro( - commandProcessor, - @"C:\Documents and Settings\All Users.WINDOWS\Application Data\IR Server Suite\MP Blast Zone Plugin\Macro\", - categories, - @"C:\Documents and Settings\All Users.WINDOWS\Application Data\IR Server Suite\MP Blast Zone Plugin\Macro\Toggle Example.Macro"); + try + { + EditMacro edit2 = new EditMacro( + commandProcessor, + @"C:\Documents and Settings\All Users.WINDOWS\Application Data\IR Server Suite\MP Blast Zone Plugin\Macro\", + categories, + @"C:\Documents and Settings\All Users.WINDOWS\Application Data\IR Server Suite\MP Blast Zone Plugin\Macro\Toggle Example.Macro"); - edit2.ShowDialog(); + edit2.ShowDialog(); + } + catch (Exception ex) + { + MessageBox.Show(ex.ToString()); + } } Modified: trunk/plugins/IR Server Suite/Common/ShellLink/ShellLink.csproj =================================================================== --- trunk/plugins/IR Server Suite/Common/ShellLink/ShellLink.csproj 2008-02-07 08:27:37 UTC (rev 1341) +++ trunk/plugins/IR Server Suite/Common/ShellLink/ShellLink.csproj 2008-02-07 10:08:33 UTC (rev 1342) @@ -41,11 +41,12 @@ <Optimize>false</Optimize> <RegisterForComInterop>false</RegisterForComInterop> <RemoveIntegerChecks>false</RemoveIntegerChecks> - <TreatWarningsAsErrors>false</TreatWarningsAsErrors> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <WarningLevel>4</WarningLevel> <DebugType>full</DebugType> <ErrorReport>prompt</ErrorReport> <UseVSHostingProcess>false</UseVSHostingProcess> + <NoWarn>0618</NoWarn> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <OutputPath>bin\Release\</OutputPath> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2008-02-09 16:10:26
|
Revision: 1353 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1353&view=rev Author: and-81 Date: 2008-02-09 08:10:18 -0800 (Sat, 09 Feb 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Documentation/new.html trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/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.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs trunk/plugins/IR Server Suite/IR Server Suite.sln Modified: trunk/plugins/IR Server Suite/Documentation/new.html =================================================================== --- trunk/plugins/IR Server Suite/Documentation/new.html 2008-02-09 14:42:42 UTC (rev 1352) +++ trunk/plugins/IR Server Suite/Documentation/new.html 2008-02-09 16:10:18 UTC (rev 1353) @@ -5,9 +5,14 @@ <H2>What's new?<BR><HR COLOR="RED"></H2> <!-- -<LI>Macros: Major overhaul of macro and command structures (WARNING: This breaks compatibility with older macro files).</LI> -<LI>Macros: Variable assignment, a data stack and conditional execution of macros is now available. See documentation for more info.</LI> +<P>Version 1.0.5.0 +<UL> +<LI>Macros: Major overhaul of macro and command structures (WARNING: This breaks compatibility with existing macro files).</LI> +<LI>Macros: Variable assignment, a data stack and conditional execution statements in macros is now available. See documentation for more info.</LI> <LI>Macros: Stack tracing macro execution for loop detection has been removed now that legitimate recursion is provided for through variables and conditional statements.</LI> +<LI>New Command: Send WakeOnLan.</LI> +</UL></P> +<BR> --> <P>Version 1.0.4.2 @@ -27,6 +32,7 @@ <LI>MediaPortal plugins: New macro commands (Send MP Action and Send MP Message).</LI> <LI>Translator: Can create a shortcut on the users desktop to launch a macro.</LI> <LI>Documentation: New documentation areas (Troubleshooting FAQ) and improvements.</LI> +<LI>MCE Remote Receiver: Can now set remote and keyboard repeat rates to mimic system keyboard repeat rate settings.</LI> </UL></P> <BR> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Properties/AssemblyInfo.cs 2008-02-09 14:42:42 UTC (rev 1352) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Properties/AssemblyInfo.cs 2008-02-09 16:10:18 UTC (rev 1353) @@ -20,6 +20,9 @@ // 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: GuidAttribute("A03753AF-FBBF-44e0-9964-144C48A4D2CF")] + // Version information for an assembly consists of the following four values: // // Major Version @@ -33,4 +36,3 @@ [assembly: AssemblyFileVersion("1.0.4.2")] [assembly: CLSCompliant(true)] -[assembly: GuidAttribute("A03753AF-FBBF-44e0-9964-144C48A4D2CF")] 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 2008-02-09 14:42:42 UTC (rev 1352) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.Designer.cs 2008-02-09 16:10:18 UTC (rev 1353) @@ -35,7 +35,7 @@ this.numericUpDownButtonHeldDelay = new System.Windows.Forms.NumericUpDown(); this.buttonOK = new System.Windows.Forms.Button(); this.buttonCancel = new System.Windows.Forms.Button(); - this.groupBoxTimes = new System.Windows.Forms.GroupBox(); + this.groupBoxRemoteTiming = new System.Windows.Forms.GroupBox(); this.toolTips = new System.Windows.Forms.ToolTip(this.components); this.numericUpDownLearnTimeout = new System.Windows.Forms.NumericUpDown(); this.numericUpDownKeyHeldDelay = new System.Windows.Forms.NumericUpDown(); @@ -57,9 +57,11 @@ this.tabPageMouse = new System.Windows.Forms.TabPage(); this.labelMouseSensitivity = new System.Windows.Forms.Label(); this.checkBoxEnableMouse = new System.Windows.Forms.CheckBox(); + this.checkBoxUseSystemRatesRemote = new System.Windows.Forms.CheckBox(); + this.checkBoxUseSystemRatesKeyboard = new System.Windows.Forms.CheckBox(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownButtonRepeatDelay)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownButtonHeldDelay)).BeginInit(); - this.groupBoxTimes.SuspendLayout(); + this.groupBoxRemoteTiming.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownLearnTimeout)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownKeyHeldDelay)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownKeyRepeatDelay)).BeginInit(); @@ -77,7 +79,7 @@ this.labelButtonRepeatDelay.Location = new System.Drawing.Point(8, 24); this.labelButtonRepeatDelay.Name = "labelButtonRepeatDelay"; this.labelButtonRepeatDelay.Size = new System.Drawing.Size(128, 20); - this.labelButtonRepeatDelay.TabIndex = 0; + this.labelButtonRepeatDelay.TabIndex = 1; this.labelButtonRepeatDelay.Text = "Button repeat delay:"; this.labelButtonRepeatDelay.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // @@ -86,7 +88,7 @@ this.labelButtonHeldDelay.Location = new System.Drawing.Point(8, 56); this.labelButtonHeldDelay.Name = "labelButtonHeldDelay"; this.labelButtonHeldDelay.Size = new System.Drawing.Size(128, 20); - this.labelButtonHeldDelay.TabIndex = 2; + this.labelButtonHeldDelay.TabIndex = 3; this.labelButtonHeldDelay.Text = "Button held delay:"; this.labelButtonHeldDelay.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // @@ -105,7 +107,7 @@ 0}); this.numericUpDownButtonRepeatDelay.Name = "numericUpDownButtonRepeatDelay"; this.numericUpDownButtonRepeatDelay.Size = new System.Drawing.Size(80, 20); - this.numericUpDownButtonRepeatDelay.TabIndex = 1; + this.numericUpDownButtonRepeatDelay.TabIndex = 2; this.numericUpDownButtonRepeatDelay.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.numericUpDownButtonRepeatDelay.ThousandsSeparator = true; this.toolTips.SetToolTip(this.numericUpDownButtonRepeatDelay, "When the button is held this is the time between the first press and the first re" + @@ -131,7 +133,7 @@ 0}); this.numericUpDownButtonHeldDelay.Name = "numericUpDownButtonHeldDelay"; this.numericUpDownButtonHeldDelay.Size = new System.Drawing.Size(80, 20); - this.numericUpDownButtonHeldDelay.TabIndex = 3; + this.numericUpDownButtonHeldDelay.TabIndex = 4; this.numericUpDownButtonHeldDelay.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.numericUpDownButtonHeldDelay.ThousandsSeparator = true; this.toolTips.SetToolTip(this.numericUpDownButtonHeldDelay, "When the button is held this is the time between repeats"); @@ -143,7 +145,7 @@ // // buttonOK // - this.buttonOK.Location = new System.Drawing.Point(128, 208); + this.buttonOK.Location = new System.Drawing.Point(128, 240); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(64, 24); this.buttonOK.TabIndex = 1; @@ -154,7 +156,7 @@ // buttonCancel // this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.buttonCancel.Location = new System.Drawing.Point(200, 208); + this.buttonCancel.Location = new System.Drawing.Point(200, 240); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(64, 24); this.buttonCancel.TabIndex = 2; @@ -162,18 +164,18 @@ this.buttonCancel.UseVisualStyleBackColor = true; this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); // - // groupBoxTimes + // groupBoxRemoteTiming // - this.groupBoxTimes.Controls.Add(this.labelButtonRepeatDelay); - this.groupBoxTimes.Controls.Add(this.numericUpDownButtonHeldDelay); - this.groupBoxTimes.Controls.Add(this.labelButtonHeldDelay); - this.groupBoxTimes.Controls.Add(this.numericUpDownButtonRepeatDelay); - this.groupBoxTimes.Location = new System.Drawing.Point(8, 40); - this.groupBoxTimes.Name = "groupBoxTimes"; - this.groupBoxTimes.Size = new System.Drawing.Size(232, 88); - this.groupBoxTimes.TabIndex = 1; - this.groupBoxTimes.TabStop = false; - this.groupBoxTimes.Text = "Remote button timing (in milliseconds)"; + this.groupBoxRemoteTiming.Controls.Add(this.labelButtonRepeatDelay); + this.groupBoxRemoteTiming.Controls.Add(this.numericUpDownButtonHeldDelay); + this.groupBoxRemoteTiming.Controls.Add(this.labelButtonHeldDelay); + this.groupBoxRemoteTiming.Controls.Add(this.numericUpDownButtonRepeatDelay); + this.groupBoxRemoteTiming.Location = new System.Drawing.Point(8, 72); + this.groupBoxRemoteTiming.Name = "groupBoxRemoteTiming"; + this.groupBoxRemoteTiming.Size = new System.Drawing.Size(232, 88); + this.groupBoxRemoteTiming.TabIndex = 1; + this.groupBoxRemoteTiming.TabStop = false; + this.groupBoxRemoteTiming.Text = "Remote button timing (in milliseconds)"; // // numericUpDownLearnTimeout // @@ -182,7 +184,7 @@ 0, 0, 0}); - this.numericUpDownLearnTimeout.Location = new System.Drawing.Point(152, 64); + this.numericUpDownLearnTimeout.Location = new System.Drawing.Point(152, 72); this.numericUpDownLearnTimeout.Maximum = new decimal(new int[] { 60000, 0, @@ -220,7 +222,7 @@ 0}); this.numericUpDownKeyHeldDelay.Name = "numericUpDownKeyHeldDelay"; this.numericUpDownKeyHeldDelay.Size = new System.Drawing.Size(80, 20); - this.numericUpDownKeyHeldDelay.TabIndex = 3; + this.numericUpDownKeyHeldDelay.TabIndex = 4; this.numericUpDownKeyHeldDelay.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.numericUpDownKeyHeldDelay.ThousandsSeparator = true; this.toolTips.SetToolTip(this.numericUpDownKeyHeldDelay, "When a key is held this is the time between repeats"); @@ -245,7 +247,7 @@ 0}); this.numericUpDownKeyRepeatDelay.Name = "numericUpDownKeyRepeatDelay"; this.numericUpDownKeyRepeatDelay.Size = new System.Drawing.Size(80, 20); - this.numericUpDownKeyRepeatDelay.TabIndex = 1; + this.numericUpDownKeyRepeatDelay.TabIndex = 2; this.numericUpDownKeyRepeatDelay.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.numericUpDownKeyRepeatDelay.ThousandsSeparator = true; this.toolTips.SetToolTip(this.numericUpDownKeyRepeatDelay, "When a key is held this is the time between the first press and the first repeat"); @@ -260,12 +262,12 @@ this.checkBoxHandleKeyboardLocal.AutoSize = true; this.checkBoxHandleKeyboardLocal.Checked = true; this.checkBoxHandleKeyboardLocal.CheckState = System.Windows.Forms.CheckState.Checked; - this.checkBoxHandleKeyboardLocal.Location = new System.Drawing.Point(8, 136); + this.checkBoxHandleKeyboardLocal.Location = new System.Drawing.Point(8, 168); this.checkBoxHandleKeyboardLocal.Name = "checkBoxHandleKeyboardLocal"; this.checkBoxHandleKeyboardLocal.Size = new System.Drawing.Size(139, 17); this.checkBoxHandleKeyboardLocal.TabIndex = 2; this.checkBoxHandleKeyboardLocal.Text = "Handle keyboard locally"; - this.toolTips.SetToolTip(this.checkBoxHandleKeyboardLocal, "Act on key presses locally (on the machine IR Server is running on)"); + this.toolTips.SetToolTip(this.checkBoxHandleKeyboardLocal, "Act on key presses locally (on the machine Input Servie is running on)"); this.checkBoxHandleKeyboardLocal.UseVisualStyleBackColor = true; // // checkBoxHandleMouseLocal @@ -278,7 +280,7 @@ this.checkBoxHandleMouseLocal.Size = new System.Drawing.Size(126, 17); this.checkBoxHandleMouseLocal.TabIndex = 1; this.checkBoxHandleMouseLocal.Text = "Handle mouse locally"; - this.toolTips.SetToolTip(this.checkBoxHandleMouseLocal, "Act on mouse locally (on the machine IR Server is running on)"); + this.toolTips.SetToolTip(this.checkBoxHandleMouseLocal, "Act on mouse locally (on the machine Input Service is running on)"); this.checkBoxHandleMouseLocal.UseVisualStyleBackColor = true; // // numericUpDownMouseSensitivity @@ -316,7 +318,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, 96); + this.checkBoxDisableMCEServices.Location = new System.Drawing.Point(8, 104); this.checkBoxDisableMCEServices.Name = "checkBoxDisableMCEServices"; this.checkBoxDisableMCEServices.Size = new System.Drawing.Size(216, 17); this.checkBoxDisableMCEServices.TabIndex = 2; @@ -327,7 +329,7 @@ // // labelLearnIRTimeout // - this.labelLearnIRTimeout.Location = new System.Drawing.Point(8, 64); + this.labelLearnIRTimeout.Location = new System.Drawing.Point(8, 72); this.labelLearnIRTimeout.Name = "labelLearnIRTimeout"; this.labelLearnIRTimeout.Size = new System.Drawing.Size(136, 20); this.labelLearnIRTimeout.TabIndex = 0; @@ -343,7 +345,7 @@ this.tabControl.Location = new System.Drawing.Point(8, 8); this.tabControl.Name = "tabControl"; this.tabControl.SelectedIndex = 0; - this.tabControl.Size = new System.Drawing.Size(256, 192); + this.tabControl.Size = new System.Drawing.Size(256, 224); this.tabControl.TabIndex = 0; // // tabPageBasic @@ -354,19 +356,20 @@ this.tabPageBasic.Location = new System.Drawing.Point(4, 22); this.tabPageBasic.Name = "tabPageBasic"; this.tabPageBasic.Padding = new System.Windows.Forms.Padding(3); - this.tabPageBasic.Size = new System.Drawing.Size(248, 166); + this.tabPageBasic.Size = new System.Drawing.Size(248, 198); this.tabPageBasic.TabIndex = 0; this.tabPageBasic.Text = "Basic"; this.tabPageBasic.UseVisualStyleBackColor = true; // // tabPageRemote // + this.tabPageRemote.Controls.Add(this.checkBoxUseSystemRatesRemote); this.tabPageRemote.Controls.Add(this.checkBoxEnableRemote); - this.tabPageRemote.Controls.Add(this.groupBoxTimes); + this.tabPageRemote.Controls.Add(this.groupBoxRemoteTiming); this.tabPageRemote.Location = new System.Drawing.Point(4, 22); this.tabPageRemote.Name = "tabPageRemote"; this.tabPageRemote.Padding = new System.Windows.Forms.Padding(3); - this.tabPageRemote.Size = new System.Drawing.Size(248, 166); + this.tabPageRemote.Size = new System.Drawing.Size(248, 198); this.tabPageRemote.TabIndex = 1; this.tabPageRemote.Text = "Remote"; this.tabPageRemote.UseVisualStyleBackColor = true; @@ -381,17 +384,19 @@ this.checkBoxEnableRemote.Size = new System.Drawing.Size(155, 17); this.checkBoxEnableRemote.TabIndex = 0; this.checkBoxEnableRemote.Text = "Enable remote control input"; + this.toolTips.SetToolTip(this.checkBoxEnableRemote, "Decode remote control button presses"); this.checkBoxEnableRemote.UseVisualStyleBackColor = true; // // tabPageKeyboard // + this.tabPageKeyboard.Controls.Add(this.checkBoxUseSystemRatesKeyboard); this.tabPageKeyboard.Controls.Add(this.checkBoxHandleKeyboardLocal); this.tabPageKeyboard.Controls.Add(this.checkBoxEnableKeyboard); this.tabPageKeyboard.Controls.Add(this.groupBoxKeypressTiming); this.tabPageKeyboard.Location = new System.Drawing.Point(4, 22); this.tabPageKeyboard.Name = "tabPageKeyboard"; this.tabPageKeyboard.Padding = new System.Windows.Forms.Padding(3); - this.tabPageKeyboard.Size = new System.Drawing.Size(248, 166); + this.tabPageKeyboard.Size = new System.Drawing.Size(248, 198); this.tabPageKeyboard.TabIndex = 2; this.tabPageKeyboard.Text = "Keyboard"; this.tabPageKeyboard.UseVisualStyleBackColor = true; @@ -406,6 +411,7 @@ this.checkBoxEnableKeyboard.Size = new System.Drawing.Size(132, 17); this.checkBoxEnableKeyboard.TabIndex = 0; this.checkBoxEnableKeyboard.Text = "Enable keyboard input"; + this.toolTips.SetToolTip(this.checkBoxEnableKeyboard, "Decode remote keyboard input"); this.checkBoxEnableKeyboard.UseVisualStyleBackColor = true; // // groupBoxKeypressTiming @@ -414,7 +420,7 @@ this.groupBoxKeypressTiming.Controls.Add(this.numericUpDownKeyHeldDelay); this.groupBoxKeypressTiming.Controls.Add(this.labelKeyHeldDelay); this.groupBoxKeypressTiming.Controls.Add(this.numericUpDownKeyRepeatDelay); - this.groupBoxKeypressTiming.Location = new System.Drawing.Point(8, 40); + this.groupBoxKeypressTiming.Location = new System.Drawing.Point(8, 72); this.groupBoxKeypressTiming.Name = "groupBoxKeypressTiming"; this.groupBoxKeypressTiming.Size = new System.Drawing.Size(232, 88); this.groupBoxKeypressTiming.TabIndex = 1; @@ -426,7 +432,7 @@ this.labelKeyRepeatDelay.Location = new System.Drawing.Point(8, 24); this.labelKeyRepeatDelay.Name = "labelKeyRepeatDelay"; this.labelKeyRepeatDelay.Size = new System.Drawing.Size(128, 20); - this.labelKeyRepeatDelay.TabIndex = 0; + this.labelKeyRepeatDelay.TabIndex = 1; this.labelKeyRepeatDelay.Text = "Key repeat delay:"; this.labelKeyRepeatDelay.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // @@ -435,7 +441,7 @@ this.labelKeyHeldDelay.Location = new System.Drawing.Point(8, 56); this.labelKeyHeldDelay.Name = "labelKeyHeldDelay"; this.labelKeyHeldDelay.Size = new System.Drawing.Size(128, 20); - this.labelKeyHeldDelay.TabIndex = 2; + this.labelKeyHeldDelay.TabIndex = 3; this.labelKeyHeldDelay.Text = "Key held delay:"; this.labelKeyHeldDelay.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // @@ -448,7 +454,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(248, 166); + this.tabPageMouse.Size = new System.Drawing.Size(248, 198); this.tabPageMouse.TabIndex = 3; this.tabPageMouse.Text = "Mouse"; this.tabPageMouse.UseVisualStyleBackColor = true; @@ -472,27 +478,56 @@ this.checkBoxEnableMouse.Size = new System.Drawing.Size(119, 17); this.checkBoxEnableMouse.TabIndex = 0; this.checkBoxEnableMouse.Text = "Enable mouse input"; + this.toolTips.SetToolTip(this.checkBoxEnableMouse, "Decode remote mouse input"); this.checkBoxEnableMouse.UseVisualStyleBackColor = true; // + // checkBoxUseSystemRatesRemote + // + this.checkBoxUseSystemRatesRemote.AutoSize = true; + this.checkBoxUseSystemRatesRemote.Checked = true; + this.checkBoxUseSystemRatesRemote.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkBoxUseSystemRatesRemote.Location = new System.Drawing.Point(8, 40); + this.checkBoxUseSystemRatesRemote.Name = "checkBoxUseSystemRatesRemote"; + this.checkBoxUseSystemRatesRemote.Size = new System.Drawing.Size(187, 17); + this.checkBoxUseSystemRatesRemote.TabIndex = 0; + this.checkBoxUseSystemRatesRemote.Text = "Use system keyboard rate settings"; + this.toolTips.SetToolTip(this.checkBoxUseSystemRatesRemote, "Use the system keyboard repeat rate settings for remote button timing"); + this.checkBoxUseSystemRatesRemote.UseVisualStyleBackColor = true; + this.checkBoxUseSystemRatesRemote.CheckedChanged += new System.EventHandler(this.checkBoxUseSystemRatesRemote_CheckedChanged); + // + // checkBoxUseSystemRatesKeyboard + // + this.checkBoxUseSystemRatesKeyboard.AutoSize = true; + this.checkBoxUseSystemRatesKeyboard.Checked = true; + this.checkBoxUseSystemRatesKeyboard.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkBoxUseSystemRatesKeyboard.Location = new System.Drawing.Point(8, 40); + this.checkBoxUseSystemRatesKeyboard.Name = "checkBoxUseSystemRatesKeyboard"; + this.checkBoxUseSystemRatesKeyboard.Size = new System.Drawing.Size(187, 17); + this.checkBoxUseSystemRatesKeyboard.TabIndex = 0; + this.checkBoxUseSystemRatesKeyboard.Text = "Use system keyboard rate settings"; + this.toolTips.SetToolTip(this.checkBoxUseSystemRatesKeyboard, "Use the system keyboard repeat rate settings for remote keyboard repeat rates"); + this.checkBoxUseSystemRatesKeyboard.UseVisualStyleBackColor = true; + this.checkBoxUseSystemRatesKeyboard.CheckedChanged += new System.EventHandler(this.checkBoxUseSystemRatesKeyboard_CheckedChanged); + // // Configure // 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(272, 241); + this.ClientSize = new System.Drawing.Size(272, 273); this.ControlBox = false; this.Controls.Add(this.tabControl); this.Controls.Add(this.buttonCancel); this.Controls.Add(this.buttonOK); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MinimumSize = new System.Drawing.Size(278, 266); + this.MinimumSize = new System.Drawing.Size(278, 298); this.Name = "Configure"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Microsoft MCE Configuration"; ((System.ComponentModel.ISupportInitialize)(this.numericUpDownButtonRepeatDelay)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownButtonHeldDelay)).EndInit(); - this.groupBoxTimes.ResumeLayout(false); + this.groupBoxRemoteTiming.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownLearnTimeout)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownKeyHeldDelay)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownKeyRepeatDelay)).EndInit(); @@ -519,7 +554,7 @@ private System.Windows.Forms.NumericUpDown numericUpDownButtonHeldDelay; private System.Windows.Forms.Button buttonOK; private System.Windows.Forms.Button buttonCancel; - private System.Windows.Forms.GroupBox groupBoxTimes; + private System.Windows.Forms.GroupBox groupBoxRemoteTiming; private System.Windows.Forms.ToolTip toolTips; private System.Windows.Forms.Label labelLearnIRTimeout; private System.Windows.Forms.NumericUpDown numericUpDownLearnTimeout; @@ -541,5 +576,7 @@ private System.Windows.Forms.CheckBox checkBoxHandleMouseLocal; private System.Windows.Forms.CheckBox checkBoxEnableMouse; private System.Windows.Forms.CheckBox checkBoxDisableMCEServices; + private System.Windows.Forms.CheckBox checkBoxUseSystemRatesRemote; + private System.Windows.Forms.CheckBox checkBoxUseSystemRatesKeyboard; } } \ 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 2008-02-09 14:42:42 UTC (rev 1352) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.cs 2008-02-09 16:10:18 UTC (rev 1353) @@ -29,6 +29,11 @@ get { return checkBoxEnableRemote.Checked; } set { checkBoxEnableRemote.Checked = value; } } + public bool UseSystemRatesForRemote + { + get { return checkBoxUseSystemRatesRemote.Checked; } + set { checkBoxUseSystemRatesRemote.Checked = value; } + } public int RemoteRepeatDelay { get { return Decimal.ToInt32(numericUpDownButtonRepeatDelay.Value); } @@ -45,6 +50,11 @@ get { return checkBoxEnableKeyboard.Checked; } set { checkBoxEnableKeyboard.Checked = value; } } + public bool UseSystemRatesForKeyboard + { + get { return checkBoxUseSystemRatesKeyboard.Checked; } + set { checkBoxUseSystemRatesKeyboard.Checked = value; } + } public int KeyboardRepeatDelay { get { return Decimal.ToInt32(numericUpDownKeyRepeatDelay.Value); } @@ -103,6 +113,15 @@ #endregion Buttons + private void checkBoxUseSystemRatesRemote_CheckedChanged(object sender, EventArgs e) + { + groupBoxRemoteTiming.Enabled = !checkBoxUseSystemRatesRemote.Checked; + } + private void checkBoxUseSystemRatesKeyboard_CheckedChanged(object sender, EventArgs e) + { + groupBoxKeypressTiming.Enabled = !checkBoxUseSystemRatesKeyboard.Checked; + } + } } 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 2008-02-09 14:42:42 UTC (rev 1352) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs 2008-02-09 16:10:18 UTC (rev 1353) @@ -71,25 +71,27 @@ #region Configuration - int _learnTimeout = 10000; - bool _disableMceServices = true; + int _learnTimeout = 10000; + bool _disableMceServices = true; - bool _enableRemoteInput = true; - int _remoteFirstRepeat = 400; - int _remoteHeldRepeats = 250; + bool _enableRemoteInput = true; + bool _useSystemRatesRemote = false; + int _remoteFirstRepeat = 400; + int _remoteHeldRepeats = 250; - bool _enableKeyboardInput = false; - int _keyboardFirstRepeat = 350; - int _keyboardHeldRepeats = 0; - bool _handleKeyboardLocally = true; + bool _enableKeyboardInput = false; + bool _useSystemRatesKeyboard = true; + int _keyboardFirstRepeat = 350; + int _keyboardHeldRepeats = 0; + bool _handleKeyboardLocally = true; - bool _enableMouseInput = false; - bool _handleMouseLocally = true; - double _mouseSensitivity = 1.0d; + bool _enableMouseInput = false; + bool _handleMouseLocally = true; + double _mouseSensitivity = 1.0d; // Hidden options ... - bool _storeAsPronto = true; - bool _forceVistaDriver = false; + bool _storeAsPronto = true; + bool _forceVistaDriver = false; #endregion Configuration @@ -384,10 +386,12 @@ try { _disableMceServices = bool.Parse(doc.DocumentElement.Attributes["DisableMceServices"].Value); } catch {} try { _enableRemoteInput = bool.Parse(doc.DocumentElement.Attributes["EnableRemoteInput"].Value); } catch {} + try { _useSystemRatesRemote = bool.Parse(doc.DocumentElement.Attributes["UseSystemRatesRemote"].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 { _useSystemRatesKeyboard = bool.Parse(doc.DocumentElement.Attributes["UseSystemRatesKeyboard"].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 {} @@ -399,6 +403,8 @@ // Hidden options ... try { _storeAsPronto = bool.Parse(doc.DocumentElement.Attributes["StoreAsPronto"].Value); } catch {} try { _forceVistaDriver = bool.Parse(doc.DocumentElement.Attributes["ForceVistaDriver"].Value); } catch {} + + } void SaveSettings() { @@ -416,10 +422,12 @@ writer.WriteAttributeString("DisableMceServices", _disableMceServices.ToString()); writer.WriteAttributeString("EnableRemoteInput", _enableRemoteInput.ToString()); + writer.WriteAttributeString("UseSystemRatesRemote", _useSystemRatesRemote.ToString()); writer.WriteAttributeString("RemoteFirstRepeat", _remoteFirstRepeat.ToString()); writer.WriteAttributeString("RemoteHeldRepeats", _remoteHeldRepeats.ToString()); writer.WriteAttributeString("EnableKeyboardInput", _enableKeyboardInput.ToString()); + writer.WriteAttributeString("UseSystemRatesKeyboard", _useSystemRatesKeyboard.ToString()); writer.WriteAttributeString("KeyboardFirstRepeat", _keyboardFirstRepeat.ToString()); writer.WriteAttributeString("KeyboardHeldRepeats", _keyboardHeldRepeats.ToString()); writer.WriteAttributeString("HandleKeyboardLocally", _handleKeyboardLocally.ToString()); @@ -564,15 +572,23 @@ { TimeSpan timeBetween = DateTime.Now.Subtract(_lastRemoteButtonTime); - if (!_remoteButtonRepeated && timeBetween.TotalMilliseconds < _remoteFirstRepeat) + int firstRepeat = _remoteFirstRepeat; + int heldRepeats = _remoteHeldRepeats; + if (_useSystemRatesRemote) { + firstRepeat = SystemInformation.KeyboardDelay; + heldRepeats = SystemInformation.KeyboardSpeed; + } + + if (!_remoteButtonRepeated && timeBetween.TotalMilliseconds < firstRepeat) + { #if TRACE Trace.WriteLine("Skip First Repeat"); #endif return; } - if (_remoteButtonRepeated && timeBetween.TotalMilliseconds < _remoteHeldRepeats) + if (_remoteButtonRepeated && timeBetween.TotalMilliseconds < heldRepeats) { #if TRACE Trace.WriteLine("Skip Held Repeat"); @@ -580,7 +596,7 @@ return; } - if (_remoteButtonRepeated && timeBetween.TotalMilliseconds > _remoteFirstRepeat) + if (_remoteButtonRepeated && timeBetween.TotalMilliseconds > firstRepeat) _remoteButtonRepeated = false; else _remoteButtonRepeated = true; @@ -662,25 +678,29 @@ // Repeats ... TimeSpan timeBetween = DateTime.Now.Subtract(_lastKeyboardKeyTime); - if (!_keyboardKeyRepeated && timeBetween.TotalMilliseconds < _keyboardFirstRepeat) + int firstRepeat = _keyboardFirstRepeat; + int heldRepeats = _keyboardHeldRepeats; + if (_useSystemRatesRemote) + { + firstRepeat = SystemInformation.KeyboardDelay; + heldRepeats = SystemInformation.KeyboardSpeed; + } + + if (!_keyboardKeyRepeated && timeBetween.TotalMilliseconds < firstRepeat) return; - if (_keyboardKeyRepeated && timeBetween.TotalMilliseconds < _keyboardHeldRepeats) + if (_keyboardKeyRepeated && timeBetween.TotalMilliseconds < heldRepeats) return; - if (_keyboardKeyRepeated && timeBetween.TotalMilliseconds > _keyboardFirstRepeat) + if (_keyboardKeyRepeated && timeBetween.TotalMilliseconds > firstRepeat) _keyboardKeyRepeated = false; else _keyboardKeyRepeated = true; if (_handleKeyboardLocally) - { KeyDown(keyCode, modifiers); - } else - { KeyDownRemote(keyCode, modifiers); - } } _lastKeyboardKeyCode = keyCode; Modified: trunk/plugins/IR Server Suite/IR Server Suite.sln =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite.sln 2008-02-09 14:42:42 UTC (rev 1352) +++ trunk/plugins/IR Server Suite/IR Server Suite.sln 2008-02-09 16:10:18 UTC (rev 1353) @@ -377,6 +377,12 @@ Release.AspNetCompiler.Debug = "False" EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "General HID Receiver", "IR Server Plugins\General HID Receiver\General HID Receiver.csproj", "{26DEDF6D-F60D-4311-9A9E-DDF64500D5BF}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -789,6 +795,12 @@ {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 + {26DEDF6D-F60D-4311-9A9E-DDF64500D5BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {26DEDF6D-F60D-4311-9A9E-DDF64500D5BF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {26DEDF6D-F60D-4311-9A9E-DDF64500D5BF}.Debug|x86.ActiveCfg = Debug|Any CPU + {26DEDF6D-F60D-4311-9A9E-DDF64500D5BF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {26DEDF6D-F60D-4311-9A9E-DDF64500D5BF}.Release|Any CPU.Build.0 = Release|Any CPU + {26DEDF6D-F60D-4311-9A9E-DDF64500D5BF}.Release|x86.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -825,6 +837,7 @@ {37A555DF-7012-4B99-8A47-1C922A361E52} = {0D1620EE-01B9-43B5-9FAA-E983BD9EBDBD} {732CDF64-D047-4D3C-91DA-E2FF27D84179} = {0D1620EE-01B9-43B5-9FAA-E983BD9EBDBD} {E146C2D8-6842-46C5-B2A9-AFA9D6F1A3BB} = {0D1620EE-01B9-43B5-9FAA-E983BD9EBDBD} + {26DEDF6D-F60D-4311-9A9E-DDF64500D5BF} = {0D1620EE-01B9-43B5-9FAA-E983BD9EBDBD} {E8BEBBCC-1EE0-488D-8806-98ADCB7F0479} = {6C18D808-E5ED-4CFB-A7CD-E2BDBB1D9BDA} {7946D42A-4BCB-4D79-80EB-BA9B17CE2E90} = {6C18D808-E5ED-4CFB-A7CD-E2BDBB1D9BDA} {CD395FC2-70E2-42C4-8A20-5469A0C5EB50} = {6C18D808-E5ED-4CFB-A7CD-E2BDBB1D9BDA} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2008-02-10 13:16:39
|
Revision: 1359 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1359&view=rev Author: and-81 Date: 2008-02-10 05:16:25 -0800 (Sun, 10 Feb 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/Configure.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/HCW Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/HcwReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/IrRemoteWrapper.cs trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/ReceiverWindow.cs trunk/plugins/IR Server Suite/IR Server Suite - Debug.nsi trunk/plugins/IR Server Suite/IR Server Suite - Release.nsi Property Changed: ---------------- trunk/plugins/IR Server Suite/IR Server Plugins/General HID Receiver/ Property changes on: trunk/plugins/IR Server Suite/IR Server Plugins/General HID Receiver ___________________________________________________________________ Name: svn:ignore + bin obj Modified: trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/Configure.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/Configure.Designer.cs 2008-02-10 13:10:18 UTC (rev 1358) +++ trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/Configure.Designer.cs 2008-02-10 13:16:25 UTC (rev 1359) @@ -1,4 +1,4 @@ -namespace HcwTransceiver +namespace HcwReceiver { partial class Configure { Modified: trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/Configure.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/Configure.cs 2008-02-10 13:10:18 UTC (rev 1358) +++ trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/Configure.cs 2008-02-10 13:16:25 UTC (rev 1359) @@ -6,7 +6,7 @@ using System.Text; using System.Windows.Forms; -namespace HcwTransceiver +namespace HcwReceiver { /// <summary> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/HCW Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/HCW Receiver.csproj 2008-02-10 13:10:18 UTC (rev 1358) +++ trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/HCW Receiver.csproj 2008-02-10 13:16:25 UTC (rev 1359) @@ -7,8 +7,8 @@ <ProjectGuid>{EE8F2C22-8BD3-4832-85F0-E6F67ED3AADB}</ProjectGuid> <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>HcwTransceiver</RootNamespace> - <AssemblyName>HCW Transceiver</AssemblyName> + <RootNamespace>HcwReceiver</RootNamespace> + <AssemblyName>HCW Receiver</AssemblyName> <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> @@ -21,7 +21,7 @@ <WarningLevel>4</WarningLevel> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <UseVSHostingProcess>false</UseVSHostingProcess> - <DocumentationFile>bin\Debug\HCW Transceiver.XML</DocumentationFile> + <DocumentationFile>bin\Debug\HCW Receiver.xml</DocumentationFile> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>none</DebugType> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/HcwReceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/HcwReceiver.cs 2008-02-10 13:10:18 UTC (rev 1358) +++ trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/HcwReceiver.cs 2008-02-10 13:16:25 UTC (rev 1359) @@ -11,7 +11,7 @@ using IRServerPluginInterface; -namespace HcwTransceiver +namespace HcwReceiver { /// <summary> @@ -21,19 +21,11 @@ public class HcwReceiver : IRServerPluginBase, IRemoteReceiver, IConfigure { - #region Delegates - - //Sets up callback so that other forms can catch a key press - delegate void HCWEvent(int keypress); - //event HCWEvent HCWKeyPressed; - - #endregion Delegates - #region Constants static readonly string ConfigurationFile = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\IR Server\\HCW Transceiver.xml"; + "\\IR Server Suite\\IR Server\\HCW Receiver.xml"; #endregion Constants @@ -43,8 +35,8 @@ bool _stopIrExe; bool _startIrExe; - IrRemoteWrapper _irRemoteWrapper = null; - RemoteHandler _remoteButtonHandler = null; + IrRemoteWrapper _irRemoteWrapper = null; + RemoteHandler _remoteButtonHandler = null; int _lastCode = 0; DateTime _lastCodeTime = DateTime.Now; @@ -72,7 +64,7 @@ /// A description of the IR Server plugin. /// </summary> /// <value>The description.</value> - public override string Description { get { return "Support for Hauppauge devices"; } } + public override string Description { get { return "Support for Hauppauge IR devices"; } } /// <summary> /// Start the IR Server plugin. Modified: trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/IrRemoteWrapper.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/IrRemoteWrapper.cs 2008-02-10 13:10:18 UTC (rev 1358) +++ trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/IrRemoteWrapper.cs 2008-02-10 13:16:25 UTC (rev 1359) @@ -7,7 +7,7 @@ using Microsoft.Win32; -namespace HcwTransceiver +namespace HcwReceiver { /// <summary> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/Properties/AssemblyInfo.cs 2008-02-10 13:10:18 UTC (rev 1358) +++ trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/Properties/AssemblyInfo.cs 2008-02-10 13:16:25 UTC (rev 1359) @@ -7,7 +7,7 @@ // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("HCW Receiver")] -[assembly: AssemblyDescription("IR Server plugin to support the HCW Receiver")] +[assembly: AssemblyDescription("IR Server plugin to support HCW Receivers")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("HcwReceiver")] Modified: trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/ReceiverWindow.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/ReceiverWindow.cs 2008-02-10 13:10:18 UTC (rev 1358) +++ trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/ReceiverWindow.cs 2008-02-10 13:16:25 UTC (rev 1359) @@ -1,7 +1,7 @@ using System; using System.Windows.Forms; -namespace HcwTransceiver +namespace HcwReceiver { #region Delegates Modified: trunk/plugins/IR Server Suite/IR Server Suite - Debug.nsi =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite - Debug.nsi 2008-02-10 13:10:18 UTC (rev 1358) +++ trunk/plugins/IR Server Suite/IR Server Suite - Debug.nsi 2008-02-10 13:16:25 UTC (rev 1359) @@ -300,8 +300,9 @@ File "IR Server Plugins\Custom HID Receiver\bin\Debug\*.*" ;File "IR Server Plugins\Direct Input Receiver\bin\Debug\*.*" File "IR Server Plugins\FusionRemote Receiver\bin\Debug\*.*" + ;File "IR Server Plugins\General HID Receiver\bin\Debug\*.*" File "IR Server Plugins\Girder Plugin\bin\Debug\*.*" - ;File "IR Server Plugins\HCW Transceiver\bin\Debug\*.*" + File "IR Server Plugins\HCW Receiver\bin\Debug\*.*" File "IR Server Plugins\IgorPlug Receiver\bin\Debug\*.*" File "IR Server Plugins\IRMan Receiver\bin\Debug\*.*" File "IR Server Plugins\IRTrans Transceiver\bin\Debug\*.*" Modified: trunk/plugins/IR Server Suite/IR Server Suite - Release.nsi =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite - Release.nsi 2008-02-10 13:10:18 UTC (rev 1358) +++ trunk/plugins/IR Server Suite/IR Server Suite - Release.nsi 2008-02-10 13:16:25 UTC (rev 1359) @@ -300,8 +300,9 @@ File "IR Server Plugins\Custom HID Receiver\bin\Release\*.*" ;File "IR Server Plugins\Direct Input Receiver\bin\Release\*.*" File "IR Server Plugins\FusionRemote Receiver\bin\Release\*.*" + ;File "IR Server Plugins\General HID Receiver\bin\Release\*.*" File "IR Server Plugins\Girder Plugin\bin\Release\*.*" - ;File "IR Server Plugins\HCW Transceiver\bin\Release\*.*" + File "IR Server Plugins\HCW Receiver\bin\Release\*.*" File "IR Server Plugins\IgorPlug Receiver\bin\Release\*.*" File "IR Server Plugins\IRMan Receiver\bin\Release\*.*" File "IR Server Plugins\IRTrans Transceiver\bin\Release\*.*" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2008-02-14 11:00:45
|
Revision: 1366 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1366&view=rev Author: and-81 Date: 2008-02-14 03:00:35 -0800 (Thu, 14 Feb 2008) Log Message: ----------- Modified Paths: -------------- 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/Properties/AssemblyInfo.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/Properties/AssemblyInfo.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/Applications/Tray Launcher/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Commands/Command/Command.csproj trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandProcessor.csproj trunk/plugins/IR Server Suite/Commands/GeneralCommands/GeneralCommands.csproj trunk/plugins/IR Server Suite/Documentation/introduction.html trunk/plugins/IR Server Suite/Documentation/new.html trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/HCW 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/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/Properties/AssemblyInfo.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/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/RedEye Blaster/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/Serial IR Blaster/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/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/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/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 Added Paths: ----------- trunk/plugins/IR Server Suite/Applications/Translator/Graphics/Remap.png trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/ trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/Configure.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/Configure.resx trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/LiveDrive Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/LiveDriveReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/Properties/ trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/Properties/AssemblyInfo.cs Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/Properties/AssemblyInfo.cs 2008-02-13 07:16:16 UTC (rev 1365) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/Properties/AssemblyInfo.cs 2008-02-14 11:00:35 UTC (rev 1366) @@ -37,4 +37,4 @@ [assembly: AssemblyFileVersion("1.0.4.2")] [assembly: CLSCompliant(true)] -[assembly: GuidAttribute("8eeb5fcb-322c-45ee-80a9-3d30cc08a48c")] +[assembly: Guid("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 2008-02-13 07:16:16 UTC (rev 1365) +++ trunk/plugins/IR Server Suite/Applications/IR Blast/Properties/AssemblyInfo.cs 2008-02-14 11:00:35 UTC (rev 1366) @@ -37,4 +37,4 @@ [assembly: AssemblyFileVersion("1.0.4.2")] [assembly: CLSCompliant(true)] -[assembly: GuidAttribute("5eeca936-da49-4952-ab3b-9f11ec57e4aa")] +[assembly: Guid("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 2008-02-13 07:16:16 UTC (rev 1365) +++ trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Properties/AssemblyInfo.cs 2008-02-14 11:00:35 UTC (rev 1366) @@ -37,4 +37,4 @@ [assembly: AssemblyFileVersion("1.0.4.2")] [assembly: CLSCompliant(true)] -[assembly: GuidAttribute("81eb136b-cc74-4eed-976d-f96ebccd1ce4")] +[assembly: Guid("81eb136b-cc74-4eed-976d-f96ebccd1ce4")] Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Properties/AssemblyInfo.cs 2008-02-13 07:16:16 UTC (rev 1365) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Properties/AssemblyInfo.cs 2008-02-14 11:00:35 UTC (rev 1366) @@ -22,7 +22,7 @@ [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: GuidAttribute("a94fbaf3-2d68-45da-8f4f-7dee41f00040")] +[assembly: Guid("a94fbaf3-2d68-45da-8f4f-7dee41f00040")] // Version information for an assembly consists of the following four values: // Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.Designer.cs 2008-02-13 07:16:16 UTC (rev 1365) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.Designer.cs 2008-02-14 11:00:35 UTC (rev 1366) @@ -45,16 +45,23 @@ this.editButtonToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.deleteButtonToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.clearButtonsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.remapButtonToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); this.copyButtonsFromToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.buttonOK = new System.Windows.Forms.Button(); this.tabControl = new System.Windows.Forms.TabControl(); this.tabPagePrograms = new System.Windows.Forms.TabPage(); + this.panelPrograms = new System.Windows.Forms.Panel(); + this.panelProgramsButtons = new System.Windows.Forms.Panel(); + this.labelProgramsDelete = new System.Windows.Forms.Label(); + this.labelProgramsEdit = new System.Windows.Forms.Label(); + this.labelProgramsAdd = new System.Windows.Forms.Label(); this.toolStripButtonMappings = new System.Windows.Forms.ToolStrip(); this.toolStripButtonNewMapping = new System.Windows.Forms.ToolStripButton(); this.toolStripButtonEditMapping = new System.Windows.Forms.ToolStripButton(); this.toolStripButtonDeleteMapping = new System.Windows.Forms.ToolStripButton(); this.toolStripButtonDeleteAllMappings = new System.Windows.Forms.ToolStripButton(); + this.toolStripButtonRemapMapping = new System.Windows.Forms.ToolStripButton(); this.tabPageEvents = new System.Windows.Forms.TabPage(); this.buttonSetCommand = new System.Windows.Forms.Button(); this.buttonAddEvent = new System.Windows.Forms.Button(); @@ -101,6 +108,8 @@ this.contextMenuStripButtonMapping.SuspendLayout(); this.tabControl.SuspendLayout(); this.tabPagePrograms.SuspendLayout(); + this.panelPrograms.SuspendLayout(); + this.panelProgramsButtons.SuspendLayout(); this.toolStripButtonMappings.SuspendLayout(); this.tabPageEvents.SuspendLayout(); this.contextMenuStripEvents.SuspendLayout(); @@ -114,20 +123,20 @@ // listViewPrograms // 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.listViewPrograms.BorderStyle = System.Windows.Forms.BorderStyle.None; this.listViewPrograms.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.columnHeader1}); this.listViewPrograms.ContextMenuStrip = this.contextMenuStripPrograms; + this.listViewPrograms.Dock = System.Windows.Forms.DockStyle.Fill; this.listViewPrograms.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; this.listViewPrograms.HideSelection = false; this.listViewPrograms.LargeImageList = this.imageListPrograms; - this.listViewPrograms.Location = new System.Drawing.Point(8, 8); + this.listViewPrograms.Location = new System.Drawing.Point(0, 0); 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.Size = new System.Drawing.Size(470, 84); this.listViewPrograms.TabIndex = 0; this.listViewPrograms.TileSize = new System.Drawing.Size(128, 48); this.toolTip.SetToolTip(this.listViewPrograms, "Choose a Program to modify mappings"); @@ -161,11 +170,11 @@ this.listViewButtons.GridLines = true; this.listViewButtons.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; this.listViewButtons.HideSelection = false; - this.listViewButtons.Location = new System.Drawing.Point(8, 96); + this.listViewButtons.Location = new System.Drawing.Point(8, 104); this.listViewButtons.MultiSelect = false; this.listViewButtons.Name = "listViewButtons"; this.listViewButtons.ShowGroups = false; - this.listViewButtons.Size = new System.Drawing.Size(504, 240); + this.listViewButtons.Size = new System.Drawing.Size(504, 232); this.listViewButtons.TabIndex = 1; this.listViewButtons.UseCompatibleStateImageBehavior = false; this.listViewButtons.View = System.Windows.Forms.View.Details; @@ -194,17 +203,18 @@ this.editButtonToolStripMenuItem, this.deleteButtonToolStripMenuItem, this.clearButtonsToolStripMenuItem, + this.remapButtonToolStripMenuItem, this.toolStripSeparator3, this.copyButtonsFromToolStripMenuItem}); this.contextMenuStripButtonMapping.Name = "contextMenuStripButtonMapping"; - this.contextMenuStripButtonMapping.Size = new System.Drawing.Size(144, 120); + this.contextMenuStripButtonMapping.Size = new System.Drawing.Size(151, 142); this.contextMenuStripButtonMapping.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStripButtonMapping_Opening); // // newButtonToolStripMenuItem // this.newButtonToolStripMenuItem.Image = global::Translator.Properties.Resources.Plus; this.newButtonToolStripMenuItem.Name = "newButtonToolStripMenuItem"; - this.newButtonToolStripMenuItem.Size = new System.Drawing.Size(143, 22); + this.newButtonToolStripMenuItem.Size = new System.Drawing.Size(150, 22); this.newButtonToolStripMenuItem.Text = "&New"; this.newButtonToolStripMenuItem.Click += new System.EventHandler(this.newButtonToolStripMenuItem_Click); // @@ -212,7 +222,7 @@ // this.editButtonToolStripMenuItem.Image = global::Translator.Properties.Resources.Edit; this.editButtonToolStripMenuItem.Name = "editButtonToolStripMenuItem"; - this.editButtonToolStripMenuItem.Size = new System.Drawing.Size(143, 22); + this.editButtonToolStripMenuItem.Size = new System.Drawing.Size(150, 22); this.editButtonToolStripMenuItem.Text = "&Edit"; this.editButtonToolStripMenuItem.Click += new System.EventHandler(this.editButtonToolStripMenuItem_Click); // @@ -220,7 +230,7 @@ // this.deleteButtonToolStripMenuItem.Image = global::Translator.Properties.Resources.Delete; this.deleteButtonToolStripMenuItem.Name = "deleteButtonToolStripMenuItem"; - this.deleteButtonToolStripMenuItem.Size = new System.Drawing.Size(143, 22); + this.deleteButtonToolStripMenuItem.Size = new System.Drawing.Size(150, 22); this.deleteButtonToolStripMenuItem.Text = "&Delete"; this.deleteButtonToolStripMenuItem.Click += new System.EventHandler(this.deleteButtonToolStripMenuItem_Click); // @@ -228,20 +238,28 @@ // this.clearButtonsToolStripMenuItem.Image = global::Translator.Properties.Resources.DeleteAll; this.clearButtonsToolStripMenuItem.Name = "clearButtonsToolStripMenuItem"; - this.clearButtonsToolStripMenuItem.Size = new System.Drawing.Size(143, 22); + this.clearButtonsToolStripMenuItem.Size = new System.Drawing.Size(150, 22); this.clearButtonsToolStripMenuItem.Text = "&Clear"; this.clearButtonsToolStripMenuItem.Click += new System.EventHandler(this.clearButtonsToolStripMenuItem_Click); // + // remapButtonToolStripMenuItem + // + this.remapButtonToolStripMenuItem.Image = global::Translator.Properties.Resources.Remap; + this.remapButtonToolStripMenuItem.Name = "remapButtonToolStripMenuItem"; + this.remapButtonToolStripMenuItem.Size = new System.Drawing.Size(150, 22); + this.remapButtonToolStripMenuItem.Text = "&Remap"; + this.remapButtonToolStripMenuItem.Click += new System.EventHandler(this.remapButtonToolStripMenuItem_Click); + // // toolStripSeparator3 // this.toolStripSeparator3.Name = "toolStripSeparator3"; - this.toolStripSeparator3.Size = new System.Drawing.Size(140, 6); + this.toolStripSeparator3.Size = new System.Drawing.Size(147, 6); // // copyButtonsFromToolStripMenuItem // this.copyButtonsFromToolStripMenuItem.Image = global::Translator.Properties.Resources.MoveRight; this.copyButtonsFromToolStripMenuItem.Name = "copyButtonsFromToolStripMenuItem"; - this.copyButtonsFromToolStripMenuItem.Size = new System.Drawing.Size(143, 22); + this.copyButtonsFromToolStripMenuItem.Size = new System.Drawing.Size(150, 22); this.copyButtonsFromToolStripMenuItem.Text = "Copy &from ..."; // // buttonOK @@ -274,8 +292,8 @@ // // tabPagePrograms // + this.tabPagePrograms.Controls.Add(this.panelPrograms); this.tabPagePrograms.Controls.Add(this.listViewButtons); - this.tabPagePrograms.Controls.Add(this.listViewPrograms); this.tabPagePrograms.Controls.Add(this.toolStripButtonMappings); this.tabPagePrograms.Location = new System.Drawing.Point(4, 22); this.tabPagePrograms.Name = "tabPagePrograms"; @@ -285,6 +303,64 @@ this.tabPagePrograms.Text = "Programs"; this.tabPagePrograms.UseVisualStyleBackColor = true; // + // panelPrograms + // + this.panelPrograms.BackColor = System.Drawing.SystemColors.Window; + this.panelPrograms.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + this.panelPrograms.Controls.Add(this.listViewPrograms); + this.panelPrograms.Controls.Add(this.panelProgramsButtons); + this.panelPrograms.Location = new System.Drawing.Point(8, 8); + this.panelPrograms.Name = "panelPrograms"; + this.panelPrograms.Size = new System.Drawing.Size(504, 88); + this.panelPrograms.TabIndex = 3; + // + // panelProgramsButtons + // + this.panelProgramsButtons.Controls.Add(this.labelProgramsDelete); + this.panelProgramsButtons.Controls.Add(this.labelProgramsEdit); + this.panelProgramsButtons.Controls.Add(this.labelProgramsAdd); + this.panelProgramsButtons.Dock = System.Windows.Forms.DockStyle.Right; + this.panelProgramsButtons.Location = new System.Drawing.Point(470, 0); + this.panelProgramsButtons.Name = "panelProgramsButtons"; + this.panelProgramsButtons.Size = new System.Drawing.Size(30, 84); + this.panelProgramsButtons.TabIndex = 1; + // + // labelProgramsDelete + // + this.labelProgramsDelete.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.labelProgramsDelete.Cursor = System.Windows.Forms.Cursors.Hand; + this.labelProgramsDelete.Image = global::Translator.Properties.Resources.Delete; + this.labelProgramsDelete.Location = new System.Drawing.Point(1, 52); + this.labelProgramsDelete.Name = "labelProgramsDelete"; + this.labelProgramsDelete.Size = new System.Drawing.Size(24, 24); + this.labelProgramsDelete.TabIndex = 2; + this.labelProgramsDelete.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.toolTip.SetToolTip(this.labelProgramsDelete, "Remove program"); + // + // labelProgramsEdit + // + this.labelProgramsEdit.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.labelProgramsEdit.Cursor = System.Windows.Forms.Cursors.Hand; + this.labelProgramsEdit.Image = global::Translator.Properties.Resources.Edit; + this.labelProgramsEdit.Location = new System.Drawing.Point(1, 27); + this.labelProgramsEdit.Name = "labelProgramsEdit"; + this.labelProgramsEdit.Size = new System.Drawing.Size(24, 24); + this.labelProgramsEdit.TabIndex = 1; + this.labelProgramsEdit.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.toolTip.SetToolTip(this.labelProgramsEdit, "Edit program"); + // + // labelProgramsAdd + // + this.labelProgramsAdd.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.labelProgramsAdd.Cursor = System.Windows.Forms.Cursors.Hand; + this.labelProgramsAdd.Image = global::Translator.Properties.Resources.Plus; + this.labelProgramsAdd.Location = new System.Drawing.Point(1, 2); + this.labelProgramsAdd.Name = "labelProgramsAdd"; + this.labelProgramsAdd.Size = new System.Drawing.Size(24, 24); + this.labelProgramsAdd.TabIndex = 0; + this.labelProgramsAdd.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.toolTip.SetToolTip(this.labelProgramsAdd, "Add program"); + // // toolStripButtonMappings // this.toolStripButtonMappings.Dock = System.Windows.Forms.DockStyle.Bottom; @@ -293,7 +369,8 @@ this.toolStripButtonNewMapping, this.toolStripButtonEditMapping, this.toolStripButtonDeleteMapping, - this.toolStripButtonDeleteAllMappings}); + this.toolStripButtonDeleteAllMappings, + this.toolStripButtonRemapMapping}); this.toolStripButtonMappings.Location = new System.Drawing.Point(3, 346); this.toolStripButtonMappings.Name = "toolStripButtonMappings"; this.toolStripButtonMappings.Size = new System.Drawing.Size(514, 25); @@ -305,7 +382,7 @@ this.toolStripButtonNewMapping.Image = global::Translator.Properties.Resources.Plus; this.toolStripButtonNewMapping.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripButtonNewMapping.Name = "toolStripButtonNewMapping"; - this.toolStripButtonNewMapping.Size = new System.Drawing.Size(51, 22); + this.toolStripButtonNewMapping.Size = new System.Drawing.Size(48, 22); this.toolStripButtonNewMapping.Text = "New"; this.toolStripButtonNewMapping.ToolTipText = "Create a new button mapping"; this.toolStripButtonNewMapping.Click += new System.EventHandler(this.toolStripButtonNewMapping_Click); @@ -315,7 +392,7 @@ this.toolStripButtonEditMapping.Image = global::Translator.Properties.Resources.Edit; this.toolStripButtonEditMapping.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripButtonEditMapping.Name = "toolStripButtonEditMapping"; - this.toolStripButtonEditMapping.Size = new System.Drawing.Size(47, 22); + this.toolStripButtonEditMapping.Size = new System.Drawing.Size(45, 22); this.toolStripButtonEditMapping.Text = "Edit"; this.toolStripButtonEditMapping.ToolTipText = "Edit the selected button mapping"; this.toolStripButtonEditMapping.Click += new System.EventHandler(this.toolStripButtonEditMapping_Click); @@ -325,7 +402,7 @@ this.toolStripButtonDeleteMapping.Image = global::Translator.Properties.Resources.Delete; this.toolStripButtonDeleteMapping.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripButtonDeleteMapping.Name = "toolStripButtonDeleteMapping"; - this.toolStripButtonDeleteMapping.Size = new System.Drawing.Size(60, 22); + this.toolStripButtonDeleteMapping.Size = new System.Drawing.Size(58, 22); this.toolStripButtonDeleteMapping.Text = "Delete"; this.toolStripButtonDeleteMapping.ToolTipText = "Delete the selected button mapping"; this.toolStripButtonDeleteMapping.Click += new System.EventHandler(this.toolStripButtonDeleteMapping_Click); @@ -336,11 +413,21 @@ this.toolStripButtonDeleteAllMappings.Image = global::Translator.Properties.Resources.DeleteAll; this.toolStripButtonDeleteAllMappings.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripButtonDeleteAllMappings.Name = "toolStripButtonDeleteAllMappings"; - this.toolStripButtonDeleteAllMappings.Size = new System.Drawing.Size(77, 22); + this.toolStripButtonDeleteAllMappings.Size = new System.Drawing.Size(72, 22); this.toolStripButtonDeleteAllMappings.Text = "Delete All"; this.toolStripButtonDeleteAllMappings.ToolTipText = "Delete all the button mappings"; this.toolStripButtonDeleteAllMappings.Click += new System.EventHandler(this.toolStripButtonDeleteAllMappings_Click); // + // toolStripButtonRemapMapping + // + this.toolStripButtonRemapMapping.Image = global::Translator.Properties.Resources.Remap; + this.toolStripButtonRemapMapping.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButtonRemapMapping.Name = "toolStripButtonRemapMapping"; + this.toolStripButtonRemapMapping.Size = new System.Drawing.Size(60, 22); + this.toolStripButtonRemapMapping.Text = "Remap"; + this.toolStripButtonRemapMapping.ToolTipText = "Link a new code to the selected mapping"; + this.toolStripButtonRemapMapping.Click += new System.EventHandler(this.toolStripButtonRemapMapping_Click); + // // tabPageEvents // this.tabPageEvents.Controls.Add(this.buttonSetCommand); @@ -461,13 +548,13 @@ this.contextMenuStripEvents.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.removeEventToolStripMenuItem}); this.contextMenuStripEvents.Name = "contextMenuStripEvents"; - this.contextMenuStripEvents.Size = new System.Drawing.Size(118, 26); + this.contextMenuStripEvents.Size = new System.Drawing.Size(125, 26); // // removeEventToolStripMenuItem // this.removeEventToolStripMenuItem.Image = global::Translator.Properties.Resources.Delete; this.removeEventToolStripMenuItem.Name = "removeEventToolStripMenuItem"; - this.removeEventToolStripMenuItem.Size = new System.Drawing.Size(117, 22); + this.removeEventToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.removeEventToolStripMenuItem.Text = "&Remove"; this.removeEventToolStripMenuItem.Click += new System.EventHandler(this.removeEventToolStripMenuItem_Click); // @@ -504,7 +591,7 @@ this.toolStripButtonNewMacro.Image = global::Translator.Properties.Resources.Plus; this.toolStripButtonNewMacro.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripButtonNewMacro.Name = "toolStripButtonNewMacro"; - this.toolStripButtonNewMacro.Size = new System.Drawing.Size(51, 22); + this.toolStripButtonNewMacro.Size = new System.Drawing.Size(48, 22); this.toolStripButtonNewMacro.Text = "New"; this.toolStripButtonNewMacro.ToolTipText = "Create a new macro"; this.toolStripButtonNewMacro.Click += new System.EventHandler(this.toolStripButtonNewMacro_Click); @@ -514,7 +601,7 @@ this.toolStripButtonEditMacro.Image = global::Translator.Properties.Resources.Edit; this.toolStripButtonEditMacro.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripButtonEditMacro.Name = "toolStripButtonEditMacro"; - this.toolStripButtonEditMacro.Size = new System.Drawing.Size(47, 22); + this.toolStripButtonEditMacro.Size = new System.Drawing.Size(45, 22); this.toolStripButtonEditMacro.Text = "Edit"; this.toolStripButtonEditMacro.ToolTipText = "Edit the selected macro"; this.toolStripButtonEditMacro.Click += new System.EventHandler(this.toolStripButtonEditMacro_Click); @@ -524,7 +611,7 @@ this.toolStripButtonDeleteMacro.Image = global::Translator.Properties.Resources.Delete; this.toolStripButtonDeleteMacro.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripButtonDeleteMacro.Name = "toolStripButtonDeleteMacro"; - this.toolStripButtonDeleteMacro.Size = new System.Drawing.Size(60, 22); + this.toolStripButtonDeleteMacro.Size = new System.Drawing.Size(58, 22); this.toolStripButtonDeleteMacro.Text = "Delete"; this.toolStripButtonDeleteMacro.ToolTipText = "Delete the selected macro"; this.toolStripButtonDeleteMacro.Click += new System.EventHandler(this.toolStripButtonDeleteMacro_Click); @@ -535,7 +622,7 @@ this.toolStripButtonCreateShortcutForMacro.Image = global::Translator.Properties.Resources.Shortcut; this.toolStripButtonCreateShortcutForMacro.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripButtonCreateShortcutForMacro.Name = "toolStripButtonCreateShortcutForMacro"; - this.toolStripButtonCreateShortcutForMacro.Size = new System.Drawing.Size(108, 22); + this.toolStripButtonCreateShortcutForMacro.Size = new System.Drawing.Size(103, 22); this.toolStripButtonCreateShortcutForMacro.Text = "Create shortcut"; this.toolStripButtonCreateShortcutForMacro.ToolTipText = "Create a shortcut to run the selected macro"; this.toolStripButtonCreateShortcutForMacro.Click += new System.EventHandler(this.toolStripButtonCreateShortcutForMacro_Click); @@ -545,7 +632,7 @@ this.toolStripButtonTestMacro.Image = global::Translator.Properties.Resources.MoveRight; this.toolStripButtonTestMacro.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripButtonTestMacro.Name = "toolStripButtonTestMacro"; - this.toolStripButtonTestMacro.Size = new System.Drawing.Size(49, 22); + this.toolStripButtonTestMacro.Size = new System.Drawing.Size(48, 22); this.toolStripButtonTestMacro.Text = "Test"; this.toolStripButtonTestMacro.ToolTipText = "Test the selected macro"; this.toolStripButtonTestMacro.Click += new System.EventHandler(this.toolStripButtonTestMacro_Click); @@ -601,7 +688,7 @@ this.toolStripButtonNewIR.Image = global::Translator.Properties.Resources.Plus; this.toolStripButtonNewIR.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripButtonNewIR.Name = "toolStripButtonNewIR"; - this.toolStripButtonNewIR.Size = new System.Drawing.Size(51, 22); + this.toolStripButtonNewIR.Size = new System.Drawing.Size(48, 22); this.toolStripButtonNewIR.Text = "New"; this.toolStripButtonNewIR.ToolTipText = "Create a new IR Command"; this.toolStripButtonNewIR.Click += new System.EventHandler(this.toolStripButtonNewIR_Click); @@ -611,7 +698,7 @@ this.toolStripButtonEditIR.Image = global::Translator.Properties.Resources.Edit; this.toolStripButtonEditIR.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripButtonEditIR.Name = "toolStripButtonEditIR"; - this.toolStripButtonEditIR.Size = new System.Drawing.Size(47, 22); + this.toolStripButtonEditIR.Size = new System.Drawing.Size(45, 22); this.toolStripButtonEditIR.Text = "Edit"; this.toolStripButtonEditIR.ToolTipText = "Edit the selected IR Command"; this.toolStripButtonEditIR.Click += new System.EventHandler(this.toolStripButtonEditIR_Click); @@ -621,7 +708,7 @@ this.toolStripButtonDeleteIR.Image = global::Translator.Properties.Resources.Delete; this.toolStripButtonDeleteIR.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripButtonDeleteIR.Name = "toolStripButtonDeleteIR"; - this.toolStripButtonDeleteIR.Size = new System.Drawing.Size(60, 22); + this.toolStripButtonDeleteIR.Size = new System.Drawing.Size(58, 22); this.toolStripButtonDeleteIR.Text = "Delete"; this.toolStripButtonDeleteIR.ToolTipText = "Delete the selected IR Command"; this.toolStripButtonDeleteIR.Click += new System.EventHandler(this.toolStripButtonDeleteIR_Click); @@ -682,58 +769,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); // @@ -743,20 +830,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); // @@ -792,6 +879,8 @@ this.tabControl.ResumeLayout(false); this.tabPagePrograms.ResumeLayout(false); this.tabPagePrograms.PerformLayout(); + this.panelPrograms.ResumeLayout(false); + this.panelProgramsButtons.ResumeLayout(false); this.toolStripButtonMappings.ResumeLayout(false); this.toolStripButtonMappings.PerformLayout(); this.tabPageEvents.ResumeLayout(false); @@ -879,6 +968,13 @@ private System.Windows.Forms.ToolStripButton toolStripButtonNewIR; private System.Windows.Forms.ToolStripButton toolStripButtonEditIR; private System.Windows.Forms.ToolStripButton toolStripButtonDeleteIR; + private System.Windows.Forms.ToolStripButton toolStripButtonRemapMapping; + private System.Windows.Forms.Panel panelPrograms; + private System.Windows.Forms.Panel panelProgramsButtons; + private System.Windows.Forms.Label labelProgramsDelete; + private System.Windows.Forms.Label labelProgramsEdit; + private System.Windows.Forms.Label labelProgramsAdd; + private System.Windows.Forms.ToolStripMenuItem remapButtonToolStripMenuItem; } } Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2008-02-13 07:16:16 UTC (rev 1365) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2008-02-14 11:00:35 UTC (rev 1366) @@ -612,7 +612,51 @@ currentMappings.Clear(); listViewButtons.Items.Clear(); } + void RemapButtonMapping() + { + if (listViewButtons.SelectedIndices.Count != 1) + return; + ListViewItem item = listViewButtons.SelectedItems[0]; + + List<ButtonMapping> currentMappings = GetCurrentButtonMappings(); + if (currentMappings == null) + return; + + ButtonMapping toModify = null; + foreach (ButtonMapping test in currentMappings) + { + if (test.KeyCode.Equals(item.SubItems[0].Text, StringComparison.Ordinal)) + { + toModify = test; + break; + } + } + + if (toModify == null) + return; + + GetKeyCodeForm getKeyCode = new GetKeyCodeForm(); + getKeyCode.ShowDialog(this); + + string keyCode = getKeyCode.KeyCode; + if (String.IsNullOrEmpty(keyCode)) + return; + + foreach (ButtonMapping test in currentMappings) + { + if (test.KeyCode.Equals(keyCode, StringComparison.Ordinal)) + { + MessageBox.Show(this, String.Format("{0} is already mapped to {1} ({2})", keyCode, test.Description, test.Command), "Cannot remap", MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + } + + item.SubItems[0].Text = keyCode; + + toModify.KeyCode = keyCode; + } + void ClickCopyFrom(object sender, EventArgs e) { ToolStripMenuItem origin = sender as ToolStripMenuItem; @@ -1203,6 +1247,10 @@ { ClearButtonMappings(); } + private void remapButtonToolStripMenuItem_Click(object sender, EventArgs e) + { + RemapButtonMapping(); + } #endregion Menus @@ -1222,6 +1270,10 @@ { ClearButtonMappings(); } + private void toolStripButtonRemapMapping_Click(object sender, EventArgs e) + { + RemapButtonMapping(); + } private void toolStripButtonNewMacro_Click(object sender, EventArgs e) { @@ -1330,7 +1382,6 @@ } } - } } Added: trunk/plugins/IR Server Suite/Applications/Translator/Graphics/Remap.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/IR Server Suite/Applications/Translator/Graphics/Remap.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/plugins/IR Server Suite/Applications/Translator/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Properties/AssemblyInfo.cs 2008-02-13 07:16:16 UTC (rev 1365) +++ trunk/plugins/IR Server Suite/Applications/Translator/Properties/AssemblyInfo.cs 2008-02-14 11:00:35 UTC (rev 1366) @@ -38,4 +38,4 @@ [assembly: CLSCompliant(true)] -[assembly: GuidAttribute("00506894-d61e-47b9-9039-879c543a73e1")] +[assembly: Guid("00506894-d61e-47b9-9039-879c543a73e1")] Modified: trunk/plugins/IR Server Suite/Applications/Translator/Properties/Resources.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Properties/Resources.Designer.cs 2008-02-13 07:16:16 UTC (rev 1365) +++ trunk/plugins/IR Server Suite/Applications/Translator/Properties/Resources.Designer.cs 2008-02-14 11:00:35 UTC (rev 1366) @@ -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. @@ -158,6 +158,13 @@ } } + internal static System.Drawing.Bitmap Remap { + get { + object obj = ResourceManager.GetObject("Remap", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + internal static System.Drawing.Bitmap ScrollDown { get { object obj = ResourceManager.GetObject("ScrollDown", resourceCulture); Modified: trunk/plugins/IR Server Suite/Applications/Translator/Properties/Resources.resx =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Properties/Resources.resx 2008-02-13 07:16:16 UTC (rev 1365) +++ trunk/plugins/IR Server Suite/Applications/Translator/Properties/Resources.resx 2008-02-14 11:00:35 UTC (rev 1366) @@ -160,6 +160,9 @@ <data name="Plus" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\graphics\plus.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> </data> + <data name="Remap" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\graphics\remap.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> <data name="ScrollDown" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\graphics\scrolldown.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> </data> Modified: trunk/plugins/IR Server Suite/Applications/Translator/Translator.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Translator.csproj 2008-02-13 07:16:16 UTC (rev 1365) +++ trunk/plugins/IR Server Suite/Applications/Translator/Translator.csproj 2008-02-14 11:00:35 UTC (rev 1366) @@ -179,6 +179,7 @@ <Content Include="Graphics\MoveUp.png" /> <Content Include="Graphics\NoIcon.png" /> <Content Include="Graphics\Plus.png" /> + <Content Include="Graphics\Remap.png" /> <Content Include="Graphics\ScrollDown.png" /> <Content Include="Graphics\ScrollUp.png" /> <Content Include="Graphics\Shortcut.png" /> Modified: trunk/plugins/IR Server Suite/Applications/Tray Launcher/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Tray Launcher/Properties/AssemblyInfo.cs 2008-02-13 07:16:16 UTC (rev 1365) +++ trunk/plugins/IR Server Suite/Applications/Tray Launcher/Properties/AssemblyInfo.cs 2008-02-14 11:00:35 UTC (rev 1366) @@ -37,4 +37,4 @@ [assembly: AssemblyFileVersion("1.0.4.2")] [assembly: CLSCompliant(true)] -[assembly: GuidAttribute("2011f0d4-cec8-43d2-8678-79f24cd6c517")] +[assembly: Guid("2011f0d4-cec8-43d2-8678-79f24cd6c517")] Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote/Properties/AssemblyInfo.cs 2008-02-13 07:16:16 UTC (rev 1365) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote/Properties/AssemblyInfo.cs 2008-02-14 11:00:35 UTC (rev 1366) @@ -37,4 +37,4 @@ [assembly: AssemblyFileVersion("1.0.4.2")] [assembly: CLSCompliant(true)] -[assembly: GuidAttribute("b9084277-405c-48e6-80d1-c0d0e1dae27d")] +[assembly: Guid("b9084277-405c-48e6-80d1-c0d0e1dae27d")] Modified: trunk/plugins/IR Server Suite/Commands/Command/Command.csproj =================================================================== --- trunk/plugins/IR Server Suite/Commands/Command/Command.csproj 2008-02-13 07:16:16 UTC (rev 1365) +++ trunk/plugins/IR Server Suite/Commands/Command/Command.csproj 2008-02-14 11:00:35 UTC (rev 1366) @@ -33,6 +33,7 @@ </PropertyGroup> <ItemGroup> <Reference Include="System" /> + <Reference Include="System.Data" /> <Reference Include="System.Windows.Forms" /> <Reference Include="System.Xml" /> </ItemGroup> Modified: trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandProcessor.csproj =================================================================== --- trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandProcessor.csproj 2008-02-13 07:16:16 UTC (rev 1365) +++ trunk/plugins/IR Server Suite/Commands/CommandProcessor/CommandProcessor.csproj 2008-02-14 11:00:35 UTC (rev 1366) @@ -33,6 +33,7 @@ </PropertyGroup> <ItemGroup> <Reference Include="System" /> + <Reference Include="System.Data" /> <Reference Include="System.Drawing" /> <Reference Include="System.Windows.Forms" /> <Reference Include="System.Xml" /> Modified: trunk/plugins/IR Server Suite/Commands/GeneralCommands/GeneralCommands.csproj =================================================================== --- trunk/plugins/IR Server Suite/Commands/GeneralCommands/GeneralCommands.csproj 2008-02-13 07:16:16 UTC (rev 1365) +++ trunk/plugins/IR Server Suite/Commands/GeneralCommands/GeneralCommands.csproj 2008-02-14 11:00:35 UTC (rev 1366) @@ -33,7 +33,9 @@ </PropertyGroup> <ItemGroup> <Reference Include="System" /> + <Reference Include="System.Data" /> <Reference Include="System.Drawing" /> + <Reference Include="System.Speech, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" /> <Reference Include="System.Windows.Forms" /> <Reference Include="System.Xml" /> </ItemGroup> Modified: trunk/plugins/IR Server Suite/Documentation/introduction.html =================================================================== --- trunk/plugins/IR Server Suite/Documentation/introduction.html 2008-02-13 07:16:16 UTC (rev 1365) +++ trunk/plugins/IR Server Suite/Documentation/introduction.html 2008-02-14 11:00:35 UTC (rev 1366) @@ -19,9 +19,15 @@ By having one point of access to the IR Device, Input Service regulates the communications with the IR Device. This means that multiple plugins and applications can be accessing the device at effectively the same time without interfering with each other.<BR> <BR> This means, for example, the MediaPortal TV Server as well as the MediaPortal client can share the device. And by using other applications in the suite you can control your whole PC.<BR> - </P> +<P><B>System requirements</B><BR> +<UL> +<LI>Windows XP or Vista</LI> +<LI>Microsoft .net 2.0</LI> +<LI>A supported remote control or input device</LI> +</UL> + <P><B>Suite Overview</B><BR> <BR> <A HREF="Input Service\index.html">Input Service</A><BR> Modified: trunk/plugins/IR Server Suite/Documentation/new.html =================================================================== --- trunk/plugins/IR Server Suite/Documentation/new.html 2008-02-13 07:16:16 UTC (rev 1365) +++ trunk/plugins/IR Server Suite/Documentation/new.html 2008-02-14 11:00:35 UTC (rev 1366) @@ -33,7 +33,8 @@ <LI>Translator: Can create a shortcut on the users desktop to launch a macro.</LI> <LI>Documentation: New documentation areas (Troubleshooting FAQ) and improvements.</LI> <LI>MCE Remote Receiver: Can now set remote and keyboard repeat rates to mimic system keyboard repeat rate settings.</LI> -<LI>IR Server Plugin: Added support for HCW (Hauppauge) Receiver.</LI> +<LI>IR Server Plugin: Added support for HCW (Hauppauge) Receiver - Experimental.</LI> +<LI>Translator: Added a "remap" button for changing the button associated with a command.</LI> </UL></P> <BR> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Properties/AssemblyInfo.cs 2008-02-13 07:16:16 UTC (rev 1365) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Properties/AssemblyInfo.cs 2008-02-14 11:00:35 UTC (rev 1366) @@ -21,7 +21,7 @@ [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: GuidAttribute("A03753AF-FBBF-44e0-9964-144C48A4D2CF")] +[assembly: Guid("A03753AF-FBBF-44e0-9964-144C48A4D2CF")] // Version information for an assembly consists of the following four values: // 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 2008-02-13 07:16:16 UTC (rev 1365) +++ trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/Properties/AssemblyInfo.cs 2008-02-14 11:00:35 UTC (rev 1366) @@ -34,6 +34,6 @@ [assembly: AssemblyFileVersion("1.0.4.2")] [assembly: CLSCompliant(true)] -[assembly: GuidAttribute("db244336-eeac-4789-af94-6fbe53df225f")] +[assembly: Guid("db244336-eeac-4789-af94-6fbe53df225f")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, UnmanagedCode = true)] Modified: trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/Properties/AssemblyInfo.cs 2008-02-13 07:16:16 UTC (rev 1365) +++ trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/Properties/AssemblyInfo.cs 2008-02-14 11:00:35 UTC (rev 1366) @@ -33,4 +33,4 @@ [assembly: AssemblyFileVersion("1.0.4.2")] [assembly: CLSCompliant(true)] -[assembly: GuidAttribute("560F8887-A826-40c8-BAB2-022FB7011EEF")] +[assembly: Guid("560F8887-A826-40c8-BAB2-022FB7011EEF")] 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 2008-02-13 07:16:16 UTC (rev 1365) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/Properties/AssemblyInfo.cs 2008-02-14 11:00:35 UTC (rev 1366) @@ -33,4 +33,4 @@ [assembly: AssemblyFileVersion("1.0.4.2")] [assembly: CLSCompliant(true)] -[assembly: GuidAttribute("efdc4eaa-6ccc-4928-a1e7-f4b634780081")] +[assembly: Guid("efdc4eaa-6ccc-4928-a1e7-f4b634780081")] 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 2008-02-13 07:16:16 UTC (rev 1365) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/Properties/AssemblyInfo.cs 2008-02-14 11:00:35 UTC (rev 1366) @@ -33,4 +33,4 @@ [assembly: AssemblyFileVersion("1.0.4.2")] [assembly: CLSCompliant(true)] -[assembly: GuidAttribute("a50e930e-1653-40d5-ba5a-3c0315868c1b")] +[assembly: Guid("a50e930e-1653-40d5-ba5a-3c0315868c1b")] 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 2008-02-13 07:16:16 UTC (rev 1365) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/Properties/AssemblyInfo.cs 2008-02-14 11:00:35 UTC (rev 1366) @@ -33,4 +33,4 @@ [assembly: AssemblyFileVersion("1.0.4.2")] [assembly: CLSCompliant(true)] -[assembly: GuidAttribute("fef45a20-12af-4750-b7fa-8c8b6ea42a15")] +[assembly: Guid("fef45a20-12af-4750-b7fa-8c8b6ea42a15")] Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/Properties/AssemblyInfo.cs 2008-02-13 07:16:16 UTC (rev 1365) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/Properties/AssemblyInfo.cs 2008-02-14 11:00:35 UTC (rev 1366) @@ -33,4 +33,4 @@ [assembly: AssemblyFileVersion("1.0.4.2")] [assembly: CLSCompliant(true)] -[assembly: GuidAttribute("2286B6BF-A7F8-4f1a-B72A-764B5002C949")] +[assembly: Guid("2286B6BF-A7F8-4f1a-B72A-764B5002C949")] Added: trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/Configure.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/Configure.Designer.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/Configure.Designer.cs 2008-02-14 11:00:35 UTC (rev 1366) @@ -0,0 +1,100 @@ +namespace LiveDriveReceiver +{ + + partial class Configure + { + /// <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.buttonOK = new System.Windows.Forms.Button(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.toolTips = new System.Windows.Forms.ToolTip(this.components); + this.comboBox1 = new System.Windows.Forms.ComboBox(); + 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(112, 104); + this.buttonOK.Name = "buttonOK"; + this.buttonOK.Size = new System.Drawing.Size(64, 24); + this.buttonOK.TabIndex = 4; + 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(184, 104); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(64, 24); + this.buttonCancel.TabIndex = 5; + this.buttonCancel.Text = "Cancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); + // + // comboBox1 + // + this.comboBox1.FormattingEnabled = true; + this.comboBox1.Location = new System.Drawing.Point(8, 32); + this.comboBox1.Name = "comboBox1"; + this.comboBox1.Size = new System.Drawing.Size(240, 21); + this.comboBox1.TabIndex = 6; + // + // Configure + // + 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(256, 137); + this.Controls.Add(this.comboBox1); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.buttonOK); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(264, 164); + this.Name = "Configure"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "LiveDrive / Audigy Drive Configuration"; + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Button buttonOK; + private System.Windows.Forms.Button buttonCancel; + private System.Windows.Forms.ToolTip toolTips; + private System.Windows.Forms.ComboBox comboBox1; + } + +} Added: trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/Configure.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/Configure.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/Configure.cs 2008-02-14 11:00:35 UTC (rev 1366) @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Runtime.InteropServices; +using System.Text; +using System.Windows.Forms; + +namespace LiveDriveReceiver +{ + + partial class Configure : Form + { + + #region Interop + + [DllImport("winmm.dll")] + static extern int midiInGetDevCaps(int uDeviceID, ref MidiInCaps lpCaps, int uSize); + + #endregion Interop + + #region Structures + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] + struct MidiInCaps + { + public const int MAXPNAMELEN = 32; + + public Int16 wMid; + public Int16 wPid; + public Int32 vDriverVersion; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAXPNAMELEN)] + public byte[] szPname; + public Int32 dwSupport; + } + + #endregion Structures + + + #region Properties + + + #endregion Properties + + #region Constructor + + public Configure() + { + InitializeComponent(); + } + + #endregion Constructor + + #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/IR Server Plugins/LiveDrive Receiver/Configure.resx =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/Configure.resx (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/Configure.resx 2008-02-14 11:00:35 UTC (rev 1366) @@ -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.... [truncated message content] |
From: <an...@us...> - 2008-02-16 13:08:03
|
Revision: 1370 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1370&view=rev Author: and-81 Date: 2008-02-16 05:08:01 -0800 (Sat, 16 Feb 2008) Log Message: ----------- Modified Paths: -------------- 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/IR Server Plugins/Ads Tech PTV-335 Receiver/Ads Tech PTV-335 Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/AdsTechPTV335Receiver.cs 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/RawInput.cs trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/ReceiverWindow.cs 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/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/General HID Receiver/General HID Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/General HID Receiver/General HID Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Config.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Config.cs trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Girder Plugin.cs trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Girder Plugin.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/GirderPluginWrapper.cs trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/Configure.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/HCW Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/HcwReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/IrRemoteWrapper.cs trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/ReceiverWindow.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IConfigure.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IKeyboardReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/ILearnIR.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IMouseReceiver.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/IRemoteReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/ITransmitIR.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/Configure.Designer.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/IRMan Receiver/IRMan Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/CSocketPacket.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/Configure.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/Configure.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/IgorPlug Receiver/IgorPlug Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/IgorPlug Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/IrDecoder.cs trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/MceDetectionData.cs trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/RemoteDetectionData.cs trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/Configure.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/LiveDriveReceiver.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/DeviceIoOverlapped.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/RedEye Blaster/Configure.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/RedEye Blaster/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/RedEye Blaster/RedEye Blaster.cs trunk/plugins/IR Server Suite/IR Server Plugins/RedEye Blaster/RedEye Blaster.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Serial IR Blaster/Configure.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Serial IR Blaster/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/Serial IR Blaster/Serial IR Blaster.cs trunk/plugins/IR Server Suite/IR Server Plugins/Serial IR Blaster/Serial IR Blaster.csproj trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/Configure.Designer.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/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/Wii Remote Receiver/Mouse.cs trunk/plugins/IR Server Suite/IR Server Plugins/Wii Remote Receiver/Setup.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Wii Remote Receiver/Setup.cs trunk/plugins/IR Server Suite/IR Server Plugins/Wii Remote Receiver/Wii Remote Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Wii Remote Receiver/Wii Remote Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/Configure.Designer.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/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/Configure.Designer.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/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 - Debug.nsi trunk/plugins/IR Server Suite/IR Server Suite - Release.nsi 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/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/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/Configuration.csproj trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Program.cs Added Paths: ----------- trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/PluginBase.cs trunk/plugins/IR Server Suite/IR Server Plugins/RC102 Receiver/ trunk/plugins/IR Server Suite/IR Server Plugins/RC102 Receiver/Properties/ trunk/plugins/IR Server Suite/IR Server Plugins/RC102 Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/RC102 Receiver/RC102 Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/RC102 Receiver/RC102Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Tira Transceiver/ trunk/plugins/IR Server Suite/IR Server Plugins/Tira Transceiver/Configure.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Tira Transceiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/Tira Transceiver/Configure.resx trunk/plugins/IR Server Suite/IR Server Plugins/Tira Transceiver/Properties/ trunk/plugins/IR Server Suite/IR Server Plugins/Tira Transceiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/Tira Transceiver/Tira Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Tira Transceiver/Tira2.dll trunk/plugins/IR Server Suite/IR Server Plugins/Tira Transceiver/TiraTransceiver.cs Removed Paths: ------------- trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IRServerPluginBase.cs Property Changed: ---------------- trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/ Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs 2008-02-16 11:23:45 UTC (rev 1369) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs 2008-02-16 13:08:01 UTC (rev 1370) @@ -9,7 +9,7 @@ using System.Text; using System.Windows.Forms; -using IRServerPluginInterface; +using InputService.Plugin; using IrssUtils; namespace IRServer @@ -20,7 +20,7 @@ #region Variables - IRServerPluginBase[] _transceivers; + PluginBase[] _transceivers; IRServerMode _mode = IRServerMode.ServerMode; string _hostComputer = String.Empty; @@ -167,7 +167,7 @@ row++; - foreach (IRServerPluginBase transceiver in _transceivers) + foreach (PluginBase transceiver in _transceivers) { gridPlugins.Rows.Insert(row); @@ -264,7 +264,7 @@ string plugin = gridPlugins[cell.Row.Index, 0].DisplayText; - foreach (IRServerPluginBase transceiver in _transceivers) + foreach (PluginBase transceiver in _transceivers) if (transceiver.Name.Equals(plugin, StringComparison.OrdinalIgnoreCase)) (transceiver as IConfigure).Configure(this); } @@ -353,7 +353,7 @@ { string name = gridPlugins[row, 0].DisplayText; - IRServerPluginBase plugin = Program.GetPlugin(name); + PluginBase plugin = Program.GetPlugin(name); bool detected = plugin.Detect(); Modified: trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2008-02-16 11:23:45 UTC (rev 1369) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2008-02-16 13:08:01 UTC (rev 1370) @@ -13,7 +13,7 @@ using Microsoft.Win32; using Microsoft.Win32.SafeHandles; -using IRServerPluginInterface; +using InputService.Plugin; using IrssComms; using IrssUtils; @@ -71,10 +71,10 @@ bool _registered; // Used for relay and repeater modes. string[] _pluginNameReceive; - List<IRServerPluginBase> _pluginReceive; + List<PluginBase> _pluginReceive; string _pluginNameTransmit; - IRServerPluginBase _pluginTransmit; + PluginBase _pluginTransmit; bool _inConfiguration; @@ -172,13 +172,13 @@ } else { - _pluginReceive = new List<IRServerPluginBase>(_pluginNameReceive.Length); + _pluginReceive = new List<PluginBase>(_pluginNameReceive.Length); for (int index = 0; index < _pluginNameReceive.Length; index++) { string pluginName = _pluginNameReceive[index]; - IRServerPluginBase plugin = Program.GetPlugin(pluginName); + PluginBase plugin = Program.GetPlugin(pluginName); if (plugin == null) { @@ -236,9 +236,9 @@ if (_pluginReceive != null) { - List<IRServerPluginBase> removePlugins = new List<IRServerPluginBase>(); + List<PluginBase> removePlugins = new List<PluginBase>(); - foreach (IRServerPluginBase plugin in _pluginReceive) + foreach (PluginBase plugin in _pluginReceive) { try { @@ -275,7 +275,7 @@ } } - foreach (IRServerPluginBase plugin in removePlugins) + foreach (PluginBase plugin in removePlugins) _pluginReceive.Remove(plugin); if (_pluginReceive.Count == 0) @@ -336,7 +336,7 @@ if (_pluginReceive != null) { - foreach (IRServerPluginBase plugin in _pluginReceive) + foreach (PluginBase plugin in _pluginReceive) { try { @@ -467,7 +467,7 @@ if (_pluginReceive != null) { - foreach (IRServerPluginBase plugin in _pluginReceive) + foreach (PluginBase plugin in _pluginReceive) { try { @@ -512,7 +512,7 @@ if (_pluginReceive != null) { - foreach (IRServerPluginBase plugin in _pluginReceive) + foreach (PluginBase plugin in _pluginReceive) { try { @@ -1280,12 +1280,12 @@ { IrssMessage response = new IrssMessage(MessageType.AvailableBlasters, MessageFlags.Response); - IRServerPluginBase[] plugins = Program.AvailablePlugins(); + PluginBase[] plugins = Program.AvailablePlugins(); StringBuilder blasters = new StringBuilder(); for (int index = 0; index < plugins.Length; index++) { - IRServerPluginBase plugin = plugins[index]; + PluginBase plugin = plugins[index]; if (plugin is ITransmitIR) { @@ -1314,12 +1314,12 @@ { IrssMessage response = new IrssMessage(MessageType.AvailableReceivers, MessageFlags.Response); - IRServerPluginBase[] plugins = Program.AvailablePlugins(); + PluginBase[] plugins = Program.AvailablePlugins(); StringBuilder receivers = new StringBuilder(); for (int index = 0; index < plugins.Length; index++) { - IRServerPluginBase plugin = plugins[index]; + PluginBase plugin = plugins[index]; if (plugin is IRemoteReceiver || plugin is IKeyboardReceiver || plugin is IMouseReceiver) { Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2008-02-16 11:23:45 UTC (rev 1369) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2008-02-16 13:08:01 UTC (rev 1370) @@ -8,7 +8,7 @@ using Microsoft.Win32; -using IRServerPluginInterface; +using InputService.Plugin; using IrssUtils; namespace IRServer @@ -76,11 +76,11 @@ /// Retreives a list of available IR Server plugins. /// </summary> /// <returns>Array of plugin instances.</returns> - internal static IRServerPluginBase[] AvailablePlugins() + internal static PluginBase[] AvailablePlugins() { try { - List<IRServerPluginBase> plugins = new List<IRServerPluginBase>(); + List<PluginBase> plugins = new List<PluginBase>(); string installFolder = SystemRegistry.GetInstallFolder(); if (String.IsNullOrEmpty(installFolder)) @@ -97,9 +97,9 @@ foreach (Type type in types) { - if (type.IsClass && !type.IsAbstract && type.IsSubclassOf(typeof(IRServerPluginBase))) + if (type.IsClass && !type.IsAbstract && type.IsSubclassOf(typeof(PluginBase))) { - IRServerPluginBase plugin = (IRServerPluginBase)assembly.CreateInstance(type.FullName); + PluginBase plugin = (PluginBase)assembly.CreateInstance(type.FullName); if (plugin != null) plugins.Add(plugin); @@ -139,16 +139,16 @@ /// </summary> /// <param name="pluginName">Name of plugin to instantiate.</param> /// <returns>Plugin instance.</returns> - internal static IRServerPluginBase GetPlugin(string pluginName) + internal static PluginBase GetPlugin(string pluginName) { if (String.IsNullOrEmpty(pluginName)) throw new ArgumentNullException("pluginName"); - IRServerPluginBase[] serverPlugins = AvailablePlugins(); + PluginBase[] serverPlugins = AvailablePlugins(); if (serverPlugins == null) throw new FileNotFoundException("No available plugins found"); - foreach (IRServerPluginBase plugin in serverPlugins) + foreach (PluginBase plugin in serverPlugins) if (plugin.Name.Equals(pluginName, StringComparison.OrdinalIgnoreCase)) return plugin; @@ -163,11 +163,11 @@ { try { - IRServerPluginBase[] plugins = AvailablePlugins(); + PluginBase[] plugins = AvailablePlugins(); List<string> receivers = new List<string>(); - foreach (IRServerPluginBase plugin in plugins) + foreach (PluginBase plugin in plugins) { try { @@ -211,11 +211,11 @@ { try { - IRServerPluginBase[] plugins = Program.AvailablePlugins(); + PluginBase[] plugins = Program.AvailablePlugins(); List<string> blasters = new List<string>(); - foreach (IRServerPluginBase plugin in plugins) + foreach (PluginBase plugin in plugins) if (plugin is ITransmitIR && plugin.Detect()) blasters.Add(plugin.Name); Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/Ads Tech PTV-335 Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/Ads Tech PTV-335 Receiver.csproj 2008-02-16 11:23:45 UTC (rev 1369) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/Ads Tech PTV-335 Receiver.csproj 2008-02-16 13:08:01 UTC (rev 1370) @@ -7,7 +7,7 @@ <ProjectGuid>{E146C2D8-6842-46C5-B2A9-AFA9D6F1A3BB}</ProjectGuid> <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>AdsTechPTV335Receiver</RootNamespace> + <RootNamespace>InputService.Plugin</RootNamespace> <AssemblyName>Ads Tech PTV-335 Receiver</AssemblyName> <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent> </PropertyGroup> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/AdsTechPTV335Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/AdsTechPTV335Receiver.cs 2008-02-16 11:23:45 UTC (rev 1369) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/AdsTechPTV335Receiver.cs 2008-02-16 13:08:01 UTC (rev 1370) @@ -3,15 +3,13 @@ using System.Threading; using System.Runtime.InteropServices; -using IRServerPluginInterface; - -namespace AdsTechPTV335Receiver +namespace InputService.Plugin { /// <summary> /// IR Server plugin to support the Ads Tech PTV-335 Receiver device. /// </summary> - public class AdsTechPTV335Receiver : IRServerPluginBase, IRemoteReceiver + public class AdsTechPTV335Receiver : PluginBase, IRemoteReceiver { #region Interop Modified: 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.Designer.cs 2008-02-16 11:23:45 UTC (rev 1369) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/AdvancedSettings.Designer.cs 2008-02-16 13:08:01 UTC (rev 1370) @@ -1,4 +1,4 @@ -namespace CustomHIDReceiver +namespace InputService.Plugin { partial class AdvancedSettings Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/AdvancedSettings.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/AdvancedSettings.cs 2008-02-16 11:23:45 UTC (rev 1369) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/AdvancedSettings.cs 2008-02-16 13:08:01 UTC (rev 1370) @@ -6,7 +6,7 @@ using System.Text; using System.Windows.Forms; -namespace CustomHIDReceiver +namespace InputService.Plugin { internal partial class AdvancedSettings : Form 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 2008-02-16 11:23:45 UTC (rev 1369) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs 2008-02-16 13:08:01 UTC (rev 1370) @@ -11,17 +11,40 @@ using Microsoft.Win32.SafeHandles; -using IRServerPluginInterface; - -namespace CustomHIDReceiver +namespace InputService.Plugin { /// <summary> /// IR Server plugin to support HID USB devices. /// </summary> - public class CustomHIDReceiver : IRServerPluginBase, IConfigure, IRemoteReceiver, IKeyboardReceiver, IMouseReceiver + public class CustomHIDReceiver : PluginBase, IConfigure, IRemoteReceiver, IKeyboardReceiver, IMouseReceiver { + static void Remote(string code) + { + Console.WriteLine(code); + } + + [STAThread] + static void Main() + { + CustomHIDReceiver c = new CustomHIDReceiver(); + + c.Configure(null); + + c.RemoteCallback += new RemoteHandler(Remote); + + + c.Start(); + + Application.Run(); + + c.Stop(); + c = null; + + + } + #region Constants static readonly string ConfigurationFile = @@ -57,21 +80,7 @@ #endregion Variables - #region Constructor - /// <summary> - /// Initializes a new instance of the <see cref="CustomHIDReceiver"/> class. - /// </summary> - public CustomHIDReceiver() - { - LoadSettings(); - - _receiverWindow = new ReceiverWindow("Custom HID Receiver"); - } - - #endregion Constructor - - /// <summary> /// Name of the IR Server plugin. /// </summary> /// <value>The name.</value> @@ -93,22 +102,13 @@ public override string Description { get { return "Supports HID USB devices."; } } /// <summary> - /// Detect the presence of this device. Devices that cannot be detected will always return false. - /// </summary> - /// <returns> - /// <c>true</c> if the device is present, otherwise <c>false</c>. - /// </returns> - public override bool Detect() - { - // TODO: Add detection code. - return false; - } - - /// <summary> /// Start the IR Server plugin. /// </summary> public override void Start() { + LoadSettings(); + + _receiverWindow = new ReceiverWindow("Custom HID Receiver"); _receiverWindow.ProcMsg += new ProcessMessage(ProcMessage); _device.dwFlags = RawInput.RawInputDeviceFlags.InputSink; @@ -140,6 +140,8 @@ RegisterForRawInput(_device); _receiverWindow.ProcMsg -= new ProcessMessage(ProcMessage); + _receiverWindow.DestroyHandle(); + _receiverWindow = null; } /// <summary> @@ -147,7 +149,10 @@ /// </summary> public void Configure(IWin32Window owner) { + LoadSettings(); + DeviceSelect deviceSelect = new DeviceSelect(); + deviceSelect.SelectedDevice = _device; if (deviceSelect.ShowDialog(owner) == DialogResult.OK) { @@ -400,6 +405,9 @@ #if TRACE Trace.WriteLine( String.Format("E0: {0}", raw.keyboard.MakeCode)); #endif + if (_keyboardHandler != null) + _keyboardHandler(0xE000 | raw.keyboard.MakeCode, true); + break; case RawInput.RawKeyboardFlags.KeyE1: 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 2008-02-16 11:23:45 UTC (rev 1369) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.csproj 2008-02-16 13:08:01 UTC (rev 1370) @@ -5,11 +5,12 @@ <ProductVersion>8.0.50727</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{0F6576B4-C88E-4E79-B7E9-9480498C5A32}</ProjectGuid> - <OutputType>Library</OutputType> + <OutputType>Exe</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>CustomHIDReceiver</RootNamespace> + <RootNamespace>InputService.Plugin</RootNamespace> <AssemblyName>Custom HID Receiver</AssemblyName> <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent> + <StartupObject>InputService.Plugin.CustomHIDReceiver</StartupObject> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>false</DebugSymbols> @@ -83,7 +84,7 @@ <ProjectReference Include="..\IR Server Plugin Interface\IR Server Plugin Interface.csproj"> <Project>{D8B3D28F-62CE-4CA7-86CE-B7EAD614A94C}</Project> <Name>IR Server Plugin Interface</Name> - <Private>False</Private> + <Private>True</Private> </ProjectReference> </ItemGroup> <ItemGroup> Modified: 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.Designer.cs 2008-02-16 11:23:45 UTC (rev 1369) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/DeviceSelect.Designer.cs 2008-02-16 13:08:01 UTC (rev 1370) @@ -1,4 +1,4 @@ -namespace CustomHIDReceiver +namespace InputService.Plugin { partial class DeviceSelect Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/DeviceSelect.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/DeviceSelect.cs 2008-02-16 11:23:45 UTC (rev 1369) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/DeviceSelect.cs 2008-02-16 13:08:01 UTC (rev 1370) @@ -8,7 +8,7 @@ using System.Text; using System.Windows.Forms; -namespace CustomHIDReceiver +namespace InputService.Plugin { internal partial class DeviceSelect : Form @@ -29,7 +29,7 @@ if (listViewDevices.SelectedItems.Count == 1) foreach (DeviceDetails details in _devices) { - if (details.ID.Equals(listViewDevices.SelectedItems[0].SubItems[1].Text)) + if (details.ID.Equals(listViewDevices.SelectedItems[0].SubItems[1].Text, StringComparison.Ordinal)) { RawInput.RAWINPUTDEVICE device = new RawInput.RAWINPUTDEVICE(); device.usUsagePage = details.UsagePage; @@ -40,6 +40,27 @@ return new RawInput.RAWINPUTDEVICE(); } + + set + { + listViewDevices.SelectedItems.Clear(); + + foreach (DeviceDetails details in _devices) + { + if (details.Usage == value.usUsage && details.UsagePage == value.usUsagePage) + { + foreach(ListViewItem item in listViewDevices.Items) + { + if (details.ID.Equals(item.SubItems[1].Text, StringComparison.Ordinal)) + { + item.Selected = true; + return; + } + } + return; + } + } + } } #endregion Properties @@ -100,7 +121,12 @@ private void buttonAdvanced_Click(object sender, EventArgs e) { + AdvancedSettings advancedSettings = new AdvancedSettings(); + if (advancedSettings.ShowDialog(this) == DialogResult.OK) + { + } + } Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/RawInput.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/RawInput.cs 2008-02-16 11:23:45 UTC (rev 1369) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/RawInput.cs 2008-02-16 13:08:01 UTC (rev 1370) @@ -8,7 +8,7 @@ using Microsoft.Win32; -namespace CustomHIDReceiver +namespace InputService.Plugin { internal class DeviceDetails Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/ReceiverWindow.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/ReceiverWindow.cs 2008-02-16 11:23:45 UTC (rev 1369) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/ReceiverWindow.cs 2008-02-16 13:08:01 UTC (rev 1370) @@ -1,7 +1,7 @@ using System; using System.Windows.Forms; -namespace CustomHIDReceiver +namespace InputService.Plugin { #region Delegates Modified: 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/Direct Input Receiver.csproj 2008-02-16 11:23:45 UTC (rev 1369) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/Direct Input Receiver.csproj 2008-02-16 13:08:01 UTC (rev 1370) @@ -7,7 +7,7 @@ <ProjectGuid>{732CDF64-D047-4D3C-91DA-E2FF27D84179}</ProjectGuid> <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>DirectInputReceiver</RootNamespace> + <RootNamespace>InputService.Plugin</RootNamespace> <AssemblyName>Direct Input Receiver</AssemblyName> <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent> </PropertyGroup> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/DirectInputListener.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/DirectInputListener.cs 2008-02-16 11:23:45 UTC (rev 1369) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/DirectInputListener.cs 2008-02-16 13:08:01 UTC (rev 1370) @@ -27,7 +27,7 @@ using System.Threading; using Microsoft.DirectX.DirectInput; -namespace DirectInputReceiver +namespace InputService.Plugin { /// <summary> /// Summary description for DirectInputListener. Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/DirectInputReceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/DirectInputReceiver.cs 2008-02-16 11:23:45 UTC (rev 1369) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/DirectInputReceiver.cs 2008-02-16 13:08:01 UTC (rev 1370) @@ -8,15 +8,13 @@ using Microsoft.DirectX.DirectInput; -using IRServerPluginInterface; - -namespace DirectInputReceiver +namespace InputService.Plugin { /// <summary> /// IR Server Plugin for Direct Input game controllers. /// </summary> - public class DirectInputReceiver : IRServerPluginBase, IRemoteReceiver, IMouseReceiver, IConfigure + public class DirectInputReceiver : PluginBase, IRemoteReceiver, IMouseReceiver, IConfigure { #region Constants 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 2008-02-16 11:23:45 UTC (rev 1369) +++ trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionREMOTE Receiver.csproj 2008-02-16 13:08:01 UTC (rev 1370) @@ -7,7 +7,7 @@ <ProjectGuid>{9FDD649E-0502-4FED-9AC1-AA0346394375}</ProjectGuid> <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>FusionRemoteReceiver</RootNamespace> + <RootNamespace>InputService.Plugin</RootNamespace> <AssemblyName>FusionREMOTE Receiver</AssemblyName> <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent> </PropertyGroup> 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 2008-02-16 11:23:45 UTC (rev 1369) +++ trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs 2008-02-16 13:08:01 UTC (rev 1370) @@ -14,15 +14,13 @@ using Microsoft.Win32.SafeHandles; -using IRServerPluginInterface; - -namespace FusionRemoteReceiver +namespace InputService.Plugin { /// <summary> /// IR Server Plugin for the DViCO FusionREMOTE USB Receiver device. /// </summary> - public class FusionRemoteReceiver : IRServerPluginBase, IRemoteReceiver + public class FusionRemoteReceiver : PluginBase, IRemoteReceiver { #region Constants Modified: trunk/plugins/IR Server Suite/IR Server Plugins/General HID Receiver/General HID Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/General HID Receiver/General HID Receiver.cs 2008-02-16 11:23:45 UTC (rev 1369) +++ trunk/plugins/IR Server Suite/IR Server Plugins/General HID Receiver/General HID Receiver.cs 2008-02-16 13:08:01 UTC (rev 1370) @@ -1,18 +1,268 @@ using System; -using System.Collections.Generic; -using System.Text; +using System.ComponentModel; +#if TRACE +using System.Diagnostics; +#endif +using System.IO; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Windows.Forms; -namespace GeneralHIDReceiver +using Microsoft.Win32.SafeHandles; + +namespace InputService.Plugin { - public class GeneralHIDReceiver + /// <summary> + /// Input Service Plugin to support general HID devices. + /// </summary> + public class GeneralHIDReceiver : PluginBase, IRemoteReceiver { - public GeneralHIDReceiver() + #region Interop + + [DllImport("user32.dll")] + static extern IntPtr SetWindowsHookEx(HookType code, HookDelegate func, IntPtr hInstance, int threadID); + + [DllImport("user32.dll")] + static extern int UnhookWindowsHookEx(IntPtr hhook); + + [DllImport("user32.dll")] + static extern int CallNextHookEx(IntPtr hhook, int code, int wParam, IntPtr lParam); + + [DllImport("kernel32.dll")] + static extern IntPtr LoadLibrary(string lpFileName); + + #endregion Interop + + #region Delegates + + delegate int HookDelegate(int code, int wParam, IntPtr lParam); + + #endregion Delegates + + #region Enumerations + + enum HookType { + WH_JOURNALRECORD = 0, + WH_JOURNALPLAYBACK = 1, + WH_KEYBOARD = 2, + WH_GETMESSAGE = 3, + WH_CALLWNDPROC = 4, + WH_CBT = 5, + WH_SYSMSGFILTER = 6, + WH_MOUSE = 7, + WH_HARDWARE = 8, + WH_DEBUG = 9, + WH_SHELL = 10, + WH_FOREGROUNDIDLE = 11, + WH_CALLWNDPROCRET = 12, + WH_KEYBOARD_LL = 13, + WH_MOUSE_LL = 14 + } + enum AppCommands + { + None = 0, + BrowserBackward = 1, + BrowserForward = 2, + BrowserRefresh = 3, + BrowserStop = 4, + BrowserSearch = 5, + BrowserFavorites = 6, + BrowserHome = 7, + VolumeMute = 8, + VolumeDown = 9, + VolumeUp = 10, + MediaNextTrack = 11, + MediaPreviousTrack = 12, + MediaStop = 13, + MediaPlayPause = 14, + LaunchMail = 15, + LaunchMediaSelect = 16, + LaunchApp1 = 17, + LaunchApp2 = 18, + BassDown = 19, + BassBoost = 20, + BassUp = 21, + TrebleDown = 22, + TrebleUp = 23, + MicrophoneVolumeMute = 24, + MicrophoneVolumeDown = 25, + MicrophoneVolumeUp = 26, + Help = 27, + Find = 28, + New = 29, + Open = 30, + Close = 31, + Save = 32, + Print = 33, + Undo = 34, + Redo = 35, + Copy = 36, + Cut = 37, + Paste = 38, + ReplyToMail = 39, + ForwardMail = 40, + SendMail = 41, + SpellCheck = 42, + DictateOrCommandControlToggle = 43, + MicrophoneOnOffToggle = 44, + CorrectionList = 45, + MediaPlay = 46, + MediaPause = 47, + MediaRecord = 48, + MediaFastForward = 49, + MediaRewind = 50, + MediaChannelUp = 51, + MediaChannelDown = 52, } + #endregion Enumerations + + #region Structures + + struct KeyboardHookStruct + { + + /// <summary> + /// Initializes a new instance of the <see cref="KeyboardHookStruct"/> struct. + /// </summary> + /// <param name="lParam">The lParam to derive from.</param> + public KeyboardHookStruct(IntPtr lParam) + { + KeyboardHookStruct khs = (KeyboardHookStruct)Marshal.PtrToStructure(lParam, typeof(KeyboardHookStruct)); + + virtualKey = khs.virtualKey; + scanCode = khs.scanCode; + flags = khs.flags; + time = khs.time; + dwExtraInfo = khs.dwExtraInfo; + } + + public int virtualKey; + public int scanCode; + public int flags; + public int time; + public int dwExtraInfo; + } + + #endregion Structures + + #region Variables + + RemoteHandler _remoteButtonHandler; + + IntPtr _hookHandle; + + #endregion Variables + + #region Implementation + + /// <summary> + /// Name of the IR Server plugin. + /// </summary> + /// <value>The name.</value> + public override string Name { get { return "General HID"; } } + /// <summary> + /// IR Server plugin version. + /// </summary> + /// <value>The version.</value> + public override string Version { get { return "1.0.4.2"; } } + /// <summary> + /// The IR Server plugin's author. + /// </summary> + /// <value>The author.</value> + public override string Author { get { return "and-81"; } } + /// <summary> + /// A description of the IR Server plugin. + /// </summary> + /// <value>The description.</value> + public override string Description { get { return "Supports general HID devices"; } } + + /// <summary> + /// Start the IR Server plugin. + /// </summary> + public override void Start() + { + IntPtr hInstance = LoadLibrary("User32"); + _hookHandle = SetWindowsHookEx(HookType.WH_KEYBOARD_LL, new HookDelegate(InternalHookDelegate), hInstance, 0); + } + /// <summary> + /// Suspend the IR Server plugin when computer enters standby. + /// </summary> + public override void Suspend() + { + Stop(); + } + /// <summary> + /// Resume the IR Server plugin when the computer returns from standby. + /// </summary> + public override void Resume() + { + Start(); + } + /// <summary> + /// Stop the IR Server plugin. + /// </summary> + public override void Stop() + { + UnhookWindowsHookEx(_hookHandle); + _hookHandle = IntPtr.Zero; + } + + /// <summary> + /// Callback for remote button presses. + /// </summary> + /// <value>The remote callback.</value> + public RemoteHandler RemoteCallback + { + get { return _remoteButtonHandler; } + set { _remoteButtonHandler = value; } + } + + + int InternalHookDelegate(int code, int wParam, IntPtr lParam) + { + if (code >= 0 && wParam == 256) + { + KeyboardHookStruct khs = new KeyboardHookStruct(lParam); + + AppCommands appCommand = KeyCodeToAppCommand((Keys)khs.virtualKey); + + if (appCommand != AppCommands.None) + { + int keys = (int)appCommand & ~0xF000; + int keyCode = (keys << 16) | code; + + if (_remoteButtonHandler != null) + _remoteButtonHandler(keyCode.ToString()); + + return 1; + } + } + + return CallNextHookEx(_hookHandle, code, wParam, lParam); + } + + static AppCommands KeyCodeToAppCommand(Keys keyCode) + { + switch (keyCode) + { + case Keys.MediaNextTrack: return AppCommands.MediaNextTrack; + case Keys.MediaPlayPause: return AppCommands.MediaPlayPause; + case Keys.MediaPreviousTrack: return AppCommands.MediaPreviousTrack; + case Keys.MediaStop: return AppCommands.MediaStop; + case Keys.VolumeDown: return AppCommands.VolumeDown; + case Keys.VolumeMute: return AppCommands.VolumeMute; + case Keys.VolumeUp: return AppCommands.VolumeUp; + default: return AppCommands.None; + } + } + + #endregion Implementation + } } Modified: trunk/plugins/IR Server Suite/IR Server Plugins/General HID Receiver/General HID Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/General HID Receiver/General HID Receiver.csproj 2008-02-16 11:23:45 UTC (rev 1369) +++ trunk/plugins/IR Server Suite/IR Server Plugins/General HID Receiver/General HID Receiver.csproj 2008-02-16 13:08:01 UTC (rev 1370) @@ -7,7 +7,7 @@ <ProjectGuid>{26DEDF6D-F60D-4311-9A9E-DDF64500D5BF}</ProjectGuid> <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>General_HID_Receiver</RootNamespace> + <RootNamespace>InputService.Plugin</RootNamespace> <AssemblyName>General HID Receiver</AssemblyName> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> @@ -18,6 +18,8 @@ <DefineConstants>DEBUG;TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <UseVSHostingProcess>false</UseVSHostingProcess> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>pdbonly</DebugType> @@ -30,12 +32,21 @@ <ItemGroup> <Reference Include="System" /> <Reference Include="System.Data" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> <Compile Include="General HID Receiver.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\IR Server Plugin Interface\IR Server Plugin Interface.csproj"> + <Project>{D8B3D28F-62CE-4CA7-86CE-B7EAD614A94C}</Project> + <Name>IR Server Plugin Interface</Name> + <Private>False</Private> + </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. Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Config.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Config.Designer.cs 2008-02-16 11:23:45 UTC (rev 1369) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Config.Designer.cs 2008-02-16 13:08:01 UTC (rev 1370) @@ -1,4 +1,4 @@ -namespace GirderPlugin +namespace InputService.Plugin { partial class Config { Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Config.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Config.cs 2008-02-16 11:23:45 UTC (rev 1369) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Config.cs 2008-02-16 13:08:01 UTC (rev 1370) @@ -6,7 +6,7 @@ using System.Text; using System.Windows.Forms; -namespace GirderPlugin +namespace InputService.Plugin { /// <summary> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Girder Plugin.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Girder Plugin.cs 2008-02-16 11:23:45 UTC (rev 1369) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Girder Plugin.cs 2008-02-16 13:08:01 UTC (rev 1370) @@ -8,15 +8,13 @@ using System.Windows.Forms; using System.Xml; -using IRServerPluginInterface; - -namespace GirderPlugin +namespace InputService.Plugin { /// <summary> /// IR Server Plugin for using Girder 3.x plugins. /// </summary> - public class GirderPlugin : IRServerPluginBase, IRemoteReceiver, ITransmitIR, IConfigure + public class GirderPlugin : PluginBase, IRemoteReceiver, ITransmitIR, IConfigure { #region Constants Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Girder Plugin.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Girder Plugin.csproj 2008-02-16 11:23:45 UTC (rev 1369) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Girder Plugin.csproj 2008-02-16 13:08:01 UTC (rev 1370) @@ -7,7 +7,7 @@ <ProjectGuid>{0C291BE9-5D15-4097-9119-4FFE19C23113}</ProjectGuid> <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>GirderPlugin</RootNamespace> + <RootNamespace>InputService.Plugin</RootNamespace> <AssemblyName>Girder Plugin</AssemblyName> <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent> <ApplicationIcon> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/GirderPluginWrapper.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/GirderPluginWrapper.cs 2008-02-16 11:23:45 UTC (rev 1369) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/GirderPluginWrapper.cs 2008-02-16 13:08:01 UTC (rev 1370) @@ -8,7 +8,7 @@ using System.Threading; using System.Xml; -namespace GirderPlugin +namespace InputService.Plugin { #region Structures Modified: trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/Configure.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/Configure.Designer.cs 2008-02-16 11:23:45 UTC (rev 1369) +++ trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/Configure.Designer.cs 2008-02-16 13:08:01 UTC (rev 1370) @@ -1,4 +1,4 @@ -namespace HcwReceiver +namespace InputService.Plugin { partial class Configure { Modified: trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/Configure.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/Configure.cs 2008-02-16 11:23:45 UTC (rev 1369) +++ trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/Configure.cs 2008-02-16 13:08:01 UTC (rev 1370) @@ -6,7 +6,7 @@ using System.Text; using System.Windows.Forms; -namespace HcwReceiver +namespace InputService.Plugin { /// <summary> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/HCW Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/HCW Receiver.csproj 2008-02-16 11:23:45 UTC (rev 1369) +++ trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/HCW Receiver.csproj 2008-02-16 13:08:01 UTC (rev 1370) @@ -7,7 +7,7 @@ <ProjectGuid>{EE8F2C22-8BD3-4832-85F0-E6F67ED3AADB}</ProjectGuid> <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>HcwReceiver</RootNamespace> + <RootNamespace>InputService.Plugin</RootNamespace> <AssemblyName>HCW Receiver</AssemblyName> <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent> </PropertyGroup> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/HcwReceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/HcwReceiver.cs 2008-02-16 11:23:45 UTC (rev 1369) +++ trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/HcwReceiver.cs 2008-02-16 13:08:01 UTC (rev 1370) @@ -9,16 +9,14 @@ using Microsoft.Win32.SafeHandles; -using IRServerPluginInterface; - -namespace HcwReceiver +namespace InputService.Plugin { /// <summary> /// IR Server plugin supporting Hauppauge devices. /// </summary> [CLSCompliant(false)] - public class HcwReceiver : IRServerPluginBase, IRemoteReceiver, IConfigure + public class HcwReceiver : PluginBase, IRemoteReceiver, IConfigure { #region Constants Modified: trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/IrRemoteWrapper.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/IrRemoteWrapper.cs 2008-02-16 11:23:45 UTC (rev 1369) +++ trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/IrRemoteWrapper.cs 2008-02-16 13:08:01 UTC (rev 1370) @@ -7,7 +7,7 @@ using Microsoft.Win32; -namespace HcwReceiver +namespace InputService.Plugin { /// <summary> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/ReceiverWindow.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/ReceiverWindow.cs 2008-02-16 11:23:45 UTC (rev 1369) +++ trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/ReceiverWindow.cs 2008-02-16 13:08:01 UTC (rev 1370) @@ -1,7 +1,7 @@ using System; using System.Windows.Forms; -namespace HcwReceiver +namespace InputService.Plugin { #region Delegates Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IConfigure.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IConfigure.cs 2008-02-16 11:23:45 UTC (rev 1369) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IConfigure.cs 2008-02-16 13:08:01 UTC (rev 1370) @@ -1,7 +1,7 @@ using System; using System.Windows.Forms; -namespace IRServerPluginInterface +namespace InputService.Plugin { /// <summary> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IKeyboardReceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IKeyboardReceiver.cs 2008-02-16 11:23:45 UTC (rev 1369) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IKeyboardReceiver.cs 2008-02-16 13:08:01 UTC (rev 1370) @@ -1,6 +1,6 @@ using System; -namespace IRServerPluginInterface +namespace InputService.Plugin { #region Delegates Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/ILearnIR.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/ILearnIR.cs 2008-02-16 11:23:45 UTC (rev 1369) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/ILearnIR.cs 2008-02-16 13:08:01 UTC (rev 1370) @@ -1,6 +1,6 @@ using System; -namespace IRServerPluginInterface +namespace InputService.Plugin { #region Enumerations Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IMouseReceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IMouseReceiver.cs 2008-02-16 11:23:45 UTC (rev 1369) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IMouseReceiver.cs 2008-02-16 13:08:01 UTC (rev 1370) @@ -1,6 +1,6 @@ using System; -namespace IRServerPluginInterface +namespace InputService.Plugin { #region Delegates 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 2008-02-16 11:23:45 UTC (rev 1369) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IR Server Plugin Interface.csproj 2008-02-16 13:08:01 UTC (rev 1370) @@ -7,7 +7,7 @@ <ProjectGuid>{D8B3D28F-62CE-4CA7-86CE-B7EAD614A94C}</ProjectGuid> <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>IRServerPluginInterface</RootNamespace> + <RootNamespace>InputService.Plugin</RootNamespace> <AssemblyName>IRServerPluginInterface</AssemblyName> <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent> </PropertyGroup> @@ -70,7 +70,7 @@ <Compile Include="ILearnIR.cs" /> <Compile Include="IMouseReceiver.cs" /> <Compile Include="IRemoteReceiver.cs" /> - <Compile Include="IRServerPluginBase.cs" /> + <Compile Include="PluginBase.cs" /> <Compile Include="ITransmitIR.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> Deleted: 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/IRServerPluginBase.cs 2008-02-16 11:23:45 UTC (rev 1369) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IRServerPluginBase.cs 2008-02-16 13:08:01 UTC (rev 1370) @@ -1,70 +0,0 @@ -namespace IRServerPluginInterface -{ - - /// <summary> - /// Base class for all IR Server Plugins. - /// </summary> - public abstract class IRServerPluginBase - { - - #region Properties - - /// <summary> - /// Name of the IR Server plugin. - /// </summary> - /// <value>The name.</value> - public abstract string Name { get; } - - /// <summary> - /// IR Server plugin version. - /// </summary> - /// <value>The version.</value> - public abstract string Version { get; } - - /// <summary> - /// The IR Server plugin's author. - /// </summary> - /// <value>The author.</value> - public abstract string Author { get; } - - /// <summary> - /// A description of the IR Server plugin. - /// </summary> - /// <value>The description.</value> - public abstract string Description { get; } - - #endregion Properties - - #region Methods - - /// <summary> - /// Detect the presence of this device. Devices that cannot be detected will always return false. - /// </summary> - /// <returns><c>true</c> if the device is present, otherwise <c>false</c>.</returns> - public virtual bool Detect() { return false; } - - /// <summary> - /// Start the IR Server plugin. - /// </summary> - public abstract void Start(); - - /// <summary> - /// Suspend the IR Server plugin when computer enters standby. - /// </summary> - public abstract void Suspend(); - - /// <summary> - /// Resume the IR Server plugin when the computer returns from standby. - /// </summary> - public abstract void Resume(); - - /// <summary> - /// Stop the IR Server plugin. - /// </summary> - public abstract void Stop(); - - #endregion Methods - - } - -} Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IRemoteReceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IRemoteReceiver.cs 2008-02-16 11:23:45 UTC (rev 1369) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IRemoteReceiver.cs 2008-02-16 13:08:01 UTC (rev 1370) @@ -1,6 +1,6 @@ using System; -namespace IRServerPluginInterface +namespace InputService.Plugin { #region Delegates Modified: 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/ITransmitIR.cs 2008-02-16 11:23:45 UTC (rev 1369) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/ITransmitIR.cs 2008-02-16 13:08:01 UTC (rev 1370) @@ -1,6 +1,6 @@ using S... [truncated message content] |
From: <an...@us...> - 2008-02-20 11:16:55
|
Revision: 1388 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1388&view=rev Author: and-81 Date: 2008-02-20 03:16:53 -0800 (Wed, 20 Feb 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Documentation/new.html trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/Ads Tech PTV-335 Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/Direct Input Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionREMOTE Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Girder Plugin.csproj trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/HCW Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/IrRemoteWrapper.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/IgorPlug Receiver/IgorPlug Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/LiveDrive Receiver.csproj 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/RC102 Receiver/RC102 Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/RedEye Blaster/RedEye Blaster.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Serial IR Blaster/Serial IR Blaster.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Tira Transceiver/Tira Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/USB-UIRT Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Wii Remote Receiver/Wii Remote Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.csproj 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/XBCDRC Receiver/XBCDRC Receiver.csproj trunk/plugins/IR Server Suite/IR Server Suite - Debug.nsi trunk/plugins/IR Server Suite/IR Server Suite - Release.nsi trunk/plugins/IR Server Suite/IR Server Suite.sln Added Paths: ----------- trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/Ira Transceiver/ trunk/plugins/IR Server Suite/IR Server Plugins/Ira Transceiver/Ira Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Ira Transceiver/IraTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Ira Transceiver/Properties/ trunk/plugins/IR Server Suite/IR Server Plugins/Ira Transceiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/Keyboard Input/ trunk/plugins/IR Server Suite/IR Server Plugins/Keyboard Input/Keyboard Input.cs trunk/plugins/IR Server Suite/IR Server Plugins/Keyboard Input/Keyboard Input.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Keyboard Input/Properties/ trunk/plugins/IR Server Suite/IR Server Plugins/Keyboard Input/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/RC102 Receiver/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/RedEye Blaster/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/Serial IR Blaster/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/Speech Receiver/ trunk/plugins/IR Server Suite/IR Server Plugins/Speech Receiver/Properties/ trunk/plugins/IR Server Suite/IR Server Plugins/Speech Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/Speech Receiver/Speech Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Speech Receiver/SpeechReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Tira Transceiver/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/Wii Remote Receiver/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/XBCDRC Receiver/Icon.ico trunk/plugins/IR Server Suite/Media Center Plugins/ Removed Paths: ------------- trunk/plugins/IR Server Suite/IR Server Plugins/General HID Receiver/ Modified: trunk/plugins/IR Server Suite/Documentation/new.html =================================================================== --- trunk/plugins/IR Server Suite/Documentation/new.html 2008-02-20 06:46:41 UTC (rev 1387) +++ trunk/plugins/IR Server Suite/Documentation/new.html 2008-02-20 11:16:53 UTC (rev 1388) @@ -37,7 +37,7 @@ <LI>Translator: Added a "remap" button for changing the button associated with a command.</LI> <LI>IR Server Plugin: Added support for RC102 and compatible receivers - Experimental.</LI> <LI>TCP Comms: Automatically maps "localhost" to loopback address, avoiding the lookup process. This <i>might</i> solve a host name lookup problem for some users.</LI> -<LI>IR Server Plugin: Added General HID plugin, should enable mapping special keyboard buttons (like Forward, Back, Play, Stop, Volume, etc...).</LI> +<LI>IR Server Plugin: Added Keyboard Input plugin, should enable mapping special (App Command) keyboard buttons (like Forward, Back, Play, Stop, Volume, etc...) as well as basic key combinations.</LI> </UL></P> <BR> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/Ads Tech PTV-335 Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/Ads Tech PTV-335 Receiver.csproj 2008-02-20 06:46:41 UTC (rev 1387) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/Ads Tech PTV-335 Receiver.csproj 2008-02-20 11:16:53 UTC (rev 1388) @@ -10,6 +10,7 @@ <RootNamespace>InputService.Plugin</RootNamespace> <AssemblyName>Ads Tech PTV-335 Receiver</AssemblyName> <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent> + <ApplicationIcon>Icon.ico</ApplicationIcon> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> @@ -46,6 +47,9 @@ <Private>False</Private> </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/IR Server Plugins/Ads Tech PTV-335 Receiver/Icon.ico =================================================================== (Binary files differ) Property changes on: trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/Icon.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream 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 2008-02-20 06:46:41 UTC (rev 1387) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.csproj 2008-02-20 11:16:53 UTC (rev 1388) @@ -5,12 +5,14 @@ <ProductVersion>8.0.50727</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{0F6576B4-C88E-4E79-B7E9-9480498C5A32}</ProjectGuid> - <OutputType>Exe</OutputType> + <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>InputService.Plugin</RootNamespace> <AssemblyName>Custom HID Receiver</AssemblyName> <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent> - <StartupObject>InputService.Plugin.CustomHIDReceiver</StartupObject> + <StartupObject> + </StartupObject> + <ApplicationIcon>Icon.ico</ApplicationIcon> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>false</DebugSymbols> @@ -97,6 +99,9 @@ <DependentUpon>DeviceSelect.cs</DependentUpon> </EmbeddedResource> </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/IR Server Plugins/Custom HID Receiver/Icon.ico =================================================================== (Binary files differ) Property changes on: trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Icon.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: 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/Direct Input Receiver.csproj 2008-02-20 06:46:41 UTC (rev 1387) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/Direct Input Receiver.csproj 2008-02-20 11:16:53 UTC (rev 1388) @@ -10,6 +10,7 @@ <RootNamespace>InputService.Plugin</RootNamespace> <AssemblyName>Direct Input Receiver</AssemblyName> <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent> + <ApplicationIcon>Icon.ico</ApplicationIcon> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> @@ -58,6 +59,9 @@ <Private>False</Private> </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/IR Server Plugins/Direct Input Receiver/Icon.ico =================================================================== (Binary files differ) Property changes on: trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/Icon.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream 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 2008-02-20 06:46:41 UTC (rev 1387) +++ trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionREMOTE Receiver.csproj 2008-02-20 11:16:53 UTC (rev 1388) @@ -10,6 +10,7 @@ <RootNamespace>InputService.Plugin</RootNamespace> <AssemblyName>FusionREMOTE Receiver</AssemblyName> <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent> + <ApplicationIcon>Icon.ico</ApplicationIcon> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>false</DebugSymbols> @@ -73,6 +74,9 @@ <Private>False</Private> </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/IR Server Plugins/FusionRemote Receiver/Icon.ico =================================================================== (Binary files differ) Property changes on: trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/Icon.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Girder Plugin.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Girder Plugin.csproj 2008-02-20 06:46:41 UTC (rev 1387) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Girder Plugin.csproj 2008-02-20 11:16:53 UTC (rev 1388) @@ -10,8 +10,7 @@ <RootNamespace>InputService.Plugin</RootNamespace> <AssemblyName>Girder Plugin</AssemblyName> <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent> - <ApplicationIcon> - </ApplicationIcon> + <ApplicationIcon>Icon.ico</ApplicationIcon> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/HCW Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/HCW Receiver.csproj 2008-02-20 06:46:41 UTC (rev 1387) +++ trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/HCW Receiver.csproj 2008-02-20 11:16:53 UTC (rev 1388) @@ -10,6 +10,7 @@ <RootNamespace>InputService.Plugin</RootNamespace> <AssemblyName>HCW Receiver</AssemblyName> <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent> + <ApplicationIcon>Icon.ico</ApplicationIcon> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>false</DebugSymbols> @@ -84,6 +85,9 @@ <Private>False</Private> </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/IR Server Plugins/HCW Receiver/Icon.ico =================================================================== (Binary files differ) Property changes on: trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/Icon.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/IrRemoteWrapper.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/IrRemoteWrapper.cs 2008-02-20 06:46:41 UTC (rev 1387) +++ trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/IrRemoteWrapper.cs 2008-02-20 11:16:53 UTC (rev 1388) @@ -119,8 +119,11 @@ public IrRemoteWrapper() { string dllPath = GetDllPath(); - IRSetDllDirectory(dllPath); + if (String.IsNullOrEmpty(dllPath)) + throw new ApplicationException("Could not find IrRemote.dll folder"); + SetDllDirectory(dllPath); + _window = new ReceiverWindow(); _window.ProcMsg = new ProcessMessage(WndProc); } @@ -152,8 +155,10 @@ /// </summary> public void StartIrExe() { - if (Process.GetProcessesByName("Ir").Length == 0) - Process.Start(GetHCWPath() + "Ir.exe", "/QUIET"); + string exe = GetHCWPath() + "Ir.exe"; + + if (Process.GetProcessesByName("Ir").Length == 0 && File.Exists(exe)) + Process.Start(exe, "/QUIET"); } /// <summary> @@ -161,9 +166,14 @@ /// </summary> public void StopIrExe() { - Process.Start(GetHCWPath() + "Ir.exe", "/QUIT"); - Thread.Sleep(500); + string exe = GetHCWPath() + "Ir.exe"; + if (File.Exists(exe)) + { + Process.Start(exe, "/QUIT"); + Thread.Sleep(500); + } + if (Process.GetProcessesByName("Ir").Length != 0) foreach (Process proc in Process.GetProcessesByName("Ir")) proc.Kill(); @@ -171,11 +181,6 @@ #endregion Public Methods - static bool IRSetDllDirectory(string PathName) - { - return SetDllDirectory(PathName); - } - static string GetHCWPath() { string dllPath = null; 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 2008-02-20 06:46:41 UTC (rev 1387) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.csproj 2008-02-20 11:16:53 UTC (rev 1388) @@ -10,6 +10,7 @@ <RootNamespace>InputService.Plugin</RootNamespace> <AssemblyName>IRMan Receiver</AssemblyName> <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent> + <ApplicationIcon>Icon.ico</ApplicationIcon> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>false</DebugSymbols> @@ -84,6 +85,9 @@ <Private>False</Private> </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/IR Server Plugins/IRMan Receiver/Icon.ico =================================================================== (Binary files differ) Property changes on: trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/Icon.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream 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 2008-02-20 06:46:41 UTC (rev 1387) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTrans Transceiver.csproj 2008-02-20 11:16:53 UTC (rev 1388) @@ -10,6 +10,7 @@ <RootNamespace>InputService.Plugin</RootNamespace> <AssemblyName>IRTrans Transceiver</AssemblyName> <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent> + <ApplicationIcon>Icon.ico</ApplicationIcon> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>false</DebugSymbols> @@ -86,6 +87,9 @@ <Private>False</Private> </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/IR Server Plugins/IRTrans Transceiver/Icon.ico =================================================================== (Binary files differ) Property changes on: trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/Icon.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/Icon.ico =================================================================== (Binary files differ) Property changes on: trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/Icon.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/IgorPlug Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/IgorPlug Receiver.csproj 2008-02-20 06:46:41 UTC (rev 1387) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/IgorPlug Receiver.csproj 2008-02-20 11:16:53 UTC (rev 1388) @@ -10,6 +10,7 @@ <RootNamespace>InputService.Plugin</RootNamespace> <AssemblyName>IgorPlug Receiver</AssemblyName> <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent> + <ApplicationIcon>Icon.ico</ApplicationIcon> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>false</DebugSymbols> @@ -74,6 +75,9 @@ <Private>False</Private> </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/IR Server Plugins/Ira Transceiver/Ira Transceiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Ira Transceiver/Ira Transceiver.csproj (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Ira Transceiver/Ira Transceiver.csproj 2008-02-20 11:16:53 UTC (rev 1388) @@ -0,0 +1,59 @@ +<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>{0E045E97-EEB2-461C-A416-CFC8E452E044}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>InputService.Plugin</RootNamespace> + <AssemblyName>Ira Transceiver</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> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <DocumentationFile>bin\Debug\Ira Transceiver.XML</DocumentationFile> + <UseVSHostingProcess>false</UseVSHostingProcess> + </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> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="IraTransceiver.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\IR Server Plugin Interface\IR Server Plugin Interface.csproj"> + <Project>{D8B3D28F-62CE-4CA7-86CE-B7EAD614A94C}</Project> + <Name>IR Server Plugin Interface</Name> + <Private>False</Private> + </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/IR Server Plugins/Ira Transceiver/IraTransceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Ira Transceiver/IraTransceiver.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Ira Transceiver/IraTransceiver.cs 2008-02-20 11:16:53 UTC (rev 1388) @@ -0,0 +1,353 @@ +using System; +using System.Collections.Generic; +#if TRACE +using System.Diagnostics; +#endif +using System.IO; +using System.IO.Ports; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading; +using System.Windows.Forms; +using System.Xml; + +namespace InputService.Plugin +{ + + /// <summary> + /// Ira/Tira device type. + /// </summary> + internal enum DeviceType + { + /// <summary> + /// Ira. + /// </summary> + Ira, + /// <summary> + /// Ira-2. + /// </summary> + Ira2, + /// <summary> + /// Tira. + /// </summary> + Tira, + } + + /// <summary> + /// IR Server Plugin for Ira Transceiver device. + /// </summary> + [CLSCompliant(false)] + public class IraTransceiver : IRServerPluginBase, IConfigure, ITransmitIR, ILearnIR, IRemoteReceiver + { + + #region Constants + + static readonly string ConfigurationFile = + Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + + "\\IR Server Suite\\Input Service\\Ira Transceiver.xml"; + + static readonly string[] Ports = new string[] { "Default" }; + + const int DeviceBufferSize = 6; + + #endregion Constants + + #region Variables + + DeviceType _deviceType; + + string _port; + + + RemoteHandler _remoteButtonHandler; + + SerialPort _serialPort; + + #endregion Variables + + #region Implementation + + /// <summary> + /// Name of the IR Server plugin. + /// </summary> + /// <value>The name.</value> + public override string Name { get { return "Ira/Tira"; } } + /// <summary> + /// IR Server plugin version. + /// </summary> + /// <value>The version.</value> + public override string Version { get { return "1.0.4.2"; } } + /// <summary> + /// The IR Server plugin's author. + /// </summary> + /// <value>The author.</value> + public override string Author { get { return "and-81"; } } + /// <summary> + /// A description of the IR Server plugin. + /// </summary> + /// <value>The description.</value> + public override string Description { get { return "Support for the Ira/Tira transceiver"; } } + + /// <summary> + /// Start the IR Server plugin. + /// </summary> + public override void Start() + { + LoadSettings(); + + Connect(9600); + + _serialPort.Write("IR"); + } + /// <summary> + /// Suspend the IR Server plugin when computer enters standby. + /// </summary> + public override void Suspend() + { + if (_deviceType == DeviceType.Tira) + { + byte[] suspendCommand = new byte[] { 49, 57, 0, 0, 0, 0, 0, 0 }; + Array.Copy(_suspendCommand, 0, suspendCommand, 2, _suspendCommand.Length); + + _serialPort.Write(suspendCommand); + } + + Disconnect(); + } + /// <summary> + /// Resume the IR Server plugin when the computer returns from standby. + /// </summary> + public override void Resume() + { + Connect(9600); + + _serialPort.Write("IR"); + } + /// <summary> + /// Stop the IR Server plugin. + /// </summary> + public override void Stop() + { + Disconnect(); + + _serialPort.Dispose(); + _serialPort = null; + } + + /// <summary> + /// Configure the IR Server plugin. + /// </summary> + public void Configure(IWin32Window owner) + { + LoadSettings(); + + Configure config = new Configure(); + + config.RepeatDelay = _repeatDelay; + config.BlastRepeats = _blastRepeats; + config.LearnTimeout = _learnTimeout; + + if (config.ShowDialog(owner) == DialogResult.OK) + { + _repeatDelay = config.RepeatDelay; + _blastRepeats = config.BlastRepeats; + _learnTimeout = config.LearnTimeout; + + SaveSettings(); + } + } + + /// <summary> + /// Callback for remote button presses. + /// </summary> + /// <value>The remote callback.</value> + public RemoteHandler RemoteCallback + { + get { return _remoteButtonHandler; } + set { _remoteButtonHandler = value; } + } + + /// <summary> + /// Lists the available blaster ports. + /// </summary> + /// <value>The available ports.</value> + public string[] AvailablePorts { get { return Ports; } } + + /// <summary> + /// Transmit an infrared command. + /// </summary> + /// <param name="port">Port to transmit on.</param> + /// <param name="data">Data to transmit.</param> + /// <returns><c>true</c> if successful, otherwise <c>false</c>.</returns> + public bool Transmit(string port, byte[] data) + { + if (_deviceType != DeviceType.Tira) + throw new ApplicationException("Ira and Ira-2 do not support IR Blasting"); + + if (String.IsNullOrEmpty(port)) + throw new ArgumentNullException("port"); + + if (data == null) + throw new ArgumentNullException("data"); + + bool result = false; + + + + + return result; + } + + /// <summary> + /// Learn an infrared command. + /// </summary> + /// <param name="data">New infrared command.</param> + /// <returns> + /// Tells the calling code if the learn was Successful, Failed or Timed Out. + /// </returns> + public LearnStatus Learn(out byte[] data) + { + LearnStatus status = LearnStatus.Failure; + + data = null; + + if (_deviceType != DeviceType.Tira) + throw new ApplicationException("Ira and Ira-2 do not support IR Learn"); + + Disconnect(); + Connect(57600); + + if (_learnTimedOut) + { + status = LearnStatus.Timeout; + } + else if (result) + { + data = Encoding.ASCII.GetBytes(irCode.ToString()); + + status = LearnStatus.Success; + } + else + { + status = LearnStatus.Failure; + } + + Disconnect(); + Connect(9600); + + return status; + } + + /// <summary> + /// Loads the settings. + /// </summary> + void LoadSettings() + { + try + { + XmlDocument doc = new XmlDocument(); + doc.Load(ConfigurationFile); + + _repeatDelay = int.Parse(doc.DocumentElement.Attributes["RepeatDelay"].Value); + _blastRepeats = int.Parse(doc.DocumentElement.Attributes["BlastRepeats"].Value); + _learnTimeout = int.Parse(doc.DocumentElement.Attributes["LearnTimeout"].Value); + } +#if TRACE + catch (Exception ex) + { + Trace.WriteLine(ex.ToString()); +#else + catch + { +#endif + + _repeatDelay = 500; + _blastRepeats = 3; + _learnTimeout = 10000; + } + } + /// <summary> + /// Saves the settings. + /// </summary> + void SaveSettings() + { + try + { + using (XmlTextWriter writer = new XmlTextWriter(ConfigurationFile, Encoding.UTF8)) + { + writer.Formatting = Formatting.Indented; + writer.Indentation = 1; + writer.IndentChar = (char)9; + writer.WriteStartDocument(true); + writer.WriteStartElement("settings"); // <settings> + + writer.WriteAttributeString("RepeatDelay", _repeatDelay.ToString()); + writer.WriteAttributeString("BlastRepeats", _blastRepeats.ToString()); + writer.WriteAttributeString("LearnTimeout", _learnTimeout.ToString()); + + writer.WriteEndElement(); // </settings> + writer.WriteEndDocument(); + } + } +#if TRACE + catch (Exception ex) + { + Trace.WriteLine(ex.ToString()); + } +#else + catch + { + } +#endif + } + + void Connect(int baud) + { + _serialPort = new SerialPort(_port, baud, Parity.None, 8, StopBits.One); + _serialPort.CtsHolding = (_deviceType == DeviceType.Tira); + _serialPort.RtsEnable = (_deviceType == DeviceType.Tira); + _serialPort.ReadBufferSize = DeviceBufferSize; + _serialPort.ReadTimeout = 1000; + + _serialPort.DataReceived += new SerialDataReceivedEventHandler(DataReceived); + + _serialPort.Open(); + } + + void Disconnect() + { + _serialPort.Close(); + } + + void DataReceived(object sender, SerialDataReceivedEventArgs e) + { + string received = _serialPort.ReadExisting(); + + switch (received) + { + case "OK": +#if TRACE + Trace.WriteLine("Ira acknowledged mode set"); +#endif + break; + + case "OIW": +#if TRACE + Trace.WriteLine("Ira acknowledged Wake-Up command set"); +#endif + break; + + // Assume it is a button press. + default: + if (_remoteButtonHandler != null) + _remoteButtonHandler(received); + break; + } + + } + + #endregion Implementation + + } + +} Added: trunk/plugins/IR Server Suite/IR Server Plugins/Ira Transceiver/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Ira Transceiver/Properties/AssemblyInfo.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Ira Transceiver/Properties/AssemblyInfo.cs 2008-02-20 11:16:53 UTC (rev 1388) @@ -0,0 +1,37 @@ +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("Ira Transceiver")] +[assembly: AssemblyDescription("IR Server plugin to support the Tira transceiver")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("and-81")] +[assembly: AssemblyProduct("Ira Transceiver")] +[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)] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// 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.2")] +[assembly: AssemblyFileVersion("1.0.4.2")] + +[assembly: CLSCompliant(true)] + +[assembly: Guid("a05e00b6-9b93-497c-b160-7f8d5684d8f8")] \ No newline at end of file Property changes on: trunk/plugins/IR Server Suite/IR Server Plugins/Keyboard Input ___________________________________________________________________ Name: svn:ignore + bin obj Added: trunk/plugins/IR Server Suite/IR Server Plugins/Keyboard Input/Keyboard Input.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Keyboard Input/Keyboard Input.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Keyboard Input/Keyboard Input.cs 2008-02-20 11:16:53 UTC (rev 1388) @@ -0,0 +1,319 @@ +using System; +using System.ComponentModel; +#if TRACE +using System.Diagnostics; +#endif +using System.IO; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Windows.Forms; + +using Microsoft.Win32.SafeHandles; + +namespace InputService.Plugin +{ + + /// <summary> + /// Input Service Plugin to capture ALL keyboard button presses and basic key combinations and forward as remote control commands. + /// </summary> + public class KeyboardInput : PluginBase, IRemoteReceiver + { + + #region Debug + + static void Remote(string code) + { + Console.WriteLine("Remote: {0}", code); + } + + [STAThread] + static void Main() + { + KeyboardInput c = new KeyboardInput(); + c.RemoteCallback += new RemoteHandler(Remote); + + c.Start(); + + Application.Run(); + + c.Stop(); + c = null; + } + + #endregion Debug + + + + #region Interop + + [DllImport("user32.dll")] + static extern IntPtr SetWindowsHookEx(HookType code, HookDelegate func, IntPtr hInstance, int threadID); + + [DllImport("user32.dll")] + static extern int UnhookWindowsHookEx(IntPtr hhook); + + [DllImport("user32.dll")] + static extern int CallNextHookEx(IntPtr hhook, int code, int wParam, IntPtr lParam); + + [DllImport("kernel32.dll")] + static extern IntPtr LoadLibrary(string lpFileName); + + #endregion Interop + + #region Delegates + + delegate int HookDelegate(int code, int wParam, IntPtr lParam); + + #endregion Delegates + + #region Enumerations + + enum HookType + { + WH_JOURNALRECORD = 0, + WH_JOURNALPLAYBACK = 1, + WH_KEYBOARD = 2, + WH_GETMESSAGE = 3, + WH_CALLWNDPROC = 4, + WH_CBT = 5, + WH_SYSMSGFILTER = 6, + WH_MOUSE = 7, + WH_HARDWARE = 8, + WH_DEBUG = 9, + WH_SHELL = 10, + WH_FOREGROUNDIDLE = 11, + WH_CALLWNDPROCRET = 12, + WH_KEYBOARD_LL = 13, + WH_MOUSE_LL = 14 + } + + enum AppCommands + { + None = 0, + BrowserBackward = 1, + BrowserForward = 2, + BrowserRefresh = 3, + BrowserStop = 4, + BrowserSearch = 5, + BrowserFavorites = 6, + BrowserHome = 7, + VolumeMute = 8, + VolumeDown = 9, + VolumeUp = 10, + MediaNextTrack = 11, + MediaPreviousTrack = 12, + MediaStop = 13, + MediaPlayPause = 14, + LaunchMail = 15, + LaunchMediaSelect = 16, + LaunchApp1 = 17, + LaunchApp2 = 18, + BassDown = 19, + BassBoost = 20, + BassUp = 21, + TrebleDown = 22, + TrebleUp = 23, + MicrophoneVolumeMute = 24, + MicrophoneVolumeDown = 25, + MicrophoneVolumeUp = 26, + Help = 27, + Find = 28, + New = 29, + Open = 30, + Close = 31, + Save = 32, + Print = 33, + Undo = 34, + Redo = 35, + Copy = 36, + Cut = 37, + Paste = 38, + ReplyToMail = 39, + ForwardMail = 40, + SendMail = 41, + SpellCheck = 42, + DictateOrCommandControlToggle = 43, + MicrophoneOnOffToggle = 44, + CorrectionList = 45, + MediaPlay = 46, + MediaPause = 47, + MediaRecord = 48, + MediaFastForward = 49, + MediaRewind = 50, + MediaChannelUp = 51, + MediaChannelDown = 52, + Delete = 53, + Flip3D = 54, + } + + #endregion Enumerations + + #region Structures + + struct KeyboardHookStruct + { + + /// <summary> + /// Initializes a new instance of the <see cref="KeyboardHookStruct"/> struct. + /// </summary> + /// <param name="lParam">The lParam to derive from.</param> + public KeyboardHookStruct(IntPtr lParam) + { + KeyboardHookStruct khs = (KeyboardHookStruct)Marshal.PtrToStructure(lParam, typeof(KeyboardHookStruct)); + + virtualKey = khs.virtualKey; + scanCode = khs.scanCode; + flags = khs.flags; + time = khs.time; + dwExtraInfo = khs.dwExtraInfo; + } + + public int virtualKey; + public int scanCode; + public int flags; + public int time; + public int dwExtraInfo; + } + + #endregion Structures + + #region Variables + + bool _stealAppCommands = true; + + RemoteHandler _remoteButtonHandler; + + IntPtr _hookHandle; + + #endregion Variables + + #region Implementation + + /// <summary> + /// Name of the IR Server plugin. + /// </summary> + /// <value>The name.</value> + public override string Name { get { return "Keyboard Input"; } } + /// <summary> + /// IR Server plugin version. + /// </summary> + /// <value>The version.</value> + public override string Version { get { return "1.0.4.2"; } } + /// <summary> + /// The IR Server plugin's author. + /// </summary> + /// <value>The author.</value> + public override string Author { get { return "and-81"; } } + /// <summary> + /// A description of the IR Server plugin. + /// </summary> + /// <value>The description.</value> + public override string Description { get { return "Captures ALL keyboard button presses and basic key combinations as remote control commands"; } } + + /// <summary> + /// Start the IR Server plugin. + /// </summary> + public override void Start() + { + IntPtr hInstance = LoadLibrary("User32"); + _hookHandle = SetWindowsHookEx(HookType.WH_KEYBOARD_LL, new HookDelegate(InternalHookDelegate), hInstance, 0); + } + /// <summary> + /// Suspend the IR Server plugin when computer enters standby. + /// </summary> + public override void Suspend() + { + Stop(); + } + /// <summary> + /// Resume the IR Server plugin when the computer returns from standby. + /// </summary> + public override void Resume() + { + Start(); + } + /// <summary> + /// Stop the IR Server plugin. + /// </summary> + public override void Stop() + { + UnhookWindowsHookEx(_hookHandle); + _hookHandle = IntPtr.Zero; + } + + /// <summary> + /// Callback for remote button presses. + /// </summary> + /// <value>The remote callback.</value> + public RemoteHandler RemoteCallback + { + get { return _remoteButtonHandler; } + set { _remoteButtonHandler = value; } + } + + + int InternalHookDelegate(int code, int wParam, IntPtr lParam) + { + if (code >= 0 && wParam == 256) + { + KeyboardHookStruct khs = new KeyboardHookStruct(lParam); + int keyCode = khs.virtualKey; + + AppCommands appCommand = KeyCodeToAppCommand((Keys)khs.virtualKey); + if (appCommand == AppCommands.None) + { + if (khs.virtualKey == (int)Keys.LShiftKey || khs.virtualKey == (int)Keys.LControlKey || + khs.virtualKey == (int)Keys.RShiftKey || khs.virtualKey == (int)Keys.RControlKey) + return CallNextHookEx(_hookHandle, code, wParam, lParam); + + if ((Control.ModifierKeys & Keys.Shift) == Keys.Shift) keyCode |= 0x00100000; + if ((Control.ModifierKeys & Keys.Control) == Keys.Control) keyCode |= 0x01000000; + if ((Control.ModifierKeys & Keys.Alt) == Keys.Alt) keyCode |= 0x10000000; + } + else + { + keyCode |= (((int)appCommand) << 8); + } + + if (_remoteButtonHandler != null) + _remoteButtonHandler(String.Format("{0:X8}", keyCode)); + + if (_stealAppCommands && appCommand != AppCommands.None) + return 1; + } + + return CallNextHookEx(_hookHandle, code, wParam, lParam); + } + + static AppCommands KeyCodeToAppCommand(Keys keyCode) + { + switch (keyCode) + { + case Keys.BrowserBack: return AppCommands.BrowserBackward; + case Keys.BrowserFavorites: return AppCommands.BrowserFavorites; + case Keys.BrowserForward: return AppCommands.BrowserForward; + case Keys.BrowserHome: return AppCommands.BrowserHome; + case Keys.BrowserRefresh: return AppCommands.BrowserRefresh; + case Keys.BrowserSearch: return AppCommands.BrowserSearch; + case Keys.BrowserStop: return AppCommands.BrowserStop; + case Keys.Help: return AppCommands.Help; + case Keys.LaunchApplication1: return AppCommands.LaunchApp1; + case Keys.LaunchApplication2: return AppCommands.LaunchApp2; + case Keys.LaunchMail: return AppCommands.LaunchMail; + case Keys.MediaNextTrack: return AppCommands.MediaNextTrack; + case Keys.MediaPlayPause: return AppCommands.MediaPlayPause; + case Keys.MediaPreviousTrack: return AppCommands.MediaPreviousTrack; + case Keys.MediaStop: return AppCommands.MediaStop; + case Keys.SelectMedia: return AppCommands.LaunchMediaSelect; + case Keys.VolumeDown: return AppCommands.VolumeDown; + case Keys.VolumeMute: return AppCommands.VolumeMute; + case Keys.VolumeUp: return AppCommands.VolumeUp; + default: return AppCommands.None; + } + } + + #endregion Implementation + + } + +} Added: trunk/plugins/IR Server Suite/IR Server Plugins/Keyboard Input/Keyboard Input.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Keyboard Input/Keyboard Input.csproj (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Keyboard Input/Keyboard Input.csproj 2008-02-20 11:16:53 UTC (rev 1388) @@ -0,0 +1,60 @@ +<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>{26DEDF6D-F60D-4311-9A9E-DDF64500D5BF}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>InputService.Plugin</RootNamespace> + <AssemblyName>Keyboard Input</AssemblyName> + <StartupObject> + </StartupObject> + </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> + <UseVSHostingProcess>false</UseVSHostingProcess> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + </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> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Keyboard Input.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\IR Server Plugin Interface\IR Server Plugin Interface.csproj"> + <Project>{D8B3D28F-62CE-4CA7-86CE-B7EAD614A94C}</Project> + <Name>IR Server Plugin Interface</Name> + <Private>True</Private> + </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/IR Server Plugins/Keyboard Input/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Keyboard Input/Properties/AssemblyInfo.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Keyboard Input/Properties/AssemblyInfo.cs 2008-02-20 11:16:53 UTC (rev 1388) @@ -0,0 +1,38 @@ +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("Keyboard Input")] +[assembly: AssemblyDescription("IR Server plugin to use the keyboard like a remote")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("and-81")] +[assembly: AssemblyProduct("KeyboardInput")] +[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("27b720ed-6766-47e8-add5-2a8bf9b73978")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// 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.2")] +[assembly: AssemblyFileVersion("1.0.4.2")] + +[assembly: CLSCompliant(true)] Added: trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/Icon.ico =================================================================== (Binary files differ) Property changes on: trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/Icon.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/LiveDrive Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/LiveDrive Receiver.csproj 2008-02-20 06:46:41 UTC (rev 1387) +++ trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/LiveDrive Receiver.csproj 2008-02-20 11:16:53 UTC (rev 1388) @@ -9,6 +9,7 @@ <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>LiveDriveReceiver</RootNamespace> <AssemblyName>LiveDrive Receiver</AssemblyName> + <ApplicationIcon>Icon.ico</ApplicationIcon> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> @@ -60,6 +61,9 @@ <SubType>Designer</SubType> </EmbeddedResource> </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. 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 2008-02-20 06:46:41 UTC (rev 1387) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.Designer.cs 2008-02-20 11:16:53 UTC (rev 1388) @@ -59,6 +59,7 @@ this.labelKeyHeldDelay = new System.Windows.Forms.Label(); this.tabPageMouse = new System.Windows.Forms.TabPage(); this.labelMouseSensitivity = new System.Windows.Forms.Label(); + this.checkBoxDisableAutomaticButtons = new System.Windows.Forms.CheckBox(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownButtonRepeatDelay)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownButtonHeldDelay)).BeginInit(); this.groupBoxRemoteTiming.SuspendLayout(); @@ -145,7 +146,7 @@ // // buttonOK // - this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.buttonOK.Location = new System.Drawing.Point(128, 240); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(64, 24); @@ -156,7 +157,7 @@ // // buttonCancel // - this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.buttonCancel.Location = new System.Drawing.Point(200, 240); this.buttonCancel.Name = "buttonCancel"; @@ -403,9 +404,6 @@ // // tabControl // - this.tabControl.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.tabControl.Controls.Add(this.tabPageBasic); this.tabControl.Controls.Add(this.tabPageRemote); this.tabControl.Controls.Add(this.tabPageKeyboard); @@ -431,6 +429,7 @@ // // tabPageRemote // + this.tabPageRemote.Controls.Add(this.checkBoxDisableAutomaticButtons); this.tabPageRemote.Controls.Add(this.checkBoxUseSystemRatesRemote); this.tabPageRemote.Controls.Add(this.checkBoxEnableRemote); this.tabPageRemote.Controls.Add(this.groupBoxRemoteTiming); @@ -510,19 +509,32 @@ this.labelMouseSensitivity.Text = "Mouse sensitivity:"; this.labelMouseSensitivity.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // + // checkBoxDisableAutomaticButtons + // + this.checkBoxDisableAutomaticButtons.AutoSize = true; + this.checkBoxDisableAutomaticButtons.Checked = true; + this.checkBoxDisableAutomaticButtons.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkBoxDisableAutomaticButtons.Location = new System.Drawing.Point(8, 168); + this.checkBoxDisableAutomaticButtons.Name = "checkBoxDisableAutomaticButtons"; + this.checkBoxDisableAutomaticButtons.Size = new System.Drawing.Size(148, 17); + this.checkBoxDisableAutomaticButtons.TabIndex = 3; + this.checkBoxDisableAutomaticButtons.Text = "Disable automatic buttons"; + this.toolTips.SetToolTip(this.checkBoxDisableAutomaticButtons, "Prevent the operating system from automatically handling some buttons"); + this.checkBoxDisableAutomaticButtons.UseVisualStyleBackColor = true; + // // Configure // - 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(272, 273); - this.ControlBox = false; this.Controls.Add(this.tabControl); this.Controls.Add(this.buttonCancel); this.Controls.Add(this.buttonOK); + this.MaximizeBox = false; + this.MinimizeBox = false; this.MinimumSize = new System.Drawing.Size(280, 300); this.Name = "Configure"; + this.ShowIcon = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Microsoft MCE Configuration"; ((System.ComponentModel.ISupportInitialize)(this.numericUpDownButtonRepeatDelay)).EndInit(); @@ -578,5 +590,6 @@ private System.Windows.Forms.CheckBox checkBoxDisableMCEServices; private System.Windows.Forms.CheckBox checkBoxUseSystemRatesRemote; private System.Windows.Forms.CheckBox checkBoxUseSystemRatesKeyboard; + private System.Windows.Forms.CheckBox checkBoxDisableAutomaticButtons; } } \ 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 2008-02-20 06:46:41 UTC (rev 1387) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.cs 2008-02-20 11:16:53 UTC (rev 1388) @@ -5,12 +5,20 @@ using System.Text; using System.Windows.Forms; +using Microsoft.Win32; + namespace InputService.Plugin { partial class Configure : Form { + #region Constants + + const string RegistrySubKey = @"SYSTEM\CurrentControlSet\Services\HidIr\Remotes\745a17a0-74d3-11d0-b6fe-00a0c90f57da"; + + #endregion Constants + #region Properties public int LearnTimeout @@ -94,6 +102,11 @@ public Configure() { InitializeComponent(); + + if (Registry.LocalMachine.GetValue(RegistrySubKey + @"\CodeSetNum0", null) == null) + checkBoxDisableAutomaticButtons.Checked = true; + else + checkBoxDisableAutomaticButtons.Checked = false; } #endregion Constructor @@ -102,6 +115,27 @@ private void buttonOK_Click(object sender, EventArgs e) { + if (checkBoxDisableAutomaticButtons.Checked) + { + using (RegistryKey key = Registry.LocalMachine.OpenSubKey(RegistrySubKey, true)) + { + key.DeleteValue("CodeSetNum0", false); + key.DeleteValue("CodeSetNum1", false); + key.DeleteValue("CodeSetNum2", false); + key.DeleteValue("CodeSetNum3", false); + } + } + else + { + using (RegistryKey key = Registry.LocalMachine.OpenSubKey(RegistrySubKey, true)) + { + key.SetValue("CodeSetNum0", 1, RegistryValueKind.DWord); + key.SetValue("CodeSetNum1", 2, RegistryValueKind.DWord); + key.SetValue("CodeSetNum2", 3, RegistryValueKind.DWord); + key.SetValue("CodeSetNum3", 4, RegistryValueKind.DWord); + } + } + this.Dia... [truncated message content] |
From: <an...@us...> - 2008-02-26 14:53:38
|
Revision: 1397 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1397&view=rev Author: and-81 Date: 2008-02-26 06:53:36 -0800 (Tue, 26 Feb 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.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.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MenuForm.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs trunk/plugins/IR Server Suite/Applications/Web Remote/Setup.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/MPUtils/MPCommon.cs trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/Ads Tech PTV-335 Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/IR501Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507 Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/LiveDrive Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.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/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/RC102 Receiver/RC102Receiver.cs trunk/plugins/IR Server Suite/IR Server Suite - Debug.nsi trunk/plugins/IR Server Suite/IR Server Suite - Release.nsi 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/Config.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/SetupForm.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/Forms/SetupForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/PluginSetup.cs Property Changed: ---------------- trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/ trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/ Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2008-02-25 11:27:01 UTC (rev 1396) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2008-02-26 14:53:36 UTC (rev 1397) @@ -517,7 +517,8 @@ { try { - Help.ShowHelp(this, SystemRegistry.GetInstallFolder() + "\\IR Server Suite.chm"); + string file = Path.Combine(SystemRegistry.GetInstallFolder(), "IR Server Suite.chm"); + Help.ShowHelp(this, file); } catch (Exception ex) { Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2008-02-25 11:27:01 UTC (rev 1396) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2008-02-26 14:53:36 UTC (rev 1397) @@ -78,60 +78,46 @@ /// <returns>Array of plugin instances.</returns> internal static PluginBase[] AvailablePlugins() { - try - { - List<PluginBase> plugins = new List<PluginBase>(); + List<PluginBase> plugins = new List<PluginBase>(); - string installFolder = SystemRegistry.GetInstallFolder(); - if (String.IsNullOrEmpty(installFolder)) - return null; + 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) + string[] files = Directory.GetFiles(installFolder + "\\IR Server Plugins\\", "*.dll", SearchOption.TopDirectoryOnly); + foreach (string file in files) + { + try { - try - { - Assembly assembly = Assembly.LoadFrom(file); - Type[] types = assembly.GetExportedTypes(); + Assembly assembly = Assembly.LoadFrom(file); + Type[] types = assembly.GetExportedTypes(); - foreach (Type type in types) + foreach (Type type in types) + { + if (type.IsClass && !type.IsAbstract && type.IsSubclassOf(typeof(PluginBase))) { - if (type.IsClass && !type.IsAbstract && type.IsSubclassOf(typeof(PluginBase))) - { - PluginBase plugin = (PluginBase)assembly.CreateInstance(type.FullName); + PluginBase plugin = (PluginBase)assembly.CreateInstance(type.FullName); - if (plugin != null) - plugins.Add(plugin); - } + if (plugin != null) + plugins.Add(plugin); } } - catch (BadImageFormatException) - { - // Ignore Bad Image Format Exceptions, just keep checking for IR Server Plugins - } - catch (TypeLoadException) - { - // Ignore Type Load Exceptions, just keep checking for IR Server Plugins - } - catch (Exception ex) - { - MessageBox.Show(ex.ToString(), "IR Server Plugin Error"); - } } - - return plugins.ToArray(); + catch (BadImageFormatException) + { + // Ignore Bad Image Format Exceptions, just keep checking for IR Server Plugins + } + catch (TypeLoadException) + { + // Ignore Type Load Exceptions, just keep checking for IR Server Plugins + } + catch (Exception ex) + { + MessageBox.Show(ex.ToString(), "IR Server Plugin Error"); + } } -#if TRACE - catch (Exception ex) - { - Trace.WriteLine("IRServer: " + ex.ToString()); -#else - catch - { -#endif - return null; - } + + return plugins.ToArray(); } /// <summary> @@ -152,7 +138,7 @@ if (plugin.Name.Equals(pluginName, StringComparison.OrdinalIgnoreCase)) return plugin; - return null; + throw new ApplicationException(String.Format("Plugin not found ({0})", pluginName)); } /// <summary> @@ -161,44 +147,16 @@ /// <returns>String array of plugin names.</returns> internal static string[] DetectReceivers() { - try - { - PluginBase[] plugins = AvailablePlugins(); + PluginBase[] plugins = AvailablePlugins(); - List<string> receivers = new List<string>(); + List<string> receivers = new List<string>(); - foreach (PluginBase plugin in plugins) - { - try - { - if ((plugin is IRemoteReceiver || plugin is IKeyboardReceiver || plugin is IMouseReceiver) && plugin.Detect()) - receivers.Add(plugin.Name); - } -#if TRACE - catch (Exception ex) - { - Trace.WriteLine("IRServer: " + ex.ToString()); - } -#else - catch - { - } -#endif - } + foreach (PluginBase plugin in plugins) + if ((plugin is IRemoteReceiver || plugin is IKeyboardReceiver || plugin is IMouseReceiver) && plugin.Detect()) + receivers.Add(plugin.Name); - if (receivers.Count > 0) - return receivers.ToArray(); - } -#if TRACE - catch (Exception ex) - { - Trace.WriteLine("IRServer: " + ex.ToString()); - } -#else - catch - { - } -#endif + if (receivers.Count > 0) + return receivers.ToArray(); return null; } @@ -209,29 +167,16 @@ /// <returns>String array of plugin names.</returns> internal static string[] DetectBlasters() { - try - { - PluginBase[] plugins = Program.AvailablePlugins(); + PluginBase[] plugins = Program.AvailablePlugins(); - List<string> blasters = new List<string>(); + List<string> blasters = new List<string>(); - foreach (PluginBase plugin in plugins) - if (plugin is ITransmitIR && plugin.Detect()) - blasters.Add(plugin.Name); + foreach (PluginBase plugin in plugins) + if (plugin is ITransmitIR && plugin.Detect()) + blasters.Add(plugin.Name); - if (blasters.Count > 0) - return blasters.ToArray(); - } -#if TRACE - catch (Exception ex) - { - Trace.WriteLine("IRServer: " + ex.ToString()); - } -#else - catch - { - } -#endif + if (blasters.Count > 0) + return blasters.ToArray(); return null; } Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs 2008-02-25 11:27:01 UTC (rev 1396) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs 2008-02-26 14:53:36 UTC (rev 1397) @@ -625,7 +625,8 @@ { try { - Help.ShowHelp(this, SystemRegistry.GetInstallFolder() + "\\IR Server Suite.chm", HelpNavigator.Topic, "Common\\keystrokes_info.html"); + string file = Path.Combine(SystemRegistry.GetInstallFolder(), "IR Server Suite.chm"); + Help.ShowHelp(this, file, HelpNavigator.Topic, "Common\\keystrokes_info.html"); } catch (Exception ex) { Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2008-02-25 11:27:01 UTC (rev 1396) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2008-02-26 14:53:36 UTC (rev 1397) @@ -159,7 +159,7 @@ Icon small; string folder = Environment.GetFolderPath(Environment.SpecialFolder.System); - string file = folder + "\\user32.dll"; + string file = Path.Combine(folder, "user32.dll"); Win32.ExtractIcons(file, 1, out large, out small); imageListPrograms.Images.Add(large); @@ -1143,7 +1143,8 @@ { try { - Help.ShowHelp(this, SystemRegistry.GetInstallFolder() + "\\IR Server Suite.chm", HelpNavigator.Topic, "Translator\\index.html"); + string file = Path.Combine(SystemRegistry.GetInstallFolder(), "IR Server Suite.chm"); + Help.ShowHelp(this, file, HelpNavigator.Topic, "Translator\\index.html"); } catch (Exception ex) { Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MenuForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MenuForm.cs 2008-02-25 11:27:01 UTC (rev 1396) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MenuForm.cs 2008-02-26 14:53:36 UTC (rev 1397) @@ -167,7 +167,7 @@ Icon small; string folder = Environment.GetFolderPath(Environment.SpecialFolder.System); - string file = folder + "\\shell32.dll"; + string file = Path.Combine(folder, "shell32.dll"); Win32.ExtractIcons(file, IconLaunch, out large, out small); _listMain.Images.Add(large); @@ -231,7 +231,7 @@ Icon small; string folder = Environment.GetFolderPath(Environment.SpecialFolder.System); - string file = folder + "\\shell32.dll"; + string file = Path.Combine(folder, "shell32.dll"); Win32.ExtractIcons(file, IconDesktop, out large, out small); newList.Images.Add(large); @@ -307,7 +307,7 @@ Icon small; string folder = Environment.GetFolderPath(Environment.SpecialFolder.System); - string file = folder + "\\shell32.dll"; + string file = Path.Combine(folder, "shell32.dll"); Win32.ExtractIcons(file, IconWindows, out large, out small); newList.Images.Add(large); @@ -360,7 +360,7 @@ Icon small; string folder = Environment.GetFolderPath(Environment.SpecialFolder.System); - string file = folder + "\\shell32.dll"; + string file = Path.Combine(folder, "shell32.dll"); Win32.ExtractIcons(file, IconTasks, out large, out small); newList.Images.Add(large); @@ -421,7 +421,7 @@ Icon small; string folder = Environment.GetFolderPath(Environment.SpecialFolder.System); - string file = folder + "\\shell32.dll"; + string file = Path.Combine(folder, "shell32.dll"); Win32.ExtractIcons(file, 15, out large, out small); newList.Images.Add(large); @@ -469,7 +469,7 @@ Icon small; string folder = Environment.GetFolderPath(Environment.SpecialFolder.System); - string file = folder + "\\shell32.dll"; + string file = Path.Combine(folder, "shell32.dll"); Win32.ExtractIcons(file, IconAudio, out large, out small); newList.Images.Add(large); @@ -508,7 +508,7 @@ Icon small; string folder = Environment.GetFolderPath(Environment.SpecialFolder.System); - string file = folder + "\\shell32.dll"; + string file = Path.Combine(folder, "shell32.dll"); Win32.ExtractIcons(file, IconEject, out large, out small); newList.Images.Add(large); Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs 2008-02-25 11:27:01 UTC (rev 1396) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs 2008-02-26 14:53:36 UTC (rev 1397) @@ -112,7 +112,8 @@ { try { - string[] skins = Directory.GetFiles(Program.InstallFolder + "\\Skins\\", "*.png", SearchOption.TopDirectoryOnly); + string path = Path.Combine(Program.InstallFolder, "Skins"); + string[] skins = Directory.GetFiles(path, "*.png", SearchOption.TopDirectoryOnly); for (int index = 0; index < skins.Length; index++) skins[index] = Path.GetFileNameWithoutExtension(skins[index]); @@ -205,7 +206,8 @@ { try { - Help.ShowHelp(this, SystemRegistry.GetInstallFolder() + "\\IR Server Suite.chm", HelpNavigator.Topic, "Virtual Remote\\index.html"); + string file = Path.Combine(SystemRegistry.GetInstallFolder(), "IR Server Suite.chm"); + Help.ShowHelp(this, file, HelpNavigator.Topic, "Virtual Remote\\index.html"); } catch (Exception ex) { 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-02-25 11:27:01 UTC (rev 1396) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs 2008-02-26 14:53:36 UTC (rev 1397) @@ -135,7 +135,8 @@ { try { - Help.ShowHelp(this, SystemRegistry.GetInstallFolder() + "\\IR Server Suite.chm", HelpNavigator.Topic, "Virtual Remote\\Skin Editor\\index.html"); + string file = Path.Combine(SystemRegistry.GetInstallFolder(), "IR Server Suite.chm"); + Help.ShowHelp(this, file, HelpNavigator.Topic, "Virtual Remote\\Skin Editor\\index.html"); } catch (Exception ex) { Modified: trunk/plugins/IR Server Suite/Applications/Web Remote/Setup.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Web Remote/Setup.cs 2008-02-25 11:27:01 UTC (rev 1396) +++ trunk/plugins/IR Server Suite/Applications/Web Remote/Setup.cs 2008-02-26 14:53:36 UTC (rev 1397) @@ -102,7 +102,8 @@ { try { - string[] skins = Directory.GetFiles(Program.InstallFolder + "\\Skins\\", "*.png", SearchOption.TopDirectoryOnly); + string path = Path.Combine(Program.InstallFolder, "Skins"); + string[] skins = Directory.GetFiles(path, "*.png", SearchOption.TopDirectoryOnly); for (int index = 0; index < skins.Length; index++) skins[index] = Path.GetFileNameWithoutExtension(skins[index]); Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs 2008-02-25 11:27:01 UTC (rev 1396) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs 2008-02-26 14:53:36 UTC (rev 1397) @@ -897,7 +897,8 @@ if (String.IsNullOrEmpty(installFolder)) return null; - string[] files = Directory.GetFiles(installFolder + "\\Commands\\", "*.dll", SearchOption.TopDirectoryOnly); + string folder = Path.Combine(installFolder, "Commands"); + string[] files = Directory.GetFiles(folder, "*.dll", SearchOption.TopDirectoryOnly); foreach (string file in files) { Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/IrssLog.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/IrssLog.cs 2008-02-25 11:27:01 UTC (rev 1396) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/IrssLog.cs 2008-02-26 14:53:36 UTC (rev 1397) @@ -116,9 +116,17 @@ string message = String.Format("{0:yyyy-MM-dd HH:mm:ss.ffffff} - Log Opened", DateTime.Now); _streamWriter.WriteLine(message); + #if TRACE Trace.WriteLine(message); #endif + + message = String.Format("{0:yyyy-MM-dd HH:mm:ss.ffffff} - {1}", DateTime.Now, System.Reflection.Assembly.GetCallingAssembly().FullName); + _streamWriter.WriteLine(message); + +#if TRACE + Trace.WriteLine(message); +#endif } #if TRACE catch (Exception ex) Modified: trunk/plugins/IR Server Suite/Common/MPUtils/MPCommon.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/MPUtils/MPCommon.cs 2008-02-25 11:27:01 UTC (rev 1396) +++ trunk/plugins/IR Server Suite/Common/MPUtils/MPCommon.cs 2008-02-26 14:53:36 UTC (rev 1397) @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.IO; using System.Text; using MediaPortal.Configuration; @@ -22,17 +23,17 @@ /// <summary> /// Folder for Custom Input Device data files. /// </summary> - public static readonly string CustomInputDevice = Config.GetFolder(Config.Dir.CustomInputDevice) + "\\"; + public static readonly string CustomInputDevice = Config.GetFolder(Config.Dir.CustomInputDevice) + Path.DirectorySeparatorChar; /// <summary> /// Folder for Input Device data default files. /// </summary> - public static readonly string CustomInputDefault = Config.GetFolder(Config.Dir.CustomInputDefault) + "\\"; + public static readonly string CustomInputDefault = Config.GetFolder(Config.Dir.CustomInputDefault) + Path.DirectorySeparatorChar; /// <summary> /// Path to the MediaPortal configuration file. /// </summary> - public static readonly string MPConfigFile = Config.GetFolder(Config.Dir.Config) + "\\MediaPortal.xml"; + public static readonly string MPConfigFile = Path.Combine(Config.GetFolder(Config.Dir.Config), "MediaPortal.xml"); #endregion Paths Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/Ads Tech PTV-335 Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/Ads Tech PTV-335 Receiver.csproj 2008-02-25 11:27:01 UTC (rev 1396) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/Ads Tech PTV-335 Receiver.csproj 2008-02-26 14:53:36 UTC (rev 1397) @@ -21,7 +21,7 @@ <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> - <DocumentationFile>bin\Debug\Ads Tech PTV-335 Receiver.XML</DocumentationFile> + <DocumentationFile>bin\Debug\Ads Tech PTV-335 Receiver.xml</DocumentationFile> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>pdbonly</DebugType> 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 2008-02-25 11:27:01 UTC (rev 1396) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.csproj 2008-02-26 14:53:36 UTC (rev 1397) @@ -24,7 +24,7 @@ <WarningLevel>4</WarningLevel> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <UseVSHostingProcess>false</UseVSHostingProcess> - <DocumentationFile>bin\Debug\Custom HID Receiver.XML</DocumentationFile> + <DocumentationFile>bin\Debug\Custom HID Receiver.xml</DocumentationFile> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>none</DebugType> Property changes on: trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver ___________________________________________________________________ Name: svn:ignore + bin obj Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/IR501Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/IR501Receiver.cs 2008-02-25 11:27:01 UTC (rev 1396) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/IR501Receiver.cs 2008-02-26 14:53:36 UTC (rev 1397) @@ -141,10 +141,10 @@ #region Constants - const int DeviceBufferSize = 4; + const int DeviceBufferSize = 255; const string DeviceID = "vid_147a&pid_e001"; - + #endregion Constants #region Variables @@ -217,7 +217,7 @@ if (String.IsNullOrEmpty(devicePath)) throw new ApplicationException("Device not found"); - SafeFileHandle deviceHandle = CreateFile(devicePath, FileAccess.Read, FileShare.ReadWrite, IntPtr.Zero, FileMode.Open, EFileAttributes.Overlapped, IntPtr.Zero); + SafeFileHandle deviceHandle = CreateFile(devicePath, FileAccess.Read, FileShare.Read, IntPtr.Zero, FileMode.Open, EFileAttributes.Overlapped, IntPtr.Zero); int lastError = Marshal.GetLastWin32Error(); if (deviceHandle.IsInvalid) @@ -348,7 +348,7 @@ { try { - if (_deviceStream.EndRead(asyncResult) == DeviceBufferSize && _deviceBuffer[1] == 0) + if (_deviceStream.EndRead(asyncResult) == 4 && _deviceBuffer[1] == 0) { TimeSpan timeSpan = DateTime.Now - _lastCodeTime; Property changes on: trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver ___________________________________________________________________ Name: svn:ignore + bin obj Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507 Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507 Receiver.csproj 2008-02-25 11:27:01 UTC (rev 1396) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507 Receiver.csproj 2008-02-26 14:53:36 UTC (rev 1397) @@ -10,6 +10,8 @@ <RootNamespace>InputService.Plugin</RootNamespace> <AssemblyName>IR507 Receiver</AssemblyName> <ApplicationIcon>Icon.ico</ApplicationIcon> + <StartupObject> + </StartupObject> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> @@ -42,7 +44,7 @@ <ProjectReference Include="..\IR Server Plugin Interface\IR Server Plugin Interface.csproj"> <Project>{D8B3D28F-62CE-4CA7-86CE-B7EAD614A94C}</Project> <Name>IR Server Plugin Interface</Name> - <Private>False</Private> + <Private>True</Private> </ProjectReference> </ItemGroup> <ItemGroup> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507Receiver.cs 2008-02-25 11:27:01 UTC (rev 1396) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507Receiver.cs 2008-02-26 14:53:36 UTC (rev 1397) @@ -141,9 +141,10 @@ #region Constants - const int DeviceBufferSize = 4; + const int DeviceBufferSize = 255; - const string DeviceID = "vid_0e6a&pid_6002"; + //const string DeviceID = "vid_0e6a&pid_6002"; + const string DeviceID = "vid_147a&pid_e02a"; #endregion Constants @@ -217,9 +218,13 @@ if (String.IsNullOrEmpty(devicePath)) throw new ApplicationException("Device not found"); - SafeFileHandle deviceHandle = CreateFile(devicePath, FileAccess.Read, FileShare.ReadWrite, IntPtr.Zero, FileMode.Open, EFileAttributes.Overlapped, IntPtr.Zero); + //Console.WriteLine("Opening device: {0}", devicePath); + + SafeFileHandle deviceHandle = CreateFile(devicePath, FileAccess.Read, FileShare.Read, IntPtr.Zero, FileMode.Open, EFileAttributes.Overlapped, IntPtr.Zero); int lastError = Marshal.GetLastWin32Error(); + //Console.WriteLine("Last Error: {0}", lastError); + if (deviceHandle.IsInvalid) throw new Win32Exception(lastError, "Failed to open device"); @@ -348,7 +353,10 @@ { try { - if (_deviceStream.EndRead(asyncResult) == DeviceBufferSize && _deviceBuffer[1] == 0) + //int read = _deviceStream.EndRead(asyncResult); + //Console.WriteLine(BitConverter.ToString(_deviceBuffer, 0, read)); + + if (_deviceStream.EndRead(asyncResult) == 4 && _deviceBuffer[1] == 0) { TimeSpan timeSpan = DateTime.Now - _lastCodeTime; @@ -374,6 +382,31 @@ #endregion Implementation + #region Debug + + [STAThread] + static void Main() + { + try + { + IR507Receiver c = new IR507Receiver(); + c.Start(); + + while (Console.ReadKey().Key != ConsoleKey.Escape) + { + Console.WriteLine("Press escape to quit"); + } + + c.Stop(); + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + } + } + + #endregion Debug + } } Modified: trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/LiveDrive Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/LiveDrive Receiver.csproj 2008-02-25 11:27:01 UTC (rev 1396) +++ trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/LiveDrive Receiver.csproj 2008-02-26 14:53:36 UTC (rev 1397) @@ -7,7 +7,7 @@ <ProjectGuid>{ABA2DAF3-B4CF-42BF-8686-DD662B0D6406}</ProjectGuid> <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>LiveDriveReceiver</RootNamespace> + <RootNamespace>InputService.Plugin</RootNamespace> <AssemblyName>LiveDrive Receiver</AssemblyName> <ApplicationIcon>Icon.ico</ApplicationIcon> </PropertyGroup> 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 2008-02-25 11:27:01 UTC (rev 1396) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.cs 2008-02-26 14:53:36 UTC (rev 1397) @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.ComponentModel; using System.Drawing; +using System.ServiceProcess; using System.Text; using System.Windows.Forms; @@ -52,6 +53,11 @@ get { return Decimal.ToInt32(numericUpDownButtonHeldDelay.Value); } set { numericUpDownButtonHeldDelay.Value = new Decimal(value); } } + public bool DisableAutomaticButtons + { + get { return checkBoxDisableAutomaticButtons.Checked; } + set { checkBoxDisableAutomaticButtons.Checked = value; } + } public bool EnableKeyboard { @@ -115,27 +121,39 @@ private void buttonOK_Click(object sender, EventArgs e) { - if (checkBoxDisableAutomaticButtons.Checked) + bool changeMade = false; + + using (RegistryKey key = Registry.LocalMachine.OpenSubKey(RegistrySubKey, true)) { - using (RegistryKey key = Registry.LocalMachine.OpenSubKey(RegistrySubKey, true)) + bool keysExist = (key.GetValue("CodeSetNum0", null) != null); + + if (checkBoxDisableAutomaticButtons.Checked && keysExist) { key.DeleteValue("CodeSetNum0", false); key.DeleteValue("CodeSetNum1", false); key.DeleteValue("CodeSetNum2", false); key.DeleteValue("CodeSetNum3", false); + + changeMade = true; } - } - else - { - using (RegistryKey key = Registry.LocalMachine.OpenSubKey(RegistrySubKey, true)) + else if (!checkBoxDisableAutomaticButtons.Checked && !keysExist) { key.SetValue("CodeSetNum0", 1, RegistryValueKind.DWord); key.SetValue("CodeSetNum1", 2, RegistryValueKind.DWord); key.SetValue("CodeSetNum2", 3, RegistryValueKind.DWord); key.SetValue("CodeSetNum3", 4, RegistryValueKind.DWord); + + changeMade = true; } } + if (changeMade) + { + RestartService("blah"); // HidServ? + + MessageBox.Show(this, "You must restart for changes to automatic button handling to take effect", "Restart required", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + this.DialogResult = DialogResult.OK; this.Close(); } @@ -156,6 +174,39 @@ groupBoxKeypressTiming.Enabled = !checkBoxUseSystemRatesKeyboard.Checked; } + + static void RestartService(string serviceName) + { + try + { + ServiceController[] services = ServiceController.GetServices(); + foreach (ServiceController service in services) + { + System.Diagnostics.Trace.WriteLine(service.ServiceName); + + if (service.ServiceName.Equals(serviceName, StringComparison.OrdinalIgnoreCase)) + { + if (service.Status != ServiceControllerStatus.Stopped) + { + service.Stop(); + service.WaitForStatus(ServiceControllerStatus.Stopped, new TimeSpan(0, 0, 30)); + } + + service.Start(); + } + } + } + catch (System.ComponentModel.Win32Exception ex) + { + MessageBox.Show(ex.Message, "Error restarting service", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + catch (System.ServiceProcess.TimeoutException ex) + { + MessageBox.Show(ex.Message, "Error stopping service", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + } } 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 2008-02-25 11:27:01 UTC (rev 1396) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverReplacement.cs 2008-02-26 14:53:36 UTC (rev 1397) @@ -371,7 +371,16 @@ SetCarrierFrequency(code.Carrier); // Send packet - WriteSync(DataPacket(code)); + byte[] data = DataPacket(code); + + // If the code would go longer than the allowable limit, truncate the code + if (data.Length > 341) // 340 minus the overhead of 1 byte in 4 for header is 255 bytes of actual time code data, add one for a terminator byte + { + Array.Resize<byte>(ref data, 341); // Shrink the array to fit + data[340] = 0x80; // Set the terminator byte + } + + WriteSync(data); } #endregion Driver overrides @@ -939,7 +948,7 @@ void WriteSync(byte[] data) { #if DEBUG - DebugWriteLine("WriteSync()"); + DebugWriteLine("WriteSync({0} bytes)", data.Length); DebugDump(data); #endif @@ -1104,19 +1113,19 @@ /// This is used to determine the carrier frequency. /// </summary> /// <param name="code">The IrCode to analyse.</param> - /// <param name="onTime">The total ammount of pulse time.</param> - /// <param name="onCount">The total count of pulses.</param> - static void GetIrCodeLengths(IrCode code, out int onTime, out int onCount) + /// <param name="pulseTime">The total ammount of pulse time.</param> + /// <param name="pulseCount">The total count of pulses.</param> + static void GetIrCodeLengths(IrCode code, out int pulseTime, out int pulseCount) { - onTime = 0; - onCount = 0; + pulseTime = 0; + pulseCount = 0; foreach (int time in code.TimingData) { if (time > 0) { - onTime += time; - onCount++; + pulseTime += time; + pulseCount++; } } } 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 2008-02-25 11:27:01 UTC (rev 1396) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverVista.cs 2008-02-26 14:53:36 UTC (rev 1397) @@ -455,6 +455,10 @@ void TransmitIR(byte[] irData, int carrier, int transmitPortMask) { +#if DEBUG + DebugWriteLine("TransmitIR({0} bytes, carrier: {1}, port: {2})", irData.Length, carrier, transmitPortMask); +#endif + if (!_deviceAvailable) throw new ApplicationException("Device not available"); 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 2008-02-25 11:27:01 UTC (rev 1396) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverXP.cs 2008-02-26 14:53:36 UTC (rev 1397) @@ -13,7 +13,7 @@ { /// <summary> - /// Driver class for Windows XP eHome driver. + /// Driver class for the Windows XP eHome driver. /// </summary> class DriverXP : Driver { @@ -370,7 +370,41 @@ SetCarrierFrequency(code.Carrier); // Send packet - WriteSync(DataPacket(code)); + byte[] data = DataPacket(code); + + /* + if (data.Length > 100) + data = new byte[] { 0x84, 0x8A, 0x30, 0x8A, 0x13, 0x84, 0x94, 0x09, 0x8B, 0x09, 0x84, 0x8A, 0x09, 0x8B, 0x09, 0x84, 0x8A, 0x30, 0x8A, 0x13, 0x84, 0x94, 0x09, 0x8B, 0x09, 0x84, 0x8A, 0x09, 0x8B, 0x09, + 0x84, 0x8A, 0x30, 0x8A, 0x13, 0x84, 0x94, 0x09, 0x8B, 0x09, 0x84, 0x8A, 0x09, 0x8B, 0x09, 0x84, 0x8A, 0x09, 0x8B, 0x09, 0x84, 0x8A, 0x09, 0x8B, 0x09, 0x84, 0x8A, 0x09, 0x8B, 0x09, 0x84, 0x8A, 0x09, 0x8B, 0x09, 0x84, 0x8A, 0x09, 0x8B, 0x09, 0x84, 0x8A, 0x7F, 0x17, 0x8A, 0x84, 0x30, 0x8A, 0x13, 0x8A, 0x84, 0x09, 0x8A, 0x0A, 0x8A, 0x84, 0x09, 0x8A, 0x0A, 0x8A, 0x84, 0x09, 0x8A, 0x09, 0x8B, 0x84, 0x09, 0x8A, 0x09, 0x95, 0x84, 0x13, 0x94, 0x13, 0x94, 0x84, 0x09, 0x8A, 0x13, 0x8B, 0x84, 0x30, 0x8A, 0x30, 0x8A, 0x84, 0x13, 0x8A, 0x09, 0x8B, 0x84, 0x09, 0x8A, 0x09, 0x8A, 0x84, 0x0A, 0x8A, 0x09, 0x8A, 0x84, 0x0A, 0x8A, 0x09, 0x8A, 0x84, 0x09, 0x95, 0x13, 0x94, 0x84, 0x13, 0x94, 0x09, 0x8A, 0x84, 0x13, 0x8B, 0x30, 0x8A, 0x84, 0x30, 0x8A, 0x13, 0x8A, 0x84, 0x09, 0x8B, 0x09, 0x8A, 0x84, 0x09, 0x8B, 0x09, 0x8A, 0x84, 0x09, 0x8A, 0x0A, 0x8A, 0x84, 0x09, 0x8A, 0x0A, 0x94, 0x84, 0x13, 0x94, 0x13, 0x94, 0x84, 0x09, 0x8A, 0x13, 0x8B, 0x84, 0x30, 0x8A, 0x30, 0x8A, 0x84, 0x13, 0x8A, 0x09, 0x8B, 0x84, 0x09, 0x8A, 0x09, 0x8B, 0x84, 0x09, 0x8A, 0x09, 0x8A, 0x84, 0x0A, 0x8A, 0x09, 0x8A, 0x84, 0x0A, 0x94, 0x13, 0x94, 0x84, 0x13, 0x94, 0x09, 0x8B, 0x84, 0x12, 0x8B, 0x30, 0x8A, 0x84, 0x30, 0x8A, 0x13, 0x8A, 0x84, 0x09, 0x8B, 0x09, 0x8A, 0x84, 0x09, 0x8B, 0x09, 0x8A, 0x84, 0x09, 0x8A, 0x0A, 0x8A, 0x84, 0x09, 0x8A, 0x0A, 0x94, 0x84, 0x13, 0x94, 0x13, 0x94, 0x84, 0x09, 0x8B, 0x12, 0x8B, 0x84, 0x30, 0x8A, 0x30, 0x8A, 0x84, 0x13, 0x8A, 0x09, 0x8B, 0x84, 0x09, 0x8A, 0x09, 0x8B, 0x84, 0x09, 0x8A, 0x09, 0x8B, 0x84, 0x09, 0x8A, 0x09, 0x8A, 0x84, 0x0A, 0x94, 0x13, 0x94, 0x84, 0x13, 0x94, 0x09, 0x8B, 0x84, 0x12, 0x8B, 0x30, 0x8A, 0x84, 0x30, 0x8A, 0x13, 0x8A, 0x84, 0x09, 0x8B, 0x09, 0x8A, 0x84, 0x09, 0x8B, 0x09, 0x8A, 0x84, 0x09, 0x8B, 0x09, 0x8A, 0x84, 0x09, 0x8A, 0x0A, 0x94, 0x84, 0x13, 0x94, 0x13, 0x94, 0x84, 0x09, 0x8B, 0x12, 0x8B, + 0x83, 0x30, 0x8A, 0x13, 0x80 }; + */ + + //data = new byte[259]; + //for (int index = 0; index < data.Length; index++) + //data[index] = (byte)(index % 256); + + /* + while (data.Length > 255) // use 255 to catch the "0x8x" segment boundaries + { + byte[] segment = new byte[255]; + Array.Copy(data, segment, segment.Length); + + WriteSync(segment); + + byte[] newData = new byte[data.Length - 255]; + Array.Copy(data, 255, newData, 0, newData.Length); + data = newData; + } + */ + + // If the code would go longer than the allowable limit, truncate the code + if (data.Length > 341) // 340 minus the overhead of 1 byte in 4 for header is 255 bytes of actual time code data, add one for a terminator byte + { + Array.Resize<byte>(ref data, 341); // Shrink the array to fit + data[340] = 0x80; // Set the terminator byte + } + + WriteSync(data); } #endregion Driver overrides @@ -634,8 +668,10 @@ return; } + int lastError; + _eHomeHandle = CreateFile(_devicePath, CreateFileAccessTypes.GenericRead | CreateFileAccessTypes.GenericWrite, CreateFileShares.None, IntPtr.Zero, CreateFileDisposition.OpenExisting, CreateFileAttributes.Overlapped, IntPtr.Zero); - int lastError = Marshal.GetLastWin32Error(); + lastError = Marshal.GetLastWin32Error(); if (_eHomeHandle.IsInvalid) { _eHomeHandle = null; @@ -915,7 +951,7 @@ void WriteSync(byte[] data) { #if DEBUG - DebugWriteLine("WriteSync()"); + DebugWriteLine("WriteSync({0} bytes)", data.Length); DebugDump(data); #endif @@ -1080,19 +1116,19 @@ /// This is used to determine the carrier frequency. /// </summary> /// <param name="code">The IrCode to analyse.</param> - /// <param name="onTime">The total ammount of pulse time.</param> - /// <param name="onCount">The total count of pulses.</param> - static void GetIrCodeLengths(IrCode code, out int onTime, out int onCount) + /// <param name="pulseTime">The total ammount of pulse time.</param> + /// <param name="pulseCount">The total count of pulses.</param> + static void GetIrCodeLengths(IrCode code, out int pulseTime, out int pulseCount) { - onTime = 0; - onCount = 0; + pulseTime = 0; + pulseCount = 0; foreach (int time in code.TimingData) { if (time > 0) { - onTime += time; - onCount++; + pulseTime += time; + pulseCount++; } } } Modified: 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 2008-02-25 11:27:01 UTC (rev 1396) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrCode.cs 2008-02-26 14:53:36 UTC (rev 1397) @@ -30,9 +30,9 @@ public const int CarrierFrequencyDefault = 36000; /// <summary> - /// How long the longest IR Code space should be (microseconds). + /// How long the longest IR Code space should be (in microseconds). /// </summary> - const int LongestSpace = -100000; + const int LongestSpace = -75000; #endregion Constants @@ -89,8 +89,8 @@ if (_timingData.Length == 0) return false; + // Find long spaces and trim the IR code ... List<int> newData = new List<int>(); - foreach (int time in _timingData) { if (time <= LongestSpace) @@ -152,34 +152,18 @@ /// <summary> /// Creates a byte array representation of this IR Code. /// </summary> - /// <param name="asPronto">Set this parameter true to convert the IR Code into Pronto format.</param> - /// <returns>Byte array representation.</returns> - public byte[] ToByteArray(bool asPronto) + /// <returns>Byte array representation (internally it is in Pronto format).</returns> + public byte[] ToByteArray() { StringBuilder output = new StringBuilder(); - if (asPronto) - { - ushort[] prontoData = Pronto.ConvertIrCodeToProntoRaw(this); + ushort[] prontoData = Pronto.ConvertIrCodeToProntoRaw(this); - for (int index = 0; index < prontoData.Length; index++) - { - output.Append(prontoData[index].ToString("X4")); - if (index != prontoData.Length - 1) - output.Append(' '); - } - } - else // Native format (only benefit is a slightly more accurate Carrier Frequency) + for (int index = 0; index < prontoData.Length; index++) { - output.Append("MCE,"); - output.AppendFormat("{0},", _carrier); - - for (int index = 0; index < _timingData.Length; index++) - { - output.Append(_timingData[index]); - if (index != _timingData.Length - 1) - output.Append(','); - } + output.Append(prontoData[index].ToString("X4")); + if (index != prontoData.Length - 1) + output.Append(' '); } return Encoding.ASCII.GetBytes(output.ToString()); @@ -219,37 +203,30 @@ if (len != 0) timingData.Add(len * 50); - // Seems some old files have excessively long delays in them .. this might fix that problem ... IrCode newCode = new IrCode(timingData.ToArray()); - newCode.FinalizeData(); + newCode.FinalizeData(); // Seems some old files have excessively long delays in them .. this might fix that problem ... return newCode; } /// <summary> - /// Create an IrCode object from Native file bytes. + /// Creates an IrCode object from Pronto format file bytes. /// </summary> /// <param name="data">IR file bytes.</param> /// <returns>New IrCode object.</returns> - static IrCode FromNativeData(string data) + static IrCode FromProntoData(byte[] data) { - if (String.IsNullOrEmpty(data)) - throw new ArgumentNullException("data"); + string code = Encoding.ASCII.GetString(data); - string[] elements = data.Split(new char[] { ',' }); + string[] stringData = code.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); - if (elements.Length < 3) - throw new ApplicationException("Invalid native IR file data"); + ushort[] prontoData = new ushort[stringData.Length]; + for (int i = 0; i < stringData.Length; i++) + prontoData[i] = ushort.Parse(stringData[i], System.Globalization.NumberStyles.HexNumber); - IrCode newCode = new IrCode(); - newCode.Carrier = int.Parse(elements[1]); + IrCode newCode = Pronto.ConvertProntoDataToIrCode(prontoData); + newCode.FinalizeData(); // Seems some old files have excessively long delays in them .. this might fix that problem ... - int[] timingData = new int[elements.Length - 2]; - for (int index = 2; index < elements.Length; index++) - timingData[index - 2] = int.Parse(elements[index]); - - newCode.TimingData = timingData; - return newCode; } @@ -261,27 +238,9 @@ public static IrCode FromByteArray(byte[] data) { if (data[4] == ' ') - { - string code = Encoding.ASCII.GetString(data); - - 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); - } - else if (data[0] == 'M' && data[1] == 'C' && data[2] == 'E') - { - string code = Encoding.ASCII.GetString(data); - - return FromNativeData(code); - } + return FromProntoData(data); else - { return FromOldData(data); - } } #endregion Static Methods Modified: 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/Microsoft MCE Transceiver.csproj 2008-02-25 11:27:01 UTC (rev 1396) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Microsoft MCE Transceiver.csproj 2008-02-26 14:53:36 UTC (rev 1397) @@ -5,12 +5,13 @@ <ProductVersion>8.0.50727</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{BABC30EB-7D0F-4398-9FCB-E517EA8D2AA9}</ProjectGuid> - <OutputType>Exe</OutputType> + <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>MicrosoftMceTransceiver</RootNamespace> + <RootNamespace>InputService.Plugin</RootNamespace> <AssemblyName>Microsoft MCE Transceiver</AssemblyName> <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent> - <StartupObject>InputService.Plugin.MicrosoftMceTransceiver</StartupObject> + <StartupObject> + </StartupObject> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>false</DebugSymbols> 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 2008-02-25 11:27:01 UTC (rev 1396) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs 2008-02-26 14:53:36 UTC (rev 1397) @@ -111,13 +111,15 @@ } IrCode code = IrCode.FromByteArray(fileBytes); + //code.Carrier = 37010; + //code.TimingData = new int[] { +150, -5950, +450, -1300, +450, -400, +500, -1250, +450, -450, +450, -400, +450, -450, +450, -400, +450, -450, +450, -400, +450, -450, +450, -400, +450, -450, +450, -400, +500, -400, +450, -400, +500, -400, +450, -1300, +450, -400, +450, -450, +450, -400, +450, -450, +450, -400, +450, -450, +450, -400, +450, -450, +450, -400, +500, -1250, +450, -10250, +3450, -1750, +450, -400, +500, -1250, +500, -400, +450, -400, +500, -400, +450, -400, +500, -400, +450, -400, +500, -400, +450, -400, +500, -400, +450, -400, +500, -400, +450, -1300, +450, -400, +500, -400, +450, -400, +500, -400, +450, -400, +500, -400, +450, -400, +500, -1250, +500, -400, +450, -1250, +500, -400, +500, -350, +500, -400, +500, -350, +500, -400, +500, -400, +450, -400, +500, -400, +450, -400, +500, -400, +450, -400, +500, -400, +450, -400, +500, -1250, +500, -350, +500, -400, +500, -350, +500, -400, +500, -400, +450, -400, +500, -400, +450, -400, +500, -400, +450, -1250, +500, -10400 }; Dump(code.TimingData); Console.WriteLine("Press any key to begin ..."); Console.ReadKey(); - int length = 750000; + int length = 1725000; //for (int length = 700000; length < 5000000; length += 50000) while (true) { @@ -126,6 +128,7 @@ List<int> newCode = new List<int>(); int total = 0; + int pulseTotal = 0; for (int index = 0; index < code.TimingData.Length; index++) { int time = code.TimingData[index]; @@ -144,14 +147,17 @@ newCode.Add(time); total += Math.Abs(time); + if (time > 0) + pulseTotal += time; } Console.WriteLine("Blasting with actual total time of {0}us ...", total); + Console.WriteLine("Blasting with total pulse time of {0}us ...", pulseTotal); IrCode test = new IrCode(code.Carrier, newCode.ToArray()); Dump(test.TimingData); - c.Transmit("Both", test.ToByteArray(true)); + c.Transmit("Both", test.ToByteArray()); Console.WriteLine("Blast complete, press any key to contiue ..."); if (Console.ReadKey().Key == ConsoleKey.Escape) @@ -192,6 +198,7 @@ bool _useSystemRatesRemote = false; int _remoteFirstRepeat = 400; int _remoteHeldRepeats = 250; + bool _disableAutomaticButtons = false; bool _enableKeyboardInput = false; bool _useSystemRatesKeyboard = true; @@ -204,7 +211,6 @@ double _mouseSensitivity = 1.0d; // Hidden options ... - bool _storeAsPronto = true; bool _forceVistaDriver = false; #endregion Configuration @@ -376,6 +382,7 @@ config.UseSystemRatesForRemote = _useSystemRatesRemote; config.RemoteRepeatDelay = _remoteFirstRepeat; config.RemoteHeldDelay = _remoteHeldRepeats; + config.DisableAutomaticButtons = _disableAutomaticButtons; config.EnableKeyboard = _enableKeyboardInput; config.UseSystemRatesForKeyboard = _useSystemRatesKeyboard; @@ -396,6 +403,7 @@ _useSystemRatesRemote = config.UseSystemRatesForRemote; _remoteFirstRepeat = config.RemoteRepeatDelay; _remoteHeldRepeats = config.RemoteHeldDelay; + _disableAutomaticButtons = config.DisableAutomaticButtons; _enableKeyboardInput = config.EnableKeyboard; _useSystemRatesKeyboard = config.UseSystemRatesForKeyboard; @@ -466,8 +474,6 @@ if (code == null) throw new ArgumentException("Invalid IR Command data", "data"); - //code.Finalize(); - _driver.Send(code, (int)blasterPort); return true; @@ -486,7 +492,7 @@ LearnStatus status = _driver.Learn(_learnTimeout, out code); if (code != null) - data = code.ToByteArray(_storeAsPronto); + data = code.ToByteArray(); else data = null; @@ -507,6 +513,7 @@ try { _useSystemRatesRemote = bool.Parse(doc.DocumentElement.Attributes["UseSystemRatesRemote"].Value); } catch { } try { _remoteFirstRepeat = int.Parse(doc.DocumentElement.Attributes["RemoteFirstRepeat"].Value); } catch {} try { _remoteHeldRepeats = int.Parse(doc.DocumentElement.Attributes["RemoteHeldRepeats"].Value); } catch {} + try { _disableAutomaticButtons = bool.Parse(doc.DocumentElement.Attributes["DisableAutomaticButtons"].Value); } catch {} try { _enableKeyboardInput = bool.Parse(doc.DocumentElement.Attributes["EnableKeyboardInput"].Value); } catch {} try { _useSystemRatesKeyboard = bool.Parse(doc.DocumentElement.Attributes["UseSystemRatesKeyboard"].Value); } catch { } @@ -519,10 +526,7 @@ try { _mouseSensitivity = double.Parse(doc.DocumentElement.Attributes["MouseSensitivity"].Value); } catch {} // Hidden options ... - try { _storeAsPronto = bool.Parse(doc.DocumentElement.Attributes["StoreAsPronto"].Value); } catch {} try { _forceVistaDriver = bool.Parse(doc.DocumentElement.Attributes["ForceVistaDriver"].Value); } catch {} - - } void SaveSettings() { @@ -543,6 +547,7 @@ writer.WriteAttributeString("UseSystemRatesRemote", _useSystemRatesRemote.ToString()); writer.WriteAttributeString("RemoteFirstRepeat", _remoteFirstRepeat.ToString()); writer.WriteAttributeString("RemoteHeldRepeats", _remoteHeldRepeats.ToString()); + writer.WriteAttributeString("DisableAutomaticButtons", _disableAutomaticButtons.ToString()); writer.WriteAttributeString("EnableKeyboardInput", _enableKeyboardInput.ToString()); writer.WriteAttributeString("UseSystemRatesKeyboard", _useSystemRatesKeyboard.ToString()); @@ -555,7 +560,6 @@ writer.WriteAttributeString("MouseSensitivity", _mouseSensitivity.ToString()); // Hidden options ... - writer.WriteAttributeString("StoreAsPronto", _storeAsPronto.ToString()); writer.WriteAttributeString("ForceVistaDriver", _forceVistaDriver.ToString()); writer.WriteEndElement(); // </settings> @@ -694,8 +698,8 @@ int heldRepeats = _remoteHeldRepeats; if (_useSystemRatesRemote) { - firstRepeat = SystemInformation.KeyboardDelay; - heldRepeats = SystemInformation.KeyboardSpeed; + firstRepeat = 250 + (SystemInformation.KeyboardDelay * 250); + heldRepeats = (int)(1000.0 / (2.5 + (SystemInformation.KeyboardSpeed * 0.888))); } if (!_remoteButtonRepeated && timeBetween.TotalMilliseconds < firstRepeat) @@ -800,8 +804,8 @@ int heldRepeats = _keyboardHeldRepeats; if (_useSystemRatesRemote) { - firstRepeat = SystemInformation.KeyboardDelay; - heldRepeats = SystemInformation.KeyboardSpeed; + firstRepeat = 250 + (SystemInformation.KeyboardDelay * 250); + heldRepeats = (int)(1000.0 / (2.5 + (SystemInformation.KeyboardSpeed * 0.888))); } if (!_keyboardKeyRepeated && timeBetween.TotalMilliseconds < firstRepeat) @@ -896,6 +900,7 @@ _mouseHandler(deltaX, deltaY, (int)buttons); } + // TODO: Convert this function to a lookup from an XML file, then provide multiple files and a way to fine-tune... static Keyboard.VKey ConvertMceKeyCodeToVKey(uint keyCode) { switch (keyCode) Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Pronto.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Pronto.cs 2008-02-25 11:27:01 UTC (rev 1396) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Pronto.cs 2008-02-26 14:53:36 UTC (rev 1397) @@ -99,6 +99,11 @@ } */ + /// <summary> + /// Converts an IR Code represented in Pronto data to an IrCode object. + /// </summary> + /// <param name="prontoData">The Pronto data to convert.</param> + /// <returns>IrCode object of interpretted Pronto data.</returns> public static IrCode ConvertProntoDataToIrCode(ushort[] prontoData) { if (prontoData == null || prontoData.Length == 0) @@ -532,6 +537,24 @@ return new IrCode(ConvertFromProntoCarrier(prontoCarrier), timingData.ToArray()); } + /* + public static ushort[] ConvertIrCodeToPronto(IrCode irCode) + { + CodeType codeType; + Int64 value; + + if (Decode(irCode, out codeType, out value)) + return EncodePronto(codeType, value); + else + return null; + } + */ + + /// <summary> + /// Converts the ir code into Pronto raw format. + /// </summary> + /// <param name="irCode">The ir code to convert.</param> + /// <returns>Pronto data (raw format).</returns> public static ushort[] ConvertIrCodeToProntoRaw(IrCode irCode) { List<ushort> prontoData = new List<ushort>(); @@ -582,11 +605,21 @@ return prontoData.ToArray(); } + /// <summary> + /// Converts from a Pronto format carrier frequency to an integer format. + /// </summary> + /// <param name="prontoCarrier">The Pronto format carrier.</param> + /// <returns>The carrier frequency as an integer number.</returns> public static int ConvertFromProntoCarrier(ushort prontoCarrier) { return (int)(1000000 / (prontoCarrier * ProntoClock)); } + /// <summary> + /// Converts from an integer number carrier frequency to a Pronto carrier format. + /// </summary> + /// <param name="carrierFrequency">The integer carrier frequency.</param> + /// <returns>The carrier frequency in Pronto format.</returns> public static ushort ConvertToProntoCarrier(int carrierFrequency) { return (ushort)(1000000 / (carrierFrequency * ProntoClock)); Modified: trunk/plugins/IR Server Suite/IR Server Plugins/RC102 Receiver/RC102Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/RC102 Receiver/RC102Receiver.cs 2008-02-25 11:27:01 UTC (rev 1396) +++ trunk/plugins/IR Server Suite/IR Server Plugins/RC102 Receiver/RC102Receiver.cs 2008-02-26 14:53:36 UTC (rev 1397) @@ -145,8 +145,9 @@ const string DeviceID = "vid_147a&pid_e019"; //const string DeviceID = "vid_147a&pid_e001"; // 501 - //const string DeviceID = "vid_0e6a&pid_6002"; // 507 - + //const string DeviceID = "vid_147a&pid_e02a"; // 507 + //const string DeviceID = "vid_0e6a&pid_6002"; // 507?? + #endregion Constants #region Variables @@ -219,7 +220,7 @@ if (String.IsNullOrEmpty(devicePath)) throw new ApplicationException("Device not found"); - SafeFileHandle deviceHandle = CreateFile(devicePath, FileAccess.Read, FileShare.ReadWrite, IntPtr.Zero, FileMode.Open, EFileAttributes.Overlapped, IntPtr.Zero); + SafeFileHandle deviceHandle = CreateFile(devicePath, FileAccess.Read, FileShare.Read, IntPtr.Zero, FileMode.Open, EFileAttributes.Overlapped, IntPtr.Zero); int lastError = Marshal.GetLastWin32Error(); if (deviceHandle.IsInvalid) Modified: trunk/plugins/IR Server Suite/IR Server Suite - Debug.nsi =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite - Debug.nsi 2008-02-25 11:27:01 UTC (rev 1396) +++ trunk/plugins/IR Server Suite/IR Server Suite - Debug.nsi 2008-02-26 14:53:36 UTC (rev 1397) @@ -296,27 +296,29 @@ SetOutPath "$DIR_INSTALL\IR Server Plugins" SetOverwrite ifnewer - File "IR Server Plugins\Ads Tech PTV-335 Receiver\bin\Debug\*.*" - File "IR Server Plugins\Custom HID Receiver\bin\Debug\*.*" - ;File "IR Server Plugins\Direct Input Receiver\bin\Debug\*.*" - File "IR Server Plugins\FusionRemote Receiver\bin\Debug\*.*" - File "IR Server Plugins\Girder Plugin\bin\Debug\*.*" - File "IR Server Plugins\HCW Receiver\bin\Debug\*.*" - File "IR Server Plugins\IgorPlug Receiver\bin\Debug\*.*" - File "IR Server Plugins\IRMan Receiver\bin\Debug\*.*" - File "IR Server Plugins\IRTrans Transceiver\bin\Debug\*.*" - File "IR Server Plugins\Keyboard Input\... [truncated message content] |
From: <an...@us...> - 2008-02-28 16:46:32
|
Revision: 1407 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1407&view=rev Author: and-81 Date: 2008-02-28 08:46:28 -0800 (Thu, 28 Feb 2008) Log Message: ----------- Modified Paths: -------------- 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/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/Program.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/Web Remote/Program.cs trunk/plugins/IR Server Suite/Documentation/new.html trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/UirtTransceiver.cs Added Paths: ----------- trunk/plugins/IR Server Suite/Applications/Abstractor/Abstract Remote Model - v0.1.doc trunk/plugins/IR Server Suite/Applications/Abstractor/Remote Maps/ trunk/plugins/IR Server Suite/Applications/Abstractor/Remote Maps/FusionREMOTE/ trunk/plugins/IR Server Suite/Applications/Abstractor/Remote Maps/FusionREMOTE/FusionHDTV.xml trunk/plugins/IR Server Suite/Applications/Abstractor/Remote Maps/FusionREMOTE/FusionREMOTE.xml trunk/plugins/IR Server Suite/Applications/Abstractor/Remote Maps/IgorPlug/ trunk/plugins/IR Server Suite/Applications/Abstractor/Remote Maps/IgorPlug/Microsoft MCE.xml trunk/plugins/IR Server Suite/Applications/Abstractor/Remote Maps/Microsoft MCE/ trunk/plugins/IR Server Suite/Applications/Abstractor/Remote Maps/Microsoft MCE/Microsoft MCE.xml trunk/plugins/IR Server Suite/Applications/Abstractor/Remote Maps/USB-UIRT/ trunk/plugins/IR Server Suite/Applications/Abstractor/Remote Maps/USB-UIRT/Microsoft MCE.xml trunk/plugins/IR Server Suite/Applications/Abstractor/Remote Maps/Windows Messages/ trunk/plugins/IR Server Suite/Applications/Abstractor/Remote Maps/Windows Messages/Virtual Remote.xml trunk/plugins/IR Server Suite/Applications/Abstractor/Remote Maps/XBCDRC/ trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/ trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/CoolCommand Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/CoolCommandReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/Properties/ trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/ReceiverWindow.cs trunk/plugins/IR Server Suite/IR Server Plugins/MacMini Receiver/ trunk/plugins/IR Server Suite/IR Server Plugins/MacMini Receiver/MacMini Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/MacMini Receiver/MacMini Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/MacMini Receiver/Properties/ trunk/plugins/IR Server Suite/IR Server Plugins/MacMini Receiver/Properties/AssemblyInfo.cs Property Changed: ---------------- trunk/plugins/IR Server Suite/Applications/Abstractor/ Property changes on: trunk/plugins/IR Server Suite/Applications/Abstractor ___________________________________________________________________ Name: svn:ignore + bin obj Added: trunk/plugins/IR Server Suite/Applications/Abstractor/Abstract Remote Model - v0.1.doc =================================================================== (Binary files differ) Property changes on: trunk/plugins/IR Server Suite/Applications/Abstractor/Abstract Remote Model - v0.1.doc ___________________________________________________________________ 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-02-28 12:22:43 UTC (rev 1406) +++ trunk/plugins/IR Server Suite/Applications/Abstractor/MainForm.Designer.cs 2008-02-28 16:46:28 UTC (rev 1407) @@ -46,7 +46,8 @@ this.listViewButtonMap = new System.Windows.Forms.ListView(); this.columnHeaderAbstractButton = new System.Windows.Forms.ColumnHeader(); this.columnHeaderKeyCode = new System.Windows.Forms.ColumnHeader(); - this.checkBox1 = new System.Windows.Forms.CheckBox(); + this.checkBoxToggle = new System.Windows.Forms.CheckBox(); + this.checkBoxForwardAbstract = new System.Windows.Forms.CheckBox(); this.groupBoxSetup.SuspendLayout(); this.groupBoxStatus.SuspendLayout(); this.groupBoxMapAbstract.SuspendLayout(); @@ -63,7 +64,7 @@ this.groupBoxSetup.Location = new System.Drawing.Point(8, 8); this.groupBoxSetup.Name = "groupBoxSetup"; this.groupBoxSetup.Size = new System.Drawing.Size(440, 64); - this.groupBoxSetup.TabIndex = 4; + this.groupBoxSetup.TabIndex = 0; this.groupBoxSetup.TabStop = false; this.groupBoxSetup.Text = "Setup"; // @@ -118,8 +119,8 @@ this.groupBoxStatus.Controls.Add(this.listBoxStatus); this.groupBoxStatus.Location = new System.Drawing.Point(8, 344); this.groupBoxStatus.Name = "groupBoxStatus"; - this.groupBoxStatus.Size = new System.Drawing.Size(440, 216); - this.groupBoxStatus.TabIndex = 5; + this.groupBoxStatus.Size = new System.Drawing.Size(440, 192); + this.groupBoxStatus.TabIndex = 2; this.groupBoxStatus.TabStop = false; this.groupBoxStatus.Text = "Status"; // @@ -134,7 +135,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, 185); + this.listBoxStatus.Size = new System.Drawing.Size(424, 168); this.listBoxStatus.TabIndex = 0; // // groupBoxMapAbstract @@ -142,7 +143,7 @@ this.groupBoxMapAbstract.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.groupBoxMapAbstract.Controls.Add(this.checkBox1); + this.groupBoxMapAbstract.Controls.Add(this.checkBoxToggle); this.groupBoxMapAbstract.Controls.Add(this.buttonClear); this.groupBoxMapAbstract.Controls.Add(this.buttonLoad); this.groupBoxMapAbstract.Controls.Add(this.buttonSave); @@ -154,7 +155,7 @@ this.groupBoxMapAbstract.Location = new System.Drawing.Point(8, 80); this.groupBoxMapAbstract.Name = "groupBoxMapAbstract"; this.groupBoxMapAbstract.Size = new System.Drawing.Size(440, 256); - this.groupBoxMapAbstract.TabIndex = 6; + this.groupBoxMapAbstract.TabIndex = 1; this.groupBoxMapAbstract.TabStop = false; this.groupBoxMapAbstract.Text = "Abstract Remote Map"; // @@ -164,7 +165,7 @@ this.buttonClear.Location = new System.Drawing.Point(8, 224); this.buttonClear.Name = "buttonClear"; this.buttonClear.Size = new System.Drawing.Size(80, 24); - this.buttonClear.TabIndex = 7; + this.buttonClear.TabIndex = 5; this.buttonClear.Text = "Clear"; this.buttonClear.UseVisualStyleBackColor = true; this.buttonClear.Click += new System.EventHandler(this.buttonClear_Click); @@ -175,7 +176,7 @@ this.buttonLoad.Location = new System.Drawing.Point(264, 224); this.buttonLoad.Name = "buttonLoad"; this.buttonLoad.Size = new System.Drawing.Size(80, 24); - this.buttonLoad.TabIndex = 5; + this.buttonLoad.TabIndex = 7; this.buttonLoad.Text = "Load"; this.buttonLoad.UseVisualStyleBackColor = true; this.buttonLoad.Click += new System.EventHandler(this.buttonLoad_Click); @@ -186,7 +187,7 @@ this.buttonSave.Location = new System.Drawing.Point(352, 224); this.buttonSave.Name = "buttonSave"; this.buttonSave.Size = new System.Drawing.Size(80, 24); - this.buttonSave.TabIndex = 6; + this.buttonSave.TabIndex = 8; this.buttonSave.Text = "Save"; this.buttonSave.UseVisualStyleBackColor = true; this.buttonSave.Click += new System.EventHandler(this.buttonSave_Click); @@ -196,7 +197,7 @@ this.labelDevice.Location = new System.Drawing.Point(232, 24); this.labelDevice.Name = "labelDevice"; this.labelDevice.Size = new System.Drawing.Size(72, 20); - this.labelDevice.TabIndex = 4; + this.labelDevice.TabIndex = 2; this.labelDevice.Text = "Receiver:"; // // labelRemote @@ -204,7 +205,7 @@ this.labelRemote.Location = new System.Drawing.Point(8, 24); this.labelRemote.Name = "labelRemote"; this.labelRemote.Size = new System.Drawing.Size(96, 20); - this.labelRemote.TabIndex = 3; + this.labelRemote.TabIndex = 0; this.labelRemote.Text = "Remote name:"; // // comboBoxDevice @@ -213,7 +214,7 @@ 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 = 2; + this.comboBoxDevice.TabIndex = 3; // // textBoxRemoteName // @@ -238,7 +239,7 @@ this.listViewButtonMap.MultiSelect = false; this.listViewButtonMap.Name = "listViewButtonMap"; this.listViewButtonMap.Size = new System.Drawing.Size(424, 168); - this.listViewButtonMap.TabIndex = 0; + this.listViewButtonMap.TabIndex = 4; this.listViewButtonMap.UseCompatibleStateImageBehavior = false; this.listViewButtonMap.View = System.Windows.Forms.View.Details; this.listViewButtonMap.KeyDown += new System.Windows.Forms.KeyEventHandler(this.listViewButtonMap_KeyDown); @@ -253,21 +254,33 @@ this.columnHeaderKeyCode.Text = "KeyCode"; this.columnHeaderKeyCode.Width = 288; // - // checkBox1 + // checkBoxToggle // - this.checkBox1.AutoSize = true; - this.checkBox1.Location = new System.Drawing.Point(136, 224); - this.checkBox1.Name = "checkBox1"; - this.checkBox1.Size = new System.Drawing.Size(85, 17); - this.checkBox1.TabIndex = 8; - this.checkBox1.Text = "Toggle Keys"; - this.checkBox1.UseVisualStyleBackColor = true; + 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); @@ -302,7 +315,8 @@ private System.Windows.Forms.ListView listViewButtonMap; private System.Windows.Forms.ColumnHeader columnHeaderAbstractButton; private System.Windows.Forms.ColumnHeader columnHeaderKeyCode; - private System.Windows.Forms.CheckBox checkBox1; + 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-02-28 12:22:43 UTC (rev 1406) +++ trunk/plugins/IR Server Suite/Applications/Abstractor/MainForm.cs 2008-02-28 16:46:28 UTC (rev 1407) @@ -23,6 +23,81 @@ public partial class MainForm : Form { + /* + static readonly string[] AbstractButtons = new string[] { + + // Primary buttons ... + "Up", + "Down", + "Left", + "Right", + "OK", + "Volume Up", + "Volume Down", + "Channel Up", + "Channel Down", + "Start", + "Back", + "Info", + "Mute", + "Number 0", + "Number 1", + "Number 2", + "Number 3", + "Number 4", + "Number 5", + "Number 6", + "Number 7", + "Number 8", + "Number 9", + "Play", + "Pause", + "Play / Pause", + "Stop", + "Fast Forward", + "Rewind", + "Record", + "Next Chapter", + "Previous Chapter", + "Power", + + // Secondary buttons ... + "Power 2", + "Power 3", + "Teletext", + "Teletext Red", + "Teletext Green", + "Teletext Yellow", + "Teletext Blue", + "Subtitles", + "Menu", + "Clear", + "Enter", + "#", + "*", + "Task Swap", + "Fullscreen", + "Aspect Ratio", + "Setup", + "Music", + "Pictures", + "Videos", + "DVD", + "TV", + "Guide", + "Live TV", + "Radio", + "Print", + "Snapshot", + "Open", + "Close", + "Eject", + "Scroll Up", + "Scroll Down", + "Page Up", + "Page Down" + };*/ + public enum AbstractButton { Up, @@ -82,6 +157,8 @@ TV, Guide, LiveTV, + Radio, + Print, Snapshot, Open, Close, @@ -109,7 +186,6 @@ delegate void DelegateAddStatusLine(string status); DelegateAddStatusLine _addStatusLine; - void AddStatusLine(string status) { IrssLog.Info(status); @@ -122,7 +198,6 @@ delegate void DelegateSetDevices(string[] devices); DelegateSetDevices _setDevices; - void SetDevices(string[] devices) { comboBoxDevice.Items.Clear(); @@ -231,6 +306,9 @@ _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)); } @@ -312,8 +390,31 @@ // Determine abstract button details ... string abstractButton = LookupAbstractButton(deviceName, keyCode); - string abstractText = String.Format("Abstract Button \"{0}\"", abstractButton); + + 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) @@ -374,9 +475,6 @@ private void buttonConnect_Click(object sender, EventArgs e) { - _abstractRemoteButtons = new DataSet("AbstractRemoteButtons"); - _abstractRemoteButtons.CaseSensitive = true; - try { AddStatusLine("Connect"); @@ -402,8 +500,6 @@ } private void buttonDisconnect_Click(object sender, EventArgs e) { - _abstractRemoteButtons = null; - AddStatusLine("Disconnect"); try @@ -443,12 +539,18 @@ { string button = rows[0]["AbstractButton"].ToString() as string; if (!String.IsNullOrEmpty(button)) - return button + " on " + table.ExtendedProperties["Remote"] as string + " through " + deviceName; + { +#if TRACE + Trace.WriteLine(button + ", remote: " + table.ExtendedProperties["Remote"] as string + ", device: " + deviceName); +#endif + return button; + } } } } - return String.Format("{0} ({1})", deviceName, keyCode); + return null; + //return String.Format("{0} ({1})", deviceName, keyCode); } @@ -462,6 +564,14 @@ 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); @@ -470,7 +580,7 @@ table.ExtendedProperties.Add("Device", device); table.ExtendedProperties.Add("Remote", remote); - table.TableName = String.Format("{0}:{1}", device, remote); + table.TableName = tableName; } } } @@ -496,11 +606,7 @@ listViewButtonMap.Items.Clear(); foreach (string abstractButton in abstractButtons) listViewButtonMap.Items.Add(new ListViewItem(new string[] { abstractButton, String.Empty })); - - listViewButtonMap.Sort(); } - - void SaveMap() { if (String.IsNullOrEmpty(textBoxRemoteName.Text)) @@ -519,27 +625,7 @@ DataTable table = new DataTable("RemoteTable"); table.ReadXmlSchema("RemoteTable.xsd"); - - /* - DataColumn column; - column = new DataColumn("RawCode", typeof(string)); - column.Caption = "Raw Code"; - column.ColumnMapping = MappingType.Attribute; - column.DefaultValue = String.Empty; - column.ReadOnly = false; - column.Unique = true; - table.Columns.Add(column); - - column = new DataColumn("AbstractButton", typeof(string)); - column.Caption = "Abstract Button"; - column.ColumnMapping = MappingType.Attribute; - column.DefaultValue = String.Empty; - column.ReadOnly = false; - column.Unique = false; - table.Columns.Add(column); - */ - foreach (ListViewItem item in listViewButtonMap.Items) { if (!String.IsNullOrEmpty(item.SubItems[1].Text)) @@ -548,7 +634,6 @@ table.WriteXml(path); } - void LoadMap() { if (String.IsNullOrEmpty(textBoxRemoteName.Text)) @@ -591,8 +676,6 @@ ListViewItem item = new ListViewItem(subitems); listViewButtonMap.Items.Add(item); } - - listViewButtonMap.Sort(); } private void listViewButtonMap_KeyDown(object sender, KeyEventArgs e) Added: trunk/plugins/IR Server Suite/Applications/Abstractor/Remote Maps/FusionREMOTE/FusionHDTV.xml =================================================================== --- trunk/plugins/IR Server Suite/Applications/Abstractor/Remote Maps/FusionREMOTE/FusionHDTV.xml (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Abstractor/Remote Maps/FusionREMOTE/FusionHDTV.xml 2008-02-28 16:46:28 UTC (rev 1407) @@ -0,0 +1,39 @@ +<?xml version="1.0" standalone="yes"?> +<DocumentElement> + <RemoteTable RawCode="00F90000" AbstractButton="Up" /> + <RemoteTable RawCode="01F90000" AbstractButton="Down" /> + <RemoteTable RawCode="03F90000" AbstractButton="Left" /> + <RemoteTable RawCode="02F90000" AbstractButton="Right" /> + <RemoteTable RawCode="1FF90000" AbstractButton="OK" /> + <RemoteTable RawCode="0DF90000" AbstractButton="Mute" /> + <RemoteTable RawCode="10F90000" AbstractButton="Number0" /> + <RemoteTable RawCode="11F90000" AbstractButton="Number1" /> + <RemoteTable RawCode="12F90000" AbstractButton="Number2" /> + <RemoteTable RawCode="13F90000" AbstractButton="Number3" /> + <RemoteTable RawCode="14F90000" AbstractButton="Number4" /> + <RemoteTable RawCode="15F90000" AbstractButton="Number5" /> + <RemoteTable RawCode="16F90000" AbstractButton="Number6" /> + <RemoteTable RawCode="17F90000" AbstractButton="Number7" /> + <RemoteTable RawCode="18F90000" AbstractButton="Number8" /> + <RemoteTable RawCode="19F90000" AbstractButton="Number9" /> + <RemoteTable RawCode="1EF90000" AbstractButton="Stop" /> + <RemoteTable RawCode="1DF90000" AbstractButton="FastForward" /> + <RemoteTable RawCode="1CF90000" AbstractButton="Rewind" /> + <RemoteTable RawCode="1BF90000" AbstractButton="Record" /> + <RemoteTable RawCode="0AF90000" AbstractButton="Power" /> + <RemoteTable RawCode="0CF90000" AbstractButton="Power2" /> + <RemoteTable RawCode="05F90000" AbstractButton="TeletextRed" /> + <RemoteTable RawCode="09F90000" AbstractButton="TeletextGreen" /> + <RemoteTable RawCode="42F90000" AbstractButton="TeletextYellow" /> + <RemoteTable RawCode="43F90000" AbstractButton="TeletextBlue" /> + <RemoteTable RawCode="08F90000" AbstractButton="Menu" /> + <RemoteTable RawCode="0EF90000" AbstractButton="TaskSwap" /> + <RemoteTable RawCode="04F90000" AbstractButton="Fullscreen" /> + <RemoteTable RawCode="07F90000" AbstractButton="AspectRatio" /> + <RemoteTable RawCode="41F90000" AbstractButton="Videos" /> + <RemoteTable RawCode="06F90000" AbstractButton="TV" /> + <RemoteTable RawCode="0BF90000" AbstractButton="Guide" /> + <RemoteTable RawCode="0FF90000" AbstractButton="LiveTV" /> + <RemoteTable RawCode="1AF90000" AbstractButton="Snapshot" /> + <RemoteTable RawCode="40F90000" AbstractButton="Open" /> +</DocumentElement> \ No newline at end of file Added: trunk/plugins/IR Server Suite/Applications/Abstractor/Remote Maps/FusionREMOTE/FusionREMOTE.xml =================================================================== --- trunk/plugins/IR Server Suite/Applications/Abstractor/Remote Maps/FusionREMOTE/FusionREMOTE.xml (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Abstractor/Remote Maps/FusionREMOTE/FusionREMOTE.xml 2008-02-28 16:46:28 UTC (rev 1407) @@ -0,0 +1,48 @@ +<?xml version="1.0" standalone="yes"?> +<DocumentElement> + <RemoteTable RawCode="51FE0100" AbstractButton="Up" /> + <RemoteTable RawCode="53FE0100" AbstractButton="Down" /> + <RemoteTable RawCode="5BFE0100" AbstractButton="Left" /> + <RemoteTable RawCode="5FFE0100" AbstractButton="Right" /> + <RemoteTable RawCode="5EFE0100" AbstractButton="OK" /> + <RemoteTable RawCode="15FE0100" AbstractButton="VolumeUp" /> + <RemoteTable RawCode="05FE0100" AbstractButton="VolumeDown" /> + <RemoteTable RawCode="11FE0100" AbstractButton="ChannelUp" /> + <RemoteTable RawCode="09FE0100" AbstractButton="ChannelDown" /> + <RemoteTable RawCode="42FE0100" AbstractButton="Start" /> + <RemoteTable RawCode="49FE0100" AbstractButton="Back" /> + <RemoteTable RawCode="59FE0100" AbstractButton="Info" /> + <RemoteTable RawCode="57FE0100" AbstractButton="Mute" /> + <RemoteTable RawCode="03FE0100" AbstractButton="Number0" /> + <RemoteTable RawCode="0BFE0100" AbstractButton="Number1" /> + <RemoteTable RawCode="17FE0100" AbstractButton="Number2" /> + <RemoteTable RawCode="1BFE0100" AbstractButton="Number3" /> + <RemoteTable RawCode="07FE0100" AbstractButton="Number4" /> + <RemoteTable RawCode="50FE0100" AbstractButton="Number5" /> + <RemoteTable RawCode="54FE0100" AbstractButton="Number6" /> + <RemoteTable RawCode="48FE0100" AbstractButton="Number7" /> + <RemoteTable RawCode="4CFE0100" AbstractButton="Number8" /> + <RemoteTable RawCode="58FE0100" AbstractButton="Number9" /> + <RemoteTable RawCode="47FE0100" AbstractButton="PlayPause" /> + <RemoteTable RawCode="0DFE0100" AbstractButton="Stop" /> + <RemoteTable RawCode="4FFE0100" AbstractButton="FastForward" /> + <RemoteTable RawCode="43FE0100" AbstractButton="Rewind" /> + <RemoteTable RawCode="01FE0100" AbstractButton="Record" /> + <RemoteTable RawCode="12FE0100" AbstractButton="NextChapter" /> + <RemoteTable RawCode="0FFE0100" AbstractButton="PreviousChapter" /> + <RemoteTable RawCode="46FE0100" AbstractButton="Power" /> + <RemoteTable RawCode="4EFE0100" AbstractButton="Power2" /> + <RemoteTable RawCode="4DFE0100" AbstractButton="Menu" /> + <RemoteTable RawCode="55FE0100" AbstractButton="TaskSwap" /> + <RemoteTable RawCode="1FFE0100" AbstractButton="Fullscreen" /> + <RemoteTable RawCode="13FE0100" AbstractButton="AspectRatio" /> + <RemoteTable RawCode="16FE0100" AbstractButton="Setup" /> + <RemoteTable RawCode="0EFE0100" AbstractButton="Music" /> + <RemoteTable RawCode="1EFE0100" AbstractButton="Pictures" /> + <RemoteTable RawCode="1AFE0100" AbstractButton="DVD" /> + <RemoteTable RawCode="02FE0100" AbstractButton="TV" /> + <RemoteTable RawCode="0AFE0100" AbstractButton="Guide" /> + <RemoteTable RawCode="5AFE0100" AbstractButton="LiveTV" /> + <RemoteTable RawCode="52FE0100" AbstractButton="Snapshot" /> + <RemoteTable RawCode="19FE0100" AbstractButton="Open" /> +</DocumentElement> \ No newline at end of file Added: trunk/plugins/IR Server Suite/Applications/Abstractor/Remote Maps/IgorPlug/Microsoft MCE.xml =================================================================== --- trunk/plugins/IR Server Suite/Applications/Abstractor/Remote Maps/IgorPlug/Microsoft MCE.xml (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Abstractor/Remote Maps/IgorPlug/Microsoft MCE.xml 2008-02-28 16:46:28 UTC (rev 1407) @@ -0,0 +1,55 @@ +<?xml version="1.0" standalone="yes"?> +<DocumentElement> + <RemoteTable RawCode="31642" AbstractButton="Power" /> + <RemoteTable RawCode="31649" AbstractButton="Teletext_Blue" /> + <RemoteTable RawCode="31650" AbstractButton="Teletext_Yellow" /> + <RemoteTable RawCode="31651" AbstractButton="Teletext_Green" /> + <RemoteTable RawCode="31652" AbstractButton="Teletext_Red" /> + <RemoteTable RawCode="31653" AbstractButton="Teletext" /> + <RemoteTable RawCode="31663" AbstractButton="Radio" /> + <RemoteTable RawCode="31665" AbstractButton="Print" /> + <RemoteTable RawCode="31669" AbstractButton="Videos" /> + <RemoteTable RawCode="31670" AbstractButton="Pictures" /> + <RemoteTable RawCode="31671" AbstractButton="Recorded_TV" /> + <RemoteTable RawCode="31672" AbstractButton="Music" /> + <RemoteTable RawCode="31673" AbstractButton="TV" /> + <RemoteTable RawCode="31705" AbstractButton="Guide" /> + <RemoteTable RawCode="31706" AbstractButton="Live_TV" /> + <RemoteTable RawCode="31707" AbstractButton="DVD_Menu" /> + <RemoteTable RawCode="31708" AbstractButton="Back" /> + <RemoteTable RawCode="31709" AbstractButton="OK" /> + <RemoteTable RawCode="31710" AbstractButton="Right" /> + <RemoteTable RawCode="31711" AbstractButton="Left" /> + <RemoteTable RawCode="31712" AbstractButton="Down" /> + <RemoteTable RawCode="31713" AbstractButton="Up" /> + <RemoteTable RawCode="31714" AbstractButton="Star" /> + <RemoteTable RawCode="31715" AbstractButton="Hash" /> + <RemoteTable RawCode="31716" AbstractButton="Replay" /> + <RemoteTable RawCode="31717" AbstractButton="Skip" /> + <RemoteTable RawCode="31718" AbstractButton="Stop" /> + <RemoteTable RawCode="31719" AbstractButton="Pause" /> + <RemoteTable RawCode="31720" AbstractButton="Record" /> + <RemoteTable RawCode="31721" AbstractButton="Play" /> + <RemoteTable RawCode="31722" AbstractButton="Rewind" /> + <RemoteTable RawCode="31723" AbstractButton="Forward" /> + <RemoteTable RawCode="31724" AbstractButton="Channel_Down" /> + <RemoteTable RawCode="31725" AbstractButton="Channel_Up" /> + <RemoteTable RawCode="31726" AbstractButton="Volume_Down" /> + <RemoteTable RawCode="31727" AbstractButton="Volume_Up" /> + <RemoteTable RawCode="31728" AbstractButton="Info" /> + <RemoteTable RawCode="31729" AbstractButton="Mute" /> + <RemoteTable RawCode="31730" AbstractButton="Start" /> + <RemoteTable RawCode="31731" AbstractButton="Power_2" /> + <RemoteTable RawCode="31732" AbstractButton="Enter" /> + <RemoteTable RawCode="31733" AbstractButton="Escape" /> + <RemoteTable RawCode="31734" AbstractButton="Number_9" /> + <RemoteTable RawCode="31735" AbstractButton="Number_8" /> + <RemoteTable RawCode="31736" AbstractButton="Number_7" /> + <RemoteTable RawCode="31737" AbstractButton="Number_6" /> + <RemoteTable RawCode="31738" AbstractButton="Number_5" /> + <RemoteTable RawCode="31739" AbstractButton="Number_4" /> + <RemoteTable RawCode="31740" AbstractButton="Number_3" /> + <RemoteTable RawCode="31741" AbstractButton="Number_2" /> + <RemoteTable RawCode="31742" AbstractButton="Number_1" /> + <RemoteTable RawCode="31743" AbstractButton="Number_0" /> +</DocumentElement> \ No newline at end of file Added: trunk/plugins/IR Server Suite/Applications/Abstractor/Remote Maps/Microsoft MCE/Microsoft MCE.xml =================================================================== --- trunk/plugins/IR Server Suite/Applications/Abstractor/Remote Maps/Microsoft MCE/Microsoft MCE.xml (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Abstractor/Remote Maps/Microsoft MCE/Microsoft MCE.xml 2008-02-28 16:46:28 UTC (rev 1407) @@ -0,0 +1,54 @@ +<?xml version="1.0" standalone="yes"?> +<DocumentElement> + <RemoteTable RawCode="31713" AbstractButton="Up" /> + <RemoteTable RawCode="31712" AbstractButton="Down" /> + <RemoteTable RawCode="31711" AbstractButton="Left" /> + <RemoteTable RawCode="31710" AbstractButton="Right" /> + <RemoteTable RawCode="31709" AbstractButton="OK" /> + <RemoteTable RawCode="31727" AbstractButton="VolumeUp" /> + <RemoteTable RawCode="31726" AbstractButton="VolumeDown" /> + <RemoteTable RawCode="31725" AbstractButton="ChannelUp" /> + <RemoteTable RawCode="31724" AbstractButton="ChannelDown" /> + <RemoteTable RawCode="31730" AbstractButton="Start" /> + <RemoteTable RawCode="31708" AbstractButton="Back" /> + <RemoteTable RawCode="31728" AbstractButton="Info" /> + <RemoteTable RawCode="31729" AbstractButton="Mute" /> + <RemoteTable RawCode="31743" AbstractButton="Number0" /> + <RemoteTable RawCode="31742" AbstractButton="Number1" /> + <RemoteTable RawCode="31741" AbstractButton="Number2" /> + <RemoteTable RawCode="31740" AbstractButton="Number3" /> + <RemoteTable RawCode="31739" AbstractButton="Number4" /> + <RemoteTable RawCode="31738" AbstractButton="Number5" /> + <RemoteTable RawCode="31737" AbstractButton="Number6" /> + <RemoteTable RawCode="31736" AbstractButton="Number7" /> + <RemoteTable RawCode="31735" AbstractButton="Number8" /> + <RemoteTable RawCode="31734" AbstractButton="Number9" /> + <RemoteTable RawCode="31721" AbstractButton="Play" /> + <RemoteTable RawCode="31719" AbstractButton="Pause" /> + <RemoteTable RawCode="31718" AbstractButton="Stop" /> + <RemoteTable RawCode="31723" AbstractButton="FastForward" /> + <RemoteTable RawCode="31722" AbstractButton="Rewind" /> + <RemoteTable RawCode="31720" AbstractButton="Record" /> + <RemoteTable RawCode="31717" AbstractButton="NextChapter" /> + <RemoteTable RawCode="31716" AbstractButton="PreviousChapter" /> + <RemoteTable RawCode="31642" AbstractButton="Power" /> + <RemoteTable RawCode="31731" AbstractButton="Power2" /> + <RemoteTable RawCode="31653" AbstractButton="Teletext" /> + <RemoteTable RawCode="31652" AbstractButton="TeletextRed" /> + <RemoteTable RawCode="31651" AbstractButton="TeletextGreen" /> + <RemoteTable RawCode="31650" AbstractButton="TeletextYellow" /> + <RemoteTable RawCode="31649" AbstractButton="TeletextBlue" /> + <RemoteTable RawCode="31733" AbstractButton="Clear" /> + <RemoteTable RawCode="31732" AbstractButton="Enter" /> + <RemoteTable RawCode="31715" AbstractButton="Hash" /> + <RemoteTable RawCode="31714" AbstractButton="Star" /> + <RemoteTable RawCode="31672" AbstractButton="Music" /> + <RemoteTable RawCode="31670" AbstractButton="Pictures" /> + <RemoteTable RawCode="31669" AbstractButton="Videos" /> + <RemoteTable RawCode="31707" AbstractButton="DVD" /> + <RemoteTable RawCode="31673" AbstractButton="TV" /> + <RemoteTable RawCode="31705" AbstractButton="Guide" /> + <RemoteTable RawCode="31706" AbstractButton="LiveTV" /> + <RemoteTable RawCode="31663" AbstractButton="Radio" /> + <RemoteTable RawCode="31665" AbstractButton="Print" /> +</DocumentElement> \ No newline at end of file Added: trunk/plugins/IR Server Suite/Applications/Abstractor/Remote Maps/USB-UIRT/Microsoft MCE.xml =================================================================== --- trunk/plugins/IR Server Suite/Applications/Abstractor/Remote Maps/USB-UIRT/Microsoft MCE.xml (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Abstractor/Remote Maps/USB-UIRT/Microsoft MCE.xml 2008-02-28 16:46:28 UTC (rev 1407) @@ -0,0 +1,95 @@ +<?xml version="1.0" standalone="yes"?> +<DocumentElement> + <RemoteTable RawCode="432689F040F1" AbstractButton="Up" /> + <RemoteTable RawCode="432688F050F1" AbstractButton="Up" /> + <RemoteTable RawCode="432489F040F1" AbstractButton="Down" /> + <RemoteTable RawCode="432488F050F1" AbstractButton="Down" /> + <RemoteTable RawCode="432451F040F1" AbstractButton="Left" /> + <RemoteTable RawCode="432450F050F1" AbstractButton="Left" /> + <RemoteTable RawCode="412F51F040F1" AbstractButton="Right" /> + <RemoteTable RawCode="412F50F050F1" AbstractButton="Right" /> + <RemoteTable RawCode="412F52F040F1" AbstractButton="OK" /> + <RemoteTable RawCode="412F53F050F1" AbstractButton="OK" /> + <RemoteTable RawCode="43249DF040F1" AbstractButton="VolumeUp" /> + <RemoteTable RawCode="43249CF050F1" AbstractButton="VolumeUp" /> + <RemoteTable RawCode="412F9DF040F1" AbstractButton="VolumeDown" /> + <RemoteTable RawCode="412F9CF050F1" AbstractButton="VolumeDown" /> + <RemoteTable RawCode="412F9EF040F1" AbstractButton="ChannelUp" /> + <RemoteTable RawCode="412F9FF050F1" AbstractButton="ChannelUp" /> + <RemoteTable RawCode="412F9FF040F1" AbstractButton="ChannelDown" /> + <RemoteTable RawCode="412F9EF050F1" AbstractButton="ChannelDown" /> + <RemoteTable RawCode="412FAAF040F1" AbstractButton="Start" /> + <RemoteTable RawCode="412FABF050F1" AbstractButton="Start" /> + <RemoteTable RawCode="412F53F040F1" AbstractButton="Back" /> + <RemoteTable RawCode="412F52F050F1" AbstractButton="Back" /> + <RemoteTable RawCode="4324ABF040F1" AbstractButton="Info" /> + <RemoteTable RawCode="4324AAF050F1" AbstractButton="Info" /> + <RemoteTable RawCode="4326ABF040F1" AbstractButton="Mute" /> + <RemoteTable RawCode="4326AAF050F1" AbstractButton="Mute" /> + <RemoteTable RawCode="450CA1F040F1" AbstractButton="Number0" /> + <RemoteTable RawCode="450CA0F050F1" AbstractButton="Number0" /> + <RemoteTable RawCode="4325A1F040F1" AbstractButton="Number1" /> + <RemoteTable RawCode="4325A0F050F1" AbstractButton="Number1" /> + <RemoteTable RawCode="4323A1F040F1" AbstractButton="Number2" /> + <RemoteTable RawCode="4323A0F050F1" AbstractButton="Number2" /> + <RemoteTable RawCode="4321A1F040F1" AbstractButton="Number3" /> + <RemoteTable RawCode="4321A0F050F1" AbstractButton="Number3" /> + <RemoteTable RawCode="4322A2F040F1" AbstractButton="Number4" /> + <RemoteTable RawCode="4322A3F050F1" AbstractButton="Number4" /> + <RemoteTable RawCode="412EA2F040F1" AbstractButton="Number5" /> + <RemoteTable RawCode="412EA3F050F1" AbstractButton="Number5" /> + <RemoteTable RawCode="4322A3F040F1" AbstractButton="Number6" /> + <RemoteTable RawCode="4322A2F050F1" AbstractButton="Number6" /> + <RemoteTable RawCode="4320A3F040F1" AbstractButton="Number7" /> + <RemoteTable RawCode="4320A2F050F1" AbstractButton="Number7" /> + <RemoteTable RawCode="4324AEF040F1" AbstractButton="Number8" /> + <RemoteTable RawCode="4324AFF050F1" AbstractButton="Number8" /> + <RemoteTable RawCode="412FAEF040F1" AbstractButton="Number9" /> + <RemoteTable RawCode="412FAFF050F1" AbstractButton="Number9" /> + <RemoteTable RawCode="412E96F040F1" AbstractButton="Play" /> + <RemoteTable RawCode="412E97F050F1" AbstractButton="Play" /> + <RemoteTable RawCode="43248CF040F1" AbstractButton="Pause" /> + <RemoteTable RawCode="43248DF050F1" AbstractButton="Pause" /> + <RemoteTable RawCode="412F8CF040F1" AbstractButton="Stop" /> + <RemoteTable RawCode="412F8DF050F1" AbstractButton="Stop" /> + <RemoteTable RawCode="412E92F040F1" AbstractButton="FastForward" /> + <RemoteTable RawCode="412E93F050F1" AbstractButton="FastForward" /> + <RemoteTable RawCode="3F2C39F040F1" AbstractButton="Rewind" /> + <RemoteTable RawCode="3F2C38F050F1" AbstractButton="Rewind" /> + <RemoteTable RawCode="412E97F040F1" AbstractButton="Record" /> + <RemoteTable RawCode="412E96F050F1" AbstractButton="Record" /> + <RemoteTable RawCode="412F8FF040F1" AbstractButton="NextChapter" /> + <RemoteTable RawCode="412F8EF050F1" AbstractButton="NextChapter" /> + <RemoteTable RawCode="412F8EF040F1" AbstractButton="PreviousChapter" /> + <RemoteTable RawCode="412F8FF050F1" AbstractButton="PreviousChapter" /> + <RemoteTable RawCode="3F2C4FF240F1" AbstractButton="Power" /> + <RemoteTable RawCode="3F2C4EF250F1" AbstractButton="Power" /> + <RemoteTable RawCode="4326AAF040F1" AbstractButton="Power2" /> + <RemoteTable RawCode="4326ABF050F1" AbstractButton="Power2" /> + <RemoteTable RawCode="3F2C1CF340F1" AbstractButton="Teletext" /> + <RemoteTable RawCode="3F2C1DF350F1" AbstractButton="Teletext" /> + <RemoteTable RawCode="3F2C1EF340F1" AbstractButton="TeletextRed" /> + <RemoteTable RawCode="3F2C1FF350F1" AbstractButton="TeletextRed" /> + <RemoteTable RawCode="412EC4F340F1" AbstractButton="TeletextGreen" /> + <RemoteTable RawCode="412EC5F350F1" AbstractButton="TeletextGreen" /> + <RemoteTable RawCode="3F2C12F340F1" AbstractButton="TeletextYellow" /> + <RemoteTable RawCode="3F2C13F350F1" AbstractButton="TeletextYellow" /> + <RemoteTable RawCode="412EC0F340F1" AbstractButton="TeletextBlue" /> + <RemoteTable RawCode="412EC1F350F1" AbstractButton="TeletextBlue" /> + <RemoteTable RawCode="412FADF040F1" AbstractButton="Clear" /> + <RemoteTable RawCode="412FACF050F1" AbstractButton="Clear" /> + <RemoteTable RawCode="412FACF040F1" AbstractButton="Enter" /> + <RemoteTable RawCode="412FADF050F1" AbstractButton="Enter" /> + <RemoteTable RawCode="432688F040F1" AbstractButton="Hash" /> + <RemoteTable RawCode="432689F050F1" AbstractButton="Hash" /> + <RemoteTable RawCode="412F88F040F1" AbstractButton="Star" /> + <RemoteTable RawCode="412F89F050F1" AbstractButton="Star" /> + <RemoteTable RawCode="412E5EF040F1" AbstractButton="DVD" /> + <RemoteTable RawCode="412E5FF050F1" AbstractButton="DVD" /> + <RemoteTable RawCode="412E5DF340F1" AbstractButton="TV" /> + <RemoteTable RawCode="412E5CF350F1" AbstractButton="TV" /> + <RemoteTable RawCode="412E5AF040F1" AbstractButton="Guide" /> + <RemoteTable RawCode="412E5BF050F1" AbstractButton="Guide" /> + <RemoteTable RawCode="3F2C5FF040F1" AbstractButton="LiveTV" /> + <RemoteTable RawCode="3F2C5EF050F1" AbstractButton="LiveTV" /> +</DocumentElement> \ No newline at end of file Added: trunk/plugins/IR Server Suite/Applications/Abstractor/Remote Maps/Windows Messages/Virtual Remote.xml =================================================================== --- trunk/plugins/IR Server Suite/Applications/Abstractor/Remote Maps/Windows Messages/Virtual Remote.xml (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Abstractor/Remote Maps/Windows Messages/Virtual Remote.xml 2008-02-28 16:46:28 UTC (rev 1407) @@ -0,0 +1,56 @@ +<?xml version="1.0" standalone="yes"?> +<DocumentElement> + <RemoteTable RawCode="101" AbstractButton="Power" /> + <RemoteTable RawCode="94" AbstractButton="TeletextBlue" /> + <RemoteTable RawCode="93" AbstractButton="TeletextYellow" /> + <RemoteTable RawCode="92" AbstractButton="TeletextGreen" /> + <RemoteTable RawCode="91" AbstractButton="TeletextRed" /> + <RemoteTable RawCode="90" AbstractButton="Teletext" /> + <RemoteTable RawCode="80" AbstractButton="Radio" /> + <RemoteTable RawCode="78" AbstractButton="Print" /> + <RemoteTable RawCode="74" AbstractButton="Videos" /> + <RemoteTable RawCode="73" AbstractButton="Pictures" /> + <RemoteTable RawCode="72" AbstractButton="RecordedTV" /> + <RemoteTable RawCode="71" AbstractButton="Music" /> + <RemoteTable RawCode="70" AbstractButton="TV" /> + <RemoteTable RawCode="39" AbstractButton="AspectRatio" /> + <RemoteTable RawCode="38" AbstractButton="Guide" /> + <RemoteTable RawCode="37" AbstractButton="LiveTV" /> + <RemoteTable RawCode="36" AbstractButton="DVDMenu" /> + <RemoteTable RawCode="35" AbstractButton="Back" /> + <RemoteTable RawCode="34" AbstractButton="OK" /> + <RemoteTable RawCode="33" AbstractButton="Right" /> + <RemoteTable RawCode="32" AbstractButton="Left" /> + <RemoteTable RawCode="31" AbstractButton="Down" /> + <RemoteTable RawCode="30" AbstractButton="Up" /> + <RemoteTable RawCode="29" AbstractButton="Star" /> + <RemoteTable RawCode="28" AbstractButton="Hash" /> + <RemoteTable RawCode="27" AbstractButton="PreviousChapter" /> + <RemoteTable RawCode="26" AbstractButton="NextChapter" /> + <RemoteTable RawCode="25" AbstractButton="Stop" /> + <RemoteTable RawCode="24" AbstractButton="Pause" /> + <RemoteTable RawCode="23" AbstractButton="Record" /> + <RemoteTable RawCode="22" AbstractButton="Play" /> + <RemoteTable RawCode="21" AbstractButton="Rewind" /> + <RemoteTable RawCode="20" AbstractButton="Forward" /> + <RemoteTable RawCode="19" AbstractButton="ChannelDown" /> + <RemoteTable RawCode="18" AbstractButton="ChannelUp" /> + <RemoteTable RawCode="17" AbstractButton="VolumeDown" /> + <RemoteTable RawCode="16" AbstractButton="VolumeUp" /> + <RemoteTable RawCode="15" AbstractButton="Info" /> + <RemoteTable RawCode="14" AbstractButton="Mute" /> + <RemoteTable RawCode="13" AbstractButton="Start" /> + <RemoteTable RawCode="12" AbstractButton="Power2" /> + <RemoteTable RawCode="11" AbstractButton="Enter" /> + <RemoteTable RawCode="10" AbstractButton="Clear" /> + <RemoteTable RawCode="9" AbstractButton="Number9" /> + <RemoteTable RawCode="8" AbstractButton="Number8" /> + <RemoteTable RawCode="7" AbstractButton="Number7" /> + <RemoteTable RawCode="6" AbstractButton="Number6" /> + <RemoteTable RawCode="5" AbstractButton="Number5" /> + <RemoteTable RawCode="4" AbstractButton="Number4" /> + <RemoteTable RawCode="3" AbstractButton="Number3" /> + <RemoteTable RawCode="2" AbstractButton="Number2" /> + <RemoteTable RawCode="1" AbstractButton="Number1" /> + <RemoteTable RawCode="0" AbstractButton="Number0" /> +</DocumentElement> \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/GetKeyCodeForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/GetKeyCodeForm.cs 2008-02-28 12:22:43 UTC (rev 1406) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/GetKeyCodeForm.cs 2008-02-28 16:46:28 UTC (rev 1407) @@ -68,6 +68,13 @@ 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); } Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.Designer.cs 2008-02-28 12:22:43 UTC (rev 1406) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.Designer.cs 2008-02-28 16:46:28 UTC (rev 1407) @@ -305,6 +305,8 @@ // // panelPrograms // + this.panelPrograms.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.panelPrograms.BackColor = System.Drawing.SystemColors.Window; this.panelPrograms.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.panelPrograms.Controls.Add(this.listViewPrograms); Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2008-02-28 12:22:43 UTC (rev 1406) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2008-02-28 16:46:28 UTC (rev 1407) @@ -504,16 +504,9 @@ if (map == null) { string description = String.Empty; - try - { - MceButton temp = (MceButton)Enum.Parse(typeof(MceButton), keyCode, true); - description = Enum.GetName(typeof(MceButton), temp); - } - catch - { - // keyCode did not fall within MceButton enum - } + // TODO: Get description from Abstract Remote Model ... + map = new ButtonMappingForm(keyCode, description, String.Empty); } Modified: trunk/plugins/IR Server Suite/Applications/Translator/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2008-02-28 12:22:43 UTC (rev 1406) +++ trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2008-02-28 16:46:28 UTC (rev 1407) @@ -809,15 +809,22 @@ if (_inConfiguration) return; + // Ability to handle Abstract and Complex remote buttons ... + string button = keyCode; + + // TODO: Include abstract button support ... + //if (!deviceName.Equals("Abstract", StringComparison.OrdinalIgnoreCase)) + // button = String.Format("{0} ({1})", deviceName, keyCode); + ProgramSettings active = ActiveProgram(); if (active == null) { // Try system wide button mappings ... foreach (ButtonMapping buttonMap in _config.SystemWideMappings) { - if (buttonMap.KeyCode.Equals(keyCode, StringComparison.Ordinal)) + if (buttonMap.KeyCode.Equals(button, StringComparison.Ordinal)) { - IrssLog.Debug("KeyCode {0} mapped in System Wide mappings", keyCode); + IrssLog.Debug("KeyCode {0} mapped in System Wide mappings", button); try { ProcessCommand(buttonMap.Command, true); @@ -832,9 +839,9 @@ // Try active program button mappings ... foreach (ButtonMapping buttonMap in active.ButtonMappings) { - if (buttonMap.KeyCode.Equals(keyCode, StringComparison.Ordinal)) + if (buttonMap.KeyCode.Equals(button, StringComparison.Ordinal)) { - IrssLog.Debug("KeyCode {0} mapped in \"{1}\" mappings", keyCode, active.Name); + IrssLog.Debug("KeyCode {0} mapped in \"{1}\" mappings", button, active.Name); try { ProcessCommand(buttonMap.Command, true); @@ -849,9 +856,9 @@ // Try system wide button mappings ... foreach (ButtonMapping buttonMap in _config.SystemWideMappings) { - if (buttonMap.KeyCode.Equals(keyCode, StringComparison.Ordinal)) + if (buttonMap.KeyCode.Equals(button, StringComparison.Ordinal)) { - IrssLog.Debug("KeyCode {0} mapped in System Wide mappings", keyCode); + IrssLog.Debug("KeyCode {0} mapped in System Wide mappings", button); try { ProcessCommand(buttonMap.Command, true); @@ -863,7 +870,7 @@ } } - IrssLog.Debug("No mapping found for KeyCode = {0}", keyCode); + IrssLog.Debug("No mapping found for KeyCode = {0}", button); } static void KeyboardHandlerCallback(string deviceName, int vKey, bool keyUp) { Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs 2008-02-28 12:22:43 UTC (rev 1406) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs 2008-02-28 16:46:28 UTC (rev 1407) @@ -151,6 +151,7 @@ throw new FileNotFoundException("Skin file not found", xmlFile); } + Program.Device = Path.GetFileNameWithoutExtension(xmlFile); LoadSkinXml(xmlFile); this.BackgroundImage = new Bitmap(skinFile); Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs 2008-02-28 12:22:43 UTC (rev 1406) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs 2008-02-28 16:46:28 UTC (rev 1407) @@ -42,6 +42,8 @@ static string _remoteSkin; + static string _device; + static RemoteButton[] _buttons; #endregion Variables @@ -76,6 +78,12 @@ set { _buttons = value; } } + internal static string Device + { + get { return _device; } + set { _device = value; } + } + #endregion Properties /// <summary> @@ -355,7 +363,17 @@ if (!_registered) return; - IrssMessage message = new IrssMessage(MessageType.ForwardRemoteEvent, MessageFlags.Notify, keyCode); + byte[] deviceNameBytes = Encoding.ASCII.GetBytes(_device); + byte[] keyCodeBytes = Encoding.ASCII.GetBytes(keyCode); + + 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); + + IrssMessage message = new IrssMessage(MessageType.ForwardRemoteEvent, MessageFlags.Notify, bytes); SendMessage(message); } 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-02-28 12:22:43 UTC (rev 1406) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs 2008-02-28 16:46:28 UTC (rev 1407) @@ -595,7 +595,7 @@ int keyCodeSize = BitConverter.ToInt32(data, 4 + deviceNameSize); string keyCode = Encoding.ASCII.GetString(data, 8 + deviceNameSize, keyCodeSize); - listViewButtons.SelectedItems[0].SubItems[1].Text = String.Format("{0} ({1})", deviceName, keyCode); + listViewButtons.SelectedItems[0].SubItems[1].Text = keyCode; } return; Modified: trunk/plugins/IR Server Suite/Applications/Web Remote/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Web Remote/Program.cs 2008-02-28 12:22:43 UTC (rev 1406) +++ trunk/plugins/IR Server Suite/Applications/Web Remote/Program.cs 2008-02-28 16:46:28 UTC (rev 1407) @@ -52,6 +52,8 @@ static string _installFolder; static string _remoteSkin; + static string _device; + static RemoteButton[] _buttons; static WebServer _webServer; @@ -266,7 +268,17 @@ if (!_registered) return; - IrssMessage message = new IrssMessage(MessageType.ForwardRemoteEvent, MessageFlags.Notify, keyCode); + byte[] deviceNameBytes = Encoding.ASCII.GetBytes(_device); + byte[] keyCodeBytes = Encoding.ASCII.GetBytes(keyCode); + + 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); + + IrssMessage message = new IrssMessage(MessageType.ForwardRemoteEvent, MessageFlags.Notify, bytes); SendMessage(message); } @@ -301,6 +313,7 @@ throw new FileNotFoundException("Skin file not found", xmlFile); } + _device = Path.GetFileNameWithoutExtension(xmlFile); LoadSkinXml(xmlFile); } catch (Exception ex) Modified: trunk/plugins/IR Server Suite/Documentation/new.html =================================================================== --- trunk/plugins/IR Server Suite/Documentation/new.html 2008-02-28 12:22:43 UTC (rev 1406) +++ trunk/plugins/IR Server Suite/Documentation/new.html 2008-02-28 16:46:28 UTC (rev 1407) @@ -38,6 +38,9 @@ <LI>IR Server Plugin: Added support for RC102 and compatible receivers - Experimental.</LI> <LI>TCP Comms: Automatically maps "localhost" to loopback address, avoiding the lookup process. This <i>might</i> solve a host name lookup problem for some users.</LI> <LI>IR Server Plugin: Added Keyboard Input plugin, should enable mapping special (App Command) keyboard buttons (like Forward, Back, Play, Stop, Volume, etc...) as well as basic key combinations.</LI> +<LI>USB-UIRT: Fixed a bug that caused the receive callback to get garbage collected, crashing the Input Service.</LI> +<LI>FusionREMOTE: Can now tell the difference between different DViCo remotes (You will need to re-teach the button keycodes).</LI> +<LI>General: Receiving device is now communicated with remote button codes, this is in preparation for a major overhaul of the remote mapping system to facilitate automatic configuration for controlling your whole PC! This feature will not be completed until 1.0.5.0 but it will be very big if it comes together as planned.</LI> </UL></P> <BR> Added: trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/CoolCommand Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/CoolCommand Receiver.csproj (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/CoolCommand Receiver.csproj 2008-02-28 16:46:28 UTC (rev 1407) @@ -0,0 +1,93 @@ +<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>{C9DB6BFE-4AA7-43D6-8B5D-3B27A2FA4B1A}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>InputService.Plugin</RootNamespace> + <AssemblyName>CoolCommand Receiver</AssemblyName> + <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent> + <ApplicationIcon>Icon.ico</ApplicationIcon> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>false</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <UseVSHostingProcess>false</UseVSHostingProcess> + <DocumentationFile>bin\Debug\CoolCommand Receiver.xml</DocumentationFile> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>none</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants> + </DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <UseVSHostingProcess>false</UseVSHostingProcess> + <DebugSymbols>false</DebugSymbols> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> + <OutputPath>bin\x86\Debug\</OutputPath> + <DefineConstants>TRACE;DEBUG</DefineConstants> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <DebugType>full</DebugType> + <PlatformTarget>x86</PlatformTarget> + <UseVSHostingProcess>false</UseVSHostingProcess> + <ErrorReport>prompt</ErrorReport> + <DocumentationFile>bin\x86\Debug\CoolCommand Receiver.xml</DocumentationFile> + </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" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="CoolCommandReceiver.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="ReceiverWindow.cs" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\IR Server Plugin Interface\IR Server Plugin Interface.csproj"> + <Project>{D8B3D28F-62CE-4CA7-86CE-B7EAD614A94C}</Project> + <Name>IR Server Plugin Interface</Name> + <Private>False</Private> + </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. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> + <PropertyGroup> + <PostBuildEvent> + </PostBuildEvent> + </PropertyGroup> +</Project> \ No newline at end of file Added: trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/CoolCommandReceiver.cs ==========================================... [truncated message content] |
From: <an...@us...> - 2008-02-29 17:31:27
|
Revision: 1411 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1411&view=rev Author: and-81 Date: 2008-02-29 09:31:08 -0800 (Fri, 29 Feb 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/IR Server/Config.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/Program.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/Forms/CloseProgramCommand.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/MessageCommand.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/WindowList.Designer.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/WindowList.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Win32.cs trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/Ads Tech PTV-335 Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/CoolCommand Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/CoolCommandReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/DirectInputReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Girder Plugin.cs trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/HcwReceiver.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/PluginBase.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/IgorPlug Receiver/IgorPlug Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Ira Transceiver/IraTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/LiveDriveReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/MacMini Receiver/MacMini Receiver.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/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/RedEye Blaster/RedEye Blaster.cs trunk/plugins/IR Server Suite/IR Server Plugins/Serial IR Blaster/Serial IR Blaster.cs trunk/plugins/IR Server Suite/IR Server Plugins/Speech Receiver/SpeechReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Tira Transceiver/TiraTransceiver.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/Wii Remote Receiver.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/Windows Message Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/X10Transceiver.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/Program.cs Property Changed: ---------------- trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/ trunk/plugins/IR Server Suite/IR Server Plugins/MacMini Receiver/ Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -112,6 +112,9 @@ #region Constructor + /// <summary> + /// Initializes a new instance of the <see cref="Config"/> class. + /// </summary> public Config() { InitializeComponent(); @@ -322,7 +325,8 @@ { try { - Help.ShowHelp(this, SystemRegistry.GetInstallFolder() + "\\IR Server Suite.chm", HelpNavigator.Topic, "IR Server\\index.html"); + string helpFile = System.IO.Path.Combine(SystemRegistry.GetInstallFolder(), "IR Server Suite.chm"); + Help.ShowHelp(this, helpFile, HelpNavigator.Topic, "IR Server\\index.html"); } catch (Exception ex) { Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -84,7 +84,8 @@ if (String.IsNullOrEmpty(installFolder)) return null; - string[] files = Directory.GetFiles(installFolder + "\\IR Server Plugins\\", "*.dll", SearchOption.TopDirectoryOnly); + string path = Path.Combine(installFolder, "IR Server Plugins"); + string[] files = Directory.GetFiles(path, "*.dll", SearchOption.TopDirectoryOnly); foreach (string file in files) { try @@ -96,10 +97,17 @@ { if (type.IsClass && !type.IsAbstract && type.IsSubclassOf(typeof(PluginBase))) { - PluginBase plugin = (PluginBase)assembly.CreateInstance(type.FullName); + try + { + PluginBase plugin = (PluginBase)assembly.CreateInstance(type.FullName); - if (plugin != null) - plugins.Add(plugin); + if (plugin != null) + plugins.Add(plugin); + } + catch + { + // Ignore this plugin ... + } } } } Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -544,13 +544,15 @@ } else if (radioButtonClass.Checked) { - // TODO: Locate Class + WindowList windowList = new WindowList(true); + if (windowList.ShowDialog(this) == DialogResult.OK) + textBoxMsgTarget.Text = windowList.SelectedItem; } else if (radioButtonWindowTitle.Checked) { - WindowList windowList = new WindowList(); + WindowList windowList = new WindowList(false); if (windowList.ShowDialog(this) == DialogResult.OK) - textBoxMsgTarget.Text = windowList.SelectedWindowTitle; + textBoxMsgTarget.Text = windowList.SelectedItem; } } @@ -566,7 +568,7 @@ } private void radioButtonClass_CheckedChanged(object sender, EventArgs e) { - buttonFindMsgTarget.Enabled = false; + buttonFindMsgTarget.Enabled = true; textBoxMsgTarget.Enabled = true; } private void radioButtonWindowTitle_CheckedChanged(object sender, EventArgs e) Modified: trunk/plugins/IR Server Suite/Applications/Translator/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -809,7 +809,7 @@ if (_inConfiguration) return; - // Ability to handle Abstract and Complex remote buttons ... + // TODO: Ability to handle Abstract and Complex remote buttons ... string button = keyCode; // TODO: Include abstract button support ... Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -135,18 +135,17 @@ if (String.IsNullOrEmpty(skin)) return; - string skinFile = String.Format("{0}\\Skins\\{1}.png", Program.InstallFolder, skin); + string skinFile = Path.Combine(Program.InstallFolder, String.Format("Skins\\{0}.png", skin)); if (!File.Exists(skinFile)) throw new FileNotFoundException("Skin graphic file not found", skinFile); // Try to load xml file of same name, failing that load using first word of skin name ... - string xmlFile = String.Format("{0}\\Skins\\{1}.xml", Program.InstallFolder, skin); + string xmlFile = Path.Combine(Program.InstallFolder, String.Format("Skins\\{0}.xml", skin)); if (!File.Exists(xmlFile)) { string firstWord = skin.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)[0]; - xmlFile = String.Format("{0}\\Skins\\{1}.xml", Program.InstallFolder, firstWord); - + xmlFile = Path.Combine(Program.InstallFolder, String.Format("Skins\\{0}.xml", firstWord)); if (!File.Exists(xmlFile)) throw new FileNotFoundException("Skin file not found", xmlFile); } Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -227,7 +227,7 @@ if (String.IsNullOrEmpty(_installFolder)) _installFolder = "."; else - _installFolder += "\\Virtual Remote"; + _installFolder = Path.Combine(_installFolder, "Virtual Remote"); } catch (Exception ex) { Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/CloseProgramCommand.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/CloseProgramCommand.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/CloseProgramCommand.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -102,13 +102,15 @@ } else if (radioButtonClass.Checked) { - // TODO: Locate Class + WindowList windowList = new WindowList(true); + if (windowList.ShowDialog(this) == DialogResult.OK) + textBoxTarget.Text = windowList.SelectedItem; } else if (radioButtonWindowTitle.Checked) { - WindowList windowList = new WindowList(); + WindowList windowList = new WindowList(false); if (windowList.ShowDialog(this) == DialogResult.OK) - textBoxTarget.Text = windowList.SelectedWindowTitle; + textBoxTarget.Text = windowList.SelectedItem; } } @@ -136,7 +138,7 @@ } private void radioButtonClass_CheckedChanged(object sender, EventArgs e) { - buttonFindTarget.Enabled = false; + buttonFindTarget.Enabled = true; textBoxTarget.Enabled = true; } private void radioButtonWindowTitle_CheckedChanged(object sender, EventArgs e) Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/MessageCommand.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/MessageCommand.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/MessageCommand.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -108,13 +108,15 @@ } else if (radioButtonClass.Checked) { - // TODO: Locate Class + WindowList windowList = new WindowList(true); + if (windowList.ShowDialog(this) == DialogResult.OK) + textBoxMsgTarget.Text = windowList.SelectedItem; } else if (radioButtonWindowTitle.Checked) { - WindowList windowList = new WindowList(); + WindowList windowList = new WindowList(false); if (windowList.ShowDialog(this) == DialogResult.OK) - textBoxMsgTarget.Text = windowList.SelectedWindowTitle; + textBoxMsgTarget.Text = windowList.SelectedItem; } } @@ -151,7 +153,7 @@ } private void radioButtonClass_CheckedChanged(object sender, EventArgs e) { - buttonFindMsgTarget.Enabled = false; + buttonFindMsgTarget.Enabled = true; textBoxMsgTarget.Enabled = true; } private void radioButtonWindowTitle_CheckedChanged(object sender, EventArgs e) Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/WindowList.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/WindowList.Designer.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/WindowList.Designer.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -28,28 +28,28 @@ /// </summary> private void InitializeComponent() { - this.listBoxWindows = new System.Windows.Forms.ListBox(); + this.listBoxItems = new System.Windows.Forms.ListBox(); this.SuspendLayout(); // // listBoxWindows // - this.listBoxWindows.Dock = System.Windows.Forms.DockStyle.Fill; - this.listBoxWindows.FormattingEnabled = true; - this.listBoxWindows.HorizontalScrollbar = true; - this.listBoxWindows.IntegralHeight = false; - this.listBoxWindows.Location = new System.Drawing.Point(0, 0); - this.listBoxWindows.Name = "listBoxWindows"; - this.listBoxWindows.Size = new System.Drawing.Size(292, 376); - this.listBoxWindows.TabIndex = 0; - this.listBoxWindows.DoubleClick += new System.EventHandler(this.listBoxWindows_DoubleClick); - this.listBoxWindows.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.listBoxWindows_KeyPress); + this.listBoxItems.Dock = System.Windows.Forms.DockStyle.Fill; + this.listBoxItems.FormattingEnabled = true; + this.listBoxItems.HorizontalScrollbar = true; + this.listBoxItems.IntegralHeight = false; + this.listBoxItems.Location = new System.Drawing.Point(0, 0); + this.listBoxItems.Name = "listBoxWindows"; + this.listBoxItems.Size = new System.Drawing.Size(292, 376); + this.listBoxItems.TabIndex = 0; + this.listBoxItems.DoubleClick += new System.EventHandler(this.listBoxWindows_DoubleClick); + this.listBoxItems.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.listBoxWindows_KeyPress); // // WindowList // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(292, 376); - this.Controls.Add(this.listBoxWindows); + this.Controls.Add(this.listBoxItems); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; this.MaximizeBox = false; this.MinimizeBox = false; @@ -65,6 +65,6 @@ #endregion - private System.Windows.Forms.ListBox listBoxWindows; + private System.Windows.Forms.ListBox listBoxItems; } } \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/WindowList.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/WindowList.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/WindowList.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -10,20 +10,26 @@ { /// <summary> - /// Window List form. + /// Window or Class List form. /// </summary> public partial class WindowList : Form { + #region Variables + + bool _listClasses; + + #endregion Variables + #region Properties /// <summary> - /// Gets the selected window title. + /// Gets the selected window title or class name. /// </summary> - /// <value>The selected window title.</value> - public string SelectedWindowTitle + /// <value>The selected window title or class name.</value> + public string SelectedItem { - get { return listBoxWindows.SelectedItem as string; } + get { return listBoxItems.SelectedItem as string; } } #endregion Properties @@ -33,10 +39,18 @@ /// <summary> /// Initializes a new instance of the <see cref="WindowList"/> class. /// </summary> - public WindowList() + /// <param name="listClasses">if set to <c>true</c> [list classes].</param> + public WindowList(bool listClasses) { + _listClasses = listClasses; + InitializeComponent(); + if (listClasses) + this.Text = "Class List"; + else + this.Text = "Window List"; + PopulateList(); } @@ -51,10 +65,17 @@ bool AddWindow(IntPtr hWnd, IntPtr lParam) { - string title = Win32.GetWindowTitle(hWnd); + string windowTitle = Win32.GetWindowTitle(hWnd); - if (!String.IsNullOrEmpty(title)) - listBoxWindows.Items.Add(title); + if (_listClasses && String.IsNullOrEmpty(windowTitle)) + { + string className = Win32.GetClassName(hWnd); + listBoxItems.Items.Add(className); + } + else if (!_listClasses && !String.IsNullOrEmpty(windowTitle)) + { + listBoxItems.Items.Add(windowTitle); + } return true; } Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Win32.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Win32.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Win32.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -1901,6 +1901,12 @@ IntPtr hWnd, int nIndex); + [DllImport("user32.dll")] + static extern int GetClassName( + IntPtr hWnd, + StringBuilder lpClassName, + int nMaxCount); + #endregion Interop #region Methods @@ -2058,6 +2064,19 @@ } /// <summary> + /// Gets the name of a class from a handle. + /// </summary> + /// <param name="hWnd">The handle to retreive the class name for.</param> + /// <returns>The class name.</returns> + public static string GetClassName(IntPtr hWnd) + { + StringBuilder name = new StringBuilder(255); + GetClassName(hWnd, name, name.Capacity); + + return name.ToString(); + } + + /// <summary> /// Used to logoff, shutdown or reboot. /// </summary> /// <param name="flags">The type of exit to perform.</param> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/Ads Tech PTV-335 Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/Ads Tech PTV-335 Receiver.csproj 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/Ads Tech PTV-335 Receiver.csproj 2008-02-29 17:31:08 UTC (rev 1411) @@ -33,8 +33,6 @@ </PropertyGroup> <ItemGroup> <Reference Include="System" /> - <Reference Include="System.Data" /> - <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> <Compile Include="AdsTechPTV335Receiver.cs" /> Property changes on: trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver ___________________________________________________________________ Name: svn:ignore + bin obj Modified: trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/CoolCommand Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/CoolCommand Receiver.csproj 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/CoolCommand Receiver.csproj 2008-02-29 17:31:08 UTC (rev 1411) @@ -58,7 +58,6 @@ </PropertyGroup> <ItemGroup> <Reference Include="System" /> - <Reference Include="System.Data" /> <Reference Include="System.Drawing" /> <Reference Include="System.Windows.Forms" /> <Reference Include="System.Xml" /> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/CoolCommandReceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/CoolCommandReceiver.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/CoolCommandReceiver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -25,9 +25,7 @@ #region Constants - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\Input Service\\CoolRemote Receiver.xml"; + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "CoolCommand Receiver.xml"); const int WM_COOL = 0x0A00; @@ -74,6 +72,7 @@ /// </returns> public override bool Detect() { + // TODO: Add CoolCommand detection try { return false; Modified: trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/Icon.ico =================================================================== (Binary files differ) 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 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -58,9 +58,7 @@ #region Constants - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\Input Service\\Custom HID Receiver.xml"; + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "Custom HID Receiver.xml"); const int DeviceBufferSize = 255; Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/DirectInputReceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/DirectInputReceiver.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/DirectInputReceiver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -1,6 +1,7 @@ using System; using System.Collections; using System.Diagnostics; +using System.IO; using System.Runtime.InteropServices; using System.Text; using System.Windows.Forms; @@ -19,9 +20,7 @@ #region Constants - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\Input Service\\Direct Input Receiver.xml"; + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "Direct Input Receiver.xml"); #endregion Constants 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 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -25,9 +25,7 @@ #region Constants - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\Input Service\\FusionRemote Receiver.xml"; + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "FusionRemote Receiver.xml"); const string DeviceID = "VID_0FE9&PID_9010"; Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Girder Plugin.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Girder Plugin.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Girder Plugin.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -19,9 +19,7 @@ #region Constants - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\Input Service\\Girder Plugin.xml"; + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "Girder Plugin.xml"); static readonly string[] Ports = new string[] { "Plugin" }; Modified: trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/HcwReceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/HcwReceiver.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/HcwReceiver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -21,9 +21,7 @@ #region Constants - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\IR Server\\HCW Receiver.xml"; + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "HCW Receiver.xml"); #endregion Constants 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 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IR Server Plugin Interface.csproj 2008-02-29 17:31:08 UTC (rev 1411) @@ -60,9 +60,7 @@ </PropertyGroup> <ItemGroup> <Reference Include="System" /> - <Reference Include="System.Data" /> <Reference Include="System.Windows.Forms" /> - <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> <Compile Include="IConfigure.cs" /> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/PluginBase.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/PluginBase.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/PluginBase.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -1,3 +1,6 @@ +using System; +using System.IO; + namespace InputService.Plugin { @@ -7,6 +10,17 @@ public abstract class PluginBase { + #region Constants + + /// <summary> + /// Plugin configuration file base path. + /// </summary> + public static readonly string ConfigurationPath = + Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), + Path.Combine("IR Server Suite", "Input Service")); + + #endregion Constants + #region Properties /// <summary> @@ -51,12 +65,12 @@ /// <summary> /// Suspend the IR Server plugin when computer enters standby. /// </summary> - public abstract void Suspend(); + public virtual void Suspend() { } /// <summary> /// Resume the IR Server plugin when the computer returns from standby. /// </summary> - public abstract void Resume(); + public virtual void Resume() { } /// <summary> /// Stop the IR Server plugin. 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 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -21,9 +21,7 @@ #region Constants - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\Input Service\\IRMan Receiver.xml"; + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "IRMan Receiver.xml"); const int DeviceBufferSize = 6; @@ -70,17 +68,6 @@ public override string Description { get { return "Receiver support for the Serial IRMan device"; } } /// <summary> - /// Detect the presence of this device. Devices that cannot be detected will always return false. - /// </summary> - /// <returns> - /// <c>true</c> if the device is present, otherwise <c>false</c>. - /// </returns> - public override bool Detect() - { - return false; - } - - /// <summary> /// Start the IR Server plugin. /// </summary> public override void Start() 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 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -183,9 +183,7 @@ #region Constants - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\Input Service\\IRTrans Transceiver.xml"; + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "IRTrans Transceiver.xml"); const string DefaultRemoteModel = "mediacenter"; const string DefaultServerAddress = "localhost"; Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/IgorPlug Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/IgorPlug Receiver.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/IgorPlug Receiver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -167,7 +167,7 @@ /// A description of the IR Server plugin. /// </summary> /// <value>The description.</value> - public override string Description { get { return "IgorPlug Receiver"; } } + public override string Description { get { return "IgorPlug USB Receiver"; } } /// <summary> /// Start the IR Server plugin. @@ -335,7 +335,7 @@ { bool Result = false; - SafeFileHandle handle = CreateFile("\\\\.\\IgorPlugUSB_0", + SafeFileHandle handle = CreateFile(@"\\.\IgorPlugUSB_0", CreateFileAccessTypes.GenericRead | CreateFileAccessTypes.GenericWrite, CreateFileShares.Read | CreateFileShares.Write, IntPtr.Zero, Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Ira Transceiver/IraTransceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Ira Transceiver/IraTransceiver.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Ira Transceiver/IraTransceiver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -37,14 +37,12 @@ /// IR Server Plugin for Ira Transceiver device. /// </summary> [CLSCompliant(false)] - public class IraTransceiver : IRServerPluginBase, IConfigure, ITransmitIR, ILearnIR, IRemoteReceiver + public class IraTransceiver : PluginBase, IConfigure, ITransmitIR, ILearnIR, IRemoteReceiver { #region Constants - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\Input Service\\Ira Transceiver.xml"; + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "Ira Transceiver.xml"); static readonly string[] Ports = new string[] { "Default" }; @@ -104,13 +102,13 @@ /// </summary> public override void Suspend() { - if (_deviceType == DeviceType.Tira) + /*if (_deviceType == DeviceType.Tira) { byte[] suspendCommand = new byte[] { 49, 57, 0, 0, 0, 0, 0, 0 }; Array.Copy(_suspendCommand, 0, suspendCommand, 2, _suspendCommand.Length); _serialPort.Write(suspendCommand); - } + }*/ Disconnect(); } @@ -138,7 +136,7 @@ /// Configure the IR Server plugin. /// </summary> public void Configure(IWin32Window owner) - { + {/* LoadSettings(); Configure config = new Configure(); @@ -154,7 +152,7 @@ _learnTimeout = config.LearnTimeout; SaveSettings(); - } + }*/ } /// <summary> @@ -216,7 +214,7 @@ Disconnect(); Connect(57600); - + /* if (_learnTimedOut) { status = LearnStatus.Timeout; @@ -231,7 +229,7 @@ { status = LearnStatus.Failure; } - + */ Disconnect(); Connect(9600); @@ -242,7 +240,7 @@ /// Loads the settings. /// </summary> void LoadSettings() - { + {/* try { XmlDocument doc = new XmlDocument(); @@ -264,13 +262,13 @@ _repeatDelay = 500; _blastRepeats = 3; _learnTimeout = 10000; - } + }*/ } /// <summary> /// Saves the settings. /// </summary> void SaveSettings() - { + {/* try { using (XmlTextWriter writer = new XmlTextWriter(ConfigurationFile, Encoding.UTF8)) @@ -298,13 +296,13 @@ catch { } -#endif +#endif*/ } void Connect(int baud) { _serialPort = new SerialPort(_port, baud, Parity.None, 8, StopBits.One); - _serialPort.CtsHolding = (_deviceType == DeviceType.Tira); + //_serialPort.CtsHolding = (_deviceType == DeviceType.Tira); _serialPort.RtsEnable = (_deviceType == DeviceType.Tira); _serialPort.ReadBufferSize = DeviceBufferSize; _serialPort.ReadTimeout = 1000; @@ -340,7 +338,7 @@ // Assume it is a button press. default: if (_remoteButtonHandler != null) - _remoteButtonHandler(received); + _remoteButtonHandler(this.Name, received); break; } Modified: trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/Icon.ico =================================================================== (Binary files differ) Modified: trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/LiveDriveReceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/LiveDriveReceiver.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/LiveDriveReceiver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -77,9 +77,7 @@ #region Constants - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\Input Service\\LiveDrive Receiver.xml"; + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "LiveDrive Receiver.xml"); const int BufferLength = 256; Property changes on: trunk/plugins/IR Server Suite/IR Server Plugins/MacMini Receiver ___________________________________________________________________ Name: svn:ignore + bin obj Modified: trunk/plugins/IR Server Suite/IR Server Plugins/MacMini Receiver/MacMini Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/MacMini Receiver/MacMini Receiver.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/MacMini Receiver/MacMini Receiver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -21,7 +21,7 @@ const int DeviceBufferSize = 5; const string DevicePathVidPid = "vid_045e&pid_0284"; - const string DeviceGuid = "{9DE464EB-5DAC-4498-88BC-5010CFD2F724}"; + //const string DeviceGuid = "{9DE464EB-5DAC-4498-88BC-5010CFD2F724}"; static readonly byte[] RepeatCode = new byte[] { 0x26, 0x00, 0x00, 0x00, 0x00 }; static readonly byte[] FlatCode = new byte[] { 0x25, 0x87, 0xE0 }; 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 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -6,20 +6,12 @@ using System.Text; using System.Windows.Forms; -using Microsoft.Win32; - namespace InputService.Plugin { partial class Configure : Form { - #region Constants - - const string RegistrySubKey = @"SYSTEM\CurrentControlSet\Services\HidIr\Remotes\745a17a0-74d3-11d0-b6fe-00a0c90f57da"; - - #endregion Constants - #region Properties public int LearnTimeout @@ -105,14 +97,14 @@ #region Constructor + /// <summary> + /// Initializes a new instance of the <see cref="Configure"/> class. + /// </summary> public Configure() { InitializeComponent(); - if (Registry.LocalMachine.GetValue(RegistrySubKey + @"\CodeSetNum0", null) == null) - checkBoxDisableAutomaticButtons.Checked = true; - else - checkBoxDisableAutomaticButtons.Checked = false; + checkBoxDisableAutomaticButtons.Checked = !MicrosoftMceTransceiver.CheckAutomaticButtons();; } #endregion Constructor @@ -123,29 +115,18 @@ { bool changeMade = false; - using (RegistryKey key = Registry.LocalMachine.OpenSubKey(RegistrySubKey, true)) - { - bool keysExist = (key.GetValue("CodeSetNum0", null) != null); + bool keysExist = MicrosoftMceTransceiver.CheckAutomaticButtons(); - if (checkBoxDisableAutomaticButtons.Checked && keysExist) - { - key.DeleteValue("CodeSetNum0", false); - key.DeleteValue("CodeSetNum1", false); - key.DeleteValue("CodeSetNum2", false); - key.DeleteValue("CodeSetNum3", false); - - changeMade = true; - } - else if (!checkBoxDisableAutomaticButtons.Checked && !keysExist) - { - key.SetValue("CodeSetNum0", 1, RegistryValueKind.DWord); - key.SetValue("CodeSetNum1", 2, RegistryValueKind.DWord); - key.SetValue("CodeSetNum2", 3, RegistryValueKind.DWord); - key.SetValue("CodeSetNum3", 4, RegistryValueKind.DWord); - - changeMade = true; - } + if (checkBoxDisableAutomaticButtons.Checked && keysExist) + { + MicrosoftMceTransceiver.DisableAutomaticButtons(); + changeMade = true; } + else if (!checkBoxDisableAutomaticButtons.Checked && !keysExist) + { + MicrosoftMceTransceiver.EnableAutomaticButtons(); + changeMade = true; + } if (changeMade) MessageBox.Show(this, "You must restart for changes to automatic button handling to take effect", "Restart required", MessageBoxButtons.OK, MessageBoxIcon.Information); 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 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -390,7 +390,9 @@ { try { - _debugFile = new StreamWriter(fileName, false); + string path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), String.Format("IR Server Suite\\Logs\\{0}", fileName)); + + _debugFile = new StreamWriter(path, false); _debugFile.AutoFlush = true; } #if TRACE 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 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverReplacement.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -184,7 +184,7 @@ public override void Start() { #if DEBUG - DebugOpen("\\MicrosoftMceTransceiver_DriverReplacement.log"); + DebugOpen("MicrosoftMceTransceiver_DriverReplacement.log"); DebugWriteLine("Start()"); #endif 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 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverVista.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -569,7 +569,7 @@ public override void Start() { #if DEBUG - DebugOpen("\\MicrosoftMceTransceiver_DriverVista.log"); + DebugOpen("MicrosoftMceTransceiver_DriverVista.log"); DebugWriteLine("Start()"); #endif 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 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverXP.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -183,7 +183,7 @@ public override void Start() { #if DEBUG - DebugOpen("\\MicrosoftMceTransceiver_DriverXP.log"); + DebugOpen("MicrosoftMceTransceiver_DriverXP.log"); DebugWriteLine("Start()"); #endif Modified: 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/Microsoft MCE Transceiver.csproj 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Microsoft MCE Transceiver.csproj 2008-02-29 17:31:08 UTC (rev 1411) @@ -62,7 +62,6 @@ </PropertyGroup> <ItemGroup> <Reference Include="System" /> - <Reference Include="System.Data" /> <Reference Include="System.Drawing" /> <Reference Include="System.ServiceProcess" /> <Reference Include="System.Windows.Forms" /> 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 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -11,6 +11,7 @@ using System.Windows.Forms; using System.Xml; +using Microsoft.Win32; using Microsoft.Win32.SafeHandles; namespace InputService.Plugin @@ -179,15 +180,15 @@ #region Constants - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\Input Service\\Microsoft MCE Transceiver.xml"; + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "Microsoft MCE Transceiver.xml"); static readonly Guid MicrosoftGuid = new Guid(0x7951772d, 0xcd50, 0x49b7, 0xb1, 0x03, 0x2b, 0xaa, 0xc4, 0x94, 0xfc, 0x57); static readonly Guid ReplacementGuid = new Guid(0x00873fdf, 0x61a8, 0x11d1, 0xaa, 0x5e, 0x00, 0xc0, 0x4f, 0xb1, 0x72, 0x8b); const int VistaVersionNumber = 6; + const string AutomaticButtonsRegKey = @"SYSTEM\CurrentControlSet\Services\HidIr\Remotes\745a17a0-74d3-11d0-b6fe-00a0c90f57da"; + #endregion Constants #region Variables @@ -213,9 +214,6 @@ bool _handleMouseLocally = true; double _mouseSensitivity = 1.0d; - // Hidden options ... - bool _forceVistaDriver = false; - #endregion Configuration Driver _driver; @@ -233,6 +231,8 @@ Mouse.MouseEvents _mouseButtons = Mouse.MouseEvents.None; + bool _ignoreAutomaticButtons = false; + RemoteHandler _remoteHandler; KeyboardHandler _keyboardHandler; MouseHandler _mouseHandler; @@ -294,6 +294,8 @@ LoadSettings(); + _ignoreAutomaticButtons = CheckAutomaticButtons(); + if (_disableMceServices) DisableMceServices(); @@ -306,14 +308,10 @@ { if (deviceGuid == MicrosoftGuid) { - if (_forceVistaDriver || Environment.OSVersion.Version.Major >= VistaVersionNumber) - { + if (Environment.OSVersion.Version.Major >= VistaVersionNumber) newDriver = new DriverVista(deviceGuid, devicePath, new RemoteCallback(RemoteEvent), new KeyboardCallback(KeyboardEvent), new MouseCallback(MouseEvent)); - } else - { newDriver = new DriverXP(deviceGuid, devicePath, new RemoteCallback(RemoteEvent), new KeyboardCallback(KeyboardEvent), new MouseCallback(MouseEvent)); - } } else { @@ -527,9 +525,6 @@ 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 {} - - // Hidden options ... - try { _forceVistaDriver = bool.Parse(doc.DocumentElement.Attributes["ForceVistaDriver"].Value); } catch {} } void SaveSettings() { @@ -562,9 +557,6 @@ writer.WriteAttributeString("HandleMouseLocally", _handleMouseLocally.ToString()); writer.WriteAttributeString("MouseSensitivity", _mouseSensitivity.ToString()); - // Hidden options ... - writer.WriteAttributeString("ForceVistaDriver", _forceVistaDriver.ToString()); - writer.WriteEndElement(); // </settings> writer.WriteEndDocument(); } @@ -626,6 +618,34 @@ return false; } + internal static bool CheckAutomaticButtons() + { + using (RegistryKey key = Registry.LocalMachine.OpenSubKey(AutomaticButtonsRegKey, false)) + { + return (key.GetValue("CodeSetNum0", null) != null); + } + } + internal static void EnableAutomaticButtons() + { + using (RegistryKey key = Registry.LocalMachine.OpenSubKey(AutomaticButtonsRegKey, true)) + { + key.SetValue("CodeSetNum0", 1, RegistryValueKind.DWord); + key.SetValue("CodeSetNum1", 2, RegistryValueKind.DWord); + key.SetValue("CodeSetNum2", 3, RegistryValueKind.DWord); + key.SetValue("CodeSetNum3", 4, RegistryValueKind.DWord); + } + } + internal static void DisableAutomaticButtons() + { + using (RegistryKey key = Registry.LocalMachine.OpenSubKey(AutomaticButtonsRegKey, true)) + { + key.DeleteValue("CodeSetNum0", false); + key.DeleteValue("CodeSetNum1", false); + key.DeleteValue("CodeSetNum2", false); + key.DeleteValue("CodeSetNum3", false); + } + } + static void DisableMceServices() { // Vista ... @@ -693,6 +713,46 @@ if (!_enableRemoteInput) return; + if (_ignoreAutomaticButtons && codeType == IrProtocol.RC6_MCE) + { + // Always ignore these buttones ... + if (keyCode == 0x7bdc || // Back + keyCode == 0x7bdd || // OK + keyCode == 0x7bde || // Right + keyCode == 0x7bdf || // Left + keyCode == 0x7be0 || // Down + keyCode == 0x7be1 || // Up + keyCode == 0x7bee || // Volume_Down + keyCode == 0x7bef || // Volume_Up + keyCode == 0x7bf1 || // Mute + keyCode == 0x7bf3 || // PC_Power + keyCode == 0x7bf6 || // Number_9 + keyCode == 0x7bf7 || // Number_8 + keyCode == 0x7bf8 || // Number_7 + keyCode == 0x7bf9 || // Number_6 + keyCode == 0x7bfa || // Number_5 + keyCode == 0x7bfb || // Number_4 + keyCode == 0x7bfc || // Number_3 + keyCode == 0x7bfd || // Number_2 + keyCode == 0x7bfe || // Number_1 + keyCode == 0x7bff) // Number_0 + { +#if TRACE + Trace.WriteLine("Ignoring remote button due to automatic handling"); +#endif + return; + } + + // Only ignore Start if the services aren't disabled ... + if (keyCode == 0x7bf2 && !_disableMceServices) + { +#if TRACE + Trace.WriteLine("Ignoring Start button due to automatic handling and the MCE services being active"); +#endif + return; + } + } + if (!firstPress && _lastRemoteButtonCodeType == codeType && _lastRemoteButtonKeyCode == keyCode) { TimeSpan timeBetween = DateTime.Now.Subtract(_lastRemoteButtonTime); Modified: trunk/plugins/IR Server Suite/IR Server Plugins/RedEye Blaster/RedEye Blaster.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/RedEye Blaster/RedEye Blaster.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/RedEye Blaster/RedEye Blaster.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -44,9 +44,7 @@ #region Constants - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\Input Service\\RedEye Blaster.xml"; + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "RedEye Blaster.xml"); static readonly string[] Ports = new string[] { "Default" }; Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Serial IR Blaster/Serial IR Blaster.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Serial IR Blaster/Serial IR Blaster.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Serial IR Blaster/Serial IR Blaster.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -21,9 +21,7 @@ #region Constants - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\Input Service\\Serial IR Blaster.xml"; + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "Serial IR Blaster.xml"); static readonly string[] Ports = new string[] { "Default" }; Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Speech Receiver/SpeechReceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Speech Receiver/SpeechReceiver.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Speech Receiver/SpeechReceiver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -13,7 +13,7 @@ /// <summary> /// IR Server Plugin for the receiving speech commands. /// </summary> - public class SpeechReceiver : IRServerPluginBase, IRemoteReceiver, IConfigure + public class SpeechReceiver : PluginBase, IRemoteReceiver, IConfigure { #region Constants @@ -87,7 +87,7 @@ /// </summary> /// <param name="owner">The owner window to use for creating modal dialogs.</param> public void Configure(IWin32Window owner) - { + {/* LoadSettings(); Setup setup = new Setup(); @@ -111,7 +111,7 @@ _led4 = setup.LED4; SaveSettings(); - } + }*/ } /// <summary> @@ -125,7 +125,7 @@ } void LoadSettings() - { + {/* XmlDocument doc = new XmlDocument(); try { doc.Load(ConfigurationFile); } @@ -147,10 +147,10 @@ try { _led3 = bool.Parse(doc.DocumentElement.Attributes["LED3"].Value); } catch { } try { _led4 = bool.Parse(doc.DocumentElement.Attributes["LED4"].Value); } - catch { } + catch { }*/ } void SaveSettings() - { + {/* try { using (XmlTextWriter writer = new XmlTextWriter(ConfigurationFile, Encoding.UTF8)) @@ -183,7 +183,7 @@ catch { } -#endif +#endif*/ } #endregion Implementation Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Tira Transceiver/TiraTransceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Tira Transceiver/TiraTransceiver.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Tira Transceiver/TiraTransceiver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -18,14 +18,12 @@ /// IR Server Plugin for Tira Transceiver device. /// </summary> [CLSCompliant(false)] - public class TiraTransceiver : IRServerPluginBase, IConfigure, ITransmitIR, ILearnIR, IRemoteReceiver + public class TiraTransceiver : PluginBase, IConfigure, ITransmitIR, ILearnIR, IRemoteReceiver { #region Constants - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\Input Service\\Tira Transceiver.xml"; + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "Tira Transceiver.xml"); static readonly string[] Ports = new string[] { "Default" }; 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 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/UirtTransceiver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -23,9 +23,7 @@ #region Constants - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\Input Service\\USB-UIRT Transceiver.xml"; + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "USB-UIRT Transceiver.xml"); const int UUIRTDRV_IRFMT_UUIRT = 0x0000; const int UUIRTDRV_IRFMT_PRONTO = 0x0010; Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Wii Remote Receiver/Wii Remote Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Wii Remote Receiver/Wii Remote Receiver.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Wii Remote Receiver/Wii Remote Receiver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -3,6 +3,7 @@ using System.Diagnostics; #endif using System.Drawing; +using System.IO; using System.Text; using System.Windows.Forms; using System.Xml; @@ -20,9 +21,7 @@ #region Constants - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\Input Service\\Wii Remote Receiver.xml"; + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "Wii Remote Receiver.xml"); readonly int ScreenWidth = Screen.PrimaryScreen.WorkingArea.Width; readonly int ScreenHeight = Screen.PrimaryScreen.WorkingArea.Height; Modified: 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.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -22,9 +22,7 @@ #region Constants - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\Input Service\\WinLirc Receiver.xml"; + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "WinLirc Receiver.xml"); #endregion Constants Modified: 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.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Windows Message Receiver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -31,9 +31,7 @@ #region Constants - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\Input Service\\Windows Messages.xml"; + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "Windows Messages.xml"); const int WM_APP = 0x8000; const int DefaultMessageID = 0x0018; Modified: trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/X10Transceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/X10Transceiver.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/X10Transceiver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -3,6 +3,7 @@ #if TRACE using System.Diagnostics; #endif +using System.IO; using System.Runtime.InteropServices; using System.Runtime.InteropServices.ComTypes; using System.Text; @@ -20,9 +21,7 @@ #region Constants - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\Input Service\\X10 Receiver.xml"; + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "X10 Transceiver.xml"); #endregion Constants Modified: trunk/plugins/IR Server Suite/IR Server Suite.sln =================... [truncated message content] |
From: <an...@us...> - 2008-03-02 04:39:11
|
Revision: 1412 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1412&view=rev Author: and-81 Date: 2008-03-01 20:39:09 -0800 (Sat, 01 Mar 2008) 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/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/Applications/Web Remote/Program.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/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs Added Paths: ----------- trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/ trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Client.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/FormMain.Designer.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/FormMain.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/FormMain.resx trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/ trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/AspectRatio.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/AspectRatioWide.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/Back.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/Blue.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/ChannelDown.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/ChannelUp.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/Clear.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/DVD.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/Down.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/Eject.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/EnterWide.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/FastForward.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/Fullscreen.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/FullscreenWide.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/Green.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/Guide.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/Hash.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/Info.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/Left.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/Music.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/Mute.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/NextChapter.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/Number0.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/Number1.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/Number2.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/Number3.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/Number4.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/Number5.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/Number6.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/Number7.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/Number8.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/Number9.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/OK.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/Pause.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/Pictures.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/Play.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/Power.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/PreviousChapter.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/Record.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/Red.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/Rewind.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/Right.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/Star.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/Start.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/Stop.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/TV.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/Teletext.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/Up.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/Video.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/VolumeDown.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/VolumeUp.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Graphics/Yellow.png trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Icon.ico trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/IrssMessage.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Program.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Properties/ trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/ServerAddress.Designer.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/ServerAddress.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/ServerAddress.resx trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Virtual Remote (PocketPC2003).csproj trunk/plugins/IR Server Suite/Applications/Virtual Remote (Smartphone2003)/ trunk/plugins/IR Server Suite/Applications/Virtual Remote (Smartphone2003)/Client.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote (Smartphone2003)/FormMain.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote (Smartphone2003)/FormMain.resx trunk/plugins/IR Server Suite/Applications/Virtual Remote (Smartphone2003)/Graphics/ trunk/plugins/IR Server Suite/Applications/Virtual Remote (Smartphone2003)/Graphics/Misc.bmp trunk/plugins/IR Server Suite/Applications/Virtual Remote (Smartphone2003)/Graphics/Navigation.bmp trunk/plugins/IR Server Suite/Applications/Virtual Remote (Smartphone2003)/Graphics/Numbers.bmp trunk/plugins/IR Server Suite/Applications/Virtual Remote (Smartphone2003)/Graphics/Playback.bmp trunk/plugins/IR Server Suite/Applications/Virtual Remote (Smartphone2003)/Icon.ico trunk/plugins/IR Server Suite/Applications/Virtual Remote (Smartphone2003)/IrssMessage.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote (Smartphone2003)/Properties/ trunk/plugins/IR Server Suite/Applications/Virtual Remote (Smartphone2003)/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote (Smartphone2003)/ServerAddress.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote (Smartphone2003)/ServerAddress.resx trunk/plugins/IR Server Suite/Applications/Virtual Remote (Smartphone2003)/Virtual Remote (Smartphone2003).csproj trunk/plugins/IR Server Suite/Applications/Virtual Remote (WinCE5)/ trunk/plugins/IR Server Suite/Applications/Virtual Remote (WinCE5)/Client.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote (WinCE5)/FormMain.Designer.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote (WinCE5)/FormMain.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote (WinCE5)/FormMain.resx trunk/plugins/IR Server Suite/Applications/Virtual Remote (WinCE5)/Icon.ico trunk/plugins/IR Server Suite/Applications/Virtual Remote (WinCE5)/IrssMessage.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote (WinCE5)/Program.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote (WinCE5)/Properties/ trunk/plugins/IR Server Suite/Applications/Virtual Remote (WinCE5)/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote (WinCE5)/Virtual Remote (WinCE5).csproj Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2008-02-29 17:31:08 UTC (rev 1411) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2008-03-02 04:39:09 UTC (rev 1412) @@ -345,6 +345,8 @@ _client.Dispose(); _client = null; + + _registered = false; } #region Controls Modified: trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2008-02-29 17:31:08 UTC (rev 1411) +++ trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2008-03-02 04:39:09 UTC (rev 1412) @@ -288,6 +288,8 @@ _client.Dispose(); _client = null; + + _registered = false; } static void ReceivedMessage(IrssMessage received) 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-02-29 17:31:08 UTC (rev 1411) +++ trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2008-03-02 04:39:09 UTC (rev 1412) @@ -250,6 +250,8 @@ _client.Dispose(); _client = null; + + _registered = false; } static void ReceivedMessage(IrssMessage received) Modified: trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2008-02-29 17:31:08 UTC (rev 1411) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2008-03-02 04:39:09 UTC (rev 1412) @@ -660,11 +660,13 @@ } void StopClient() { - if (_client != null) - { - _client.Dispose(); - _client = null; - } + if (_client == null) + return; + + _client.Dispose(); + _client = null; + + _registered = false; } bool StartRelay() Modified: trunk/plugins/IR Server Suite/Applications/Translator/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2008-02-29 17:31:08 UTC (rev 1411) +++ trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2008-03-02 04:39:09 UTC (rev 1412) @@ -657,11 +657,13 @@ } internal static void StopClient() { - if (_client != null) - { - _client.Dispose(); - _client = null; - } + if (_client == null) + return; + + _client.Dispose(); + _client = null; + + _registered = false; } static void ReceivedMessage(IrssMessage received) Modified: trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs 2008-02-29 17:31:08 UTC (rev 1411) +++ trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs 2008-03-02 04:39:09 UTC (rev 1412) @@ -302,6 +302,8 @@ _client.Dispose(); _client = null; + + _registered = false; } void ReceivedMessage(IrssMessage received) Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs 2008-02-29 17:31:08 UTC (rev 1411) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs 2008-03-02 04:39:09 UTC (rev 1412) @@ -336,6 +336,8 @@ _client.Dispose(); _client = null; + + _registered = false; } internal static bool ProcessClick(int x, int y) Property changes on: trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003) ___________________________________________________________________ Name: svn:ignore + bin obj Added: trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Client.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Client.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/Client.cs 2008-03-02 04:39:09 UTC (rev 1412) @@ -0,0 +1,341 @@ +using System; +using System.Net; +using System.Net.Sockets; +using System.Text; +using System.Threading; + +namespace VirtualRemote +{ + + #region Delegates + + /// <summary> + /// Message handling delegate for client. + /// </summary> + /// <param name="message">Message received.</param> + public delegate void ClientMessageSink(IrssMessage message); + + #endregion Delegates + + /// <summary> + /// TCP communications client class. + /// </summary> + public class Client : IDisposable + { + + #region Variables + + IPEndPoint _serverEndpoint; + Socket _serverSocket; + + volatile bool _processConnectionThread = false; + volatile bool _connected = false; + + ClientMessageSink _messageSink; + + WaitCallback _connectCallback; + WaitCallback _disconnectCallback; + WaitCallback _commsFailureCallback; + + #endregion Variables + + #region Properties + + /// <summary> + /// Is this client connected? + /// </summary> + public bool Connected + { + get { return _connected; } + } + + /// <summary> + /// Gets or Sets the Connect callback. + /// </summary> + public WaitCallback ConnectCallback + { + get { return _connectCallback; } + set { _connectCallback = value; } + } + + /// <summary> + /// Gets or Sets the Disconnect callback. + /// </summary> + public WaitCallback DisconnectCallback + { + get { return _disconnectCallback; } + set { _disconnectCallback = value; } + } + + /// <summary> + /// Gets or Sets the Communications Failure callback. + /// </summary> + public WaitCallback CommsFailureCallback + { + get { return _commsFailureCallback; } + set { _commsFailureCallback = value; } + } + + #endregion Properties + + #region Constructor + + /// <summary> + /// Create a TCP communications client. + /// </summary> + /// <param name="serverEndPoint">IP Address and Port combination of Server.</param> + /// <param name="messageSink">The message sink to call for messages.</param> + public Client(IPEndPoint serverEndPoint, ClientMessageSink messageSink) + { + _serverEndpoint = serverEndPoint; + + _messageSink = messageSink; + } + + #endregion Constructor + + #region IDisposable + + /// <summary> + /// Releases unmanaged and - optionally - managed resources + /// </summary> + public void Dispose() + { + Dispose(true); + 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> + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + // Dispose managed resources ... + Stop(); + } + + // Free native resources ... + + } + + #endregion IDisposable + + #region Implementation + + /// <summary> + /// Start the client communications. + /// </summary> + /// <returns><c>true</c> if successful, otherwise <c>false</c>.</returns> + public bool Start() + { + if (_processConnectionThread) + return false; + + _processConnectionThread = true; + _connected = false; + + try + { + Thread connectionThread = new Thread(new ThreadStart(ConnectionThread)); + connectionThread.Name = "IrssComms.Client.ConnectionThread"; + connectionThread.IsBackground = true; + connectionThread.Start(); + } + catch + { + _processConnectionThread = false; + + throw; + } + + return true; + } + + /// <summary> + /// Stop the client communications. + /// </summary> + public void Stop() + { + if (!_processConnectionThread) + return; + + _processConnectionThread = false; + _connected = false; + + _serverSocket.Close(); + _serverSocket = null; + } + + /// <summary> + /// Send a message to the server. + /// </summary> + /// <param name="message">Message to send.</param> + /// <returns><c>true</c> if successful, otherwise <c>false</c>.</returns> + public bool Send(IrssMessage message) + { + if (message == null) + throw new ArgumentNullException("message"); + + if (_serverSocket == null) + return false; + + byte[] data = message.ToBytes(); + + int dataLength = IPAddress.HostToNetworkOrder(data.Length); + + byte[] dataLengthBytes = BitConverter.GetBytes(dataLength); + + try + { + // Send packet size ... + _serverSocket.Send(dataLengthBytes); + + // Send packet ... + _serverSocket.Send(data); + + return true; + } + catch (SocketException) + { + return false; + } + } + + void QueueMessageSink(IrssMessage message) + { + _messageSink(message); + } + + void ConnectionThread() + { + // Outer loop is for reconnection attempts ... + while (_processConnectionThread) + { + _connected = false; + + _serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); + + #region Attempt to connect + + while (_processConnectionThread) + { + try + { + _serverSocket.Connect(_serverEndpoint); + break; + } + catch (SocketException socketException) + { + if (!_processConnectionThread) + return; + + if (socketException.ErrorCode == 10061) // ConnectionRefused + { + Thread.Sleep(1000); + continue; + } + + if (_commsFailureCallback != null) + _commsFailureCallback(socketException); + else + throw; + } + catch (Exception ex) + { + if (!_processConnectionThread) + return; + + if (_commsFailureCallback != null) + _commsFailureCallback(ex); + else + throw; + } + } + + #endregion Attempt to connect + + if (!_processConnectionThread) + return; + + _connected = true; + + if (_connectCallback != null) + _connectCallback(null); + + #region Read from socket + + try + { + byte[] buffer = new byte[4]; + + int bytesRead; + + // Read data from socket ... + while (_processConnectionThread) + { + bytesRead = _serverSocket.Receive(buffer, buffer.Length, SocketFlags.None); + if (bytesRead != buffer.Length) + break; + + int readSize = BitConverter.ToInt32(buffer, 0); + readSize = IPAddress.NetworkToHostOrder(readSize); + + byte[] packet = new byte[readSize]; + + bytesRead = _serverSocket.Receive(packet, packet.Length, SocketFlags.None); + if (bytesRead != packet.Length) + break; + + IrssMessage message = IrssMessage.FromBytes(packet); + _messageSink(message); + } + + if (!_processConnectionThread) + return; + + if (_disconnectCallback != null) + _disconnectCallback(null); + + } + catch (SocketException socketException) + { + if (!_processConnectionThread) + return; + + if (socketException.ErrorCode == 10054) // ConnectionReset + { + if (_disconnectCallback != null) + _disconnectCallback(null); + } + else + { + if (_commsFailureCallback != null) + _commsFailureCallback(socketException); + else + throw; + } + } + catch (Exception ex) + { + if (!_processConnectionThread) + return; + + if (_commsFailureCallback != null) + _commsFailureCallback(ex); + else + throw; + } + + #endregion Read from socket + + } + } + + #endregion Implementation + + } + +} Added: trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/FormMain.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/FormMain.Designer.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/FormMain.Designer.cs 2008-03-02 04:39:09 UTC (rev 1412) @@ -0,0 +1,692 @@ +namespace VirtualRemote +{ + + partial class FormMain + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + private System.Windows.Forms.MainMenu mainMenu; + + /// <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() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormMain)); + this.mainMenu = new System.Windows.Forms.MainMenu(); + this.menuItemSetup = new System.Windows.Forms.MenuItem(); + this.menuItemQuit = new System.Windows.Forms.MenuItem(); + this.tabControl = new System.Windows.Forms.TabControl(); + this.tabPageNavigation = new System.Windows.Forms.TabPage(); + this.pictureBox30 = new System.Windows.Forms.PictureBox(); + this.pictureBox8 = new System.Windows.Forms.PictureBox(); + this.pictureBox7 = new System.Windows.Forms.PictureBox(); + this.pictureBox6 = new System.Windows.Forms.PictureBox(); + this.pictureBox9 = new System.Windows.Forms.PictureBox(); + this.pictureBox10 = new System.Windows.Forms.PictureBox(); + this.pictureBox4 = new System.Windows.Forms.PictureBox(); + this.pictureBox3 = new System.Windows.Forms.PictureBox(); + this.pictureBox2 = new System.Windows.Forms.PictureBox(); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.pictureBoxUp = new System.Windows.Forms.PictureBox(); + this.pictureBoxBack = new System.Windows.Forms.PictureBox(); + this.tabPagePlayback = new System.Windows.Forms.TabPage(); + this.pictureBoxNextChapter = new System.Windows.Forms.PictureBox(); + this.pictureBoxPreviousChapter = new System.Windows.Forms.PictureBox(); + this.pictureBoxRewind = new System.Windows.Forms.PictureBox(); + this.pictureBoxFastForward = new System.Windows.Forms.PictureBox(); + this.pictureBoxPause = new System.Windows.Forms.PictureBox(); + this.pictureBoxRecord = new System.Windows.Forms.PictureBox(); + this.pictureBoxStop = new System.Windows.Forms.PictureBox(); + this.pictureBoxPlay = new System.Windows.Forms.PictureBox(); + this.tabPageNumbers = new System.Windows.Forms.TabPage(); + this.pictureBox24 = new System.Windows.Forms.PictureBox(); + this.pictureBox23 = new System.Windows.Forms.PictureBox(); + this.pictureBox20 = new System.Windows.Forms.PictureBox(); + this.pictureBox21 = new System.Windows.Forms.PictureBox(); + this.pictureBox22 = new System.Windows.Forms.PictureBox(); + this.pictureBox17 = new System.Windows.Forms.PictureBox(); + this.pictureBox18 = new System.Windows.Forms.PictureBox(); + this.pictureBox19 = new System.Windows.Forms.PictureBox(); + this.pictureBox14 = new System.Windows.Forms.PictureBox(); + this.pictureBox15 = new System.Windows.Forms.PictureBox(); + this.pictureBox16 = new System.Windows.Forms.PictureBox(); + this.pictureBox13 = new System.Windows.Forms.PictureBox(); + this.pictureBox12 = new System.Windows.Forms.PictureBox(); + this.pictureBox11 = new System.Windows.Forms.PictureBox(); + this.tabPageMisc = new System.Windows.Forms.TabPage(); + this.pictureBoxInfo = new System.Windows.Forms.PictureBox(); + this.pictureBoxPower = new System.Windows.Forms.PictureBox(); + this.pictureBoxFullscree = new System.Windows.Forms.PictureBox(); + this.pictureBoxAspectRatio = new System.Windows.Forms.PictureBox(); + this.pictureBoxTeletext = new System.Windows.Forms.PictureBox(); + this.pictureBox28 = new System.Windows.Forms.PictureBox(); + this.pictureBox27 = new System.Windows.Forms.PictureBox(); + this.pictureBox26 = new System.Windows.Forms.PictureBox(); + this.pictureBox25 = new System.Windows.Forms.PictureBox(); + this.notification = new Microsoft.WindowsCE.Forms.Notification(); + this.tabControl.SuspendLayout(); + this.tabPageNavigation.SuspendLayout(); + this.tabPagePlayback.SuspendLayout(); + this.tabPageNumbers.SuspendLayout(); + this.tabPageMisc.SuspendLayout(); + this.SuspendLayout(); + // + // mainMenu + // + this.mainMenu.MenuItems.Add(this.menuItemSetup); + this.mainMenu.MenuItems.Add(this.menuItemQuit); + // + // menuItemSetup + // + this.menuItemSetup.Text = "Setup"; + this.menuItemSetup.Click += new System.EventHandler(this.menuItemSetup_Click); + // + // menuItemQuit + // + this.menuItemQuit.Text = "Quit"; + this.menuItemQuit.Click += new System.EventHandler(this.menuItemQuit_Click); + // + // tabControl + // + this.tabControl.Controls.Add(this.tabPageNavigation); + this.tabControl.Controls.Add(this.tabPagePlayback); + this.tabControl.Controls.Add(this.tabPageNumbers); + this.tabControl.Controls.Add(this.tabPageMisc); + this.tabControl.Dock = System.Windows.Forms.DockStyle.Fill; + this.tabControl.Location = new System.Drawing.Point(0, 0); + this.tabControl.Name = "tabControl"; + this.tabControl.SelectedIndex = 0; + this.tabControl.Size = new System.Drawing.Size(240, 268); + this.tabControl.TabIndex = 0; + // + // tabPageNavigation + // + this.tabPageNavigation.Controls.Add(this.pictureBox30); + this.tabPageNavigation.Controls.Add(this.pictureBox8); + this.tabPageNavigation.Controls.Add(this.pictureBox7); + this.tabPageNavigation.Controls.Add(this.pictureBox6); + this.tabPageNavigation.Controls.Add(this.pictureBox9); + this.tabPageNavigation.Controls.Add(this.pictureBox10); + this.tabPageNavigation.Controls.Add(this.pictureBox4); + this.tabPageNavigation.Controls.Add(this.pictureBox3); + this.tabPageNavigation.Controls.Add(this.pictureBox2); + this.tabPageNavigation.Controls.Add(this.pictureBox1); + this.tabPageNavigation.Controls.Add(this.pictureBoxUp); + this.tabPageNavigation.Controls.Add(this.pictureBoxBack); + this.tabPageNavigation.Location = new System.Drawing.Point(0, 0); + this.tabPageNavigation.Name = "tabPageNavigation"; + this.tabPageNavigation.Size = new System.Drawing.Size(240, 245); + this.tabPageNavigation.Text = "Navigation"; + // + // pictureBox30 + // + this.pictureBox30.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox30.Image"))); + this.pictureBox30.Location = new System.Drawing.Point(168, 8); + this.pictureBox30.Name = "pictureBox30"; + this.pictureBox30.Size = new System.Drawing.Size(64, 48); + this.pictureBox30.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox30.Tag = "Record"; + // + // pictureBox8 + // + this.pictureBox8.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox8.Image"))); + this.pictureBox8.Location = new System.Drawing.Point(88, 192); + this.pictureBox8.Name = "pictureBox8"; + this.pictureBox8.Size = new System.Drawing.Size(64, 48); + this.pictureBox8.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox8.Tag = "Up"; + this.pictureBox8.Click += new System.EventHandler(this.button_Click); + // + // pictureBox7 + // + this.pictureBox7.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox7.Image"))); + this.pictureBox7.Location = new System.Drawing.Point(8, 136); + this.pictureBox7.Name = "pictureBox7"; + this.pictureBox7.Size = new System.Drawing.Size(64, 48); + this.pictureBox7.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox7.Tag = "Up"; + this.pictureBox7.Click += new System.EventHandler(this.button_Click); + // + // pictureBox6 + // + this.pictureBox6.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox6.Image"))); + this.pictureBox6.Location = new System.Drawing.Point(8, 192); + this.pictureBox6.Name = "pictureBox6"; + this.pictureBox6.Size = new System.Drawing.Size(64, 48); + this.pictureBox6.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox6.Tag = "Up"; + this.pictureBox6.Click += new System.EventHandler(this.button_Click); + // + // pictureBox9 + // + this.pictureBox9.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox9.Image"))); + this.pictureBox9.Location = new System.Drawing.Point(168, 192); + this.pictureBox9.Name = "pictureBox9"; + this.pictureBox9.Size = new System.Drawing.Size(64, 48); + this.pictureBox9.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox9.Tag = "Up"; + this.pictureBox9.Click += new System.EventHandler(this.button_Click); + // + // pictureBox10 + // + this.pictureBox10.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox10.Image"))); + this.pictureBox10.Location = new System.Drawing.Point(168, 136); + this.pictureBox10.Name = "pictureBox10"; + this.pictureBox10.Size = new System.Drawing.Size(64, 48); + this.pictureBox10.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox10.Tag = "Up"; + this.pictureBox10.Click += new System.EventHandler(this.button_Click); + // + // pictureBox4 + // + this.pictureBox4.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox4.Image"))); + this.pictureBox4.Location = new System.Drawing.Point(160, 72); + this.pictureBox4.Name = "pictureBox4"; + this.pictureBox4.Size = new System.Drawing.Size(64, 48); + this.pictureBox4.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox4.Tag = "Up"; + this.pictureBox4.Click += new System.EventHandler(this.button_Click); + // + // pictureBox3 + // + this.pictureBox3.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox3.Image"))); + this.pictureBox3.Location = new System.Drawing.Point(16, 72); + this.pictureBox3.Name = "pictureBox3"; + this.pictureBox3.Size = new System.Drawing.Size(64, 48); + this.pictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox3.Tag = "Up"; + this.pictureBox3.Click += new System.EventHandler(this.button_Click); + // + // pictureBox2 + // + this.pictureBox2.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox2.Image"))); + this.pictureBox2.Location = new System.Drawing.Point(88, 128); + this.pictureBox2.Name = "pictureBox2"; + this.pictureBox2.Size = new System.Drawing.Size(64, 48); + this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox2.Tag = "Up"; + this.pictureBox2.Click += new System.EventHandler(this.button_Click); + // + // pictureBox1 + // + this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image"))); + this.pictureBox1.Location = new System.Drawing.Point(88, 72); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(64, 48); + this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox1.Tag = "Up"; + this.pictureBox1.Click += new System.EventHandler(this.button_Click); + // + // pictureBoxUp + // + this.pictureBoxUp.Image = ((System.Drawing.Image)(resources.GetObject("pictureBoxUp.Image"))); + this.pictureBoxUp.Location = new System.Drawing.Point(88, 16); + this.pictureBoxUp.Name = "pictureBoxUp"; + this.pictureBoxUp.Size = new System.Drawing.Size(64, 48); + this.pictureBoxUp.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBoxUp.Tag = "Up"; + this.pictureBoxUp.Click += new System.EventHandler(this.button_Click); + // + // pictureBoxBack + // + this.pictureBoxBack.Image = ((System.Drawing.Image)(resources.GetObject("pictureBoxBack.Image"))); + this.pictureBoxBack.Location = new System.Drawing.Point(8, 8); + this.pictureBoxBack.Name = "pictureBoxBack"; + this.pictureBoxBack.Size = new System.Drawing.Size(64, 48); + this.pictureBoxBack.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBoxBack.Tag = "Back"; + this.pictureBoxBack.Click += new System.EventHandler(this.button_Click); + // + // tabPagePlayback + // + this.tabPagePlayback.Controls.Add(this.pictureBoxNextChapter); + this.tabPagePlayback.Controls.Add(this.pictureBoxPreviousChapter); + this.tabPagePlayback.Controls.Add(this.pictureBoxRewind); + this.tabPagePlayback.Controls.Add(this.pictureBoxFastForward); + this.tabPagePlayback.Controls.Add(this.pictureBoxPause); + this.tabPagePlayback.Controls.Add(this.pictureBoxRecord); + this.tabPagePlayback.Controls.Add(this.pictureBoxStop); + this.tabPagePlayback.Controls.Add(this.pictureBoxPlay); + this.tabPagePlayback.Location = new System.Drawing.Point(0, 0); + this.tabPagePlayback.Name = "tabPagePlayback"; + this.tabPagePlayback.Size = new System.Drawing.Size(240, 245); + this.tabPagePlayback.Text = "Playback"; + // + // pictureBoxNextChapter + // + this.pictureBoxNextChapter.Image = ((System.Drawing.Image)(resources.GetObject("pictureBoxNextChapter.Image"))); + this.pictureBoxNextChapter.Location = new System.Drawing.Point(136, 168); + this.pictureBoxNextChapter.Name = "pictureBoxNextChapter"; + this.pictureBoxNextChapter.Size = new System.Drawing.Size(64, 48); + this.pictureBoxNextChapter.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBoxNextChapter.Tag = "NextChapter"; + // + // pictureBoxPreviousChapter + // + this.pictureBoxPreviousChapter.Image = ((System.Drawing.Image)(resources.GetObject("pictureBoxPreviousChapter.Image"))); + this.pictureBoxPreviousChapter.Location = new System.Drawing.Point(40, 168); + this.pictureBoxPreviousChapter.Name = "pictureBoxPreviousChapter"; + this.pictureBoxPreviousChapter.Size = new System.Drawing.Size(64, 48); + this.pictureBoxPreviousChapter.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBoxPreviousChapter.Tag = "PreviousChapter"; + // + // pictureBoxRewind + // + this.pictureBoxRewind.Image = ((System.Drawing.Image)(resources.GetObject("pictureBoxRewind.Image"))); + this.pictureBoxRewind.Location = new System.Drawing.Point(8, 104); + this.pictureBoxRewind.Name = "pictureBoxRewind"; + this.pictureBoxRewind.Size = new System.Drawing.Size(64, 48); + this.pictureBoxRewind.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBoxRewind.Tag = "Rewind"; + // + // pictureBoxFastForward + // + this.pictureBoxFastForward.Image = ((System.Drawing.Image)(resources.GetObject("pictureBoxFastForward.Image"))); + this.pictureBoxFastForward.Location = new System.Drawing.Point(168, 104); + this.pictureBoxFastForward.Name = "pictureBoxFastForward"; + this.pictureBoxFastForward.Size = new System.Drawing.Size(64, 48); + this.pictureBoxFastForward.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBoxFastForward.Tag = "FastForward"; + // + // pictureBoxPause + // + this.pictureBoxPause.Image = ((System.Drawing.Image)(resources.GetObject("pictureBoxPause.Image"))); + this.pictureBoxPause.Location = new System.Drawing.Point(168, 40); + this.pictureBoxPause.Name = "pictureBoxPause"; + this.pictureBoxPause.Size = new System.Drawing.Size(64, 48); + this.pictureBoxPause.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBoxPause.Tag = "Pause"; + this.pictureBoxPause.Click += new System.EventHandler(this.button_Click); + // + // pictureBoxRecord + // + this.pictureBoxRecord.Image = ((System.Drawing.Image)(resources.GetObject("pictureBoxRecord.Image"))); + this.pictureBoxRecord.Location = new System.Drawing.Point(8, 40); + this.pictureBoxRecord.Name = "pictureBoxRecord"; + this.pictureBoxRecord.Size = new System.Drawing.Size(64, 48); + this.pictureBoxRecord.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBoxRecord.Tag = "Record"; + this.pictureBoxRecord.Click += new System.EventHandler(this.button_Click); + // + // pictureBoxStop + // + this.pictureBoxStop.Image = ((System.Drawing.Image)(resources.GetObject("pictureBoxStop.Image"))); + this.pictureBoxStop.Location = new System.Drawing.Point(88, 40); + this.pictureBoxStop.Name = "pictureBoxStop"; + this.pictureBoxStop.Size = new System.Drawing.Size(64, 48); + this.pictureBoxStop.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBoxStop.Tag = "Stop"; + this.pictureBoxStop.Click += new System.EventHandler(this.button_Click); + // + // pictureBoxPlay + // + this.pictureBoxPlay.Image = ((System.Drawing.Image)(resources.GetObject("pictureBoxPlay.Image"))); + this.pictureBoxPlay.Location = new System.Drawing.Point(88, 104); + this.pictureBoxPlay.Name = "pictureBoxPlay"; + this.pictureBoxPlay.Size = new System.Drawing.Size(64, 48); + this.pictureBoxPlay.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBoxPlay.Tag = "Play"; + this.pictureBoxPlay.Click += new System.EventHandler(this.button_Click); + // + // tabPageNumbers + // + this.tabPageNumbers.Controls.Add(this.pictureBox24); + this.tabPageNumbers.Controls.Add(this.pictureBox23); + this.tabPageNumbers.Controls.Add(this.pictureBox20); + this.tabPageNumbers.Controls.Add(this.pictureBox21); + this.tabPageNumbers.Controls.Add(this.pictureBox22); + this.tabPageNumbers.Controls.Add(this.pictureBox17); + this.tabPageNumbers.Controls.Add(this.pictureBox18); + this.tabPageNumbers.Controls.Add(this.pictureBox19); + this.tabPageNumbers.Controls.Add(this.pictureBox14); + this.tabPageNumbers.Controls.Add(this.pictureBox15); + this.tabPageNumbers.Controls.Add(this.pictureBox16); + this.tabPageNumbers.Controls.Add(this.pictureBox13); + this.tabPageNumbers.Controls.Add(this.pictureBox12); + this.tabPageNumbers.Controls.Add(this.pictureBox11); + this.tabPageNumbers.Location = new System.Drawing.Point(0, 0); + this.tabPageNumbers.Name = "tabPageNumbers"; + this.tabPageNumbers.Size = new System.Drawing.Size(240, 245); + this.tabPageNumbers.Text = "Numbers"; + this.tabPageNumbers.Click += new System.EventHandler(this.button_Click); + // + // pictureBox24 + // + this.pictureBox24.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox24.Image"))); + this.pictureBox24.Location = new System.Drawing.Point(88, 200); + this.pictureBox24.Name = "pictureBox24"; + this.pictureBox24.Size = new System.Drawing.Size(144, 40); + this.pictureBox24.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox24.Tag = "Up"; + this.pictureBox24.Click += new System.EventHandler(this.button_Click); + // + // pictureBox23 + // + this.pictureBox23.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox23.Image"))); + this.pictureBox23.Location = new System.Drawing.Point(8, 200); + this.pictureBox23.Name = "pictureBox23"; + this.pictureBox23.Size = new System.Drawing.Size(64, 40); + this.pictureBox23.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox23.Tag = "Up"; + this.pictureBox23.Click += new System.EventHandler(this.button_Click); + // + // pictureBox20 + // + this.pictureBox20.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox20.Image"))); + this.pictureBox20.Location = new System.Drawing.Point(168, 152); + this.pictureBox20.Name = "pictureBox20"; + this.pictureBox20.Size = new System.Drawing.Size(64, 40); + this.pictureBox20.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox20.Tag = "Up"; + this.pictureBox20.Click += new System.EventHandler(this.button_Click); + // + // pictureBox21 + // + this.pictureBox21.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox21.Image"))); + this.pictureBox21.Location = new System.Drawing.Point(88, 152); + this.pictureBox21.Name = "pictureBox21"; + this.pictureBox21.Size = new System.Drawing.Size(64, 40); + this.pictureBox21.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox21.Tag = "Up"; + this.pictureBox21.Click += new System.EventHandler(this.button_Click); + // + // pictureBox22 + // + this.pictureBox22.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox22.Image"))); + this.pictureBox22.Location = new System.Drawing.Point(8, 152); + this.pictureBox22.Name = "pictureBox22"; + this.pictureBox22.Size = new System.Drawing.Size(64, 40); + this.pictureBox22.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox22.Tag = "Up"; + this.pictureBox22.Click += new System.EventHandler(this.button_Click); + // + // pictureBox17 + // + this.pictureBox17.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox17.Image"))); + this.pictureBox17.Location = new System.Drawing.Point(168, 104); + this.pictureBox17.Name = "pictureBox17"; + this.pictureBox17.Size = new System.Drawing.Size(64, 40); + this.pictureBox17.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox17.Tag = "Up"; + this.pictureBox17.Click += new System.EventHandler(this.button_Click); + // + // pictureBox18 + // + this.pictureBox18.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox18.Image"))); + this.pictureBox18.Location = new System.Drawing.Point(88, 104); + this.pictureBox18.Name = "pictureBox18"; + this.pictureBox18.Size = new System.Drawing.Size(64, 40); + this.pictureBox18.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox18.Tag = "Up"; + this.pictureBox18.Click += new System.EventHandler(this.button_Click); + // + // pictureBox19 + // + this.pictureBox19.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox19.Image"))); + this.pictureBox19.Location = new System.Drawing.Point(8, 104); + this.pictureBox19.Name = "pictureBox19"; + this.pictureBox19.Size = new System.Drawing.Size(64, 40); + this.pictureBox19.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox19.Tag = "Up"; + this.pictureBox19.Click += new System.EventHandler(this.button_Click); + // + // pictureBox14 + // + this.pictureBox14.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox14.Image"))); + this.pictureBox14.Location = new System.Drawing.Point(168, 56); + this.pictureBox14.Name = "pictureBox14"; + this.pictureBox14.Size = new System.Drawing.Size(64, 40); + this.pictureBox14.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox14.Tag = "Up"; + this.pictureBox14.Click += new System.EventHandler(this.button_Click); + // + // pictureBox15 + // + this.pictureBox15.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox15.Image"))); + this.pictureBox15.Location = new System.Drawing.Point(88, 56); + this.pictureBox15.Name = "pictureBox15"; + this.pictureBox15.Size = new System.Drawing.Size(64, 40); + this.pictureBox15.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox15.Tag = "Up"; + this.pictureBox15.Click += new System.EventHandler(this.button_Click); + // + // pictureBox16 + // + this.pictureBox16.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox16.Image"))); + this.pictureBox16.Location = new System.Drawing.Point(8, 56); + this.pictureBox16.Name = "pictureBox16"; + this.pictureBox16.Size = new System.Drawing.Size(64, 40); + this.pictureBox16.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox16.Tag = "Up"; + this.pictureBox16.Click += new System.EventHandler(this.button_Click); + // + // pictureBox13 + // + this.pictureBox13.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox13.Image"))); + this.pictureBox13.Location = new System.Drawing.Point(168, 8); + this.pictureBox13.Name = "pictureBox13"; + this.pictureBox13.Size = new System.Drawing.Size(64, 40); + this.pictureBox13.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox13.Tag = "Up"; + this.pictureBox13.Click += new System.EventHandler(this.button_Click); + // + // pictureBox12 + // + this.pictureBox12.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox12.Image"))); + this.pictureBox12.Location = new System.Drawing.Point(88, 8); + this.pictureBox12.Name = "pictureBox12"; + this.pictureBox12.Size = new System.Drawing.Size(64, 40); + this.pictureBox12.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox12.Tag = "Up"; + this.pictureBox12.Click += new System.EventHandler(this.button_Click); + // + // pictureBox11 + // + this.pictureBox11.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox11.Image"))); + this.pictureBox11.Location = new System.Drawing.Point(8, 8); + this.pictureBox11.Name = "pictureBox11"; + this.pictureBox11.Size = new System.Drawing.Size(64, 40); + this.pictureBox11.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox11.Tag = "Up"; + this.pictureBox11.Click += new System.EventHandler(this.button_Click); + // + // tabPageMisc + // + this.tabPageMisc.Controls.Add(this.pictureBoxInfo); + this.tabPageMisc.Controls.Add(this.pictureBoxPower); + this.tabPageMisc.Controls.Add(this.pictureBoxFullscree); + this.tabPageMisc.Controls.Add(this.pictureBoxAspectRatio); + this.tabPageMisc.Controls.Add(this.pictureBoxTeletext); + this.tabPageMisc.Controls.Add(this.pictureBox28); + this.tabPageMisc.Controls.Add(this.pictureBox27); + this.tabPageMisc.Controls.Add(this.pictureBox26); + this.tabPageMisc.Controls.Add(this.pictureBox25); + this.tabPageMisc.Location = new System.Drawing.Point(0, 0); + this.tabPageMisc.Name = "tabPageMisc"; + this.tabPageMisc.Size = new System.Drawing.Size(240, 245); + this.tabPageMisc.Text = "Misc"; + // + // pictureBoxInfo + // + this.pictureBoxInfo.Image = ((System.Drawing.Image)(resources.GetObject("pictureBoxInfo.Image"))); + this.pictureBoxInfo.Location = new System.Drawing.Point(88, 8); + this.pictureBoxInfo.Name = "pictureBoxInfo"; + this.pictureBoxInfo.Size = new System.Drawing.Size(64, 40); + this.pictureBoxInfo.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBoxInfo.Tag = "Info"; + // + // pictureBoxPower + // + this.pictureBoxPower.Image = ((System.Drawing.Image)(resources.GetObject("pictureBoxPower.Image"))); + this.pictureBoxPower.Location = new System.Drawing.Point(8, 8); + this.pictureBoxPower.Name = "pictureBoxPower"; + this.pictureBoxPower.Size = new System.Drawing.Size(64, 40); + this.pictureBoxPower.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBoxPower.Tag = "Power"; + // + // pictureBoxFullscree + // + this.pictureBoxFullscree.Image = ((System.Drawing.Image)(resources.GetObject("pictureBoxFullscree.Image"))); + this.pictureBoxFullscree.Location = new System.Drawing.Point(128, 152); + this.pictureBoxFullscree.Name = "pictureBoxFullscree"; + this.pictureBoxFullscree.Size = new System.Drawing.Size(104, 40); + this.pictureBoxFullscree.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBoxFullscree.Tag = "Up"; + // + // pictureBoxAspectRatio + // + this.pictureBoxAspectRatio.Image = ((System.Drawing.Image)(resources.GetObject("pictureBoxAspectRatio.Image"))); + this.pictureBoxAspectRatio.Location = new System.Drawing.Point(8, 152); + this.pictureBoxAspectRatio.Name = "pictureBoxAspectRatio"; + this.pictureBoxAspectRatio.Size = new System.Drawing.Size(104, 40); + this.pictureBoxAspectRatio.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBoxAspectRatio.Tag = "AspectRatio"; + // + // pictureBoxTeletext + // + this.pictureBoxTeletext.Image = ((System.Drawing.Image)(resources.GetObject("pictureBoxTeletext.Image"))); + this.pictureBoxTeletext.Location = new System.Drawing.Point(168, 8); + this.pictureBoxTeletext.Name = "pictureBoxTeletext"; + this.pictureBoxTeletext.Size = new System.Drawing.Size(64, 40); + this.pictureBoxTeletext.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBoxTeletext.Tag = "Teletext"; + // + // pictureBox28 + // + this.pictureBox28.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox28.Image"))); + this.pictureBox28.Location = new System.Drawing.Point(184, 200); + this.pictureBox28.Name = "pictureBox28"; + this.pictureBox28.Size = new System.Drawing.Size(48, 32); + this.pictureBox28.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox28.Tag = "Up"; + // + // pictureBox27 + // + this.pictureBox27.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox27.Image"))); + this.pictureBox27.Location = new System.Drawing.Point(128, 200); + this.pictureBox27.Name = "pictureBox27"; + this.pictureBox27.Size = new System.Drawing.Size(48, 32); + this.pictureBox27.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox27.Tag = "Up"; + // + // pictureBox26 + // + this.pictureBox26.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox26.Image"))); + this.pictureBox26.Location = new System.Drawing.Point(64, 200); + this.pictureBox26.Name = "pictureBox26"; + this.pictureBox26.Size = new System.Drawing.Size(48, 32); + this.pictureBox26.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox26.Tag = "Up"; + // + // pictureBox25 + // + this.pictureBox25.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox25.Image"))); + this.pictureBox25.Location = new System.Drawing.Point(8, 200); + this.pictureBox25.Name = "pictureBox25"; + this.pictureBox25.Size = new System.Drawing.Size(48, 32); + this.pictureBox25.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pictureBox25.Tag = "Up"; + // + // notification + // + this.notification.Caption = "Virtual Remote"; + this.notification.InitialDuration = 3; + this.notification.Text = ""; + // + // FormMain + // + this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; + this.AutoScroll = true; + this.ClientSize = new System.Drawing.Size(240, 268); + this.Controls.Add(this.tabControl); + this.KeyPreview = true; + this.Menu = this.mainMenu; + this.Name = "FormMain"; + this.Text = "Virtual Remote"; + this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.FormMain_KeyDown); + this.Load += new System.EventHandler(this.FormMain_Load); + this.tabControl.ResumeLayout(false); + this.tabPageNavigation.ResumeLayout(false); + this.tabPagePlayback.ResumeLayout(false); + this.tabPageNumbers.ResumeLayout(false); + this.tabPageMisc.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.MenuItem menuItemSetup; + private System.Windows.Forms.TabControl tabControl; + private System.Windows.Forms.TabPage tabPageNavigation; + private System.Windows.Forms.TabPage tabPagePlayback; + private System.Windows.Forms.MenuItem menuItemQuit; + private System.Windows.Forms.TabPage tabPageNumbers; + private System.Windows.Forms.TabPage tabPageMisc; + private Microsoft.WindowsCE.Forms.Notification notification; + private System.Windows.Forms.PictureBox pictureBoxRecord; + private System.Windows.Forms.PictureBox pictureBoxStop; + private System.Windows.Forms.PictureBox pictureBoxPause; + private System.Windows.Forms.PictureBox pictureBoxPlay; + private System.Windows.Forms.PictureBox pictureBoxNextChapter; + private System.Windows.Forms.PictureBox pictureBoxPreviousChapter; + private System.Windows.Forms.PictureBox pictureBoxRewind; + private System.Windows.Forms.PictureBox pictureBoxFastForward; + private System.Windows.Forms.PictureBox pictureBox4; + private System.Windows.Forms.PictureBox pictureBox3; + private System.Windows.Forms.PictureBox pictureBox2; + private System.Windows.Forms.PictureBox pictureBox1; + private System.Windows.Forms.PictureBox pictureBoxUp; + private System.Windows.Forms.PictureBox pictureBoxBack; + private System.Windows.Forms.PictureBox pictureBox24; + private System.Windows.Forms.PictureBox pictureBox23; + private System.Windows.Forms.PictureBox pictureBox20; + private System.Windows.Forms.PictureBox pictureBox21; + private System.Windows.Forms.PictureBox pictureBox22; + private System.Windows.Forms.PictureBox pictureBox17; + private System.Windows.Forms.PictureBox pictureBox18; + private System.Windows.Forms.PictureBox pictureBox19; + private System.Windows.Forms.PictureBox pictureBox14; + private System.Windows.Forms.PictureBox pictureBox15; + private System.Windows.Forms.PictureBox pictureBox16; + private System.Windows.Forms.PictureBox pictureBox13; + private System.Windows.Forms.PictureBox pictureBox12; + private System.Windows.Forms.PictureBox pictureBox11; + private System.Windows.Forms.PictureBox pictureBox28; + private System.Windows.Forms.PictureBox pictureBox27; + private System.Windows.Forms.PictureBox pictureBox26; + private System.Windows.Forms.PictureBox pictureBox25; + private System.Windows.Forms.PictureBox pictureBox9; + private System.Windows.Forms.PictureBox pictureBox10; + private System.Windows.Forms.PictureBox pictureBoxFullscree; + private System.Windows.Forms.PictureBox pictureBoxAspectRatio; + private System.Windows.Forms.PictureBox pictureBoxTeletext; + private System.Windows.Forms.PictureBox pictureBox8; + private System.Windows.Forms.PictureBox pictureBox7; + private System.Windows.Forms.PictureBox pictureBox6; + private System.Windows.Forms.PictureBox pictureBox30; + private System.Windows.Forms.PictureBox pictureBoxInfo; + private System.Windows.Forms.PictureBox pictureBoxPower; + } + +} Added: trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/FormMain.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/FormMain.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003)/FormMain.cs 2008-03-02 04:39:09 UTC (rev 1412) @@ -0,0 +1,282 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.IO; +using System.Net; +using System.Net.Sockets; +using System.Text; +using System.Threading; +using System.Windows.Forms; +using System.Xml; + +namespace VirtualRemote +{ + + /// <summary> + /// Main Form for Virtual Remote. + /// <... [truncated message content] |
From: <an...@us...> - 2008-03-03 05:53:53
|
Revision: 1415 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1415&view=rev Author: and-81 Date: 2008-03-02 21:53:52 -0800 (Sun, 02 Mar 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Abstractor/Abstractor.csproj trunk/plugins/IR Server Suite/Applications/Keyboard Input Relay/Keyboard Input Relay.csproj trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote (Smartphone2003)/ServerAddress.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote (Smartphone2003)/Virtual Remote (Smartphone2003).csproj trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverXP.cs trunk/plugins/IR Server Suite/IR Server Suite.sln Added Paths: ----------- trunk/plugins/IR Server Suite/Applications/Dbox Tuner/ trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Data.cs trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Dbox Tuner.csproj trunk/plugins/IR Server Suite/Applications/Dbox Tuner/DboxFunctions.cs trunk/plugins/IR Server Suite/Applications/Dbox Tuner/GuiDbox.cs trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Icon.ico trunk/plugins/IR Server Suite/Applications/Dbox Tuner/MyDboxGui.cs trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Program.cs trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Properties/ trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Request.cs trunk/plugins/IR Server Suite/Applications/Dbox Tuner/SetupForm.Designer.cs trunk/plugins/IR Server Suite/Applications/Dbox Tuner/SetupForm.cs trunk/plugins/IR Server Suite/Applications/Dbox Tuner/SetupForm.resx trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003) Installer/ trunk/plugins/IR Server Suite/Applications/Virtual Remote (PocketPC2003) Installer/Virtual Remote (PocketPC2003) Installer.vddproj trunk/plugins/IR Server Suite/Applications/Virtual Remote (Smartphone2003) Installer/ trunk/plugins/IR Server Suite/Applications/Virtual Remote (Smartphone2003) Installer/Virtual Remote (Smartphone2003) Installer.vddproj trunk/plugins/IR Server Suite/Applications/Virtual Remote (WinCE5) Installer/ trunk/plugins/IR Server Suite/Applications/Virtual Remote (WinCE5) Installer/Virtual Remote (WinCE5) Installer.vddproj Modified: trunk/plugins/IR Server Suite/Applications/Abstractor/Abstractor.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/Abstractor/Abstractor.csproj 2008-03-02 16:34:31 UTC (rev 1414) +++ trunk/plugins/IR Server Suite/Applications/Abstractor/Abstractor.csproj 2008-03-03 05:53:52 UTC (rev 1415) @@ -23,12 +23,14 @@ <UseVSHostingProcess>false</UseVSHostingProcess> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> + <DebugType>none</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> + <DefineConstants> + </DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <UseVSHostingProcess>false</UseVSHostingProcess> </PropertyGroup> <ItemGroup> <Reference Include="System" /> Property changes on: trunk/plugins/IR Server Suite/Applications/Dbox Tuner ___________________________________________________________________ Name: svn:ignore + bin obj Added: trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Data.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Data.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Data.cs 2008-03-03 05:53:52 UTC (rev 1415) @@ -0,0 +1,293 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.Collections.Generic; +using System.Text; +using System.Data; +using System.IO; +using System.Xml; +using System.Text.RegularExpressions; + +namespace DboxTuner +{ + + public class Data + { + + string _url; + string _userName; + string _password; + + public static string _boxtype = String.Empty; + + private string _Command = "/control/"; + + public Data(string url, string username, string password, string boxtype) + { + _url = url; + _userName = username; + _password = password; + _boxtype = boxtype; + } + + + public DataSet UserTVBouquets + { + get + { + DboxFunctions dboxfunc = new DboxFunctions(_url, _userName, _password, _boxtype); + //dboxfunc.ErrorLog("data.cs box = " + _boxtype); + string command = ""; + string temp = ""; + string sreturn = ""; + Request request = new Request(_url, _userName, _password); + + switch (_boxtype) + { + case "Enigma v1": + // get userbouquets (ref=4097:7:0:6:0:0:0:0:0:0:) + sreturn = request.PostData("/cgi-bin/getServices?ref=4097:7:0:6:0:0:0:0:0:0:"); + + // get internal hdd recording + if (!request.PostData("/cgi-bin/getServices?ref=2:47:0:0:0:0:0:0:0:0:/var/media/movie/").Contains("E: ")) + sreturn += "2:47:0:0:0:0:0:0:0:0:/var/media/movie/;Recordings\n"; + + // replace neutrino split character with ; + sreturn = sreturn.Replace(";", " "); + sreturn = sreturn.Replace(" selected", ""); // removes enigma v1's selected tag in bouquets output + + //dboxfunc.ErrorLog("returned bouquets: " + sreturn); + // set the bouquet command for this boxtype + command = "/cgi-bin/getServices?ref="; + break; + + case "Enigma v2": + string serviceID = ""; + string serviceName = ""; + // xmlbased, return all userbouquets + XmlDocument doc = new XmlDocument(); + doc.LoadXml(request.PostData("/web/fetchchannels?ServiceListBrowse=1:7:1:0:0:0:0:0:0:0:(type == 1) FROM BOUQUET \"bouquets.tv\" ORDER BY bouquet")); + XmlNodeList nodelist = doc.GetElementsByTagName("e2service"); + + foreach (XmlNode docnode in nodelist) + { + foreach (XmlNode datanode in docnode) + { + switch (datanode.Name) + { + case "e2servicereference": + serviceID = datanode.InnerText; + break; + + case "e2servicename": + serviceName = datanode.InnerText.Replace(" (TV)", ""); + break; + } + } + sreturn += serviceID + ";" + serviceName + "\n"; // make a list of all the userbouquets + } + + command = "/web/fetchchannels?ServiceListBrowse="; + //dboxfunc.ErrorLog("returned bouquets: " + sreturn); + break; + + default: + sreturn = request.PostData(_Command + "getbouquets"); + // set the bouquet command for this boxtype + command = (_Command + "getbouquet?bouquet="); + break; + } + + string[] allBouquets = sreturn.Split('\n'); // split the list of userbouquets + + // convert to dataset + DataSet ds = new DataSet(); + DataTable table = new DataTable("BouquetsTV"); + DataRow row = null; + + try + { + table.Columns.Add("BouqNo", Type.GetType("System.String")); + table.Columns.Add("BouqName", Type.GetType("System.String")); + table.Columns.Add("Channel", Type.GetType("System.String")); + table.Columns.Add("ID", Type.GetType("System.String")); + table.Columns.Add("Name", Type.GetType("System.String")); + + int loopcount = 0; + foreach (string s in allBouquets) + { + if (s != "") + { + ////dboxfunc.ErrorLog("on top of foreach allbouquet"); + // split the bouquet id from bouquet name + // s = "0 ServiceID, 1 Name of the Bouquets" + if (_boxtype == "Enigma v2") + temp = s.Split(';')[0]; //enigma2 splitchar is ";" + else + temp = s.Split(' ')[0]; //otherboxes splitchar is " " + + //dboxfunc.ErrorLog("splitted string to temp: " + temp); + + if (_boxtype == "Neutrino") + _Command = command + temp + "&mode=TV"; //build neutrino command + else + _Command = command + temp; //build enigma command + + //dboxfunc.ErrorLog("sending command: " + _Command); + + sreturn = request.PostData(_Command); //request list of channels contained in bouquetID "temp" + sreturn = sreturn.Replace(";selected", ""); + //dboxfunc.ErrorLog("sent command and returned: " + sreturn); + + if (_boxtype == "Enigma v2") + { + string serviceID = ""; + string serviceName = ""; + XmlDocument doc = new XmlDocument(); + doc.LoadXml(sreturn); + XmlNodeList nodelist = doc.GetElementsByTagName("e2service"); + sreturn = ""; + foreach (XmlNode docnode in nodelist) + { + foreach (XmlNode datanode in docnode) + { + switch (datanode.Name) + { + case "e2servicereference": + serviceID = datanode.InnerText; + break; + case "e2servicename": + serviceName = datanode.InnerText; + break; + } + } + sreturn += serviceID + ";" + serviceName + "\n"; // make a list of all the channels + } + } + + string[] OneBouquet = sreturn.Split('\n'); + string bucket = ""; + ////dboxfunc.ErrorLog("starting onebouquet again"); + if (OneBouquet[0] != "") + { + + foreach (string bouquets in OneBouquet) + { + + //dboxfunc.ErrorLog("on top of onebouquets foreach"); + if (bouquets != "") + { + //dboxfunc.ErrorLog("string is: " + bouquets); + if ((bouquets.IndexOf(' ') > -1) || (bouquets.IndexOf(';') > -1)) + { + row = table.NewRow(); + //dboxfunc.ErrorLog("created new row"); + int start = 0; + // modifying the enigma string so it's the same as neutrino + // that way I don't need to rewrite this textfilter + // using xml for enigma 1 is a very bad solution as the xml functions do not accept bouquet ids. + // which => one webrequest for each channel in every bouquet + if (_boxtype == "Enigma v1" || _boxtype == "Enigma v2") + { + string chan_id = bouquets.Split(';')[0]; // f.ex.: 1:0:1:6D67:437:1:C00000:0:0:0: + string chan_name = bouquets.Split(';')[1]; //f.eks DISCOVERY CHANNEL + if (chan_id.StartsWith("1:0:1") || chan_id.StartsWith("1:0:0") && chan_name != "<n/a>" && chan_name != "") // if chan_id is a TV service and chan_name is NOT <n/a> or emty + bucket = Convert.ToString(++loopcount) + " " + chan_id + " " + chan_name; + + } + //dboxfunc.ErrorLog("starting string functions"); + //dboxfunc.ErrorLog("split tmp_ref: " + s + " number of chars: " + s.Length); + + if (_boxtype == "Neutrino") + bucket = bouquets; + + String tmp_Ref; + + if (_boxtype == "Enigma v2") + tmp_Ref = s.Split(';')[0]; //enigma2 splitchar is ";" + else + tmp_Ref = s.Split(' ')[0]; //otherboxes splitchar is " " + + start = tmp_Ref.Length + 1; + String tmp_Bouquet = s.Substring(start, s.Length - start); + //dboxfunc.ErrorLog("split tmp_bouq, bucket is: " + bucket); + + String tmp_Channel = bucket.Split(' ')[0]; + //dboxfunc.ErrorLog("split channel"); + String tmp_ID = bucket.Split(' ')[1]; + + if (_boxtype == "Enigma v1") + tmp_ID = tmp_ID.Replace("1:0:0:0:0:0:0:0:0:0:", _url + "/rootX"); //workaround for the inability to stream internal recordings from the enigma hdd + + //dboxfunc.ErrorLog("split ID"); + start = tmp_Channel.Length + tmp_ID.Length + 2; + String tmp_Name = bucket.Substring(start, bucket.Length - start); + //dboxfunc.ErrorLog("split name"); + tmp_Name = tmp_Name.Replace("\"", "'"); + //dboxfunc.ErrorLog("ended string functions"); + + row["BouqNo"] = tmp_Ref; + row["BouqName"] = tmp_Bouquet; + row["Channel"] = tmp_Channel; + row["ID"] = tmp_ID; + row["Name"] = @tmp_Name; + + //dboxfunc.ErrorLog("ended row functions"); + //dboxfunc.ErrorLog("added: " + tmp_Ref + "channel: " + tmp_Channel + "id: " + tmp_ID + "name: " + tmp_Name); + // test if enigma got a error on service list + //dboxfunc.ErrorLog("trying to add row" + tmp_Channel); + table.Rows.Add(row); + //dboxfunc.ErrorLog("Added row" + tmp_Channel); + + if (tmp_ID == "E:" || tmp_Name == "<n/a>") + { + // kill the row or we get error + //dboxfunc.ErrorLog("trying to remove row" + tmp_Channel); + table.Rows.Remove(row); + //dboxfunc.ErrorLog("removed row" + tmp_Channel); + } + } + } + } + } + } + + + } + ds.Tables.Add(table); + } + catch + { + + } + //dboxfunc.ErrorLog("returning bouquets dataset"); + return ds; + } + } + + } + +} Added: trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Dbox Tuner.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Dbox Tuner.csproj (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Dbox Tuner.csproj 2008-03-03 05:53:52 UTC (rev 1415) @@ -0,0 +1,95 @@ +<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>{F8CC05AA-6306-459E-BD32-40C02489EFEC}</ProjectGuid> + <OutputType>Exe</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>DboxTuner</RootNamespace> + <AssemblyName>DboxTuner</AssemblyName> + <StartupObject>DboxTuner.Program</StartupObject> + <ApplicationIcon>Icon.ico</ApplicationIcon> + </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> + <UseVSHostingProcess>false</UseVSHostingProcess> + <DocumentationFile> + </DocumentationFile> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>none</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants> + </DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <UseVSHostingProcess>false</UseVSHostingProcess> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'MyDboxSVN|AnyCPU' "> + <OutputPath>..\..\Mediaportal\xbmc\bin\Debug\plugins\Windows\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <Optimize>false</Optimize> + <DebugType>pdbonly</DebugType> + <PlatformTarget>AnyCPU</PlatformTarget> + <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies> + <ErrorReport>prompt</ErrorReport> + <DocumentationFile> + </DocumentationFile> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Web" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Data.cs" /> + <Compile Include="SetupForm.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="SetupForm.Designer.cs"> + <DependentUpon>SetupForm.cs</DependentUpon> + </Compile> + <Compile Include="DboxFunctions.cs" /> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="Request.cs" /> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="SetupForm.resx"> + <SubType>Designer</SubType> + <DependentUpon>SetupForm.cs</DependentUpon> + </EmbeddedResource> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\Common\IrssUtils\IrssUtils.csproj"> + <Project>{CA15769C-232E-4CA7-94FD-206A06CA3ABB}</Project> + <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. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Added: trunk/plugins/IR Server Suite/Applications/Dbox Tuner/DboxFunctions.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Dbox Tuner/DboxFunctions.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Dbox Tuner/DboxFunctions.cs 2008-03-03 05:53:52 UTC (rev 1415) @@ -0,0 +1,233 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.Collections.Generic; +using System.Text; +using System.Xml; +using System.IO; + +namespace DboxTuner +{ + + class DboxFunctions + { + + #region Variables + + string _url; + string _userName; + string _password; + string _command = "/control/"; + string _boxType; + + #endregion Variables + + #region Constructor + + public DboxFunctions(string url, string username, string password, string boxtype) + { + _url = "http://" + url; + _userName = username; + _password = password; + _boxType = boxtype; + } + + #endregion Constructor + + public string GetID() + { + //ErrorLog("entered getid with " +_Url + " "+_UserName+" "+_Password+" "+_Boxtype); + Request request = new Request(_url, _userName, _password); + XmlDocument doc = new XmlDocument(); + XmlNode elem = doc.DocumentElement; + + string s = ""; + //get actual channel (ID) + + switch (_boxType) + { + case "Enigma v1": + doc.LoadXml(request.PostData("/xml/streaminfo")); + elem = doc.SelectSingleNode("/streaminfo/service/reference"); + s = elem.InnerText; + break; + + case "Enigma v2": + doc.LoadXml(request.PostData("/web/subservices")); + elem = doc.SelectSingleNode("/e2servicelist/e2service/e2servicereference"); + s = elem.InnerText; + break; + + default: + s = request.PostData(_command + "zapto"); + s = s.Replace("\n", ""); + //ErrorLog("get channel "+s+" for "+_Boxtype); + break; + } + + return s; + } + public string ZapTo(string ID) + { + Request request = new Request(_url, _userName, _password); + string s = ""; + //zap to channel (ID) + switch (_boxType) + { + case "Enigma v1": + s = request.PostData("/cgi-bin/zapTo?path=" + ID); + return s; + case "Enigma v2": + s = request.PostData("/web/zap?ZapTo=" + ID); + return s; + default: + s = request.PostData(_command + "zapto?" + ID); + return s; + } + } + public void WakeUp() + { + Request request = new Request(_url, _userName, _password); + switch (_boxType) + { + case "Enigma v1": + request.PostData("/cgi-bin/admin?command=wakeup"); + break; + case "Enigma v2": // donno if wakeup is correct command + request.PostData("/web/powerstate?newstate=wakeup"); + break; + case "Neutrino": // off = wakeup + request.PostData("/control/standby?off"); + break; + } + + } + public string SetSPTS() + { + Request request = new Request(_url, _userName, _password); + string s = ""; + //set playback to spts only required for neutrino, (i think) + // return ok for enigma + if (_boxType != "Neutrino") + s = "ok"; + else //send neutrino command + s = request.PostData(_command + "system?setAViAExtPlayBack=spts"); + return s; + } + public string ToggleMute() + { + Request request = new Request(_url, _userName, _password); + string s = ""; + // get status + switch (_boxType) + { + case "Enigma v1": + s = request.PostData("/cgi-bin/audio?mute=0"); + return s; + case "Enigma v2": + s = request.PostData("/web/vol?set=mute"); + return s; + default: + s = request.PostData(_command + "volume?status"); + if (s == "0") + s = request.PostData(_command + "volume?mute"); + if (s == "1") + s = request.PostData(_command + "volume?unmute"); + + return s; + } + + } + public string GetEpgXml(string ID) + { + Request request = new Request(_url, _userName, _password); + string s = ""; + // get epg from box (xml formatted) + switch (_boxType) + { + case "Enigma v1": + s = request.PostData("/xml/serviceepg?ref=" + ID); + break; + case "Enigma v2": + s = request.PostData("/web/epgservice?ref=" + ID); + break; + default: + s = request.PostData(_command + "epg?xml=true&channelid=" + ID + "&details=true"); // &max=20 + break; + } + s = s.Replace("&", "&"); + return s; + + } + public void ShowMessage(string message) + { + Request request = new Request(_url, _userName, _password); + + switch (_boxType) + { + case "Enigma v1": + request.PostData("/cgi-bin/xmessage?timeout=10&caption=Message&body=" + message); + break; + + case "Enigma v2": + request.PostData("/web/message?type=1&timeout=10&text=" + message); + break; + + default: + request.PostData(_command + "message?popup=" + message); + break; + } + } + public string GetInfo() + { + Request request = new Request(_url, _userName, _password); + string s = String.Empty; + + switch (_boxType) + { + case "Enigma v1": + s = request.PostData("/xml/boxinfo"); + s = s.Replace("\n", " "); + s = s.Replace(" ", ""); + break; + + case "Enigma v2": + s = request.PostData("/web/about"); + s = s.Replace("\n", " "); + break; + + default: + s = request.PostData(_command + "info?version"); + s = s.Replace("\n", " "); + break; + } + + return s; + } + + } + +} Added: trunk/plugins/IR Server Suite/Applications/Dbox Tuner/GuiDbox.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Dbox Tuner/GuiDbox.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Dbox Tuner/GuiDbox.cs 2008-03-03 05:53:52 UTC (rev 1415) @@ -0,0 +1,181 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.ComponentModel; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.Text; +using System.Text.RegularExpressions; +using MediaPortal.GUI.Library; +using MediaPortal.Player; +using MediaPortal.Dialogs; +using MediaPortal.Configuration; +using MediaPortal.Playlists; +using System.Xml; +using System.IO; +using System.Data; +using MediaPortal.Util; + +namespace MediaPortal.GUI.Mydbox +{ + public class DboxGui : GUIWindow + { + public const int WindowID = 9900; + + #region Constructor + public DboxGui() + { + GetID = (int)MyDboxGui.WindowID; + } + #endregion + + #region SkinControlAttributes + [SkinControlAttribute(50)] + protected GUIFacadeControl facadeview = null; + [SkinControlAttribute(2)] + protected GUIButtonControl btnFavoriet = null; + [SkinControlAttribute(3)] + protected GUIButtonControl btnRadio = null; + [SkinControlAttribute(4)] + protected GUIButtonControl btnRecordings = null; + #endregion + + #region Variables + //private DBox.Core _Dreambox = null; + //PlayListPlayer playlistPlayer; + + // bools + //private bool _ShowChannels = false; + + private static string server; + private static string username; + private static string password; + + private string _Url = ""; + private string _UserName = ""; + private string _Password = ""; + + private static DataTable _TV_Bouquets = null; + //private static DataTable _Radio_Bouquets = null; + + #endregion + + #region Overrides + public override bool Init() + { + //playlistPlayer = PlayListPlayer.SingletonPlayer; + LoadSettings(); + + return Load(GUIGraphicsContext.Skin + @"\mydbox.xml"); + } + + #endregion + + #region Private Methods + void LoadSettings() + { + string path = Path.Combine(Config.GetFolder(Config.Dir.Config), "MediaPortal.xml"); + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(path)) + //using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + server = xmlreader.GetValue("mydbox", "IP"); + username = xmlreader.GetValue("mydbox", "UserName"); + password = xmlreader.GetValue("mydbox", "Password"); + } + + ShowBoutiques(); + + } + + void ShowBoutiques() + { + _Url = "http://" + server ; + _UserName = ""; + _Password = ""; + + //_ShowChannels = false; + facadeview.Clear(); + + //get bouquets + Data _DBox = new Data(_Url, _UserName, _Password); + _TV_Bouquets = _DBox.UserTVBouquets.Tables[0]; + + foreach (DataRow row in _TV_Bouquets.Rows) + { + GUIListItem li = new GUIListItem(); + li.Label = row["Name"].ToString(); + facadeview.Add(li); + } + } + void ShowChannels(GUIListItem guiListItem) + { + _Url = "http://192.168.0.100/"; + _UserName = ""; + _Password = ""; + + //_ShowChannels = true; + facadeview.Clear(); + Data _DBox = new Data(_Url, _UserName, _Password); + string reference = GetChannelReference(guiListItem); + //DataTable dt = _DBox.Channels(reference).Tables[0]; + //foreach (DataRow row in dt.Rows) + { + // GUIListItem li = new GUIListItem(); + // li.Label = row["Name"].ToString(); + // facadeview.Add(li); + } + try + { + //string currentChannelName = _Dbox.CurrentChannel.Name; + //GUIPropertyManager.SetProperty("#Play.Current.File", currentChannelName); + //GUIPropertyManager.SetProperty("#Play.Current.Title", currentChannelName); + } + catch (Exception) { } + } + string GetChannelReference(GUIListItem guiListItem) + { + string reference = ""; + Data _DBox = new Data(_Url, _UserName, _Password); + DataTable dt = _DBox.UserTVBouquets.Tables[0]; + foreach (DataRow row in dt.Rows) + { + if (guiListItem.Label == row["Name"].ToString()) + { + reference = row["Ref"].ToString(); + break; + } + } + return reference; + } + #endregion + + + } + + + + +} \ No newline at end of file Added: trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Icon.ico =================================================================== (Binary files differ) Property changes on: trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Icon.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/IR Server Suite/Applications/Dbox Tuner/MyDboxGui.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Dbox Tuner/MyDboxGui.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Dbox Tuner/MyDboxGui.cs 2008-03-03 05:53:52 UTC (rev 1415) @@ -0,0 +1,1677 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.ComponentModel; +using System.Collections; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.Diagnostics; +using System.Text; +using System.Text.RegularExpressions; +using MediaPortal.GUI.Library; +using MediaPortal.Player; +using MediaPortal.Dialogs; +using MediaPortal.Playlists; +using MediaPortal.Localisation; +using System.Xml; +using System.IO; +using System.Data; +using System.Drawing; +using MediaPortal.Util; +using AXVLC; +using System.Net; + +namespace DboxTuner +{ + public class MyDboxGui : GUIWindow + { + #region SkinControlAttributes + [SkinControlAttribute(2)] + protected GUIButtonControl btnTVGuide = null; + [SkinControlAttribute(3)] + protected GUIToggleButtonControl btnRecord = null; + [SkinControlAttribute(4)] + protected GUIButtonControl btnSnap = null; + [SkinControlAttribute(6)] + protected GUIButtonControl btnBouquet = null; + [SkinControlAttribute(7)] + protected GUIButtonControl btnChannel = null; + [SkinControlAttribute(8)] + protected GUIToggleButtonControl btnTVOnOff = null; + [SkinControlAttribute(9)] + protected GUIToggleButtonControl btnShiftOnOff = null; + [SkinControlAttribute(11)] + protected GUIButtonControl btnRecordings = null; + [SkinControlAttribute(13)] + protected GUIButtonControl btnWhatsThis = null; + [SkinControlAttribute(24)] + protected GUIImage imgRecord; + [SkinControlAttribute(99)] + protected GUIVideoControl videoWindow = null; + #endregion + + #region Private Variables + + private static string server; + private static string username; + private static string password; + public static string boxtype; + + private static string AutoOn; + private static bool BoxConn = false; + + private static DateTime startRecord; + + DataRow row = null; + DataTable _TV_Bouquets = new DataTable("BouquetsTV"); + + private static int ActBouquetNo; + private static string ActBouquet; + public static string ActChannel; + + private static VirtualDirectory recDirectory = new VirtualDirectory(); + private static string RecDir = String.Empty; + private static string SnapDir = String.Empty; + + private string LogPathName = Configuration.Config.GetFolder(MediaPortal.Configuration.Config.Dir.Config) + @"\log\MyDbox.log"; + + private static OnActionHandler ah; + + public static VideoLanControl vlcControl = null; + // osd for channel + public static MyOSD osd; + public int t_OSD = 0; + // select direct the channel + public static MySelect sel; + public int t_Sel = 0; + public string SelStr = "...."; + // info screen + public static MyOSD_Info info; + public int t_Info = 0; + // info screen + public static MyOSD_Chan chan; + public int t_Chan = 0; + public ArrayList SelChan; + public int MaxBouq; + // global functions dbox (faster) + static DboxFunctions func; + + public AxAXVLC.AxVLCPlugin Control + { + get + { + return vlcControl.Player; + } + } + + string _currentGroup = String.Empty; + string _currentChannel = String.Empty; + + bool _started; + bool _paused; + bool _isFullScreen; + bool _wasFullscreen; // true if we are in fullscreen and ACTION_PREVIOUS_MENU is sent to action handler + + + int _cnt_Ply = 0; + bool _Ply_VLC = false; + + int _positionX = 10, _positionY = 10, _videoWidth = 100, _videoHeight = 100; + int _PreviousWindowID = 0; + + // ticker for updates + private System.Windows.Forms.Timer _Update = new System.Windows.Forms.Timer(); + private System.Windows.Forms.Timer _OSDTimer = new System.Windows.Forms.Timer(); + + //thread for EPG updates + System.Threading.Thread EPG_Thread; + + static cGlobal cGlobal; + + #endregion + + #region Private Enumerations + enum Controls + { + BouquetButton = 6, + ChannelButton = 7, + TVButton = 3, + TVOnOff = 8, + RecordingsButton = 11, + RadioButton = 12, + DirectButton = 13, + List = 50 + } + #endregion + + public override int GetID + { + get + { + return 75642203; + } + set + { + base.GetID = value; + } + } + + public override bool Init() + { + bool result = Load(GUIGraphicsContext.Skin + @"\mydboxmain.xml"); + Mydbox.GUILocalizeStrings.Load(GUI.Library.GUILocalizeStrings.CurrentLanguage()); + + LoadSettings(); + + Data dboxdata = new Data(server, username, password, boxtype); + dboxdata.loadEPGdata(); //load epg data from file + + if (File.Exists(LogPathName)) File.Delete(LogPathName); + ErrorLog("Init plugin"); + + SelChan = new ArrayList(); + + // get bouquets + ParseXML(); + ErrorLog("XML parsed " + _TV_Bouquets.Rows.Count); + + recDirectory.AddExtension(".dat"); + recDirectory.ShowFilesWithoutExtension = false; + + Share share2 = new Share(); + share2.Name = "Recordings"; + share2.Path = RecDir; + recDirectory.IsRootShare(RecDir); + + if (ah == null) ah = new OnActionHandler(OnAction2); + + #region get some data from box + try + { + // get actual ID + func = new DboxFunctions(server, username, password, boxtype); + func.wakeup(); + cGlobal.currentID = func.getID(); + if (cGlobal.currentID != "") + { + ErrorLog("Actual ID " + cGlobal.currentID); + func.setSPTS(); + ErrorLog("SetSPTS has been set"); + ErrorLog("Version=> " + func.getInfo()); + func.showMessage("Mediaportal%20connected"); + // looks box is working + BoxConn = true; + } + else + { + ErrorLog("Receiver is not reachable ?"); + } + } + + catch + { + ErrorLog("Receiver is not reachable ?"); + } + + // get group/channel + ActBouquetNo = 1; + for (int i = 0; i < _TV_Bouquets.Rows.Count; i++) + { + if (_TV_Bouquets.Rows[i]["ID"].ToString() == cGlobal.currentID) + { + ActBouquetNo = Convert.ToInt16(_TV_Bouquets.Rows[i]["BouqNo"].ToString()); + + ActBouquet = _TV_Bouquets.Rows[i]["BouqName"].ToString(); + ActChannel = _TV_Bouquets.Rows[i]["Name"].ToString(); + + ErrorLog("Actual group " + ActBouquet + " actual channel " + ActChannel); + } + } + + #endregion + + return result; + } + + #region Actions + + public void OnAction2(Action action) + { + Debug.WriteLine("Action2:" + action.wID.ToString()); + + if (GUIWindowManager.ActiveWindowEx == (int)GUIWindow.Window.WINDOW_DIALOG_MENU) return; + //bool actionTaken = true; + + //Debug.WriteLine(action.wID.ToString()); + + object key; + switch (action.wID) + { + case Action.ActionType.ACTION_EXIT: + { // prepare for exit + OnPageDestroy(0); + break; + } + case Action.ActionType.ACTION_PREVIOUS_MENU: + { + if (_isFullScreen) + { + if (t_Chan > 0) t_Chan = 0; // channel osd is up, kill it + else if (t_OSD > 0) t_OSD = 0; // epg is up, kill it + else if (t_Info > 0) + { + t_Info = 0; + t_OSD = 2; // info is up, go back to epg + } + else // no osd is up, exit fullscreen + { + _isFullScreen = false; + _wasFullscreen = true; + SetWindows(); + } + } + break; + } + case Action.ActionType.ACTION_MOVE_LEFT: + if ((_isFullScreen == true) && (cGlobal.VLC_Live == true)) + { + if (t_Chan > 0) + { // only if already visible + ActBouquetNo--; + } + + if (ActBouquetNo == 0) + ActBouquetNo = MaxBouq; + + t_Chan = 10; + t_OSD = 0; + chan.DisplayBouq(ActBouquetNo.ToString(), "0"); + } + break; + case Action.ActionType.ACTION_MOVE_RIGHT: + if ((_isFullScreen == true) && (cGlobal.VLC_Live == true)) + { + if (t_Chan > 0) + { // only if already visible + ActBouquetNo++; + } + if (ActBouquetNo > MaxBouq) + ActBouquetNo = 1; + + t_Chan = 10; + t_OSD = 0; + chan.DisplayBouq(ActBouquetNo.ToString(), "-1"); + } + break; + case Action.ActionType.ACTION_MOVE_DOWN: + case Action.ActionType.ACTION_MOVE_UP: + if ((_isFullScreen == true) && (cGlobal.VLC_Live == true)) + { + t_Chan = 10; + t_OSD = 0; + } + break; + case Action.ActionType.ACTION_VOLUME_MUTE: + DboxFunctions func = new DboxFunctions(server, username, password, boxtype); + func.toggleMute(); + break; + case Action.ActionType.ACTION_FORWARD: + case Action.ActionType.ACTION_MUSIC_FORWARD: + key = vlcControl.Player.getVariable("key-faster"); + vlcControl.Player.setVariable("key-pressed", key); + break; + case Action.ActionType.ACTION_MUSIC_REWIND: + case Action.ActionType.ACTION_REWIND: + key = vlcControl.Player.getVariable("key-slower"); + vlcControl.Player.setVariable("key-pressed", key); + break; + case Action.ActionType.ACTION_PREV_CHANNEL: + OnPreviousChannel(); + PlayCurrentChannel(); + break; + case Action.ActionType.ACTION_PAGE_DOWN: + OnPreviousChannel(); + PlayCurrentChannel(); + break; + case Action.ActionType.ACTION_NEXT_CHANNEL: + OnNextChannel(); + PlayCurrentChannel(); + break; + case Action.ActionType.ACTION_PAGE_UP: + OnNextChannel(); + PlayCurrentChannel(); + break; + case Action.ActionType.ACTION_PLAY: + case Action.ActionType.ACTION_MUSIC_PLAY: + PlayCurrentChannel(); + break; + case Action.ActionType.ACTION_STOP: + StopPlaying(); + btnTVOnOff.Selected = false; + break; + case Action.ActionType.ACTION_PAUSE: + if (_started) + { + if (!vlcControl.Player.Playing) + { + _paused = false; + vlcControl.Player.play(); + } + else + { + _paused = true; + vlcControl.Player.pause(); + } + } + break; + case (Action.ActionType.ACTION_RECORD): + if (btnRecord.Selected) + { + btnRecord.Selected = false; + imgRecord.Visible = false; + } + else + { + btnRecord.Selected = true; + imgRecord.Visible = true; + OnRecord(); + } + break; + case (Action.ActionType.ACTION_SHOW_FULLSCREEN): + SetWindows(); + break; + case (Action.ActionType.ACTION_SHOW_GUI): + if (_isFullScreen == false) + { + //vlcControl.Player.fullscreen(); + _isFullScreen = true; + SetWindows(); + } + else + { + if (chan.Visible == false) + { + //vlcControl.Player.fullscreen(); + _isFullScreen = false; + SetWindows(); + } + else + { + + } + } + break; + case Action.ActionType.ACTION_SELECT_ITEM: + string t = chan.GetChannel(ActBouquet); + if ((t != "") && (_isFullScreen == true)) + { + if (t_Chan > 0) + { + t_Chan = 0; + ChangeChannel(t); + PlayCurrentChannel(); + } + } + break; + case (Action.ActionType.ACTION_CONTEXT_MENU): + if (t_OSD > 0) + { + if (cGlobal.VLC_Live == true) + { + t_OSD = 0; + t_Info = 10; + } + else + t_OSD = 0; + } + else + { + t_OSD = 10; + t_Info = 0; + t_Chan = 0; + } + break; + case Action.ActionType.ACTION_KEY_PRESSED: + if (cGlobal.VLC_Live == true) + { + switch (action.m_key.KeyChar) + { + case '1': + t_Sel = 2; + t_Info = 0; + SelStr = SelStr + "1"; + SelStr = callSelect(SelStr); + break; + case '2': + t_Sel = 2; + t_Info = 0; + SelStr = SelStr + "2"; + SelStr = callSelect(SelStr); + break; + case '3': + t_Sel = 2; + t_Info = 0; + SelStr = SelStr + "3"; + SelStr = callSelect(SelStr); + break; + case '4': + t_Sel = 2; + t_Info = 0; + SelStr = SelStr + "4"; + SelStr = callSelect(SelStr); + break; + case '5': + t_Sel = 2; + t_Info = 0; + SelStr = SelStr + "5"; + SelStr = callSelect(SelStr); + break; + case '6': + t_Sel = 2; + t_Info = 0; + SelStr = SelStr + "6"; + SelStr = callSelect(SelStr); + break; + case '7': + t_Sel = 2; + t_Info = 0; + SelStr = SelStr + "7"; + SelStr = callSelect(SelStr); + break; + case '8': + t_Sel = 2; + t_Info = 0; + SelStr = SelStr + "8"; + SelStr = callSelect(SelStr); + break; + case '9': + t_Sel = 2; + t_Info = 0; + SelStr = SelStr + "9"; + SelStr = callSelect(SelStr); + break; + case '0': + t_Sel = 2; + t_Info = 0; + SelStr = SelStr + "0"; + SelStr = callSelect(SelStr); + break; + case '#': + if ((SelStr != "....") & (SelStr != "") & (SelStr.Length > 0) & (t_Sel > 0)) + { + int x = Convert.ToInt16(SelStr) - 1; + try + { + t_Sel = 0; + ChangeChannel(_TV_Bouquets.Rows[x]["ID"].ToString()); + PlayCurrentChannel(); + } + catch + { + } + } + break; + } + } + break; + case (Action.ActionType.ACTION_ASPECT_RATIO): + if ((SelStr != "....") & (SelStr != "") & (SelStr.Length > 0) & (t_Sel > 0)) + { + int x = Convert.ToInt16(SelStr) - 1; + try + { + t_Sel = 0; + ChangeChannel(_TV_Bouquets.Rows[x]["ID"].ToString()); + PlayCurrentChannel(); + } + catch + { + } + } + break; + + default: + //actionTaken = false; + break; + } + } + + private string callSelect(string selNo) + { + selNo = selNo.Replace(".", ""); + if (selNo.Length > 4) + { + selNo = selNo.Substring(4, selNo.Length - 4); + } + + string ch = ""; + int x = Convert.ToInt32(selNo); + if (x > 0) + { + x = x - 1; + // valid no ?? + if (x <= _TV_Bouquets.Rows.Count) + { + ch = _TV_Bouquets.Rows[x]["Name"].ToString(); + } + else + { + ch = ""; + } + } + sel.SetSelction(selNo, ch); + + return selNo; + } + + public override void OnAction(Action action) + { + if (_isFullScreen || _wasFullscreen) + { // disable "right click"/previous menu when in fullscreen + if (action.wID == Action.ActionType.ACTION_PREVIOUS_MENU) + { + action = new Action(Action.ActionType.ACTION_SHOW_GUI, 0, 0); + _wasFullscreen = false; + } + base.OnAction(action); + } + else + { // if windowed still the same + base.OnAction(action); + } + } + + #endregion + + #region overrides + + public override bool OnMessage(GUIMessage message) + { + return base.OnMessage(message); + } + + protected override void OnPageLoad() + { + base.OnPageLoad(); + + ErrorLog("Load plugin"); + + // set actions + //GUIGraphicsContext.OnNewAction -= ah; + GUIGraphicsContext.OnNewAction += ah; + + // disable exclusive mode + Log.Info("DBox2 plugin: Disabling DX9 exclusive mode"); + GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_SWITCH_FULL_WINDOWED, 0, 0, 0, 0, 0, null); + GUIWindowManager.SendMessage(msg); + + // init record fields + GUIPropertyManager.SetProperty("#Dbox.Record.channel", " "); + GUIPropertyManager.SetProperty("#Dbox.Record.title", " "); + GUIPropertyManager.SetProperty("#Dbox.Record.start", " "); + GUIPropertyManager.SetProperty("#Dbox.Record.stop", " "); + + + #region set timer + // start update ticker + _Update.Interval = 2000; + _Update.Tick += new EventHandler(_Update_Tick); + _Update.Start(); + // start OSD ticker + _OSDTimer.Interval = 1000; + _OSDTimer.Tick += new EventHandler(_OSDTimer_Tick); + _OSDTimer.Start(); + #endregion + + //set video window position + if (videoWindow != null) + { + GUIGraphicsContext.VideoWindow = new Rectangle(videoWindow.XPosition, videoWindow.YPosition, videoWindow.Width, videoWindow.Height); + } + + // TV is off + btnTVOnOff.Selected = false; + + #region init vlc + // close last instance + if (vlcControl != null) + vlcControl = null; + + // SaveDir exits ? + if (!Directory.Exists(RecDir)) Directory.CreateDirectory(RecDir); + if (!Directory.Exists(SnapDir)) Directory.CreateDirectory(SnapDir); + + // new instance + vlcControl = new VideoLanControl(); + vlcControl = VideoLanControl.Instance; + // control is now visible + vlcControl.Visible = false; + vlcControl.Enabled = false; + // add control to GUI + GUIGraphicsContext.form.Controls.Add(vlcControl); + // set focus + GUIGraphicsContext.form.Focus(); + #endregion + + #region init osd + // prepare osd + if (osd == null) + { + osd = new MyOSD(); + osd.Visible = false; + GUIGraphicsContext.form.Controls.Add(osd); + GUIGraphicsContext.form.Focus(); + } + // prepare select + if (sel == null) + { + sel = new MySelect(); + sel.Visible = false; + GUIGraphicsContext.form.Controls.Add(sel); + GUIGraphicsContext.form.Focus(); + } + if (info == null) + { + info = new MyOSD_Info(); + info.Visible = false; + GUIGraphicsContext.form.Controls.Add(info); + GUIGraphicsContext.form.Focus(); + } + if (chan == null) + { + chan = new MyOSD_Chan(_TV_Bouquets); + chan.Visible = false; + GUIGraphicsContext.form.Controls.Add(chan); + GUIGraphicsContext.form.Focus(); + } + #endregion + + // init channel display + chan.DisplayBouq(ActBouquetNo.ToString(), "1"); + + // set windows + SetWindows(); + + //Disable program & timeshift for now + GUIControl.DisableControl(GetID, 2); + GUIControl.DisableControl(GetID, 9); + //focus on/off + GUIControl.FocusControl(GetID, 8); + + // set localized labels for static controls + GUIPropertyManager.SetProperty("#header_label", Mydbox.GUILocalizeStrings.Get(0)); // MyDreamDboxTV + GUIControl.SetControlLabel(GetID, btnTVGuide.GetID, Mydbox.GUILocalizeStrings.Get(600)); // Program + GUIControl.SetControlLabel(GetID, btnRecord.GetID, Mydbox.GUILocalizeStrings.Get(601)); // Record + GUIControl.SetControlLabel(GetID, btnSnap.GetID, Mydbox.GUILocalizeStrings.Get(602)); // Snapshot + GUIControl.SetControlLabel(GetID, btnBouquet.GetID, Mydbox.GUILocalizeStrings.Get(603)); // Group + GUIControl.SetControlLabel(GetID, btnChannel.GetID, Mydbox.GUILocalizeStrings.Get(604)); // Channel + GUIControl.SetControlLabel(GetID, btnTVOnOff.GetID, Mydbox.GUILocalizeStrings.Get(605)); //On/Off + GUIControl.SetControlLabel(GetID, btnShiftOnOff.GetID, Mydbox.GUILocalizeStrings.Get(606)); // Shift + GUIControl.SetControlLabel(GetID, btnRecordings.GetID, Mydbox.GUILocalizeStrings.Get(607)); // Recordings + GUIControl.SetControlLabel(GetID, btnWhatsThis.GetID, Mydbox.GUILocalizeStrings.Get(608)); // Whats .. + + if (AutoOn == "yes") + { + _isFullScreen = true; + SetWindows(); + btnTVOnOff.Selected = true; + AutoOn = "no"; + PlayCurrentChannel(); + } + + EPG_Thread = new System.Threading.Thread(new System.Threading.ThreadStart(EPG_Refresh)); + EPG_Thread.Start(); + System.Threading.Thread.Sleep(0); + + } + + protected override void OnPageDestroy(int new_windowId) + { + _Update.Stop(); + _Update.Tick -= new EventHandler(_Update_Tick); + + _OSDTimer.Stop(); + _OSDTimer.Tick -= new EventHandler(_Update_Tick); + + EPG_Thread.Interrupt(); + EPG_Thread.Abort(); + + Data dboxdata = new Data(server, username, password, boxtype); + dboxdata.saveEPGdata(); + + if (_started) + StopPlaying(); + + ErrorLog("Unload plugin"); + + if (new_windowId != (int)GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO) GUIGraphicsContext.OnNewAction -= ah; + base.OnPageDestroy(35); //(new_windowId); + } + + protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType) + { + if (!_isFullScreen) + { + if (control == btnRecord) + { + OnRecord(); + } + if (control == btnSnap) + { + object key = vlcControl.Player.getVariable("key-snapshot"); + vlcControl.Player.setVariable("key-pressed", key); + } + if (control == btnBouquet) + showBouquet(); + if (control == btnChannel) + showChannel(); + if (control == btnTVOnOff) + switchOnOff(); + if (control == btnWhatsThis) + OnBtnWhatsThis(); + if (control == btnShiftOnOff) + { + } + if (control == btnRecordings) + { + t_OSD = 0; + osd.Visible = false; + t_Sel = 0; + sel.Visible = false; + + if (_started) + StopVLC(); + + // Play recording + cGlobal.VLC_Live = false; + //display tv on + btnTVOnOff.Selected = false; + + //activate Recordings Screen + GUIWindowManager.ActivateWindow(75642204); + + } + } + base.OnClicked(controlId, control, actionType); + } + + protected override void OnShowContextMenu() + { + base.OnShowContextMenu(); + } + + #endregion overrides + + private void showBouquet() + { + //show list with bouquets + GUIDialogMenuBottomRight menu = (GUIDialogMenuBottomRight)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU_BOTTOM_RIGHT); + menu.Reset(); + menu.SetHeading(GUILocalizeStrings.Get(971) + ": "); + + int act = 0; + String actRef = ""; + + for (int i = 0; i < _TV_Bouquets.Rows.Count; i++) + { + actRef = _TV_Bouquets.Rows[i]["BouqNo"].ToString(); + if (act != Convert.ToInt16(actRef)) + { + menu.Add(_TV_Bouquets.Rows[i]["BouqName"].ToString()); + act = Convert.ToInt16(actRef); + } + } + menu.DoModal(GetID); + string bouquetName = menu.SelectedLabelText; + if (bouquetName != "") + { + for (int i = 0; i < _TV_Bouquets.Rows.Count; i++) + { + if (_TV_Bouquets.Rows[i]["BouqName"].ToString() == bouquetName) + { + ActBouquetNo = Convert.ToInt16(_TV_Bouquets.Rows[i]["BouqNo"].ToString()); + ActBouquet = _TV_Bouquets.Rows[i]["BouqName"].ToString(); + break; + } + } + } + + } + + private void showChannel() + { + //show list with bouquets + GUIDialogMenuBottomRight menu = (GUIDialogMenuBottomRight)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU_BOTTOM_RIGHT); + menu.Reset(); + menu.SetHeading(GUILocalizeStrings.Get(972) + ": "); + + String actRef = ""; + + for (int i = 0; i < _TV_B... [truncated message content] |
From: <an...@us...> - 2008-03-03 17:13:46
|
Revision: 1417 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1417&view=rev Author: and-81 Date: 2008-03-03 09:13:43 -0800 (Mon, 03 Mar 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Dbox Tuner.csproj 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/Dbox Tuner/SetupForm.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote (Smartphone2003) Installer/Virtual Remote (Smartphone2003) Installer.vddproj trunk/plugins/IR Server Suite/Applications/Virtual Remote (WinCE5) Installer/Virtual Remote (WinCE5) Installer.vddproj trunk/plugins/IR Server Suite/Documentation/Virtual Remote/index.html trunk/plugins/IR Server Suite/Documentation/new.html 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/DirectInputReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507 Receiver.csproj trunk/plugins/IR Server Suite/IR Server Suite - Debug.nsi trunk/plugins/IR Server Suite/IR Server Suite - Release.nsi Added Paths: ----------- trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/Configure.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/Configure.resx trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/RawInput.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/ReceiverWindow.cs Removed Paths: ------------- trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Data.cs trunk/plugins/IR Server Suite/Applications/Dbox Tuner/DboxFunctions.cs trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Request.cs Deleted: trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Data.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Data.cs 2008-03-03 06:55:09 UTC (rev 1416) +++ trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Data.cs 2008-03-03 17:13:43 UTC (rev 1417) @@ -1,267 +0,0 @@ -#region Copyright (C) 2005-2007 Team MediaPortal - -/* - * Copyright (C) 2005-2007 Team MediaPortal - * http://www.team-mediaportal.com - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#endregion - -using System; -using System.Collections.Generic; -using System.Text; -using System.Data; -using System.IO; -using System.Xml; -using System.Text.RegularExpressions; - -namespace DboxTuner -{ - - public class Data - { - - string _url; - string _userName; - string _password; - - public static string _boxtype = String.Empty; - - private string _Command = "/control/"; - - public Data(string url, string username, string password, string boxtype) - { - _url = url; - _userName = username; - _password = password; - _boxtype = boxtype; - } - - - public DataSet UserTVBouquets - { - get - { - string command = ""; - string temp = ""; - string sreturn = ""; - Request request = new Request(_url, _userName, _password); - - switch (_boxtype) - { - case "Enigma v1": - // get userbouquets (ref=4097:7:0:6:0:0:0:0:0:0:) - sreturn = request.PostData("/cgi-bin/getServices?ref=4097:7:0:6:0:0:0:0:0:0:"); - - // get internal hdd recording - if (!request.PostData("/cgi-bin/getServices?ref=2:47:0:0:0:0:0:0:0:0:/var/media/movie/").Contains("E: ")) - sreturn += "2:47:0:0:0:0:0:0:0:0:/var/media/movie/;Recordings\n"; - - // replace neutrino split character with ; - sreturn = sreturn.Replace(";", " "); - sreturn = sreturn.Replace(" selected", ""); // removes enigma v1's selected tag in bouquets output - - // set the bouquet command for this boxtype - command = "/cgi-bin/getServices?ref="; - break; - - case "Enigma v2": - string serviceID = ""; - string serviceName = ""; - // xmlbased, return all userbouquets - XmlDocument doc = new XmlDocument(); - doc.LoadXml(request.PostData("/web/fetchchannels?ServiceListBrowse=1:7:1:0:0:0:0:0:0:0:(type == 1) FROM BOUQUET \"bouquets.tv\" ORDER BY bouquet")); - XmlNodeList nodelist = doc.GetElementsByTagName("e2service"); - - foreach (XmlNode docnode in nodelist) - { - foreach (XmlNode datanode in docnode) - { - switch (datanode.Name) - { - case "e2servicereference": - serviceID = datanode.InnerText; - break; - - case "e2servicename": - serviceName = datanode.InnerText.Replace(" (TV)", ""); - break; - } - } - sreturn += serviceID + ";" + serviceName + "\n"; // make a list of all the userbouquets - } - - command = "/web/fetchchannels?ServiceListBrowse="; - break; - - default: - sreturn = request.PostData(_Command + "getbouquets"); - // set the bouquet command for this boxtype - command = (_Command + "getbouquet?bouquet="); - break; - } - - string[] allBouquets = sreturn.Split('\n'); // split the list of userbouquets - - // convert to dataset - DataSet ds = new DataSet(); - DataTable table = new DataTable("BouquetsTV"); - DataRow row = null; - - try - { - table.Columns.Add("BouqNo", Type.GetType("System.String")); - table.Columns.Add("BouqName", Type.GetType("System.String")); - table.Columns.Add("Channel", Type.GetType("System.String")); - table.Columns.Add("ID", Type.GetType("System.String")); - table.Columns.Add("Name", Type.GetType("System.String")); - - int loopcount = 0; - foreach (string s in allBouquets) - { - if (s != "") - { - ////dboxfunc.ErrorLog("on top of foreach allbouquet"); - // split the bouquet id from bouquet name - // s = "0 ServiceID, 1 Name of the Bouquets" - if (_boxtype == "Enigma v2") - temp = s.Split(';')[0]; //enigma2 splitchar is ";" - else - temp = s.Split(' ')[0]; //otherboxes splitchar is " " - - if (_boxtype == "Neutrino") - _Command = command + temp + "&mode=TV"; //build neutrino command - else - _Command = command + temp; //build enigma command - - sreturn = request.PostData(_Command); //request list of channels contained in bouquetID "temp" - sreturn = sreturn.Replace(";selected", ""); - - if (_boxtype == "Enigma v2") - { - string serviceID = ""; - string serviceName = ""; - XmlDocument doc = new XmlDocument(); - doc.LoadXml(sreturn); - XmlNodeList nodelist = doc.GetElementsByTagName("e2service"); - sreturn = ""; - foreach (XmlNode docnode in nodelist) - { - foreach (XmlNode datanode in docnode) - { - switch (datanode.Name) - { - case "e2servicereference": - serviceID = datanode.InnerText; - break; - case "e2servicename": - serviceName = datanode.InnerText; - break; - } - } - sreturn += serviceID + ";" + serviceName + "\n"; // make a list of all the channels - } - } - - string[] OneBouquet = sreturn.Split('\n'); - string bucket = ""; - - if (OneBouquet[0] != "") - { - foreach (string bouquets in OneBouquet) - { - if (bouquets != "") - { - if ((bouquets.IndexOf(' ') > -1) || (bouquets.IndexOf(';') > -1)) - { - row = table.NewRow(); - - int start = 0; - // modifying the enigma string so it's the same as neutrino - // that way I don't need to rewrite this textfilter - // using xml for enigma 1 is a very bad solution as the xml functions do not accept bouquet ids. - // which => one webrequest for each channel in every bouquet - if (_boxtype == "Enigma v1" || _boxtype == "Enigma v2") - { - string chan_id = bouquets.Split(';')[0]; // f.ex.: 1:0:1:6D67:437:1:C00000:0:0:0: - string chan_name = bouquets.Split(';')[1]; //f.eks DISCOVERY CHANNEL - if (chan_id.StartsWith("1:0:1") || chan_id.StartsWith("1:0:0") && chan_name != "<n/a>" && chan_name != "") // if chan_id is a TV service and chan_name is NOT <n/a> or emty - bucket = Convert.ToString(++loopcount) + " " + chan_id + " " + chan_name; - - } - - if (_boxtype == "Neutrino") - bucket = bouquets; - - String tmp_Ref; - - if (_boxtype == "Enigma v2") - tmp_Ref = s.Split(';')[0]; //enigma2 splitchar is ";" - else - tmp_Ref = s.Split(' ')[0]; //otherboxes splitchar is " " - - start = tmp_Ref.Length + 1; - String tmp_Bouquet = s.Substring(start, s.Length - start); - - String tmp_Channel = bucket.Split(' ')[0]; - String tmp_ID = bucket.Split(' ')[1]; - - if (_boxtype == "Enigma v1") - tmp_ID = tmp_ID.Replace("1:0:0:0:0:0:0:0:0:0:", _url + "/rootX"); //workaround for the inability to stream internal recordings from the enigma hdd - - start = tmp_Channel.Length + tmp_ID.Length + 2; - String tmp_Name = bucket.Substring(start, bucket.Length - start); - tmp_Name = tmp_Name.Replace("\"", "'"); - - row["BouqNo"] = tmp_Ref; - row["BouqName"] = tmp_Bouquet; - row["Channel"] = tmp_Channel; - row["ID"] = tmp_ID; - row["Name"] = @tmp_Name; - - // test if enigma got a error on service list - table.Rows.Add(row); - - if (tmp_ID == "E:" || tmp_Name == "<n/a>") - { - // kill the row or we get error - table.Rows.Remove(row); - } - } - } - } - } - } - - - } - ds.Tables.Add(table); - } - catch - { - - } - - return ds; - } - } - - } - -} Modified: trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Dbox Tuner.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Dbox Tuner.csproj 2008-03-03 06:55:09 UTC (rev 1416) +++ trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Dbox Tuner.csproj 2008-03-03 17:13:43 UTC (rev 1417) @@ -37,37 +37,22 @@ <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <UseVSHostingProcess>false</UseVSHostingProcess> </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'MyDboxSVN|AnyCPU' "> - <OutputPath>..\..\Mediaportal\xbmc\bin\Debug\plugins\Windows\</OutputPath> - <DefineConstants>TRACE</DefineConstants> - <Optimize>false</Optimize> - <DebugType>pdbonly</DebugType> - <PlatformTarget>AnyCPU</PlatformTarget> - <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies> - <ErrorReport>prompt</ErrorReport> - <DocumentationFile> - </DocumentationFile> - </PropertyGroup> <ItemGroup> <Reference Include="System" /> <Reference Include="System.Data" /> <Reference Include="System.Drawing" /> - <Reference Include="System.Web" /> <Reference Include="System.Windows.Forms" /> <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> - <Compile Include="Data.cs" /> <Compile Include="SetupForm.cs"> <SubType>Form</SubType> </Compile> <Compile Include="SetupForm.Designer.cs"> <DependentUpon>SetupForm.cs</DependentUpon> </Compile> - <Compile Include="DboxFunctions.cs" /> <Compile Include="Program.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> - <Compile Include="Request.cs" /> </ItemGroup> <ItemGroup> <EmbeddedResource Include="SetupForm.resx"> Deleted: trunk/plugins/IR Server Suite/Applications/Dbox Tuner/DboxFunctions.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Dbox Tuner/DboxFunctions.cs 2008-03-03 06:55:09 UTC (rev 1416) +++ trunk/plugins/IR Server Suite/Applications/Dbox Tuner/DboxFunctions.cs 2008-03-03 17:13:43 UTC (rev 1417) @@ -1,237 +0,0 @@ -#region Copyright (C) 2005-2007 Team MediaPortal - -/* - * Copyright (C) 2005-2007 Team MediaPortal - * http://www.team-mediaportal.com - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#endregion - -using System; -using System.Collections.Generic; -using System.Text; -using System.Xml; -using System.IO; - -namespace DboxTuner -{ - - class DboxFunctions - { - - #region Variables - - string _url; - string _userName; - string _password; - string _command = "/control/"; - string _boxType; - - #endregion Variables - - #region Constructor - - public DboxFunctions(string url, string username, string password, string boxtype) - { - _url = "http://" + url; - _userName = username; - _password = password; - _boxType = boxtype; - } - - #endregion Constructor - - public string ZapTo(string ID) - { - Request request = new Request(_url, _userName, _password); - string s = ""; - //zap to channel (ID) - switch (_boxType) - { - case "Enigma v1": - s = request.PostData("/cgi-bin/zapTo?path=" + ID); - return s; - case "Enigma v2": - s = request.PostData("/web/zap?ZapTo=" + ID); - return s; - default: - s = request.PostData(_command + "zapto?" + ID); - return s; - } - } - public void WakeUp() - { - Request request = new Request(_url, _userName, _password); - switch (_boxType) - { - case "Enigma v1": - request.PostData("/cgi-bin/admin?command=wakeup"); - break; - case "Enigma v2": // donno if wakeup is correct command - request.PostData("/web/powerstate?newstate=wakeup"); - break; - case "Neutrino": // off = wakeup - request.PostData("/control/standby?off"); - break; - } - - } - public string SetSPTS() - { - Request request = new Request(_url, _userName, _password); - string s = ""; - //set playback to spts only required for neutrino, (i think) - // return ok for enigma - if (_boxType != "Neutrino") - s = "ok"; - else //send neutrino command - s = request.PostData(_command + "system?setAViAExtPlayBack=spts"); - return s; - } - public string ToggleMute() - { - Request request = new Request(_url, _userName, _password); - string s = ""; - // get status - switch (_boxType) - { - case "Enigma v1": - s = request.PostData("/cgi-bin/audio?mute=0"); - return s; - case "Enigma v2": - s = request.PostData("/web/vol?set=mute"); - return s; - default: - s = request.PostData(_command + "volume?status"); - if (s == "0") - s = request.PostData(_command + "volume?mute"); - if (s == "1") - s = request.PostData(_command + "volume?unmute"); - - return s; - } - - } - public void ShowMessage(string message) - { - Request request = new Request(_url, _userName, _password); - - switch (_boxType) - { - case "Enigma v1": - request.PostData("/cgi-bin/xmessage?timeout=10&caption=Message&body=" + message); - break; - - case "Enigma v2": - request.PostData("/web/message?type=1&timeout=10&text=" + message); - break; - - default: - request.PostData(_command + "message?popup=" + message); - break; - } - } - public string GetInfo() - { - Request request = new Request(_url, _userName, _password); - string s = String.Empty; - - switch (_boxType) - { - case "Enigma v1": - s = request.PostData("/xml/boxinfo"); - s = s.Replace("\n", " "); - s = s.Replace(" ", ""); - break; - - case "Enigma v2": - s = request.PostData("/web/about"); - s = s.Replace("\n", " "); - break; - - default: - s = request.PostData(_command + "info?version"); - s = s.Replace("\n", " "); - break; - } - - return s; - } - - // Unused ... - - public string GetEpgXml(string ID) - { - Request request = new Request(_url, _userName, _password); - string s = ""; - // get epg from box (xml formatted) - switch (_boxType) - { - case "Enigma v1": - s = request.PostData("/xml/serviceepg?ref=" + ID); - break; - case "Enigma v2": - s = request.PostData("/web/epgservice?ref=" + ID); - break; - default: - s = request.PostData(_command + "epg?xml=true&channelid=" + ID + "&details=true"); // &max=20 - break; - } - - s = s.Replace("&", "&"); - - return s; - } - public string GetID() - { - //ErrorLog("entered getid with " +_Url + " "+_UserName+" "+_Password+" "+_Boxtype); - Request request = new Request(_url, _userName, _password); - XmlDocument doc = new XmlDocument(); - XmlNode elem = doc.DocumentElement; - - string s = ""; - //get actual channel (ID) - - switch (_boxType) - { - case "Enigma v1": - doc.LoadXml(request.PostData("/xml/streaminfo")); - elem = doc.SelectSingleNode("/streaminfo/service/reference"); - s = elem.InnerText; - break; - - case "Enigma v2": - doc.LoadXml(request.PostData("/web/subservices")); - elem = doc.SelectSingleNode("/e2servicelist/e2service/e2servicereference"); - s = elem.InnerText; - break; - - default: - s = request.PostData(_command + "zapto"); - s = s.Replace("\n", ""); - //ErrorLog("get channel "+s+" for "+_Boxtype); - break; - } - - return s; - } - - } - -} Modified: trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Program.cs 2008-03-03 06:55:09 UTC (rev 1416) +++ trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Program.cs 2008-03-03 17:13:43 UTC (rev 1417) @@ -1,6 +1,7 @@ using System; using System.Data; using System.IO; +using System.Net; using System.Text; using System.Threading; using System.Windows.Forms; @@ -11,6 +12,14 @@ namespace DboxTuner { + internal enum StbBoxType + { + Unknown, + EnigmaV1, + EnigmaV2, + Neutrino, + } + /// <summary> /// Based on MyDbox MediaPortal plugin by Mark Koenig (kroko). /// </summary> @@ -19,8 +28,10 @@ #region Constants + 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 @@ -29,7 +40,9 @@ static string _address; static string _userName; static string _password; - static string _boxType; + static StbBoxType _boxType; + + static string _url; static DataTable _tvBouquets; #endregion Variables @@ -55,7 +68,7 @@ IrssLog.Append("Dbox Tuner.log"); LoadSettings(); - + if (args.Length == 0) { Console.WriteLine("Usage:"); @@ -74,7 +87,7 @@ } else { - DboxFunctions func = new DboxFunctions(_address, _userName, _password, _boxType); + _url = UrlPrefix + _address; switch (args[0].ToUpperInvariant()) { @@ -103,27 +116,27 @@ case "WAKE": Info("Command: Wake"); - func.WakeUp(); + WakeUp(); break; case "MUTE": Info("Command: Mute"); - func.ToggleMute(); + ToggleMute(); break; case "MESSAGE": Info("Command: Message \"{0}\"", args[1]); - func.ShowMessage(args[1]); + ShowMessage(args[1]); break; case "SETSPTS": Info("Command: Set SPTS"); - func.SetSPTS(); + SetSPTS(); break; case "INFO": Info("Command: Get Info"); - string output = func.GetInfo(); + string output = GetInfo(); Info(output); break; @@ -139,9 +152,13 @@ if (rows.Length == 1) { string channelID = rows[0]["ID"] as string; - func.ZapTo(channelID); + ZapTo(channelID); break; } + else if (rows.Length > 0) + { + Info("Multiple channels match Channel No \"{0}\"", args[1]); + } Info("Cannot find channel ({0}) to tune", args[1]); break; @@ -172,7 +189,7 @@ _address = doc.DocumentElement.Attributes["Address"].Value; _userName = doc.DocumentElement.Attributes["UserName"].Value; _password = doc.DocumentElement.Attributes["Password"].Value; - _boxType = doc.DocumentElement.Attributes["BoxType"].Value; + _boxType = (StbBoxType)Enum.Parse(typeof(StbBoxType), doc.DocumentElement.Attributes["BoxType"].Value); } catch (Exception ex) { @@ -181,7 +198,7 @@ _address = "192.168.0.100"; _userName = "root"; _password = "dbox2"; - _boxType = String.Empty; + _boxType = StbBoxType.Unknown; } } static void SaveSettings() @@ -199,7 +216,7 @@ writer.WriteAttributeString("Address", _address); writer.WriteAttributeString("UserName", _userName); writer.WriteAttributeString("Password", _password); - writer.WriteAttributeString("BoxType", _boxType); + writer.WriteAttributeString("BoxType", Enum.GetName(typeof(StbBoxType), _boxType)); writer.WriteEndElement(); // </settings> writer.WriteEndDocument(); @@ -211,6 +228,432 @@ } } + + internal static string PostData(string url, string userName, string password, StbBoxType boxType, string command) + { + try + { + Uri uri = new Uri(url + command); + WebRequest request = WebRequest.Create(uri); + request.Credentials = new NetworkCredential(userName, password); + request.Timeout = 2000; + + // back to iso encoding sorry , should work anywhere in EU + // which it doesn't, because dreambox use utf-8 encoding, making all UTF-8 extended characters a multibyte garble if we encode those to iso + + Encoding encode = Encoding.GetEncoding("iso-8859-1"); + if (boxType == StbBoxType.EnigmaV1 || boxType == StbBoxType.EnigmaV2) + encode = Encoding.GetEncoding("utf-8"); + + using (WebResponse response = request.GetResponse()) + using (Stream receiveStream = response.GetResponseStream()) + using (StreamReader reader = new StreamReader(receiveStream, encode)) + return reader.ReadToEnd(); + } + catch + { + return String.Empty; + } + } + + internal static DataSet GetData(string url, string userName, string password, StbBoxType boxType) + { + DataSet ds = new DataSet(); + + string command; + string temp; + + string sreturn = String.Empty; + + #region Get data from STB + + switch (boxType) + { + case StbBoxType.EnigmaV1: + // get userbouquets (ref=4097:7:0:6:0:0:0:0:0:0:) + sreturn = PostData(url, userName, password, boxType, "/cgi-bin/getServices?ref=4097:7:0:6:0:0:0:0:0:0:"); + + // get internal hdd recording + if (!PostData(url, userName, password, boxType, "/cgi-bin/getServices?ref=2:47:0:0:0:0:0:0:0:0:/var/media/movie/").Contains("E: ")) + sreturn += "2:47:0:0:0:0:0:0:0:0:/var/media/movie/;Recordings\n"; + + // replace neutrino split character with ; + sreturn = sreturn.Replace(";", " "); + sreturn = sreturn.Replace(" selected", ""); // removes enigma v1's selected tag in bouquets output + + // set the bouquet command for this boxtype + command = "/cgi-bin/getServices?ref="; + break; + + case StbBoxType.EnigmaV2: + string serviceID = String.Empty; + string serviceName = String.Empty; + + string returnedXml = PostData(url, userName, password, boxType, "/web/fetchchannels?ServiceListBrowse=1:7:1:0:0:0:0:0:0:0:(type == 1) FROM BOUQUET \"bouquets.tv\" ORDER BY bouquet"); + + // xmlbased, return all userbouquets + XmlDocument doc = new XmlDocument(); + doc.LoadXml(returnedXml); + XmlNodeList nodelist = doc.GetElementsByTagName("e2service"); + + foreach (XmlNode docnode in nodelist) + { + foreach (XmlNode datanode in docnode) + { + switch (datanode.Name) + { + case "e2servicereference": + serviceID = datanode.InnerText; + break; + + case "e2servicename": + serviceName = datanode.InnerText.Replace(" (TV)", ""); + break; + } + } + + sreturn += serviceID + ";" + serviceName + "\n"; // make a list of all the userbouquets + } + + command = "/web/fetchchannels?ServiceListBrowse="; + break; + + default: + sreturn = PostData(url, userName, password, boxType, "/control/getbouquets"); + // set the bouquet command for this boxtype + command = "/control/getbouquet?bouquet="; + break; + } + + #endregion Get data from STB + + #region Convert data to dataset + + DataTable table = new DataTable("BouquetsTV"); + DataRow row = null; + + string[] allBouquets = sreturn.Split('\n'); // split the list of userbouquets + + try + { + table.Columns.Add("BouqNo", Type.GetType("System.String")); + table.Columns.Add("BouqName", Type.GetType("System.String")); + table.Columns.Add("Channel", Type.GetType("System.String")); + table.Columns.Add("ID", Type.GetType("System.String")); + table.Columns.Add("Name", Type.GetType("System.String")); + + int loopcount = 0; + foreach (string s in allBouquets) + { + if (!String.IsNullOrEmpty(s)) + { + string curCommand; + + // split the bouquet id from bouquet name + // s = "0 ServiceID, 1 Name of the Bouquets" + if (boxType == StbBoxType.EnigmaV2) //enigma2 splitchar is ";" + temp = s.Split(';')[0]; + else //otherboxes splitchar is " " + temp = s.Split(' ')[0]; + + if (boxType == StbBoxType.Neutrino) //build neutrino command + curCommand = command + temp + "&mode=TV"; + else //build enigma command + curCommand = command + temp; + + + //request list of channels contained in bouquetID "temp" + sreturn = PostData(url, userName, password, boxType, curCommand); + sreturn = sreturn.Replace(";selected", ""); + + if (boxType == StbBoxType.EnigmaV2) + { + string serviceID = String.Empty; + string serviceName = String.Empty; + + XmlDocument doc = new XmlDocument(); + doc.LoadXml(sreturn); + XmlNodeList nodelist = doc.GetElementsByTagName("e2service"); + sreturn = String.Empty; + foreach (XmlNode docnode in nodelist) + { + foreach (XmlNode datanode in docnode) + { + switch (datanode.Name) + { + case "e2servicereference": + serviceID = datanode.InnerText; + break; + case "e2servicename": + serviceName = datanode.InnerText; + break; + } + } + sreturn += serviceID + ";" + serviceName + "\n"; // make a list of all the channels + } + } + + string[] OneBouquet = sreturn.Split('\n'); + string bucket = String.Empty; + + if (!String.IsNullOrEmpty(OneBouquet[0])) + { + foreach (string bouquets in OneBouquet) + { + if (!String.IsNullOrEmpty(bouquets)) + { + if ((bouquets.IndexOf(' ') > -1) || (bouquets.IndexOf(';') > -1)) + { + row = table.NewRow(); + + int start = 0; + // modifying the enigma string so it's the same as neutrino + // that way I don't need to rewrite this textfilter + // using xml for enigma 1 is a very bad solution as the xml functions do not accept bouquet ids. + // which => one webrequest for each channel in every bouquet + if (boxType == StbBoxType.EnigmaV1 || boxType == StbBoxType.EnigmaV2) + { + string chan_id = bouquets.Split(';')[0]; // eg. 1:0:1:6D67:437:1:C00000:0:0:0: + string chan_name = bouquets.Split(';')[1]; // eg. DISCOVERY CHANNEL + + // if chan_id is a TV service and chan_name is NOT <n/a> or empty + if (chan_id.StartsWith("1:0:1", StringComparison.Ordinal) || chan_id.StartsWith("1:0:0", StringComparison.Ordinal) && !String.IsNullOrEmpty(chan_name) && !chan_name.Equals("<n/a>", StringComparison.OrdinalIgnoreCase)) + bucket = Convert.ToString(++loopcount) + " " + chan_id + " " + chan_name; + } + else if (boxType == StbBoxType.Neutrino) + bucket = bouquets; + + string tmp_Ref; + + if (boxType == StbBoxType.EnigmaV2) //enigma2 splitchar is ";" + tmp_Ref = s.Split(';')[0]; + else //otherboxes splitchar is " " + tmp_Ref = s.Split(' ')[0]; + + start = tmp_Ref.Length + 1; + string tmp_Bouquet = s.Substring(start, s.Length - start); + + string tmp_Channel = bucket.Split(' ')[0]; + string tmp_ID = bucket.Split(' ')[1]; + + if (boxType == StbBoxType.EnigmaV1) + tmp_ID = tmp_ID.Replace("1:0:0:0:0:0:0:0:0:0:", _url + "/rootX"); //workaround for the inability to stream internal recordings from the enigma hdd + + start = tmp_Channel.Length + tmp_ID.Length + 2; + string tmp_Name = bucket.Substring(start, bucket.Length - start); + tmp_Name = tmp_Name.Replace("\"", "'"); + + row["BouqNo"] = tmp_Ref; + row["BouqName"] = tmp_Bouquet; + row["Channel"] = tmp_Channel; + row["ID"] = tmp_ID; + row["Name"] = tmp_Name; + + // test if enigma got a error on service list + table.Rows.Add(row); + + if (tmp_ID.Equals("E:", StringComparison.OrdinalIgnoreCase) || tmp_Name.Equals("<n/a>", StringComparison.OrdinalIgnoreCase)) + { + // kill the row or we get error + table.Rows.Remove(row); + } + } + } + } + } + } + } + ds.Tables.Add(table); + + } + catch + { + + } + + #endregion Convert data to dataset + + return ds; + } + + internal static StbBoxType DetectBoxType(string url, string userName, string password) + { + string str1 = PostData(url, userName, password, StbBoxType.Unknown, "/control/getmode").ToUpperInvariant(); + if (str1.Contains("TV") || str1.Contains("RADIO") || str1.Contains("UNKNOWN")) + return StbBoxType.Neutrino; + + string str2 = PostData(url, userName, password, StbBoxType.Unknown, "/cgi-bin/status").ToUpperInvariant(); + if (str2.Contains("ENIGMA")) + return StbBoxType.EnigmaV1; + + string str3 = PostData(url, userName, password, StbBoxType.Unknown, "/web/stream.m3u").ToUpperInvariant(); + if (str3.Contains("#EXTM3U")) + return StbBoxType.EnigmaV2; + + return StbBoxType.Unknown; + } + + static string ZapTo(string ID) + { + switch (_boxType) + { + case StbBoxType.EnigmaV1: return PostData(_url, _userName, _password, _boxType, "/cgi-bin/zapTo?path=" + ID); + case StbBoxType.EnigmaV2: return PostData(_url, _userName, _password, _boxType, "/web/zap?ZapTo=" + ID); + default: return PostData(_url, _userName, _password, _boxType, "/control/zapto?" + ID); + } + } + static void WakeUp() + { + switch (_boxType) + { + case StbBoxType.EnigmaV1: + PostData(_url, _userName, _password, _boxType, "/cgi-bin/admin?command=wakeup"); + break; + + case StbBoxType.EnigmaV2: // donno if wakeup is correct command + PostData(_url, _userName, _password, _boxType, "/web/powerstate?newstate=wakeup"); + break; + + case StbBoxType.Neutrino: // off = wakeup + PostData(_url, _userName, _password, _boxType, "/control/standby?off"); + break; + } + } + static string SetSPTS() + { + //set playback to spts only required for neutrino, (i think) + + if (_boxType == StbBoxType.Neutrino) //send neutrino command + return PostData(_url, _userName, _password, _boxType, "/control/system?setAViAExtPlayBack=spts"); + else // return ok for enigma + return "ok"; + } + static string ToggleMute() + { + string status; + + switch (_boxType) + { + case StbBoxType.EnigmaV1: + status = PostData(_url, _userName, _password, _boxType, "/cgi-bin/audio?mute=0"); + break; + + case StbBoxType.EnigmaV2: + status = PostData(_url, _userName, _password, _boxType, "/web/vol?set=mute"); + break; + + default: + status = PostData(_url, _userName, _password, _boxType, "/control/volume?status"); + if (status.Equals("0", StringComparison.Ordinal)) + status = PostData(_url, _userName, _password, _boxType, "/control/volume?mute"); + if (status.Equals("1", StringComparison.Ordinal)) + status = PostData(_url, _userName, _password, _boxType, "/control/volume?unmute"); + break; + } + + return status; + } + static void ShowMessage(string message) + { + switch (_boxType) + { + case StbBoxType.EnigmaV1: + PostData(_url, _userName, _password, _boxType, "/cgi-bin/xmessage?timeout=10&caption=Message&body=" + message); + break; + + case StbBoxType.EnigmaV2: + PostData(_url, _userName, _password, _boxType, "/web/message?type=1&timeout=10&text=" + message); + break; + + default: + PostData(_url, _userName, _password, _boxType, "/control/message?popup=" + message); + break; + } + } + static string GetInfo() + { + string info; + + switch (_boxType) + { + case StbBoxType.EnigmaV1: + info = PostData(_url, _userName, _password, _boxType, "/xml/boxinfo"); + info = info.Replace("\n", " "); + info = info.Replace(" ", ""); + break; + + case StbBoxType.EnigmaV2: + info = PostData(_url, _userName, _password, _boxType, "/web/about"); + info = info.Replace("\n", " "); + break; + + default: + info = PostData(_url, _userName, _password, _boxType, "/control/info?version"); + info = info.Replace("\n", " "); + break; + } + + return info; + } + + // Unused ... + /* + static string GetEpgXml(string ID) + { + string epgXml; + + switch (_boxType) + { + case StbBoxType.EnigmaV1: + epgXml = PostData(_url, _userName, _password, _boxType, "/xml/serviceepg?ref=" + ID); + break; + + case StbBoxType.EnigmaV2: + epgXml = PostData(_url, _userName, _password, _boxType, "/web/epgservice?ref=" + ID); + break; + + default: + epgXml = PostData(_url, _userName, _password, _boxType, "/control/epg?xml=true&channelid=" + ID + "&details=true"); // &max=20 + break; + } + + epgXml = epgXml.Replace("&", "&"); + + return epgXml; + } + static string GetID() + { + XmlDocument doc = new XmlDocument(); + XmlNode elem = doc.DocumentElement; + + string id; + string xml; + + switch (_boxType) + { + case StbBoxType.EnigmaV1: + xml = PostData(_url, _userName, _password, _boxType, "/xml/streaminfo"); + doc.LoadXml(xml); + elem = doc.SelectSingleNode("/streaminfo/service/reference"); + id = elem.InnerText; + break; + + case StbBoxType.EnigmaV2: + xml = PostData(_url, _userName, _password, _boxType, "/web/subservices"); + doc.LoadXml(xml); + elem = doc.SelectSingleNode("/e2servicelist/e2service/e2servicereference"); + id = elem.InnerText; + break; + + default: + id = PostData(_url, _userName, _password, _boxType, "/control/zapto"); + id = id.Replace("\n", ""); + break; + } + + return id; + } + */ } } 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-03 06:55:09 UTC (rev 1416) +++ trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Properties/AssemblyInfo.cs 2008-03-03 17:13:43 UTC (rev 1417) @@ -1,4 +1,5 @@ -using System.Reflection; +using System; +using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -33,3 +34,5 @@ // übernehmen, indem Sie "*" eingeben: [assembly: AssemblyVersion("1.0.4.2")] [assembly: AssemblyFileVersion("1.0.4.2")] + +[assembly: CLSCompliant(true)] Deleted: trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Request.cs =================================================================== (Binary files differ) Modified: trunk/plugins/IR Server Suite/Applications/Dbox Tuner/SetupForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Dbox Tuner/SetupForm.cs 2008-03-03 06:55:09 UTC (rev 1416) +++ trunk/plugins/IR Server Suite/Applications/Dbox Tuner/SetupForm.cs 2008-03-03 17:13:43 UTC (rev 1417) @@ -39,13 +39,13 @@ #region Variables - string _boxType = "unknown"; + StbBoxType _boxType = StbBoxType.Unknown; #endregion Variables #region Properties - public string BoxType + public StbBoxType BoxType { get { return _boxType; } set { _boxType = value; } @@ -238,45 +238,19 @@ } - static string DetectBoxType(string url, string userName, string password) - { - Request request = new Request(url, userName, password); - - // Detect Neutrino - string str1 = request.PostData("/control/getmode").ToLower(); - if (str1.Contains("tv") || str1.Contains("radio") || str1.Contains("unknown")) - return "Neutrino"; - - // Detect enigma v1 - string str2 = request.PostData("/cgi-bin/status").ToLower(); - if (str2.Contains("enigma")) - return "Enigma v1"; - - // Detect enigma v2 - string str3 = request.PostData("/web/stream.m3u"); - if (str3.Contains("#EXTM3U")) - return "Enigma v2"; - - return "unknown"; - } - private void buttonGetData_Click(object sender, EventArgs e) { StatusMessage("Attempting to read channel list ..."); try { - string url = "http://" + textBoxIpAddress.Text; - string userName = textBoxUserName.Text; - string password = textBoxPassword.Text; + string url = Program.UrlPrefix + Address; // Detect box type ... - if (_boxType.Equals("unknown", StringComparison.OrdinalIgnoreCase)) - { - _boxType = DetectBoxType(url, userName, password); - } + if (BoxType == StbBoxType.Unknown) + BoxType = Program.DetectBoxType(url, UserName, Password); - if (_boxType.Equals("unknown", StringComparison.OrdinalIgnoreCase)) + if (BoxType == StbBoxType.Unknown) { StatusMessage("ERROR - No STB or unknown type detected!"); } @@ -284,10 +258,8 @@ { StatusMessage("Detected box type: {0}", _boxType); - Data data = new Data(url, userName, password, _boxType); + DataTable bouquets = Program.GetData(url, UserName, Password, BoxType).Tables[0]; - DataTable bouquets = data.UserTVBouquets.Tables[0]; - if (bouquets.Rows.Count != 0) StatusMessage("{0} channels found", bouquets.Rows.Count); else @@ -324,11 +296,7 @@ private void buttonDetectBoxType_Click(object sender, EventArgs e) { - string url = "http://" + textBoxIpAddress.Text; - string userName = textBoxUserName.Text; - string password = textBoxPassword.Text; - - _boxType = DetectBoxType(url, userName, password); + BoxType = Program.DetectBoxType(Program.UrlPrefix + Address, UserName, Password); } } Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote (Smartphone2003) Installer/Virtual Remote (Smartphone2003) Installer.vddproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote (Smartphone2003) Installer/Virtual Remote (Smartphone2003) Installer.vddproj 2008-03-03 06:55:09 UTC (rev 1416) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote (Smartphone2003) Installer/Virtual Remote (Smartphone2003) Installer.vddproj 2008-03-03 17:13:43 UTC (rev 1417) @@ -3,7 +3,7 @@ "VSVersion" = "3:701" "ProjectType" = "8:{AB322303-2255-48EF-A496-5904EB18DA55}" "IsWebType" = "8:FALSE" -"ProjectName" = "8:Virtual Remote (Smartphone)" +"ProjectName" = "8:Virtual Remote (Smartphone2003) Installer" "LanguageId" = "3:1033" "CodePage" = "3:1252" "SccProjectName" = "8:" Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote (WinCE5) Installer/Virtual Remote (WinCE5) Installer.vddproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote (WinCE5) Installer/Virtual Remote (WinCE5) Installer.vddproj 2008-03-03 06:55:09 UTC (rev 1416) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote (WinCE5) Installer/Virtual Remote (WinCE5) Installer.vddproj 2008-03-03 17:13:43 UTC (rev 1417) @@ -3,7 +3,7 @@ "VSVersion" = "3:701" "ProjectType" = "8:{AB322303-2255-48EF-A496-5904EB18DA55}" "IsWebType" = "8:FALSE" -"ProjectName" = "8:Virtual Remote (WinCE)" +"ProjectName" = "8:Virtual Remote (WinCE5) Installer" "LanguageId" = "3:1033" "CodePage" = "3:1252" "SccProjectName" = "8:" Modified: trunk/plugins/IR Server Suite/Documentation/Virtual Remote/index.html =================================================================== --- trunk/plugins/IR Server Suite/Documentation/Virtual Remote/index.html 2008-03-03 06:55:09 UTC (rev 1416) +++ trunk/plugins/IR Server Suite/Documentation/Virtual Remote/index.html 2008-03-03 17:13:43 UTC (rev 1417) @@ -4,7 +4,7 @@ <H2>What Is Virtual Remote?<BR><HR COLOR="RED"></H2> -<P>Virtual Remote is a small application for simulating remote control button presses. It can be run on any computer on the Local Area Network to simulate a user pressing a remote button at the server.</P> +<P>Virtual Remote is a small application for simulating remote control button presses. It can be run on any computer on the Local Area Network to simulate a user pressing a remote button.</P> <IMG SRC="virtual_remote.png"> @@ -38,7 +38,9 @@ <P>To send simulated buttons with spaces in their codes use quotation marks:<BR> VirtualRemote.exe "Button 1" "Button 2"</P> -<P>Using command line parameters you can interface IR Server with any other software that supports launching external applications for IR Blasting, for example, for changing channels on a set top box.</P> +<P>Using command line parameters you can interface IR Server Suite with any other software that supports launching external applications. For example, for changing channels on a set top box.</P> +<P>Virtual Remote also comes in three Smart-Device versions supporting WinCE 5, Smartphone 2003, and PocketPC 2003 compatible platforms.</P> + </BODY> </HTML> Modified: trunk/plugins/IR Server Suite/Documentation/new.html =================================================================== --- trunk/plugins/IR Server Suite/Documentation/new.html 2008-03-03 06:55:09 UTC (rev 1416) +++ trunk/plugins/IR Server Suite/Documentation/new.html 2008-03-03 17:13:43 UTC (rev 1417) @@ -42,6 +42,7 @@ <LI>FusionREMOTE: Can now tell the difference between different DViCo remotes (You will need to re-teach the button keycodes).</LI> <LI>General: Receiving device name is now sent along with remote button codes, this is in preparation for a major overhaul of the remote mapping system to facilitate automatic configuration for controlling your whole PC! This feature will not be completed until 1.0.4.3 or 1.0.5.0 but it will be very big if it comes together as planned.</LI> <LI>New Prorgam: Added Keyboard Input Relay, to enable mapping special (App Command) keyboard buttons (like Forward, Back, Play, Stop, Volume, etc...) as well as basic key combinations as if they are remote button presses.</LI> +<LI>New Input Plugin: Direct Input. This allows the user to map game controllers (gamepads, joysticks, etc...) as remotes. First version is basic, next version will allow button combos and controlling the mouse with analog sticks.</LI> </UL></P> <BR> Added: trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/Configure.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/Configure.Designer.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/Configure.Designer.cs 2008-03-03 17:13:43 UTC (rev 1417) @@ -0,0 +1,303 @@ +namespace InputService.Plugin +{ + partial class Configure + { + /// <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.buttonOK = new System.Windows.Forms.Button(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.toolTips = new System.Windows.Forms.ToolTip(this.components); + this.buttonConfigure = new System.Windows.Forms.Button(); + this.listViewDevices = new System.Windows.Forms.ListView(); + this.columnHeaderName = new System.Windows.Forms.ColumnHeader(); + this.columnHeaderDevice = new System.Windows.Forms.ColumnHeader(); + this.radioButtonNone = new System.Windows.Forms.RadioButton(); + this.groupBoxMouseMovement = new System.Windows.Forms.GroupBox(); + this.radioButtonAxesXY = new System.Windows.Forms.RadioButton(); + this.radioButtonRotationXY = new System.Windows.Forms.RadioButton(); + this.groupBoxMouseButtons = new System.Windows.Forms.GroupBox(); + this.labelLeft = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.comboBoxLeft = new System.Windows.Forms.ComboBox(); + this.comboBoxMiddle = new System.Windows.Forms.ComboBox(); + this.comboBoxRight = new System.Windows.Forms.ComboBox(); + this.groupBoxMouseMovement.SuspendLayout(); + this.groupBoxMouseButtons.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(168, 264); + this.buttonOK.Name = "buttonOK"; + this.buttonOK.Size = new System.Drawing.Size(64, 24); + this.buttonOK.TabIndex = 4; + 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(240, 264); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(64, 24); + this.buttonCancel.TabIndex = 5; + this.buttonCancel.Text = "Cancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); + // + // buttonConfigure + // + this.buttonConfigure.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonConfigure.Location = new System.Drawing.Point(8, 264); + this.buttonConfigure.Name = "buttonConfigure"; + this.buttonConfigure.Size = new System.Drawing.Size(64, 24); + this.buttonConfigure.TabIndex = 6; + this.buttonConfigure.Text = "Configure"; + this.toolTips.SetToolTip(this.buttonConfigure, "Configure the selected device"); + this.buttonConfigure.UseVisualStyleBackColor = true; + this.buttonConfigure.Click += new System.EventHandler(this.buttonConfigure_Click); + // + // listViewDevices + // + this.listViewDevices.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.listViewDevices.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnHeaderName, + this.columnHeaderDevice}); + this.listViewDevices.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; + this.listViewDevices.HideSelection = false; + this.listViewDevices.Location = new System.Drawing.Point(8, 8); + this.listViewDevices.MultiSelect = false; + this.listViewDevices.Name = "listViewDevices"; + this.listViewDevices.ShowGroups = false; + this.listViewDevices.Size = new System.Drawing.Size(296, 104); + this.listViewDevices.TabIndex = 7; + this.toolTips.SetToolTip(this.listViewDevices, "Select the device to use"); + this.listViewDevices.UseCompatibleStateImageBehavior = false; + this.listViewDevices.View = System.Windows.Forms.View.Details; + this.listViewDevices.SelectedIndexChanged += new System.EventHandler(this.listViewDevices_SelectedIndexChanged); + // + // columnHeaderName + // + this.columnHeaderName.Text = "Name"; + this.columnHeaderName.Width = 108; + // + // columnHeaderDevice + // + this.columnHeaderDevice.Text = "Device"; + this.columnHeaderDevice.Width = 124; + // + // radioButtonNone + // + this.radioButtonNone.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.radioButtonNone.AutoSize = true; + this.radioButtonNone.Checked = true; + this.radioButtonNone.Location = new System.Drawing.Point(8, 24); + this.radioButtonNone.Name = "radioButtonNone"; + this.radioButtonNone.Size = new System.Drawing.Size(51, 17); + this.radioButtonNone.TabIndex = 8; + this.radioButtonNone.TabStop = true; + this.radioButtonNone.Text = "None"; + this.toolTips.SetToolTip(this.radioButtonNone, "Don\'t use the controller to move the mouse"); + this.radioButtonNone.UseVisualStyleBackColor = true; + // + // groupBoxMouseMovement + // + this.groupBoxMouseMovement.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxMouseMovement.Controls.Add(this.radioButtonRotationXY); + this.groupBoxMouseMovement.Controls.Add(this.radioButtonAxesXY); + this.groupBoxMouseMovement.Controls.Add(this.radioButtonNone); + this.groupBoxMouseMovement.Enabled = false; + this.groupBoxMouseMovement.Location = new System.Drawing.Point(8, 120); + this.groupBoxMouseMovement.Name = "groupBoxMouseMovement"; + this.groupBoxMouseMovement.Size = new System.Drawing.Size(296, 56); + this.groupBoxMouseMovement.TabIndex = 9; + this.groupBoxMouseMovement.TabStop = false; + this.groupBoxMouseMovement.Text = "Mouse movement"; + // + // radioButtonAxesXY + // + this.radioButtonAxesXY.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.radioButtonAxesXY.AutoSize = true; + this.radioButtonAxesXY.Location = new System.Drawing.Point(72, 24); + this.radioButtonAxesXY.Name = "radioButtonAxesXY"; + this.radioButtonAxesXY.Size = new System.Drawing.Size(91, 17); + this.radioButtonAxesXY.TabIndex = 9; + this.radioButtonAxesXY.Text = "Use X/Y axes"; + this.toolTips.SetToolTip(this.radioButtonAxesXY, "Use the X and Y axes to move the mouse"); + this.radioButtonAxesXY.UseVisualStyleBackColor = true; + // + // radioButtonRotationXY + // + this.radioButtonRotationXY.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.radioButtonRotationXY.AutoSize = true; + this.radioButtonRotationXY.Location = new System.Drawing.Point(176, 24); + this.radioButtonRotationXY.Name = "radioButtonRotationXY"; + this.radioButtonRotationXY.Size = new System.Drawing.Size(109, 17); + this.radioButtonRotationXY.TabIndex = 10; + this.radioButtonRotationXY.Text = "Use Rotation X/Y"; + this.toolTips.SetToolTip(this.radioButtonRotationXY, "Use rotation X and Y to move the mouse"); + this.radioButtonRotationXY.UseVisualStyleBackColor = true; + // + // groupBoxMouseButtons + // + this.groupBoxMouseButtons.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxMouseButtons.Controls.Add(this.comboBoxRight); + this.groupBoxMouseButtons.Controls.Add(this.comboBoxMiddle); + this.groupBoxMouseButtons.Controls.Add(this.comboBoxLeft); + this.groupBoxMouseButtons.Controls.Add(this.label2); + this.groupBoxMouseButtons.Controls.Add(this.label1); + this.groupBoxMouseButtons.Controls.Add(this.labelLeft); + this.groupBoxMouseButtons.Enabled = false; + this.groupBoxMouseButtons.Location = new System.Drawing.Point(8, 184); + this.groupBoxMouseButtons.Name = "groupBoxMouseButtons"; + this.groupBoxMouseButtons.Size = new System.Drawing.Size(296, 72); + this.groupBoxMouseButtons.TabIndex = 14; + this.groupBoxMouseButtons.TabStop = false; + this.groupBoxMouseButtons.Text = "Mouse buttons"; + this.groupBoxMouseButtons.Enter += new System.EventHandler(this.groupBoxMouseButtons_Enter); + ... [truncated message content] |
From: <an...@us...> - 2008-03-03 22:47:31
|
Revision: 1418 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1418&view=rev Author: and-81 Date: 2008-03-03 14:47:28 -0800 (Mon, 03 Mar 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Program.cs trunk/plugins/IR Server Suite/Applications/Dbox Tuner/SetupForm.cs trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs trunk/plugins/IR Server Suite/Input Service/Input Service/InputService.cs Modified: trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Program.cs 2008-03-03 17:13:43 UTC (rev 1417) +++ trunk/plugins/IR Server Suite/Applications/Dbox Tuner/Program.cs 2008-03-03 22:47:28 UTC (rev 1418) @@ -12,6 +12,8 @@ namespace DboxTuner { + #region Enumerations + internal enum StbBoxType { Unknown, @@ -20,6 +22,8 @@ Neutrino, } + #endregion Enumerations + /// <summary> /// Based on MyDbox MediaPortal plugin by Mark Koenig (kroko). /// </summary> @@ -250,8 +254,10 @@ using (StreamReader reader = new StreamReader(receiveStream, encode)) return reader.ReadToEnd(); } - catch + catch (Exception ex) { + IrssLog.Error(ex); + return String.Empty; } } @@ -466,9 +472,9 @@ ds.Tables.Add(table); } - catch + catch (Exception ex) { - + IrssLog.Error(ex); } #endregion Convert data to dataset Modified: trunk/plugins/IR Server Suite/Applications/Dbox Tuner/SetupForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Dbox Tuner/SetupForm.cs 2008-03-03 17:13:43 UTC (rev 1417) +++ trunk/plugins/IR Server Suite/Applications/Dbox Tuner/SetupForm.cs 2008-03-03 22:47:28 UTC (rev 1418) @@ -1,36 +1,13 @@ -#region Copyright (C) 2005-2007 Team MediaPortal - -/* - * Copyright (C) 2005-2007 Team MediaPortal - * http://www.team-mediaportal.com - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#endregion - using System; using System.Collections; using System.ComponentModel; -using System.IO; -using System.Windows.Forms; using System.Data; using System.Diagnostics; +using System.IO; +using System.Windows.Forms; +using IrssUtils; + namespace DboxTuner { @@ -271,16 +248,25 @@ bouquets.WriteXml(Program.DataFile, XmlWriteMode.WriteSchema); } } - catch + catch (Exception ex) { StatusMessage("ERROR - Cannot read bouquet!"); + IrssLog.Error(ex); + + MessageBox.Show(this, ex.ToString(), "Dbox Tuner - Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } void StatusMessage(string format, params object[] args) { - toolStripStatusLabel.Text = String.Format(format, args); + string message = String.Format(format, args); + toolStripStatusLabel.Text = message; statusStrip.Update(); + + if (message.StartsWith("ERROR", StringComparison.OrdinalIgnoreCase)) + IrssLog.Error(message); + else + IrssLog.Info(message); } private void buttonOK_Click(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 2008-03-03 17:13:43 UTC (rev 1417) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2008-03-03 22:47:28 UTC (rev 1418) @@ -999,9 +999,19 @@ { IrssLog.Info("Blast IR"); - if (_pluginTransmit == null || !(_pluginTransmit is ITransmitIR)) + if (_pluginTransmit == null) + { + IrssLog.Warn("No transmit plugin loaded, can't blast"); return false; + } + ITransmitIR _blaster = _pluginTransmit as ITransmitIR; + if (_blaster == null) + { + IrssLog.Error("Active transmit plugin doesn't support blasting!"); + return false; + } + string port = "Default"; int portLen = BitConverter.ToInt32(data, 0); @@ -1011,7 +1021,7 @@ byte[] codeData = new byte[data.Length - (4 + portLen)]; Array.Copy(data, 4 + portLen, codeData, 0, codeData.Length); - return (_pluginTransmit as ITransmitIR).Transmit(port, codeData); + return _blaster.Transmit(port, codeData); } catch (Exception ex) { @@ -1030,7 +1040,9 @@ IrssLog.Warn("No transmit plugin loaded, can't learn"); return LearnStatus.Failure; } - else if (!(_pluginTransmit is ILearnIR)) + + ILearnIR _learner = _pluginTransmit as ILearnIR; + if (_learner == null) { IrssLog.Warn("Active transmit plugin doesn't support learn"); return LearnStatus.Failure; @@ -1042,7 +1054,7 @@ try { - status = (_pluginTransmit as ILearnIR).Learn(out data); + status = _learner.Learn(out data); switch (status) { case LearnStatus.Success: 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-03 17:13:43 UTC (rev 1417) +++ trunk/plugins/IR Server Suite/Input Service/Input Service/InputService.cs 2008-03-03 22:47:28 UTC (rev 1418) @@ -988,9 +988,19 @@ { IrssLog.Info("Blast IR"); - if (_pluginTransmit == null || !(_pluginTransmit is ITransmitIR)) + if (_pluginTransmit == null) + { + IrssLog.Warn("No transmit plugin loaded, can't blast"); return false; + } + ITransmitIR _blaster = _pluginTransmit as ITransmitIR; + if (_blaster == null) + { + IrssLog.Error("Active transmit plugin doesn't support blasting!"); + return false; + } + string port = "Default"; int portLen = BitConverter.ToInt32(data, 0); @@ -1000,7 +1010,7 @@ byte[] codeData = new byte[data.Length - (4 + portLen)]; Array.Copy(data, 4 + portLen, codeData, 0, codeData.Length); - return (_pluginTransmit as ITransmitIR).Transmit(port, codeData); + return _blaster.Transmit(port, codeData); } catch (Exception ex) { @@ -1019,7 +1029,9 @@ IrssLog.Warn("No transmit plugin loaded, can't learn"); return LearnStatus.Failure; } - else if (!(_pluginTransmit is ILearnIR)) + + ILearnIR _learner = _pluginTransmit as ILearnIR; + if (_learner == null) { IrssLog.Warn("Active transmit plugin doesn't support learn"); return LearnStatus.Failure; @@ -1031,7 +1043,7 @@ try { - status = (_pluginTransmit as ILearnIR).Learn(out data); + status = _learner.Learn(out data); switch (status) { case LearnStatus.Success: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2008-03-03 23:19:21
|
Revision: 1419 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1419&view=rev Author: and-81 Date: 2008-03-03 15:19:19 -0800 (Mon, 03 Mar 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 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 Modified: trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2008-03-03 22:47:28 UTC (rev 1418) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2008-03-03 23:19:19 UTC (rev 1419) @@ -176,20 +176,27 @@ for (int index = 0; index < _pluginNameReceive.Length; index++) { - string pluginName = _pluginNameReceive[index]; + try + { + string pluginName = _pluginNameReceive[index]; - PluginBase plugin = Program.GetPlugin(pluginName); + PluginBase plugin = Program.GetPlugin(pluginName); - if (plugin == null) - { - IrssLog.Warn("Receiver plugin not found: {0}", pluginName); + if (plugin == null) + { + IrssLog.Warn("Receiver plugin not found: {0}", pluginName); + } + else + { + _pluginReceive.Add(plugin); + + if (!String.IsNullOrEmpty(_pluginNameTransmit) && plugin.Name.Equals(_pluginNameTransmit, StringComparison.OrdinalIgnoreCase)) + _pluginTransmit = plugin; + } } - else + catch (Exception ex) { - _pluginReceive.Add(plugin); - - if (!String.IsNullOrEmpty(_pluginNameTransmit) && plugin.Name.Equals(_pluginNameTransmit, StringComparison.OrdinalIgnoreCase)) - _pluginTransmit = plugin; + IrssLog.Error(ex); } } Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/DirectInputListener.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/DirectInputListener.cs 2008-03-03 22:47:28 UTC (rev 1418) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/DirectInputListener.cs 2008-03-03 23:19:19 UTC (rev 1419) @@ -29,22 +29,29 @@ namespace InputService.Plugin { + /// <summary> /// Summary description for DirectInputListener. /// </summary> /// class DirectInputListener { + + #region Variables + Device device = null; Thread inputListener = null; - bool isRunning = false; + volatile bool isListening = false; int delay = 150; // sleep time in milliseconds // event: send info on joystick state change public delegate void diStateChange(object sender, JoystickState state); public event diStateChange OnStateChange = null; + #endregion Variables + #region Constructor / Deconstructor + public DirectInputListener() { // @@ -52,29 +59,29 @@ // } - ~DirectInputListener() { StopListener(); DeInitDevice(); } + #endregion Constructor / Deconstructor + + #region Properties + public Device SelectedDevice { get { return device; } } - public bool IsRunning - { - get { return isRunning; } - } - public int Delay { get { return delay; } set { delay = value; } } + #endregion Properties + public bool InitDevice(Guid guid) { device = new Device(guid); @@ -87,16 +94,16 @@ if ((doi.ObjectId & (int) DeviceObjectTypeFlags.Axis) != 0) { // We found an axis, set the range to a max of 10,000 - device.Properties.SetRange(ParameterHow.ById, - doi.ObjectId, new InputRange(-5000, 5000)); + device.Properties.SetRange(ParameterHow.ById, doi.ObjectId, new InputRange(-5000, 5000)); } } + StopListener(); StartListener(); device.Acquire(); + return true; } - public void DeInitDevice() { if (null != device) @@ -113,11 +120,11 @@ } } - public string GetCurrentButtonCombo() { string res = ""; JoystickState state; + if (CheckDevice()) { // Get the state of the device. @@ -133,6 +140,7 @@ return res; } } + return res; } @@ -158,7 +166,7 @@ void ThreadFunction() { - while (true) + while (isListening) { UpdateInputState(); Thread.Sleep(delay); @@ -172,6 +180,7 @@ { return false; } + try { // Poll the device for info. @@ -198,7 +207,6 @@ return false; } } - } //catch(InputException inputex) return (device != null); @@ -207,6 +215,7 @@ void UpdateInputState() { JoystickState state; + if (CheckDevice()) { // Get the state of the device. @@ -214,12 +223,11 @@ { state = device.CurrentJoystickState; } - // Catch any exceptions. None will be handled here, - // any device re-aquisition will be handled above. - catch (InputException) + catch (InputException) // Catch any exceptions. None will be handled here, any device re-aquisition will be handled above. { return; } + // send events here if (null != this.OnStateChange) { @@ -231,31 +239,28 @@ public void StopListener() { - if (null != inputListener) - { - isRunning = false; + if (inputListener != null) + return; + + isListening = false; + + Thread.Sleep(500); + + if (inputListener != null && inputListener.IsAlive) inputListener.Abort(); - inputListener = null; - } + + inputListener = null; } void StartListener() { + isListening = true; + inputListener = new Thread(new ThreadStart(this.ThreadFunction)); + inputListener.IsBackground = true; inputListener.Start(); - isRunning = true; } - public void Pause() - { - isRunning = false; - } + } - public void Resume() - { - isRunning = true; - } - - - } -} \ No newline at end of file +} Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/DirectInputReceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/DirectInputReceiver.cs 2008-03-03 22:47:28 UTC (rev 1418) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/DirectInputReceiver.cs 2008-03-03 23:19:19 UTC (rev 1419) @@ -198,8 +198,9 @@ { if (_diListener != null) { - UnacquireDevice(); - + _diListener.DeInitDevice(); + _diListener.StopListener(); + _diListener.OnStateChange -= new DirectInputListener.diStateChange(diListener_OnStateChange); _diListener = null; } @@ -297,11 +298,6 @@ SendActions(state); } - void UnacquireDevice() - { - _diListener.DeInitDevice(); - } - bool AcquireDevice() { if (_deviceList == null) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2008-03-04 13:24:15
|
Revision: 1424 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1424&view=rev Author: and-81 Date: 2008-03-04 05:24:09 -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.cs trunk/plugins/IR Server Suite/Applications/Dbox Tuner/SetupForm.cs trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.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/GetKeyCodeForm.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/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs trunk/plugins/IR Server Suite/IR Server Suite - Debug.nsi trunk/plugins/IR Server Suite/IR Server Suite - Release.nsi trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/FusionREMOTE/FusionHDTV.xml trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/IgorPlug/Microsoft MCE.xml trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/Microsoft MCE/Microsoft MCE.xml trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/USB-UIRT/Microsoft MCE.xml trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/Windows Messages/Virtual Remote.xml trunk/plugins/IR Server Suite/Input Service/Input Service/InputService.cs Added Paths: ----------- trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/GBPVR.exe.xml trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/PVRX2.exe.xml Removed Paths: ------------- trunk/plugins/IR Server Suite/Applications/Abstractor/RemoteTable.Designer.cs trunk/plugins/IR Server Suite/Applications/Abstractor/RemoteTable.xsc trunk/plugins/IR Server Suite/Applications/Abstractor/RemoteTable.xsd trunk/plugins/IR Server Suite/Applications/Abstractor/RemoteTable.xss trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/Default.xml trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/Wii Remote.xml Modified: trunk/plugins/IR Server Suite/Applications/Abstractor/Abstractor.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/Abstractor/Abstractor.csproj 2008-03-04 13:23:12 UTC (rev 1423) +++ trunk/plugins/IR Server Suite/Applications/Abstractor/Abstractor.csproj 2008-03-04 13:24:09 UTC (rev 1424) @@ -53,26 +53,6 @@ <SubType>Designer</SubType> <DependentUpon>MainForm.cs</DependentUpon> </EmbeddedResource> - <None Include="RemoteTable.xsc"> - <DependentUpon>RemoteTable.xsd</DependentUpon> - <CopyToOutputDirectory>Always</CopyToOutputDirectory> - </None> - <None Include="RemoteTable.xsd"> - <Generator>MSDataSetGenerator</Generator> - <LastGenOutput>RemoteTable.Designer.cs</LastGenOutput> - <SubType>Designer</SubType> - <CopyToOutputDirectory>Always</CopyToOutputDirectory> - </None> - <None Include="RemoteTable.xss"> - <DependentUpon>RemoteTable.xsd</DependentUpon> - <CopyToOutputDirectory>Always</CopyToOutputDirectory> - </None> - <Compile Include="RemoteTable.Designer.cs"> - <AutoGen>True</AutoGen> - <DesignTime>True</DesignTime> - <DependentUpon>RemoteTable.xsd</DependentUpon> - <CopyToOutputDirectory>Always</CopyToOutputDirectory> - </Compile> </ItemGroup> <ItemGroup> <ProjectReference Include="..\..\Common\IrssComms\IrssComms.csproj"> Modified: trunk/plugins/IR Server Suite/Applications/Abstractor/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Abstractor/MainForm.cs 2008-03-04 13:23:12 UTC (rev 1423) +++ trunk/plugins/IR Server Suite/Applications/Abstractor/MainForm.cs 2008-03-04 13:24:09 UTC (rev 1424) @@ -616,7 +616,10 @@ } string device = comboBoxDevice.Text; - + + if (!Directory.Exists(device)) + Directory.CreateDirectory(device); + string fileName = Path.ChangeExtension(textBoxRemoteName.Text, ".xml"); string path = Path.Combine(device, fileName); Deleted: trunk/plugins/IR Server Suite/Applications/Abstractor/RemoteTable.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Abstractor/RemoteTable.Designer.cs 2008-03-04 13:23:12 UTC (rev 1423) +++ trunk/plugins/IR Server Suite/Applications/Abstractor/RemoteTable.Designer.cs 2008-03-04 13:24:09 UTC (rev 1424) @@ -1,528 +0,0 @@ -//------------------------------------------------------------------------------ -// <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> -//------------------------------------------------------------------------------ - -#pragma warning disable 1591 - -namespace Abstractor { - using System; - - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")] - [Serializable()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.ComponentModel.ToolboxItem(true)] - [System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedDataSetSchema")] - [System.Xml.Serialization.XmlRootAttribute("AbstractRemoteButtons")] - [System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")] - public partial class AbstractRemoteButtons : System.Data.DataSet { - - private RemoteTableDataTable tableRemoteTable; - - private System.Data.SchemaSerializationMode _schemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema; - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - public AbstractRemoteButtons() { - this.BeginInit(); - this.InitClass(); - System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged); - base.Tables.CollectionChanged += schemaChangedHandler; - base.Relations.CollectionChanged += schemaChangedHandler; - this.EndInit(); - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - protected AbstractRemoteButtons(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : - base(info, context, false) { - if ((this.IsBinarySerialized(info, context) == true)) { - this.InitVars(false); - System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler1 = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged); - this.Tables.CollectionChanged += schemaChangedHandler1; - this.Relations.CollectionChanged += schemaChangedHandler1; - return; - } - string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string)))); - if ((this.DetermineSchemaSerializationMode(info, context) == System.Data.SchemaSerializationMode.IncludeSchema)) { - System.Data.DataSet ds = new System.Data.DataSet(); - ds.ReadXmlSchema(new System.Xml.XmlTextReader(new System.IO.StringReader(strSchema))); - if ((ds.Tables["RemoteTable"] != null)) { - base.Tables.Add(new RemoteTableDataTable(ds.Tables["RemoteTable"])); - } - this.DataSetName = ds.DataSetName; - this.Prefix = ds.Prefix; - this.Namespace = ds.Namespace; - this.Locale = ds.Locale; - this.CaseSensitive = ds.CaseSensitive; - this.EnforceConstraints = ds.EnforceConstraints; - this.Merge(ds, false, System.Data.MissingSchemaAction.Add); - this.InitVars(); - } - else { - this.ReadXmlSchema(new System.Xml.XmlTextReader(new System.IO.StringReader(strSchema))); - } - this.GetSerializationData(info, context); - System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged); - base.Tables.CollectionChanged += schemaChangedHandler; - this.Relations.CollectionChanged += schemaChangedHandler; - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.ComponentModel.Browsable(false)] - [System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Content)] - public RemoteTableDataTable RemoteTable { - get { - return this.tableRemoteTable; - } - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.ComponentModel.BrowsableAttribute(true)] - [System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Visible)] - public override System.Data.SchemaSerializationMode SchemaSerializationMode { - get { - return this._schemaSerializationMode; - } - set { - this._schemaSerializationMode = value; - } - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] - public new System.Data.DataTableCollection Tables { - get { - return base.Tables; - } - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)] - public new System.Data.DataRelationCollection Relations { - get { - return base.Relations; - } - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - protected override void InitializeDerivedDataSet() { - this.BeginInit(); - this.InitClass(); - this.EndInit(); - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - public override System.Data.DataSet Clone() { - AbstractRemoteButtons cln = ((AbstractRemoteButtons)(base.Clone())); - cln.InitVars(); - cln.SchemaSerializationMode = this.SchemaSerializationMode; - return cln; - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - protected override bool ShouldSerializeTables() { - return false; - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - protected override bool ShouldSerializeRelations() { - return false; - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - protected override void ReadXmlSerializable(System.Xml.XmlReader reader) { - if ((this.DetermineSchemaSerializationMode(reader) == System.Data.SchemaSerializationMode.IncludeSchema)) { - this.Reset(); - System.Data.DataSet ds = new System.Data.DataSet(); - ds.ReadXml(reader); - if ((ds.Tables["RemoteTable"] != null)) { - base.Tables.Add(new RemoteTableDataTable(ds.Tables["RemoteTable"])); - } - this.DataSetName = ds.DataSetName; - this.Prefix = ds.Prefix; - this.Namespace = ds.Namespace; - this.Locale = ds.Locale; - this.CaseSensitive = ds.CaseSensitive; - this.EnforceConstraints = ds.EnforceConstraints; - this.Merge(ds, false, System.Data.MissingSchemaAction.Add); - this.InitVars(); - } - else { - this.ReadXml(reader); - this.InitVars(); - } - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - protected override System.Xml.Schema.XmlSchema GetSchemaSerializable() { - System.IO.MemoryStream stream = new System.IO.MemoryStream(); - this.WriteXmlSchema(new System.Xml.XmlTextWriter(stream, null)); - stream.Position = 0; - return System.Xml.Schema.XmlSchema.Read(new System.Xml.XmlTextReader(stream), null); - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - internal void InitVars() { - this.InitVars(true); - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - internal void InitVars(bool initTable) { - this.tableRemoteTable = ((RemoteTableDataTable)(base.Tables["RemoteTable"])); - if ((initTable == true)) { - if ((this.tableRemoteTable != null)) { - this.tableRemoteTable.InitVars(); - } - } - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - private void InitClass() { - this.DataSetName = "AbstractRemoteButtons"; - this.Prefix = ""; - this.Locale = new System.Globalization.CultureInfo("en"); - this.EnforceConstraints = true; - this.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema; - this.tableRemoteTable = new RemoteTableDataTable(); - base.Tables.Add(this.tableRemoteTable); - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - private bool ShouldSerializeRemoteTable() { - return false; - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - private void SchemaChanged(object sender, System.ComponentModel.CollectionChangeEventArgs e) { - if ((e.Action == System.ComponentModel.CollectionChangeAction.Remove)) { - this.InitVars(); - } - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(System.Xml.Schema.XmlSchemaSet xs) { - AbstractRemoteButtons ds = new AbstractRemoteButtons(); - System.Xml.Schema.XmlSchemaComplexType type = new System.Xml.Schema.XmlSchemaComplexType(); - System.Xml.Schema.XmlSchemaSequence sequence = new System.Xml.Schema.XmlSchemaSequence(); - xs.Add(ds.GetSchemaSerializable()); - System.Xml.Schema.XmlSchemaAny any = new System.Xml.Schema.XmlSchemaAny(); - any.Namespace = ds.Namespace; - sequence.Items.Add(any); - type.Particle = sequence; - return type; - } - - public delegate void RemoteTableRowChangeEventHandler(object sender, RemoteTableRowChangeEvent e); - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")] - [System.Serializable()] - [System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] - public partial class RemoteTableDataTable : System.Data.DataTable, System.Collections.IEnumerable { - - private System.Data.DataColumn columnRawCode; - - private System.Data.DataColumn columnAbstractButton; - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - public RemoteTableDataTable() { - this.TableName = "RemoteTable"; - this.BeginInit(); - this.InitClass(); - this.EndInit(); - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - internal RemoteTableDataTable(System.Data.DataTable table) { - this.TableName = table.TableName; - if ((table.CaseSensitive != table.DataSet.CaseSensitive)) { - this.CaseSensitive = table.CaseSensitive; - } - if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) { - this.Locale = table.Locale; - } - if ((table.Namespace != table.DataSet.Namespace)) { - this.Namespace = table.Namespace; - } - this.Prefix = table.Prefix; - this.MinimumCapacity = table.MinimumCapacity; - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - protected RemoteTableDataTable(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : - base(info, context) { - this.InitVars(); - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - public System.Data.DataColumn RawCodeColumn { - get { - return this.columnRawCode; - } - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - public System.Data.DataColumn AbstractButtonColumn { - get { - return this.columnAbstractButton; - } - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.ComponentModel.Browsable(false)] - public int Count { - get { - return this.Rows.Count; - } - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - public RemoteTableRow this[int index] { - get { - return ((RemoteTableRow)(this.Rows[index])); - } - } - - public event RemoteTableRowChangeEventHandler RemoteTableRowChanging; - - public event RemoteTableRowChangeEventHandler RemoteTableRowChanged; - - public event RemoteTableRowChangeEventHandler RemoteTableRowDeleting; - - public event RemoteTableRowChangeEventHandler RemoteTableRowDeleted; - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - public void AddRemoteTableRow(RemoteTableRow row) { - this.Rows.Add(row); - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - public RemoteTableRow AddRemoteTableRow(string RawCode, string AbstractButton) { - RemoteTableRow rowRemoteTableRow = ((RemoteTableRow)(this.NewRow())); - rowRemoteTableRow.ItemArray = new object[] { - RawCode, - AbstractButton}; - this.Rows.Add(rowRemoteTableRow); - return rowRemoteTableRow; - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - public virtual System.Collections.IEnumerator GetEnumerator() { - return this.Rows.GetEnumerator(); - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - public override System.Data.DataTable Clone() { - RemoteTableDataTable cln = ((RemoteTableDataTable)(base.Clone())); - cln.InitVars(); - return cln; - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - protected override System.Data.DataTable CreateInstance() { - return new RemoteTableDataTable(); - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - internal void InitVars() { - this.columnRawCode = base.Columns["RawCode"]; - this.columnAbstractButton = base.Columns["AbstractButton"]; - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - private void InitClass() { - this.columnRawCode = new System.Data.DataColumn("RawCode", typeof(string), null, System.Data.MappingType.Attribute); - base.Columns.Add(this.columnRawCode); - this.columnAbstractButton = new System.Data.DataColumn("AbstractButton", typeof(string), null, System.Data.MappingType.Attribute); - base.Columns.Add(this.columnAbstractButton); - this.Constraints.Add(new System.Data.UniqueConstraint("Constraint1", new System.Data.DataColumn[] { - this.columnRawCode}, false)); - this.columnRawCode.Unique = true; - this.columnRawCode.Namespace = ""; - this.columnRawCode.Caption = "Raw Code"; - this.columnRawCode.DefaultValue = ((string)("")); - this.columnAbstractButton.Namespace = ""; - this.columnAbstractButton.Caption = "Abstract Button"; - this.columnAbstractButton.DefaultValue = ((string)("")); - this.Locale = new System.Globalization.CultureInfo("en"); - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - public RemoteTableRow NewRemoteTableRow() { - return ((RemoteTableRow)(this.NewRow())); - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - protected override System.Data.DataRow NewRowFromBuilder(System.Data.DataRowBuilder builder) { - return new RemoteTableRow(builder); - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - protected override System.Type GetRowType() { - return typeof(RemoteTableRow); - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - protected override void OnRowChanged(System.Data.DataRowChangeEventArgs e) { - base.OnRowChanged(e); - if ((this.RemoteTableRowChanged != null)) { - this.RemoteTableRowChanged(this, new RemoteTableRowChangeEvent(((RemoteTableRow)(e.Row)), e.Action)); - } - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - protected override void OnRowChanging(System.Data.DataRowChangeEventArgs e) { - base.OnRowChanging(e); - if ((this.RemoteTableRowChanging != null)) { - this.RemoteTableRowChanging(this, new RemoteTableRowChangeEvent(((RemoteTableRow)(e.Row)), e.Action)); - } - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - protected override void OnRowDeleted(System.Data.DataRowChangeEventArgs e) { - base.OnRowDeleted(e); - if ((this.RemoteTableRowDeleted != null)) { - this.RemoteTableRowDeleted(this, new RemoteTableRowChangeEvent(((RemoteTableRow)(e.Row)), e.Action)); - } - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - protected override void OnRowDeleting(System.Data.DataRowChangeEventArgs e) { - base.OnRowDeleting(e); - if ((this.RemoteTableRowDeleting != null)) { - this.RemoteTableRowDeleting(this, new RemoteTableRowChangeEvent(((RemoteTableRow)(e.Row)), e.Action)); - } - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - public void RemoveRemoteTableRow(RemoteTableRow row) { - this.Rows.Remove(row); - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - public static System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(System.Xml.Schema.XmlSchemaSet xs) { - System.Xml.Schema.XmlSchemaComplexType type = new System.Xml.Schema.XmlSchemaComplexType(); - System.Xml.Schema.XmlSchemaSequence sequence = new System.Xml.Schema.XmlSchemaSequence(); - AbstractRemoteButtons ds = new AbstractRemoteButtons(); - xs.Add(ds.GetSchemaSerializable()); - System.Xml.Schema.XmlSchemaAny any1 = new System.Xml.Schema.XmlSchemaAny(); - any1.Namespace = "http://www.w3.org/2001/XMLSchema"; - any1.MinOccurs = new decimal(0); - any1.MaxOccurs = decimal.MaxValue; - any1.ProcessContents = System.Xml.Schema.XmlSchemaContentProcessing.Lax; - sequence.Items.Add(any1); - System.Xml.Schema.XmlSchemaAny any2 = new System.Xml.Schema.XmlSchemaAny(); - any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1"; - any2.MinOccurs = new decimal(1); - any2.ProcessContents = System.Xml.Schema.XmlSchemaContentProcessing.Lax; - sequence.Items.Add(any2); - System.Xml.Schema.XmlSchemaAttribute attribute1 = new System.Xml.Schema.XmlSchemaAttribute(); - attribute1.Name = "namespace"; - attribute1.FixedValue = ds.Namespace; - type.Attributes.Add(attribute1); - System.Xml.Schema.XmlSchemaAttribute attribute2 = new System.Xml.Schema.XmlSchemaAttribute(); - attribute2.Name = "tableTypeName"; - attribute2.FixedValue = "RemoteTableDataTable"; - type.Attributes.Add(attribute2); - type.Particle = sequence; - return type; - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")] - public partial class RemoteTableRow : System.Data.DataRow { - - private RemoteTableDataTable tableRemoteTable; - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - internal RemoteTableRow(System.Data.DataRowBuilder rb) : - base(rb) { - this.tableRemoteTable = ((RemoteTableDataTable)(this.Table)); - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - public string RawCode { - get { - try { - return ((string)(this[this.tableRemoteTable.RawCodeColumn])); - } - catch (System.InvalidCastException e) { - throw new System.Data.StrongTypingException("The value for column \'RawCode\' in table \'RemoteTable\' is DBNull.", e); - } - } - set { - this[this.tableRemoteTable.RawCodeColumn] = value; - } - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - public string AbstractButton { - get { - if (this.IsAbstractButtonNull()) { - return string.Empty; - } - else { - return ((string)(this[this.tableRemoteTable.AbstractButtonColumn])); - } - } - set { - this[this.tableRemoteTable.AbstractButtonColumn] = value; - } - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - public bool IsRawCodeNull() { - return this.IsNull(this.tableRemoteTable.RawCodeColumn); - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - public void SetRawCodeNull() { - this[this.tableRemoteTable.RawCodeColumn] = System.Convert.DBNull; - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - public bool IsAbstractButtonNull() { - return this.IsNull(this.tableRemoteTable.AbstractButtonColumn); - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - public void SetAbstractButtonNull() { - this[this.tableRemoteTable.AbstractButtonColumn] = System.Convert.DBNull; - } - } - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")] - public class RemoteTableRowChangeEvent : System.EventArgs { - - private RemoteTableRow eventRow; - - private System.Data.DataRowAction eventAction; - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - public RemoteTableRowChangeEvent(RemoteTableRow row, System.Data.DataRowAction action) { - this.eventRow = row; - this.eventAction = action; - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - public RemoteTableRow Row { - get { - return this.eventRow; - } - } - - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - public System.Data.DataRowAction Action { - get { - return this.eventAction; - } - } - } - } -} - -#pragma warning restore 1591 \ No newline at end of file Deleted: trunk/plugins/IR Server Suite/Applications/Abstractor/RemoteTable.xsc =================================================================== (Binary files differ) Deleted: trunk/plugins/IR Server Suite/Applications/Abstractor/RemoteTable.xsd =================================================================== --- trunk/plugins/IR Server Suite/Applications/Abstractor/RemoteTable.xsd 2008-03-04 13:23:12 UTC (rev 1423) +++ trunk/plugins/IR Server Suite/Applications/Abstractor/RemoteTable.xsd 2008-03-04 13:24:09 UTC (rev 1424) @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<xs:schema id="AbstractRemoteButtons" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop"> - <xs:annotation> - <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource"> - <DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource"> - <Connections> - </Connections> - <Tables> - </Tables> - <Sources> - </Sources> - </DataSource> - </xs:appinfo> - </xs:annotation> - <xs:element name="AbstractRemoteButtons" msdata:IsDataSet="true" msdata:Locale="en" msprop:Generator_UserDSName="AbstractRemoteButtons" msprop:Generator_DataSetName="AbstractRemoteButtons"> - <xs:complexType> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="RemoteTable" msdata:Locale="en" msprop:Generator_UserTableName="RemoteTable" msprop:Generator_RowDeletedName="RemoteTableRowDeleted" msprop:Generator_RowChangedName="RemoteTableRowChanged" msprop:Generator_RowClassName="RemoteTableRow" msprop:Generator_RowChangingName="RemoteTableRowChanging" msprop:Generator_RowEvArgName="RemoteTableRowChangeEvent" msprop:Generator_RowEvHandlerName="RemoteTableRowChangeEventHandler" msprop:Generator_TableClassName="RemoteTableDataTable" msprop:Generator_TableVarName="tableRemoteTable" msprop:Generator_RowDeletingName="RemoteTableRowDeleting" msprop:Generator_TablePropName="RemoteTable"> - <xs:complexType> - <xs:attribute name="RawCode" msdata:Caption="Raw Code" msprop:Generator_UserColumnName="RawCode" msprop:nullValue="_throw" msprop:Generator_ColumnPropNameInRow="RawCode" msprop:Generator_ColumnPropNameInTable="RawCodeColumn" msprop:Generator_ColumnVarNameInTable="columnRawCode" type="xs:string" default="" /> - <xs:attribute name="AbstractButton" msdata:Caption="Abstract Button" msprop:Generator_UserColumnName="AbstractButton" msprop:nullValue="_empty" msprop:Generator_ColumnPropNameInRow="AbstractButton" msprop:Generator_ColumnPropNameInTable="AbstractButtonColumn" msprop:Generator_ColumnVarNameInTable="columnAbstractButton" type="xs:string" default="" /> - </xs:complexType> - </xs:element> - </xs:choice> - </xs:complexType> - <xs:unique name="Constraint1"> - <xs:selector xpath=".//RemoteTable" /> - <xs:field xpath="@RawCode" /> - </xs:unique> - </xs:element> -</xs:schema> \ No newline at end of file Deleted: trunk/plugins/IR Server Suite/Applications/Abstractor/RemoteTable.xss =================================================================== (Binary files differ) Modified: trunk/plugins/IR Server Suite/Applications/Dbox Tuner/SetupForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Dbox Tuner/SetupForm.cs 2008-03-04 13:23:12 UTC (rev 1423) +++ trunk/plugins/IR Server Suite/Applications/Dbox Tuner/SetupForm.cs 2008-03-04 13:24:09 UTC (rev 1424) @@ -235,17 +235,18 @@ { StatusMessage("Detected box type: {0}", _boxType); - DataTable bouquets = Program.GetData(url, UserName, Password, BoxType).Tables[0]; + DataSet dataSet = Program.GetData(url, UserName, Password, BoxType); + DataTable dataTable = dataSet.Tables[0]; - if (bouquets.Rows.Count != 0) - StatusMessage("{0} channels found", bouquets.Rows.Count); + if (dataTable.Rows.Count != 0) + StatusMessage("{0} channels found", dataTable.Rows.Count); else StatusMessage("ERROR - No channels found!"); if (File.Exists(Program.DataFile)) File.Delete(Program.DataFile); - bouquets.WriteXml(Program.DataFile, XmlWriteMode.WriteSchema); + dataTable.WriteXml(Program.DataFile, XmlWriteMode.WriteSchema); } } catch (Exception ex) Modified: trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2008-03-04 13:23:12 UTC (rev 1423) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2008-03-04 13:24:09 UTC (rev 1424) @@ -1,6 +1,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Data; using System.IO; using System.Net; using System.Net.Sockets; @@ -51,36 +52,42 @@ #region Constants - static readonly string ConfigurationFile = Path.Combine(Common.FolderAppData, "IR Server\\IR Server.xml"); + static readonly string ConfigurationFile = Path.Combine(Common.FolderAppData, "IR Server\\IR Server.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 #region Variables NotifyIcon _notifyIcon; + bool _inConfiguration; - List<ClientManager> _registeredClients; - List<ClientManager> _registeredRepeaters; - - Server _server; - Client _client; - + bool _abstractRemoteMode; IRServerMode _mode; string _hostComputer; - bool _registered; // Used for relay and repeater modes. - string[] _pluginNameReceive; List<PluginBase> _pluginReceive; string _pluginNameTransmit; PluginBase _pluginTransmit; - bool _inConfiguration; + Server _server; + Client _client; + List<ClientManager> _registeredClients; + List<ClientManager> _registeredRepeaters; + + bool _registered; // Used for relay and repeater modes. + + DataSet _abstractRemoteButtons; + #endregion Variables - #region Constructor / Destructor + #region Constructor /// <summary> /// Initializes a new instance of the <see cref="IRServer"/> class. @@ -106,7 +113,7 @@ } */ - #endregion Constructor / Destructor + #endregion Constructor #region IDisposable @@ -150,71 +157,82 @@ /// <returns><c>true</c> if successful, otherwise <c>false</c>.</returns> internal bool Start() { - try - { - IrssLog.Info("Starting IR Server ..."); + IrssLog.Info("Starting IR Server ..."); - LoadSettings(); + LoadSettings(); - // Load IR Plugins ... - _pluginReceive = null; - _pluginTransmit = null; + #region Load plugin(s) - if (_pluginNameReceive == null && String.IsNullOrEmpty(_pluginNameTransmit)) + _pluginReceive = null; + _pluginTransmit = null; + + if (_pluginNameReceive == null && String.IsNullOrEmpty(_pluginNameTransmit)) + { + IrssLog.Warn("No transmit or receive plugins loaded"); + } + else + { + if (_pluginNameReceive == null) { - IrssLog.Warn("No transmit or receive plugins loaded"); + IrssLog.Warn("No receiver plugins loaded"); } else { - if (_pluginNameReceive == null) + _pluginReceive = new List<PluginBase>(_pluginNameReceive.Length); + + for (int index = 0; index < _pluginNameReceive.Length; index++) { - IrssLog.Warn("No receiver plugins loaded"); - } - else - { - _pluginReceive = new List<PluginBase>(_pluginNameReceive.Length); - - for (int index = 0; index < _pluginNameReceive.Length; index++) + try { - try - { - string pluginName = _pluginNameReceive[index]; + string pluginName = _pluginNameReceive[index]; - PluginBase plugin = Program.GetPlugin(pluginName); + PluginBase plugin = Program.GetPlugin(pluginName); - if (plugin == null) - { - IrssLog.Warn("Receiver plugin not found: {0}", pluginName); - } - else - { - _pluginReceive.Add(plugin); - - if (!String.IsNullOrEmpty(_pluginNameTransmit) && plugin.Name.Equals(_pluginNameTransmit, StringComparison.OrdinalIgnoreCase)) - _pluginTransmit = plugin; - } + if (plugin == null) + { + IrssLog.Warn("Receiver plugin not found: {0}", pluginName); } - catch (Exception ex) + else { - IrssLog.Error(ex); + _pluginReceive.Add(plugin); + + if (!String.IsNullOrEmpty(_pluginNameTransmit) && plugin.Name.Equals(_pluginNameTransmit, StringComparison.OrdinalIgnoreCase)) + _pluginTransmit = plugin; } } - - if (_pluginReceive.Count == 0) - _pluginReceive = null; + catch (Exception ex) + { + IrssLog.Error(ex); + } } - if (String.IsNullOrEmpty(_pluginNameTransmit)) + if (_pluginReceive.Count == 0) + _pluginReceive = null; + } + + if (String.IsNullOrEmpty(_pluginNameTransmit)) + { + IrssLog.Warn("No transmit plugin loaded"); + } + else if (_pluginTransmit == null) + { + try { - IrssLog.Info("No transmit plugin loaded"); + _pluginTransmit = Program.GetPlugin(_pluginNameTransmit); } - else if (_pluginTransmit == null) + catch (Exception ex) { - _pluginTransmit = Program.GetPlugin(_pluginNameTransmit); + IrssLog.Error(ex); } } + } + + #endregion Load plugin(s) - // Mode select ... + #region Mode select + + try + { switch (_mode) { case IRServerMode.ServerMode: @@ -236,89 +254,111 @@ IrssLog.Error("Failed to start in Repeater Mode"); break; } + } + catch (Exception ex) + { + IrssLog.Error("Failed to start Input Service Communications"); + IrssLog.Error(ex); + } - // Start plugin(s) ... + #endregion Mode select - bool startedTransmit = false; + #region Start plugin(s) - if (_pluginReceive != null) + bool startedTransmit = false; + + if (_pluginReceive != null) + { + List<PluginBase> removePlugins = new List<PluginBase>(); + + foreach (PluginBase plugin in _pluginReceive) { - List<PluginBase> removePlugins = new List<PluginBase>(); - - foreach (PluginBase plugin in _pluginReceive) + try { - try - { - plugin.Start(); + plugin.Start(); - IRemoteReceiver remoteReceiver = plugin as IRemoteReceiver; - if (remoteReceiver != null) - remoteReceiver.RemoteCallback += new RemoteHandler(RemoteHandlerCallback); + IRemoteReceiver remoteReceiver = plugin as IRemoteReceiver; + if (remoteReceiver != null) + remoteReceiver.RemoteCallback += new RemoteHandler(RemoteHandlerCallback); - IKeyboardReceiver keyboardReceiver = plugin as IKeyboardReceiver; - if (keyboardReceiver != null) - keyboardReceiver.KeyboardCallback += new KeyboardHandler(KeyboardHandlerCallback); + IKeyboardReceiver keyboardReceiver = plugin as IKeyboardReceiver; + if (keyboardReceiver != null) + keyboardReceiver.KeyboardCallback += new KeyboardHandler(KeyboardHandlerCallback); - IMouseReceiver mouseReceiver = plugin as IMouseReceiver; - if (mouseReceiver != null) - mouseReceiver.MouseCallback += new MouseHandler(MouseHandlerCallback); + IMouseReceiver mouseReceiver = plugin as IMouseReceiver; + if (mouseReceiver != null) + mouseReceiver.MouseCallback += new MouseHandler(MouseHandlerCallback); - if (plugin.Name.Equals(_pluginNameTransmit, StringComparison.OrdinalIgnoreCase)) - { - startedTransmit = true; - IrssLog.Info("Transmit and Receive plugin started: \"{0}\"", plugin.Name); - } - else - { - IrssLog.Info("Receiver plugin started: \"{0}\"", plugin.Name); - } + if (plugin.Name.Equals(_pluginNameTransmit, StringComparison.OrdinalIgnoreCase)) + { + startedTransmit = true; + IrssLog.Info("Transmit and Receive plugin started: \"{0}\"", plugin.Name); } - catch (Exception ex) + else { - IrssLog.Error("Failed to start receive plugin: \"{0}\"", plugin.Name); - IrssLog.Error(ex); - - removePlugins.Add(plugin); + IrssLog.Info("Receiver plugin started: \"{0}\"", plugin.Name); } } + catch (Exception ex) + { + IrssLog.Error("Failed to start receive plugin: \"{0}\"", plugin.Name); + IrssLog.Error(ex); + removePlugins.Add(plugin); + } + } + + if (removePlugins.Count > 0) foreach (PluginBase plugin in removePlugins) _pluginReceive.Remove(plugin); - if (_pluginReceive.Count == 0) - _pluginReceive = null; - } + if (_pluginReceive.Count == 0) + _pluginReceive = null; + } - if (_pluginTransmit != null && !startedTransmit) + if (_pluginTransmit != null && !startedTransmit) + { + try { - try - { - _pluginTransmit.Start(); + _pluginTransmit.Start(); - IrssLog.Info("Transmit plugin started: \"{0}\"", _pluginNameTransmit); - } - catch (Exception ex) - { - IrssLog.Error("Failed to start transmit plugin: \"{0}\"", _pluginNameTransmit); - IrssLog.Error(ex); + IrssLog.Info("Transmit plugin started: \"{0}\"", _pluginNameTransmit); + } + catch (Exception ex) + { + IrssLog.Error("Failed to start transmit plugin: \"{0}\"", _pluginNameTransmit); + IrssLog.Error(ex); - _pluginTransmit = null; - } + _pluginTransmit = null; } + } - _notifyIcon.Visible = true; + #endregion Start plugin(s) - SystemEvents.PowerModeChanged += new PowerModeChangedEventHandler(SystemEvents_PowerModeChanged); + #region Setup Abstract Remote Model processing - IrssLog.Info("IR Server started"); + if (_abstractRemoteMode) + { + IrssLog.Info("IR Server is running in Abstract Remote mode"); - return true; + _abstractRemoteButtons = new DataSet("AbstractRemoteButtons"); + _abstractRemoteButtons.CaseSensitive = true; + + List<string> receivers = new List<string>(_pluginReceive.Count); + foreach (PluginBase plugin in _pluginReceive) + if (plugin is IRemoteReceiver) + LoadAbstractDeviceFiles(plugin.Name); } - catch (Exception ex) - { - IrssLog.Error(ex); - return false; - } + + #endregion Setup Abstract Remote Model processing + + _notifyIcon.Visible = true; + + SystemEvents.PowerModeChanged += new PowerModeChangedEventHandler(SystemEvents_PowerModeChanged); + + IrssLog.Info("IR Server started"); + + return true; } /// <summary> @@ -669,7 +709,7 @@ { if (_client == null) return; - + _client.Dispose(); _client = null; @@ -751,9 +791,41 @@ { IrssLog.Debug("{0} generated a remote event: {1}", deviceName, keyCode); - byte[] deviceNameBytes = Encoding.ASCII.GetBytes(deviceName); - byte[] keyCodeBytes = Encoding.ASCII.GetBytes(keyCode); + string messageDeviceName = deviceName; + string messageKeyCode = keyCode; + switch (_mode) + { + case IRServerMode.ServerMode: + if (_abstractRemoteMode) + { + string abstractButton = LookupAbstractButton(deviceName, keyCode); + if (!String.IsNullOrEmpty(abstractButton)) + { + messageDeviceName = "Abstract"; + messageKeyCode = abstractButton; + + IrssLog.Info("Abstract Remote Button mapped: {0}", abstractButton); + } + else + { + IrssLog.Info("Abstract Remote Button not found: {0} ({1})", deviceName, keyCode); + } + } + break; + + case IRServerMode.RelayMode: + // Don't do anything in relay mode, just pass it on. + break; + + case IRServerMode.RepeaterMode: + IrssLog.Debug("Remote event ignored, IR Server is in Repeater Mode."); + return; + } + + byte[] deviceNameBytes = Encoding.ASCII.GetBytes(messageDeviceName); + byte[] keyCodeBytes = Encoding.ASCII.GetBytes(messageKeyCode); + byte[] bytes = new byte[8 + deviceNameBytes.Length + keyCodeBytes.Length]; BitConverter.GetBytes(deviceNameBytes.Length).CopyTo(bytes, 0); @@ -776,15 +848,8 @@ _client.Send(message); break; } - - case IRServerMode.RepeaterMode: - { - IrssLog.Debug("Remote event ignored, IR Server is in Repeater Mode."); - break; - } } } - void KeyboardHandlerCallback(string deviceName, int vKey, bool keyUp) { IrssLog.Debug("{0} generated a keyboard event: {1}, keyUp: {2}", deviceName, vKey, keyUp); @@ -816,7 +881,6 @@ } } } - void MouseHandlerCallback(string deviceName, int deltaX, int deltaY, int buttons) { IrssLog.Debug("{0} generated a mouse Event - deltaX: {1}, deltaY: {2}, buttons: {3}", deviceName, deltaX, deltaY, buttons); @@ -1103,7 +1167,55 @@ } else { - IrssMessage forward = new IrssMessage(MessageType.RemoteEvent, MessageFlags.Notify, combo.Message.GetDataAsBytes()); + byte[] data = combo.Message.GetDataAsBytes(); + + if (_abstractRemoteMode) + { + // Decode message ... + int deviceNameSize = BitConverter.ToInt32(data, 0); + string deviceName = Encoding.ASCII.GetString(data, 4, deviceNameSize); + int keyCodeSize = BitConverter.ToInt32(data, 4 + deviceNameSize); + string keyCode = Encoding.ASCII.GetString(data, 8 + deviceNameSize, keyCodeSize); + + // Check that the device maps are loaded for the forwarded device + bool foundDevice = false; + foreach (PluginBase plugin in _pluginReceive) + { + if (plugin is IRemoteReceiver && plugin.Name.Equals(deviceName, StringComparison.OrdinalIgnoreCase)) + { + foundDevice = true; + break; + } + } + + // If the remote maps are not already loaded for this device then attempt to load them + if (!foundDevice) + LoadAbstractDeviceFiles(deviceName); + + // Find abstract button mapping + string abstractButton = LookupAbstractButton(deviceName, keyCode); + if (String.IsNullOrEmpty(abstractButton)) + { + IrssLog.Info("Abstract Remote Button mapped from forwarded remote event: {0}", abstractButton); + + // Encode new message ... + byte[] deviceNameBytes = Encoding.ASCII.GetBytes("Abstract"); + byte[] keyCodeBytes = Encoding.ASCII.GetBytes(abstractButton); + + data = new byte[8 + deviceNameBytes.Length + keyCodeBytes.Length]; + + BitConverter.GetBytes(deviceNameBytes.Length).CopyTo(data, 0); + deviceNameBytes.CopyTo(data, 4); + BitConverter.GetBytes(keyCodeBytes.Length).CopyTo(data, 4 + deviceNameBytes.Length); + keyCodeBytes.CopyTo(data, 8 + deviceNameBytes.Length); + } + else + { + IrssLog.Info("Abstract Remote Button not found for forwarded remote event: {0} ({1})", deviceName, keyCode); + } + } + + IrssMessage forward = new IrssMessage(MessageType.RemoteEvent, MessageFlags.Notify, data); SendToAllExcept(combo.Manager, forward); } break; @@ -1509,6 +1621,7 @@ void LoadSettings() { + _abstractRemoteMode = false; _mode = IRServerMode.ServerMode; _hostComputer = String.Empty; _pluginNameReceive = null; @@ -1542,6 +1655,9 @@ return; } + try { _abstractRemoteMode = bool.Parse(doc.DocumentElement.Attributes["AbstractRemoteMode"].Value); } + catch (Exception ex) { IrssLog.Warn(ex.ToString()); } + try { _mode = (IRServerMode)Enum.Parse(typeof(IRServerMode), doc.DocumentElement.Attributes["Mode"].Value, true); } catch (Exception ex) { IrssLog.Warn(ex.ToString()); } @@ -1574,6 +1690,7 @@ writer.WriteStartDocument(true); writer.WriteStartElement("settings"); // <settings> + writer.WriteAttributeString("AbstractRemoteMode", _abstractRemoteMode.ToString()); writer.WriteAttributeString("Mode", Enum.GetName(typeof(IRServerMode), _mode)); writer.WriteAttributeString("HostComputer", _hostComputer); writer.WriteAttributeString("PluginTransmit", _pluginNameTransmit); @@ -1628,6 +1745,70 @@ } } + string LookupAbstractButton(string deviceName, string keyCode) + { + if (_abstractRemoteButtons == null || _abstractRemoteButtons.Tables.Count == 0) + return null; + + try + { + 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)) + { + IrssLog.Debug(button + ", remote: " + table.ExtendedProperties["Remote"] as string + ", device: " + deviceName); + return button; + } + } + } + } + } + catch (Exception ex) + { + IrssLog.Error(ex); + } + + return null; + //return String.Format("{0} ({1})", deviceName, keyCode); + } + + void LoadAbstractDeviceFiles(string device) + { + string path = Path.Combine(AbstractRemoteMapFolder, device); + string[] files = Directory.GetFiles(path, "*.xml", SearchOption.TopDirectoryOnly); + foreach (string file in files) + { + string remote = Path.GetFileNameWithoutExtension(file); + string tableName = String.Format("{0}:{1}", device, remote); + if (_abstractRemoteButtons.Tables.Contains(tableName)) + { + IrssLog.Warn("Abstract Remote Table already loaded ({0})", tableName); + continue; + } + + DataTable table = _abstractRemoteButtons.Tables.Add("RemoteTable"); + table.ReadXmlSchema(AbstractRemoteSchemaFile); + table.ReadXml(file); + + table.ExtendedProperties.Add("Device", device); + table.ExtendedProperties.Add("Remote", remote); + + table.TableName = tableName; + + IrssLog.Info("Abstract Remote Table ({0}) loaded", tableName); + } + } + #endregion Implementation } Deleted: trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/Default.xml =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/Default.xml 2008-03-04 13:23:12 UTC (rev 1423) +++ trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/Default.xml 2008-03-04 13:24:09 UTC (rev 1424) @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> - <ServerHost>localhost</ServerHost> - <SystemWideMappings /> - <Programs> - <ProgramSettings Name="MediaPortal" Filename="C:\Program Files\Team MediaPortal\MediaPortal\MediaPortal.exe" Folder="C:\Program Files\Team MediaPortal\MediaPortal" Arguments="" UseShellExecute="false" ForceWindowFocus="false" IgnoreSystemWide="true" WindowState="Normal"> - <ButtonMappings /> - </ProgramSettings> - </Programs> - <Events /> -</Configuration> \ No newline at end of file Added: trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/GBPVR.exe.xml =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/GBPVR.exe.xml (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/GBPVR.exe.xml 2008-03-04 13:24:09 UTC (rev 1424) @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="utf-8"?> +<Configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <Programs> + <ProgramSettings Name="GBPVR" FileName="C:\Program Files\devnz\gbpvr\GBPVR.exe" Folder="C:\Program Files\devnz\gbpvr" Arguments="" UseShellExecute="false" ForceWindowFocus="false" IgnoreSystemWide="false" WindowState="Normal"> + <ButtonMappings> + <ButtonMapping KeyCode="31743" Description="0" Command="Keys: {NUM0}" /> + <ButtonMapping KeyCode="31742" Description="1" Command="Keys: {NUM1}" /> + <ButtonMapping KeyCode="31741" Description="2" Command="Keys: {NUM2}" /> + <ButtonMapping KeyCode="31740" Description="3" Command="Keys: {NUM3}" /> + <ButtonMapping KeyCode="31739" Description="4" Command="Keys: {NUM4}" /> + <ButtonMapping KeyCode="31738" Description="5" Command="Keys: {NUM5}" /> + <ButtonMapping KeyCode="31737" Description="6" Command="Keys: {NUM6}" /> + <ButtonMapping KeyCode="31736" Description="7" Command="Keys: {NUM7}" /> + <ButtonMapping KeyCode="31735" Description="8" Command="Keys: {NUM8}" /> + <ButtonMapping KeyCode="31734" Description="9" Command="Keys: {NUM9}" /> + <ButtonMapping KeyCode="31713" Description="UP" Command="Keys: {UP}" /> + <ButtonMapping KeyCode="31712" Description="DOWN" Command="Keys: {DOWN}" /> + <ButtonMapping KeyCode="31711" Description="LEFT" Command="Keys: {LEFT}" /> + <ButtonMapping KeyCode="31710" Description="RIGHT" Command="Keys: {RIGHT}" /> + <ButtonMapping KeyCode="31709" Description="OK" Command="Keys: {ENTER}" /> + <ButtonMapping KeyCode="31722" Description="REW" Command="Keys: ^d" /> + <ButtonMapping KeyCode="31723" Description="FF" Command="Keys: ^f" /> + <ButtonMapping KeyCode="31721" Description="PLAY" Command="Keys: ^p" /> + <ButtonMapping KeyCode="31719" Description="PAUSE" Command="Keys: ^q" /> + <ButtonMapping KeyCode="31718" Description="STOP" Command="Keys: ^s" /> + <ButtonMapping KeyCode="31720" Description="RECORD" Command="Keys: ^k" /> + <ButtonMapping KeyCode="31716" Description="Track-" Command="Keys: ^{LEFT}" /> + <ButtonMapping KeyCode="31717" Description="Track+" Command="Keys: ^{RIGHT}" /> + <ButtonMapping KeyCode="31708" Description="Back" Command="Keys: {ESC}" /> + <ButtonMapping KeyCode="31728" Description="Info" Command="Keys: ^b" /> + <ButtonMapping KeyCode="31725" Description="Ch+" Command="Keys: {PGUP}" /> + <ButtonMapping KeyCode="31724" Description="Ch-" Command="Keys: {PGDN}" /> + <ButtonMapping KeyCode="31671" Description="Recorded TV" Command="Keys: {F8}" /> + <ButtonMapping KeyCode="31705" Description="Guide" Command="Keys: {F1}" /> + <ButtonMapping KeyCode="31706" Description="Live TV" Command="Keys: {F2}" /> + <ButtonMapping KeyCode="31730" Description="Last Channel" Command="Keys: ^w" /> + <ButtonMapping KeyCode="31714" Description="Videos" Command="Keys: {F3}" /> + <ButtonMapping KeyCode="31715" Description="Radio" Command="Keys: {F6}" /> + <ButtonMapping KeyCode="31732" Description="Audio" Command="Keys: {F4}" /> + <ButtonMapping KeyCode="31731" Description="Main Menu" Command="Keys: {HOME}" /> + </ButtonMappings> + </ProgramSettings> + </Programs> +</Configuration> \ No newline at end of file Added: trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/PVRX2.exe.xml =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/PVRX2.exe.xml (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Translator/Default Settings/PVRX2.exe.xml 2008-03-04 13:24:09 UTC (rev 1424) @@ -0,0 +1,44 @@ +<?xml version="1.0" ... [truncated message content] |
From: <an...@us...> - 2008-03-04 13:34:59
|
Revision: 1425 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1425&view=rev Author: and-81 Date: 2008-03-04 05:34:57 -0800 (Tue, 04 Mar 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.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.resx trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Program.cs Added Paths: ----------- trunk/plugins/IR Server Suite/Documentation/Virtual Remote/pocketpc.png trunk/plugins/IR Server Suite/Documentation/Virtual Remote/smartphone.png Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2008-03-04 13:24:09 UTC (rev 1424) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2008-03-04 13:34:57 UTC (rev 1425) @@ -351,12 +351,12 @@ Program.Config.Programs.Add(progSettings); RefreshProgramList(); - + /* string programFile = Path.GetFileName(progSettings.FileName); string settingsFile = Path.Combine(Program.FolderDefaultSettings, programFile + ".xml"); if (File.Exists(settingsFile)) { - if (DialogResult.Yes == MessageBox.Show(this, String.Format("Do you want to use the default settings for {0}", programFile), "Default settings found", MessageBoxButtons.YesNo, MessageBoxIcon.Question)) + if (MessageBox.Show(this, String.Format("Do you want to use the default settings for {0}", programFile), "Default settings found", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { List<ButtonMapping> mappings = LoadDefaultSettings(settingsFile); @@ -365,6 +365,7 @@ RefreshButtonList(); } } + */ } } Added: trunk/plugins/IR Server Suite/Documentation/Virtual Remote/pocketpc.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/IR Server Suite/Documentation/Virtual Remote/pocketpc.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/IR Server Suite/Documentation/Virtual Remote/smartphone.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/IR Server Suite/Documentation/Virtual Remote/smartphone.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream 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-03-04 13:24:09 UTC (rev 1424) +++ trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Advanced.Designer.cs 2008-03-04 13:34:57 UTC (rev 1425) @@ -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(); // @@ -129,7 +130,7 @@ 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; + this.buttonCancel.TabIndex = 3; this.buttonCancel.Text = "Cancel"; this.buttonCancel.UseVisualStyleBackColor = true; this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); @@ -140,11 +141,24 @@ 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; + this.buttonOK.TabIndex = 2; this.buttonOK.Text = "OK"; 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.Enabled = false; + 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 = 1; + 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; @@ -152,6 +166,7 @@ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.buttonCancel; this.ClientSize = new System.Drawing.Size(400, 169); + this.Controls.Add(this.checkBoxAbstractRemoteMode); this.Controls.Add(this.buttonCancel); this.Controls.Add(this.buttonOK); this.Controls.Add(this.groupBoxMode); @@ -162,6 +177,7 @@ 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/Input Service/Input Service Configuration/Advanced.resx =================================================================== --- trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Advanced.resx 2008-03-04 13:24:09 UTC (rev 1424) +++ trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Advanced.resx 2008-03-04 13:34:57 UTC (rev 1425) @@ -120,9 +120,6 @@ <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> <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> 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 2008-03-04 13:24:09 UTC (rev 1424) +++ trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Program.cs 2008-03-04 13:34:57 UTC (rev 1425) @@ -48,6 +48,7 @@ #region Variables + static bool _abstractRemoteMode; static InputServiceMode _mode; static string _hostComputer; static string[] _pluginNameReceive; @@ -133,6 +134,7 @@ { IrssLog.Info("Loading settings ..."); + _abstractRemoteMode = false; _mode = InputServiceMode.ServerMode; _hostComputer = String.Empty; _pluginNameReceive = null; @@ -169,6 +171,9 @@ return; } + try { _abstractRemoteMode = bool.Parse(doc.DocumentElement.Attributes["AbstractRemoteMode"].Value); } + catch (Exception ex) { IrssLog.Warn(ex.ToString()); } + try { _mode = (InputServiceMode)Enum.Parse(typeof(InputServiceMode), doc.DocumentElement.Attributes["Mode"].Value, true); } catch (Exception ex) { IrssLog.Warn(ex.ToString()); } @@ -203,6 +208,7 @@ writer.WriteStartDocument(true); writer.WriteStartElement("settings"); // <settings> + writer.WriteAttributeString("AbstractRemoteMode", _abstractRemoteMode.ToString()); writer.WriteAttributeString("Mode", Enum.GetName(typeof(InputServiceMode), _mode)); writer.WriteAttributeString("HostComputer", _hostComputer); writer.WriteAttributeString("PluginTransmit", _pluginNameTransmit); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |