You can subscribe to this list here.
2007 |
Jan
(36) |
Feb
(79) |
Mar
(123) |
Apr
(95) |
May
(119) |
Jun
(172) |
Jul
(124) |
Aug
(100) |
Sep
(83) |
Oct
(52) |
Nov
(97) |
Dec
(87) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(131) |
Feb
(80) |
Mar
(163) |
Apr
(178) |
May
(73) |
Jun
(54) |
Jul
(106) |
Aug
(118) |
Sep
(50) |
Oct
(125) |
Nov
(100) |
Dec
(99) |
2009 |
Jan
(104) |
Feb
(99) |
Mar
(68) |
Apr
(81) |
May
(52) |
Jun
(87) |
Jul
(67) |
Aug
(33) |
Sep
(27) |
Oct
(37) |
Nov
(60) |
Dec
(116) |
2010 |
Jan
(82) |
Feb
(79) |
Mar
(38) |
Apr
(50) |
May
(45) |
Jun
(53) |
Jul
(23) |
Aug
(86) |
Sep
(22) |
Oct
(96) |
Nov
(97) |
Dec
(73) |
2011 |
Jan
(24) |
Feb
(45) |
Mar
(28) |
Apr
(31) |
May
(42) |
Jun
(25) |
Jul
|
Aug
(12) |
Sep
(28) |
Oct
(13) |
Nov
(43) |
Dec
(13) |
2012 |
Jan
(62) |
Feb
(28) |
Mar
(6) |
Apr
(16) |
May
(7) |
Jun
|
Jul
(16) |
Aug
(2) |
Sep
(1) |
Oct
(4) |
Nov
(1) |
Dec
(3) |
2013 |
Jan
(5) |
Feb
|
Mar
(34) |
Apr
(9) |
May
(6) |
Jun
(10) |
Jul
(32) |
Aug
(8) |
Sep
(11) |
Oct
(35) |
Nov
(24) |
Dec
(22) |
2014 |
Jan
(44) |
Feb
(9) |
Mar
(9) |
Apr
(15) |
May
(25) |
Jun
(34) |
Jul
(16) |
Aug
(11) |
Sep
(7) |
Oct
(6) |
Nov
(1) |
Dec
(12) |
2015 |
Jan
(33) |
Feb
(19) |
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(5) |
From: <an...@us...> - 2007-10-04 07:02:58
|
Revision: 973 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=973&view=rev Author: and-81 Date: 2007-10-04 00:02:56 -0700 (Thu, 04 Oct 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs trunk/plugins/IR Server Suite/Applications/IR Server/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Translator/ButtonMapping.cs trunk/plugins/IR Server Suite/Applications/Translator/Configuration.cs trunk/plugins/IR Server Suite/Applications/Translator/Program.cs trunk/plugins/IR Server Suite/Applications/Translator/ProgramSettings.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/GetKeyCodeForm.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/Setup.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.Designer.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs trunk/plugins/IR Server Suite/Common/IrssComms/IrssComms.csproj trunk/plugins/IR Server Suite/Common/IrssComms/MessageManagerCombo.cs trunk/plugins/IR Server Suite/Common/IrssComms/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/MessageCommand.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/ServerAddress.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Common/IrssUtils/SystemRegistry.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Win32.cs trunk/plugins/IR Server Suite/Common/MPUtils/MPCommands.cs trunk/plugins/IR Server Suite/Common/MPUtils/MPUtils.csproj trunk/plugins/IR Server Suite/Common/MPUtils/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Advanced.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Advanced.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverVista.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/USB-UIRT Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/UirtTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/XBCDRC Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Suite.sln trunk/plugins/IR Server Suite/Input Service/Input Service.csproj trunk/plugins/IR Server Suite/Input Service/InputService.cs trunk/plugins/IR Server Suite/Input Service/Program.cs trunk/plugins/IR Server Suite/Input Service/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/SetupForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MPBlastZonePlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/SetupForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/PluginSetup.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs trunk/plugins/MCEReplacement/MCEReplacement.cs Added Paths: ----------- trunk/plugins/IR Server Suite/Applications/IR Server/Advanced.Designer.cs trunk/plugins/IR Server Suite/Applications/IR Server/Advanced.cs trunk/plugins/IR Server Suite/Applications/IR Server/Advanced.resx trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/BlastCommand.Designer.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/BlastCommand.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/BlastCommand.resx trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/LearnIR.Designer.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/LearnIR.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/LearnIR.resx trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/ trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Girder Plugin.cs trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Girder Plugin.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Properties/ trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/Serial IR Blaster/ trunk/plugins/IR Server Suite/IR Server Plugins/Serial IR Blaster/Configure.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Serial IR Blaster/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/Serial IR Blaster/Configure.resx trunk/plugins/IR Server Suite/IR Server Plugins/Serial IR Blaster/Properties/ trunk/plugins/IR Server Suite/IR Server Plugins/Serial IR Blaster/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/Serial IR Blaster/Serial IR Blaster.cs trunk/plugins/IR Server Suite/IR Server Plugins/Serial IR Blaster/Serial IR Blaster.csproj trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/NativeMethods.cs trunk/plugins/IR Server Suite/Input Service/Icon.ico Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-10-03 03:14:49 UTC (rev 972) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-10-04 07:02:56 UTC (rev 973) @@ -145,9 +145,9 @@ comboBoxComputer.Items.Clear(); comboBoxComputer.Items.Add("localhost"); - ArrayList networkPCs = IrssUtils.Win32.GetNetworkComputers(); + string[] networkPCs = IrssUtils.Win32.GetNetworkComputers(false); if (networkPCs != null) - comboBoxComputer.Items.AddRange(networkPCs.ToArray()); + comboBoxComputer.Items.AddRange(networkPCs); comboBoxComputer.Text = _serverHost; } Added: trunk/plugins/IR Server Suite/Applications/IR Server/Advanced.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Advanced.Designer.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Advanced.Designer.cs 2007-10-04 07:02:56 UTC (rev 973) @@ -0,0 +1,180 @@ +namespace IRServer +{ + partial class Advanced + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Advanced)); + this.groupBoxMode = new System.Windows.Forms.GroupBox(); + this.labelComputer = new System.Windows.Forms.Label(); + this.radioButtonRepeater = new System.Windows.Forms.RadioButton(); + this.radioButtonRelay = new System.Windows.Forms.RadioButton(); + this.radioButtonServer = new System.Windows.Forms.RadioButton(); + this.comboBoxComputer = new System.Windows.Forms.ComboBox(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.buttonOK = new System.Windows.Forms.Button(); + this.toolTips = new System.Windows.Forms.ToolTip(this.components); + this.groupBoxMode.SuspendLayout(); + this.SuspendLayout(); + // + // groupBoxMode + // + this.groupBoxMode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxMode.Controls.Add(this.labelComputer); + this.groupBoxMode.Controls.Add(this.radioButtonRepeater); + this.groupBoxMode.Controls.Add(this.radioButtonRelay); + this.groupBoxMode.Controls.Add(this.radioButtonServer); + this.groupBoxMode.Controls.Add(this.comboBoxComputer); + this.groupBoxMode.Location = new System.Drawing.Point(8, 8); + this.groupBoxMode.Name = "groupBoxMode"; + this.groupBoxMode.Size = new System.Drawing.Size(384, 120); + this.groupBoxMode.TabIndex = 0; + this.groupBoxMode.TabStop = false; + this.groupBoxMode.Text = "IR Server Mode"; + // + // labelComputer + // + this.labelComputer.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.labelComputer.Location = new System.Drawing.Point(168, 56); + this.labelComputer.Name = "labelComputer"; + this.labelComputer.Size = new System.Drawing.Size(208, 32); + this.labelComputer.TabIndex = 3; + this.labelComputer.Text = "Input Relay / Repeater host computer:"; + this.labelComputer.TextAlign = System.Drawing.ContentAlignment.BottomLeft; + // + // radioButtonRepeater + // + this.radioButtonRepeater.AutoSize = true; + this.radioButtonRepeater.Location = new System.Drawing.Point(16, 88); + this.radioButtonRepeater.Name = "radioButtonRepeater"; + this.radioButtonRepeater.Size = new System.Drawing.Size(98, 17); + this.radioButtonRepeater.TabIndex = 2; + this.radioButtonRepeater.TabStop = true; + this.radioButtonRepeater.Text = "Repeater mode"; + this.toolTips.SetToolTip(this.radioButtonRepeater, "All output commands from a host IR Server are repeated"); + this.radioButtonRepeater.UseVisualStyleBackColor = true; + this.radioButtonRepeater.CheckedChanged += new System.EventHandler(this.radioButtonRepeater_CheckedChanged); + // + // radioButtonRelay + // + this.radioButtonRelay.AutoSize = true; + this.radioButtonRelay.Location = new System.Drawing.Point(16, 56); + this.radioButtonRelay.Name = "radioButtonRelay"; + this.radioButtonRelay.Size = new System.Drawing.Size(103, 17); + this.radioButtonRelay.TabIndex = 1; + this.radioButtonRelay.TabStop = true; + this.radioButtonRelay.Text = "Input relay mode"; + this.toolTips.SetToolTip(this.radioButtonRelay, "All input is relayed to another IR Server instance"); + this.radioButtonRelay.UseVisualStyleBackColor = true; + this.radioButtonRelay.CheckedChanged += new System.EventHandler(this.radioButtonRelay_CheckedChanged); + // + // radioButtonServer + // + this.radioButtonServer.AutoSize = true; + this.radioButtonServer.Location = new System.Drawing.Point(16, 24); + this.radioButtonServer.Name = "radioButtonServer"; + this.radioButtonServer.Size = new System.Drawing.Size(126, 17); + this.radioButtonServer.TabIndex = 0; + this.radioButtonServer.TabStop = true; + this.radioButtonServer.Text = "Server mode (default)"; + this.toolTips.SetToolTip(this.radioButtonServer, "IR Server operates as a device server (default)"); + this.radioButtonServer.UseVisualStyleBackColor = true; + this.radioButtonServer.CheckedChanged += new System.EventHandler(this.radioButtonServer_CheckedChanged); + // + // comboBoxComputer + // + this.comboBoxComputer.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.comboBoxComputer.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.comboBoxComputer.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.comboBoxComputer.Enabled = false; + this.comboBoxComputer.FormattingEnabled = true; + this.comboBoxComputer.Location = new System.Drawing.Point(168, 88); + this.comboBoxComputer.Name = "comboBoxComputer"; + this.comboBoxComputer.Size = new System.Drawing.Size(208, 21); + this.comboBoxComputer.TabIndex = 4; + // + // 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(328, 144); + 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); + // + // buttonOK + // + this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonOK.Location = new System.Drawing.Point(256, 144); + this.buttonOK.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); + // + // Advanced + // + this.AcceptButton = this.buttonOK; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.buttonCancel; + this.ClientSize = new System.Drawing.Size(402, 177); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.buttonOK); + this.Controls.Add(this.groupBoxMode); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MinimumSize = new System.Drawing.Size(418, 213); + this.Name = "Advanced"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "IR Server - Advanced Configuration"; + this.groupBoxMode.ResumeLayout(false); + this.groupBoxMode.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupBoxMode; + private System.Windows.Forms.Label labelComputer; + private System.Windows.Forms.RadioButton radioButtonRepeater; + private System.Windows.Forms.RadioButton radioButtonRelay; + private System.Windows.Forms.RadioButton radioButtonServer; + private System.Windows.Forms.ComboBox comboBoxComputer; + private System.Windows.Forms.Button buttonCancel; + private System.Windows.Forms.Button buttonOK; + private System.Windows.Forms.ToolTip toolTips; + } +} \ No newline at end of file Added: trunk/plugins/IR Server Suite/Applications/IR Server/Advanced.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Advanced.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Advanced.cs 2007-10-04 07:02:56 UTC (rev 973) @@ -0,0 +1,98 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace IRServer +{ + + partial class Advanced : Form + { + + #region Properties + + public IRServerMode Mode + { + get + { + if (radioButtonRelay.Checked) + return IRServerMode.RelayMode; + else if (radioButtonRepeater.Checked) + return IRServerMode.RepeaterMode; + else + return IRServerMode.ServerMode; + } + set + { + switch (value) + { + case IRServerMode.ServerMode: + radioButtonServer.Checked = true; + break; + + case IRServerMode.RelayMode: + radioButtonRelay.Checked = true; + break; + + case IRServerMode.RepeaterMode: + radioButtonRepeater.Checked = true; + break; + } + } + } + public string HostComputer + { + get { return comboBoxComputer.Text; } + set { comboBoxComputer.Text = value; } + } + + #endregion Properties + + #region Constructor + + public Advanced() + { + InitializeComponent(); + + string[] networkPCs = IrssUtils.Win32.GetNetworkComputers(false); + if (networkPCs != null) + comboBoxComputer.Items.AddRange(networkPCs); + } + + #endregion Constructor + + #region Controls + + 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 radioButtonServer_CheckedChanged(object sender, EventArgs e) + { + comboBoxComputer.Enabled = false; + } + private void radioButtonRelay_CheckedChanged(object sender, EventArgs e) + { + comboBoxComputer.Enabled = true; + } + private void radioButtonRepeater_CheckedChanged(object sender, EventArgs e) + { + comboBoxComputer.Enabled = true; + } + + #endregion Controls + + } + +} Added: trunk/plugins/IR Server Suite/Applications/IR Server/Advanced.resx =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Advanced.resx (rev 0) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Advanced.resx 2007-10-04 07:02:56 UTC (rev 973) @@ -0,0 +1,171 @@ +<?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> + <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> + <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value> + AAABAAIAICAAAAEACACoCAAAJgAAABAQEAABAAQAKAEAAM4IAAAoAAAAIAAAAEAAAAABAAgAAAAAAIAE + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAgAAAAICAAIAAAACAAIAAgIAAAMDAwADA3MAA8MqmANTw + /wCx4v8AjtT/AGvG/wBIuP8AJar/AACq/wAAktwAAHq5AABilgAASnMAADJQANTj/wCxx/8Ajqv/AGuP + /wBIc/8AJVf/AABV/wAASdwAAD25AAAxlgAAJXMAABlQANTU/wCxsf8Ajo7/AGtr/wBISP8AJSX/AAAA + /gAAANwAAAC5AAAAlgAAAHMAAABQAOPU/wDHsf8Aq47/AI9r/wBzSP8AVyX/AFUA/wBJANwAPQC5ADEA + lgAlAHMAGQBQAPDU/wDisf8A1I7/AMZr/wC4SP8AqiX/AKoA/wCSANwAegC5AGIAlgBKAHMAMgBQAP/U + /wD/sf8A/47/AP9r/wD/SP8A/yX/AP4A/gDcANwAuQC5AJYAlgBzAHMAUABQAP/U8AD/seIA/47UAP9r + xgD/SLgA/yWqAP8AqgDcAJIAuQB6AJYAYgBzAEoAUAAyAP/U4wD/sccA/46rAP9rjwD/SHMA/yVXAP8A + VQDcAEkAuQA9AJYAMQBzACUAUAAZAP/U1AD/sbEA/46OAP9rawD/SEgA/yUlAP4AAADcAAAAuQAAAJYA + AABzAAAAUAAAAP/j1AD/x7EA/6uOAP+PawD/c0gA/1clAP9VAADcSQAAuT0AAJYxAABzJQAAUBkAAP/w + 1AD/4rEA/9SOAP/GawD/uEgA/6olAP+qAADckgAAuXoAAJZiAABzSgAAUDIAAP//1AD//7EA//+OAP// + awD//0gA//8lAP7+AADc3AAAubkAAJaWAABzcwAAUFAAAPD/1ADi/7EA1P+OAMb/awC4/0gAqv8lAKr/ + AACS3AAAerkAAGKWAABKcwAAMlAAAOP/1ADH/7EAq/+OAI//awBz/0gAV/8lAFX/AABJ3AAAPbkAADGW + AAAlcwAAGVAAANT/1ACx/7EAjv+OAGv/awBI/0gAJf8lAAD+AAAA3AAAALkAAACWAAAAcwAAAFAAANT/ + 4wCx/8cAjv+rAGv/jwBI/3MAJf9XAAD/VQAA3EkAALk9AACWMQAAcyUAAFAZANT/8ACx/+IAjv/UAGv/ + xgBI/7gAJf+qAAD/qgAA3JIAALl6AACWYgAAc0oAAFAyANT//wCx//8Ajv//AGv//wBI//8AJf//AAD+ + /gAA3NwAALm5AACWlgAAc3MAAFBQAPLy8gDm5uYA2traAM7OzgDCwsIAtra2AKqqqgCenp4AkpKSAIaG + hgB6enoAbm5uAGJiYgBWVlYASkpKAD4+PgAyMjIAJiYmABoaGgAODg4A8Pv/AKSgoACAgIAAAAD/AAD/ + AAAA//8A/wAAAP8A/wD//wAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + /PwAAPz8/PwA/AAA/AAAAPwAAAD8/Pz8APwAAPwAAAAAAPwA/AAAAAD8AAD8AAD8APwAAPwAAAAA/AAA + /AAAAAAA/AD8AAAAAPwAAPwAAPwA/AAA/AAAAAD8AAD8AAAAAAD8APwAAAAA/AAA/AD8AAAA/AD8AAAA + APwAAPwAAAAAAPwA/AAAAAD8AAD8APwAAAD8APwAAAAA/AAA/AAAAPz8AAD8/PwAAPz8/AAA/AAAAPwA + /Pz8AAD8/PwAAAD8AAAAAPwAAAAA/AAA/AD8AAAA/AD8AAAAAPwAAPwAAPwAAAAA/AAAAAD8AAD8APwA + AAD8APwAAAAA/AAA/AAA/AAAAAD8AAAAAPwAAPwA/AAAAPwA/AAAAAD8AAD8AAD8AAAAAPwAAAAA/AAA + /AD8AAAA/AD8AAAAAPwAAPwAAAD8/AAA/Pz8/AD8/PwAAPwAAAD8APz8/PwA/Pz8AAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + APn5+fn5+fn5AAAA+fn5AAAAAAD5+fkAAAAAAAAAAAAAAPn5+fn5+QAAAAAA+fkAAAAAAPn5AAAAAAAA + AAAAAAAAAAD5+QAAAAAAAAD5+QAAAAAA+fkAAAAAAAAAAAAAAAAAAPn5AAAAAAAAAPn5+fn5+fn5AAAA + AAAAAAAAAAAAAAAA+fkAAAAAAAAA+fn5+fn5+fkAAAAAAAAAAAAAAAAAAAD5+QAAAAAAAAD5+QAAAAAA + +fkAAAAAAAAAAAAAAAAAAPn5AAAAAAAAAPn5AAAAAAD5+QAAAAAAAAAAAAAAAAAA+fkAAAAAAAAA+fkA + AAAAAPn5AAAAAAAAAAAAAAAA+fn5+fn5AAAAAAD5+fn5+fn5+fkAAAAAAAAAAAAAAPn5+fn5+fn5AAAA + +fn5+fn5+fn5AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAPj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+AAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////AAAAAP/////MLdwt9e2t7fXtre317XXt9e117cxj + dGO97XXtve117b3tde297XXtzCN0I//////////////////////gHHx/8D58//z+fP/8/gH//P4B//z+ + fP/8/nz//P58//A+AP/gHAH///////////8AAAAf/////ygAAAAQAAAAIAAAAAEABAAAAAAAwAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAwMDAAICAgAAAAP8AAP8AAAD/ + /wD/AAAA/wD/AP//AAD///8AAAAAAAAAAAAKq77t2ZzAAAAAAAAAAAAAAAAAAAAAAAAAzMDAwAwAAAAA + wMDAwMAAAMzAzADAwAAAwADAwMDAAADMwMwAwMAAAAAAAAAAAAAAmZCQCQAAAAAJAJCQAAAAAAkAmQAA + AAAACQCQkAAAAACZkJmQAAAAAAAAAAAAAAD//wAAgAcAAP//AAD//wAAxW8AAPVXAADE1wAA3VcAAMTX + AAD//wAAxb8AAO1/AADs/wAA7X8AAMR/AAD//wAA +</value> + </data> +</root> \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-10-03 03:14:49 UTC (rev 972) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-10-04 07:02:56 UTC (rev 973) @@ -65,7 +65,7 @@ IRServerMode _mode; string _hostComputer; - bool _registered = false; // Used for relay and repeater modes. + bool _registered; // Used for relay and repeater modes. string[] _pluginNameReceive; IRServerPluginBase[] _pluginReceive; Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Properties/AssemblyInfo.cs 2007-10-03 03:14:49 UTC (rev 972) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Properties/AssemblyInfo.cs 2007-10-04 07:02:56 UTC (rev 973) @@ -2,12 +2,11 @@ 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("IR Server")] [assembly: AssemblyDescription("Provides multiple connections for local and network access to a remote control transceiver")] [assembly: AssemblyConfiguration("")] @@ -22,7 +21,9 @@ // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] -// +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: GuidAttribute("a94fbaf3-2d68-45da-8f4f-7dee41f00040")] + // Version information for an assembly consists of the following four values: // // Major Version @@ -38,4 +39,4 @@ [assembly: CLSCompliant(true)] -[assembly: GuidAttribute("a94fbaf3-2d68-45da-8f4f-7dee41f00040")] +//[assembly: SecurityPermission(SecurityAction.RequestMinimum, UnmanagedCode = true)] Modified: trunk/plugins/IR Server Suite/Applications/Translator/ButtonMapping.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/ButtonMapping.cs 2007-10-03 03:14:49 UTC (rev 972) +++ trunk/plugins/IR Server Suite/Applications/Translator/ButtonMapping.cs 2007-10-04 07:02:56 UTC (rev 973) @@ -55,7 +55,7 @@ #region Constructors - public ButtonMapping() : this(String.Empty, String.Empty, String.Empty) { } + public ButtonMapping() { } public ButtonMapping(string keyCode, string description, string command) { _keyCode = keyCode; Modified: trunk/plugins/IR Server Suite/Applications/Translator/Configuration.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Configuration.cs 2007-10-03 03:14:49 UTC (rev 972) +++ trunk/plugins/IR Server Suite/Applications/Translator/Configuration.cs 2007-10-04 07:02:56 UTC (rev 973) @@ -92,7 +92,7 @@ /// <param name="config">Configuration to save.</param> /// <param name="fileName">File to save to.</param> /// <returns>Success.</returns> - public static bool Save(Configuration config, string fileName) + internal static bool Save(Configuration config, string fileName) { try { @@ -114,7 +114,7 @@ /// </summary> /// <param name="fileName">File to load from.</param> /// <returns>Loaded Configuration.</returns> - public static Configuration Load(string fileName) + internal static Configuration Load(string fileName) { try { Modified: trunk/plugins/IR Server Suite/Applications/Translator/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2007-10-03 03:14:49 UTC (rev 972) +++ trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2007-10-04 07:02:56 UTC (rev 973) @@ -253,7 +253,9 @@ { for (int index = 0; index < args.Length; index++) { - switch (args[index].ToLowerInvariant()) + string command = args[index].ToLowerInvariant(); + + switch (command) { case "-macro": SendCopyDataMessage("Translator", Common.CmdPrefixMacro + args[++index]); @@ -303,7 +305,7 @@ copyData.lpData = Win32.VarPtr(data).ToInt32(); copyData.cbData = data.Length; - IntPtr windowHandle = Win32.FindWindow(null, targetWindow); + IntPtr windowHandle = Win32.FindWindowByTitle(targetWindow); if (windowHandle != IntPtr.Zero) { IntPtr result; Modified: trunk/plugins/IR Server Suite/Applications/Translator/ProgramSettings.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/ProgramSettings.cs 2007-10-03 03:14:49 UTC (rev 972) +++ trunk/plugins/IR Server Suite/Applications/Translator/ProgramSettings.cs 2007-10-04 07:02:56 UTC (rev 973) @@ -144,7 +144,7 @@ /// Get the Command String to launch the program. /// </summary> /// <returns>Returns the Command String to launch the program.</returns> - public string LaunchCommand() + internal string LaunchCommand() { return String.Format("{0}|{1}|{2}|{3}|{4}|{5}|{6}|{7}", _filename, Modified: trunk/plugins/IR Server Suite/Applications/Tray Launcher/GetKeyCodeForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Tray Launcher/GetKeyCodeForm.cs 2007-10-03 03:14:49 UTC (rev 972) +++ trunk/plugins/IR Server Suite/Applications/Tray Launcher/GetKeyCodeForm.cs 2007-10-04 07:02:56 UTC (rev 973) @@ -30,7 +30,7 @@ #endregion Properties delegate void DelegateKeyCodeSet(); - DelegateKeyCodeSet _keyCodeSet = null; + DelegateKeyCodeSet _keyCodeSet; void KeyCodeSet() { timer.Stop(); @@ -55,7 +55,7 @@ timer.Start(); } - + void MessageReceiver(IrssMessage received) { if (received.Type == MessageType.RemoteEvent) @@ -70,7 +70,7 @@ { KeyCodeSet(); } - + } } Modified: trunk/plugins/IR Server Suite/Applications/Tray Launcher/Setup.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Tray Launcher/Setup.cs 2007-10-03 03:14:49 UTC (rev 972) +++ trunk/plugins/IR Server Suite/Applications/Tray Launcher/Setup.cs 2007-10-04 07:02:56 UTC (rev 973) @@ -66,9 +66,10 @@ comboBoxComputer.Items.Clear(); comboBoxComputer.Items.Add("localhost"); - ArrayList networkPCs = IrssUtils.Win32.GetNetworkComputers(); + + string[] networkPCs = IrssUtils.Win32.GetNetworkComputers(false); if (networkPCs != null) - comboBoxComputer.Items.AddRange(networkPCs.ToArray()); + comboBoxComputer.Items.AddRange(networkPCs); } #endregion Constructor Modified: trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs 2007-10-03 03:14:49 UTC (rev 972) +++ trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs 2007-10-04 07:02:56 UTC (rev 973) @@ -30,11 +30,11 @@ #region Variables - static ClientMessageSink _handleMessage = null; + static ClientMessageSink _handleMessage; Client _client; - static bool _registered = false; + static bool _registered; string _serverHost; string _programFile; @@ -44,7 +44,7 @@ NotifyIcon _notifyIcon; - bool _inConfiguration = false; + bool _inConfiguration; #endregion Variables Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs 2007-10-03 03:14:49 UTC (rev 972) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs 2007-10-04 07:02:56 UTC (rev 973) @@ -184,7 +184,7 @@ } } - void ButtonPress(string keyCode) + static void ButtonPress(string keyCode) { if (!Program.Registered) return; Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs 2007-10-03 03:14:49 UTC (rev 972) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs 2007-10-04 07:02:56 UTC (rev 973) @@ -33,10 +33,9 @@ static Client _client; - static bool _registered = false; + static bool _registered; static string _serverHost; - static string _lastKeyCode = String.Empty; static string _installFolder; Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.Designer.cs 2007-10-03 03:14:49 UTC (rev 972) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.Designer.cs 2007-10-04 07:02:56 UTC (rev 973) @@ -55,6 +55,7 @@ this.connectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.disconnectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.changeServerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.timerFlash = new System.Windows.Forms.Timer(this.components); this.saveFileDialog = new System.Windows.Forms.SaveFileDialog(); this.buttonAddButton = new System.Windows.Forms.Button(); @@ -62,7 +63,6 @@ this.buttonSetCode = new System.Windows.Forms.Button(); this.buttonSetShortcut = new System.Windows.Forms.Button(); this.comboBoxShortcut = new System.Windows.Forms.ComboBox(); - this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.panelRemote.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBoxRemote)).BeginInit(); this.menuStrip.SuspendLayout(); @@ -216,42 +216,42 @@ // newToolStripMenuItem // this.newToolStripMenuItem.Name = "newToolStripMenuItem"; - this.newToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.newToolStripMenuItem.Size = new System.Drawing.Size(138, 22); this.newToolStripMenuItem.Text = "New"; this.newToolStripMenuItem.Click += new System.EventHandler(this.newToolStripMenuItem_Click); // // openToolStripMenuItem // this.openToolStripMenuItem.Name = "openToolStripMenuItem"; - this.openToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.openToolStripMenuItem.Size = new System.Drawing.Size(138, 22); this.openToolStripMenuItem.Text = "Open"; this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click); // // saveToolStripMenuItem // this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; - this.saveToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.saveToolStripMenuItem.Size = new System.Drawing.Size(138, 22); this.saveToolStripMenuItem.Text = "Save"; this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click); // // saveAsToolStripMenuItem // this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem"; - this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(138, 22); this.saveAsToolStripMenuItem.Text = "Save as ..."; this.saveAsToolStripMenuItem.Click += new System.EventHandler(this.saveAsToolStripMenuItem_Click); // // closeToolStripMenuItem // this.closeToolStripMenuItem.Name = "closeToolStripMenuItem"; - this.closeToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.closeToolStripMenuItem.Size = new System.Drawing.Size(138, 22); this.closeToolStripMenuItem.Text = "Close"; this.closeToolStripMenuItem.Click += new System.EventHandler(this.closeToolStripMenuItem_Click); // // quitToolStripMenuItem // this.quitToolStripMenuItem.Name = "quitToolStripMenuItem"; - this.quitToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.quitToolStripMenuItem.Size = new System.Drawing.Size(138, 22); this.quitToolStripMenuItem.Text = "Quit"; this.quitToolStripMenuItem.Click += new System.EventHandler(this.quitToolStripMenuItem_Click); // @@ -286,9 +286,16 @@ this.changeServerToolStripMenuItem.Text = "Change Server"; this.changeServerToolStripMenuItem.Click += new System.EventHandler(this.changeServerToolStripMenuItem_Click); // + // helpToolStripMenuItem + // + this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; + this.helpToolStripMenuItem.Size = new System.Drawing.Size(40, 20); + this.helpToolStripMenuItem.Text = "Help"; + this.helpToolStripMenuItem.Click += new System.EventHandler(this.helpToolStripMenuItem_Click); + // // timerFlash // - this.timerFlash.Interval = 750; + this.timerFlash.Interval = 1250; this.timerFlash.Tick += new System.EventHandler(this.timerFlash_Tick); // // saveFileDialog @@ -347,13 +354,6 @@ this.comboBoxShortcut.Size = new System.Drawing.Size(112, 21); this.comboBoxShortcut.TabIndex = 9; // - // helpToolStripMenuItem - // - this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; - this.helpToolStripMenuItem.Size = new System.Drawing.Size(40, 20); - this.helpToolStripMenuItem.Text = "Help"; - this.helpToolStripMenuItem.Click += new System.EventHandler(this.helpToolStripMenuItem_Click); - // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs 2007-10-03 03:14:49 UTC (rev 972) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs 2007-10-04 07:02:56 UTC (rev 973) @@ -28,20 +28,20 @@ #region Variables - Client _client = null; + Client _client; - bool _registered = false; + bool _registered; - string _serverHost = String.Empty; + string _serverHost = String.Empty; - bool _unsavedChanges = false; - //bool _fileOpen = false; + bool _unsavedChanges; + //bool _fileOpen; string _fileName = String.Empty; Label _currentButton = null; Point _mouseOffset; - bool _isMouseDown = false; + bool _isMouseDown; #endregion Variables Modified: trunk/plugins/IR Server Suite/Common/IrssComms/IrssComms.csproj =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssComms/IrssComms.csproj 2007-10-03 03:14:49 UTC (rev 972) +++ trunk/plugins/IR Server Suite/Common/IrssComms/IrssComms.csproj 2007-10-04 07:02:56 UTC (rev 973) @@ -44,11 +44,13 @@ </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> <OutputPath>bin\x86\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> + <DefineConstants> + </DefineConstants> <Optimize>true</Optimize> - <DebugType>pdbonly</DebugType> + <DebugType>none</DebugType> <PlatformTarget>x86</PlatformTarget> <ErrorReport>prompt</ErrorReport> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <ItemGroup> <Reference Include="System" /> Modified: trunk/plugins/IR Server Suite/Common/IrssComms/MessageManagerCombo.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssComms/MessageManagerCombo.cs 2007-10-03 03:14:49 UTC (rev 972) +++ trunk/plugins/IR Server Suite/Common/IrssComms/MessageManagerCombo.cs 2007-10-04 07:02:56 UTC (rev 973) @@ -62,10 +62,12 @@ /// <returns>true if the current object is equal to the other parameter; otherwise, false.</returns> public override bool Equals(object obj) { - if (!(obj is MessageManagerCombo)) + MessageManagerCombo asCombo = obj as MessageManagerCombo; + + if (asCombo == null) return false; - return Equals((MessageManagerCombo)obj); + return Equals(asCombo); } /// <summary> Modified: trunk/plugins/IR Server Suite/Common/IrssComms/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssComms/Properties/AssemblyInfo.cs 2007-10-03 03:14:49 UTC (rev 972) +++ trunk/plugins/IR Server Suite/Common/IrssComms/Properties/AssemblyInfo.cs 2007-10-04 07:02:56 UTC (rev 973) @@ -2,6 +2,7 @@ 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 @@ -36,3 +37,5 @@ [assembly: AssemblyFileVersion("1.0.3.4")] [assembly: CLSCompliant(true)] + +//[assembly: SecurityPermission(SecurityAction.RequestMinimum, UnmanagedCode = true)] Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs 2007-10-03 03:14:49 UTC (rev 972) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs 2007-10-04 07:02:56 UTC (rev 973) @@ -408,11 +408,11 @@ break; case "class": - windowHandle = Win32.FindWindow(commands[1], null); + windowHandle = Win32.FindWindowByClass(commands[1]); break; case "window": - windowHandle = Win32.FindWindow(null, commands[1]); + windowHandle = Win32.FindWindowByTitle(commands[1]); break; } Added: trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/BlastCommand.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/BlastCommand.Designer.cs (rev 0) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/BlastCommand.Designer.cs 2007-10-04 07:02:56 UTC (rev 973) @@ -0,0 +1,174 @@ +namespace IrssUtils.Forms +{ + + partial class BlastCommand + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.labelIRFile = new System.Windows.Forms.Label(); + this.labelBlasterPort = new System.Windows.Forms.Label(); + this.comboBoxPort = new System.Windows.Forms.ComboBox(); + this.labelIRCommandFile = new System.Windows.Forms.Label(); + this.buttonTest = new System.Windows.Forms.Button(); + this.buttonOK = new System.Windows.Forms.Button(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.checkBoxUseForAll = new System.Windows.Forms.CheckBox(); + this.toolTips = new System.Windows.Forms.ToolTip(this.components); + this.SuspendLayout(); + // + // labelIRFile + // + this.labelIRFile.Location = new System.Drawing.Point(8, 8); + this.labelIRFile.Name = "labelIRFile"; + this.labelIRFile.Size = new System.Drawing.Size(88, 20); + this.labelIRFile.TabIndex = 0; + this.labelIRFile.Text = "IR Command:"; + this.labelIRFile.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // labelBlasterPort + // + this.labelBlasterPort.Location = new System.Drawing.Point(8, 40); + this.labelBlasterPort.Name = "labelBlasterPort"; + this.labelBlasterPort.Size = new System.Drawing.Size(88, 21); + this.labelBlasterPort.TabIndex = 2; + this.labelBlasterPort.Text = "Blaster port:"; + this.labelBlasterPort.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // comboBoxPort + // + this.comboBoxPort.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.comboBoxPort.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxPort.FormattingEnabled = true; + this.comboBoxPort.Location = new System.Drawing.Point(96, 40); + this.comboBoxPort.Name = "comboBoxPort"; + this.comboBoxPort.Size = new System.Drawing.Size(160, 21); + this.comboBoxPort.TabIndex = 3; + this.toolTips.SetToolTip(this.comboBoxPort, "Choose the blaster port to transmit this command to"); + // + // labelIRCommandFile + // + this.labelIRCommandFile.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.labelIRCommandFile.AutoEllipsis = true; + this.labelIRCommandFile.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + this.labelIRCommandFile.Location = new System.Drawing.Point(96, 8); + this.labelIRCommandFile.Name = "labelIRCommandFile"; + this.labelIRCommandFile.Size = new System.Drawing.Size(248, 20); + this.labelIRCommandFile.TabIndex = 1; + this.labelIRCommandFile.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // buttonTest + // + this.buttonTest.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonTest.Location = new System.Drawing.Point(8, 72); + this.buttonTest.Name = "buttonTest"; + this.buttonTest.Size = new System.Drawing.Size(56, 24); + this.buttonTest.TabIndex = 4; + this.buttonTest.Text = "Test"; + this.toolTips.SetToolTip(this.buttonTest, "Test this blast command"); + this.buttonTest.UseVisualStyleBackColor = true; + this.buttonTest.Click += new System.EventHandler(this.buttonTest_Click); + // + // buttonOK + // + this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonOK.Location = new System.Drawing.Point(224, 72); + this.buttonOK.Name = "buttonOK"; + this.buttonOK.Size = new System.Drawing.Size(56, 24); + this.buttonOK.TabIndex = 6; + this.buttonOK.Text = "OK"; + this.buttonOK.UseVisualStyleBackColor = true; + this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); + // + // buttonCancel + // + this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.buttonCancel.Location = new System.Drawing.Point(288, 72); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(56, 24); + this.buttonCancel.TabIndex = 7; + this.buttonCancel.Text = "Cancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); + // + // checkBoxUseForAll + // + this.checkBoxUseForAll.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.checkBoxUseForAll.Location = new System.Drawing.Point(72, 72); + this.checkBoxUseForAll.Name = "checkBoxUseForAll"; + this.checkBoxUseForAll.Size = new System.Drawing.Size(144, 24); + this.checkBoxUseForAll.TabIndex = 5; + this.checkBoxUseForAll.Text = "Use this port for all"; + this.toolTips.SetToolTip(this.checkBoxUseForAll, "Use the selected blaster port for all blast commands in this group"); + this.checkBoxUseForAll.UseVisualStyleBackColor = true; + this.checkBoxUseForAll.Visible = false; + // + // BlastCommand + // + this.AcceptButton = this.buttonOK; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.buttonCancel; + this.ClientSize = new System.Drawing.Size(352, 105); + this.Controls.Add(this.checkBoxUseForAll); + this.Controls.Add(this.buttonOK); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.buttonTest); + this.Controls.Add(this.labelIRCommandFile); + this.Controls.Add(this.labelBlasterPort); + this.Controls.Add(this.comboBoxPort); + this.Controls.Add(this.labelIRFile); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(360, 132); + this.Name = "BlastCommand"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Blast Command"; + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Label labelIRFile; + private System.Windows.Forms.Label labelBlasterPort; + private System.Windows.Forms.ComboBox comboBoxPort; + private System.Windows.Forms.Label labelIRCommandFile; + private System.Windows.Forms.Button buttonTest; + private System.Windows.Forms.Button buttonOK; + private System.Windows.Forms.Button buttonCancel; + private System.Windows.Forms.CheckBox checkBoxUseForAll; + private System.Windows.Forms.ToolTip toolTips; + } + +} Added: trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/BlastCommand.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/BlastCommand.cs (rev 0) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/BlastCommand.cs 2007-10-04 07:02:56 UTC (rev 973) @@ -0,0 +1,146 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace IrssUtils.Forms +{ + + public partial class BlastCommand : Form + { + + #region Properties + + public string CommandString + { + get + { + return String.Format("{0}|{1}", + labelIRCommandFile.Text, + comboBoxPort.SelectedItem as string); + } + } + + public string BlasterPort + { + get { return comboBoxPort.SelectedItem as string; } + set { comboBoxPort.SelectedItem = value; } + } + + public bool UseForAll + { + get { return checkBoxUseForAll.Checked; } + } + + #endregion Properties + + #region Variables + + string _baseFolder; + + BlastIrDelegate _blastIrDelegate; + + #endregion Variables + + #region Constructors + + BlastCommand(BlastIrDelegate blastIrDelegate, string baseFolder, string[] ports) + { + if (blastIrDelegate == null) + throw new ArgumentNullException("blastIrDelegate"); + + if (String.IsNullOrEmpty(baseFolder)) + throw new ArgumentNullException("baseFolder"); + + if (ports == null) + throw new ArgumentNullException("ports"); + + InitializeComponent(); + + _blastIrDelegate = blastIrDelegate; + + _baseFolder = baseFolder; + + comboBoxPort.Items.AddRange(ports); + comboBoxPort.SelectedIndex = 0; + } + + public BlastCommand(BlastIrDelegate blastIrDelegate, string baseFolder, string[] ports, string name) + : this(blastIrDelegate, baseFolder, ports) + { + if (String.IsNullOrEmpty(name)) + throw new ArgumentNullException("fileName"); + + labelIRCommandFile.Text = name; + } + + public BlastCommand(BlastIrDelegate blastIrDelegate, string baseFolder, string[] ports, string[] commands) + : this(blastIrDelegate, baseFolder, ports) + { + if (commands == null) + throw new ArgumentNullException("commands"); + + labelIRCommandFile.Text = commands[0]; + + if (comboBoxPort.Items.Contains(commands[1])) + comboBoxPort.SelectedItem = commands[1]; + } + + public BlastCommand(BlastIrDelegate blastIrDelegate, string baseFolder, string[] ports, string name, bool useAllCheckBoxVisible, int commandCount) + : this(blastIrDelegate, baseFolder, ports, name) + { + checkBoxUseForAll.Text = String.Format("Use this port for all ({0})", commandCount); + checkBoxUseForAll.Visible = true; + } + + public BlastCommand(BlastIrDelegate blastIrDelegate, string baseFolder, string[] ports, string[] commands, bool useAllCheckBoxVisible, int commandCount) + : this(blastIrDelegate, baseFolder, ports, commands) + { + checkBoxUseForAll.Text = String.Format("Use this port for all ({0})", commandCount); + checkBoxUseForAll.Visible = true; + } + + #endregion Constructors + + #region Buttons + + private void buttonOK_Click(object sender, EventArgs e) + { + this.DialogResult = DialogResult.OK; + this.Close(); + } + + private void buttonCancel_Click(object sender, EventArgs e) + { + this.DialogResult = DialogResult.Cancel; + this.Close(); + } + + private void buttonTest_Click(object sender, EventArgs e) + { + string name = labelIRCommandFile.Text.Trim(); + + if (name.Length == 0) + return; + + tr... [truncated message content] |
From: <se...@us...> - 2007-10-03 03:14:54
|
Revision: 972 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=972&view=rev Author: sergem1 Date: 2007-10-02 20:14:49 -0700 (Tue, 02 Oct 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ETVNet/ETVNet/ETVBrowser.cs trunk/plugins/ETVNet/ETVNet/Plugin.cs trunk/plugins/ETVNet/ETVNet/TODO.txt trunk/plugins/ETVNet/ETVNet/TopList.cs Modified: trunk/plugins/ETVNet/ETVNet/ETVBrowser.cs =================================================================== --- trunk/plugins/ETVNet/ETVNet/ETVBrowser.cs 2007-10-02 22:59:15 UTC (rev 971) +++ trunk/plugins/ETVNet/ETVNet/ETVBrowser.cs 2007-10-03 03:14:49 UTC (rev 972) @@ -167,7 +167,7 @@ // how to check result ??? byte[] buffer = new byte[1024]; s.Read(buffer,0,1024); - String x = System.Text.Encoding.GetEncoding(0).GetString(buffer); + String x = System.Text.Encoding.UTF8.GetString(buffer); } public Hashtable getTopDirectoryPage() @@ -177,7 +177,7 @@ MatchCollection matches = regexTopLinks.Matches(todayPage, 0); // // find all stream types - archive, today, live - Hashtable streams = new Hashtable(3); + Hashtable streams = new Hashtable(4); foreach (Match match in matches) { foreach (Capture streamtype in match.Groups[3].Captures) @@ -205,6 +205,22 @@ } } } + + // special case + { + System.Collections.ArrayList list = new System.Collections.ArrayList(); + streams["\xC2\xF1\xE5 \xEA\xE0\xED\xE0\xEB\xFB"] = list; + Hashtable entry = new Hashtable(2); + entry.Add("name", "\xD1\xE5\xE3\xEE\xE4\xED\xFF \xE2 \xFD\xF4\xE8\xF0\xE5 - \xC2\xF1\xE5 \xEA\xE0\xED\xE0\xEB\xFB"); + entry.Add("url", new Uri(baseUrl, "eitv_browse.fcgi?action=today").AbsoluteUri); + list.Add(entry); + + entry = new Hashtable(2); + entry.Add("name", "\xC0\xF0\xF5\xE8\xE2 \xE2\xF1\xE5\xF5 \xEA\xE0\xED\xE0\xEB\xEE\xE2"); + entry.Add("url", new Uri(baseUrl, "eitv_browse.fcgi").AbsoluteUri); + list.Add(entry); + } + return streams; } @@ -342,8 +358,8 @@ public String getHTMLAsString(string URL, Hashtable GETData, Hashtable POSTData) { Stream responseStream = getHTML(URL, GETData, POSTData); - // default encoding for non-unicode programs, set in control panel, in all reality should be win-1251 - StreamReader urlRdr = new StreamReader(new StreamReader(responseStream).BaseStream, Encoding.GetEncoding(0)); + // UTF-8 + StreamReader urlRdr = new StreamReader(new StreamReader(responseStream).BaseStream, Encoding.UTF8); string result = urlRdr.ReadToEnd(); if (traceHTML) { @@ -378,8 +394,8 @@ { if(GETDataString.Length > 0) GETDataString += "&"; - GETDataString += HttpUtility.UrlEncode(key, Encoding.GetEncoding(0)) - + "=" + HttpUtility.UrlEncode(GETData[key].ToString(), Encoding.GetEncoding(0)); + GETDataString += HttpUtility.UrlEncode(key, Encoding.UTF8) + + "=" + HttpUtility.UrlEncode(GETData[key].ToString(), Encoding.UTF8); } } // URL encode POST data, if any @@ -390,8 +406,8 @@ { if(POSTDataString.Length > 0) POSTDataString += "&"; - POSTDataString += HttpUtility.UrlEncode(key,Encoding.GetEncoding(0)) - + "=" + HttpUtility.UrlEncode(POSTData[key].ToString(), Encoding.GetEncoding(0)); + POSTDataString += HttpUtility.UrlEncode(key, Encoding.UTF8) + + "=" + HttpUtility.UrlEncode(POSTData[key].ToString(), Encoding.UTF8); } } @@ -419,7 +435,7 @@ webRequest.UserAgent = "MediaPortal-ETVNet-Plugin/1.0"; webRequest.ContentLength = POSTDataString.Length; Stream postStream = webRequest.GetRequestStream(); - byte[] postBuffer = System.Text.Encoding.GetEncoding(0).GetBytes(POSTDataString); + byte[] postBuffer = System.Text.Encoding.UTF8.GetBytes(POSTDataString); postStream.Write(postBuffer,0,postBuffer.Length); postStream.Close(); }else Modified: trunk/plugins/ETVNet/ETVNet/Plugin.cs =================================================================== --- trunk/plugins/ETVNet/ETVNet/Plugin.cs 2007-10-02 22:59:15 UTC (rev 971) +++ trunk/plugins/ETVNet/ETVNet/Plugin.cs 2007-10-03 03:14:49 UTC (rev 972) @@ -292,8 +292,8 @@ if (ruKeyboard.done) { string searchWord = ruKeyboard.inputString; - string url = "http://dir2.etvnet.ca/cgi-bin/video/eitv_browse.fcgi?action=search&keywords=" - + HttpUtility.UrlEncode(searchWord, Encoding.GetEncoding(0)) + string url = "http://www.etvnet.ca/cgi-bin/video/eitv_browse.fcgi?action=search&keywords=" + + HttpUtility.UrlEncode(searchWord, Encoding.UTF8) +"&keywords_search_in_description=0&category=&datetime_since.day=&datetime_since.month=&datetime_since.year=&datetime_till.day=&datetime_till.month=&datetime_till.year=&duration_min=&duration_max=&rating_min=&channel=&record_type=&order_by="; currentNode = new PathPage("Search Title: " + searchWord, url, currentNode.browser, currentNode); RenderNode(); @@ -311,8 +311,8 @@ if (ruKeyboard.done) { string searchWord = ruKeyboard.inputString; - string url = "http://dir2.etvnet.ca/cgi-bin/video/eitv_browse.fcgi?action=search&keywords=" - + HttpUtility.UrlEncode(searchWord, Encoding.GetEncoding(0)) + string url = "http://www.etvnet.ca/cgi-bin/video/eitv_browse.fcgi?action=search&keywords=" + + HttpUtility.UrlEncode(searchWord, Encoding.UTF8) + "&keywords_search_in_description=1&category=&datetime_since.day=&datetime_since.month=&datetime_since.year=&datetime_till.day=&datetime_till.month=&datetime_till.year=&duration_min=&duration_max=&rating_min=&channel=&record_type=&order_by="; currentNode = new PathPage("Search Title: " + searchWord, url, currentNode.browser, currentNode); RenderNode(); Modified: trunk/plugins/ETVNet/ETVNet/TODO.txt =================================================================== --- trunk/plugins/ETVNet/ETVNet/TODO.txt 2007-10-02 22:59:15 UTC (rev 971) +++ trunk/plugins/ETVNet/ETVNet/TODO.txt 2007-10-03 03:14:49 UTC (rev 972) @@ -7,7 +7,6 @@ aspect ratio support hardware keyboard input demo link playback -page up/down on description page while focus is on the button localization Modified: trunk/plugins/ETVNet/ETVNet/TopList.cs =================================================================== --- trunk/plugins/ETVNet/ETVNet/TopList.cs 2007-10-02 22:59:15 UTC (rev 971) +++ trunk/plugins/ETVNet/ETVNet/TopList.cs 2007-10-03 03:14:49 UTC (rev 972) @@ -62,12 +62,12 @@ PathNode pathnode; if (((string)node["url"]).StartsWith("javascript:")) // stream link { - pathnode = new PathTerminal((string)node["name"], null, (string)node["url"], null, browser, this); + pathnode = new PathTerminal((string)node["name"], null, (string)node["url"], null, browser, link); } else { // archive or today page - pathnode = new PathPage((string)node["name"], (string)node["url"], browser, this); + pathnode = new PathPage((string)node["name"], (string)node["url"], browser, link); } newList.Add(pathnode); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fc...@us...> - 2007-10-02 22:59:18
|
Revision: 971 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=971&view=rev Author: fcsobel Date: 2007-10-02 15:59:15 -0700 (Tue, 02 Oct 2007) Log Message: ----------- Added Paths: ----------- trunk/plugins/RSS Plugins/My Ebay/ trunk/plugins/RSS Plugins/My Ebay/GUIEbay/ trunk/plugins/RSS Plugins/My Ebay/GUIEbay/GUIEbay.cs trunk/plugins/RSS Plugins/My Ebay/GUIEbay/MyEbay.xml trunk/plugins/RSS Plugins/My Flickr/ trunk/plugins/RSS Plugins/My Flickr/GUIFlickr/ trunk/plugins/RSS Plugins/My Flickr/GUIFlickr/GUIFlickr.cs trunk/plugins/RSS Plugins/My Flickr/GUIFlickr/MyFlickr.xml Added: trunk/plugins/RSS Plugins/My Ebay/GUIEbay/GUIEbay.cs =================================================================== --- trunk/plugins/RSS Plugins/My Ebay/GUIEbay/GUIEbay.cs (rev 0) +++ trunk/plugins/RSS Plugins/My Ebay/GUIEbay/GUIEbay.cs 2007-10-02 22:59:15 UTC (rev 971) @@ -0,0 +1,324 @@ +using System; +using System.Windows.Forms; +using MediaPortal.GUI.Library; +using MediaPortal.GUI.Video; +//using MediaPortal.Video.Database; +using MediaPortal.Util; +using MediaPortal.Dialogs; +using MediaPortal.Player; +using System.Data; +using System.ComponentModel; +using c3o.Framework.Web; +using System.Collections.Specialized; +using System.Xml; +using System.Xml.Serialization; +using System.IO; +using c3o.Ebay; + + +namespace MediaPortal.GUI.Rss +{ + public class GUIEbay : GUIDataTable, ISetupForm + { + [SkinControlAttribute(200)] + protected GUIButtonControl bttnRefresh = null; + + + + public override int GetID + { + get + { + return 61909; + } + set + { + } + } + + protected override void OnPageLoad() + { + GUIPropertyManager.SetProperty("#header.label", "My Ebay"); + + this.ShowData(); + + base.OnPageLoad(); + } + + + protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType) + { + base.OnClicked(controlId, control, actionType); + + if (control == this.bttnRefresh) this.ShowData(); + } + + public void ShowData() + { + XmlDocument xdoc = EbayHelper.GetItem(250034619743); + + XmlNode root = xdoc["GetItemResponse"]["Item"]; + + string ItemId = root["ItemID"].InnerText; + string Category = root["PrimaryCategory"]["CategoryName"].InnerText; + string Title = root["Title"].InnerText; + string Quantity = root["Quantity"].InnerText; + string Location = root["Location"].InnerText; + string Started = root["ListingDetails"]["StartTime"].InnerText + " GMT"; + string Ends = root["ListingDetails"]["EndTime"].InnerText + " GMT"; + string URL = root["ListingDetails"]["ViewItemURL"].InnerText; + string CurrentPrice = root["SellingStatus"]["CurrentPrice"].InnerText;// +root["SellingStatus"]["CurrentPrice"].GetAttribute("currencyID"); + + CurrentPrice = string.Format("{0:c}", System.Convert.ToDouble(CurrentPrice)); + + string StartPrice = root["StartPrice"].InnerText + root["StartPrice"].GetAttribute("currencyID"); + string BuyItNowPrice = root["BuyItNowPrice"].InnerText + root["BuyItNowPrice"].GetAttribute("currencyID"); + string MinimumBid = root["SellingStatus"]["MinimumToBid"].InnerText + root["SellingStatus"]["MinimumToBid"].GetAttribute("currencyID"); + string BidIncrement = root["SellingStatus"]["BidIncrement"].InnerText + root["SellingStatus"]["BidIncrement"].GetAttribute("currencyID"); + string BidCount = root["SellingStatus"]["BidCount"].InnerText; + + DataTable dt = new DataTable(); + dt.Columns.Add("label"); + dt.Columns.Add("label2"); + dt.Columns.Add("IconImage"); + dt.Columns.Add("DVDLabel"); + + dt.Rows.Add(Title, CurrentPrice, @"http://i10.ebayimg.com/01/i/08/85/14/3a_2.JPG", "Bid Count: " + BidCount + "\n\rBid Amount: " + CurrentPrice); + + this.facadeView.Clear(); + + this.Datasource = dt; + this.Databind(); + } + + public void ShowData2() + { + this.facadeView.Clear(); + this.facadeView.View = GUIFacadeControl.ViewMode.List; + this.facadeView.Clear(); + + RssReader r = new RssReader(@"http://rss.api.ebay.com/ws/rssapi?FeedName=SearchResults&siteId=0&language=en-US&output=RSS20&fsop=1&fsoo=1&rd=0&sass=greyhound_fancier&frpp=50"); + + string ebayPrice = r.Detail.Rows[0]["rx:CurrentPrice"].ToString(); + + ebayPrice = string.Format("{0:c}", System.Convert.ToDouble(ebayPrice) / 100.00); + + string ebayCount = r.Detail.Rows[0]["rx:BiDCount"].ToString(); + string ebayTitle = r.Detail.Rows[0]["title"].ToString(); + string ebayDescription = r.Detail.Rows[0]["Description"].ToString(); + + int startPos = ebayDescription.IndexOf("src="); + int endPos = ebayDescription.IndexOf(".jpg"); + + string ebayImage = ebayDescription.Substring(startPos + 5, endPos - (startPos + 1)); + + DataTable dt = new DataTable(); + dt.Columns.Add("label"); + dt.Columns.Add("label2"); + dt.Columns.Add("IconImage"); + dt.Columns.Add("DVDLabel"); + + dt.Rows.Add(ebayTitle, ebayPrice, ebayImage, "Bid Count: " + ebayCount + "\n\rBid Amount: " + ebayPrice); + + this.Datasource = dt; + this.Databind(); + + + } + + + public override bool Init() + { + return Load(GUIGraphicsContext.Skin + @"\MyEbay.xml"); + } + + + + #region ISetupForm Members + + // Returns the name of the plugin which is shown in the plugin menu + public string PluginName() + { + return "My Ebay"; + } + + + + // Returns the description of the plugin is shown in the plugin menu + public string Description() + { + return "My Ebay"; + } + + + + // Returns the author of the plugin which is shown in the plugin menu + public string Author() + { + return "fcsobel"; + } + + + + // show the setup dialog + public void ShowPlugin() + { + Form setup = new MyPodCastSetupForm(); + setup.ShowDialog(); + } + + + + // Indicates whether plugin can be enabled/disabled + public bool CanEnable() + { + return true; + } + + // get ID of windowplugin belonging to this setup + public int GetWindowId() + { + return this.GetID; + } + + // Indicates if plugin is enabled by default; + public bool DefaultEnabled() + { + return true; + } + + // indicates if a plugin has its own setup screen + public bool HasSetup() + { + return true; + } + + + /// <summary> + /// If the plugin should have its own button on the main menu of Media Portal then it + /// should return true to this method, otherwise if it should not be on home + /// it should return false + /// </summary> + /// <param name="strButtonText">text the button should have</param> + /// <param name="strButtonImage">image for the button, or empty for default</param> + /// <param name="strButtonImageFocus">image for the button, or empty for default</param> + /// <param name="strPictureImage">subpicture for the button or empty for none</param> + /// <returns>true : plugin needs its own button on home + /// false : plugin does not need its own button on home</returns> + //public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) + //{ + + // strButtonText = "UKNova"; + // strButtonImage = String.Empty; + // strButtonImageFocus = String.Empty; + // strPictureImage = String.Empty; + // return false; + //} + + public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) + { + strButtonText = PluginName(); + strButtonImage = String.Empty; + strButtonImageFocus = String.Empty; + strPictureImage = String.Empty; + return true; + } + #endregion + + + //protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType) + //{ + // //base.OnClicked(controlId, control, actionType); + // //if (control == this.bttnAddSite) this.ShowOpmlSites(); + // //if (control == this.facadeView) this.OnListView(); + // //if (control == this.bttnAddSearchTag) this.AddSearchTag(); + // //if (control == this.bttnDelete) this.OnDelete(); + + // base.OnClicked(controlId, control, actionType); + //} + + + + public override void OnAction(Action action) + { + base.OnAction(action); + } + + + //protected override void OnListViewList() + //{ + // base.OnListViewList(); + + // GUIListItem item = this.facadeView.SelectedListItem; + + // if (item != null) + // { + // if (item.IsFolder) + // { + // if (item.Label == "..") + // { + // if (this.selectedOutline == null) + // { + // this.ShowSites(); + // } + // else + // { + // this.SelectOutline(this.opmlList, this.selectedOutline.parent, GUIFacadeControl.ViewMode.List); + // } + // } + // } + // else + // { + // // Select Item + // item.IconImage = "check-box.png"; + // item.IsDownloading = true; + + // // Refresh list so you see change + // GUIControl.RefreshControl(this.GetID, this.facadeView.GetID); + + // // Download File + // string url = this.facadeView.SelectedListItem.Path; + + // if (url != null && url.Length > 0) + // { + // if (url.ToLower().Contains(".avi") || + // url.ToLower().Contains(".mpeg") || + // url.ToLower().Contains(".mov") || + // url.ToLower().Contains(".wmv") || + // url.ToLower().Contains(".divx") || + // url.ToLower().Contains(".mpg")) + // { + // g_Player.FullScreen = true; + // if (g_Player.Play(url)) + // { + // GUIGraphicsContext.IsFullScreenVideo = true; + // GUIWindowManager.ActivateWindow((int)GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO); + // } + // } + // else + // { + // if (url.ToLower().Contains(".mp3")) + // { + // //this.PlayPodCast(url); + // g_Player.Play(url); + // //g_Player.PlayAudioStream(url); + // } + // else + // { + // if (url.ToLower().Contains(".m4v") || + // url.ToLower().Contains(".mp4")) + // { + // System.Diagnostics.Process.Start(@"QuickTimePlayer.exe", url); + // } + // else + // { + // System.Diagnostics.Process.Start(url); + // } + // } + // } + // } + // } + // } + //} + } +} \ No newline at end of file Added: trunk/plugins/RSS Plugins/My Ebay/GUIEbay/MyEbay.xml =================================================================== --- trunk/plugins/RSS Plugins/My Ebay/GUIEbay/MyEbay.xml (rev 0) +++ trunk/plugins/RSS Plugins/My Ebay/GUIEbay/MyEbay.xml 2007-10-02 22:59:15 UTC (rev 971) @@ -0,0 +1,59 @@ +<window> + <id>61902</id> + <defaultcontrol>2</defaultcontrol> + <allowoverlay>yes</allowoverlay> + + <controls> + <import>common.window.xml</import> + + <control> + <type>group</type> + <description>group element</description> + <animation>FlyInFromLeft</animation> + <layout>StackLayout</layout> + <posX>60</posX> + <posY>97</posY> + + <control> + <description>View-As button</description> + <type>button</type> + <id>2</id> + <label>100</label> + <onup>17</onup> + <onright>50</onright> + </control> + + <control> + <animation>FlyInFromLeft</animation> + <description>Refresh</description> + <type>button</type> + <id>200</id> + <label>Refresh</label> + <onleft>50</onleft> + <onright>50</onright> + </control> + + <control> + <type>textboxscrollup</type> + <description>Details</description> + <id>80</id> + <width>180</width> + <height>100</height> + <colordiffuse>ffffffff</colordiffuse> + <font>font13</font> + <textcolor>FFFFFFFF</textcolor> + </control> + + <control> + <type>image</type> + <description>Ebay Image</description> + <id>24</id> + <width>101</width> + <height>150</height> + <texture>background.png</texture> + </control> + + </control> + <import>common.facade.xml</import> + </controls> +</window> \ No newline at end of file Added: trunk/plugins/RSS Plugins/My Flickr/GUIFlickr/GUIFlickr.cs =================================================================== --- trunk/plugins/RSS Plugins/My Flickr/GUIFlickr/GUIFlickr.cs (rev 0) +++ trunk/plugins/RSS Plugins/My Flickr/GUIFlickr/GUIFlickr.cs 2007-10-02 22:59:15 UTC (rev 971) @@ -0,0 +1,544 @@ +using System; +using System.Windows.Forms; +using MediaPortal.GUI.Library; +using MediaPortal.GUI.Video; +using MediaPortal.Dialogs; +using MediaPortal.Player; +using MediaPortal.Util; +using MediaPortal.GUI; +using MediaPortal.GUI.Pictures; +using System.Data; +using System.ComponentModel; +using c3o.Framework.Web; +using System.Collections.Specialized; + + +namespace MediaPortal.MyFlickr +{ + public class GUIFlickr : GUIVideoBaseWindow, ISetupForm + { + [SkinControlAttribute(10)] protected GUIButtonControl bttnAddSearchTag = null; + [SkinControlAttribute(14)] protected GUIButtonControl bttnDeleteSearchTag = null; + [SkinControlAttribute(50)] protected GUIFacadeControl listview = null; + + + VirtualDirectory virtualDirectory = new VirtualDirectory(); + + protected RssReader dtRss; + protected string Url = null; + protected string CurrentLocation = "."; + protected string ParentPath + { + get + { + if (CurrentLocation.Contains(":")) + { + return CurrentLocation.Substring(0, CurrentLocation.LastIndexOf(":")); + } + else + { + return null; + } + } + } + protected string sort = null; + protected string filter = null; + + public override int GetID + { + get + { + return 5699; + } + set + { + } + } + + + protected override void OnPageLoad() + { +// MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MediaPortal.xml"); + + base.OnPageLoad(); + + // Load Site List + this.ShowFolder("."); + + this.listview.View = GUIFacadeControl.ViewMode.SmallIcons; + + //facadeView.View = GUIFacadeControl.ViewMode.LargeIcons; + + } + + + // if (Utils.IsPicture(item.Path)) + //{ + // string thumbnailImage = GetThumbnail(item.Path); + // if (!System.IO.File.Exists(thumbnailImage)) + // { + // int iRotate = dbs.GetRotation(item.Path); + // Util.Picture.CreateThumbnail(item.Path, thumbnailImage, 128, 128, iRotate); + // System.Threading.Thread.Sleep(100); + // } + + // thumbnailImage = GetLargeThumbnail(item.Path); + // if (!System.IO.File.Exists(thumbnailImage)) + // { + // int iRotate = dbs.GetRotation(item.Path); + // Util.Picture.CreateThumbnail(item.Path, thumbnailImage, 512, 512, iRotate); + // // System.Threading.Thread.Sleep(100); + // } + //} + //} + + + protected void AddSearchTag() + { + string NewSearchTag = String.Empty; + + if (GetKeyboard(ref NewSearchTag)) + { + MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings("MediaPortal.xml"); + string SearchTags = xmlwriter.GetValue("MyFlickr", "SearchTags") as string; + + if (SearchTags != null && SearchTags.Length > 0) + { + SearchTags += "," + NewSearchTag; + } + else + { + SearchTags = NewSearchTag; + } + + xmlwriter.SetValue("MyFlickr", "SearchTags", SearchTags); + + this.Url = @"http://www.flickr.com/services/feeds/photos_public.gne?format=rss2&" + "tags=" + NewSearchTag; + this.ShowRSSAsc(); + } + } + + + + //protected bool GetKeyboard(ref string strLine) + //{ + // VirtualKeyboard keyboard = (VirtualKeyboard)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_VIRTUAL_KEYBOARD); + // if (null == keyboard) return false; + // keyboard.Reset(); + // keyboard.DoModal(this.GetID); + // if (keyboard.IsConfirmed) + // { + // strLine = keyboard.Text; + // return true; + // } + // return false; + //} + + + + + public override bool Init() + { + return Load(GUIGraphicsContext.Skin + @"\MyFlickr.xml"); + + // GUIWindowManager.Receivers += new SendMessageHandler(this.OnMessage); + } + + + + #region ISetupForm Members + + // Returns the name of the plugin which is shown in the plugin menu + public string PluginName() + { + return "My Flickr"; + } + + + + // Returns the description of the plugin is shown in the plugin menu + public string Description() + { + return "My Flickr"; + } + + + + // Returns the author of the plugin which is shown in the plugin menu + public string Author() + { + return "fcsobel"; + } + + + + // show the setup dialog + public void ShowPlugin() + { + //Form setup = new SetupForm(); + //setup.ShowDialog(); + } + + + + // Indicates whether plugin can be enabled/disabled + public bool CanEnable() + { + return true; + } + + // get ID of windowplugin belonging to this setup + public int GetWindowId() + { + return this.GetID; + } + + + + + // Indicates if plugin is enabled by default; + public bool DefaultEnabled() + { + return true; + } + + // indicates if a plugin has its own setup screen + public bool HasSetup() + { + return true; + } + + + /// <summary> + /// If the plugin should have its own button on the main menu of Media Portal then it + /// should return true to this method, otherwise if it should not be on home + /// it should return false + /// </summary> + /// <param name="strButtonText">text the button should have</param> + /// <param name="strButtonImage">image for the button, or empty for default</param> + /// <param name="strButtonImageFocus">image for the button, or empty for default</param> + /// <param name="strPictureImage">subpicture for the button or empty for none</param> + /// <returns>true : plugin needs its own button on home + /// false : plugin does not need its own button on home</returns> + //public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) + //{ + + // strButtonText = "UKNova"; + // strButtonImage = String.Empty; + // strButtonImageFocus = String.Empty; + // strPictureImage = String.Empty; + // return false; + //} + + public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) + { + strButtonText = PluginName(); + strButtonImage = String.Empty; + strButtonImageFocus = String.Empty; + strPictureImage = String.Empty; + return true; + } + #endregion + + + protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType) + { + if (control == this.bttnAddSearchTag) this.AddSearchTag(); + if (control == this.listview) this.OnListView(); + + base.OnClicked(controlId, control, actionType); + } + + + public override void OnAction(Action action) + { + base.OnAction(action); + + if (action.IsUserAction()) + { + GUIListItem item = this.listview.SelectedListItem; + + if (item != null) + { + // Set Display + GUIPropertyManager.SetProperty("#title", item.Label); + + if (item.IsFolder) + { + + } + else + { + // Show Details for picture + // GUIControl.SelectItemControl(GetID, this.listview.GetID, this.listview.SelectedListItemIndex); + } + } + } + } + + //protected void SwitchView() + //{ + // switch (CurrentView) + // { + // case View.List: + // facadeView.View = GUIFacadeControl.ViewMode.List; + // break; + // case View.Icons: + // facadeView.View = GUIFacadeControl.ViewMode.SmallIcons; + // break; + // case View.LargeIcons: + // facadeView.View = GUIFacadeControl.ViewMode.LargeIcons; + // break; + // case View.Albums: + // facadeView.View = GUIFacadeControl.ViewMode.AlbumView; + // break; + // case View.FilmStrip: + // facadeView.View = GUIFacadeControl.ViewMode.Filmstrip; + // break; + // } + //} + + + + void OnClick(int itemIndex) + { + GUIListItem item = this.listview.SelectedListItem; + if (item == null) return; + if (item.IsFolder) + { + } + else + { + if (virtualDirectory.IsRemote(item.Path)) + { + if (!virtualDirectory.IsRemoteFileDownloaded(item.Path, item.FileInfo.Length)) + { + if (!virtualDirectory.ShouldWeDownloadFile(item.Path)) return; + if (!virtualDirectory.DownloadRemoteFile(item.Path, item.FileInfo.Length)) + { + //show message that we are unable to download the file + GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_SHOW_WARNING, 0, 0, 0, 0, 0, 0); + msg.Param1 = 916; + msg.Param2 = 920; + msg.Param3 = 0; + msg.Param4 = 0; + GUIWindowManager.SendMessage(msg); + + return; + } + } + return; + } + + //selectedItemIndex = GetSelectedItemNo(); +// OnShowPicture(item.Path); + } + } + + + //void OnShowPicture(string strFile) + //{ + // GUISlideShow SlideShow = (GUISlideShow)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_SLIDESHOW); + // if (SlideShow == null) return; + + + // SlideShow.Reset(); + // for (int i = 0; i < this.listview.Count; ++i) + // { + // GUIListItem item = this.listview[itemIndex]; + // if (!item.IsFolder) + // { + // if (item.IsRemote) continue; + // SlideShow.Add(item.Path); + // } + // } + // GUIWindowManager.ActivateWindow((int)GUIWindow.Window.WINDOW_SLIDESHOW); + // SlideShow.Select(strFile); + //} + + + + //public void ShowItem(int index) + //{ + // if (dtRss != null && dtRss.Rows.Count > 0) + // { + // int i = this.listview.SelectedListItemIndex; + + // if (i < dtRss.Rows.Count) + // { + // DataRow row = dtRss.Rows[i]; + + // string pubDate = row["pubDate"].ToString(); + // string description = row["description"].ToString(); + + // if (pubDate != null && pubDate.Length > 0) + // { + // this.pubDateValue.Label = pubDate; + // } + + // this.detailbox.Label = description; + // } + // } + //} + + + + + private void OnListView() + { + GUIListItem item = this.listview.SelectedListItem; + + if (item != null) + { + if (item.IsFolder) + { + if (item.IsRemote) + { + this.Url = item.Path; + this.ShowRSSAsc(); + } + else + { + this.ShowFolder(item.Path); + } + } + else // Must be a picture + { + GUIControl.SelectItemControl(GetID, this.listview.GetID, this.listview.SelectedListItemIndex); + + ///item.IsDownloading = true; + + // Download File + //this.dtRss.Download(item.Path, item.Label); + + // show the image + } + } + } + + + /// <summary> + /// Show Folder Contents + /// </summary> + /// <param name="path"></param> + protected void ShowFolder(string path) + { + if (path == ".") + { + this.listview.Clear(); + + // Show Top level + GUIListItem item = new GUIListItem(); + item = new GUIListItem(); + item.Label = "Latest Flickr Photos"; + item.IsFolder = true; + item.IsRemote = true; + item.IconImage = "defaultVideo.png"; + item.Path = @"http://www.flickr.com/services/feeds/photos_public.gne?format=rss2"; + listview.Add(item); + + + // Add Search Tags + MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MediaPortal.xml"); + + string SearchTags = xmlreader.GetValue("MyFlickr", "SearchTags") as string; + + if (SearchTags != null && SearchTags.Length > 0) + { + string[] TagList = SearchTags.Split(','); + + foreach (string Tag in TagList) + { + item = new GUIListItem(); + item.Label = Tag; + item.IsFolder = true; + item.IsRemote = true; + item.IconImage = "defaultVideo.png"; + item.Path = @"http://www.flickr.com/services/feeds/photos_public.gne?format=rss2&" + "tags=" + Tag; + listview.Add(item); + } + } + + // Set Focus on List + GUIControl.FocusControl(this.GetID, this.listview.GetID); + } + } + + + + + + // Background Version + public void ShowRSSAsc() + { + // Load Page in background + BackgroundWorker worker = new BackgroundWorker(); + worker.DoWork += new DoWorkEventHandler(this.ShowRSS); + worker.RunWorkerAsync(); + } + public void ShowRSS(object sender, DoWorkEventArgs e) { this.ShowRSS(); } + public void ShowRSS() + { + GUIPropertyManager.SetProperty("#title", "Loading..."); + GUIWindowManager.Process(); + + listview.Clear(); + + GUIListItem item = new GUIListItem(); + item = new GUIListItem(); + item.Label = ".."; + item.IsFolder = true; + item.IconImage = "defaultVideo.png"; + item.Path = "."; + listview.Add(item); + + GUIPropertyManager.SetProperty("#title", "Loading..." + this.Url); + GUIWindowManager.Process(); + + // Read rss feed + dtRss = new RssReader(this.Url); + + DataTable dt = dtRss.Detail; + + if (this.filter != null || this.sort != null) + { + // Convert to view for sort and filter + DataView dv = new DataView(dt); + + if (this.filter != null) dv.RowFilter = this.filter; + if (this.sort != null) dv.Sort = this.sort; + + /// Load back into table + dt = dv.ToTable(); + } + +// GUIPropertyManager.SetProperty("#title", "Loading..." + dt.Rows.Count.ToString()); + // GUIWindowManager.Process(); + + + foreach (DataRow row in dt.Rows) + { + GUIPropertyManager.SetProperty("#title", "Row"); + GUIWindowManager.Process(); + + item = new GUIListItem(); + item.IsFolder = false; + item.IsRemote = true; + item.IconImage = "defaultVideo.png"; + if (dt.Columns.Contains("media:content_url")) + { + item.Path = row["media:content_url"].ToString(); + + } + if (dt.Columns.Contains("media:thumbnail_url")) item.ThumbnailImage = row["media:thumbnail_url"].ToString(); + if (dt.Columns.Contains("title")) item.Label = row["title"].ToString(); + + + + listview.Add(item); + } + } + //this.RefreshTitle(); + + } +} Added: trunk/plugins/RSS Plugins/My Flickr/GUIFlickr/MyFlickr.xml =================================================================== --- trunk/plugins/RSS Plugins/My Flickr/GUIFlickr/MyFlickr.xml (rev 0) +++ trunk/plugins/RSS Plugins/My Flickr/GUIFlickr/MyFlickr.xml 2007-10-02 22:59:15 UTC (rev 971) @@ -0,0 +1,134 @@ +<window> + <id>2</id> + <defaultcontrol>2</defaultcontrol> + <allowoverlay>yes</allowoverlay> + <controls> + <control> + <description>BG</description> + <type>image</type> + <id>1</id> + <posX>0</posX> + <posY>0</posY> + <width>720</width> + <height>576</height> + <texture>background.png</texture> + </control> + <control> + <type>image</type> + <id>1</id> + <posX>60</posX> + <posY>20</posY> + <texture>pictures_logo.png</texture> + </control> + <control> + <description>My Pictures text label</description> + <type>label</type> + <id>1</id> + <posX>250</posX> + <posY>70</posY> + <label>My Flickr</label> + <font>font16</font> + <align>right</align> + <textcolor>ffffffff</textcolor> + </control> + <control> + <description>Number of Files Label</description> + <type>label</type> + <id>1</id> + <posX>260</posX> + <posY>530</posY> + <label>#itemcount</label> + <align>left</align> + <textcolor>ffffffff</textcolor> + </control> + <control> + <description>Selected item Label</description> + <type>fadelabel</type> + <id>1</id> + <posX>660</posX> + <posY>70</posY> + <width>400</width> + <label>#selecteditem</label> + <font>font13</font> + <align>right</align> + <textcolor>ffffffff</textcolor> + </control> + <control> + <type>group</type> + <description>group element</description> + <animation>FlyInFromLeft</animation> + <control> + <description>View-As button</description> + <type>button</type> + <id>2</id> + <posX>60</posX> + <posY>97</posY> + <label>100</label> + <onleft>2</onleft> + <onright>50</onright> + <onup>9</onup> + <ondown>3</ondown> + </control> + <control> + <type>sortbutton</type> + <id>3</id> + <posX>60</posX> + <posY>131</posY> + <label>103</label> + <onleft>3</onleft> + <onright>50</onright> + <onup>2</onup> + <ondown>6</ondown> + </control> + <control> + <description>SlideShow button</description> + <type>button</type> + <id>6</id> + <posX>60</posX> + <posY>165</posY> + <label>108</label> + <onleft>6</onleft> + <onright>50</onright> + <onup>3</onup> + <ondown>7</ondown> + </control> + <control> + <description>Recursive Slideshow</description> + <type>button</type> + <id>7</id> + <posX>60</posX> + <posY>199</posY> + <label>361</label> + <onleft>7</onleft> + <onright>50</onright> + <onup>6</onup> + <ondown>8</ondown> + </control> + <control> + <description>Create Thumbnails</description> + <type>button</type> + <id>8</id> + <posX>60</posX> + <posY>233</posY> + <label>109</label> + <onleft>8</onleft> + <onright>50</onright> + <onup>7</onup> + <ondown>9</ondown> + </control> + <control> + <description>Rotate</description> + <type>button</type> + <id>9</id> + <posX>60</posX> + <posY>267</posY> + <label>735</label> + <onleft>8</onleft> + <onright>50</onright> + <onup>8</onup> + <ondown>2</ondown> + </control> + </control> + <import>common.facade.xml</import> + </controls> +</window> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fc...@us...> - 2007-10-02 22:54:31
|
Revision: 970 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=970&view=rev Author: fcsobel Date: 2007-10-02 15:54:23 -0700 (Tue, 02 Oct 2007) Log Message: ----------- Added Paths: ----------- trunk/plugins/RSS Plugins/ Removed Paths: ------------- trunk/plugins/MyTorrents/ Copied: trunk/plugins/RSS Plugins (from rev 969, trunk/plugins/MyTorrents) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-10-02 15:03:31
|
Revision: 969 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=969&view=rev Author: and-81 Date: 2007-10-02 08:03:30 -0700 (Tue, 02 Oct 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs 2007-10-02 15:03:19 UTC (rev 968) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs 2007-10-02 15:03:30 UTC (rev 969) @@ -249,9 +249,11 @@ { blasterPort = (BlasterPort)Enum.Parse(typeof(BlasterPort), port, true); } - catch (Exception ex) + catch { - throw new ArgumentException("Invalid Blaster Port", "port", ex); +#if TRACE + Trace.WriteLine("Invalid Blaster Port ({0}), using default ({1})", port, blasterPort.ToString()); +#endif } IrCode code = IrCode.FromByteArray(data); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-10-02 15:03:21
|
Revision: 968 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=968&view=rev Author: and-81 Date: 2007-10-02 08:03:19 -0700 (Tue, 02 Oct 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/InputMapper/InputHandler.cs trunk/plugins/MCEReplacement/InputMapper/InputMappingForm.cs Modified: trunk/plugins/MCEReplacement/InputMapper/InputHandler.cs =================================================================== --- trunk/plugins/MCEReplacement/InputMapper/InputHandler.cs 2007-10-02 05:45:04 UTC (rev 967) +++ trunk/plugins/MCEReplacement/InputMapper/InputHandler.cs 2007-10-02 15:03:19 UTC (rev 968) @@ -131,7 +131,7 @@ /// <summary> /// Constructor: Initializes mappings from XML file /// </summary> - /// <param name="deviceXmlName">Input device name</param> + /// <param name="deviceXmlName">Input device name.</param> public InputHandler(string deviceXmlName) { @@ -146,7 +146,7 @@ /// <summary> /// Get version of XML mapping file /// </summary> - /// <param name="xmlPath">Path to XML file</param> + /// <param name="xmlPath">Path to XML file.</param> /// Possible exceptions: System.Xml.XmlException public int GetXmlVersion(string xmlPath) { @@ -159,7 +159,7 @@ /// <summary> /// Check if XML file exists and version is current /// </summary> - /// <param name="xmlPath">Path to XML file</param> + /// <param name="xmlPath">Path to XML file.</param> /// Possible exceptions: System.IO.FileNotFoundException /// System.Xml.XmlException /// ApplicationException("XML version mismatch") @@ -174,14 +174,14 @@ /// <summary> /// Get path to XML mmapping file for given device name /// </summary> - /// <param name="deviceXmlName">Input device name</param> - /// <returns>Path to XML file</returns> + /// <param name="deviceXmlName">Input device name.</param> + /// <returns>Path to XML file.</returns> /// Possible exceptions: System.IO.FileNotFoundException /// System.Xml.XmlException /// ApplicationException("XML version mismatch") public string GetXmlPath(string deviceXmlName) { - string path = string.Empty; + string path = String.Empty; string pathCustom = MCEReplacement.CustomInputDevice + deviceXmlName + ".xml"; string pathDefault = MCEReplacement.CustomInputDefault + deviceXmlName + ".xml"; @@ -202,10 +202,10 @@ /// <summary> /// Load mapping from XML file /// </summary> - /// <param name="xmlPath">Path to XML file</param> + /// <param name="xmlPath">Path to XML file.</param> public void LoadMapping(string xmlPath) { - if (xmlPath != string.Empty) + if (xmlPath != String.Empty) { _remote = new ArrayList(); XmlDocument doc = new XmlDocument(); @@ -231,7 +231,7 @@ cmdKeyChar = Convert.ToInt32(nodeAction.Attributes["cmdkeychar"].Value); cmdKeyCode = Convert.ToInt32(nodeAction.Attributes["cmdkeycode"].Value); } - string sound = string.Empty; + string sound = String.Empty; XmlAttribute soundAttribute = nodeAction.Attributes["sound"]; if (soundAttribute != null) sound = soundAttribute.Value; @@ -254,7 +254,7 @@ /// <summary> /// Evaluates the button number, gets its mapping and executes the action /// </summary> - /// <param name="btnCode">Button code (ref: XML file)</param> + /// <param name="btnCode">Button code (ref: XML file).</param> public bool MapAction(int btnCode) { return DoMapAction(btnCode.ToString(), -1); @@ -263,7 +263,7 @@ /// <summary> /// Evaluates the button number, gets its mapping and executes the action /// </summary> - /// <param name="btnCode">Button code (ref: XML file)</param> + /// <param name="btnCode">Button code (ref: XML file).</param> public bool MapAction(string btnCode) { return DoMapAction(btnCode, -1); @@ -273,8 +273,8 @@ /// <summary> /// Evaluates the button number, gets its mapping and executes the action with an optional paramter /// </summary> - /// <param name="btnCode">Button code (ref: XML file)</param> - /// <param name="processID">Process-ID for close/kill commands</param> + /// <param name="btnCode">Button code (ref: XML file).</param> + /// <param name="processID">Process-ID for close/kill commands.</param> public bool MapAction(int btnCode, int processID) { return DoMapAction(btnCode.ToString(), processID); @@ -284,8 +284,8 @@ /// <summary> /// Evaluates the button number, gets its mapping and executes the action with an optional paramter /// </summary> - /// <param name="btnCode">Button code (ref: XML file)</param> - /// <param name="processID">Process-ID for close/kill commands</param> + /// <param name="btnCode">Button code (ref: XML file).</param> + /// <param name="processID">Process-ID for close/kill commands.</param> public bool MapAction(string btnCode, int processID) { return DoMapAction(btnCode, processID); @@ -295,8 +295,8 @@ /// <summary> /// Evaluates the button number, gets its mapping and executes the action /// </summary> - /// <param name="btnCode">Button code (ref: XML file)</param> - /// <param name="processID">Process-ID for close/kill commands</param> + /// <param name="btnCode">Button code (ref: XML file).</param> + /// <param name="processID">Process-ID for close/kill commands.</param> bool DoMapAction(string btnCode, int processID) { if (!_isLoaded) // No mapping loaded @@ -312,7 +312,7 @@ Log.Info("{0} / {1} / {2} / {3}", map.Condition, map.ConProperty, map.Command, map.CmdProperty); #endif Action action; - if (map.Sound != string.Empty) + if (map.Sound != String.Empty) MediaPortal.Util.Utils.PlaySound(map.Sound, false, true); if (map.Focus && !GUIGraphicsContext.HasFocus) { @@ -426,8 +426,8 @@ /// <summary> /// Get mappings for a given button code based on the current conditions /// </summary> - /// <param name="btnCode">Button code (ref: XML file)</param> - /// <returns>Mapping</returns> + /// <param name="btnCode">Button code (ref: XML file).</param> + /// <returns>Mapping.</returns> public Mapping GetMapping(string btnCode) { RemoteMap button = null; Modified: trunk/plugins/MCEReplacement/InputMapper/InputMappingForm.cs =================================================================== --- trunk/plugins/MCEReplacement/InputMapper/InputMappingForm.cs 2007-10-02 05:45:04 UTC (rev 967) +++ trunk/plugins/MCEReplacement/InputMapper/InputMappingForm.cs 2007-10-02 15:03:19 UTC (rev 968) @@ -37,8 +37,8 @@ using MediaPortal.InputDevices; using MediaPortal.Configuration; +using IrssUtils.Forms; - namespace MediaPortal.Plugins { /// <summary> @@ -74,10 +74,10 @@ string inputClassName; bool changedSettings = false; - + class Data { string type; @@ -150,12 +150,12 @@ private MediaPortal.UserInterface.Controls.MPTextBox textBoxKeyCode; private MediaPortal.UserInterface.Controls.MPLabel labelExpand; private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxGainFocus; - - #endregion private MediaPortal.UserInterface.Controls.MPRadioButton radioButtonBlast; private Button buttonRemoveReplacements; + #endregion + /// <summary> /// Required designer variable. /// </summary> @@ -237,7 +237,7 @@ components.Dispose(); } } - + base.Dispose(disposing); } @@ -824,7 +824,7 @@ 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(); + string cmdProperty = nodeAction.Attributes["cmdproperty"].Value; // .ToUpper() string sound = String.Empty; XmlAttribute soundAttribute = nodeAction.Attributes["sound"]; if (soundAttribute != null) @@ -841,7 +841,7 @@ { case "WINDOW": { - try { conditionString = GetFriendlyName(Enum.GetName(typeof(GUIWindow.Window), Convert.ToInt32(conProperty))); } + try { conditionString = GetFriendlyName(Enum.GetName(typeof(GUIWindow.Window), Convert.ToInt32(conProperty))); } catch { conditionString = conProperty; } break; } @@ -872,7 +872,7 @@ break; case "WINDOW": { - try { commandString = "Window \"" + GetFriendlyName(Enum.GetName(typeof(GUIWindow.Window), Convert.ToInt32(cmdProperty))) + "\""; } + try { commandString = "Window \"" + GetFriendlyName(Enum.GetName(typeof(GUIWindow.Window), Convert.ToInt32(cmdProperty))) + "\""; } catch { commandString = "Window \"" + cmdProperty + "\""; } break; } @@ -886,7 +886,7 @@ commandString = processList[Array.IndexOf(nativeProcessList, cmdProperty)]; break; case "BLAST": - commandString = "Blast IR: \"" + cmdProperty + "\""; + commandString = cmdProperty; break; } @@ -962,107 +962,108 @@ //try #endif { - XmlTextWriter writer = new XmlTextWriter(Config.GetFile(Config.Dir.CustomInputDevice, xmlFile), System.Text.Encoding.UTF8); - writer.Formatting = Formatting.Indented; - writer.Indentation = 1; - writer.IndentChar = (char)9; - writer.WriteStartDocument(true); - writer.WriteStartElement("mappings"); // <mappings> - writer.WriteAttributeString("version", "3"); - if (treeMapping.Nodes.Count > 0) - foreach (TreeNode remoteNode in treeMapping.Nodes) - { - writer.WriteStartElement("remote"); // <remote> - writer.WriteAttributeString("family", (string)((Data)remoteNode.Tag).Value); - if (remoteNode.Nodes.Count > 0) - foreach (TreeNode buttonNode in remoteNode.Nodes) - { - writer.WriteStartElement("button"); // <button> - writer.WriteAttributeString("name", (string)((Data)buttonNode.Tag).Parameter); - writer.WriteAttributeString("code", (string)((Data)buttonNode.Tag).Value); + using (XmlTextWriter writer = new XmlTextWriter(Config.GetFile(Config.Dir.CustomInputDevice, xmlFile), System.Text.Encoding.UTF8)) + { + writer.Formatting = Formatting.Indented; + writer.Indentation = 1; + writer.IndentChar = (char)9; + writer.WriteStartDocument(true); + writer.WriteStartElement("mappings"); // <mappings> + writer.WriteAttributeString("version", "3"); + if (treeMapping.Nodes.Count > 0) + foreach (TreeNode remoteNode in treeMapping.Nodes) + { + writer.WriteStartElement("remote"); // <remote> + writer.WriteAttributeString("family", (string)((Data)remoteNode.Tag).Value); + if (remoteNode.Nodes.Count > 0) + foreach (TreeNode buttonNode in remoteNode.Nodes) + { + writer.WriteStartElement("button"); // <button> + writer.WriteAttributeString("name", (string)((Data)buttonNode.Tag).Parameter); + writer.WriteAttributeString("code", (string)((Data)buttonNode.Tag).Value); - if (buttonNode.Nodes.Count > 0) - foreach (TreeNode layerNode in buttonNode.Nodes) - { - foreach (TreeNode conditionNode in layerNode.Nodes) + if (buttonNode.Nodes.Count > 0) + foreach (TreeNode layerNode in buttonNode.Nodes) { - string layer; - string condition; - string conProperty; - string command = String.Empty; - string cmdProperty = String.Empty; - string cmdKeyChar = String.Empty; - string cmdKeyCode = String.Empty; - string sound = String.Empty; - bool focus = false; - foreach (TreeNode commandNode in conditionNode.Nodes) + foreach (TreeNode conditionNode in layerNode.Nodes) { - switch (((Data)commandNode.Tag).Type) + string layer; + string condition; + string conProperty; + string command = String.Empty; + string cmdProperty = String.Empty; + string cmdKeyChar = String.Empty; + string cmdKeyCode = String.Empty; + string sound = String.Empty; + bool focus = false; + foreach (TreeNode commandNode in conditionNode.Nodes) { - case "COMMAND": - { - command = (string)((Data)commandNode.Tag).Parameter; - focus = ((Data)commandNode.Tag).Focus; - if (command != "KEY") - cmdProperty = ((Data)commandNode.Tag).Value.ToString(); - else + switch (((Data)commandNode.Tag).Type) + { + case "COMMAND": { - command = "ACTION"; - Key key = (Key)((Data)commandNode.Tag).Value; - cmdProperty = "93"; - cmdKeyChar = key.KeyChar.ToString(); - cmdKeyCode = key.KeyCode.ToString(); + command = (string)((Data)commandNode.Tag).Parameter; + focus = ((Data)commandNode.Tag).Focus; + if (command != "KEY") + cmdProperty = ((Data)commandNode.Tag).Value.ToString(); + else + { + command = "ACTION"; + Key key = (Key)((Data)commandNode.Tag).Value; + cmdProperty = "93"; + cmdKeyChar = key.KeyChar.ToString(); + cmdKeyCode = key.KeyCode.ToString(); + } } - } - break; - case "SOUND": - sound = (string)((Data)commandNode.Tag).Value; - break; + break; + case "SOUND": + sound = (string)((Data)commandNode.Tag).Value; + break; + } } - } - condition = (string)((Data)conditionNode.Tag).Parameter; - conProperty = ((Data)conditionNode.Tag).Value.ToString(); - layer = Convert.ToString(((Data)layerNode.Tag).Value); - writer.WriteStartElement("action"); // <action> - writer.WriteAttributeString("layer", layer); - writer.WriteAttributeString("condition", condition); - writer.WriteAttributeString("conproperty", conProperty); - writer.WriteAttributeString("command", command); - writer.WriteAttributeString("cmdproperty", cmdProperty); - if (cmdProperty == Convert.ToInt32(Action.ActionType.ACTION_KEY_PRESSED).ToString()) - { - if (!String.IsNullOrEmpty(cmdKeyChar)) + condition = (string)((Data)conditionNode.Tag).Parameter; + conProperty = ((Data)conditionNode.Tag).Value.ToString(); + layer = Convert.ToString(((Data)layerNode.Tag).Value); + writer.WriteStartElement("action"); // <action> + writer.WriteAttributeString("layer", layer); + writer.WriteAttributeString("condition", condition); + writer.WriteAttributeString("conproperty", conProperty); + writer.WriteAttributeString("command", command); + writer.WriteAttributeString("cmdproperty", cmdProperty); + if (cmdProperty == Convert.ToInt32(Action.ActionType.ACTION_KEY_PRESSED).ToString()) { - writer.WriteAttributeString("cmdkeychar", cmdKeyChar); + if (!String.IsNullOrEmpty(cmdKeyChar)) + { + writer.WriteAttributeString("cmdkeychar", cmdKeyChar); + } + else + { + writer.WriteAttributeString("cmdkeychar", "0"); + } + if (!String.IsNullOrEmpty(cmdKeyCode)) + { + writer.WriteAttributeString("cmdkeycode", cmdKeyCode); + } + else + { + writer.WriteAttributeString("cmdkeychar", "0"); + } + } - else - { - writer.WriteAttributeString("cmdkeychar", "0"); - } - if (!String.IsNullOrEmpty(cmdKeyCode)) - { - writer.WriteAttributeString("cmdkeycode", cmdKeyCode); - } - else - { - writer.WriteAttributeString("cmdkeychar", "0"); - } - + if (!String.IsNullOrEmpty(sound)) + writer.WriteAttributeString("sound", sound); + if (focus) + writer.WriteAttributeString("focus", focus.ToString()); + writer.WriteEndElement(); // </action> } - if (!String.IsNullOrEmpty(sound)) - writer.WriteAttributeString("sound", sound); - if (focus) - writer.WriteAttributeString("focus", focus.ToString()); - writer.WriteEndElement(); // </action> } - } - writer.WriteEndElement(); // </button> - } - writer.WriteEndElement(); // </remote> - } - writer.WriteEndElement(); // </mapping> - writer.WriteEndDocument(); - writer.Close(); + writer.WriteEndElement(); // </button> + } + writer.WriteEndElement(); // </remote> + } + writer.WriteEndElement(); // </mapping> + writer.WriteEndDocument(); + } changedSettings = false; return true; } @@ -1214,9 +1215,9 @@ radioButtonWindow.Checked = true; comboBoxCondProperty.Enabled = true; - + string friendlyName; - try { friendlyName = GetFriendlyName(Enum.GetName(typeof(GUIWindow.Window), Convert.ToInt32(data.Value))); } + try { friendlyName = GetFriendlyName(Enum.GetName(typeof(GUIWindow.Window), Convert.ToInt32(data.Value))); } catch { friendlyName = Convert.ToInt32(data.Value).ToString(); } UpdateCombo(ref comboBoxCondProperty, windowsList, friendlyName); break; @@ -1288,9 +1289,9 @@ comboBoxCmdProperty.Enabled = true; textBoxKeyChar.Enabled = textBoxKeyCode.Enabled = false; textBoxKeyChar.Text = textBoxKeyCode.Text = String.Empty; - + string friendlyName; - try { friendlyName = GetFriendlyName(Enum.GetName(typeof(GUIWindow.Window), Convert.ToInt32(data.Value))); } + try { friendlyName = GetFriendlyName(Enum.GetName(typeof(GUIWindow.Window), Convert.ToInt32(data.Value))); } catch { friendlyName = Convert.ToInt32(data.Value).ToString(); } UpdateCombo(ref comboBoxCmdProperty, windowsListFiltered, friendlyName); break; @@ -1501,12 +1502,12 @@ TreeNode node = getNode("COMMAND"); Data data = new Data("COMMAND", "WINDOW", "0"); node.Tag = data; - + string friendlyName; - try { friendlyName = GetFriendlyName(Enum.GetName(typeof(GUIWindow.Window), Convert.ToInt32(data.Value))); } + try { friendlyName = GetFriendlyName(Enum.GetName(typeof(GUIWindow.Window), Convert.ToInt32(data.Value))); } catch { friendlyName = Convert.ToInt32(data.Value).ToString(); } UpdateCombo(ref comboBoxCmdProperty, windowsListFiltered, friendlyName); - + node.Text = "Window \"" + comboBoxCmdProperty.Text + "\""; ((Data)node.Tag).Focus = checkBoxGainFocus.Checked; changedSettings = true; @@ -1819,9 +1820,9 @@ TreeNode node = getNode("COMMAND"); Data data = new Data("COMMAND", "BLAST", String.Empty); node.Tag = data; - node.Text = "Blast IR: \"\""; + node.Text = ""; ((Data)node.Tag).Focus = checkBoxGainFocus.Checked; - UpdateCombo(ref comboBoxCmdProperty, MCEReplacement.GetFileList(true), string.Empty); + UpdateCombo(ref comboBoxCmdProperty, MCEReplacement.GetFileList(true), String.Empty); changedSettings = true; } @@ -1843,13 +1844,13 @@ if (e.KeyCode == Keys.Enter && comboBoxCondProperty.DropDownStyle == ComboBoxStyle.DropDown) ConditionPropChanged(); } - + private void comboBoxCmdProperty_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter && comboBoxCmdProperty.DropDownStyle == ComboBoxStyle.DropDown) CommandPropChanged(); } - + private void CommandPropChanged() { if ((string)comboBoxCmdProperty.SelectedItem == "Key Pressed") @@ -1898,9 +1899,30 @@ node.Text = (string)comboBoxCmdProperty.SelectedItem; break; case "BLAST": - node.Tag = new Data("COMMAND", "BLAST", (string)comboBoxCmdProperty.SelectedItem); - node.Text = "Blast IR: \"" + (string)comboBoxCmdProperty.SelectedItem + "\""; - break; + { + string text = (string)comboBoxCmdProperty.SelectedItem; + if (text.StartsWith(IrssUtils.Common.CmdPrefixBlast, StringComparison.InvariantCultureIgnoreCase)) + { + BlastCommand blastCommand = new BlastCommand( + new IrssUtils.BlastIrDelegate(MCEReplacement.BlastIR), + MCEReplacement.IRFolder, + Enum.GetNames(typeof(MicrosoftMceTransceiver.BlasterPort)), + text.Substring(IrssUtils.Common.CmdPrefixBlast.Length)); + + if (blastCommand.ShowDialog(this) == DialogResult.OK) + { + string command = IrssUtils.Common.CmdPrefixBlast + blastCommand.CommandString; + node.Tag = new Data("COMMAND", "BLAST", command); + node.Text = command; + } + } + else if (text.StartsWith(IrssUtils.Common.CmdPrefixMacro, StringComparison.InvariantCultureIgnoreCase)) + { + node.Tag = new Data("COMMAND", "BLAST", text); + node.Text = text; + } + break; + } } ((Data)node.Tag).Focus = checkBoxGainFocus.Checked; changedSettings = true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-10-02 05:45:10
|
Revision: 967 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=967&view=rev Author: and-81 Date: 2007-10-01 22:45:04 -0700 (Mon, 01 Oct 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs trunk/plugins/IR Server Suite/Applications/IR Server/Config.Designer.cs trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/EditProgramForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Program.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs trunk/plugins/IR Server Suite/Common/IrssComms/ClientManager.cs trunk/plugins/IR Server Suite/Common/IrssComms/GenericPCQueue.cs trunk/plugins/IR Server Suite/Common/IrssComms/IrssMessage.cs trunk/plugins/IR Server Suite/Common/IrssComms/Server.cs trunk/plugins/IR Server Suite/Common/IrssUtils/IrssLog.cs trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IR Server Plugin Interface.csproj trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverReplacement.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverVista.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverXP.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/UirtTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Windows Message Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/X10Transceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/XBCDRC Receiver/XBCDRC Receiver.cs trunk/plugins/IR Server Suite/IR Server Suite.sln trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/SetupForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MappedEvent.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/SetupForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/StbSetup.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/PluginSetup.cs trunk/plugins/MCEReplacement/Forms/MacroEditor.cs trunk/plugins/MCEReplacement/Forms/MultiMapNameBox.cs trunk/plugins/MCEReplacement/Forms/SetupForm.cs trunk/plugins/MCEReplacement/Forms/StbSetup.cs trunk/plugins/MCEReplacement/MCEReplacement.cs trunk/plugins/MCEReplacement/MappedEvent.cs Added Paths: ----------- trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IConfigure.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IKeyboardReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/ILearnIR.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IMouseReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IRServerPluginBase.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IRemoteReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/ITransmitIR.cs Removed Paths: ------------- trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IRServerPluginInterface.cs Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-10-01 13:08:52 UTC (rev 966) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-10-02 05:45:04 UTC (rev 967) @@ -177,6 +177,9 @@ comboBoxPort.Items.Clear(); comboBoxPort.Items.AddRange(_irServerInfo.Ports); comboBoxPort.SelectedIndex = 0; + + _client.Send(new IrssMessage(MessageType.ActiveReceivers, MessageFlags.Request)); + _client.Send(new IrssMessage(MessageType.ActiveBlasters, MessageFlags.Request)); } else if ((received.Flags & MessageFlags.Failure) == MessageFlags.Failure) { @@ -184,6 +187,14 @@ } return; + case MessageType.ActiveBlasters: + this.Invoke(_addStatusLine, new Object[] { received.GetDataAsString() }); + break; + + case MessageType.ActiveReceivers: + this.Invoke(_addStatusLine, new Object[] { received.GetDataAsString() }); + break; + case MessageType.RemoteEvent: RemoteHandlerCallback(received.GetDataAsString()); return; @@ -521,6 +532,7 @@ private void buttonAutoTest_Click(object sender, EventArgs e) { AutoTest = new Thread(new ThreadStart(AutoTestThread)); + AutoTest.Name = "DebugClient.AutoTest"; AutoTest.IsBackground = true; AutoTest.Start(); } Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Config.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Config.Designer.cs 2007-10-01 13:08:52 UTC (rev 966) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Config.Designer.cs 2007-10-02 05:45:04 UTC (rev 967) @@ -34,20 +34,21 @@ this.buttonCancel = new System.Windows.Forms.Button(); this.toolTips = new System.Windows.Forms.ToolTip(this.components); this.checkBoxRunAtBoot = new System.Windows.Forms.CheckBox(); + this.buttonAdvanced = new System.Windows.Forms.Button(); + this.buttonDetect = new System.Windows.Forms.Button(); this.groupBoxTransceiver = new System.Windows.Forms.GroupBox(); this.gridPlugins = new SourceGrid.Grid(); this.buttonHelp = new System.Windows.Forms.Button(); - this.buttonAdvanced = new System.Windows.Forms.Button(); this.groupBoxTransceiver.SuspendLayout(); this.SuspendLayout(); // // buttonOK // this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonOK.Location = new System.Drawing.Point(352, 280); + this.buttonOK.Location = new System.Drawing.Point(352, 304); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(64, 24); - this.buttonOK.TabIndex = 4; + this.buttonOK.TabIndex = 5; this.buttonOK.Text = "OK"; this.buttonOK.UseVisualStyleBackColor = true; this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); @@ -56,26 +57,50 @@ // this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.buttonCancel.Location = new System.Drawing.Point(424, 280); + this.buttonCancel.Location = new System.Drawing.Point(424, 304); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(64, 24); - this.buttonCancel.TabIndex = 5; + this.buttonCancel.TabIndex = 6; this.buttonCancel.Text = "Cancel"; this.buttonCancel.UseVisualStyleBackColor = true; this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); // // checkBoxRunAtBoot // - this.checkBoxRunAtBoot.Anchor = System.Windows.Forms.AnchorStyles.Bottom; + this.checkBoxRunAtBoot.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.checkBoxRunAtBoot.AutoSize = true; - this.checkBoxRunAtBoot.Location = new System.Drawing.Point(168, 288); + this.checkBoxRunAtBoot.Location = new System.Drawing.Point(8, 272); this.checkBoxRunAtBoot.Name = "checkBoxRunAtBoot"; this.checkBoxRunAtBoot.Size = new System.Drawing.Size(165, 17); - this.checkBoxRunAtBoot.TabIndex = 3; + this.checkBoxRunAtBoot.TabIndex = 1; this.checkBoxRunAtBoot.Text = "&Start IR Server with Windows"; this.toolTips.SetToolTip(this.checkBoxRunAtBoot, "Run IR Server when windows boots up?"); this.checkBoxRunAtBoot.UseVisualStyleBackColor = true; // + // buttonAdvanced + // + this.buttonAdvanced.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonAdvanced.Location = new System.Drawing.Point(80, 304); + this.buttonAdvanced.Name = "buttonAdvanced"; + this.buttonAdvanced.Size = new System.Drawing.Size(64, 24); + this.buttonAdvanced.TabIndex = 3; + this.buttonAdvanced.Text = "Advanced"; + this.toolTips.SetToolTip(this.buttonAdvanced, "Click here for advanced options"); + this.buttonAdvanced.UseVisualStyleBackColor = true; + this.buttonAdvanced.Click += new System.EventHandler(this.buttonAdvanced_Click); + // + // buttonDetect + // + this.buttonDetect.Anchor = System.Windows.Forms.AnchorStyles.Bottom; + this.buttonDetect.Location = new System.Drawing.Point(216, 304); + this.buttonDetect.Name = "buttonDetect"; + this.buttonDetect.Size = new System.Drawing.Size(80, 24); + this.buttonDetect.TabIndex = 4; + this.buttonDetect.Text = "Auto-Detect"; + this.toolTips.SetToolTip(this.buttonDetect, "Click here to automatically detect attached devices"); + this.buttonDetect.UseVisualStyleBackColor = true; + this.buttonDetect.Click += new System.EventHandler(this.buttonDetect_Click); + // // groupBoxTransceiver // this.groupBoxTransceiver.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) @@ -108,31 +133,20 @@ // buttonHelp // this.buttonHelp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.buttonHelp.Location = new System.Drawing.Point(8, 280); + this.buttonHelp.Location = new System.Drawing.Point(8, 304); this.buttonHelp.Name = "buttonHelp"; this.buttonHelp.Size = new System.Drawing.Size(64, 24); - this.buttonHelp.TabIndex = 1; + this.buttonHelp.TabIndex = 2; this.buttonHelp.Text = "Help"; this.buttonHelp.UseVisualStyleBackColor = true; this.buttonHelp.Click += new System.EventHandler(this.buttonHelp_Click); // - // buttonAdvanced - // - this.buttonAdvanced.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.buttonAdvanced.Location = new System.Drawing.Point(80, 280); - this.buttonAdvanced.Name = "buttonAdvanced"; - this.buttonAdvanced.Size = new System.Drawing.Size(64, 24); - this.buttonAdvanced.TabIndex = 2; - this.buttonAdvanced.Text = "Advanced"; - this.toolTips.SetToolTip(this.buttonAdvanced, "Click here for advanced options"); - this.buttonAdvanced.UseVisualStyleBackColor = true; - this.buttonAdvanced.Click += new System.EventHandler(this.buttonAdvanced_Click); - // // Config // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(496, 319); + this.ClientSize = new System.Drawing.Size(496, 343); + this.Controls.Add(this.buttonDetect); this.Controls.Add(this.buttonAdvanced); this.Controls.Add(this.buttonHelp); this.Controls.Add(this.checkBoxRunAtBoot); @@ -140,7 +154,7 @@ this.Controls.Add(this.buttonCancel); this.Controls.Add(this.buttonOK); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MinimumSize = new System.Drawing.Size(504, 346); + this.MinimumSize = new System.Drawing.Size(504, 370); this.Name = "Config"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "IR Server - Configuration"; @@ -160,5 +174,6 @@ private System.Windows.Forms.Button buttonHelp; private SourceGrid.Grid gridPlugins; private System.Windows.Forms.Button buttonAdvanced; + private System.Windows.Forms.Button buttonDetect; } } \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs 2007-10-01 13:08:52 UTC (rev 966) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs 2007-10-02 05:45:04 UTC (rev 967) @@ -20,7 +20,7 @@ #region Variables - IRServerPlugin[] _transceivers; + IRServerPluginBase[] _transceivers; IRServerMode _mode = IRServerMode.ServerMode; string _hostComputer = String.Empty; @@ -165,7 +165,7 @@ row++; - foreach (IRServerPlugin transceiver in _transceivers) + foreach (IRServerPluginBase transceiver in _transceivers) { gridPlugins.Rows.Insert(row); @@ -262,7 +262,7 @@ string plugin = gridPlugins[cell.Row.Index, 0].DisplayText; - foreach (IRServerPlugin transceiver in _transceivers) + foreach (IRServerPluginBase transceiver in _transceivers) if (transceiver.Name == plugin) (transceiver as IConfigure).Configure(); } @@ -344,6 +344,29 @@ #endregion Controls + private void buttonDetect_Click(object sender, EventArgs e) + { + SourceGrid.Cells.CheckBox checkBox; + for (int row = 1; row < gridPlugins.RowsCount; row++) + { + string name = gridPlugins[row, 0].DisplayText; + + IRServerPluginBase plugin = Program.GetPlugin(name); + + bool detected = plugin.Detect(); + + // Receive + checkBox = gridPlugins[row, 1] as SourceGrid.Cells.CheckBox; + if (checkBox != null) + checkBox.Checked = detected; + + // Transmit + checkBox = gridPlugins[row, 2] as SourceGrid.Cells.CheckBox; + if (checkBox != null) + checkBox.Checked = detected; + } + } + } } Modified: trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-10-01 13:08:52 UTC (rev 966) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-10-02 05:45:04 UTC (rev 967) @@ -68,10 +68,10 @@ bool _registered = false; // Used for relay and repeater modes. string[] _pluginNameReceive; - IRServerPlugin[] _pluginReceive; + IRServerPluginBase[] _pluginReceive; string _pluginNameTransmit; - IRServerPlugin _pluginTransmit; + IRServerPluginBase _pluginTransmit; bool _inConfiguration = false; @@ -159,13 +159,13 @@ } else { - List<IRServerPlugin> plugins = new List<IRServerPlugin>(_pluginNameReceive.Length); + List<IRServerPluginBase> plugins = new List<IRServerPluginBase>(_pluginNameReceive.Length); for (int index = 0; index < _pluginNameReceive.Length; index++) { string pluginName = _pluginNameReceive[index]; - IRServerPlugin plugin = Program.GetPlugin(pluginName); + IRServerPluginBase plugin = Program.GetPlugin(pluginName); if (plugin == null) { @@ -222,7 +222,7 @@ if (_pluginReceive != null) { - foreach (IRServerPlugin plugin in _pluginReceive) + foreach (IRServerPluginBase plugin in _pluginReceive) { try { @@ -316,7 +316,7 @@ if (_pluginReceive != null) { - foreach (IRServerPlugin plugin in _pluginReceive) + foreach (IRServerPluginBase plugin in _pluginReceive) { try { @@ -441,6 +441,7 @@ ServerMessageSink sink = new ServerMessageSink(ServerReceivedMessage); _server = new Server(Server.DefaultPort, sink); + _server.ClientDisconnectCallback = new WaitCallback(ClientDisconnect); _server.Start(); } @@ -495,6 +496,17 @@ Thread.Sleep(1000); } + void ClientDisconnect(object obj) + { + ClientManager clientManager = obj as ClientManager; + + if (clientManager != null) + { + UnregisterClient(clientManager); + UnregisterRepeater(clientManager); + } + } + bool StartClient(IPEndPoint endPoint) { if (_client != null) @@ -704,7 +716,7 @@ if (_pluginReceive != null) { - foreach (IRServerPlugin plugin in _pluginReceive) + foreach (IRServerPluginBase plugin in _pluginReceive) { if (_pluginTransmit == plugin) resumedTransmit = true; @@ -733,7 +745,7 @@ if (_pluginReceive != null) { - foreach (IRServerPlugin plugin in _pluginReceive) + foreach (IRServerPluginBase plugin in _pluginReceive) { if (_pluginTransmit == plugin) suspendedTransmit = true; @@ -987,6 +999,8 @@ { switch (combo.Message.Type) { + + #region ForwardRemoteEvent case MessageType.ForwardRemoteEvent: if (_mode == IRServerMode.RelayMode) { @@ -999,7 +1013,9 @@ SendToAllExcept(combo.Manager, forward); } break; + #endregion ForwardRemoteEvent + #region ForwardKeyboardEvent case MessageType.ForwardKeyboardEvent: if (_mode == IRServerMode.RelayMode) { @@ -1012,7 +1028,9 @@ SendToAllExcept(combo.Manager, forward); } break; + #endregion ForwardKeyboardEvent + #region ForwardMouseEvent case MessageType.ForwardMouseEvent: if (_mode == IRServerMode.RelayMode) { @@ -1025,7 +1043,9 @@ SendToAllExcept(combo.Manager, forward); } break; + #endregion ForwardMouseEvent + #region BlastIR case MessageType.BlastIR: { IrssMessage response = new IrssMessage(MessageType.BlastIR, MessageFlags.Response); @@ -1050,7 +1070,9 @@ break; } + #endregion BlastIR + #region LearnIR case MessageType.LearnIR: { IrssMessage response = new IrssMessage(MessageType.LearnIR, MessageFlags.Response); @@ -1085,7 +1107,9 @@ SendTo(combo.Manager, response); break; } + #endregion LearnIR + #region ServerShutdown case MessageType.ServerShutdown: if ((combo.Message.Flags & MessageFlags.Request) == MessageFlags.Request) { @@ -1093,9 +1117,10 @@ Stop(); Application.Exit(); } - break; + #endregion ServerShutdown + #region RegisterClient case MessageType.RegisterClient: { IrssMessage response = new IrssMessage(MessageType.RegisterClient, MessageFlags.Response); @@ -1125,11 +1150,15 @@ SendTo(combo.Manager, response); break; } + #endregion RegisterClient + #region UnregisterClient case MessageType.UnregisterClient: UnregisterClient(combo.Manager); break; + #endregion UnregisterClient + #region RegisterRepeater case MessageType.RegisterRepeater: { IrssMessage response = new IrssMessage(MessageType.RegisterRepeater, MessageFlags.Response); @@ -1142,10 +1171,179 @@ SendTo(combo.Manager, response); break; } + #endregion RegisterRepeater + #region UnregisterRepeater case MessageType.UnregisterRepeater: UnregisterRepeater(combo.Manager); break; + #endregion UnregisterRepeater + + #region ActiveBlasters + case MessageType.ActiveBlasters: + { + IrssMessage response = new IrssMessage(MessageType.ActiveBlasters, MessageFlags.Response); + response.SetDataAsString(_pluginNameTransmit); + + SendTo(combo.Manager, response); + break; + } + #endregion ActiveBlasters + + #region ActiveReceivers + case MessageType.ActiveReceivers: + { + IrssMessage response = new IrssMessage(MessageType.ActiveReceivers, MessageFlags.Response); + + if (_pluginNameReceive != null) + { + StringBuilder receivers = new StringBuilder(); + for (int index = 0; index < _pluginNameReceive.Length; index++) + { + receivers.Append(_pluginNameReceive[index]); + + if (index < _pluginNameReceive.Length - 1) + receivers.Append(','); + } + + response.SetDataAsString(receivers.ToString()); + } + else + { + response.SetDataAsString(null); + } + + SendTo(combo.Manager, response); + break; + } + #endregion ActiveReceivers + + #region AvailableBlasters + case MessageType.AvailableBlasters: + { + IrssMessage response = new IrssMessage(MessageType.AvailableBlasters, MessageFlags.Response); + + IRServerPluginBase[] plugins = Program.AvailablePlugins(); + StringBuilder blasters = new StringBuilder(); + + for (int index = 0; index < plugins.Length; index++) + { + IRServerPluginBase plugin = plugins[index]; + + if (plugin is ITransmitIR) + { + blasters.Append(plugin.Name); + blasters.Append(','); + } + } + + if (blasters.Length == 0) + { + response.SetDataAsString(null); + } + else + { + blasters.Remove(blasters.Length - 1, 1); + response.SetDataAsString(blasters.ToString()); + } + + SendTo(combo.Manager, response); + break; + } + #endregion AvailableBlasters + + #region AvailableReceivers + case MessageType.AvailableReceivers: + { + IrssMessage response = new IrssMessage(MessageType.AvailableReceivers, MessageFlags.Response); + + IRServerPluginBase[] plugins = Program.AvailablePlugins(); + StringBuilder receivers = new StringBuilder(); + + for (int index = 0; index < plugins.Length; index++) + { + IRServerPluginBase plugin = plugins[index]; + + if (plugin is IRemoteReceiver || plugin is IKeyboardReceiver || plugin is IMouseReceiver) + { + receivers.Append(plugin.Name); + receivers.Append(','); + } + } + + if (receivers.Length == 0) + { + response.SetDataAsString(null); + } + else + { + receivers.Remove(receivers.Length - 1, 1); + response.SetDataAsString(receivers.ToString()); + } + + SendTo(combo.Manager, response); + break; + } + #endregion AvailableReceivers + + #region DetectedBlasters + case MessageType.DetectedBlasters: + { + IrssMessage response = new IrssMessage(MessageType.DetectedBlasters, MessageFlags.Response); + string[] detectedBlasters = Program.DetectBlasters(); + + if (detectedBlasters != null) + { + StringBuilder blasters = new StringBuilder(); + for (int index = 0; index < detectedBlasters.Length; index++) + { + blasters.Append(detectedBlasters[index]); + + if (index < detectedBlasters.Length - 1) + blasters.Append(','); + } + + response.SetDataAsString(blasters.ToString()); + } + else + { + response.SetDataAsString(null); + } + + SendTo(combo.Manager, response); + break; + } + #endregion DetectedBlasters + + #region DetectedReceivers + case MessageType.DetectedReceivers: + { + IrssMessage response = new IrssMessage(MessageType.DetectedReceivers, MessageFlags.Response); + string[] detectedReceivers = Program.DetectReceivers(); + + if (detectedReceivers != null) + { + StringBuilder receivers = new StringBuilder(); + for (int index = 0; index < detectedReceivers.Length; index++) + { + receivers.Append(detectedReceivers[index]); + + if (index < detectedReceivers.Length - 1) + receivers.Append(','); + } + + response.SetDataAsString(receivers.ToString()); + } + else + { + response.SetDataAsString(null); + } + + SendTo(combo.Manager, response); + break; + } + #endregion DetectedReceivers + } } catch (Exception ex) @@ -1232,6 +1430,19 @@ catch (FileNotFoundException) { IrssLog.Warn("No configuration file found ({0}), creating default configuration file", ConfigurationFile); + + string[] blasters = Program.DetectBlasters(); + if (blasters == null) + _pluginNameTransmit = String.Empty; + else + _pluginNameTransmit = blasters[0]; + + string[] receivers = Program.DetectReceivers(); + if (receivers == null) + _pluginNameReceive = null; + else + _pluginNameReceive = receivers; + SaveSettings(); return; } Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2007-10-01 13:08:52 UTC (rev 966) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2007-10-02 05:45:04 UTC (rev 967) @@ -30,14 +30,12 @@ catch (Exception ex) { Trace.WriteLine(ex.ToString()); - return; - } #else catch { +#endif return; } -#endif Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); @@ -74,11 +72,11 @@ /// Retreives a list of available IR Server plugins. /// </summary> /// <returns>Array of plugin instances.</returns> - internal static IRServerPlugin[] AvailablePlugins() + internal static IRServerPluginBase[] AvailablePlugins() { try { - List<IRServerPlugin> plugins = new List<IRServerPlugin>(); + List<IRServerPluginBase> plugins = new List<IRServerPluginBase>(); string installFolder = SystemRegistry.GetInstallFolder(); if (String.IsNullOrEmpty(installFolder)) @@ -95,10 +93,10 @@ foreach (Type type in types) { - if (type.IsClass && !type.IsAbstract && type.IsSubclassOf(typeof(IRServerPlugin))) + if (type.IsClass && !type.IsAbstract && type.IsSubclassOf(typeof(IRServerPluginBase))) { - IRServerPlugin plugin = (IRServerPlugin)assembly.CreateInstance(type.FullName); - + IRServerPluginBase plugin = (IRServerPluginBase)assembly.CreateInstance(type.FullName); + if (plugin != null) plugins.Add(plugin); } @@ -108,6 +106,10 @@ { // Ignore Bad Image Format Exceptions, just keep checking for IR Server Plugins } + catch (TypeLoadException) + { + // Ignore Type Load Exceptions, just keep checking for IR Server Plugins + } catch (Exception ex) { MessageBox.Show(ex.ToString(), "IR Server Plugin Error"); @@ -119,15 +121,13 @@ #if TRACE catch (Exception ex) { - Trace.WriteLine(ex.ToString()); - return null; - } + Trace.WriteLine("IRServer: " + ex.ToString()); #else catch { +#endif return null; } -#endif } /// <summary> @@ -135,22 +135,88 @@ /// </summary> /// <param name="pluginName">Name of plugin to instantiate.</param> /// <returns>Plugin instance.</returns> - internal static IRServerPlugin GetPlugin(string pluginName) + internal static IRServerPluginBase GetPlugin(string pluginName) { if (String.IsNullOrEmpty(pluginName)) throw new ArgumentNullException("pluginName"); - IRServerPlugin[] serverPlugins = AvailablePlugins(); + IRServerPluginBase[] serverPlugins = AvailablePlugins(); if (serverPlugins == null) throw new FileNotFoundException("No available plugins found"); - foreach (IRServerPlugin plugin in serverPlugins) + foreach (IRServerPluginBase plugin in serverPlugins) if (plugin.Name.Equals(pluginName, StringComparison.InvariantCultureIgnoreCase)) return plugin; return null; } + /// <summary> + /// Retreives a list of detected Receiver plugins. + /// </summary> + /// <returns>String array of plugin names.</returns> + internal static string[] DetectReceivers() + { + try + { + IRServerPluginBase[] plugins = AvailablePlugins(); + + List<string> receivers = new List<string>(); + + foreach (IRServerPluginBase plugin in plugins) + if ((plugin is IRemoteReceiver || plugin is IKeyboardReceiver || plugin is IMouseReceiver) && plugin.Detect()) + receivers.Add(plugin.Name); + + if (receivers.Count > 0) + return receivers.ToArray(); + } +#if TRACE + catch (Exception ex) + { + Trace.WriteLine("IRServer: " + ex.ToString()); + } +#else + catch + { + } +#endif + + return null; + } + + /// <summary> + /// Retreives a list of detected Blaster plugins. + /// </summary> + /// <returns>String array of plugin names.</returns> + internal static string[] DetectBlasters() + { + try + { + IRServerPluginBase[] plugins = Program.AvailablePlugins(); + + List<string> blasters = new List<string>(); + + foreach (IRServerPluginBase plugin in plugins) + if (plugin is ITransmitIR && plugin.Detect()) + blasters.Add(plugin.Name); + + if (blasters.Count > 0) + return blasters.ToArray(); + } +#if TRACE + catch (Exception ex) + { + Trace.WriteLine("IRServer: " + ex.ToString()); + } +#else + catch + { + } +#endif + + return null; + } + } } Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs 2007-10-01 13:08:52 UTC (rev 966) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs 2007-10-02 05:45:04 UTC (rev 967) @@ -580,7 +580,7 @@ private void buttonNewMacro_Click(object sender, EventArgs e) { - MacroEditor macroEditor = new MacroEditor(true, String.Empty); + MacroEditor macroEditor = new MacroEditor(); macroEditor.ShowDialog(this); SetupMacroList(); Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/EditProgramForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/EditProgramForm.cs 2007-10-01 13:08:52 UTC (rev 966) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/EditProgramForm.cs 2007-10-02 05:45:04 UTC (rev 967) @@ -150,7 +150,7 @@ } catch (Exception ex) { - IrssLog.Error("Test Application: {0}", ex.Message); + IrssLog.Error("Test Application: {0}", ex.ToString()); } } Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MacroEditor.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MacroEditor.cs 2007-10-01 13:08:52 UTC (rev 966) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MacroEditor.cs 2007-10-02 05:45:04 UTC (rev 967) @@ -20,22 +20,38 @@ #region Constructor - public MacroEditor(bool newMacro, string name) + /// <summary> + /// Creates a Macro Editor windows form. + /// </summary> + public MacroEditor() { InitializeComponent(); + + textBoxName.Text = "New"; + textBoxName.Enabled = true; + } - textBoxName.Text = name; - textBoxName.Enabled = newMacro; + /// <summary> + /// Creates a Macro Editor windows form. + /// </summary> + /// <param name="name">The name of an existing macro.</param> + public MacroEditor(string name) + : this() + { + if (String.IsNullOrEmpty(name)) + throw new ArgumentNullException("name"); - if (!newMacro) - { - string fileName = Program.FolderMacros + name + Common.FileExtensionMacro; - ReadFromFile(fileName); - } + textBoxName.Text = name; + textBoxName.Enabled = false; + + string fileName = Program.FolderMacros + name + Common.FileExtensionMacro; + ReadFromFile(fileName); } #endregion Constructor + #region Implementation + void RefreshCommandList() { comboBoxCommands.Items.Clear(); @@ -57,6 +73,10 @@ comboBoxCommands.Items.AddRange(irList); } + /// <summary> + /// Write the macro in the listBox to a macro name provided. + /// </summary> + /// <param name="fileName">Name of Macro to write (macro name, not file path).</param> void WriteToFile(string fileName) { try @@ -150,6 +170,11 @@ IrssLog.Error(ex.ToString()); } } + + /// <summary> + /// Read a macro into the listBox from the macro name provided. + /// </summary> + /// <param name="fileName">Name of Macro to read (macro name, not file path).</param> void ReadFromFile(string fileName) { try @@ -157,6 +182,8 @@ XmlDocument doc = new XmlDocument(); doc.Load(fileName); + listBoxMacro.Items.Clear(); + XmlNodeList commandSequence = doc.DocumentElement.SelectNodes("action"); string commandProperty; @@ -237,36 +264,26 @@ if (selected == Common.UITextRun) { ExternalProgram externalProgram = new ExternalProgram(false); - - if (externalProgram.ShowDialog(this) == DialogResult.Cancel) - return; - - listBoxMacro.Items.Add(Common.CmdPrefixRun + externalProgram.CommandString); + if (externalProgram.ShowDialog(this) == DialogResult.OK) + listBoxMacro.Items.Add(Common.CmdPrefixRun + externalProgram.CommandString); } else if (selected == Common.UITextPause) { - IrssUtils.Forms.PauseTime pauseTime = new IrssUtils.Forms.PauseTime(); - - if (pauseTime.ShowDialog(this) == DialogResult.Cancel) - return; - - listBoxMacro.Items.Add(Common.CmdPrefixPause + pauseTime.Time.ToString()); + PauseTime pauseTime = new PauseTime(); + if (pauseTime.ShowDialog(this) == DialogResult.OK) + listBoxMacro.Items.Add(Common.CmdPrefixPause + pauseTime.Time.ToString()); } else if (selected == Common.UITextSerial) { SerialCommand serialCommand = new SerialCommand(); - if (serialCommand.ShowDialog(this) == DialogResult.Cancel) - return; - - listBoxMacro.Items.Add(Common.CmdPrefixSerial + serialCommand.CommandString); + if (serialCommand.ShowDialog(this) == DialogResult.OK) + listBoxMacro.Items.Add(Common.CmdPrefixSerial + serialCommand.CommandString); } else if (selected == Common.UITextWindowMsg) { MessageCommand messageCommand = new MessageCommand(); - if (messageCommand.ShowDialog(this) == DialogResult.Cancel) - return; - - listBoxMacro.Items.Add(Common.CmdPrefixWindowMsg + messageCommand.CommandString); + if (messageCommand.ShowDialog(this) == DialogResult.OK) + listBoxMacro.Items.Add(Common.CmdPrefixWindowMsg + messageCommand.CommandString); } else if (selected == Common.UITextTcpMsg) { @@ -279,18 +296,14 @@ else if (selected == Common.UITextKeys) { KeysCommand keysCommand = new KeysCommand(); - if (keysCommand.ShowDialog(this) == DialogResult.Cancel) - return; - - listBoxMacro.Items.Add(Common.CmdPrefixKeys + keysCommand.CommandString); + if (keysCommand.ShowDialog(this) == DialogResult.OK) + listBoxMacro.Items.Add(Common.CmdPrefixKeys + keysCommand.CommandString); } else if (selected == Common.UITextEject) { EjectCommand ejectCommand = new EjectCommand(); - if (ejectCommand.ShowDialog(this) == DialogResult.Cancel) - return; - - listBoxMacro.Items.Add(Common.CmdPrefixEject + ejectCommand.CommandString); + if (ejectCommand.ShowDialog(this) == DialogResult.OK) + listBoxMacro.Items.Add(Common.CmdPrefixEject + ejectCommand.CommandString); } else if (selected == Common.UITextStandby) { @@ -308,7 +321,7 @@ { listBoxMacro.Items.Add(Common.CmdPrefixShutdown); } - else + else if (selected.StartsWith(Common.CmdPrefixBlast)) { BlastCommand blastCommand = new BlastCommand( new BlastIrDelegate(Program.BlastIR), @@ -316,11 +329,13 @@ Program.TransceiverInformation.Ports, selected.Substring(Common.CmdPrefixBlast.Length)); - if (blastCommand.ShowDialog(this) == DialogResult.Cancel) - return; - - listBoxMacro.Items.Add(Common.CmdPrefixBlast + blastCommand.CommandString); + if (blastCommand.ShowDialog(this) == DialogResult.OK) + listBoxMacro.Items.Add(Common.CmdPrefixBlast + blastCommand.CommandString); } + else + { + throw new ApplicationException(String.Format("Unknown command in macro command list \"{0}\"", selected)); + } } private void buttonMoveUp_Click(object sender, EventArgs e) @@ -409,8 +424,7 @@ if (selected.StartsWith(Common.CmdPrefixPause)) { - IrssUtils.Forms.PauseTime pauseTime = new IrssUtils.Forms.PauseTime(int.Parse(selected.Substring(Common.CmdPrefixPause.Length))); - + PauseTime pauseTime = new PauseTime(int.Parse(selected.Substring(Common.CmdPrefixPause.Length))); if (pauseTime.ShowDialog(this) == DialogResult.Cancel) return; @@ -422,6 +436,7 @@ else if (selected.StartsWith(Common.CmdPrefixRun)) { string[] commands = Common.SplitRunCommand(selected.Substring(Common.CmdPrefixRun.Length)); + ExternalProgram executeProgram = new ExternalProgram(commands, false); if (executeProgram.ShowDialog(this) == DialogResult.Cancel) return; @@ -434,6 +449,7 @@ else if (selected.StartsWith(Common.CmdPrefixSerial)) { string[] commands = Common.SplitSerialCommand(selected.Substring(Common.CmdPrefixSerial.Length)); + SerialCommand serialCommand = new SerialCommand(commands); if (serialCommand.ShowDialog(this) == DialogResult.Cancel) return; @@ -446,6 +462,7 @@ else if (selected.StartsWith(Common.CmdPrefixWindowMsg)) { string[] commands = Common.SplitWindowMessageCommand(selected.Substring(Common.CmdPrefixWindowMsg.Length)); + MessageCommand messageCommand = new MessageCommand(commands); if (messageCommand.ShowDialog(this) == DialogResult.Cancel) return; @@ -509,6 +526,8 @@ } } + #endregion Implementation + } } Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2007-10-01 13:08:52 UTC (rev 966) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2007-10-02 05:45:04 UTC (rev 967) @@ -270,7 +270,7 @@ } else { - MessageBox.Show(this, "File not found: " + command + Common.FileExtensionIR, "File missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + MessageBox.Show(this, "File not found: " + fileName, "IR file missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); RefreshIRList(); } } @@ -284,12 +284,12 @@ if (File.Exists(fileName)) { - MacroEditor macroEditor = new MacroEditor(false, command); + MacroEditor macroEditor = new MacroEditor(command); macroEditor.ShowDialog(this); } else { - MessageBox.Show(this, "File not found: " + command + Common.FileExtensionMacro, "File missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + MessageBox.Show(this, "File not found: " + fileName, "Macro file missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); RefreshMacroList(); } } @@ -668,13 +668,13 @@ } else { - MessageBox.Show(this, "File not found: " + fileName, "File missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + MessageBox.Show(this, "File not found: " + fileName, "IR file missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } private void buttonNewMacro_Click(object sender, EventArgs e) { - MacroEditor macroEditor = new MacroEditor(true, String.Empty); + MacroEditor macroEditor = new MacroEditor(); macroEditor.ShowDialog(this); RefreshMacroList(); @@ -700,7 +700,7 @@ } else { - MessageBox.Show(this, "File not found: " + fileName, "File missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + MessageBox.Show(this, "File not found: " + fileName, "Macro file missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } private void buttonTestMacro_Click(object sender, EventArgs e) Modified: trunk/plugins/IR Server Suite/Applications/Translator/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2007-10-01 13:08:52 UTC (rev 966) +++ trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2007-10-02 05:45:04 UTC (rev 967) @@ -847,7 +847,7 @@ catch (Exception ex) { _learnIRFilename = null; - IrssLog.Error(ex.Message); + IrssLog.Error(ex.ToString()); } } @@ -1160,7 +1160,7 @@ catch (Exception ex) { _learnIRFilename = null; - IrssLog.Error(ex.Message); + IrssLog.Error(ex.ToString()); return false; } Modified: trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs 2007-10-01 13:08:52 UTC (rev 966) +++ trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs 2007-10-02 05:45:04 UTC (rev 967) @@ -44,6 +44,8 @@ NotifyIcon _notifyIcon; + bool _inConfiguration = false; + #endregion Variables #region Properties @@ -109,12 +111,12 @@ } bool clientStarted = false; - - IPAddress serverIP = Client.GetIPFromName(_serverHost); - IPEndPoint endPoint = new IPEndPoint(serverIP, IrssComms.Server.DefaultPort); try { + IPAddress serverIP = Client.GetIPFromName(_serverHost); + IPEndPoint endPoint = new IPEndPoint(serverIP, IrssComms.Server.DefaultPort); + clientStarted = StartClient(endPoint); } catch (Exception ex) @@ -336,7 +338,6 @@ break; } - // If another module of the program has registered to receive messages too ... if (_handleMessage != null) _handleMessage(received); } @@ -384,17 +385,27 @@ { IrssLog.Info("Setup"); + _inConfiguration = true; + if (Configure()) { Stop(); Thread.Sleep(500); Start(); } + + _inConfiguration = false; } void ClickLaunch(object sender, EventArgs e) { IrssLog.Info("Launch"); + if (_inConfiguration) + { + IrssLog.Info("In Configuration"); + return; + } + try { // Check for multiple instances @@ -411,18 +422,23 @@ return; } } - catch { } + catch (Exception ex) + { + IrssLog.Error(ex.ToString()); + } } // Launch program Process launch = new Process(); launch.StartInfo.FileName = _programFile; launch.StartInfo.UseShellExecute = false; + launch.StartInfo.WindowStyle = ProcessWindowStyle.Normal; + launch.StartInfo.UseShellExecute = true; launch.Start(); } catch (Exception ex) { - IrssLog.Error(ex.Message); + IrssLog.Error(ex.ToString()); MessageBox.Show(ex.Message, "Tray Launcher", MessageBoxButtons.OK, MessageBoxIcon.Error); } } @@ -430,6 +446,12 @@ { IrssLog.Info("Quit"); + if (_inConfiguration) + { + IrssLog.Info("In Configuration"); + return; + } + Stop(); Application.Exit(); Modified: trunk/plugins/IR Server Suite/Common/IrssComms/ClientManager.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssComms/ClientManager.cs 2007-10-01 13:08:52 UTC (rev 966) +++ trunk/plugins/IR Server Suite/Common/IrssComms/ClientManager.cs 2007-10-02 05:45:04 UTC (rev 967) @@ -24,8 +24,23 @@ Socket _connection; + WaitCallback _disconnectCallback; + #endregion Variables + #region Properties + + /// <summary> + /// Gets or Sets the Disconnect callback. + /// </summary> + public WaitCallback DisconnectCallback + { + get { return _disconnectCallback; } + set { _disconnectCallback = value; } + } + + #endregion Properties + #region Constructor internal ClientManager(Socket connection, ServerMessageSink sink) @@ -80,9 +95,14 @@ _processReceiveThread = false; - _connection.Close(); - _connection = null; + if (_connection != null) + { + _connection.Close(100); + _connection = null; + } + _messageSink = null; + //_receiveThread.Abort(); //_receiveThread.Join(); _receiveThread = null; @@ -114,7 +134,7 @@ { bytesRead = _connection.Receive(buffer, buffer.Length, SocketFlags.None); if (bytesRead != buffer.Length) - break; // TODO: Inform server to remove clientmanager from list? (Low) + break; int readSize = BitConverter.ToInt32(buffer, 0); readSize = IPAddress.NetworkToHostOrder(readSize); @@ -127,7 +147,9 @@ IrssMessage message = IrssMessage.FromBytes(packet); MessageManagerCombo combo = new MessageManagerCombo(message, this); - _messageSink(combo); + + if (_messageSink != null) + _messageSink(combo); } } #if TRACE @@ -140,6 +162,16 @@ { } #endif + finally + { + if (_connection != null) + { + _connection.Close(100); + _connection = null; + } + + _disconnectCallback(this); + } } #endregion Implementation Modified: trunk/plugins/IR Server Suite/Common/IrssComms/GenericPCQueue.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssComms/GenericPCQueue.cs 2007-10-01 13:08:52 UTC (rev 966) +++ trunk/plugins/IR Server Suite/Common/IrssComms/GenericPCQueue.cs 2007-10-02 05:45:04 UTC (rev 967) @@ -104,8 +104,8 @@ // Create the worker thread ... _workerThread = new Thread(new ThreadStart(WorkerThread)); + _workerThread.Name = "IrssComms.GenericPCQueue"; _workerThread.IsBackground = true; - _workerThread.Name = "IrssComms.GenericPCQueue"; _workerThread.Start(); } Modified: trunk/plugins/IR Server Suite/Common/IrssComms/IrssMessage.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssComms/IrssMessage.cs 2007-10-01 13:08:52 UTC (rev 966) +++ trunk/plugins/IR Server Suite/Common/IrssComms/IrssMessage.cs 2007-10-02 05:45:04 UTC (rev 967) @@ -33,6 +33,13 @@ ForwardRemoteEvent, ForwardKeyboardEvent, ForwardMouseEvent, + + AvailableReceivers, + AvailableBlasters, + ActiveReceivers, + ActiveBlasters, + DetectedReceivers, + DetectedBlasters, } [Flags] Modified: trunk/plugins/IR Server Suite/Common/IrssComms/Server.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssComms/Server.cs 2007-10-01 13:08:52 UTC (rev 966) +++ trunk/plugins/IR Server Suite/Common/IrssComms/Server.cs 2007-10-02 05:45:04 UTC (rev 967) @@ -53,8 +53,23 @@ GenericPCQueue<MessageManagerCombo> _messageQueue; + WaitCallback _clientDisconnectCallback; + #endregion Variables + #region Properties + + /// <summary> + /// Gets or Sets the Client Disconnect callback. + /// </summary> + public WaitCallback ClientDisconnectCallback + { + get { return _clientDisconnectCallback; } + set { _clientDisconnectCallback = value; } + } + + #endregion Properties + #region Constructor /// <summary> @@ -148,8 +163,8 @@ catch { _processConnectionThread = false; - _serverSocket = null; - _clientManagers = null; + _serverSocket = null; + _clientManagers = null; _connectionThread = null; throw; @@ -205,7 +220,7 @@ } catch (SocketException) { - _clientManagers.Remove(sendTo); + ClientDisconnect(sendTo); return false; } } @@ -220,6 +235,25 @@ _messageSink(combo); } + void ClientDisconnect(object obj) + { + ClientManager clientManager = obj as ClientManager; + + if (clientManager != null) + { + lock (_clientManagers) + { + if (_clientManagers.Contains(clientManager)) + _clientManagers.Remove(clientManager); + } + + if (_clientDisconnectCallback != null) + _clientDisconnectCallback(clientManager); + + clientManager.Dispose(); + } + } + void ConnectionThread() { try @@ -231,6 +265,7 @@ Socket socket = _serverSocket.Accept(); ClientManager manager = new ClientManager(socket, clientManagerMessageSink); + manager.DisconnectCallback = new WaitCallback(ClientDisconnect); lock (_clientManagers) _clientManagers.Add(manager); Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/IrssLog.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/IrssLog.cs 2007-10-01 13:08:52 UTC (rev 966) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/IrssLog.cs 2007-10-02 05:45:04 UTC (rev 967) @@ -195,6 +195,9 @@ { string message = DateTime.Now.ToString() + " - Error:\t" + String.Format(format, args); _streamWriter.WriteLine(message); +#if TRACE + Trace.WriteLine(message); +#endif } } @@ -209,6 +212,9 @@ { string message = DateTime.Now.ToString() + " - Warn: \t" + String.Format(format, args); _streamWriter.WriteLine(message); +#if TRACE + Trace.WriteLine(message); +#endif } } @@ -223,6 +229,9 @@ { string message = DateTime.Now.ToString() + " - Info: \t" + String.Format(format, args); _streamWriter.WriteLine(message); +#if TRACE + Trace.WriteLine(message); +#endif } } @@ -237,6 +246,9 @@ { string message = DateTime.Now.ToString() + " - Debug:\t" + String.Format(format, args); _streamWriter.WriteLine(message); +#if TRACE + Trace.WriteLine(message); +#endif } } Modified: trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs 2007-10-01 13:08:52 UTC (rev 966) +++ trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs 2007-10-02 05:45:04 UTC (rev 967) @@ -17,7 +17,7 @@ namespace FusionRemoteReceiver { - public class FusionRemoteReceiver : IRServerPlugin, IRemoteReceiver + public class FusionRemoteReceiver : IRServerPluginBase, IRemoteReceiver { #region Constants @@ -202,6 +202,16 @@ public override string Author { get { return "and-81"; } } public override string Description { get { return "DViCO FusionREMOTE Receiver"; } } + public override bool Detect() + { + Guid hidGuid = new Guid(); + HidD_GetHidGuid(ref hidGuid); + + string devicePath = FindDevice(hidGuid, DeviceID); + + return (devicePath != null); + } + public override bool Start() { try @@ -217,15 +227,13 @@ #if TRACE catch (Exception ex) { - Trace.WriteLine(ex.ToString()); - return false; - } + Trace.WriteLine("FusionRemoteReceiver: " + ex.ToString()); #else catch { +#endif return false; } -#endif } public override void Suspend() { Added: trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IConfigure.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IConfigure.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IConfigure.cs 2007-10-02 05:45:04 UTC (rev 967) @@ -0,0 +1,19 @@ +using System; + +namespace IRServerPluginInterface +{ + + /// <summary> + /// Plugins that implement this interface are configurable. + /// </summary> + public interface IConfigure + { + + /// <summary> + /// Configure the IR Server plugin. + /// </summary> + void Configure(); + + } + +} Added: trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IKeyboardReceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IKeyboardReceiver.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IKeyboardReceiver.cs 2007-10-02 05:45:04 UTC (rev 967) @@ -0,0 +1,30 @@ +using System; + +namespace IRServerPluginInterface +{ + + #region Delegates + + /// <summary> + /// IR Server callback for keyboard key press handling. + /// </summary> + /// <param name="vKey">Virtual key code.</param> + /// <param name="keyUp">.</param> + public delegate void KeyboardHandler(int vKey, bool keyUp); + + #endregion Delegates + + /// <summary> + /// Plugins that implement this interface can receive keyboard button presses. + /// </summary> + public interface IKeyboardReceiver + { + + /// <summary> + /// Callback for keyboard presses. + /// </summary> + KeyboardHandler KeyboardCallback { get; set; } + + } + +} Added: trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/ILearnIR.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/ILearnIR.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/ILearnIR.cs 2007-10-02 05:45:04 UTC (rev 967) @@ -0,0 +1,44 @@ +using System; + +namespace IRServerPluginInterface +{ + + #region Enumerations + + /// <summary> + /// Provides information about the status of learning an infrared command. + /// </summary> + public enum LearnStatus + { + /// <summary> + /// Failed to learn infrared command. + /// </summary> + Failure, + /// <summary> + /// Succeeded in learning infrared command. + /// </summary> + Success, + /// <summary> + /// Infrared command learning timed out. + /// </summary> + Timeout, + } + + #endregion Enumerations + + /// <summary> + /// Plugins that implement this interface can learn IR commands. + /// </summary> + public interface ILearnIR + { + + /// <summary> + /// Learn an infrared command. + /// </summary> + /// <param name="data">New infrared command.</param> + /// <returns>Tells the calling code if the learn was Successful, Failed or Timed Out.</returns> + LearnStatus Learn(out byte[] data); + + } + +} Added: trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IMouseReceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IMouseReceiver.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugin... [truncated message content] |
From: <rs...@us...> - 2007-10-01 13:08:55
|
Revision: 966 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=966&view=rev Author: rsparey Date: 2007-10-01 06:08:52 -0700 (Mon, 01 Oct 2007) Log Message: ----------- Updating views to try and please more people... ie list view made bigger... film strip more icons... mid strip only visible when needed.... Modified Paths: -------------- trunk/skins/Foofaraw/Development Skin/Foofaraw/myradioguide.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/mytvrecordedtv.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/myvideo.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/myvideoTitle.xml Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/myradioguide.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/myradioguide.xml 2007-10-01 03:08:08 UTC (rev 965) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/myradioguide.xml 2007-10-01 13:08:52 UTC (rev 966) @@ -2,35 +2,12 @@ <window> <id>762</id> <defaultcontrol>2</defaultcontrol> - <allowoverlay>no</allowoverlay> + <allowoverlay>yes</allowoverlay> <controls> <import>common.window.xml</import> - <import>common.time.xml</import> <control> - <type>image</type> - <decription>mid_strip</decription> - <id>1</id> - <posX>-12</posX> - <posY>186</posY> - <width>1388</width> - <height>365</height> - <texture>mid_strip.png</texture> - <animation effect="zoom" start="100,100" end="100,135" center="12,186" time="1000" acceleration ="-1" >WindowOpen</animation> - <animation effect="zoom" start="100,135" end="100,100" center="12,186" time="1000" acceleration ="-1" >WindowClose</animation> - </control> + <import>common.time.xml</import> <control> <type>image</type> - <decription>bottom_strip</decription> - <id>1</id> - <posX>-12</posX> - <posY>547</posY> - <width>1388</width> - <height>18</height> - <texture>bottom_strip.png</texture> - <animation effect="slide" time="1000" start="0,0" end="0,130" acceleration="-1" >WindowOpen</animation> - <animation effect="slide" time="1000" start="0,130" end="0,0" acceleration="-1" >WindowClose</animation> - </control> - <control> - <type>image</type> <decription>top-strip</decription> <id>1</id> <posX>12</posX> @@ -98,7 +75,7 @@ <posX>5</posX> <posY>200</posY> <width>1322</width> - <height>300</height> + <height>380</height> <colordiffuse>60ffffff</colordiffuse> <texture>-</texture> <animation effect="fade" time="250">WindowOpen</animation> @@ -192,9 +169,9 @@ <description>Current program title</description> <type>fadelabel</type> <id>13</id> - <posX>200</posX> - <posY>500</posY> - <width>666</width> + <posX>400</posX> + <posY>580</posY> + <width>600</width> <label>#Radio.Guide.Title</label> <font>font16</font> <textcolor>FFFFFFFF</textcolor> @@ -205,8 +182,8 @@ <description>Current program time</description> <type>label</type> <id>14</id> - <posX>50</posX> - <posY>505</posY> + <posX>230</posX> + <posY>585</posY> <label>#Radio.Guide.Time</label> <align>left</align> <font>font16</font> @@ -218,8 +195,8 @@ <description>Current program genre</description> <type>label</type> <id>27</id> - <posX>891</posX> - <posY>720</posY> + <posX>1320</posX> + <posY>580</posY> <label>#Radio.Guide.Genre</label> <align>left</align> <font>font16</font> @@ -231,9 +208,9 @@ <description>Description1</description> <type>textboxscrollup</type> <id>15</id> - <posX>50</posX> - <posY>550</posY> - <width>1300</width> + <posX>230</posX> + <posY>620</posY> + <width>1100</width> <height>93</height> <seperator>----------------------------------------------------------------------------------------------</seperator> <label>#Radio.Guide.Description</label> @@ -302,6 +279,7 @@ <posY>503</posY> <texture>tvguide_record_button.png</texture> <visible>no</visible> + <keepaspectratio>yes</keepaspectratio> <animation effect="fade" time="250">WindowOpen</animation> <animation effect="fade" time="500">WindowClose</animation> </control> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/mytvrecordedtv.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/mytvrecordedtv.xml 2007-10-01 03:08:08 UTC (rev 965) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/mytvrecordedtv.xml 2007-10-01 13:08:52 UTC (rev 966) @@ -16,31 +16,7 @@ </control> <import>common.time.xml</import> - <control> - <type>image</type> - <decription>mid_strip</decription> - <id>1</id> - <posX>-12</posX> - <posY>186</posY> - <width>1388</width> - <height>365</height> - <texture>mid_strip.png</texture> - <animation effect="zoom" start="100,100" end="100,135" center="12,186" time="1000" acceleration ="-1" >WindowOpen</animation> - <animation effect="zoom" start="100,135" end="100,100" center="12,186" time="1000" acceleration ="-1" >WindowClose</animation> - </control> - - <control> - <type>image</type> - <decription>bottom_strip</decription> - <id>1</id> - <posX>-12</posX> - <posY>547</posY> - <width>1388</width> - <height>18</height> - <texture>bottom_strip.png</texture> - <animation effect="slide" time="1000" start="0,0" end="0,130" acceleration="-1" >WindowOpen</animation> - <animation effect="slide" time="1000" start="0,130" end="0,0" acceleration="-1" >WindowClose</animation> - </control> + <control> <type>image</type> @@ -134,7 +110,7 @@ <label>100</label> <font>font14</font> <onleft>7</onleft> - <onright>3</onright> + <onright>10</onright> <onup>22</onup> <ondown>10</ondown> <width>209</width> @@ -240,10 +216,9 @@ </control> + <control> - - <control> <type>group</type> <description>group element</description> <id>0</id> @@ -257,9 +232,9 @@ <id>10</id> <posX>20</posX> - <posY>210</posY> + <posY>140</posY> - <height>500</height> + <height>462</height> <width>600</width> <spinWidth>20</spinWidth> @@ -287,13 +262,13 @@ <textYOff>12</textYOff> <textYOff2>12</textYOff2> <textYOff3>48</textYOff3> - <IconXOff>22</IconXOff> - <IconYOff>16</IconYOff> + <IconXOff>10</IconXOff> + <IconYOff>10</IconYOff> <textcolor2>ffffffff</textcolor2> <textcolor3>ffccef61</textcolor3> - <itemHeight>50</itemHeight> - <itemWidth>50</itemWidth> + <itemHeight>70</itemHeight> + <itemWidth>75</itemWidth> <textureHeight>132</textureHeight> <keepaspectratio>yes</keepaspectratio> @@ -312,17 +287,17 @@ <id>11</id> <onleft>10</onleft> - <onright>2</onright> + <onright>3</onright> <onup>2</onup> <ondown>2</ondown> <textureHeight>42</textureHeight> - <height>500</height> + <height>600</height> <width>590</width> <textYOff2>5</textYOff2> <posX>30</posX> - <posY>205</posY> + <posY>140</posY> <spinWidth>27</spinWidth> <spinHeight>27</spinHeight> @@ -367,9 +342,9 @@ <type>image</type> <id>10</id> <posX>628</posX> - <posY>205</posY> + <posY>140</posY> <width>715</width> - <height>460</height> + <height>550</height> <texture>grey_background.png</texture> </control> @@ -449,6 +424,22 @@ <animation effect="slide" time="500" start="0,0" end="2000,0" acceleration="-1">WindowClose</animation> </control> + <control> + <id>1</id> + <type>image</type> + <posX>700</posX> + <posY>460</posY> + <width>500</width> + <height>150</height> + <centered>yes</centered> + <keepaspectratio>yes</keepaspectratio> + <texture flipY="true" diffuse="Thumb_Mask.png">#selectedthumb</texture> + <visible>Control.HasFocus(10)|Control.HasFocus(11)</visible> + <animation effect="fade" time="1000">visiblechange</animation> + <animation effect="slide" time="500" start="2000,0" end="0,0" delay="800" acceleration="-1">WindowOpen</animation> + </control> + + </controls> </window> \ No newline at end of file Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/myvideo.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/myvideo.xml 2007-10-01 03:08:08 UTC (rev 965) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/myvideo.xml 2007-10-01 13:08:52 UTC (rev 966) @@ -71,8 +71,8 @@ <id>1</id> <animation effect="fade" time="400">WindowClose</animation> <animation effect="fade" time="400">WindowOpen</animation> - <posX>250</posX> - <posY>600</posY> + <posX>240</posX> + <posY>650</posY> <width>1000</width> <label>#selecteditem</label> <font>wipeout</font> @@ -231,14 +231,24 @@ </control> - + <control> + <type>image</type> + <id>1</id> + <posX>155</posX> + <posY>180</posY> + <width>280</width> + <height>280</height> + <texture>cd_art.png</texture> + <visible>facadeview.list</visible> + <animation effect="fade" time="250">visiblechange</animation> + </control> <control> <id>1</id> <type>image</type> - <posX>165</posX> - <posY>170</posY> + <posX>155</posX> + <posY>155</posY> <width>280</width> - <height>280</height> + <height>400</height> <texture flipY="true" diffuse="Thumb_Mask.png">#selectedthumb</texture> <visible>facadeview.list</visible> <animation effect="fade" time="250">visiblechange</animation> @@ -248,9 +258,8 @@ <id>1</id> <posX>112</posX> <posY>150</posY> - <width>360</width> - <height>387</height> - <texture>dvd_box.png</texture> + <width>335</width> + <height>410</height> <texture flipY="true" diffuse="Thumb_Mask.png">dvd_box.png</texture> <visible>facadeview.list</visible> <animation effect="fade" time="250">visiblechange</animation> @@ -274,8 +283,8 @@ <description>listcontrol</description> <type>listcontrol</type> <id>50</id> - <onleft>2</onleft> - <onright>2</onright> + <onleft>50</onleft> + <onright>50</onright> <onup>2</onup> <ondown>2</ondown> <posX>542</posX> @@ -320,8 +329,8 @@ <description>Thumbnail Panel</description> <type>thumbnailpanel</type> <id>50</id> - <onleft>2</onleft> - <onright>2</onright> + <onleft>50</onleft> + <onright>50</onright> <onup>2</onup> <ondown>2</ondown> <posX>30</posX> @@ -379,8 +388,8 @@ <description>Filmstrip view</description> <type>filmstrip</type> <id>50</id> - <onleft>2</onleft> - <onright>2</onright> + <onleft>50</onleft> + <onright>50</onright> <onup>2</onup> <ondown>50</ondown> <posX>180</posX> @@ -529,5 +538,6 @@ <animation effect="fade" time="250">visiblechange</animation> <animation effect="slide" start="0,-36" end="0,0" time="250">visiblechange</animation> </control> + </controls> </window> \ No newline at end of file Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/myvideoTitle.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/myvideoTitle.xml 2007-10-01 03:08:08 UTC (rev 965) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/myvideoTitle.xml 2007-10-01 13:08:52 UTC (rev 966) @@ -1,47 +1,15 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <window> <id>25</id> - <defaultcontrol>2</defaultcontrol> + <defaultcontrol>2</defaultcontrol> <allowoverlay>yes</allowoverlay> - <define>#header.label:#view</define> - <define>#header.image:videos_logo.png</define> - <define>#header.hover:hover_my videos.png</define> + + + <controls> - <import>common.window.xml</import> <import>common.time.xml</import> - <control> - <type>image</type> - <decription>mid_strip</decription> - <id>1</id> - <posX>-12</posX> - <posY>186</posY> - <width>1390</width> - <height>365</height> - <texture>mid_strip.png</texture> - - </control> - <control> - <type>image</type> - <decription>bottom_strip</decription> - <id>1</id> - <posX>-12</posX> - <posY>547</posY> - <width>1390</width> - <height>18</height> - <texture>bottom_strip.png</texture> - - </control> <control> - <type>image</type> - <decription>top-strip</decription> - <id>1</id> - <posX>12</posX> - <posY>100</posY> - <width>1342</width> - <height>36</height> - <texture>top-strip.png</texture> - - </control> + @@ -103,36 +71,27 @@ <id>1</id> <animation effect="fade" time="400">WindowClose</animation> <animation effect="fade" time="400">WindowOpen</animation> - <posX>250</posX> - <posY>600</posY> + <posX>240</posX> + <posY>650</posY> <width>1000</width> <label>#selecteditem</label> - <font>wipeouts</font> - <align>center</align> + <font>wipeout</font> + <align>Left</align> <textcolor>ffffffff</textcolor> </control> - - <control> - <type>imagelist</type> - <animation effect="fade" time="250">WindowOpen</animation> - <animation effect="fade" time="500">WindowClose</animation> - <id>101</id> - <posX>1233</posX> - <posY>66</posY> - <width>210</width> - <height>42</height> - <textureWidth>21</textureWidth> - <textureHeight>21</textureHeight> - <subitems> - <subitem>greystar.png</subitem> - <subitem>star.png</subitem> - </subitems> - <orientation>horizontal</orientation> - <align>right</align> - <percentage>#rating</percentage> + + <control> + <type>image</type> + <decription>top-strip</decription> + <id>1</id> + <posX>12</posX> + <posY>100</posY> + <width>1342</width> + <height>36</height> + <texture>top-strip.png</texture> + </control> - - <control> + <control> <description>View-As button</description> <type>button</type> <id>2</id> @@ -155,7 +114,7 @@ </control> - <control> + <control> <type>sortbutton</type> <id>3</id> <animation effect="fade" time="400">WindowClose</animation> @@ -180,7 +139,8 @@ <offsetSortButtonY>8</offsetSortButtonY> <textcolor>white</textcolor> </control> - <control> + + <control> <description>Switch View button</description> <type>button</type> <id>5</id> @@ -200,7 +160,7 @@ <textureNoFocus>tab_up.png</textureNoFocus> </control> - <control> + <control> <description>Trailers</description> <type>button</type> <id>8</id> @@ -222,7 +182,9 @@ <textureNoFocus>tab_up.png</textureNoFocus> </control> - <control> + + + <control> <description>Play DVD</description> <type>button</type> <id>6</id> @@ -268,8 +230,52 @@ <textureNoFocus>tab_up.png</textureNoFocus> </control> - - <control> + + <control> + <type>image</type> + <id>1</id> + <posX>155</posX> + <posY>180</posY> + <width>280</width> + <height>280</height> + <texture>cd_art.png</texture> + <visible>facadeview.list</visible> + <animation effect="fade" time="250">visiblechange</animation> + </control> + <control> + <id>1</id> + <type>image</type> + <posX>155</posX> + <posY>155</posY> + <width>280</width> + <height>400</height> + <texture flipY="true" diffuse="Thumb_Mask.png">#selectedthumb</texture> + <visible>facadeview.list</visible> + <animation effect="fade" time="250">visiblechange</animation> + </control> + <control> + <type>image</type> + <id>1</id> + <posX>112</posX> + <posY>150</posY> + <width>335</width> + <height>410</height> + <texture flipY="true" diffuse="Thumb_Mask.png">dvd_box.png</texture> + <visible>facadeview.list</visible> + <animation effect="fade" time="250">visiblechange</animation> + </control> + + + + <control> + <type>group</type> + <animation effect="fade" time="400">WindowClose</animation> + <animation effect="fade" time="400">WindowOpen</animation> + <description>group element</description> + <layout>StackLayout</layout> + <posX>60</posX> + <posY>97</posY> + <control> <description>composite control consisting of a list control and a thumbnail panel</description> <type>facadeview</type> <id>50</id> @@ -277,18 +283,18 @@ <description>listcontrol</description> <type>listcontrol</type> <id>50</id> - <onleft>2</onleft> - <onright>2</onright> + <onleft>50</onleft> + <onright>50</onright> <onup>2</onup> <ondown>2</ondown> - <posX>30</posX> - <posY>200</posY> - <width>1306</width> - <height>330</height> + <posX>542</posX> + <posY>160</posY> + <width>800</width> + <height>520</height> <spinWidth>27</spinWidth> <spinHeight>27</spinHeight> <spinPosX>1240</spinPosX> - <spinPosY>515</spinPosY> + <spinPosY>650</spinPosY> <spinColor>ffffffff</spinColor> <textureUp>arrow_round_up_nofocus.png</textureUp> <textureDown>arrow_round_down_nofocus.png</textureDown> @@ -323,8 +329,8 @@ <description>Thumbnail Panel</description> <type>thumbnailpanel</type> <id>50</id> - <onleft>2</onleft> - <onright>2</onright> + <onleft>50</onleft> + <onright>50</onright> <onup>2</onup> <ondown>2</ondown> <posX>30</posX> @@ -382,13 +388,13 @@ <description>Filmstrip view</description> <type>filmstrip</type> <id>50</id> - <onleft>2</onleft> - <onright>2</onright> + <onleft>50</onleft> + <onright>50</onright> <onup>2</onup> <ondown>50</ondown> - <posX>25</posX> - <posY>260</posY> - <width>1360</width> + <posX>180</posX> + <posY>200</posY> + <width>1300</width> <height>400</height> <spinWidth>27</spinWidth> <spinHeight>27</spinHeight> @@ -399,14 +405,14 @@ <textureDown>arrow_round_down_nofocus.png</textureDown> <textureUpFocus>arrow_round_up_focus.png</textureUpFocus> <textureDownFocus>arrow_round_down_focus.png</textureDownFocus> - <itemWidth>120</itemWidth> + <itemWidth>265</itemWidth> <itemHeight>100</itemHeight> - <textureWidth>220</textureWidth> - <textureHeight>100</textureHeight> - <thumbWidth>101</thumbWidth> - <thumbHeight>154</thumbHeight> - <thumbPosX>15</thumbPosX><!-- 10 --> - <thumbPosY>1</thumbPosY><!-- 10 --> + <textureWidth>310</textureWidth> + <textureHeight>210</textureHeight> + <thumbWidth>210</thumbWidth> + <thumbHeight>310</thumbHeight> + <thumbPosX>25</thumbPosX><!-- 10 --> + <thumbPosY>5</thumbPosY><!-- 10 --> <imageFolder>dvd_box.png</imageFolder> <imageFolderFocus>dvd_box.png</imageFolderFocus> <keepaspectratio>no</keepaspectratio> @@ -440,8 +446,8 @@ <InfoImagediffuse>ffffffff</InfoImagediffuse> - <textureWidth>120</textureWidth> - <textureHeight>159</textureHeight> + <textureWidth>240</textureWidth> + <textureHeight>320</textureHeight> <showFolder>yes</showFolder> <showBackGround>no</showBackGround> @@ -460,15 +466,16 @@ </control> </control> - - <control> + </control> + + <control> <description>Tv Series</description> <type>button</type> <id>584</id> <animation effect="fade" time="400">WindowClose</animation> <animation effect="fade" time="400">WindowOpen</animation> - <posY>194</posY> + <posY>136</posY> <posX>639</posX> <label>TV Series</label> <hyperlink>9811</hyperlink> @@ -492,7 +499,7 @@ <id>7</id> <animation effect="fade" time="400">WindowClose</animation> <animation effect="fade" time="400">WindowOpen</animation> - <posY>194</posY> + <posY>136</posY> <posX>848</posX> <label>654</label> <font>font14</font> @@ -515,7 +522,7 @@ <id>9</id> <animation effect="fade" time="400">WindowClose</animation> <animation effect="fade" time="400">WindowOpen</animation> - <posY>194</posY> + <posY>136</posY> <posX>1057</posX> <label>983</label> <font>font14</font> @@ -531,13 +538,13 @@ <animation effect="fade" time="250">visiblechange</animation> <animation effect="slide" start="0,-36" end="0,0" time="250">visiblechange</animation> </control> - <control> + <control> <type>imagelist</type> <animation effect="fade" time="250">WindowOpen</animation> <animation effect="fade" time="500">WindowClose</animation> <id>101</id> <posX>1233</posX> - <posY>1240</posY> + <posY>66</posY> <width>210</width> <height>42</height> <textureWidth>21</textureWidth> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kro...@us...> - 2007-10-01 03:08:15
|
Revision: 965 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=965&view=rev Author: kroko_koenig Date: 2007-09-30 20:08:08 -0700 (Sun, 30 Sep 2007) Log Message: ----------- Update to my actual work version 0.4 Modified Paths: -------------- trunk/plugins/MyDbox/Source/MyDbox/ChannelInfo.cs trunk/plugins/MyDbox/Source/MyDbox/Data.cs trunk/plugins/MyDbox/Source/MyDbox/DboxSetupForm.Designer.cs trunk/plugins/MyDbox/Source/MyDbox/DboxSetupForm.cs trunk/plugins/MyDbox/Source/MyDbox/Epg.cs trunk/plugins/MyDbox/Source/MyDbox/MyDbox.csproj trunk/plugins/MyDbox/Source/MyDbox/MyDboxGui.cs trunk/plugins/MyDbox/Source/MyDbox/MyDboxPlugin.cs trunk/plugins/MyDbox/Source/MyDbox/Properties/AssemblyInfo.cs trunk/plugins/MyDbox/Source/MyDbox/Request.cs trunk/plugins/MyDbox/Source/MyDbox/bin/Release/MyDbox.dll trunk/plugins/MyDbox/Source/MyDbox/bin/Release/MyDbox.pdb trunk/plugins/MyDbox/Source/MyDbox/obj/Debug/MyDbox.dll trunk/plugins/MyDbox/Source/MyDbox/obj/Debug/MyDbox.pdb trunk/plugins/MyDbox/Source/MyDbox/obj/Debug/ResolveAssemblyReference.cache trunk/plugins/MyDbox/Source/MyDbox/obj/MyDbox.csproj.FileList.txt trunk/plugins/MyDbox/Source/MyDbox/obj/Release/MyDbox.csproj.GenerateResource.Cache trunk/plugins/MyDbox/Source/MyDbox/obj/Release/MyDbox.dll trunk/plugins/MyDbox/Source/MyDbox/obj/Release/MyDbox.pdb trunk/plugins/MyDbox/Source/MyDbox/obj/Release/ResolveAssemblyReference.cache trunk/plugins/MyDbox/Source/MyDbox.sln Added Paths: ----------- trunk/plugins/MyDbox/Source/Config.jpg trunk/plugins/MyDbox/Source/MyDbox/DboxFunctions.cs trunk/plugins/MyDbox/Source/MyDbox/GuiRecordings.cs trunk/plugins/MyDbox/Source/MyDbox/MyDboxGui.c trunk/plugins/MyDbox/Source/MyDbox/MyOSD.Designer.cs trunk/plugins/MyDbox/Source/MyDbox/MyOSD.cs trunk/plugins/MyDbox/Source/MyDbox/MyOSD.resx trunk/plugins/MyDbox/Source/MyDbox/MyOSD_Chan.Designer.cs trunk/plugins/MyDbox/Source/MyDbox/MyOSD_Chan.cs trunk/plugins/MyDbox/Source/MyDbox/MyOSD_Chan.resx trunk/plugins/MyDbox/Source/MyDbox/MyOSD_Info.Designer.cs trunk/plugins/MyDbox/Source/MyDbox/MyOSD_Info.cs trunk/plugins/MyDbox/Source/MyDbox/MyOSD_Info.resx trunk/plugins/MyDbox/Source/MyDbox/MySelect.Designer.cs trunk/plugins/MyDbox/Source/MyDbox/MySelect.cs trunk/plugins/MyDbox/Source/MyDbox/MySelect.resx trunk/plugins/MyDbox/Source/MyDbox/Properties/Resources.Designer.cs trunk/plugins/MyDbox/Source/MyDbox/Properties/Resources.resx trunk/plugins/MyDbox/Source/MyDbox/VideoLanControl.cs trunk/plugins/MyDbox/Source/MyDbox/VideoLanControl.designer.cs trunk/plugins/MyDbox/Source/MyDbox/VideoLanControl.resx trunk/plugins/MyDbox/Source/MyDbox/bin/Debug/MyDbox.dll trunk/plugins/MyDbox/Source/MyDbox/bin/Debug/MyDbox.pdb trunk/plugins/MyDbox/Source/MyDbox/bin/MyDboxSVN/ trunk/plugins/MyDbox/Source/MyDbox/bin/MyDboxSVN/AxInterop.AXVLC.dll trunk/plugins/MyDbox/Source/MyDbox/bin/MyDboxSVN/Interop.AXVLC.dll trunk/plugins/MyDbox/Source/MyDbox/bin/Release/Interop.WinGrabEngine.dll trunk/plugins/MyDbox/Source/MyDbox/bin/Release/MediaPortal.GUI.Mydbox.DboxSetupForm.resources trunk/plugins/MyDbox/Source/MyDbox/bin/Release/MediaPortal.GUI.Mydbox.VideoLanControl.resources trunk/plugins/MyDbox/Source/MyDbox/bin/Release/MyDbox.csproj.GenerateResource.Cache trunk/plugins/MyDbox/Source/MyDbox/bin/Release/MyDbox.csproj.ResolveComReference.cache trunk/plugins/MyDbox/Source/MyDbox/bin/Release/ResolveAssemblyReference.cache trunk/plugins/MyDbox/Source/MyDbox/bin/Release/TempPE/ trunk/plugins/MyDbox/Source/MyDbox/cGlobal.cs trunk/plugins/MyDbox/Source/MyDbox/nokia_dbox2.png trunk/plugins/MyDbox/Source/MyDbox/nokia_dbox2Disabled.png trunk/plugins/MyDbox/Source/MyDbox/obj/Debug/MediaPortal.GUI.Mydbox.DboxSetupForm.resources trunk/plugins/MyDbox/Source/MyDbox/obj/Debug/MyDbox.csproj.GenerateResource.Cache trunk/plugins/MyDbox/Source/MyDbox/obj/MyDboxSVN/ trunk/plugins/MyDbox/Source/MyDbox/obj/MyDboxSVN/MediaPortal.GUI.Mydbox.DboxSetupForm.resources trunk/plugins/MyDbox/Source/MyDbox/obj/MyDboxSVN/MediaPortal.GUI.Mydbox.MyOSD.resources trunk/plugins/MyDbox/Source/MyDbox/obj/MyDboxSVN/MediaPortal.GUI.Mydbox.MyOSD_Chan.resources trunk/plugins/MyDbox/Source/MyDbox/obj/MyDboxSVN/MediaPortal.GUI.Mydbox.MyOSD_Info.resources trunk/plugins/MyDbox/Source/MyDbox/obj/MyDboxSVN/MediaPortal.GUI.Mydbox.MySelect.resources trunk/plugins/MyDbox/Source/MyDbox/obj/MyDboxSVN/MediaPortal.GUI.Mydbox.VideoLanControl.resources trunk/plugins/MyDbox/Source/MyDbox/obj/MyDboxSVN/MyDbox.Properties.Resources.resources trunk/plugins/MyDbox/Source/MyDbox/obj/MyDboxSVN/MyDbox.csproj.GenerateResource.Cache trunk/plugins/MyDbox/Source/MyDbox/obj/MyDboxSVN/MyDbox.dll trunk/plugins/MyDbox/Source/MyDbox/obj/MyDboxSVN/MyDbox.nokia_dbox2.png trunk/plugins/MyDbox/Source/MyDbox/obj/MyDboxSVN/MyDbox.nokia_dbox2Disabled.png trunk/plugins/MyDbox/Source/MyDbox/obj/MyDboxSVN/MyDbox.pdb trunk/plugins/MyDbox/Source/MyDbox/obj/MyDboxSVN/Refactor/ trunk/plugins/MyDbox/Source/MyDbox/obj/MyDboxSVN/ResolveAssemblyReference.cache trunk/plugins/MyDbox/Source/MyDbox/obj/MyDboxSVN/TempPE/ trunk/plugins/MyDbox/Source/MyDbox/obj/MyDboxSVN/TempPE/Properties.Resources.Designer.cs.dll trunk/plugins/MyDbox/Source/MyDbox/obj/Release/MediaPortal.GUI.Mydbox.VideoLanControl.resources trunk/plugins/MyDbox/Source/Record.jpg trunk/plugins/MyDbox/Source/osd.JPG trunk/plugins/MyDbox/Source/osd2.jpg trunk/plugins/MyDbox/Source/osd3.jpg trunk/plugins/MyDbox/Source/osd4.jpg trunk/plugins/MyDbox/Source/osd5.jpg trunk/plugins/MyDbox/Source/read_me.txt Removed Paths: ------------- trunk/plugins/MyDbox/Source/MyDbox/bin/Release/Communications.DLL trunk/plugins/MyDbox/Source/MyDbox/bin/Release/Core.dll trunk/plugins/MyDbox/Source/MyDbox/bin/Release/Dialogs.dll trunk/plugins/MyDbox/Source/MyDbox/bin/Release/ExternalPlayers.dll trunk/plugins/MyDbox/Source/MyDbox/bin/Release/Utils.dll trunk/plugins/MyDbox/Source/MyDbox/bin/Release/copy.bat Added: trunk/plugins/MyDbox/Source/Config.jpg =================================================================== (Binary files differ) Property changes on: trunk/plugins/MyDbox/Source/Config.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/plugins/MyDbox/Source/MyDbox/ChannelInfo.cs =================================================================== (Binary files differ) Modified: trunk/plugins/MyDbox/Source/MyDbox/Data.cs =================================================================== --- trunk/plugins/MyDbox/Source/MyDbox/Data.cs 2007-09-30 11:15:36 UTC (rev 964) +++ trunk/plugins/MyDbox/Source/MyDbox/Data.cs 2007-10-01 03:08:08 UTC (rev 965) @@ -92,11 +92,13 @@ start = tmp_Channel.Length + tmp_ID.Length + 2; String tmp_Name = bouquets.Substring(start, bouquets.Length - start); + tmp_Name = tmp_Name.Replace("\"", "'"); + row["Ref"] = tmp_Ref; row["Bouquet"] = tmp_Bouquet; row["Channel"] = tmp_Channel; row["ID"] = tmp_ID; - row["Name"] = tmp_Name; + row["Name"] = @tmp_Name; table.Rows.Add(row); } Added: trunk/plugins/MyDbox/Source/MyDbox/DboxFunctions.cs =================================================================== --- trunk/plugins/MyDbox/Source/MyDbox/DboxFunctions.cs (rev 0) +++ trunk/plugins/MyDbox/Source/MyDbox/DboxFunctions.cs 2007-10-01 03:08:08 UTC (rev 965) @@ -0,0 +1,144 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.Collections.Generic; +using System.Text; + +namespace MediaPortal.GUI.Mydbox +{ + class DboxFunctions + { + + static cGlobal cGlobal; + + private string _Url = ""; + private string _UserName = ""; + private string _Password = ""; + private string _Command = "/control/"; + + public DboxFunctions(string url, string username, string password) + { + _Url = "http://" + url; + _UserName = username; + _Password = password; + } + + public string getID() + { + Request request = new Request(_Url, _UserName, _Password); + + //get actual channel (ID) + string s = request.PostData(_Command + "zapto"); + s = s.Replace("\n", ""); + + return s; + } + public string Zapto(string ID) + { + Request request = new Request(_Url, _UserName, _Password); + + //zap to channel (ID) + string s = request.PostData(_Command + "zapto?" + ID); + + return s; + } + public string getLiveUrl() + { + Request request = new Request(_Url, _UserName, _Password); + + //get live url + + // old version + //string s = request.PostData(_Command + "build_live_url"); + + //get PIDs + int PMT = 0; + int VPID = 0; + int APID = 0; + + string s = request.PostData(_Command + "zapto?getallpids"); + string[] allPids = s.Split('\n'); + + if (allPids.GetUpperBound(0) > 0) + { + string[] allFields = allPids[0].Split(' '); + VPID = Convert.ToInt16(allFields[0]); + + allFields = allPids[1].Split(' '); + APID = Convert.ToInt16(allFields[0]); + + for (int i = 2; i < allPids.GetUpperBound(0); i++) + { + allFields = allPids[i].Split(' '); + + if (allFields[1] == "pmt") + PMT = Convert.ToInt16(allFields[0]); + } + } + + // http://ip.der.dbox:31339/0,0x64,0x65,0x66 + if (PMT != 0) + s = _Url + ":31339/0,0x" + string.Format("{0:x4}", PMT) + ",0x" + string.Format("{0:x4}", VPID) + ",0x" + string.Format("{0:x4}", APID); + else + s = ""; + + return s; + } + public string setSPTS() + { + Request request = new Request(_Url, _UserName, _Password); + + //set playback to spts + string s = request.PostData(_Command + "system?setAViAExtPlayBack=spts"); + + return s; + } + public string setMute() + { + Request request = new Request(_Url, _UserName, _Password); + + // get status + string s = request.PostData(_Command + "volume?status"); + + if (s == "0") + s = request.PostData(_Command + "volume?mute"); + if (s == "1") + s = request.PostData(_Command + "volume?unmute"); + + return s; + } + public string getInfo() + { + Request request = new Request(_Url, _UserName, _Password); + + // get info from the box + string s = request.PostData(_Command + "info?version"); + s = s.Replace("\n", " "); + + return s; + } + } +} Modified: trunk/plugins/MyDbox/Source/MyDbox/DboxSetupForm.Designer.cs =================================================================== --- trunk/plugins/MyDbox/Source/MyDbox/DboxSetupForm.Designer.cs 2007-09-30 11:15:36 UTC (rev 964) +++ trunk/plugins/MyDbox/Source/MyDbox/DboxSetupForm.Designer.cs 2007-10-01 03:08:08 UTC (rev 965) @@ -36,5 +36,15 @@ private MediaPortal.UserInterface.Controls.MPLabel mpLabel2; private MediaPortal.UserInterface.Controls.MPTextBox edtIP; private MediaPortal.UserInterface.Controls.MPLabel mpLabel1; + private MediaPortal.UserInterface.Controls.MPTextBox edtSnapshot; + private MediaPortal.UserInterface.Controls.MPTextBox edtRecord; + private MediaPortal.UserInterface.Controls.MPLabel mpLabel5; + private MediaPortal.UserInterface.Controls.MPLabel mpLabel4; + private MediaPortal.UserInterface.Controls.MPButton mpButton2; + private System.Windows.Forms.Button btnSelRec; + private System.Windows.Forms.Button btnSelSave; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.CheckBox chkAutoOn; + private System.Windows.Forms.GroupBox groupBox1; } } \ No newline at end of file Modified: trunk/plugins/MyDbox/Source/MyDbox/DboxSetupForm.cs =================================================================== --- trunk/plugins/MyDbox/Source/MyDbox/DboxSetupForm.cs 2007-09-30 11:15:36 UTC (rev 964) +++ trunk/plugins/MyDbox/Source/MyDbox/DboxSetupForm.cs 2007-10-01 03:08:08 UTC (rev 965) @@ -30,12 +30,18 @@ using System.Windows.Forms; using MediaPortal.Profile; using MediaPortal.Util; +using System.Data; +using System.Diagnostics; - namespace MediaPortal.GUI.Mydbox { public partial class DboxSetupForm : Form { + private string _Url = ""; + private string _UserName = ""; + private string _Password = ""; + private static DataTable _TV_Bouquets = null; + public DboxSetupForm() { InitializeComponent(); @@ -56,6 +62,12 @@ private void InitializeComponent() { this.mpGroupBox1 = new MediaPortal.UserInterface.Controls.MPGroupBox(); + this.btnSelRec = new System.Windows.Forms.Button(); + this.btnSelSave = new System.Windows.Forms.Button(); + this.edtSnapshot = new MediaPortal.UserInterface.Controls.MPTextBox(); + this.edtRecord = new MediaPortal.UserInterface.Controls.MPTextBox(); + this.mpLabel5 = new MediaPortal.UserInterface.Controls.MPLabel(); + this.mpLabel4 = new MediaPortal.UserInterface.Controls.MPLabel(); this.edtPassword = new MediaPortal.UserInterface.Controls.MPTextBox(); this.mpLabel3 = new MediaPortal.UserInterface.Controls.MPLabel(); this.edtUserName = new MediaPortal.UserInterface.Controls.MPTextBox(); @@ -63,11 +75,23 @@ this.edtIP = new MediaPortal.UserInterface.Controls.MPTextBox(); this.mpLabel1 = new MediaPortal.UserInterface.Controls.MPLabel(); this.mpButton1 = new MediaPortal.UserInterface.Controls.MPButton(); + this.mpButton2 = new MediaPortal.UserInterface.Controls.MPButton(); + this.button1 = new System.Windows.Forms.Button(); + this.chkAutoOn = new System.Windows.Forms.CheckBox(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); this.mpGroupBox1.SuspendLayout(); + this.groupBox1.SuspendLayout(); this.SuspendLayout(); // // mpGroupBox1 // + this.mpGroupBox1.Controls.Add(this.mpButton2); + this.mpGroupBox1.Controls.Add(this.btnSelRec); + this.mpGroupBox1.Controls.Add(this.btnSelSave); + this.mpGroupBox1.Controls.Add(this.edtSnapshot); + this.mpGroupBox1.Controls.Add(this.edtRecord); + this.mpGroupBox1.Controls.Add(this.mpLabel5); + this.mpGroupBox1.Controls.Add(this.mpLabel4); this.mpGroupBox1.Controls.Add(this.edtPassword); this.mpGroupBox1.Controls.Add(this.mpLabel3); this.mpGroupBox1.Controls.Add(this.edtUserName); @@ -77,11 +101,65 @@ this.mpGroupBox1.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.mpGroupBox1.Location = new System.Drawing.Point(3, 3); this.mpGroupBox1.Name = "mpGroupBox1"; - this.mpGroupBox1.Size = new System.Drawing.Size(310, 144); + this.mpGroupBox1.Size = new System.Drawing.Size(481, 215); this.mpGroupBox1.TabIndex = 0; this.mpGroupBox1.TabStop = false; this.mpGroupBox1.Text = "D-Box Login Settings"; // + // btnSelRec + // + this.btnSelRec.Location = new System.Drawing.Point(287, 164); + this.btnSelRec.Name = "btnSelRec"; + this.btnSelRec.Size = new System.Drawing.Size(28, 19); + this.btnSelRec.TabIndex = 10; + this.btnSelRec.Text = "..."; + this.btnSelRec.UseVisualStyleBackColor = true; + this.btnSelRec.Click += new System.EventHandler(this.btnSelRec_Click); + // + // btnSelSave + // + this.btnSelSave.Location = new System.Drawing.Point(287, 137); + this.btnSelSave.Name = "btnSelSave"; + this.btnSelSave.Size = new System.Drawing.Size(28, 19); + this.btnSelSave.TabIndex = 9; + this.btnSelSave.Text = "..."; + this.btnSelSave.UseVisualStyleBackColor = true; + this.btnSelSave.Click += new System.EventHandler(this.btnSelSave_Click); + // + // edtSnapshot + // + this.edtSnapshot.BorderColor = System.Drawing.Color.Empty; + this.edtSnapshot.Location = new System.Drawing.Point(120, 163); + this.edtSnapshot.Name = "edtSnapshot"; + this.edtSnapshot.Size = new System.Drawing.Size(157, 20); + this.edtSnapshot.TabIndex = 8; + // + // edtRecord + // + this.edtRecord.BorderColor = System.Drawing.Color.Empty; + this.edtRecord.Location = new System.Drawing.Point(120, 137); + this.edtRecord.Name = "edtRecord"; + this.edtRecord.Size = new System.Drawing.Size(157, 20); + this.edtRecord.TabIndex = 7; + // + // mpLabel5 + // + this.mpLabel5.AutoSize = true; + this.mpLabel5.Location = new System.Drawing.Point(28, 163); + this.mpLabel5.Name = "mpLabel5"; + this.mpLabel5.Size = new System.Drawing.Size(86, 13); + this.mpLabel5.TabIndex = 6; + this.mpLabel5.Text = "Save snapshots:"; + // + // mpLabel4 + // + this.mpLabel4.AutoSize = true; + this.mpLabel4.Location = new System.Drawing.Point(41, 137); + this.mpLabel4.Name = "mpLabel4"; + this.mpLabel4.Size = new System.Drawing.Size(73, 13); + this.mpLabel4.TabIndex = 5; + this.mpLabel4.Text = "Save records:"; + // // edtPassword // this.edtPassword.BorderColor = System.Drawing.Color.Empty; @@ -89,7 +167,6 @@ this.edtPassword.Name = "edtPassword"; this.edtPassword.Size = new System.Drawing.Size(157, 20); this.edtPassword.TabIndex = 5; - this.edtPassword.Visible = false; // // mpLabel3 // @@ -99,7 +176,6 @@ this.mpLabel3.Size = new System.Drawing.Size(56, 13); this.mpLabel3.TabIndex = 4; this.mpLabel3.Text = "Password:"; - this.mpLabel3.Visible = false; // // edtUserName // @@ -108,7 +184,6 @@ this.edtUserName.Name = "edtUserName"; this.edtUserName.Size = new System.Drawing.Size(157, 20); this.edtUserName.TabIndex = 3; - this.edtUserName.Visible = false; // // mpLabel2 // @@ -118,7 +193,6 @@ this.mpLabel2.Size = new System.Drawing.Size(61, 13); this.mpLabel2.TabIndex = 2; this.mpLabel2.Text = "User name:"; - this.mpLabel2.Visible = false; // // edtIP // @@ -131,7 +205,7 @@ // mpLabel1 // this.mpLabel1.AutoSize = true; - this.mpLabel1.Location = new System.Drawing.Point(26, 45); + this.mpLabel1.Location = new System.Drawing.Point(22, 42); this.mpLabel1.Name = "mpLabel1"; this.mpLabel1.Size = new System.Drawing.Size(92, 13); this.mpLabel1.TabIndex = 0; @@ -139,7 +213,7 @@ // // mpButton1 // - this.mpButton1.Location = new System.Drawing.Point(238, 153); + this.mpButton1.Location = new System.Drawing.Point(409, 263); this.mpButton1.Name = "mpButton1"; this.mpButton1.Size = new System.Drawing.Size(75, 23); this.mpButton1.TabIndex = 1; @@ -147,9 +221,51 @@ this.mpButton1.UseVisualStyleBackColor = true; this.mpButton1.Click += new System.EventHandler(this.mpButton1_Click); // + // mpButton2 + // + this.mpButton2.Location = new System.Drawing.Point(287, 42); + this.mpButton2.Name = "mpButton2"; + this.mpButton2.Size = new System.Drawing.Size(137, 23); + this.mpButton2.TabIndex = 2; + this.mpButton2.Text = "Get Bouquet from box"; + this.mpButton2.UseVisualStyleBackColor = true; + this.mpButton2.Click += new System.EventHandler(this.mpButton2_Click_1); + // + // button1 + // + this.button1.Location = new System.Drawing.Point(3, 263); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 2; + this.button1.Text = "Cancel"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // chkAutoOn + // + this.chkAutoOn.AutoSize = true; + this.chkAutoOn.Location = new System.Drawing.Point(9, 19); + this.chkAutoOn.Name = "chkAutoOn"; + this.chkAutoOn.Size = new System.Drawing.Size(200, 17); + this.chkAutoOn.TabIndex = 11; + this.chkAutoOn.Text = "Auto turn on when entering My DBox"; + this.chkAutoOn.UseVisualStyleBackColor = true; + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.chkAutoOn); + this.groupBox1.Location = new System.Drawing.Point(3, 218); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(481, 39); + this.groupBox1.TabIndex = 3; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Auto on"; + // // DboxSetupForm // - this.ClientSize = new System.Drawing.Size(316, 179); + this.ClientSize = new System.Drawing.Size(490, 298); + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.button1); this.Controls.Add(this.mpButton1); this.Controls.Add(this.mpGroupBox1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; @@ -160,6 +276,8 @@ this.Text = "Dbox Settings"; this.mpGroupBox1.ResumeLayout(false); this.mpGroupBox1.PerformLayout(); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); this.ResumeLayout(false); } @@ -170,6 +288,62 @@ this.Close(); } + private void mpButton2_Click_1(object sender, EventArgs e) + { + mpButton2.Text = "Try to read bouquet..."; + mpButton2.Update(); + + try + { + _Url = "http://" + edtIP.Text; + _UserName = edtUserName.Text; + _Password = edtPassword.Text; + + //get bouquets + Data _DBox = new Data(_Url, _UserName, _Password); + _TV_Bouquets = _DBox.UserTVBouquets.Tables[0]; + + mpButton2.Text = "Received " + _TV_Bouquets.Rows.Count + " channels"; + mpButton2.Update(); + + string path = Configuration.Config.GetFolder(MediaPortal.Configuration.Config.Dir.Config); + if (File.Exists(path + @"\dbox.xml")) + File.Delete(path + @"\dbox.xml"); + + using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(path + @"\dbox.xml")) + { + xmlwriter.Clear(); + for (int i = 0; i < _TV_Bouquets.Rows.Count; i++) + { + string b = _TV_Bouquets.Rows[i]["Bouquet"].ToString(); + string c = _TV_Bouquets.Rows[i]["Channel"].ToString(); + + string v = _TV_Bouquets.Rows[i]["Name"].ToString() + "#" + _TV_Bouquets.Rows[i]["ID"].ToString(); + + xmlwriter.SetValue(b, c, v); + mpButton2.Text = "Write channel " + i; + mpButton2.Update(); + //Debug.WriteLine(b + " "+ c + " " +v); + } + } + + mpButton2.Text = "Get Bouquet from box"; + mpButton2.Update(); + + if (_TV_Bouquets.Rows.Count != 0) + MessageBox.Show(_TV_Bouquets.Rows.Count + " channels found !", "Read bouquet"); + else + MessageBox.Show("ERROR ! No channels found !", "Read bouquet"); + + MediaPortal.Profile.Settings.SaveCache(); + } + catch + { + MessageBox.Show("ERROR ! Can not read bouquet !", "Read bouquet"); + mpButton2.Text = "Get Bouquet from box"; + } + } + void LoadSettings() { using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MediaPortal.xml")) @@ -177,6 +351,28 @@ edtIP.Text = xmlreader.GetValue("mydbox", "IP"); edtUserName.Text = xmlreader.GetValue("mydbox", "UserName"); edtPassword.Text = xmlreader.GetValue("mydbox", "Password"); + + edtRecord.Text = xmlreader.GetValue("mydbox", "Record"); + edtSnapshot.Text = xmlreader.GetValue("mydbox", "Snapshot"); + + if (xmlreader.GetValue("mydbox", "AutoOn") == "yes") + chkAutoOn.Checked = true; + else + chkAutoOn.Checked = false; + + + if (edtIP.Text == "") + edtIP.Text = @"192.168.0.100"; + + if (edtUserName.Text == "") + edtUserName.Text = @"root"; + if (edtPassword.Text == "") + edtPassword.Text = @"dbox2"; + + if (edtRecord.Text=="") + edtRecord.Text=@"C:\Dbox2\Records"; + if (edtSnapshot.Text=="") + edtSnapshot.Text=@"C:\Dbox2\Snapshot"; } } @@ -191,7 +387,55 @@ xmlwriter.SetValue("mydbox", "IP", edtIP.Text); xmlwriter.SetValue("mydbox", "UserName", edtUserName.Text); xmlwriter.SetValue("mydbox", "Password", edtPassword.Text); + + xmlwriter.SetValue("mydbox", "Record", edtRecord.Text); + xmlwriter.SetValue("mydbox", "Snapshot", edtSnapshot.Text); + + if ( chkAutoOn.Checked == true) + xmlwriter.SetValue("mydbox", "AutoOn", "yes"); + else + xmlwriter.SetValue("mydbox", "AutoOn", "no"); + } } + + private void btnSelSave_Click(object sender, EventArgs e) + { + try + { + FolderBrowserDialog dialog = new FolderBrowserDialog(); + dialog.SelectedPath = edtRecord.Text; + + if (dialog.ShowDialog() == DialogResult.OK) + { + edtRecord.Text = dialog.SelectedPath; + } + } + catch (Exception) + { + } + } + + private void btnSelRec_Click(object sender, EventArgs e) + { + try + { + FolderBrowserDialog dialog = new FolderBrowserDialog(); + dialog.SelectedPath = edtSnapshot.Text; + + if (dialog.ShowDialog() == DialogResult.OK) + { + edtSnapshot.Text = dialog.SelectedPath; + } + } + catch (Exception) + { + } + } + + private void button1_Click(object sender, EventArgs e) + { + this.Close(); + } } } \ No newline at end of file Modified: trunk/plugins/MyDbox/Source/MyDbox/Epg.cs =================================================================== --- trunk/plugins/MyDbox/Source/MyDbox/Epg.cs 2007-09-30 11:15:36 UTC (rev 964) +++ trunk/plugins/MyDbox/Source/MyDbox/Epg.cs 2007-10-01 03:08:08 UTC (rev 965) @@ -83,8 +83,13 @@ ActTime = DateTime.Now; + DateTime t1 = DateTime.UtcNow; + DateTime t2 = DateTime.Now; + TimeSpan ts = t2.Subtract(t1); - StartTime = DateTime.Parse("01.01.1970 01:00"); + StartTime = DateTime.Parse("01.01.1970 00:00"); + StartTime = StartTime.Add(ts); + StartTime = StartTime.AddSeconds(Convert.ToInt32(allFields[1])); EndTime = StartTime.AddSeconds(Convert.ToInt32(allFields[2])); @@ -154,7 +159,13 @@ ActTime = DateTime.Now; - StartTime = DateTime.Parse("01.01.1970 01:00"); + DateTime t1 = DateTime.UtcNow; + DateTime t2 = DateTime.Now; + TimeSpan ts = t2.Subtract(t1); + + StartTime = DateTime.Parse("01.01.1970 00:00"); + StartTime = StartTime.Add(ts); + StartTime = StartTime.AddSeconds(Convert.ToInt32(allFields[1])); EndTime = StartTime.AddSeconds(Convert.ToInt32(allFields[2])); Added: trunk/plugins/MyDbox/Source/MyDbox/GuiRecordings.cs =================================================================== --- trunk/plugins/MyDbox/Source/MyDbox/GuiRecordings.cs (rev 0) +++ trunk/plugins/MyDbox/Source/MyDbox/GuiRecordings.cs 2007-10-01 03:08:08 UTC (rev 965) @@ -0,0 +1,535 @@ +using System; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.Text; +using System.Text.RegularExpressions; +using System.Globalization; + +using MediaPortal.GUI.Library; +using MediaPortal.Player; +using MediaPortal.Util; +using MediaPortal.Dialogs; +using MediaPortal.Playlists; +using System.Xml; +using System.Xml.Serialization; +using System.IO; +using System.Data; + +namespace MediaPortal.GUI.Mydbox +{ + public class GuiRecordings : GUIWindow, IComparer<GUIListItem> + { + #region MapSettings class + [Serializable] + public class MapSettings + { + protected int _SortBy; + protected int _ViewAs; + protected bool _SortAscending; + + public MapSettings() + { + // Set default view + _SortBy = (int)SortMethod.Date ; + _ViewAs = (int)View.BigIcons ; + _SortAscending = false; + } + + [XmlElement("SortBy")] + public int SortBy + { + get { return _SortBy; } + set { _SortBy = value; } + } + + [XmlElement("ViewAs")] + public int ViewAs + { + get { return _ViewAs; } + set { _ViewAs = value; } + } + + [XmlElement("SortAscending")] + public bool SortAscending + { + get { return _SortAscending; } + set { _SortAscending = value; } + } + } + #endregion + + #region Base variables + enum SortMethod + { + Name = 0, + Date = 1, + Size = 2 + } + + enum View + { + List = 0, + Icons = 1, + BigIcons = 2, + Albums = 3, + Filmstrip = 4, + } + #endregion + + #region Skin + [SkinControlAttribute(50)] + protected GUIFacadeControl facadeView = null; + [SkinControlAttribute(2)] + protected GUIButtonControl btnViewAs = null; + [SkinControlAttribute(3)] + protected GUISortButtonControl btnSortBy = null; + + public const int WindowID = 75642204; + #endregion + + #region Constructor + public GuiRecordings() + { + GetID = (int)GuiRecordings.WindowID; + } + #endregion + + #region Private Variables + + private static string server; + private static string username; + private static string password; + + private static VirtualDirectory recDirectory = new VirtualDirectory(); + private static VirtualDirectory snapDirectory = new VirtualDirectory(); + private static string RecDir = String.Empty; + private static string SnapDir = String.Empty; + + public DateTime t1; + public DateTime t2; + public Double t_dif; + + static cGlobal cGlobal; + + MapSettings mapSettings = new MapSettings(); + + int selectedItemIndex = -1; + GUIListItem selectedListItem = null; + + #endregion + + #region Private Enumerations + enum Controls + { + List = 50 + + } + #endregion + + #region Overrides + public override bool Init() + { + + LoadSettings(); + return Load(GUIGraphicsContext.Skin + @"\mydboxrecordings.xml"); + } + + public override void OnAction(Action action) + { + switch (action.wID) + { + case Action.ActionType.ACTION_PREVIOUS_MENU: + { + GUIWindowManager.ShowPreviousWindow(); + return; + } + } + + base.OnAction(action); + } + + protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType) + { + base.OnClicked(controlId, control, actionType); + if (control == btnViewAs) + { + switch ((View)mapSettings.ViewAs) + { + case View.List: + mapSettings.ViewAs = (int)View.Icons; + break; + case View.Icons: + mapSettings.ViewAs = (int)View.BigIcons; + break; + case View.BigIcons: + mapSettings.ViewAs = (int)View.Filmstrip; + break; + case View.Albums: + mapSettings.ViewAs = (int)View.Filmstrip; + break; + case View.Filmstrip: + mapSettings.ViewAs = (int)View.List; + break; + } + ShowThumbPanel(); + GUIControl.FocusControl(GetID, control.GetID); + } + if (control == btnSortBy) // sort by + { + switch ((SortMethod)mapSettings.SortBy) + { + case SortMethod.Name: + mapSettings.SortBy = (int)SortMethod.Date; + break; + case SortMethod.Date: + mapSettings.SortBy = (int)SortMethod.Size; + break; + case SortMethod.Size: + mapSettings.SortBy = (int)SortMethod.Name; + break; + } + OnSort(); + GUIControl.FocusControl(GetID, control.GetID); + } + + } + + protected override void OnPageLoad() + { + base.OnPageLoad(); + + if (facadeView == null) + { + facadeView = new GUIFacadeControl(GetID); + } + + ShowThumbPanel(); + btnSortBy.SortChanged += new SortEventHandler(SortChanged); + } + + public override bool OnMessage(GUIMessage message) + { + switch (message.Message) + { + case GUIMessage.MessageType.GUI_MSG_WINDOW_INIT: + { + base.OnMessage(message); + GUIPropertyManager.SetProperty("#currentmodule", GUILocalizeStrings.Get(604)); + FillRecordings(); + OnSort(); + return true; + } + case GUIMessage.MessageType.GUI_MSG_CLICKED: + { + //get sender control + base.OnMessage(message); + int iControl = message.SenderControlId; + + if (iControl == (int)Controls.List) + { + GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_ITEM_SELECTED, GetID, 0, iControl, 0, 0, null); + OnMessage(msg); + int iItem = (int)msg.Param1; + int iAction = (int)message.Param1; + if (iAction == (int)Action.ActionType.ACTION_SELECT_ITEM) + { + // play + GUIListItem item = GUIControl.GetListItem(GetID, (int)Controls.List, iItem); + + cGlobal.VLC_File = item.Path; + cGlobal.VLC_StartPlay = true; + + //activate Recordings Screen + GUIWindowManager.ActivateWindow(75642203); + } + } + return true; + } + case GUIMessage.MessageType.GUI_MSG_WINDOW_DEINIT: + { + + } + break; + + } + return base.OnMessage(message); + + } + + #endregion + + #region Private Methods + + public void LoadSettings() + { + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MediaPortal.xml")) + { + server = xmlreader.GetValue("mydbox", "IP"); + username = xmlreader.GetValue("mydbox", "UserName"); + password = xmlreader.GetValue("mydbox", "Password"); + + RecDir = xmlreader.GetValue("mydbox", "Record"); + SnapDir = xmlreader.GetValue("mydbox", "Snapshot"); + } + } + + void FillRecordings() + { + recDirectory.AddExtension(".dat"); + recDirectory.ShowFilesWithoutExtension = false; + snapDirectory.AddExtension(".png"); + snapDirectory.ShowFilesWithoutExtension = false; + + foreach (GUIListItem item in recDirectory.GetDirectory(RecDir)) + { + if (!item.IsFolder) + { + string s = ""; + t1 = item.FileInfo.CreationTime; + t_dif = 60; // set diff to 1 minute + + foreach (GUIListItem itemS in snapDirectory.GetDirectory(SnapDir)) + { + if (!itemS.IsFolder) + { + t2 = itemS.FileInfo.CreationTime; + + TimeSpan tr; + if (t2 > t1) + tr = t2 - t1; + else + tr = t1 - t2; + + double tm = tr.TotalSeconds; + + if ((tm < t_dif) && (tm<60)) + { + t_dif = tm; + s = itemS.Path; + } + } + } + + if (s!="") item.ThumbnailImage = s; + + string[] field = item.Label.Split(' '); + string fname = field[1] + " " + field[2]; + item.Label = item.FileInfo.CreationTime.Date.ToShortDateString() + "\n" + field[2]; + + //GUIControl.AddListItemControl(GetID, (int)Controls.List, item); + item.OnItemSelected += new MediaPortal.GUI.Library.GUIListItem.ItemSelectedHandler(item_OnItemSelected); + facadeView.Add(item); + } + } + + string strObjects = String.Format("{0} {1}", GUIControl.GetItemCount(GetID, (int)Controls.List).ToString(), GUILocalizeStrings.Get(632)); + GUIPropertyManager.SetProperty("#itemcount", strObjects); + + } + + GUIListItem GetSelectedItem() + { + return facadeView.SelectedListItem; + } + GUIListItem GetItem(int itemIndex) + { + if (itemIndex >= facadeView.Count || itemIndex < 0) + return null; + return facadeView[itemIndex]; + } + + int GetSelectedItemNo() + { + return facadeView.SelectedListItemIndex; + } + int GetItemCount() + { + return facadeView.Count; + } + + void UpdateButtonStates() + { + GUIControl.HideControl(GetID, facadeView.GetID); + int iControl = facadeView.GetID; + GUIControl.ShowControl(GetID, iControl); + GUIControl.FocusControl(GetID, iControl); + + string textLine = String.Empty; + View view = (View)mapSettings.ViewAs; + SortMethod method = (SortMethod)mapSettings.SortBy; + bool sortAsc = mapSettings.SortAscending; + + switch (view) + { + case View.List: + textLine = GUILocalizeStrings.Get(101); + break; + case View.Icons: + textLine = GUILocalizeStrings.Get(100); + break; + case View.BigIcons: + textLine = GUILocalizeStrings.Get(417); + break; + case View.Albums: + textLine = GUILocalizeStrings.Get(417); + break; + case View.Filmstrip: + textLine = GUILocalizeStrings.Get(733); + break; + } + GUIControl.SetControlLabel(GetID, btnViewAs.GetID, textLine); + + switch (method) + { + case SortMethod.Name: + textLine = GUILocalizeStrings.Get(103); + break; + case SortMethod.Date: + textLine = GUILocalizeStrings.Get(104); + break; + case SortMethod.Size: + textLine = GUILocalizeStrings.Get(105); + break; + } + GUIControl.SetControlLabel(GetID, btnSortBy.GetID, textLine); + btnSortBy.IsAscending = sortAsc; + } + + void ShowThumbPanel() + { + int itemIndex = GetSelectedItemNo(); + if (mapSettings.ViewAs == (int)View.BigIcons) + { + facadeView.View = GUIFacadeControl.ViewMode.LargeIcons; + } + else if (mapSettings.ViewAs == (int)View.Albums) + { + facadeView.View = GUIFacadeControl.ViewMode.LargeIcons; + } + else if (mapSettings.ViewAs == (int)View.Icons) + { + facadeView.View = GUIFacadeControl.ViewMode.SmallIcons; + } + else if (mapSettings.ViewAs == (int)View.List) + { + facadeView.View = GUIFacadeControl.ViewMode.List; + } + else if (mapSettings.ViewAs == (int)View.Filmstrip) + { + facadeView.View = GUIFacadeControl.ViewMode.Filmstrip; + } + if (itemIndex > -1) + { + GUIControl.SelectItemControl(GetID, facadeView.GetID, itemIndex); + } + UpdateButtonStates(); + } + + #endregion + + #region Sort Members + void OnSort() + { + facadeView.Sort(this); + UpdateButtonStates(); + } + + public int Compare(GUIListItem item1, GUIListItem item2) + { + if (item1 == item2) + return 0; + if (item1 == null) + return -1; + if (item2 == null) + return -1; + if (item1.IsFolder && item1.Label == "..") + return -1; + if (item2.IsFolder && item2.Label == "..") + return -1; + if (item1.IsFolder && !item2.IsFolder) + return -1; + else if (!item1.IsFolder && item2.IsFolder) + return 1; + + string sizeItem1 = String.Empty; + string sizeItem2 = String.Empty; + if (item1.FileInfo != null && !item1.IsFolder) + sizeItem1 = MediaPortal.Util.Utils.GetSize(item1.FileInfo.Length); + if (item2.FileInfo != null && !item1.IsFolder) + sizeItem2 = MediaPortal.Util.Utils.GetSize(item2.FileInfo.Length); + + SortMethod method = (SortMethod)mapSettings.SortBy; + bool sortAsc = mapSettings.SortAscending; + + switch (method) + { + case SortMethod.Name: + item1.Label2 = sizeItem1; + item2.Label2 = sizeItem2; + + if (sortAsc) + { + return String.Compare(item1.Label, item2.Label, true); + } + else + { + return String.Compare(item2.Label, item1.Label, true); + } + + + case SortMethod.Date: + if (item1.FileInfo == null) + return -1; + if (item2.FileInfo == null) + return -1; + + item1.Label2 = item1.FileInfo.ModificationTime.ToShortDateString() + " " + item1.FileInfo.ModificationTime.ToString("t", CultureInfo.CurrentCulture.DateTimeFormat); + item2.Label2 = item2.FileInfo.ModificationTime.ToShortDateString() + " " + item2.FileInfo.ModificationTime.ToString("t", CultureInfo.CurrentCulture.DateTimeFormat); + if (sortAsc) + { + return DateTime.Compare(item1.FileInfo.ModificationTime, item2.FileInfo.ModificationTime); + } + else + { + return DateTime.Compare(item2.FileInfo.ModificationTime, item1.FileInfo.ModificationTime); + } + + case SortMethod.Size: + if (item1.FileInfo == null) + return -1; + if (item2.FileInfo == null) + return -1; + item1.Label2 = sizeItem1; + item2.Label2 = sizeItem2; + if (sortAsc) + { + return (int)(item1.FileInfo.Length - item2.FileInfo.Length); + } + else + { + return (int)(item2.FileInfo.Length - item1.FileInfo.Length); + } + } + return 0; + } + #endregion + + private void item_OnItemSelected(GUIListItem item, GUIControl parent) + { + GUIFilmstripControl filmstrip = parent as GUIFilmstripControl; + if (filmstrip == null) + return; + string thumbnailImage = item.ThumbnailImage; + filmstrip.InfoImageFileName = thumbnailImage; + //UpdateButtonStates(); -> fixing mantis bug 902 + } + + private void SortChanged(object sender, SortEventArgs e) + { + mapSettings.SortAscending = e.Order != System.Windows.Forms.SortOrder.Descending; + OnSort(); + GUIControl.FocusControl(GetID, ((GUIControl)sender).GetID); + } + + } +} \ No newline at end of file Modified: trunk/plugins/MyDbox/Source/MyDbox/MyDbox.csproj =================================================================== --- trunk/plugins/MyDbox/Source/MyDbox/MyDbox.csproj 2007-09-30 11:15:36 UTC (rev 964) +++ trunk/plugins/MyDbox/Source/MyDbox/MyDbox.csproj 2007-10-01 03:08:08 UTC (rev 965) @@ -14,7 +14,7 @@ <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> - <OutputPath>bin\Debug\</OutputPath> + <OutputPath>..\..\..\MediaPortal\xbmc\bin\Debug\plugins\windows\</OutputPath> <DefineConstants>DEBUG;TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> @@ -22,23 +22,55 @@ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>pdbonly</DebugType> <Optimize>true</Optimize> - <OutputPath>bin\Release\</OutputPath> + <OutputPath>..\..\..\MediaPortal\xbmc\bin\Debug\plugins\windows\</OutputPath> <DefineConstants>TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> + <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies> </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'MyDboxSVN|AnyCPU' "> + <OutputPath>..\..\Mediaportal\xbmc\bin\Debug\plugins\Windows\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <Optimize>false</Optimize> + <DebugType>pdbonly</DebugType> + <PlatformTarget>AnyCPU</PlatformTarget> + <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies> + <ErrorReport>prompt</ErrorReport> + <DocumentationFile> + </DocumentationFile> + </PropertyGroup> <ItemGroup> - <Reference Include="Core, Version=1.0.2593.1921, Culture=neutral, processorArchitecture=MSIL" /> - <Reference Include="Dialogs, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL" /> - <Reference Include="ExternalPlayers, Version=1.0.2604.25450, Culture=neutral, processorArchitecture=MSIL" /> + <Reference Include="AxInterop.AXVLC, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\Mediaportal\xbmc\bin\Debug\AxInterop.AXVLC.dll</HintPath> + <Private>False</Private> + </Reference> + <Reference Include="Core, Version=0.2.2.9991, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\Mediaportal\xbmc\bin\Debug\Core.dll</HintPath> + <Private>False</Private> + </Reference> + <Reference Include="Dialogs, Version=0.2.2.9991, Culture=neutral, processorArchitecture=MSIL"> + <Private>False</Private> + </Reference> + <Reference Include="Interop.AXVLC, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\Mediaportal\xbmc\bin\Debug\Interop.AXVLC.dll</HintPath> + <Private>False</Private> + </Reference> <Reference Include="System" /> <Reference Include="System.Data" /> <Reference Include="System.Drawing" /> <Reference Include="System.Windows.Forms" /> <Reference Include="System.Xml" /> - <Reference Include="Utils, Version=1.0.2593.1896, Culture=neutral, processorArchitecture=MSIL" /> + <Reference Include="Utils, Version=2.2.2.0, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\Mediaportal\xbmc\bin\Debug\Utils.dll</HintPath> + <Private>False</Private> + </Reference> </ItemGroup> <ItemGroup> + <Compile Include="cGlobal.cs" /> <Compile Include="ChannelInfo.cs" /> <Compile Include="Data.cs" /> <Compile Include="DboxSetupForm.cs"> @@ -48,10 +80,47 @@ <DependentUpon>DboxSetupForm.cs</DependentUpon> </Compile> <Compile Include="Epg.cs" /> + <Compile Include="DboxFunctions.cs" /> + <Compile Include="MyOSD_Chan.cs"> + <SubType>UserControl</SubType> + </Compile> + <Compile Include="MyOSD_Chan.Designer.cs"> + <DependentUpon>MyOSD_Chan.cs</DependentUpon> + </Compile> + <Compile Include="MyOSD_Info.cs"> + <SubType>UserControl</SubType> + </Compile> + <Compile Include="MyOSD_Info.Designer.cs"> + <DependentUpon>MyOSD_Info.cs</DependentUpon> + </Compile> + <Compile Include="MyOSD.cs"> + <SubType>UserControl</SubType> + </Compile> + <Compile Include="MyOSD.Designer.cs"> + <DependentUpon>MyOSD.cs</DependentUpon> + </Compile> + <Compile Include="GuiRecordings.cs" /> <Compile Include="MyDboxGui.cs" /> <Compile Include="MyDboxPlugin.cs" /> + <Compile Include="MySelect.cs"> + <SubType>UserControl</SubType> + </Compile> + <Compile Include="MySelect.Designer.cs"> + <DependentUpon>MySelect.cs</DependentUpon> + </Compile> <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="Properties\Resources.Designer.cs"> + <AutoGen>True</AutoGen> + <DesignTime>True</DesignTime> + <DependentUpon>Resources.resx</DependentUpon> + </Compile> <Compile Include="Request.cs" /> + <Compile Include="VideoLanControl.cs"> + <SubType>UserControl</SubType> + </Compile> + <Compile Include="VideoLanControl.designer.cs"> + <DependentUpon>VideoLanControl.cs</DependentUpon> + </Compile> <Compile Include="Zap.cs" /> </ItemGroup> <ItemGroup> @@ -59,7 +128,38 @@ <SubType>Designer</SubType> <DependentUpon>DboxSetupForm.cs</DependentUpon> </EmbeddedResource> + <EmbeddedResource Include="VideoLanControl.resx"> + <DependentUpon>VideoLanControl.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="nokia_dbox2.png" /> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="MyOSD_Chan.resx"> + <DependentUpon>MyOSD_Chan.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> + <EmbeddedResource Include="MyOSD_Info.resx"> + <DependentUpon>MyOSD_Info.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> + <EmbeddedResource Include="MyOSD.resx"> + <SubType>Designer</SubType> + <DependentUpon>MyOSD.cs</DependentUpon> + </EmbeddedResource> + <EmbeddedResource Include="MySelect.resx"> + <SubType>Designer</SubType> + <DependentUpon>MySelect.cs</DependentUpon> + </EmbeddedResource> + <EmbeddedResource Include="nokia_dbox2Disabled.png" /> + <EmbeddedResource Include="Properties\Resources.resx"> + <SubType>Designer</SubType> + <Generator>ResXFileCodeGenerator</Generator> + <LastGenOutput>Resources.Designer.cs</LastGenOutput> + </EmbeddedResource> + </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. Added: trunk/plugins/MyDbox/Source/MyDbox/MyDboxGui.c =================================================================== --- trunk/plugins/MyDbox/Source/MyDbox/MyDboxGui.c (rev 0) +++ trunk/plugins/MyDbox/Source/MyDbox/MyDboxGui.c 2007-10-01 03:08:08 UTC (rev 965) @@ -0,0 +1,1039 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.ComponentModel; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.Text; +using System.Text.RegularExpressions; +using MediaPortal.GUI.Library; +using MediaPortal.Player; +using MediaPortal.Dialogs; +using MediaPortal.Playlists; +using System.Xml; +using System.IO; +using System.Data; +using System.Drawing; +using MediaPortal.Util; +using AXVLC; + +namespace MediaPortal.GUI.Mydbox +{ + + public class MyDboxGui : GUIWindow + { + #region SkinControlAttributes + [SkinControlAttribute(3)] + protected GUIToggleButtonControl btnRecord = null; + [SkinControlAttribute(4)] + protected GUIButtonControl btnSnap= null; + [SkinControlAttribute(6)] + protected GUIButtonControl btnBouquet = null; + [SkinControlAttribute(7)] + protected GUIButtonControl btnChannel = null; + [SkinControlAttribute(8)] + protected GUIToggleButtonControl btnTVOnOff = null; + [SkinControlAttribute(9)] + protected GUIToggleButtonControl btnShiftOnOff = null; + [SkinControlAttribute(11)] + protected GUIButtonControl btnRecordings = null; + [SkinControlAttribute(13)] + protected GUIButtonControl SelChannel = null; + [SkinControlAttribute(20)] + protected GUIVideoControl videoWindow = null; + #endregion + + #region Private Variables + + private string _Url = ""; + private string _UserName = ""; + private string _Password = ""; + + private static string server; + private static string username; + private static string password; + + DataRow row = null; + DataTable _TV_Bouquets = new DataTable("BouquetsTV"); + + private static int ActBouquet = 1; + private static int ActChannelList; + + private static VirtualDirectory recDirectory = new VirtualDirectory(); + + private static string RecDir = String.Empty; + private static string SnapDir = String.Empty; + + private string LogPathName = Directory.GetCurrentDirectory() + @"\log\MyDbox.log"; + + private static OnActionHandler ah; + + public static... [truncated message content] |
From: <mis...@us...> - 2007-09-30 11:15:39
|
Revision: 964 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=964&view=rev Author: misterd_sf Date: 2007-09-30 04:15:36 -0700 (Sun, 30 Sep 2007) Log Message: ----------- Step 3 of Mplayer 0.8: - Fixed Installer - Added initialising message to the list of localizable messages - Added Dispose() to the osd library. Modified Paths: -------------- trunk/plugins/My MPlayer/ExternalOSDLibrary/BaseWindow.cs trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/BaseElement.cs trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/ButtonElement.cs trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/CheckMarkElement.cs trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/FadeLabelElement.cs trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/ImageElement.cs trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/LabelElement.cs trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/ListElement.cs trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/ProgressControlElement.cs trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/SliderElement.cs trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/TextScrollUpElement.cs trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/ToggleButtonElement.cs trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/VerticalScrollbarElement.cs trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/VolumeBarElement.cs trunk/plugins/My MPlayer/ExternalOSDLibrary/FullscreenWindow.cs trunk/plugins/My MPlayer/ExternalOSDLibrary/OSDController.cs trunk/plugins/My MPlayer/MPlayer_ExtPlayer/ExternalOSDLibrary.cs trunk/plugins/My MPlayer/MPlayer_ExtPlayer/Language/strings_de.xml trunk/plugins/My MPlayer/MPlayer_ExtPlayer/Language/strings_en.xml trunk/plugins/My MPlayer/MPlayer_ExtPlayer/LocalizeStrings.cs trunk/plugins/My MPlayer/MPlayer_ExtPlayer/MPlayer_ExtPlayer.csproj trunk/plugins/My MPlayer/MPlayer_Installer/Installer.cs trunk/plugins/My MPlayer/My MPlayer.xmp Modified: trunk/plugins/My MPlayer/ExternalOSDLibrary/BaseWindow.cs =================================================================== --- trunk/plugins/My MPlayer/ExternalOSDLibrary/BaseWindow.cs 2007-09-29 15:26:22 UTC (rev 963) +++ trunk/plugins/My MPlayer/ExternalOSDLibrary/BaseWindow.cs 2007-09-30 11:15:36 UTC (rev 964) @@ -33,7 +33,7 @@ /// <summary> /// Base class for all MP windows that can be handled by this library /// </summary> - public abstract class BaseWindow { + public abstract class BaseWindow : IDisposable { #region variables /// <summary> /// List of all elements of the window @@ -54,7 +54,7 @@ temp = uiElement as GUIControl; if (temp != null) { element = GenerateElement(temp); - if(element!=null){ + if (element != null) { _elementList.Add(element); } } @@ -132,5 +132,16 @@ /// <returns>true, if window is visible; false otherwise</returns> public abstract bool IsWindowVisible(); #endregion + + #region IDisposable Member + /// <summary> + /// Disposes the object + /// </summary> + public virtual void Dispose() { + foreach (BaseElement element in _elementList) { + element.Dispose(); + } + } + #endregion } } Modified: trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/BaseElement.cs =================================================================== --- trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/BaseElement.cs 2007-09-29 15:26:22 UTC (rev 963) +++ trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/BaseElement.cs 2007-09-30 11:15:36 UTC (rev 964) @@ -34,7 +34,7 @@ /// <summary> /// Base class for all gui elements /// </summary> - public abstract class BaseElement { + public abstract class BaseElement : IDisposable{ #region abstract methods /// <summary> /// Draws the element on the given graphics @@ -120,5 +120,14 @@ public virtual void DrawCacheStatus(Graphics graph, float cacheFill) { } #endregion + + #region IDisposable Member + /// <summary> + /// Disposes the object + /// </summary> + public abstract void Dispose(); + + #endregion + } } Modified: trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/ButtonElement.cs =================================================================== --- trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/ButtonElement.cs 2007-09-29 15:26:22 UTC (rev 963) +++ trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/ButtonElement.cs 2007-09-30 11:15:36 UTC (rev 964) @@ -173,8 +173,19 @@ Rectangle rectangle = new Rectangle(x, _button.YPosition + _button.TextOffsetY, labelWidth, _button.Height); String label = _button.Label; graph.DrawString(GUIPropertyManager.Parse(label), _font, brush, rectangle, StringFormat.GenericTypographic); + brush.Dispose(); } } + + /// <summary> + /// Disposes the object + /// </summary> + public override void Dispose() { + _focusBitmap.Dispose(); + _noFocusBitmap.Dispose(); + _hoverBitmap.Dispose(); + _font.Dispose(); + } #endregion } } Modified: trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/CheckMarkElement.cs =================================================================== --- trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/CheckMarkElement.cs 2007-09-29 15:26:22 UTC (rev 963) +++ trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/CheckMarkElement.cs 2007-09-30 11:15:36 UTC (rev 964) @@ -130,14 +130,17 @@ if (_checkMark.Disabled) { SolidBrush brush = new SolidBrush(_disabledColor); graph.DrawString(_checkMark.Label, _font, brush, dwTextPosX, _checkMark.YPosition); + brush.Dispose(); } else { if (_checkMark.Focus) { SolidBrush brush = new SolidBrush(_textColor); graph.DrawString(_checkMark.Label, _font, brush, dwTextPosX, _checkMark.YPosition); + brush.Dispose(); } else { SolidBrush brush = new SolidBrush(_disabledColor); graph.DrawString(_checkMark.Label, _font, brush, dwTextPosX, _checkMark.YPosition); + brush.Dispose(); } } } @@ -148,6 +151,14 @@ } } } + + /// <summary> + /// Disposes the object + /// </summary> + public override void Dispose() { + _checkFocusBitmap.Dispose(); + _checkNoFocusBitmap.Dispose(); + } #endregion } } Modified: trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/FadeLabelElement.cs =================================================================== --- trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/FadeLabelElement.cs 2007-09-29 15:26:22 UTC (rev 963) +++ trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/FadeLabelElement.cs 2007-09-30 11:15:36 UTC (rev 964) @@ -84,6 +84,14 @@ graph.DrawString(text, _font, _brush, rectangle,StringFormat.GenericTypographic); } } + + /// <summary> + /// Disposes the object + /// </summary> + public override void Dispose() { + _font.Dispose(); + _brush.Dispose(); + } #endregion } } Modified: trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/ImageElement.cs =================================================================== --- trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/ImageElement.cs 2007-09-29 15:26:22 UTC (rev 963) +++ trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/ImageElement.cs 2007-09-30 11:15:36 UTC (rev 964) @@ -69,6 +69,13 @@ DrawElementAlternative(graph,GetImageRectangle()); } } + + /// <summary> + /// Disposes the object + /// </summary> + public override void Dispose() { + _bitmap.Dispose(); + } #endregion #region public methods Modified: trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/LabelElement.cs =================================================================== --- trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/LabelElement.cs 2007-09-29 15:26:22 UTC (rev 963) +++ trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/LabelElement.cs 2007-09-30 11:15:36 UTC (rev 964) @@ -73,6 +73,13 @@ DrawStandard(graph, _label.Label); } } + + /// <summary> + /// Disposes the object + /// </summary> + public override void Dispose() { + _font.Dispose(); + } #endregion #region public methods Modified: trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/ListElement.cs =================================================================== --- trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/ListElement.cs 2007-09-29 15:26:22 UTC (rev 963) +++ trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/ListElement.cs 2007-09-30 11:15:36 UTC (rev 964) @@ -113,6 +113,14 @@ } } } + + /// <summary> + /// Disposes the object + /// </summary> + public override void Dispose() { + _imageFocus.Dispose(); + _imageNonFocus.Dispose(); + } #endregion #region properties @@ -215,6 +223,14 @@ } graph.DrawString(GUIPropertyManager.Parse(_label), _font, _brush, rectangle, StringFormat.GenericTypographic); } + + /// <summary> + /// Disposes the object + /// </summary> + public override void Dispose() { + _brush.Dispose(); + _font.Dispose(); + } #endregion #region properties @@ -530,6 +546,27 @@ RenderScrollbar(graph, dwPosY); } } + + /// <summary> + /// Disposes the object + /// </summary> + public override void Dispose() { + foreach (ListButtonElement element in _listButtons) { + element.Dispose(); + } + foreach (ListLabelElement element in _labelControls1) { + element.Dispose(); + } + foreach (ListLabelElement element in _labelControls2) { + element.Dispose(); + } + foreach (ListLabelElement element in _labelControls3) { + element.Dispose(); + } + foreach (Bitmap element in _cachedBitmaps.Values) { + element.Dispose(); + } + } #endregion #region private methods @@ -567,7 +604,7 @@ _labelControls3.Add(cntl3); } } - + /// <summary> /// Renders the label /// </summary> @@ -724,7 +761,7 @@ } pItem = null; } - + /// <summary> /// Renders the text /// </summary> @@ -762,7 +799,7 @@ label.Font = getFont(_list.FontName); label.DrawElement(graph); } - + /// <summary> /// Render the button /// </summary> @@ -784,7 +821,7 @@ } } } - + /// <summary> /// Render icon /// </summary> @@ -852,7 +889,7 @@ } pItem = null; } - + /// <summary> /// Render the scroll bar /// </summary> Modified: trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/ProgressControlElement.cs =================================================================== --- trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/ProgressControlElement.cs 2007-09-29 15:26:22 UTC (rev 963) +++ trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/ProgressControlElement.cs 2007-09-30 11:15:36 UTC (rev 964) @@ -90,6 +90,16 @@ DrawProgressBar(graph,fWidth,percent); } } + + /// <summary> + /// Disposes the object + /// </summary> + public override void Dispose() { + _leftBitmap.Dispose(); + _midBitmap.Dispose(); + _rightBitmap.Dispose(); + _backgroundBitmap.Dispose(); + } #endregion #region public overrides methods Modified: trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/SliderElement.cs =================================================================== --- trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/SliderElement.cs 2007-09-29 15:26:22 UTC (rev 963) +++ trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/SliderElement.cs 2007-09-30 11:15:36 UTC (rev 964) @@ -98,6 +98,7 @@ if (null != font) { SolidBrush brush = new SolidBrush(Color.FromArgb(255,255,255,255)); graph.DrawString(GUIPropertyManager.Parse(strValue), font, brush, (float)_slider.XPosition, (float)_slider.YPosition); + brush.Dispose(); } backgroundPositionX += 60; break; @@ -108,6 +109,7 @@ if (null != font) { SolidBrush brush = new SolidBrush(Color.FromArgb(255, 255, 255, 255)); graph.DrawString(GUIPropertyManager.Parse(strValue), font, brush, (float)_slider.XPosition, (float)_slider.YPosition); + brush.Dispose(); } backgroundPositionX += 60; break; @@ -134,6 +136,15 @@ } } } + + /// <summary> + /// Disposes the object + /// </summary> + public override void Dispose() { + _backgroundBitmap.Dispose(); + _sliderBitmap.Dispose(); + _sliderFocusBitmap.Dispose(); + } #endregion } } Modified: trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/TextScrollUpElement.cs =================================================================== --- trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/TextScrollUpElement.cs 2007-09-29 15:26:22 UTC (rev 963) +++ trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/TextScrollUpElement.cs 2007-09-30 11:15:36 UTC (rev 964) @@ -97,6 +97,14 @@ graph.DrawString(GUIPropertyManager.Parse(label), _font, _brush, rectangle, StringFormat.GenericTypographic); } } + + /// <summary> + /// Disposes the object + /// </summary> + public override void Dispose() { + _font.Dispose(); + _brush.Dispose(); + } #endregion } } Modified: trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/ToggleButtonElement.cs =================================================================== --- trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/ToggleButtonElement.cs 2007-09-29 15:26:22 UTC (rev 963) +++ trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/ToggleButtonElement.cs 2007-09-30 11:15:36 UTC (rev 964) @@ -162,9 +162,20 @@ Rectangle rectangle = new Rectangle(x, _button.YPosition + _button.TextOffsetY, labelWidth, _button.Height); String label = _button.Label; graph.DrawString(GUIPropertyManager.Parse(label), _font, brush, rectangle, StringFormat.GenericTypographic); - + brush.Dispose(); } } + + /// <summary> + /// Disposes the object + /// </summary> + public override void Dispose() { + _focusBitmap.Dispose(); + _noFocusBitmap.Dispose(); + _altFocusBitmap.Dispose(); + _altNoFocusBitmap.Dispose(); + _font.Dispose(); + } #endregion } } Modified: trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/VerticalScrollbarElement.cs =================================================================== --- trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/VerticalScrollbarElement.cs 2007-09-29 15:26:22 UTC (rev 963) +++ trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/VerticalScrollbarElement.cs 2007-09-30 11:15:36 UTC (rev 964) @@ -111,6 +111,15 @@ } } } + + /// <summary> + /// Disposes the object + /// </summary> + public override void Dispose() { + _scrollBarBackground.Dispose(); + _scrollBarTop.Dispose(); + _scrollBarBottom.Dispose(); + } #endregion } } Modified: trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/VolumeBarElement.cs =================================================================== --- trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/VolumeBarElement.cs 2007-09-29 15:26:22 UTC (rev 963) +++ trunk/plugins/My MPlayer/ExternalOSDLibrary/Elements/VolumeBarElement.cs 2007-09-30 11:15:36 UTC (rev 964) @@ -118,6 +118,13 @@ } } } + + /// <summary> + /// Disposes the object + /// </summary> + public override void Dispose() { + _bitmap.Dispose(); + } #endregion } } Modified: trunk/plugins/My MPlayer/ExternalOSDLibrary/FullscreenWindow.cs =================================================================== --- trunk/plugins/My MPlayer/ExternalOSDLibrary/FullscreenWindow.cs 2007-09-29 15:26:22 UTC (rev 963) +++ trunk/plugins/My MPlayer/ExternalOSDLibrary/FullscreenWindow.cs 2007-09-30 11:15:36 UTC (rev 964) @@ -162,6 +162,18 @@ element.DrawCacheStatus(graph, cacheFill); } } + + /// <summary> + /// Dispose the object + /// </summary> + public override void Dispose() { + _label.Dispose(); + _background.Dispose(); + foreach (BaseElement element in _cacheElements) { + element.Dispose(); + } + base.Dispose(); + } #endregion } } Modified: trunk/plugins/My MPlayer/ExternalOSDLibrary/OSDController.cs =================================================================== --- trunk/plugins/My MPlayer/ExternalOSDLibrary/OSDController.cs 2007-09-29 15:26:22 UTC (rev 963) +++ trunk/plugins/My MPlayer/ExternalOSDLibrary/OSDController.cs 2007-09-30 11:15:36 UTC (rev 964) @@ -30,10 +30,11 @@ using MediaPortal.GUI.Library; namespace ExternalOSDLibrary { + /// <summary> /// Controller for the ExternalOSDLibrary. This is the main entry point for usage in an external player /// </summary> - public class OSDController { + public class OSDController : IDisposable{ #region variables /// <summary> /// Singleton instance @@ -69,7 +70,7 @@ /// Indicates, if additional osd information is displayed /// </summary> private bool _showAdditionalOSD; - + /// <summary> /// Label of the additional osd /// </summary> @@ -173,7 +174,7 @@ _osdForm2.Image = image; _osdForm2.Refresh(); } - + /// <summary> /// Deactivates the osd. Nothing will be displayed until it will be reactivated. /// </summary> @@ -238,5 +239,19 @@ _showInit = false; } #endregion + + #region IDisposable Member + /// <summary> + /// Disposes the osd controller + /// </summary> + public void Dispose() { + _fullscreenWindow.Dispose(); + _dialogWindow.Dispose(); + _videoOSDWindow.Dispose(); + _osdForm.Dispose(); + _osdForm2.Dispose(); + singleton = null; + } + #endregion } } Modified: trunk/plugins/My MPlayer/MPlayer_ExtPlayer/ExternalOSDLibrary.cs =================================================================== --- trunk/plugins/My MPlayer/MPlayer_ExtPlayer/ExternalOSDLibrary.cs 2007-09-29 15:26:22 UTC (rev 963) +++ trunk/plugins/My MPlayer/MPlayer_ExtPlayer/ExternalOSDLibrary.cs 2007-09-30 11:15:36 UTC (rev 964) @@ -75,7 +75,7 @@ } } _osd.Activate(); - _osd.ShowInit("Initiliazing"); + _osd.ShowInit(LocalizeStrings.Get((int)LocalizedMessages.Initializing)); } private void osdGetInstance() { Modified: trunk/plugins/My MPlayer/MPlayer_ExtPlayer/Language/strings_de.xml =================================================================== --- trunk/plugins/My MPlayer/MPlayer_ExtPlayer/Language/strings_de.xml 2007-09-29 15:26:22 UTC (rev 963) +++ trunk/plugins/My MPlayer/MPlayer_ExtPlayer/Language/strings_de.xml 2007-09-30 11:15:36 UTC (rev 964) @@ -18,5 +18,6 @@ <String id="14">Wiedergabe Stream</String> <String id="15">Disc-Wiedergabe</String> <String id="16">Lösche Element</String> + <String id="17">Initialisiere</String> </Section> </Language> \ No newline at end of file Modified: trunk/plugins/My MPlayer/MPlayer_ExtPlayer/Language/strings_en.xml =================================================================== --- trunk/plugins/My MPlayer/MPlayer_ExtPlayer/Language/strings_en.xml 2007-09-29 15:26:22 UTC (rev 963) +++ trunk/plugins/My MPlayer/MPlayer_ExtPlayer/Language/strings_en.xml 2007-09-30 11:15:36 UTC (rev 964) @@ -18,5 +18,6 @@ <String id="14">Play Stream</String> <String id="15">Play Disc</String> <String id="16">Delete Item</String> + <String id="17">Initializing</String> </Section> </Language> \ No newline at end of file Modified: trunk/plugins/My MPlayer/MPlayer_ExtPlayer/LocalizeStrings.cs =================================================================== --- trunk/plugins/My MPlayer/MPlayer_ExtPlayer/LocalizeStrings.cs 2007-09-29 15:26:22 UTC (rev 963) +++ trunk/plugins/My MPlayer/MPlayer_ExtPlayer/LocalizeStrings.cs 2007-09-30 11:15:36 UTC (rev 964) @@ -109,7 +109,11 @@ /// <summary> /// Delete button /// </summary> - Delete=16 + Delete=16, + /// <summary> + /// Initializing message + /// </summary> + Initializing=17 } /// <summary> Modified: trunk/plugins/My MPlayer/MPlayer_ExtPlayer/MPlayer_ExtPlayer.csproj =================================================================== --- trunk/plugins/My MPlayer/MPlayer_ExtPlayer/MPlayer_ExtPlayer.csproj 2007-09-29 15:26:22 UTC (rev 963) +++ trunk/plugins/My MPlayer/MPlayer_ExtPlayer/MPlayer_ExtPlayer.csproj 2007-09-30 11:15:36 UTC (rev 964) @@ -145,6 +145,8 @@ <Content Include="config.ico" /> <Content Include="Language\strings_de.xml" /> <Content Include="Language\strings_en.xml" /> + <Content Include="Language\strings_es.xml" /> + <Content Include="Language\strings_fr.xml" /> <Content Include="SampleConfiguration\MPlayer_ExtPlayer.xml" /> </ItemGroup> <ItemGroup> Modified: trunk/plugins/My MPlayer/MPlayer_Installer/Installer.cs =================================================================== --- trunk/plugins/My MPlayer/MPlayer_Installer/Installer.cs 2007-09-29 15:26:22 UTC (rev 963) +++ trunk/plugins/My MPlayer/MPlayer_Installer/Installer.cs 2007-09-30 11:15:36 UTC (rev 964) @@ -68,6 +68,16 @@ LoadPlugins(configPath + @"\Windows\MPlayer_GUIPlugin.dll"); ConfigurationWizard wizard = new ConfigurationWizard(); wizard.ShowDialog(); + using (MediaPortal.Profile.Settings xmlWriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { + xmlWriter.SetValueAsBool("plugins", "My MPlayer GUI",true); + xmlWriter.SetValueAsBool("plugins", "MPlayer", true); + xmlWriter.SetValueAsBool("pluginsdlls", "MPlayer_GUIPlugin.dll", true); + xmlWriter.SetValueAsBool("pluginsdlls", "MPlayer_ExtPlayer.dll", true); + xmlWriter.SetValueAsBool("home", "My MPlayer GUI", true); + xmlWriter.SetValueAsBool("myplugins", "My MPlayer GUI", false); + xmlWriter.SetValueAsBool("pluginswindows", "MPlayer.MPlayer_GUIPlugin", true); + } + MediaPortal.Profile.Settings.SaveCache(); return true; } Modified: trunk/plugins/My MPlayer/My MPlayer.xmp =================================================================== --- trunk/plugins/My MPlayer/My MPlayer.xmp 2007-09-29 15:26:22 UTC (rev 963) +++ trunk/plugins/My MPlayer/My MPlayer.xmp 2007-09-30 11:15:36 UTC (rev 964) @@ -8,7 +8,7 @@ <Source>ExternalOSDLibrary\bin\Release\ExternalOSDLibrary.dll</Source> <Id>04010</Id> <Option /> - <Guid>686795da-9902-43d1-83d9-14eae062befc</Guid> + <Guid>208539bd-cb3d-4403-936b-cc2ac5f9086b</Guid> </File> <File> <FileName>MPlayer_ExtPlayer.dll</FileName> @@ -17,7 +17,7 @@ <Source>MPlayer_ExtPlayer\bin\Release\MPlayer_ExtPlayer.dll</Source> <Id>01050</Id> <Option /> - <Guid>796c1748-3b7e-4f77-b2d0-f745c8fd66a4</Guid> + <Guid>129d0b43-6858-40ec-89ca-533818efa0cc</Guid> </File> <File> <FileName>MPlayer_ExtPlayer.xml</FileName> @@ -26,7 +26,7 @@ <Source>MPlayer_ExtPlayer\SampleConfiguration\MPlayer_ExtPlayer.xml</Source> <Id>04010</Id> <Option /> - <Guid>57701aeb-bdf6-484a-a7a8-ce2b3d061a43</Guid> + <Guid>e8372d2f-64ea-44ac-9a08-02c357a3fcca</Guid> </File> <File> <FileName>MPlayer_GUIPlugin.dll</FileName> @@ -35,7 +35,7 @@ <Source>MPlayer_GUIPlugin\bin\Release\MPlayer_GUIPlugin.dll</Source> <Id>01010</Id> <Option /> - <Guid>6288386c-0e13-41ba-b267-0ee0ef6fcb2c</Guid> + <Guid>d35cb71e-87ba-4840-b18a-d8fc57f6830d</Guid> </File> <File> <FileName>MPlayer_GUIPlugin.xml</FileName> @@ -44,7 +44,7 @@ <Source>MPlayer_GUIPlugin\SampleConfiguration\MPlayer_GUIPlugin.xml</Source> <Id>04010</Id> <Option /> - <Guid>28c6436c-59e7-49a8-813c-c569047400f4</Guid> + <Guid>a9bc8f02-b1d8-4aca-a9f9-0eb3875e05be</Guid> </File> <File> <FileName>MPlayer_Installer.dll</FileName> @@ -62,7 +62,7 @@ <Source>z:\Source-MediaPortal\MP-Plugins\My MPlayer\MPlayer-License.txt</Source> <Id>03010</Id> <Option /> - <Guid>d34086ec-93b3-4756-b10e-abc94975e542</Guid> + <Guid>63740cb8-9f67-4d7e-b4ca-4b95779a8539</Guid> </File> <File> <FileName>myMPlayer.xml</FileName> @@ -71,7 +71,7 @@ <Source>MPlayer_GUIPlugin\SkinFiles\BlueTwo 4x3\myMPlayer.xml</Source> <Id>02010</Id> <Option>OutputFileName=|DefaultFile=True|</Option> - <Guid>dae94e3d-2ebe-4aec-9d8b-107ca2b74415</Guid> + <Guid>526a6e68-e375-4d75-9d1c-47e6728b12db</Guid> </File> <File> <FileName>myMPlayer.xml</FileName> @@ -80,7 +80,7 @@ <Source>MPlayer_GUIPlugin\SkinFiles\BlueTwo 16x9\myMPlayer.xml</Source> <Id>02010</Id> <Option /> - <Guid>d4a573ff-5d88-4c68-a165-ecfdc1b0672a</Guid> + <Guid>40d8ee5d-6ad2-4fa0-b51b-aff4990060d2</Guid> </File> <File> <FileName>myMPlayer.xml</FileName> @@ -89,7 +89,7 @@ <Source>MPlayer_GUIPlugin\SkinFiles\PM III\myMPlayer.xml</Source> <Id>02010</Id> <Option /> - <Guid>2cd41f49-101f-4f99-8290-62151c942590</Guid> + <Guid>ef453824-7cd5-4df6-823f-3bd53b6c0d77</Guid> </File> <File> <FileName>strings_de.xml</FileName> @@ -98,7 +98,7 @@ <Source>MPlayer_ExtPlayer\Language\strings_de.xml</Source> <Id>04010</Id> <Option /> - <Guid>5f4076a7-55b8-46c3-ba7a-b58e636bc844</Guid> + <Guid>5f064f77-ceb3-481d-8345-b1efcf57763a</Guid> </File> <File> <FileName>strings_en.xml</FileName> @@ -107,7 +107,7 @@ <Source>MPlayer_ExtPlayer\Language\strings_en.xml</Source> <Id>04010</Id> <Option /> - <Guid>8b52a34e-e2e4-4b04-988e-3eb997e4cf04</Guid> + <Guid>4c978042-6d29-4466-ae50-b8a7a3b491c6</Guid> </File> <File> <FileName>strings_es.xml</FileName> @@ -116,7 +116,7 @@ <Source>MPlayer_ExtPlayer\Language\strings_es.xml</Source> <Id>04010</Id> <Option /> - <Guid>26b782b5-80fc-43f2-8f47-afb8ccf2b41a</Guid> + <Guid>1fbbcd8a-2046-477a-ac65-4ff5148fe942</Guid> </File> <File> <FileName>strings_fr.xml</FileName> @@ -125,7 +125,7 @@ <Source>MPlayer_ExtPlayer\Language\strings_fr.xml</Source> <Id>04010</Id> <Option /> - <Guid>325b0645-8dc8-4e40-b83b-0f79917fe9ca</Guid> + <Guid>687d49d5-d1cb-43b9-b347-910666909884</Guid> </File> </FileList> <StringList /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nor...@us...> - 2007-09-29 15:26:28
|
Revision: 963 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=963&view=rev Author: northern_sky Date: 2007-09-29 08:26:22 -0700 (Sat, 29 Sep 2007) Log Message: ----------- minor changes Modified Paths: -------------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesImportProgress.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesView.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/DirectoryImport.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItem.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemDirectoryCache.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemFactory.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemGameBase.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemMame.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/FileItem.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/FilelinkItem.cs Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesImportProgress.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesImportProgress.cs 2007-09-28 18:46:10 UTC (rev 962) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesImportProgress.cs 2007-09-29 15:26:22 UTC (rev 963) @@ -95,7 +95,7 @@ { progressTextBox.Text = importStartedText; isImportRunning = true; - CurApp.Refresh(false); + CurApp.ReImport(false); } finally { Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesView.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesView.cs 2007-09-28 18:46:10 UTC (rev 962) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesView.cs 2007-09-29 15:26:22 UTC (rev 963) @@ -316,7 +316,7 @@ FilelinkItem filelink = (FilelinkItem)listViewItem.Tag; if (filelink != null) { - filelink.Delete(); + filelink.DeleteFileItem(); } } else @@ -324,7 +324,7 @@ FileItem file = (FileItem)listViewItem.Tag; if (file != null) { - file.Delete(); + file.DeleteFileItem(); } } } @@ -603,17 +603,21 @@ { importOptionsCheckedListBox.SetItemChecked(importOptionsCheckedListBox.Items.IndexOf(ImportOptionToString(ImportOption.OnlyImportValidImages)), true); } - if (applicationItem.ImportMameMahjong) + + + if (applicationItem is ApplicationItemMame) { - importOptionsCheckedListBox.SetItemChecked(importOptionsCheckedListBox.Items.IndexOf(ImportOptionToString(ImportOption.ImportMahjongGames)), true); + if (((ApplicationItemMame)applicationItem).ImportMamePlaychoice10) + { + importOptionsCheckedListBox.SetItemChecked(importOptionsCheckedListBox.Items.IndexOf(ImportOptionToString(ImportOption.ImportPlaychoiceGames)), true); + } - } - if (applicationItem.ImportMamePlaychoice10) - { - importOptionsCheckedListBox.SetItemChecked(importOptionsCheckedListBox.Items.IndexOf(ImportOptionToString(ImportOption.ImportPlaychoiceGames)), true); - } - if (applicationItem is ApplicationItemMame) - { + if (((ApplicationItemMame)applicationItem).ImportMameMahjong) + { + importOptionsCheckedListBox.SetItemChecked(importOptionsCheckedListBox.Items.IndexOf(ImportOptionToString(ImportOption.ImportMahjongGames)), true); + + } + if (((ApplicationItemMame)applicationItem).ImportOriginalsOnly) { importOptionsCheckedListBox.SetItemChecked(importOptionsCheckedListBox.Items.IndexOf(ImportOptionToString(ImportOption.OnlyImportOriginals)), true); Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.cs 2007-09-28 18:46:10 UTC (rev 962) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.cs 2007-09-29 15:26:22 UTC (rev 963) @@ -1014,7 +1014,7 @@ if (currentApplicationItem != null) { currentApplicationItem.ImportFinishedEvent += new ApplicationItem.ImportFinishedEventHandler(currentApplicationItem_ImportFinishedEvent); - currentApplicationItem.Refresh(true); + currentApplicationItem.ReImport(true); } } Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/DirectoryImport.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/DirectoryImport.cs 2007-09-28 18:46:10 UTC (rev 962) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/DirectoryImport.cs 2007-09-29 15:26:22 UTC (rev 963) @@ -57,7 +57,7 @@ fileItem = (FileItem) applicationItem.ItemList[i]; if (!File.Exists(fileItem.Filename)) { - fileItem.Delete(); + fileItem.DeleteFileItem(); } } Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItem.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItem.cs 2007-09-28 18:46:10 UTC (rev 962) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItem.cs 2007-09-29 15:26:22 UTC (rev 963) @@ -51,19 +51,19 @@ { public abstract class ApplicationItem { - protected ImportBase importBase = null; + protected ImportBase importBase = null; #region Events/Delegates - // public delegate void FilelinkLaunchEventHandler(FilelinkItem curLink, bool mpGuiMode); - // public event FilelinkLaunchEventHandler OnLaunchFilelink = null; + // public delegate void FilelinkLaunchEventHandler(FilelinkItem curLink, bool mpGuiMode); + // public event FilelinkLaunchEventHandler OnLaunchFilelink = null; // event: read new file - public delegate void RefreshInfoEventHandler(object sender ,FileReadEventArgs e) ; - public event RefreshInfoEventHandler RefreshInfoEvent = null; + public delegate void RefreshInfoEventHandler(object sender, FileReadEventArgs e); + public event RefreshInfoEventHandler RefreshInfoEvent = null; - public delegate void ImportFinishedEventHandler(object sender,EventArgs e); + public delegate void ImportFinishedEventHandler(object sender, EventArgs e); public event ImportFinishedEventHandler ImportFinishedEvent; public delegate void ImportDelegate(); @@ -77,37 +77,27 @@ { RefreshInfoEvent(this, e); } - + } public virtual void OnImportFinished(object sender, EventArgs e) { if (ImportFinishedEvent != null) { - ImportFinishedEvent(this,e); + ImportFinishedEvent(this, e); } } protected void ImportEnded(IAsyncResult result) { filesAreLoaded = false; - if (progressDialog != null) - { - progressDialog.Close(); - } - - - OnImportFinished(this, null); FixFileLinks(); - if (progressDialog != null) { progressDialog.Close(); progressDialog.ShowWaitCursor = false; - } - - + OnImportFinished(this, null); } #endregion Events/Delegates @@ -135,7 +125,6 @@ private List<ImportOption> importOptionList;//a list of options for the filesview private List<FileSettingOption> fileSettingList;//a list of which setting to use for filesview - bool enabled; int appPosition; string currentView = ""; @@ -143,8 +132,6 @@ public List<object> ItemList = new List<object>();//fileitems or links public bool filesAreLoaded = false; // load on demand.... public bool linksAreLoaded = false; // load on demand.... - bool importMamePlaychoice10 = false; - bool importMameMahjong = false; public string mameCatVerIniPath = ""; public string mameHistoryDatPath = ""; bool refreshGUIAllowed = false; @@ -155,7 +142,6 @@ string imageDirectories; // in one string for sqlite db field private string[] imageDirsSplitted; // imageDirectories splitted - string fileDirectory; string validExtensions; bool importValidImagesOnly; @@ -275,16 +261,6 @@ set { currentView = value; } } - public bool ImportMamePlaychoice10 - { - get { return importMamePlaychoice10; } - set { importMamePlaychoice10 = value; } - } - public bool ImportMameMahjong - { - get { return importMameMahjong; } - set { importMameMahjong = value; } - } // more Properties, maybe need some renaming or anything else public string FileDirectory @@ -292,14 +268,14 @@ get { return fileDirectory; } set { fileDirectory = value; } } - + public string ImageDirectory { get { return imageDirectories; } set { imageDirectories = value; - + //also do the split imageDirsSplitted = imageDirectories.Split(';'); for (int i = 0; i < imageDirsSplitted.Length; i++) @@ -355,7 +331,7 @@ public ApplicationItem() { - // .. init member variables ... + // .. init member variables ... appID = -1; fatherID = -1; title = ""; @@ -391,7 +367,7 @@ { progressDialog = (GUIDialogProgress)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_PROGRESS); progressDialog.SetHeading(headerText); - progressDialog.SetLine(0,headerText); + progressDialog.SetLine(0, headerText); progressDialog.SetLine(1, ""); progressDialog.SetLine(2, ""); progressDialog.StartModal(GetID); @@ -403,28 +379,17 @@ //mpgui if (progressDialog != null) { - progressDialog.ShowProgressBar(true); progressDialog.ShowWaitCursor = true; progressDialog.SetLine(2, String.Format("{0} {1}", GUILocalizeStrings.Get(13005), informationMessage)); // "last imported file {0}" progressDialog.SetPercentage(progressBarCtr); progressDialog.Progress(); - - } - else - { - - - - - } - // SendRefreshInfo(String.Format("{0} {1}", GUILocalizeStrings.Get(13005), informationMessage), progressBarCtr); } - + protected void DoPreLaunch() { if (waitForExit && (preLaunch != "")) @@ -491,22 +456,17 @@ protected virtual void Import(bool mpGUIMode) { - + importBase.ReadNewFileEvent += new ImportBase.ReadNewFileEventHandler(Import_ReadNewFileEvent); importDelegate = new ImportDelegate(importBase.StartImport); importDelegate.BeginInvoke(new AsyncCallback(ImportEnded), null); - + } #endregion protected methods #region Public Methods - public virtual string CurrentFilePath() - { - return this.FileDirectory; - } - public void Assign(ApplicationItem sourceApp) { this.Enabled = sourceApp.Enabled; @@ -533,30 +493,6 @@ this.PlatformId = sourceApp.PlatformId; } - public FileItem PrevFile(FileItem curFile) - { - if (ItemList == null) return null; - if (ItemList.Count == 0) return null; - - int index = this.ItemList.IndexOf(curFile); - index = index - 1; - if (index < 0) - index = ItemList.Count - 1; - return (FileItem)ItemList[index]; - } - - public FileItem NextFile(FileItem curFile) - { - if (ItemList == null) return null; - if (ItemList.Count == 0) return null; - - int index = this.ItemList.IndexOf(curFile); - index = index + 1; - if (index > ItemList.Count - 1) - index = 0; - return (FileItem)ItemList[index]; - } - /// <summary> /// look for FileItem and launch it using the found object /// </summary> @@ -579,7 +515,7 @@ // use the APPLICATION launcher and add current file information if (this.Executable != "") - { + { // executable of the application procStart.FileName = this.Executable; @@ -715,9 +651,10 @@ return false; } - public virtual void Refresh(bool mpGuiMode) + public virtual void ReImport(bool mpGuiMode) { - // descendant classes do that! + DeleteFiles(); + Import(mpGuiMode); } public void LoadFromXmlProfile(XmlNode node) @@ -906,7 +843,7 @@ } } - private void Update() + private void UpdateApplicationItem() { if (ApplicationItemId == -1) return; @@ -1042,7 +979,7 @@ if (appID == -1) Insert(); else - Update(); + UpdateApplicationItem(); } protected virtual void FixFileLinks() @@ -1113,7 +1050,7 @@ if (fileItem == null) return; bool foundThumb = false; - + while (!foundThumb) { thumbFolderIndex++; @@ -1240,6 +1177,6 @@ #endregion - + } } \ No newline at end of file Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemDirectoryCache.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemDirectoryCache.cs 2007-09-28 18:46:10 UTC (rev 962) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemDirectoryCache.cs 2007-09-29 15:26:22 UTC (rev 963) @@ -76,11 +76,8 @@ return true; } - public override void Refresh(bool mpGuiMode) - { - Import(mpGuiMode); - } + protected override void Import(bool mpGUIMode) { if (mpGUIMode) @@ -88,7 +85,6 @@ ShowProgressDialog("Importing from folders.."); } - ValidExtensions = ValidExtensions.Replace(" ", ""); importBase = new DirectoryImport(this); base.Import(mpGUIMode); Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemFactory.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemFactory.cs 2007-09-28 18:46:10 UTC (rev 962) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemFactory.cs 2007-09-29 15:26:22 UTC (rev 963) @@ -34,7 +34,7 @@ /// <summary> /// Factory like object that creates the matchin Application descendant class /// depending on the itemType parameter - /// Descendant classes differ in LOADING and REFRESHING filelists + /// </summary> public class ItemFactory { @@ -165,8 +165,7 @@ { FilterItem filterItem = new FilterItem( ); filterItem.Title = row["title"].ToString() ; - // newFile.LastTimeLaunched = ProgramUtils.GetDateDef(results, iRecord, "lastTimeLaunched", DateTime.MinValue); - //newFile.LaunchCount = ProgramUtils.GetIntDef(results, iRecord, "launchcount", 0); ; + return filterItem; } Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemGameBase.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemGameBase.cs 2007-09-28 18:46:10 UTC (rev 962) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemGameBase.cs 2007-09-29 15:26:22 UTC (rev 963) @@ -60,25 +60,15 @@ if ((ApplicationItemSource == "") || (!File.Exists(ApplicationItemSource))) return; - if (mpGUIMode) { ShowProgressDialog("Importing from gameBase.."); } importBase = new GamebaseImport(this); - base.Import(mpGUIMode); - } - - - public override void Refresh(bool bGUIMode) - { - DeleteFiles(); - Import(bGUIMode); - } #endregion ApplicationItem Overloads } } \ No newline at end of file Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemMame.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemMame.cs 2007-09-28 18:46:10 UTC (rev 962) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemMame.cs 2007-09-29 15:26:22 UTC (rev 963) @@ -50,10 +50,23 @@ #region Variables bool importOriginalsOnly = true; + bool importMamePlaychoice10 = false; + bool importMameMahjong = false; - #endregion Variables + public bool ImportMamePlaychoice10 + { + get { return importMamePlaychoice10; } + set { importMamePlaychoice10 = value; } + } + public bool ImportMameMahjong + { + get { return importMameMahjong; } + set { importMameMahjong = value; } + } + + public ApplicationItemMame() { @@ -94,19 +107,6 @@ #region ApplicationItem Overloads - public override string CurrentFilePath() - { - return this.FileDirectory; - } - - - - public override void Refresh(bool bGUIMode) - { - DeleteFiles(); - Import(bGUIMode); - } - protected override void Import(bool mpGUIMode) { @@ -118,7 +118,6 @@ base.Import(mpGUIMode); } - #endregion ApplicationItem Overloads } } \ No newline at end of file Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/FileItem.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/FileItem.cs 2007-09-28 18:46:10 UTC (rev 962) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/FileItem.cs 2007-09-29 15:26:22 UTC (rev 963) @@ -331,17 +331,7 @@ categoryData = value; } } - /* public bool IsFolder - { - get - { - return isFolder; - } - set - { - isFolder = value; - } - }*/ + public string GameInfoURL { get { return gameInfoURL; } @@ -386,33 +376,8 @@ return nRes; } - // - // no need for these methods anymore - // + - //public string ExtractImageExtension() - //{ - // string strRes = ""; - // string[] parts = this.Imagefile.Split( '.' ); - // if ( parts.Length >= 2 ) - // { - // // there was an extension - // strRes = '.' + parts[parts.Length - 1]; - // } - // return strRes; - //} - - //public string ExtractImageFileNoPath() - //{ - // string strRes = ""; - // string[] parts = this.Imagefile.Split( '\\' ); - // if ( parts.Length >= 1 ) - // { - // strRes = parts[parts.Length - 1]; - // } - // return strRes; - //} - public void SetProperties() { /* string strThumb = MediaPortal.Util.Utils.GetLargeCoverArtName(Thumbs.MovieTitle, Title);*/ @@ -440,7 +405,7 @@ GUIPropertyManager.SetProperty("#iswatched", strValue);*/ } - private void Insert() + private void InsertFileItem() { SQLiteParameter[] parameterArray = new SQLiteParameter[15]; @@ -517,7 +482,7 @@ - private void Update() + private void UpdateFileItem() { try @@ -604,15 +569,15 @@ { if ( fileID == -1 ) { - Insert(); + InsertFileItem(); } else { - Update(); + UpdateFileItem(); } } - public virtual void Delete() + public virtual void DeleteFileItem() { if ( this.FileID >= 0 ) Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/FilelinkItem.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/FilelinkItem.cs 2007-09-28 18:46:10 UTC (rev 962) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/FilelinkItem.cs 2007-09-29 15:26:22 UTC (rev 963) @@ -65,7 +65,7 @@ { if (Exists()) { - Update(); + } else { @@ -73,7 +73,7 @@ } } - public override void Delete() + public override void DeleteFileItem() { try @@ -131,11 +131,5 @@ Log.Info("programdatabase exception err:{0} stack:{1}", ex.Message, ex.StackTrace); } } - - private void Update() - { - // nothing to update (yet) - //...... as all tblFileLinkItem fields are primary key fields... - } } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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-09-28 18:10:54
|
Revision: 961 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=961&view=rev Author: and-81 Date: 2007-09-28 11:10:48 -0700 (Fri, 28 Sep 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs Modified: trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-09-28 16:34:14 UTC (rev 960) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-09-28 18:10:48 UTC (rev 961) @@ -43,7 +43,7 @@ #endregion Enumerations - internal class IRServer : IDisposable + public class IRServer : IDisposable { #region Constants @@ -115,6 +115,10 @@ if (disposeManagedResources) { // Dispose managed resources ... + + StopServer(); + StopClient(); + _notifyIcon.Dispose(); _notifyIcon = null; } @@ -183,7 +187,7 @@ { IrssLog.Warn("No transmit plugin loaded"); } - else if (_pluginTransmit != null) + else if (_pluginTransmit == null) { _pluginTransmit = Program.GetPlugin(_pluginNameTransmit); } Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs 2007-09-28 16:34:14 UTC (rev 960) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs 2007-09-28 18:10:48 UTC (rev 961) @@ -252,7 +252,7 @@ } public LearnStatus Learn(out byte[] data) { - IrCode code = null; + IrCode code; LearnStatus status = _driver.Learn(_learnTimeout, out code); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-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 16:31:52
|
Revision: 959 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=959&view=rev Author: and-81 Date: 2007-09-28 09:31:49 -0700 (Fri, 28 Sep 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/GetKeyCodeForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.Designer.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.resx trunk/plugins/IR Server Suite/Applications/Translator/Program.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/GetKeyCodeForm.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs trunk/plugins/IR Server Suite/Common/IrssComms/Client.cs trunk/plugins/IR Server Suite/Common/IrssComms/ClientManager.cs trunk/plugins/IR Server Suite/Common/IrssComms/GenericPCQueue.cs trunk/plugins/IR Server Suite/Common/IrssComms/IrssMessage.cs trunk/plugins/IR Server Suite/Common/IrssComms/MessageManagerCombo.cs trunk/plugins/IR Server Suite/Common/IrssComms/Server.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs trunk/plugins/IR Server Suite/Common/IrssUtils/IrssLog.cs trunk/plugins/IR Server Suite/Common/IrssUtils/SystemRegistry.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Win32.cs trunk/plugins/IR Server Suite/Common/MPUtils/MPCommands.cs trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IRServerPluginInterface.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverReplacement.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverVista.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverXP.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrDecoder.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MceDetectionData.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/NotifyWindow.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/RemoteDetectionData.cs trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/UirtTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLircServer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Windows Message Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/X10Transceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/XBCDRC Receiver/XBCDRC Receiver.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MPBlastZonePlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -173,7 +173,7 @@ if ((received.Flags & MessageFlags.Success) == MessageFlags.Success) { _registered = true; - _irServerInfo = IRServerInfo.FromBytes(received.DataAsBytes); + _irServerInfo = IRServerInfo.FromBytes(received.GetDataAsBytes()); comboBoxPort.Items.Clear(); comboBoxPort.Items.AddRange(_irServerInfo.Ports); comboBoxPort.SelectedIndex = 0; @@ -185,13 +185,13 @@ return; case MessageType.RemoteEvent: - RemoteHandlerCallback(received.DataAsString); + RemoteHandlerCallback(received.GetDataAsString()); return; case MessageType.LearnIR: if ((received.Flags & MessageFlags.Success) == MessageFlags.Success) { - byte[] dataBytes = received.DataAsBytes; + byte[] dataBytes = received.GetDataAsBytes(); using (FileStream file = File.Create(_learnIRFilename)) file.Write(dataBytes, 0, dataBytes.Length); @@ -206,7 +206,7 @@ case MessageType.Error: _learnIRFilename = null; - this.Invoke(_addStatusLine, new Object[] { received.DataAsString }); + this.Invoke(_addStatusLine, new Object[] { received.GetDataAsString() }); return; } } Modified: trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -311,7 +311,7 @@ break; case MessageType.Error: - Warn(received.DataAsString); + Warn(received.GetDataAsString()); break; } } Modified: trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -275,7 +275,7 @@ break; case MessageType.Error: - IrssLog.Warn(received.DataAsString); + IrssLog.Warn(received.GetDataAsString()); break; } } Modified: trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -43,7 +43,7 @@ #endregion Enumerations - internal class IRServer + internal class IRServer : IDisposable { #region Constants @@ -59,8 +59,8 @@ List<ClientManager> _registeredClients; List<ClientManager> _registeredRepeaters; - Server _server = null; - Client _client = null; + Server _server; + Client _client; IRServerMode _mode; string _hostComputer; @@ -77,7 +77,7 @@ #endregion Variables - #region Constructor + #region Constructor / Destructor public IRServer() { @@ -93,8 +93,38 @@ _notifyIcon.Text = "IR Server"; } - #endregion Constructor + /* + ~IRServer() + { + Dispose(false); + } + */ + #endregion Constructor / Destructor + + #region IDisposable + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposeManagedResources) + { + if (disposeManagedResources) + { + // Dispose managed resources ... + _notifyIcon.Dispose(); + _notifyIcon = null; + } + + // Free native resources ... + + } + + #endregion IDisposable + #region Implementation /// <summary> @@ -159,6 +189,7 @@ } } + // Mode select ... switch (_mode) { case IRServerMode.ServerMode: @@ -193,14 +224,17 @@ { if (plugin.Start()) { - if (plugin is IRemoteReceiver) - (plugin as IRemoteReceiver).RemoteCallback += new RemoteHandler(RemoteHandlerCallback); + IRemoteReceiver remoteReceiver = plugin as IRemoteReceiver; + if (remoteReceiver != null) + remoteReceiver.RemoteCallback += new RemoteHandler(RemoteHandlerCallback); - if (plugin is IKeyboardReceiver) - (plugin as IKeyboardReceiver).KeyboardCallback += new KeyboardHandler(KeyboardHandlerCallback); + IKeyboardReceiver keyboardReceiver = plugin as IKeyboardReceiver; + if (keyboardReceiver != null) + keyboardReceiver.KeyboardCallback += new KeyboardHandler(KeyboardHandlerCallback); - if (plugin is IMouseReceiver) - (plugin as IMouseReceiver).MouseCallback += new MouseHandler(MouseHandlerCallback); + IMouseReceiver mouseReceiver = plugin as IMouseReceiver; + if (mouseReceiver != null) + mouseReceiver.MouseCallback += new MouseHandler(MouseHandlerCallback); if (plugin.Name.Equals(_pluginTransmit.Name)) { @@ -274,7 +308,6 @@ } // Stop Plugin(s) ... - bool stoppedTransmit = false; if (_pluginReceive != null) @@ -283,14 +316,17 @@ { try { - if (plugin is IRemoteReceiver) - (plugin as IRemoteReceiver).RemoteCallback -= new RemoteHandler(RemoteHandlerCallback); + IRemoteReceiver remoteReceiver = plugin as IRemoteReceiver; + if (remoteReceiver != null) + remoteReceiver.RemoteCallback -= new RemoteHandler(RemoteHandlerCallback); - if (plugin is IKeyboardReceiver) - (plugin as IKeyboardReceiver).KeyboardCallback -= new KeyboardHandler(KeyboardHandlerCallback); + IKeyboardReceiver keyboardReceiver = plugin as IKeyboardReceiver; + if (keyboardReceiver != null) + keyboardReceiver.KeyboardCallback -= new KeyboardHandler(KeyboardHandlerCallback); - if (plugin is IMouseReceiver) - (plugin as IMouseReceiver).MouseCallback -= new MouseHandler(MouseHandlerCallback); + IMouseReceiver mouseReceiver = plugin as IMouseReceiver; + if (mouseReceiver != null) + mouseReceiver.MouseCallback -= new MouseHandler(MouseHandlerCallback); plugin.Stop(); @@ -406,17 +442,23 @@ } void StopServer() { - if (_server == null) - return; + if (_server != null) + { + _server.Dispose(); + _server = null; + } - _server.Dispose(); - _server = null; + if (_registeredClients != null) + { + _registeredClients.Clear(); + _registeredClients = null; + } - _registeredClients.Clear(); - _registeredClients = null; - - _registeredRepeaters.Clear(); - _registeredRepeaters = null; + if (_registeredRepeaters != null) + { + _registeredRepeaters.Clear(); + _registeredRepeaters = null; + } } void CommsFailure(object obj) @@ -473,11 +515,11 @@ } void StopClient() { - if (_client == null) - return; - - _client.Dispose(); - _client = null; + if (_client != null) + { + _client.Dispose(); + _client = null; + } } bool StartRelay() @@ -539,11 +581,16 @@ IrssMessage message = new IrssMessage(MessageType.UnregisterRepeater, MessageFlags.Request); _client.Send(message); } - + } + catch + { + throw; + } + finally + { StopServer(); StopClient(); } - catch { } } void RemoteHandlerCallback(string keyCode) @@ -939,12 +986,12 @@ case MessageType.ForwardRemoteEvent: if (_mode == IRServerMode.RelayMode) { - IrssMessage forward = new IrssMessage(MessageType.ForwardRemoteEvent, MessageFlags.Request, combo.Message.DataAsBytes); + IrssMessage forward = new IrssMessage(MessageType.ForwardRemoteEvent, MessageFlags.Request, combo.Message.GetDataAsBytes()); _client.Send(forward); } else { - IrssMessage forward = new IrssMessage(MessageType.RemoteEvent, MessageFlags.Notify, combo.Message.DataAsBytes); + IrssMessage forward = new IrssMessage(MessageType.RemoteEvent, MessageFlags.Notify, combo.Message.GetDataAsBytes()); SendToAllExcept(combo.Manager, forward); } break; @@ -952,12 +999,12 @@ case MessageType.ForwardKeyboardEvent: if (_mode == IRServerMode.RelayMode) { - IrssMessage forward = new IrssMessage(MessageType.ForwardKeyboardEvent, MessageFlags.Request, combo.Message.DataAsBytes); + IrssMessage forward = new IrssMessage(MessageType.ForwardKeyboardEvent, MessageFlags.Request, combo.Message.GetDataAsBytes()); _client.Send(forward); } else { - IrssMessage forward = new IrssMessage(MessageType.KeyboardEvent, MessageFlags.Notify, combo.Message.DataAsBytes); + IrssMessage forward = new IrssMessage(MessageType.KeyboardEvent, MessageFlags.Notify, combo.Message.GetDataAsBytes()); SendToAllExcept(combo.Manager, forward); } break; @@ -965,12 +1012,12 @@ case MessageType.ForwardMouseEvent: if (_mode == IRServerMode.RelayMode) { - IrssMessage forward = new IrssMessage(MessageType.ForwardMouseEvent, MessageFlags.Request, combo.Message.DataAsBytes); + IrssMessage forward = new IrssMessage(MessageType.ForwardMouseEvent, MessageFlags.Request, combo.Message.GetDataAsBytes()); _client.Send(forward); } else { - IrssMessage forward = new IrssMessage(MessageType.MouseEvent, MessageFlags.Notify, combo.Message.DataAsBytes); + IrssMessage forward = new IrssMessage(MessageType.MouseEvent, MessageFlags.Notify, combo.Message.GetDataAsBytes()); SendToAllExcept(combo.Manager, forward); } break; @@ -988,7 +1035,7 @@ if (_registeredRepeaters.Count > 0) SendToRepeaters(combo.Message); - if (BlastIR(combo.Message.DataAsBytes)) + if (BlastIR(combo.Message.GetDataAsBytes())) response.Flags |= MessageFlags.Success; else response.Flags |= MessageFlags.Failure; @@ -1018,7 +1065,7 @@ { case LearnStatus.Success: response.Flags |= MessageFlags.Success; - response.DataAsBytes = bytes; + response.SetDataAsBytes(bytes); break; case LearnStatus.Failure: @@ -1063,7 +1110,7 @@ irServerInfo.Ports = (_pluginTransmit as ITransmitIR).AvailablePorts; } - response.DataAsBytes = irServerInfo.ToBytes(); + response.SetDataAsBytes(irServerInfo.ToBytes()); response.Flags |= MessageFlags.Success; } else Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -26,11 +26,18 @@ if (Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName).Length != 1) return; } +#if TRACE catch (Exception ex) { - Trace.WriteLine(ex.Message); + Trace.WriteLine(ex.ToString()); return; } +#else + catch + { + return; + } +#endif Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); @@ -42,10 +49,11 @@ Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException); // Start Server - IRServer irServer = new IRServer(); - - if (irServer.Start()) - Application.Run(); + using (IRServer irServer = new IRServer()) + { + if (irServer.Start()) + Application.Run(); + } Application.ThreadException -= new ThreadExceptionEventHandler(Application_ThreadException); @@ -108,11 +116,18 @@ return plugins.ToArray(); } +#if TRACE catch (Exception ex) { Trace.WriteLine(ex.ToString()); return null; } +#else + catch + { + return null; + } +#endif } /// <summary> Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/GetKeyCodeForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/GetKeyCodeForm.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/GetKeyCodeForm.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -61,7 +61,7 @@ { if (received.Type == MessageType.RemoteEvent) { - _keyCode = received.DataAsString; + _keyCode = received.GetDataAsString(); this.Invoke(_keyCodeSet); } Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.Designer.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.Designer.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -573,58 +573,58 @@ this.toolStripSeparator2, this.quitToolStripMenuItem}); this.configurationToolStripMenuItem.Name = "configurationToolStripMenuItem"; - this.configurationToolStripMenuItem.Size = new System.Drawing.Size(37, 20); + this.configurationToolStripMenuItem.Size = new System.Drawing.Size(35, 20); this.configurationToolStripMenuItem.Text = "&File"; // // newToolStripMenuItem // this.newToolStripMenuItem.Name = "newToolStripMenuItem"; - this.newToolStripMenuItem.Size = new System.Drawing.Size(122, 22); + this.newToolStripMenuItem.Size = new System.Drawing.Size(132, 22); this.newToolStripMenuItem.Text = "&New"; this.newToolStripMenuItem.Click += new System.EventHandler(this.newToolStripMenuItem_Click); // // openToolStripMenuItem // this.openToolStripMenuItem.Name = "openToolStripMenuItem"; - this.openToolStripMenuItem.Size = new System.Drawing.Size(122, 22); + this.openToolStripMenuItem.Size = new System.Drawing.Size(132, 22); this.openToolStripMenuItem.Text = "&Open ..."; this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click); // // importToolStripMenuItem // this.importToolStripMenuItem.Name = "importToolStripMenuItem"; - this.importToolStripMenuItem.Size = new System.Drawing.Size(122, 22); + this.importToolStripMenuItem.Size = new System.Drawing.Size(132, 22); this.importToolStripMenuItem.Text = "&Import ..."; this.importToolStripMenuItem.Click += new System.EventHandler(this.importToolStripMenuItem_Click); // // exportToolStripMenuItem // this.exportToolStripMenuItem.Name = "exportToolStripMenuItem"; - this.exportToolStripMenuItem.Size = new System.Drawing.Size(122, 22); + this.exportToolStripMenuItem.Size = new System.Drawing.Size(132, 22); this.exportToolStripMenuItem.Text = "&Export ..."; this.exportToolStripMenuItem.Click += new System.EventHandler(this.exportToolStripMenuItem_Click); // // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(119, 6); + this.toolStripSeparator1.Size = new System.Drawing.Size(129, 6); // // serverToolStripMenuItem // this.serverToolStripMenuItem.Name = "serverToolStripMenuItem"; - this.serverToolStripMenuItem.Size = new System.Drawing.Size(122, 22); + this.serverToolStripMenuItem.Size = new System.Drawing.Size(132, 22); this.serverToolStripMenuItem.Text = "&Server ..."; this.serverToolStripMenuItem.Click += new System.EventHandler(this.serverToolStripMenuItem_Click); // // toolStripSeparator2 // this.toolStripSeparator2.Name = "toolStripSeparator2"; - this.toolStripSeparator2.Size = new System.Drawing.Size(119, 6); + this.toolStripSeparator2.Size = new System.Drawing.Size(129, 6); // // quitToolStripMenuItem // this.quitToolStripMenuItem.Name = "quitToolStripMenuItem"; - this.quitToolStripMenuItem.Size = new System.Drawing.Size(122, 22); + this.quitToolStripMenuItem.Size = new System.Drawing.Size(132, 22); this.quitToolStripMenuItem.Text = "&Quit"; this.quitToolStripMenuItem.Click += new System.EventHandler(this.quitToolStripMenuItem_Click); // @@ -634,20 +634,20 @@ this.translatorHelpToolStripMenuItem, this.aboutToolStripMenuItem}); this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; - this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20); + this.helpToolStripMenuItem.Size = new System.Drawing.Size(40, 20); this.helpToolStripMenuItem.Text = "&Help"; // // translatorHelpToolStripMenuItem // this.translatorHelpToolStripMenuItem.Name = "translatorHelpToolStripMenuItem"; - this.translatorHelpToolStripMenuItem.Size = new System.Drawing.Size(122, 22); + this.translatorHelpToolStripMenuItem.Size = new System.Drawing.Size(129, 22); this.translatorHelpToolStripMenuItem.Text = "&Contents"; this.translatorHelpToolStripMenuItem.Click += new System.EventHandler(this.translatorHelpToolStripMenuItem_Click); // // aboutToolStripMenuItem // this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; - this.aboutToolStripMenuItem.Size = new System.Drawing.Size(122, 22); + this.aboutToolStripMenuItem.Size = new System.Drawing.Size(129, 22); this.aboutToolStripMenuItem.Text = "&About"; this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click); // @@ -679,6 +679,7 @@ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Translator"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing); + this.Load += new System.EventHandler(this.MainForm_Load); this.groupBoxProgram.ResumeLayout(false); this.tabControl.ResumeLayout(false); this.tabPagePrograms.ResumeLayout(false); Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -86,7 +86,7 @@ #region Variables - IrssUtils.Forms.LearnIR _learnIR; + LearnIR _learnIR; #endregion Variables @@ -258,7 +258,7 @@ if (File.Exists(fileName)) { - _learnIR = new IrssUtils.Forms.LearnIR( + _learnIR = new LearnIR( new LearnIrDelegate(Program.LearnIR), new BlastIrDelegate(Program.BlastIR), Program.TransceiverInformation.Ports, @@ -317,13 +317,38 @@ } } + private void MainForm_Load(object sender, EventArgs e) + { + Program.HandleMessage += new ClientMessageSink(ReceivedMessage); + } private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { + Program.HandleMessage -= new ClientMessageSink(ReceivedMessage); + CommitEvents(); Configuration.Save(Program.Config, Program.ConfigFile); } + void ReceivedMessage(IrssMessage received) + { + if (_learnIR != null && received.Type == MessageType.LearnIR) + { + if ((received.Flags & MessageFlags.Success) == MessageFlags.Success) + { + _learnIR.LearnStatus("Learned IR successfully", true); + } + else if ((received.Flags & MessageFlags.Timeout) == MessageFlags.Timeout) + { + _learnIR.LearnStatus("Learn IR timed out", false); + } + else if ((received.Flags & MessageFlags.Failure) == MessageFlags.Failure) + { + _learnIR.LearnStatus("Learn IR failed", false); + } + } + } + protected override void WndProc(ref Message m) { try @@ -600,7 +625,7 @@ private void buttonNewIR_Click(object sender, EventArgs e) { - _learnIR = new IrssUtils.Forms.LearnIR( + _learnIR = new LearnIR( new LearnIrDelegate(Program.LearnIR), new BlastIrDelegate(Program.BlastIR), Program.TransceiverInformation.Ports); @@ -616,7 +641,7 @@ if (listBoxIR.SelectedIndex == -1) return; - _learnIR = new IrssUtils.Forms.LearnIR( + _learnIR = new LearnIR( new LearnIrDelegate(Program.LearnIR), new BlastIrDelegate(Program.BlastIR), Program.TransceiverInformation.Ports, Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.resx =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.resx 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.resx 2007-09-28 16:31:49 UTC (rev 959) @@ -120,9 +120,6 @@ <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>17, 17</value> </metadata> - <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> - <value>17, 17</value> - </metadata> <metadata name="menuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>102, 17</value> </metadata> Modified: trunk/plugins/IR Server Suite/Applications/Translator/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -618,7 +618,7 @@ break; default: - throw new Exception("Unknown action: " + menuItem.Text); + throw new ArgumentException(String.Format("Unknown action: {0}", menuItem.Text), "sender"); } } catch (Exception ex) @@ -740,11 +740,11 @@ } internal static void StopClient() { - if (_client == null) - return; - - _client.Dispose(); - _client = null; + if (_client != null) + { + _client.Dispose(); + _client = null; + } } static void ReceivedMessage(IrssMessage received) @@ -756,24 +756,28 @@ switch (received.Type) { case MessageType.RemoteEvent: - RemoteHandlerCallback(received.DataAsString); + RemoteHandlerCallback(received.GetDataAsString()); break; case MessageType.KeyboardEvent: { - int vKey = BitConverter.ToInt32(received.DataAsBytes, 0); - bool keyUp = BitConverter.ToBoolean(received.DataAsBytes, 4); + byte[] dataBytes = received.GetDataAsBytes(); + int vKey = BitConverter.ToInt32(dataBytes, 0); + bool keyUp = BitConverter.ToBoolean(dataBytes, 4); + KeyboardHandlerCallback(vKey, keyUp); break; } case MessageType.MouseEvent: { - int deltaX = BitConverter.ToInt32(received.DataAsBytes, 0); - int deltaY = BitConverter.ToInt32(received.DataAsBytes, 4); - int buttons = BitConverter.ToInt32(received.DataAsBytes, 8); + byte[] dataBytes = received.GetDataAsBytes(); + int deltaX = BitConverter.ToInt32(dataBytes, 0); + int deltaY = BitConverter.ToInt32(dataBytes, 4); + int buttons = BitConverter.ToInt32(dataBytes, 8); + MouseHandlerCallback(deltaX, deltaY, buttons); break; } @@ -788,7 +792,7 @@ case MessageType.RegisterClient: if ((received.Flags & MessageFlags.Success) == MessageFlags.Success) { - _irServerInfo = IRServerInfo.FromBytes(received.DataAsBytes); + _irServerInfo = IRServerInfo.FromBytes(received.GetDataAsBytes()); _registered = true; IrssLog.Info("Registered to IR Server"); @@ -805,7 +809,7 @@ { IrssLog.Info("Learned IR Successfully"); - byte[] dataBytes = received.DataAsBytes; + byte[] dataBytes = received.GetDataAsBytes(); using (FileStream file = File.Create(_learnIRFilename)) file.Write(dataBytes, 0, dataBytes.Length); @@ -833,7 +837,7 @@ case MessageType.Error: _learnIRFilename = null; - IrssLog.Error("Received error: {0}", received.DataAsString); + IrssLog.Error("Received error: {0}", received.GetDataAsString()); break; } @@ -1027,7 +1031,7 @@ doc.Load(fileName); if (doc.DocumentElement.InnerText.Contains(Common.XmlTagBlast) && !_registered) - throw new Exception("Cannot process Macro with Blast commands when not registered to an active IR Server"); + throw new ApplicationException("Cannot process Macro with Blast commands when not registered to an active IR Server"); XmlNodeList commandSequence = doc.DocumentElement.SelectNodes("action"); string commandProperty; @@ -1171,7 +1175,7 @@ internal static void BlastIR(string fileName, string port) { if (!_registered) - throw new Exception("Cannot Blast, not registered to an active IR Server"); + throw new ApplicationException("Cannot Blast, not registered to an active IR Server"); using (FileStream file = File.OpenRead(fileName)) { Modified: trunk/plugins/IR Server Suite/Applications/Tray Launcher/GetKeyCodeForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Tray Launcher/GetKeyCodeForm.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Applications/Tray Launcher/GetKeyCodeForm.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -60,7 +60,7 @@ { if (received.Type == MessageType.RemoteEvent) { - _keyCode = received.DataAsString; + _keyCode = received.GetDataAsString(); this.Invoke(_keyCodeSet); } Modified: trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -323,7 +323,7 @@ break; case MessageType.RemoteEvent: - RemoteHandlerCallback(received.DataAsString); + RemoteHandlerCallback(received.GetDataAsString()); break; case MessageType.ServerShutdown: @@ -332,7 +332,7 @@ break; case MessageType.Error: - IrssLog.Error("Received error: {0}", received.DataAsString); + IrssLog.Error("Received error: {0}", received.GetDataAsString()); break; } Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -176,7 +176,7 @@ Program.RemoteSkin = skin; } else - throw new Exception(String.Format("Failed to load skin file not found \"{0}\"", xmlFile)); + throw new FileNotFoundException("Failed to load skin, file not found", xmlFile); } catch (Exception ex) { Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -354,7 +354,7 @@ break; case MessageType.Error: - IrssLog.Error(received.DataAsString); + IrssLog.Error(received.GetDataAsString()); break; } } Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -581,7 +581,7 @@ { case MessageType.RemoteEvent: if (listViewButtons.SelectedItems.Count == 1) - listViewButtons.SelectedItems[0].SubItems[1].Text = received.DataAsString; + listViewButtons.SelectedItems[0].SubItems[1].Text = received.GetDataAsString(); return; case MessageType.RegisterClient: @@ -603,7 +603,7 @@ return; case MessageType.Error: - MessageBox.Show(this, received.DataAsString, "Virtual Remote Skin Editor Error from Server", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show(this, received.GetDataAsString(), "Virtual Remote Skin Editor Error from Server", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } Modified: trunk/plugins/IR Server Suite/Common/IrssComms/Client.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssComms/Client.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Common/IrssComms/Client.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -25,8 +25,8 @@ #region Variables - IPEndPoint _serverEndPoint; - Socket _serverSocket = null; + IPEndPoint _serverEndpoint; + Socket _serverSocket; volatile bool _processConnectionThread = false; volatile bool _connected = false; @@ -35,9 +35,9 @@ ClientMessageSink _messageSink; - WaitCallback _connectCallback = null; - WaitCallback _disconnectCallback = null; - WaitCallback _commsFailureCallback = null; + WaitCallback _connectCallback; + WaitCallback _disconnectCallback; + WaitCallback _commsFailureCallback; #endregion Variables @@ -88,7 +88,7 @@ /// <param name="serverEndPoint">IP Address and Port combination of Server.</param> public Client(IPEndPoint serverEndPoint, ClientMessageSink messageSink) { - _serverEndPoint = serverEndPoint; + _serverEndpoint = serverEndPoint; _messageSink = messageSink; @@ -105,13 +105,12 @@ GC.SuppressFinalize(this); } - protected virtual void Dispose(bool disposing) + protected virtual void Dispose(bool disposeManagedResources) { - if (disposing) + if (disposeManagedResources) { // Dispose managed resources ... - if (_processConnectionThread) - Stop(); + Stop(); _messageQueue.Dispose(); } @@ -238,7 +237,7 @@ { try { - _serverSocket.Connect(_serverEndPoint); + _serverSocket.Connect(_serverEndpoint); break; } catch (SocketException socketException) @@ -290,8 +289,8 @@ // Read data from socket ... while (_processConnectionThread) { - bytesRead = _serverSocket.Receive(buffer, 4, SocketFlags.None); - if (bytesRead == 0) + bytesRead = _serverSocket.Receive(buffer, buffer.Length, SocketFlags.None); + if (bytesRead != buffer.Length) break; int readSize = BitConverter.ToInt32(buffer, 0); @@ -299,12 +298,11 @@ byte[] packet = new byte[readSize]; - bytesRead = _serverSocket.Receive(packet, readSize, SocketFlags.None); - if (bytesRead == 0) + bytesRead = _serverSocket.Receive(packet, packet.Length, SocketFlags.None); + if (bytesRead != packet.Length) break; IrssMessage message = IrssMessage.FromBytes(packet); - _messageQueue.Enqueue(message); } Modified: trunk/plugins/IR Server Suite/Common/IrssComms/ClientManager.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssComms/ClientManager.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Common/IrssComms/ClientManager.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -12,7 +12,7 @@ /// <summary> /// Manages Server socket connections. /// </summary> - public class ClientManager + public class ClientManager : IDisposable { #region Variables @@ -36,6 +36,28 @@ #endregion Constructor + #region IDisposable + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposeManagedResources) + { + if (disposeManagedResources) + { + // Dispose managed resources ... + Stop(); + } + + // Free native resources ... + + } + + #endregion IDisposable + #region Implementation internal void Start() @@ -59,6 +81,7 @@ _processReceiveThread = false; _connection.Close(); + _connection = null; //_receiveThread.Abort(); //_receiveThread.Join(); @@ -89,8 +112,8 @@ while (_processReceiveThread) { - bytesRead = _connection.Receive(buffer, 4, SocketFlags.None); - if (bytesRead == 0) + bytesRead = _connection.Receive(buffer, buffer.Length, SocketFlags.None); + if (bytesRead != buffer.Length) break; // TODO: Inform server to remove clientmanager from list? (Low) int readSize = BitConverter.ToInt32(buffer, 0); @@ -98,8 +121,8 @@ byte[] packet = new byte[readSize]; - bytesRead = _connection.Receive(packet, readSize, SocketFlags.None); - if (bytesRead == 0) + bytesRead = _connection.Receive(packet, packet.Length, SocketFlags.None); + if (bytesRead != packet.Length) break; IrssMessage message = IrssMessage.FromBytes(packet); @@ -107,10 +130,16 @@ _messageSink(combo); } } +#if TRACE catch (SocketException socketException) { Trace.WriteLine(socketException.ToString()); } +#else + catch (SocketException) + { + } +#endif } #endregion Implementation Modified: trunk/plugins/IR Server Suite/Common/IrssComms/GenericPCQueue.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssComms/GenericPCQueue.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Common/IrssComms/GenericPCQueue.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -66,13 +66,12 @@ GC.SuppressFinalize(this); } - protected virtual void Dispose(bool disposing) + protected virtual void Dispose(bool disposeManagedResources) { - if (disposing) + if (disposeManagedResources) { // Dispose managed resources ... - if (_processQueue) - Stop(); + Stop(); _workerThread = null; @@ -82,6 +81,7 @@ _queueLock = null; _queueWaitHandle.Close(); + _queueWaitHandle = null; } // Free native resources ... @@ -142,9 +142,11 @@ throw new ArgumentNullException("obj"); lock (_queueLock) + { _queue.Enqueue(obj); - _queueWaitHandle.Set(); + _queueWaitHandle.Set(); + } } /// <summary> @@ -166,12 +168,10 @@ try { T obj = default(T); - bool didDequeue; + bool didDequeue = false; while (_processQueue) { - didDequeue = false; - lock (_queueLock) { if (_queue.Count > 0) @@ -182,15 +182,27 @@ } if (didDequeue) + { _sink(obj); + obj = default(T); + didDequeue = false; + } else + { _queueWaitHandle.WaitOne(); + } } } +#if TRACE catch (ThreadAbortException threadAbortException) { Trace.WriteLine(threadAbortException.ToString()); } +#else + catch (ThreadAbortException) + { + } +#endif } #endregion Implementation Modified: trunk/plugins/IR Server Suite/Common/IrssComms/IrssMessage.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssComms/IrssMessage.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Common/IrssComms/IrssMessage.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -93,36 +93,6 @@ set { _flags = value; } } - /// <summary> - /// Message data as bytes. - /// </summary> - public byte[] DataAsBytes - { - get { return _data; } - set { _data = value; } - } - - /// <summary> - /// Message data as string. - /// </summary> - public string DataAsString - { - get - { - if (_data == null) - return String.Empty; - else - return Encoding.ASCII.GetString(_data); - } - set - { - if (String.IsNullOrEmpty(value)) - _data = null; - else - _data = Encoding.ASCII.GetBytes(value); - } - } - #endregion Properties #region Constructors @@ -144,13 +114,13 @@ public IrssMessage(MessageType type, MessageFlags flags, byte[] data) : this(type, flags) { - _data = data; + SetDataAsBytes(data); } public IrssMessage(MessageType type, MessageFlags flags, string data) : this(type, flags) { - _data = Encoding.ASCII.GetBytes(data); + SetDataAsString(data); } #endregion Constructors @@ -158,6 +128,47 @@ #region Implementation /// <summary> + /// Get message data as bytes. + /// </summary> + public byte[] GetDataAsBytes() + { + return _data; + } + + /// <summary> + /// Set message data as bytes. + /// </summary> + public void SetDataAsBytes(byte[] data) + { + if (data == null) + _data = null; + else + _data = (byte[])data.Clone(); + } + + /// <summary> + /// Get message data as string. + /// </summary> + public string GetDataAsString() + { + if (_data == null) + return String.Empty; + else + return Encoding.ASCII.GetString(_data); + } + + /// <summary> + /// Set message data as string. + /// </summary> + public void SetDataAsString(string data) + { + if (String.IsNullOrEmpty(data)) + _data = null; + else + _data = Encoding.ASCII.GetBytes(data); + } + + /// <summary> /// Turn this Message instance into a byte array. /// </summary> /// <returns>Byte array representation of this Message instance.</returns> Modified: trunk/plugins/IR Server Suite/Common/IrssComms/MessageManagerCombo.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssComms/MessageManagerCombo.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Common/IrssComms/MessageManagerCombo.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -6,7 +6,7 @@ /// <summary> /// Encapsulates an IrssMessage and a ClientManager object instance for queueing. /// </summary> - public struct MessageManagerCombo : IEquatable<MessageManagerCombo> + public class MessageManagerCombo : IEquatable<MessageManagerCombo> { #region Variables @@ -53,6 +53,8 @@ #endregion Properties + #region IEquatable<MessageManagerCombo> Members + /// <summary> /// Indicates whether the current object is equal to another object of the same type. /// </summary> @@ -105,6 +107,8 @@ return _message.GetHashCode() + _manager.GetHashCode(); } + #endregion + } } Modified: trunk/plugins/IR Server Suite/Common/IrssComms/Server.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssComms/Server.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Common/IrssComms/Server.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -81,13 +81,12 @@ GC.SuppressFinalize(this); } - protected virtual void Dispose(bool disposing) + protected virtual void Dispose(bool disposeManagedResources) { - if (disposing) + if (disposeManagedResources) { // Dispose managed resources ... - if (_processConnectionThread) - Stop(); + Stop(); _messageQueue.Dispose(); } @@ -177,7 +176,7 @@ lock (_clientManagers) { foreach (ClientManager manager in _clientManagers) - manager.Stop(); + manager.Dispose(); _clientManagers.Clear(); _clientManagers = null; @@ -239,10 +238,16 @@ manager.Start(); } } +#if TRACE catch (SocketException socketException) { - Trace.Write(socketException.ToString()); + Trace.WriteLine(socketException.ToString()); } +#else + catch (SocketException) + { + } +#endif } #endregion Implementation Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -193,6 +193,8 @@ #region Command Segments + public static readonly char[] SegmentSeparator = new char[] { '|' }; + public const int SegmentsBlastCommand = 2; public const int SegmentsRunCommand = 8; public const int SegmentsSerialCommand = 7; @@ -273,7 +275,7 @@ if (String.IsNullOrEmpty(command)) throw new ArgumentNullException("command"); - string[] commands = command.Split(new char[] { '|' }, StringSplitOptions.None); + string[] commands = command.Split(SegmentSeparator, StringSplitOptions.None); if (commands.Length != elements) throw new ArgumentException(String.Format("Command structure is invalid: {0}", command), "command"); @@ -291,6 +293,9 @@ /// <param name="command">An array of arguments for the method (the output of SplitRunCommand).</param> public static void ProcessRunCommand(string[] commands) { + if (commands == null) + throw new ArgumentNullException("commands"); + Process process = new Process(); process.StartInfo.FileName = commands[0]; process.StartInfo.WorkingDirectory = commands[1]; @@ -333,6 +338,9 @@ /// <param name="commands">An array of arguments for the method (the output of SplitSerialCommand).</param> public static void ProcessSerialCommand(string[] commands) { + if (commands == null) + throw new ArgumentNullException("commands"); + string command = Common.ReplaceEscapeCodes(commands[0]); string comPort = commands[1]; @@ -369,6 +377,9 @@ /// <param name="commands">An array of arguments for the method (the output of SplitWindowMessageCommand).</param> public static void ProcessWindowMessageCommand(string[] commands) { + if (commands == null) + throw new ArgumentNullException("commands"); + IntPtr windowHandle = IntPtr.Zero; string matchType = commands[0].ToLowerInvariant(); @@ -425,6 +436,9 @@ /// <param name="command">The keystrokes to send.</param> public static void ProcessKeyCommand(string command) { + if (String.IsNullOrEmpty(command)) + throw new ArgumentNullException("command"); + SendKeys.SendWait(command); } @@ -434,6 +448,9 @@ /// <param name="commands">An array of arguments for the method (the output of SplitTcpMessageCommand).</param> public static void ProcessTcpMessageCommand(string[] commands) { + if (commands == null) + throw new ArgumentNullException("commands"); + using (TcpClient tcpClient = new TcpClient()) { tcpClient.Connect(commands[0], int.Parse(commands[1])); @@ -457,6 +474,9 @@ /// <param name="command">The Mouse Command string.</param> public static void ProcessMouseCommand(string command) { + if (String.IsNullOrEmpty(command)) + throw new ArgumentNullException("command"); + switch (command) { case MouseClickLeft: @@ -503,6 +523,9 @@ /// <param name="command">The drive letter of the CD-ROM drive to eject the tray on.</param> public static void ProcessEjectCommand(string command) { + if (String.IsNullOrEmpty(command)) + throw new ArgumentNullException("command"); + if (CDRom.IsCDRom(command)) CDRom.Open(command); } Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/IrssLog.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/IrssLog.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/IrssLog.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -70,10 +70,16 @@ File.Move(fileName, backup); } +#if TRACE catch (Exception ex) { - Trace.WriteLine(ex.Message); + Trace.WriteLine(ex.ToString()); } +#else + catch + { + } +#endif } try @@ -84,10 +90,16 @@ string message = DateTime.Now.ToString() + ":\tLog Opened"; _streamWriter.WriteLine(message); } +#if TRACE catch (Exception ex) { - Trace.WriteLine(ex.Message); + Trace.WriteLine(ex.ToString()); } +#else + catch + { + } +#endif } } @@ -109,12 +121,18 @@ File.Delete(backup); File.Move(fileName, backup); - } + } } +#if TRACE catch (Exception ex) { - Trace.WriteLine(ex.Message); + Trace.WriteLine(ex.ToString()); } +#else + catch + { + } +#endif try { @@ -124,10 +142,16 @@ string message = DateTime.Now.ToString() + ":\tLog Opened"; _streamWriter.WriteLine(message); } +#if TRACE catch (Exception ex) { - Trace.WriteLine(ex.Message); + Trace.WriteLine(ex.ToString()); } +#else + catch + { + } +#endif } } Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/SystemRegistry.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/SystemRegistry.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/SystemRegistry.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -17,6 +17,8 @@ #endregion Constants + #region Methods + /// <summary> /// Get the install folder for IR Server Suite. /// </summary> @@ -37,6 +39,9 @@ /// <returns>If key of name exists return true else return false.</returns> public static bool GetAutoRun(string name) { + if (String.IsNullOrEmpty(name)) + throw new ArgumentNullException("name"); + RegistryKey key = Registry.CurrentUser.CreateSubKey(AutoRunPath); bool autoRun = (key.GetValue(name, null) != null); key.Close(); @@ -51,6 +56,12 @@ /// <param name="executablePath">Executable Path for program.</param> public static void SetAutoRun(string name, string executablePath) { + if (String.IsNullOrEmpty(name)) + throw new ArgumentNullException("name"); + + if (String.IsNullOrEmpty(executablePath)) + throw new ArgumentNullException("executablePath"); + RegistryKey key = Registry.CurrentUser.CreateSubKey(AutoRunPath); key.SetValue(name, executablePath, RegistryValueKind.String); key.Close(); @@ -62,11 +73,16 @@ /// <param name="name">Auto-run program name.</param> public static void RemoveAutoRun(string name) { + if (String.IsNullOrEmpty(name)) + throw new ArgumentNullException("name"); + RegistryKey key = Registry.CurrentUser.CreateSubKey(AutoRunPath); key.DeleteValue(name, false); key.Close(); } - + + #endregion Methods + } } Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Win32.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Win32.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Win32.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -364,6 +364,12 @@ #region Delegates + /// <summary> + /// Delegate for enumerating open Windows with EnumWindows method. + /// </summary> + /// <param name="hWnd">Window Handle.</param> + /// <param name="lParam">lParam.</param> + /// <returns>Success.</returns> public delegate bool EnumWindowsProc(IntPtr hWnd, int lParam); #endregion Delegates @@ -640,9 +646,9 @@ /// </summary> /// <param name="o">Object to get pointer for.</param> /// <returns>Pointer to object.</returns> - public static IntPtr VarPtr(object o) + public static IntPtr VarPtr(object obj) { - GCHandle handle = GCHandle.Alloc(o, GCHandleType.Pinned); + GCHandle handle = GCHandle.Alloc(obj, GCHandleType.Pinned); IntPtr ptr = handle.AddrOfPinnedObject(); handle.Free(); return ptr; Modified: trunk/plugins/IR Server Suite/Common/MPUtils/MPCommands.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/MPUtils/MPCommands.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/Common/MPUtils/MPCommands.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -27,7 +27,7 @@ { GUIDialogNotify dlgNotify = (GUIDialogNotify)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_NOTIFY); if (dlgNotify == null) - throw new Exception("Failed to create GUIDialogNotify"); + throw new ApplicationException("Failed to create GUIDialogNotify"); dlgNotify.Reset(); dlgNotify.ClearAll(); @@ -44,6 +44,9 @@ /// <param name="useBasicHome">Use the basic home screen when home is requested.</param> public static void ProcessGoTo(string screen, bool useBasicHome) { + if (String.IsNullOrEmpty(screen)) + throw new ArgumentNullException("screen"); + int window = (int)GUIWindow.Window.WINDOW_INVALID; try @@ -66,7 +69,7 @@ } if (window == (int)GUIWindow.Window.WINDOW_INVALID) - throw new Exception(String.Format("Failed to parse Goto command window id \"{0}\"", screen)); + throw new ArgumentException(String.Format("Failed to parse Goto command window id \"{0}\"", screen), "screen"); if (window == (int)GUIWindow.Window.WINDOW_HOME && useBasicHome) window = (int)GUIWindow.Window.WINDOW_SECOND_HOME; Modified: trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -214,11 +214,18 @@ return true; } +#if TRACE catch (Exception ex) { - Trace.WriteLine(ex.Message); + Trace.WriteLine(ex.ToString()); return false; } +#else + catch + { + return false; + } +#endif } public override void Suspend() { @@ -261,7 +268,7 @@ string devicePath = FindDevice(hidGuid, DeviceID); if (devicePath == null) - throw new Exception("No device detected"); + throw new ApplicationException("No device detected"); SafeFileHandle deviceHandle = CreateFile(devicePath, GENERIC_READ, EFileShares.Read | EFileShares.Write, IntPtr.Zero, ECreationDisposition.OpenExisting, EFileAttributes.Overlapped, IntPtr.Zero); int lastError = Marshal.GetLastWin32Error(); @@ -381,10 +388,16 @@ if (_deviceStream != null) _deviceStream.BeginRead(_deviceBuffer, 0, _deviceBuffer.Length, new AsyncCallback(OnReadComplete), null); } +#if TRACE catch (Exception ex) { Trace.WriteLine(ex.ToString()); } +#else + catch + { + } +#endif } #endregion Implementation Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IRServerPluginInterface.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IRServerPluginInterface.cs 2007-09-28 15:23:09 UTC (rev 958) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IRServerPluginInterface.cs 2007-09-28 16:31:49 UTC (rev 959) @@ -50,6 +50,9 @@ #endregion Enumerations + /// <summary> + /// Base cla... [truncated message content] |
From: <rs...@us...> - 2007-09-28 15:23:19
|
Revision: 958 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=958&view=rev Author: rsparey Date: 2007-09-28 08:23:09 -0700 (Fri, 28 Sep 2007) Log Message: ----------- Updating views to try and please more people... ie list view made bigger... film strip more icons... mid strip only visible when needed.... Modified Paths: -------------- trunk/skins/Foofaraw/Development Skin/Foofaraw/myHome.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicgenres.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicsongs.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/myradioguide.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/mytvguide.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/mytvhome.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/mytvrecordedtv.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/mytvrecordedtvchannel.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/mytvrecordedtvgenre.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/mytvsearch.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/release notes.xml Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/myHome.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/myHome.xml 2007-09-26 22:16:15 UTC (rev 957) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/myHome.xml 2007-09-28 15:23:09 UTC (rev 958) @@ -41,6 +41,7 @@ <onright>50</onright> <onup>10</onup> <ondown>50</ondown> + </control> <control> <description>Back button</description> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicgenres.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicgenres.xml 2007-09-26 22:16:15 UTC (rev 957) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicgenres.xml 2007-09-28 15:23:09 UTC (rev 958) @@ -3,9 +3,8 @@ <id>504</id> <defaultcontrol>2</defaultcontrol> <allowoverlay>yes</allowoverlay> - <define>#header.label:#view</define> - <define>#header.image:music_logo.png</define> - <define>#header.hover:hover_my music.png</define> + <define>#header.label:134</define> + <controls> <control> <description>BG</description> @@ -65,29 +64,11 @@ <animation effect="slide" time="1000" delay="2000" start="-600,0" end="0,0" acceleration="-1">WindowOpen</animation> <animation effect="fade" time="500" start="50">WindowClose</animation> </control> - <control> + + + +<control> <type>image</type> - <decription>mid_strip</decription> - <id>1</id> - <posX>-12</posX> - <posY>186</posY> - <width>1390</width> - <height>365</height> - <texture>mid_strip.png</texture> - - </control> - <control> - <type>image</type> - <decription>bottom_strip</decription> - <id>1</id> - <posX>-12</posX> - <posY>547</posY> - <width>1390</width> - <height>18</height> - <texture>bottom_strip.png</texture> - - </control> <control> - <type>image</type> <decription>top-strip</decription> <id>1</id> <posX>12</posX> @@ -97,23 +78,8 @@ <texture>top-strip.png</texture> </control> - - <control> - <description>Selected item Label</description> - <type>fadelabel</type> - <id>1</id> - <animation effect="fade" time="400">WindowClose</animation> - <animation effect="fade" time="400">WindowOpen</animation> - <posX>250</posX> - <posY>600</posY> - <width>1000</width> - <label>#selecteditem</label> - <font>wipeout</font> - <align>Left</align> - <textcolor>ffffffff</textcolor> - </control> - + <control> <description>View-As button</description> <type>button</type> @@ -176,7 +142,7 @@ <width>209</width> <height>36</height> <onleft>3</onleft> - <onright>7</onright> + <onright>8</onright> <onup>21</onup> <ondown>50</ondown> <textureFocus>tab_down.png</textureFocus> @@ -186,7 +152,7 @@ <control> <description>Search Button</description> <type>button</type> - <id>7</id> + <id>8</id> <animation effect="fade" time="400">WindowClose</animation> <animation effect="fade" time="400">WindowOpen</animation> <posY>100</posY> @@ -196,7 +162,7 @@ <width>209</width> <height>36</height> <onleft>6</onleft> - <onright>8</onright> + <onright>9</onright> <onup>21</onup> <ondown>50</ondown> <textureFocus>tab_down.png</textureFocus> @@ -204,19 +170,19 @@ <textcolor>white</textcolor> </control> <control> - <description>Play CD</description> + <description>Playingnow</description> <type>button</type> - <id>8</id> + <id>9</id> <animation effect="fade" time="400">WindowClose</animation> <animation effect="fade" time="400">WindowOpen</animation> - + <hyperlink>510</hyperlink> + <label>100510</label> <posY>100</posY> <posX>848</posX> - <label>890</label> <font>font14</font> <width>209</width> <height>36</height> - <onleft>7</onleft> + <onleft>8</onleft> <onright>10</onright> <onup>21</onup> <ondown>50</ondown> @@ -238,7 +204,7 @@ <ondown>99</ondown> <width>209</width> <height>36</height> - <onleft>8</onleft> + <onleft>9</onleft> <onright>2</onright> <onup>21</onup> <ondown>11</ondown> @@ -246,17 +212,69 @@ <textureNoFocus>tab_up.png</textureNoFocus> <textcolor>white</textcolor> </control> - <control> - <type>group</type> - <description>group element</description> - <animation effect="fade" time="200">WindowOpen</animation> - <animation effect="fade" time="200">WindowClose</animation> - <control> - <description>composite control consisting of a list control and a thumbnail panel</description> - <type>facadeview</type> - <id>50</id> - - <control> + + <control> + <type>image</type> + <id>1</id> + <posX>165</posX> + <posY>170</posY> + <width>280</width> + <height>280</height> + <texture flipY="true" diffuse="Thumb_Mask.png">cd_art.png</texture> + <visible>facadeview.list</visible> + <animation effect="fade" time="250">visiblechange</animation> + </control> + <control> + <id>1</id> + <type>image</type> + <posX>165</posX> + <posY>170</posY> + <width>280</width> + <height>280</height> + <texture flipY="true" diffuse="Thumb_Mask.png">#selectedthumb</texture> + <visible>facadeview.list</visible> + <animation effect="fade" time="250">visiblechange</animation> + </control> + <control> + <type>image</type> + <id>1</id> + <posX>112</posX> + <posY>150</posY> + <width>360</width> + <height>308</height> + <texture flipY="true" diffuse="Thumb_Mask.png">cd_box.png</texture> + <visible>facadeview.list</visible> + <animation effect="fade" time="250">visiblechange</animation> + </control> + + <control> + <description>Selected item Label</description> + <type>fadelabel</type> + <id>1</id> + <animation effect="fade" time="400">WindowClose</animation> + <animation effect="fade" time="400">WindowOpen</animation> + <posX>240</posX> + <posY>650</posY> + <width>1000</width> + <label>#selecteditem</label> + <font>wipeout</font> + <align>Left</align> + <textcolor>ffffffff</textcolor> + </control> + + <control> + <type>group</type> + <animation effect="fade" time="400">WindowClose</animation> + <animation effect="fade" time="400">WindowOpen</animation> + <description>group element</description> + <layout>StackLayout</layout> + <posX>60</posX> + <posY>97</posY> + <control> + <description>composite control consisting of a list control and a thumbnail panel</description> + <type>facadeview</type> + <id>50</id> + <control> <description>listcontrol</description> <type>listcontrol</type> <id>50</id> @@ -264,14 +282,14 @@ <onright>2</onright> <onup>2</onup> <ondown>50</ondown> - <posX>30</posX> - <posY>200</posY> - <width>1306</width> - <height>330</height> + <posX>542</posX> + <posY>160</posY> + <width>800</width> + <height>520</height> <spinWidth>27</spinWidth> <spinHeight>27</spinHeight> <spinPosX>1240</spinPosX> - <spinPosY>515</spinPosY> + <spinPosY>650</spinPosY> <spinColor>ffffffff</spinColor> <textureUp>arrow_round_up_nofocus.png</textureUp> <textureDown>arrow_round_down_nofocus.png</textureDown> @@ -300,7 +318,10 @@ <IconXOff>24</IconXOff> <IconYOff>9</IconYOff> <suffix>|</suffix> - </control> + + </control> + + <control> <description>Thumbnail Panel</description> <type>thumbnailpanel</type> @@ -310,18 +331,18 @@ <onup>2</onup> <ondown>50</ondown> <posX>30</posX> - <posY>198</posY> + <posY>140</posY> <width>1316</width> - <height>350</height> + <height>480</height> <spinWidth>27</spinWidth> <spinHeight>27</spinHeight> - <spinPosX>1240</spinPosX> - <spinPosY>515</spinPosY> + <spinPosX>1240</spinPosX> + <spinPosY>650</spinPosY> <spinColor>ffffffff</spinColor> - <textureUp>arrow_round_up_nofocus.png</textureUp> - <textureDown>arrow_round_down_nofocus.png</textureDown> - <textureUpFocus>arrow_round_up_focus.png</textureUpFocus> - <textureDownFocus>arrow_round_down_focus.png</textureDownFocus> + <textureUp>arrow_round_right_nofocus.png</textureUp> + <textureDown>arrow_round_left_nofocus.png</textureDown> + <textureUpFocus>arrow_round_right_focus.png</textureUpFocus> + <textureDownFocus>arrow_round_left_focus.png</textureDownFocus> <itemWidth>80</itemWidth> <itemHeight>60</itemHeight> <textureWidth>80</textureWidth> @@ -367,27 +388,27 @@ <onright>2</onright> <onup>2</onup> <ondown>50</ondown> - <posX>25</posX> - <posY>260</posY> - <width>1360</width> + <posX>60</posX> + <posY>220</posY> + <width>1400</width> <height>400</height> <spinWidth>27</spinWidth> <spinHeight>27</spinHeight> <spinPosX>1240</spinPosX> <spinPosY>515</spinPosY> <spinColor>ffffffff</spinColor> - <textureUp>arrow_round_up_nofocus.png</textureUp> - <textureDown>arrow_round_down_nofocus.png</textureDown> - <textureUpFocus>arrow_round_up_focus.png</textureUpFocus> - <textureDownFocus>arrow_round_down_focus.png</textureDownFocus> - <itemWidth>120</itemWidth> - <itemHeight>100</itemHeight> - <textureWidth>220</textureWidth> - <textureHeight>100</textureHeight> - <thumbWidth>101</thumbWidth> - <thumbHeight>101</thumbHeight> - <thumbPosX>15</thumbPosX><!-- 10 --> - <thumbPosY>1</thumbPosY><!-- 10 --> + <textureUp>arrow_round_right_nofocus.png</textureUp> + <textureDown>arrow_round_left_nofocus.png</textureDown> + <textureUpFocus>arrow_round_right_focus.png</textureUpFocus> + <textureDownFocus>arrow_round_left_focus.png</textureDownFocus> + <itemWidth>240</itemWidth> + <itemHeight>200</itemHeight> + <textureWidth>440</textureWidth> + <textureHeight>200</textureHeight> + <thumbWidth>202</thumbWidth> + <thumbHeight>202</thumbHeight> + <thumbPosX>38</thumbPosX><!-- 10 --> + <thumbPosY>14</thumbPosY><!-- 10 --> <imageFolder>cd_box.png</imageFolder> <imageFolderFocus>cd_box.png</imageFolderFocus> <keepaspectratio>no</keepaspectratio> @@ -399,17 +420,17 @@ <remoteColor>ffFFA075</remoteColor> <downloadColor>ff80ff80</downloadColor> <suffix>|</suffix> - <textureWidthBig>100</textureWidthBig> - <textureHeightBig>100</textureHeightBig> - <itemWidthBig>100</itemWidthBig> - <itemHeightBig>84</itemHeightBig> - <thumbWidthBig>84</thumbWidthBig> - <thumbHeightBig>100</thumbHeightBig> + <textureWidthBig>200</textureWidthBig> + <textureHeightBig>200</textureHeightBig> + <itemWidthBig>200</itemWidthBig> + <itemHeightBig>168</itemHeightBig> + <thumbWidthBig>168</thumbWidthBig> + <thumbHeightBig>200</thumbHeightBig> <thumbPosXBig>0</thumbPosXBig> <thumbPosYBig>0</thumbPosYBig> <background>-</background> - <backgroundx>130</backgroundx> - <backgroundy>130</backgroundy> + <backgroundx>260</backgroundx> + <backgroundy>260</backgroundy> <backgroundwidth>320</backgroundwidth> <backgroundheight>320</backgroundheight> <backgrounddiffuse>60ffffff</backgrounddiffuse> @@ -421,8 +442,8 @@ <InfoImagediffuse>ffffffff</InfoImagediffuse> - <textureWidth>120</textureWidth> - <textureHeight>105</textureHeight> + <textureWidth>253</textureWidth> + <textureHeight>218</textureHeight> <showFolder>yes</showFolder> <showBackGround>no</showBackGround> @@ -438,10 +459,23 @@ <animation effect="fade" time="500">delay="1300">WindowOpen</animation> - </control> - </control> + </control> + </control> + <control> + <description>Number of Files Label</description> + <type>label</type> + <id>1</id> + <posX>1200</posX> + <posY>650</posY> + <label>#itemcount</label> + <align>right</align> + <textcolor>White</textcolor> + <font>font1</font> + <animation effect="fade" time="200">WindowOpen</animation> + <animation effect="fade" time="200">WindowClose</animation> </control> + <control> <description> playlist</description> @@ -449,7 +483,7 @@ <id>11</id> <animation effect="fade" time="400">WindowClose</animation> <animation effect="fade" time="400">WindowOpen</animation> - <posY>194</posY> + <posY>136</posY> <posX>1057</posX> <hyperlink>500</hyperlink> <label>136</label> @@ -467,17 +501,17 @@ <animation effect="slide" start="0,-36" end="0,0" time="250">visiblechange</animation> </control> <control> - <description> playing now</description> + <description> playing cd</description> <type>button</type> <id>12</id> <animation effect="fade" time="400">WindowClose</animation> <animation effect="fade" time="400">WindowOpen</animation> - <posY>230</posY> + <posY>172</posY> <posX>1057</posX> - <hyperlink>510</hyperlink> - <label>100510</label> + <label>890</label> <font>font14</font> + <action>100</action> <width>209</width> <height>36</height> <onleft>8</onleft> @@ -490,5 +524,5 @@ <animation effect="fade" time="250">visiblechange</animation> <animation effect="slide" start="0,-72" end="0,0" time="250">visiblechange</animation> </control> - </controls> + </controls> </window> \ No newline at end of file Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicsongs.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicsongs.xml 2007-09-26 22:16:15 UTC (rev 957) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicsongs.xml 2007-09-28 15:23:09 UTC (rev 958) @@ -142,7 +142,7 @@ <width>209</width> <height>36</height> <onleft>3</onleft> - <onright>7</onright> + <onright>8</onright> <onup>21</onup> <ondown>50</ondown> <textureFocus>tab_down.png</textureFocus> @@ -152,7 +152,7 @@ <control> <description>Search Button</description> <type>button</type> - <id>7</id> + <id>8</id> <animation effect="fade" time="400">WindowClose</animation> <animation effect="fade" time="400">WindowOpen</animation> <posY>100</posY> @@ -182,7 +182,7 @@ <font>font14</font> <width>209</width> <height>36</height> - <onleft>7</onleft> + <onleft>8</onleft> <onright>10</onright> <onup>21</onup> <ondown>50</ondown> @@ -333,7 +333,7 @@ <posX>30</posX> <posY>140</posY> <width>1316</width> - <height>525</height> + <height>480</height> <spinWidth>27</spinWidth> <spinHeight>27</spinHeight> <spinPosX>1240</spinPosX> @@ -511,6 +511,7 @@ <posX>1057</posX> <label>890</label> <font>font14</font> + <action>100</action> <width>209</width> <height>36</height> <onleft>8</onleft> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/myradioguide.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/myradioguide.xml 2007-09-26 22:16:15 UTC (rev 957) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/myradioguide.xml 2007-09-28 15:23:09 UTC (rev 958) @@ -33,11 +33,12 @@ <type>image</type> <decription>top-strip</decription> <id>1</id> - <posX>-12</posX> + <posX>12</posX> <posY>100</posY> - <width>1388</width> + <width>1342</width> <height>36</height> <texture>top-strip.png</texture> + </control> <control> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/mytvguide.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/mytvguide.xml 2007-09-26 22:16:15 UTC (rev 957) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/mytvguide.xml 2007-09-28 15:23:09 UTC (rev 958) @@ -2,42 +2,22 @@ <window> <id>600</id> <defaultcontrol>2</defaultcontrol> - <allowoverlay>no</allowoverlay> + <allowoverlay>yes</allowoverlay> <controls> <import>common.window.xml</import> - <import>common.time.xml</import> <control> - <type>image</type> - <decription>mid_strip</decription> - <id>1</id> - <posX>-12</posX> - <posY>186</posY> - <width>1388</width> - <height>365</height> - <texture>mid_strip.png</texture> - <animation effect="zoom" start="100,100" end="100,135" center="12,186" time="1000" acceleration ="-1" >WindowOpen</animation> - <animation effect="zoom" start="100,135" end="100,100" center="12,186" time="1000" acceleration ="-1" >WindowClose</animation> - </control> + <import>common.time.xml</import> + + <control> <type>image</type> - <decription>bottom_strip</decription> - <id>1</id> - <posX>-12</posX> - <posY>547</posY> - <width>1388</width> - <height>18</height> - <texture>bottom_strip.png</texture> - <animation effect="slide" time="1000" start="0,0" end="0,130" acceleration="-1" >WindowOpen</animation> - <animation effect="slide" time="1000" start="0,130" end="0,0" acceleration="-1" >WindowClose</animation> - </control> - <control> - <type>image</type> <decription>top-strip</decription> <id>1</id> - <posX>-12</posX> + <posX>12</posX> <posY>100</posY> - <width>1388</width> + <width>1342</width> <height>36</height> <texture>top-strip.png</texture> + </control> <control> @@ -136,7 +116,7 @@ <posX>5</posX> <posY>200</posY> <width>1322</width> - <height>300</height> + <height>380</height> <colordiffuse>60ffffff</colordiffuse> <texture>-</texture> <animation effect="fade" time="250">WindowOpen</animation> @@ -233,9 +213,9 @@ <description>Current program title</description> <type>fadelabel</type> <id>13</id> - <posX>200</posX> - <posY>500</posY> - <width>666</width> + <posX>400</posX> + <posY>580</posY> + <width>600</width> <label>#TV.Guide.Title</label> <font>font16</font> <textcolor>FFFFFFFF</textcolor> @@ -246,8 +226,8 @@ <description>Current program time</description> <type>label</type> <id>14</id> - <posX>50</posX> - <posY>505</posY> + <posX>230</posX> + <posY>585</posY> <label>#TV.Guide.Time</label> <align>left</align> <font>font14</font> @@ -260,7 +240,7 @@ <type>label</type> <id>27</id> <posX>1320</posX> - <posY>500</posY> + <posY>580</posY> <label>#TV.Guide.Genre</label> <align>Right</align> <font>font14</font> @@ -272,13 +252,13 @@ <description>Description1</description> <type>textboxscrollup</type> <id>15</id> - <posX>50</posX> - <posY>550</posY> - <width>1300</width> + <posX>230</posX> + <posY>620</posY> + <width>1100</width> <height>93</height> <seperator>----------------------------------------------------------------------------------------------</seperator> <label>#TV.Guide.Description</label> - <font>font12</font> + <font>font14</font> <textcolor>FFFFFFFF</textcolor> <animation effect="slide" time="500" start="2000,0" end="0,0" delay="800" acceleration="-1">WindowOpen</animation> <animation effect="slide" time="500" start="0,0" end="2000,0" acceleration="-1">WindowClose</animation> @@ -335,6 +315,7 @@ <posY>503</posY> <texture>tvguide_record_button.png</texture> <visible>no</visible> + <keepaspectratio>yes</keepaspectratio> <animation effect="fade" time="250">WindowOpen</animation> <animation effect="fade" time="500">WindowClose</animation> </control> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/mytvhome.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/mytvhome.xml 2007-09-26 22:16:15 UTC (rev 957) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/mytvhome.xml 2007-09-28 15:23:09 UTC (rev 958) @@ -20,29 +20,8 @@ <animation effect="fade" time="500" delay="1000">WindowOpen</animation> <animation effect="fade" time="500">WindowClose</animation> </control> - <control> + <control> <type>image</type> - <decription>mid_strip</decription> - <id>1</id> - <posX>-12</posX> - <posY>186</posY> - <width>1390</width> - <height>365</height> - <texture>mid_strip.png</texture> - - </control> - <control> - <type>image</type> - <decription>bottom_strip</decription> - <id>1</id> - <posX>-12</posX> - <posY>547</posY> - <width>1390</width> - <height>18</height> - <texture>bottom_strip.png</texture> - - </control> <control> - <type>image</type> <decription>top-strip</decription> <id>1</id> <posX>12</posX> @@ -367,7 +346,7 @@ <id>9</id> <animation effect="fade" time="400">WindowClose</animation> <animation effect="fade" time="400">WindowOpen</animation> - <posY>194</posY> + <posY>136</posY> <posX>221</posX> <label>708</label> @@ -396,7 +375,7 @@ <hyperlink>604</hyperlink> <animation effect="fade" time="400">WindowClose</animation> <animation effect="fade" time="400">WindowOpen</animation> - <posY>194</posY> + <posY>136</posY> <posX>430</posX> <font>font14</font> <width>209</width> @@ -422,7 +401,7 @@ <animation effect="fade" time="400">WindowClose</animation> <animation effect="fade" time="400">WindowOpen</animation> - <posY>230</posY> + <posY>172</posY> <posX>430</posX> <font>font14</font> <width>209</width> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/mytvrecordedtv.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/mytvrecordedtv.xml 2007-09-26 22:16:15 UTC (rev 957) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/mytvrecordedtv.xml 2007-09-28 15:23:09 UTC (rev 958) @@ -46,11 +46,12 @@ <type>image</type> <decription>top-strip</decription> <id>1</id> - <posX>-12</posX> + <posX>12</posX> <posY>100</posY> - <width>1388</width> + <width>1342</width> <height>36</height> <texture>top-strip.png</texture> + </control> <control> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/mytvrecordedtvchannel.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/mytvrecordedtvchannel.xml 2007-09-26 22:16:15 UTC (rev 957) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/mytvrecordedtvchannel.xml 2007-09-28 15:23:09 UTC (rev 958) @@ -41,11 +41,12 @@ <type>image</type> <decription>top-strip</decription> <id>1</id> - <posX>-12</posX> + <posX>12</posX> <posY>100</posY> - <width>1388</width> + <width>1342</width> <height>36</height> <texture>top-strip.png</texture> + </control> <control> <description>icon background</description> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/mytvrecordedtvgenre.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/mytvrecordedtvgenre.xml 2007-09-26 22:16:15 UTC (rev 957) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/mytvrecordedtvgenre.xml 2007-09-28 15:23:09 UTC (rev 958) @@ -40,11 +40,12 @@ <type>image</type> <decription>top-strip</decription> <id>1</id> - <posX>-12</posX> + <posX>12</posX> <posY>100</posY> - <width>1388</width> + <width>1342</width> <height>36</height> <texture>top-strip.png</texture> + </control> <control> <description>icon background</description> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/mytvsearch.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/mytvsearch.xml 2007-09-26 22:16:15 UTC (rev 957) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/mytvsearch.xml 2007-09-28 15:23:09 UTC (rev 958) @@ -86,11 +86,12 @@ <type>image</type> <decription>top-strip</decription> <id>1</id> - <posX>-12</posX> + <posX>12</posX> <posY>100</posY> - <width>1388</width> + <width>1342</width> <height>36</height> <texture>top-strip.png</texture> + </control> <control> <description>Number of Files Label</description> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/release notes.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/release notes.xml 2007-09-26 22:16:15 UTC (rev 957) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/release notes.xml 2007-09-28 15:23:09 UTC (rev 958) @@ -6,4 +6,8 @@ Added Backgroun changer update for vista -fixed osd in my videos \ No newline at end of file +fixed osd in my videos + +8. +Changed layouts +Fixed Play CD Button This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fc...@us...> - 2007-09-26 22:16:18
|
Revision: 957 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=957&view=rev Author: fcsobel Date: 2007-09-26 15:16:15 -0700 (Wed, 26 Sep 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MyTorrents/AzureusWrapper/AzureusWrapper.csproj trunk/plugins/MyTorrents/My PodCasts/GUIPodCasts/GUIPodCasts.cs trunk/plugins/MyTorrents/My Torrents/GUITorrents/GUITorrents.cs trunk/plugins/MyTorrents/My uTorrent/GUIuTorrent/GUIuTorrent.cs trunk/plugins/MyTorrents/My uTorrent/Skin/media/downloading.png trunk/plugins/MyTorrents/My uTorrent/Skin/media/inactive.PNG trunk/plugins/MyTorrents/My uTorrent/Skin/media/seeding.png trunk/plugins/MyTorrents/c3o.Plugins/Shared/GUIRssBaseWindow.cs trunk/plugins/MyTorrents/c3o.Plugins/Shared/RssBaseSetupForm.Designer.cs trunk/plugins/MyTorrents/c3o.Plugins/Shared/RssBaseSetupForm.cs trunk/plugins/MyTorrents/c3o.Plugins/Web/Opml.cs trunk/plugins/MyTorrents/c3o.Plugins/Web/RSSReader.cs trunk/plugins/MyTorrents/c3o.Plugins/Web/SiteReader.cs trunk/plugins/MyTorrents/c3o.Plugins/Web/WebHelper.cs trunk/plugins/MyTorrents/c3o.Plugins/Web/uTorrentData.cs Modified: trunk/plugins/MyTorrents/AzureusWrapper/AzureusWrapper.csproj =================================================================== --- trunk/plugins/MyTorrents/AzureusWrapper/AzureusWrapper.csproj 2007-09-26 07:34:18 UTC (rev 956) +++ trunk/plugins/MyTorrents/AzureusWrapper/AzureusWrapper.csproj 2007-09-26 22:16:15 UTC (rev 957) @@ -9,6 +9,10 @@ <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>AzureusWrapper</RootNamespace> <AssemblyName>AzureusWrapper</AssemblyName> + <SccProjectName>SAK</SccProjectName> + <SccLocalPath>SAK</SccLocalPath> + <SccAuxPath>SAK</SccAuxPath> + <SccProvider>SAK</SccProvider> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> Modified: trunk/plugins/MyTorrents/My PodCasts/GUIPodCasts/GUIPodCasts.cs =================================================================== --- trunk/plugins/MyTorrents/My PodCasts/GUIPodCasts/GUIPodCasts.cs 2007-09-26 07:34:18 UTC (rev 956) +++ trunk/plugins/MyTorrents/My PodCasts/GUIPodCasts/GUIPodCasts.cs 2007-09-26 22:16:15 UTC (rev 957) @@ -6,6 +6,7 @@ using MediaPortal.Util; using MediaPortal.Dialogs; using MediaPortal.Player; +using MediaPortal.Configuration; using System.Data; using System.ComponentModel; using c3o.Framework.Web; @@ -19,6 +20,8 @@ { public class GUIPodCasts : GUIRssBaseWindow, ISetupForm { + public static bool useVMR9 = true; + public override int GetID { get @@ -62,7 +65,12 @@ GUIPropertyManager.SetProperty("#header.label", "My PodCasts"); - base.OnPageLoad(); + base.OnPageLoad(); + + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + useVMR9 = xmlreader.GetValueAsBool("general", "usevrm9forwebstreams", true); + } } @@ -227,53 +235,267 @@ if (url != null && url.Length > 0) { - if (url.ToLower().Contains(".avi") || - url.ToLower().Contains(".mpeg") || - url.ToLower().Contains(".mov") || - url.ToLower().Contains(".wmv") || - url.ToLower().Contains(".divx") || - url.ToLower().Contains(".mpg")) - { - //g_Player.FullScreen = true; - //if (g_Player.Play(url)) - //{ - // GUIGraphicsContext.IsFullScreenVideo = true; - // GUIWindowManager.ActivateWindow((int)GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO); - //} + //this.PlayVideo(url); + this.PlayIt(url, this.facadeView.SelectedListItem.Label); - if (g_Player.Play(url)) - { - GUIGraphicsContext.IsFullScreenVideo = true; - GUIWindowManager.ActivateWindow((int)GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO); - g_Player.FullScreen = true; - } - } - else - { - g_Player.PlayAudioStream(url); + //// PlayUrl(url, this.facadeView.SelectedListItem.Label); + // if (url.Contains(".mp3") || + // url.Contains(".wav") || + // url.Contains(".wma") || + // url.Contains(".aac")) + // { + // if (g_Player.PlayAudioStream(url)) + // { + // //g_Player.FullScreen = false; + // } + // else + // { + // Log.Info("GUIPodCasts: Unable to play {0}", url); + // GUIDialogNotify dlg = (GUIDialogNotify)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_NOTIFY); + // dlg.SetHeading("ERROR"); + // dlg.SetText("Unable to play the selected stream. Please try again later."); + // dlg.DoModal(GUIWindowManager.ActiveWindow); + // } + // } + // else + // { + // if (g_Player.Play(url)) + // { + // GUIGraphicsContext.IsFullScreenVideo = true; + // GUIWindowManager.ActivateWindow((int)GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO); + // g_Player.FullScreen = true; - //if (url.ToLower().Contains(".mp3")) - //{ - // //this.PlayPodCast(url); - // g_Player.Play(url); - // //g_Player.PlayAudioStream(url); - //} - //else - //{ - // if (url.ToLower().Contains(".m4v") || - // url.ToLower().Contains(".mp4")) - // { - // System.Diagnostics.Process.Start(@"QuickTimePlayer.exe", url); - // } - // else - // { - // System.Diagnostics.Process.Start(url); - // } - //} - } + // //g_Player.ShowFullScreenWindow(); + // //g_Player.FullScreen = true; + // } + // else + // { + // Log.Info("GUIPodCasts: Unable to play {0}", url); + // GUIDialogNotify dlg = (GUIDialogNotify)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_NOTIFY); + // dlg.SetHeading("ERROR"); + // dlg.SetText("Unable to play the selected stream. Please try again later."); + // dlg.DoModal(GUIWindowManager.ActiveWindow); + // } + // } + } } } } + +// void PlayItOld(string url) +// { +// if (url.ToLower().StartsWith("mms:")) +// { +// if (g_Player.PlayVideoStream(url)) +// { +//// g_Player.ShowFullScreenWindow(); +// GUIGraphicsContext.IsFullScreenVideo = true; +// GUIWindowManager.ActivateWindow((int)GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO); +// g_Player.FullScreen = true; +// } +// else +// { +// Log.Info("GUIPodCasts: Unable to play {0}", url); +// GUIDialogNotify dlg = (GUIDialogNotify)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_NOTIFY); +// dlg.SetHeading("ERROR"); +// dlg.SetText("Unable to play the video stream. Please try again later."); +// dlg.DoModal(GUIWindowManager.ActiveWindow); +// } +// } + +// if (g_Player.Play(url)) +// { +// url = url.ToLower(); + +// if (url.Contains(".mp3") || +// url.Contains(".wav") || +// url.Contains(".wma") || +// url.Contains(".aac")) +// { +// // Playing audio only +// } +// else +// { +// // Play video full screen +// GUIGraphicsContext.IsFullScreenVideo = true; +// GUIWindowManager.ActivateWindow((int)GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO); +// g_Player.FullScreen = true; + +// //g_Player.ShowFullScreenWindow(); +// //g_Player.FullScreen = true; +// } +// } +// else +// { +// Log.Info("GUIPodCasts: Unable to play {0}", url); +// GUIDialogNotify dlg = (GUIDialogNotify)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_NOTIFY); +// dlg.SetHeading("ERROR"); +// dlg.SetText("Unable to play the stream. Please try again later."); +// dlg.DoModal(GUIWindowManager.ActiveWindow); +// } +// } + + + void PlayIt(string url, string name) + { + if (url.ToLower().StartsWith("mms:")) + { + if (g_Player.PlayVideoStream(url, name)) + { + g_Player.ShowFullScreenWindow(); + g_Player.FullScreen = true; + } + else + { + Log.Info("GUIPodCasts: Unable to play {0}", url); + GUIDialogNotify dlg = (GUIDialogNotify)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_NOTIFY); + dlg.SetHeading("ERROR"); + dlg.SetText("Unable to play the video stream."); + dlg.DoModal(GUIWindowManager.ActiveWindow); + } + } + + if (url.Contains(".mp3") || + url.Contains(".wav") || + url.Contains(".wma") || + url.Contains(".aac")) + { + if (!g_Player.PlayAudioStream(url)) + { + Log.Info("GUIPodCasts: Unable to play {0}", url); + GUIDialogNotify dlg = (GUIDialogNotify)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_NOTIFY); + dlg.SetHeading("ERROR"); + dlg.SetText("Unable to play the audio stream."); + dlg.DoModal(GUIWindowManager.ActiveWindow); + } + } + else + { + if (g_Player.Play(url)) + { + // Play video full screen + g_Player.ShowFullScreenWindow(); + g_Player.FullScreen = true; + } + else + { + Log.Info("GUIPodCasts: Unable to play {0}", url); + GUIDialogNotify dlg = (GUIDialogNotify)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_NOTIFY); + dlg.SetHeading("ERROR"); + dlg.SetText("Unable to play the video."); + dlg.DoModal(GUIWindowManager.ActiveWindow); + } + + } + } + + //void PlayVideoOld(string url) + //{ + // if (url.ToLower().Contains(".avi") || + // url.ToLower().Contains(".mpeg") || + // url.ToLower().Contains(".mov") || + // url.ToLower().Contains(".wmv") || + // url.ToLower().Contains(".divx") || + // url.ToLower().Contains(".mpg")) + // { + // if (g_Player.Play(url)) + // { + // //GUIGraphicsContext.IsFullScreenVideo = true; + // //GUIWindowManager.ActivateWindow((int)GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO); + // //g_Player.FullScreen = true; + + // g_Player.ShowFullScreenWindow(); + // g_Player.FullScreen = true; + // } + // else + // { + // Log.Info("GUIPodCasts: Unable to play {0}", url); + // GUIDialogNotify dlg = (GUIDialogNotify)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_NOTIFY); + // dlg.SetHeading("ERROR"); + // dlg.SetText("Unable to play the selected stream. Please try again later."); + // dlg.DoModal(GUIWindowManager.ActiveWindow); + // } + // } + // else + // { + // if (g_Player.PlayAudioStream(url)) + // { + // g_Player.FullScreen = false; + // } + // else + // { + // Log.Info("GUIPodCasts: Unable to play {0}", url); + // GUIDialogNotify dlg = (GUIDialogNotify)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_NOTIFY); + // dlg.SetHeading("ERROR"); + // dlg.SetText("Unable to play the selected stream. Please try again later."); + // dlg.DoModal(GUIWindowManager.ActiveWindow); + // } + // } + //} + + + //void playVideo(string url) + //{ + // if (useVMR9) + // { + // g_Player.PlayVideoStream(url, "test"); + // g_Player.ShowFullScreenWindow(); + // } + // else + // { + // g_Player.PlayAudioStream(url); + // } + + // //if (g_Player.Playing) + // //{ + // // g_Player.ShowFullScreenWindow(); + // //} + // //else + // //{ + // // Log.Info("GUIPodCasts: Unable to play {0}", url); + // // GUIDialogNotify dlg = (GUIDialogNotify)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_NOTIFY); + // // dlg.SetHeading("ERROR"); + // // dlg.SetText("useVMR9 Unable to play this stream. Please try again later."); + // // dlg.DoModal(GUIWindowManager.ActiveWindow); + // //} + //} + + //public void PlayUrl(string url, string videoName) + //{ + // //GetGUIProperties(); + // //MMSUrl = string.Empty; + // //GetMMSURL(url); + // //Log.Debug("Url: {0}, mmsurl: {1}, videoname: {2}", url, MMSUrl, videoName); + + // bool playOk = false; + + // if (useVMR9) + // { + // playOk = g_Player.PlayVideoStream(url, videoName); + // } + // else + // { + // playOk = g_Player.PlayAudioStream(url); + // //playOk = g_Player.PlayAudioStream(url, true); + // } + + // if (playOk) + // { + // g_Player.ShowFullScreenWindow(); + // g_Player.FullScreen = true; + // } + // else + // { + // Log.Info("GUIPodCasts: Unable to play {0}", url); + // GUIDialogNotify dlg = (GUIDialogNotify)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_NOTIFY); + // dlg.SetHeading("ERROR"); + // dlg.SetText("Unable to play the selected stream. Please try again later."); + // dlg.DoModal(GUIWindowManager.ActiveWindow); + // } + //} + + + } } \ No newline at end of file Modified: trunk/plugins/MyTorrents/My Torrents/GUITorrents/GUITorrents.cs =================================================================== --- trunk/plugins/MyTorrents/My Torrents/GUITorrents/GUITorrents.cs 2007-09-26 07:34:18 UTC (rev 956) +++ trunk/plugins/MyTorrents/My Torrents/GUITorrents/GUITorrents.cs 2007-09-26 22:16:15 UTC (rev 957) @@ -14,6 +14,7 @@ using System.Xml.Serialization; using System.IO; using AzureusWrapper; +using System.Text.RegularExpressions; namespace MediaPortal.GUI.Rss @@ -551,14 +552,23 @@ } + //protected void GetTorrent(string url, string pattern, string replace) + //{ + // Regex reg = new Regex(pattern); + // url = reg.Replace(JsonData, replace); + //} + protected void GetTorrent(string url) { if (url != null && url.Length > 0) { // Added for mininova rss - url = url.Replace(@"/tor/", @"/get/"); + //url = url.Replace(@"/tor/", @"/get/"); + //Regex reg = new Regex(@".*www\.torrentspy\.com/torrent/(.*)/.*"); + //url = reg.Replace(JsonData, @"http://cache.torrentspy.com/download.asp?id=\1"); + if (this.CurrentSite == "UKNova") { dtUKNova.DownloadTorrent(url); @@ -571,7 +581,8 @@ } else { - dtUKNova.DownloadTorrent(url); + this.dtRss.DownloadTorrent(url); + //dtUKNova.DownloadTorrent(url); } } } Modified: trunk/plugins/MyTorrents/My uTorrent/GUIuTorrent/GUIuTorrent.cs =================================================================== --- trunk/plugins/MyTorrents/My uTorrent/GUIuTorrent/GUIuTorrent.cs 2007-09-26 07:34:18 UTC (rev 956) +++ trunk/plugins/MyTorrents/My uTorrent/GUIuTorrent/GUIuTorrent.cs 2007-09-26 22:16:15 UTC (rev 957) @@ -184,7 +184,9 @@ string lSize = uTrow["Size"].ToString(); string lUpSpeed = uTrow["UpSpeed"].ToString(); string lDownSpeed = uTrow["DownSpeed"].ToString(); + string ETA = uTrow["ETA"].ToString(); + if (ETA.Length > 0) ETA = SecondsToDaysHoursMinutes(int.Parse(ETA)); if (lRatio.Length > 0) lRatio = String.Format("{0:N2}", Double.Parse(lRatio) / 1000); // 24 = 0.024 if (lSize.Length > 0) lSize = GUIHelper.FormatSize(ulong.Parse(lSize), 1); if (lUpSpeed.Length > 0) lUpSpeed = GUIHelper.FormatSize(ulong.Parse(lUpSpeed), 1); @@ -193,20 +195,20 @@ string DownLoadPercent = String.Format("{0:P2}", Double.Parse(lPercentage) / 1000); string UploadPercent = "0%"; - string IconImage = "Inactive.PNG"; + string IconImage = "utInactive.png"; switch (status) { case "136": - IconImage = "Inactive.PNG"; + IconImage = "utInactive.png"; status = "Stopped"; break; case "233": - IconImage = "Inactive.PNG"; + IconImage = "utInactive.png"; status = "Paused"; break; case "137": - IconImage = "seeding.PNG"; + IconImage = "utSeeding.png"; status = "Seeding(F)"; break; case "200": @@ -214,17 +216,17 @@ if (lPercentage == "1000") { status = "Seeding"; - IconImage = "seeding.PNG"; + IconImage = "utSeeding.png"; } else { status = "Downloading"; - IconImage = "Downloading.PNG"; + IconImage = "utDownloading.png"; } break; } - string DVDLabel = lFileName + "\n" + status + "\nSize: " + lSize + "\nRatio: " + lRatio + "\nSeeds: " + lSeeds + " (" + lSeeds2 + ")\nPeers: " + lPeers + " (" + lPeers2 + ")" + "\nDown Speed: " + lDownSpeed + "\nUp Speed: " + lUpSpeed; + string DVDLabel = lFileName + "\n" + status + "\nSize: " + lSize + "\nRatio: " + lRatio + "\nSeeds: " + lSeeds + " (" + lSeeds2 + ")\nPeers: " + lPeers + " (" + lPeers2 + ")" + "\nDown Speed: " + lDownSpeed + "\nUp Speed: " + lUpSpeed + "\nETA: " + ETA; dt.Rows.Add(lFileName, lKey, status + " (" + DownLoadPercent + ")", DVDLabel, IconImage); @@ -249,8 +251,22 @@ + public string SecondsToDaysHoursMinutes(int time) + { + int days = time / 86400; + int hours = (time / 3600) - (days * 24); + int minutes = (time / 60) - (days * 1440) - (hours * 60); + int seconds = time % 60; // Modulous + if (days > 0) return String.Format("{3}d {2}h {1}m {0}s", seconds, minutes, hours, days); + if (hours > 0) return String.Format("{2}h {1}m {0}s", seconds, minutes, hours); + if (minutes > 0) return String.Format("{1}m {0}s", seconds, minutes); + if (seconds > 0) return String.Format("{0}s", seconds); + return ""; + } + + public override bool Init() { //this.RssFileName = "MyPodCasts.Feeds.opml.xml"; @@ -440,7 +456,7 @@ uTorrentData.StartDownload(WebUiUrl, WebUiLogin, WebUiPassword, dl); break; case "Stop": - if (item.IconImage == "Inactive.PNG") + if (item.IconImage == "utInactive.png") { this.uTorentAction("Remove"); } Modified: trunk/plugins/MyTorrents/My uTorrent/Skin/media/downloading.png =================================================================== (Binary files differ) Modified: trunk/plugins/MyTorrents/My uTorrent/Skin/media/inactive.PNG =================================================================== (Binary files differ) Modified: trunk/plugins/MyTorrents/My uTorrent/Skin/media/seeding.png =================================================================== (Binary files differ) Modified: trunk/plugins/MyTorrents/c3o.Plugins/Shared/GUIRssBaseWindow.cs =================================================================== --- trunk/plugins/MyTorrents/c3o.Plugins/Shared/GUIRssBaseWindow.cs 2007-09-26 07:34:18 UTC (rev 956) +++ trunk/plugins/MyTorrents/c3o.Plugins/Shared/GUIRssBaseWindow.cs 2007-09-26 22:16:15 UTC (rev 957) @@ -13,8 +13,8 @@ using System.Xml; using System.Xml.Serialization; using System.IO; +using System.Text.RegularExpressions; - namespace MediaPortal.GUI.Rss { public class GUIRssBaseWindow : GUIVideoBaseWindow @@ -330,27 +330,47 @@ this.SelectOutline(this.opmlFeeds, null, this.DefaultView); } } - + + protected void SearchOpml(string url) { this.ListMode = "Sites.Opml.List"; string Source = null; - // Cache The Page - MediaPortal.Utils.Web.HTMLCache.WebCacheInitialise(); + //// SVN version + //// Cache The Page + MediaPortal.Utils.Web.HTMLCache hc = new MediaPortal.Utils.Web.HTMLCache(); - if (MediaPortal.Utils.Web.HTMLCache.LoadPage(new Uri(url))) - { - Source = MediaPortal.Utils.Web.HTMLCache.GetPage(); - } - else - { - SiteReader sr = new SiteReader(); - Source = sr.ReadPage(url); - MediaPortal.Utils.Web.HTMLCache.SavePage(new Uri(url), Source); - } + hc.WebCacheInitialise(); + if (hc.LoadPage(new MediaPortal.Utils.Web.HTTPRequest(url))) + { + Source = hc.GetPage(); + } + else + { + SiteReader sr = new SiteReader(); + Source = sr.ReadPage(url); + hc.SavePage(new MediaPortal.Utils.Web.HTTPRequest(url), Source); + } + + //// 0.2.2 version + //MediaPortal.Utils.Web.HTMLCache hc = new MediaPortal.Utils.Web.HTMLCache(); + + //MediaPortal.Utils.Web.HTMLCache.WebCacheInitialise(); + + //if (MediaPortal.Utils.Web.HTMLCache.LoadPage(new Uri(url))) + //{ + // Source = MediaPortal.Utils.Web.HTMLCache.GetPage(); + //} + //else + //{ + // SiteReader sr = new SiteReader(); + // Source = sr.ReadPage(url); + // MediaPortal.Utils.Web.HTMLCache.SavePage(new Uri(url), Source); + //} + // Read rss feed into XmlDocument XmlDocument xml = new XmlDocument(); xml.LoadXml(Source); @@ -605,6 +625,8 @@ string SiteName = this.selectedOutline.text; string SiteUrl = this.selectedOutline.url; + string pattern = this.selectedOutline.search; + string replacement = this.selectedOutline.replace; GUIPropertyManager.SetProperty("#selecteditem", "Loading " + SiteUrl + "..."); GUIWindowManager.Process(); @@ -626,7 +648,7 @@ GUIPropertyManager.SetProperty("#selecteditem", "Loading " + SiteUrl); // Read rss feed - dtRss = new RssReader(SiteUrl); + dtRss = new RssReader(SiteUrl, pattern, replacement); DataTable dt = dtRss.Detail; Modified: trunk/plugins/MyTorrents/c3o.Plugins/Shared/RssBaseSetupForm.Designer.cs =================================================================== --- trunk/plugins/MyTorrents/c3o.Plugins/Shared/RssBaseSetupForm.Designer.cs 2007-09-26 07:34:18 UTC (rev 956) +++ trunk/plugins/MyTorrents/c3o.Plugins/Shared/RssBaseSetupForm.Designer.cs 2007-09-26 22:16:15 UTC (rev 957) @@ -28,216 +28,256 @@ /// </summary> private void InitializeComponent() { - this.bttnOK = new System.Windows.Forms.Button(); - this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog(); - this.gbDetail = new System.Windows.Forms.GroupBox(); - this.bttnAddDetail = new System.Windows.Forms.Button(); - this.bttnDelete = new System.Windows.Forms.Button(); - this.button1 = new System.Windows.Forms.Button(); - this.tbxItemName = new System.Windows.Forms.TextBox(); - this.label9 = new System.Windows.Forms.Label(); - this.tbxItemUrl = new System.Windows.Forms.TextBox(); - this.tbxItemImage = new System.Windows.Forms.TextBox(); - this.label8 = new System.Windows.Forms.Label(); - this.label7 = new System.Windows.Forms.Label(); - this.bttnAdd = new System.Windows.Forms.Button(); - this.label6 = new System.Windows.Forms.Label(); - this.bttnBrowseRss = new System.Windows.Forms.Button(); - this.tbxUrl = new System.Windows.Forms.TextBox(); - this.tvList = new System.Windows.Forms.TreeView(); - this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); - this.bttnCancel = new System.Windows.Forms.Button(); - this.gbDetail.SuspendLayout(); - this.SuspendLayout(); - // - // bttnOK - // - this.bttnOK.Location = new System.Drawing.Point(15, 462); - this.bttnOK.Name = "bttnOK"; - this.bttnOK.Size = new System.Drawing.Size(75, 23); - this.bttnOK.TabIndex = 5; - this.bttnOK.Text = "OK"; - this.bttnOK.UseVisualStyleBackColor = true; - this.bttnOK.Click += new System.EventHandler(this.button1_Click); - // - // gbDetail - // - this.gbDetail.Controls.Add(this.bttnAddDetail); - this.gbDetail.Controls.Add(this.bttnDelete); - this.gbDetail.Controls.Add(this.button1); - this.gbDetail.Controls.Add(this.tbxItemName); - this.gbDetail.Controls.Add(this.label9); - this.gbDetail.Controls.Add(this.tbxItemUrl); - this.gbDetail.Controls.Add(this.tbxItemImage); - this.gbDetail.Controls.Add(this.label8); - this.gbDetail.Controls.Add(this.label7); - this.gbDetail.Location = new System.Drawing.Point(326, 45); - this.gbDetail.Name = "gbDetail"; - this.gbDetail.Size = new System.Drawing.Size(260, 404); - this.gbDetail.TabIndex = 21; - this.gbDetail.TabStop = false; - this.gbDetail.Text = "Details"; - // - // bttnAddDetail - // - this.bttnAddDetail.Location = new System.Drawing.Point(86, 111); - this.bttnAddDetail.Name = "bttnAddDetail"; - this.bttnAddDetail.Size = new System.Drawing.Size(75, 23); - this.bttnAddDetail.TabIndex = 22; - this.bttnAddDetail.Text = "Add"; - this.bttnAddDetail.UseVisualStyleBackColor = true; - this.bttnAddDetail.Click += new System.EventHandler(this.bttnAddDetail_Click); - // - // bttnDelete - // - this.bttnDelete.Location = new System.Drawing.Point(162, 111); - this.bttnDelete.Name = "bttnDelete"; - this.bttnDelete.Size = new System.Drawing.Size(75, 23); - this.bttnDelete.TabIndex = 21; - this.bttnDelete.Text = "Delete"; - this.bttnDelete.UseVisualStyleBackColor = true; - this.bttnDelete.Click += new System.EventHandler(this.bttnDelete_Click); - // - // button1 - // - this.button1.Location = new System.Drawing.Point(8, 111); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(75, 23); - this.button1.TabIndex = 20; - this.button1.Text = "Update"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.button1_Click_2); - // - // tbxItemName - // - this.tbxItemName.Location = new System.Drawing.Point(56, 30); - this.tbxItemName.Name = "tbxItemName"; - this.tbxItemName.Size = new System.Drawing.Size(176, 20); - this.tbxItemName.TabIndex = 14; - // - // label9 - // - this.label9.AutoSize = true; - this.label9.Location = new System.Drawing.Point(12, 85); - this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(39, 13); - this.label9.TabIndex = 19; - this.label9.Text = "Image:"; - // - // tbxItemUrl - // - this.tbxItemUrl.Location = new System.Drawing.Point(56, 56); - this.tbxItemUrl.Name = "tbxItemUrl"; - this.tbxItemUrl.Size = new System.Drawing.Size(176, 20); - this.tbxItemUrl.TabIndex = 15; - // - // tbxItemImage - // - this.tbxItemImage.Location = new System.Drawing.Point(56, 82); - this.tbxItemImage.Name = "tbxItemImage"; - this.tbxItemImage.Size = new System.Drawing.Size(176, 20); - this.tbxItemImage.TabIndex = 16; - // - // label8 - // - this.label8.AutoSize = true; - this.label8.Location = new System.Drawing.Point(23, 63); - this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(23, 13); - this.label8.TabIndex = 18; - this.label8.Text = "Url:"; - // - // label7 - // - this.label7.AutoSize = true; - this.label7.Location = new System.Drawing.Point(12, 33); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(38, 13); - this.label7.TabIndex = 17; - this.label7.Text = "Name:"; - // - // bttnAdd - // - this.bttnAdd.Location = new System.Drawing.Point(354, 13); - this.bttnAdd.Name = "bttnAdd"; - this.bttnAdd.Size = new System.Drawing.Size(75, 23); - this.bttnAdd.TabIndex = 15; - this.bttnAdd.Text = "Add"; - this.bttnAdd.UseVisualStyleBackColor = true; - this.bttnAdd.Click += new System.EventHandler(this.bttnAdd_Click_1); - // - // label6 - // - this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(17, 18); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(59, 13); - this.label6.TabIndex = 14; - this.label6.Text = "XML Feed:"; - // - // bttnBrowseRss - // - this.bttnBrowseRss.Location = new System.Drawing.Point(435, 13); - this.bttnBrowseRss.Name = "bttnBrowseRss"; - this.bttnBrowseRss.Size = new System.Drawing.Size(75, 23); - this.bttnBrowseRss.TabIndex = 13; - this.bttnBrowseRss.Text = "Browse"; - this.bttnBrowseRss.UseVisualStyleBackColor = true; - this.bttnBrowseRss.Click += new System.EventHandler(this.button1_Click_1); - // - // tbxUrl - // - this.tbxUrl.Location = new System.Drawing.Point(77, 15); - this.tbxUrl.Name = "tbxUrl"; - this.tbxUrl.Size = new System.Drawing.Size(269, 20); - this.tbxUrl.TabIndex = 12; - // - // tvList - // - this.tvList.AllowDrop = true; - this.tvList.Location = new System.Drawing.Point(15, 51); - this.tvList.Name = "tvList"; - this.tvList.Size = new System.Drawing.Size(301, 398); - this.tvList.TabIndex = 13; - this.tvList.DragDrop += new System.Windows.Forms.DragEventHandler(this.tvList_DragDrop); - this.tvList.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tvList_AfterSelect); - this.tvList.DragEnter += new System.Windows.Forms.DragEventHandler(this.tvList_DragEnter); - this.tvList.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.tvList_ItemDrag); - // - // openFileDialog1 - // - this.openFileDialog1.FileName = "openFileDialog1"; - // - // bttnCancel - // - this.bttnCancel.Location = new System.Drawing.Point(102, 462); - this.bttnCancel.Name = "bttnCancel"; - this.bttnCancel.Size = new System.Drawing.Size(75, 23); - this.bttnCancel.TabIndex = 22; - this.bttnCancel.Text = "Cancel"; - this.bttnCancel.UseVisualStyleBackColor = true; - this.bttnCancel.Click += new System.EventHandler(this.bttnCancel_Click); - // - // MyRssBaseSetupForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(611, 499); - this.Controls.Add(this.bttnCancel); - this.Controls.Add(this.gbDetail); - this.Controls.Add(this.bttnAdd); - this.Controls.Add(this.bttnOK); - this.Controls.Add(this.label6); - this.Controls.Add(this.tvList); - this.Controls.Add(this.bttnBrowseRss); - this.Controls.Add(this.tbxUrl); - this.Name = "MyRssBaseSetupForm"; - this.Text = "My Torrents"; - this.Load += new System.EventHandler(this.SetupForm_Load); - this.gbDetail.ResumeLayout(false); - this.gbDetail.PerformLayout(); - this.ResumeLayout(false); - this.PerformLayout(); + this.bttnOK = new System.Windows.Forms.Button(); + this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog(); + this.gbDetail = new System.Windows.Forms.GroupBox(); + this.label2 = new System.Windows.Forms.Label(); + this.tbxReplacement = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.tbxPattern = new System.Windows.Forms.TextBox(); + this.bttnAddDetail = new System.Windows.Forms.Button(); + this.bttnDelete = new System.Windows.Forms.Button(); + this.button1 = new System.Windows.Forms.Button(); + this.tbxItemName = new System.Windows.Forms.TextBox(); + this.label9 = new System.Windows.Forms.Label(); + this.tbxItemUrl = new System.Windows.Forms.TextBox(); + this.tbxItemImage = new System.Windows.Forms.TextBox(); + this.label8 = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.bttnAdd = new System.Windows.Forms.Button(); + this.label6 = new System.Windows.Forms.Label(); + this.bttnBrowseRss = new System.Windows.Forms.Button(); + this.tbxUrl = new System.Windows.Forms.TextBox(); + this.tvList = new System.Windows.Forms.TreeView(); + this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); + this.bttnCancel = new System.Windows.Forms.Button(); + this.gbDetail.SuspendLayout(); + this.SuspendLayout(); + // + // bttnOK + // + this.bttnOK.Location = new System.Drawing.Point(15, 462); + this.bttnOK.Name = "bttnOK"; + this.bttnOK.Size = new System.Drawing.Size(75, 23); + this.bttnOK.TabIndex = 5; + this.bttnOK.Text = "OK"; + this.bttnOK.UseVisualStyleBackColor = true; + this.bttnOK.Click += new System.EventHandler(this.button1_Click); + // + // gbDetail + // + this.gbDetail.Controls.Add(this.label2); + this.gbDetail.Controls.Add(this.tbxReplacement); + this.gbDetail.Controls.Add(this.label1); + this.gbDetail.Controls.Add(this.tbxPattern); + this.gbDetail.Controls.Add(this.bttnAddDetail); + this.gbDetail.Controls.Add(this.bttnDelete); + this.gbDetail.Controls.Add(this.button1); + this.gbDetail.Controls.Add(this.tbxItemName); + this.gbDetail.Controls.Add(this.label9); + this.gbDetail.Controls.Add(this.tbxItemUrl); + this.gbDetail.Controls.Add(this.tbxItemImage); + this.gbDetail.Controls.Add(this.label8); + this.gbDetail.Controls.Add(this.label7); + this.gbDetail.Location = new System.Drawing.Point(326, 45); + this.gbDetail.Name = "gbDetail"; + this.gbDetail.Size = new System.Drawing.Size(285, 404); + this.gbDetail.TabIndex = 21; + this.gbDetail.TabStop = false; + this.gbDetail.Text = "Details"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(30, 140); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(50, 13); + this.label2.TabIndex = 26; + this.label2.Text = "Replace:"; + // + // tbxReplacement + // + this.tbxReplacement.Location = new System.Drawing.Point(86, 137); + this.tbxReplacement.Name = "tbxReplacement"; + this.tbxReplacement.Size = new System.Drawing.Size(176, 20); + this.tbxReplacement.TabIndex = 18; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(36, 112); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(44, 13); + this.label1.TabIndex = 24; + this.label1.Text = "Search:"; + // + // tbxPattern + // + this.tbxPattern.Location = new System.Drawing.Point(86, 109); + this.tbxPattern.Name = "tbxPattern"; + this.tbxPattern.Size = new System.Drawing.Size(176, 20); + this.tbxPattern.TabIndex = 17; + // + // bttnAddDetail + // + this.bttnAddDetail.Location = new System.Drawing.Point(104, 176); + this.bttnAddDetail.Name = "bttnAddDetail"; + this.bttnAddDetail.Size = new System.Drawing.Size(75, 23); + this.bttnAddDetail.TabIndex = 22; + this.bttnAddDetail.Text = "Add"; + this.bttnAddDetail.UseVisualStyleBackColor = true; + this.bttnAddDetail.Click += new System.EventHandler(this.bttnAddDetail_Click); + // + // bttnDelete + // + this.bttnDelete.Location = new System.Drawing.Point(180, 176); + this.bttnDelete.Name = "bttnDelete"; + this.bttnDelete.Size = new System.Drawing.Size(75, 23); + this.bttnDelete.TabIndex = 21; + this.bttnDelete.Text = "Delete"; + this.bttnDelete.UseVisualStyleBackColor = true; + this.bttnDelete.Click += new System.EventHandler(this.bttnDelete_Click); + // + // button1 + // + this.button1.Location = new System.Drawing.Point(26, 176); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 20; + this.button1.Text = "Update"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click_2); + // + // tbxItemName + // + this.tbxItemName.Location = new System.Drawing.Point(86, 30); + this.tbxItemName.Name = "tbxItemName"; + this.tbxItemName.Size = new System.Drawing.Size(176, 20); + this.tbxItemName.TabIndex = 14; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(41, 85); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(39, 13); + this.label9.TabIndex = 19; + this.label9.Text = "Image:"; + // + // tbxItemUrl + // + this.tbxItemUrl.Location = new System.Drawing.Point(86, 56); + this.tbxItemUrl.Name = "tbxItemUrl"; + this.tbxItemUrl.Size = new System.Drawing.Size(176, 20); + this.tbxItemUrl.TabIndex = 15; + // + // tbxItemImage + // + this.tbxItemImage.Location = new System.Drawing.Point(86, 82); + this.tbxItemImage.Name = "tbxItemImage"; + this.tbxItemImage.Size = new System.Drawing.Size(176, 20); + this.tbxItemImage.TabIndex = 16; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(57, 56); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(23, 13); + this.label8.TabIndex = 18; + this.label8.Text = "Url:"; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(42, 30); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(38, 13); + this.label7.TabIndex = 17; + this.label7.Text = "Name:"; + // + // bttnAdd + // + this.bttnAdd.Location = new System.Drawing.Point(354, 13); + this.bttnAdd.Name = "bttnAdd"; + this.bttnAdd.Size = new System.Drawing.Size(75, 23); + this.bttnAdd.TabIndex = 15; + this.bttnAdd.Text = "Add"; + this.bttnAdd.UseVisualStyleBackColor = true; + this.bttnAdd.Click += new System.EventHandler(this.bttnAdd_Click_1); + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(17, 18); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(59, 13); + this.label6.TabIndex = 14; + this.label6.Text = "XML Feed:"; + // + // bttnBrowseRss + // + this.bttnBrowseRss.Location = new System.Drawing.Point(435, 13); + this.bttnBrowseRss.Name = "bttnBrowseRss"; + this.bttnBrowseRss.Size = new System.Drawing.Size(75, 23); + this.bttnBrowseRss.TabIndex = 13; + this.bttnBrowseRss.Text = "Browse"; + this.bttnBrowseRss.UseVisualStyleBackColor = true; + this.bttnBrowseRss.Click += new System.EventHandler(this.button1_Click_1); + // + // tbxUrl + // + this.tbxUrl.Location = new System.Drawing.Point(77, 15); + this.tbxUrl.Name = "tbxUrl"; + this.tbxUrl.Size = new System.Drawing.Size(269, 20); + this.tbxUrl.TabIndex = 12; + // + // tvList + // + this.tvList.AllowDrop = true; + this.tvList.Location = new System.Drawing.Point(15, 51); + this.tvList.Name = "tvList"; + this.tvList.Size = new System.Drawing.Size(301, 398); + this.tvList.TabIndex = 13; + this.tvList.DragDrop += new System.Windows.Forms.DragEventHandler(this.tvList_DragDrop); + this.tvList.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tvList_AfterSelect); + this.tvList.DragEnter += new System.Windows.Forms.DragEventHandler(this.tvList_DragEnter); + this.tvList.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.tvList_ItemDrag); + // + // openFileDialog1 + // + this.openFileDialog1.FileName = "openFileDialog1"; + // + // bttnCancel + // + this.bttnCancel.Location = new System.Drawing.Point(102, 462); + this.bttnCancel.Name = "bttnCancel"; + this.bttnCancel.Size = new System.Drawing.Size(75, 23); + this.bttnCancel.TabIndex = 22; + this.bttnCancel.Text = "Cancel"; + this.bttnCancel.UseVisualStyleBackColor = true; + this.bttnCancel.Click += new System.EventHandler(this.bttnCancel_Click); + // + // RssBaseSetupForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(626, 499); + this.Controls.Add(this.bttnCancel); + this.Controls.Add(this.gbDetail); + this.Controls.Add(this.bttnAdd); + this.Controls.Add(this.bttnOK); + this.Controls.Add(this.label6); + this.Controls.Add(this.tvList); + this.Controls.Add(this.bttnBrowseRss); + this.Controls.Add(this.tbxUrl); + this.Name = "RssBaseSetupForm"; + this.Text = "RSS Setup"; + this.Load += new System.EventHandler(this.SetupForm_Load); + this.gbDetail.ResumeLayout(false); + this.gbDetail.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); } @@ -262,5 +302,9 @@ private System.Windows.Forms.Button bttnAddDetail; private System.Windows.Forms.Button bttnDelete; private System.Windows.Forms.Button bttnCancel; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox tbxReplacement; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox tbxPattern; } } \ No newline at end of file Modified: trunk/plugins/MyTorrents/c3o.Plugins/Shared/RssBaseSetupForm.cs =================================================================== --- trunk/plugins/MyTorrents/c3o.Plugins/Shared/RssBaseSetupForm.cs 2007-09-26 07:34:18 UTC (rev 956) +++ trunk/plugins/MyTorrents/c3o.Plugins/Shared/RssBaseSetupForm.cs 2007-09-26 22:16:15 UTC (rev 957) @@ -421,6 +421,8 @@ this.tbxItemName.Text = item.text; this.tbxItemUrl.Text = item.url; this.tbxItemImage.Text = item.image; + this.tbxPattern.Text = item.search; + this.tbxReplacement.Text = item.replace; } } } @@ -439,7 +441,9 @@ item.text = this.tbxItemName.Text; item.url = this.tbxItemUrl.Text; item.image = this.tbxItemImage.Text; - + item.search = this.tbxPattern.Text; + item.replace = this.tbxReplacement.Text; + tn.Text = this.tbxItemName.Text; tn.Tag = item; @@ -522,7 +526,7 @@ if (tn != null) { - OpmlOutline item = new OpmlOutline(this.tbxItemName.Text, "link", this.tbxItemUrl.Text, this.tbxItemImage.Text, null, null); + OpmlOutline item = new OpmlOutline(this.tbxItemName.Text, "link", this.tbxItemUrl.Text, this.tbxItemImage.Text, this.tbxPattern.Text, this.tbxReplacement.Text, null, null); TreeNode newtn = tn.Nodes.Add(this.tbxItemName.Text); Modified: trunk/plugins/MyTorrents/c3o.Plugins/Web/Opml.cs =================================================================== --- trunk/plugins/MyTorrents/c3o.Plugins/Web/Opml.cs 2007-09-26 07:34:18 UTC (rev 956) +++ trunk/plugins/MyTorrents/c3o.Plugins/Web/Opml.cs 2007-09-26 22:16:15 UTC (rev 957) @@ -160,12 +160,14 @@ public string type; public string url; public string image; + public string search; + public string replace; public OpmlOutline[] outlines; public OpmlOutline parent = null; public OpmlBody body = null; public bool isDeleted = false; - public OpmlOutline(string text, string type, string url, string image, OpmlBody body, OpmlOutline parent) + public OpmlOutline(string text, string type, string url, string image, OpmlBody body, OpmlOutline parent) { this.text = text; this.type = type; @@ -173,8 +175,22 @@ this.parent = parent; this.body = body; this.image = image; + this.search = null; + this.replace = null; } + public OpmlOutline(string text, string type, string url, string image, string search, string replace, OpmlBody body, OpmlOutline parent) + { + this.text = text; + this.type = type; + this.url = url; + this.parent = parent; + this.body = body; + this.image = image; + this.search = search; + this.replace = replace; + } + public OpmlOutline(XmlNode parentNode, OpmlBody body ) { this.body = body; @@ -220,6 +236,12 @@ case "itunes:image_href": this.image = attribute.Value; break; + case "search": + this.search = attribute.Value; + break; + case "replace": + this.replace = attribute.Value; + break; default: this.Add(attribute.Name, attribute.Value); break; @@ -245,6 +267,8 @@ xmlOutline.SetAttribute("url", this.url); xmlOutline.SetAttribute("image", this.image); xmlOutline.SetAttribute("type", this.type); + xmlOutline.SetAttribute("search", this.search); + xmlOutline.SetAttribute("replace", this.replace); foreach (string key in this.Keys) { Modified: trunk/plugins/MyTorrents/c3o.Plugins/Web/RSSReader.cs =================================================================== --- trunk/plugins/MyTorrents/c3o.Plugins/Web/RSSReader.cs 2007-09-26 07:34:18 UTC (rev 956) +++ trunk/plugins/MyTorrents/c3o.Plugins/Web/RSSReader.cs 2007-09-26 22:16:15 UTC (rev 957) @@ -3,6 +3,7 @@ using System.Text; using System.Data; using System.Xml; +using System.Text.RegularExpressions; namespace c3o.Framework.Web { @@ -10,20 +11,36 @@ { public DataTable Header = null; public DataTable Detail = null; + private SiteReader sr; + public string TorrentPath = "Torrents"; public RssReader(string url) { - SiteReader sr = new SiteReader(); - XmlDocument xml = new XmlDocument(); + this.LoadData(url, null, null); - // Read rss feed into XmlDocument - xml.LoadXml(sr.ReadPage(url)); + //SiteReader sr = new SiteReader(); + //XmlDocument xml = new XmlDocument(); - this.LoadData(xml); + //// Read rss feed into XmlDocument + //xml.LoadXml(sr.ReadPage(url)); + + //this.LoadData(xml); } + public RssReader(string url, string pattern, string replacement) + { + this.sr = new SiteReader(); + + this.LoadData(url, pattern, replacement); + } + + public RssReader(XmlDocument xml) { + this.sr = new SiteReader(); + + this.LoadData(xml); + //XmlDocument xml = new XmlDocument(); // Read rss feed into XmlDocument @@ -34,10 +51,29 @@ //// Load items into datatable //this.Detail = this.GetRssItems(xml); - this.LoadData(xml); + } + public void LoadData(string url, string pattern, string replacement) + { + XmlDocument xml = new XmlDocument(); + + // Read rss feed into XmlDocument + string xmlstring = this.sr.ReadPage(url); + + if (pattern != null && pattern.Length > 0 && replacement != null && replacement.Length > 0) + { + Regex reg = new Regex(pattern); + xmlstring = reg.Replace(xmlstring, replacement); + } + + xml.LoadXml(xmlstring); + + this.LoadData(xml); + } + + public void LoadData(XmlDocument xml) { // Load header into datatable @@ -47,6 +83,33 @@ this.Detail = this.GetRssItems(xml); } + + + + public void DownloadTorrent(string url) + { + int i = 1; + if (url != null && url.Length > 0) + { + if (!System.IO.Directory.Exists(this.TorrentPath)) System.IO.Directory.CreateDirectory(this.TorrentPath); + + // Find file name + string FileName = this.TorrentPath + @"\temp" + i.ToString() + ".torrent"; + while (System.IO.File.Exists(FileName)) + { + i++; + FileName = this.TorrentPath + @"\temp" + i.ToString() + ".torrent"; + } + + // Save Torrent file to disk + this.sr.Download(url, FileName); + + // Launch client + System.Diagnostics.Process.Start(FileName); + } + } + + public DataTable GetRssHeader(XmlDocument xml) { DataTable dt = null; Modified: trunk/plugins/MyTorrents/c3o.Plugins/Web/SiteReader.cs =================================================================== --- trunk/plugins/MyTorrents/c3o.Plugins/Web/SiteReader.cs 2007-09-26 07:34:18 UTC (rev 956) +++ trunk/plugins/MyTorrents/c3o.Plugins/Web/SiteReader.cs 2007-09-26 22:16:15 UTC (rev 957) @@ -6,7 +6,7 @@ { public class SiteReader { - private CookieContainer cookies; + private CookieContainer cookies = new CookieContainer(); public SiteReader() { @@ -57,7 +57,7 @@ /// <returns></returns> public string ReadPage(string url) { - return WebHelper.ReadPage(url, cookies); + return WebHelper.ReadPage(url, ref cookies); //// Setup the request //HttpWebRequest wr = WebRequest.Create(url) as HttpWebRequest; @@ -81,7 +81,7 @@ /// <returns></returns> public byte[] ReadFile(string url) { - return WebHelper.ReadFile(url, cookies); + return WebHelper.ReadFile(url, ref cookies); //byte[] result; //byte[] buffer = new byte[4096]; @@ -121,7 +121,7 @@ /// <param name="filename"></param> public void Download(string url, string filename) { - WebHelper.Download(url, filename, cookies); + WebHelper.Download(url, filename, ref cookies); //byte[] FileData = this.ReadFile(url); Modified: trunk/plugins/MyTorrents/c3o.Plugins/Web/WebHelper.cs =================================================================== --- trunk/plugins/MyTorrents/c3o.Plugins/Web/WebHelper.cs 2007-09-26 07:34:18 UTC (rev 956) +++ trunk/plugins/MyTorrents/c3o.Plugins/Web/WebHelper.cs 2007-09-26 22:16:15 UTC (rev 957) @@ -51,7 +51,7 @@ /// </summary> /// <param name="url"></param> /// <returns></returns> - public static string ReadPage(string url, CookieContainer cookies) + public static string ReadPage(string url, ref CookieContainer cookies) { // Setup the request HttpWebRequest wr = WebRequest.Create(url) as HttpWebRequest; @@ -73,7 +73,7 @@ /// </summary> /// <param name="url"></param> /// <returns></returns> - public static byte[] ReadFile(string url, CookieContainer cookies) + public static byte[] ReadFile(string url, ref CookieContainer cookies) { byte[] result; byte[] buffer = new byte[4096]; @@ -111,9 +111,9 @@ /// </summary> /// <param name="url"></param> /// <param name="filename"></param> - public static void Download(string url, string filename, CookieContainer cookies) + public static void Download(string url, string filename, ref CookieContainer cookies) { - byte[] FileData = ReadFile(url, cookies); + byte[] FileData = ReadFile(url, ref cookies); // Create file FileStream fs = File.Create(filename); Modified: trunk/plugins/MyTorrents/c3o.Plugins/Web/uTorrentData.cs =================================================================== --- trunk/plugins/MyTorrents/c3o.Plugins/Web/uTorrentData.cs 2007-09-26 07:34:18 UTC (rev 956) +++ trunk/plugins/MyTorrents/c3o.Plugins/Web/uTorrentData.cs 2007-09-26 22:16:15 UTC (rev 957) @@ -54,41 +54,54 @@ if (JsonData != null) { // Clean up string + JsonData = JsonData.Replace("'", ""); // Remove Any single quotes + JsonData = JsonData.Replace("\"", "'"); JsonData = JsonData.Replace("\n\r", ""); JsonData = JsonData.Replace("\r\n", ""); JsonData = JsonData.Replace("\n", ""); JsonData = JsonData.Replace("\r", ""); - JsonData = JsonData.Replace("{\"\":\"\",\"label\": [],\"torrents\":", ""); - JsonData = JsonData.Replace("[[", "["); - JsonData = JsonData.Substring(0, (JsonData.IndexOf("]]") + 1)); - JsonData = JsonData.Replace("],[", "]\n\r["); - JsonData = JsonData.Replace("[", "#"); - JsonData = JsonData.Replace("]", "#"); + string start = "'torrents':"; + JsonData = JsonData.Substring(JsonData.IndexOf("'torrents':") + start.Length); + + // Replace [ outside of quotes with #[# + Regex reg = new Regex("\\[(?=([^']*'[^']*')*(?![^']*'))"); + JsonData = reg.Replace(JsonData, "<<<"); + + // Replace ] outside of quotes with #]# + reg = new Regex("\\](?=([^']*'[^']*')*(?![^']*'))"); + JsonData = reg.Replace(JsonData, ">>>"); + + JsonData = JsonData.Replace("<<<<<<", "<<<"); + JsonData = JsonData.Replace("<<< <<<", "<<<"); + JsonData = JsonData.Substring(0, (JsonData.IndexOf(">>>>>>") + 3)); + JsonData = JsonData.Replace(">>>, <<<", ">>>\n\r<<<"); + JsonData = JsonData.Replace(">>>,<<<", ">>>\n\r<<<"); + // Create DataTable to hold list dt = new DataTable(); dt.Columns.Add("key", typeof(string)); - dt.Columns.Add("status", typeof(Int64)); + dt.Columns.Add("status", typeof(Int64)); dt.Columns.Add("FileName", typeof(string)); - dt.Columns.Add("Size", typeof(Int64)); - dt.Columns.Add("percentage", typeof(Int64)); - dt.Columns.Add("bytes", typeof(Int64)); + dt.Columns.Add("Size", typeof(Int64)); + dt.Columns.Add("percentage", typeof(Int64)); + dt.Columns.Add("bytes", typeof(Int64)); dt.Columns.Add("i5", typeof(Int64)); - dt.Columns.Add("ratio", typeof(Int64)); // 24 = 0.024 - dt.Columns.Add("UpSpeed", typeof(Int64)); - dt.Columns.Add("DownSpeed", typeof(Int64)); - dt.Columns.Add("i9", typeof(Int64)); + dt.Columns.Add("ratio", typeof(Int64)); // 24 = 0.024 + dt.Columns.Add("UpSpeed", typeof(Int64)); + dt.Columns.Add("DownSpeed", typeof(Int64)); + dt.Columns.Add("ETA", typeof(Int64)); dt.Columns.Add("s1", typeof(string)); - dt.Columns.Add("peers", typeof(int)); + dt.Columns.Add("peers", typeof(int)); dt.Columns.Add("peers2", typeof(int)); dt.Columns.Add("seeds", typeof(int)); dt.Columns.Add("seeds2", typeof(int)); - dt.Columns.Add("i14", typeof(Int64)); - dt.Columns.Add("i15", typeof(Int64)); - dt.Columns.Add("i16", typeof(Int64)); + dt.Columns.Add("i14", typeof(Int64)); + dt.Columns.Add("i15", typeof(Int64)); + dt.Columns.Add("i16", typeof(Int64)); // Regular Expression to parse data - string pattern = @"#(?<row>.*)#"; + string pattern = @"<<<(?<row>.*)>>>"; // Find data MatchCollection mc = Regex.Matches(JsonData, pattern); @@ -100,12 +113,16 @@ string RowString... [truncated message content] |
From: <an...@us...> - 2007-09-26 07:34:30
|
Revision: 956 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=956&view=rev Author: and-81 Date: 2007-09-26 00:34:18 -0700 (Wed, 26 Sep 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.Designer.cs trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs trunk/plugins/IR Server Suite/Applications/Translator/Configuration.cs trunk/plugins/IR Server Suite/Applications/Translator/EventSchedule.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.Designer.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/EditProgramForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/GetKeyCodeForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Program.cs trunk/plugins/IR Server Suite/Applications/Translator/Translator.csproj trunk/plugins/IR Server Suite/Applications/Tray Launcher/GetKeyCodeForm.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/Setup.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/RemoteButton.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs trunk/plugins/IR Server Suite/Common/IrssComms/Client.cs trunk/plugins/IR Server Suite/Common/IrssComms/ClientManager.cs trunk/plugins/IR Server Suite/Common/IrssComms/IrssMessage.cs trunk/plugins/IR Server Suite/Common/IrssComms/MessageManagerCombo.cs trunk/plugins/IR Server Suite/Common/IrssComms/Server.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/ServerAddress.Designer.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/ServerAddress.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/ServerAddress.resx trunk/plugins/IR Server Suite/Common/IrssUtils/IrssLog.cs trunk/plugins/IR Server Suite/Common/IrssUtils/IrssUtils.csproj trunk/plugins/IR Server Suite/Common/IrssUtils/Win32.cs trunk/plugins/IR Server Suite/Common/MPUtils/ExternalChannelConfig.cs trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IRServerPluginInterface.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/CSocketPacket.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Advanced.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverReplacement.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverVista.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverXP.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrCode.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrDecoder.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Keyboard.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MceDetectionData.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Mouse.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/NotifyWindow.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Pronto.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/RemoteDetectionData.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Win32ErrorCodes.cs trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/UirtTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/CreateIRFile.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLircServer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/ReceiverWindow.cs trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Windows Message Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/X10Transceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/XBCDRC Receiver/XBCDRC Receiver.cs trunk/plugins/IR Server Suite/IR Server Suite.sln trunk/plugins/IR Server Suite/Input Service/InputService.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/SetupForm.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/SetupForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MP Blast Zone Plugin.csproj trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MPBlastZonePlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Menu.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/MultiMapNameBox.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/InputMapper/InputHandler.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/InputMapper/InputMappingForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MP Control Plugin.csproj trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MappedEvent.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/ExternalChannels.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/SetupForm.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/SetupForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/SetupForm.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/StbSetup.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2 Blaster Plugin.csproj trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/ExternalChannels.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/PluginSetup.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/PluginSetup.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/StbSetup.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3 Blaster Plugin.csproj trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs Removed Paths: ------------- trunk/plugins/IR Server Suite/Applications/Translator/Forms/BlastCommand.Designer.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/BlastCommand.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/BlastCommand.resx trunk/plugins/IR Server Suite/Applications/Translator/Forms/LearnIR.Designer.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/LearnIR.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/LearnIR.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/BlastCommand.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/BlastCommand.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/BlastCommand.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/LearnIR.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/LearnIR.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/LearnIR.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/BlastCommand.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/BlastCommand.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/BlastCommand.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/LearnIR.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/LearnIR.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/LearnIR.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/BlastCommand.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/BlastCommand.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/BlastCommand.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/LearnIR.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/LearnIR.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/LearnIR.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/BlastCommand.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/BlastCommand.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/BlastCommand.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/LearnIR.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/LearnIR.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/LearnIR.resx Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.Designer.cs 2007-09-24 19:20:56 UTC (rev 955) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.Designer.cs 2007-09-26 07:34:18 UTC (rev 956) @@ -37,7 +37,6 @@ this.buttonDisconnect = new System.Windows.Forms.Button(); this.buttonShutdownServer = new System.Windows.Forms.Button(); this.listBoxStatus = new System.Windows.Forms.ListBox(); - this.buttonPing = new System.Windows.Forms.Button(); this.groupBoxStatus = new System.Windows.Forms.GroupBox(); this.groupBoxRemoteButton = new System.Windows.Forms.GroupBox(); this.labelCustomButton = new System.Windows.Forms.Label(); @@ -141,18 +140,6 @@ this.listBoxStatus.TabIndex = 0; this.toolTips.SetToolTip(this.listBoxStatus, "Status messages"); // - // buttonPing - // - this.buttonPing.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonPing.Location = new System.Drawing.Point(296, 16); - this.buttonPing.Name = "buttonPing"; - this.buttonPing.Size = new System.Drawing.Size(64, 24); - this.buttonPing.TabIndex = 3; - this.buttonPing.Text = "Ping"; - this.toolTips.SetToolTip(this.buttonPing, "Ping the server"); - this.buttonPing.UseVisualStyleBackColor = true; - this.buttonPing.Click += new System.EventHandler(this.buttonPing_Click); - // // groupBoxStatus // this.groupBoxStatus.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) @@ -266,7 +253,6 @@ this.groupBoxCommands.Controls.Add(this.buttonBlast); this.groupBoxCommands.Controls.Add(this.buttonLearnIR); this.groupBoxCommands.Controls.Add(this.buttonShutdownServer); - this.groupBoxCommands.Controls.Add(this.buttonPing); this.groupBoxCommands.Location = new System.Drawing.Point(8, 80); this.groupBoxCommands.Name = "groupBoxCommands"; this.groupBoxCommands.Size = new System.Drawing.Size(440, 48); @@ -343,7 +329,6 @@ private System.Windows.Forms.Button buttonDisconnect; private System.Windows.Forms.Button buttonShutdownServer; private System.Windows.Forms.ListBox listBoxStatus; - private System.Windows.Forms.Button buttonPing; private System.Windows.Forms.GroupBox groupBoxStatus; private System.Windows.Forms.GroupBox groupBoxRemoteButton; private System.Windows.Forms.NumericUpDown numericUpDownButton; Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-09-24 19:20:56 UTC (rev 955) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-09-26 07:34:18 UTC (rev 956) @@ -20,7 +20,7 @@ namespace DebugClient { - public partial class MainForm : Form + partial class MainForm : Form { #region Enumerations @@ -107,11 +107,10 @@ Client _client = null; - string _serverHost = Environment.MachineName; + string _serverHost = "localhost"; string _learnIRFilename = null; bool _registered = false; - int _echoID = -1; IRServerInfo _irServerInfo = new IRServerInfo(); @@ -143,12 +142,14 @@ comboBoxPort.Items.Add("None"); comboBoxPort.SelectedIndex = 0; + comboBoxComputer.Items.Clear(); + comboBoxComputer.Items.Add("localhost"); + ArrayList networkPCs = IrssUtils.Win32.GetNetworkComputers(); if (networkPCs != null) - { comboBoxComputer.Items.AddRange(networkPCs.ToArray()); - comboBoxComputer.Text = _serverHost; - } + + comboBoxComputer.Text = _serverHost; } private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { @@ -192,9 +193,8 @@ { byte[] dataBytes = received.DataAsBytes; - FileStream file = new FileStream(_learnIRFilename, FileMode.Create); - file.Write(dataBytes, 0, dataBytes.Length); - file.Close(); + using (FileStream file = File.Create(_learnIRFilename)) + file.Write(dataBytes, 0, dataBytes.Length); } _learnIRFilename = null; @@ -204,10 +204,6 @@ _registered = false; return; - case MessageType.Echo: - _echoID = BitConverter.ToInt32(received.DataAsBytes, 0); - return; - case MessageType.Error: _learnIRFilename = null; this.Invoke(_addStatusLine, new Object[] { received.DataAsString }); @@ -247,21 +243,21 @@ { try { - if (!File.Exists(fileName)) - return false; + using (FileStream file = File.OpenRead(fileName)) + { + if (file.Length == 0) + throw new IOException(String.Format("Cannot Blast. IR file \"{0}\" has no data, possible IR learn failure", fileName)); - FileStream file = new FileStream(fileName, FileMode.Open); + byte[] outData = new byte[4 + port.Length + file.Length]; - byte[] outData = new byte[4 + port.Length + file.Length]; + BitConverter.GetBytes(port.Length).CopyTo(outData, 0); + Encoding.ASCII.GetBytes(port).CopyTo(outData, 4); - BitConverter.GetBytes(port.Length).CopyTo(outData, 0); - Encoding.ASCII.GetBytes(port).CopyTo(outData, 4); + file.Read(outData, 4 + port.Length, (int)file.Length); - file.Read(outData, 4 + port.Length, (int)file.Length); - file.Close(); - - IrssMessage message = new IrssMessage(MessageType.BlastIR, MessageFlags.Request, outData); - _client.Send(message); + IrssMessage message = new IrssMessage(MessageType.BlastIR, MessageFlags.Request, outData); + _client.Send(message); + } } catch (Exception ex) { @@ -303,16 +299,14 @@ Thread.Sleep(1000); } - bool StartClient() + bool StartClient(IPEndPoint endPoint) { if (_client != null) return false; ClientMessageSink sink = new ClientMessageSink(ReceivedMessage); - IPAddress serverAddress = Client.GetIPFromName(_serverHost); - - _client = new Client(serverAddress, 24000, sink); + _client = new Client(endPoint, sink); _client.CommsFailureCallback = new WaitCallback(CommsFailure); _client.ConnectCallback = new WaitCallback(Connected); _client.DisconnectCallback = new WaitCallback(Disconnected); @@ -332,7 +326,7 @@ if (_client == null) return; - _client.Stop(); + _client.Dispose(); _client = null; } @@ -353,7 +347,10 @@ _serverHost = comboBoxComputer.Text; - StartClient(); + IPAddress serverIP = Client.GetIPFromName(_serverHost); + IPEndPoint endPoint = new IPEndPoint(serverIP, IrssComms.Server.DefaultPort); + + StartClient(endPoint); } catch (Exception ex) { @@ -465,33 +462,7 @@ AddStatusLine(ex.Message); } } - private void buttonPing_Click(object sender, EventArgs e) - { - AddStatusLine("Ping Server"); - if (_client == null) - { - AddStatusLine(" - Not connected"); - return; - } - - if (!_client.Connected) - { - AddStatusLine(" - Connecting..."); - return; - } - - try - { - IrssMessage message = new IrssMessage(MessageType.Ping, MessageFlags.Request, BitConverter.GetBytes(24)); - _client.Send(message); - } - catch (Exception ex) - { - AddStatusLine(ex.Message); - } - } - private void comboBoxRemoteButtons_SelectedIndexChanged(object sender, EventArgs e) { if (comboBoxRemoteButtons.SelectedItem.ToString() == "Custom") Modified: trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2007-09-24 19:20:56 UTC (rev 955) +++ trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2007-09-26 07:34:18 UTC (rev 956) @@ -24,7 +24,6 @@ static Client _client = null; static bool _registered = false; - static int _echoID = -1; static string _serverHost = null; @@ -87,70 +86,76 @@ ShowHelp(); } - else if (StartClient()) + else { - Thread.Sleep(250); + IPAddress serverIP = Client.GetIPFromName(_serverHost); - // Wait for registered ... Give up after 10 seconds ... - int attempt = 0; - while (!_registered) + IPEndPoint endPoint = new IPEndPoint(serverIP, IrssComms.Server.DefaultPort); + + if (StartClient(endPoint)) { - if (++attempt >= 10) - break; - else - Thread.Sleep(1000); - } + Thread.Sleep(250); - if (_registered) - { - string fileName; - foreach (String command in irCommands) + // Wait for registered ... Give up after 10 seconds ... + int attempt = 0; + while (!_registered) { - if (_treatAsChannelNumber) + if (++attempt >= 10) + break; + else + Thread.Sleep(1000); + } + + if (_registered) + { + string fileName; + foreach (String command in irCommands) { - Info("Processing channel: {0}", command); - - StringBuilder channelNumber = new StringBuilder(command); - - if (_padChannelNumber > 0) + if (_treatAsChannelNumber) { - for (int index = 0; index < _padChannelNumber - command.Length; index++) - channelNumber.Insert(0, '0'); + Info("Processing channel: {0}", command); - Info("Padding channel number: {0} becomes {1}", command, channelNumber.ToString()); - } + StringBuilder channelNumber = new StringBuilder(command); - foreach (char digit in channelNumber.ToString()) - { - if (digit.Equals('~')) + if (_padChannelNumber > 0) { - Thread.Sleep(500); + for (int index = 0; index < _padChannelNumber - command.Length; index++) + channelNumber.Insert(0, '0'); + + Info("Padding channel number: {0} becomes {1}", command, channelNumber.ToString()); } - else + + foreach (char digit in channelNumber.ToString()) { - fileName = Common.FolderIRCommands + digit + Common.FileExtensionIR; - BlastIR(fileName, _blastPort); + if (digit.Equals('~')) + { + Thread.Sleep(500); + } + else + { + fileName = Common.FolderIRCommands + digit + Common.FileExtensionIR; + BlastIR(fileName, _blastPort); + } } } + else if (command.StartsWith("~")) + { + Thread.Sleep(command.Length * 500); + } + else + { + fileName = Common.FolderIRCommands + command; + BlastIR(fileName, _blastPort); + } } - else if (command.StartsWith("~")) - { - Thread.Sleep(command.Length * 500); - } - else - { - fileName = Common.FolderIRCommands + command; - BlastIR(fileName, _blastPort); - } + + Thread.Sleep(500); } - - Thread.Sleep(500); + else + { + Warn("Failed to register with server host \"{0}\", blasting not sent", _serverHost); + } } - else - { - Warn("Failed to register with server host \"{0}\", blasting not sent", _serverHost); - } - } } else // Give help ... @@ -240,16 +245,14 @@ Thread.Sleep(1000); } - static bool StartClient() + static bool StartClient(IPEndPoint endPoint) { if (_client != null) return false; ClientMessageSink sink = new ClientMessageSink(ReceivedMessage); - IPAddress serverAddress = Client.GetIPFromName(_serverHost); - - _client = new Client(serverAddress, 24000, sink); + _client = new Client(endPoint, sink); _client.CommsFailureCallback = new WaitCallback(CommsFailure); _client.ConnectCallback = new WaitCallback(Connected); _client.DisconnectCallback = new WaitCallback(Disconnected); @@ -269,7 +272,7 @@ if (_client == null) return; - _client.Stop(); + _client.Dispose(); _client = null; } @@ -307,10 +310,6 @@ Warn("IR Server Shutdown - Blasting disabled until IR Server returns"); break; - case MessageType.Echo: - _echoID = BitConverter.ToInt32(received.DataAsBytes, 0); - break; - case MessageType.Error: Warn(received.DataAsString); break; @@ -324,18 +323,21 @@ static void BlastIR(string fileName, string port) { - FileStream file = new FileStream(fileName, FileMode.Open); + using (FileStream file = File.OpenRead(fileName)) + { + if (file.Length == 0) + throw new IOException(String.Format("Cannot Blast. IR file \"{0}\" has no data, possible IR learn failure", fileName)); - byte[] outData = new byte[4 + port.Length + file.Length]; + byte[] outData = new byte[4 + port.Length + file.Length]; - BitConverter.GetBytes(port.Length).CopyTo(outData, 0); - Encoding.ASCII.GetBytes(port).CopyTo(outData, 4); + BitConverter.GetBytes(port.Length).CopyTo(outData, 0); + Encoding.ASCII.GetBytes(port).CopyTo(outData, 4); - file.Read(outData, 4 + port.Length, (int)file.Length); - file.Close(); + file.Read(outData, 4 + port.Length, (int)file.Length); - IrssMessage message = new IrssMessage(MessageType.BlastIR, MessageFlags.Request | MessageFlags.ForceNotRespond, outData); - _client.Send(message); + IrssMessage message = new IrssMessage(MessageType.BlastIR, MessageFlags.Request | MessageFlags.ForceNotRespond, outData); + _client.Send(message); + } } #region Log Commands Modified: trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2007-09-24 19:20:56 UTC (rev 955) +++ trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2007-09-26 07:34:18 UTC (rev 956) @@ -25,7 +25,6 @@ static Client _client = null; static bool _registered = false; - static int _echoID = -1; static string _serverHost = null; @@ -86,69 +85,77 @@ ShowHelp(); } - else if (StartClient()) + else { - Thread.Sleep(250); + IPAddress serverIP = Client.GetIPFromName(_serverHost); - // Wait for registered ... Give up after 10 seconds ... - int attempt = 0; - while (!_registered) + IPEndPoint endPoint = new IPEndPoint(serverIP, IrssComms.Server.DefaultPort); + + if (StartClient(endPoint)) { - if (++attempt >= 10) - break; - else - Thread.Sleep(1000); - } + Thread.Sleep(250); - if (_registered) - { - string fileName; - foreach (String command in irCommands) + // Wait for registered ... Give up after 10 seconds ... + int attempt = 0; + while (!_registered) { - if (_treatAsChannelNumber) + if (++attempt >= 10) + break; + else + Thread.Sleep(1000); + } + + if (_registered) + { + string fileName; + foreach (String command in irCommands) { - IrssLog.Info("Processing channel: {0}", command); - - StringBuilder channelNumber = new StringBuilder(command); - - if (_padChannelNumber > 0) + if (_treatAsChannelNumber) { - for (int index = 0; index < _padChannelNumber - command.Length; index++) - channelNumber.Insert(0, '0'); + IrssLog.Info("Processing channel: {0}", command); - IrssLog.Info("Padding channel number: {0} becomes {1}", command, channelNumber.ToString()); - } + StringBuilder channelNumber = new StringBuilder(command); - foreach (char digit in channelNumber.ToString()) - { - if (digit.Equals('~')) + if (_padChannelNumber > 0) { - Thread.Sleep(500); + for (int index = 0; index < _padChannelNumber - command.Length; index++) + channelNumber.Insert(0, '0'); + + IrssLog.Info("Padding channel number: {0} becomes {1}", command, channelNumber.ToString()); } - else + + foreach (char digit in channelNumber.ToString()) { - fileName = Common.FolderIRCommands + digit + Common.FileExtensionIR; - BlastIR(fileName, _blastPort); + if (digit.Equals('~')) + { + Thread.Sleep(500); + } + else + { + fileName = Common.FolderIRCommands + digit + Common.FileExtensionIR; + BlastIR(fileName, _blastPort); + } } } + else if (command.StartsWith("~")) + { + Thread.Sleep(command.Length * 500); + } + else + { + fileName = Common.FolderIRCommands + command; + BlastIR(fileName, _blastPort); + } } - else if (command.StartsWith("~")) - { - Thread.Sleep(command.Length * 500); - } - else - { - fileName = Common.FolderIRCommands + command; - BlastIR(fileName, _blastPort); - } + + Thread.Sleep(500); } + else + { + IrssLog.Warn("Failed to register with server host \"{0}\", blasting not sent", _serverHost); + } - Thread.Sleep(500); } - else - { - IrssLog.Warn("Failed to register with server host \"{0}\", blasting not sent", _serverHost); - } } } @@ -202,16 +209,14 @@ Thread.Sleep(1000); } - static bool StartClient() + static bool StartClient(IPEndPoint endPoint) { if (_client != null) return false; ClientMessageSink sink = new ClientMessageSink(ReceivedMessage); - IPAddress serverAddress = Client.GetIPFromName(_serverHost); - - _client = new Client(serverAddress, 24000, sink); + _client = new Client(endPoint, sink); _client.CommsFailureCallback = new WaitCallback(CommsFailure); _client.ConnectCallback = new WaitCallback(Connected); _client.DisconnectCallback = new WaitCallback(Disconnected); @@ -231,7 +236,7 @@ if (_client == null) return; - _client.Stop(); + _client.Dispose(); _client = null; } @@ -269,10 +274,6 @@ IrssLog.Warn("IR Server Shutdown - Blasting disabled until IR Server returns"); break; - case MessageType.Echo: - _echoID = BitConverter.ToInt32(received.DataAsBytes, 0); - break; - case MessageType.Error: IrssLog.Warn(received.DataAsString); break; @@ -286,18 +287,21 @@ static void BlastIR(string fileName, string port) { - FileStream file = new FileStream(fileName, FileMode.Open); + using (FileStream file = File.OpenRead(fileName)) + { + if (file.Length == 0) + throw new IOException(String.Format("Cannot Blast. IR file \"{0}\" has no data, possible IR learn failure", fileName)); - byte[] outData = new byte[4 + port.Length + file.Length]; + byte[] outData = new byte[4 + port.Length + file.Length]; - BitConverter.GetBytes(port.Length).CopyTo(outData, 0); - Encoding.ASCII.GetBytes(port).CopyTo(outData, 4); + BitConverter.GetBytes(port.Length).CopyTo(outData, 0); + Encoding.ASCII.GetBytes(port).CopyTo(outData, 4); - file.Read(outData, 4 + port.Length, (int)file.Length); - file.Close(); + file.Read(outData, 4 + port.Length, (int)file.Length); - IrssMessage message = new IrssMessage(MessageType.BlastIR, MessageFlags.Request | MessageFlags.ForceNotRespond, outData); - _client.Send(message); + IrssMessage message = new IrssMessage(MessageType.BlastIR, MessageFlags.Request | MessageFlags.ForceNotRespond, outData); + _client.Send(message); + } } } Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs 2007-09-24 19:20:56 UTC (rev 955) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs 2007-09-26 07:34:18 UTC (rev 956) @@ -15,7 +15,7 @@ namespace IRServer { - public partial class Config : Form + partial class Config : Form { #region Variables @@ -40,19 +40,24 @@ set { _hostComputer = value; } } - public string PluginReceive + public string[] PluginReceive { get { + List<string> receivers = new List<string>(); + SourceGrid.Cells.CheckBox checkBox; for (int row = 1; row < gridPlugins.RowsCount; row++) { checkBox = gridPlugins[row, 1] as SourceGrid.Cells.CheckBox; if (checkBox != null && checkBox.Checked) - return gridPlugins[row, 0].DisplayText; + receivers.Add(gridPlugins[row, 0].DisplayText); } - return String.Empty; + if (receivers.Count == 0) + return null; + else + return receivers.ToArray(); } set { @@ -63,7 +68,9 @@ if (checkBox == null) continue; - if (gridPlugins[row, 0].DisplayText.Equals(value, StringComparison.InvariantCultureIgnoreCase)) + if (value == null) + checkBox.Checked = false; + else if (Array.IndexOf<string>(value, gridPlugins[row, 0].DisplayText) != -1) checkBox.Checked = true; else checkBox.Checked = false; @@ -173,13 +180,13 @@ gridPlugins[row, 0] = nameCell; - if (transceiver is IRemoteReceiver) + if (transceiver is IRemoteReceiver || transceiver is IMouseReceiver || transceiver is IKeyboardReceiver) { SourceGrid.Cells.CheckBox checkbox = new SourceGrid.Cells.CheckBox(); - SourceGrid.Cells.Controllers.CustomEvents checkboxcontroller = new SourceGrid.Cells.Controllers.CustomEvents(); - checkboxcontroller.ValueChanged += new EventHandler(ReceiveChanged); - checkbox.Controller.AddController(checkboxcontroller); + //SourceGrid.Cells.Controllers.CustomEvents checkboxcontroller = new SourceGrid.Cells.Controllers.CustomEvents(); + //checkboxcontroller.ValueChanged += new EventHandler(ReceiveChanged); + //checkbox.Controller.AddController(checkboxcontroller); gridPlugins[row, 1] = checkbox; } @@ -259,7 +266,7 @@ if (transceiver.Name == plugin) (transceiver as IConfigure).Configure(); } - + /* private void ReceiveChanged(object sender, EventArgs e) { SourceGrid.CellContext context = (SourceGrid.CellContext)sender; @@ -277,6 +284,7 @@ checkBox.Checked = false; } } + */ private void TransmitChanged(object sender, EventArgs e) { SourceGrid.CellContext context = (SourceGrid.CellContext)sender; Modified: trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-09-24 19:20:56 UTC (rev 955) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-09-26 07:34:18 UTC (rev 956) @@ -62,18 +62,16 @@ Server _server = null; Client _client = null; - int _serverPort = 24000; - IRServerMode _mode; string _hostComputer; bool _registered = false; // Used for relay and repeater modes. - string _pluginNameReceive = String.Empty; - IRServerPlugin _pluginReceive = null; + string[] _pluginNameReceive; + IRServerPlugin[] _pluginReceive; - string _pluginNameTransmit = String.Empty; - IRServerPlugin _pluginTransmit = null; + string _pluginNameTransmit; + IRServerPlugin _pluginTransmit; bool _inConfiguration = false; @@ -115,111 +113,132 @@ _pluginReceive = null; _pluginTransmit = null; - if (String.IsNullOrEmpty(_pluginNameReceive) && String.IsNullOrEmpty(_pluginNameTransmit)) + if (_pluginNameReceive == null && String.IsNullOrEmpty(_pluginNameTransmit)) { - IrssLog.Warn("No transmit or receive plugin loaded"); + IrssLog.Warn("No transmit or receive plugins loaded"); } else { - if (String.IsNullOrEmpty(_pluginNameReceive)) + if (_pluginNameReceive == null) { - IrssLog.Warn("No receiver plugin loaded"); + IrssLog.Warn("No receiver plugins loaded"); } else { - _pluginReceive = Program.GetPlugin(_pluginNameReceive); + List<IRServerPlugin> plugins = new List<IRServerPlugin>(_pluginNameReceive.Length); + + for (int index = 0; index < _pluginNameReceive.Length; index++) + { + string pluginName = _pluginNameReceive[index]; + + IRServerPlugin plugin = Program.GetPlugin(pluginName); + + if (plugin == null) + { + IrssLog.Warn("Receiver plugin not found: {0}", pluginName); + } + else + { + plugins.Add(plugin); + + if (!String.IsNullOrEmpty(_pluginNameTransmit) && plugin.Name.Equals(_pluginNameTransmit)) + _pluginTransmit = plugin; + } + } + + _pluginReceive = plugins.ToArray(); } - if (_pluginNameTransmit.Equals(_pluginNameReceive, StringComparison.InvariantCultureIgnoreCase)) + if (String.IsNullOrEmpty(_pluginNameTransmit)) { - _pluginTransmit = _pluginReceive; - IrssLog.Info("Using the same plugin for transmit and receive"); - } - else if (String.IsNullOrEmpty(_pluginNameTransmit)) - { IrssLog.Warn("No transmit plugin loaded"); } - else + else if (_pluginTransmit != null) { _pluginTransmit = Program.GetPlugin(_pluginNameTransmit); - } + } } switch (_mode) { case IRServerMode.ServerMode: - { - StartServer(); + StartServer(); + IrssLog.Info("Started in Server Mode"); + break; - IrssLog.Info("Started in Server Mode"); - break; - } - case IRServerMode.RelayMode: - { - if (StartRelay()) - IrssLog.Info("Started in Relay Mode"); - else - IrssLog.Error("Failed to start in Relay Mode"); - break; - } + if (StartRelay()) + IrssLog.Info("Started in Relay Mode"); + else + IrssLog.Error("Failed to start in Relay Mode"); + break; case IRServerMode.RepeaterMode: - { - if (StartRepeater()) - IrssLog.Info("Started in Repeater Mode"); - else - IrssLog.Error("Failed to start in Repeater Mode"); - break; - } + if (StartRepeater()) + IrssLog.Info("Started in Repeater Mode"); + else + IrssLog.Error("Failed to start in Repeater Mode"); + break; } // Start plugin(s) ... + + bool startedTransmit = false; + if (_pluginReceive != null) { - try + foreach (IRServerPlugin plugin in _pluginReceive) { - if (_pluginReceive.Start()) - IrssLog.Info("Receiver plugin started: \"{0}\"", _pluginNameReceive); - else - IrssLog.Error("Failed to start receive plugin: \"{0}\"", _pluginNameReceive); - } - catch (Exception ex) - { - IrssLog.Error("Failed to start receive plugin: \"{0}\"", _pluginNameReceive); - IrssLog.Error(ex.ToString()); - } - } - - if (!_pluginNameTransmit.Equals(_pluginNameReceive, StringComparison.InvariantCultureIgnoreCase)) - { - if (_pluginTransmit != null) - { try { - if (_pluginTransmit.Start()) - IrssLog.Info("Transmit plugin started: \"{0}\"", _pluginNameTransmit); + if (plugin.Start()) + { + if (plugin is IRemoteReceiver) + (plugin as IRemoteReceiver).RemoteCallback += new RemoteHandler(RemoteHandlerCallback); + + if (plugin is IKeyboardReceiver) + (plugin as IKeyboardReceiver).KeyboardCallback += new KeyboardHandler(KeyboardHandlerCallback); + + if (plugin is IMouseReceiver) + (plugin as IMouseReceiver).MouseCallback += new MouseHandler(MouseHandlerCallback); + + if (plugin.Name.Equals(_pluginTransmit.Name)) + { + startedTransmit = true; + IrssLog.Info("Transmit and Receive plugin started: \"{0}\"", plugin.Name); + } + else + { + IrssLog.Info("Receiver plugin started: \"{0}\"", plugin.Name); + } + } else - IrssLog.Error("Failed to start transmit plugin: \"{0}\"", _pluginNameTransmit); + { + IrssLog.Error("Failed to start receive plugin: \"{0}\"", plugin.Name); + } } catch (Exception ex) { - IrssLog.Error("Failed to start transmit plugin: \"{0}\"", _pluginNameTransmit); + IrssLog.Error("Failed to start receive plugin: \"{0}\"", plugin.Name); IrssLog.Error(ex.ToString()); } } } - - if (_pluginReceive != null) + + if (_pluginTransmit != null && !startedTransmit) { - if (_pluginReceive is IRemoteReceiver) - (_pluginReceive as IRemoteReceiver).RemoteCallback += new RemoteHandler(RemoteHandlerCallback); - - if (_pluginReceive is IKeyboardReceiver) - (_pluginReceive as IKeyboardReceiver).KeyboardCallback += new KeyboardHandler(KeyboardHandlerCallback); - - if (_pluginReceive is IMouseReceiver) - (_pluginReceive as IMouseReceiver).MouseCallback += new MouseHandler(MouseHandlerCallback); + try + { + if (_pluginTransmit.Start()) + IrssLog.Info("Transmit plugin started: \"{0}\"", _pluginNameTransmit); + else + IrssLog.Error("Failed to start transmit plugin: \"{0}\"", _pluginNameTransmit); + } + catch (Exception ex) + { + IrssLog.Error("Failed to start transmit plugin: \"{0}\"", _pluginNameTransmit); + IrssLog.Error(ex.ToString()); + } } _notifyIcon.Visible = true; @@ -254,32 +273,52 @@ SendToAll(message); } + // Stop Plugin(s) ... + + bool stoppedTransmit = false; + if (_pluginReceive != null) { - if (_pluginReceive is IRemoteReceiver) - (_pluginReceive as IRemoteReceiver).RemoteCallback -= new RemoteHandler(RemoteHandlerCallback); - - if (_pluginReceive is IKeyboardReceiver) - (_pluginReceive as IKeyboardReceiver).KeyboardCallback -= new KeyboardHandler(KeyboardHandlerCallback); - - if (_pluginReceive is IMouseReceiver) - (_pluginReceive as IMouseReceiver).MouseCallback -= new MouseHandler(MouseHandlerCallback); + foreach (IRServerPlugin plugin in _pluginReceive) + { + try + { + if (plugin is IRemoteReceiver) + (plugin as IRemoteReceiver).RemoteCallback -= new RemoteHandler(RemoteHandlerCallback); + + if (plugin is IKeyboardReceiver) + (plugin as IKeyboardReceiver).KeyboardCallback -= new KeyboardHandler(KeyboardHandlerCallback); + + if (plugin is IMouseReceiver) + (plugin as IMouseReceiver).MouseCallback -= new MouseHandler(MouseHandlerCallback); + + plugin.Stop(); + + if (plugin == _pluginTransmit) + { + stoppedTransmit = true; + IrssLog.Info("Transmit and Receive plugin stopped: \"{0}\"", plugin.Name); + } + else + { + IrssLog.Info("Receiver plugin stopped: \"{0}\"", plugin.Name); + } + } + catch (Exception ex) + { + IrssLog.Error(ex.ToString()); + } + } + + _pluginReceive = null; } - - // Stop Plugin(s) + try { - if (_pluginReceive != null) - _pluginReceive.Stop(); - } - catch (Exception ex) - { - IrssLog.Error(ex.ToString()); - } - try - { - if (_pluginTransmit != null && _pluginTransmit != _pluginReceive) + if (_pluginTransmit != null && !stoppedTransmit) _pluginTransmit.Stop(); + + _pluginTransmit = null; } catch (Exception ex) { @@ -337,7 +376,7 @@ _pluginNameReceive = config.PluginReceive; _pluginNameTransmit = config.PluginTransmit; - SaveSettings(); // Save Settings + SaveSettings(); Start(); // Restart communications } @@ -361,7 +400,7 @@ _registeredRepeaters = new List<ClientManager>(); ServerMessageSink sink = new ServerMessageSink(ServerReceivedMessage); - _server = new Server(_serverPort, sink); + _server = new Server(Server.DefaultPort, sink); _server.Start(); } @@ -370,7 +409,7 @@ if (_server == null) return; - _server.Stop(); + _server.Dispose(); _server = null; _registeredClients.Clear(); @@ -410,16 +449,14 @@ Thread.Sleep(1000); } - bool StartClient() + bool StartClient(IPEndPoint endPoint) { if (_client != null) return false; ClientMessageSink sink = new ClientMessageSink(ClientReceivedMessage); - IPAddress serverAddress = Client.GetIPFromName(_hostComputer); - - _client = new Client(serverAddress, 24000, sink); + _client = new Client(endPoint, sink); _client.CommsFailureCallback = new WaitCallback(CommsFailure); _client.ConnectCallback = new WaitCallback(Connected); _client.DisconnectCallback = new WaitCallback(Disconnected); @@ -439,17 +476,21 @@ if (_client == null) return; - _client.Stop(); + _client.Dispose(); _client = null; } - + bool StartRelay() { try { StartServer(); - StartClient(); + IPAddress serverIP = Client.GetIPFromName(_hostComputer); + IPEndPoint endPoint = new IPEndPoint(serverIP, IrssComms.Server.DefaultPort); + + StartClient(endPoint); + return true; } catch (Exception ex) @@ -473,8 +514,12 @@ try { StartServer(); - StartClient(); + IPAddress serverIP = Client.GetIPFromName(_hostComputer); + IPEndPoint endPoint = new IPEndPoint(serverIP, IrssComms.Server.DefaultPort); + + StartClient(endPoint); + return true; } catch (Exception ex) @@ -604,30 +649,55 @@ { IrssLog.Info("Resume from standby ..."); + bool resumedTransmit = false; + if (_pluginReceive != null) - _pluginReceive.Resume(); + { + foreach (IRServerPlugin plugin in _pluginReceive) + { + if (_pluginTransmit == plugin) + resumedTransmit = true; - if (_pluginTransmit != null && _pluginTransmit != _pluginReceive) + plugin.Resume(); + } + } + + if (_pluginTransmit != null && !resumedTransmit) _pluginTransmit.Resume(); - // TODO: Inform clients ? + // Inform clients ... + if (_mode == IRServerMode.ServerMode) + { + IrssMessage message = new IrssMessage(MessageType.ServerResume, MessageFlags.Notify); + SendToAll(message); + } break; } case PowerModes.Suspend: { - IrssLog.Info("Enter low-power standby ..."); + IrssLog.Info("Enter standby ..."); + bool suspendedTransmit = false; + if (_pluginReceive != null) - _pluginReceive.Suspend(); + { + foreach (IRServerPlugin plugin in _pluginReceive) + { + if (_pluginTransmit == plugin) + suspendedTransmit = true; - if (_pluginTransmit != null && _pluginTransmit != _pluginReceive) + plugin.Suspend(); + } + } + + if (_pluginTransmit != null && !suspendedTransmit) _pluginTransmit.Suspend(); // Inform clients ... if (_mode == IRServerMode.ServerMode) { - IrssMessage message = new IrssMessage(MessageType.ServerShutdown, MessageFlags.Notify); + IrssMessage message = new IrssMessage(MessageType.ServerSuspend, MessageFlags.Notify); SendToAll(message); } break; @@ -975,13 +1045,6 @@ break; - case MessageType.Ping: - { - IrssMessage response = new IrssMessage(MessageType.Echo, MessageFlags.Response, combo.Message.DataAsBytes); - SendTo(combo.Manager, response); - break; - } - case MessageType.RegisterClient: { IrssMessage response = new IrssMessage(MessageType.RegisterClient, MessageFlags.Response); @@ -1104,45 +1167,85 @@ void LoadSettings() { + _mode = IRServerMode.ServerMode; + _hostComputer = String.Empty; + _pluginNameReceive = null; + _pluginNameTransmit = String.Empty; + + XmlDocument doc = new XmlDocument(); + try { - XmlDocument doc = new XmlDocument(); doc.Load(ConfigurationFile); - - _mode = (IRServerMode)Enum.Parse(typeof(IRServerMode), doc.DocumentElement.Attributes["Mode"].Value, true); - _hostComputer = doc.DocumentElement.Attributes["HostComputer"].Value; - _pluginNameReceive = doc.DocumentElement.Attributes["PluginReceive"].Value; - _pluginNameTransmit = doc.DocumentElement.Attributes["PluginTransmit"].Value; } + catch (FileNotFoundException) + { + IrssLog.Warn("No configuration file found ({0}), creating default configuration file", ConfigurationFile); + SaveSettings(); + return; + } catch (Exception ex) { IrssLog.Error(ex.ToString()); + return; + } - _mode = IRServerMode.ServerMode; - _hostComputer = String.Empty; - _pluginNameReceive = String.Empty; - _pluginNameTransmit = String.Empty; + try { _mode = (IRServerMode)Enum.Parse(typeof(IRServerMode), doc.DocumentElement.Attributes["Mode"].Value, true); } + catch (Exception ex) { IrssLog.Warn(ex.ToString()); } + + try { _hostComputer = doc.DocumentElement.Attributes["HostComputer"].Value; } + catch (Exception ex) { IrssLog.Warn(ex.ToString()); } + + try { _pluginNameTransmit = doc.DocumentElement.Attributes["PluginTransmit"].Value; } + catch (Exception ex) { IrssLog.Warn(ex.ToString()); } + + try + { + string receivers = doc.DocumentElement.Attributes["PluginReceive"].Value; + if (!String.IsNullOrEmpty(receivers)) + _pluginNameReceive = receivers.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); } + catch (Exception ex) + { + IrssLog.Warn(ex.ToString()); + } } void SaveSettings() { try { - XmlTextWriter writer = new XmlTextWriter(ConfigurationFile, System.Text.Encoding.UTF8); - writer.Formatting = Formatting.Indented; - writer.Indentation = 1; - writer.IndentChar = (char)9; - writer.WriteStartDocument(true); - writer.WriteStartElement("settings"); // <settings> + using (XmlTextWriter writer = new XmlTextWriter(ConfigurationFile, System.Text.Encoding.UTF8)) + { + writer.Formatting = Formatting.Indented; + writer.Indentation = 1; + writer.IndentChar = (char)9; + writer.WriteStartDocument(true); + writer.WriteStartElement("settings"); // <settings> - writer.WriteAttributeString("Mode", Enum.GetName(typeof(IRServerMode), _mode)); - writer.WriteAttributeString("HostComputer", _hostComputer); - writer.WriteAttributeString("PluginReceive", _pluginNameReceive); - writer.WriteAttributeString("PluginTransmit", _pluginNameTransmit); + writer.WriteAttributeString("Mode", Enum.GetName(typeof(IRServerMode), _mode)); + writer.WriteAttributeString("HostComputer", _hostComputer); + writer.WriteAttributeString("PluginTransmit", _pluginNameTransmit); - writer.WriteEndElement(); // </settings> - writer.WriteEndDocument(); - writer.Close(); + if (_pluginNameReceive != null) + { + StringBuilder receivers = new StringBuilder(); + for (int index = 0; index < _pluginNameReceive.Length; index++) + { + receivers.Append(_pluginNameReceive[index]); + + if (index < _pluginNameReceive.Length - 1) + receivers.Append(','); + } + writer.WriteAttributeString("PluginReceive", receivers.ToString()); + } + else + { + writer.WriteAttributeString("PluginReceive", String.Empty); + } + + writer.WriteEndElement(); // </settings> + writer.WriteEndDocument(); + } } catch (Exception ex) { Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2007-09-24 19:20:56 UTC (rev 955) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2007-09-26 07:34:18 UTC (rev 956) @@ -83,18 +83,16 @@ try { Assembly assembly = Assembly.LoadFrom(file); - Type[] types = assembly.GetExportedTypes(); foreach (Type type in types) { if (type.IsClass && !type.IsAbstract && type.IsSubclassOf(typeof(IRServerPlugin))) { - IRServerPlugin plugin = (IRServerPlugin)Activator.CreateInstance(type); - if (plugin == null) - continue; - - plugins.Add(plugin); + IRServerPlugin plugin = (IRServerPlugin)assembly.CreateInstance(type.FullName); + + if (plugin != null) + plugins.Add(plugin); } } } Modified: trunk/plugins/IR Server Suite/Applications/Translator/Configuration.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Configuration.cs 2007-09-24 19:20:56 UTC (rev 955) +++ trunk/plugins/IR Server Suite/Applications/Translator/Configuration.cs 2007-09-26 07:34:18 UTC (rev 956) @@ -75,7 +75,7 @@ public Configuration() { - _serverHost = String.Empty; + _serverHost = "localhost"; _systemWideMappings = new List<ButtonMapping>(); _programSettings = new List<ProgramSettings>(); @@ -122,6 +122,11 @@ using (StreamReader file = new StreamReader(fileName)) return (Configuration)reader.Deserialize(file); } + catch (FileNotFoundException) + { + IrssLog.Warn("No configuration file found ({0}), using default configuration", fileName); + return new Configuration(); + } catch (Exception ex) { IrssLog.Error(ex.ToString()); Modified: trunk/plugins/IR Server Suite/Applications/Translator/EventSchedule.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/EventSchedule.cs 2007-09-24 19:20:56 UTC (rev 955) +++ trunk/plugins/IR Server Suite/Applications/Translator/EventSchedule.cs 2007-09-26 07:34:18 UTC (rev 956) @@ -51,7 +51,7 @@ #endregion Enumerations - public class EventSchedule + class EventSchedule { //DateTime _start; Deleted: trunk/plugins/IR Server Suite/Applications/Translator/Forms/BlastCommand.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/BlastCommand.Designer.cs 2007-09-24 19:20:56 UTC (rev 955) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/BlastCommand.Designer.cs 2007-09-26 07:34:18 UTC (rev 956) @@ -1,150 +0,0 @@ -namespace Translator -{ - partial class BlastCommand - { - /// <summary> - /// Required designer variable. - /// </summary> - private System.ComponentModel.IContainer components = null; - - /// <summary> - /// Clean up any resources being used. - /// </summary> - /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disp... [truncated message content] |
From: <nor...@us...> - 2007-09-24 19:21:06
|
Revision: 955 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=955&view=rev Author: northern_sky Date: 2007-09-24 12:20:56 -0700 (Mon, 24 Sep 2007) Log Message: ----------- recurse extensions fixed Modified Paths: -------------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ClassDiagram1.cd trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesView.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsMame.Designer.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItem.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemDirectoryCache.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemGameBase.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemMame.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ProgramUtils.cs Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ClassDiagram1.cd =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ClassDiagram1.cd 2007-09-24 13:59:44 UTC (rev 954) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ClassDiagram1.cd 2007-09-24 19:20:56 UTC (rev 955) @@ -8,7 +8,7 @@ <HashCode>AKIYAABCAAEaMAEwAAAAAAAAAFlAAAEACEACAABEoAA=</HashCode> </TypeIdentifier> </Class> - <Class Name="GUIProgramsAlt.Design.AppSettingsFilesImportProgress" Collapsed="true"> + <Class Name="GUIProgramsAlt.Design.AppSettingsFilesImportProgress"> <Position X="3" Y="3.5" Width="1.5" /> <TypeIdentifier> <FileName>Design\AppFilesImportProgress.cs</FileName> @@ -19,7 +19,7 @@ <Position X="16.25" Y="0.5" Width="1.5" /> <TypeIdentifier> <FileName>Design\AppFilesView.cs</FileName> - <HashCode>oAANBAJFSCBB8ECgSJCCQIRigVMQACQBQmSUgUQRCNE=</HashCode> + <HashCode>oAANBAJFSCBB8ECgSJCCQIZigVMQAjQBQmSUwUQRCNE=</HashCode> </TypeIdentifier> </Class> <Class Name="GUIProgramsAlt.Design.AppSettingsBase" Collapsed="true"> @@ -103,14 +103,14 @@ <Position X="18" Y="3.5" Width="1.5" /> <TypeIdentifier> <FileName>Design\SetupForm.cs</FileName> - <HashCode>xqnowBGYG3JKfJwlBOCIEETiVZM6QmVoVEie0NAzAXM=</HashCode> + <HashCode>xqnowBGYG3JKfJwlBOKIEETiVZM6QmVoVEie0NAzAXM=</HashCode> </TypeIdentifier> </Class> <Class Name="GUIProgramsAlt.GUIProgramsAlt" Collapsed="true" BaseTypeListCollapsed="true"> <Position X="21.5" Y="1.5" Width="1.5" /> <TypeIdentifier> <FileName>GUIProgramsAlt.cs</FileName> - <HashCode>IPJEILBSQgAlAIR4ggEgCBMAAQBFb0FBKFGCZhAAZSg=</HashCode> + <HashCode>IPJEILBSQgAlAIR4ggEgCAMAAQBFb0FBKFGCZhAAZSg=</HashCode> </TypeIdentifier> <Lollipop Position="0.2" Collapsed="true" /> </Class> @@ -118,7 +118,7 @@ <Position X="14.5" Y="2.5" Width="1.5" /> <TypeIdentifier> <FileName>GUIProgramsAltFileInfo.cs</FileName> - <HashCode>AEQIAQEBggFRANBACAgRCAgMBUAIAEBBgACLYAYEBAA=</HashCode> + <HashCode>AAQIAQEBggFRANBACAgRCAgMBUAIAEBBiACLYAYEBAA=</HashCode> </TypeIdentifier> <Lollipop Position="0.2" Collapsed="true" /> </Class> @@ -183,14 +183,14 @@ <Position X="5" Y="8.75" Width="1.5" /> <TypeIdentifier> <FileName>Imports\MameImport.cs</FileName> - <HashCode>qACAgAEAGAAAEAABAAAEAAgCgAASABAAGwAQBIEAAAA=</HashCode> + <HashCode>qACAgAEAGAAAEAABAAAEAAgCgAASABAAGwAQFIEAAAA=</HashCode> </TypeIdentifier> </Class> <Class Name="GUIProgramsAlt.Items.ApplicationItem" Collapsed="true"> <Position X="3.75" Y="4.5" Width="1.5" /> <TypeIdentifier> <FileName>Items\ApplicationItem.cs</FileName> - <HashCode>hD6AAsRiQzNHIuPwpIiN4gIAmZcqBAkYqGVmCZkEpYA=</HashCode> + <HashCode>hD6AAsTiQjNHIuPwpIiN4gIEmZcqBAkYqGVmCZkEpYA=</HashCode> </TypeIdentifier> </Class> <Class Name="GUIProgramsAlt.Items.ApplicationItemDirectoryCache" Collapsed="true"> @@ -308,7 +308,7 @@ <Position X="14.5" Y="4.75" Width="1.5" /> <TypeIdentifier> <FileName>ProgramUtils.cs</FileName> - <HashCode>AAAAAAAAAgAAAAAAAACAAAAAAAAAAAAAAAAQAAIAAAA=</HashCode> + <HashCode>AAAAAAAAAgAAAAAAAACAAAAAQAAAAAAAAAAQAQIAAAA=</HashCode> </TypeIdentifier> </Enum> </ClassDiagram> \ No newline at end of file Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesView.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesView.cs 2007-09-24 13:59:44 UTC (rev 954) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesView.cs 2007-09-24 19:20:56 UTC (rev 955) @@ -704,7 +704,25 @@ protected void fileExtensionsbutton_Click(object sender, EventArgs e) { - fileExtensionsTextBox.Text = ProgramUtils.GetAvailableExtensions(this.fileDirTextBox.Text); + char separator = ';'; + string result = string.Empty; + List<string> tmpList = new List<string>(); + ProgramUtils.GetAvailableExtensions(this.fileDirTextBox.Text, tmpList); + + foreach (string ext in tmpList) + { + if (result == "") + { + result += ext; + } + else + { + result += separator + ext; + } + } + + + fileExtensionsTextBox.Text = result; } public void SetupFileView() Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsMame.Designer.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsMame.Designer.cs 2007-09-24 13:59:44 UTC (rev 954) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsMame.Designer.cs 2007-09-24 19:20:56 UTC (rev 955) @@ -45,9 +45,13 @@ // // shellexecuteCheckBox // - this.toolTip.SetToolTip(this.shellexecuteCheckBox, "Enable this if you want to run a program that is associated with a specific fileItem-" + - "extension.\r\nYou can omit the \"Launching Application\" in this case."); + this.toolTip.SetToolTip(this.shellexecuteCheckBox, "Enable this if you want to run a program that is associated with a specific fileI" + + "tem-extension.\r\nYou can omit the \"Launching Application\" in this case."); // + // waitExitCheckBox + // + this.toolTip.SetToolTip(this.waitExitCheckBox, "If you want mediaportal to wait for exit while running application."); + // // applicationArgumentsLabel // this.toolTip.SetToolTip(this.applicationArgumentsLabel, "Optional arguments that are needed to launch the program \r\n\r\n(advanced hint: Use " + @@ -92,7 +96,7 @@ // historyDatLink // this.historyDatLink.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.historyDatLink.Location = new System.Drawing.Point(6, 61); + this.historyDatLink.Location = new System.Drawing.Point(6, 32); this.historyDatLink.Name = "historyDatLink"; this.historyDatLink.Size = new System.Drawing.Size(164, 16); this.historyDatLink.TabIndex = 81; @@ -104,7 +108,7 @@ // catverLink // this.catverLink.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.catverLink.Location = new System.Drawing.Point(6, 45); + this.catverLink.Location = new System.Drawing.Point(6, 16); this.catverLink.Name = "catverLink"; this.catverLink.Size = new System.Drawing.Size(150, 16); this.catverLink.TabIndex = 80; @@ -122,7 +126,6 @@ this.groupBox1.Size = new System.Drawing.Size(226, 87); this.groupBox1.TabIndex = 82; this.groupBox1.TabStop = false; - this.groupBox1.Text = "Add CATVER.INI and HISTORY.DAT in your mame.exe folder for full dataimport"; // // AppSettingsMame // Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItem.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItem.cs 2007-09-24 13:59:44 UTC (rev 954) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItem.cs 2007-09-24 19:20:56 UTC (rev 955) @@ -95,13 +95,19 @@ { progressDialog.Close(); } + + OnImportFinished(this, null); + FixFileLinks(); + if (progressDialog != null) { progressDialog.Close(); progressDialog.ShowWaitCursor = false; } + + } #endregion Events/Delegates Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemDirectoryCache.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemDirectoryCache.cs 2007-09-24 13:59:44 UTC (rev 954) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemDirectoryCache.cs 2007-09-24 19:20:56 UTC (rev 955) @@ -79,7 +79,6 @@ public override void Refresh(bool mpGuiMode) { Import(mpGuiMode); - FixFileLinks(); } protected override void Import(bool mpGUIMode) Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemGameBase.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemGameBase.cs 2007-09-24 13:59:44 UTC (rev 954) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemGameBase.cs 2007-09-24 19:20:56 UTC (rev 955) @@ -78,7 +78,6 @@ { DeleteFiles(); Import(bGUIMode); - FixFileLinks(); } #endregion ApplicationItem Overloads } Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemMame.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemMame.cs 2007-09-24 13:59:44 UTC (rev 954) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemMame.cs 2007-09-24 19:20:56 UTC (rev 955) @@ -105,7 +105,6 @@ { DeleteFiles(); Import(bGUIMode); - FixFileLinks(); } protected override void Import(bool mpGUIMode) @@ -115,7 +114,6 @@ { ShowProgressDialog("Importing from mame.."); } - importBase = new MameImport(this); base.Import(mpGUIMode); } Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ProgramUtils.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ProgramUtils.cs 2007-09-24 13:59:44 UTC (rev 954) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ProgramUtils.cs 2007-09-24 19:20:56 UTC (rev 955) @@ -314,53 +314,49 @@ GUIProgramsAlt.ThumbnailPath = ""; } - static public string GetAvailableExtensions(string curDirectory) + static public void GetAvailableExtensions(string curDirectory,List<string> extensionList) { char separator = ';'; string[] fileDirs = curDirectory.Split(separator); - List<string> extensionsList = new List<string>(); string extension = ""; - string result = ""; foreach (string dir in fileDirs) { + if (System.IO.Directory.Exists(dir)) { string[] fileEntries = System.IO.Directory.GetFiles(dir); if ((fileEntries != null) && (fileEntries.Length > 0)) { - - - foreach (string fileName in fileEntries) + foreach (string fileName in fileEntries) { extension = System.IO.Path.GetExtension(fileName).ToLower(); if (extension.Trim() == "") { extension = "."; // placeholder for "files without any extension } - if (!extensionsList.Contains(extension)) + if (!extensionList.Contains(extension)) { - extensionsList.Add(extension); + extensionList.Add(extension); } } } + //check if underdirs + string[] directorys = Directory.GetDirectories(dir); + if ((directorys != null) && (directorys.Length > 0)) + { + foreach (string dirName in directorys) + { + GetAvailableExtensions(dirName,extensionList); + } + } + } } - foreach (string ext in extensionsList) - { - if (result == "") - { - result += ext; - } - else - { - result += separator + ext; - } - } + - return result; } public class ListItem This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rs...@us...> - 2007-09-24 13:59:46
|
Revision: 954 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=954&view=rev Author: rsparey Date: 2007-09-24 06:59:44 -0700 (Mon, 24 Sep 2007) Log Message: ----------- updated my radio view Modified Paths: -------------- trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicsongs.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/myradio.xml Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicsongs.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicsongs.xml 2007-09-23 11:09:35 UTC (rev 953) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicsongs.xml 2007-09-24 13:59:44 UTC (rev 954) @@ -162,7 +162,7 @@ <width>209</width> <height>36</height> <onleft>6</onleft> - <onright>8</onright> + <onright>9</onright> <onup>21</onup> <ondown>50</ondown> <textureFocus>tab_down.png</textureFocus> @@ -172,7 +172,7 @@ <control> <description>Playingnow</description> <type>button</type> - <id>12</id> + <id>9</id> <animation effect="fade" time="400">WindowClose</animation> <animation effect="fade" time="400">WindowOpen</animation> <hyperlink>510</hyperlink> @@ -204,7 +204,7 @@ <ondown>99</ondown> <width>209</width> <height>36</height> - <onleft>8</onleft> + <onleft>9</onleft> <onright>2</onright> <onup>21</onup> <ondown>11</ondown> @@ -496,15 +496,15 @@ <ondown>12</ondown> <textureFocus>tab_down.png</textureFocus> <textureNoFocus>tab_up.png</textureNoFocus> - <visible>Control.HasFocus(10)|Control.HasFocus(11)|Control.HasFocus(8)</visible> + <visible>Control.HasFocus(10)|Control.HasFocus(11)|Control.HasFocus(12)</visible> <animation effect="fade" time="250">visiblechange</animation> <animation effect="slide" start="0,-36" end="0,0" time="250">visiblechange</animation> </control> <control> - <description> playing now</description> + <description> playing cd</description> <type>button</type> - <id>8</id> + <id>12</id> <animation effect="fade" time="400">WindowClose</animation> <animation effect="fade" time="400">WindowOpen</animation> <posY>172</posY> @@ -519,7 +519,7 @@ <ondown>50</ondown> <textureFocus>tab_down.png</textureFocus> <textureNoFocus>tab_up.png</textureNoFocus> - <visible>Control.HasFocus(10)|Control.HasFocus(8)|Control.HasFocus(11)</visible> + <visible>Control.HasFocus(10)|Control.HasFocus(12)|Control.HasFocus(11)</visible> <animation effect="fade" time="250">visiblechange</animation> <animation effect="slide" start="0,-72" end="0,0" time="250">visiblechange</animation> </control> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/myradio.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/myradio.xml 2007-09-23 11:09:35 UTC (rev 953) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/myradio.xml 2007-09-24 13:59:44 UTC (rev 954) @@ -3,7 +3,6 @@ <id>30</id> <defaultcontrol>2</defaultcontrol> <allowoverlay>yes</allowoverlay> - <define>#header.label:666</define> <controls> <import>common.window.xml</import> @@ -55,29 +54,8 @@ <animation effect="slide" time="1000" delay="2000" start="-600,0" end="0,0" acceleration="-1">WindowOpen</animation> <animation effect="fade" time="500" start="50">WindowClose</animation> </control> - <control> + <control> <type>image</type> - <decription>mid_strip</decription> - <id>1</id> - <posX>-12</posX> - <posY>186</posY> - <width>1390</width> - <height>365</height> - <texture>mid_strip.png</texture> - - </control> - <control> - <type>image</type> - <decription>bottom_strip</decription> - <id>1</id> - <posX>-12</posX> - <posY>547</posY> - <width>1390</width> - <height>18</height> - <texture>bottom_strip.png</texture> - - </control> <control> - <type>image</type> <decription>top-strip</decription> <id>1</id> <posX>12</posX> @@ -115,8 +93,8 @@ <onleft>2</onleft> <onright>3</onright> <onup>2</onup> - <ondown>50</ondown> - <subitems> + <ondown>51</ondown> + <subitems> <subitem>101</subitem> <subitem>100</subitem> <subitem>417</subitem> @@ -130,6 +108,7 @@ </control> + <control> <type>sortbutton</type> <id>3</id> @@ -218,27 +197,8 @@ <textureFocus>tab_down.png</textureFocus> <textureNoFocus>tab_up.png</textureNoFocus> </control> - <control> - <description>My Playlists</description> - <type>button</type> - <id>9</id> - <animation effect="fade" time="400">WindowClose</animation> - <animation effect="fade" time="400">WindowOpen</animation> - <posY>100</posY> - <posX>1057</posX> - <label>983</label> <font>font14</font> - <ondown>99</ondown> - <width>209</width> - <height>36</height> - <onleft>8</onleft> - <onright>9</onright> - <onup>17</onup> - <ondown>50</ondown> - <textureFocus>tab_down.png</textureFocus> - <textureNoFocus>tab_up.png</textureNoFocus> - <textcolor>white</textcolor> - </control> + @@ -304,7 +264,7 @@ <onleft>2</onleft> <onright>2</onright> <onup>2</onup> - <ondown>50</ondown> + <ondown>50</ondown><ondown>51</ondown> <posX>30</posX> <posY>198</posY> <width>1316</width> @@ -356,6 +316,8 @@ <thumbAnimation effect="zoom" start="100,100" end="150,150" time="200">focus</thumbAnimation> <thumbAnimation effect="zoom" start="150,150" end="100,100" time="200">unfocus</thumbAnimation> </control> + </control> + </controls> </window> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nor...@us...> - 2007-09-23 11:09:42
|
Revision: 953 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=953&view=rev Author: northern_sky Date: 2007-09-23 04:09:35 -0700 (Sun, 23 Sep 2007) Log Message: ----------- made catver,historydat selectable from fileoptions Modified Paths: -------------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Database/DatabaseHandler.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesView.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileSettingsBox.Designer.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileSettingsBox.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/MameImport.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItem.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemFactory.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemMame.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ProgramUtils.cs Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Database/DatabaseHandler.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Database/DatabaseHandler.cs 2007-09-23 05:14:40 UTC (rev 952) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Database/DatabaseHandler.cs 2007-09-23 11:09:35 UTC (rev 953) @@ -501,7 +501,10 @@ platformId INTEGER, waitForExit BOOL, preLaunch TEXT, - postLaunch TEXT + postLaunch TEXT, + mameCatVerIniPath TEXT, + mameHistoryDatPath TEXT + )"; ExecuteStmtNonQuery(sqlStmt); Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesView.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesView.cs 2007-09-23 05:14:40 UTC (rev 952) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesView.cs 2007-09-23 11:09:35 UTC (rev 953) @@ -52,6 +52,8 @@ TextBox imageDirsTextBox = null; TextBox gamebaseDBTextBox = null; TextBox fileExtensionsTextBox = null; + TextBox mameHistoryDatTextBox = null; + TextBox mameCatverTextBox = null; @@ -218,6 +220,14 @@ { gamebaseDBTextBox.Text = currentApplicationItem.ApplicationItemSource; } + if (mameHistoryDatTextBox != null) + { + mameHistoryDatTextBox.Text = currentApplicationItem.mameHistoryDatPath; + } + if (mameCatverTextBox != null) + { + mameCatverTextBox.Text = currentApplicationItem.mameCatVerIniPath; + } //filePathsLabel.Text = currentApplicationItem.CurrentFilePath().Replace("&", "&&"); } @@ -624,15 +634,19 @@ applicationItem.ValidExtensions = (fileExtensionsTextBox == null) ? "" : fileExtensionsTextBox.Text; applicationItem.ApplicationItemSource = (gamebaseDBTextBox == null) ? "" : gamebaseDBTextBox.Text; + applicationItem.ImportValidImagesOnly = IsItemChecked(ImportOptionToString(ImportOption.OnlyImportValidImages)); if ((currentApplicationItem is ApplicationItemMame)) { - ((ApplicationItemMame)applicationItem).ImportOriginalsOnly = IsItemChecked(ImportOptionToString(ImportOption.OnlyImportOriginals)); - applicationItem.ImportMameMahjong = IsItemChecked(ImportOptionToString(ImportOption.ImportMahjongGames)); - applicationItem.ImportMamePlaychoice10 = IsItemChecked(ImportOptionToString(ImportOption.ImportPlaychoiceGames)); + ApplicationItemMame applicationItemMame = (ApplicationItemMame)applicationItem; + applicationItemMame.ImportOriginalsOnly = IsItemChecked(ImportOptionToString(ImportOption.OnlyImportOriginals)); + applicationItemMame.ImportMameMahjong = IsItemChecked(ImportOptionToString(ImportOption.ImportMahjongGames)); + applicationItemMame.ImportMamePlaychoice10 = IsItemChecked(ImportOptionToString(ImportOption.ImportPlaychoiceGames)); + applicationItemMame.mameCatVerIniPath = (mameCatverTextBox == null) ? "" : mameCatverTextBox.Text; + applicationItemMame.mameHistoryDatPath = (mameHistoryDatTextBox == null) ? "" : mameHistoryDatTextBox.Text; } @@ -672,6 +686,22 @@ } + protected void selectFileButton_Click(object sender, EventArgs e) + { + FileSettingsBox fileSettingsBox =(FileSettingsBox) ((Button)sender).Parent; + + if (fileSettingsBox.TextBox.Text != "") + { + openFileDialog.FileName = fileSettingsBox.TextBox.Text; + } + if (openFileDialog.ShowDialog(null) == DialogResult.OK) + { + fileSettingsBox.TextBox.Text = openFileDialog.FileName; + } + + } + + protected void fileExtensionsbutton_Click(object sender, EventArgs e) { fileExtensionsTextBox.Text = ProgramUtils.GetAvailableExtensions(this.fileDirTextBox.Text); @@ -775,6 +805,14 @@ imageDirsTextBox = fileSettingBox.TextBox; fileSettingBox.Button.Click += new EventHandler(this.imageDirButton_Click); break; + case "CatVer.ini" + "Button": + mameCatverTextBox = fileSettingBox.TextBox; + fileSettingBox.Button.Click += new EventHandler(this.selectFileButton_Click); + break; + case "History.dat" + "Button": + mameHistoryDatTextBox = fileSettingBox.TextBox; + fileSettingBox.Button.Click += new EventHandler(this.selectFileButton_Click); + break; default: break; } Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileSettingsBox.Designer.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileSettingsBox.Designer.cs 2007-09-23 05:14:40 UTC (rev 952) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileSettingsBox.Designer.cs 2007-09-23 11:09:35 UTC (rev 953) @@ -67,7 +67,7 @@ this.Controls.Add(this.Label); this.Controls.Add(this.Button); this.Name = "FileSettingsBox"; - this.Size = new System.Drawing.Size(475, 30); + this.Size = new System.Drawing.Size(462, 30); this.ResumeLayout(false); this.PerformLayout(); Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileSettingsBox.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileSettingsBox.cs 2007-09-23 05:14:40 UTC (rev 952) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileSettingsBox.cs 2007-09-23 11:09:35 UTC (rev 953) @@ -38,6 +38,10 @@ return "Gamebase DB"; case FileSettingOption.ImageDirectoryPaths: return "Imagefolder(s)"; + case FileSettingOption.MameCategoryData: + return "CatVer.ini"; + case FileSettingOption.MameHistoryData: + return "History.dat"; default: return ""; } Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/MameImport.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/MameImport.cs 2007-09-23 05:14:40 UTC (rev 952) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/MameImport.cs 2007-09-23 11:09:35 UTC (rev 953) @@ -61,6 +61,7 @@ string mameDir; string catverIniFile; string historyDatFile; + private ApplicationItemMame applicationItemMame; Dictionary<string, MameHistoryContainer> romHistoryDictionary = new Dictionary<string, MameHistoryContainer>(); @@ -72,7 +73,7 @@ public MameImport(ApplicationItem applicationItem) { - this.applicationItem = applicationItem; + this.applicationItemMame =(ApplicationItemMame) applicationItem; } void ReadListFull() @@ -80,11 +81,11 @@ fullRomListDictionary.Clear(); string line = string.Empty; - OnReadNewFileEvent(this,new FileReadEventArgs(10,"generating mame list (full)")); + OnReadNewFileEvent(this, new FileReadEventArgs(10, "generating mame list (full)")); using (Process process = new Process()) { - ProcessStartInfo processStartInfo = new ProcessStartInfo(applicationItem.Executable); + ProcessStartInfo processStartInfo = new ProcessStartInfo(applicationItemMame.Executable); processStartInfo.Arguments = "-listfull"; processStartInfo.UseShellExecute = false; processStartInfo.RedirectStandardOutput = true; @@ -111,13 +112,13 @@ void ReadListClones() { string line; - if (((ApplicationItemMame)applicationItem).ImportOriginalsOnly) + if (applicationItemMame.ImportOriginalsOnly) { - OnReadNewFileEvent(this,new FileReadEventArgs(20,"generating mame list (clones)")); + OnReadNewFileEvent(this, new FileReadEventArgs(20, "generating mame list (clones)")); using (Process process = new Process()) { - ProcessStartInfo myProcessStartInfo = new ProcessStartInfo(applicationItem.Executable); + ProcessStartInfo myProcessStartInfo = new ProcessStartInfo(applicationItemMame.Executable); myProcessStartInfo.Arguments = "-listclones"; myProcessStartInfo.UseShellExecute = false; myProcessStartInfo.RedirectStandardOutput = true; @@ -233,29 +234,29 @@ { char separator = ';'; conditionChecker.Clear(); - string[] fileDirs = applicationItem.FileDirectory.Split(separator); + string[] fileDirs = applicationItemMame.FileDirectory.Split(separator); - if (conditionChecker.DoCheck(System.IO.File.Exists(applicationItem.Executable), "mame-application not found!")) + if (conditionChecker.DoCheck(System.IO.File.Exists(applicationItemMame.Executable), "mame-application not found!")) { - mameDir = Path.GetDirectoryName(applicationItem.Executable); - catverIniFile = mameDir + "\\catver.ini"; - historyDatFile = mameDir + "\\history.dat"; + mameDir = Path.GetDirectoryName(applicationItemMame.Executable); + catverIniFile = applicationItemMame.mameCatVerIniPath; + historyDatFile = applicationItemMame.mameHistoryDatPath; } if (conditionChecker.IsOk) { - OnReadNewFileEvent(this,new FileReadEventArgs(0,"Generating lists...")); + OnReadNewFileEvent(this, new FileReadEventArgs(0, "Generating lists...")); ReadListFull(); - OnReadNewFileEvent(this,new FileReadEventArgs(0,"Generating lists.....")); + OnReadNewFileEvent(this, new FileReadEventArgs(0, "Generating lists.....")); ReadListClones(); if (System.IO.File.Exists(catverIniFile)) { - OnReadNewFileEvent(this,new FileReadEventArgs(0,"Reading catver.ini.......")); + OnReadNewFileEvent(this, new FileReadEventArgs(0, "Reading catver.ini.......")); ReadCatverIni(); } if (System.IO.File.Exists(historyDatFile)) { - OnReadNewFileEvent(this,new FileReadEventArgs(0,"Reading history.dat............")); + OnReadNewFileEvent(this, new FileReadEventArgs(0, "Reading history.dat............")); ReadHistoryDat(); } @@ -263,10 +264,18 @@ { for (int i = 0; i < fileDirs.Length; i++) { - string[] tmp = System.IO.Directory.GetFiles(fileDirs[i], "*.zip"); - for (int x = 0; x < tmp.Length; x++) + + string[] validExtensionsArr = applicationItemMame.ValidExtensions.Split(';'); + + for (int z = 0; z < validExtensionsArr.Length; z++) { - localRomNames.Add(tmp[x]); + + string[] tmp = System.IO.Directory.GetFiles(fileDirs[i],"*"+ validExtensionsArr[z]); + for (int x = 0; x < tmp.Length; x++) + { + localRomNames.Add(tmp[x]); + } + } } } @@ -279,7 +288,7 @@ { if (!CheckPrerequisites()) { - OnReadNewFileEvent(this,new FileReadEventArgs(0,conditionChecker.Problems)); + OnReadNewFileEvent(this, new FileReadEventArgs(0, conditionChecker.Problems)); Log.Info("MameImporter: import failed! Details: {0}", conditionChecker.Problems); return; } @@ -297,7 +306,7 @@ transaction.Commit(); } - OnReadNewFileEvent(this,new FileReadEventArgs(100,"Import done...................")); + OnReadNewFileEvent(this, new FileReadEventArgs(100, "Import done...................")); } @@ -328,9 +337,9 @@ string fullEntry = ""; string genreEntry = ""; string versionEntry = ""; - bool onlyOriginals = ((ApplicationItemMame)applicationItem).ImportOriginalsOnly; - bool importMahjongGames = applicationItem.ImportMameMahjong; - bool importPlaychoiceGames = applicationItem.ImportMamePlaychoice10; + bool onlyOriginals = applicationItemMame.ImportOriginalsOnly; + bool importMahjongGames = applicationItemMame.ImportMameMahjong; + bool importPlaychoiceGames = applicationItemMame.ImportMamePlaychoice10; bool shouldImport = true; MameHistoryContainer mameHistoryNode = null; @@ -341,13 +350,13 @@ { FileItem curFile = new FileItem(); - curFile.ApplicationItemId = applicationItem.ApplicationItemId; + curFile.ApplicationItemId = applicationItemMame.ApplicationItemId; curFile.Filename = fullRomname; - curFile.Imagefile = ImportImageFiles(curFile.Filename, curFile.Title, applicationItem); + curFile.Imagefile = ImportImageFiles(curFile.Filename, curFile.Title, applicationItemMame); - if ((curFile.Imagefile == "") && (applicationItem.ImportValidImagesOnly)) + if ((curFile.Imagefile == "") && (applicationItemMame.ImportValidImagesOnly)) { - OnReadNewFileEvent(this,new FileReadEventArgs( (int)(100 * (((double)count) / total)),"")); + OnReadNewFileEvent(this, new FileReadEventArgs((int)(100 * (((double)count) / total)), "")); return; } if (this.fullRomListDictionary.ContainsKey(curRomname)) @@ -403,7 +412,7 @@ curFile.Write(); // OnReadNewFileEvent(curFile.Title, count, localRomNames.Length); - OnReadNewFileEvent(this,new FileReadEventArgs((int)(100 * (((double)count) / total)),curFile.Title) ); + OnReadNewFileEvent(this, new FileReadEventArgs((int)(100 * (((double)count) / total)), curFile.Title)); } } @@ -411,7 +420,7 @@ } else { - OnReadNewFileEvent(this,new FileReadEventArgs((int)(100 * (((double)count) / total)),"") ); + OnReadNewFileEvent(this, new FileReadEventArgs((int)(100 * (((double)count) / total)), "")); } } Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItem.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItem.cs 2007-09-23 05:14:40 UTC (rev 952) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItem.cs 2007-09-23 11:09:35 UTC (rev 953) @@ -139,6 +139,8 @@ public bool linksAreLoaded = false; // load on demand.... bool importMamePlaychoice10 = false; bool importMameMahjong = false; + public string mameCatVerIniPath = ""; + public string mameHistoryDatPath = ""; bool refreshGUIAllowed = false; ItemType itemType; @@ -799,7 +801,7 @@ private void Insert() { - SQLiteParameter[] parameterArray = new SQLiteParameter[23]; + SQLiteParameter[] parameterArray = new SQLiteParameter[25]; ApplicationItemId = GetNewAppID(); // important to avoid subsequent inserts! //params for question + values parameterArray[0] = dbHandlerInstance.GetParameter<int>(ApplicationItemId, "@applicationItemId", DbType.Int32); @@ -825,6 +827,8 @@ parameterArray[20] = dbHandlerInstance.GetParameter<bool>(WaitForExit, "@waitForExit", DbType.Boolean); parameterArray[21] = dbHandlerInstance.GetParameter<string>(PreLaunch, "@preLaunch", DbType.String); parameterArray[22] = dbHandlerInstance.GetParameter<string>(PostLaunch, "@postLaunch", DbType.String); + parameterArray[23] = dbHandlerInstance.GetParameter<string>(mameCatVerIniPath, "@mameCatVerIniPath", DbType.String); + parameterArray[24] = dbHandlerInstance.GetParameter<string>(mameHistoryDatPath, "@mameHistoryDatPath", DbType.String); try { @@ -855,7 +859,9 @@ platformId, waitForExit, preLaunch, - postLaunch + postLaunch, + mameCatVerIniPath, + mameHistoryDatPath ) VALUES ( @@ -881,7 +887,9 @@ @platformId, @waitForExit, @preLaunch, - @postLaunch + @postLaunch, + @mameCatVerIniPath, + @mameHistoryDatPath )"; dbHandlerInstance.ExecuteStmtNonQuery(sqlStmt, parameterArray); @@ -897,7 +905,7 @@ if (ApplicationItemId == -1) return; - SQLiteParameter[] parameterArray = new SQLiteParameter[23]; + SQLiteParameter[] parameterArray = new SQLiteParameter[25]; //params for question + values parameterArray[0] = dbHandlerInstance.GetParameter<int>(ApplicationItemId, "@applicationItemId", DbType.Int32); @@ -923,6 +931,8 @@ parameterArray[20] = dbHandlerInstance.GetParameter<bool>(WaitForExit, "@waitForExit", DbType.Boolean); parameterArray[21] = dbHandlerInstance.GetParameter<string>(PreLaunch, "@preLaunch", DbType.String); parameterArray[22] = dbHandlerInstance.GetParameter<string>(PostLaunch, "@postLaunch", DbType.String); + parameterArray[23] = dbHandlerInstance.GetParameter<string>(mameCatVerIniPath, "@mameCatVerIniPath", DbType.String); + parameterArray[24] = dbHandlerInstance.GetParameter<string>(mameHistoryDatPath, "@mameHistoryDatPath", DbType.String); try { @@ -951,7 +961,9 @@ platformId = @platformId, waitForExit = @waitForExit, preLaunch = @preLaunch, - postLaunch = @postLaunch + postLaunch = @postLaunch, + mameCatVerIniPath = @mameCatVerIniPath, + mameHistoryDatPath = @mameHistoryDatPath WHERE applicationId = @applicationItemId"; Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemFactory.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemFactory.cs 2007-09-23 05:14:40 UTC (rev 952) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemFactory.cs 2007-09-23 11:09:35 UTC (rev 953) @@ -127,6 +127,8 @@ item.WaitForExit =(bool) dataReader["waitforexit"]; item.PreLaunch = (string) dataReader["preLaunch"]; item.PostLaunch =(string) dataReader["postLaunch"]; + item.mameCatVerIniPath = (string)dataReader["mameCatVerIniPath"]; + item.mameHistoryDatPath = (string)dataReader["mameHistoryDatPath"]; } return item; } Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemMame.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemMame.cs 2007-09-23 05:14:40 UTC (rev 952) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemMame.cs 2007-09-23 11:09:35 UTC (rev 953) @@ -51,6 +51,7 @@ bool importOriginalsOnly = true; + #endregion Variables public ApplicationItemMame() @@ -71,6 +72,8 @@ FileSettingList.Add(FileSettingOption.FileDirectoryPaths); FileSettingList.Add(FileSettingOption.FileExtensionPaths); FileSettingList.Add(FileSettingOption.ImageDirectoryPaths); + FileSettingList.Add(FileSettingOption.MameCategoryData); + FileSettingList.Add(FileSettingOption.MameHistoryData); ImportOptionList = new List<ImportOption>(); ImportOptionList.Add(ImportOption.ImportMahjongGames); @@ -89,7 +92,7 @@ #endregion Public Methods - #region ApplicationItem Overloads + #region ApplicationItem Overloads public override string CurrentFilePath() { Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ProgramUtils.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ProgramUtils.cs 2007-09-23 05:14:40 UTC (rev 952) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ProgramUtils.cs 2007-09-23 11:09:35 UTC (rev 953) @@ -111,6 +111,8 @@ FileExtensionPaths = 1, ImageDirectoryPaths = 2, GameBaseDBPath = 3, + MameCategoryData = 4, + MameHistoryData = 5, } #endregion This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <i-...@us...> - 2007-09-23 05:14:44
|
Revision: 952 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=952&view=rev Author: i-loop Date: 2007-09-22 22:14:40 -0700 (Sat, 22 Sep 2007) Log Message: ----------- sysynched with BlueTwo svn Modified Paths: -------------- trunk/skins/BlueTwoBig/Development Version/mymusicplaylist.xml Modified: trunk/skins/BlueTwoBig/Development Version/mymusicplaylist.xml =================================================================== --- trunk/skins/BlueTwoBig/Development Version/mymusicplaylist.xml 2007-09-22 12:38:30 UTC (rev 951) +++ trunk/skins/BlueTwoBig/Development Version/mymusicplaylist.xml 2007-09-23 05:14:40 UTC (rev 952) @@ -8,6 +8,7 @@ <define>#header.hover:hover_my music.png</define> <controls> <import>common.window.xml</import> + <import>common.time.xml</import> <control> <description>group element</description> <type>group</type> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rs...@us...> - 2007-09-22 12:38:32
|
Revision: 951 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=951&view=rev Author: rsparey Date: 2007-09-22 05:38:30 -0700 (Sat, 22 Sep 2007) Log Message: ----------- modifying skin layout Modified Paths: -------------- trunk/skins/Foofaraw/Development Skin/Foofaraw/BasicHome.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/myHomePlugIns.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicsongs.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/mypics.xml Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/BasicHome.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/BasicHome.xml 2007-09-22 07:14:11 UTC (rev 950) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/BasicHome.xml 2007-09-22 12:38:30 UTC (rev 951) @@ -41,18 +41,8 @@ <animation effect="fade" time="250" delay="2000" >WindowOpen</animation> <animation effect="fade" time="500" delay="5">WindowClose</animation> </control> - <control> - <type>image</type> - <decription>mid_strip</decription> - <id>1</id> - <posX>12</posX> - <posY>136</posY> - <width>1342</width> - <height>420</height> - <texture>mid_strip2.png</texture> - - </control> + <control> <type>image</type> <decription>top-strip</decription> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/myHomePlugIns.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/myHomePlugIns.xml 2007-09-22 07:14:11 UTC (rev 950) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/myHomePlugIns.xml 2007-09-22 12:38:30 UTC (rev 951) @@ -78,41 +78,7 @@ <animation effect="slide" time="1000" delay="2000" start="-600,0" end="0,0" acceleration="-1">WindowOpen</animation> <animation effect="fade" time="500" start="50">WindowClose</animation> </control> - <control> - <type>image</type> - <decription>mid_strip</decription> - <id>1</id> - <posX>12</posX> - <posY>186</posY> - <width>1342</width> - <height>365</height> - <texture>mid_strip.png</texture> - <animation effect="zoom" start="100,100" end="100,115" center="12,186" time="1000" acceleration ="-1" >WindowOpen</animation> - <animation effect="zoom" start="100,115" end="100,100" center="12,186" time="1000" acceleration ="-1" >WindowClose</animation> - </control> - <control> - <type>image</type> - <decription>bottom_strip</decription> - <id>1</id> - <posX>12</posX> - <posY>547</posY> - <width>1342</width> - <height>18</height> - <texture>bottom_strip.png</texture> - <animation effect="slide" time="1000" start="0,0" end="0,50" acceleration="-1" >WindowOpen</animation> - <animation effect="slide" time="1000" start="0,50" end="0,0" acceleration="-1" >WindowClose</animation> - </control> - <control> - <type>image</type> - <decription>top-strip</decription> - <id>1</id> - <posX>12</posX> - <posY>100</posY> - <width>1342</width> - <height>36</height> - <texture>top-strip.png</texture> - - </control> + <control> <description>Menu</description> <type>menu</type> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicsongs.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicsongs.xml 2007-09-22 07:14:11 UTC (rev 950) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicsongs.xml 2007-09-22 12:38:30 UTC (rev 951) @@ -213,7 +213,17 @@ <textcolor>white</textcolor> </control> - + <control> + <type>image</type> + <id>1</id> + <posX>165</posX> + <posY>170</posY> + <width>280</width> + <height>280</height> + <texture flipY="true" diffuse="Thumb_Mask.png">cd_art.png</texture> + <visible>facadeview.list</visible> + <animation effect="fade" time="250">visiblechange</animation> + </control> <control> <id>1</id> <type>image</type> @@ -232,8 +242,7 @@ <posY>150</posY> <width>360</width> <height>308</height> - <texture>cd_box.png</texture> - <texture flipY="true" diffuse="Thumb_Mask.png">cd_box.png</texture> + <texture flipY="true" diffuse="Thumb_Mask.png">cd_box.png</texture> <visible>facadeview.list</visible> <animation effect="fade" time="250">visiblechange</animation> </control> @@ -322,18 +331,18 @@ <onup>2</onup> <ondown>50</ondown> <posX>30</posX> - <posY>198</posY> + <posY>140</posY> <width>1316</width> - <height>350</height> + <height>525</height> <spinWidth>27</spinWidth> <spinHeight>27</spinHeight> - <spinPosX>1240</spinPosX> - <spinPosY>515</spinPosY> + <spinPosX>1240</spinPosX> + <spinPosY>650</spinPosY> <spinColor>ffffffff</spinColor> - <textureUp>arrow_round_up_nofocus.png</textureUp> - <textureDown>arrow_round_down_nofocus.png</textureDown> - <textureUpFocus>arrow_round_up_focus.png</textureUpFocus> - <textureDownFocus>arrow_round_down_focus.png</textureDownFocus> + <textureUp>arrow_round_right_nofocus.png</textureUp> + <textureDown>arrow_round_left_nofocus.png</textureDown> + <textureUpFocus>arrow_round_right_focus.png</textureUpFocus> + <textureDownFocus>arrow_round_left_focus.png</textureDownFocus> <itemWidth>80</itemWidth> <itemHeight>60</itemHeight> <textureWidth>80</textureWidth> @@ -388,10 +397,10 @@ <spinPosX>1240</spinPosX> <spinPosY>515</spinPosY> <spinColor>ffffffff</spinColor> - <textureUp>arrow_round_up_nofocus.png</textureUp> - <textureDown>arrow_round_down_nofocus.png</textureDown> - <textureUpFocus>arrow_round_up_focus.png</textureUpFocus> - <textureDownFocus>arrow_round_down_focus.png</textureDownFocus> + <textureUp>arrow_round_right_nofocus.png</textureUp> + <textureDown>arrow_round_left_nofocus.png</textureDown> + <textureUpFocus>arrow_round_right_focus.png</textureUpFocus> + <textureDownFocus>arrow_round_left_focus.png</textureDownFocus> <itemWidth>240</itemWidth> <itemHeight>200</itemHeight> <textureWidth>440</textureWidth> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/mypics.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/mypics.xml 2007-09-22 07:14:11 UTC (rev 950) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/mypics.xml 2007-09-22 12:38:30 UTC (rev 951) @@ -212,7 +212,6 @@ <posY>150</posY> <width>360</width> <height>264</height> - <texture>photo_frame.png</texture> <texture flipY="true" diffuse="Thumb_Mask.png">photo_frame.png</texture> <visible>facadeview.list</visible> <animation effect="fade" time="250">visiblechange</animation> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2007-09-22 07:14:13
|
Revision: 950 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=950&view=rev Author: framug Date: 2007-09-22 00:14:11 -0700 (Sat, 22 Sep 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/file explorer/Source/FileExplorer.csproj Modified: trunk/plugins/file explorer/Source/FileExplorer.csproj =================================================================== --- trunk/plugins/file explorer/Source/FileExplorer.csproj 2007-09-22 07:00:03 UTC (rev 949) +++ trunk/plugins/file explorer/Source/FileExplorer.csproj 2007-09-22 07:14:11 UTC (rev 950) @@ -27,7 +27,7 @@ <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)' == 'Release' "> - <OutputPath>bin/Release</OutputPath> + <OutputPath>..\Release\Plugins\Windows\</OutputPath> <Optimize>True</Optimize> <DefineConstants>TRACE</DefineConstants> <DebugSymbols>false</DebugSymbols> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2007-09-22 07:00:07
|
Revision: 949 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=949&view=rev Author: framug Date: 2007-09-22 00:00:03 -0700 (Sat, 22 Sep 2007) Log Message: ----------- Added Paths: ----------- trunk/plugins/file explorer/Release/Skin/BlueTwo/ Removed Paths: ------------- trunk/plugins/file explorer/Release/Skin/blue two/ Copied: trunk/plugins/file explorer/Release/Skin/BlueTwo (from rev 948, trunk/plugins/file explorer/Release/Skin/blue two) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |