From: <an...@us...> - 2008-02-29 17:31:27
|
Revision: 1411 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1411&view=rev Author: and-81 Date: 2008-02-29 09:31:08 -0800 (Fri, 29 Feb 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Program.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/CloseProgramCommand.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/MessageCommand.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/WindowList.Designer.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/WindowList.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Win32.cs trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/Ads Tech PTV-335 Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/CoolCommand Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/CoolCommandReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/DirectInputReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Girder Plugin.cs trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/HcwReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IR Server Plugin Interface.csproj trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/PluginBase.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/IgorPlug Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Ira Transceiver/IraTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/LiveDriveReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/MacMini Receiver/MacMini Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverReplacement.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverVista.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverXP.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Microsoft MCE Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/RedEye Blaster/RedEye Blaster.cs trunk/plugins/IR Server Suite/IR Server Plugins/Serial IR Blaster/Serial IR Blaster.cs trunk/plugins/IR Server Suite/IR Server Plugins/Speech Receiver/SpeechReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Tira Transceiver/TiraTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/UirtTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Wii Remote Receiver/Wii Remote Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Windows Message Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/X10Transceiver.cs trunk/plugins/IR Server Suite/IR Server Suite.sln trunk/plugins/IR Server Suite/Input Service/Input Service/InputService.cs trunk/plugins/IR Server Suite/Input Service/Input Service/Program.cs Property Changed: ---------------- trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/ trunk/plugins/IR Server Suite/IR Server Plugins/MacMini Receiver/ Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -112,6 +112,9 @@ #region Constructor + /// <summary> + /// Initializes a new instance of the <see cref="Config"/> class. + /// </summary> public Config() { InitializeComponent(); @@ -322,7 +325,8 @@ { try { - Help.ShowHelp(this, SystemRegistry.GetInstallFolder() + "\\IR Server Suite.chm", HelpNavigator.Topic, "IR Server\\index.html"); + string helpFile = System.IO.Path.Combine(SystemRegistry.GetInstallFolder(), "IR Server Suite.chm"); + Help.ShowHelp(this, helpFile, HelpNavigator.Topic, "IR Server\\index.html"); } catch (Exception ex) { Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -84,7 +84,8 @@ if (String.IsNullOrEmpty(installFolder)) return null; - string[] files = Directory.GetFiles(installFolder + "\\IR Server Plugins\\", "*.dll", SearchOption.TopDirectoryOnly); + string path = Path.Combine(installFolder, "IR Server Plugins"); + string[] files = Directory.GetFiles(path, "*.dll", SearchOption.TopDirectoryOnly); foreach (string file in files) { try @@ -96,10 +97,17 @@ { if (type.IsClass && !type.IsAbstract && type.IsSubclassOf(typeof(PluginBase))) { - PluginBase plugin = (PluginBase)assembly.CreateInstance(type.FullName); + try + { + PluginBase plugin = (PluginBase)assembly.CreateInstance(type.FullName); - if (plugin != null) - plugins.Add(plugin); + if (plugin != null) + plugins.Add(plugin); + } + catch + { + // Ignore this plugin ... + } } } } Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -544,13 +544,15 @@ } else if (radioButtonClass.Checked) { - // TODO: Locate Class + WindowList windowList = new WindowList(true); + if (windowList.ShowDialog(this) == DialogResult.OK) + textBoxMsgTarget.Text = windowList.SelectedItem; } else if (radioButtonWindowTitle.Checked) { - WindowList windowList = new WindowList(); + WindowList windowList = new WindowList(false); if (windowList.ShowDialog(this) == DialogResult.OK) - textBoxMsgTarget.Text = windowList.SelectedWindowTitle; + textBoxMsgTarget.Text = windowList.SelectedItem; } } @@ -566,7 +568,7 @@ } private void radioButtonClass_CheckedChanged(object sender, EventArgs e) { - buttonFindMsgTarget.Enabled = false; + buttonFindMsgTarget.Enabled = true; textBoxMsgTarget.Enabled = true; } private void radioButtonWindowTitle_CheckedChanged(object sender, EventArgs e) Modified: trunk/plugins/IR Server Suite/Applications/Translator/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -809,7 +809,7 @@ if (_inConfiguration) return; - // Ability to handle Abstract and Complex remote buttons ... + // TODO: Ability to handle Abstract and Complex remote buttons ... string button = keyCode; // TODO: Include abstract button support ... Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -135,18 +135,17 @@ if (String.IsNullOrEmpty(skin)) return; - string skinFile = String.Format("{0}\\Skins\\{1}.png", Program.InstallFolder, skin); + string skinFile = Path.Combine(Program.InstallFolder, String.Format("Skins\\{0}.png", skin)); if (!File.Exists(skinFile)) throw new FileNotFoundException("Skin graphic file not found", skinFile); // Try to load xml file of same name, failing that load using first word of skin name ... - string xmlFile = String.Format("{0}\\Skins\\{1}.xml", Program.InstallFolder, skin); + string xmlFile = Path.Combine(Program.InstallFolder, String.Format("Skins\\{0}.xml", skin)); if (!File.Exists(xmlFile)) { string firstWord = skin.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)[0]; - xmlFile = String.Format("{0}\\Skins\\{1}.xml", Program.InstallFolder, firstWord); - + xmlFile = Path.Combine(Program.InstallFolder, String.Format("Skins\\{0}.xml", firstWord)); if (!File.Exists(xmlFile)) throw new FileNotFoundException("Skin file not found", xmlFile); } Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -227,7 +227,7 @@ if (String.IsNullOrEmpty(_installFolder)) _installFolder = "."; else - _installFolder += "\\Virtual Remote"; + _installFolder = Path.Combine(_installFolder, "Virtual Remote"); } catch (Exception ex) { Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/CloseProgramCommand.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/CloseProgramCommand.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/CloseProgramCommand.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -102,13 +102,15 @@ } else if (radioButtonClass.Checked) { - // TODO: Locate Class + WindowList windowList = new WindowList(true); + if (windowList.ShowDialog(this) == DialogResult.OK) + textBoxTarget.Text = windowList.SelectedItem; } else if (radioButtonWindowTitle.Checked) { - WindowList windowList = new WindowList(); + WindowList windowList = new WindowList(false); if (windowList.ShowDialog(this) == DialogResult.OK) - textBoxTarget.Text = windowList.SelectedWindowTitle; + textBoxTarget.Text = windowList.SelectedItem; } } @@ -136,7 +138,7 @@ } private void radioButtonClass_CheckedChanged(object sender, EventArgs e) { - buttonFindTarget.Enabled = false; + buttonFindTarget.Enabled = true; textBoxTarget.Enabled = true; } private void radioButtonWindowTitle_CheckedChanged(object sender, EventArgs e) Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/MessageCommand.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/MessageCommand.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/MessageCommand.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -108,13 +108,15 @@ } else if (radioButtonClass.Checked) { - // TODO: Locate Class + WindowList windowList = new WindowList(true); + if (windowList.ShowDialog(this) == DialogResult.OK) + textBoxMsgTarget.Text = windowList.SelectedItem; } else if (radioButtonWindowTitle.Checked) { - WindowList windowList = new WindowList(); + WindowList windowList = new WindowList(false); if (windowList.ShowDialog(this) == DialogResult.OK) - textBoxMsgTarget.Text = windowList.SelectedWindowTitle; + textBoxMsgTarget.Text = windowList.SelectedItem; } } @@ -151,7 +153,7 @@ } private void radioButtonClass_CheckedChanged(object sender, EventArgs e) { - buttonFindMsgTarget.Enabled = false; + buttonFindMsgTarget.Enabled = true; textBoxMsgTarget.Enabled = true; } private void radioButtonWindowTitle_CheckedChanged(object sender, EventArgs e) Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/WindowList.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/WindowList.Designer.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/WindowList.Designer.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -28,28 +28,28 @@ /// </summary> private void InitializeComponent() { - this.listBoxWindows = new System.Windows.Forms.ListBox(); + this.listBoxItems = new System.Windows.Forms.ListBox(); this.SuspendLayout(); // // listBoxWindows // - this.listBoxWindows.Dock = System.Windows.Forms.DockStyle.Fill; - this.listBoxWindows.FormattingEnabled = true; - this.listBoxWindows.HorizontalScrollbar = true; - this.listBoxWindows.IntegralHeight = false; - this.listBoxWindows.Location = new System.Drawing.Point(0, 0); - this.listBoxWindows.Name = "listBoxWindows"; - this.listBoxWindows.Size = new System.Drawing.Size(292, 376); - this.listBoxWindows.TabIndex = 0; - this.listBoxWindows.DoubleClick += new System.EventHandler(this.listBoxWindows_DoubleClick); - this.listBoxWindows.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.listBoxWindows_KeyPress); + this.listBoxItems.Dock = System.Windows.Forms.DockStyle.Fill; + this.listBoxItems.FormattingEnabled = true; + this.listBoxItems.HorizontalScrollbar = true; + this.listBoxItems.IntegralHeight = false; + this.listBoxItems.Location = new System.Drawing.Point(0, 0); + this.listBoxItems.Name = "listBoxWindows"; + this.listBoxItems.Size = new System.Drawing.Size(292, 376); + this.listBoxItems.TabIndex = 0; + this.listBoxItems.DoubleClick += new System.EventHandler(this.listBoxWindows_DoubleClick); + this.listBoxItems.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.listBoxWindows_KeyPress); // // WindowList // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(292, 376); - this.Controls.Add(this.listBoxWindows); + this.Controls.Add(this.listBoxItems); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; this.MaximizeBox = false; this.MinimizeBox = false; @@ -65,6 +65,6 @@ #endregion - private System.Windows.Forms.ListBox listBoxWindows; + private System.Windows.Forms.ListBox listBoxItems; } } \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/WindowList.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/WindowList.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/WindowList.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -10,20 +10,26 @@ { /// <summary> - /// Window List form. + /// Window or Class List form. /// </summary> public partial class WindowList : Form { + #region Variables + + bool _listClasses; + + #endregion Variables + #region Properties /// <summary> - /// Gets the selected window title. + /// Gets the selected window title or class name. /// </summary> - /// <value>The selected window title.</value> - public string SelectedWindowTitle + /// <value>The selected window title or class name.</value> + public string SelectedItem { - get { return listBoxWindows.SelectedItem as string; } + get { return listBoxItems.SelectedItem as string; } } #endregion Properties @@ -33,10 +39,18 @@ /// <summary> /// Initializes a new instance of the <see cref="WindowList"/> class. /// </summary> - public WindowList() + /// <param name="listClasses">if set to <c>true</c> [list classes].</param> + public WindowList(bool listClasses) { + _listClasses = listClasses; + InitializeComponent(); + if (listClasses) + this.Text = "Class List"; + else + this.Text = "Window List"; + PopulateList(); } @@ -51,10 +65,17 @@ bool AddWindow(IntPtr hWnd, IntPtr lParam) { - string title = Win32.GetWindowTitle(hWnd); + string windowTitle = Win32.GetWindowTitle(hWnd); - if (!String.IsNullOrEmpty(title)) - listBoxWindows.Items.Add(title); + if (_listClasses && String.IsNullOrEmpty(windowTitle)) + { + string className = Win32.GetClassName(hWnd); + listBoxItems.Items.Add(className); + } + else if (!_listClasses && !String.IsNullOrEmpty(windowTitle)) + { + listBoxItems.Items.Add(windowTitle); + } return true; } Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Win32.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Win32.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Win32.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -1901,6 +1901,12 @@ IntPtr hWnd, int nIndex); + [DllImport("user32.dll")] + static extern int GetClassName( + IntPtr hWnd, + StringBuilder lpClassName, + int nMaxCount); + #endregion Interop #region Methods @@ -2058,6 +2064,19 @@ } /// <summary> + /// Gets the name of a class from a handle. + /// </summary> + /// <param name="hWnd">The handle to retreive the class name for.</param> + /// <returns>The class name.</returns> + public static string GetClassName(IntPtr hWnd) + { + StringBuilder name = new StringBuilder(255); + GetClassName(hWnd, name, name.Capacity); + + return name.ToString(); + } + + /// <summary> /// Used to logoff, shutdown or reboot. /// </summary> /// <param name="flags">The type of exit to perform.</param> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/Ads Tech PTV-335 Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/Ads Tech PTV-335 Receiver.csproj 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Ads Tech PTV-335 Receiver/Ads Tech PTV-335 Receiver.csproj 2008-02-29 17:31:08 UTC (rev 1411) @@ -33,8 +33,6 @@ </PropertyGroup> <ItemGroup> <Reference Include="System" /> - <Reference Include="System.Data" /> - <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> <Compile Include="AdsTechPTV335Receiver.cs" /> Property changes on: trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver ___________________________________________________________________ Name: svn:ignore + bin obj Modified: trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/CoolCommand Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/CoolCommand Receiver.csproj 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/CoolCommand Receiver.csproj 2008-02-29 17:31:08 UTC (rev 1411) @@ -58,7 +58,6 @@ </PropertyGroup> <ItemGroup> <Reference Include="System" /> - <Reference Include="System.Data" /> <Reference Include="System.Drawing" /> <Reference Include="System.Windows.Forms" /> <Reference Include="System.Xml" /> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/CoolCommandReceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/CoolCommandReceiver.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/CoolCommandReceiver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -25,9 +25,7 @@ #region Constants - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\Input Service\\CoolRemote Receiver.xml"; + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "CoolCommand Receiver.xml"); const int WM_COOL = 0x0A00; @@ -74,6 +72,7 @@ /// </returns> public override bool Detect() { + // TODO: Add CoolCommand detection try { return false; Modified: trunk/plugins/IR Server Suite/IR Server Plugins/CoolCommand Receiver/Icon.ico =================================================================== (Binary files differ) Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -58,9 +58,7 @@ #region Constants - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\Input Service\\Custom HID Receiver.xml"; + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "Custom HID Receiver.xml"); const int DeviceBufferSize = 255; Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/DirectInputReceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/DirectInputReceiver.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/DirectInputReceiver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -1,6 +1,7 @@ using System; using System.Collections; using System.Diagnostics; +using System.IO; using System.Runtime.InteropServices; using System.Text; using System.Windows.Forms; @@ -19,9 +20,7 @@ #region Constants - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\Input Service\\Direct Input Receiver.xml"; + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "Direct Input Receiver.xml"); #endregion Constants Modified: trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -25,9 +25,7 @@ #region Constants - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\Input Service\\FusionRemote Receiver.xml"; + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "FusionRemote Receiver.xml"); const string DeviceID = "VID_0FE9&PID_9010"; Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Girder Plugin.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Girder Plugin.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Girder Plugin/Girder Plugin.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -19,9 +19,7 @@ #region Constants - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\Input Service\\Girder Plugin.xml"; + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "Girder Plugin.xml"); static readonly string[] Ports = new string[] { "Plugin" }; Modified: trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/HcwReceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/HcwReceiver.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/HCW Receiver/HcwReceiver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -21,9 +21,7 @@ #region Constants - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\IR Server\\HCW Receiver.xml"; + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "HCW Receiver.xml"); #endregion Constants Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IR Server Plugin Interface.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IR Server Plugin Interface.csproj 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IR Server Plugin Interface.csproj 2008-02-29 17:31:08 UTC (rev 1411) @@ -60,9 +60,7 @@ </PropertyGroup> <ItemGroup> <Reference Include="System" /> - <Reference Include="System.Data" /> <Reference Include="System.Windows.Forms" /> - <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> <Compile Include="IConfigure.cs" /> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/PluginBase.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/PluginBase.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/PluginBase.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -1,3 +1,6 @@ +using System; +using System.IO; + namespace InputService.Plugin { @@ -7,6 +10,17 @@ public abstract class PluginBase { + #region Constants + + /// <summary> + /// Plugin configuration file base path. + /// </summary> + public static readonly string ConfigurationPath = + Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), + Path.Combine("IR Server Suite", "Input Service")); + + #endregion Constants + #region Properties /// <summary> @@ -51,12 +65,12 @@ /// <summary> /// Suspend the IR Server plugin when computer enters standby. /// </summary> - public abstract void Suspend(); + public virtual void Suspend() { } /// <summary> /// Resume the IR Server plugin when the computer returns from standby. /// </summary> - public abstract void Resume(); + public virtual void Resume() { } /// <summary> /// Stop the IR Server plugin. Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -21,9 +21,7 @@ #region Constants - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\Input Service\\IRMan Receiver.xml"; + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "IRMan Receiver.xml"); const int DeviceBufferSize = 6; @@ -70,17 +68,6 @@ public override string Description { get { return "Receiver support for the Serial IRMan device"; } } /// <summary> - /// Detect the presence of this device. Devices that cannot be detected will always return false. - /// </summary> - /// <returns> - /// <c>true</c> if the device is present, otherwise <c>false</c>. - /// </returns> - public override bool Detect() - { - return false; - } - - /// <summary> /// Start the IR Server plugin. /// </summary> public override void Start() Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -183,9 +183,7 @@ #region Constants - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\Input Service\\IRTrans Transceiver.xml"; + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "IRTrans Transceiver.xml"); const string DefaultRemoteModel = "mediacenter"; const string DefaultServerAddress = "localhost"; Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/IgorPlug Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/IgorPlug Receiver.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/IgorPlug Receiver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -167,7 +167,7 @@ /// A description of the IR Server plugin. /// </summary> /// <value>The description.</value> - public override string Description { get { return "IgorPlug Receiver"; } } + public override string Description { get { return "IgorPlug USB Receiver"; } } /// <summary> /// Start the IR Server plugin. @@ -335,7 +335,7 @@ { bool Result = false; - SafeFileHandle handle = CreateFile("\\\\.\\IgorPlugUSB_0", + SafeFileHandle handle = CreateFile(@"\\.\IgorPlugUSB_0", CreateFileAccessTypes.GenericRead | CreateFileAccessTypes.GenericWrite, CreateFileShares.Read | CreateFileShares.Write, IntPtr.Zero, Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Ira Transceiver/IraTransceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Ira Transceiver/IraTransceiver.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Ira Transceiver/IraTransceiver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -37,14 +37,12 @@ /// IR Server Plugin for Ira Transceiver device. /// </summary> [CLSCompliant(false)] - public class IraTransceiver : IRServerPluginBase, IConfigure, ITransmitIR, ILearnIR, IRemoteReceiver + public class IraTransceiver : PluginBase, IConfigure, ITransmitIR, ILearnIR, IRemoteReceiver { #region Constants - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\Input Service\\Ira Transceiver.xml"; + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "Ira Transceiver.xml"); static readonly string[] Ports = new string[] { "Default" }; @@ -104,13 +102,13 @@ /// </summary> public override void Suspend() { - if (_deviceType == DeviceType.Tira) + /*if (_deviceType == DeviceType.Tira) { byte[] suspendCommand = new byte[] { 49, 57, 0, 0, 0, 0, 0, 0 }; Array.Copy(_suspendCommand, 0, suspendCommand, 2, _suspendCommand.Length); _serialPort.Write(suspendCommand); - } + }*/ Disconnect(); } @@ -138,7 +136,7 @@ /// Configure the IR Server plugin. /// </summary> public void Configure(IWin32Window owner) - { + {/* LoadSettings(); Configure config = new Configure(); @@ -154,7 +152,7 @@ _learnTimeout = config.LearnTimeout; SaveSettings(); - } + }*/ } /// <summary> @@ -216,7 +214,7 @@ Disconnect(); Connect(57600); - + /* if (_learnTimedOut) { status = LearnStatus.Timeout; @@ -231,7 +229,7 @@ { status = LearnStatus.Failure; } - + */ Disconnect(); Connect(9600); @@ -242,7 +240,7 @@ /// Loads the settings. /// </summary> void LoadSettings() - { + {/* try { XmlDocument doc = new XmlDocument(); @@ -264,13 +262,13 @@ _repeatDelay = 500; _blastRepeats = 3; _learnTimeout = 10000; - } + }*/ } /// <summary> /// Saves the settings. /// </summary> void SaveSettings() - { + {/* try { using (XmlTextWriter writer = new XmlTextWriter(ConfigurationFile, Encoding.UTF8)) @@ -298,13 +296,13 @@ catch { } -#endif +#endif*/ } void Connect(int baud) { _serialPort = new SerialPort(_port, baud, Parity.None, 8, StopBits.One); - _serialPort.CtsHolding = (_deviceType == DeviceType.Tira); + //_serialPort.CtsHolding = (_deviceType == DeviceType.Tira); _serialPort.RtsEnable = (_deviceType == DeviceType.Tira); _serialPort.ReadBufferSize = DeviceBufferSize; _serialPort.ReadTimeout = 1000; @@ -340,7 +338,7 @@ // Assume it is a button press. default: if (_remoteButtonHandler != null) - _remoteButtonHandler(received); + _remoteButtonHandler(this.Name, received); break; } Modified: trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/Icon.ico =================================================================== (Binary files differ) Modified: trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/LiveDriveReceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/LiveDriveReceiver.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/LiveDriveReceiver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -77,9 +77,7 @@ #region Constants - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\Input Service\\LiveDrive Receiver.xml"; + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "LiveDrive Receiver.xml"); const int BufferLength = 256; Property changes on: trunk/plugins/IR Server Suite/IR Server Plugins/MacMini Receiver ___________________________________________________________________ Name: svn:ignore + bin obj Modified: trunk/plugins/IR Server Suite/IR Server Plugins/MacMini Receiver/MacMini Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/MacMini Receiver/MacMini Receiver.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/MacMini Receiver/MacMini Receiver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -21,7 +21,7 @@ const int DeviceBufferSize = 5; const string DevicePathVidPid = "vid_045e&pid_0284"; - const string DeviceGuid = "{9DE464EB-5DAC-4498-88BC-5010CFD2F724}"; + //const string DeviceGuid = "{9DE464EB-5DAC-4498-88BC-5010CFD2F724}"; static readonly byte[] RepeatCode = new byte[] { 0x26, 0x00, 0x00, 0x00, 0x00 }; static readonly byte[] FlatCode = new byte[] { 0x25, 0x87, 0xE0 }; Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -6,20 +6,12 @@ using System.Text; using System.Windows.Forms; -using Microsoft.Win32; - namespace InputService.Plugin { partial class Configure : Form { - #region Constants - - const string RegistrySubKey = @"SYSTEM\CurrentControlSet\Services\HidIr\Remotes\745a17a0-74d3-11d0-b6fe-00a0c90f57da"; - - #endregion Constants - #region Properties public int LearnTimeout @@ -105,14 +97,14 @@ #region Constructor + /// <summary> + /// Initializes a new instance of the <see cref="Configure"/> class. + /// </summary> public Configure() { InitializeComponent(); - if (Registry.LocalMachine.GetValue(RegistrySubKey + @"\CodeSetNum0", null) == null) - checkBoxDisableAutomaticButtons.Checked = true; - else - checkBoxDisableAutomaticButtons.Checked = false; + checkBoxDisableAutomaticButtons.Checked = !MicrosoftMceTransceiver.CheckAutomaticButtons();; } #endregion Constructor @@ -123,29 +115,18 @@ { bool changeMade = false; - using (RegistryKey key = Registry.LocalMachine.OpenSubKey(RegistrySubKey, true)) - { - bool keysExist = (key.GetValue("CodeSetNum0", null) != null); + bool keysExist = MicrosoftMceTransceiver.CheckAutomaticButtons(); - if (checkBoxDisableAutomaticButtons.Checked && keysExist) - { - key.DeleteValue("CodeSetNum0", false); - key.DeleteValue("CodeSetNum1", false); - key.DeleteValue("CodeSetNum2", false); - key.DeleteValue("CodeSetNum3", false); - - changeMade = true; - } - else if (!checkBoxDisableAutomaticButtons.Checked && !keysExist) - { - key.SetValue("CodeSetNum0", 1, RegistryValueKind.DWord); - key.SetValue("CodeSetNum1", 2, RegistryValueKind.DWord); - key.SetValue("CodeSetNum2", 3, RegistryValueKind.DWord); - key.SetValue("CodeSetNum3", 4, RegistryValueKind.DWord); - - changeMade = true; - } + if (checkBoxDisableAutomaticButtons.Checked && keysExist) + { + MicrosoftMceTransceiver.DisableAutomaticButtons(); + changeMade = true; } + else if (!checkBoxDisableAutomaticButtons.Checked && !keysExist) + { + MicrosoftMceTransceiver.EnableAutomaticButtons(); + changeMade = true; + } if (changeMade) MessageBox.Show(this, "You must restart for changes to automatic button handling to take effect", "Restart required", MessageBoxButtons.OK, MessageBoxIcon.Information); Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -390,7 +390,9 @@ { try { - _debugFile = new StreamWriter(fileName, false); + string path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), String.Format("IR Server Suite\\Logs\\{0}", fileName)); + + _debugFile = new StreamWriter(path, false); _debugFile.AutoFlush = true; } #if TRACE Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverReplacement.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverReplacement.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverReplacement.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -184,7 +184,7 @@ public override void Start() { #if DEBUG - DebugOpen("\\MicrosoftMceTransceiver_DriverReplacement.log"); + DebugOpen("MicrosoftMceTransceiver_DriverReplacement.log"); DebugWriteLine("Start()"); #endif Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverVista.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverVista.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverVista.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -569,7 +569,7 @@ public override void Start() { #if DEBUG - DebugOpen("\\MicrosoftMceTransceiver_DriverVista.log"); + DebugOpen("MicrosoftMceTransceiver_DriverVista.log"); DebugWriteLine("Start()"); #endif Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverXP.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverXP.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverXP.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -183,7 +183,7 @@ public override void Start() { #if DEBUG - DebugOpen("\\MicrosoftMceTransceiver_DriverXP.log"); + DebugOpen("MicrosoftMceTransceiver_DriverXP.log"); DebugWriteLine("Start()"); #endif Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Microsoft MCE Transceiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Microsoft MCE Transceiver.csproj 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Microsoft MCE Transceiver.csproj 2008-02-29 17:31:08 UTC (rev 1411) @@ -62,7 +62,6 @@ </PropertyGroup> <ItemGroup> <Reference Include="System" /> - <Reference Include="System.Data" /> <Reference Include="System.Drawing" /> <Reference Include="System.ServiceProcess" /> <Reference Include="System.Windows.Forms" /> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -11,6 +11,7 @@ using System.Windows.Forms; using System.Xml; +using Microsoft.Win32; using Microsoft.Win32.SafeHandles; namespace InputService.Plugin @@ -179,15 +180,15 @@ #region Constants - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\Input Service\\Microsoft MCE Transceiver.xml"; + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "Microsoft MCE Transceiver.xml"); static readonly Guid MicrosoftGuid = new Guid(0x7951772d, 0xcd50, 0x49b7, 0xb1, 0x03, 0x2b, 0xaa, 0xc4, 0x94, 0xfc, 0x57); static readonly Guid ReplacementGuid = new Guid(0x00873fdf, 0x61a8, 0x11d1, 0xaa, 0x5e, 0x00, 0xc0, 0x4f, 0xb1, 0x72, 0x8b); const int VistaVersionNumber = 6; + const string AutomaticButtonsRegKey = @"SYSTEM\CurrentControlSet\Services\HidIr\Remotes\745a17a0-74d3-11d0-b6fe-00a0c90f57da"; + #endregion Constants #region Variables @@ -213,9 +214,6 @@ bool _handleMouseLocally = true; double _mouseSensitivity = 1.0d; - // Hidden options ... - bool _forceVistaDriver = false; - #endregion Configuration Driver _driver; @@ -233,6 +231,8 @@ Mouse.MouseEvents _mouseButtons = Mouse.MouseEvents.None; + bool _ignoreAutomaticButtons = false; + RemoteHandler _remoteHandler; KeyboardHandler _keyboardHandler; MouseHandler _mouseHandler; @@ -294,6 +294,8 @@ LoadSettings(); + _ignoreAutomaticButtons = CheckAutomaticButtons(); + if (_disableMceServices) DisableMceServices(); @@ -306,14 +308,10 @@ { if (deviceGuid == MicrosoftGuid) { - if (_forceVistaDriver || Environment.OSVersion.Version.Major >= VistaVersionNumber) - { + if (Environment.OSVersion.Version.Major >= VistaVersionNumber) newDriver = new DriverVista(deviceGuid, devicePath, new RemoteCallback(RemoteEvent), new KeyboardCallback(KeyboardEvent), new MouseCallback(MouseEvent)); - } else - { newDriver = new DriverXP(deviceGuid, devicePath, new RemoteCallback(RemoteEvent), new KeyboardCallback(KeyboardEvent), new MouseCallback(MouseEvent)); - } } else { @@ -527,9 +525,6 @@ try { _enableMouseInput = bool.Parse(doc.DocumentElement.Attributes["EnableMouseInput"].Value); } catch {} try { _handleMouseLocally = bool.Parse(doc.DocumentElement.Attributes["HandleMouseLocally"].Value); } catch {} try { _mouseSensitivity = double.Parse(doc.DocumentElement.Attributes["MouseSensitivity"].Value); } catch {} - - // Hidden options ... - try { _forceVistaDriver = bool.Parse(doc.DocumentElement.Attributes["ForceVistaDriver"].Value); } catch {} } void SaveSettings() { @@ -562,9 +557,6 @@ writer.WriteAttributeString("HandleMouseLocally", _handleMouseLocally.ToString()); writer.WriteAttributeString("MouseSensitivity", _mouseSensitivity.ToString()); - // Hidden options ... - writer.WriteAttributeString("ForceVistaDriver", _forceVistaDriver.ToString()); - writer.WriteEndElement(); // </settings> writer.WriteEndDocument(); } @@ -626,6 +618,34 @@ return false; } + internal static bool CheckAutomaticButtons() + { + using (RegistryKey key = Registry.LocalMachine.OpenSubKey(AutomaticButtonsRegKey, false)) + { + return (key.GetValue("CodeSetNum0", null) != null); + } + } + internal static void EnableAutomaticButtons() + { + using (RegistryKey key = Registry.LocalMachine.OpenSubKey(AutomaticButtonsRegKey, true)) + { + key.SetValue("CodeSetNum0", 1, RegistryValueKind.DWord); + key.SetValue("CodeSetNum1", 2, RegistryValueKind.DWord); + key.SetValue("CodeSetNum2", 3, RegistryValueKind.DWord); + key.SetValue("CodeSetNum3", 4, RegistryValueKind.DWord); + } + } + internal static void DisableAutomaticButtons() + { + using (RegistryKey key = Registry.LocalMachine.OpenSubKey(AutomaticButtonsRegKey, true)) + { + key.DeleteValue("CodeSetNum0", false); + key.DeleteValue("CodeSetNum1", false); + key.DeleteValue("CodeSetNum2", false); + key.DeleteValue("CodeSetNum3", false); + } + } + static void DisableMceServices() { // Vista ... @@ -693,6 +713,46 @@ if (!_enableRemoteInput) return; + if (_ignoreAutomaticButtons && codeType == IrProtocol.RC6_MCE) + { + // Always ignore these buttones ... + if (keyCode == 0x7bdc || // Back + keyCode == 0x7bdd || // OK + keyCode == 0x7bde || // Right + keyCode == 0x7bdf || // Left + keyCode == 0x7be0 || // Down + keyCode == 0x7be1 || // Up + keyCode == 0x7bee || // Volume_Down + keyCode == 0x7bef || // Volume_Up + keyCode == 0x7bf1 || // Mute + keyCode == 0x7bf3 || // PC_Power + keyCode == 0x7bf6 || // Number_9 + keyCode == 0x7bf7 || // Number_8 + keyCode == 0x7bf8 || // Number_7 + keyCode == 0x7bf9 || // Number_6 + keyCode == 0x7bfa || // Number_5 + keyCode == 0x7bfb || // Number_4 + keyCode == 0x7bfc || // Number_3 + keyCode == 0x7bfd || // Number_2 + keyCode == 0x7bfe || // Number_1 + keyCode == 0x7bff) // Number_0 + { +#if TRACE + Trace.WriteLine("Ignoring remote button due to automatic handling"); +#endif + return; + } + + // Only ignore Start if the services aren't disabled ... + if (keyCode == 0x7bf2 && !_disableMceServices) + { +#if TRACE + Trace.WriteLine("Ignoring Start button due to automatic handling and the MCE services being active"); +#endif + return; + } + } + if (!firstPress && _lastRemoteButtonCodeType == codeType && _lastRemoteButtonKeyCode == keyCode) { TimeSpan timeBetween = DateTime.Now.Subtract(_lastRemoteButtonTime); Modified: trunk/plugins/IR Server Suite/IR Server Plugins/RedEye Blaster/RedEye Blaster.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/RedEye Blaster/RedEye Blaster.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/RedEye Blaster/RedEye Blaster.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -44,9 +44,7 @@ #region Constants - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\Input Service\\RedEye Blaster.xml"; + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "RedEye Blaster.xml"); static readonly string[] Ports = new string[] { "Default" }; Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Serial IR Blaster/Serial IR Blaster.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Serial IR Blaster/Serial IR Blaster.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Serial IR Blaster/Serial IR Blaster.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -21,9 +21,7 @@ #region Constants - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\Input Service\\Serial IR Blaster.xml"; + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "Serial IR Blaster.xml"); static readonly string[] Ports = new string[] { "Default" }; Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Speech Receiver/SpeechReceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Speech Receiver/SpeechReceiver.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Speech Receiver/SpeechReceiver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -13,7 +13,7 @@ /// <summary> /// IR Server Plugin for the receiving speech commands. /// </summary> - public class SpeechReceiver : IRServerPluginBase, IRemoteReceiver, IConfigure + public class SpeechReceiver : PluginBase, IRemoteReceiver, IConfigure { #region Constants @@ -87,7 +87,7 @@ /// </summary> /// <param name="owner">The owner window to use for creating modal dialogs.</param> public void Configure(IWin32Window owner) - { + {/* LoadSettings(); Setup setup = new Setup(); @@ -111,7 +111,7 @@ _led4 = setup.LED4; SaveSettings(); - } + }*/ } /// <summary> @@ -125,7 +125,7 @@ } void LoadSettings() - { + {/* XmlDocument doc = new XmlDocument(); try { doc.Load(ConfigurationFile); } @@ -147,10 +147,10 @@ try { _led3 = bool.Parse(doc.DocumentElement.Attributes["LED3"].Value); } catch { } try { _led4 = bool.Parse(doc.DocumentElement.Attributes["LED4"].Value); } - catch { } + catch { }*/ } void SaveSettings() - { + {/* try { using (XmlTextWriter writer = new XmlTextWriter(ConfigurationFile, Encoding.UTF8)) @@ -183,7 +183,7 @@ catch { } -#endif +#endif*/ } #endregion Implementation Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Tira Transceiver/TiraTransceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Tira Transceiver/TiraTransceiver.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Tira Transceiver/TiraTransceiver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -18,14 +18,12 @@ /// IR Server Plugin for Tira Transceiver device. /// </summary> [CLSCompliant(false)] - public class TiraTransceiver : IRServerPluginBase, IConfigure, ITransmitIR, ILearnIR, IRemoteReceiver + public class TiraTransceiver : PluginBase, IConfigure, ITransmitIR, ILearnIR, IRemoteReceiver { #region Constants - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\Input Service\\Tira Transceiver.xml"; + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "Tira Transceiver.xml"); static readonly string[] Ports = new string[] { "Default" }; Modified: trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/UirtTransceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/UirtTransceiver.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/UirtTransceiver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -23,9 +23,7 @@ #region Constants - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\Input Service\\USB-UIRT Transceiver.xml"; + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "USB-UIRT Transceiver.xml"); const int UUIRTDRV_IRFMT_UUIRT = 0x0000; const int UUIRTDRV_IRFMT_PRONTO = 0x0010; Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Wii Remote Receiver/Wii Remote Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Wii Remote Receiver/Wii Remote Receiver.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Wii Remote Receiver/Wii Remote Receiver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -3,6 +3,7 @@ using System.Diagnostics; #endif using System.Drawing; +using System.IO; using System.Text; using System.Windows.Forms; using System.Xml; @@ -20,9 +21,7 @@ #region Constants - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\Input Service\\Wii Remote Receiver.xml"; + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "Wii Remote Receiver.xml"); readonly int ScreenWidth = Screen.PrimaryScreen.WorkingArea.Width; readonly int ScreenHeight = Screen.PrimaryScreen.WorkingArea.Height; Modified: trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -22,9 +22,7 @@ #region Constants - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\Input Service\\WinLirc Receiver.xml"; + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "WinLirc Receiver.xml"); #endregion Constants Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Windows Message Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Windows Message Receiver.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Windows Message Receiver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -31,9 +31,7 @@ #region Constants - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\Input Service\\Windows Messages.xml"; + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "Windows Messages.xml"); const int WM_APP = 0x8000; const int DefaultMessageID = 0x0018; Modified: trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/X10Transceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/X10Transceiver.cs 2008-02-29 07:26:50 UTC (rev 1410) +++ trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/X10Transceiver.cs 2008-02-29 17:31:08 UTC (rev 1411) @@ -3,6 +3,7 @@ #if TRACE using System.Diagnostics; #endif +using System.IO; using System.Runtime.InteropServices; using System.Runtime.InteropServices.ComTypes; using System.Text; @@ -20,9 +21,7 @@ #region Constants - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\Input Service\\X10 Receiver.xml"; + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "X10 Transceiver.xml"); #endregion Constants Modified: trunk/plugins/IR Server Suite/IR Server Suite.sln =================... [truncated message content] |