From: <mis...@us...> - 2009-05-31 13:14:38
|
Revision: 2876 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=2876&view=rev Author: misterd_sf Date: 2009-05-31 12:12:49 +0000 (Sun, 31 May 2009) Log Message: ----------- - Translator now works with PlayMovie - Added channel support to X10 - Fixed TV2 Blaster Plugin build - Fixed Mp Control Plugin after TVE2 removal Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Translator/Program.cs trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/X10 Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/X10Transceiver.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/InputMapper/InputHandler.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MP Control Plugin.csproj trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2 Blaster Plugin.csproj trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3 Blaster Plugin.csproj Added Paths: ----------- trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/Configure.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/Configure.resx Property Changed: ---------------- trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/ Modified: trunk/plugins/IR Server Suite/Applications/Translator/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2009-05-31 11:33:35 UTC (rev 2875) +++ trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2009-05-31 12:12:49 UTC (rev 2876) @@ -868,14 +868,25 @@ return null; } - string fileName = Path.GetFileName(process.MainModule.FileName); - + string fileName = string.Empty; + string processName = string.Empty; + try + { + fileName = Path.GetFileName(process.MainModule.FileName); + }catch + { + processName = Path.GetFileName(process.ProcessName); + } foreach (ProgramSettings progSettings in Config.Programs) { if (fileName.Equals(Path.GetFileName(progSettings.FileName), StringComparison.OrdinalIgnoreCase)) { return progSettings; } + if (processName.Equals(Path.GetFileName(progSettings.Name), StringComparison.OrdinalIgnoreCase)) + { + return progSettings; + } } } catch (Exception ex) Added: trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/Configure.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/Configure.Designer.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/Configure.Designer.cs 2009-05-31 12:12:49 UTC (rev 2876) @@ -0,0 +1,162 @@ +namespace InputService.Plugin +{ + partial class Configure + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.buttonOK = new System.Windows.Forms.Button(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.toolTips = new System.Windows.Forms.ToolTip(this.components); + this.numericUpDownButtonChannelNumber = new System.Windows.Forms.NumericUpDown(); + this.labelChannelNumber = new System.Windows.Forms.Label(); + this.labelUseChannelContrl = new System.Windows.Forms.Label(); + this.checkBoxUseChannelControl = new System.Windows.Forms.CheckBox(); + this.buttonGetChannelNumber = new System.Windows.Forms.Button(); + this.timer1 = new System.Windows.Forms.Timer(this.components); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownButtonChannelNumber)).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(137, 134); + this.buttonOK.Name = "buttonOK"; + this.buttonOK.Size = new System.Drawing.Size(64, 24); + this.buttonOK.TabIndex = 4; + this.buttonOK.Text = "OK"; + this.buttonOK.UseVisualStyleBackColor = true; + this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); + // + // buttonCancel + // + this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.buttonCancel.Location = new System.Drawing.Point(209, 134); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(64, 24); + this.buttonCancel.TabIndex = 5; + this.buttonCancel.Text = "Cancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); + // + // numericUpDownButtonChannelNumber + // + this.numericUpDownButtonChannelNumber.Location = new System.Drawing.Point(152, 35); + this.numericUpDownButtonChannelNumber.Maximum = new decimal(new int[] { + 100000, + 0, + 0, + 0}); + this.numericUpDownButtonChannelNumber.Name = "numericUpDownButtonChannelNumber"; + this.numericUpDownButtonChannelNumber.Size = new System.Drawing.Size(117, 20); + this.numericUpDownButtonChannelNumber.TabIndex = 1; + this.numericUpDownButtonChannelNumber.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.numericUpDownButtonChannelNumber.ThousandsSeparator = true; + this.toolTips.SetToolTip(this.numericUpDownButtonChannelNumber, "How long between repeated buttons (in milliseconds)"); + // + // labelChannelNumber + // + this.labelChannelNumber.Location = new System.Drawing.Point(12, 33); + this.labelChannelNumber.Name = "labelChannelNumber"; + this.labelChannelNumber.Size = new System.Drawing.Size(134, 20); + this.labelChannelNumber.TabIndex = 0; + this.labelChannelNumber.Text = "Channel number: "; + this.labelChannelNumber.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // labelUseChannelContrl + // + this.labelUseChannelContrl.Location = new System.Drawing.Point(12, 9); + this.labelUseChannelContrl.Name = "labelUseChannelContrl"; + this.labelUseChannelContrl.Size = new System.Drawing.Size(134, 20); + this.labelUseChannelContrl.TabIndex = 6; + this.labelUseChannelContrl.Text = "Use channel control:"; + this.labelUseChannelContrl.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // checkBoxUseChannelControl + // + this.checkBoxUseChannelControl.AutoSize = true; + this.checkBoxUseChannelControl.Location = new System.Drawing.Point(152, 12); + this.checkBoxUseChannelControl.Name = "checkBoxUseChannelControl"; + this.checkBoxUseChannelControl.Size = new System.Drawing.Size(15, 14); + this.checkBoxUseChannelControl.TabIndex = 7; + this.checkBoxUseChannelControl.UseVisualStyleBackColor = true; + this.checkBoxUseChannelControl.CheckedChanged += new System.EventHandler(this.checkBoxUseChannelControl_CheckedChanged); + // + // buttonGetChannelNumber + // + this.buttonGetChannelNumber.Location = new System.Drawing.Point(152, 61); + this.buttonGetChannelNumber.Name = "buttonGetChannelNumber"; + this.buttonGetChannelNumber.Size = new System.Drawing.Size(117, 23); + this.buttonGetChannelNumber.TabIndex = 8; + this.buttonGetChannelNumber.Text = "Get Channel number"; + this.buttonGetChannelNumber.UseVisualStyleBackColor = true; + this.buttonGetChannelNumber.Click += new System.EventHandler(this.buttonGetChannelNumber_Click); + // + // timer1 + // + this.timer1.Tick += new System.EventHandler(this.timer1_Tick); + // + // Configure + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(281, 167); + this.Controls.Add(this.buttonGetChannelNumber); + this.Controls.Add(this.checkBoxUseChannelControl); + this.Controls.Add(this.labelUseChannelContrl); + this.Controls.Add(this.labelChannelNumber); + this.Controls.Add(this.numericUpDownButtonChannelNumber); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.buttonOK); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(256, 164); + this.Name = "Configure"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "X10 Configuration"; + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownButtonChannelNumber)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button buttonOK; + private System.Windows.Forms.Button buttonCancel; + private System.Windows.Forms.ToolTip toolTips; + private System.Windows.Forms.Label labelChannelNumber; + private System.Windows.Forms.Label labelUseChannelContrl; + private System.Windows.Forms.CheckBox checkBoxUseChannelControl; + private System.Windows.Forms.NumericUpDown numericUpDownButtonChannelNumber; + private System.Windows.Forms.Button buttonGetChannelNumber; + private System.Windows.Forms.Timer timer1; + } +} \ No newline at end of file Added: trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/Configure.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/Configure.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/Configure.cs 2009-05-31 12:12:49 UTC (rev 2876) @@ -0,0 +1,155 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace InputService.Plugin +{ + + /// <summary> + /// Configure the HCW Transceiver plugin. + /// </summary> + partial class Configure : Form + { + #region variables + X10Transceiver x10Transceiver; + int count; + #endregion variables + + #region Properties + + /// <summary> + /// Gets or sets if channel control is used + /// </summary> + /// <value>Use channel control</value> + public bool UseChannelControl + { + get { + return checkBoxUseChannelControl.Checked; + } + set { + checkBoxUseChannelControl.Checked = value; + numericUpDownButtonChannelNumber.Enabled = checkBoxUseChannelControl.Checked; + buttonGetChannelNumber.Enabled = checkBoxUseChannelControl.Checked; + } + } + + /// <summary> + /// Gets or sets the channel number + /// </summary> + /// <value>The channel number</value> + public int ChannelNumber + { + get { + return Decimal.ToInt32(numericUpDownButtonChannelNumber.Value); + } + set { + numericUpDownButtonChannelNumber.Value = new Decimal(value); + } + } + + /// <summary> + /// Sets the corresponding X10Transceiver + /// </summary> + public X10Transceiver X10Transceiver + { + set { x10Transceiver = value; } + } + #endregion Properties + + #region Constructor + + /// <summary> + /// Initializes a new instance of the <see cref="Configure"/> class. + /// </summary> + public Configure() + { + InitializeComponent(); + } + + #endregion Constructor + + #region Buttons + + private void buttonOK_Click(object sender, EventArgs e) + { + this.DialogResult = DialogResult.OK; + this.Close(); + } + + private void buttonCancel_Click(object sender, EventArgs e) + { + this.DialogResult = DialogResult.Cancel; + this.Close(); + } + + private void checkBoxUseChannelControl_CheckedChanged(object sender, EventArgs e) + { + numericUpDownButtonChannelNumber.Enabled = checkBoxUseChannelControl.Checked; + buttonGetChannelNumber.Enabled = checkBoxUseChannelControl.Checked; + } + #endregion Buttons + + private void buttonGetChannelNumber_Click(object sender, EventArgs e) + { + try + { + x10Transceiver.StartGetChannelNumber(); + buttonOK.Enabled = false; + buttonCancel.Enabled = false; + buttonGetChannelNumber.Enabled = false; + numericUpDownButtonChannelNumber.Enabled = false; + checkBoxUseChannelControl.Enabled = false; + count = 0; + timer1.Start(); + } catch + { + MessageBox.Show("Error while starting X10 device", "X10 Configuration", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void timer1_Tick(object sender, EventArgs e) + { + int number = x10Transceiver.GetChannelNumber(); + if (number == -1) + { + count++; + if (count == 50) + { + timer1.Stop(); + try + { + x10Transceiver.StopGetChannelNumber(); + } finally + { + buttonOK.Enabled = true; + buttonCancel.Enabled = true; + buttonGetChannelNumber.Enabled = true; + numericUpDownButtonChannelNumber.Enabled = true; + checkBoxUseChannelControl.Enabled = true; + } + } + } else + { + timer1.Stop(); + try + { + x10Transceiver.StopGetChannelNumber(); + } finally + { + checkBoxUseChannelControl.Enabled = true; + numericUpDownButtonChannelNumber.Enabled = true; + numericUpDownButtonChannelNumber.Value = number; + buttonOK.Enabled = true; + buttonCancel.Enabled = true; + buttonGetChannelNumber.Enabled = true; + } + } + } + + + } + +} Added: trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/Configure.resx =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/Configure.resx (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/Configure.resx 2009-05-31 12:12:49 UTC (rev 2876) @@ -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="toolTips.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> + <metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>107, 17</value> + </metadata> +</root> \ No newline at end of file Modified: trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/Properties/Resources.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/Properties/Resources.Designer.cs 2009-05-31 11:33:35 UTC (rev 2875) +++ trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/Properties/Resources.Designer.cs 2009-05-31 12:12:49 UTC (rev 2876) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. -// Runtime Version:2.0.50727.832 +// Runtime Version:2.0.50727.1433 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. Modified: trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/X10 Transceiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/X10 Transceiver.csproj 2009-05-31 11:33:35 UTC (rev 2875) +++ trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/X10 Transceiver.csproj 2009-05-31 12:12:49 UTC (rev 2876) @@ -53,6 +53,12 @@ <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> + <Compile Include="Configure.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="Configure.Designer.cs"> + <DependentUpon>Configure.cs</DependentUpon> + </Compile> <Compile Include="Properties\Resources.Designer.cs"> <AutoGen>True</AutoGen> <DesignTime>True</DesignTime> @@ -72,6 +78,10 @@ <Content Include="Icon.ico" /> </ItemGroup> <ItemGroup> + <EmbeddedResource Include="Configure.resx"> + <DependentUpon>Configure.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> <EmbeddedResource Include="Properties\Resources.resx"> <SubType>Designer</SubType> <Generator>ResXFileCodeGenerator</Generator> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/X10Transceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/X10Transceiver.cs 2009-05-31 11:33:35 UTC (rev 2875) +++ trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/X10Transceiver.cs 2009-05-31 12:12:49 UTC (rev 2876) @@ -1,6 +1,10 @@ using System; using System.Drawing; +using System.IO; using System.Runtime.InteropServices.ComTypes; +using System.Text; +using System.Windows.Forms; +using System.Xml; using InputService.Plugin.Properties; using X10; @@ -9,8 +13,14 @@ /// <summary> /// IR Server Plugin for X10 Transceiver devices. /// </summary> - public class X10Transceiver : PluginBase, IRemoteReceiver, _DIX10InterfaceEvents + public class X10Transceiver : PluginBase, IRemoteReceiver, _DIX10InterfaceEvents, IConfigure { + #region Constants + + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "X10 Transceiver.xml"); + + #endregion Constants + #region Variables private static RemoteHandler _remoteButtonHandler; @@ -19,6 +29,9 @@ private IConnectionPoint icp; private IConnectionPointContainer icpc; private X10Interface X10Inter; + bool useChannelControl; + int channelNumber; + bool getChannelNumber; #endregion Variables @@ -87,6 +100,17 @@ { try { + if (getChannelNumber) + { + channelNumber = lAddress; + getChannelNumber = false; + return; + } + if (useChannelControl && (lAddress != channelNumber)) + { + return; + } + string keyCode = Enum.GetName(typeof (EX10Command), eCommand); if (RemoteCallback != null) @@ -162,6 +186,7 @@ /// </summary> public override void Start() { + LoadSettings(); X10Inter = new X10Interface(); if (X10Inter == null) throw new InvalidOperationException("Failed to start X10 interface"); @@ -201,5 +226,110 @@ X10Inter = null; } } + + /// <summary> + /// Starts to wait for the channel number + /// </summary> + public void StartGetChannelNumber() + { + Start(); + getChannelNumber = true; + channelNumber = -1; + } + + /// <summary> + /// Get the found channel number + /// </summary> + public int GetChannelNumber() + { + return channelNumber; + } + + /// <summary> + /// Stops to wait for the channel number + /// </summary> + public void StopGetChannelNumber() + { + getChannelNumber = false; + LoadSettings(); + Stop(); + } + + void LoadSettings() + { + try + { + getChannelNumber = false; + XmlDocument doc = new XmlDocument(); + doc.Load(ConfigurationFile); + + useChannelControl = bool.Parse(doc.DocumentElement.Attributes["useChannelControl"].Value); + channelNumber = int.Parse(doc.DocumentElement.Attributes["channelNumber"].Value); + } +#if TRACE + catch (Exception ex) + { + Trace.WriteLine(ex.ToString()); +#else + catch + { +#endif + useChannelControl = false; + channelNumber = 0; + } + } + + void SaveSettings() + { + try + { + XmlTextWriter writer = new XmlTextWriter(ConfigurationFile, Encoding.UTF8); + writer.Formatting = Formatting.Indented; + writer.Indentation = 1; + writer.IndentChar = (char)9; + writer.WriteStartDocument(true); + writer.WriteStartElement("settings"); // <settings> + + writer.WriteAttributeString("useChannelControl", useChannelControl.ToString()); + writer.WriteAttributeString("channelNumber", channelNumber.ToString()); + + writer.WriteEndElement(); // </settings> + writer.WriteEndDocument(); + writer.Close(); + } +#if TRACE + catch (Exception ex) + { + Trace.WriteLine(ex.ToString()); + } +#else + catch + { + } +#endif + } + + /// <summary> + /// Configure the IR Server plugin. + /// </summary> + /// <param name="owner">The owner window to use for creating modal dialogs.</param> + public void Configure(IWin32Window owner) + { + LoadSettings(); + + Configure config = new Configure(); + + config.UseChannelControl = useChannelControl; + config.ChannelNumber = channelNumber; + config.X10Transceiver = this; + if (config.ShowDialog(owner) == DialogResult.OK) + { + useChannelControl = config.UseChannelControl; + channelNumber = config.ChannelNumber; + SaveSettings(); + } + } + + } } \ No newline at end of file Property changes on: trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin ___________________________________________________________________ Modified: svn:ignore - *.suo *.user thumbs.db bin obj + *.suo *.user thumbs.db bin obj [Bb]in [Dd]ebug [Rr]elease *.aps *.eto Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/InputMapper/InputHandler.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/InputMapper/InputHandler.cs 2009-05-31 11:33:35 UTC (rev 2875) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/InputMapper/InputHandler.cs 2009-05-31 12:12:49 UTC (rev 2876) @@ -433,7 +433,7 @@ switch (map.ConProperty) { case "TV": - if (g_Player.IsTV) + if (g_Player.IsTimeShifting || g_Player.IsTV || g_Player.IsTVRecording) found = map; break; case "DVD": Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MP Control Plugin.csproj =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MP Control Plugin.csproj 2009-05-31 11:33:35 UTC (rev 2875) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MP Control Plugin.csproj 2009-05-31 12:12:49 UTC (rev 2876) @@ -151,4 +151,4 @@ <Name>MPUtils</Name> </ProjectReference> </ItemGroup> -</Project> +</Project> \ No newline at end of file Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2 Blaster Plugin.csproj =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2 Blaster Plugin.csproj 2009-05-31 11:33:35 UTC (rev 2875) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2 Blaster Plugin.csproj 2009-05-31 12:12:49 UTC (rev 2876) @@ -3,7 +3,7 @@ <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProductVersion>8.0.50727</ProductVersion> + <ProductVersion>9.0.30729</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{7946D42A-4BCB-4D79-80EB-BA9B17CE2E90}</ProjectGuid> <OutputType>Library</OutputType> @@ -102,9 +102,13 @@ <Reference Include="System.Xml" /> <Reference Include="TVCapture, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\..\..\mediaportal\trunk\mediaportal\xbmc\bin\Release\TVCapture.DLL</HintPath> + <HintPath>..\..\..\..\..\..\mediaportal\trunk\TvEngine2\Core\TvCapture\bin\Release\TVCapture.DLL</HintPath> <Private>False</Private> </Reference> + <Reference Include="TVCapture-Databases, Version=1.0.2.22074, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\..\..\..\MediaPortal\trunk\TvEngine2\Core\Databases\bin\Release\TVCapture-Databases.dll</HintPath> + </Reference> <Reference Include="Utils, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> <HintPath>..\..\..\..\..\..\mediaportal\trunk\mediaportal\xbmc\bin\Release\Utils.DLL</HintPath> Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3 Blaster Plugin.csproj =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3 Blaster Plugin.csproj 2009-05-31 11:33:35 UTC (rev 2875) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3 Blaster Plugin.csproj 2009-05-31 12:12:49 UTC (rev 2876) @@ -1,7 +1,7 @@ <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> <PropertyGroup> <ProjectType>Local</ProjectType> - <ProductVersion>8.0.50727</ProductVersion> + <ProductVersion>9.0.30729</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{CD395FC2-70E2-42C4-8A20-5469A0C5EB50}</ProjectGuid> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |