From: <an...@us...> - 2007-01-30 02:51:50
|
Revision: 50 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=50&view=rev Author: and-81 Date: 2007-01-29 18:51:49 -0800 (Mon, 29 Jan 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/MCEReplacement.cs trunk/plugins/MCEReplacement/MCEReplacement.csproj trunk/plugins/MCEReplacement/MceIrApi.cs trunk/plugins/MCEReplacement/Win32.cs Added Paths: ----------- trunk/plugins/MCEReplacement/Forms/ trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs trunk/plugins/MCEReplacement/Forms/ExternalChannels.designer.cs trunk/plugins/MCEReplacement/Forms/ExternalChannels.resx trunk/plugins/MCEReplacement/Forms/ExternalProgram.Designer.cs trunk/plugins/MCEReplacement/Forms/ExternalProgram.cs trunk/plugins/MCEReplacement/Forms/ExternalProgram.resx trunk/plugins/MCEReplacement/Forms/GoToScreen.Designer.cs trunk/plugins/MCEReplacement/Forms/GoToScreen.cs trunk/plugins/MCEReplacement/Forms/GoToScreen.resx trunk/plugins/MCEReplacement/Forms/KeysCommand.Designer.cs trunk/plugins/MCEReplacement/Forms/KeysCommand.cs trunk/plugins/MCEReplacement/Forms/KeysCommand.resx trunk/plugins/MCEReplacement/Forms/LearnIR.Designer.cs trunk/plugins/MCEReplacement/Forms/LearnIR.cs trunk/plugins/MCEReplacement/Forms/LearnIR.resx trunk/plugins/MCEReplacement/Forms/MacroEditor.Designer.cs trunk/plugins/MCEReplacement/Forms/MacroEditor.cs trunk/plugins/MCEReplacement/Forms/MacroEditor.resx trunk/plugins/MCEReplacement/Forms/MessageCommand.Designer.cs trunk/plugins/MCEReplacement/Forms/MessageCommand.cs trunk/plugins/MCEReplacement/Forms/MessageCommand.resx trunk/plugins/MCEReplacement/Forms/MultiMapNameBox.Designer.cs trunk/plugins/MCEReplacement/Forms/MultiMapNameBox.cs trunk/plugins/MCEReplacement/Forms/MultiMapNameBox.resx trunk/plugins/MCEReplacement/Forms/PauseTime.Designer.cs trunk/plugins/MCEReplacement/Forms/PauseTime.cs trunk/plugins/MCEReplacement/Forms/PauseTime.resx trunk/plugins/MCEReplacement/Forms/PopupMessage.Designer.cs trunk/plugins/MCEReplacement/Forms/PopupMessage.cs trunk/plugins/MCEReplacement/Forms/PopupMessage.resx trunk/plugins/MCEReplacement/Forms/SelectBlasterPort.Designer.cs trunk/plugins/MCEReplacement/Forms/SelectBlasterPort.cs trunk/plugins/MCEReplacement/Forms/SelectBlasterPort.resx trunk/plugins/MCEReplacement/Forms/SelectBlasterSpeed.Designer.cs trunk/plugins/MCEReplacement/Forms/SelectBlasterSpeed.cs trunk/plugins/MCEReplacement/Forms/SelectBlasterSpeed.resx trunk/plugins/MCEReplacement/Forms/SerialCommand.Designer.cs trunk/plugins/MCEReplacement/Forms/SerialCommand.cs trunk/plugins/MCEReplacement/Forms/SerialCommand.resx trunk/plugins/MCEReplacement/Forms/SetupForm.Designer.cs trunk/plugins/MCEReplacement/Forms/SetupForm.cs trunk/plugins/MCEReplacement/Forms/SetupForm.resx trunk/plugins/MCEReplacement/Forms/StbSetup.Designer.cs trunk/plugins/MCEReplacement/Forms/StbSetup.cs trunk/plugins/MCEReplacement/Forms/StbSetup.resx Removed Paths: ------------- trunk/plugins/MCEReplacement/Configuration/ Added: trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs (rev 0) +++ trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs 2007-01-30 02:51:49 UTC (rev 50) @@ -0,0 +1,245 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Diagnostics; +using System.Drawing; +using System.IO; +using System.Text; +using System.Threading; +using System.Windows.Forms; +using System.Xml; + +using MediaPortal.GUI.Library; +using MediaPortal.Util; + +namespace MediaPortal.Plugins +{ + + public partial class ExternalChannels : Form + { + + #region Variables + + TabPage[] _tvCardTabs; + StbSetup[] _tvCardStbSetups; + + #endregion Variables + + #region Constructor + + public ExternalChannels() + { + InitializeComponent(); + } + + #endregion Constructor + + private void ExternalChannels_Load(object sender, EventArgs e) + { + int cards = MCEReplacement.ExternalChannelConfigs.Length; + string cardName; + string cardNumber; + + _tvCardTabs = new TabPage[cards]; + _tvCardStbSetups = new StbSetup[cards]; + + comboBoxCopyFrom.Items.Clear(); + + for (int index = 0; index < cards; index++) + { + cardNumber = (index + 1).ToString(); + cardName = "TV Card " + cardNumber; + + comboBoxCopyFrom.Items.Add(cardName); + + _tvCardStbSetups[index] = new StbSetup(index); + _tvCardStbSetups[index].Name = "StbSetup" + cardNumber; + _tvCardStbSetups[index].Dock = DockStyle.Fill; + _tvCardStbSetups[index].TabIndex = 0; + + _tvCardTabs[index] = new TabPage(cardName); + _tvCardTabs[index].Controls.Add(_tvCardStbSetups[index]); + + this.tabControlTVCards.TabPages.Add(_tvCardTabs[index]); + } + + comboBoxCopyFrom.SelectedIndex = 0; + + // Setup quick setup combo box + string[] quickSetupFiles = Directory.GetFiles(MCEReplacement.AppDataFolder + MCEReplacement.STBFolder, "*.xml", SearchOption.TopDirectoryOnly); + foreach (string file in quickSetupFiles) + comboBoxQuickSetup.Items.Add(Path.GetFileNameWithoutExtension(file)); + + comboBoxQuickSetup.Items.Add("Clear all"); + } + + static bool ProcessExternalChannelProgram(string runCommand, int currentChannelDigit, string fullChannelString, MceIrApi.BlasterPort blasterPort) + { + string[] commands = MCEReplacement.SplitRunCommand(runCommand); + + if (commands == null) + return false; + + commands[2] = commands[2].Replace("%1", currentChannelDigit.ToString()); + commands[2] = commands[2].Replace("%2", fullChannelString); + commands[2] = commands[2].Replace("%3", ((int)blasterPort).ToString()); + + return MCEReplacement.ProcessRunCommand(commands); + } + + static bool ProcessSerialCommand(string serialCommand, int currentChannelDigit, string fullChannelString, MceIrApi.BlasterPort blasterPort) + { + string[] commands = MCEReplacement.SplitSerialCommand(serialCommand); + + if (commands == null) + return false; + + commands[0] = commands[0].Replace("%1", currentChannelDigit.ToString()); + commands[0] = commands[0].Replace("%2", fullChannelString); + commands[0] = commands[0].Replace("%3", ((int)blasterPort).ToString()); + + return MCEReplacement.ProcessSerialCommand(commands); + + } + + #region Buttons + + private void buttonOK_Click(object sender, EventArgs e) + { + foreach (StbSetup setup in _tvCardStbSetups) + setup.Save(); + + foreach (ExternalChannelConfig config in MCEReplacement.ExternalChannelConfigs) + config.SaveExternalChannelConfig(); + + this.DialogResult = DialogResult.OK; + this.Close(); + } + + private void buttonTest_Click(object sender, EventArgs e) + { + StbSetup setup = _tvCardStbSetups[tabControlTVCards.SelectedIndex]; + + int channelTest = Decimal.ToInt32(numericUpDownTest.Value); + string channel; + switch (setup.ChannelDigits) + { + case 2: + channel = channelTest.ToString("00"); + break; + + case 3: + channel = channelTest.ToString("000"); + break; + + case 4: + channel = channelTest.ToString("0000"); + break; + + default: + channel = channelTest.ToString(); + break; + } + + try + { + int charVal; + string command; + + for (int repeatCount = 0; repeatCount <= setup.RepeatChannelCommands; repeatCount++) + { + if (repeatCount > 0 && setup.RepeatPauseTime > 0) + Thread.Sleep(setup.RepeatPauseTime); + + if (setup.UsePreChangeCommand && !String.IsNullOrEmpty(setup.PreChangeCommand)) + { + if (setup.PreChangeCommand.StartsWith(MCEReplacement.RunCommandPrefix)) + ProcessExternalChannelProgram(setup.PreChangeCommand.Substring(MCEReplacement.RunCommandPrefix.Length), -1, channel, setup.ExtBlastPort); + else if (setup.PreChangeCommand.StartsWith(MCEReplacement.SerialCommandPrefix)) + ProcessSerialCommand(setup.PreChangeCommand.Substring(MCEReplacement.SerialCommandPrefix.Length), -1, channel, setup.ExtBlastPort); + else + MCEReplacement.ProcessCommand(setup.PreChangeCommand, setup.ExtBlastPort, setup.ExtBlastSpeed); + + if (setup.PauseTime > 0) + Thread.Sleep(setup.PauseTime); + } + + foreach (char digit in channel) + { + charVal = digit - 48; + + command = setup.Digits[charVal]; + if (!String.IsNullOrEmpty(command)) + { + if (command.StartsWith(MCEReplacement.RunCommandPrefix)) + ProcessExternalChannelProgram(command.Substring(MCEReplacement.RunCommandPrefix.Length), charVal, channel, setup.ExtBlastPort); + else if (command.StartsWith(MCEReplacement.SerialCommandPrefix)) + ProcessSerialCommand(command.Substring(MCEReplacement.SerialCommandPrefix.Length), charVal, channel, setup.ExtBlastPort); + else + MCEReplacement.ProcessCommand(command, setup.ExtBlastPort, setup.ExtBlastSpeed); + + if (setup.PauseTime > 0) + Thread.Sleep(setup.PauseTime); + } + } + + if (setup.SendSelect && !String.IsNullOrEmpty(setup.SelectCommand)) + { + if (setup.SelectCommand.StartsWith(MCEReplacement.RunCommandPrefix)) + { + ProcessExternalChannelProgram(setup.SelectCommand.Substring(MCEReplacement.RunCommandPrefix.Length), -1, channel, setup.ExtBlastPort); + + if (setup.DoubleChannelSelect) + ProcessExternalChannelProgram(setup.SelectCommand.Substring(MCEReplacement.RunCommandPrefix.Length), -1, channel, setup.ExtBlastPort); + } + else if (setup.SelectCommand.StartsWith(MCEReplacement.SerialCommandPrefix)) + { + ProcessSerialCommand(setup.SelectCommand.Substring(MCEReplacement.SerialCommandPrefix.Length), -1, channel, setup.ExtBlastPort); + + if (setup.DoubleChannelSelect) + ProcessSerialCommand(setup.SelectCommand.Substring(MCEReplacement.SerialCommandPrefix.Length), -1, channel, setup.ExtBlastPort); + } + else + { + MCEReplacement.ProcessCommand(setup.SelectCommand, setup.ExtBlastPort, setup.ExtBlastSpeed); + + if (setup.DoubleChannelSelect) + MCEReplacement.ProcessCommand(setup.SelectCommand, setup.ExtBlastPort, setup.ExtBlastSpeed); + } + } + } + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Failed to test external channel", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void buttonQuickSet_Click(object sender, EventArgs e) + { + string quickSetup = comboBoxQuickSetup.Text; + + if (quickSetup.Length == 0) + return; + + _tvCardStbSetups[tabControlTVCards.SelectedIndex].SetToXml(quickSetup); + } + + private void buttonCopyFrom_Click(object sender, EventArgs e) + { + _tvCardStbSetups[tabControlTVCards.SelectedIndex].SetToCard(comboBoxCopyFrom.SelectedIndex); + } + + private void buttonCancel_Click(object sender, EventArgs e) + { + this.DialogResult = DialogResult.Cancel; + this.Close(); + } + + #endregion Buttons + + } + +} Added: trunk/plugins/MCEReplacement/Forms/ExternalChannels.designer.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/ExternalChannels.designer.cs (rev 0) +++ trunk/plugins/MCEReplacement/Forms/ExternalChannels.designer.cs 2007-01-30 02:51:49 UTC (rev 50) @@ -0,0 +1,233 @@ +namespace MediaPortal.Plugins +{ + partial class ExternalChannels + { + /// <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.buttonOK = new System.Windows.Forms.Button(); + this.groupBoxQuickSetup = new System.Windows.Forms.GroupBox(); + this.buttonQuickSet = new System.Windows.Forms.Button(); + this.comboBoxQuickSetup = new System.Windows.Forms.ComboBox(); + this.groupBoxTest = new System.Windows.Forms.GroupBox(); + this.labelCh = new System.Windows.Forms.Label(); + this.buttonTest = new System.Windows.Forms.Button(); + this.numericUpDownTest = new System.Windows.Forms.NumericUpDown(); + this.buttonCopyFrom = new System.Windows.Forms.Button(); + this.comboBoxCopyFrom = new System.Windows.Forms.ComboBox(); + this.tabControlTVCards = new System.Windows.Forms.TabControl(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.groupBoxQuickSetup.SuspendLayout(); + this.groupBoxTest.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownTest)).BeginInit(); + 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(400, 408); + this.buttonOK.Name = "buttonOK"; + this.buttonOK.Size = new System.Drawing.Size(56, 24); + this.buttonOK.TabIndex = 5; + this.buttonOK.Text = "OK"; + this.buttonOK.UseVisualStyleBackColor = true; + this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); + // + // groupBoxQuickSetup + // + this.groupBoxQuickSetup.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxQuickSetup.Controls.Add(this.buttonQuickSet); + this.groupBoxQuickSetup.Controls.Add(this.comboBoxQuickSetup); + this.groupBoxQuickSetup.Location = new System.Drawing.Point(8, 352); + this.groupBoxQuickSetup.Name = "groupBoxQuickSetup"; + this.groupBoxQuickSetup.Size = new System.Drawing.Size(288, 48); + this.groupBoxQuickSetup.TabIndex = 1; + this.groupBoxQuickSetup.TabStop = false; + this.groupBoxQuickSetup.Text = "Quick Setup"; + // + // buttonQuickSet + // + this.buttonQuickSet.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonQuickSet.Location = new System.Drawing.Point(232, 16); + this.buttonQuickSet.Name = "buttonQuickSet"; + this.buttonQuickSet.Size = new System.Drawing.Size(48, 21); + this.buttonQuickSet.TabIndex = 1; + this.buttonQuickSet.Text = "Set"; + this.buttonQuickSet.UseVisualStyleBackColor = true; + this.buttonQuickSet.Click += new System.EventHandler(this.buttonQuickSet_Click); + // + // comboBoxQuickSetup + // + this.comboBoxQuickSetup.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.comboBoxQuickSetup.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxQuickSetup.FormattingEnabled = true; + this.comboBoxQuickSetup.Location = new System.Drawing.Point(8, 16); + this.comboBoxQuickSetup.Name = "comboBoxQuickSetup"; + this.comboBoxQuickSetup.Size = new System.Drawing.Size(216, 21); + this.comboBoxQuickSetup.TabIndex = 0; + // + // groupBoxTest + // + this.groupBoxTest.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxTest.Controls.Add(this.labelCh); + this.groupBoxTest.Controls.Add(this.buttonTest); + this.groupBoxTest.Controls.Add(this.numericUpDownTest); + this.groupBoxTest.Location = new System.Drawing.Point(304, 352); + this.groupBoxTest.Name = "groupBoxTest"; + this.groupBoxTest.Size = new System.Drawing.Size(216, 48); + this.groupBoxTest.TabIndex = 2; + this.groupBoxTest.TabStop = false; + this.groupBoxTest.Text = "Test"; + // + // labelCh + // + this.labelCh.Location = new System.Drawing.Point(8, 16); + this.labelCh.Name = "labelCh"; + this.labelCh.Size = new System.Drawing.Size(64, 20); + this.labelCh.TabIndex = 0; + this.labelCh.Text = "Channel:"; + this.labelCh.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // buttonTest + // + this.buttonTest.Location = new System.Drawing.Point(152, 16); + this.buttonTest.Name = "buttonTest"; + this.buttonTest.Size = new System.Drawing.Size(56, 20); + this.buttonTest.TabIndex = 2; + this.buttonTest.Text = "Test"; + this.buttonTest.UseVisualStyleBackColor = true; + this.buttonTest.Click += new System.EventHandler(this.buttonTest_Click); + // + // numericUpDownTest + // + this.numericUpDownTest.Location = new System.Drawing.Point(72, 16); + this.numericUpDownTest.Maximum = new decimal(new int[] { + 9999, + 0, + 0, + 0}); + this.numericUpDownTest.Name = "numericUpDownTest"; + this.numericUpDownTest.Size = new System.Drawing.Size(72, 20); + this.numericUpDownTest.TabIndex = 1; + this.numericUpDownTest.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.numericUpDownTest.Value = new decimal(new int[] { + 1, + 0, + 0, + 0}); + // + // buttonCopyFrom + // + this.buttonCopyFrom.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonCopyFrom.Location = new System.Drawing.Point(8, 408); + this.buttonCopyFrom.Name = "buttonCopyFrom"; + this.buttonCopyFrom.Size = new System.Drawing.Size(144, 21); + this.buttonCopyFrom.TabIndex = 3; + this.buttonCopyFrom.Text = "Copy from saved config:"; + this.buttonCopyFrom.UseVisualStyleBackColor = true; + this.buttonCopyFrom.Click += new System.EventHandler(this.buttonCopyFrom_Click); + // + // comboBoxCopyFrom + // + this.comboBoxCopyFrom.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.comboBoxCopyFrom.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxCopyFrom.FormattingEnabled = true; + this.comboBoxCopyFrom.Location = new System.Drawing.Point(160, 408); + this.comboBoxCopyFrom.Name = "comboBoxCopyFrom"; + this.comboBoxCopyFrom.Size = new System.Drawing.Size(120, 21); + this.comboBoxCopyFrom.TabIndex = 4; + // + // tabControlTVCards + // + this.tabControlTVCards.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.tabControlTVCards.Location = new System.Drawing.Point(8, 8); + this.tabControlTVCards.Name = "tabControlTVCards"; + this.tabControlTVCards.SelectedIndex = 0; + this.tabControlTVCards.Size = new System.Drawing.Size(512, 336); + this.tabControlTVCards.TabIndex = 0; + // + // 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(464, 408); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(56, 24); + this.buttonCancel.TabIndex = 6; + this.buttonCancel.Text = "Cancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); + // + // ExternalChannels + // + 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(528, 439); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.tabControlTVCards); + this.Controls.Add(this.comboBoxCopyFrom); + this.Controls.Add(this.buttonCopyFrom); + this.Controls.Add(this.groupBoxTest); + this.Controls.Add(this.groupBoxQuickSetup); + this.Controls.Add(this.buttonOK); + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(536, 466); + this.Name = "ExternalChannels"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "External Channel Changing"; + this.Load += new System.EventHandler(this.ExternalChannels_Load); + this.groupBoxQuickSetup.ResumeLayout(false); + this.groupBoxTest.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownTest)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Button buttonOK; + private System.Windows.Forms.GroupBox groupBoxQuickSetup; + private System.Windows.Forms.ComboBox comboBoxQuickSetup; + private System.Windows.Forms.GroupBox groupBoxTest; + private System.Windows.Forms.NumericUpDown numericUpDownTest; + private System.Windows.Forms.Button buttonTest; + private System.Windows.Forms.Button buttonQuickSet; + private System.Windows.Forms.Label labelCh; + private System.Windows.Forms.Button buttonCopyFrom; + private System.Windows.Forms.ComboBox comboBoxCopyFrom; + private System.Windows.Forms.TabControl tabControlTVCards; + private System.Windows.Forms.Button buttonCancel; + + } +} \ No newline at end of file Added: trunk/plugins/MCEReplacement/Forms/ExternalChannels.resx =================================================================== --- trunk/plugins/MCEReplacement/Forms/ExternalChannels.resx (rev 0) +++ trunk/plugins/MCEReplacement/Forms/ExternalChannels.resx 2007-01-30 02:51:49 UTC (rev 50) @@ -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 Added: trunk/plugins/MCEReplacement/Forms/ExternalProgram.Designer.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/ExternalProgram.Designer.cs (rev 0) +++ trunk/plugins/MCEReplacement/Forms/ExternalProgram.Designer.cs 2007-01-30 02:51:49 UTC (rev 50) @@ -0,0 +1,294 @@ +namespace MediaPortal.Plugins +{ + partial class ExternalProgram + { + /// <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.textBoxProgram = new System.Windows.Forms.TextBox(); + this.labelProgram = new System.Windows.Forms.Label(); + this.buttonProgam = new System.Windows.Forms.Button(); + this.buttonStartup = new System.Windows.Forms.Button(); + this.labelStartup = new System.Windows.Forms.Label(); + this.textBoxStartup = new System.Windows.Forms.TextBox(); + this.buttonOK = new System.Windows.Forms.Button(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.labelParameters = new System.Windows.Forms.Label(); + this.textBoxParameters = new System.Windows.Forms.TextBox(); + this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); + this.folderBrowserDialog = new System.Windows.Forms.FolderBrowserDialog(); + this.buttonParamQuestion = new System.Windows.Forms.Button(); + this.checkBoxShellExecute = new System.Windows.Forms.CheckBox(); + this.buttonTest = new System.Windows.Forms.Button(); + this.checkBoxNoWindow = new System.Windows.Forms.CheckBox(); + this.checkBoxWaitForExit = new System.Windows.Forms.CheckBox(); + this.comboBoxWindowStyle = new System.Windows.Forms.ComboBox(); + this.labelWindowStyle = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // textBoxProgram + // + this.textBoxProgram.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxProgram.Location = new System.Drawing.Point(8, 24); + this.textBoxProgram.Name = "textBoxProgram"; + this.textBoxProgram.Size = new System.Drawing.Size(288, 20); + this.textBoxProgram.TabIndex = 1; + // + // labelProgram + // + this.labelProgram.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.labelProgram.Location = new System.Drawing.Point(8, 8); + this.labelProgram.Name = "labelProgram"; + this.labelProgram.Size = new System.Drawing.Size(288, 16); + this.labelProgram.TabIndex = 0; + this.labelProgram.Text = "Program:"; + this.labelProgram.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // buttonProgam + // + this.buttonProgam.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonProgam.Location = new System.Drawing.Point(304, 24); + this.buttonProgam.Name = "buttonProgam"; + this.buttonProgam.Size = new System.Drawing.Size(24, 20); + this.buttonProgam.TabIndex = 2; + this.buttonProgam.Text = "..."; + this.buttonProgam.UseVisualStyleBackColor = true; + this.buttonProgam.Click += new System.EventHandler(this.buttonProgam_Click); + // + // buttonStartup + // + this.buttonStartup.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonStartup.Location = new System.Drawing.Point(304, 72); + this.buttonStartup.Name = "buttonStartup"; + this.buttonStartup.Size = new System.Drawing.Size(24, 20); + this.buttonStartup.TabIndex = 5; + this.buttonStartup.Text = "..."; + this.buttonStartup.UseVisualStyleBackColor = true; + this.buttonStartup.Click += new System.EventHandler(this.buttonStartup_Click); + // + // labelStartup + // + this.labelStartup.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.labelStartup.Location = new System.Drawing.Point(8, 56); + this.labelStartup.Name = "labelStartup"; + this.labelStartup.Size = new System.Drawing.Size(288, 16); + this.labelStartup.TabIndex = 3; + this.labelStartup.Text = "Startup Folder:"; + this.labelStartup.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // textBoxStartup + // + this.textBoxStartup.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxStartup.Location = new System.Drawing.Point(8, 72); + this.textBoxStartup.Name = "textBoxStartup"; + this.textBoxStartup.Size = new System.Drawing.Size(288, 20); + this.textBoxStartup.TabIndex = 4; + // + // 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(208, 216); + this.buttonOK.Name = "buttonOK"; + this.buttonOK.Size = new System.Drawing.Size(56, 24); + this.buttonOK.TabIndex = 15; + 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(272, 216); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(56, 24); + this.buttonCancel.TabIndex = 16; + this.buttonCancel.Text = "Cancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); + // + // labelParameters + // + this.labelParameters.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.labelParameters.Location = new System.Drawing.Point(8, 104); + this.labelParameters.Name = "labelParameters"; + this.labelParameters.Size = new System.Drawing.Size(288, 16); + this.labelParameters.TabIndex = 6; + this.labelParameters.Text = "Parameters:"; + this.labelParameters.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // textBoxParameters + // + this.textBoxParameters.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxParameters.Location = new System.Drawing.Point(8, 120); + this.textBoxParameters.Name = "textBoxParameters"; + this.textBoxParameters.Size = new System.Drawing.Size(288, 20); + this.textBoxParameters.TabIndex = 7; + // + // openFileDialog + // + this.openFileDialog.Filter = "All files|*.*"; + this.openFileDialog.Title = "Select Program Executable"; + // + // folderBrowserDialog + // + this.folderBrowserDialog.Description = "Select the startup folder for the program to run from"; + // + // buttonParamQuestion + // + this.buttonParamQuestion.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonParamQuestion.Location = new System.Drawing.Point(304, 120); + this.buttonParamQuestion.Name = "buttonParamQuestion"; + this.buttonParamQuestion.Size = new System.Drawing.Size(24, 20); + this.buttonParamQuestion.TabIndex = 8; + this.buttonParamQuestion.Text = "?"; + this.buttonParamQuestion.UseVisualStyleBackColor = true; + this.buttonParamQuestion.Click += new System.EventHandler(this.buttonParamQuestion_Click); + // + // checkBoxShellExecute + // + this.checkBoxShellExecute.Location = new System.Drawing.Point(8, 184); + this.checkBoxShellExecute.Name = "checkBoxShellExecute"; + this.checkBoxShellExecute.Size = new System.Drawing.Size(184, 21); + this.checkBoxShellExecute.TabIndex = 12; + this.checkBoxShellExecute.Text = "Startup using ShellExecute"; + this.checkBoxShellExecute.UseVisualStyleBackColor = true; + // + // 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, 216); + this.buttonTest.Name = "buttonTest"; + this.buttonTest.Size = new System.Drawing.Size(56, 24); + this.buttonTest.TabIndex = 14; + this.buttonTest.Text = "Test"; + this.buttonTest.UseVisualStyleBackColor = true; + this.buttonTest.Click += new System.EventHandler(this.buttonTest_Click); + // + // checkBoxNoWindow + // + this.checkBoxNoWindow.Location = new System.Drawing.Point(208, 152); + this.checkBoxNoWindow.Name = "checkBoxNoWindow"; + this.checkBoxNoWindow.Size = new System.Drawing.Size(104, 21); + this.checkBoxNoWindow.TabIndex = 11; + this.checkBoxNoWindow.Text = "No window"; + this.checkBoxNoWindow.UseVisualStyleBackColor = true; + // + // checkBoxWaitForExit + // + this.checkBoxWaitForExit.Location = new System.Drawing.Point(208, 184); + this.checkBoxWaitForExit.Name = "checkBoxWaitForExit"; + this.checkBoxWaitForExit.Size = new System.Drawing.Size(104, 21); + this.checkBoxWaitForExit.TabIndex = 13; + this.checkBoxWaitForExit.Text = "Wait for exit"; + this.checkBoxWaitForExit.UseVisualStyleBackColor = true; + // + // comboBoxWindowStyle + // + this.comboBoxWindowStyle.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxWindowStyle.FormattingEnabled = true; + this.comboBoxWindowStyle.Location = new System.Drawing.Point(104, 152); + this.comboBoxWindowStyle.MaxDropDownItems = 4; + this.comboBoxWindowStyle.Name = "comboBoxWindowStyle"; + this.comboBoxWindowStyle.Size = new System.Drawing.Size(88, 21); + this.comboBoxWindowStyle.TabIndex = 10; + // + // labelWindowStyle + // + this.labelWindowStyle.Location = new System.Drawing.Point(8, 152); + this.labelWindowStyle.Name = "labelWindowStyle"; + this.labelWindowStyle.Size = new System.Drawing.Size(96, 21); + this.labelWindowStyle.TabIndex = 9; + this.labelWindowStyle.Text = "Window Style:"; + this.labelWindowStyle.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // ExternalProgram + // + 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(336, 249); + this.Controls.Add(this.checkBoxNoWindow); + this.Controls.Add(this.checkBoxWaitForExit); + this.Controls.Add(this.comboBoxWindowStyle); + this.Controls.Add(this.labelWindowStyle); + this.Controls.Add(this.buttonTest); + this.Controls.Add(this.checkBoxShellExecute); + this.Controls.Add(this.buttonParamQuestion); + this.Controls.Add(this.labelParameters); + this.Controls.Add(this.textBoxParameters); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.buttonOK); + this.Controls.Add(this.buttonStartup); + this.Controls.Add(this.labelStartup); + this.Controls.Add(this.textBoxStartup); + this.Controls.Add(this.buttonProgam); + this.Controls.Add(this.labelProgram); + this.Controls.Add(this.textBoxProgram); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(344, 276); + this.Name = "ExternalProgram"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "External Program Details"; + this.Load += new System.EventHandler(this.ExternalProgram_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox textBoxProgram; + private System.Windows.Forms.Label labelProgram; + private System.Windows.Forms.Button buttonProgam; + private System.Windows.Forms.Button buttonStartup; + private System.Windows.Forms.Label labelStartup; + private System.Windows.Forms.TextBox textBoxStartup; + private System.Windows.Forms.Button buttonOK; + private System.Windows.Forms.Button buttonCancel; + private System.Windows.Forms.Label labelParameters; + private System.Windows.Forms.TextBox textBoxParameters; + private System.Windows.Forms.OpenFileDialog openFileDialog; + private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog; + private System.Windows.Forms.Button buttonParamQuestion; + private System.Windows.Forms.CheckBox checkBoxShellExecute; + private System.Windows.Forms.Button buttonTest; + private System.Windows.Forms.CheckBox checkBoxNoWindow; + private System.Windows.Forms.CheckBox checkBoxWaitForExit; + private System.Windows.Forms.ComboBox comboBoxWindowStyle; + private System.Windows.Forms.Label labelWindowStyle; + } +} \ No newline at end of file Added: trunk/plugins/MCEReplacement/Forms/ExternalProgram.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/ExternalProgram.cs (rev 0) +++ trunk/plugins/MCEReplacement/Forms/ExternalProgram.cs 2007-01-30 02:51:49 UTC (rev 50) @@ -0,0 +1,162 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Diagnostics; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +using MediaPortal.GUI.Library; + +namespace MediaPortal.Plugins +{ + + public partial class ExternalProgram : Form + { + + #region Variables + + string _parametersMessage = ""; + + #endregion Variables + + #region Properties + + public string CommandString + { + get + { + return string.Format("{0}|{1}|{2}|{3}|{4}|{5}|{6}", + textBoxProgram.Text, + textBoxStartup.Text, + textBoxParameters.Text, + (string)comboBoxWindowStyle.SelectedItem, + checkBoxNoWindow.Checked.ToString(), + checkBoxShellExecute.Checked.ToString(), + checkBoxWaitForExit.Checked.ToString()); + } + } + + #endregion Properties + + #region Constructors + + public ExternalProgram() : this(null, "") { } + public ExternalProgram(string parametersMessage) : this(null, parametersMessage) { } + public ExternalProgram(string[] commands) : this(commands, "") { } + public ExternalProgram(string[] commands, string parametersMessage) + { + InitializeComponent(); + + _parametersMessage = parametersMessage; + + comboBoxWindowStyle.Items.Clear(); + comboBoxWindowStyle.Items.AddRange(Enum.GetNames(typeof(ProcessWindowStyle))); + + if (commands != null) + { + textBoxProgram.Text = commands[0]; + textBoxStartup.Text = commands[1]; + textBoxParameters.Text = commands[2]; + + checkBoxNoWindow.Checked = bool.Parse(commands[4]); + checkBoxShellExecute.Checked = bool.Parse(commands[5]); + checkBoxWaitForExit.Checked = bool.Parse(commands[6]); + + comboBoxWindowStyle.SelectedItem = ((ProcessWindowStyle)Enum.Parse(typeof(ProcessWindowStyle), commands[3])).ToString(); + } + else + { + comboBoxWindowStyle.SelectedIndex = 0; + } + } + + #endregion Constructors + + private void ExternalProgram_Load(object sender, EventArgs e) + { + if (_parametersMessage.Trim().Length == 0) + buttonParamQuestion.Visible = false; + } + + + private void buttonProgam_Click(object sender, EventArgs e) + { + if (openFileDialog.ShowDialog(this) == DialogResult.OK) + { + textBoxProgram.Text = openFileDialog.FileName; + + if (textBoxStartup.Text.Trim().Length == 0) + { + textBoxStartup.Text = System.IO.Path.GetDirectoryName(openFileDialog.FileName); + } + } + } + + private void buttonStartup_Click(object sender, EventArgs e) + { + if (folderBrowserDialog.ShowDialog(this) == DialogResult.OK) + { + textBoxProgram.Text = folderBrowserDialog.SelectedPath; + } + } + + private void buttonOK_Click(object sender, EventArgs e) + { + if (textBoxProgram.Text.Trim().Length == 0) + { + MessageBox.Show(this, "You must specify a program to run", "Missing program name", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + return; + } + + this.DialogResult = DialogResult.OK; + this.Close(); + } + + private void buttonCancel_Click(object sender, EventArgs e) + { + this.DialogResult = DialogResult.Cancel; + this.Close(); + } + + private void buttonParamQuestion_Click(object sender, EventArgs e) + { + MessageBox.Show(this, _parametersMessage, "Parameters", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + + private void buttonTest_Click(object sender, EventArgs e) + { + if (textBoxProgram.Text.Trim().Length == 0) + { + MessageBox.Show(this, "You must specify a program to run", "Missing program name", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + return; + } + + try + { + Process process = new Process(); + process.StartInfo.FileName = textBoxProgram.Text; + process.StartInfo.WorkingDirectory = textBoxStartup.Text; + process.StartInfo.Arguments = textBoxParameters.Text; + process.StartInfo.WindowStyle = (ProcessWindowStyle)Enum.Parse(typeof(ProcessWindowStyle), (string)comboBoxWindowStyle.SelectedItem); + process.StartInfo.CreateNoWindow = checkBoxNoWindow.Checked; + process.StartInfo.UseShellExecute = checkBoxShellExecute.Checked; + + if (MCEReplacement.LogVerbose) + Log.Info("MCEReplacement: Launching external program {0}", textBoxProgram.Text); + + process.Start(); + + if (checkBoxWaitForExit.Checked) // Wait for exit + process.WaitForExit(); + } + catch (Exception ex) + { + Log.Error("MCEReplacement: {0}", ex.Message); + } + } + + } + +} Added: trunk/plugins/MCEReplacement/Forms/ExternalProgram.resx =================================================================== --- trunk/plugins/MCEReplacement/Forms/ExternalProgram.resx (rev 0) +++ trunk/plugins/MCEReplacement/Forms/ExternalProgram.resx 2007-01-30 02:51:49 UTC (rev 50) @@ -0,0 +1,126 @@ +<?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="openFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> + <metadata name="folderBrowserDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>144, 17</value> + </metadata> +</root> \ No newline at end of file Added: trunk/plugins/MCEReplacement/Forms/GoToScreen.Designer.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/GoToScreen.Designer.cs (rev 0) +++ trunk/plugins/MCEReplacement/Forms/GoToScreen.Designer.cs 2007-01-30 02:51:49 UTC (rev 50) @@ -0,0 +1,111 @@ +namespace MediaPortal.Plugins +{ + partial class GoToScreen + { + /// <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.comboBoxScreen = new System.Windows.Forms.ComboBox(); + this.buttonOK = new System.Windows.Forms.Button(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.labelScreen = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // comboBoxScreen + // + this.comboBoxScreen.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.comboBoxScreen.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxScreen.FormattingEnabled = true; + this.comboBoxScreen.Location = new System.Drawing.Point(8, 24); + this.comboBoxScreen.Name = "comboBoxScreen"; + this.comboBoxScreen.Size = new System.Drawing.Size(280, 21); + this.comboBoxScreen.TabIndex = 0; + // + // 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(152, 56); + 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(224, 56); + 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); + // + // labelScreen + // + this.labelScreen.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.labelScreen.Location = new System.Drawing.Point(8, 8); + this.labelScreen.Name = "labelScreen"; + this.labelScreen.Size = new System.Drawing.Size(280, 16); + this.labelScreen.TabIndex = 3; + this.labelScreen.Text = "Screen:"; + // + // GoToScreen + // + 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(296, 89); + this.Controls.Add(this.labelScre... [truncated message content] |
From: <an...@us...> - 2007-02-02 14:48:55
|
Revision: 81 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=81&view=rev Author: and-81 Date: 2007-02-02 06:48:53 -0800 (Fri, 02 Feb 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/MCEReplacement.cs trunk/plugins/MCEReplacementTray/Tray.cs Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-02-02 12:52:42 UTC (rev 80) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-02-02 14:48:53 UTC (rev 81) @@ -652,31 +652,19 @@ switch ((RemoteButton)button) { case RemoteButton.Up: - if (y < MouseModeStep) - Cursor.Position = new Point(x, 0); - else - Cursor.Position = new Point(x, y - distance); + Cursor.Position = new Point(x, y - distance); return true; case RemoteButton.Down: - if (y > Screen.PrimaryScreen.WorkingArea.Height - distance) - Cursor.Position = new Point(x, Screen.PrimaryScreen.WorkingArea.Height); - else - Cursor.Position = new Point(x, y + distance); + Cursor.Position = new Point(x, y + distance); return true; case RemoteButton.Left: - if (x < MouseModeStep) - Cursor.Position = new Point(0, y); - else - Cursor.Position = new Point(x - distance, y); + Cursor.Position = new Point(x - distance, y); return true; case RemoteButton.Right: - if (x > Screen.PrimaryScreen.WorkingArea.Width - distance) - Cursor.Position = new Point(x, Screen.PrimaryScreen.WorkingArea.Width); - else - Cursor.Position = new Point(x + distance, y); + Cursor.Position = new Point(x + distance, y); return true; case RemoteButton.Replay: // Left Single-Click Modified: trunk/plugins/MCEReplacementTray/Tray.cs =================================================================== --- trunk/plugins/MCEReplacementTray/Tray.cs 2007-02-02 12:52:42 UTC (rev 80) +++ trunk/plugins/MCEReplacementTray/Tray.cs 2007-02-02 14:48:53 UTC (rev 81) @@ -266,12 +266,14 @@ { case PBT_APMQUERYSUSPEND: case PBT_APMQUERYSTANDBY: - MceIrApi.Suspend(); + if (MceIrApi.InUse) + MceIrApi.Suspend(); TrayIcon.Visible = false; break; case PBT_APMRESUMEAUTOMATIC: - MceIrApi.Resume(); + if (MceIrApi.InUse) + MceIrApi.Resume(); TrayIcon.Visible = true; break; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-02-19 11:18:08
|
Revision: 124 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=124&view=rev Author: and-81 Date: 2007-02-19 03:18:05 -0800 (Mon, 19 Feb 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/MCEReplacement.cs trunk/plugins/MCEReplacement/MappedEvent.cs Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-02-18 17:54:30 UTC (rev 123) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-02-19 11:18:05 UTC (rev 124) @@ -839,8 +839,7 @@ if (LogVerbose) Log.Info("MCEReplacement: Tune External Channel: {0}, Tuner card: {1}", msg.Label, msg.Label2); - //if (!ProcessExternalChannel(msg.Label, msg.Label2)) - if (!ProcessExternalChannel(msg.Label, "0")) + if (!ProcessExternalChannel(msg.Label, msg.Label2)) Log.Error("MCEReplacement: Failed to process external channel request"); } @@ -1656,7 +1655,7 @@ return null; } - string[] commands = runCommand.Split(new char[] { '|' }); + string[] commands = runCommand.Split(new char[] { '|' }, StringSplitOptions.None); if (commands.Length != 7) { @@ -1722,7 +1721,7 @@ return null; } - string[] commands = serialCommand.Split(new char[] { '|' }); + string[] commands = serialCommand.Split(new char[] { '|' }, StringSplitOptions.None); if (commands.Length != 6) { @@ -1920,7 +1919,7 @@ return null; } - string[] commands = messageCommand.Split(new char[] { '|' }); + string[] commands = messageCommand.Split(new char[] { '|' }, StringSplitOptions.None); if (commands.Length != 4) { @@ -2006,7 +2005,7 @@ return null; } - string[] commands = popupCommand.Split(new char[] { '|' }); + string[] commands = popupCommand.Split(new char[] { '|' }, StringSplitOptions.None); if (commands.Length != 3) { Modified: trunk/plugins/MCEReplacement/MappedEvent.cs =================================================================== --- trunk/plugins/MCEReplacement/MappedEvent.cs 2007-02-18 17:54:30 UTC (rev 123) +++ trunk/plugins/MCEReplacement/MappedEvent.cs 2007-02-19 11:18:05 UTC (rev 124) @@ -200,7 +200,7 @@ if (eventString == null || commandString == null) return null; - string[] eventStringElements = eventString.Split(new char[] { ',', '=' }); + string[] eventStringElements = eventString.Split(new char[] { ',', '=' }, StringSplitOptions.None); if (eventStringElements.Length == 1) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-10-27 13:40:28
|
Revision: 1008 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1008&view=rev Author: and-81 Date: 2007-10-27 06:40:24 -0700 (Sat, 27 Oct 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs trunk/plugins/MCEReplacement/Forms/SetupForm.Designer.cs trunk/plugins/MCEReplacement/Forms/SetupForm.cs trunk/plugins/MCEReplacement/Forms/StbSetup.cs trunk/plugins/MCEReplacement/MCEReplacement.cs trunk/plugins/MCEReplacement/Properties/AssemblyInfo.cs Modified: trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs 2007-10-27 13:36:02 UTC (rev 1007) +++ trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs 2007-10-27 13:40:24 UTC (rev 1008) @@ -39,7 +39,8 @@ private void ExternalChannels_Load(object sender, EventArgs e) { - int cards = MCEReplacement.ExternalChannelConfigs.Length; + int cards = MCEReplacement.TvCardCount; + string cardName; string cardNumber; @@ -103,8 +104,8 @@ foreach (StbSetup setup in _tvCardStbSetups) setup.Save(); - foreach (ExternalChannelConfig config in MCEReplacement.ExternalChannelConfigs) - config.Save(); + for (int index = 0; index < MCEReplacement.TvCardCount; index++) + MCEReplacement.GetExternalChannelConfig(index).Save(); this.DialogResult = DialogResult.OK; this.Close(); Modified: trunk/plugins/MCEReplacement/Forms/SetupForm.Designer.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/SetupForm.Designer.cs 2007-10-27 13:36:02 UTC (rev 1007) +++ trunk/plugins/MCEReplacement/Forms/SetupForm.Designer.cs 2007-10-27 13:40:24 UTC (rev 1008) @@ -675,7 +675,7 @@ this.listViewIR.TabIndex = 0; this.listViewIR.UseCompatibleStateImageBehavior = false; this.listViewIR.View = System.Windows.Forms.View.List; - this.listViewIR.DoubleClick += new System.EventHandler(this.listBoxIR_DoubleClick); + this.listViewIR.DoubleClick += new System.EventHandler(this.listViewIR_DoubleClick); this.listViewIR.AfterLabelEdit += new System.Windows.Forms.LabelEditEventHandler(this.listViewIR_AfterLabelEdit); // // tabPageMacros @@ -709,7 +709,7 @@ this.listViewMacro.TabIndex = 0; this.listViewMacro.UseCompatibleStateImageBehavior = false; this.listViewMacro.View = System.Windows.Forms.View.List; - this.listViewMacro.DoubleClick += new System.EventHandler(this.listBoxMacro_DoubleClick); + this.listViewMacro.DoubleClick += new System.EventHandler(this.listViewMacro_DoubleClick); this.listViewMacro.AfterLabelEdit += new System.Windows.Forms.LabelEditEventHandler(this.listViewMacro_AfterLabelEdit); // // tabPageMultiMapping Modified: trunk/plugins/MCEReplacement/Forms/SetupForm.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/SetupForm.cs 2007-10-27 13:36:02 UTC (rev 1007) +++ trunk/plugins/MCEReplacement/Forms/SetupForm.cs 2007-10-27 13:40:24 UTC (rev 1008) @@ -19,6 +19,7 @@ using MicrosoftMceTransceiver; using IrssUtils; using IrssUtils.Forms; +using MPUtils.Forms; namespace MediaPortal.Plugins { @@ -485,7 +486,7 @@ } else if (selected == Common.UITextGoto) { - MPUtils.Forms.GoToScreen goToScreen = new MPUtils.Forms.GoToScreen(); + GoToScreen goToScreen = new GoToScreen(); if (goToScreen.ShowDialog(this) == DialogResult.Cancel) return; @@ -665,15 +666,104 @@ #region Other Controls - private void listBoxIR_DoubleClick(object sender, EventArgs e) + private void listViewIR_DoubleClick(object sender, EventArgs e) { EditIR(); } - private void listBoxMacro_DoubleClick(object sender, EventArgs e) + private void listViewMacro_DoubleClick(object sender, EventArgs e) { EditMacro(); } + private void listViewIR_AfterLabelEdit(object sender, LabelEditEventArgs e) + { + ListView origin = sender as ListView; + if (origin == null) + { + e.CancelEdit = true; + return; + } + + if (String.IsNullOrEmpty(e.Label)) + { + e.CancelEdit = true; + return; + } + + ListViewItem originItem = origin.Items[e.Item]; + + string oldFileName = MCEReplacement.IRFolder + originItem.Text + Common.FileExtensionIR; + if (!File.Exists(oldFileName)) + { + MessageBox.Show("File not found: " + oldFileName, "Cannot rename, Original file not found", MessageBoxButtons.OK, MessageBoxIcon.Error); + e.CancelEdit = true; + return; + } + + if (!Common.IsValidFileName(e.Label)) + { + MessageBox.Show("File name not valid: " + e.Label, "Cannot rename, New file name not valid", MessageBoxButtons.OK, MessageBoxIcon.Error); + e.CancelEdit = true; + return; + } + + try + { + string newFileName = MCEReplacement.IRFolder + e.Label + Common.FileExtensionIR; + + File.Move(oldFileName, newFileName); + } + catch (Exception ex) + { + IrssLog.Error(ex.ToString()); + MessageBox.Show(ex.ToString(), "Failed to rename file", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + private void listViewMacro_AfterLabelEdit(object sender, LabelEditEventArgs e) + { + ListView origin = sender as ListView; + if (origin == null) + { + e.CancelEdit = true; + return; + } + + if (String.IsNullOrEmpty(e.Label)) + { + e.CancelEdit = true; + return; + } + + ListViewItem originItem = origin.Items[e.Item]; + + string oldFileName = MCEReplacement.MacroFolder + originItem.Text + Common.FileExtensionMacro; + if (!File.Exists(oldFileName)) + { + MessageBox.Show("File not found: " + oldFileName, "Cannot rename, Original file not found", MessageBoxButtons.OK, MessageBoxIcon.Error); + e.CancelEdit = true; + return; + } + + if (!Common.IsValidFileName(e.Label)) + { + MessageBox.Show("File name not valid: " + e.Label, "Cannot rename, New file name not valid", MessageBoxButtons.OK, MessageBoxIcon.Error); + e.CancelEdit = true; + return; + } + + try + { + string newFileName = MCEReplacement.MacroFolder + e.Label + Common.FileExtensionMacro; + + File.Move(oldFileName, newFileName); + } + catch (Exception ex) + { + IrssLog.Error(ex.ToString()); + MessageBox.Show(ex.ToString(), "Failed to rename file", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + private void listViewEventMap_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Delete) @@ -698,7 +788,7 @@ } else if (command.StartsWith(Common.CmdPrefixGoto)) { - MPUtils.Forms.GoToScreen goToScreen = new MPUtils.Forms.GoToScreen(command.Substring(Common.CmdPrefixGoto.Length)); + GoToScreen goToScreen = new GoToScreen(command.Substring(Common.CmdPrefixGoto.Length)); if (goToScreen.ShowDialog(this) == DialogResult.Cancel) return; @@ -764,77 +854,6 @@ #endregion Other Controls - private void listViewIR_AfterLabelEdit(object sender, LabelEditEventArgs e) - { - ListView origin = sender as ListView; - if (origin == null) - return; - - ListViewItem originItem = origin.Items[e.Item]; - - string oldFileName = MCEReplacement.IRFolder + originItem.Text + Common.FileExtensionIR; - if (!File.Exists(oldFileName)) - { - MessageBox.Show("File not found: " + oldFileName, "Cannot rename, Original file not found", MessageBoxButtons.OK, MessageBoxIcon.Error); - e.CancelEdit = true; - return; - } - - if (String.IsNullOrEmpty(e.Label) || !Common.IsValidFileName(e.Label)) - { - MessageBox.Show("File name not valid: " + e.Label, "Cannot rename, New file name not valid", MessageBoxButtons.OK, MessageBoxIcon.Error); - e.CancelEdit = true; - return; - } - - try - { - string newFileName = MCEReplacement.IRFolder + e.Label + Common.FileExtensionIR; - - File.Move(oldFileName, newFileName); - } - catch (Exception ex) - { - IrssLog.Error(ex.ToString()); - MessageBox.Show(ex.ToString(), "Failed to rename file", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - private void listViewMacro_AfterLabelEdit(object sender, LabelEditEventArgs e) - { - ListView origin = sender as ListView; - if (origin == null) - return; - - ListViewItem originItem = origin.Items[e.Item]; - - string oldFileName = MCEReplacement.MacroFolder + originItem.Text + Common.FileExtensionMacro; - if (!File.Exists(oldFileName)) - { - MessageBox.Show("File not found: " + oldFileName, "Cannot rename, Original file not found", MessageBoxButtons.OK, MessageBoxIcon.Error); - e.CancelEdit = true; - return; - } - - if (String.IsNullOrEmpty(e.Label) || !Common.IsValidFileName(e.Label)) - { - MessageBox.Show("File name not valid: " + e.Label, "Cannot rename, New file name not valid", MessageBoxButtons.OK, MessageBoxIcon.Error); - e.CancelEdit = true; - return; - } - - try - { - string newFileName = MCEReplacement.MacroFolder + e.Label + Common.FileExtensionMacro; - - File.Move(oldFileName, newFileName); - } - catch (Exception ex) - { - IrssLog.Error(ex.ToString()); - MessageBox.Show(ex.ToString(), "Failed to rename file", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - } } Modified: trunk/plugins/MCEReplacement/Forms/StbSetup.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/StbSetup.cs 2007-10-27 13:36:02 UTC (rev 1007) +++ trunk/plugins/MCEReplacement/Forms/StbSetup.cs 2007-10-27 13:40:24 UTC (rev 1008) @@ -141,7 +141,7 @@ public void SetToCard(int cardId) { - ExternalChannelConfig config = MCEReplacement.ExternalChannelConfigs[cardId]; + ExternalChannelConfig config = MCEReplacement.GetExternalChannelConfig(cardId); if (config == null) return; @@ -172,7 +172,7 @@ public void SetToConfig(int cardId) { - ExternalChannelConfig config = MCEReplacement.ExternalChannelConfigs[cardId]; + ExternalChannelConfig config = MCEReplacement.GetExternalChannelConfig(cardId); if (config == null) return; Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-10-27 13:36:02 UTC (rev 1007) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-10-27 13:40:24 UTC (rev 1008) @@ -41,7 +41,7 @@ /// <summary> /// The plugin version string. /// </summary> - public const string PluginVersion = "MCE Replacement Plugin 1.0.3.4 for MediaPortal 0.2.3.0"; + internal const string PluginVersion = "MCE Replacement Plugin 1.0.3.5 for MediaPortal 0.2.3.0"; /// <summary> /// The wParam for Message Mode Windows Messages. @@ -49,13 +49,13 @@ public const int MessageModeCommand = 0x0018; // Macro Commands - //public const string WindowStateCommand = "Toggle Window State"; + //internal const string WindowStateCommand = "Toggle Window State"; // Macro File Commands - //public const string WindowStateMacroText = "WINDOW_STATE"; + //internal const string WindowStateMacroText = "WINDOW_STATE"; // English text for Macro commands - //public const string ChangeWindowStateText = "Change Window State"; + //internal const string ChangeWindowStateText = "Change Window State"; internal static readonly string AppDataFolder = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + @@ -113,7 +113,7 @@ static ExternalChannelConfig[] _externalChannelConfigs; - static bool _inConfiguration = false; + static bool _inConfiguration; static bool _mpBasicHome; static bool _mpMCERemote; @@ -132,7 +132,7 @@ /// Gets or sets the mce transceiver. /// </summary> /// <value>The mce transceiver.</value> - public static MicrosoftMceTransceiver.MicrosoftMceTransceiver MceTransceiver + internal static MicrosoftMceTransceiver.MicrosoftMceTransceiver MceTransceiver { get { return _mceTransceiver; } set { _mceTransceiver = value; } @@ -142,16 +142,27 @@ /// Gets or sets a value indicating whether to log verbosely. /// </summary> /// <value><c>true</c> if logging is set to verbose; otherwise, <c>false</c>.</value> - public static bool LogVerbose + internal static bool LogVerbose { get { return _logVerbose; } set { _logVerbose = value; } } + /// <summary> + /// Gets or sets a value indicating whether in configuration. + /// </summary> + /// <value><c>true</c> if in configuration; otherwise, <c>false</c>.</value> + internal static bool InConfiguration + { + get { return _inConfiguration; } + set { _inConfiguration = value; } + } + + /// <summary> /// Gets or sets a value indicating whether MediaPortal will require focus to handle input. /// </summary> /// <value><c>true</c> if requires focus; otherwise, <c>false</c>.</value> - public static bool RequireFocus + internal static bool RequireFocus { get { return _requireFocus; } set { _requireFocus = value; } @@ -160,7 +171,7 @@ /// Gets or sets a value indicating whether to control external channel tuning. /// </summary> /// <value><c>true</c> if controlling external channel tuning; otherwise, <c>false</c>.</value> - public static bool ControlExternalEnabled + internal static bool ControlExternalEnabled { get { return _controlExternalEnabled; } set { _controlExternalEnabled = value; } @@ -169,7 +180,7 @@ /// Gets or sets a value indicating whether message mode is enabled. /// </summary> /// <value><c>true</c> if message mode is enabled; otherwise, <c>false</c>.</value> - public static bool MessageModeEnabled + internal static bool MessageModeEnabled { get { return _messageModeEnabled; } set { _messageModeEnabled = value; } @@ -178,7 +189,7 @@ /// Gets or sets a value indicating whether the MCE remote is enabled. /// </summary> /// <value><c>true</c> if MCE remote is enabled; otherwise, <c>false</c>.</value> - public static bool MCERemoteEnabled + internal static bool MCERemoteEnabled { get { return _mceRemoteEnabled; } set { _mceRemoteEnabled = value; } @@ -189,7 +200,7 @@ /// <value> /// <c>true</c> if different remote handling is enabled; otherwise, <c>false</c>. /// </value> - public static bool DifferentRemoteEnabled + internal static bool DifferentRemoteEnabled { get { return _differentRemoteEnabled; } set { _differentRemoteEnabled = value; } @@ -198,7 +209,7 @@ /// Gets or sets a value indicating whether multi mapping is enabled. /// </summary> /// <value><c>true</c> if multi mapping is enabled; otherwise, <c>false</c>.</value> - public static bool MultiMappingEnabled + internal static bool MultiMappingEnabled { get { return _multiMappingEnabled; } set { _multiMappingEnabled = value; } @@ -207,7 +218,7 @@ /// Gets or sets a value indicating whether the event mapper is enabled. /// </summary> /// <value><c>true</c> if the event mapper is enabled; otherwise, <c>false</c>.</value> - public static bool EventMapperEnabled + internal static bool EventMapperEnabled { get { return _eventMapperEnabled; } set { _eventMapperEnabled = value; } @@ -217,7 +228,7 @@ /// Gets or sets the mouse mode button. /// </summary> /// <value>The mouse mode button.</value> - public static RemoteButton MouseModeButton + internal static RemoteButton MouseModeButton { get { return _mouseModeButton; } set { _mouseModeButton = value; } @@ -226,7 +237,7 @@ /// Gets or sets a value indicating whether mouse mode is enabled. /// </summary> /// <value><c>true</c> if mouse mode is enabled; otherwise, <c>false</c>.</value> - public static bool MouseModeEnabled + internal static bool MouseModeEnabled { get { return _mouseModeEnabled; } set { _mouseModeEnabled = value; } @@ -235,7 +246,7 @@ /// Gets or sets a value indicating whether mouse mode is active. /// </summary> /// <value><c>true</c> if mouse mode is active; otherwise, <c>false</c>.</value> - public static bool MouseModeActive + internal static bool MouseModeActive { get { return _mouseModeActive; } set { _mouseModeActive = value; } @@ -244,7 +255,7 @@ /// Gets or sets the mouse mode step distance. /// </summary> /// <value>The mouse mode step distance.</value> - public static int MouseModeStep + internal static int MouseModeStep { get { return _mouseModeStep; } set { _mouseModeStep = value; } @@ -253,9 +264,9 @@ /// Gets or sets a value indicating whether mouse mode acceleration is enabled. /// </summary> /// <value> - /// <c>true</c> if mouse mode acceleration is enabled; otherwise, <c>false</c>. + /// <c>true</c> if mouse mode acceleration is enabled; otherwise, <c>false</c>. /// </value> - public static bool MouseModeAcceleration + internal static bool MouseModeAcceleration { get { return _mouseModeAcceleration; } set { _mouseModeAcceleration = value; } @@ -265,7 +276,7 @@ /// Gets the event mappings. /// </summary> /// <value>The event mappings.</value> - public static List<MappedEvent> EventMappings + internal static List<MappedEvent> EventMappings { get { return _eventMappings; } } @@ -274,7 +285,7 @@ /// Gets or sets the multi mapping button. /// </summary> /// <value>The multi mapping button.</value> - public static RemoteButton MultiMappingButton + internal static RemoteButton MultiMappingButton { get { return _multiMappingButton; } set { _multiMappingButton = value; } @@ -283,35 +294,34 @@ /// Gets the multi maps. /// </summary> /// <value>The multi maps.</value> - public static string[] MultiMaps + internal static string[] MultiMaps { get { return _multiMaps; } } /// <summary> - /// Gets the external channel configs. + /// Count of available TV Cards. /// </summary> - /// <value>The external channel configs.</value> - public static ExternalChannelConfig[] ExternalChannelConfigs + internal static int TvCardCount { - get { return _externalChannelConfigs; } - } + get + { + ArrayList cards = new ArrayList(); + MediaPortal.TV.Database.TVDatabase.GetCards(ref cards); - /// <summary> - /// Gets or sets a value indicating whether in configuration. - /// </summary> - /// <value><c>true</c> if in configuration; otherwise, <c>false</c>.</value> - public static bool InConfiguration - { - get { return _inConfiguration; } - set { _inConfiguration = value; } + int cardCount = cards.Count; + if (cardCount == 0) + cardCount = 1; + + return cardCount; + } } /// <summary> /// Gets a value indicating whether MediaPortal has basic home enabled. /// </summary> /// <value><c>true</c> if MediaPortal has basic home enabled; otherwise, <c>false</c>.</value> - public static bool MP_BasicHome + internal static bool MP_BasicHome { get { return _mpBasicHome; } } @@ -319,7 +329,7 @@ /// Gets a value indicating whether MediaPortal has MCE remote enabled. /// </summary> /// <value><c>true</c> if MediaPortal has MCE remote enabled; otherwise, <c>false</c>.</value> - public static bool MP_MCERemote + internal static bool MP_MCERemote { get { return _mpMCERemote; } } @@ -327,7 +337,7 @@ /// Gets the MediaPortal serial uir port. /// </summary> /// <value>The MediaPortal serial uir port.</value> - public static string MP_SerialUirPort + internal static string MP_SerialUirPort { get { return _mpSerialUirPort; } } @@ -551,7 +561,7 @@ /// <returns>true if the plugin can be seen, otherwise false.</returns> public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) { - strButtonText = strButtonImage = strButtonImageFocus = strPictureImage = ""; + strButtonText = strButtonImage = strButtonImageFocus = strPictureImage = String.Empty; return false; } @@ -610,128 +620,9 @@ #endregion IPluginReceiver methods - #region Private Methods + #region Implementation /// <summary> - /// Handles remote buttons received. - /// </summary> - /// <param name="remoteButton">The remote button.</param> - void RemoteButtonReceived(string remoteButton) - { - int keyCode = int.Parse(remoteButton); - - // Handle MCE Remote button presses ... - if (!MessageModeEnabled) - { - // If user has stipulated that MP must have focus to recognize commands ... - if (RequireFocus && !GUIGraphicsContext.HasFocus) - return; - - int button = -1; - - // Map keyCode to button on MCE remote ... - if (MCERemoteEnabled) - { - for (int i = 0; i < _mceRemoteMap.Length; i += 2) - { - if (_mceRemoteMap[i] == keyCode) - { - button = _mceRemoteMap[i + 1]; - - if (MultiMappingEnabled && (RemoteButton)button == MultiMappingButton) - { - ChangeMultiMapping(); - return; - } - - if (MouseModeEnabled) - if (HandleMouseMode((RemoteButton)button)) - return; - - // Get & execute Mapping - bool gotMapped; - if (MultiMappingEnabled) - gotMapped = _multiInputHandlers[_multiMappingSet].MapAction(button); - else - gotMapped = _defaultInputHandler.MapAction(button); - - if (LogVerbose) - { - if (gotMapped) - Log.Debug("MCEReplacement: Command \"{0}\" mapped to MCE remote", button); - else - Log.Debug("MCEReplacement: Command \"{0}\" not mapped to MCE remote", button); - } - - return; - } - } - } - - // Check for different remote mapping ... - if (DifferentRemoteEnabled) - { - for (int i = 0; i < _differentRemoteMap.Length; i += 2) - { - if (_differentRemoteMap[i] == keyCode) - { - button = _differentRemoteMap[i + 1]; - - if (MultiMappingEnabled && (RemoteButton)button == MultiMappingButton) - { - ChangeMultiMapping(); - return; - } - - if (MouseModeEnabled) - if (HandleMouseMode((RemoteButton)button)) - return; - - // Get & execute Mapping - bool gotMapped; - if (MultiMappingEnabled) - gotMapped = _multiInputHandlers[_multiMappingSet].MapAction(button); - else - gotMapped = _defaultInputHandler.MapAction(button); - - if (LogVerbose) - { - if (gotMapped) - Log.Debug("MCEReplacement: Command \"{0}\" mapped to different remote", button); - else - Log.Debug("MCEReplacement: Command \"{0}\" not mapped to different remote", button); - } - - return; - } - } - } - - if (LogVerbose) - Log.Info("MCEReplacement: keyCode \"{0}\" was not handled", keyCode); - } - } - - /// <summary> - /// Handles the PowerModeChanged event of the SystemEvents control. - /// </summary> - /// <param name="sender">The source of the event.</param> - /// <param name="e">The <see cref="Microsoft.Win32.PowerModeChangedEventArgs"/> instance containing the event data.</param> - void SystemEvents_PowerModeChanged(object sender, PowerModeChangedEventArgs e) - { - switch (e.Mode) - { - case PowerModes.Suspend: - OnSuspend(); - break; - - case PowerModes.Resume: - OnResume(); - break; - } - } - - /// <summary> /// Handles the mouse mode. /// </summary> /// <param name="button">The button pressed.</param> @@ -933,9 +824,153 @@ } /// <summary> + /// Handles remote buttons received. + /// </summary> + /// <param name="remoteButton">The remote button.</param> + void RemoteButtonReceived(string remoteButton) + { + int keyCode = int.Parse(remoteButton); + + // Handle MCE Remote button presses ... + if (!MessageModeEnabled) + { + // If user has stipulated that MP must have focus to recognize commands ... + if (RequireFocus && !GUIGraphicsContext.HasFocus) + return; + + int button = -1; + + // Map keyCode to button on MCE remote ... + if (MCERemoteEnabled) + { + for (int i = 0; i < _mceRemoteMap.Length; i += 2) + { + if (_mceRemoteMap[i] == keyCode) + { + button = _mceRemoteMap[i + 1]; + + if (MultiMappingEnabled && (RemoteButton)button == MultiMappingButton) + { + ChangeMultiMapping(); + return; + } + + if (MouseModeEnabled) + if (HandleMouseMode((RemoteButton)button)) + return; + + // Get & execute Mapping + bool gotMapped; + if (MultiMappingEnabled) + gotMapped = _multiInputHandlers[_multiMappingSet].MapAction(button); + else + gotMapped = _defaultInputHandler.MapAction(button); + + if (LogVerbose) + { + if (gotMapped) + Log.Debug("MCEReplacement: Command \"{0}\" mapped to MCE remote", button); + else + Log.Debug("MCEReplacement: Command \"{0}\" not mapped to MCE remote", button); + } + + return; + } + } + } + + // Check for different remote mapping ... + if (DifferentRemoteEnabled) + { + for (int i = 0; i < _differentRemoteMap.Length; i += 2) + { + if (_differentRemoteMap[i] == keyCode) + { + button = _differentRemoteMap[i + 1]; + + if (MultiMappingEnabled && (RemoteButton)button == MultiMappingButton) + { + ChangeMultiMapping(); + return; + } + + if (MouseModeEnabled) + if (HandleMouseMode((RemoteButton)button)) + return; + + // Get & execute Mapping + bool gotMapped; + if (MultiMappingEnabled) + gotMapped = _multiInputHandlers[_multiMappingSet].MapAction(button); + else + gotMapped = _defaultInputHandler.MapAction(button); + + if (LogVerbose) + { + if (gotMapped) + Log.Debug("MCEReplacement: Command \"{0}\" mapped to different remote", button); + else + Log.Debug("MCEReplacement: Command \"{0}\" not mapped to different remote", button); + } + + return; + } + } + } + + if (LogVerbose) + Log.Info("MCEReplacement: keyCode \"{0}\" was not handled", keyCode); + } + } + + /// <summary> + /// Load external channel configurations. + /// </summary> + static void LoadExternalConfigs() + { + int cardCount = TvCardCount; + + _externalChannelConfigs = new ExternalChannelConfig[cardCount]; + + string fileName; + for (int index = 0; index < cardCount; index++) + { + fileName = String.Format("{0}ExternalChannelConfig{1}.xml", AppDataFolder, Convert.ToString(index + 1)); + try + { + _externalChannelConfigs[index] = ExternalChannelConfig.Load(fileName); + } + catch (Exception ex) + { + _externalChannelConfigs[index] = new ExternalChannelConfig(fileName); + Log.Error(ex); + } + + _externalChannelConfigs[index].CardId = index; + } + } + + /// <summary> + /// Given a card ID returns the configuration for that card. + /// </summary> + /// <param name="cardId">ID of card to retreive configuration for.</param> + /// <returns>Card configuration, null if it doesn't exist.</returns> + internal static ExternalChannelConfig GetExternalChannelConfig(int cardId) + { + if (_externalChannelConfigs == null) + return null; + + foreach (ExternalChannelConfig config in _externalChannelConfigs) + if (config.CardId == cardId) + return config; + + return null; + } + + /// <summary> /// OnMessage is used to receive requests to Tune External Channels and for event mapping. /// </summary> - /// <param name="msg">Message</param> + /// <param name="msg">Message.</param> void OnMessage(GUIMessage msg) { if (ControlExternalEnabled && msg.Message == GUIMessage.MessageType.GUI_MSG_TUNE_EXTERNAL_CHANNEL) @@ -958,24 +993,6 @@ } /// <summary> - /// Loads the external configs. - /// </summary> - static void LoadExternalConfigs() - { - ArrayList cards = new ArrayList(); - MediaPortal.TV.Database.TVDatabase.GetCards(ref cards); - - int cardCount = cards.Count; - if (cardCount == 0) - cardCount = 1; - - _externalChannelConfigs = new ExternalChannelConfig[cardCount]; - - for (int index = 0; index < cardCount; index++) - ExternalChannelConfigs[index] = new ExternalChannelConfig(AppDataFolder + "ExternalChannelConfig" + (index + 1).ToString() + ".xml"); - } - - /// <summary> /// Changes the multi mapping. /// </summary> static void ChangeMultiMapping() @@ -997,6 +1014,8 @@ /// <param name="multiMapping">The multi mapping.</param> static void ChangeMultiMapping(string multiMapping) { + Log.Debug("MCEReplacement: ChangeMultiMapping: {0}", multiMapping); + if (multiMapping == "TOGGLE") { ChangeMultiMapping(); @@ -1023,68 +1042,6 @@ } /// <summary> - /// Loads the settings. - /// </summary> - static void LoadSettings() - { - try - { - using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(MPConfigFile)) - { - LogVerbose = xmlreader.GetValueAsBool("MCEReplacement", "LogVerbose", false); - RequireFocus = xmlreader.GetValueAsBool("MCEReplacement", "RequireFocus", false); - MCERemoteEnabled = xmlreader.GetValueAsBool("MCEReplacement", "MapMCERemote", true); - DifferentRemoteEnabled = xmlreader.GetValueAsBool("MCEReplacement", "MapDifferentRemote", false); - MessageModeEnabled = xmlreader.GetValueAsBool("MCEReplacement", "MessageModeEnabled", false); - ControlExternalEnabled = xmlreader.GetValueAsBool("MCEReplacement", "ControlExternalEnabled", false); - MultiMappingEnabled = xmlreader.GetValueAsBool("MCEReplacement", "MultiMappingEnabled", false); - MultiMappingButton = (RemoteButton)xmlreader.GetValueAsInt("MCEReplacement", "MultiMappingButton", (int)RemoteButton.Start); - EventMapperEnabled = xmlreader.GetValueAsBool("MCEReplacement", "EventMapperEnabled", false); - MouseModeButton = (RemoteButton)xmlreader.GetValueAsInt("MCEReplacement", "MouseModeButton", (int)RemoteButton.Teletext); - MouseModeEnabled = xmlreader.GetValueAsBool("MCEReplacement", "MouseModeEnabled", false); - MouseModeStep = xmlreader.GetValueAsInt("MCEReplacement", "MouseModeStep", 10); - - // MediaPortal settings ... - _mpBasicHome = xmlreader.GetValueAsBool("general", "startbasichome", false); - _mpMCERemote = xmlreader.GetValueAsBool("remote", "MCE", false); - _mpSerialUirPort = xmlreader.GetValueAsString("SerialUIR", "commport", ""); - } - } - catch (Exception ex) - { - Log.Error("MCEReplacement: LoadSettings() {0}", ex.Message); - } - } - /// <summary> - /// Saves the settings. - /// </summary> - static void SaveSettings() - { - try - { - using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(MPConfigFile)) - { - xmlwriter.SetValueAsBool("MCEReplacement", "LogVerbose", LogVerbose); - xmlwriter.SetValueAsBool("MCEReplacement", "RequireFocus", RequireFocus); - xmlwriter.SetValueAsBool("MCEReplacement", "MapMCERemote", MCERemoteEnabled); - xmlwriter.SetValueAsBool("MCEReplacement", "MapDifferentRemote", DifferentRemoteEnabled); - xmlwriter.SetValueAsBool("MCEReplacement", "MessageModeEnabled", MessageModeEnabled); - xmlwriter.SetValueAsBool("MCEReplacement", "ControlExternalEnabled", ControlExternalEnabled); - xmlwriter.SetValueAsBool("MCEReplacement", "MultiMappingEnabled", MultiMappingEnabled); - xmlwriter.SetValue("MCEReplacement", "MultiMappingButton", (int)MultiMappingButton); - xmlwriter.SetValueAsBool("MCEReplacement", "EventMapperEnabled", EventMapperEnabled); - xmlwriter.SetValue("MCEReplacement", "MouseModeButton", (int)MouseModeButton); - xmlwriter.SetValueAsBool("MCEReplacement", "MouseModeEnabled", MouseModeEnabled); - xmlwriter.SetValue("MCEReplacement", "MouseModeStep", MouseModeStep); - } - } - catch (Exception ex) - { - Log.Error("MCEReplacement: SaveSettings() {0}", ex.Message); - } - } - - /// <summary> /// Loads the remote map. /// </summary> /// <param name="remoteFile">The remote file.</param> @@ -1193,15 +1150,14 @@ if (LogVerbose) Log.Info("MCEReplacement: Event Mapper - Event \"{0}\"", Enum.GetName(typeof(MappedEvent.MappingEvent), eventType)); - string command = mappedEvent.Command; - - if (command.StartsWith(Common.CmdPrefixBlast)) - command = command.Substring(Common.CmdPrefixBlast.Length); - - if (!ProcessCommand(command)) + try { - Log.Error("MCEReplacement: Failed to execute Event Mapper command \"{0}\"", mappedEvent.EventType); + ProcessCommand(mappedEvent.Command); } + catch (Exception ex) + { + Log.Error("MCEReplacement: Failed to execute Event Mapper command \"{0}\" - {1}", mappedEvent.EventType, ex.ToString()); + } } } } @@ -1222,20 +1178,38 @@ if (LogVerbose) Log.Info("MCEReplacement: Event Mapper - Event \"{0}\"", Enum.GetName(typeof(MappedEvent.MappingEvent), eventType)); - string command = mappedEvent.Command; - - if (command.StartsWith(Common.CmdPrefixBlast)) - command = command.Substring(Common.CmdPrefixBlast.Length); - - if (!ProcessCommand(command)) + try { - Log.Error("MCEReplacement: Failed to execute Event Mapper command \"{0}\"", mappedEvent.EventType); + ProcessCommand(mappedEvent.Command); } + catch (Exception ex) + { + Log.Error("MCEReplacement: Failed to execute Event Mapper command \"{0}\" - {1}", mappedEvent.EventType, ex.ToString()); + } } } } /// <summary> + /// Handles the PowerModeChanged event of the SystemEvents control. + /// </summary> + /// <param name="sender">The source of the event.</param> + /// <param name="e">The <see cref="Microsoft.Win32.PowerModeChangedEventArgs"/> instance containing the event data.</param> + static void SystemEvents_PowerModeChanged(object sender, PowerModeChangedEventArgs e) + { + switch (e.Mode) + { + case PowerModes.Resume: + OnResume(); + break; + + case PowerModes.Suspend: + OnSuspend(); + break; + } + } + + /// <summary> /// Processes the external channel. /// </summary> /// <param name="externalChannel">The external channel.</param> @@ -1248,10 +1222,10 @@ if (card < 0) card = 0; - if (card >= ExternalChannelConfigs.Length) + if (card >= _externalChannelConfigs.Length) throw new ArgumentException("Card number is higher than last card in list, reconfigure plugin TV cards.", "tunerCard"); - ExternalChannelConfig config = ExternalChannelConfigs[card]; + ExternalChannelConfig config = _externalChannelConfigs[card]; // Clean up the "externalChannel" string into "channel". StringBuilder channel = new StringBuilder(); @@ -1387,62 +1361,9 @@ } /// <summary> - /// Adds to the Macro Stack. - /// </summary> - /// <param name="fileName">Name of the macro file.</param> - static void MacroStackAdd(string fileName) - { - string lowerCasedFileName = fileName.ToLowerInvariant(); - - if (_macroStack == null) - { - _macroStack = new List<string>(); - } - else if (_macroStack.Contains(lowerCasedFileName)) - { - StringBuilder macroStackTrace = new StringBuilder(); - macroStackTrace.AppendLine("Macro infinite loop detected!"); - macroStackTrace.AppendLine(); - macroStackTrace.AppendLine("Stack trace:"); - - foreach (string macro in _macroStack) - { - if (macro.Equals(lowerCasedFileName)) - macroStackTrace.AppendLine(String.Format("--> {0}", macro)); - else - macroStackTrace.AppendLine(macro); - } - - macroStackTrace.AppendLine(String.Format("--> {0}", lowerCasedFileName)); - - throw new ApplicationException(macroStackTrace.ToString()); - } - - _macroStack.Add(lowerCasedFileName); - } - /// <summary> - /// Removes from the Macro Stack. - /// </summary> - /// <param name="fileName">Name of the macro file.</param> - static void MacroStackRemove(string fileName) - { - string lowerCasedFileName = fileName.ToLowerInvariant(); - - if (_macroStack.Contains(lowerCasedFileName)) - _macroStack.Remove(lowerCasedFileName); - - if (_macroStack.Count == 0) - _macroStack = null; - } - - #endregion Private Methods - - #region Public Methods - - /// <summary> /// Loads the default remote button input handler. /// </summary> - public static void LoadDefaultMapping() + internal static void LoadDefaultMapping() { _defaultInputHandler = new InputHandler("MCE Replacement"); @@ -1453,7 +1374,7 @@ /// <summary> /// Loads multi-mappings for input handling. /// </summary> - public static void LoadMultiMappings() + internal static void LoadMultiMappings() { XmlDocument doc = new XmlDocument(); doc.Load(MultiMappingFile); @@ -1479,7 +1400,7 @@ /// <summary> /// Call this when entering standby to ensure that the Event Mapper is informed. /// </summary> - public static void OnSuspend() + internal static void OnSuspend() { if (!InConfiguration && EventMapperEnabled) MapEvent(MappedEvent.MappingEvent.PC_Suspend); @@ -1496,7 +1417,7 @@ /// <summary> /// Call this when leaving standby to ensure the Event Mapper is informed. /// </summary> - public static void OnResume() + internal static void OnResume() { if (_mceTransceiver != null) { @@ -1511,11 +1432,59 @@ } /// <summary> + /// Adds to the Macro Stack. + /// </summary> + /// <param name="fileName">Name of the macro file.</param> + static void MacroStackAdd(string fileName) + { + string lowerCasedFileName = fileName.ToLowerInvariant(); + + if (_macroStack == null) + { + _macroStack = new List<string>(); + } + else if (_macroStack.Contains(lowerCasedFileName)) + { + StringBuilder macroStackTrace = new StringBuilder(); + macroStackTrace.AppendLine("Macro infinite loop detected!"); + macroStackTrace.AppendLine(); + macroStackTrace.AppendLine("Stack trace:"); + + foreach (string macro in _macroStack) + { + if (macro.Equals(lowerCasedFileName)) + macroStackTrace.AppendLine(String.Format("--> {0}", macro)); + else + macroStackTrace.AppendLine(macro); + } + + macroStackTrace.AppendLine(String.Format("--> {0}", lowerCasedFileName)); + + throw new ApplicationException(macroStackTrace.ToString()); + } + + _macroStack.Add(lowerCasedFileName); + } + /// <summary> + /// Removes from the Macro Stack. + /// </summary> + /// <param name="fileName">Name of the macro file.</param> + static void MacroStackRemove(string fileName) + { + string lowerCasedFileName = fileName.ToLowerInvariant(); + + if (_macroStack.Contains(lowerCasedFileName)) + _macroStack.Remove(lowerCasedFileName); + + if (_macroStack.Count == 0) + _macroStack = null; + } + + /// <summary> /// Process the supplied Macro file. /// </summary> /// <param name="fileName">Macro file to process (absolute path).</param> - /// <returns>Sucess.</returns> - public static bool ProcessMacro(string fileName) + internal static void ProcessMacro(string fileName) { MacroStackAdd(fileName); @@ -1793,11 +1762,8 @@ GUIGraphicsContext.OnAction(new Action(Action.ActionType.ACTION_SHUTDOWN, 0, 0)); break; } - } } - - return true; } finally { @@ -1810,7 +1776,7 @@ /// </summary> /// <param name="fileName">File to blast (absolute path).</param> /// <param name="port">Port to blast to.</param> - public static void BlastIR(string fileName, string port) + internal static void BlastIR(string fileName, string port) { try { @@ -1843,13 +1809,10 @@ } /// <summary> - /// Given a command this method checks if the file exists as an IR - /// command, macro or other command and then processes the request - /// accordingly. + /// Given a command this method processes the request accordingly. /// </summary> /// <param name="command">Command to process.</param> - /// <returns>true if successful, otherwise false.</returns> - public static bool ProcessCommand(string command) + internal static void ProcessCommand(string command) { if (String.IsNullOrEmpty(command)) throw new ArgumentNullException("command"); @@ -1857,7 +1820,7 @@ if (command.StartsWith(Common.CmdPrefixMacro, StringComparison.InvariantCultureIgnoreCase)) // Macro { string fileName = MacroFolder + command.Substring(Common.CmdPrefixMacro.Length) + Common.FileExtensionMacro; - return ProcessMacro(fileName); + ProcessMacro(fileName); } else if (command.StartsWith(Common.CmdPrefixBlast, StringComparison.InvariantCultureIgnoreCase)) // IR Code { @@ -1872,19 +1835,16 @@ else if (command.StartsWith(Common.CmdPrefixRun, StringComparison.InvariantCultureIgnoreCase)) // External Program { string[] commands = Common.SplitRunCommand(command.Substring(Common.CmdPrefixRun.Length)); - Common.ProcessRunCommand(commands); } else if (command.StartsWith(Common.CmdPrefixSerial, StringComparison.InvariantCultureIgnoreCase)) // Serial Port Command { string[] commands = Common.SplitSerialCommand(command.Substring(Common.CmdPrefixSerial.Length)); - Common.ProcessSerialCommand(commands); } else if (command.StartsWith(Common.CmdPrefixWindowMsg, StringComparison.InvariantCultureIgnoreCase)) // Message Command { string[] commands = Common.SplitWindowMessageCommand(command.Substring(Common.CmdPrefixWindowMsg.Length)); - Common.ProcessWindowMessageCommand(commands); } else if (command.StartsWith(Common.CmdPrefixKeys, StringComparison.InvariantCultureIgnoreCase)) // Keystroke Command @@ -1901,11 +1861,8 @@ } else { - Log.Error("MCEReplacement: Unprocessed command \"{0}\"", command); - return false; + throw new ArgumentException(String.Format("Cannot process unrecognized command \"{0}\"", command), "command"); } - - return true; } /// <summary> @@ -1913,7 +1870,7 @@ /// </summary> /// <param name="fileName">File to place learned IR command in (absolute path).</param> /// <returns>true if successful, otherwise false.</returns> - public static IRServerPluginInterface.LearnStatus LearnIRCommand(string fileName) + internal static IRServerPluginInterface.LearnStatus LearnIRCommand(string fileName) { IRServerPluginInterface.LearnStatus status = IRServerPluginInterface.LearnStatus.Failure; @@ -1944,27 +1901,19 @@ /// </summary> /// <param name="commandPrefix">Add the command prefix to each list item.</param> /// <returns>string[] of IR Commands.</returns> - public static string[] GetIRList(bool commandPrefix) + internal static string[] GetIRList(bool commandPrefix) { - try - { - string[] files = Directory.GetFiles(IRFolder, "*" + Common.FileExtensionIR); - string[] list = new string[files.Length]; + string[] files = Directory.GetFiles(IRFolder, "*" + Common.FileExtensionIR); + string[] list = new string[files.Length]; - int i = 0; - foreach (string file in files) - if (commandPrefix) - list[i++] = Common.CmdPrefixBlast + Path.GetFileNameWithoutExtension(file); - else - list[i++] = Path.GetFileNameWithoutExtension(file); + int i = 0; + foreach (string file in files) + if (commandPrefix) + list[i++] = Common.CmdPrefixBlast + Path.GetFileNameWithoutExtension(file); + else + list[i++] = Path.GetFileNameWithoutExtension(file); - return list; - } - catch (Exception ex) - { - Log.Error("MCEReplacement: GetIRList() - {0}", ex.ToString()); - return null; - } + return list; } /// <summary> @@ -1972,29 +1921,21 @@ /// </summary> /// <param name="commandPrefix">Add the command prefix to each list item.</param> /// <returns>string[] of Macros.</returns> - public static string[] GetMacroList(bool commandPrefix) + internal static string[] GetMacroList(bool commandPrefix) { - try - { - string[] files = Directory.GetFiles(MacroFolder, "*" + Common.FileExtensionMacro); - string[] list = new string[files.Length]; + string[] files = Directory.GetFiles(MacroFolder, '*' + Common.FileExtensionMacro); + string[] list = new string[files.Length]; - int i = 0; - foreach (string file in files) - { - if (commandPrefix) - list[i++] = Common.CmdPrefixMacro + Path.GetFileNameWithoutExtension(file); - else - list[i++] = Path.GetFileNameWithoutExtension(file); - } - - return list; - } - catch (Exception ex) + int i = 0; + foreach (string file in files) { - Log.Error("MCEReplacement: GetMacroList() - {0}", ex.ToString()); - return null; + if (commandPrefix) + list[i++] = Common.CmdPrefixMacro + Path.GetFileNameWithoutExtension(file); + else + list[i++] = Path.GetFileNameWithoutExtension(file); } + + return list; } /// <summary> @@ -2002,10 +1943,10 @@ /// </summary> /// <param name="commandPrefix">Add the command prefix to each list item.</param> /// <returns>string[] of IR Commands and Macros.</returns> - public static string[] GetFileList(bool commandPrefix) + internal static string[] GetFileList(bool commandPrefix) { - string[] MacroFiles = Directory.GetFiles(MacroFolder, "*" + Common.FileExtensionMacro); - string[] IRFiles = Directory.GetFiles(IRFolder, "*" + Common.FileExtensionIR); + string[] MacroFiles = Directory.GetFiles(MacroFolder, '*' + Common.FileExtensionMacro); + string[] IRFiles = Directory.GetFiles(IRFolder, '*' + Common.FileExtensionIR); string[] list = new string[MacroFiles.Length + IRFiles.Length]; int i = 0; @@ -2028,8 +1969,70 @@ return list; } - #endregion Public Methods + /// <summary> + /// Loads the settings. + /// </summary> + static void LoadSettings() + { + try + { + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(MPConfigFile)) + { + LogVerbose = xmlreader.GetValueAsBool("MCEReplacement", "LogVerbose", false); + RequireFocus = xmlreader.GetValueAsBool("MCEReplacement", "RequireFocus", false); + MCERemoteEnabled = xmlreader.GetValueAsBool("MCEReplacement", "MapMCERemote", true); + DifferentRemoteEnabled = xmlreader.GetValueAsBool("MCEReplacement", "MapDifferentRemote", false); + MessageModeEnabled = xmlreader.GetValueAsBool("MCEReplacement", "MessageModeEnabled", false); + ControlExternalEnabled = xmlreader.GetValueAsBool("MCEReplacement", "ControlExternalEnabled", false); + MultiMappingEnabled = xmlreader.GetValueAsBool("MCEReplacement", "MultiMappingEnabled", false); + MultiMappingButton = (RemoteButton)xmlreader.GetValueAsInt("MCEReplacement", "MultiMappingButton", (int)RemoteButton.Start); + EventMapperEnabled = xmlreader.GetValueAsBool("MCEReplacement", "EventMapperEnabled", false); + MouseModeButton = (RemoteButton)xmlreader.GetValueAsInt("MCEReplacement", "MouseModeButton", (int)RemoteButton.Teletext); + MouseModeEnabled = xmlreader.GetValueAsBool("MCEReplacement", "MouseModeEnabled", false); + MouseModeStep = xmlreader.GetValueAsInt("MCEReplacement", "MouseModeStep", 10); + // MediaPortal settings ... + _mpBasicHome = xmlreader.GetValueAsBool("general", "startbasichome", false); + _mpMCERemote = xmlreader.GetValueAsBool("remote", "MCE", false); + _mpSerialUirPort = xmlreader.GetValueAsString("SerialUIR", "commport", ""); + } + } + catch (Exception ex) + { + Log.Error("MCEReplacement: LoadSettings() {0}", ex.Message); + } + } + /// <summary> + /// Saves the settings. + /// </summary> + static void SaveSettings() + { + try + { + using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(MPConfigFile)) + { + xmlwriter.SetValueAsBool("MCEReplacement", "LogVerbose", LogVerbose); + xmlwriter.SetValueAsBool("MCEReplacement", "RequireFocus", RequireFocus); + xmlwriter.SetValueAsBool("MCEReplacement", "MapMCERemote", MCERemoteEnabled); + xmlwriter.SetValueAsBool("MCEReplacement", "MapDifferentRemote", DifferentRemoteEnabled); + xmlwriter.SetValueAsBool("MCEReplacement", "MessageModeEnabled", MessageModeEnabled); + xmlwriter.SetValueAsBool("MCEReplacement", "ControlExternalEnabled", ControlExternalEnabled); + xmlwriter.SetValueAsBool("MCEReplacement", "MultiMappingEnabled", MultiMappingEnabled); + xmlwriter.SetValue("MCEReplacement", "MultiMappingButton", (int)MultiMappingButton); + xmlwriter.SetValueAsBool("MCEReplacement", "EventMapperEnabled", EventMapperEnabled); + xmlwriter.SetValue("MCEReplacement", "MouseModeButton", (int)MouseModeButton); + xmlwriter.SetValueAsBool("MCEReplacement", "MouseModeEnabled", MouseModeEnabled); + xmlwriter.SetValue("MCEReplacement", "MouseModeStep", MouseModeStep); + } + } + catch (Exception ex) + { + Log.Error("MCEReplacement: SaveSettings() {0}", ex.Message); + } + } + + #endregion Implementation + } } Modified: trunk/plugins/MCEReplacement/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/MCEReplacement/Properties/AssemblyInfo.cs 2007-10-27 13:36:02 UTC (rev 1007) +++ trunk/plugins/MCEReplacement/Properties/AssemblyInfo.cs 2007-10-27 13:40:24 UTC (rev 1008) @@ -34,8 +34,8 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.3.4")] -[assembly: AssemblyFileVersionAttribute("1.0.3.4")] +[assembly: AssemblyVersion("1.0.3.5")] +[assembly: AssemblyFileVersionAttribute("1.0.3.5")] // // In order to sign your assembly you must specify a key to use. Refer to the This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-02-22 12:45:01
|
Revision: 135 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=135&view=rev Author: and-81 Date: 2007-02-22 04:45:00 -0800 (Thu, 22 Feb 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/InputMapper/InputHandler.cs trunk/plugins/MCEReplacement/InputMapper/InputMappingForm.cs trunk/plugins/MCEReplacement/MCEReplacement.csproj trunk/plugins/MCEReplacement/MceIrApi.cs Removed Paths: ------------- trunk/plugins/MCEReplacement/InputMapper/NewButtonForm.Designer.cs trunk/plugins/MCEReplacement/InputMapper/NewButtonForm.cs trunk/plugins/MCEReplacement/InputMapper/NewButtonForm.resx Modified: trunk/plugins/MCEReplacement/InputMapper/InputHandler.cs =================================================================== --- trunk/plugins/MCEReplacement/InputMapper/InputHandler.cs 2007-02-22 12:41:20 UTC (rev 134) +++ trunk/plugins/MCEReplacement/InputMapper/InputHandler.cs 2007-02-22 12:45:00 UTC (rev 135) @@ -1,8 +1,8 @@ -#region Copyright (C) 2005-2006 Team MediaPortal - Author: mPod +#region Copyright (C) 2005-2007 Team MediaPortal /* - * Copyright (C) 2005-2006 Team MediaPortal - Author: mPod - * http://www.team-mediaportal.com + * 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 @@ -29,11 +29,11 @@ using System.Collections; using System.Xml; using System.IO; - using MediaPortal.GUI.Library; using MediaPortal.Util; using MediaPortal.Player; using MediaPortal.TV.Recording; +using MediaPortal.Configuration; namespace MediaPortal.Plugins { @@ -218,10 +218,10 @@ { int cmdKeyChar = 0; int cmdKeyCode = 0; - string condition = nodeAction.Attributes["condition"].Value.ToUpperInvariant(); - string conProperty = nodeAction.Attributes["conproperty"].Value.ToUpperInvariant(); - string command = nodeAction.Attributes["command"].Value.ToUpperInvariant(); - string cmdProperty = nodeAction.Attributes["cmdproperty"].Value.ToUpperInvariant(); + string condition = nodeAction.Attributes["condition"].Value.ToUpper(); + string conProperty = nodeAction.Attributes["conproperty"].Value.ToUpper(); + string command = nodeAction.Attributes["command"].Value.ToUpper(); + string cmdProperty = nodeAction.Attributes["cmdproperty"].Value.ToUpper(); if ((command == "ACTION") && (cmdProperty == "93")) { cmdKeyChar = Convert.ToInt32(nodeAction.Attributes["cmdkeychar"].Value); @@ -392,6 +392,7 @@ break; case "PROCESS": { + GUIGraphicsContext.ResetLastActivity(); if (processID > 0) { Process proc = Process.GetProcessById(processID); Modified: trunk/plugins/MCEReplacement/InputMapper/InputMappingForm.cs =================================================================== --- trunk/plugins/MCEReplacement/InputMapper/InputMappingForm.cs 2007-02-22 12:41:20 UTC (rev 134) +++ trunk/plugins/MCEReplacement/InputMapper/InputMappingForm.cs 2007-02-22 12:45:00 UTC (rev 135) @@ -150,7 +150,6 @@ private MediaPortal.UserInterface.Controls.MPTextBox textBoxKeyCode; private MediaPortal.UserInterface.Controls.MPLabel labelExpand; private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxGainFocus; - private MediaPortal.UserInterface.Controls.MPButton buttonEdit; #endregion private MediaPortal.UserInterface.Controls.MPRadioButton radioButtonBlast; @@ -254,7 +253,6 @@ this.labelExpand = new MediaPortal.UserInterface.Controls.MPLabel(); this.buttonDefault = new MediaPortal.UserInterface.Controls.MPButton(); this.buttonRemove = new MediaPortal.UserInterface.Controls.MPButton(); - this.buttonNew = new MediaPortal.UserInterface.Controls.MPButton(); this.buttonDown = new MediaPortal.UserInterface.Controls.MPButton(); this.buttonUp = new MediaPortal.UserInterface.Controls.MPButton(); this.beveledLine1 = new MediaPortal.UserInterface.Controls.MPBeveledLine(); @@ -285,7 +283,7 @@ this.groupBoxLayer = new MediaPortal.UserInterface.Controls.MPGroupBox(); this.comboBoxLayer = new MediaPortal.UserInterface.Controls.MPComboBox(); this.labelLayer = new MediaPortal.UserInterface.Controls.MPLabel(); - this.buttonEdit = new MediaPortal.UserInterface.Controls.MPButton(); + this.buttonNew = new MediaPortal.UserInterface.Controls.MPButton(); this.buttonRemoveReplacements = new System.Windows.Forms.Button(); this.groupBoxAction.SuspendLayout(); this.groupBoxCondition.SuspendLayout(); @@ -302,7 +300,7 @@ this.treeMapping.Location = new System.Drawing.Point(16, 56); this.treeMapping.Name = "treeMapping"; this.treeMapping.Size = new System.Drawing.Size(312, 335); - this.treeMapping.TabIndex = 1; + this.treeMapping.TabIndex = 0; this.treeMapping.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeMapping_AfterSelect); // // labelExpand @@ -311,17 +309,17 @@ this.labelExpand.Location = new System.Drawing.Point(328, 374); this.labelExpand.Name = "labelExpand"; this.labelExpand.Size = new System.Drawing.Size(13, 13); - this.labelExpand.TabIndex = 7; + this.labelExpand.TabIndex = 5; this.labelExpand.Text = "+"; this.labelExpand.Click += new System.EventHandler(this.labelExpand_Click); // // buttonDefault // - this.buttonDefault.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonDefault.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.buttonDefault.Location = new System.Drawing.Point(268, 442); this.buttonDefault.Name = "buttonDefault"; this.buttonDefault.Size = new System.Drawing.Size(75, 23); - this.buttonDefault.TabIndex = 13; + this.buttonDefault.TabIndex = 11; this.buttonDefault.Text = "Reset"; this.buttonDefault.UseVisualStyleBackColor = true; this.buttonDefault.Click += new System.EventHandler(this.buttonDefault_Click); @@ -332,29 +330,18 @@ this.buttonRemove.Location = new System.Drawing.Point(272, 397); this.buttonRemove.Name = "buttonRemove"; this.buttonRemove.Size = new System.Drawing.Size(56, 20); - this.buttonRemove.TabIndex = 6; + this.buttonRemove.TabIndex = 4; this.buttonRemove.Text = "Remove"; this.buttonRemove.UseVisualStyleBackColor = true; this.buttonRemove.Click += new System.EventHandler(this.buttonRemove_Click); // - // buttonNew - // - this.buttonNew.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.buttonNew.Location = new System.Drawing.Point(144, 397); - this.buttonNew.Name = "buttonNew"; - this.buttonNew.Size = new System.Drawing.Size(56, 20); - this.buttonNew.TabIndex = 4; - this.buttonNew.Text = "New"; - this.buttonNew.UseVisualStyleBackColor = true; - this.buttonNew.Click += new System.EventHandler(this.buttonNew_Click); - // // buttonDown // this.buttonDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.buttonDown.Location = new System.Drawing.Point(80, 397); + this.buttonDown.Location = new System.Drawing.Point(97, 397); this.buttonDown.Name = "buttonDown"; this.buttonDown.Size = new System.Drawing.Size(56, 20); - this.buttonDown.TabIndex = 3; + this.buttonDown.TabIndex = 2; this.buttonDown.Text = "Down"; this.buttonDown.UseVisualStyleBackColor = true; this.buttonDown.Click += new System.EventHandler(this.buttonDown_Click); @@ -365,7 +352,7 @@ this.buttonUp.Location = new System.Drawing.Point(16, 397); this.buttonUp.Name = "buttonUp"; this.buttonUp.Size = new System.Drawing.Size(56, 20); - this.buttonUp.TabIndex = 2; + this.buttonUp.TabIndex = 1; this.buttonUp.Text = "Up"; this.buttonUp.UseVisualStyleBackColor = true; this.buttonUp.Click += new System.EventHandler(this.buttonUp_Click); @@ -376,8 +363,8 @@ | System.Windows.Forms.AnchorStyles.Right))); this.beveledLine1.Location = new System.Drawing.Point(8, 432); this.beveledLine1.Name = "beveledLine1"; - this.beveledLine1.Size = new System.Drawing.Size(572, 2); - this.beveledLine1.TabIndex = 11; + this.beveledLine1.Size = new System.Drawing.Size(328, 2); + this.beveledLine1.TabIndex = 9; // // buttonApply // @@ -385,7 +372,7 @@ this.buttonApply.Location = new System.Drawing.Point(346, 442); this.buttonApply.Name = "buttonApply"; this.buttonApply.Size = new System.Drawing.Size(75, 23); - this.buttonApply.TabIndex = 14; + this.buttonApply.TabIndex = 12; this.buttonApply.Text = "Apply"; this.buttonApply.UseVisualStyleBackColor = true; this.buttonApply.Click += new System.EventHandler(this.buttonApply_Click); @@ -396,7 +383,7 @@ this.buttonOk.Location = new System.Drawing.Point(426, 442); this.buttonOk.Name = "buttonOk"; this.buttonOk.Size = new System.Drawing.Size(75, 23); - this.buttonOk.TabIndex = 15; + this.buttonOk.TabIndex = 13; this.buttonOk.Text = "OK"; this.buttonOk.UseVisualStyleBackColor = true; this.buttonOk.Click += new System.EventHandler(this.buttonOk_Click); @@ -408,7 +395,7 @@ this.buttonCancel.Location = new System.Drawing.Point(505, 442); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(75, 23); - this.buttonCancel.TabIndex = 16; + this.buttonCancel.TabIndex = 14; this.buttonCancel.Text = "Cancel"; this.buttonCancel.UseVisualStyleBackColor = true; // @@ -424,7 +411,7 @@ this.headerLabel.Name = "headerLabel"; this.headerLabel.PaddingLeft = 2; this.headerLabel.Size = new System.Drawing.Size(558, 24); - this.headerLabel.TabIndex = 0; + this.headerLabel.TabIndex = 15; this.headerLabel.TextColor = System.Drawing.Color.WhiteSmoke; this.headerLabel.TextFont = new System.Drawing.Font("Verdana", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); // @@ -448,8 +435,8 @@ this.groupBoxAction.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.groupBoxAction.Location = new System.Drawing.Point(350, 221); this.groupBoxAction.Name = "groupBoxAction"; - this.groupBoxAction.Size = new System.Drawing.Size(224, 203); - this.groupBoxAction.TabIndex = 10; + this.groupBoxAction.Size = new System.Drawing.Size(224, 211); + this.groupBoxAction.TabIndex = 8; this.groupBoxAction.TabStop = false; this.groupBoxAction.Text = "Action"; // @@ -459,9 +446,9 @@ this.radioButtonBlast.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.radioButtonBlast.Location = new System.Drawing.Point(112, 68); this.radioButtonBlast.Name = "radioButtonBlast"; - this.radioButtonBlast.Size = new System.Drawing.Size(61, 17); + this.radioButtonBlast.Size = new System.Drawing.Size(102, 17); this.radioButtonBlast.TabIndex = 5; - this.radioButtonBlast.Text = "Blast IR"; + this.radioButtonBlast.Text = "Blast IR / Macro"; this.radioButtonBlast.UseVisualStyleBackColor = true; this.radioButtonBlast.Click += new System.EventHandler(this.radioButtonBlast_Click); // @@ -481,7 +468,7 @@ // this.textBoxKeyCode.BorderColor = System.Drawing.Color.Empty; this.textBoxKeyCode.Enabled = false; - this.textBoxKeyCode.Location = new System.Drawing.Point(152, 144); + this.textBoxKeyCode.Location = new System.Drawing.Point(152, 152); this.textBoxKeyCode.MaxLength = 3; this.textBoxKeyCode.Name = "textBoxKeyCode"; this.textBoxKeyCode.Size = new System.Drawing.Size(48, 20); @@ -492,7 +479,7 @@ // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(24, 148); + this.label1.Location = new System.Drawing.Point(24, 156); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(28, 13); this.label1.TabIndex = 8; @@ -502,7 +489,7 @@ // this.textBoxKeyChar.BorderColor = System.Drawing.Color.Empty; this.textBoxKeyChar.Enabled = false; - this.textBoxKeyChar.Location = new System.Drawing.Point(72, 144); + this.textBoxKeyChar.Location = new System.Drawing.Point(72, 152); this.textBoxKeyChar.MaxLength = 3; this.textBoxKeyChar.Name = "textBoxKeyChar"; this.textBoxKeyChar.Size = new System.Drawing.Size(80, 20); @@ -525,7 +512,7 @@ // labelSound // this.labelSound.AutoSize = true; - this.labelSound.Location = new System.Drawing.Point(24, 171); + this.labelSound.Location = new System.Drawing.Point(24, 184); this.labelSound.Name = "labelSound"; this.labelSound.Size = new System.Drawing.Size(41, 13); this.labelSound.TabIndex = 11; @@ -536,7 +523,7 @@ this.comboBoxSound.BorderColor = System.Drawing.Color.Empty; this.comboBoxSound.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxSound.ForeColor = System.Drawing.Color.DarkRed; - this.comboBoxSound.Location = new System.Drawing.Point(72, 168); + this.comboBoxSound.Location = new System.Drawing.Point(72, 181); this.comboBoxSound.Name = "comboBoxSound"; this.comboBoxSound.Size = new System.Drawing.Size(128, 21); this.comboBoxSound.TabIndex = 12; @@ -595,7 +582,7 @@ this.comboBoxCmdProperty.BorderColor = System.Drawing.Color.Empty; this.comboBoxCmdProperty.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxCmdProperty.ForeColor = System.Drawing.Color.DarkGreen; - this.comboBoxCmdProperty.Location = new System.Drawing.Point(24, 116); + this.comboBoxCmdProperty.Location = new System.Drawing.Point(24, 120); this.comboBoxCmdProperty.Name = "comboBoxCmdProperty"; this.comboBoxCmdProperty.Size = new System.Drawing.Size(176, 21); this.comboBoxCmdProperty.Sorted = true; @@ -615,7 +602,7 @@ this.groupBoxCondition.Location = new System.Drawing.Point(350, 110); this.groupBoxCondition.Name = "groupBoxCondition"; this.groupBoxCondition.Size = new System.Drawing.Size(224, 100); - this.groupBoxCondition.TabIndex = 9; + this.groupBoxCondition.TabIndex = 7; this.groupBoxCondition.TabStop = false; this.groupBoxCondition.Text = "Condition"; // @@ -689,7 +676,7 @@ this.groupBoxLayer.Location = new System.Drawing.Point(350, 48); this.groupBoxLayer.Name = "groupBoxLayer"; this.groupBoxLayer.Size = new System.Drawing.Size(224, 52); - this.groupBoxLayer.TabIndex = 8; + this.groupBoxLayer.TabIndex = 6; this.groupBoxLayer.TabStop = false; this.groupBoxLayer.Text = "Layer"; // @@ -713,16 +700,16 @@ this.labelLayer.TabIndex = 0; this.labelLayer.Text = "Layer:"; // - // buttonEdit + // buttonNew // - this.buttonEdit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.buttonEdit.Location = new System.Drawing.Point(208, 397); - this.buttonEdit.Name = "buttonEdit"; - this.buttonEdit.Size = new System.Drawing.Size(56, 20); - this.buttonEdit.TabIndex = 5; - this.buttonEdit.Text = "Edit"; - this.buttonEdit.UseVisualStyleBackColor = true; - this.buttonEdit.Click += new System.EventHandler(this.buttonEdit_Click); + this.buttonNew.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonNew.Location = new System.Drawing.Point(189, 397); + this.buttonNew.Name = "buttonNew"; + this.buttonNew.Size = new System.Drawing.Size(56, 20); + this.buttonNew.TabIndex = 3; + this.buttonNew.Text = "New"; + this.buttonNew.UseVisualStyleBackColor = true; + this.buttonNew.Click += new System.EventHandler(this.buttonNew_Click); // // buttonRemoveReplacements // @@ -730,7 +717,7 @@ this.buttonRemoveReplacements.Location = new System.Drawing.Point(8, 442); this.buttonRemoveReplacements.Name = "buttonRemoveReplacements"; this.buttonRemoveReplacements.Size = new System.Drawing.Size(224, 24); - this.buttonRemoveReplacements.TabIndex = 12; + this.buttonRemoveReplacements.TabIndex = 10; this.buttonRemoveReplacements.Text = "Remove replacement driver mappings"; this.buttonRemoveReplacements.UseVisualStyleBackColor = true; this.buttonRemoveReplacements.Click += new System.EventHandler(this.buttonRemoveReplacements_Click); @@ -740,7 +727,6 @@ this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.AutoScroll = true; this.ClientSize = new System.Drawing.Size(590, 475); - this.Controls.Add(this.buttonEdit); this.Controls.Add(this.buttonRemoveReplacements); this.Controls.Add(this.labelExpand); this.Controls.Add(this.treeMapping); @@ -1621,30 +1607,7 @@ } } - private void buttonEdit_Click(object sender, EventArgs e) - { - TreeNode node = treeMapping.SelectedNode; - Data data = (Data)node.Tag; - if (data.Type == "BUTTON") - { - NewButtonForm newButtonForm = new NewButtonForm(); - newButtonForm.ButtonName = (string)data.Parameter; - newButtonForm.ButtonCode = (string)data.Value; - - newButtonForm.ShowDialog(); - if (newButtonForm.Accepted) - { - ((Data)(node.Tag)).Parameter = newButtonForm.ButtonName; - ((Data)(node.Tag)).Value = newButtonForm.ButtonCode; - node.Text = newButtonForm.ButtonName; - Log.Info("Name: {0}", newButtonForm.ButtonName); - Log.Info("Code: {0}", newButtonForm.ButtonCode); - changedSettings = true; - } - } - } - private void buttonNew_Click(object sender, System.EventArgs e) { TreeNode node = treeMapping.SelectedNode; Deleted: trunk/plugins/MCEReplacement/InputMapper/NewButtonForm.Designer.cs =================================================================== --- trunk/plugins/MCEReplacement/InputMapper/NewButtonForm.Designer.cs 2007-02-22 12:41:20 UTC (rev 134) +++ trunk/plugins/MCEReplacement/InputMapper/NewButtonForm.Designer.cs 2007-02-22 12:45:00 UTC (rev 135) @@ -1,149 +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 - -namespace MediaPortal.Plugins -{ - partial class NewButtonForm - { - /// <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() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NewButtonForm)); - this.textBoxButton = new MediaPortal.UserInterface.Controls.MPTextBox(); - this.textBoxName = new MediaPortal.UserInterface.Controls.MPTextBox(); - this.buttonOk = new MediaPortal.UserInterface.Controls.MPButton(); - this.buttonCancel = new MediaPortal.UserInterface.Controls.MPButton(); - this.labelButton = new MediaPortal.UserInterface.Controls.MPLabel(); - this.labelName = new MediaPortal.UserInterface.Controls.MPLabel(); - this.SuspendLayout(); - // - // textBoxButton - // - this.textBoxButton.BorderColor = System.Drawing.Color.Empty; - this.textBoxButton.Location = new System.Drawing.Point(88, 48); - this.textBoxButton.Name = "textBoxButton"; - this.textBoxButton.Size = new System.Drawing.Size(176, 20); - this.textBoxButton.TabIndex = 0; - // - // textBoxName - // - this.textBoxName.BorderColor = System.Drawing.Color.Empty; - this.textBoxName.Location = new System.Drawing.Point(88, 80); - this.textBoxName.Name = "textBoxName"; - this.textBoxName.Size = new System.Drawing.Size(176, 20); - this.textBoxName.TabIndex = 1; - // - // buttonOk - // - this.buttonOk.Location = new System.Drawing.Point(120, 136); - this.buttonOk.Name = "buttonOk"; - this.buttonOk.Size = new System.Drawing.Size(75, 23); - this.buttonOk.TabIndex = 2; - this.buttonOk.Text = "&OK"; - this.buttonOk.UseVisualStyleBackColor = true; - this.buttonOk.Click += new System.EventHandler(this.buttonOk_Click); - // - // buttonCancel - // - this.buttonCancel.Location = new System.Drawing.Point(208, 136); - this.buttonCancel.Name = "buttonCancel"; - this.buttonCancel.Size = new System.Drawing.Size(75, 23); - this.buttonCancel.TabIndex = 3; - this.buttonCancel.Text = "&Cancel"; - this.buttonCancel.UseVisualStyleBackColor = true; - this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); - // - // labelButton - // - this.labelButton.AutoSize = true; - this.labelButton.Location = new System.Drawing.Point(24, 48); - this.labelButton.Name = "labelButton"; - this.labelButton.Size = new System.Drawing.Size(41, 13); - this.labelButton.TabIndex = 4; - this.labelButton.Text = "Button:"; - // - // labelName - // - this.labelName.AutoSize = true; - this.labelName.Location = new System.Drawing.Point(24, 80); - this.labelName.Name = "labelName"; - this.labelName.Size = new System.Drawing.Size(38, 13); - this.labelName.TabIndex = 5; - this.labelName.Text = "Name:"; - // - // NewButtonForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(292, 170); - this.Controls.Add(this.labelName); - this.Controls.Add(this.labelButton); - this.Controls.Add(this.buttonCancel); - this.Controls.Add(this.buttonOk); - this.Controls.Add(this.textBoxName); - this.Controls.Add(this.textBoxButton); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "NewButtonForm"; - this.Text = "Add new button"; - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private MediaPortal.UserInterface.Controls.MPTextBox textBoxButton; - private MediaPortal.UserInterface.Controls.MPTextBox textBoxName; - private MediaPortal.UserInterface.Controls.MPButton buttonOk; - private MediaPortal.UserInterface.Controls.MPButton buttonCancel; - private MediaPortal.UserInterface.Controls.MPLabel labelButton; - private MediaPortal.UserInterface.Controls.MPLabel labelName; - } -} \ No newline at end of file Deleted: trunk/plugins/MCEReplacement/InputMapper/NewButtonForm.cs =================================================================== --- trunk/plugins/MCEReplacement/InputMapper/NewButtonForm.cs 2007-02-22 12:41:20 UTC (rev 134) +++ trunk/plugins/MCEReplacement/InputMapper/NewButtonForm.cs 2007-02-22 12:45:00 UTC (rev 135) @@ -1,87 +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.ComponentModel; -using System.Data; -using System.Drawing; -using System.Text; -using System.Windows.Forms; - -namespace MediaPortal.Plugins -{ - public partial class NewButtonForm : Form - { - private bool _accepted = false; - - public bool Accepted - { - get { return _accepted; } - } - - public string ButtonCode - { - get { return textBoxButton.Text; } - set - { - textBoxButton.Text = value; - this.Text = "Edit button"; - } - } - - public string ButtonName - { - get - { - if (textBoxButton.Text != string.Empty) - return textBoxName.Text; - else - return string.Empty; - } - set - { - textBoxName.Text = value; - this.Text = "Edit button"; - } - } - - public NewButtonForm() - { - InitializeComponent(); - } - - private void buttonCancel_Click(object sender, EventArgs e) - { - this.Close(); - } - - private void buttonOk_Click(object sender, EventArgs e) - { - _accepted = true; - this.Close(); - } - } -} \ No newline at end of file Deleted: trunk/plugins/MCEReplacement/InputMapper/NewButtonForm.resx =================================================================== --- trunk/plugins/MCEReplacement/InputMapper/NewButtonForm.resx 2007-02-22 12:41:20 UTC (rev 134) +++ trunk/plugins/MCEReplacement/InputMapper/NewButtonForm.resx 2007-02-22 12:45:00 UTC (rev 135) @@ -1,413 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<root> - <!-- - Microsoft ResX Schema - - Version 2.0 - - The primary goals of this format is to allow a simple XML format - that is mostly human readable. The generation and parsing of the - various data types are done through the TypeConverter classes - associated with the data types. - - Example: - - ... ado.net/XML headers & schema ... - <resheader name="resmimetype">text/microsoft-resx</resheader> - <resheader name="version">2.0</resheader> - <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> - <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> - <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> - <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> - <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> - <value>[base64 mime encoded serialized .NET Framework object]</value> - </data> - <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> - <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> - <comment>This is a comment</comment> - </data> - - There are any number of "resheader" rows that contain simple - name/value pairs. - - Each data row contains a name, and value. The row also contains a - type or mimetype. Type corresponds to a .NET class that support - text/value conversion through the TypeConverter architecture. - Classes that don't support this are serialized and stored with the - mimetype set. - - The mimetype is used for serialized objects, and tells the - ResXResourceReader how to depersist the object. This is currently not - extensible. For a given mimetype the value must be set accordingly: - - Note - application/x-microsoft.net.object.binary.base64 is the format - that the ResXResourceWriter will generate, however the reader can - read any of the formats listed below. - - mimetype: application/x-microsoft.net.object.binary.base64 - value : The object must be serialized with - : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter - : and then encoded with base64 encoding. - - mimetype: application/x-microsoft.net.object.soap.base64 - value : The object must be serialized with - : System.Runtime.Serialization.Formatters.Soap.SoapFormatter - : and then encoded with base64 encoding. - - mimetype: application/x-microsoft.net.object.bytearray.base64 - value : The object must be serialized into a byte array - : using a System.ComponentModel.TypeConverter - : and then encoded with base64 encoding. - --> - <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> - <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> - <xsd:element name="root" msdata:IsDataSet="true"> - <xsd:complexType> - <xsd:choice maxOccurs="unbounded"> - <xsd:element name="metadata"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" /> - </xsd:sequence> - <xsd:attribute name="name" use="required" type="xsd:string" /> - <xsd:attribute name="type" type="xsd:string" /> - <xsd:attribute name="mimetype" type="xsd:string" /> - <xsd:attribute ref="xml:space" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="assembly"> - <xsd:complexType> - <xsd:attribute name="alias" type="xsd:string" /> - <xsd:attribute name="name" type="xsd:string" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="data"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> - <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> - <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> - <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> - <xsd:attribute ref="xml:space" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="resheader"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" use="required" /> - </xsd:complexType> - </xsd:element> - </xsd:choice> - </xsd:complexType> - </xsd:element> - </xsd:schema> - <resheader name="resmimetype"> - <value>text/microsoft-resx</value> - </resheader> - <resheader name="version"> - <value>2.0</value> - </resheader> - <resheader name="reader"> - <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> - </resheader> - <resheader name="writer"> - <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> - </resheader> - <assembly alias="System.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> - AAABAAcAEBAQAAAAAAAoAQAAdgAAABAQAAABAAgAaAUAAJ4BAAAQEAAAAQAYAGgDAAAGBwAAICAQAAAA - AADoAgAAbgoAACAgAAABAAgAqAgAAFYNAAAwMAAAAQAYAKgcAAD+FQAAICAAAAEAIACoEAAApjIAACgA - AAAQAAAAIAAAAAEABAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAACAAAAAgIAAgAAAAIAA - gACAgAAAwMDAAICAgAAAAP8AAP8AAAD//wD/AAAA/wD/AP//AAD///8ACwCwCwCwAAALC7C7ALu7AAu7 - u7sAsAsAALsLsAC7uwAAAAAAAAAAAAiIiIiAAAAAiIiIiIgAAACIiIiIiAAAAIiIiIiIAAAAiIiIiIgA - CACIiIiIiAiIgIiIiIiIiIiIiIiIiIiI/4iIiIiIiIj3iIiIiIiAiIiHCIcAiHAIiHC23wAApMMAAIDb - AADJwwAA//8AAAB/AAAAPwAAAD8AAAA/AAAAIwAAAAEAAAAAAAAAAAAAAAAAAABAAACMYQAAKAAAABAA - AAAgAAAAAQAIAAAAAABAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABFRUUAS0tLAEZHSABAQEAATU1NADw9 - PQArKisASUlJAEpKSgBeXl4AqampAJ6engCsrKwAREREAFVWVgCrq6sAnZ2dAK6urgBLS0oAMTQ2ALS0 - tQCYl5YAmpqaAKioqABoaWkAbm5uAJWVlQCgn58APUJFAKCgnwCWlpYAn5+fAD1BQwCqqqkAi4qJAL/I - zACpqqsAkpGRAGxrawCfn54AREhKAJeXlwBZXF4AoaGgAJGRkQD///8AgYB/AERHSgCYl5cAoKCgADU3 - OQCtrKwAiYmIAMvP0gCxsLAAj4+PAJqamwCVlZYAnp2dAFdYVwBFSEoAsrGxAJGRkACpqKgAZ2lpAG1s - bQCql40Ap5KGAK+bkQBHOzYAmZeVAJWWlgBQT08ALyEbAH5vaAB9fn8AT1JUAHReUwAgs/8ADL3/ACax - /QAEsf8AlpCNAKeUiQClkogAoJ6cAGVVTgADSWgAD4TIABG2/wAYLz4AIKnoAAk6VwAagLQACF6QAFeR - swAkqvQAG7v/AJqBdAAps/8AHcX/ABR0qgAIM0QAEFyMACn5/wAVdqwAABwvAFLF/QAAJkAAYbHVAAM/ - YgAOdbIAGpTPAAZFaAAGZ6AAF6HfAAo5WQATfLoAGJfQACG2/wACAwoAIMf/AAInPwBS0P8AACpGAGO+ - 4wAGUX0AElB1ACLb/wAdsfYADDlVACPS/wAhyf8AD010ABqk3QASd6oAIb//AB29/wAsUmwACDFKAAAG - DgABBwwAAggMAAk2VQAWExIAAxkpAAo3UwAILkYABy1EAA5NdAADFSAAHcf/AB69/wANTGcAD1Z1ABBg - hAATco8ABB4yACTm/wANWXMAD1t8AA5MaAAQXoEABiY6ABJqhQAGJTgAGp7gABd6rgAdo/EAGJjeACLF - /wARaZ4AGqDqABdsmAAesf8AFFmDABNrnwAduP8AG6jtABFilAAQYnwABiU3AB+4/wANTnMADUBeABiC - tgAaqvQAF5DUAAw/XAAl5P8ABSQ6AAskNgAUbqQAGYzPABBjgAACDhUACjVLAA9ghgAKOVEABB4sAAcj - NAAHIzYAEnGSAAYlMgAHLEQAEGWEAAcqQAAHKjUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUgAAUgAAUgAAUgAAAAAAAFIAUlIA - UlIAAFJSUlIAAABSUlJSUlJSAABSAABSAAAAAFJSAFJSAAAAUlJSUgAAAAAAAAAAAAAAAAAAAAAAAEof - Hx9BAR8fHwAAAAAAAAAfHx8fKx8fHx8fAAAAAAAAHx8fHycfHx8fHwAAAAAAAB8fHx8nHx8fHx8AAAAA - AAAfHx8fJx8fHx8fAAAHBQAAHx8fHycfHx8fH5EfHx8fAB8fHx8nHx8fHwofHyY4HzkfHx8fJx8fHx8r - HyYuLhsfHx8fHycfHx8fCh8mLjYfHx8fHx8fJx8fHwAjHx8fHzYAHx8kAAAxHzYAADgfHzYAtt8AAKTD - AACA2wAAycMAAP//AAAAfwAAAD8AAAA/AAAAPwAAACMAAAABAAAAAAAAAAAAAAAAAAAAQAAAjGEAACgA - AAAQAAAAIAAAAAEAGAAAAAAAQAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAEsf8AAAAAAAAEsf8AAAAAAAAE - sf8AAAAAAAAEsf8AAAAAAAAAAAAAAAAAAAAAAAAEsf8AAAAEsf8Esf8AAAAEsf8Esf8AAAAAAAAEsf8E - sf8Esf8Esf8AAAAAAAAAAAAEsf8Esf8Esf8Esf8Esf8Esf8Esf8AAAAAAAAEsf8AAAAAAAAEsf8AAAAA - AAAAAAAAAAAEsf8Esf8AAAAEsf8Esf8AAAAAAAAAAAAEsf8Esf8Esf8Esf8AAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAvIRuWlpaWlpaWlpZnaWlFRUWWlpaW - lpaWlpYAAAAAAAAAAAAAAAAAAAAAAAAAAACWlpaWlpaWlpaWlpZZXF6WlpaWlpaWlpaWlpaWlpYAAAAA - AAAAAAAAAAAAAAAAAACWlpaWlpaWlpaWlpZsa2uWlpaWlpaWlpaWlpaWlpYAAAAAAAAAAAAAAAAAAAAA - AACWlpaWlpaWlpaWlpZsa2uWlpaWlpaWlpaWlpaWlpYAAAAAAAAAAAAAAAAAAAAAAACWlpaWlpaWlpaW - lpZsa2uWlpaWlpaWlpaWlpaWlpYAAAAAAAArKitNTU0AAAAAAACWlpaWlpaWlpaWlpZsa2uWlpaWlpaW - lpaWlpaWlpYWExKWlpaWlpaWlpaWlpYAAACWlpaWlpaWlpaWlpZsa2uWlpaWlpaWlpaWlpZeXl6WlpaW - lpaSkZGPj4+WlpaampuWlpaWlpaWlpaWlpZsa2uWlpaWlpaWlpaWlpZZXF6WlpaSkZH///////+VlZWW - lpaWlpaWlpaWlpaWlpZsa2uWlpaWlpaWlpaWlpZeXl6WlpaSkZH////Lz9KWlpaWlpaWlpaWlpaWlpaW - lpaWlpaRkZGWlpaWlpaWlpYAAACLiomWlpaWlpaWlpaWlpbLz9IAAACWlpaWlpa/yMwAAAAAAACYl5eW - lpbLz9IAAAAAAACPj4+WlpaWlpbLz9IAAAC23wAApMMAAIDbAADJwwAA//8AAAB/AAAAPwAAAD8AAAA/ - AAAAIwAAAAEAAAAAAAAAAAAAAAAAAABAAACMYQAAKAAAACAAAABAAAAAAQAEAAAAAACAAgAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAIAAAIAAAACAgACAAAAAgACAAICAAADAwMAAgICAAAAA/wAA/wAAAP//AP8A - AAD/AP8A//8AAP///wAAAAAAAAAAAAAAAAAAAAAAA7AAALuzCzAAC7uwO7szsAOzAAOzuxswALszMLs7 - M7ADu7MDMDs7MAC7AAGzAzOwA7s7M7E7OzEQswAxszszsAOxC7O7uwu7szs7M7u7M7ADszuwO7MAuzO7 - u7M7swOwAbu7MAAAAAAAuwAAAAADsAADMwAAAAAAAAMAAAAAADAAOAEwAzADM4ADMwAxADMzA7gDuAsw - u7uwO7swswu7uwO4A7gLM7szMLs7MbM7M7sDuAO4CzOzAzOzA7OzOwC7A7gDuAszszsxszuzszszuwOz - A7MLuLu7iLu7s7M7u7ODsxOzO7iLuIiLO7AAA7swiLu7u7uIiIiIgwOzswAAAIiLu4uziIiIiIALsbMA - AACIiIiIgIiIiIiAAACIgzAAiIiIiICIiIiIgACIiIiIAIiIiIiAiIiIiIAIiIiIiICIiIiIgIiIiIiI - OIiIiIiIiIiIiICIiIiIgIiIh3iIiIiIiIiAiIiIiICIiP/3iIiIiIiIgIiIiIiIiIf//4iIiIiIiICI - iIiIg4iH//+IiIiIiIiAiIiIiICIiP/3iIiIiIiIgIiIiIiAiIiIiIiIiIiIiHCIiIiIcAiIiIiIiAiI - iIiACIiIh4AIeIiIiIAAiHd4AACId4gAAIh3d3gAAAAAAAAAAAAAAAAAAAAAAP////+PCcEBjgHAAYAB - jiGAAAABgAgAAYEMAAmB/8/54//v/cmQIzCIgAAgiIAAAIiAAACIgAAAgAAAAAAAAOEAAAg/AAAYPwAA - HgcAABwDAAAYAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQBAAAGAYAcDgPAP/////KAAAACAA - AABAAAAAAQAIAAAAAACABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAQAAAAEB - AQACAgIABAQEAAUGBwAFCQsABQoNAAQLDgAECw8ABQ0RAAUOEwAFDxUABRAXAAUSGQAHFBwACRYdAAsY - HwAOGSAAERshABMdIgAWHiMAGSAkABsiJQAcIycAGiQqABYlLQASJTAADiYzAAwnNQAKKToACSs/AAgu - QwAIMUcACTRNAAk2UAAKOVMACjxZAApAXgAMQWAAEENgABpEXAAjQ1YAKURTADFETwA7REkAP0RHAEFF - RgBERkcAR0hIAEtKSgBPTk4AVlVVAFxcWwBhYWAAZmVlAG1sbAB0dXUAd3p8AHh9gAB9gIIAhISFAIiH - hgCJiIcAiomIAIqKiQCLi4oAi4uLAIyMjACOjo4AkJCQAJKSkgCUk5MAlJSTAJWUlACXlZQAmJWTAJqV - kgCalZIAmpWSAJqVkgCalZIAmZWTAJiVlACWlpUAlpaVAJaWlQCWlpUAlpaVAJaVlQCWlpYAlpaWAJaW - lgCWlpYAl5eXAJeXlwCYmJgAmJiYAJiYmACYmJgAmZmZAJmZmQCampoAm5ubAJubmwCcnJwAnZ2dAJ6e - ngCgoKAAoKCgAKGhoQCioqIAoqKiAKOjowClpaUApaWmAKSlpgCgo6UAm6KmAJahpwCNn6kAgp2sAHub - rQB1ma8AbZiwAGeXtABjl7YAYpa0AGKTsABhkq4AX5CsAFqMqQBWiaYAUIWkAEqCoQBGfp8APHmcADBx - lgAoao8AIGOJABldgwAWWoAAElh/AA5WfwAOVn4ADVV9AA1WfwAOWIIADlqFAA9chwAPXYkAD16MABBg - jQAQYY8AEWSTABFmlgASaJkAEmqdABJtoQASb6QAEnKoABNzqwAUda0AFXiwABZ5sgAXe7QAGH64ABiA - uwAYgb4AGIK/ABeDwQAXhMIAGIXEABqHxgAaickAGovLABuNzgAaj9EAG5DUABuS1gAclNkAHJbcAByY - 3wAdmuEAHJvkACCf5wAen+kAG6DrABqg7AAaoO0AGqHuABmi7wAZovAAGqPyABqk8wAapfUAGqb2ABun - 9wAcqPcAHKn5ABuq+wAbqvsAG6v8ABus/QAbrP4AG63+ABut/gAbrv4AG6/+ABqv/gAbr/4AG7D+AByx - /gAbsv4AG7L+AByz/gAetP4AHrX+AB+2/gAgt/4AILj+AB+5/gAeuv4AHrr+AB67/gAeu/4AHrz+AB69 - /gAfvv4AH7/+ACDA/gAgwv4AIMP+ACDE/gAhxf4AIcX+ACHG/gAlxv0AK8b8ADLG+gBDyPgAXcz0AH7R - 8QCd1u4Aut/uANDm7wDe6vAA6O/yAPD09gD09vcA////APj4+AADAwMDAwMDAwMDAwMDAwMDAwMDAwMD - AwMDAwMDAwMDAwOU2iEDAwMDv+jglwPOtgMDAyK/6+vhAyvX5uqxlfADA5zcKwMDA6/nuM7TKs63AwMD - xemlqawf6dy32LSi6wMDmd/S17kJubwJleegy6kDAw/nvgMDAyjpnwO5taDrAwOc4ca04KmtySmz4J+/ - tycoH920FSIrJeauK9CwnuwDA5zeJxHC0Lrc09jpA8jb09+vvNy8vry5wtrY6JWU7wMDleOkntTrA7nr - 6rwDA/DqvCvQ0+jo7LW06uq8A5rvAwMn6eHh6LoDAwMDAwMDAwMDA/DrAwMDAwMDAwMDqPADAwMDpqks - AwMDAwMDAwMDAwMDA7EDAwMDAwMDAwMDqQMDA6s8AyiqAwOZKwMNnKWxiwsDlaivAwOxKgMDpqCgpgOe - 6oIDsOg+A821CsXj5eXHDrrl4eefI/CdA9Tj49jcA5vhggOs3j8Dw6ss5eCiq5Ei6tyq1Lkn6ZWi47es - 1NIDmuGCA6zePwPCsaHgkAOkqpXmngOuyCvmmbLhDQ7f0gOY4YIDrN4/A8GyluOmldq7KuevK8LCleid - qN+dptjYA5bjjAOq3DAIv706x93f14I5wt3m2NSh6qQr1N7c3rM6K+WmJbrak5XSv1+AvcqCVVV/yrbJ - yxMDAwO48PC8AzY70Nre2NLb39uDVVFTUVNPX28wA7HLlfCfAwMDAwMDNlWAytO9gs/UoEFiX11dWl9f - cwMD58kq26MDAwMDAwM2X1FTUVNTVUIZRGVfX19fX19zAwMDAwk0NTcyMgMDAzZfX11dWl9lRhxFZV9f - X19fX3UDAwM3Q2ptbU0+PQMDNl9fX19fX2VHHEVlX19fX19fawMDO3ZpX2JfYmprQgM2X19fX19fZUcc - RWVfX19fX2JIMzFtX19dSEtfX19uPjZfX19fX19lRxxFZV9fX19fZUUJXWVfTEx3ckldX19qNl9fX19f - X2VHHEVlX19fX19lQhxzX01I+v//d0lfX182X19fX19fZUccRWVfX19fX2VBM29fSnf////8R01fXzZf - X19fX19lRxxFZV9fX19fZUEyb19Kd/////tFTV9fNl9fX19fX2VHHEVlX19fX19lRRtzX11F+f37d0tf - X182Yl9fX19fZUgPR2lfX19fX2JdDkRqX11LYl1LX19fajZuX19fX19fcgM3a19fX19fX3gDHWViX11N - TV9fX28+A0duYl9fX29AAwM+b2JfX2VwQgMDN3dpX19fX19vQgMDA0FrdXN3QAMDAxw+anV4Sz0DAwMD - N0F3c3Nzd0IDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMD/////48JwQGOAcABgAGOIYAA - AAGACAABgQwACYH/z/nj/+/9yZAjMIiAACCIgAAAiIAAAIiAAACAAAAAAAAA4QAACD8AABg/AAAeBwAA - HAMAABgBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAEAAAYBgBwOA8A/////8oAAAAMAAAAGAA - AAABABgAAAAAAIAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQMF - D1iBHaz+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACz9dGJDUHKb0GpvkF4nKAQkNAAAAD1qEFobFFobF - CTRNAAAAAAAAAAAAAAAAAAECByxBFoK/HKTyG6DsHKb0Haz9EWWVAAAAAQUIDU90GZffG6TxG5/qHaz9 - GpnhBBomDU91Ha3/Ha3/AAAAAAAAAgwRFX+7Ha3/F4jJBR8uAAAAAAAAAAAAAAAAAAAACThSG5/rHaz+ - Ha3/Ha3/G6HuDlV+AQcLFX66Ha3/Ha3/CTRNAAAAAAAAAAAAAAAABR4sGI7SHaz9Ha3/Ha3/Ha3/Ha3/ - FoTDAQcLC0JhHKXzHa3/Ha3/Ha3/Ha3/Haz+Cj5bFoTDHa3/Ha3/AAAAAAAAAg4UFoTCHa3/FYC8AxAX - AAAAAAAAAAAAAAAABRsoGZbdHa3/Ha3/Ha3/Ha3/Ha3/GJHVByxBFYC9Ha3/Ha3/CTRNAAAAAAAAAAAA - AgwSE3GnHa3/Ha3/Ha3/Ha3/Ha3/Ha3/EGCNBSEwG5/qHa3/Ha3/Ha3/Ha3/Ha3/Ha3/DElrF4vNHa3/ - Ha3/AAAAAAAAAg0TFoLAHa3/G6HuF4bGFoK/FHWtCDJKAAAAC0NjHKf2Ha3/G6DsCTNLFHixHa3/HKb1 - D1qEFX66Ha3/Ha3/CTRNAAAAAAAAAAEBBiU3Gp3oHa3/Ha3/AAAAAAAAAAAADUtvAAIDDlJ5Haz+Ha3/ - GZffCjtXFX66Ha3/Ha3/DEdoF4nKHa3/Ha3/AAAAAAAAAg0TFoPBHa3/Ha3/Ha3/Ha3/Ha3/GpvlBRwp - DU5zHKf2Ha3/Cj5bAAAABiExHaz9Ha3/E3ClFoLAHa3/GI7RCTRNAAAAAAAAAAEBCC1DHKf2Ha3/E2+j - AAAAAAAAAAAAAAAAAAAAEWiZHa3/G6HtCDJJAAAACjxZHav8Ha3/DEdpF4nKHa3/Ha3/AAAAAAAAAg0T - F4jIHa3/Ha3/HKr6G6LvHav8Ha3/FoK/DlF4G6PwHa3/EWOSAxMcD1qFHa3/Haz+EmqcFHmyHa3/G6Lv - CTRNAxEZBBonAw8WByxBHKTyHa3/EWOSAxQdAxAYBBomDU1yAQUHD1yHHa3/HKb0D1eAAxIaE3GmHa3/ - Ha3/C0JhF4rLHa3/Ha3/AAAAAAAAAg0TFobFHa3/Hav8EmiaCjpVGIzPHa3/Haz+EWOSGJHWHa3/Hav8 - GZbdHaz+Ha3/Ha3/E3GnEWSUHaz9Ha3/G6HuGIzPGpnhFX66DEZnGZffHa3/G5/rEWOSEWOSEWOSEWOS - EWOSDEptHKXzHa3/HKn5GpvlHaz+Ha3/G6HuBiIyF4fHHa3/Ha3/AAAAAAAAAg4UFoXEHa3/F4fHAgwR - AAAAEWaWHa3/Ha3/Ha3/GI7SHav8Ha3/Ha3/Ha3/Ha3/Ha3/AAAAF4jJGp7pHa3/Ha3/Ha3/Ha3/Ha3/ - FoPBGJLXHa3/Ha3/Ha3/Ha3/Ha3/Ha3/Ha3/Ha3/GJLXHaz+Ha3/Ha3/Ha3/Ha3/EWaXAQUHF4nKHa3/ - Ha3/AAAAAAAAAw8WFX24Ha3/GZffDEVmCC9FGZXbHa3/Ha3/Ha3/AAAAHa3/Ha3/Ha3/Ha3/Ha3/Ha3/ - AAAAAAAAHa3/Ha3/Ha3/Ha3/Har7F4rLD1qFGpvlHa3/Ha3/Ha3/Ha3/Ha3/Ha3/Ha3/Ha3/Ha3/Ha3/ - Ha3/Ha3/Ha3/Ha3/Ag4VAAAAF4rMHa3/Ha3/AAAAAAAAAxMcEWOSHa3/Ha3/HKTyG6PwHa3/Ha3/Ha3/ - Ha3/AAAAAAAAHa3/Ha3/Ha3/Ha3/AAAAAAAAAAAAAAAAHa3/Ha3/Ha3/F4vNByxBByg7HKj4Ha3/Ha3/ - Ha3/Ha3/Ha3/Ha3/Ha3/AAAAAAAAHa3/Ha3/Ha3/Ha3/AAAAAAAAAQMFGZTaHa3/Ha3/AAAAAAAAAAAA - DUtuGpniHa3/Ha3/Ha3/Ha3/Ha3/Ha3/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAHa3/Ha3/Ha3/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAHa3/Ha3/Ha3/AAAAAAAAAAAAAAAABSAvE3ClHKj3Ha3/F4jJD1iCCDJJAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHa3/Ha3/AAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHa3/Ha3/Ha3/AAAAAAAAAAAAAAAAAwMDHx8fOjo6 - ICAgAAAAGxsbGxsbAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgICAgICBQUFAgICBAQEQkJCMzMzJCQk - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAIDDUdoHa3+TqLSdXZ3HR0dAxAXIIO8Iqr4Q4KlDxUXAAAABys/G5/qGIzPBBUfAwMD - AxAXD1yHGpvlHKXzG6PwHqn4LKryPl1vAQEBAgsQDlF3GpzmHaz+G6DsHa3/AxAYAAAAByk9G6TxHa3/ - CDBHAAAAAQkNDlJ5GpniHKf2G6LvHKj3Haz9Ha3/AAAAAg4UGIK+Ha3/MqntX4CTGRkZCTNLHpzkHa3/ - R6XbRE1TAQEBEF2JHa3/G6HtDDxXAQMFEmyfHav8Ha3/Ha3/Ha3/Ha3/Hq3+FGiYAAAAD1iBHav8Ha3/ - Ha3/Haz+Haz+FoPBAAAADlV+Ha3/Hav8C0FgAAAAEF6LHKn5Haz+Ha3/Ha3/Har7Ha3/Ha3/AAAAAg4V - GYbFHa3/L6rwXYKXGhoaCTdRHp7nHa3/RqXcV2BlBAQED1yIHa3/HKDrCThSC0FgHar6Ha3/Ha3+Hqz9 - Hqz9Hq3+H6v6C0NjBiMzHaz+Ha3/Haz+Hav8Haz+Ha3/HKj3Byk9DUtuHa3/HKf2CTRNCC5EG6PwHa3/ - Haz+Hav8Haz+HKn5Ha3/Ha3/AAAAAw4VGYXCHa3/MKnvXoGVGhoaCTdRHp7nHa3/R6XbWGBkBgYGEFuG - Ha3/HZ/pC0NjGXWpHa3/Hq3+PaXfJWCDEkViSIqwNWyMAQQGFWSRHa3/Ha3/G6TxD1yHF4jJHaz+Ha3/ - EWSTDEdoHa3/G6PwCj1aEWSTHa3/Ha3/GpvkC0JhFoTCHar7Haz+Ha3/AAAAAw4VGYXCHa3/MKnvXoGV - GhoaCTdRHp7nHa3/R6XbWGBkBwcHEFuGHa3/HqHrDU91GIK/Ha3/LKfuPVdlAgICAQYJJozHK5POBSEw - FnWrHa3/I6r3DlV+AAAACTRMG6TxHa3/E3SrDU90Ha3/G6TxDEhqE3OpHa3/HKn5C0JiAAAACjlUHKf2 - Haz+Ha3/AAAAAw4VGYTBHa3/MKnvXoGVGhoaCTdRHp7nHa3/R6XbWWBlCAgIEFyHHa3/IaPtDk90FX+7 - Ha3/HpnfDDBEAQcLEWWVHa3/Ha3/EF6KEWWVHa3/HKDrC0BeAQcKC0FgHKTyHa3/E3KoDU90Ha3/HKf2 - DElrE2+kHa3/Gp3oC0JiAxAYD1mDHKn5Ha3/Ha3/ODg4Aw4VGYO/Ha3/MKnvYoWZHBwcCTdRHp7nHa3/ - R6XbWGBkBgYGEFuGHa3/JafxH1RyEmmbHa3/Ha3/FoG+EWaWHaTxHa3/Ha3/J1t4DEdpHa3/Ha3/GI7S - EWSUGZPZHa3/Ha3/FHq0D1qEHa3/Haz9DU91D1mDHa3/Ha3/GZTaFHewG6TxHaz9Ha3/Ha3/JCQkAw4V - F4LAHa3/MKfrTm+CDg4OCTRMHJvjHa3/RJ/TNz1BAQEBD1mDHa3/JKn1WIWeJlJqHKb0Ha3/Ha3/Ha3/ - Ha3/Ha3/L6nveYOJLEdWG5/qHa3/Ha3/Ha3/Ha3/Ha3/Ha3/G6DsFXy3Ha3/Ha3/E3ClCThTGp3oHa3/ - Ha3/Ha3/Ha3/Ha3/Ha3/Ha3/JCQkAg0TFYC8Ha3/H53lGT1RAAAACjpWGp7pHa3/IInFCREWAAAAE2+j - Ha3/I6r2a567g4iLQ4mxH6v6Ha3/Ha3/Ha3/MKnvd5yxlpaWiY2PSoWmH6n4Ha3/Ha3/Ha3/Ha3/Ha3/ - GI7RBBYhF4vNHa3/AAAABic5FXu2HKn5Ha3/Ha3/Ha3/Ha3/Ha3/AAAAJCQkKS8yEWeYHa3/HKn5FXu1 - DVB2FoLAHav8Ha3/HKb0EWSTD1yIHaLuHa3/JKn2dZyylpaWkZebb524TKTXQqbfVaLOgJqplpaWlpaW - lpaWk5eZZ5++GZbdFHewFoPBHKn5Ha3/FHewAAECAAAAAAAAAAAAAAAAAAAAHa3/Ha3/Ha3/Ha3/Ha3/ - AAAAAAAAJCQkgICAK1RtHar7Ha3/HKn5Haj2Haz+Ha3/Ha3/Ha3/HKj4Hqr6Ha3/Ha3/Np/cjZidlpaW - lpaWlpaWj5ecjJifkZealpaWlpaWlpaWlpaWlpaWlpaWCThTAxAXCTdRG6PwHa3/E3KoCjpWHKb1Ha3/ - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJCQklpaWhIyQQY+8Ha3/Ha3/Ha3/Ha3/H6z9Iqf0 - Ha3/Ha3/Ha3/Ha3/Hp7nY4eblpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWAAAA - AAAADlV9Haz9Ha3/GZbdFHWtHa3/Haz+Gp3oAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJCQklpaW - lpaWjpabZZ6+NKjrJav4Oqflb524gJimVKLOLKryKav1NZHGIz5NeXp7lpaWlpaWlpaWlpaWlpaWlpaW - lpaWlpaWlpaWlpaWlpaWlpaWlpaWAAAAAAAAGJHVG6TxHKXzDElsBys/GZffF4rMBiIyAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAJCQklpaWlpaWlpaWlpaWkpeajJifkZealpaWlpaWlpaWjpedjZidXmBg - JCQkenp6lpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWAAAAAAAAAAAAAAAAAAAA - AAAABwcHIiktLTM3MTExMDAwLy8vJCQkSkpKAAAAAAAAAAAAAAAAAAAAJCQklpaWlpaWlpaWlpaWlpaW - lpaWlpaWlpaWlpaWlpaWlpaWlpaWX19fJCQkenp6lpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaW - lpaWlpaWlpaWAAAAAAAAAAAAAAAABgYGMjIyXl5ef39/jo6OkZGRkJCQh4eHbGxsSkpKSkpKAAAAAAAA - AAAAAAAAJCQklpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWX19fJCQkenp6lpaWlpaW - lpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlZWVAAAAAAAAAAAAFRUVWVlZjY2NlpaWlpaWlpaW - lpaWlpaWlpaWlpaWlpaWfHx8SkpKAAAAAAAAAAAAJCQklpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaW - lpaWlpaWlpaWX19fJCQkenp6lpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWioqKAAAA - AAAAFRUVampqlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWjo6OSkpKAAAAAAAAJCQklpaW - lpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWX19fJCQkenp6lpaWlpaWlpaWlpaWlpaWlpaW - lpaWlpaWlpaWlpaWlpaWlpaWc3NzAAAABwcHXV1dlpaWlpaWlpaWlpaWlpaWlpaWl5eXlpaWlpaWlpaW - lpaWlpaWlpaWlJSUSkpKAAAAJCQklpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWX19f - JCQkenp6lpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWY2NjSkpKNTU1kpKSlpaWlpaW - lpaWlpaWl5eXk5OTj4+PkZGRlpaWlpaWlpaWlpaWlpaWlpaWlpaWSkpKJCQklpaWlpaWlpaWlpaWlpaW - lpaWlpaWlpaWlpaWlpaWlpaWlpaWX19fJCQkenp6lpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaW - lpaWlZWVXV1dBAQEc3NzlpaWlpaWlpaWlpaWlpaWj4+PkpKSnp6elpaWjY2NlJSUlpaWlpaWlpaWlpaW - lpaWSkpKJCQklpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWX19fJCQkenp6lpaWlpaW - lpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlZWVWVlZGRkZkpKSlpaWlpaWlpaWlpaWkJCQpaWl0dHR - 5OTk3d3dsrKykpKSlZWVlpaWlpaWlpaWlpaWlpaWJCQklpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaW - lpaWlpaWlpaWX19fJCQkenp6lpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlJSUWFhYMzMz - lpaWlpaWlpaWlpaWkJCQn5+f3d3d/v7+////////8vLyr6+vkpKSlZWVlpaWlpaWlpaWlpaWJCQklpaW - lpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWX19fJCQkenp6lpaWlpaWlpaWlpaWlpaWlpaW - lpaWlpaWlpaWlpaWlpaWlJSUW1tbRUVFlpaWlpaWlpaWlZWVkpKSu7u7+fn5////////////////1NTU - lZWVlJSUlpaWlpaWlpaWlpaWJCQklpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWX19f - JCQkenp6lpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlJSUXl5eTExMlpaWlpaWlpaWlJSU - k5OTxMTE/v7+////////////////4ODgl5eXlJSUlpaWlpaWlpaWlpaWJCQklpaWlpaWlpaWlpaWlpaW - lpaWlpaWlpaWlpaWlpaWlpaWlpaWX19fJCQkenp6lpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaW - lpaWlZWVWVlZQEBAlpaWlpaWlpaWlpaWj4+Ps7Oz9/f3////////////////zs7OlJSUlJSUlpaWlpaW - lpaWlpaWJCQklpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWX19fJiYmenp6lpaWlpaW - lpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlZWVXFxcLS0tlpaWlpaWlpaWlpaWkpKSlZWVzc3N//// - ////////5OTko6Ojk5OTlpaWlpaWlpaWlpaWlpaWJCQklpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaW - lpaWlpaWlpaWY2NjISEheXl5lpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWaWlpDw8P - jo6OlpaWlpaWlpaWlpaWk5OTmJiYs7OzxMTEvb29oKCglJSUlpaWlpaWlpaWlpaWlpaWlpaWJCQklpaW - lpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWYmJiBgYGcHBwlpaWlpaWlpaWlpaWlpaWlpaW - lpaWlpaWlpaWlpaWlpaWlpaWenp6AQEBYmJilpaWlpaWlpaWlpaWlpaWlJSUkJCQj4+PkJCQk5OTlpaW - lpaWlpaWlpaWlpaWlpaWlpaWExMTlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWfn5+ - AAAAS0tLkZGRlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWi4uLAAAAIyMji4uLlpaWlpaW - lpaWlpaWlpaWlpaWlpaWlZWVlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWExMTf39/lpaWlpaWlpaWlpaW - lpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWAAAAFhYWdHR0lpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaW - lpaWlpaWlpaWAAAABwcHQkJClpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaW - lpaWAAAAAAAAExMTkpKSlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWAAAAAAAABQUFKysrfHx8 - lpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWAAAAAAAAAAAAExMTUVFRlpaWlpaWlpaWlpaWlpaW - lpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWAAAAAAAAAAAAAAAASkpKgoKClpaWlpaWlpaWlpaWlpaWlpaW - lpaWlpaWlpaWAAAAAAAAAAAAMjIyTk5OeXl5kpKSlpaWlpaWlpaWlpaWlpaWlpaWlpaWAAAAAAAAAAAA - AAAAAAAALi4uXV1dg4ODlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWAAAAAAAAAAAAAAAAAAAA - AAAASkpKSkpKlpaWlpaWlpaWlpaWlpaWlpaWAAAAAAAAAAAAAAAAAAAAAAAAAAAASkpKSkpKlpaWlpaW - lpaWlpaWlpaWAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASkpKSkpKlpaWlpaWlpaWlpaWlpaWlpaW - lpaWlpaWAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////////+P8CHgEAH//4Pg - AeAAAf//g8ABwAAB//+AQAGDgAH//4AAAYPAAf//gAAAAAAB//+AAAAAAAH//4AAIAAAAf//gBAwAAAB - //+AGHgAGGH//8A//+P/8f//4D//8//x///gP8A//////4AIAAAhAP//gAAAACEA//+AAAAAAAD//4AA - AAAAAP//gAAAAAAA//+AAAAAAAD//wAAAAAAAP//AAAAAAAA//8AAAAAAgH//wAAAAAPg///AAAAAAP/ - //8AAAAGAf///wAAAAYB////AAAAB+Af//8AAAAHgA///wAAAAcAB///AAAABgAD//8AAAAEAAH//wAA - AAAAAP//AAAAAAAA//8AAAAAAAD//wAAAAAAAP//AAAAAAAA//8AAAAAAAD//wAAAAAAAP//AAAAAAAA - //8AAAAAAAD//wAAAAAAAP//AAIABAAA//8AAgAEAAH//4AGAA4AA///wAcAHwAH///gH8B/wA////// - ////////KAAAACAAAABAAAAAAQAgAAAAAACAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAAbAAA - AJAAAABsAAAAJAAAAAAAAAAMAAAAPAAAAHgAAACQAAAAkAAAAJAAAACQAAAAkAAAAGwAAAAkAAAADAAA - ADwAAAB4AAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAABsAAAAAAAE - CP8dsv//BiU3/wAAAJwAAABUAAAAMAAAAEgbnur/IL7//x64//8OWIP/AxUe/xyr/P8YkdX/AAAAkAAA - ADAAAAAkBSY5/xqf6v8gwv//IMH//x+5//8EHCr/C0Ji/x2w//8fvP//IMD//xeHyP8NVHz/I9P//wAA - AJAAAAAAAAQI/x20//8MSWv/AAAAtAAAAJwAAACQFYTD/x+9//8ZlNv/HKv8/x2u//8KQF7/HKv9/xiT - 2P8AAACcAAAAVAAAAP8bo/H/IL///xNzqv8UerX/FoG//wUgMP8gv///HbT//xiR1v8dsf//F4zP/xFt - oP8gwv//AAAAkAAAAAAABAj/Hrf//x2t//8dsP//GJTc/wEFB/8Yldz/Gp3n/wAFB/8OVHz/H73//xFn - mP8cqfr/FHq0/wAAALQAAACcAg0U/x+9//8anun/AAAAtAAAAJwAAACQCTlV/x+///8QZpb/AAAB/xmV - 3P8XjtL/EWmb/yDC//8AAACQAAAAAAAECP8fuf//G6Xz/xiMz/8euP//FHy3/xaCv/8cpvf/Cj1a/xeK - y/8fuP//EWaW/xqg6/8Ykdf/CTZP/wk6Vv8FHi7/HrX//xeMzv8EGib/Bic5/wtDYv8HMEb/H7z//xWC - wf8KQ2P/Haz+/xaGxv8QZJP/IMP//wAAAJAAAAAAAAQI/x62//8JNlD/AxAY/xqh7f8crP7/GZff/x6z - //8drv//HbH//x+///8AAABsG6b0/x2z//8drv//Hrf//xWEw/8Zm+X/HrL//xqb5f8anej/Gpvl/xmW - 3f8boe3/HbL//x2x//8fvv//DU5z/w5Vfv8gxf//AAAAkAAAAAAABAj/H7r//xJxqP8RZJP/Ha///yDB - //8AAACQGZXc/yDB//8gwP//Gpzm/wAAACQAAAAMIcf//yDA//8am+X/DEZo/xys//8drv//H77//x++ - //8gw///GI/T/xeN0P8gwP//IMD//xqb5P8AAAD/D12K/yHF//8AAACEAAAAAAk2UP8fv///Hbn//x65 - //8fvv//GJjh/wAAAJwAAABIAAAAGAAAACQAAAAwAAAAMAAAADAAAAAwAAAAMAAAADAAAAAwItH//yDC - //8AAACEAAAAVAAAACQAAAAMAAAADAAAACQAAAAkAAAAGAAAACQUebP/Icr//wAAAIQAAAAAAAAAJAQP - FP8ed6r/GXuy/xBBXf8EAQD/AAAAtAAAAIQAAABgAAAAeAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAA - AJAAAACQFofH/wAAAKgAAACcAAAAeAAAAEgAAABIAAAAeAAAAGwAAABIAAAAbAAAAJAUerX/AAAAqAAA - AAAABAj/IYK5/2tra/8LAAD/EjxT/yp/sP8SHCD/AAAAtA9ch/8MSWz/AAAA/wILEP8RYI7/E3Ss/yWK - w/89f6b/Eg8N/wAAAP8NTnP/FHmz/xWEw/8AAAC0AAAAnBaHx/8KP13/AAAAnAQZJf8Uda7/EWma/xFp - m/8Tdq3/AAAAAAAECP8gwP//W5zC/wwLCv8VhcX/Kr7//1p4iv8ACxL/HKr8/xiO0f8BBwr/G6Pw/x26 - //8eu///G7v//xil9v8BDBL/GZfe/x+7//8fuf//H73//xFml/8GKz//Isr//xBikf8AAAC0HK///x+6 - //8fuv//HbH//x60//8AAAAAAAQI/x+5//9bl7z/DAsK/xSBvv8otv//YHyM/wAIEP8aou//FoC9/w9L - bf8cu///Mbj//x5vnv82i7v/IVNw/wcpPP8fwP//HrT//xV+uv8dr///GZbc/wk3UP8fv///DU91/xJu - ov8fuv//GJHW/xWBvv8dr///Ha3//wAAACQABAj/H7n//1uXuv8MCwn/FIG+/yi2//9ge4r/AAsR/xqh - 7v8ZiMb/EWqd/yG4//8zX3j/AAAA/xlzqP8dfrT/DVN7/yG8//8SY5H/AAAA/xWDv/8cpvX/DEpt/x+8 - //8PW4b/FonK/x65//8BChD/AgwR/x63//8drf//YGZq/wAECP8fuf//YJ3B/w8NDf8Ugb7/Kbb//2R/ - j/8AChH/GqDt/yCKyP8LVoD/Hbr//xJ1rv8NUnn/HLL//xeZ4v8IPlz/Hb3//xaExP8LRWb/G6Hu/xuh - 7f8NUHT/IL7//w9ikf8UebL/Hrf//xBikv8Td67/HbH//x2x//8lJSX/CFWC/yG6//8/dpX/AAAA/xR9 - uf8ntP//MUZS/wAECP8Wnuv/Oano/1Viaf8Zpfb/GLX//xq3//8UsP//Y6DE/2deWf8Zoe3/G7X//x+8 - //8dsf//HK///xJrn/8gwP//E3Ko/wtHav8dr///Hrb//x6z//8etv//F4vN/yUlJf8DRmz/Hbv//xV2 - rf8GMEj/GZjh/x2y//8OVn//DEtv/xmt//81quv/l5aW/3CUqv88p+X/LKrw/1ehzP+alpP/npeT/3KV - p/8nq/f/FpDW/xun9v8cqfr/AxMd/wAAALQAAACcAAAAbBiT2f8hyP//Icf//xmb5v8AAAAkJSUl/2Bm - av8Xq///GLL//x22//8Ysf//F63//xqz//8et///FLP//1+VtP+clpL/m5WS/5uUkP+alZL/nJSP/5eV - lf+Wlpb/p5+a/zE/R/8AAAD/FofH/xyp+v8OVHv/Is3//xFml/8AAACcAAAAVAAAADAAAAAkAAAADAAA - AAAlJSX/nJaT/2mWr/8qqvP/FK7//0ak2/9bncP/Iaz7/x2v//8YaZf/iYSC/5mXl/+Wlpb/lpWV/5aV - lf+WlpX/lpaW/5aWlv+ioqL/AAAAkAAAADAfvf//G6f3/whAYP8WtP//Cmyk/wAAALQAAACcAAAAkAAA - AHgAAAA8AAAADCUlJf+Wlpb/nJWR/5+Ujv+clZD/npSN/56Ujv+glpH/kIeC/ycdF/+KiYj/mJiY/5aW - lv+Wlpb/lpaW/5aWlv+Wlpb/lpaW/6Kiov8AAACQAAAAPAAAACQAAABIEQkE/0U6Nf9QR0L/UVFR/0BA - QP89PT3/AAAAtAAAAIQAAAAAJSUl/5aWlv+Wlpb/lpWV/5aVlf+WlpX/lpaW/5iYl/+Li4r/JSUl/4qK - iv+YmJj/lpaW/5aWlv+Wlpb/lpaW/5aWlv+Wlpb/o6Oj/wAAAJwAAABsAAAAeFBQUP+IiIj/mpqZ/5yc - nP+cnJz/lJSU/3p6ev9xcXH/AAAAtAAAAAwlJSX/lpaW/5aWlv+Wlpb/lpaW/5aWlv+Wlpb/mJiY/4uL - i/8lJSX/ioqK/5iYmP+Wlpb/lpaW/5aWlv+Wlpb/lpaW/5aWlv+bm5v/AAAAtAAAAP9nZ2f/paWl/5mZ - mf+Wlpb/l5eX/5aWlv+Xl5f/mpqa/5ubm/+Hh4f/AAAADCUlJf+Wlpb/lpaW/5aWlv+Wlpb/lpaW/5aW - lv+YmJj/i4uL/yUlJf+Kior/mJiY/5aWlv+Wlpb/lpaW/5aWlv+Wlpb/l5eX/4yMjP9BQUH/ODg4/5yc - nP+Wlpb/lpaW/5WVlf+NjY3/kZGR/5aWlv+Wlpb/lpaW/52dnf94eHj/JSUl/5aWlv+Wlpb/lpaW/5aW - lv+Wlpb/lpaW/5iYmP+Li4v/JSUl/4qKiv+YmJj/lpaW/5aWlv+Wlpb/lpaW/5aWlv+YmJj/ioqK/wgI - CP+VlZX/mJiY/5aWlv+Tk5P/k5OT/6+vr/+hoaH/j4+P/5WVlf+Wlpb/lpaW/5qamv8lJSX/lpaW/5aW - lv+Wlpb/lpaW/5aWlv+Wlpb/mJiY/4uLi/8lJSX/ioqK/5iYmP+Wlpb/lpaW/5aWlv+Wlpb/lpaW/5iY - mP+Ghob/JCQk/6Kiov+Wlpb/lJSU/42Njf/d3d3///////j4+P+0tLT/jo6O/5aWlv+Wlpb/lpaW/yUl - Jf+Wlpb/lpaW/5aWlv+Wlpb/lpaW/5aWlv+YmJj/i4uL/yUlJf+Kior/mJiY/5aWlv+Wlpb/lpaW/5aW - lv+Wlpb/mJiY/4WFhf9BQUH/n5+f/5aWlv+QkJD/rKys//////////////////Hx8f+Li4v/lJSU/5aW - lv+Wlpb/JSUl/5aWlv+Wlpb/lpaW/5aWlv+Wlpb/lpaW/5iYmP+Li4v/JSUl/4qKiv+YmJj/lpaW/5aW - lv+Wlpb/lpaW/5aWlv+YmJj/hYWF/z09Pf+fn5//lpaW/5CQkP+mpqb/////////////////7u7u/4qK - iv+UlJT/lpaW/5aWlv8lJSX/lpaW/5aWlv+Wlpb/lpaW/5aWlv+Wlpb/mJiY/4uLi/8nJyf/ioqK/5iY - mP+Wlpb/lpaW/5aWlv+Wlpb/lpaW/5iYmP+Kior/ISEh/6Kiov+Wlpb/lZWV/4qKiv/MzMz/9fX1/+np - 6f+np6f/kZGR/5aWlv+Wlpb/lpaW/xMTE/+Li4v/mZmZ/5aWlv+Wlpb/lpaW/5aWlv+YmJj/jIyM/xMT - E/+Li4v/mZmZ/5aWlv+Wlpb/lpaW/5aWlv+Wlpb/l5eX/5WVlf8RERH/iYmJ/5qamv+Wlpb/lZWV/5GR - kf+Xl5f/lZWV/5KSkv+Wlpb/lpaW/5aWlv+ampr/AAAAeFFRUf+bm5v/lpaW/5aWlv+Wlpb/lpaW/5aW - lv+hoaH/AAAAeFFRUf+bm5v/lpaW/5aWlv+Wlpb/lpaW/5aWlv+Wlpb/pKSk/wAAAHgrKyv/mJiY/5eX - l/+Wlpb/lZWV/5SUlP+UlJT/lpaW/5aWlv+Wlpb/np6e/3h4eP8AAAAAEBAQ/3h4eP+fn5//l5eX/5aW - lv+Wlpb/np6e/39/f/8AAAAAEBAQ/3h4eP+fn5//l5eX/5aWlv+Wlpb/mJiY/6CgoP+Hh4f/AAAAPAAA - AP9QUFD/p6en/5mZmf+Wlpb/lpaW/5aWlv+Wlpb/lpaW/56env+Hh4f/AAAAAAAAAAwAAAAAJycn/3h4 - eP+ampr/oqKi/6ampv9/f3//AAAAAAAAAAwAAAAAJycn/3h4eP+ampr/o6Oj/6SkpP+RkZH/cnJy/wAA - ACQAAAAMAAAAAAAAAABRUVH/goKC/6ampv+ioqL/oqKi/6Kiov+mpqb/h4eH/wAAAAAAAAAMAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AACCAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBA - AAFAoAwC/////w== -</value> - </data> -</root> \ No newline at end of file Modified: trunk/plugins/MCEReplacement/MCEReplacement.csproj =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.csproj 2007-02-22 12:41:20 UTC (rev 134) +++ trunk/plugins/MCEReplacement/MCEReplacement.csproj 2007-02-22 12:45:00 UTC (rev 135) @@ -144,16 +144,14 @@ <Compile Include="InputMapper\InputMappingForm.cs"> <SubType>Form</SubType> </Compile> - <Compile Include="InputMapper\NewButtonForm.cs"> - <SubType>Form</SubType> - </Compile> - <Compile Include="InputMapper\NewButtonForm.Designer.cs"> - <DependentUpon>NewButtonForm.cs</DependentUpon> - </Compile> <Compi... [truncated message content] |
From: <an...@us...> - 2007-03-23 04:43:35
|
Revision: 211 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=211&view=rev Author: and-81 Date: 2007-03-22 21:43:28 -0700 (Thu, 22 Mar 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/Forms/MacroEditor.cs trunk/plugins/MCEReplacement/MCEReplacement.cs Modified: trunk/plugins/MCEReplacement/Forms/MacroEditor.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/MacroEditor.cs 2007-03-22 17:21:30 UTC (rev 210) +++ trunk/plugins/MCEReplacement/Forms/MacroEditor.cs 2007-03-23 04:43:28 UTC (rev 211) @@ -377,7 +377,7 @@ //if (selectBlasterSpeed.ShowDialog(this) == DialogResult.Cancel) //return; - listBoxMacro.Items.Add(MCEReplacement.SetMapCommandPrefix + ""); + listBoxMacro.Items.Add(MCEReplacement.SetMapCommandPrefix + "TOGGLE"); } else if (selected == SetMouseModeText) { Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-03-22 17:21:30 UTC (rev 210) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-03-23 04:43:28 UTC (rev 211) @@ -391,13 +391,13 @@ #region ISetupForm methods - public bool CanEnable() { return true; } - public bool HasSetup() { return true; } - public string PluginName() { return "MCE Replacement"; } - public bool DefaultEnabled() { return true; } - public int GetWindowId() { return 0; } - public string Author() { return "and-81"; } - public string Description() { return "Replaces MediaPortal's native MCE remote control support"; } + public bool CanEnable() { return true; } + public bool HasSetup() { return true; } + public string PluginName() { return "MCE Replacement"; } + public bool DefaultEnabled() { return true; } + public int GetWindowId() { return 0; } + public string Author() { return "and-81"; } + public string Description() { return "Replaces MediaPortal's native MCE remote control support"; } public void ShowPlugin() { @@ -649,8 +649,6 @@ } else if (MouseModeActive) { - //int x = Cursor.Position.X; - //int y = Cursor.Position.Y; int distance = MouseModeStep; if (MouseModeAcceleration) @@ -659,22 +657,18 @@ switch ((RemoteButton)button) { case RemoteButton.Up: - //Cursor.Position = new Point(x, y - distance); Mouse.Move(0, -distance, false); return true; case RemoteButton.Down: - //Cursor.Position = new Point(x, y + distance); Mouse.Move(0, distance, false); return true; case RemoteButton.Left: - //Cursor.Position = new Point(x - distance, y); Mouse.Move(-distance, 0, false); return true; case RemoteButton.Right: - //Cursor.Position = new Point(x + distance, y); Mouse.Move(distance, 0, false); return true; @@ -895,7 +889,6 @@ return; } } - } static void ShowNotifyDialog(string heading, string text, int timeout) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-04-04 18:01:54
|
Revision: 287 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=287&view=rev Author: and-81 Date: 2007-04-04 11:01:46 -0700 (Wed, 04 Apr 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/Forms/MacroEditor.Designer.cs trunk/plugins/MCEReplacement/Forms/MacroEditor.cs trunk/plugins/MCEReplacement/MCEReplacement.cs trunk/plugins/MCEReplacement/MCEReplacement.csproj Modified: trunk/plugins/MCEReplacement/Forms/MacroEditor.Designer.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/MacroEditor.Designer.cs 2007-04-04 16:37:30 UTC (rev 286) +++ trunk/plugins/MCEReplacement/Forms/MacroEditor.Designer.cs 2007-04-04 18:01:46 UTC (rev 287) @@ -196,10 +196,8 @@ // // MacroEditor // - 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(312, 329); this.Controls.Add(this.buttonOK); this.Controls.Add(this.buttonTest); Modified: trunk/plugins/MCEReplacement/Forms/MacroEditor.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/MacroEditor.cs 2007-04-04 16:37:30 UTC (rev 286) +++ trunk/plugins/MCEReplacement/Forms/MacroEditor.cs 2007-04-04 18:01:46 UTC (rev 287) @@ -34,6 +34,11 @@ public const string ToggleInputLayerText = "Toggle Input Handler Layer"; public const string ChangeWindowStateText = "Change Window State"; public const string GetFocusText = "Get Focus"; + public const string ExitCommandText = "Exit MediaPortal"; + public const string StandByCommandText = "Standby"; + public const string HibernateCommandText = "Hibernate"; + public const string RebootCommandText = "Reboot"; + public const string ShutdownCommandText = "Shutdown"; #endregion Constants @@ -80,6 +85,11 @@ comboBoxCommands.Items.Add(ToggleInputLayerText); comboBoxCommands.Items.Add(ChangeWindowStateText); comboBoxCommands.Items.Add(GetFocusText); + comboBoxCommands.Items.Add(ExitCommandText); + comboBoxCommands.Items.Add(StandByCommandText); + comboBoxCommands.Items.Add(HibernateCommandText); + comboBoxCommands.Items.Add(RebootCommandText); + comboBoxCommands.Items.Add(ShutdownCommandText); comboBoxCommands.Items.AddRange(MCEReplacement.GetIRList()); } @@ -105,79 +115,104 @@ if (item.StartsWith(MCEReplacement.BlastCommandPrefix)) { - writer.WriteAttributeString("command", "BLAST"); + writer.WriteAttributeString("command", MCEReplacement.BlastMacroText); writer.WriteAttributeString("cmdproperty", item.Substring(MCEReplacement.BlastCommandPrefix.Length)); } else if (item.StartsWith(MCEReplacement.PauseCommandPrefix)) { - writer.WriteAttributeString("command", "PAUSE"); + writer.WriteAttributeString("command", MCEReplacement.PauseMacroText); writer.WriteAttributeString("cmdproperty", item.Substring(MCEReplacement.PauseCommandPrefix.Length)); } else if (item.StartsWith(MCEReplacement.RunCommandPrefix)) { - writer.WriteAttributeString("command", "RUN"); + writer.WriteAttributeString("command", MCEReplacement.RunMacroText); writer.WriteAttributeString("cmdproperty", item.Substring(MCEReplacement.RunCommandPrefix.Length)); } else if (item.StartsWith(MCEReplacement.GoToCommandPrefix)) { - writer.WriteAttributeString("command", "GOTO"); + writer.WriteAttributeString("command", MCEReplacement.GotoMacroText); writer.WriteAttributeString("cmdproperty", item.Substring(MCEReplacement.GoToCommandPrefix.Length)); } else if (item.StartsWith(MCEReplacement.SerialCommandPrefix)) { - writer.WriteAttributeString("command", "SERIAL"); + writer.WriteAttributeString("command", MCEReplacement.SerialMacroText); writer.WriteAttributeString("cmdproperty", item.Substring(MCEReplacement.SerialCommandPrefix.Length)); } else if (item.StartsWith(MCEReplacement.MessageCommandPrefix)) { - writer.WriteAttributeString("command", "MESSAGE"); + writer.WriteAttributeString("command", MCEReplacement.MessageMacroText); writer.WriteAttributeString("cmdproperty", item.Substring(MCEReplacement.MessageCommandPrefix.Length)); } else if (item.StartsWith(MCEReplacement.KeyCommandPrefix)) { - writer.WriteAttributeString("command", "KEYS"); + writer.WriteAttributeString("command", MCEReplacement.KeysMacroText); writer.WriteAttributeString("cmdproperty", item.Substring(MCEReplacement.KeyCommandPrefix.Length)); } else if (item.StartsWith(MCEReplacement.PopupCommandPrefix)) { - writer.WriteAttributeString("command", "POPUP"); + writer.WriteAttributeString("command", MCEReplacement.PopupMacroText); writer.WriteAttributeString("cmdproperty", item.Substring(MCEReplacement.PopupCommandPrefix.Length)); } else if (item.StartsWith(MCEReplacement.PortCommandPrefix)) { - writer.WriteAttributeString("command", "PORT"); + writer.WriteAttributeString("command", MCEReplacement.PortMacroText); writer.WriteAttributeString("cmdproperty", item.Substring(MCEReplacement.PortCommandPrefix.Length)); } else if (item.StartsWith(MCEReplacement.SpeedCommandPrefix)) { - writer.WriteAttributeString("command", "SPEED"); + writer.WriteAttributeString("command", MCEReplacement.SpeedMacroText); writer.WriteAttributeString("cmdproperty", item.Substring(MCEReplacement.SpeedCommandPrefix.Length)); } else if (item.StartsWith(MCEReplacement.SetMapCommandPrefix)) { - writer.WriteAttributeString("command", "MULTI_MAPPING"); + writer.WriteAttributeString("command", MCEReplacement.MapMacroText); writer.WriteAttributeString("cmdproperty", item.Substring(MCEReplacement.SetMapCommandPrefix.Length)); } else if (item.StartsWith(MCEReplacement.SetMouseCommandPrefix)) { - writer.WriteAttributeString("command", "MOUSE_MODE"); + writer.WriteAttributeString("command", MCEReplacement.MouseMacroText); writer.WriteAttributeString("cmdproperty", item.Substring(MCEReplacement.SetMouseCommandPrefix.Length)); } else if (item.StartsWith(MCEReplacement.InputLayerCommand)) { - writer.WriteAttributeString("command", "INPUT_LAYER"); + writer.WriteAttributeString("command", MCEReplacement.InputLayerMacroText); writer.WriteAttributeString("cmdproperty", "TOGGLE"); } else if (item.StartsWith(MCEReplacement.WindowStateCommand)) { - writer.WriteAttributeString("command", "WINDOW_STATE"); + writer.WriteAttributeString("command", MCEReplacement.WindowStateMacroText); writer.WriteAttributeString("cmdproperty", "TOGGLE"); } else if (item.StartsWith(MCEReplacement.GetFocusCommand)) { - writer.WriteAttributeString("command", "GET_FOCUS"); + writer.WriteAttributeString("command", MCEReplacement.GetFocusMacroText); writer.WriteAttributeString("cmdproperty", ""); - } + } + else if (item.StartsWith(MCEReplacement.ExitCommand)) + { + writer.WriteAttributeString("command", MCEReplacement.ExitMacroText); + writer.WriteAttributeString("cmdproperty", ""); + } + else if (item.StartsWith(MCEReplacement.StandByCommand)) + { + writer.WriteAttributeString("command", MCEReplacement.StandbyMacroText); + writer.WriteAttributeString("cmdproperty", ""); + } + else if (item.StartsWith(MCEReplacement.HibernateCommand)) + { + writer.WriteAttributeString("command", MCEReplacement.HibernateMacroText); + writer.WriteAttributeString("cmdproperty", ""); + } + else if (item.StartsWith(MCEReplacement.RebootCommand)) + { + writer.WriteAttributeString("command", MCEReplacement.RebootMacroText); + writer.WriteAttributeString("cmdproperty", ""); + } + else if (item.StartsWith(MCEReplacement.ShutdownCommand)) + { + writer.WriteAttributeString("command", MCEReplacement.ShutdownMacroText); + writer.WriteAttributeString("cmdproperty", ""); + } writer.WriteEndElement(); } @@ -214,65 +249,85 @@ switch (item.Attributes["command"].Value) { - case "BLAST": + case MCEReplacement.BlastMacroText: listBoxMacro.Items.Add(MCEReplacement.BlastCommandPrefix + commandProperty); break; - case "PAUSE": + case MCEReplacement.PauseMacroText: listBoxMacro.Items.Add(MCEReplacement.PauseCommandPrefix + commandProperty); break; - case "RUN": + case MCEReplacement.RunMacroText: listBoxMacro.Items.Add(MCEReplacement.RunCommandPrefix + commandProperty); break; - case "SERIAL": + case MCEReplacement.SerialMacroText: listBoxMacro.Items.Add(MCEReplacement.SerialCommandPrefix + commandProperty); break; - case "MESSAGE": + case MCEReplacement.MessageMacroText: listBoxMacro.Items.Add(MCEReplacement.MessageCommandPrefix + commandProperty); break; - case "KEYS": + case MCEReplacement.KeysMacroText: listBoxMacro.Items.Add(MCEReplacement.KeyCommandPrefix + commandProperty); break; - case "GOTO": + case MCEReplacement.GotoMacroText: listBoxMacro.Items.Add(MCEReplacement.GoToCommandPrefix + commandProperty); break; - case "POPUP": + case MCEReplacement.PopupMacroText: listBoxMacro.Items.Add(MCEReplacement.PopupCommandPrefix + commandProperty); break; - case "PORT": + case MCEReplacement.PortMacroText: listBoxMacro.Items.Add(MCEReplacement.PortCommandPrefix + commandProperty); break; - case "SPEED": + case MCEReplacement.SpeedMacroText: listBoxMacro.Items.Add(MCEReplacement.SpeedCommandPrefix + commandProperty); break; - case "MULTI_MAPPING": + case MCEReplacement.MapMacroText: listBoxMacro.Items.Add(MCEReplacement.SetMapCommandPrefix + commandProperty); break; - case "MOUSE_MODE": + case MCEReplacement.MouseMacroText: listBoxMacro.Items.Add(MCEReplacement.SetMouseCommandPrefix + commandProperty); break; - case "INPUT_LAYER": + case MCEReplacement.InputLayerMacroText: listBoxMacro.Items.Add(MCEReplacement.InputLayerCommand); break; - case "WINDOW_STATE": + case MCEReplacement.WindowStateMacroText: listBoxMacro.Items.Add(MCEReplacement.WindowStateCommand); break; - case "GET_FOCUS": + case MCEReplacement.GetFocusMacroText: listBoxMacro.Items.Add(MCEReplacement.GetFocusCommand); break; + + case MCEReplacement.ExitMacroText: + listBoxMacro.Items.Add(MCEReplacement.ExitCommand); + break; + + case MCEReplacement.StandbyMacroText: + listBoxMacro.Items.Add(MCEReplacement.StandByCommand); + break; + + case MCEReplacement.HibernateMacroText: + listBoxMacro.Items.Add(MCEReplacement.HibernateCommand); + break; + + case MCEReplacement.RebootMacroText: + listBoxMacro.Items.Add(MCEReplacement.RebootCommand); + break; + + case MCEReplacement.ShutdownMacroText: + listBoxMacro.Items.Add(MCEReplacement.ShutdownCommand); + break; } } } @@ -399,6 +454,26 @@ { listBoxMacro.Items.Add(MCEReplacement.GetFocusCommand); } + else if (selected == ExitCommandText) + { + listBoxMacro.Items.Add(MCEReplacement.ExitCommand); + } + else if (selected == StandByCommandText) + { + listBoxMacro.Items.Add(MCEReplacement.StandByCommand); + } + else if (selected == HibernateCommandText) + { + listBoxMacro.Items.Add(MCEReplacement.HibernateCommand); + } + else if (selected == RebootCommandText) + { + listBoxMacro.Items.Add(MCEReplacement.RebootCommand); + } + else if (selected == ShutdownCommandText) + { + listBoxMacro.Items.Add(MCEReplacement.ShutdownCommand); + } else { listBoxMacro.Items.Add(MCEReplacement.BlastCommandPrefix + selected); @@ -616,6 +691,8 @@ listBoxMacro.Items.Insert(index, MCEReplacement.SpeedCommandPrefix + selectBlasterSpeed.CommandString); listBoxMacro.SelectedIndex = index; } + + // TODO: Add new command types? } } Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-04-04 16:37:30 UTC (rev 286) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-04-04 18:01:46 UTC (rev 287) @@ -11,11 +11,12 @@ using System.Windows.Forms; using System.Xml; +using MediaPortal.Configuration; using MediaPortal.Devices; using MediaPortal.Dialogs; using MediaPortal.GUI.Library; using MediaPortal.Hardware; -using MediaPortal.Configuration; +using MediaPortal.Player; using MediaPortal.Util; namespace MediaPortal.Plugins @@ -26,7 +27,7 @@ #region Constants - public const string PluginVersion = "MCE Replacement Plugin 1.0.3.0 for MediaPortal 0.2.1.0"; + public const string PluginVersion = "MCE Replacement Plugin 1.0.3.0 for MediaPortal 0.2.2.0 + SVN"; public const int MessageModeCommand = 0x0018; @@ -37,7 +38,7 @@ public const string IRExtension = ".IR"; public const string MacroExtension = ".MACRO"; - // Macro Commands + // Plugin Commands public const string RunCommandPrefix = "Run: "; public const string BlastCommandPrefix = "Blast: "; public const string PauseCommandPrefix = "Pause: "; @@ -53,7 +54,34 @@ public const string InputLayerCommand = "Toggle Input Layer"; public const string WindowStateCommand = "Toggle Window State"; public const string GetFocusCommand = "Get Focus"; + public const string ExitCommand = "Exit MediaPortal"; + public const string StandByCommand = "Standby"; + public const string HibernateCommand = "Hibernate"; + public const string RebootCommand = "Reboot"; + public const string ShutdownCommand = "Shutdown"; + // Macro File Commands + public const string BlastMacroText = "BLAST"; + public const string PauseMacroText = "PAUSE"; + public const string RunMacroText = "RUN"; + public const string SerialMacroText = "SERIAL"; + public const string KeysMacroText = "KEYS"; + public const string MessageMacroText = "MESSAGE"; + public const string GotoMacroText = "GOTO"; + public const string PopupMacroText = "POPUP"; + public const string PortMacroText = "PORT"; + public const string SpeedMacroText = "SPEED"; + public const string MapMacroText = "MULTI_MAPPING"; + public const string MouseMacroText = "MOUSE_MODE"; + public const string InputLayerMacroText = "INPUT_LAYER"; + public const string WindowStateMacroText = "WINDOW_STATE"; + public const string GetFocusMacroText = "GET_FOCUS"; + public const string ExitMacroText = "EXIT"; + public const string StandbyMacroText = "STANDBY"; + public const string HibernateMacroText = "HIBERNATE"; + public const string RebootMacroText = "REBOOT"; + public const string ShutdownMacroText = "SHUTDOWN"; + public static readonly string AppDataFolder = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\MediaPortal MCE Replacement Plugin\\"; @@ -1440,7 +1468,7 @@ switch (item.Attributes["command"].Value) { - case "BLAST": + case BlastMacroText: if (!BlastIR(AppDataFolder + commandProperty + IRExtension, macroPort, macroSpeed)) { file.Close(); @@ -1449,7 +1477,7 @@ } break; - case "PAUSE": + case PauseMacroText: { if (LogVerbose) Log.Debug("MCEReplacement: Pause {0}", commandProperty); @@ -1459,7 +1487,7 @@ break; } - case "RUN": + case RunMacroText: { string[] commands = SplitRunCommand(commandProperty); @@ -1479,7 +1507,7 @@ break; } - case "SERIAL": + case SerialMacroText: { string[] commands = SplitSerialCommand(commandProperty); @@ -1499,7 +1527,7 @@ break; } - case "GOTO": + case GotoMacroText: { if (InConfiguration) MessageBox.Show(commandProperty, "Go To Window", MessageBoxButtons.OK, MessageBoxIcon.Information); @@ -1508,7 +1536,7 @@ break; } - case "POPUP": + case PopupMacroText: { string[] commands = SplitPopupCommand(commandProperty); @@ -1530,15 +1558,15 @@ break; } - case "PORT": + case PortMacroText: macroPort = (MceIrApi.BlasterPort)Enum.Parse(typeof(MceIrApi.BlasterPort), commandProperty); break; - case "SPEED": + case SpeedMacroText: macroSpeed = (MceIrApi.BlasterSpeed)Enum.Parse(typeof(MceIrApi.BlasterSpeed), commandProperty); break; - case "MESSAGE": + case MessageMacroText: { string[] commands = SplitMessageCommand(commandProperty); @@ -1556,7 +1584,7 @@ break; } - case "KEYS": + case KeysMacroText: { if (InConfiguration) { @@ -1572,7 +1600,7 @@ break; } - case "MULTI_MAPPING": + case MapMacroText: { if (InConfiguration) MessageBox.Show(commandProperty, "Change Multi-Mapping Command", MessageBoxButtons.OK, MessageBoxIcon.Information); @@ -1582,7 +1610,7 @@ break; } - case "MOUSE_MODE": + case MouseMacroText: { if (InConfiguration) { @@ -1647,7 +1675,7 @@ break; } - case "INPUT_LAYER": + case InputLayerMacroText: { if (InConfiguration) { @@ -1670,7 +1698,7 @@ break; } - case "WINDOW_STATE": + case WindowStateMacroText: { if (InConfiguration) { @@ -1687,7 +1715,7 @@ break; } - case "GET_FOCUS": + case GetFocusMacroText: { if (InConfiguration) { @@ -1700,6 +1728,85 @@ GUIWindowManager.SendThreadMessage(msg); break; } + + case ExitMacroText: + { + if (!InConfiguration) + { + Log.Info("MCEReplacement: MediaPortal Exit"); + GUIGraphicsContext.OnAction(new Action(Action.ActionType.ACTION_EXIT, 0, 0)); + } + break; + } + + case StandbyMacroText: + { + if (!InConfiguration) + { + Log.Info("MCEReplacement: Request Standby"); + GUIGraphicsContext.ResetLastActivity(); + // Stop all media before suspending or hibernating + g_Player.Stop(); + + GUIMessage msg; + + if (_mpBasicHome) + msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW, 0, 0, 0, (int)GUIWindow.Window.WINDOW_SECOND_HOME, 0, null); + else + msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW, 0, 0, 0, (int)GUIWindow.Window.WINDOW_HOME, 0, null); + + GUIWindowManager.SendThreadMessage(msg); + + MCEReplacement.OnSuspend(); + WindowsController.ExitWindows(RestartOptions.Suspend, true); + } + break; + } + + case HibernateMacroText: + { + if (!InConfiguration) + { + Log.Info("MCEReplacement: Request Hibernate"); + GUIGraphicsContext.ResetLastActivity(); + // Stop all media before suspending or hibernating + g_Player.Stop(); + + GUIMessage msg; + + if (_mpBasicHome) + msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW, 0, 0, 0, (int)GUIWindow.Window.WINDOW_SECOND_HOME, 0, null); + else + msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW, 0, 0, 0, (int)GUIWindow.Window.WINDOW_HOME, 0, null); + + GUIWindowManager.SendThreadMessage(msg); + + MCEReplacement.OnSuspend(); + WindowsController.ExitWindows(RestartOptions.Hibernate, true); + } + break; + } + + case RebootMacroText: + { + if (!InConfiguration) + { + Log.Info("MCEReplacement: Reboot"); + GUIGraphicsContext.OnAction(new Action(Action.ActionType.ACTION_REBOOT, 0, 0)); + } + break; + } + + case ShutdownMacroText: + { + if (!InConfiguration) + { + Log.Info("MCEReplacement: Shutdown"); + GUIGraphicsContext.OnAction(new Action(Action.ActionType.ACTION_SHUTDOWN, 0, 0)); + } + break; + } + } } } @@ -1927,7 +2034,7 @@ { if (String.IsNullOrEmpty(command)) { - Log.Error("MCEReplacement: Invalid command"); + Log.Error("MCEReplacement: Invalid (empty) command"); return false; } @@ -2032,6 +2139,27 @@ return ProcessGoTo(command.Substring(GoToCommandPrefix.Length)); } + + + + + /* + public const string SetMapCommandPrefix = "Multi-Mapping: "; + public const string SetMouseCommandPrefix = "Mouse Mode: "; + public const string InputLayerCommand = "Toggle Input Layer"; + public const string WindowStateCommand = "Toggle Window State"; + public const string GetFocusCommand = "Get Focus"; + + public const string ExitCommand = "Exit MediaPortal"; +public const string StandByCommand = "Standby"; +public const string HibernateCommand = "Hibernate"; +public const string RebootCommand = "Reboot"; +public const string ShutdownCommand = "Shutdown"; + */ + + + + Log.Error("MCEReplacement: Unprocessed command \"{0}\"", command); return false; } Modified: trunk/plugins/MCEReplacement/MCEReplacement.csproj =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.csproj 2007-04-04 16:37:30 UTC (rev 286) +++ trunk/plugins/MCEReplacement/MCEReplacement.csproj 2007-04-04 18:01:46 UTC (rev 287) @@ -152,28 +152,29 @@ <Compile Include="Win32.cs" /> </ItemGroup> <ItemGroup> - <Reference Include="Core, Version=1.0.2485.22312, Culture=neutral, processorArchitecture=x86"> + <Reference Include="Core, Version=1.0.2581.1884, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\MediaPortal 0.2.1.0\Core.DLL</HintPath> + <HintPath>..\..\MediaPortal\Core\bin\Release\Core.dll</HintPath> <Private>False</Private> </Reference> - <Reference Include="Databases, Version=1.0.2485.22313, Culture=neutral, processorArchitecture=x86"> + <Reference Include="Databases, Version=1.0.2581.1890, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\MediaPortal 0.2.1.0\Databases.DLL</HintPath> + <HintPath>..\..\MediaPortal\Databases\bin\Release\Databases.dll</HintPath> <Private>False</Private> </Reference> - <Reference Include="Dialogs, Version=0.0.0.0, Culture=neutral, processorArchitecture=x86"> + <Reference Include="Dialogs, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\MediaPortal 0.2.1.0\Dialogs.DLL</HintPath> + <HintPath>..\..\MediaPortal\Dialogs\bin\Release\Dialogs.dll</HintPath> <Private>False</Private> </Reference> <Reference Include="Microsoft.DirectX.Direct3D, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\MediaPortal 0.2.1.0\Microsoft.DirectX.Direct3D.dll</HintPath> + <HintPath>..\..\MediaPortal\xbmc\bin\Release\Microsoft.DirectX.Direct3D.dll</HintPath> + <Private>False</Private> </Reference> - <Reference Include="RemotePlugins, Version=1.0.2485.22315, Culture=neutral, processorArchitecture=x86"> + <Reference Include="RemotePlugins, Version=1.0.2581.1913, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\MediaPortal 0.2.1.0\RemotePlugins.DLL</HintPath> + <HintPath>..\..\MediaPortal\RemotePlugins\bin\Release\RemotePlugins.dll</HintPath> <Private>False</Private> </Reference> <Reference Include="System" /> @@ -181,11 +182,16 @@ <Reference Include="System.Drawing" /> <Reference Include="System.Windows.Forms" /> <Reference Include="System.Xml" /> - <Reference Include="TVCapture, Version=1.0.2485.22314, Culture=neutral, processorArchitecture=x86"> + <Reference Include="TVCapture, Version=1.0.2581.1894, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\MediaPortal 0.2.1.0\TVCapture.DLL</HintPath> + <HintPath>..\..\MediaPortal\TVCapture\bin\Release\TVCapture.dll</HintPath> <Private>False</Private> </Reference> + <Reference Include="Utils, Version=1.0.2581.1867, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\MediaPortal\Utils\bin\Release\Utils.dll</HintPath> + <Private>False</Private> + </Reference> </ItemGroup> <ItemGroup> <EmbeddedResource Include="Forms\ExternalChannels.resx"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-04-07 14:39:24
|
Revision: 295 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=295&view=rev Author: and-81 Date: 2007-04-07 07:39:22 -0700 (Sat, 07 Apr 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/AssemblyInfo.cs trunk/plugins/MCEReplacement/MCEReplacement.cs trunk/plugins/MCEReplacement/Win32.cs Modified: trunk/plugins/MCEReplacement/AssemblyInfo.cs =================================================================== --- trunk/plugins/MCEReplacement/AssemblyInfo.cs 2007-04-07 09:44:22 UTC (rev 294) +++ trunk/plugins/MCEReplacement/AssemblyInfo.cs 2007-04-07 14:39:22 UTC (rev 295) @@ -34,8 +34,8 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.3.0")] -[assembly: AssemblyFileVersionAttribute("1.0.3.0")] +[assembly: AssemblyVersion("1.0.3.1")] +[assembly: AssemblyFileVersionAttribute("1.0.3.1")] // // In order to sign your assembly you must specify a key to use. Refer to the Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-04-07 09:44:22 UTC (rev 294) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-04-07 14:39:22 UTC (rev 295) @@ -27,7 +27,7 @@ #region Constants - public const string PluginVersion = "MCE Replacement Plugin 1.0.3.0 for MediaPortal 0.2.2.0 + SVN"; + public const string PluginVersion = "MCE Replacement Plugin 1.0.3.1 for MediaPortal 0.2.2.0 + SVN"; public const int MessageModeCommand = 0x0018; @@ -2218,12 +2218,23 @@ try { if (proc.MainModule.FileName == commands[0]) + { windowHandle = proc.MainWindowHandle; + break; + } } catch { } } + + // if it wasn't an application, try a class + if (windowHandle == IntPtr.Zero) + windowHandle = Win32.FindWindow(commands[0], null); + + // if still not found, try window title + if (windowHandle == IntPtr.Zero) + windowHandle = Win32.FindWindow(null, commands[0]); } if (windowHandle == IntPtr.Zero) Modified: trunk/plugins/MCEReplacement/Win32.cs =================================================================== --- trunk/plugins/MCEReplacement/Win32.cs 2007-04-07 09:44:22 UTC (rev 294) +++ trunk/plugins/MCEReplacement/Win32.cs 2007-04-07 14:39:22 UTC (rev 295) @@ -35,11 +35,14 @@ #region Interop [DllImport("user32")] - public static extern IntPtr GetForegroundWindow(); + internal static extern IntPtr GetForegroundWindow(); [DllImport("user32", SetLastError = false)] - public static extern IntPtr SendMessage(IntPtr windowHandle, int msg, IntPtr wordParam, IntPtr longParam); + internal static extern IntPtr SendMessage(IntPtr windowHandle, int msg, IntPtr wordParam, IntPtr longParam); + [DllImport("user32", SetLastError = true)] + internal static extern IntPtr FindWindow(string lpClassName, string lpWindowName); + #endregion Interop } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-04-14 04:44:06
|
Revision: 327 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=327&view=rev Author: and-81 Date: 2007-04-13 21:44:03 -0700 (Fri, 13 Apr 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/Forms/MacroEditor.cs trunk/plugins/MCEReplacement/Forms/MessageCommand.Designer.cs trunk/plugins/MCEReplacement/Forms/MessageCommand.cs trunk/plugins/MCEReplacement/Forms/MessageCommand.resx trunk/plugins/MCEReplacement/MCEReplacement.cs trunk/plugins/MCEReplacement/MCEReplacement.csproj Modified: trunk/plugins/MCEReplacement/Forms/MacroEditor.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/MacroEditor.cs 2007-04-14 03:44:42 UTC (rev 326) +++ trunk/plugins/MCEReplacement/Forms/MacroEditor.cs 2007-04-14 04:44:03 UTC (rev 327) @@ -18,30 +18,6 @@ public partial class MacroEditor : Form { - #region Constants - - public const string RunProgramText = "Run Program"; - public const string PauseText = "Pause"; - public const string SerialCommandText = "Serial Command"; - public const string MessageCommandText = "Message Command"; - public const string KeystrokesCommandText = "Keystrokes Command"; - public const string GoToScreenText = "Go To Screen"; - public const string PopupMessageText = "Popup Message"; - public const string ForceBlasterPortText = "Force Blaster Port"; - public const string ForceBlasterSpeedText = "Force Blaster Speed"; - public const string SetMultiMappingText = "Set Multi-Mapping"; - public const string SetMouseModeText = "Set Mouse Mode"; - public const string ToggleInputLayerText = "Toggle Input Handler Layer"; - public const string ChangeWindowStateText = "Change Window State"; - public const string GetFocusText = "Get Focus"; - public const string ExitCommandText = "Exit MediaPortal"; - public const string StandByCommandText = "Standby"; - public const string HibernateCommandText = "Hibernate"; - public const string RebootCommandText = "Reboot"; - public const string ShutdownCommandText = "Shutdown"; - - #endregion Constants - #region Variables MceIrApi.BlasterPort _blastPort; @@ -71,25 +47,25 @@ { comboBoxCommands.Items.Clear(); - comboBoxCommands.Items.Add(RunProgramText); - comboBoxCommands.Items.Add(PauseText); - comboBoxCommands.Items.Add(SerialCommandText); - comboBoxCommands.Items.Add(MessageCommandText); - comboBoxCommands.Items.Add(KeystrokesCommandText); - comboBoxCommands.Items.Add(GoToScreenText); - comboBoxCommands.Items.Add(PopupMessageText); - comboBoxCommands.Items.Add(ForceBlasterPortText); - comboBoxCommands.Items.Add(ForceBlasterSpeedText); - comboBoxCommands.Items.Add(SetMultiMappingText); - comboBoxCommands.Items.Add(SetMouseModeText); - comboBoxCommands.Items.Add(ToggleInputLayerText); - comboBoxCommands.Items.Add(ChangeWindowStateText); - comboBoxCommands.Items.Add(GetFocusText); - comboBoxCommands.Items.Add(ExitCommandText); - comboBoxCommands.Items.Add(StandByCommandText); - comboBoxCommands.Items.Add(HibernateCommandText); - comboBoxCommands.Items.Add(RebootCommandText); - comboBoxCommands.Items.Add(ShutdownCommandText); + comboBoxCommands.Items.Add(MCEReplacement.RunProgramText); + comboBoxCommands.Items.Add(MCEReplacement.PauseText); + comboBoxCommands.Items.Add(MCEReplacement.SerialCommandText); + comboBoxCommands.Items.Add(MCEReplacement.MessageCommandText); + comboBoxCommands.Items.Add(MCEReplacement.KeystrokesCommandText); + comboBoxCommands.Items.Add(MCEReplacement.GoToScreenText); + comboBoxCommands.Items.Add(MCEReplacement.PopupMessageText); + comboBoxCommands.Items.Add(MCEReplacement.ForceBlasterPortText); + comboBoxCommands.Items.Add(MCEReplacement.ForceBlasterSpeedText); + comboBoxCommands.Items.Add(MCEReplacement.SetMultiMappingText); + comboBoxCommands.Items.Add(MCEReplacement.SetMouseModeText); + comboBoxCommands.Items.Add(MCEReplacement.ToggleInputLayerText); + //comboBoxCommands.Items.Add(MCEReplacement.ChangeWindowStateText); + comboBoxCommands.Items.Add(MCEReplacement.GetFocusText); + comboBoxCommands.Items.Add(MCEReplacement.ExitCommandText); + comboBoxCommands.Items.Add(MCEReplacement.StandByCommandText); + comboBoxCommands.Items.Add(MCEReplacement.HibernateCommandText); + comboBoxCommands.Items.Add(MCEReplacement.RebootCommandText); + comboBoxCommands.Items.Add(MCEReplacement.ShutdownCommandText); comboBoxCommands.Items.AddRange(MCEReplacement.GetIRList()); } @@ -178,11 +154,13 @@ writer.WriteAttributeString("command", MCEReplacement.InputLayerMacroText); writer.WriteAttributeString("cmdproperty", "TOGGLE"); } + /* else if (item.StartsWith(MCEReplacement.WindowStateCommand)) { writer.WriteAttributeString("command", MCEReplacement.WindowStateMacroText); writer.WriteAttributeString("cmdproperty", "TOGGLE"); } + */ else if (item.StartsWith(MCEReplacement.GetFocusCommand)) { writer.WriteAttributeString("command", MCEReplacement.GetFocusMacroText); @@ -300,11 +278,11 @@ case MCEReplacement.InputLayerMacroText: listBoxMacro.Items.Add(MCEReplacement.InputLayerCommand); break; - +/* case MCEReplacement.WindowStateMacroText: listBoxMacro.Items.Add(MCEReplacement.WindowStateCommand); break; - +*/ case MCEReplacement.GetFocusMacroText: listBoxMacro.Items.Add(MCEReplacement.GetFocusCommand); break; @@ -352,7 +330,7 @@ string selected = (string)comboBoxCommands.SelectedItem; - if (selected == RunProgramText) + if (selected == MCEReplacement.RunProgramText) { ExternalProgram externalProgram = new ExternalProgram(); @@ -361,7 +339,7 @@ listBoxMacro.Items.Add(MCEReplacement.RunCommandPrefix + externalProgram.CommandString); } - else if (selected == PauseText) + else if (selected == MCEReplacement.PauseText) { PauseTime pauseTime = new PauseTime(); @@ -370,7 +348,7 @@ listBoxMacro.Items.Add(MCEReplacement.PauseCommandPrefix + pauseTime.Time.ToString()); } - else if (selected == SerialCommandText) + else if (selected == MCEReplacement.SerialCommandText) { SerialCommand serialCommand = new SerialCommand(); if (serialCommand.ShowDialog(this) == DialogResult.Cancel) @@ -378,7 +356,7 @@ listBoxMacro.Items.Add(MCEReplacement.SerialCommandPrefix + serialCommand.CommandString); } - else if (selected == MessageCommandText) + else if (selected == MCEReplacement.MessageCommandText) { MessageCommand messageCommand = new MessageCommand(); if (messageCommand.ShowDialog(this) == DialogResult.Cancel) @@ -386,7 +364,7 @@ listBoxMacro.Items.Add(MCEReplacement.MessageCommandPrefix + messageCommand.CommandString); } - else if (selected == KeystrokesCommandText) + else if (selected == MCEReplacement.KeystrokesCommandText) { KeysCommand keysCommand = new KeysCommand(); if (keysCommand.ShowDialog(this) == DialogResult.Cancel) @@ -394,7 +372,7 @@ listBoxMacro.Items.Add(MCEReplacement.KeyCommandPrefix + keysCommand.CommandString); } - else if (selected == GoToScreenText) + else if (selected == MCEReplacement.GoToScreenText) { GoToScreen goToScreen = new GoToScreen(); if (goToScreen.ShowDialog(this) == DialogResult.Cancel) @@ -402,7 +380,7 @@ listBoxMacro.Items.Add(MCEReplacement.GoToCommandPrefix + goToScreen.Screen); } - else if (selected == PopupMessageText) + else if (selected == MCEReplacement.PopupMessageText) { PopupMessage popupMessage = new PopupMessage(); if (popupMessage.ShowDialog(this) == DialogResult.Cancel) @@ -410,7 +388,7 @@ listBoxMacro.Items.Add(MCEReplacement.PopupCommandPrefix + popupMessage.CommandString); } - else if (selected == ForceBlasterPortText) + else if (selected == MCEReplacement.ForceBlasterPortText) { SelectBlasterPort selectBlasterPort = new SelectBlasterPort(_blastPort); if (selectBlasterPort.ShowDialog(this) == DialogResult.Cancel) @@ -418,7 +396,7 @@ listBoxMacro.Items.Add(MCEReplacement.PortCommandPrefix + selectBlasterPort.CommandString); } - else if (selected == ForceBlasterSpeedText) + else if (selected == MCEReplacement.ForceBlasterSpeedText) { SelectBlasterSpeed selectBlasterSpeed = new SelectBlasterSpeed(_blastSpeed); if (selectBlasterSpeed.ShowDialog(this) == DialogResult.Cancel) @@ -426,7 +404,7 @@ listBoxMacro.Items.Add(MCEReplacement.SpeedCommandPrefix + selectBlasterSpeed.CommandString); } - else if (selected == SetMultiMappingText) + else if (selected == MCEReplacement.SetMultiMappingText) { //SelectBlasterSpeed selectBlasterSpeed = new SelectBlasterSpeed(_blastSpeed); //if (selectBlasterSpeed.ShowDialog(this) == DialogResult.Cancel) @@ -434,7 +412,7 @@ listBoxMacro.Items.Add(MCEReplacement.SetMapCommandPrefix + "TOGGLE"); } - else if (selected == SetMouseModeText) + else if (selected == MCEReplacement.SetMouseModeText) { //SelectBlasterSpeed selectBlasterSpeed = new SelectBlasterSpeed(_blastSpeed); //if (selectBlasterSpeed.ShowDialog(this) == DialogResult.Cancel) @@ -442,35 +420,37 @@ listBoxMacro.Items.Add(MCEReplacement.SetMouseCommandPrefix + "TOGGLE"); } - else if (selected == ToggleInputLayerText) + else if (selected == MCEReplacement.ToggleInputLayerText) { listBoxMacro.Items.Add(MCEReplacement.InputLayerCommand); } - else if (selected == ChangeWindowStateText) + /* + else if (selected == MCEReplacement.ChangeWindowStateText) { listBoxMacro.Items.Add(MCEReplacement.WindowStateCommand); } - else if (selected == GetFocusText) + */ + else if (selected == MCEReplacement.GetFocusText) { listBoxMacro.Items.Add(MCEReplacement.GetFocusCommand); } - else if (selected == ExitCommandText) + else if (selected == MCEReplacement.ExitCommandText) { listBoxMacro.Items.Add(MCEReplacement.ExitCommand); } - else if (selected == StandByCommandText) + else if (selected == MCEReplacement.StandByCommandText) { listBoxMacro.Items.Add(MCEReplacement.StandByCommand); } - else if (selected == HibernateCommandText) + else if (selected == MCEReplacement.HibernateCommandText) { listBoxMacro.Items.Add(MCEReplacement.HibernateCommand); } - else if (selected == RebootCommandText) + else if (selected == MCEReplacement.RebootCommandText) { listBoxMacro.Items.Add(MCEReplacement.RebootCommand); } - else if (selected == ShutdownCommandText) + else if (selected == MCEReplacement.ShutdownCommandText) { listBoxMacro.Items.Add(MCEReplacement.ShutdownCommand); } Modified: trunk/plugins/MCEReplacement/Forms/MessageCommand.Designer.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/MessageCommand.Designer.cs 2007-04-14 03:44:42 UTC (rev 326) +++ trunk/plugins/MCEReplacement/Forms/MessageCommand.Designer.cs 2007-04-14 04:44:03 UTC (rev 327) @@ -31,10 +31,8 @@ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - this.checkBoxMsgCurrApp = new System.Windows.Forms.CheckBox(); - this.labelMsgApp = new System.Windows.Forms.Label(); - this.buttonFindMsgApp = new System.Windows.Forms.Button(); - this.textBoxMsgApp = new System.Windows.Forms.TextBox(); + this.buttonFindMsgTarget = new System.Windows.Forms.Button(); + this.textBoxMsgTarget = new System.Windows.Forms.TextBox(); this.numericUpDownLParam = new System.Windows.Forms.NumericUpDown(); this.numericUpDownWParam = new System.Windows.Forms.NumericUpDown(); this.numericUpDownMsg = new System.Windows.Forms.NumericUpDown(); @@ -46,93 +44,85 @@ this.labelMessage = new System.Windows.Forms.Label(); this.buttonCancel = new System.Windows.Forms.Button(); this.buttonOK = new System.Windows.Forms.Button(); + this.groupBoxTarget = new System.Windows.Forms.GroupBox(); + this.groupBoxDetails = new System.Windows.Forms.GroupBox(); + this.toolTip = new System.Windows.Forms.ToolTip(this.components); + this.radioButtonActiveWindow = new System.Windows.Forms.RadioButton(); + this.radioButtonApplication = new System.Windows.Forms.RadioButton(); + this.radioButtonClass = new System.Windows.Forms.RadioButton(); + this.radioButtonWindowTitle = new System.Windows.Forms.RadioButton(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownLParam)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownWParam)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownMsg)).BeginInit(); this.contextMenuStripWM.SuspendLayout(); + this.groupBoxTarget.SuspendLayout(); + this.groupBoxDetails.SuspendLayout(); this.SuspendLayout(); // - // checkBoxMsgCurrApp + // buttonFindMsgTarget // - this.checkBoxMsgCurrApp.Location = new System.Drawing.Point(96, 32); - this.checkBoxMsgCurrApp.Name = "checkBoxMsgCurrApp"; - this.checkBoxMsgCurrApp.Size = new System.Drawing.Size(160, 16); - this.checkBoxMsgCurrApp.TabIndex = 3; - this.checkBoxMsgCurrApp.Text = "Send to active window"; - this.checkBoxMsgCurrApp.UseVisualStyleBackColor = true; - this.checkBoxMsgCurrApp.CheckedChanged += new System.EventHandler(this.checkBoxMsgCurrApp_CheckedChanged); + this.buttonFindMsgTarget.Location = new System.Drawing.Point(240, 80); + this.buttonFindMsgTarget.Name = "buttonFindMsgTarget"; + this.buttonFindMsgTarget.Size = new System.Drawing.Size(24, 20); + this.buttonFindMsgTarget.TabIndex = 5; + this.buttonFindMsgTarget.Text = "..."; + this.toolTip.SetToolTip(this.buttonFindMsgTarget, "Locate a target for the message"); + this.buttonFindMsgTarget.UseVisualStyleBackColor = true; + this.buttonFindMsgTarget.Click += new System.EventHandler(this.buttonFindMsgApp_Click); // - // labelMsgApp + // textBoxMsgTarget // - this.labelMsgApp.Location = new System.Drawing.Point(8, 8); - this.labelMsgApp.Name = "labelMsgApp"; - this.labelMsgApp.Size = new System.Drawing.Size(88, 20); - this.labelMsgApp.TabIndex = 0; - this.labelMsgApp.Text = "Application:"; - this.labelMsgApp.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.textBoxMsgTarget.Location = new System.Drawing.Point(8, 80); + this.textBoxMsgTarget.Name = "textBoxMsgTarget"; + this.textBoxMsgTarget.Size = new System.Drawing.Size(224, 20); + this.textBoxMsgTarget.TabIndex = 4; + this.toolTip.SetToolTip(this.textBoxMsgTarget, "Message target"); // - // buttonFindMsgApp - // - this.buttonFindMsgApp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonFindMsgApp.Location = new System.Drawing.Point(352, 8); - this.buttonFindMsgApp.Name = "buttonFindMsgApp"; - this.buttonFindMsgApp.Size = new System.Drawing.Size(24, 20); - this.buttonFindMsgApp.TabIndex = 2; - this.buttonFindMsgApp.Text = "..."; - this.buttonFindMsgApp.UseVisualStyleBackColor = true; - this.buttonFindMsgApp.Click += new System.EventHandler(this.buttonFindMsgApp_Click); - // - // textBoxMsgApp - // - this.textBoxMsgApp.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxMsgApp.Location = new System.Drawing.Point(96, 8); - this.textBoxMsgApp.Name = "textBoxMsgApp"; - this.textBoxMsgApp.Size = new System.Drawing.Size(248, 20); - this.textBoxMsgApp.TabIndex = 1; - // // numericUpDownLParam // - this.numericUpDownLParam.Location = new System.Drawing.Point(96, 128); + this.numericUpDownLParam.Location = new System.Drawing.Point(144, 88); this.numericUpDownLParam.Maximum = new decimal(new int[] { -1, 0, 0, 0}); this.numericUpDownLParam.Name = "numericUpDownLParam"; - this.numericUpDownLParam.Size = new System.Drawing.Size(104, 20); - this.numericUpDownLParam.TabIndex = 9; + this.numericUpDownLParam.Size = new System.Drawing.Size(120, 20); + this.numericUpDownLParam.TabIndex = 5; this.numericUpDownLParam.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.numericUpDownLParam.ThousandsSeparator = true; + this.toolTip.SetToolTip(this.numericUpDownLParam, "Long Parameter (or LParam)"); // // numericUpDownWParam // - this.numericUpDownWParam.Location = new System.Drawing.Point(96, 96); + this.numericUpDownWParam.Location = new System.Drawing.Point(144, 56); this.numericUpDownWParam.Maximum = new decimal(new int[] { -1, 0, 0, 0}); this.numericUpDownWParam.Name = "numericUpDownWParam"; - this.numericUpDownWParam.Size = new System.Drawing.Size(104, 20); - this.numericUpDownWParam.TabIndex = 7; + this.numericUpDownWParam.Size = new System.Drawing.Size(120, 20); + this.numericUpDownWParam.TabIndex = 3; this.numericUpDownWParam.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.numericUpDownWParam.ThousandsSeparator = true; + this.toolTip.SetToolTip(this.numericUpDownWParam, "Word Paramater (or WParam)"); // // numericUpDownMsg // this.numericUpDownMsg.ContextMenuStrip = this.contextMenuStripWM; - this.numericUpDownMsg.Location = new System.Drawing.Point(96, 64); + this.numericUpDownMsg.Location = new System.Drawing.Point(144, 24); this.numericUpDownMsg.Maximum = new decimal(new int[] { -1, 0, 0, 0}); this.numericUpDownMsg.Name = "numericUpDownMsg"; - this.numericUpDownMsg.Size = new System.Drawing.Size(104, 20); - this.numericUpDownMsg.TabIndex = 5; + this.numericUpDownMsg.Size = new System.Drawing.Size(120, 20); + this.numericUpDownMsg.TabIndex = 1; this.numericUpDownMsg.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.numericUpDownMsg.ThousandsSeparator = true; + this.toolTip.SetToolTip(this.numericUpDownMsg, "Message identifier"); // // contextMenuStripWM // @@ -158,28 +148,28 @@ // // labelLParam // - this.labelLParam.Location = new System.Drawing.Point(8, 128); + this.labelLParam.Location = new System.Drawing.Point(8, 88); this.labelLParam.Name = "labelLParam"; - this.labelLParam.Size = new System.Drawing.Size(88, 20); - this.labelLParam.TabIndex = 8; + this.labelLParam.Size = new System.Drawing.Size(128, 20); + this.labelLParam.TabIndex = 4; this.labelLParam.Text = "Long Param:"; this.labelLParam.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // labelWParam // - this.labelWParam.Location = new System.Drawing.Point(8, 96); + this.labelWParam.Location = new System.Drawing.Point(8, 56); this.labelWParam.Name = "labelWParam"; - this.labelWParam.Size = new System.Drawing.Size(88, 20); - this.labelWParam.TabIndex = 6; + this.labelWParam.Size = new System.Drawing.Size(128, 20); + this.labelWParam.TabIndex = 2; this.labelWParam.Text = "Word Param:"; this.labelWParam.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // labelMessage // - this.labelMessage.Location = new System.Drawing.Point(8, 64); + this.labelMessage.Location = new System.Drawing.Point(8, 24); this.labelMessage.Name = "labelMessage"; - this.labelMessage.Size = new System.Drawing.Size(88, 20); - this.labelMessage.TabIndex = 4; + this.labelMessage.Size = new System.Drawing.Size(128, 20); + this.labelMessage.TabIndex = 0; this.labelMessage.Text = "Message:"; this.labelMessage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // @@ -187,10 +177,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(312, 152); + this.buttonCancel.Location = new System.Drawing.Point(216, 256); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(64, 24); - this.buttonCancel.TabIndex = 11; + this.buttonCancel.TabIndex = 3; this.buttonCancel.Text = "Cancel"; this.buttonCancel.UseVisualStyleBackColor = true; this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); @@ -198,35 +188,104 @@ // 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(240, 152); + this.buttonOK.Location = new System.Drawing.Point(144, 256); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(64, 24); - this.buttonOK.TabIndex = 10; + this.buttonOK.TabIndex = 2; this.buttonOK.Text = "OK"; this.buttonOK.UseVisualStyleBackColor = true; this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); // + // groupBoxTarget + // + this.groupBoxTarget.Controls.Add(this.radioButtonWindowTitle); + this.groupBoxTarget.Controls.Add(this.radioButtonClass); + this.groupBoxTarget.Controls.Add(this.radioButtonApplication); + this.groupBoxTarget.Controls.Add(this.radioButtonActiveWindow); + this.groupBoxTarget.Controls.Add(this.textBoxMsgTarget); + this.groupBoxTarget.Controls.Add(this.buttonFindMsgTarget); + this.groupBoxTarget.Location = new System.Drawing.Point(8, 8); + this.groupBoxTarget.Name = "groupBoxTarget"; + this.groupBoxTarget.Size = new System.Drawing.Size(272, 112); + this.groupBoxTarget.TabIndex = 0; + this.groupBoxTarget.TabStop = false; + this.groupBoxTarget.Text = "Target"; + // + // groupBoxDetails + // + this.groupBoxDetails.Controls.Add(this.labelMessage); + this.groupBoxDetails.Controls.Add(this.labelWParam); + this.groupBoxDetails.Controls.Add(this.labelLParam); + this.groupBoxDetails.Controls.Add(this.numericUpDownMsg); + this.groupBoxDetails.Controls.Add(this.numericUpDownWParam); + this.groupBoxDetails.Controls.Add(this.numericUpDownLParam); + this.groupBoxDetails.Location = new System.Drawing.Point(8, 128); + this.groupBoxDetails.Name = "groupBoxDetails"; + this.groupBoxDetails.Size = new System.Drawing.Size(272, 120); + this.groupBoxDetails.TabIndex = 1; + this.groupBoxDetails.TabStop = false; + this.groupBoxDetails.Text = "Message Details"; + // + // radioButtonActiveWindow + // + this.radioButtonActiveWindow.Location = new System.Drawing.Point(8, 24); + this.radioButtonActiveWindow.Name = "radioButtonActiveWindow"; + this.radioButtonActiveWindow.Size = new System.Drawing.Size(112, 16); + this.radioButtonActiveWindow.TabIndex = 0; + this.radioButtonActiveWindow.Text = "Active window"; + this.toolTip.SetToolTip(this.radioButtonActiveWindow, "Send the message to the active window"); + this.radioButtonActiveWindow.UseVisualStyleBackColor = true; + this.radioButtonActiveWindow.CheckedChanged += new System.EventHandler(this.radioButtonActiveWindow_CheckedChanged); + // + // radioButtonApplication + // + this.radioButtonApplication.Location = new System.Drawing.Point(152, 24); + this.radioButtonApplication.Name = "radioButtonApplication"; + this.radioButtonApplication.Size = new System.Drawing.Size(112, 16); + this.radioButtonApplication.TabIndex = 1; + this.radioButtonApplication.TabStop = true; + this.radioButtonApplication.Text = "Application"; + this.toolTip.SetToolTip(this.radioButtonApplication, "Send the message to the specified application"); + this.radioButtonApplication.UseVisualStyleBackColor = true; + this.radioButtonApplication.CheckedChanged += new System.EventHandler(this.radioButtonApplication_CheckedChanged); + // + // radioButtonClass + // + this.radioButtonClass.Location = new System.Drawing.Point(8, 48); + this.radioButtonClass.Name = "radioButtonClass"; + this.radioButtonClass.Size = new System.Drawing.Size(112, 16); + this.radioButtonClass.TabIndex = 2; + this.radioButtonClass.TabStop = true; + this.radioButtonClass.Text = "Class"; + this.toolTip.SetToolTip(this.radioButtonClass, "Send the message to the specified class"); + this.radioButtonClass.UseVisualStyleBackColor = true; + this.radioButtonClass.CheckedChanged += new System.EventHandler(this.radioButtonClass_CheckedChanged); + // + // radioButtonWindowTitle + // + this.radioButtonWindowTitle.Location = new System.Drawing.Point(152, 48); + this.radioButtonWindowTitle.Name = "radioButtonWindowTitle"; + this.radioButtonWindowTitle.Size = new System.Drawing.Size(112, 16); + this.radioButtonWindowTitle.TabIndex = 3; + this.radioButtonWindowTitle.TabStop = true; + this.radioButtonWindowTitle.Text = "Window title"; + this.toolTip.SetToolTip(this.radioButtonWindowTitle, "Send the message to the window with the specified title"); + this.radioButtonWindowTitle.UseVisualStyleBackColor = true; + this.radioButtonWindowTitle.CheckedChanged += new System.EventHandler(this.radioButtonWindowTitle_CheckedChanged); + // // MessageCommand // 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(384, 185); - this.Controls.Add(this.checkBoxMsgCurrApp); + this.ClientSize = new System.Drawing.Size(288, 288); + this.Controls.Add(this.groupBoxDetails); + this.Controls.Add(this.groupBoxTarget); this.Controls.Add(this.buttonCancel); this.Controls.Add(this.buttonOK); - this.Controls.Add(this.labelMsgApp); - this.Controls.Add(this.buttonFindMsgApp); - this.Controls.Add(this.textBoxMsgApp); - this.Controls.Add(this.numericUpDownLParam); - this.Controls.Add(this.numericUpDownWParam); - this.Controls.Add(this.numericUpDownMsg); - this.Controls.Add(this.labelLParam); - this.Controls.Add(this.labelWParam); - this.Controls.Add(this.labelMessage); this.MinimizeBox = false; - this.MinimumSize = new System.Drawing.Size(392, 212); + this.MinimumSize = new System.Drawing.Size(296, 322); this.Name = "MessageCommand"; this.ShowIcon = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; @@ -235,17 +294,17 @@ ((System.ComponentModel.ISupportInitialize)(this.numericUpDownWParam)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownMsg)).EndInit(); this.contextMenuStripWM.ResumeLayout(false); + this.groupBoxTarget.ResumeLayout(false); + this.groupBoxTarget.PerformLayout(); + this.groupBoxDetails.ResumeLayout(false); this.ResumeLayout(false); - this.PerformLayout(); } #endregion - private System.Windows.Forms.CheckBox checkBoxMsgCurrApp; - private System.Windows.Forms.Label labelMsgApp; - private System.Windows.Forms.Button buttonFindMsgApp; - private System.Windows.Forms.TextBox textBoxMsgApp; + private System.Windows.Forms.Button buttonFindMsgTarget; + private System.Windows.Forms.TextBox textBoxMsgTarget; private System.Windows.Forms.NumericUpDown numericUpDownLParam; private System.Windows.Forms.NumericUpDown numericUpDownWParam; private System.Windows.Forms.NumericUpDown numericUpDownMsg; @@ -257,6 +316,13 @@ private System.Windows.Forms.ContextMenuStrip contextMenuStripWM; private System.Windows.Forms.ToolStripMenuItem wMAPPToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem wMUSERToolStripMenuItem; + private System.Windows.Forms.GroupBox groupBoxTarget; + private System.Windows.Forms.GroupBox groupBoxDetails; + private System.Windows.Forms.ToolTip toolTip; + private System.Windows.Forms.RadioButton radioButtonActiveWindow; + private System.Windows.Forms.RadioButton radioButtonWindowTitle; + private System.Windows.Forms.RadioButton radioButtonClass; + private System.Windows.Forms.RadioButton radioButtonApplication; } } Modified: trunk/plugins/MCEReplacement/Forms/MessageCommand.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/MessageCommand.cs 2007-04-14 03:44:42 UTC (rev 326) +++ trunk/plugins/MCEReplacement/Forms/MessageCommand.cs 2007-04-14 04:44:03 UTC (rev 327) @@ -19,8 +19,29 @@ { get { - return string.Format("{0}|{1}|{2}|{3}", - checkBoxMsgCurrApp.Checked ? "*" : textBoxMsgApp.Text, + string target = "error"; + + if (radioButtonActiveWindow.Checked) + { + target = "active"; + textBoxMsgTarget.Text = "*"; + } + else if (radioButtonApplication.Checked) + { + target = "application"; + } + else if (radioButtonClass.Checked) + { + target = "class"; + } + else if (radioButtonWindowTitle.Checked) + { + target = "window"; + } + + return string.Format("{0}|{1}|{2}|{3}|{4}", + target, + textBoxMsgTarget.Text, numericUpDownMsg.Value.ToString(), numericUpDownWParam.Value.ToString(), numericUpDownLParam.Value.ToString()); @@ -31,27 +52,33 @@ #region Constructors - public MessageCommand() : this(null) { } + public MessageCommand() : this(new string[] { "active", "", "32768", "0", "0" }) { } public MessageCommand(string[] commands) { InitializeComponent(); if (commands != null) { - if (commands[0] == "*") + switch (commands[0].ToLowerInvariant()) { - checkBoxMsgCurrApp.Checked = true; - textBoxMsgApp.Text = ""; + case "active": + radioButtonActiveWindow.Checked = true; + break; + case "application": + radioButtonApplication.Checked = true; + break; + case "class": + radioButtonClass.Checked = true; + break; + case "window": + radioButtonWindowTitle.Checked = true; + break; } - else - { - checkBoxMsgCurrApp.Checked = false; - textBoxMsgApp.Text = commands[0]; - } - numericUpDownMsg.Value = decimal.Parse(commands[1]); - numericUpDownWParam.Value = decimal.Parse(commands[2]); - numericUpDownLParam.Value = decimal.Parse(commands[3]); + textBoxMsgTarget.Text = commands[1]; + numericUpDownMsg.Value = decimal.Parse(commands[2]); + numericUpDownWParam.Value = decimal.Parse(commands[3]); + numericUpDownLParam.Value = decimal.Parse(commands[4]); } } @@ -59,13 +86,24 @@ private void buttonFindMsgApp_Click(object sender, EventArgs e) { - OpenFileDialog find = new OpenFileDialog(); - find.Filter = "All files|*.*"; - find.Multiselect = false; - find.Title = "Application to send message to"; + if (radioButtonApplication.Checked) + { + OpenFileDialog find = new OpenFileDialog(); + find.Filter = "All files|*.*"; + find.Multiselect = false; + find.Title = "Application to send message to"; - if (find.ShowDialog(this) == DialogResult.OK) - textBoxMsgApp.Text = find.FileName; + if (find.ShowDialog(this) == DialogResult.OK) + textBoxMsgTarget.Text = find.FileName; + } + /* + else if (radioButtonClass.Checked) + { + } + else if (radioButtonWindowTitle.Checked) + { + } + */ } private void buttonOK_Click(object sender, EventArgs e) @@ -84,17 +122,31 @@ { numericUpDownMsg.Value = new decimal(Win32.WM_APP); } - private void wMUSERToolStripMenuItem_Click(object sender, EventArgs e) { numericUpDownMsg.Value = new decimal(Win32.WM_USER); } - private void checkBoxMsgCurrApp_CheckedChanged(object sender, EventArgs e) + private void radioButtonActiveWindow_CheckedChanged(object sender, EventArgs e) { - textBoxMsgApp.Enabled = !checkBoxMsgCurrApp.Checked; - buttonFindMsgApp.Enabled = !checkBoxMsgCurrApp.Checked; + buttonFindMsgTarget.Enabled = false; + textBoxMsgTarget.Enabled = false; } + private void radioButtonApplication_CheckedChanged(object sender, EventArgs e) + { + buttonFindMsgTarget.Enabled = true; + textBoxMsgTarget.Enabled = true; + } + private void radioButtonClass_CheckedChanged(object sender, EventArgs e) + { + buttonFindMsgTarget.Enabled = false; + textBoxMsgTarget.Enabled = true; + } + private void radioButtonWindowTitle_CheckedChanged(object sender, EventArgs e) + { + buttonFindMsgTarget.Enabled = false; + textBoxMsgTarget.Enabled = true; + } } Modified: trunk/plugins/MCEReplacement/Forms/MessageCommand.resx =================================================================== --- trunk/plugins/MCEReplacement/Forms/MessageCommand.resx 2007-04-14 03:44:42 UTC (rev 326) +++ trunk/plugins/MCEReplacement/Forms/MessageCommand.resx 2007-04-14 04:44:03 UTC (rev 327) @@ -117,7 +117,13 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> + <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>174, 17</value> + </metadata> <metadata name="contextMenuStripWM.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>17, 17</value> </metadata> + <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>174, 17</value> + </metadata> </root> \ No newline at end of file Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-04-14 03:44:42 UTC (rev 326) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-04-14 04:44:03 UTC (rev 327) @@ -52,7 +52,7 @@ public const string SetMapCommandPrefix = "Multi-Mapping: "; public const string SetMouseCommandPrefix = "Mouse Mode: "; public const string InputLayerCommand = "Toggle Input Layer"; - public const string WindowStateCommand = "Toggle Window State"; + //public const string WindowStateCommand = "Toggle Window State"; public const string GetFocusCommand = "Get Focus"; public const string ExitCommand = "Exit MediaPortal"; public const string StandByCommand = "Standby"; @@ -74,7 +74,7 @@ public const string MapMacroText = "MULTI_MAPPING"; public const string MouseMacroText = "MOUSE_MODE"; public const string InputLayerMacroText = "INPUT_LAYER"; - public const string WindowStateMacroText = "WINDOW_STATE"; + //public const string WindowStateMacroText = "WINDOW_STATE"; public const string GetFocusMacroText = "GET_FOCUS"; public const string ExitMacroText = "EXIT"; public const string StandbyMacroText = "STANDBY"; @@ -82,6 +82,27 @@ public const string RebootMacroText = "REBOOT"; public const string ShutdownMacroText = "SHUTDOWN"; + // English text for Macro commands + public const string RunProgramText = "Run Program"; + public const string PauseText = "Pause"; + public const string SerialCommandText = "Serial Command"; + public const string MessageCommandText = "Message Command"; + public const string KeystrokesCommandText = "Keystrokes Command"; + public const string GoToScreenText = "Go To Screen"; + public const string PopupMessageText = "Popup Message"; + public const string ForceBlasterPortText = "Force Blaster Port"; + public const string ForceBlasterSpeedText = "Force Blaster Speed"; + public const string SetMultiMappingText = "Set Multi-Mapping"; + public const string SetMouseModeText = "Set Mouse Mode"; + public const string ToggleInputLayerText = "Toggle Input Handler Layer"; + //public const string ChangeWindowStateText = "Change Window State"; + public const string GetFocusText = "Get Focus"; + public const string ExitCommandText = "Exit MediaPortal"; + public const string StandByCommandText = "Standby"; + public const string HibernateCommandText = "Hibernate"; + public const string RebootCommandText = "Reboot"; + public const string ShutdownCommandText = "Shutdown"; + public static readonly string AppDataFolder = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\MediaPortal MCE Replacement Plugin\\"; @@ -1697,7 +1718,7 @@ break; } - +/* case WindowStateMacroText: { if (InConfiguration) @@ -1714,7 +1735,7 @@ GUIWindowManager.SendMessage(msg); break; } - +*/ case GetFocusMacroText: { if (InConfiguration) @@ -2179,7 +2200,7 @@ string[] commands = messageCommand.Split(new char[] { '|' }, StringSplitOptions.None); - if (commands.Length != 4) + if (commands.Length != 5) { Log.Error("MCEReplacement: Message command structure is invalid: {0}", messageCommand); return null; @@ -2207,34 +2228,36 @@ { IntPtr windowHandle = IntPtr.Zero; - if (commands[0] == "*") + switch (commands[0].ToLowerInvariant()) { - windowHandle = Win32.GetForegroundWindow(); - } - else - { - foreach (Process proc in Process.GetProcesses()) - { - try + case "active": + windowHandle = Win32.GetForegroundWindow(); + break; + + case "application": + foreach (Process proc in Process.GetProcesses()) { - if (proc.MainModule.FileName == commands[0]) + try { - windowHandle = proc.MainWindowHandle; - break; + if (proc.MainModule.FileName == commands[1]) + { + windowHandle = proc.MainWindowHandle; + break; + } } + catch + { + } } - catch - { - } - } - - // if it wasn't an application, try a class - if (windowHandle == IntPtr.Zero) - windowHandle = Win32.FindWindow(commands[0], null); - - // if still not found, try window title - if (windowHandle == IntPtr.Zero) - windowHandle = Win32.FindWindow(null, commands[0]); + break; + + case "class": + windowHandle = Win32.FindWindow(commands[1], null); + break; + + case "window": + windowHandle = Win32.FindWindow(null, commands[1]); + break; } if (windowHandle == IntPtr.Zero) @@ -2243,14 +2266,14 @@ return false; } - int msg = int.Parse(commands[1]); - IntPtr wordParam = new IntPtr(int.Parse(commands[2])); - IntPtr longParam = new IntPtr(int.Parse(commands[3])); + int msg = int.Parse(commands[2]); + IntPtr wordParam = new IntPtr(int.Parse(commands[3])); + IntPtr longParam = new IntPtr(int.Parse(commands[4])); Win32.SendMessage(windowHandle, msg, wordParam, longParam); if (LogVerbose) - Log.Info("MCEReplacement: Message Sent({0}, {1}, {2}, {3})", commands[0], msg, wordParam, longParam); + Log.Info("MCEReplacement: Message Sent({0}, {1}, {2}, {3}, {4})", commands[0], commands[1], msg, wordParam, longParam); return true; } Modified: trunk/plugins/MCEReplacement/MCEReplacement.csproj =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.csproj 2007-04-14 03:44:42 UTC (rev 326) +++ trunk/plugins/MCEReplacement/MCEReplacement.csproj 2007-04-14 04:44:03 UTC (rev 327) @@ -167,11 +167,6 @@ <HintPath>..\..\MediaPortal\Dialogs\bin\Release\Dialogs.dll</HintPath> <Private>False</Private> </Reference> - <Reference Include="Microsoft.DirectX.Direct3D, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\MediaPortal\xbmc\bin\Release\Microsoft.DirectX.Direct3D.dll</HintPath> - <Private>False</Private> - </Reference> <Reference Include="RemotePlugins, Version=1.0.2581.1913, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\..\MediaPortal\RemotePlugins\bin\Release\RemotePlugins.dll</HintPath> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-04-25 05:00:39
|
Revision: 343 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=343&view=rev Author: and-81 Date: 2007-04-24 22:00:30 -0700 (Tue, 24 Apr 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/Forms/GoToScreen.Designer.cs trunk/plugins/MCEReplacement/MCEReplacement.cs Modified: trunk/plugins/MCEReplacement/Forms/GoToScreen.Designer.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/GoToScreen.Designer.cs 2007-04-19 14:45:34 UTC (rev 342) +++ trunk/plugins/MCEReplacement/Forms/GoToScreen.Designer.cs 2007-04-25 05:00:30 UTC (rev 343) @@ -38,17 +38,18 @@ // this.comboBoxScreen.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.comboBoxScreen.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxScreen.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; + this.comboBoxScreen.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; this.comboBoxScreen.FormattingEnabled = true; this.comboBoxScreen.Location = new System.Drawing.Point(8, 24); this.comboBoxScreen.Name = "comboBoxScreen"; - this.comboBoxScreen.Size = new System.Drawing.Size(280, 21); + this.comboBoxScreen.Size = new System.Drawing.Size(248, 21); this.comboBoxScreen.TabIndex = 0; // // 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(152, 56); + this.buttonOK.Location = new System.Drawing.Point(120, 56); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(64, 24); this.buttonOK.TabIndex = 1; @@ -60,7 +61,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(224, 56); + this.buttonCancel.Location = new System.Drawing.Point(192, 56); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(64, 24); this.buttonCancel.TabIndex = 2; @@ -74,7 +75,7 @@ | System.Windows.Forms.AnchorStyles.Right))); this.labelScreen.Location = new System.Drawing.Point(8, 8); this.labelScreen.Name = "labelScreen"; - this.labelScreen.Size = new System.Drawing.Size(280, 16); + this.labelScreen.Size = new System.Drawing.Size(248, 16); this.labelScreen.TabIndex = 3; this.labelScreen.Text = "Screen:"; // @@ -84,14 +85,14 @@ 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(296, 89); + this.ClientSize = new System.Drawing.Size(264, 89); this.Controls.Add(this.labelScreen); this.Controls.Add(this.buttonCancel); this.Controls.Add(this.buttonOK); this.Controls.Add(this.comboBoxScreen); this.MaximizeBox = false; this.MinimizeBox = false; - this.MinimumSize = new System.Drawing.Size(270, 116); + this.MinimumSize = new System.Drawing.Size(272, 123); this.Name = "GoToScreen"; this.ShowIcon = false; this.ShowInTaskbar = false; Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-04-19 14:45:34 UTC (rev 342) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-04-25 05:00:30 UTC (rev 343) @@ -38,7 +38,7 @@ public const string IRExtension = ".IR"; public const string MacroExtension = ".MACRO"; - // Plugin Commands + // Macro Commands public const string RunCommandPrefix = "Run: "; public const string BlastCommandPrefix = "Blast: "; public const string PauseCommandPrefix = "Pause: "; @@ -412,7 +412,6 @@ if (LogVerbose) Log.Info("MCEReplacement: Started"); } - public void Stop() { if (LogVerbose) @@ -2160,27 +2159,6 @@ return ProcessGoTo(command.Substring(GoToCommandPrefix.Length)); } - - - - - /* - public const string SetMapCommandPrefix = "Multi-Mapping: "; - public const string SetMouseCommandPrefix = "Mouse Mode: "; - public const string InputLayerCommand = "Toggle Input Layer"; - public const string WindowStateCommand = "Toggle Window State"; - public const string GetFocusCommand = "Get Focus"; - - public const string ExitCommand = "Exit MediaPortal"; -public const string StandByCommand = "Standby"; -public const string HibernateCommand = "Hibernate"; -public const string RebootCommand = "Reboot"; -public const string ShutdownCommand = "Shutdown"; - */ - - - - Log.Error("MCEReplacement: Unprocessed command \"{0}\"", command); return false; } @@ -2323,16 +2301,41 @@ try { - GUIWindow.Window window = (GUIWindow.Window)Enum.Parse(typeof(GUIWindow.Window), "WINDOW_" + screen); + int window = (int)GUIWindow.Window.WINDOW_INVALID; - if (window == GUIWindow.Window.WINDOW_HOME && MP_BasicHome) - window = GUIWindow.Window.WINDOW_SECOND_HOME; + try + { + window = (int)Enum.Parse(typeof(GUIWindow.Window), "WINDOW_" + screen); + } + catch + { + // Parsing the window id as a GUIWindow.Window failed, so parse it as an int + } + try + { + if (window == (int)GUIWindow.Window.WINDOW_INVALID) + window = Convert.ToInt32(screen); + } + catch + { + // Parsing the window id as an int failed, give up. + } + + if (window == (int)GUIWindow.Window.WINDOW_INVALID) + { + Log.Error("MCEReplacement: Failed to parse Goto command window id \"{0}\"", screen); + return false; + } + + if (window == (int)GUIWindow.Window.WINDOW_HOME && MP_BasicHome) + window = (int)GUIWindow.Window.WINDOW_SECOND_HOME; + if (LogVerbose) - Log.Info("MCEReplacement: Go To Window \"{0}\"", Enum.GetName(typeof(GUIWindow.Window), window)); + Log.Info("MCEReplacement: Go To Window \"{0}\"", window); GUIGraphicsContext.ResetLastActivity(); - GUIWindowManager.SendThreadMessage(new GUIMessage(GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW, 0, 0, 0, (int)window, 0, null)); + GUIWindowManager.SendThreadMessage(new GUIMessage(GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW, 0, 0, 0, window, 0, null)); } catch (Exception ex) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-09-28 16:34:16
|
Revision: 960 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=960&view=rev Author: and-81 Date: 2007-09-28 09:34:14 -0700 (Fri, 28 Sep 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs trunk/plugins/MCEReplacement/Forms/ExternalChannels.designer.cs trunk/plugins/MCEReplacement/Forms/LearnIR.Designer.cs trunk/plugins/MCEReplacement/Forms/LearnIR.cs trunk/plugins/MCEReplacement/Forms/MacroEditor.Designer.cs trunk/plugins/MCEReplacement/Forms/MacroEditor.cs trunk/plugins/MCEReplacement/Forms/MultiMapNameBox.cs trunk/plugins/MCEReplacement/Forms/SetupForm.Designer.cs trunk/plugins/MCEReplacement/Forms/SetupForm.cs trunk/plugins/MCEReplacement/Forms/SetupForm.resx trunk/plugins/MCEReplacement/Forms/StbSetup.Designer.cs trunk/plugins/MCEReplacement/Forms/StbSetup.cs trunk/plugins/MCEReplacement/InputMapper/InputHandler.cs trunk/plugins/MCEReplacement/InputMapper/InputMappingForm.cs trunk/plugins/MCEReplacement/MCEReplacement.cs trunk/plugins/MCEReplacement/MCEReplacement.csproj trunk/plugins/MCEReplacement/MappedEvent.cs Added Paths: ----------- trunk/plugins/MCEReplacement/Properties/ trunk/plugins/MCEReplacement/Properties/AssemblyInfo.cs Removed Paths: ------------- trunk/plugins/MCEReplacement/AssemblyInfo.cs trunk/plugins/MCEReplacement/ExternalChannelConfig.cs trunk/plugins/MCEReplacement/Forms/ExternalProgram.Designer.cs trunk/plugins/MCEReplacement/Forms/ExternalProgram.cs trunk/plugins/MCEReplacement/Forms/ExternalProgram.resx trunk/plugins/MCEReplacement/Forms/GoToScreen.Designer.cs trunk/plugins/MCEReplacement/Forms/GoToScreen.cs trunk/plugins/MCEReplacement/Forms/GoToScreen.resx trunk/plugins/MCEReplacement/Forms/KeysCommand.Designer.cs trunk/plugins/MCEReplacement/Forms/KeysCommand.cs trunk/plugins/MCEReplacement/Forms/KeysCommand.resx trunk/plugins/MCEReplacement/Forms/MessageCommand.Designer.cs trunk/plugins/MCEReplacement/Forms/MessageCommand.cs trunk/plugins/MCEReplacement/Forms/MessageCommand.resx trunk/plugins/MCEReplacement/Forms/PauseTime.Designer.cs trunk/plugins/MCEReplacement/Forms/PauseTime.cs trunk/plugins/MCEReplacement/Forms/PauseTime.resx trunk/plugins/MCEReplacement/Forms/PopupMessage.Designer.cs trunk/plugins/MCEReplacement/Forms/PopupMessage.cs trunk/plugins/MCEReplacement/Forms/PopupMessage.resx trunk/plugins/MCEReplacement/Forms/SelectBlasterPort.Designer.cs trunk/plugins/MCEReplacement/Forms/SelectBlasterPort.cs trunk/plugins/MCEReplacement/Forms/SelectBlasterPort.resx trunk/plugins/MCEReplacement/Forms/SelectBlasterSpeed.Designer.cs trunk/plugins/MCEReplacement/Forms/SelectBlasterSpeed.cs trunk/plugins/MCEReplacement/Forms/SelectBlasterSpeed.resx trunk/plugins/MCEReplacement/Forms/SerialCommand.Designer.cs trunk/plugins/MCEReplacement/Forms/SerialCommand.cs trunk/plugins/MCEReplacement/Forms/SerialCommand.resx trunk/plugins/MCEReplacement/MceIrApi.cs trunk/plugins/MCEReplacement/Mouse.cs trunk/plugins/MCEReplacement/Util.cs trunk/plugins/MCEReplacement/Win32.cs Deleted: trunk/plugins/MCEReplacement/AssemblyInfo.cs =================================================================== --- trunk/plugins/MCEReplacement/AssemblyInfo.cs 2007-09-28 16:31:49 UTC (rev 959) +++ trunk/plugins/MCEReplacement/AssemblyInfo.cs 2007-09-28 16:34:14 UTC (rev 960) @@ -1,71 +0,0 @@ -using System; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Security.Permissions; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("MCE Replacement Plugin")] -[assembly: AssemblyDescription("Replaces MediaPortal's native MCE remote control support")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("and-81")] -[assembly: AssemblyProduct("MediaPortal")] -[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.3.2")] -[assembly: AssemblyFileVersionAttribute("1.0.3.2")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\<setupForm>. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("")] -[assembly: AssemblyKeyName("")] - -[assembly: CLSCompliant(true)] - -[assembly: SecurityPermission(SecurityAction.RequestMinimum, UnmanagedCode = true)] Deleted: trunk/plugins/MCEReplacement/ExternalChannelConfig.cs =================================================================== --- trunk/plugins/MCEReplacement/ExternalChannelConfig.cs 2007-09-28 16:31:49 UTC (rev 959) +++ trunk/plugins/MCEReplacement/ExternalChannelConfig.cs 2007-09-28 16:34:14 UTC (rev 960) @@ -1,204 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Xml; - -using MediaPortal.GUI.Library; - -namespace MediaPortal.Plugins -{ - - public class ExternalChannelConfig - { - - #region Variables - - string _fileName; - - int _pauseTime = 250; - bool _sendSelect = false; - MceIrApi.BlasterPort _extBlastPort = MceIrApi.BlasterPort.Both; - MceIrApi.BlasterSpeed _extBlastSpeed = MceIrApi.BlasterSpeed.Medium; - bool _doubleChannelSelect = false; - int _repeatChannelCommands = 0; - int _channelDigits = 0; - int _repeatPauseTime = 1000; - bool _usePreChangeCommand = false; - - string _selectCommand = ""; - string _preChangeCommand = ""; - string[] _digits = new string[10]; - - #endregion Variables - - #region Properties - - public string FileName - { - get { return _fileName; } - } - - public int PauseTime - { - get { return _pauseTime; } - set { _pauseTime = value; } - } - public bool SendSelect - { - get { return _sendSelect; } - set { _sendSelect = value; } - } - public MceIrApi.BlasterPort ExtBlastPort - { - get { return _extBlastPort; } - set { _extBlastPort = value; } - } - public MceIrApi.BlasterSpeed ExtBlastSpeed - { - get { return _extBlastSpeed; } - set { _extBlastSpeed = value; } - } - public bool DoubleChannelSelect - { - get { return _doubleChannelSelect; } - set { _doubleChannelSelect = value; } - } - public int RepeatChannelCommands - { - get { return _repeatChannelCommands; } - set { _repeatChannelCommands = value; } - } - public int ChannelDigits - { - get { return _channelDigits; } - set { _channelDigits = value; } - } - public int RepeatPauseTime - { - get { return _repeatPauseTime; } - set { _repeatPauseTime = value; } - } - public bool UsePreChangeCommand - { - get { return _usePreChangeCommand; } - set { _usePreChangeCommand = value; } - } - - public string[] Digits - { - get { return _digits; } - set { _digits = value; } - } - public string SelectCommand - { - get { return _selectCommand; } - set { _selectCommand = value; } - } - public string PreChangeCommand - { - get { return _preChangeCommand; } - set { _preChangeCommand = value; } - } - - #endregion Properties - - #region Constructor - - public ExternalChannelConfig(string fileName) - { - _fileName = fileName; - - if (!File.Exists(_fileName)) - { - for (int i = 0; i < 10; i++) - Digits[i] = ""; - - return; - } - - FileStream file = null; - - try - { - file = new FileStream(_fileName, FileMode.Open, FileAccess.Read, FileShare.Read); - - XmlDocument doc = new XmlDocument(); - doc.Load(file); - - XmlNodeList nodeList = doc.DocumentElement.ChildNodes; - - PauseTime = Util.GetXmlInt(nodeList, "PauseTime", PauseTime); - UsePreChangeCommand = Util.GetXmlBool(nodeList, "UsePreChangeCommand", UsePreChangeCommand); - SendSelect = Util.GetXmlBool(nodeList, "SendSelect", SendSelect); - DoubleChannelSelect = Util.GetXmlBool(nodeList, "DoubleChannelSelect", DoubleChannelSelect); - ExtBlastPort = (MceIrApi.BlasterPort)Util.GetXmlInt(nodeList, "ExtBlastPort", (int)ExtBlastPort); - ExtBlastSpeed = (MceIrApi.BlasterSpeed)Util.GetXmlInt(nodeList, "ExtBlastSpeed", (int)ExtBlastSpeed); - RepeatChannelCommands = Util.GetXmlInt(nodeList, "RepeatChannelCommands", RepeatChannelCommands); - ChannelDigits = Util.GetXmlInt(nodeList, "ChannelDigits", ChannelDigits); - RepeatPauseTime = Util.GetXmlInt(nodeList, "RepeatDelay", RepeatPauseTime); - - SelectCommand = Util.GetXmlString(nodeList, "SelectCommand", SelectCommand); - PreChangeCommand = Util.GetXmlString(nodeList, "PreChangeCommand", PreChangeCommand); - - for (int i = 0; i < 10; i++) - Digits[i] = Util.GetXmlString(nodeList, "Digit" + i.ToString(), ""); - } - catch (Exception ex) - { - Log.Error("MCEReplacement: ExternalChannelConfig() {0}", ex.Message); - } - - if (file != null) - file.Close(); - } - - #endregion Constructor - - public void SaveExternalChannelConfig() - { - FileStream file = null; - - try - { - file = new FileStream(_fileName, FileMode.Create, FileAccess.Write, FileShare.Read); - - XmlTextWriter writer = new XmlTextWriter(file, System.Text.Encoding.UTF8); - writer.Formatting = Formatting.Indented; - writer.Indentation = 1; - writer.IndentChar = (char)9; - writer.WriteStartDocument(true); - writer.WriteStartElement("config"); // <config> - - writer.WriteElementString("PauseTime", PauseTime.ToString()); - writer.WriteElementString("UsePreChangeCommand", UsePreChangeCommand.ToString()); - writer.WriteElementString("SendSelect", SendSelect.ToString()); - writer.WriteElementString("DoubleChannelSelect", DoubleChannelSelect.ToString()); - writer.WriteElementString("ChannelDigits", ChannelDigits.ToString()); - writer.WriteElementString("ExtBlastPort", ((int)ExtBlastPort).ToString()); - writer.WriteElementString("ExtBlastSpeed", ((int)ExtBlastSpeed).ToString()); - writer.WriteElementString("RepeatChannelCommands", RepeatChannelCommands.ToString()); - writer.WriteElementString("RepeatDelay", RepeatPauseTime.ToString()); - - writer.WriteElementString("SelectCommand", SelectCommand); - writer.WriteElementString("PreChangeCommand", PreChangeCommand); - - for (int i = 0; i < 10; i++) - writer.WriteElementString("Digit" + i.ToString(), Digits[i]); - - writer.WriteEndElement(); // </config> - writer.WriteEndDocument(); - writer.Close(); - } - catch (Exception ex) - { - Log.Error("MCEReplacement: SaveExternalChannelConfig() {0}", ex.Message); - } - - if (file != null) - file.Close(); - } - - } - -} Modified: trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs 2007-09-28 16:31:49 UTC (rev 959) +++ trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs 2007-09-28 16:34:14 UTC (rev 960) @@ -11,10 +11,14 @@ using System.Windows.Forms; using System.Xml; +using IrssUtils; +using MPUtils; +using MPUtils.Forms; + namespace MediaPortal.Plugins { - public partial class ExternalChannels : Form + partial class ExternalChannels : Form { #region Variables @@ -72,33 +76,24 @@ comboBoxQuickSetup.Items.Add("Clear all"); } - static bool ProcessExternalChannelProgram(string runCommand, int currentChannelDigit, string fullChannelString, MceIrApi.BlasterPort blasterPort) + static void ProcessExternalChannelProgram(string runCommand, int currentChannelDigit, string fullChannelString) { - string[] commands = MCEReplacement.SplitRunCommand(runCommand); + string[] commands = Common.SplitRunCommand(runCommand); - if (commands == null) - return false; - commands[2] = commands[2].Replace("%1", currentChannelDigit.ToString()); commands[2] = commands[2].Replace("%2", fullChannelString); - commands[2] = commands[2].Replace("%3", ((int)blasterPort).ToString()); - return MCEReplacement.ProcessRunCommand(commands); + Common.ProcessRunCommand(commands); } - static bool ProcessSerialCommand(string serialCommand, int currentChannelDigit, string fullChannelString, MceIrApi.BlasterPort blasterPort) + static void ProcessSerialCommand(string serialCommand, int currentChannelDigit, string fullChannelString) { - string[] commands = MCEReplacement.SplitSerialCommand(serialCommand); + string[] commands = Common.SplitSerialCommand(serialCommand); - if (commands == null) - return false; - commands[0] = commands[0].Replace("%1", currentChannelDigit.ToString()); commands[0] = commands[0].Replace("%2", fullChannelString); - commands[0] = commands[0].Replace("%3", ((int)blasterPort).ToString()); - return MCEReplacement.ProcessSerialCommand(commands); - + Common.ProcessSerialCommand(commands); } #region Buttons @@ -109,7 +104,7 @@ setup.Save(); foreach (ExternalChannelConfig config in MCEReplacement.ExternalChannelConfigs) - config.SaveExternalChannelConfig(); + config.Save(); this.DialogResult = DialogResult.OK; this.Close(); @@ -152,15 +147,15 @@ if (setup.UsePreChangeCommand && !String.IsNullOrEmpty(setup.PreChangeCommand)) { - if (setup.PreChangeCommand.StartsWith(MCEReplacement.RunCommandPrefix)) - ProcessExternalChannelProgram(setup.PreChangeCommand.Substring(MCEReplacement.RunCommandPrefix.Length), -1, channel, setup.ExtBlastPort); - else if (setup.PreChangeCommand.StartsWith(MCEReplacement.SerialCommandPrefix)) - ProcessSerialCommand(setup.PreChangeCommand.Substring(MCEReplacement.SerialCommandPrefix.Length), -1, channel, setup.ExtBlastPort); + if (setup.PreChangeCommand.StartsWith(Common.CmdPrefixRun)) + ProcessExternalChannelProgram(setup.PreChangeCommand.Substring(Common.CmdPrefixRun.Length), -1, channel); + else if (setup.PreChangeCommand.StartsWith(Common.CmdPrefixSerial)) + ProcessSerialCommand(setup.PreChangeCommand.Substring(Common.CmdPrefixSerial.Length), -1, channel); else - MCEReplacement.ProcessCommand(setup.PreChangeCommand, setup.ExtBlastPort, setup.ExtBlastSpeed); + MCEReplacement.ProcessCommand(setup.PreChangeCommand); if (setup.PauseTime > 0) - Thread.Sleep(setup.PauseTime); + Thread.Sleep(setup.PauseTime); } foreach (char digit in channel) @@ -170,54 +165,54 @@ command = setup.Digits[charVal]; if (!String.IsNullOrEmpty(command)) { - if (command.StartsWith(MCEReplacement.RunCommandPrefix)) - ProcessExternalChannelProgram(command.Substring(MCEReplacement.RunCommandPrefix.Length), charVal, channel, setup.ExtBlastPort); - else if (command.StartsWith(MCEReplacement.SerialCommandPrefix)) - ProcessSerialCommand(command.Substring(MCEReplacement.SerialCommandPrefix.Length), charVal, channel, setup.ExtBlastPort); + if (command.StartsWith(Common.CmdPrefixRun)) + ProcessExternalChannelProgram(command.Substring(Common.CmdPrefixRun.Length), charVal, channel); + else if (command.StartsWith(Common.CmdPrefixSerial)) + ProcessSerialCommand(command.Substring(Common.CmdPrefixSerial.Length), charVal, channel); else - MCEReplacement.ProcessCommand(command, setup.ExtBlastPort, setup.ExtBlastSpeed); + MCEReplacement.ProcessCommand(command); if (setup.PauseTime > 0) - Thread.Sleep(setup.PauseTime); + Thread.Sleep(setup.PauseTime); } } if (setup.SendSelect && !String.IsNullOrEmpty(setup.SelectCommand)) { - if (setup.SelectCommand.StartsWith(MCEReplacement.RunCommandPrefix)) + if (setup.SelectCommand.StartsWith(Common.CmdPrefixRun)) { - ProcessExternalChannelProgram(setup.SelectCommand.Substring(MCEReplacement.RunCommandPrefix.Length), -1, channel, setup.ExtBlastPort); + ProcessExternalChannelProgram(setup.SelectCommand.Substring(Common.CmdPrefixRun.Length), -1, channel); if (setup.DoubleChannelSelect) { if (setup.PauseTime > 0) Thread.Sleep(setup.PauseTime); - ProcessExternalChannelProgram(setup.SelectCommand.Substring(MCEReplacement.RunCommandPrefix.Length), -1, channel, setup.ExtBlastPort); + ProcessExternalChannelProgram(setup.SelectCommand.Substring(Common.CmdPrefixRun.Length), -1, channel); } } - else if (setup.SelectCommand.StartsWith(MCEReplacement.SerialCommandPrefix)) + else if (setup.SelectCommand.StartsWith(Common.CmdPrefixSerial)) { - ProcessSerialCommand(setup.SelectCommand.Substring(MCEReplacement.SerialCommandPrefix.Length), -1, channel, setup.ExtBlastPort); + ProcessSerialCommand(setup.SelectCommand.Substring(Common.CmdPrefixSerial.Length), -1, channel); if (setup.DoubleChannelSelect) { if (setup.PauseTime > 0) Thread.Sleep(setup.PauseTime); - ProcessSerialCommand(setup.SelectCommand.Substring(MCEReplacement.SerialCommandPrefix.Length), -1, channel, setup.ExtBlastPort); + ProcessSerialCommand(setup.SelectCommand.Substring(Common.CmdPrefixSerial.Length), -1, channel); } } else { - MCEReplacement.ProcessCommand(setup.SelectCommand, setup.ExtBlastPort, setup.ExtBlastSpeed); + MCEReplacement.ProcessCommand(setup.SelectCommand); if (setup.DoubleChannelSelect) { if (setup.PauseTime > 0) Thread.Sleep(setup.PauseTime); - MCEReplacement.ProcessCommand(setup.SelectCommand, setup.ExtBlastPort, setup.ExtBlastSpeed); + MCEReplacement.ProcessCommand(setup.SelectCommand); } } } Modified: trunk/plugins/MCEReplacement/Forms/ExternalChannels.designer.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/ExternalChannels.designer.cs 2007-09-28 16:31:49 UTC (rev 959) +++ trunk/plugins/MCEReplacement/Forms/ExternalChannels.designer.cs 2007-09-28 16:34:14 UTC (rev 960) @@ -203,7 +203,6 @@ this.MinimumSize = new System.Drawing.Size(536, 466); this.Name = "ExternalChannels"; this.ShowIcon = false; - this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "External Channel Changing"; this.Load += new System.EventHandler(this.ExternalChannels_Load); Deleted: trunk/plugins/MCEReplacement/Forms/ExternalProgram.Designer.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/ExternalProgram.Designer.cs 2007-09-28 16:31:49 UTC (rev 959) +++ trunk/plugins/MCEReplacement/Forms/ExternalProgram.Designer.cs 2007-09-28 16:34:14 UTC (rev 960) @@ -1,294 +0,0 @@ -namespace MediaPortal.Plugins -{ - partial class ExternalProgram - { - /// <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.textBoxProgram = new System.Windows.Forms.TextBox(); - this.labelProgram = new System.Windows.Forms.Label(); - this.buttonProgam = new System.Windows.Forms.Button(); - this.buttonStartup = new System.Windows.Forms.Button(); - this.labelStartup = new System.Windows.Forms.Label(); - this.textBoxStartup = new System.Windows.Forms.TextBox(); - this.buttonOK = new System.Windows.Forms.Button(); - this.buttonCancel = new System.Windows.Forms.Button(); - this.labelParameters = new System.Windows.Forms.Label(); - this.textBoxParameters = new System.Windows.Forms.TextBox(); - this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); - this.folderBrowserDialog = new System.Windows.Forms.FolderBrowserDialog(); - this.buttonParamQuestion = new System.Windows.Forms.Button(); - this.checkBoxShellExecute = new System.Windows.Forms.CheckBox(); - this.buttonTest = new System.Windows.Forms.Button(); - this.checkBoxNoWindow = new System.Windows.Forms.CheckBox(); - this.checkBoxWaitForExit = new System.Windows.Forms.CheckBox(); - this.comboBoxWindowStyle = new System.Windows.Forms.ComboBox(); - this.labelWindowStyle = new System.Windows.Forms.Label(); - this.SuspendLayout(); - // - // textBoxProgram - // - this.textBoxProgram.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxProgram.Location = new System.Drawing.Point(8, 24); - this.textBoxProgram.Name = "textBoxProgram"; - this.textBoxProgram.Size = new System.Drawing.Size(288, 20); - this.textBoxProgram.TabIndex = 1; - // - // labelProgram - // - this.labelProgram.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.labelProgram.Location = new System.Drawing.Point(8, 8); - this.labelProgram.Name = "labelProgram"; - this.labelProgram.Size = new System.Drawing.Size(288, 16); - this.labelProgram.TabIndex = 0; - this.labelProgram.Text = "Program:"; - this.labelProgram.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // buttonProgam - // - this.buttonProgam.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonProgam.Location = new System.Drawing.Point(304, 24); - this.buttonProgam.Name = "buttonProgam"; - this.buttonProgam.Size = new System.Drawing.Size(24, 20); - this.buttonProgam.TabIndex = 2; - this.buttonProgam.Text = "..."; - this.buttonProgam.UseVisualStyleBackColor = true; - this.buttonProgam.Click += new System.EventHandler(this.buttonProgam_Click); - // - // buttonStartup - // - this.buttonStartup.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonStartup.Location = new System.Drawing.Point(304, 72); - this.buttonStartup.Name = "buttonStartup"; - this.buttonStartup.Size = new System.Drawing.Size(24, 20); - this.buttonStartup.TabIndex = 5; - this.buttonStartup.Text = "..."; - this.buttonStartup.UseVisualStyleBackColor = true; - this.buttonStartup.Click += new System.EventHandler(this.buttonStartup_Click); - // - // labelStartup - // - this.labelStartup.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.labelStartup.Location = new System.Drawing.Point(8, 56); - this.labelStartup.Name = "labelStartup"; - this.labelStartup.Size = new System.Drawing.Size(288, 16); - this.labelStartup.TabIndex = 3; - this.labelStartup.Text = "Start in folder:"; - this.labelStartup.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // textBoxStartup - // - this.textBoxStartup.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxStartup.Location = new System.Drawing.Point(8, 72); - this.textBoxStartup.Name = "textBoxStartup"; - this.textBoxStartup.Size = new System.Drawing.Size(288, 20); - this.textBoxStartup.TabIndex = 4; - // - // 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(208, 216); - this.buttonOK.Name = "buttonOK"; - this.buttonOK.Size = new System.Drawing.Size(56, 24); - this.buttonOK.TabIndex = 15; - 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(272, 216); - this.buttonCancel.Name = "buttonCancel"; - this.buttonCancel.Size = new System.Drawing.Size(56, 24); - this.buttonCancel.TabIndex = 16; - this.buttonCancel.Text = "Cancel"; - this.buttonCancel.UseVisualStyleBackColor = true; - this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); - // - // labelParameters - // - this.labelParameters.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.labelParameters.Location = new System.Drawing.Point(8, 104); - this.labelParameters.Name = "labelParameters"; - this.labelParameters.Size = new System.Drawing.Size(288, 16); - this.labelParameters.TabIndex = 6; - this.labelParameters.Text = "Parameters:"; - this.labelParameters.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // textBoxParameters - // - this.textBoxParameters.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxParameters.Location = new System.Drawing.Point(8, 120); - this.textBoxParameters.Name = "textBoxParameters"; - this.textBoxParameters.Size = new System.Drawing.Size(288, 20); - this.textBoxParameters.TabIndex = 7; - // - // openFileDialog - // - this.openFileDialog.Filter = "All files|*.*"; - this.openFileDialog.Title = "Select Program Executable"; - // - // folderBrowserDialog - // - this.folderBrowserDialog.Description = "Select the startup folder for the program to run from"; - // - // buttonParamQuestion - // - this.buttonParamQuestion.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonParamQuestion.Location = new System.Drawing.Point(304, 120); - this.buttonParamQuestion.Name = "buttonParamQuestion"; - this.buttonParamQuestion.Size = new System.Drawing.Size(24, 20); - this.buttonParamQuestion.TabIndex = 8; - this.buttonParamQuestion.Text = "?"; - this.buttonParamQuestion.UseVisualStyleBackColor = true; - this.buttonParamQuestion.Click += new System.EventHandler(this.buttonParamQuestion_Click); - // - // checkBoxShellExecute - // - this.checkBoxShellExecute.Location = new System.Drawing.Point(8, 184); - this.checkBoxShellExecute.Name = "checkBoxShellExecute"; - this.checkBoxShellExecute.Size = new System.Drawing.Size(184, 21); - this.checkBoxShellExecute.TabIndex = 12; - this.checkBoxShellExecute.Text = "Start using ShellExecute"; - this.checkBoxShellExecute.UseVisualStyleBackColor = true; - // - // 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, 216); - this.buttonTest.Name = "buttonTest"; - this.buttonTest.Size = new System.Drawing.Size(56, 24); - this.buttonTest.TabIndex = 14; - this.buttonTest.Text = "Test"; - this.buttonTest.UseVisualStyleBackColor = true; - this.buttonTest.Click += new System.EventHandler(this.buttonTest_Click); - // - // checkBoxNoWindow - // - this.checkBoxNoWindow.Location = new System.Drawing.Point(208, 152); - this.checkBoxNoWindow.Name = "checkBoxNoWindow"; - this.checkBoxNoWindow.Size = new System.Drawing.Size(104, 21); - this.checkBoxNoWindow.TabIndex = 11; - this.checkBoxNoWindow.Text = "No window"; - this.checkBoxNoWindow.UseVisualStyleBackColor = true; - // - // checkBoxWaitForExit - // - this.checkBoxWaitForExit.Location = new System.Drawing.Point(208, 184); - this.checkBoxWaitForExit.Name = "checkBoxWaitForExit"; - this.checkBoxWaitForExit.Size = new System.Drawing.Size(104, 21); - this.checkBoxWaitForExit.TabIndex = 13; - this.checkBoxWaitForExit.Text = "Wait for exit"; - this.checkBoxWaitForExit.UseVisualStyleBackColor = true; - // - // comboBoxWindowStyle - // - this.comboBoxWindowStyle.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.comboBoxWindowStyle.FormattingEnabled = true; - this.comboBoxWindowStyle.Location = new System.Drawing.Point(104, 152); - this.comboBoxWindowStyle.MaxDropDownItems = 4; - this.comboBoxWindowStyle.Name = "comboBoxWindowStyle"; - this.comboBoxWindowStyle.Size = new System.Drawing.Size(88, 21); - this.comboBoxWindowStyle.TabIndex = 10; - // - // labelWindowStyle - // - this.labelWindowStyle.Location = new System.Drawing.Point(8, 152); - this.labelWindowStyle.Name = "labelWindowStyle"; - this.labelWindowStyle.Size = new System.Drawing.Size(96, 21); - this.labelWindowStyle.TabIndex = 9; - this.labelWindowStyle.Text = "Window Style:"; - this.labelWindowStyle.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // ExternalProgram - // - 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(336, 249); - this.Controls.Add(this.checkBoxNoWindow); - this.Controls.Add(this.checkBoxWaitForExit); - this.Controls.Add(this.comboBoxWindowStyle); - this.Controls.Add(this.labelWindowStyle); - this.Controls.Add(this.buttonTest); - this.Controls.Add(this.checkBoxShellExecute); - this.Controls.Add(this.buttonParamQuestion); - this.Controls.Add(this.labelParameters); - this.Controls.Add(this.textBoxParameters); - this.Controls.Add(this.buttonCancel); - this.Controls.Add(this.buttonOK); - this.Controls.Add(this.buttonStartup); - this.Controls.Add(this.labelStartup); - this.Controls.Add(this.textBoxStartup); - this.Controls.Add(this.buttonProgam); - this.Controls.Add(this.labelProgram); - this.Controls.Add(this.textBoxProgram); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.MinimumSize = new System.Drawing.Size(344, 276); - this.Name = "ExternalProgram"; - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "External Program Details"; - this.Load += new System.EventHandler(this.ExternalProgram_Load); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.TextBox textBoxProgram; - private System.Windows.Forms.Label labelProgram; - private System.Windows.Forms.Button buttonProgam; - private System.Windows.Forms.Button buttonStartup; - private System.Windows.Forms.Label labelStartup; - private System.Windows.Forms.TextBox textBoxStartup; - private System.Windows.Forms.Button buttonOK; - private System.Windows.Forms.Button buttonCancel; - private System.Windows.Forms.Label labelParameters; - private System.Windows.Forms.TextBox textBoxParameters; - private System.Windows.Forms.OpenFileDialog openFileDialog; - private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog; - private System.Windows.Forms.Button buttonParamQuestion; - private System.Windows.Forms.CheckBox checkBoxShellExecute; - private System.Windows.Forms.Button buttonTest; - private System.Windows.Forms.CheckBox checkBoxNoWindow; - private System.Windows.Forms.CheckBox checkBoxWaitForExit; - private System.Windows.Forms.ComboBox comboBoxWindowStyle; - private System.Windows.Forms.Label labelWindowStyle; - } -} \ No newline at end of file Deleted: trunk/plugins/MCEReplacement/Forms/ExternalProgram.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/ExternalProgram.cs 2007-09-28 16:31:49 UTC (rev 959) +++ trunk/plugins/MCEReplacement/Forms/ExternalProgram.cs 2007-09-28 16:34:14 UTC (rev 960) @@ -1,162 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Diagnostics; -using System.Drawing; -using System.Text; -using System.Windows.Forms; - -using MediaPortal.GUI.Library; - -namespace MediaPortal.Plugins -{ - - public partial class ExternalProgram : Form - { - - #region Variables - - string _parametersMessage = ""; - - #endregion Variables - - #region Properties - - public string CommandString - { - get - { - return string.Format("{0}|{1}|{2}|{3}|{4}|{5}|{6}", - textBoxProgram.Text, - textBoxStartup.Text, - textBoxParameters.Text, - (string)comboBoxWindowStyle.SelectedItem, - checkBoxNoWindow.Checked.ToString(), - checkBoxShellExecute.Checked.ToString(), - checkBoxWaitForExit.Checked.ToString()); - } - } - - #endregion Properties - - #region Constructors - - public ExternalProgram() : this(null, "") { } - public ExternalProgram(string parametersMessage) : this(null, parametersMessage) { } - public ExternalProgram(string[] commands) : this(commands, "") { } - public ExternalProgram(string[] commands, string parametersMessage) - { - InitializeComponent(); - - _parametersMessage = parametersMessage; - - comboBoxWindowStyle.Items.Clear(); - comboBoxWindowStyle.Items.AddRange(Enum.GetNames(typeof(ProcessWindowStyle))); - - if (commands != null) - { - textBoxProgram.Text = commands[0]; - textBoxStartup.Text = commands[1]; - textBoxParameters.Text = commands[2]; - - checkBoxNoWindow.Checked = bool.Parse(commands[4]); - checkBoxShellExecute.Checked = bool.Parse(commands[5]); - checkBoxWaitForExit.Checked = bool.Parse(commands[6]); - - comboBoxWindowStyle.SelectedItem = ((ProcessWindowStyle)Enum.Parse(typeof(ProcessWindowStyle), commands[3])).ToString(); - } - else - { - comboBoxWindowStyle.SelectedIndex = 0; - } - } - - #endregion Constructors - - private void ExternalProgram_Load(object sender, EventArgs e) - { - if (_parametersMessage.Trim().Length == 0) - buttonParamQuestion.Visible = false; - } - - - private void buttonProgam_Click(object sender, EventArgs e) - { - if (openFileDialog.ShowDialog(this) == DialogResult.OK) - { - textBoxProgram.Text = openFileDialog.FileName; - - if (textBoxStartup.Text.Trim().Length == 0) - { - textBoxStartup.Text = System.IO.Path.GetDirectoryName(openFileDialog.FileName); - } - } - } - - private void buttonStartup_Click(object sender, EventArgs e) - { - if (folderBrowserDialog.ShowDialog(this) == DialogResult.OK) - { - textBoxProgram.Text = folderBrowserDialog.SelectedPath; - } - } - - private void buttonOK_Click(object sender, EventArgs e) - { - if (textBoxProgram.Text.Trim().Length == 0) - { - MessageBox.Show(this, "You must specify a program to run", "Missing program name", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - return; - } - - this.DialogResult = DialogResult.OK; - this.Close(); - } - - private void buttonCancel_Click(object sender, EventArgs e) - { - this.DialogResult = DialogResult.Cancel; - this.Close(); - } - - private void buttonParamQuestion_Click(object sender, EventArgs e) - { - MessageBox.Show(this, _parametersMessage, "Parameters", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - - private void buttonTest_Click(object sender, EventArgs e) - { - if (textBoxProgram.Text.Trim().Length == 0) - { - MessageBox.Show(this, "You must specify a program to run", "Missing program name", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - return; - } - - try - { - Process process = new Process(); - process.StartInfo.FileName = textBoxProgram.Text; - process.StartInfo.WorkingDirectory = textBoxStartup.Text; - process.StartInfo.Arguments = textBoxParameters.Text; - process.StartInfo.WindowStyle = (ProcessWindowStyle)Enum.Parse(typeof(ProcessWindowStyle), (string)comboBoxWindowStyle.SelectedItem); - process.StartInfo.CreateNoWindow = checkBoxNoWindow.Checked; - process.StartInfo.UseShellExecute = checkBoxShellExecute.Checked; - - if (MCEReplacement.LogVerbose) - Log.Info("MCEReplacement: Launching external program {0}", textBoxProgram.Text); - - process.Start(); - - if (checkBoxWaitForExit.Checked) // Wait for exit - process.WaitForExit(); - } - catch (Exception ex) - { - Log.Error("MCEReplacement: {0}", ex.Message); - } - } - - } - -} Deleted: trunk/plugins/MCEReplacement/Forms/ExternalProgram.resx =================================================================== --- trunk/plugins/MCEReplacement/Forms/ExternalProgram.resx 2007-09-28 16:31:49 UTC (rev 959) +++ trunk/plugins/MCEReplacement/Forms/ExternalProgram.resx 2007-09-28 16:34:14 UTC (rev 960) @@ -1,126 +0,0 @@ -<?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="openFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> - <value>17, 17</value> - </metadata> - <metadata name="folderBrowserDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> - <value>144, 17</value> - </metadata> -</root> \ No newline at end of file Deleted: trunk/plugins/MCEReplacement/Forms/GoToScreen.Designer.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/GoToScreen.Designer.cs 2007-09-28 16:31:49 UTC (rev 959) +++ trunk/plugins/MCEReplacement/Forms/GoToScreen.Designer.cs 2007-09-28 16:34:14 UTC (rev 960) @@ -1,112 +0,0 @@ -namespace MediaPortal.Plugins -{ - partial class GoToScreen - { - /// <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.comboBoxScreen = new System.Windows.Forms.ComboBox(); - this.buttonOK = new System.Windows.Forms.Button(); - this.buttonCancel = new System.Windows.Forms.Button(); - this.labelScreen = new System.Windows.Forms.Label(); - this.SuspendLayout(); - // - // comboBoxScreen - // - this.comboBoxScreen.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.comboBoxScreen.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; - this.comboBoxScreen.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; - this.comboBoxScreen.FormattingEnabled = true; - this.comboBoxScreen.Location = new System.Drawing.Point(8, 24); - this.comboBoxScreen.Name = "comboBoxScreen"; - this.comboBoxScreen.Size = new System.Drawing.Size(248, 21); - this.comboBoxScreen.TabIndex = 0; - // - // 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(120, 56); - 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(192, 56); - 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); - // - // labelScreen - // - this.labelScreen.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.labelScreen.Location = new System.Drawing.Point(8, 8); - this.labelScreen.Name = "labelScreen"; - this.labelScreen.Size = new System.Drawing.Size(248, 16); - this.labelScreen.TabIndex = 3; - this.labelScreen.Text = "Screen:"; - // - // GoToScreen - // - 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(264, 89); - this.Controls.Add(this.labelScreen); - this.Controls.Add(this.buttonCancel); - this.Controls.Add(this.buttonOK); - this.Controls.Add(this.comboBoxScreen); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.MinimumSize = new System.Drawing.Size(272, 123); - this.Name = "GoToScreen"; - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Go to screen"; - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.ComboBox comboBoxScreen; - private System.Windows.Forms.Button buttonOK; - private System.Windows.Forms.Button buttonCancel; - private System.Windows.Forms.Label labelScreen; - } -} \ No newline at end of file Deleted: trunk/plugins/MCEReplacement/Forms/GoToScreen.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/GoToScreen.cs 2007-09-28 16:31:49 UTC (rev 959) +++ trunk/plugins/MCEReplacement/Forms/GoToScreen.cs 2007-09-28 16:34:14 UTC (rev 960) @@ -1,71 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Text; -using System.Windows.Forms; - -namespace MediaPortal.Plugins -{ - - public partial class GoToScreen : Form - { - - #region Properties - - public string Screen - { - get { return comboBoxScreen.Text; } - } - - #endregion Properties - - #region Constructors - - public GoToScreen() : this(String.Empty) { } - public GoToScreen(string selected) - { - InitializeComponent(); - - SetupComboBox(); - - if (String.IsNullOrEmpty(selected)) - comboBoxScreen.SelectedIndex = 0; - else - comboBoxScreen.Text = selected; - } - - #endregion Constructors - - void SetupComboBox() - { - comboBoxScreen.Items.Clear(); - string[] items = Enum.GetNames(typeof(MediaPortal.GUI.Library.GUIWindow.Window)); - - int index; - for (index = 0; index < items.Length; index++) - items[index] = items[index].Substring(7); - - Array.Sort(items); - - for (index = 0; index < items.Length; index++) - if (items[index] != "INVALID" && items[index] != "SECOND_HOME") - comboBoxScreen.Items.Add(items[index]); - } - - 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(); - } - - } - -} Deleted: trunk/plugins/MCEReplacement/Forms/GoToScreen.resx =================================================================== --- trunk/plugins/MCEReplacement/Forms/GoToScreen.resx 2007-09-28 16:31:49 UTC (rev 959) +++ trunk/plugins/MCEReplacement/Forms/GoToScreen.resx 2007-09-28 16:34:14 UTC (rev 960) @@ -1,120 +0,0 @@ -<?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=... [truncated message content] |
From: <an...@us...> - 2007-09-28 18:46:12
|
Revision: 962 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=962&view=rev Author: and-81 Date: 2007-09-28 11:46:10 -0700 (Fri, 28 Sep 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs trunk/plugins/MCEReplacement/Forms/SetupForm.cs trunk/plugins/MCEReplacement/MCEReplacement.cs Modified: trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs 2007-09-28 18:10:48 UTC (rev 961) +++ trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs 2007-09-28 18:46:10 UTC (rev 962) @@ -69,7 +69,7 @@ comboBoxCopyFrom.SelectedIndex = 0; // Setup quick setup combo box - string[] quickSetupFiles = Directory.GetFiles(MCEReplacement.AppDataFolder + MCEReplacement.STBFolder, "*.xml", SearchOption.TopDirectoryOnly); + string[] quickSetupFiles = Directory.GetFiles(MCEReplacement.STBFolder, "*.xml", SearchOption.TopDirectoryOnly); foreach (string file in quickSetupFiles) comboBoxQuickSetup.Items.Add(Path.GetFileNameWithoutExtension(file)); Modified: trunk/plugins/MCEReplacement/Forms/SetupForm.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/SetupForm.cs 2007-09-28 18:10:48 UTC (rev 961) +++ trunk/plugins/MCEReplacement/Forms/SetupForm.cs 2007-09-28 18:46:10 UTC (rev 962) @@ -169,7 +169,7 @@ } } - void ReceivedRemoteButton(string button) + public void ReceivedRemoteButton(string button) { if (listViewButtons.SelectedIndices.Count == 1 && tabControl.SelectedTab == tabPageDifferentRemote) { @@ -220,7 +220,7 @@ if (listBoxIR.SelectedIndex != -1) { string command = (string)listBoxIR.SelectedItem; - string fileName = MCEReplacement.AppDataFolder + command + Common.FileExtensionIR; + string fileName = MCEReplacement.IRFolder + command + Common.FileExtensionIR; if (File.Exists(fileName)) { @@ -243,7 +243,7 @@ if (listBoxMacro.SelectedIndex != -1) { string command = (string)listBoxMacro.SelectedItem; - string fileName = MCEReplacement.AppDataFolder + command + Common.FileExtensionMacro; + string fileName = MCEReplacement.MacroFolder + command + Common.FileExtensionMacro; if (File.Exists(fileName)) { @@ -383,7 +383,7 @@ if (listBoxIR.SelectedIndex != -1) { string file = (string)listBoxIR.SelectedItem; - string fileName = MCEReplacement.AppDataFolder + file + Common.FileExtensionIR; + string fileName = MCEReplacement.IRFolder + file + Common.FileExtensionIR; if (File.Exists(fileName)) { if (MessageBox.Show(this, "Are you sure you want to delete \"" + file + "\"?", "Confirm delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) @@ -401,7 +401,7 @@ private void buttonNewMacro_Click(object sender, EventArgs e) { - MacroEditor macroEditor = new MacroEditor(true, ""); + MacroEditor macroEditor = new MacroEditor(true, "New"); macroEditor.ShowDialog(this); RefreshMacroList(); @@ -416,7 +416,7 @@ if (listBoxMacro.SelectedIndex != -1) { string file = (string)listBoxMacro.SelectedItem; - string fileName = MCEReplacement.AppDataFolder + file + Common.FileExtensionMacro; + string fileName = MCEReplacement.MacroFolder + file + Common.FileExtensionMacro; if (File.Exists(fileName)) { if (MessageBox.Show(this, "Are you sure you want to delete \"" + file + "\"?", "Confirm delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-09-28 18:10:48 UTC (rev 961) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-09-28 18:46:10 UTC (rev 962) @@ -56,7 +56,6 @@ public static readonly string MacroFolder = AppDataFolder + "Macro\\"; public static readonly string STBFolder = AppDataFolder + "STB\\"; - public static readonly string CustomInputDevice = Config.GetFolder(Config.Dir.CustomInputDevice) + "\\"; public static readonly string CustomInputDefault = Config.GetFolder(Config.Dir.CustomInputDefault) + "\\"; @@ -337,6 +336,8 @@ public void ShowPlugin() { + Log.Debug("MCE Replacement: {0}", AppDataFolder); + LoadSettings(); LoadDefaultMapping(); LoadMultiMappings(); @@ -355,9 +356,25 @@ } SetupForm setupForm = new SetupForm(); + + try + { + _mceTransceiver = new MicrosoftMceTransceiver.MicrosoftMceTransceiver(); + _mceTransceiver.RemoteCallback = new IRServerPluginInterface.RemoteHandler(setupForm.ReceivedRemoteButton); + _mceTransceiver.Start(); + } + catch (Exception ex) + { + Log.Error("MCEReplacement: {0}", ex.Message); + _mceTransceiver = null; + } + if (setupForm.ShowDialog() == DialogResult.OK) SaveSettings(); + if (_mceTransceiver != null) + _mceTransceiver.Stop(); + if (LogVerbose) Log.Info("MCEReplacement: ShowPlugin() - End"); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-11-03 12:48:09
|
Revision: 1019 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1019&view=rev Author: and-81 Date: 2007-11-03 05:48:07 -0700 (Sat, 03 Nov 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/Forms/LearnIR.cs trunk/plugins/MCEReplacement/Forms/MacroEditor.cs trunk/plugins/MCEReplacement/Forms/SetupForm.cs trunk/plugins/MCEReplacement/InputMapper/InputHandler.cs trunk/plugins/MCEReplacement/MCEReplacement.cs Modified: trunk/plugins/MCEReplacement/Forms/LearnIR.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/LearnIR.cs 2007-11-03 12:41:55 UTC (rev 1018) +++ trunk/plugins/MCEReplacement/Forms/LearnIR.cs 2007-11-03 12:48:07 UTC (rev 1019) @@ -90,7 +90,7 @@ string fileName = MCEReplacement.IRFolder + name + Common.FileExtensionIR; - IRServerPluginInterface.LearnStatus status = MCEReplacement.LearnIRCommand(fileName); + IRServerPluginInterface.LearnStatus status = MCEReplacement.LearnIR(fileName); switch (status) { Modified: trunk/plugins/MCEReplacement/Forms/MacroEditor.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/MacroEditor.cs 2007-11-03 12:41:55 UTC (rev 1018) +++ trunk/plugins/MCEReplacement/Forms/MacroEditor.cs 2007-11-03 12:48:07 UTC (rev 1019) @@ -32,7 +32,7 @@ { InitializeComponent(); - textBoxName.Text = "New"; + textBoxName.Text = "New"; textBoxName.Enabled = true; } @@ -65,7 +65,10 @@ comboBoxCommands.Items.Add(Common.UITextPause); comboBoxCommands.Items.Add(Common.UITextSerial); comboBoxCommands.Items.Add(Common.UITextWindowMsg); + comboBoxCommands.Items.Add(Common.UITextTcpMsg); comboBoxCommands.Items.Add(Common.UITextKeys); + comboBoxCommands.Items.Add(Common.UITextMouse); + comboBoxCommands.Items.Add(Common.UITextEject); comboBoxCommands.Items.Add(Common.UITextGoto); comboBoxCommands.Items.Add(Common.UITextPopup); comboBoxCommands.Items.Add(Common.UITextMultiMap); @@ -139,11 +142,26 @@ writer.WriteAttributeString("command", Common.XmlTagWindowMsg); writer.WriteAttributeString("cmdproperty", item.Substring(Common.CmdPrefixWindowMsg.Length)); } + else if (item.StartsWith(Common.CmdPrefixTcpMsg)) + { + writer.WriteAttributeString("command", Common.XmlTagTcpMsg); + writer.WriteAttributeString("cmdproperty", item.Substring(Common.CmdPrefixTcpMsg.Length)); + } else if (item.StartsWith(Common.CmdPrefixKeys)) { writer.WriteAttributeString("command", Common.XmlTagKeys); writer.WriteAttributeString("cmdproperty", item.Substring(Common.CmdPrefixKeys.Length)); } + else if (item.StartsWith(Common.CmdPrefixMouse)) + { + writer.WriteAttributeString("command", Common.XmlTagMouse); + writer.WriteAttributeString("cmdproperty", item.Substring(Common.CmdPrefixMouse.Length)); + } + else if (item.StartsWith(Common.CmdPrefixEject)) + { + writer.WriteAttributeString("command", Common.XmlTagEject); + writer.WriteAttributeString("cmdproperty", item.Substring(Common.CmdPrefixEject.Length)); + } else if (item.StartsWith(Common.CmdPrefixPopup)) { writer.WriteAttributeString("command", Common.XmlTagPopup); @@ -265,10 +283,22 @@ listBoxMacro.Items.Add(Common.CmdPrefixWindowMsg + commandProperty); break; + case Common.XmlTagTcpMsg: + listBoxMacro.Items.Add(Common.CmdPrefixTcpMsg + commandProperty); + break; + case Common.XmlTagKeys: listBoxMacro.Items.Add(Common.CmdPrefixKeys + commandProperty); break; + case Common.XmlTagMouse: + listBoxMacro.Items.Add(Common.CmdPrefixMouse + commandProperty); + break; + + case Common.XmlTagEject: + listBoxMacro.Items.Add(Common.CmdPrefixEject + commandProperty); + break; + case Common.XmlTagGoto: listBoxMacro.Items.Add(Common.CmdPrefixGoto + commandProperty); break; @@ -361,12 +391,32 @@ if (messageCommand.ShowDialog(this) == DialogResult.OK) listBoxMacro.Items.Add(Common.CmdPrefixWindowMsg + messageCommand.CommandString); } + else if (selected == Common.UITextTcpMsg) + { + TcpMessageCommand tcpMessageCommand = new TcpMessageCommand(); + if (tcpMessageCommand.ShowDialog(this) == DialogResult.Cancel) + return; + + listBoxMacro.Items.Add(Common.CmdPrefixTcpMsg + tcpMessageCommand.CommandString); + } else if (selected == Common.UITextKeys) { KeysCommand keysCommand = new KeysCommand(); if (keysCommand.ShowDialog(this) == DialogResult.OK) listBoxMacro.Items.Add(Common.CmdPrefixKeys + keysCommand.CommandString); } + else if (selected == Common.UITextMouse) + { + MouseCommand mouseCommand = new MouseCommand(); + if (mouseCommand.ShowDialog(this) == DialogResult.OK) + listBoxMacro.Items.Add(Common.CmdPrefixMouse + mouseCommand.CommandString); + } + else if (selected == Common.UITextEject) + { + EjectCommand ejectCommand = new EjectCommand(); + if (ejectCommand.ShowDialog(this) == DialogResult.OK) + listBoxMacro.Items.Add(Common.CmdPrefixEject + ejectCommand.CommandString); + } else if (selected == Common.UITextGoto) { GoToScreen goToScreen = new GoToScreen(); @@ -381,18 +431,10 @@ } else if (selected == Common.UITextMultiMap) { - //SelectBlasterSpeed selectBlasterSpeed = new SelectBlasterSpeed(_blastSpeed); - //if (selectBlasterSpeed.ShowDialog(this) == DialogResult.Cancel) - //return; - listBoxMacro.Items.Add(Common.CmdPrefixMultiMap + "TOGGLE"); } else if (selected == Common.UITextMouseMode) { - //SelectBlasterSpeed selectBlasterSpeed = new SelectBlasterSpeed(_blastSpeed); - //if (selectBlasterSpeed.ShowDialog(this) == DialogResult.Cancel) - //return; - listBoxMacro.Items.Add(Common.CmdPrefixMouseMode + "TOGGLE"); } else if (selected == Common.UITextInputLayer) @@ -524,6 +566,7 @@ if (name.Length == 0) { MessageBox.Show(this, "You must supply a name for this Macro", "Name missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + textBoxName.Focus(); return; } @@ -599,6 +642,18 @@ listBoxMacro.Items.Insert(index, Common.CmdPrefixWindowMsg + messageCommand.CommandString); listBoxMacro.SelectedIndex = index; } + else if (selected.StartsWith(Common.CmdPrefixTcpMsg)) + { + string[] commands = Common.SplitTcpMessageCommand(selected.Substring(Common.CmdPrefixTcpMsg.Length)); + TcpMessageCommand tcpMessageCommand = new TcpMessageCommand(commands); + if (tcpMessageCommand.ShowDialog(this) == DialogResult.Cancel) + return; + + int index = listBoxMacro.SelectedIndex; + listBoxMacro.Items.RemoveAt(index); + listBoxMacro.Items.Insert(index, Common.CmdPrefixTcpMsg + tcpMessageCommand.CommandString); + listBoxMacro.SelectedIndex = index; + } else if (selected.StartsWith(Common.CmdPrefixKeys)) { KeysCommand keysCommand = new KeysCommand(selected.Substring(Common.CmdPrefixKeys.Length)); @@ -610,6 +665,28 @@ listBoxMacro.Items.Insert(index, Common.CmdPrefixKeys + keysCommand.CommandString); listBoxMacro.SelectedIndex = index; } + else if (selected.StartsWith(Common.CmdPrefixMouse)) + { + MouseCommand mouseCommand = new MouseCommand(selected.Substring(Common.CmdPrefixMouse.Length)); + if (mouseCommand.ShowDialog(this) == DialogResult.Cancel) + return; + + int index = listBoxMacro.SelectedIndex; + listBoxMacro.Items.RemoveAt(index); + listBoxMacro.Items.Insert(index, Common.CmdPrefixMouse + mouseCommand.CommandString); + listBoxMacro.SelectedIndex = index; + } + else if (selected.StartsWith(Common.CmdPrefixEject)) + { + EjectCommand ejectCommand = new EjectCommand(selected.Substring(Common.CmdPrefixEject.Length)); + if (ejectCommand.ShowDialog(this) == DialogResult.Cancel) + return; + + int index = listBoxMacro.SelectedIndex; + listBoxMacro.Items.RemoveAt(index); + listBoxMacro.Items.Insert(index, Common.CmdPrefixEject + ejectCommand.CommandString); + listBoxMacro.SelectedIndex = index; + } else if (selected.StartsWith(Common.CmdPrefixGoto)) { GoToScreen goToScreen = new GoToScreen(selected.Substring(Common.CmdPrefixGoto.Length)); Modified: trunk/plugins/MCEReplacement/Forms/SetupForm.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/SetupForm.cs 2007-11-03 12:41:55 UTC (rev 1018) +++ trunk/plugins/MCEReplacement/Forms/SetupForm.cs 2007-11-03 12:48:07 UTC (rev 1019) @@ -194,8 +194,16 @@ comboBoxCommands.Items.Add(Common.UITextRun); comboBoxCommands.Items.Add(Common.UITextSerial); comboBoxCommands.Items.Add(Common.UITextWindowMsg); + comboBoxCommands.Items.Add(Common.UITextTcpMsg); comboBoxCommands.Items.Add(Common.UITextKeys); + comboBoxCommands.Items.Add(Common.UITextEject); comboBoxCommands.Items.Add(Common.UITextGoto); + //comboBoxCommands.Items.Add(Common.UITextWindowState); + comboBoxCommands.Items.Add(Common.UITextExit); + comboBoxCommands.Items.Add(Common.UITextStandby); + comboBoxCommands.Items.Add(Common.UITextHibernate); + comboBoxCommands.Items.Add(Common.UITextReboot); + comboBoxCommands.Items.Add(Common.UITextShutdown); string[] fileList = MCEReplacement.GetFileList(true); @@ -484,14 +492,6 @@ command = Common.CmdPrefixRun + externalProgram.CommandString; } - else if (selected == Common.UITextGoto) - { - GoToScreen goToScreen = new GoToScreen(); - if (goToScreen.ShowDialog(this) == DialogResult.Cancel) - return; - - command = Common.CmdPrefixGoto + goToScreen.Screen; - } else if (selected == Common.UITextSerial) { SerialCommand serialCommand = new SerialCommand(); @@ -508,6 +508,14 @@ command = Common.CmdPrefixWindowMsg + messageCommand.CommandString; } + else if (selected == Common.UITextTcpMsg) + { + TcpMessageCommand tcpMessageCommand = new TcpMessageCommand(); + if (tcpMessageCommand.ShowDialog(this) == DialogResult.Cancel) + return; + + command = Common.CmdPrefixTcpMsg + tcpMessageCommand.CommandString; + } else if (selected == Common.UITextKeys) { KeysCommand keysCommand = new KeysCommand(); @@ -516,6 +524,22 @@ command = Common.CmdPrefixKeys + keysCommand.CommandString; } + else if (selected == Common.UITextEject) + { + EjectCommand ejectCommand = new EjectCommand(); + if (ejectCommand.ShowDialog(this) == DialogResult.Cancel) + return; + + command = Common.CmdPrefixEject + ejectCommand.CommandString; + } + else if (selected == Common.UITextGoto) + { + GoToScreen goToScreen = new GoToScreen(); + if (goToScreen.ShowDialog(this) == DialogResult.Cancel) + return; + + command = Common.CmdPrefixGoto + goToScreen.Screen; + } else if (selected.StartsWith(Common.CmdPrefixBlast)) { BlastCommand blastCommand = new BlastCommand( @@ -529,7 +553,7 @@ command = Common.CmdPrefixBlast + blastCommand.CommandString; } - else if (selected.StartsWith(Common.CmdPrefixMacro)) + else { command = selected; } @@ -546,8 +570,8 @@ string mappingName = multiMapNameBox.MapName; - string pathCustom = MCEReplacement.CustomInputDevice + "MCE Replacement.xml"; - string pathDefault = MCEReplacement.CustomInputDefault + "MCE Replacement.xml"; + string pathCustom = MPUtils.MPCommon.CustomInputDevice + "MCE Replacement.xml"; + string pathDefault = MPUtils.MPCommon.CustomInputDefault + "MCE Replacement.xml"; string sourceFile; if (File.Exists(pathCustom)) @@ -560,7 +584,7 @@ return; } - string destinationFile = MCEReplacement.CustomInputDevice + mappingName + ".xml"; + string destinationFile = MPUtils.MPCommon.CustomInputDevice + mappingName + ".xml"; File.Copy(sourceFile, destinationFile, true); @@ -700,16 +724,18 @@ return; } - if (!Common.IsValidFileName(e.Label)) + string name = e.Label.Trim(); + + if (!Common.IsValidFileName(name)) { - MessageBox.Show("File name not valid: " + e.Label, "Cannot rename, New file name not valid", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show("File name not valid: " + name, "Cannot rename, New file name not valid", MessageBoxButtons.OK, MessageBoxIcon.Error); e.CancelEdit = true; return; } try { - string newFileName = MCEReplacement.IRFolder + e.Label + Common.FileExtensionIR; + string newFileName = MCEReplacement.IRFolder + name + Common.FileExtensionIR; File.Move(oldFileName, newFileName); } @@ -744,16 +770,18 @@ return; } - if (!Common.IsValidFileName(e.Label)) + string name = e.Label.Trim(); + + if (!Common.IsValidFileName(name)) { - MessageBox.Show("File name not valid: " + e.Label, "Cannot rename, New file name not valid", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show("File name not valid: " + name, "Cannot rename, New file name not valid", MessageBoxButtons.OK, MessageBoxIcon.Error); e.CancelEdit = true; return; } try { - string newFileName = MCEReplacement.MacroFolder + e.Label + Common.FileExtensionMacro; + string newFileName = MCEReplacement.MacroFolder + name + Common.FileExtensionMacro; File.Move(oldFileName, newFileName); } Modified: trunk/plugins/MCEReplacement/InputMapper/InputHandler.cs =================================================================== --- trunk/plugins/MCEReplacement/InputMapper/InputHandler.cs 2007-11-03 12:41:55 UTC (rev 1018) +++ trunk/plugins/MCEReplacement/InputMapper/InputHandler.cs 2007-11-03 12:48:07 UTC (rev 1019) @@ -134,8 +134,7 @@ /// <param name="deviceXmlName">Input device name.</param> public InputHandler(string deviceXmlName) { - - using (Profile.Settings xmlreader = new Profile.Settings(MCEReplacement.MPConfigFile)) + using (Profile.Settings xmlreader = new Profile.Settings(MPUtils.MPCommon.MPConfigFile)) _basicHome = xmlreader.GetValueAsBool("general", "startbasichome", false); string xmlPath = GetXmlPath(deviceXmlName); @@ -182,8 +181,8 @@ public string GetXmlPath(string deviceXmlName) { string path = String.Empty; - string pathCustom = MCEReplacement.CustomInputDevice + deviceXmlName + ".xml"; - string pathDefault = MCEReplacement.CustomInputDefault + deviceXmlName + ".xml"; + string pathCustom = MPUtils.MPCommon.CustomInputDevice + deviceXmlName + ".xml"; + string pathDefault = MPUtils.MPCommon.CustomInputDefault + deviceXmlName + ".xml"; if (System.IO.File.Exists(pathCustom) && CheckXmlFile(pathCustom)) { Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-11-03 12:41:55 UTC (rev 1018) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-11-03 12:48:07 UTC (rev 1019) @@ -41,22 +41,13 @@ /// <summary> /// The plugin version string. /// </summary> - internal const string PluginVersion = "MCE Replacement Plugin 1.0.3.5 for MediaPortal 0.2.3.0"; + internal const string PluginVersion = "MCE Replacement Plugin 1.0.3.5 for MediaPortal 0.2.3.0"; /// <summary> /// The wParam for Message Mode Windows Messages. /// </summary> - public const int MessageModeCommand = 0x0018; + public const int MessageModeCommand = 0x0018; - // Macro Commands - //internal const string WindowStateCommand = "Toggle Window State"; - - // Macro File Commands - //internal const string WindowStateMacroText = "WINDOW_STATE"; - - // English text for Macro commands - //internal const string ChangeWindowStateText = "Change Window State"; - internal static readonly string AppDataFolder = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\MediaPortal MCE Replacement Plugin\\"; @@ -65,11 +56,6 @@ internal static readonly string MacroFolder = AppDataFolder + "Macro\\"; internal static readonly string STBFolder = AppDataFolder + "STB\\"; - internal static readonly string CustomInputDevice = Config.GetFolder(Config.Dir.CustomInputDevice) + "\\"; - internal static readonly string CustomInputDefault = Config.GetFolder(Config.Dir.CustomInputDefault) + "\\"; - - internal static readonly string MPConfigFile = Config.GetFolder(Config.Dir.Config) + "\\MediaPortal.xml"; - internal static readonly string MCERemoteFile = AppDataFolder + "MCERemote.xml"; internal static readonly string DifferentRemoteFile = AppDataFolder + "DifferentRemote.xml"; internal static readonly string MultiMappingFile = AppDataFolder + "MultiMapping.xml"; @@ -147,18 +133,7 @@ get { return _logVerbose; } set { _logVerbose = value; } } - /// <summary> - /// Gets or sets a value indicating whether in configuration. - /// </summary> - /// <value><c>true</c> if in configuration; otherwise, <c>false</c>.</value> - internal static bool InConfiguration - { - get { return _inConfiguration; } - set { _inConfiguration = value; } - } - - /// <summary> /// Gets or sets a value indicating whether MediaPortal will require focus to handle input. /// </summary> /// <value><c>true</c> if requires focus; otherwise, <c>false</c>.</value> @@ -198,7 +173,7 @@ /// Gets or sets a value indicating whether different remote handling is enabled. /// </summary> /// <value> - /// <c>true</c> if different remote handling is enabled; otherwise, <c>false</c>. + /// <c>true</c> if different remote handling is enabled; otherwise, <c>false</c>. /// </value> internal static bool DifferentRemoteEnabled { @@ -300,6 +275,16 @@ } /// <summary> + /// Gets or sets a value indicating whether in configuration. + /// </summary> + /// <value><c>true</c> if in configuration; otherwise, <c>false</c>.</value> + internal static bool InConfiguration + { + get { return _inConfiguration; } + set { _inConfiguration = value; } + } + + /// <summary> /// Count of available TV Cards. /// </summary> internal static int TvCardCount @@ -429,7 +414,7 @@ GUIWindowManager.Receivers -= new SendMessageHandler(OnMessage); _defaultInputHandler = null; - + if (MultiMappingEnabled) for (int i = 0; i < _multiInputHandlers.Count; i++) _multiInputHandlers[i] = null; @@ -451,41 +436,41 @@ /// Determines whether this plugin can be enabled. /// </summary> /// <returns> - /// <c>true</c> if this plugin can be enabled; otherwise, <c>false</c>. + /// <c>true</c> if this plugin can be enabled; otherwise, <c>false</c>. /// </returns> - public bool CanEnable() { return true; } + public bool CanEnable() { return true; } /// <summary> /// Determines whether this plugin has setup. /// </summary> /// <returns> - /// <c>true</c> if this plugin has setup; otherwise, <c>false</c>. + /// <c>true</c> if this plugin has setup; otherwise, <c>false</c>. /// </returns> - public bool HasSetup() { return true; } + public bool HasSetup() { return true; } /// <summary> /// Gets the plugin name. /// </summary> /// <returns>The plugin name.</returns> - public string PluginName() { return "MCE Replacement"; } + public string PluginName() { return "MCE Replacement"; } /// <summary> /// Defaults enabled. /// </summary> /// <returns>true if this plugin is enabled by default, otherwise false.</returns> - public bool DefaultEnabled() { return true; } + public bool DefaultEnabled() { return true; } /// <summary> /// Gets the window id. /// </summary> /// <returns>The window id.</returns> - public int GetWindowId() { return 0; } + public int GetWindowId() { return 0; } /// <summary> /// Gets the plugin author. /// </summary> /// <returns>The plugin author.</returns> - public string Author() { return "and-81"; } + public string Author() { return "and-81"; } /// <summary> /// Gets the description of the plugin. /// </summary> /// <returns>The plugin description.</returns> - public string Description() { return "Replaces MediaPortal's native MCE remote control support"; } + public string Description() { return "Replaces MediaPortal's native MCE remote control support"; } /// <summary> /// Shows the plugin configuration. @@ -559,7 +544,7 @@ /// <param name="strButtonImageFocus">The button image focus.</param> /// <param name="strPictureImage">The picture image.</param> /// <returns>true if the plugin can be seen, otherwise false.</returns> - public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) + public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) { strButtonText = strButtonImage = strButtonImageFocus = strPictureImage = String.Empty; return false; @@ -657,7 +642,7 @@ _mouseModeMiddleHeld = false; } - MPCommands.ShowNotifyDialog("Mouse Mode", notifyMessage, 2); + MPCommon.ShowNotifyDialog("Mouse Mode", notifyMessage, 2); if (LogVerbose) Log.Info("MCEReplacement: {0}", notifyMessage); @@ -999,14 +984,14 @@ { // Cycle through Multi-Mappings ... _multiMappingSet = (_multiMappingSet + 1) % MultiMaps.Length; - + // Show the mapping set name on screen ... string setName = MultiMaps[_multiMappingSet]; if (LogVerbose) Log.Info("MCEReplacement: Multi-Mapping has changed to \"{0}\"", setName); - MPCommands.ShowNotifyDialog("Multi-Mapping", setName, 2); + MPCommon.ShowNotifyDialog("Multi-Mapping", setName, 2); } /// <summary> /// Changes the multi mapping. @@ -1034,7 +1019,7 @@ if (LogVerbose) Log.Info("MCEReplacement: Multi-Mapping has changed to \"{0}\"", setName); - MPCommands.ShowNotifyDialog("Multi-Mapping", setName, 2); + MPCommon.ShowNotifyDialog("Multi-Mapping", setName, 2); return; } @@ -1431,6 +1416,62 @@ MapEvent(MappedEvent.MappingEvent.PC_Resume); } + static void Hibernate() + { + if (InConfiguration) + return; + + GUIGraphicsContext.ResetLastActivity(); + // Stop all media before hibernating + g_Player.Stop(); + + GUIMessage msg; + + if (_mpBasicHome) + msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW, 0, 0, 0, (int)GUIWindow.Window.WINDOW_SECOND_HOME, 0, null); + else + msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW, 0, 0, 0, (int)GUIWindow.Window.WINDOW_HOME, 0, null); + + GUIWindowManager.SendThreadMessage(msg); + + OnSuspend(); + WindowsController.ExitWindows(RestartOptions.Hibernate, false); + } + + static void Standby() + { + if (InConfiguration) + return; + + GUIGraphicsContext.ResetLastActivity(); + // Stop all media before suspending + g_Player.Stop(); + + GUIMessage msg; + + if (_mpBasicHome) + msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW, 0, 0, 0, (int)GUIWindow.Window.WINDOW_SECOND_HOME, 0, null); + else + msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW, 0, 0, 0, (int)GUIWindow.Window.WINDOW_HOME, 0, null); + + GUIWindowManager.SendThreadMessage(msg); + + OnSuspend(); + WindowsController.ExitWindows(RestartOptions.Suspend, false); + } + + static void Reboot() + { + if (!InConfiguration) + GUIGraphicsContext.OnAction(new Action(Action.ActionType.ACTION_SHUTDOWN, 0, 0)); + } + + static void ShutDown() + { + if (!InConfiguration) + GUIGraphicsContext.OnAction(new Action(Action.ActionType.ACTION_REBOOT, 0, 0)); + } + /// <summary> /// Adds to the Macro Stack. /// </summary> @@ -1511,7 +1552,6 @@ case Common.XmlTagBlast: { string[] commands = Common.SplitBlastCommand(commandProperty); - BlastIR(IRFolder + commands[0] + Common.FileExtensionIR, commands[1]); break; } @@ -1542,7 +1582,7 @@ if (InConfiguration) MessageBox.Show(commandProperty, "Go To Window", MessageBoxButtons.OK, MessageBoxIcon.Information); else - MPCommands.ProcessGoTo(commandProperty, MP_BasicHome); + MPCommon.ProcessGoTo(commandProperty, MP_BasicHome); break; } @@ -1553,7 +1593,7 @@ if (InConfiguration) MessageBox.Show(commands[1], commands[0], MessageBoxButtons.OK, MessageBoxIcon.Information); else - MPCommands.ShowNotifyDialog(commands[0], commands[1], int.Parse(commands[2])); + MPCommon.ShowNotifyDialog(commands[0], commands[1], int.Parse(commands[2])); break; } @@ -1565,6 +1605,13 @@ break; } + case Common.XmlTagTcpMsg: + { + string[] commands = Common.SplitTcpMessageCommand(commandProperty); + Common.ProcessTcpMessageCommand(commands); + break; + } + case Common.XmlTagKeys: { if (InConfiguration) @@ -1634,7 +1681,7 @@ _mouseModeMiddleHeld = false; } - MPCommands.ShowNotifyDialog("Mouse Mode", notifyMessage, 2); + MPCommon.ShowNotifyDialog("Mouse Mode", notifyMessage, 2); if (LogVerbose) Log.Info("MCEReplacement: {0}", notifyMessage); @@ -1703,63 +1750,33 @@ break; } + case Common.XmlTagEject: + { + Common.ProcessEjectCommand(commandProperty); + break; + } + case Common.XmlTagStandby: { - if (!InConfiguration) - { - GUIGraphicsContext.ResetLastActivity(); - // Stop all media before suspending or hibernating - g_Player.Stop(); - - GUIMessage msg; - - if (_mpBasicHome) - msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW, 0, 0, 0, (int)GUIWindow.Window.WINDOW_SECOND_HOME, 0, null); - else - msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW, 0, 0, 0, (int)GUIWindow.Window.WINDOW_HOME, 0, null); - - GUIWindowManager.SendThreadMessage(msg); - - MCEReplacement.OnSuspend(); - WindowsController.ExitWindows(RestartOptions.Suspend, true); - } + Standby(); break; } case Common.XmlTagHibernate: { - if (!InConfiguration) - { - GUIGraphicsContext.ResetLastActivity(); - // Stop all media before suspending or hibernating - g_Player.Stop(); - - GUIMessage msg; - - if (_mpBasicHome) - msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW, 0, 0, 0, (int)GUIWindow.Window.WINDOW_SECOND_HOME, 0, null); - else - msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW, 0, 0, 0, (int)GUIWindow.Window.WINDOW_HOME, 0, null); - - GUIWindowManager.SendThreadMessage(msg); - - MCEReplacement.OnSuspend(); - WindowsController.ExitWindows(RestartOptions.Hibernate, true); - } + Hibernate(); break; } - case Common.XmlTagReboot: + case Common.XmlTagShutdown: { - if (!InConfiguration) - GUIGraphicsContext.OnAction(new Action(Action.ActionType.ACTION_REBOOT, 0, 0)); + ShutDown(); break; } - case Common.XmlTagShutdown: + case Common.XmlTagReboot: { - if (!InConfiguration) - GUIGraphicsContext.OnAction(new Action(Action.ActionType.ACTION_SHUTDOWN, 0, 0)); + Reboot(); break; } } @@ -1772,6 +1789,37 @@ } /// <summary> + /// Learn an IR command. + /// </summary> + /// <param name="fileName">File to place learned IR command in (absolute path).</param> + /// <returns>true if successful, otherwise false.</returns> + internal static IRServerPluginInterface.LearnStatus LearnIR(string fileName) + { + IRServerPluginInterface.LearnStatus status = IRServerPluginInterface.LearnStatus.Failure; + + try + { + byte[] data; + status = _mceTransceiver.Learn(out data); + + if (status == IRServerPluginInterface.LearnStatus.Success) + { + if (data == null || data.Length == 0) + throw new ApplicationException("No data learned"); + + using (FileStream file = File.Create(fileName)) + file.Write(data, 0, data.Length); + } + } + catch (Exception ex) + { + Log.Error("MCEReplacement: LearnIRCommand() {0}", ex.ToString()); + } + + return status; + } + + /// <summary> /// Blast an IR command. /// </summary> /// <param name="fileName">File to blast (absolute path).</param> @@ -1827,7 +1875,7 @@ string[] commands = Common.SplitBlastCommand(command.Substring(Common.CmdPrefixBlast.Length)); BlastIR(IRFolder + commands[0] + Common.FileExtensionIR, commands[1]); } - else if (command.StartsWith(Common.CmdPrefixSTB)) // STB IR Code + else if (command.StartsWith(Common.CmdPrefixSTB, StringComparison.InvariantCultureIgnoreCase)) // STB IR Code { string[] commands = Common.SplitBlastCommand(command.Substring(Common.CmdPrefixSTB.Length)); BlastIR(STBFolder + commands[0] + Common.FileExtensionIR, commands[1]); @@ -1855,45 +1903,40 @@ else Common.ProcessKeyCommand(keyCommand); } - else if (command.StartsWith(Common.CmdPrefixGoto, StringComparison.InvariantCultureIgnoreCase)) // Go To Screen + else if (command.StartsWith(Common.CmdPrefixMouse, StringComparison.InvariantCultureIgnoreCase)) // Mouse Command { - MPCommands.ProcessGoTo(command.Substring(Common.CmdPrefixGoto.Length), MP_BasicHome); + string mouseCommand = command.Substring(Common.CmdPrefixMouse.Length); + Common.ProcessMouseCommand(mouseCommand); } - else + else if (command.StartsWith(Common.CmdPrefixEject, StringComparison.InvariantCultureIgnoreCase)) // Eject Command { - throw new ArgumentException(String.Format("Cannot process unrecognized command \"{0}\"", command), "command"); + string ejectCommand = command.Substring(Common.CmdPrefixEject.Length); + Common.ProcessEjectCommand(ejectCommand); } - } - - /// <summary> - /// Learn an IR Command and put it in a file. - /// </summary> - /// <param name="fileName">File to place learned IR command in (absolute path).</param> - /// <returns>true if successful, otherwise false.</returns> - internal static IRServerPluginInterface.LearnStatus LearnIRCommand(string fileName) - { - IRServerPluginInterface.LearnStatus status = IRServerPluginInterface.LearnStatus.Failure; - - try + else if (command.StartsWith(Common.CmdPrefixHibernate, StringComparison.InvariantCultureIgnoreCase)) // Hibernate Command { - byte[] data; - status = _mceTransceiver.Learn(out data); - - if (status == IRServerPluginInterface.LearnStatus.Success) - { - if (data == null || data.Length == 0) - throw new ApplicationException("No data learned"); - - using (FileStream file = File.Create(fileName)) - file.Write(data, 0, data.Length); - } + Hibernate(); } - catch (Exception ex) + else if (command.StartsWith(Common.CmdPrefixReboot, StringComparison.InvariantCultureIgnoreCase)) // Reboot Command { - Log.Error("MCEReplacement: LearnIRCommand() {0}", ex.ToString()); + Reboot(); } - - return status; + else if (command.StartsWith(Common.CmdPrefixShutdown, StringComparison.InvariantCultureIgnoreCase)) // Shutdown Command + { + ShutDown(); + } + else if (command.StartsWith(Common.CmdPrefixStandby, StringComparison.InvariantCultureIgnoreCase)) // Standby Command + { + Standby(); + } + else if (command.StartsWith(Common.CmdPrefixGoto, StringComparison.InvariantCultureIgnoreCase)) // Go To Screen + { + MPCommon.ProcessGoTo(command.Substring(Common.CmdPrefixGoto.Length), MP_BasicHome); + } + else + { + throw new ArgumentException(String.Format("Cannot process unrecognized command \"{0}\"", command), "command"); + } } /// <summary> @@ -1976,7 +2019,7 @@ { try { - using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(MPConfigFile)) + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(MPCommon.MPConfigFile)) { LogVerbose = xmlreader.GetValueAsBool("MCEReplacement", "LogVerbose", false); RequireFocus = xmlreader.GetValueAsBool("MCEReplacement", "RequireFocus", false); @@ -2009,7 +2052,7 @@ { try { - using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(MPConfigFile)) + using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(MPCommon.MPConfigFile)) { xmlwriter.SetValueAsBool("MCEReplacement", "LogVerbose", LogVerbose); xmlwriter.SetValueAsBool("MCEReplacement", "RequireFocus", RequireFocus); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-11-27 15:53:10
|
Revision: 1092 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1092&view=rev Author: and-81 Date: 2007-11-27 07:53:02 -0800 (Tue, 27 Nov 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs trunk/plugins/MCEReplacement/Forms/MacroEditor.cs trunk/plugins/MCEReplacement/Forms/SetupForm.cs trunk/plugins/MCEReplacement/InputMapper/InputHandler.cs trunk/plugins/MCEReplacement/MCEReplacement.cs Modified: trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs 2007-11-27 15:50:44 UTC (rev 1091) +++ trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs 2007-11-27 15:53:02 UTC (rev 1092) @@ -153,7 +153,7 @@ else if (setup.PreChangeCommand.StartsWith(Common.CmdPrefixSerial)) ProcessSerialCommand(setup.PreChangeCommand.Substring(Common.CmdPrefixSerial.Length), -1, channel); else - MCEReplacement.ProcessCommand(setup.PreChangeCommand); + MCEReplacement.ProcessCommand(setup.PreChangeCommand, false); if (setup.PauseTime > 0) Thread.Sleep(setup.PauseTime); @@ -171,7 +171,7 @@ else if (command.StartsWith(Common.CmdPrefixSerial)) ProcessSerialCommand(command.Substring(Common.CmdPrefixSerial.Length), charVal, channel); else - MCEReplacement.ProcessCommand(command); + MCEReplacement.ProcessCommand(command, false); if (setup.PauseTime > 0) Thread.Sleep(setup.PauseTime); @@ -206,14 +206,14 @@ } else { - MCEReplacement.ProcessCommand(setup.SelectCommand); + MCEReplacement.ProcessCommand(setup.SelectCommand, false); if (setup.DoubleChannelSelect) { if (setup.PauseTime > 0) Thread.Sleep(setup.PauseTime); - MCEReplacement.ProcessCommand(setup.SelectCommand); + MCEReplacement.ProcessCommand(setup.SelectCommand, false); } } } Modified: trunk/plugins/MCEReplacement/Forms/MacroEditor.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/MacroEditor.cs 2007-11-27 15:50:44 UTC (rev 1091) +++ trunk/plugins/MCEReplacement/Forms/MacroEditor.cs 2007-11-27 15:53:02 UTC (rev 1092) @@ -543,7 +543,7 @@ try { - MCEReplacement.ProcessMacro(fileName); + MCEReplacement.ProcessCommand(Common.CmdPrefixMacro + name, false); } catch (Exception ex) { Modified: trunk/plugins/MCEReplacement/Forms/SetupForm.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/SetupForm.cs 2007-11-27 15:50:44 UTC (rev 1091) +++ trunk/plugins/MCEReplacement/Forms/SetupForm.cs 2007-11-27 15:53:02 UTC (rev 1092) @@ -440,9 +440,7 @@ try { - string fileName = MCEReplacement.MacroFolder + listViewMacro.SelectedItems[0].Text + Common.FileExtensionMacro; - - MCEReplacement.ProcessMacro(fileName); + MCEReplacement.ProcessCommand(Common.CmdPrefixMacro + listViewMacro.SelectedItems[0].Text, false); } catch (Exception ex) { Modified: trunk/plugins/MCEReplacement/InputMapper/InputHandler.cs =================================================================== --- trunk/plugins/MCEReplacement/InputMapper/InputHandler.cs 2007-11-27 15:50:44 UTC (rev 1091) +++ trunk/plugins/MCEReplacement/InputMapper/InputHandler.cs 2007-11-27 15:53:02 UTC (rev 1092) @@ -413,7 +413,7 @@ } break; case "BLAST": - MCEReplacement.ProcessCommand(map.CmdProperty); + MCEReplacement.ProcessCommand(map.CmdProperty, true); break; default: return false; Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-11-27 15:50:44 UTC (rev 1091) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-11-27 15:53:02 UTC (rev 1092) @@ -108,7 +108,7 @@ static int[] _mceRemoteMap; static int[] _differentRemoteMap; - static List<string> _macroStack; + static Hashtable _macroStacks; #endregion Variables @@ -340,6 +340,9 @@ Log.Info("MCEReplacement: Starting ({0})", PluginVersion); + // Hashtable for storing active macro stacks in. + _macroStacks = new Hashtable(); + // Load basic settings LoadSettings(); @@ -1137,7 +1140,7 @@ try { - ProcessCommand(mappedEvent.Command); + ProcessCommand(mappedEvent.Command, false); } catch (Exception ex) { @@ -1165,7 +1168,7 @@ try { - ProcessCommand(mappedEvent.Command); + ProcessCommand(mappedEvent.Command, false); } catch (Exception ex) { @@ -1241,7 +1244,7 @@ else if (command.StartsWith(Common.CmdPrefixSerial)) ProcessExternalSerialCommand(command.Substring(Common.CmdPrefixSerial.Length), -1, channel.ToString()); else - ProcessCommand(command); + ProcessCommand(command, false); if (config.PauseTime > 0) Thread.Sleep(config.PauseTime); @@ -1260,7 +1263,7 @@ else if (command.StartsWith(Common.CmdPrefixSerial)) ProcessExternalSerialCommand(command.Substring(Common.CmdPrefixSerial.Length), charVal, channel.ToString()); else - ProcessCommand(command); + ProcessCommand(command, false); if (config.PauseTime > 0) Thread.Sleep(config.PauseTime); @@ -1298,14 +1301,14 @@ } else { - ProcessCommand(command); + ProcessCommand(command, false); if (config.DoubleChannelSelect) { if (config.PauseTime > 0) Thread.Sleep(config.PauseTime); - ProcessCommand(command); + ProcessCommand(command, false); } } } @@ -1416,118 +1419,199 @@ MapEvent(MappedEvent.MappingEvent.PC_Resume); } - static void Hibernate() + /// <summary> + /// Learn an IR command. + /// </summary> + /// <param name="fileName">File to place learned IR command in (absolute path).</param> + /// <returns>true if successful, otherwise false.</returns> + internal static IRServerPluginInterface.LearnStatus LearnIR(string fileName) { - if (InConfiguration) - return; + IRServerPluginInterface.LearnStatus status = IRServerPluginInterface.LearnStatus.Failure; - GUIGraphicsContext.ResetLastActivity(); - // Stop all media before hibernating - g_Player.Stop(); + try + { + byte[] data; + status = _mceTransceiver.Learn(out data); - GUIMessage msg; + if (status == IRServerPluginInterface.LearnStatus.Success) + { + if (data == null || data.Length == 0) + throw new ApplicationException("No data learned"); - if (_mpBasicHome) - msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW, 0, 0, 0, (int)GUIWindow.Window.WINDOW_SECOND_HOME, 0, null); - else - msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW, 0, 0, 0, (int)GUIWindow.Window.WINDOW_HOME, 0, null); + using (FileStream file = File.Create(fileName)) + file.Write(data, 0, data.Length); + } + } + catch (Exception ex) + { + Log.Error("MCEReplacement: LearnIRCommand() {0}", ex.ToString()); + } - GUIWindowManager.SendThreadMessage(msg); - - OnSuspend(); - WindowsController.ExitWindows(RestartOptions.Hibernate, false); + return status; } - static void Standby() + /// <summary> + /// Blast an IR command. + /// </summary> + /// <param name="fileName">File to blast (absolute path).</param> + /// <param name="port">Port to blast to.</param> + internal static void BlastIR(string fileName, string port) { - if (InConfiguration) - return; + try + { + using (FileStream file = File.OpenRead(fileName)) + { + if (file.Length == 0) + { + Log.Error("MCEReplacement: IR file \"{0}\" has no data, possible IR learn failure", fileName); + return; + } - GUIGraphicsContext.ResetLastActivity(); - // Stop all media before suspending - g_Player.Stop(); + byte[] bytes = new byte[file.Length]; + file.Read(bytes, 0, (int)file.Length); - GUIMessage msg; + if (_mceTransceiver.Transmit(port, bytes)) + { + if (LogVerbose) + Log.Info("MCEReplacement: Blast successful"); - if (_mpBasicHome) - msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW, 0, 0, 0, (int)GUIWindow.Window.WINDOW_SECOND_HOME, 0, null); - else - msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW, 0, 0, 0, (int)GUIWindow.Window.WINDOW_HOME, 0, null); + return; + } + } + } + catch (Exception ex) + { + Log.Error("MCEReplacement: BlastIR() {0}", ex.ToString()); + } - GUIWindowManager.SendThreadMessage(msg); - - OnSuspend(); - WindowsController.ExitWindows(RestartOptions.Suspend, false); + Log.Error("MCEReplacement: Failed to blast IR file \"{0}\"", fileName); } - static void Reboot() - { - if (!InConfiguration) - GUIGraphicsContext.OnAction(new Action(Action.ActionType.ACTION_SHUTDOWN, 0, 0)); - } - - static void ShutDown() - { - if (!InConfiguration) - GUIGraphicsContext.OnAction(new Action(Action.ActionType.ACTION_REBOOT, 0, 0)); - } - /// <summary> - /// Adds to the Macro Stack. + /// Given a command this method processes the request accordingly. /// </summary> - /// <param name="fileName">Name of the macro file.</param> - static void MacroStackAdd(string fileName) + /// <param name="command">Command to process.</param> + /// <param name="async">Process command asynchronously?</param> + internal static void ProcessCommand(string command, bool async) { - string upperCasedFileName = fileName.ToUpperInvariant(); + if (String.IsNullOrEmpty(command)) + throw new ArgumentNullException("command"); - if (_macroStack == null) + if (async) { - _macroStack = new List<string>(); + Thread newThread = new Thread(new ParameterizedThreadStart(ProcCommand)); + newThread.Name = "ProcessCommand"; + newThread.Priority = ThreadPriority.BelowNormal; + newThread.Start(command); } - else if (_macroStack.Contains(upperCasedFileName)) + else { - StringBuilder macroStackTrace = new StringBuilder(); - macroStackTrace.AppendLine("Macro infinite loop detected!"); - macroStackTrace.AppendLine(); - macroStackTrace.AppendLine("Stack trace:"); - - foreach (string macro in _macroStack) - { - if (macro.Equals(upperCasedFileName)) - macroStackTrace.AppendLine(String.Format("--> {0}", macro)); - else - macroStackTrace.AppendLine(macro); - } - - macroStackTrace.AppendLine(String.Format("--> {0}", upperCasedFileName)); - - throw new ApplicationException(macroStackTrace.ToString()); + ProcCommand(command); } + } - _macroStack.Add(upperCasedFileName); - } /// <summary> - /// Removes from the Macro Stack. + /// Used by ProcessCommand to actually handle the command. + /// Can be called Synchronously or as a Parameterized Thread. /// </summary> - /// <param name="fileName">Name of the macro file.</param> - static void MacroStackRemove(string fileName) + /// <param name="commandObj">Command string to process.</param> + static void ProcCommand(object commandObj) { - string upperCasedFileName = fileName.ToUpperInvariant(); + string command = commandObj as string; - if (_macroStack.Contains(upperCasedFileName)) - _macroStack.Remove(upperCasedFileName); - - if (_macroStack.Count == 0) - _macroStack = null; + if (command.StartsWith(Common.CmdPrefixMacro, StringComparison.OrdinalIgnoreCase)) + { + string fileName = MacroFolder + command.Substring(Common.CmdPrefixMacro.Length) + Common.FileExtensionMacro; + ProcMacro(fileName); + } + else if (command.StartsWith(Common.CmdPrefixBlast, StringComparison.OrdinalIgnoreCase)) + { + string[] commands = Common.SplitBlastCommand(command.Substring(Common.CmdPrefixBlast.Length)); + BlastIR(IRFolder + commands[0] + Common.FileExtensionIR, commands[1]); + } + else if (command.StartsWith(Common.CmdPrefixSTB, StringComparison.OrdinalIgnoreCase)) + { + string[] commands = Common.SplitBlastCommand(command.Substring(Common.CmdPrefixSTB.Length)); + BlastIR(STBFolder + commands[0] + Common.FileExtensionIR, commands[1]); + } + else if (command.StartsWith(Common.CmdPrefixRun, StringComparison.OrdinalIgnoreCase)) + { + string[] commands = Common.SplitRunCommand(command.Substring(Common.CmdPrefixRun.Length)); + Common.ProcessRunCommand(commands); + } + else if (command.StartsWith(Common.CmdPrefixSerial, StringComparison.OrdinalIgnoreCase)) + { + string[] commands = Common.SplitSerialCommand(command.Substring(Common.CmdPrefixSerial.Length)); + Common.ProcessSerialCommand(commands); + } + else if (command.StartsWith(Common.CmdPrefixWindowMsg, StringComparison.OrdinalIgnoreCase)) + { + string[] commands = Common.SplitWindowMessageCommand(command.Substring(Common.CmdPrefixWindowMsg.Length)); + Common.ProcessWindowMessageCommand(commands); + } + else if (command.StartsWith(Common.CmdPrefixKeys, StringComparison.OrdinalIgnoreCase)) + { + string keyCommand = command.Substring(Common.CmdPrefixKeys.Length); + if (InConfiguration) + MessageBox.Show(keyCommand, Common.UITextKeys, MessageBoxButtons.OK, MessageBoxIcon.Information); + else + Common.ProcessKeyCommand(keyCommand); + } + else if (command.StartsWith(Common.CmdPrefixMouse, StringComparison.OrdinalIgnoreCase)) + { + string mouseCommand = command.Substring(Common.CmdPrefixMouse.Length); + Common.ProcessMouseCommand(mouseCommand); + } + else if (command.StartsWith(Common.CmdPrefixEject, StringComparison.OrdinalIgnoreCase)) + { + string ejectCommand = command.Substring(Common.CmdPrefixEject.Length); + Common.ProcessEjectCommand(ejectCommand); + } + else if (command.StartsWith(Common.CmdPrefixHibernate, StringComparison.OrdinalIgnoreCase)) + { + if (InConfiguration) + MessageBox.Show("Cannot Hibernate in configuration", Common.UITextHibernate, MessageBoxButtons.OK, MessageBoxIcon.Information); + else + MPCommon.Hibernate(); + } + else if (command.StartsWith(Common.CmdPrefixReboot, StringComparison.OrdinalIgnoreCase)) + { + if (InConfiguration) + MessageBox.Show("Cannot Reboot in configuration", Common.UITextReboot, MessageBoxButtons.OK, MessageBoxIcon.Information); + else + MPCommon.Reboot(); + } + else if (command.StartsWith(Common.CmdPrefixShutdown, StringComparison.OrdinalIgnoreCase)) + { + if (InConfiguration) + MessageBox.Show("Cannot Shutdown in configuration", Common.UITextShutdown, MessageBoxButtons.OK, MessageBoxIcon.Information); + else + MPCommon.ShutDown(); + } + else if (command.StartsWith(Common.CmdPrefixStandby, StringComparison.OrdinalIgnoreCase)) + { + if (InConfiguration) + MessageBox.Show("Cannot enter Standby in configuration", Common.UITextStandby, MessageBoxButtons.OK, MessageBoxIcon.Information); + else + MPCommon.Standby(); + } + else if (command.StartsWith(Common.CmdPrefixGoto, StringComparison.OrdinalIgnoreCase)) + { + MPCommon.ProcessGoTo(command.Substring(Common.CmdPrefixGoto.Length), MP_BasicHome); + } + else + { + throw new ArgumentException(String.Format("Cannot process unrecognized command \"{0}\"", command), "command"); + } } /// <summary> /// Process the supplied Macro file. /// </summary> /// <param name="fileName">Macro file to process (absolute path).</param> - internal static void ProcessMacro(string fileName) + static void ProcMacro(string fileName) { - MacroStackAdd(fileName); + MacroStackAdd(Thread.CurrentThread.ManagedThreadId, fileName); try { @@ -1545,7 +1629,7 @@ { case Common.XmlTagMacro: { - ProcessMacro(MacroFolder + commandProperty + Common.FileExtensionMacro); + ProcMacro(MacroFolder + commandProperty + Common.FileExtensionMacro); break; } @@ -1758,25 +1842,37 @@ case Common.XmlTagStandby: { - Standby(); + if (InConfiguration) + MessageBox.Show("Cannot enter Standby in configuration", Common.UITextStandby, MessageBoxButtons.OK, MessageBoxIcon.Information); + else + MPCommon.Standby(); break; } case Common.XmlTagHibernate: { - Hibernate(); + if (InConfiguration) + MessageBox.Show("Cannot Hibernate in configuration", Common.UITextHibernate, MessageBoxButtons.OK, MessageBoxIcon.Information); + else + MPCommon.Hibernate(); break; } case Common.XmlTagShutdown: { - ShutDown(); + if (InConfiguration) + MessageBox.Show("Cannot ShutDown in configuration", Common.UITextShutdown, MessageBoxButtons.OK, MessageBoxIcon.Information); + else + MPCommon.ShutDown(); break; } case Common.XmlTagReboot: { - Reboot(); + if (InConfiguration) + MessageBox.Show("Cannot Reboot in configuration", Common.UITextReboot, MessageBoxButtons.OK, MessageBoxIcon.Information); + else + MPCommon.Reboot(); break; } } @@ -1784,161 +1880,81 @@ } finally { - MacroStackRemove(fileName); + MacroStackRemove(Thread.CurrentThread.ManagedThreadId, fileName); } } - + /// <summary> - /// Learn an IR command. + /// Retreives the required Macro Stack from the Hashtable. /// </summary> - /// <param name="fileName">File to place learned IR command in (absolute path).</param> - /// <returns>true if successful, otherwise false.</returns> - internal static IRServerPluginInterface.LearnStatus LearnIR(string fileName) + /// <param name="hash">Hash table lookup value.</param> + /// <returns>Macro Stack.</returns> + static List<string> GetMacroStack(int hash) { - IRServerPluginInterface.LearnStatus status = IRServerPluginInterface.LearnStatus.Failure; - - try + if (_macroStacks.ContainsKey(hash)) { - byte[] data; - status = _mceTransceiver.Learn(out data); - - if (status == IRServerPluginInterface.LearnStatus.Success) - { - if (data == null || data.Length == 0) - throw new ApplicationException("No data learned"); - - using (FileStream file = File.Create(fileName)) - file.Write(data, 0, data.Length); - } + return (List<string>)_macroStacks[hash]; } - catch (Exception ex) + else { - Log.Error("MCEReplacement: LearnIRCommand() {0}", ex.ToString()); + List<string> newStack = new List<string>(); + _macroStacks.Add(hash, newStack); + return newStack; } - - return status; } /// <summary> - /// Blast an IR command. + /// Adds to the Macro Stack. /// </summary> - /// <param name="fileName">File to blast (absolute path).</param> - /// <param name="port">Port to blast to.</param> - internal static void BlastIR(string fileName, string port) + /// <param name="hash">Hash table lookup value.</param> + /// <param name="fileName">Name of the macro file.</param> + static void MacroStackAdd(int hash, string fileName) { - try + List<string> stack = GetMacroStack(hash); + + string upperCasedFileName = fileName.ToUpperInvariant(); + + if (stack.Contains(upperCasedFileName)) { - using (FileStream file = File.OpenRead(fileName)) + StringBuilder macroStackTrace = new StringBuilder(); + macroStackTrace.AppendLine("Macro infinite loop detected!"); + macroStackTrace.AppendLine(); + macroStackTrace.AppendLine("Stack trace:"); + + foreach (string macro in stack) { - if (file.Length == 0) - { - Log.Error("MCEReplacement: IR file \"{0}\" has no data, possible IR learn failure", fileName); - return; - } + if (macro.Equals(upperCasedFileName)) + macroStackTrace.AppendLine(String.Format("--> {0}", macro)); + else + macroStackTrace.AppendLine(macro); + } - byte[] bytes = new byte[file.Length]; - file.Read(bytes, 0, (int)file.Length); + macroStackTrace.AppendLine(String.Format("--> {0}", upperCasedFileName)); - if (_mceTransceiver.Transmit(port, bytes)) - { - if (LogVerbose) - Log.Info("MCEReplacement: Blast successful"); - - return; - } - } + throw new ApplicationException(macroStackTrace.ToString()); } - catch (Exception ex) - { - Log.Error("MCEReplacement: BlastIR() {0}", ex.ToString()); - } - Log.Error("MCEReplacement: Failed to blast IR file \"{0}\"", fileName); + stack.Add(upperCasedFileName); } /// <summary> - /// Given a command this method processes the request accordingly. + /// Removes from the Macro Stack. /// </summary> - /// <param name="command">Command to process.</param> - internal static void ProcessCommand(string command) + /// <param name="hash">Hash table lookup value.</param> + /// <param name="fileName">Name of the macro file.</param> + static void MacroStackRemove(int hash, string fileName) { - if (String.IsNullOrEmpty(command)) - throw new ArgumentNullException("command"); + List<string> stack = GetMacroStack(hash); - if (command.StartsWith(Common.CmdPrefixMacro, StringComparison.OrdinalIgnoreCase)) // Macro - { - string fileName = MacroFolder + command.Substring(Common.CmdPrefixMacro.Length) + Common.FileExtensionMacro; - ProcessMacro(fileName); - } - else if (command.StartsWith(Common.CmdPrefixBlast, StringComparison.OrdinalIgnoreCase)) // IR Code - { - string[] commands = Common.SplitBlastCommand(command.Substring(Common.CmdPrefixBlast.Length)); - BlastIR(IRFolder + commands[0] + Common.FileExtensionIR, commands[1]); - } - else if (command.StartsWith(Common.CmdPrefixSTB, StringComparison.OrdinalIgnoreCase)) // STB IR Code - { - string[] commands = Common.SplitBlastCommand(command.Substring(Common.CmdPrefixSTB.Length)); - BlastIR(STBFolder + commands[0] + Common.FileExtensionIR, commands[1]); - } - else if (command.StartsWith(Common.CmdPrefixRun, StringComparison.OrdinalIgnoreCase)) // External Program - { - string[] commands = Common.SplitRunCommand(command.Substring(Common.CmdPrefixRun.Length)); - Common.ProcessRunCommand(commands); - } - else if (command.StartsWith(Common.CmdPrefixSerial, StringComparison.OrdinalIgnoreCase)) // Serial Port Command - { - string[] commands = Common.SplitSerialCommand(command.Substring(Common.CmdPrefixSerial.Length)); - Common.ProcessSerialCommand(commands); - } - else if (command.StartsWith(Common.CmdPrefixWindowMsg, StringComparison.OrdinalIgnoreCase)) // Message Command - { - string[] commands = Common.SplitWindowMessageCommand(command.Substring(Common.CmdPrefixWindowMsg.Length)); - Common.ProcessWindowMessageCommand(commands); - } - else if (command.StartsWith(Common.CmdPrefixKeys, StringComparison.OrdinalIgnoreCase)) // Keystroke Command - { - string keyCommand = command.Substring(Common.CmdPrefixKeys.Length); - if (InConfiguration) - MessageBox.Show(keyCommand, Common.UITextKeys, MessageBoxButtons.OK, MessageBoxIcon.Information); - else - Common.ProcessKeyCommand(keyCommand); - } - else if (command.StartsWith(Common.CmdPrefixMouse, StringComparison.OrdinalIgnoreCase)) // Mouse Command - { - string mouseCommand = command.Substring(Common.CmdPrefixMouse.Length); - Common.ProcessMouseCommand(mouseCommand); - } - else if (command.StartsWith(Common.CmdPrefixEject, StringComparison.OrdinalIgnoreCase)) // Eject Command - { - string ejectCommand = command.Substring(Common.CmdPrefixEject.Length); - Common.ProcessEjectCommand(ejectCommand); - } - else if (command.StartsWith(Common.CmdPrefixHibernate, StringComparison.OrdinalIgnoreCase)) // Hibernate Command - { - Hibernate(); - } - else if (command.StartsWith(Common.CmdPrefixReboot, StringComparison.OrdinalIgnoreCase)) // Reboot Command - { - Reboot(); - } - else if (command.StartsWith(Common.CmdPrefixShutdown, StringComparison.OrdinalIgnoreCase)) // Shutdown Command - { - ShutDown(); - } - else if (command.StartsWith(Common.CmdPrefixStandby, StringComparison.OrdinalIgnoreCase)) // Standby Command - { - Standby(); - } - else if (command.StartsWith(Common.CmdPrefixGoto, StringComparison.OrdinalIgnoreCase)) // Go To Screen - { - MPCommon.ProcessGoTo(command.Substring(Common.CmdPrefixGoto.Length), MP_BasicHome); - } - else - { - throw new ArgumentException(String.Format("Cannot process unrecognized command \"{0}\"", command), "command"); - } + string upperCasedFileName = fileName.ToUpperInvariant(); + + if (stack.Contains(upperCasedFileName)) + stack.Remove(upperCasedFileName); + + if (stack.Count == 0) + _macroStacks.Remove(hash); } - + /// <summary> /// Returns a list of IR Commands /// </summary> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2008-01-04 23:08:48
|
Revision: 1205 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1205&view=rev Author: and-81 Date: 2008-01-04 15:08:43 -0800 (Fri, 04 Jan 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs trunk/plugins/MCEReplacement/Forms/MacroEditor.cs trunk/plugins/MCEReplacement/Forms/SetupForm.cs trunk/plugins/MCEReplacement/Forms/StbSetup.cs trunk/plugins/MCEReplacement/MCEReplacement.cs trunk/plugins/MCEReplacement/Properties/AssemblyInfo.cs Modified: trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs 2008-01-04 22:57:22 UTC (rev 1204) +++ trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs 2008-01-04 23:08:43 UTC (rev 1205) @@ -15,7 +15,6 @@ using IrssUtils; using MPUtils; -using MPUtils.Forms; namespace MediaPortal.Plugins { @@ -41,32 +40,34 @@ private void ExternalChannels_Load(object sender, EventArgs e) { - int cards = MCEReplacement.TvCardCount; + ArrayList cards = new ArrayList(); + MediaPortal.TV.Database.TVDatabase.GetCards(ref cards); - string cardName; - string cardNumber; + if (cards.Count == 0) + throw new ApplicationException("Cannot load external channel configurations, there are no TV cards registered"); - _tvCardTabs = new TabPage[cards]; - _tvCardStbSetups = new StbSetup[cards]; + _tvCardTabs = new TabPage[cards.Count]; + _tvCardStbSetups = new StbSetup[cards.Count]; comboBoxCopyFrom.Items.Clear(); - for (int index = 0; index < cards; index++) + int index = 0; + foreach (int cardId in cards) { - cardNumber = (index + 1).ToString(); - cardName = "TV Card " + cardNumber; + string cardName = String.Format("TV Card {0}", cardId); comboBoxCopyFrom.Items.Add(cardName); - _tvCardStbSetups[index] = new StbSetup(index); - _tvCardStbSetups[index].Name = "StbSetup" + cardNumber; + _tvCardStbSetups[index] = new StbSetup(cardId); + _tvCardStbSetups[index].Name = "StbSetup" + index; _tvCardStbSetups[index].Dock = DockStyle.Fill; - _tvCardStbSetups[index].TabIndex = 0; _tvCardTabs[index] = new TabPage(cardName); _tvCardTabs[index].Controls.Add(_tvCardStbSetups[index]); this.tabControlTVCards.TabPages.Add(_tvCardTabs[index]); + + index++; } comboBoxCopyFrom.SelectedIndex = 0; @@ -108,8 +109,14 @@ foreach (StbSetup setup in _tvCardStbSetups) setup.Save(); - for (int index = 0; index < MCEReplacement.TvCardCount; index++) - MCEReplacement.GetExternalChannelConfig(index).Save(); + ArrayList cards = new ArrayList(); + MediaPortal.TV.Database.TVDatabase.GetCards(ref cards); + + if (cards.Count == 0) + throw new ApplicationException("Cannot save external channel configurations, there are no TV cards registered"); + + foreach (int cardId in cards) + MCEReplacement.GetExternalChannelConfig(cardId).Save(); } catch (Exception ex) { Modified: trunk/plugins/MCEReplacement/Forms/MacroEditor.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/MacroEditor.cs 2008-01-04 22:57:22 UTC (rev 1204) +++ trunk/plugins/MCEReplacement/Forms/MacroEditor.cs 2008-01-04 23:08:43 UTC (rev 1205) @@ -122,7 +122,7 @@ } catch (Exception ex) { - Log.Error("MCEReplacement: {0}", ex.ToString()); + Log.Error(ex); } } @@ -146,7 +146,7 @@ } catch (Exception ex) { - Log.Error("MCEReplacement: {0}", ex.ToString()); + Log.Error(ex); } } @@ -327,7 +327,7 @@ } catch (Exception ex) { - Log.Error("MCEReplacement: {0}", ex.ToString()); + Log.Error(ex); MessageBox.Show(this, ex.Message, "Failed to add macro command", MessageBoxButtons.OK, MessageBoxIcon.Error); } } @@ -387,7 +387,7 @@ } catch (Exception ex) { - Log.Error("MCEReplacement: {0}", ex.ToString()); + Log.Error(ex); MessageBox.Show(this, ex.Message, "Test failed", MessageBoxButtons.OK, MessageBoxIcon.Error); } } @@ -422,7 +422,7 @@ } catch (Exception ex) { - Log.Error("MCEReplacement: {0}", ex.ToString()); + Log.Error(ex); MessageBox.Show(this, ex.Message, "Failed writing macro to file", MessageBoxButtons.OK, MessageBoxIcon.Error); } @@ -568,7 +568,7 @@ } catch (Exception ex) { - Log.Error("MCEReplacement: {0}", ex.ToString()); + Log.Error(ex); MessageBox.Show(this, ex.Message, "Failed to edit macro item", MessageBoxButtons.OK, MessageBoxIcon.Error); } } Modified: trunk/plugins/MCEReplacement/Forms/SetupForm.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/SetupForm.cs 2008-01-04 22:57:22 UTC (rev 1204) +++ trunk/plugins/MCEReplacement/Forms/SetupForm.cs 2008-01-04 23:08:43 UTC (rev 1205) @@ -127,7 +127,7 @@ } catch (Exception ex) { - Log.Error("MCEReplacement: {0}", ex.Message); + Log.Error(ex); MessageBox.Show(this, ex.Message, "MCE Replacement Plugin Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } @@ -334,7 +334,7 @@ } catch (Exception ex) { - Log.Error("MCEReplacement: {0}", ex.Message); + Log.Error(ex); } } @@ -355,6 +355,7 @@ } catch (Exception ex) { + Log.Error(ex); MessageBox.Show(this, ex.Message, "Failed to load help", MessageBoxButtons.OK, MessageBoxIcon.Error); } } @@ -444,6 +445,7 @@ } catch (Exception ex) { + Log.Error(ex); MessageBox.Show(this, ex.Message, "Test failed", MessageBoxButtons.OK, MessageBoxIcon.Error); } } @@ -723,8 +725,8 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); - MessageBox.Show(ex.ToString(), "Failed to rename file", MessageBoxButtons.OK, MessageBoxIcon.Error); + IrssLog.Error(ex); + MessageBox.Show(ex.Message, "Failed to rename file", MessageBoxButtons.OK, MessageBoxIcon.Error); } } private void listViewMacro_AfterLabelEdit(object sender, LabelEditEventArgs e) @@ -769,8 +771,8 @@ } catch (Exception ex) { - IrssLog.Error(ex.ToString()); - MessageBox.Show(ex.ToString(), "Failed to rename file", MessageBoxButtons.OK, MessageBoxIcon.Error); + IrssLog.Error(ex); + MessageBox.Show(ex.Message, "Failed to rename file", MessageBoxButtons.OK, MessageBoxIcon.Error); } } Modified: trunk/plugins/MCEReplacement/Forms/StbSetup.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/StbSetup.cs 2008-01-04 22:57:22 UTC (rev 1204) +++ trunk/plugins/MCEReplacement/Forms/StbSetup.cs 2008-01-04 23:08:43 UTC (rev 1205) @@ -24,7 +24,7 @@ #region Constants - const string parameterInfo = + const string ParameterInfo = @"%1 = Current channel number digit (-1 for Select/Pre-Change) %2 = Full channel number string %3 = Blaster port (0 = Both, 1 = Port 1, 2 = Port 2)"; @@ -150,9 +150,6 @@ { ExternalChannelConfig config = MCEReplacement.GetExternalChannelConfig(cardId); - if (config == null) - return; - // Setup command list. for (int i = 0; i < 10; i++) listViewExternalCommands.Items[i].SubItems[1].Text = config.Digits[i]; @@ -181,11 +178,6 @@ { ExternalChannelConfig config = MCEReplacement.GetExternalChannelConfig(cardId); - if (config == null) - return; - - config.CardId = cardId; - config.PauseTime = Decimal.ToInt32(numericUpDownPauseTime.Value); config.SendSelect = checkBoxSendSelect.Checked; config.DoubleChannelSelect = checkBoxDoubleSelect.Checked; @@ -372,7 +364,7 @@ { string[] commands = Common.SplitRunCommand(selected.Substring(Common.CmdPrefixRun.Length)); - ExternalProgram executeProgram = new ExternalProgram(commands, parameterInfo); + ExternalProgram executeProgram = new ExternalProgram(commands, ParameterInfo); if (executeProgram.ShowDialog(this) == DialogResult.OK) newCommand = Common.CmdPrefixRun + executeProgram.CommandString; } @@ -380,7 +372,7 @@ { string[] commands = Common.SplitSerialCommand(selected.Substring(Common.CmdPrefixSerial.Length)); - SerialCommand serialCommand = new SerialCommand(commands, parameterInfo); + SerialCommand serialCommand = new SerialCommand(commands, ParameterInfo); if (serialCommand.ShowDialog(this) == DialogResult.OK) newCommand = Common.CmdPrefixSerial + serialCommand.CommandString; } @@ -429,7 +421,7 @@ } catch (Exception ex) { - Log.Error("MCEReplacement: {0}", ex.ToString()); + Log.Error(ex); MessageBox.Show(this, ex.Message, "Failed to edit command", MessageBoxButtons.OK, MessageBoxIcon.Error); } } @@ -446,13 +438,13 @@ if (selected.Equals(Common.UITextRun, StringComparison.OrdinalIgnoreCase)) { - ExternalProgram externalProgram = new ExternalProgram(parameterInfo); + ExternalProgram externalProgram = new ExternalProgram(ParameterInfo); if (externalProgram.ShowDialog(this) == DialogResult.OK) newCommand = Common.CmdPrefixRun + externalProgram.CommandString; } else if (selected.Equals(Common.UITextSerial, StringComparison.OrdinalIgnoreCase)) { - SerialCommand serialCommand = new SerialCommand(parameterInfo); + SerialCommand serialCommand = new SerialCommand(ParameterInfo); if (serialCommand.ShowDialog(this) == DialogResult.OK) newCommand = Common.CmdPrefixSerial + serialCommand.CommandString; } @@ -512,7 +504,7 @@ } catch (Exception ex) { - Log.Error("MCEReplacement: {0}", ex.ToString()); + Log.Error(ex); MessageBox.Show(this, ex.Message, "Failed to set command", MessageBoxButtons.OK, MessageBoxIcon.Error); } } Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2008-01-04 22:57:22 UTC (rev 1204) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2008-01-04 23:08:43 UTC (rev 1205) @@ -43,7 +43,7 @@ /// <summary> /// The plugin version string. /// </summary> - internal const string PluginVersion = "MCE Replacement Plugin 1.0.4.0 for MediaPortal 0.2.3.0"; + internal const string PluginVersion = "MCE Replacement Plugin 1.0.4.1 for MediaPortal 0.2.3.0"; /// <summary> /// The wParam for Message Mode Windows Messages. @@ -289,24 +289,6 @@ } /// <summary> - /// Count of available TV Cards. - /// </summary> - internal static int TvCardCount - { - get - { - ArrayList cards = new ArrayList(); - MediaPortal.TV.Database.TVDatabase.GetCards(ref cards); - - int cardCount = cards.Count; - if (cardCount == 0) - cardCount = 1; - - return cardCount; - } - } - - /// <summary> /// Gets a value indicating whether MediaPortal has basic home enabled. /// </summary> /// <value><c>true</c> if MediaPortal has basic home enabled; otherwise, <c>false</c>.</value> @@ -383,7 +365,7 @@ } catch (Exception ex) { - Log.Error("MCEReplacement: {0}", ex.ToString()); + Log.Error(ex); } } @@ -489,7 +471,7 @@ LoadMultiMappings(); LoadExternalConfigs(); - InConfiguration = true; + _inConfiguration = true; if (MP_MCERemote) { @@ -524,7 +506,7 @@ } catch (Exception ex) { - Log.Error("MCEReplacement: ShowPlugin() - {0}", ex.ToString()); + Log.Error(ex); _mceTransceiver = null; } @@ -912,32 +894,32 @@ Log.Info("MCEReplacement: keyCode \"{0}\" was not handled", keyCode); } } + /// <summary> /// OnMessage is used to receive requests to Tune External Channels and for event mapping. /// </summary> /// <param name="msg">Message.</param> void OnMessage(GUIMessage msg) { - if (ControlExternalEnabled && msg.Message == GUIMessage.MessageType.GUI_MSG_TUNE_EXTERNAL_CHANNEL) + if (EventMapperEnabled) + MapEvent(msg); + + if (!ControlExternalEnabled || msg.Message != GUIMessage.MessageType.GUI_MSG_TUNE_EXTERNAL_CHANNEL) + return; + + Log.Info("MCEReplacement: Tune request - Card: {0}, Channel: {1}", msg.Label2, msg.Label); + + try { - if (LogVerbose) - Log.Info("MCEReplacement: Tune External Channel: {0}, Tuner card: {1}", msg.Label, msg.Label2); - - try - { - Thread newThread = new Thread(new ParameterizedThreadStart(ProcessExternalChannel)); - newThread.Name = "ProcessExternalChannel"; - newThread.Priority = ThreadPriority.BelowNormal; - newThread.Start(new string[] { msg.Label, msg.Label2 }); - } - catch (Exception ex) - { - Log.Error("MCEReplacement: {0}", ex.ToString()); - } + Thread newThread = new Thread(new ParameterizedThreadStart(ProcessExternalChannel)); + newThread.Name = "ProcessExternalChannel"; + newThread.IsBackground = true; + newThread.Start(new string[] { msg.Label, msg.Label2 }); } - - if (EventMapperEnabled) - MapEvent(msg); + catch (Exception ex) + { + Log.Error(ex); + } } /// <summary> @@ -945,25 +927,31 @@ /// </summary> static void LoadExternalConfigs() { - int cardCount = TvCardCount; + ArrayList cards = new ArrayList(); + MediaPortal.TV.Database.TVDatabase.GetCards(ref cards); - _externalChannelConfigs = new ExternalChannelConfig[cardCount]; + if (cards.Count == 0) + throw new ApplicationException("Cannot load external channel configurations, there are no TV cards registered"); - string fileName; - for (int index = 0; index < cardCount; index++) + _externalChannelConfigs = new ExternalChannelConfig[cards.Count]; + + int index = 0; + foreach (int cardId in cards) { - fileName = String.Format("{0}ExternalChannelConfig{1}.xml", AppDataFolder, Convert.ToString(index + 1)); + string fileName = String.Format("{0}ExternalChannelConfig{1}.xml", AppDataFolder, cardId); try { _externalChannelConfigs[index] = ExternalChannelConfig.Load(fileName); } catch (Exception ex) { + Log.Error(ex); + _externalChannelConfigs[index] = new ExternalChannelConfig(fileName); - Log.Error("MCEReplacement: {0}", ex.ToString()); } - _externalChannelConfigs[index].CardId = index; + _externalChannelConfigs[index].CardId = cardId; + index++; } } @@ -993,6 +981,8 @@ try { string[] data = args as string[]; + if (data == null) + throw new ArgumentException("Parameter is not of type string[]", "args"); int card = int.Parse(data[1]); @@ -1000,11 +990,8 @@ if (card < 0) card = 0; - if (card >= _externalChannelConfigs.Length) - throw new ArgumentException("Card number is higher than last card in list, reconfigure plugin TV cards.", "args"); + ExternalChannelConfig config = GetExternalChannelConfig(card); - ExternalChannelConfig config = _externalChannelConfigs[card]; - // Clean up the "data[0]" string into "channel". StringBuilder channel = new StringBuilder(); foreach (char digit in data[0]) @@ -1071,7 +1058,7 @@ } catch (Exception ex) { - Log.Error("MCEReplacement: {0}", ex.ToString()); + Log.Error(ex); } } @@ -1083,6 +1070,10 @@ /// <param name="channelFull">The channel full ID.</param> internal static void ProcessExternalCommand(string command, int channelDigit, string channelFull) { +#if DEBUG + Log.Debug("MCEReplacement: ProcessExternalCommand(\"{0}\", {1}, {2})", command, channelDigit, channelFull); +#endif + if (command.StartsWith(Common.CmdPrefixRun, StringComparison.OrdinalIgnoreCase)) { string[] commands = Common.SplitRunCommand(command.Substring(Common.CmdPrefixRun.Length)); @@ -1273,7 +1264,7 @@ } catch (Exception ex) { - Log.Error("MCEReplacement: {0}", ex.ToString()); + Log.Error(ex); } } @@ -1460,7 +1451,7 @@ /// Learn an IR command. /// </summary> /// <param name="fileName">File to place learned IR command in (absolute path).</param> - /// <returns>true if successful, otherwise false.</returns> + /// <returns><c>true</c> if successful, otherwise <c>false</c>.</returns> internal static IRServerPluginInterface.LearnStatus LearnIR(string fileName) { IRServerPluginInterface.LearnStatus status = IRServerPluginInterface.LearnStatus.Failure; @@ -1481,7 +1472,7 @@ } catch (Exception ex) { - Log.Error("MCEReplacement: LearnIRCommand() {0}", ex.ToString()); + Log.Error(ex); } return status; @@ -1531,12 +1522,12 @@ { Thread newThread = new Thread(new ParameterizedThreadStart(ProcCommand)); newThread.Name = ProcessCommandThreadName; - newThread.Priority = ThreadPriority.BelowNormal; + newThread.IsBackground = true; newThread.Start(command); } catch (Exception ex) { - Log.Error("MCEReplacement: {0}", ex.ToString()); + Log.Error(ex); } } else @@ -1592,6 +1583,16 @@ string[] commands = Common.SplitWindowMessageCommand(command.Substring(Common.CmdPrefixWindowMsg.Length)); Common.ProcessWindowMessageCommand(commands); } + else if (command.StartsWith(Common.CmdPrefixTcpMsg, StringComparison.OrdinalIgnoreCase)) + { + string[] commands = Common.SplitTcpMessageCommand(command.Substring(Common.CmdPrefixTcpMsg.Length)); + Common.ProcessTcpMessageCommand(commands); + } + else if (command.StartsWith(Common.CmdPrefixHttpMsg, StringComparison.OrdinalIgnoreCase)) + { + string[] commands = Common.SplitHttpMessageCommand(command.Substring(Common.CmdPrefixHttpMsg.Length)); + Common.ProcessHttpCommand(commands); + } else if (command.StartsWith(Common.CmdPrefixKeys, StringComparison.OrdinalIgnoreCase)) { string keyCommand = command.Substring(Common.CmdPrefixKeys.Length); @@ -1610,9 +1611,22 @@ string ejectCommand = command.Substring(Common.CmdPrefixEject.Length); Common.ProcessEjectCommand(ejectCommand); } + else if (command.StartsWith(Common.CmdPrefixPopup, StringComparison.OrdinalIgnoreCase)) + { + string[] commands = Common.SplitPopupCommand(command.Substring(Common.CmdPrefixPopup.Length)); + if (_inConfiguration) + MessageBox.Show(commands[1], commands[0], MessageBoxButtons.OK, MessageBoxIcon.Information); + else + MPCommon.ShowNotifyDialog(commands[0], commands[1], int.Parse(commands[2])); + } else if (command.StartsWith(Common.CmdPrefixGoto, StringComparison.OrdinalIgnoreCase)) { - MPCommon.ProcessGoTo(command.Substring(Common.CmdPrefixGoto.Length), _mpBasicHome); + string screenID = command.Substring(Common.CmdPrefixGoto.Length); + + if (_inConfiguration) + MessageBox.Show(screenID, Common.UITextGoto, MessageBoxButtons.OK, MessageBoxIcon.Information); + else + MPCommon.ProcessGoTo(screenID, _mpBasicHome); } else if (command.StartsWith(Common.CmdPrefixHibernate, StringComparison.OrdinalIgnoreCase)) { @@ -1676,7 +1690,7 @@ catch (Exception ex) { if (Thread.CurrentThread.Name.Equals(ProcessCommandThreadName, StringComparison.OrdinalIgnoreCase)) - Log.Error("MCEReplacement: {0}", ex.ToString()); + Log.Error(ex); else throw; } @@ -1880,7 +1894,7 @@ } catch (Exception ex) { - Log.Error("MCEReplacement: {0}", ex.ToString()); + Log.Error(ex); } } /// <summary> @@ -1908,7 +1922,7 @@ } catch (Exception ex) { - Log.Error("MCEReplacement: {0}", ex.ToString()); + Log.Error(ex); } } Modified: trunk/plugins/MCEReplacement/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/MCEReplacement/Properties/AssemblyInfo.cs 2008-01-04 22:57:22 UTC (rev 1204) +++ trunk/plugins/MCEReplacement/Properties/AssemblyInfo.cs 2008-01-04 23:08:43 UTC (rev 1205) @@ -34,8 +34,8 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.4.0")] -[assembly: AssemblyFileVersionAttribute("1.0.4.0")] +[assembly: AssemblyVersion("1.0.4.1")] +[assembly: AssemblyFileVersionAttribute("1.0.4.1")] // // In order to sign your assembly you must specify a key to use. Refer to the This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2008-01-07 00:49:44
|
Revision: 1217 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1217&view=rev Author: and-81 Date: 2008-01-06 16:49:42 -0800 (Sun, 06 Jan 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/MCEReplacement.cs trunk/plugins/MCEReplacement/MCEReplacement.csproj Added Paths: ----------- trunk/plugins/MCEReplacement/GenericPCQueue.cs Added: trunk/plugins/MCEReplacement/GenericPCQueue.cs =================================================================== --- trunk/plugins/MCEReplacement/GenericPCQueue.cs (rev 0) +++ trunk/plugins/MCEReplacement/GenericPCQueue.cs 2008-01-07 00:49:42 UTC (rev 1217) @@ -0,0 +1,220 @@ +using System; +using System.Collections.Generic; +#if TRACE +using System.Diagnostics; +#endif +using System.Threading; + +namespace MediaPortal.Plugins +{ + + #region Delegates + + /// <summary> + /// Delegate for GenericPCQueue sink. + /// </summary> + /// <param name="obj">Generic object to process.</param> + public delegate void GenericPCQueueSink<T>(T obj); + + #endregion Delegates + + /// <summary> + /// Implements a thread-safe Producer/Consumer Queue for generics. + /// </summary> + public class GenericPCQueue<T> : IDisposable + { + + #region Variables + + Thread _workerThread; + Queue<T> _queue; + object _queueLock; + EventWaitHandle _queueWaitHandle; + volatile bool _processQueue; + + GenericPCQueueSink<T> _sink; + + #endregion Variables + + #region Constructor + + /// <summary> + /// Create a new MessageQueue. + /// </summary> + /// <param name="sink">Where to send dequeued messages.</param> + public GenericPCQueue(GenericPCQueueSink<T> sink) + { + if (sink == null) + throw new ArgumentNullException("sink"); + + _sink = sink; + + // Create locking and control mechanisms ... + _queueLock = new object(); + _queueWaitHandle = new AutoResetEvent(false); + + // Create FIFO generic queue + _queue = new Queue<T>(); + } + + #endregion Constructor + + #region IDisposable + + /// <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(); + + _workerThread = null; + + _queue.Clear(); + _queue = null; + + _queueLock = null; + + _queueWaitHandle.Close(); + _queueWaitHandle = null; + } + + // Free native resources ... + + } + + #endregion IDisposable + + #region Implementation + + /// <summary> + /// Start processing the queue. + /// </summary> + public void Start() + { + if (_processQueue) + return; + + _processQueue = true; + + // Create the worker thread ... + _workerThread = new Thread(new ThreadStart(WorkerThread)); + _workerThread.Name = "GenericPCQueue"; + _workerThread.IsBackground = true; + + _workerThread.Start(); + } + + /// <summary> + /// Stop processing the queue. + /// </summary> + public void Stop() + { + if (!_processQueue) + return; + + // Signal the worker thread to stop ... + _processQueue = false; + _queueWaitHandle.Set(); + + // Join the worker thread and wait for it to finish ... + if (_workerThread != null && _workerThread.IsAlive && !_workerThread.Join(1000)) + { + _workerThread.Abort(); + _workerThread.Join(); + } + + _workerThread = null; + } + + /// <summary> + /// Add a generic object to the queue. + /// </summary> + /// <param name="obj">Generic object to place in the queue.</param> + public void Enqueue(T obj) + { + if (obj == null) + throw new ArgumentNullException("obj"); + + lock (_queueLock) + { + _queue.Enqueue(obj); + + _queueWaitHandle.Set(); + } + } + + /// <summary> + /// Clears the queue of any messages. + /// </summary> + public void ClearQueue() + { + lock (_queueLock) + { + _queue.Clear(); + } + } + + /// <summary> + /// Queue processing worker thread. + /// </summary> + void WorkerThread() + { + try + { + T obj = default(T); + bool didDequeue = false; + + while (_processQueue) + { + lock (_queueLock) + { + if (_queue.Count > 0) + { + obj = _queue.Dequeue(); + didDequeue = true; + } + } + + if (didDequeue) + { + _sink(obj); + obj = default(T); + didDequeue = false; + } + else + { + _queueWaitHandle.WaitOne(); + } + } + } +#if TRACE + catch (ThreadAbortException threadAbortException) + { + Trace.WriteLine(threadAbortException.ToString()); + } +#else + catch (ThreadAbortException) + { + } +#endif + } + + #endregion Implementation + + } + +} Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2008-01-07 00:48:54 UTC (rev 1216) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2008-01-07 00:49:42 UTC (rev 1217) @@ -114,6 +114,8 @@ static Hashtable _macroStacks; + GenericPCQueue<string> _buttonQueue; + #endregion Variables #region Properties @@ -354,6 +356,9 @@ if (ControlExternalEnabled) LoadExternalConfigs(); + _buttonQueue = new GenericPCQueue<string>(ProcessRemoteButton); + _buttonQueue.Start(); + // Load MicrosoftMceTransceiver if (!MessageModeEnabled && (MCERemoteEnabled || DifferentRemoteEnabled)) { @@ -411,6 +416,9 @@ _mceTransceiver.Stop(); } + _buttonQueue.Stop(); + _buttonQueue.Dispose(); + if (LogVerbose) Log.Info("MCEReplacement: Stopped"); } @@ -796,11 +804,22 @@ } /// <summary> - /// Handles remote buttons received. + /// Queues remote buttons received. /// </summary> /// <param name="remoteButton">The remote button.</param> void RemoteButtonReceived(string remoteButton) { + Log.Debug("MCEReplacement: RemoteButtonReceived({0})", remoteButton); + _buttonQueue.Enqueue(remoteButton); + } + + /// <summary> + /// Handles remote buttons received. + /// </summary> + /// <param name="remoteButton">The remote button.</param> + void ProcessRemoteButton(string remoteButton) + { + Log.Debug("MCEReplacement: ProcessRemoteButton({0})", remoteButton); int keyCode = int.Parse(remoteButton); // Handle MCE Remote button presses ... @@ -1174,7 +1193,7 @@ string setName = MultiMaps[_multiMappingSet]; if (LogVerbose) - Log.Info("MCEReplacement: Multi-Mapping has changed to \"{0}\"", setName); + Log.Info("MCEReplacement: Multi-Mapping has cycled to \"{0}\"", setName); MPCommon.ShowNotifyDialog("Multi-Mapping", setName, 2); } @@ -1194,7 +1213,7 @@ for (int index = 0; index < MultiMaps.Length; index++) { - if (MultiMaps[index].Equals(multiMapping, StringComparison.OrdinalIgnoreCase)) + if (MultiMaps[index].Equals(multiMapping, StringComparison.CurrentCultureIgnoreCase)) { _multiMappingSet = index; @@ -1205,10 +1224,11 @@ Log.Info("MCEReplacement: Multi-Mapping has changed to \"{0}\"", setName); MPCommon.ShowNotifyDialog("Multi-Mapping", setName, 2); - return; } } + + Log.Warn("MCEReplacement: Could not find Multi-Mapping \"{0}\"", multiMapping); } /// <summary> @@ -1379,7 +1399,6 @@ } } - /// <summary> /// Loads the default remote button input handler. /// </summary> @@ -1615,6 +1634,14 @@ string ejectCommand = command.Substring(Common.CmdPrefixEject.Length); Common.ProcessEjectCommand(ejectCommand); } + else if (command.StartsWith(Common.CmdPrefixMultiMap, StringComparison.OrdinalIgnoreCase)) + { + string multiMapping = command.Substring(Common.CmdPrefixMultiMap.Length); + if (_inConfiguration) + MessageBox.Show(multiMapping, "Change multi-mapping", MessageBoxButtons.OK, MessageBoxIcon.Information); + else + ChangeMultiMapping(multiMapping); + } else if (command.StartsWith(Common.CmdPrefixPopup, StringComparison.OrdinalIgnoreCase)) { string[] commands = Common.SplitPopupCommand(command.Substring(Common.CmdPrefixPopup.Length)); Modified: trunk/plugins/MCEReplacement/MCEReplacement.csproj =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.csproj 2008-01-07 00:48:54 UTC (rev 1216) +++ trunk/plugins/MCEReplacement/MCEReplacement.csproj 2008-01-07 00:49:42 UTC (rev 1217) @@ -94,6 +94,7 @@ <Compile Include="Forms\StbSetup.Designer.cs"> <DependentUpon>StbSetup.cs</DependentUpon> </Compile> + <Compile Include="GenericPCQueue.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Forms\MultiMapNameBox.cs"> <SubType>Form</SubType> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |