From: <an...@us...> - 2008-04-10 15:47:24
|
Revision: 1624 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1624&view=rev Author: and-81 Date: 2008-04-10 08:47:17 -0700 (Thu, 10 Apr 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/IR Server Plugins/Imon Receiver/Imon Receiver.cs trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/Imon/Imon PAD.xml trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/InputMapper/InputHandler.cs Added Paths: ----------- trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/Imon/Imon Front Panel.xml trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/Imon/Imon Volume Knob.xml Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Imon Receiver/Imon Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Imon Receiver/Imon Receiver.cs 2008-04-10 14:17:58 UTC (rev 1623) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Imon Receiver/Imon Receiver.cs 2008-04-10 15:47:17 UTC (rev 1624) @@ -95,6 +95,9 @@ const uint IMON_PAD_BUTTON = 1000; const uint IMON_MCE_BUTTON = 2000; + const uint IMON_PANEL_BUTTON = 3000; + const uint IMON_VOLUME_UP = 4001; + const uint IMON_VOLUME_DOWN = 4002; static readonly byte[][] SetModeMCE = new byte[][] { new byte[] { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00 }, @@ -438,7 +441,8 @@ { try { - SafeFileHandle deviceHandle = CreateFile(DevicePath, CreateFileAccessTypes.GenericRead | CreateFileAccessTypes.GenericWrite, CreateFileShares.Read | CreateFileShares.Write, IntPtr.Zero, CreateFileDisposition.OpenExisting, CreateFileAttributes.Overlapped, IntPtr.Zero); + //SafeFileHandle deviceHandle = CreateFile(DevicePath, CreateFileAccessTypes.GenericRead | CreateFileAccessTypes.GenericWrite, CreateFileShares.Read | CreateFileShares.Write, IntPtr.Zero, CreateFileDisposition.OpenExisting, CreateFileAttributes.Overlapped, IntPtr.Zero); + SafeFileHandle deviceHandle = CreateFile(DevicePath, CreateFileAccessTypes.GenericRead | CreateFileAccessTypes.GenericWrite, CreateFileShares.Read | CreateFileShares.Write, IntPtr.Zero, CreateFileDisposition.OpenExisting, CreateFileAttributes.Normal, IntPtr.Zero); int lastError = Marshal.GetLastWin32Error(); if (deviceHandle.IsInvalid) @@ -466,7 +470,8 @@ LoadSettings(); - _deviceHandle = CreateFile(DevicePath, CreateFileAccessTypes.GenericRead | CreateFileAccessTypes.GenericWrite, CreateFileShares.Read | CreateFileShares.Write, IntPtr.Zero, CreateFileDisposition.OpenExisting, CreateFileAttributes.Overlapped, IntPtr.Zero); + //_deviceHandle = CreateFile(DevicePath, CreateFileAccessTypes.GenericRead | CreateFileAccessTypes.GenericWrite, CreateFileShares.Read | CreateFileShares.Write, IntPtr.Zero, CreateFileDisposition.OpenExisting, CreateFileAttributes.Overlapped, IntPtr.Zero); + _deviceHandle = CreateFile(DevicePath, CreateFileAccessTypes.GenericRead | CreateFileAccessTypes.GenericWrite, CreateFileShares.Read | CreateFileShares.Write, IntPtr.Zero, CreateFileDisposition.OpenExisting, CreateFileAttributes.Normal, IntPtr.Zero); int lastError = Marshal.GetLastWin32Error(); if (_deviceHandle.IsInvalid) @@ -695,6 +700,20 @@ MouseEvent(xSign * xSize, ySign * ySize, right, left); } + else if (dataBytes[7] == 0xEE) // Front panel buttons/volume knob + { + if (dataBytes[3] != 0x01) + { + uint keyCode = IMON_PANEL_BUTTON + dataBytes[3]; + RemoteEvent(keyCode, _remoteToggle != dataBytes[3]); + } + _remoteToggle = dataBytes[3]; + + if (dataBytes[0] == 0x01) + RemoteEvent(IMON_VOLUME_DOWN, true); + if (dataBytes[1] == 0x01) + RemoteEvent(IMON_VOLUME_UP, true); + } } void ReceiveThread() @@ -720,7 +739,12 @@ byte[] dataBytes = new byte[bytesRead]; Marshal.Copy(deviceBufferPtr, dataBytes, 0, bytesRead); - if (dataBytes[0] != 0xFF && dataBytes[0] != 0x00) + // Rubbish data: + // FF, FF, FF, FF, FF, FF, 9F, FF, + // 00, 00, 00, 00, 00, 00, 00, F0, + + if (dataBytes[0] != 0xFF && dataBytes[1] != 0xFF && dataBytes[2] != 0xFF && dataBytes[3] != 0xFF && + dataBytes[0] != 0x00 && dataBytes[1] != 0x00 && dataBytes[2] != 0x00 && dataBytes[3] != 0x00) ProcessInput(dataBytes); } } @@ -745,6 +769,21 @@ void IoControl(uint ioControlCode, IntPtr inBuffer, int inBufferSize, IntPtr outBuffer, int outBufferSize, out int bytesReturned) { + try + { + DeviceIoControl(_deviceHandle, ioControlCode, inBuffer, inBufferSize, outBuffer, outBufferSize, out bytesReturned, IntPtr.Zero); + } + catch + { + if (_deviceHandle != null) + CancelIo(_deviceHandle); + + throw; + } + } + + void IoControlOverlapped(uint ioControlCode, IntPtr inBuffer, int inBufferSize, IntPtr outBuffer, int outBufferSize, out int bytesReturned) + { int lastError; using (WaitHandle waitHandle = new ManualResetEvent(false)) Added: trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/Imon/Imon Front Panel.xml =================================================================== --- trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/Imon/Imon Front Panel.xml (rev 0) +++ trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/Imon/Imon Front Panel.xml 2008-04-10 15:47:17 UTC (rev 1624) @@ -0,0 +1,12 @@ +<?xml version="1.0" standalone="yes"?> +<DocumentElement> + <RemoteTable RawCode="3018" AbstractButton="Up" /> + <RemoteTable RawCode="3019" AbstractButton="Down" /> + <RemoteTable RawCode="3020" AbstractButton="Left" /> + <RemoteTable RawCode="3021" AbstractButton="Right" /> + <RemoteTable RawCode="3022" AbstractButton="OK" /> + <RemoteTable RawCode="3044" AbstractButton="Start" /> + <RemoteTable RawCode="3023" AbstractButton="Back" /> + <RemoteTable RawCode="3045" AbstractButton="Info" /> + <RemoteTable RawCode="3043" AbstractButton="Power" /> +</DocumentElement> \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/Imon/Imon PAD.xml =================================================================== --- trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/Imon/Imon PAD.xml 2008-04-10 14:17:58 UTC (rev 1623) +++ trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/Imon/Imon PAD.xml 2008-04-10 15:47:17 UTC (rev 1624) @@ -1,9 +1,5 @@ <?xml version="1.0" standalone="yes"?> <DocumentElement> - <RemoteTable RawCode="?1" AbstractButton="Up" /> - <RemoteTable RawCode="?2" AbstractButton="Down" /> - <RemoteTable RawCode="?3" AbstractButton="Left" /> - <RemoteTable RawCode="?4" AbstractButton="Right" /> <RemoteTable RawCode="1148" AbstractButton="OK" /> <RemoteTable RawCode="1038" AbstractButton="VolumeUp" /> <RemoteTable RawCode="1042" AbstractButton="VolumeDown" /> @@ -11,7 +7,6 @@ <RemoteTable RawCode="1014" AbstractButton="ChannelDown" /> <RemoteTable RawCode="1178" AbstractButton="Start" /> <RemoteTable RawCode="1032" AbstractButton="Back" /> - <RemoteTable RawCode="?5" AbstractButton="Info" /> <RemoteTable RawCode="1218" AbstractButton="Mute" /> <RemoteTable RawCode="1234" AbstractButton="Number0" /> <RemoteTable RawCode="1058" AbstractButton="Number1" /> @@ -33,11 +28,6 @@ <RemoteTable RawCode="1208" AbstractButton="PreviousChapter" /> <RemoteTable RawCode="1002" AbstractButton="Power" /> <RemoteTable RawCode="1016" AbstractButton="Power2" /> - <RemoteTable RawCode="?6" AbstractButton="Teletext" /> - <RemoteTable RawCode="?7" AbstractButton="Red" /> - <RemoteTable RawCode="?8" AbstractButton="Green" /> - <RemoteTable RawCode="?9" AbstractButton="Yellow" /> - <RemoteTable RawCode="?10" AbstractButton="Blue" /> <RemoteTable RawCode="1252" AbstractButton="Clear" /> <RemoteTable RawCode="1034" AbstractButton="Enter" /> <RemoteTable RawCode="1096" AbstractButton="Hash" /> @@ -47,12 +37,8 @@ <RemoteTable RawCode="1200" AbstractButton="Videos" /> <RemoteTable RawCode="1102" AbstractButton="DVD" /> <RemoteTable RawCode="1040" AbstractButton="TV" /> - <RemoteTable RawCode="?11" AbstractButton="Guide" /> - <RemoteTable RawCode="?12" AbstractButton="LiveTV" /> - <RemoteTable RawCode="?13" AbstractButton="Radio" /> - <RemoteTable RawCode="?14" AbstractButton="Print" /> - <RemoteTable RawCode="?15" AbstractButton="RecordedTV" /> <RemoteTable RawCode="1106" AbstractButton="AspectRatio" /> - <RemoteTable RawCode="?16" AbstractButton="Print" /> - <RemoteTable RawCode="?17" AbstractButton="Messenger" /> + <RemoteTable RawCode="1114" AbstractButton="Eject" /> + <RemoteTable RawCode="1002" AbstractButton="Close" /> + <RemoteTable RawCode="1166" AbstractButton="Fullscreen" /> </DocumentElement> \ No newline at end of file Added: trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/Imon/Imon Volume Knob.xml =================================================================== --- trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/Imon/Imon Volume Knob.xml (rev 0) +++ trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/Imon/Imon Volume Knob.xml 2008-04-10 15:47:17 UTC (rev 1624) @@ -0,0 +1,5 @@ +<?xml version="1.0" standalone="yes"?> +<DocumentElement> + <RemoteTable RawCode="4001" AbstractButton="VolumeUp" /> + <RemoteTable RawCode="4002" AbstractButton="VolumeDown" /> +</DocumentElement> \ No newline at end of file Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/InputMapper/InputHandler.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/InputMapper/InputHandler.cs 2008-04-10 14:17:58 UTC (rev 1623) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/InputMapper/InputHandler.cs 2008-04-10 15:47:17 UTC (rev 1624) @@ -324,7 +324,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) // && !g_Player.Playing) MediaPortal.Util.Utils.PlaySound(map.Sound, false, true); if (map.Focus && !GUIGraphicsContext.HasFocus) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2008-04-11 14:57:59
|
Revision: 1629 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1629&view=rev Author: and-81 Date: 2008-04-11 07:57:53 -0700 (Fri, 11 Apr 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/IgorPlug Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/IgorPlug Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/IrDecoder.cs trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/MceDetectionData.cs trunk/plugins/IR Server Suite/IR Server Plugins/Imon Receiver/Imon Receiver.cs Modified: trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs 2008-04-11 05:31:22 UTC (rev 1628) +++ trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs 2008-04-11 14:57:53 UTC (rev 1629) @@ -66,6 +66,9 @@ #region Constructor + /// <summary> + /// Initializes a new instance of the <see cref="Tray"/> class. + /// </summary> public Tray() { ContextMenuStrip contextMenu = new ContextMenuStrip(); 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-04-11 05:31:22 UTC (rev 1628) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/IgorPlug Receiver.cs 2008-04-11 14:57:53 UTC (rev 1629) @@ -21,8 +21,64 @@ public class IgorPlugReceiver : PluginBase, IRemoteReceiver { + // #define TEST_APPLICATION in the project properties when creating the console test app ... +#if TEST_APPLICATION + + static void xRemote(string deviceName, string code) + { + Console.WriteLine("Remote: {0}", code); + } + static void xKeyboard(string deviceName, int button, bool up) + { + Console.WriteLine("Keyboard: {0}, {1}", button, up); + } + static void xMouse(string deviceName, int x, int y, int buttons) + { + Console.WriteLine("Mouse: ({0}, {1}) - {2}", x, y, buttons); + } + + [STAThread] + static void Main() + { + IgorPlugReceiver device; + + try + { + device = new IgorPlugReceiver(); + + //device.Configure(null); + + device.RemoteCallback += new RemoteHandler(xRemote); + //device.KeyboardCallback += new KeyboardHandler(xKeyboard); + //device.MouseCallback += new MouseHandler(xMouse); + + device.Start(); + + Console.WriteLine("Press a button on your remote ..."); + + System.Windows.Forms.Application.Run(); + + device.Stop(); + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + } + finally + { + device = null; + } + + Console.ReadKey(); + } + +#endif + + #region Constants + const string DevicePath = @"\\.\IgorPlugUSB_0"; + const int NO_ERROR = 0; const int DEVICE_NOT_PRESENT = 1; const int NO_DATA_AVAILABLE = 2; @@ -103,6 +159,16 @@ #region Interop + [DllImport("kernel32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool DeviceIoControl( + SafeFileHandle handle, + uint ioControlCode, + byte[] inBuffer, int inBufferSize, + byte[] outBuffer, int outBufferSize, + out int bytesReturned, + IntPtr overlapped); + [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)] static extern SafeFileHandle CreateFile( [MarshalAs(UnmanagedType.LPTStr)] string fileName, @@ -118,15 +184,6 @@ static extern bool CloseHandle( SafeFileHandle handle); - [DllImport("Kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] - static extern bool DeviceIoControl( - SafeFileHandle handle, - uint ioControlCode, - byte[] inBuffer, int inBufferSize, - byte[] outBuffer, int outBufferSize, - out int bytesReturned, - IntPtr overlapped); - #endregion Interop #region Variables @@ -176,11 +233,40 @@ public override Icon DeviceIcon { get { return Properties.Resources.Icon; } } /// <summary> + /// Detect the presence of this device. Devices that cannot be detected will always return false. + /// This method should not throw exceptions. + /// </summary> + /// <returns><c>true</c> if the device is present, otherwise <c>false</c>.</returns> + public override bool Detect() + { + try + { + SafeFileHandle deviceHandle = CreateFile(DevicePath, CreateFileAccessTypes.GenericRead | CreateFileAccessTypes.GenericWrite, CreateFileShares.Read | CreateFileShares.Write, IntPtr.Zero, CreateFileDisposition.OpenExisting, CreateFileAttributes.Normal, IntPtr.Zero); + int lastError = Marshal.GetLastWin32Error(); + + if (deviceHandle.IsInvalid) + throw new Win32Exception(lastError, "Failed to open device"); + + CloseHandle(deviceHandle); + + return true; + } + catch + { + return false; + } + } + + /// <summary> /// Start the IR Server plugin. /// </summary> - /// <returns><c>true</c> if successful, otherwise <c>false</c>.</returns> public override void Start() { +#if DEBUG + DebugOpen("IgorPlug Receiver.log"); + DebugWriteLine("Start()"); +#endif + ThreadStart readThreadStart = new ThreadStart(ReadThread); _readThread = new Thread(readThreadStart); _readThread.IsBackground = true; @@ -191,6 +277,10 @@ /// </summary> public override void Suspend() { +#if DEBUG + DebugWriteLine("Suspend()"); +#endif + Stop(); } /// <summary> @@ -198,6 +288,10 @@ /// </summary> public override void Resume() { +#if DEBUG + DebugWriteLine("Resume()"); +#endif + Start(); } /// <summary> @@ -205,10 +299,18 @@ /// </summary> public override void Stop() { +#if DEBUG + DebugWriteLine("Stop()"); +#endif + _readThread.Abort(); if (_readThread.IsAlive) _readThread.Join(); + +#if DEBUG + DebugClose(); +#endif } /// <summary> @@ -237,6 +339,15 @@ switch (returnCode) { case NO_ERROR: + byte[] data = new byte[codeLength]; + Array.Copy(timingCode, data, codeLength); + + int[] timingData = GetTimingData(data); + + IrDecoder.DecodeIR(timingData, new RemoteCallback(RemoteEvent), null, null); + + Thread.Sleep(100); + DoSetInfraBufferEmpty(); break; case NO_DATA_AVAILABLE: @@ -254,27 +365,18 @@ default: throw new IOException(String.Format("Unknown error ({0})", returnCode)); } - - byte[] data = new byte[codeLength]; - Array.Copy(timingCode, data, codeLength); - - int[] timingData = GetTimingData(data); - - IrDecoder.DecodeIR(timingData, new RemoteCallback(RemoteEvent), null, null); - - Thread.Sleep(100); - DoSetInfraBufferEmpty(); } } #if TRACE - catch (Exception ex) // (ThreadAbortException ex) + catch (ThreadAbortException ex) { Trace.WriteLine(ex.ToString()); + } #else - catch // (ThreadAbortException) + catch (ThreadAbortException) { + } #endif - } } void RemoteEvent(IrProtocol codeType, uint keyCode, bool firstPress) @@ -290,7 +392,7 @@ if (!_remoteButtonRepeated && timeBetween.TotalMilliseconds < _remoteFirstRepeat) { #if TRACE - Trace.WriteLine("Skip First Repeat"); + Trace.WriteLine("Skip, First Repeat"); #endif return; } @@ -298,7 +400,7 @@ if (_remoteButtonRepeated && timeBetween.TotalMilliseconds < _remoteHeldRepeats) { #if TRACE - Trace.WriteLine("Skip Held Repeat"); + Trace.WriteLine("Skip, Held Repeat"); #endif return; } @@ -341,16 +443,11 @@ { bool Result = false; - SafeFileHandle handle = CreateFile(@"\\.\IgorPlugUSB_0", - CreateFileAccessTypes.GenericRead | CreateFileAccessTypes.GenericWrite, - CreateFileShares.Read | CreateFileShares.Write, - IntPtr.Zero, - CreateFileDisposition.OpenExisting, - CreateFileAttributes.None, - IntPtr.Zero); + SafeFileHandle handle = CreateFile(DevicePath, CreateFileAccessTypes.GenericRead | CreateFileAccessTypes.GenericWrite, CreateFileShares.Read | CreateFileShares.Write, IntPtr.Zero, CreateFileDisposition.OpenExisting, CreateFileAttributes.None, IntPtr.Zero); + int lastError = Marshal.GetLastWin32Error(); if (handle.IsInvalid) - throw new Exception("Cannot Open IgorUSB Driver!"); + throw new Win32Exception(lastError, "Failed to open device"); try { @@ -416,7 +513,7 @@ DiagramLength = 0; OutLength = 3; if (!SendToDriver(FNCNumberDoGetInfraCode, 0, 0, ref OutputData, ref OutLength)) - return DEVICE_NOT_PRESENT; //dev not present + return DEVICE_NOT_PRESENT; BytesToRead = OutputData[0]; if ((LastReadedCode == OutputData[1]) || (OutLength <= 1) || (BytesToRead == 0)) @@ -445,15 +542,143 @@ k = 0; for (i = j; i < BytesToRead; i++) TimeCodeDiagram[k++] = OutputData[i]; + for (i = 0; i < j; i++) TimeCodeDiagram[k++] = OutputData[i]; + DiagramLength = BytesToRead; DoSetInfraBufferEmpty(); + return NO_ERROR; } #endregion Implementation + + #region Debug +#if DEBUG + + static StreamWriter _debugFile; + + /// <summary> + /// Opens a debug output file. + /// </summary> + /// <param name="fileName">Name of the file.</param> + static void DebugOpen(string fileName) + { + try + { +#if TEST_APPLICATION + string path = fileName; +#else + string path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), String.Format("IR Server Suite\\Logs\\{0}", fileName)); +#endif + _debugFile = new StreamWriter(path, false); + _debugFile.AutoFlush = true; + } +#if TRACE + catch (Exception ex) + { + Trace.WriteLine(ex.ToString()); +#else + catch + { +#endif + _debugFile = null; + } + } + + /// <summary> + /// Closes the debug output file. + /// </summary> + static void DebugClose() + { + if (_debugFile != null) + { + _debugFile.Close(); + _debugFile.Dispose(); + _debugFile = null; + } + } + + /// <summary> + /// Writes a line to the debug output file. + /// </summary> + /// <param name="line">The line.</param> + /// <param name="args">Formatting arguments.</param> + static void DebugWriteLine(string line, params object[] args) + { + if (_debugFile != null) + { + _debugFile.Write("{0:yyyy-MM-dd HH:mm:ss.ffffff} - ", DateTime.Now); + _debugFile.WriteLine(line, args); + } +#if TRACE + else + { + Trace.WriteLine(String.Format(line, args)); + } +#endif + } + + /// <summary> + /// Writes a string to the debug output file. + /// </summary> + /// <param name="text">The string to write.</param> + /// <param name="args">Formatting arguments.</param> + static void DebugWrite(string text, params object[] args) + { + if (_debugFile != null) + { + _debugFile.Write(text, args); + } +#if TRACE + else + { + Trace.Write(String.Format(text, args)); + } +#endif + } + + /// <summary> + /// Writes a new line to the debug output file. + /// </summary> + static void DebugWriteNewLine() + { + if (_debugFile != null) + { + _debugFile.WriteLine(); + } +#if TRACE + else + { + Trace.WriteLine(String.Empty); + } +#endif + } + + /// <summary> + /// Dumps an Array to the debug output file. + /// </summary> + /// <param name="array">The array.</param> + static void DebugDump(Array array) + { + foreach (object item in array) + { + if (item is byte) DebugWrite("{0:X2}", (byte) item); + else if (item is ushort) DebugWrite("{0:X4}", (ushort) item); + else if (item is int) DebugWrite("{1}{0}", (int) item, (int)item > 0 ? "+" : String.Empty); + else DebugWrite("{0}", item); + + DebugWrite(", "); + } + + DebugWriteNewLine(); + } + +#endif + #endregion Debug + } } Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/IgorPlug Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/IgorPlug Receiver.csproj 2008-04-11 05:31:22 UTC (rev 1628) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/IgorPlug Receiver.csproj 2008-04-11 14:57:53 UTC (rev 1629) @@ -11,6 +11,8 @@ <AssemblyName>IgorPlug Receiver</AssemblyName> <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent> <ApplicationIcon>Icon.ico</ApplicationIcon> + <StartupObject> + </StartupObject> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>false</DebugSymbols> @@ -57,7 +59,7 @@ <ProjectReference Include="..\IR Server Plugin Interface\IR Server Plugin Interface.csproj"> <Project>{D8B3D28F-62CE-4CA7-86CE-B7EAD614A94C}</Project> <Name>IR Server Plugin Interface</Name> - <Private>False</Private> + <Private>True</Private> </ProjectReference> </ItemGroup> <ItemGroup> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/IrDecoder.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/IrDecoder.cs 2008-04-11 05:31:22 UTC (rev 1628) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/IrDecoder.cs 2008-04-11 14:57:53 UTC (rev 1629) @@ -73,10 +73,22 @@ /// </summary> RC6_MCE, /// <summary> - /// Foxtel's protocol variation of Philips RC6. 36kHz carrier. + /// RC6-6-16 protocol variation of Philips RC6. 36kHz carrier. Used by some Vista MCE remotes (I think). /// </summary> - RC6_Foxtel, + RC6_16, /// <summary> + /// RC6-6-20 protocol variation of Philips RC6. 36kHz carrier. Used by Pace Foxtel STB's. + /// </summary> + RC6_20, + /// <summary> + /// RC6-6-24 protocol variation of Philips RC6. 36kHz carrier. RC6A. + /// </summary> + RC6_24, + /// <summary> + /// RC6-6-32 protocol variation of Philips RC6. 36kHz carrier. Used by Microsoft MCE remote. + /// </summary> + RC6_32, + /// <summary> /// RCA protocol. 56kHz carrier. /// </summary> RCA, @@ -129,22 +141,16 @@ #region Constants - const ushort ToggleBitMce = 0x8000; - const ushort ToggleMaskMce = 0x7FFF; - const ushort CustomerMce = 0x800F; + const uint ToggleBitMce = 0x8000; + const uint ToggleMaskMce = 0x7FFF; + const uint CustomerMce = 0x800F; - const ushort ToggleBitRC5 = 0x0800; - const ushort ToggleMaskRC5 = 0xF7FF; + const uint ToggleBitRC5 = 0x0800; + const uint ToggleMaskRC5 = 0x07FF; const uint ToggleBitRC5X = 0x00020000; - const ushort ToggleMaskRC5X = 0xFFFF; + const uint ToggleMaskRC5X = 0x0001FFFF; - const uint RC6HeaderMask = 0xFFFFFFF0; - - const uint PrefixRC6 = 0x000FC950; - const uint PrefixRC6A = 0x000FCA90; - const uint PrefixRC6Foxtel = 0x000FCA93; - const uint MceMouse = 1; const uint MceKeyboard = 4; @@ -998,7 +1004,7 @@ case RemoteDetectionState.HeaderPulse: if (pulse) { - if (IsBetween(duration, 750, 1100)) + if (IsBetween(duration, 700, 1100)) { RC5_Data.State = RemoteDetectionState.HeaderSpace; RC5_Data.Bit = 13; @@ -1019,7 +1025,7 @@ #region HeaderSpace case RemoteDetectionState.HeaderSpace: - if (!pulse && IsBetween(duration, 750, 1000)) + if (!pulse && IsBetween(duration, 700, 1100)) { RC5_Data.State = RemoteDetectionState.Data; RC5_Data.HalfBit = 0; @@ -1034,7 +1040,7 @@ { if (pulse) { - if (IsBetween(duration, 750, 1100) || IsBetween(duration, 1500, 2000)) + if (IsBetween(duration, 700, 1100) || IsBetween(duration, 1500, 2000)) { RC5_Data.HalfBit = (byte)((duration >= 1500) ? 0 : 1); RC5_Data.Bit--; @@ -1047,7 +1053,7 @@ } else { - if (IsBetween(duration, 750, 1100) || IsBetween(duration, 1500, 2000)) + if (IsBetween(duration, 700, 1100) || IsBetween(duration, 1500, 2000)) { RC5_Data.HalfBit = (byte)((duration >= 1500) ? 0 : 1); RC5_Data.Bit--; @@ -1064,41 +1070,29 @@ RC5_Data.Bit += 5; } } - break; } - - if (IsBetween(duration, 750, 1100)) + else // RC5_Data.HalfBit != 0 { - RC5_Data.HalfBit = 0; - ignored = false; + if (IsBetween(duration, 700, 1100)) + { + RC5_Data.HalfBit = 0; + ignored = false; - if ((RC5_Data.Bit == 1) && pulse) - RC5_Data.State = RemoteDetectionState.KeyCode; + if ((RC5_Data.Bit == 1) && pulse) + RC5_Data.State = RemoteDetectionState.KeyCode; + } + else if (RC5_Data.Bit == 7 && (IsBetween(duration, 3400, 3800) || IsBetween(duration, 4300, 4700))) + { + RC5_Data.HalfBit = (byte)((duration >= 4300) ? 0 : 1); + RC5_Data.Code <<= 6; + RC5_Data.Bit += 6; + ignored = false; + } } - else if (RC5_Data.Bit == 7 && (IsBetween(duration, 3400, 3800) || IsBetween(duration, 4300, 4700))) - { - RC5_Data.HalfBit = (byte)((duration >= 4300) ? 0 : 1); - RC5_Data.Code <<= 6; - RC5_Data.Bit += 6; - ignored = false; - } break; #endregion Data - #region Leading - case RemoteDetectionState.Leading: - if (pulse) - break; - - if (duration > 10000) - { - RC5_Data.State = RemoteDetectionState.HeaderPulse; - ignored = false; - } - break; - #endregion Leading - } if (RC5_Data.State == RemoteDetectionState.KeyCode) @@ -1132,6 +1126,7 @@ remoteCallback(IrProtocol.RC5, RC5_Data.Code, first); RC5_Data.State = RemoteDetectionState.HeaderPulse; + ignored = false; } if (ignored && (RC5_Data.State != RemoteDetectionState.Leading) && (RC5_Data.State != RemoteDetectionState.HeaderPulse)) @@ -1156,14 +1151,14 @@ case RemoteDetectionState.HeaderPulse: if (pulse && IsBetween(duration, 2600, 3300)) { - RC6_Data.State = RemoteDetectionState.HeaderSpace; - RC6_Data.Header = 0x000FC000; - RC6_Data.Bit = 12; - RC6_Data.HalfBit = 0; - RC6_Data.Code = 0; - RC6_Data.LongPulse = false; - RC6_Data.LongSpace = false; - RC6_Data.Toggle &= 0xFE; + RC6_Data.State = RemoteDetectionState.HeaderSpace; + RC6_Data.Header = 0x000FC000; + RC6_Data.Bit = 12; + RC6_Data.HalfBit = 0; + RC6_Data.Code = 0; + RC6_Data.LongPulse = false; + RC6_Data.LongSpace = false; + RC6_Data.Toggle &= 0xFE; ignored = false; } break; @@ -1240,27 +1235,8 @@ } if (!ignored && RC6_Data.Bit == 0) - { - if ((RC6_Data.Header & RC6HeaderMask) == PrefixRC6) - { - RC6_Data.Bit = 16; - } - //else if (RC6_Data.Header == PrefixRC6Foxtel) - //{ - //RC6_Data.Bit = 20; - //} - else if ((RC6_Data.Header & RC6HeaderMask) == PrefixRC6A) - { - RC6_Data.Bit = 32; - } - else - { - ignored = true; - break; - } + RC6_Data.State = RemoteDetectionState.Data; - RC6_Data.State = RemoteDetectionState.Data; - } break; #endregion PreData @@ -1273,9 +1249,6 @@ ignored = false; RC6_Data.LongPulse = true; RC6_Data.HalfBit++; - - if (RC6_Data.Bit == 1) - RC6_Data.State = RemoteDetectionState.KeyCode; } else if (!pulse && IsBetween(duration, 300, 600)) { @@ -1283,28 +1256,47 @@ RC6_Data.LongSpace = true; RC6_Data.HalfBit++; } + else if (!pulse && duration > 4000) + { + if (RC6_Data.Bit == 16 || RC6_Data.Bit == 20 || RC6_Data.Bit == 24 || RC6_Data.Bit == 32) + RC6_Data.State = RemoteDetectionState.KeyCode; + } + break; } if (RC6_Data.LongPulse) { RC6_Data.LongPulse = false; + if (pulse) break; if (IsBetween(duration, 750, 1000)) { - RC6_Data.Bit--; + RC6_Data.Bit++; + RC6_Data.Code = RC6_Data.Code << 1; + RC6_Data.LongSpace = true; RC6_Data.HalfBit += 2; ignored = false; } else if (IsBetween(duration, 300, 600)) { - RC6_Data.Bit--; + RC6_Data.Bit++; + RC6_Data.Code = RC6_Data.Code << 1; + RC6_Data.HalfBit++; ignored = false; } + else if (duration > 4000) + { + RC6_Data.Bit++; + RC6_Data.Code = RC6_Data.Code << 1; + + if (RC6_Data.Bit == 16 || RC6_Data.Bit == 20 || RC6_Data.Bit == 24 || RC6_Data.Bit == 32) + RC6_Data.State = RemoteDetectionState.KeyCode; + } } else if (RC6_Data.LongSpace) { @@ -1313,28 +1305,34 @@ if (!pulse) break; - if (RC6_Data.Bit == 32) - RC6_Data.Bit = 24; + //if (RC6_Data.Bit == 32) + //RC6_Data.Bit = 24; + //if (RC6_Data.Bit == 24) + //RC6_Data.Bit = 32; + if (IsBetween(duration, 750, 1000)) { - RC6_Data.Bit--; - RC6_Data.Code |= (uint)1 << RC6_Data.Bit; + RC6_Data.Bit++; + RC6_Data.Code = RC6_Data.Code << 1; + RC6_Data.Code |= 1; + RC6_Data.LongPulse = true; RC6_Data.HalfBit += 2; ignored = false; - - if (RC6_Data.Bit == 1) - RC6_Data.State = RemoteDetectionState.KeyCode; } else if (IsBetween(duration, 300, 600)) { - RC6_Data.Bit--; - RC6_Data.Code |= (uint)1 << RC6_Data.Bit; + RC6_Data.Bit++; + RC6_Data.Code = RC6_Data.Code << 1; + RC6_Data.Code |= 1; + RC6_Data.HalfBit++; ignored = false; - - if (RC6_Data.Bit == 0) + } + else if (duration > 4000) + { + if (RC6_Data.Bit == 16 || RC6_Data.Bit == 20 || RC6_Data.Bit == 24 || RC6_Data.Bit == 32) RC6_Data.State = RemoteDetectionState.KeyCode; } } @@ -1363,7 +1361,7 @@ protocolVariation = IrProtocol.RC6_MCE; } - else // Standard RC6 or Non-MCE variations + else // Non-MCE RC6 variations { bool toggleOn = (RC6_Data.Toggle & 1) == 1; @@ -1376,22 +1374,27 @@ else RC6_Data.Toggle = 4; - //if (RC6_Data.Header == PrefixRC6Foxtel) - //protocolVariation = IrProtocol.RC6_Foxtel; - //else - if ((RC6_Data.Header & RC6HeaderMask) == PrefixRC6A) - protocolVariation = IrProtocol.RC6A; + if (RC6_Data.Bit == 16) + protocolVariation = IrProtocol.RC6_16; + else if (RC6_Data.Bit == 20) + protocolVariation = IrProtocol.RC6_20; + else if (RC6_Data.Bit == 24) + protocolVariation = IrProtocol.RC6_24; + else if (RC6_Data.Bit == 32) + protocolVariation = IrProtocol.RC6_32; + else + break; } remoteCallback(protocolVariation, RC6_Data.Code, first); RC6_Data.State = RemoteDetectionState.HeaderPulse; + ignored = false; } if (ignored && (RC6_Data.State != RemoteDetectionState.HeaderPulse)) RC6_Data.State = RemoteDetectionState.HeaderPulse; } - } static void DetectRCA(int[] timingData, RemoteCallback remoteCallback) { Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/MceDetectionData.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/MceDetectionData.cs 2008-04-11 05:31:22 UTC (rev 1628) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/MceDetectionData.cs 2008-04-11 14:57:53 UTC (rev 1629) @@ -25,15 +25,15 @@ [Flags] enum KeyModifiers { - None = 0, - LeftControl = 1, - LeftShift = 2, - LeftAlt = 4, - LeftWin = 8, - RightControl = 16, - RightShift = 32, - RightAlt = 64, - RightWin = 128, + None = 0x00, + LeftControl = 0x01, + LeftShift = 0x02, + LeftAlt = 0x04, + LeftWin = 0x08, + RightControl = 0x10, + RightShift = 0x20, + RightAlt = 0x40, + RightWin = 0x80, } #endregion Enumerations Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Imon Receiver/Imon Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Imon Receiver/Imon Receiver.cs 2008-04-11 05:31:22 UTC (rev 1628) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Imon Receiver/Imon Receiver.cs 2008-04-11 14:57:53 UTC (rev 1629) @@ -181,6 +181,7 @@ [Flags] enum CreateFileAttributes : uint { + None = 0x00000000, Readonly = 0x00000001, Hidden = 0x00000002, System = 0x00000004, @@ -245,7 +246,7 @@ static extern bool CancelIo( SafeFileHandle handle); - [DllImport("kernel32.dll")] + [DllImport("kernel32.dll", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] static extern bool CloseHandle( SafeFileHandle handle); @@ -433,10 +434,9 @@ /// <summary> /// Detect the presence of this device. Devices that cannot be detected will always return false. + /// This method should not throw exceptions. /// </summary> - /// <returns> - /// <c>true</c> if the device is present, otherwise <c>false</c>. - /// </returns> + /// <returns><c>true</c> if the device is present, otherwise <c>false</c>.</returns> public override bool Detect() { try @@ -762,9 +762,11 @@ // FF, FF, FF, FF, FF, FF, 9F, FF, // 00, 00, 00, 00, 00, 00, 00, F0, - if (dataBytes[0] != 0xFF && dataBytes[1] != 0xFF && dataBytes[2] != 0xFF && dataBytes[3] != 0xFF && dataBytes[4] != 0xFF && dataBytes[5] != 0xFF && - dataBytes[0] != 0x00 && dataBytes[1] != 0x00 && dataBytes[2] != 0x00 && dataBytes[3] != 0x00 && dataBytes[4] != 0x00 && dataBytes[5] != 0x00) + if ((dataBytes[0] != 0xFF || dataBytes[1] != 0xFF || dataBytes[2] != 0xFF || dataBytes[3] != 0xFF || dataBytes[4] != 0xFF || dataBytes[5] != 0xFF) && + (dataBytes[0] != 0x00 || dataBytes[1] != 0x00 || dataBytes[2] != 0x00 || dataBytes[3] != 0x00 || dataBytes[4] != 0x00 || dataBytes[5] != 0x00)) + { ProcessInput(dataBytes); + } } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2008-04-18 03:53:17
|
Revision: 1660 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1660&view=rev Author: and-81 Date: 2008-04-17 20:53:16 -0700 (Thu, 17 Apr 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Documentation/new.html trunk/plugins/IR Server Suite/Input Service/Input Service/InputServiceInstaller.cs Modified: trunk/plugins/IR Server Suite/Documentation/new.html =================================================================== --- trunk/plugins/IR Server Suite/Documentation/new.html 2008-04-17 23:58:02 UTC (rev 1659) +++ trunk/plugins/IR Server Suite/Documentation/new.html 2008-04-18 03:53:16 UTC (rev 1660) @@ -75,9 +75,17 @@ <LI>Translator: Fixed a bug with the tray icon not re-appearing correctly after being hidden.</LI> <LI>Installer: Fixed an x64 bug.</LI> <LI>Translator: Fixed an x64 bug.</LI> +<LI>Input Service: Now enables "Interact with desktop" setting for service, this should get MCE Replacement Driver users the ability to use the Remote Keyboard properly.</LI> +</UL></P> +<BR> +<!-- +<P>Known Issues (1.4.2): +<UL> +<LI>Standby and Resume with some MCE remote setups is crashing the Input Service.</LI> </UL></P> <BR> +--> <P>Version 1.0.4.1 <UL> Modified: trunk/plugins/IR Server Suite/Input Service/Input Service/InputServiceInstaller.cs =================================================================== --- trunk/plugins/IR Server Suite/Input Service/Input Service/InputServiceInstaller.cs 2008-04-17 23:58:02 UTC (rev 1659) +++ trunk/plugins/IR Server Suite/Input Service/Input Service/InputServiceInstaller.cs 2008-04-18 03:53:16 UTC (rev 1660) @@ -23,8 +23,8 @@ /// </summary> public InputServiceInstaller() { - //this.Committing += new InstallEventHandler(InputServiceInstaller_Committing); - this.AfterInstall += new InstallEventHandler(InputServiceInstaller_AfterInstall); + this.Committing += new InstallEventHandler(InputServiceInstaller_Committing); + //this.AfterInstall += new InstallEventHandler(InputServiceInstaller_AfterInstall); ServiceProcessInstaller serviceProcessInstaller = new ServiceProcessInstaller(); ServiceInstaller serviceInstaller = new ServiceInstaller(); @@ -49,23 +49,20 @@ /// </summary> void InputServiceInstaller_AfterInstall(object sender, InstallEventArgs e) { - - // TODO: Set the restart options. - - + // TODO: Set the restart options here. + // Start the service ... //using (ServiceController serviceController = new ServiceController(Program.ServiceName)) //serviceController.Start(); } - /* /// <summary> /// Used to set the "Allow service to interact with the desktop" setting. /// </summary> void InputServiceInstaller_Committing(object sender, InstallEventArgs e) { - ManagementBaseObject InParam = null; - ManagementBaseObject OutParam = null; + ManagementBaseObject inParam = null; + ManagementBaseObject outParam = null; try { @@ -79,9 +76,9 @@ using (ManagementObject wmiService = new ManagementObject(path)) { - InParam = wmiService.GetMethodParameters("Change"); - InParam["DesktopInteract"] = true; - OutParam = wmiService.InvokeMethod("Change", InParam, null); + inParam = wmiService.GetMethodParameters("Change"); + inParam["DesktopInteract"] = true; + outParam = wmiService.InvokeMethod("Change", inParam, null); } } catch @@ -90,14 +87,14 @@ } finally { - if (InParam != null) - InParam.Dispose(); + if (inParam != null) + inParam.Dispose(); - if (OutParam != null) - OutParam.Dispose(); + if (outParam != null) + outParam.Dispose(); } } - */ + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2008-04-18 04:19:21
|
Revision: 1661 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1661&view=rev Author: and-81 Date: 2008-04-17 21:19:20 -0700 (Thu, 17 Apr 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Keyboard.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs trunk/plugins/IR Server Suite/Input Service/Input Service/Input Service.csproj trunk/plugins/IR Server Suite/setup/setup.nsi Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Keyboard.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Keyboard.cs 2008-04-18 03:53:16 UTC (rev 1660) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Keyboard.cs 2008-04-18 04:19:20 UTC (rev 1661) @@ -1,5 +1,6 @@ using System; using System.Runtime.InteropServices; +using System.Text; namespace InputService.Plugin { @@ -10,6 +11,61 @@ static class Keyboard { + #region Constants + + const int KL_NAMELENGTH = 9; + + const uint KLF_ACTIVATE = 0x0001; + const uint KLF_NOTELLSHELL = 0x0080; + const uint KLF_REORDER = 0x0008; + const uint KLF_REPLACELANG = 0x0010; + //const uint KLF_RESET = 0x40000000; + const uint KLF_SETFORPROCESS = 0x0100; + //const uint KLF_SHIFTLOCK = 0x10000; + const uint KLF_SUBSTITUTE_OK = 0x0002; + const uint KLF_UNLOADPREVIOUS = 0x0004; + + + const int MAPVK_VK_TO_SCAN = 0; + const int MAPVK_SCAN_TO_VK = 1; + const int MAPVK_VK_TO_CHAR = 2; + + + /// <summary> + /// English (Australia). + /// </summary> + public const string English_AU = "00000c09"; + /// <summary> + /// English (Great Britain). + /// </summary> + public const string English_GB = "00000809"; + /// <summary> + /// English (US). + /// </summary> + public const string English_US = "00000409"; + /// <summary> + /// French (France). + /// </summary> + public const string French_FR = "0000040c"; + /// <summary> + /// German (Germany). + /// </summary> + public const string German_DE = "00000407"; + /// <summary> + /// German (Austria). + /// </summary> + public const string German_AT = "00000c07"; + /// <summary> + /// Japanese (Japan). + /// </summary> + public const string Japanese_JP = "00000411"; + /// <summary> + /// Spanish (Spain). + /// </summary> + public const string Spanish_ES = "00000c0a"; + + #endregion Constants + #region Interop [DllImport("user32.dll")] @@ -19,6 +75,34 @@ uint dwFlags, IntPtr dwExtraInfo); + [DllImport("user32.dll")] + static extern long GetKeyboardLayoutName( + StringBuilder pwszKLID); + + [DllImport("user32.dll")] + static extern int ActivateKeyboardLayout( + IntPtr nkl, + uint Flags); + + [DllImport("user32.dll")] + static extern uint GetKeyboardLayoutList( + int nBuff, + [Out] IntPtr[] lpList); + + [DllImport("user32.dll")] + static extern IntPtr LoadKeyboardLayout( + string pwszKLID, + uint Flags); + + [DllImport("user32.dll")] + static extern bool UnloadKeyboardLayout( + IntPtr hkl); + + [DllImport("user32.dll")] + static extern uint MapVirtualKey( + uint uCode, + uint uMapType); + #endregion Interop #region Enumerations @@ -188,6 +272,48 @@ #region Public Methods /// <summary> + /// Gets the character that maps to the Virtual Key provided. + /// </summary> + /// <param name="vKey">The virtual key.</param> + /// <returns>The character.</returns> + public static char GetCharFromVKey(VKey vKey) + { + return (char)MapVirtualKey((uint)vKey, MAPVK_VK_TO_CHAR); + } + + /// <summary> + /// Gets the current keyboard layout. + /// </summary> + /// <returns>The name of the current keyboard layout.</returns> + public static string GetLayout() + { + StringBuilder name = new StringBuilder(KL_NAMELENGTH); + GetKeyboardLayoutName(name); + return name.ToString(); + } + + /// <summary> + /// Loads the specified keyboard layout. + /// </summary> + /// <param name="layout">The keyboard layout to load.</param> + /// <returns>Identifier for removing this keyboard layout.</returns> + public static IntPtr LoadLayout(string layout) + { + return LoadKeyboardLayout(layout, KLF_ACTIVATE | KLF_REORDER | KLF_SETFORPROCESS | KLF_SUBSTITUTE_OK); + } + + /// <summary> + /// Unloads the already loaded layout. + /// </summary> + /// <param name="layout">The layout to unload.</param> + /// <returns><c>true</c> if successful, otherwise <c>false</c>.</returns> + public static bool UnloadLayout(IntPtr layout) + { + return UnloadKeyboardLayout(layout); + } + + + /// <summary> /// Simulate a key being pressed down. /// </summary> /// <param name="vKey">Virtual key to press.</param> 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-04-18 03:53:16 UTC (rev 1660) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs 2008-04-18 04:19:20 UTC (rev 1661) @@ -64,7 +64,9 @@ } static void xKeyboard(string deviceName, int button, bool up) { - Console.WriteLine("Keyboard: {0}, {1}", button, up); + char chr = Keyboard.GetCharFromVKey((Keyboard.VKey)button); + + Console.WriteLine("Keyboard: {0}, {1} - \"{2}\"", button, up, chr); } static void xMouse(string deviceName, int x, int y, int buttons) { @@ -91,6 +93,8 @@ { device = new MicrosoftMceTransceiver(); + //Keyboard.LoadLayout(Keyboard.German_DE); + Console.Write("Configure device? (y/n) "); if (Console.ReadKey().Key == ConsoleKey.Y) @@ -1024,6 +1028,10 @@ static void DisableMceServices() { + // "HKLM\SYSTEM\CurrentControlSet\Services\<service name>\Start" + // 2 for automatic, 3 manual , 4 disabled + + // Vista ... // Stop Microsoft MCE ehRecvr, mcrdsvc and ehSched processes (if they exist) try Modified: trunk/plugins/IR Server Suite/Input Service/Input Service/Input Service.csproj =================================================================== --- trunk/plugins/IR Server Suite/Input Service/Input Service/Input Service.csproj 2008-04-18 03:53:16 UTC (rev 1660) +++ trunk/plugins/IR Server Suite/Input Service/Input Service/Input Service.csproj 2008-04-18 04:19:20 UTC (rev 1661) @@ -108,7 +108,9 @@ </Content> </ItemGroup> <ItemGroup> + <Content Include="Abstract Remote Maps\Imon\Imon Front Panel.xml" /> <Content Include="Abstract Remote Maps\Imon\Imon PAD.xml" /> + <Content Include="Abstract Remote Maps\Imon\Imon Volume Knob.xml" /> <Content Include="Abstract Remote Maps\Imon\Microsoft MCE.xml" /> <Content Include="Input Service.exe.manifest"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> Modified: trunk/plugins/IR Server Suite/setup/setup.nsi =================================================================== --- trunk/plugins/IR Server Suite/setup/setup.nsi 2008-04-18 03:53:16 UTC (rev 1660) +++ trunk/plugins/IR Server Suite/setup/setup.nsi 2008-04-18 04:19:20 UTC (rev 1661) @@ -165,7 +165,7 @@ !insertmacro "${MacroName}" "SectionTV3Common" !insertmacro "${MacroName}" "SectionTV3BlasterPlugin" - !insertmacro "${MacroName}" "SectionMCEBlaster" +; !insertmacro "${MacroName}" "SectionMCEBlaster" !insertmacro "${MacroName}" "SectionTranslator" !insertmacro "${MacroName}" "SectionTrayLauncher" @@ -228,7 +228,7 @@ SetShellVarContext all ; Kill running Programs - DetailPrint "Terminating processes ..." + DetailPrint "Attempting to terminate running processes ..." ${KILLPROCESS} "Translator.exe" ${KILLPROCESS} "TrayLauncher.exe" ${KILLPROCESS} "WebRemote.exe" @@ -602,7 +602,7 @@ SectionGroupEnd ;====================================== - +/* SectionGroup /e "Media Center add-ons" SectionGroupMCE !if ${VER_BUILD} != 0 @@ -646,7 +646,7 @@ ;====================================== SectionGroupEnd - +*/ ;====================================== ${MementoSection} "Translator" SectionTranslator @@ -1319,8 +1319,8 @@ !insertmacro MUI_DESCRIPTION_TEXT ${SectionTV2BlasterPlugin} "$(DESC_SectionTV2BlasterPlugin)" !insertmacro MUI_DESCRIPTION_TEXT ${SectionGroupTV3} "$(DESC_SectionGroupTV3)" !insertmacro MUI_DESCRIPTION_TEXT ${SectionTV3BlasterPlugin} "$(DESC_SectionTV3BlasterPlugin)" - !insertmacro MUI_DESCRIPTION_TEXT ${SectionGroupMCE} "$(DESC_SectionGroupMCE)" - !insertmacro MUI_DESCRIPTION_TEXT ${SectionMCEBlaster} "$(DESC_SectionMCEBlaster)" +; !insertmacro MUI_DESCRIPTION_TEXT ${SectionGroupMCE} "$(DESC_SectionGroupMCE)" +; !insertmacro MUI_DESCRIPTION_TEXT ${SectionMCEBlaster} "$(DESC_SectionMCEBlaster)" !insertmacro MUI_DESCRIPTION_TEXT ${SectionTranslator} "$(DESC_SectionTranslator)" !insertmacro MUI_DESCRIPTION_TEXT ${SectionTrayLauncher} "$(DESC_SectionTrayLauncher)" !insertmacro MUI_DESCRIPTION_TEXT ${SectionVirtualRemote} "$(DESC_SectionVirtualRemote)" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2008-04-22 14:23:02
|
Revision: 1695 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1695&view=rev Author: chef_koch Date: 2008-04-22 07:21:25 -0700 (Tue, 22 Apr 2008) Log Message: ----------- output for build script is written to logfile Modified Paths: -------------- trunk/plugins/IR Server Suite/Build Deploy Debug.bat trunk/plugins/IR Server Suite/Build Deploy Release.bat Modified: trunk/plugins/IR Server Suite/Build Deploy Debug.bat =================================================================== --- trunk/plugins/IR Server Suite/Build Deploy Debug.bat 2008-04-22 14:16:53 UTC (rev 1694) +++ trunk/plugins/IR Server Suite/Build Deploy Debug.bat 2008-04-22 14:21:25 UTC (rev 1695) @@ -1,15 +1,15 @@ rem @ECHO OFF -setup\DeployVersionSVN.exe /svn="%CD%" +setup\DeployVersionSVN.exe /svn="%CD%" > build_debug.log -"%ProgramFiles%\Microsoft Visual Studio 8\Common7\IDE\devenv.com" /rebuild Debug "IR Server Suite.sln" +"%ProgramFiles%\Microsoft Visual Studio 8\Common7\IDE\devenv.com" /rebuild Debug "IR Server Suite.sln" >> build_debug.log -setup\DeployVersionSVN.exe /svn="%CD%" /revert +setup\DeployVersionSVN.exe /svn="%CD%" /revert >> build_debug.log rem these commands are necessary to get the svn revision, to enable them just remove the EXIT one line above -setup\DeployVersionSVN.exe /svn="%CD%" /GetVersion +setup\DeployVersionSVN.exe /svn="%CD%" /GetVersion >> build_debug.log IF NOT EXIST version.txt EXIT SET /p version=<version.txt DEL version.txt -"%ProgramFiles%\NSIS\makensis.exe" /DVER_BUILD=%version% setup\setup.nsi \ No newline at end of file +"%ProgramFiles%\NSIS\makensis.exe" /DVER_BUILD=%version% setup\setup.nsi >> build_debug.log \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Build Deploy Release.bat =================================================================== --- trunk/plugins/IR Server Suite/Build Deploy Release.bat 2008-04-22 14:16:53 UTC (rev 1694) +++ trunk/plugins/IR Server Suite/Build Deploy Release.bat 2008-04-22 14:21:25 UTC (rev 1695) @@ -1,3 +1,3 @@ -"%ProgramFiles%\Microsoft Visual Studio 8\Common7\IDE\devenv.com" /rebuild Release "IR Server Suite.sln" -"%ProgramFiles%\HTML Help Workshop\hhc.exe" "Documentation\IR Server Suite.hhp" -"%ProgramFiles%\NSIS\makensis.exe" setup\setup.nsi +"%ProgramFiles%\Microsoft Visual Studio 8\Common7\IDE\devenv.com" /rebuild Release "IR Server Suite.sln" > build_release.log +"%ProgramFiles%\HTML Help Workshop\hhc.exe" "Documentation\IR Server Suite.hhp" >> build_release.log +"%ProgramFiles%\NSIS\makensis.exe" setup\setup.nsi >> build_release.log \ 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: <che...@us...> - 2008-04-22 14:24:55
|
Revision: 1696 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1696&view=rev Author: chef_koch Date: 2008-04-22 07:23:50 -0700 (Tue, 22 Apr 2008) Log Message: ----------- added status msgs to build scripts Modified Paths: -------------- trunk/plugins/IR Server Suite/Build Deploy Debug.bat trunk/plugins/IR Server Suite/Build Deploy Release.bat Modified: trunk/plugins/IR Server Suite/Build Deploy Debug.bat =================================================================== --- trunk/plugins/IR Server Suite/Build Deploy Debug.bat 2008-04-22 14:21:25 UTC (rev 1695) +++ trunk/plugins/IR Server Suite/Build Deploy Debug.bat 2008-04-22 14:23:50 UTC (rev 1696) @@ -1,14 +1,23 @@ -rem @ECHO OFF +@ECHO OFF +echo. +echo -= IR Server Suite : Build Deploy Debug.bat =- + +echo. +echo Writing SVN revision assemblies... setup\DeployVersionSVN.exe /svn="%CD%" > build_debug.log +echo. +echo Building IR Server Suite... "%ProgramFiles%\Microsoft Visual Studio 8\Common7\IDE\devenv.com" /rebuild Debug "IR Server Suite.sln" >> build_debug.log +echo. +echo Reverting assemblies... setup\DeployVersionSVN.exe /svn="%CD%" /revert >> build_debug.log -rem these commands are necessary to get the svn revision, to enable them just remove the EXIT one line above +echo. +echo Building Installer... setup\DeployVersionSVN.exe /svn="%CD%" /GetVersion >> build_debug.log - IF NOT EXIST version.txt EXIT SET /p version=<version.txt DEL version.txt Modified: trunk/plugins/IR Server Suite/Build Deploy Release.bat =================================================================== --- trunk/plugins/IR Server Suite/Build Deploy Release.bat 2008-04-22 14:21:25 UTC (rev 1695) +++ trunk/plugins/IR Server Suite/Build Deploy Release.bat 2008-04-22 14:23:50 UTC (rev 1696) @@ -1,3 +1,16 @@ +@ECHO OFF + +echo. +echo -= IR Server Suite : Build Deploy Release.bat =- + +echo. +echo Building IR Server Suite... "%ProgramFiles%\Microsoft Visual Studio 8\Common7\IDE\devenv.com" /rebuild Release "IR Server Suite.sln" > build_release.log + +echo. +echo Building Help file... "%ProgramFiles%\HTML Help Workshop\hhc.exe" "Documentation\IR Server Suite.hhp" >> build_release.log + +echo. +echo Building Installer... "%ProgramFiles%\NSIS\makensis.exe" setup\setup.nsi >> build_release.log \ 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...> - 2008-04-24 16:51:41
|
Revision: 1706 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1706&view=rev Author: and-81 Date: 2008-04-24 09:51:09 -0700 (Thu, 24 Apr 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/Imon USB Receivers.cs Added Paths: ----------- trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/iMon/ Removed Paths: ------------- trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/iMon USB Receivers/ Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/Imon USB Receivers.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/Imon USB Receivers.cs 2008-04-24 16:46:46 UTC (rev 1705) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/Imon USB Receivers.cs 2008-04-24 16:51:09 UTC (rev 1706) @@ -1027,7 +1027,7 @@ /// Name of the IR Server plugin. /// </summary> /// <value>The name.</value> - public override string Name { get { return "iMon USB Receivers"; } } + public override string Name { get { return "iMon"; } } /// <summary> /// IR Server plugin version. Copied: trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/iMon (from rev 1704, trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/iMon USB Receivers) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2008-04-25 13:08:50
|
Revision: 1712 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1712&view=rev Author: and-81 Date: 2008-04-25 06:08:25 -0700 (Fri, 25 Apr 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/RawInput.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/Imon USB Receivers.cs trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/iMon/Imon PAD.xml trunk/plugins/IR Server Suite/setup/setup.nsi Added Paths: ----------- trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/ trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Configure.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Configure.resx trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Pinnacle Serial Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Pinnacle Serial Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Properties/ trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Properties/Resources.resx trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/Pinnacle Serial/ Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/RawInput.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/RawInput.cs 2008-04-25 05:54:50 UTC (rev 1711) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/RawInput.cs 2008-04-25 13:08:25 UTC (rev 1712) @@ -488,7 +488,6 @@ { throw new InvalidOperationException("An error occurred while retrieving the list of devices"); } - } static string GetFriendlyName(string vidAndPid) Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507Receiver.cs 2008-04-25 05:54:50 UTC (rev 1711) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507Receiver.cs 2008-04-25 13:08:25 UTC (rev 1712) @@ -314,7 +314,6 @@ { Marshal.FreeHGlobal(buffer); } - } static string FindDevice(Guid classGuid) 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-04-25 05:54:50 UTC (rev 1711) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.cs 2008-04-25 13:08:25 UTC (rev 1712) @@ -134,7 +134,7 @@ try { - _serialPort.Dispose(); + _serialPort.Close(); } #if TRACE catch (Exception ex) Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/Imon USB Receivers.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/Imon USB Receivers.cs 2008-04-25 05:54:50 UTC (rev 1711) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/Imon USB Receivers.cs 2008-04-25 13:08:25 UTC (rev 1712) @@ -921,12 +921,15 @@ IntPtr deviceBufferPtr = IntPtr.Zero; - try + switch (mode) { - switch (mode) + + #region iMon + case RcMode.iMon: { - case RcMode.iMon: - foreach (byte[] send in SetModeiMon) + foreach (byte[] send in SetModeiMon) + { + try { deviceBufferPtr = Marshal.AllocHGlobal(send.Length); @@ -934,11 +937,33 @@ IoControl(IOCTL_IMON_WRITE, deviceBufferPtr, send.Length, IntPtr.Zero, 0, out bytesRead); Marshal.FreeHGlobal(deviceBufferPtr); + deviceBufferPtr = IntPtr.Zero; } - break; +#if DEBUG + catch (Exception ex) + { + DebugWriteLine(ex.ToString()); +#else + catch + { +#endif + if (_deviceHandle != null) + CancelIo(_deviceHandle); - case RcMode.Mce: - foreach (byte[] send in SetModeMCE) + if (deviceBufferPtr != IntPtr.Zero) + Marshal.FreeHGlobal(deviceBufferPtr); + } + } + break; + } + #endregion iMon + + #region Mce + case RcMode.Mce: + { + foreach (byte[] send in SetModeMCE) + { + try { deviceBufferPtr = Marshal.AllocHGlobal(send.Length); @@ -946,26 +971,28 @@ IoControl(IOCTL_IMON_WRITE, deviceBufferPtr, send.Length, IntPtr.Zero, 0, out bytesRead); Marshal.FreeHGlobal(deviceBufferPtr); + deviceBufferPtr = IntPtr.Zero; } - break; - } - } #if DEBUG - catch (Exception ex) - { - DebugWriteLine(ex.ToString()); + catch (Exception ex) + { + DebugWriteLine(ex.ToString()); #else - catch - { + catch + { #endif - if (_deviceHandle != null) - CancelIo(_deviceHandle); + if (_deviceHandle != null) + CancelIo(_deviceHandle); + + if (deviceBufferPtr != IntPtr.Zero) + Marshal.FreeHGlobal(deviceBufferPtr); + } + } + break; + } + #endregion Mce + } - finally - { - if (deviceBufferPtr != IntPtr.Zero) - Marshal.FreeHGlobal(deviceBufferPtr); - } } #endregion DosDevice Specific Helper Functions Added: trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Configure.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Configure.Designer.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Configure.Designer.cs 2008-04-25 13:08:25 UTC (rev 1712) @@ -0,0 +1,159 @@ +namespace InputService.Plugin +{ + partial class Configure + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.labelButtonRepeatDelay = new System.Windows.Forms.Label(); + this.numericUpDownButtonRepeatDelay = new System.Windows.Forms.NumericUpDown(); + this.buttonOK = new System.Windows.Forms.Button(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.toolTips = new System.Windows.Forms.ToolTip(this.components); + this.labelPort = new System.Windows.Forms.Label(); + this.comboBoxPort = new System.Windows.Forms.ComboBox(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownButtonRepeatDelay)).BeginInit(); + this.SuspendLayout(); + // + // labelButtonRepeatDelay + // + this.labelButtonRepeatDelay.Location = new System.Drawing.Point(8, 8); + this.labelButtonRepeatDelay.Name = "labelButtonRepeatDelay"; + this.labelButtonRepeatDelay.Size = new System.Drawing.Size(120, 20); + this.labelButtonRepeatDelay.TabIndex = 0; + this.labelButtonRepeatDelay.Text = "Button repeat delay:"; + this.labelButtonRepeatDelay.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // numericUpDownButtonRepeatDelay + // + this.numericUpDownButtonRepeatDelay.Increment = new decimal(new int[] { + 50, + 0, + 0, + 0}); + this.numericUpDownButtonRepeatDelay.Location = new System.Drawing.Point(128, 8); + this.numericUpDownButtonRepeatDelay.Maximum = new decimal(new int[] { + 10000, + 0, + 0, + 0}); + this.numericUpDownButtonRepeatDelay.Minimum = new decimal(new int[] { + 50, + 0, + 0, + 0}); + this.numericUpDownButtonRepeatDelay.Name = "numericUpDownButtonRepeatDelay"; + this.numericUpDownButtonRepeatDelay.Size = new System.Drawing.Size(88, 20); + this.numericUpDownButtonRepeatDelay.TabIndex = 1; + this.numericUpDownButtonRepeatDelay.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.numericUpDownButtonRepeatDelay.ThousandsSeparator = true; + this.toolTips.SetToolTip(this.numericUpDownButtonRepeatDelay, "How long between repeated buttons (in milliseconds)"); + this.numericUpDownButtonRepeatDelay.Value = new decimal(new int[] { + 10000, + 0, + 0, + 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(82, 74); + this.buttonOK.Name = "buttonOK"; + this.buttonOK.Size = new System.Drawing.Size(64, 24); + this.buttonOK.TabIndex = 4; + this.buttonOK.Text = "OK"; + this.buttonOK.UseVisualStyleBackColor = true; + this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); + // + // buttonCancel + // + this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.buttonCancel.Location = new System.Drawing.Point(154, 74); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(64, 24); + this.buttonCancel.TabIndex = 5; + this.buttonCancel.Text = "Cancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); + // + // labelPort + // + this.labelPort.Location = new System.Drawing.Point(8, 40); + this.labelPort.Name = "labelPort"; + this.labelPort.Size = new System.Drawing.Size(120, 21); + this.labelPort.TabIndex = 2; + this.labelPort.Text = "Serial port:"; + this.labelPort.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // comboBoxPort + // + this.comboBoxPort.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxPort.FormattingEnabled = true; + this.comboBoxPort.Location = new System.Drawing.Point(128, 40); + this.comboBoxPort.Name = "comboBoxPort"; + this.comboBoxPort.Size = new System.Drawing.Size(88, 21); + this.comboBoxPort.TabIndex = 3; + // + // Configure + // + this.AcceptButton = this.buttonOK; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.buttonCancel; + this.ClientSize = new System.Drawing.Size(224, 104); + this.Controls.Add(this.labelButtonRepeatDelay); + this.Controls.Add(this.comboBoxPort); + this.Controls.Add(this.numericUpDownButtonRepeatDelay); + this.Controls.Add(this.labelPort); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.buttonOK); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(232, 138); + this.Name = "Configure"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "IRMan Receiver Configuration"; + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownButtonRepeatDelay)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Label labelButtonRepeatDelay; + private System.Windows.Forms.NumericUpDown numericUpDownButtonRepeatDelay; + private System.Windows.Forms.Button buttonOK; + private System.Windows.Forms.Button buttonCancel; + private System.Windows.Forms.ToolTip toolTips; + private System.Windows.Forms.Label labelPort; + private System.Windows.Forms.ComboBox comboBoxPort; + } +} \ No newline at end of file Added: trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Configure.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Configure.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Configure.cs 2008-04-25 13:08:25 UTC (rev 1712) @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.IO.Ports; +using System.Text; +using System.Windows.Forms; + +namespace InputService.Plugin +{ + + partial class Configure : Form + { + + #region Variables + + string[] _ports; + + #endregion Variables + + #region Properties + + public int RepeatDelay + { + get { return Decimal.ToInt32(numericUpDownButtonRepeatDelay.Value); } + set { numericUpDownButtonRepeatDelay.Value = new Decimal(value); } + } + public string CommPort + { + get { return comboBoxPort.SelectedItem as string; } + set { comboBoxPort.SelectedItem = value; } + } + + #endregion Properties + + #region Constructor + + public Configure() + { + InitializeComponent(); + + comboBoxPort.Items.Clear(); + + _ports = SerialPort.GetPortNames(); + if (_ports == null || _ports.Length == 0) + { + MessageBox.Show(this, "No available serial ports found!", "IRMan Receiver", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + comboBoxPort.Items.AddRange(_ports); + } + + #endregion Constructor + + #region Buttons + + private void buttonOK_Click(object sender, EventArgs e) + { + this.DialogResult = DialogResult.OK; + this.Close(); + } + private void buttonCancel_Click(object sender, EventArgs e) + { + this.DialogResult = DialogResult.Cancel; + this.Close(); + } + + #endregion Buttons + + } + +} Added: trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Configure.resx =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Configure.resx (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Configure.resx 2008-04-25 13:08:25 UTC (rev 1712) @@ -0,0 +1,123 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <metadata name="toolTips.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> +</root> \ No newline at end of file Added: trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Icon.ico =================================================================== (Binary files differ) Property changes on: trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Icon.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Pinnacle Serial Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Pinnacle Serial Receiver.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Pinnacle Serial Receiver.cs 2008-04-25 13:08:25 UTC (rev 1712) @@ -0,0 +1,304 @@ +using System; +using System.Collections.Generic; +#if TRACE +using System.Diagnostics; +#endif +using System.Drawing; +using System.IO; +using System.IO.Ports; +using System.Text; +using System.Threading; +using System.Windows.Forms; +using System.Xml; + +namespace InputService.Plugin +{ + + /// <summary> + /// IR Server Plugin for Pinnacle Serial Receiver device. + /// </summary> + public class PinnacleSerialReceiver : PluginBase, IConfigure, IRemoteReceiver + { + + #region Constants + + static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "Pinnacle Serial Receiver.xml"); + + const int DeviceBufferSize = 3; + + #endregion Constants + + #region Variables + + SerialPort _serialPort; + byte[] _deviceBuffer; + + RemoteHandler _remoteButtonHandler; + + int _repeatDelay; + string _serialPortName; + + bool _disposed; + + string _lastCode = String.Empty; + DateTime _lastCodeTime = DateTime.Now; + + #endregion Variables + + #region Implementation + + /// <summary> + /// Name of the IR Server plugin. + /// </summary> + /// <value>The name.</value> + public override string Name { get { return "Pinnacle Serial"; } } + /// <summary> + /// IR Server plugin version. + /// </summary> + /// <value>The version.</value> + public override string Version { get { return "1.4.2.0"; } } + /// <summary> + /// The IR Server plugin's author. + /// </summary> + /// <value>The author.</value> + public override string Author { get { return "and-81"; } } + /// <summary> + /// A description of the IR Server plugin. + /// </summary> + /// <value>The description.</value> + public override string Description { get { return "Receiver support for the Pinnacle Serial device"; } } + /// <summary> + /// Gets the plugin icon. + /// </summary> + /// <value>The plugin icon.</value> + public override Icon DeviceIcon { get { return Properties.Resources.Icon; } } + + /// <summary> + /// Start the IR Server plugin. + /// </summary> + public override void Start() + { + LoadSettings(); + + _deviceBuffer = new byte[DeviceBufferSize]; + + _serialPort = new SerialPort(_serialPortName, 1200, Parity.None, 8, StopBits.One); + _serialPort.Handshake = Handshake.None; + _serialPort.DtrEnable = false; + _serialPort.RtsEnable = true; + _serialPort.ReadBufferSize = DeviceBufferSize; + _serialPort.ReadTimeout = 1000; + + _serialPort.Open(); + Thread.Sleep(100); + _serialPort.DiscardInBuffer(); + + _serialPort.ReceivedBytesThreshold = DeviceBufferSize; + _serialPort.DataReceived += new SerialDataReceivedEventHandler(SerialPort_DataReceived); + } + /// <summary> + /// Suspend the IR Server plugin when computer enters standby. + /// </summary> + public override void Suspend() + { + Stop(); + } + /// <summary> + /// Resume the IR Server plugin when the computer returns from standby. + /// </summary> + public override void Resume() + { + Start(); + } + /// <summary> + /// Stop the IR Server plugin. + /// </summary> + public override void Stop() + { + if (_serialPort == null) + return; + + try + { + _serialPort.Close(); + } +#if TRACE + catch (Exception ex) + { + Trace.WriteLine(ex.ToString()); + } +#else + catch + { + } +#endif + finally + { + _serialPort = null; + } + } + + /// <summary> + /// Callback for remote button presses. + /// </summary> + /// <value>The remote callback.</value> + public RemoteHandler RemoteCallback + { + get { return _remoteButtonHandler; } + set { _remoteButtonHandler = value; } + } + + /// <summary> + /// Configure the IR Server plugin. + /// </summary> + public void Configure(IWin32Window owner) + { + LoadSettings(); + + Configure config = new Configure(); + + config.RepeatDelay = _repeatDelay; + config.CommPort = _serialPortName; + + if (config.ShowDialog(owner) == DialogResult.OK) + { + _repeatDelay = config.RepeatDelay; + _serialPortName = config.CommPort; + + SaveSettings(); + } + } + + /// <summary> + /// Handles the DataReceived event of the SerialPort control. + /// </summary> + /// <param name="sender">The source of the event.</param> + /// <param name="e">The <see cref="System.IO.Ports.SerialDataReceivedEventArgs"/> instance containing the event data.</param> + void SerialPort_DataReceived(object sender, SerialDataReceivedEventArgs e) + { + try + { + _serialPort.Read(_deviceBuffer, 0, DeviceBufferSize); + + TimeSpan timeSpan = DateTime.Now - _lastCodeTime; + + StringBuilder keyCode = new StringBuilder(2 * DeviceBufferSize); + for (int index = 0; index < DeviceBufferSize; index++) + keyCode.Append(_deviceBuffer[index].ToString("X2")); + + string thisCode = keyCode.ToString(); + + if (thisCode.Equals(_lastCode, StringComparison.Ordinal)) // Repeated button + { + if (timeSpan.Milliseconds > _repeatDelay) + { + _remoteButtonHandler(this.Name, thisCode); + _lastCodeTime = DateTime.Now; + } + } + else + { + _remoteButtonHandler(this.Name, thisCode); + _lastCodeTime = DateTime.Now; + } + + _lastCode = thisCode; + } +#if TRACE + catch (Exception ex) + { + Trace.WriteLine(ex.ToString()); + } +#else + catch + { + } +#endif + } + + /// <summary> + /// Releases unmanaged and - optionally - managed resources + /// </summary> + /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param> + protected virtual void Dispose(bool disposing) + { + // process only if mananged and unmanaged resources have + // not been disposed of. + if (!this._disposed) + { + if (disposing) + { + // dispose managed resources + Stop(); + } + + // dispose unmanaged resources + this._disposed = true; + } + } + + /// <summary> + /// Loads the settings. + /// </summary> + void LoadSettings() + { + try + { + XmlDocument doc = new XmlDocument(); + doc.Load(ConfigurationFile); + + _repeatDelay = int.Parse(doc.DocumentElement.Attributes["RepeatDelay"].Value); + _serialPortName = doc.DocumentElement.Attributes["SerialPortName"].Value; + } +#if TRACE + catch (Exception ex) + { + Trace.WriteLine(ex.ToString()); +#else + catch + { +#endif + + _repeatDelay = 500; + _serialPortName = "COM1"; + } + } + /// <summary> + /// Saves the settings. + /// </summary> + void SaveSettings() + { + try + { + using (XmlTextWriter writer = new XmlTextWriter(ConfigurationFile, Encoding.UTF8)) + { + writer.Formatting = Formatting.Indented; + writer.Indentation = 1; + writer.IndentChar = (char)9; + writer.WriteStartDocument(true); + writer.WriteStartElement("settings"); // <settings> + + writer.WriteAttributeString("RepeatDelay", _repeatDelay.ToString()); + writer.WriteAttributeString("SerialPortName", _serialPortName); + + writer.WriteEndElement(); // </settings> + writer.WriteEndDocument(); + } + } +#if TRACE + catch (Exception ex) + { + Trace.WriteLine(ex.ToString()); + } +#else + catch + { + } +#endif + } + + #endregion Implementation + + } + +} Added: trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Pinnacle Serial Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Pinnacle Serial Receiver.csproj (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Pinnacle Serial Receiver.csproj 2008-04-25 13:08:25 UTC (rev 1712) @@ -0,0 +1,93 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{EBFA0F67-1EB6-4282-8475-C397B9852B3F}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>InputService.Plugin</RootNamespace> + <AssemblyName>Pinnacle Serial Receiver</AssemblyName> + <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent> + <ApplicationIcon>Icon.ico</ApplicationIcon> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>false</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <UseVSHostingProcess>false</UseVSHostingProcess> + <DocumentationFile>bin\Debug\Pinnacle Serial Receiver.XML</DocumentationFile> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>none</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants> + </DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <UseVSHostingProcess>false</UseVSHostingProcess> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Configure.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="Configure.Designer.cs"> + <DependentUpon>Configure.cs</DependentUpon> + </Compile> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="Pinnacle Serial Receiver.cs" /> + <Compile Include="Properties\Resources.Designer.cs"> + <AutoGen>True</AutoGen> + <DesignTime>True</DesignTime> + <DependentUpon>Resources.resx</DependentUpon> + </Compile> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="Configure.resx"> + <DependentUpon>Configure.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> + <EmbeddedResource Include="Properties\Resources.resx"> + <SubType>Designer</SubType> + <Generator>ResXFileCodeGenerator</Generator> + <LastGenOutput>Resources.Designer.cs</LastGenOutput> + </EmbeddedResource> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\IR Server Plugin Interface\IR Server Plugin Interface.csproj"> + <Project>{D8B3D28F-62CE-4CA7-86CE-B7EAD614A94C}</Project> + <Name>IR Server Plugin Interface</Name> + <Private>False</Private> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <Content Include="Icon.ico" /> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> + <PropertyGroup> + <PostBuildEvent> + </PostBuildEvent> + </PropertyGroup> +</Project> \ No newline at end of file Added: trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Properties/AssemblyInfo.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Properties/AssemblyInfo.cs 2008-04-25 13:08:25 UTC (rev 1712) @@ -0,0 +1,36 @@ +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Pinnacle Serial Receiver")] +[assembly: AssemblyDescription("IR Server plugin to support the Pinnacle Serial receiver")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("and-81")] +[assembly: AssemblyProduct("PinnacleSerialReceiver")] +[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.4.2.0")] +[assembly: AssemblyFileVersion("1.4.2.0")] + +[assembly: CLSCompliant(true)] +[assembly: Guid("FE926576-8701-477f-9694-73895D480F5F")] Added: trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Properties/Resources.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Properties/Resources.Designer.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Properties/Resources.Designer.cs 2008-04-25 13:08:25 UTC (rev 1712) @@ -0,0 +1,70 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:2.0.50727.832 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace InputService.Plugin.Properties { + using System; + + + /// <summary> + /// A strongly-typed resource class, for looking up localized strings, etc. + /// </summary> + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// <summary> + /// Returns the cached ResourceManager instance used by this class. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("InputService.Plugin.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// <summary> + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + internal static System.Drawing.Icon Icon { + get { + object obj = ResourceManager.GetObject("Icon", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + } +} Added: trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Properties/Resources.resx =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Properties/Resources.resx (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Properties/Resources.resx 2008-04-25 13:08:25 UTC (rev 1712) @@ -0,0 +1,124 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> + <data name="Icon" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\icon.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> +</root> \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/iMon/Imon PAD.xml =================================================================== --- trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/iMon/Imon PAD.xml 2008-04-25 05:54:50 UTC (rev 1711) +++ trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/iMon/Imon PAD.xml 2008-04-25 13:08:25 UTC (rev 1712) @@ -39,6 +39,5 @@ <RemoteTable RawCode="1040" AbstractButton="TV" /> <RemoteTable RawCode="1106" AbstractButton="AspectRatio" /> <RemoteTable RawCode="1114" AbstractButton="Eject" /> - <RemoteTable RawCode="1002" AbstractButton="Close" /> <RemoteTable RawCode="1166" AbstractButton="Fullscreen" /> </DocumentElement> \ No newline at end of file Modified: trunk/plugins/IR Server Suite/setup/setup.nsi =================================================================== --- trunk/plugins/IR Server Suite/setup/setup.nsi 2008-04-25 05:54:50 UTC (rev 1711) +++ trunk/plugins/IR Server Suite/setup/setup.nsi 2008-04-25 13:08:25 UTC (rev 1712) @@ -352,6 +352,7 @@ File "..\IR Server Plugins\LiveDrive Receiver\bin\${BuildType}\LiveDrive Receiver.*" File "..\IR Server Plugins\MacMini Receiver\bin\${BuildType}\MacMini Receiver.*" File "..\IR Server Plugins\Microsoft MCE Transceiver\bin\${BuildType}\Microsoft MCE Transceiver.*" + File "..\IR Server Plugins\Pinnacle Serial Receiver\bin\${BuildType}\Pinnacle Serial Receiver.*" ;File "..\IR Server Plugins\RC102 Receiver\bin\${BuildType}\RC102 Receiver.*" File "..\IR Server Plugins\RedEye Blaster\bin\${BuildType}\RedEye Blaster.*" File "..\IR Server Plugins\Serial IR Blaster\bin\${BuildType}\Serial IR Blaster.*" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2008-04-26 04:51:57
|
Revision: 1715 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1715&view=rev Author: and-81 Date: 2008-04-25 21:51:55 -0700 (Fri, 25 Apr 2008) Log Message: ----------- Added support for Pinnacle Serial IR Receiver and Remote Modified Paths: -------------- trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Configure.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Configure.resx trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Pinnacle Serial Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Pinnacle Serial Receiver.csproj Added Paths: ----------- trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/Pinnacle Serial/Pinnacle 41 Button.xml Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Configure.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Configure.Designer.cs 2008-04-26 00:18:16 UTC (rev 1714) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Configure.Designer.cs 2008-04-26 04:51:55 UTC (rev 1715) @@ -118,6 +118,7 @@ this.comboBoxPort.Name = "comboBoxPort"; this.comboBoxPort.Size = new System.Drawing.Size(88, 21); this.comboBoxPort.TabIndex = 3; + this.toolTips.SetToolTip(this.comboBoxPort, "Select the serial port the device is attached to"); // // Configure // @@ -125,7 +126,7 @@ 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(224, 104); + this.ClientSize = new System.Drawing.Size(226, 106); this.Controls.Add(this.labelButtonRepeatDelay); this.Controls.Add(this.comboBoxPort); this.Controls.Add(this.numericUpDownButtonRepeatDelay); @@ -140,7 +141,7 @@ this.ShowIcon = false; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "IRMan Receiver Configuration"; + this.Text = "Pinnacle Configuration"; ((System.ComponentModel.ISupportInitialize)(this.numericUpDownButtonRepeatDelay)).EndInit(); this.ResumeLayout(false); Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Configure.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Configure.cs 2008-04-26 00:18:16 UTC (rev 1714) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Configure.cs 2008-04-26 04:51:55 UTC (rev 1715) @@ -44,7 +44,7 @@ _ports = SerialPort.GetPortNames(); if (_ports == null || _ports.Length == 0) { - MessageBox.Show(this, "No available serial ports found!", "IRMan Receiver", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show(this, "No available serial ports found!", "Pinnacle Serial Receiver", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Configure.resx =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Configure.resx 2008-04-26 00:18:16 UTC (rev 1714) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Configure.resx 2008-04-26 04:51:55 UTC (rev 1715) @@ -120,4 +120,7 @@ <metadata name="toolTips.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>17, 17</value> </metadata> + <metadata name="toolTips.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> </root> \ No newline at end of file Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Pinnacle Serial Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Pinnacle Serial Receiver.cs 2008-04-26 00:18:16 UTC (rev 1714) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Pinnacle Serial Receiver.cs 2008-04-26 04:51:55 UTC (rev 1715) @@ -1,3 +1,5 @@ +//#define TEST_APPLICATION + using System; using System.Collections.Generic; #if TRACE @@ -20,11 +22,87 @@ public class PinnacleSerialReceiver : PluginBase, IConfigure, IRemoteReceiver { + // #define TEST_APPLICATION in the project properties when creating the console test app ... +#if TEST_APPLICATION + + static PinnacleSerialReceiver device; + + static void xRemote(string deviceName, string code) + { + Console.WriteLine("Remote: {0}", code); + } + + static void Dump(int[] timingData) + { + foreach (int time in timingData) + Console.Write("{0}, ", time); + Console.WriteLine(); + } + + [STAThread] + static void Main() + { + Console.WriteLine("PinnacleSerialReceiver Test App"); + Console.WriteLine("===================================="); + Console.WriteLine(); + + try + { + device = new PinnacleSerialReceiver(); + + //Keyboard.LoadLayout(Keyboard.German_DE); + + Console.Write("Configure device? (y/n) "); + + if (Console.ReadKey().Key == ConsoleKey.Y) + { + Console.WriteLine(); + + Console.WriteLine("Configuring ..."); + device.Configure(null); + } + else + { + Console.WriteLine(); + } + + device.RemoteCallback += new RemoteHandler(xRemote); + //device.KeyboardCallback += new KeyboardHandler(xKeyboard); + //device.MouseCallback += new MouseHandler(xMouse); + + Console.WriteLine("Starting device access ..."); + + device.Start(); + + Console.WriteLine("Press a button on your remote ..."); + + Application.Run(); + + device.Stop(); + } + catch (Exception ex) + { + Console.WriteLine("Error:"); + Console.WriteLine(ex.ToString()); + Console.WriteLine(); + Console.WriteLine(""); + + Console.ReadKey(); + } + finally + { + device = null; + } + } + +#endif + + #region Constants static readonly string ConfigurationFile = Path.Combine(ConfigurationPath, "Pinnacle Serial Receiver.xml"); - const int DeviceBufferSize = 3; + const int DeviceBufferSize = 255; // 3; #endregion Constants @@ -86,14 +164,14 @@ _serialPort.Handshake = Handshake.None; _serialPort.DtrEnable = false; _serialPort.RtsEnable = true; - _serialPort.ReadBufferSize = DeviceBufferSize; - _serialPort.ReadTimeout = 1000; + //_serialPort.ReadBufferSize = DeviceBufferSize; + //_serialPort.ReadTimeout = 1000; _serialPort.Open(); Thread.Sleep(100); _serialPort.DiscardInBuffer(); - _serialPort.ReceivedBytesThreshold = DeviceBufferSize; + //_serialPort.ReceivedBytesThreshold = DeviceBufferSize; _serialPort.DataReceived += new SerialDataReceivedEventHandler(SerialPort_DataReceived); } /// <summary> @@ -178,16 +256,33 @@ { try { - _serialPort.Read(_deviceBuffer, 0, DeviceBufferSize); + int bytes = _serialPort.BytesToRead; + if (bytes == 0) + return; + _serialPort.Read(_deviceBuffer, 0, bytes); + TimeSpan timeSpan = DateTime.Now - _lastCodeTime; - StringBuilder keyCode = new StringBuilder(2 * DeviceBufferSize); - for (int index = 0; index < DeviceBufferSize; index++) - keyCode.Append(_deviceBuffer[index].ToString("X2")); + string thisCode = String.Empty; - string thisCode = keyCode.ToString(); + if (bytes == 3) + { + int code = _deviceBuffer[2] & 0x3F; + thisCode = code.ToString(); + } + else + { + StringBuilder keyCode = new StringBuilder(2 * bytes); + for (int index = 0; index < bytes; index++) + keyCode.Append(_deviceBuffer[index].ToString("X2")); + + thisCode = keyCode.ToString(); + } + if (String.IsNullOrEmpty(thisCode)) + return; + if (thisCode.Equals(_lastCode, StringComparison.Ordinal)) // Repeated button { if (timeSpan.Milliseconds > _repeatDelay) @@ -259,7 +354,7 @@ { #endif - _repeatDelay = 500; + _repeatDelay = 400; _serialPortName = "COM1"; } } Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Pinnacle Serial Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Pinnacle Serial Receiver.csproj 2008-04-26 00:18:16 UTC (rev 1714) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Pinnacle Serial Receiver/Pinnacle Serial Receiver.csproj 2008-04-26 04:51:55 UTC (rev 1715) @@ -11,6 +11,8 @@ <AssemblyName>Pinnacle Serial Receiver</AssemblyName> <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent> <ApplicationIcon>Icon.ico</ApplicationIcon> + <StartupObject> + </StartupObject> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>false</DebugSymbols> @@ -72,7 +74,7 @@ <ProjectReference Include="..\IR Server Plugin Interface\IR Server Plugin Interface.csproj"> <Project>{D8B3D28F-62CE-4CA7-86CE-B7EAD614A94C}</Project> <Name>IR Server Plugin Interface</Name> - <Private>False</Private> + <Private>True</Private> </ProjectReference> </ItemGroup> <ItemGroup> Added: trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/Pinnacle Serial/Pinnacle 41 Button.xml =================================================================== --- trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/Pinnacle Serial/Pinnacle 41 Button.xml (rev 0) +++ trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/Pinnacle Serial/Pinnacle 41 Button.xml 2008-04-26 04:51:55 UTC (rev 1715) @@ -0,0 +1,43 @@ +<?xml version="1.0" standalone="yes"?> +<DocumentElement> + <RemoteTable RawCode="63" AbstractButton="Up" /> + <RemoteTable RawCode="62" AbstractButton="Down" /> + <RemoteTable RawCode="61" AbstractButton="Left" /> + <RemoteTable RawCode="59" AbstractButton="Right" /> + <RemoteTable RawCode="26" AbstractButton="OK" /> + <RemoteTable RawCode="27" AbstractButton="VolumeUp" /> + <RemoteTable RawCode="15" AbstractButton="VolumeDown" /> + <RemoteTable RawCode="23" AbstractButton="ChannelUp" /> + <RemoteTable RawCode="28" AbstractButton="ChannelDown" /> + <RemoteTable RawCode="37" AbstractButton="PreviousChannel" /> + <RemoteTable RawCode="22" AbstractButton="Back" /> + <RemoteTable RawCode="43" AbstractButton="Info" /> + <RemoteTable RawCode="60" AbstractButton="Mute" /> + <RemoteTable RawCode="58" AbstractButton="Number0" /> + <RemoteTable RawCode="49" AbstractButton="Number1" /> + <RemoteTable RawCode="50" AbstractButton="Number2" /> + <RemoteTable RawCode="51" AbstractButton="Number3" /> + <RemoteTable RawCode="52" AbstractButton="Number4" /> + <RemoteTable RawCode="53" AbstractButton="Number5" /> + <RemoteTable RawCode="54" AbstractButton="Number6" /> + <RemoteTable RawCode="55" AbstractButton="Number7" /> + <RemoteTable RawCode="56" AbstractButton="Number8" /> + <RemoteTable RawCode="57" AbstractButton="Number9" /> + <RemoteTable RawCode="13" AbstractButton="Play" /> + <RemoteTable RawCode="21" AbstractButton="Pause" /> + <RemoteTable RawCode="11" AbstractButton="Stop" /> + <RemoteTable RawCode="7" AbstractButton="FastForward" /> + <RemoteTable RawCode="14" AbstractButton="Rewind" /> + <RemoteTable RawCode="39" AbstractButton="Record" /> + <RemoteTable RawCode="25" AbstractButton="NextChapter" /> + <RemoteTable RawCode="47" AbstractButton="Power" /> + <RemoteTable RawCode="41" AbstractButton="Teletext" /> + <RemoteTable RawCode="29" AbstractButton="Menu" /> + <RemoteTable RawCode="45" AbstractButton="Fullscreen" /> + <RemoteTable RawCode="30" AbstractButton="AspectRatio" /> + <RemoteTable RawCode="46" AbstractButton="Pictures" /> + <RemoteTable RawCode="38" AbstractButton="TV" /> + <RemoteTable RawCode="24" AbstractButton="Guide" /> + <RemoteTable RawCode="31" AbstractButton="LiveTV" /> + <RemoteTable RawCode="42" AbstractButton="Radio" /> +</DocumentElement> \ 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...> - 2008-04-26 07:13:39
|
Revision: 1718 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1718&view=rev Author: and-81 Date: 2008-04-26 00:13:23 -0700 (Sat, 26 Apr 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Documentation/new.html trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/Configure.Designer.cs Modified: trunk/plugins/IR Server Suite/Documentation/new.html =================================================================== --- trunk/plugins/IR Server Suite/Documentation/new.html 2008-04-26 07:12:51 UTC (rev 1717) +++ trunk/plugins/IR Server Suite/Documentation/new.html 2008-04-26 07:13:23 UTC (rev 1718) @@ -76,6 +76,8 @@ <LI>Installer: Fixed an x64 bug.</LI> <LI>Translator: Fixed an x64 bug.</LI> <LI>Input Service: Now enables "Interact with desktop" setting for service, this should get MCE Replacement Driver users the ability to use the Remote Keyboard properly.</LI> +<LI>New Input Plugin: Pinnacle Serial Receiver is now supported.</LI> +<LI>MP Control Plugin: Fixed remote mapping bug (in plugin configuration).</LI> </UL></P> <BR> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/Configure.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/Configure.Designer.cs 2008-04-26 07:12:51 UTC (rev 1717) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/Configure.Designer.cs 2008-04-26 07:13:23 UTC (rev 1718) @@ -118,6 +118,7 @@ this.comboBoxPort.Name = "comboBoxPort"; this.comboBoxPort.Size = new System.Drawing.Size(88, 21); this.comboBoxPort.TabIndex = 3; + this.toolTips.SetToolTip(this.comboBoxPort, "Select the serial port the device is attached to"); // // Configure // @@ -125,7 +126,7 @@ 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(224, 104); + this.ClientSize = new System.Drawing.Size(226, 106); this.Controls.Add(this.labelButtonRepeatDelay); this.Controls.Add(this.comboBoxPort); this.Controls.Add(this.numericUpDownButtonRepeatDelay); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2008-04-27 16:46:20
|
Revision: 1745 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1745&view=rev Author: and-81 Date: 2008-04-27 09:46:16 -0700 (Sun, 27 Apr 2008) Log Message: ----------- Misc fixes/updates Modified Paths: -------------- 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/Web Remote/WebServer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/DirectInputListener.cs trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/IgorPlug Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/Imon USB Receivers.cs trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/LiveDriveReceiver.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/WinLirc Transceiver/WinLirc Transceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLircServer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs Added Paths: ----------- trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/SocketInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLircCommand.cs Modified: trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2008-04-27 15:12:02 UTC (rev 1744) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2008-04-27 16:46:16 UTC (rev 1745) @@ -1360,7 +1360,7 @@ if ((combo.Message.Flags & MessageFlags.Request) == MessageFlags.Request) { IrssLog.Info("Shutdown command received"); - Stop(); + //Stop(); Application.Exit(); } break; @@ -1656,7 +1656,7 @@ IrssLog.Info("Quit"); - Stop(); + //Stop(); Application.Exit(); } Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2008-04-27 15:12:02 UTC (rev 1744) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2008-04-27 16:46:16 UTC (rev 1745) @@ -54,7 +54,10 @@ using (IRServer irServer = new IRServer()) { if (irServer.Start()) + { Application.Run(); + irServer.Stop(); + } } Application.ThreadException -= new ThreadExceptionEventHandler(Application_ThreadException); @@ -72,47 +75,55 @@ IrssLog.Error(e.Exception); } + static PluginBase[] _plugins = null; + /// <summary> /// Retreives a list of available IR Server plugins. /// </summary> /// <returns>Array of plugin instances.</returns> internal static PluginBase[] AvailablePlugins() { - List<PluginBase> plugins = new List<PluginBase>(); + if (_plugins == null) + { + List<PluginBase> plugins = new List<PluginBase>(); - string installFolder = SystemRegistry.GetInstallFolder(); - if (String.IsNullOrEmpty(installFolder)) - return null; + string installFolder = SystemRegistry.GetInstallFolder(); + if (String.IsNullOrEmpty(installFolder)) + return null; - string path = Path.Combine(installFolder, "IR Server Plugins"); - string[] files = Directory.GetFiles(path, "*.dll", SearchOption.TopDirectoryOnly); + string path = Path.Combine(installFolder, "IR Server Plugins"); + string[] files = Directory.GetFiles(path, "*.dll", SearchOption.TopDirectoryOnly); - // TODO: Return a Type[], don't instantiate unless required + // TODO: Return a Type[], don't instantiate unless required - foreach (string file in files) - { - try + foreach (string file in files) { - Assembly assembly = Assembly.LoadFrom(file); - Type[] types = assembly.GetExportedTypes(); + try + { + Assembly assembly = Assembly.LoadFrom(file); + Type[] types = assembly.GetExportedTypes(); - foreach (Type type in types) - { - if (type.IsClass && !type.IsAbstract && type.IsSubclassOf(typeof(PluginBase))) + foreach (Type type in types) { - PluginBase plugin = (PluginBase)assembly.CreateInstance(type.FullName); + if (type.IsClass && !type.IsAbstract && type.IsSubclassOf(typeof(PluginBase))) + { + PluginBase plugin = (PluginBase)assembly.CreateInstance(type.FullName); - if (plugin != null) - plugins.Add(plugin); + if (plugin != null) + plugins.Add(plugin); + } } } + catch (BadImageFormatException) { } // Ignore Bad Image Format Exceptions, just keep checking for IR Server Plugins + catch (TypeLoadException) { } // Ignore Type Load Exceptions, just keep checking for IR Server Plugins + catch (FileNotFoundException) { } // Ignore File Not Found Exceptions, just keep checking for IR Server Plugins } - catch (BadImageFormatException) { } // Ignore Bad Image Format Exceptions, just keep checking for IR Server Plugins - catch (TypeLoadException) { } // Ignore Type Load Exceptions, just keep checking for IR Server Plugins - catch (FileNotFoundException) { } // Ignore File Not Found Exceptions, just keep checking for IR Server Plugins + + _plugins = plugins.ToArray(); } - return plugins.ToArray(); + return _plugins; +// return plugins.ToArray(); } /// <summary> Modified: trunk/plugins/IR Server Suite/Applications/Web Remote/WebServer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Web Remote/WebServer.cs 2008-04-27 15:12:02 UTC (rev 1744) +++ trunk/plugins/IR Server Suite/Applications/Web Remote/WebServer.cs 2008-04-27 16:46:16 UTC (rev 1745) @@ -63,6 +63,7 @@ _runningThread.Abort(); _runningThread = new Thread(new ThreadStart(RunThread)); + _runningThread.Name = "WebRemote Server"; _runningThread.IsBackground = true; _runningThread.Start(); } Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/DirectInputListener.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/DirectInputListener.cs 2008-04-27 15:12:02 UTC (rev 1744) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Direct Input Receiver/DirectInputListener.cs 2008-04-27 16:46:16 UTC (rev 1745) @@ -255,6 +255,7 @@ isListening = true; inputListener = new Thread(new ThreadStart(this.ThreadFunction)); + inputListener.Name = "DirectInputListener"; inputListener.IsBackground = true; inputListener.Start(); } 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-04-27 15:12:02 UTC (rev 1744) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug Receiver/IgorPlug Receiver.cs 2008-04-27 16:46:16 UTC (rev 1745) @@ -179,11 +179,6 @@ [MarshalAs(UnmanagedType.U4)] CreateFileAttributes flags, IntPtr templateFile); - [DllImport("kernel32.dll", SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - static extern bool CloseHandle( - SafeFileHandle handle); - #endregion Interop #region Variables @@ -247,7 +242,7 @@ if (deviceHandle.IsInvalid) throw new Win32Exception(lastError, "Failed to open device"); - CloseHandle(deviceHandle); + deviceHandle.Dispose(); return true; } @@ -267,8 +262,11 @@ DebugWriteLine("Start()"); #endif - ThreadStart readThreadStart = new ThreadStart(ReadThread); - _readThread = new Thread(readThreadStart); + if (!Detect()) + throw new InvalidOperationException("IgorPlug not found"); + + _readThread = new Thread(new ThreadStart(ReadThread)); + _readThread.Name = "IgorPlug.ReadThread"; _readThread.IsBackground = true; _readThread.Start(); } @@ -482,7 +480,7 @@ } finally { - CloseHandle(handle); + handle.Dispose(); } return Result; Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/Imon USB Receivers.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/Imon USB Receivers.cs 2008-04-27 15:12:02 UTC (rev 1744) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/Imon USB Receivers.cs 2008-04-27 16:46:16 UTC (rev 1745) @@ -545,11 +545,6 @@ static extern bool CancelIo( SafeFileHandle handle); - [DllImport("kernel32.dll", SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - static extern bool CloseHandle( - SafeFileHandle handle); - #endregion DosDevice Interop #region HID Device Support variables @@ -1162,13 +1157,9 @@ DebugWriteLine("Suspend()"); #endif if (_DriverMode == DeviceType.HID) - { Stop_HID(); - } else - { Stop_DOS(); - } } /// <summary> @@ -1180,13 +1171,9 @@ DebugWriteLine("Resume()"); #endif if (_DriverMode == DeviceType.HID) - { Start_HID(); - } else - { Start_DOS(); - } } /// <summary> @@ -1738,9 +1725,11 @@ _receiveThread = null; - if (_deviceHandle != null && !_deviceHandle.IsClosed) - CloseHandle(_deviceHandle); + if (_deviceHandle != null) + _deviceHandle.Dispose(); + _deviceHandle = null; + #if DEBUG DebugClose(); #endif @@ -1788,7 +1777,6 @@ if (deviceHandle.IsInvalid) throw new Win32Exception(lastError, "Failed to open device"); - CloseHandle(deviceHandle); deviceHandle.Dispose(); #if DEBUG DebugWriteLine("Detect_DOS(): completed - found device."); 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-04-27 15:12:02 UTC (rev 1744) +++ trunk/plugins/IR Server Suite/IR Server Plugins/LiveDrive Receiver/LiveDriveReceiver.cs 2008-04-27 16:46:16 UTC (rev 1745) @@ -27,7 +27,7 @@ internal static extern int midiInGetNumDevs(); [DllImport("winmm.dll")] - static extern uint midiInOpen(ref int lphMidiIn, int uDeviceID, MidiInProc dwCallback, int dwInstance, Int64 dwFlags); + static extern uint midiInOpen(ref int lphMidiIn, int uDeviceID, MidiInProc dwCallback, int dwInstance, int dwFlags); [DllImport("winmm.dll")] static extern uint midiInStart(int hMidiIn); @@ -89,7 +89,7 @@ const int MM_ERROR = 0x3C5; const int MM_LONGERROR = 0x3C6; - const Int64 CALLBACK_FUNCTION = 0x00030000L; + const int CALLBACK_FUNCTION = 0x30000; const int MMSYSERR_NOERROR = 0; const int MMSYSERR_BASE = 0; 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-04-27 15:12:02 UTC (rev 1744) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs 2008-04-27 16:46:16 UTC (rev 1745) @@ -177,11 +177,6 @@ protected static extern bool CancelIo( SafeFileHandle handle); - [DllImport("kernel32.dll")] - [return: MarshalAs(UnmanagedType.Bool)] - protected static extern bool CloseHandle( - SafeFileHandle handle); - [DllImport("setupapi.dll", CharSet = CharSet.Auto)] static extern IntPtr SetupDiGetClassDevs( ref Guid classGuid, 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-04-27 15:12:02 UTC (rev 1744) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverReplacement.cs 2008-04-27 16:46:16 UTC (rev 1745) @@ -647,9 +647,11 @@ try { _readThreadMode = ReadThreadMode.Stop; + _stopReadThread.Set(); + if (Thread.CurrentThread != _readThread) + _readThread.Join(PacketTimeout * 2); - if (!_stopReadThread.Set() || !_readThread.Join(PacketTimeout * 2)) - _readThread.Abort(); + //_readThread.Abort(); } #if DEBUG catch (Exception ex) @@ -703,7 +705,6 @@ if (_writeHandle.IsInvalid) { _writeHandle = null; - CloseHandle(_readHandle); _readHandle.Dispose(); throw new Win32Exception(lastError); } @@ -745,16 +746,12 @@ _readHandle.DangerousRelease(); - CloseHandle(_readHandle); - _readHandle.Dispose(); _readHandle = null; } if (_writeHandle != null) { - CloseHandle(_writeHandle); - _writeHandle.Dispose(); _writeHandle = null; } 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-04-27 15:12:02 UTC (rev 1744) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverVista.cs 2008-04-27 16:46:16 UTC (rev 1745) @@ -877,11 +877,14 @@ _readThreadMode = ReadThreadMode.Stop; - _readThread.Abort(); + //_readThread.Abort(); - if (Thread.CurrentThread != _readThread) - _readThread.Join(); + if (_eHomeHandle != null) + CancelIo(_eHomeHandle); + //if (Thread.CurrentThread != _readThread) + //_readThread.Join(); + _readThread = null; } @@ -949,8 +952,6 @@ _eHomeHandle.DangerousRelease(); - CloseHandle(_eHomeHandle); - _eHomeHandle.Dispose(); _eHomeHandle = null; } 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-04-27 15:12:02 UTC (rev 1744) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverXP.cs 2008-04-27 16:46:16 UTC (rev 1745) @@ -646,9 +646,11 @@ try { _readThreadMode = ReadThreadMode.Stop; + _stopReadThread.Set(); + if (Thread.CurrentThread != _readThread) + _readThread.Join(PacketTimeout * 2); - if (!_stopReadThread.Set() || !_readThread.Join(PacketTimeout * 2)) - _readThread.Abort(); + //_readThread.Abort(); } #if DEBUG catch (Exception ex) @@ -732,8 +734,6 @@ _eHomeHandle.DangerousRelease(); - CloseHandle(_eHomeHandle); - _eHomeHandle.Dispose(); _eHomeHandle = null; } Added: trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/SocketInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/SocketInfo.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/SocketInfo.cs 2008-04-27 16:46:16 UTC (rev 1745) @@ -0,0 +1,59 @@ +using System; +using System.Net.Sockets; + +namespace InputService.Plugin +{ + + /// <summary> + /// Class containing information for the data callback function + /// </summary> + class SocketInfo + { + + #region Variables + + Socket _socket; + byte[] _dataBuffer; + + #endregion Variables + + #region Properties + + /// <summary> + /// Gets the socket. + /// </summary> + /// <value>The socket.</value> + public Socket Sock { get { return _socket; } } + + /// <summary> + /// Gets the data buffer. + /// </summary> + /// <value>The data buffer.</value> + public byte[] DataBuffer { get { return _dataBuffer; } } + + #endregion Properties + + #region Constructors + + /// <summary> + /// Initializes a new instance of the <see cref="SocketInfo"/> class. + /// </summary> + public SocketInfo() + { + _dataBuffer = new byte[512]; + } + + /// <summary> + /// Initializes a new instance of the <see cref="SocketInfo"/> class. + /// </summary> + /// <param name="socket">The socket.</param> + public SocketInfo(Socket socket) : this() + { + _socket = socket; + } + + #endregion Constructors + + } + +} 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-04-27 15:12:02 UTC (rev 1744) +++ trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.cs 2008-04-27 16:46:16 UTC (rev 1745) @@ -268,7 +268,7 @@ /// Handles commands. /// </summary> /// <param name="cmd">The Command.</param> - void CommandHandler(WinLircServer.Command cmd) + void CommandHandler(WinLircCommand cmd) { if (_remoteButtonHandler == null) return; Modified: trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.csproj 2008-04-27 15:12:02 UTC (rev 1744) +++ trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.csproj 2008-04-27 16:46:16 UTC (rev 1745) @@ -61,7 +61,9 @@ <DesignTime>True</DesignTime> <DependentUpon>Resources.resx</DependentUpon> </Compile> + <Compile Include="SocketInfo.cs" /> <Compile Include="WinLirc Transceiver.cs" /> + <Compile Include="WinLircCommand.cs" /> <Compile Include="WinLircServer.cs" /> </ItemGroup> <ItemGroup> Added: trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLircCommand.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLircCommand.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLircCommand.cs 2008-04-27 16:46:16 UTC (rev 1745) @@ -0,0 +1,75 @@ +using System; + +namespace InputService.Plugin +{ + + /// <summary> + /// Class containing information on a WinLIRC command + /// </summary> + class WinLircCommand + { + + #region Variables + + string _remote; + string _button; + DateTime _time; + + #endregion Variables + + #region Properties + + /// <summary> + /// Gets the button. + /// </summary> + /// <value>The button.</value> + public string Button { get { return _button; } } + /// <summary> + /// Gets the remote. + /// </summary> + /// <value>The remote.</value> + public string Remote { get { return _remote; } } + /// <summary> + /// Gets the time. + /// </summary> + /// <value>The time.</value> + public DateTime Time { get { return _time; } } + + #endregion Properties + + #region Constructors + + /// <summary> + /// Initializes a new instance of the <see cref="WinLircCommand"/> class. + /// </summary> + public WinLircCommand() + { + _time = DateTime.Now; + } + + /// <summary> + /// Initializes a new instance of the <see cref="WinLircCommand"/> class. + /// </summary> + /// <param name="data">The data.</param> + public WinLircCommand(string data) : this() + { + string[] dataElements = data.Split(' '); + _button = dataElements[2]; + _remote = dataElements[3]; + } + + #endregion Constructors + + /// <summary> + /// Determines whether this command is same the same as the specified second. + /// </summary> + /// <param name="second">The second command to compare with.</param> + /// <returns><c>true</c> if this command is the same as the specified second; otherwise, <c>false</c>.</returns> + public bool IsSameCommand(WinLircCommand second) + { + return (_button.Equals(second.Button, StringComparison.Ordinal) && _remote.Equals(second.Remote, StringComparison.Ordinal)); + } + + } + +} Modified: trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLircServer.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLircServer.cs 2008-04-27 15:12:02 UTC (rev 1744) +++ trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLircServer.cs 2008-04-27 16:46:16 UTC (rev 1745) @@ -43,13 +43,13 @@ #region Variables - public delegate void CommandEventHandler(Command cmd); + public delegate void CommandEventHandler(WinLircCommand cmd); public event CommandEventHandler CommandEvent; Socket _socket; // Socket for WinLIRC communication TimeSpan _buttonReleaseTime; // Time span in which multiple receptions of the same command are ignored AsyncCallback _dataCallback; // Callback function receiving data from WinLIRC IAsyncResult _dataCallbackResult; // Result of the callback function - Command _lastCommand; // Last command actually sent to InputHandler + WinLircCommand _lastCommand; // Last command actually sent to InputHandler #endregion Variables @@ -58,7 +58,7 @@ public WinLircServer(IPAddress ip, int port, TimeSpan buttonReleaseTime) { _buttonReleaseTime = buttonReleaseTime; - _lastCommand = new Command(); + _lastCommand = new WinLircCommand(); _socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); _socket.Connect(ip, port); // Connect; error handling is done in SetupDataCallback() @@ -76,9 +76,8 @@ if (_dataCallback == null) _dataCallback = new AsyncCallback(OnDataReceived); - SocketInfo info = new SocketInfo(); - info._socket = _socket; - _dataCallbackResult = _socket.BeginReceive(info._dataBuffer, 0, info._dataBuffer.Length, SocketFlags.None, _dataCallback, info); + SocketInfo info = new SocketInfo(_socket); + _dataCallbackResult = _socket.BeginReceive(info.DataBuffer, 0, info.DataBuffer.Length, SocketFlags.None, _dataCallback, info); } catch (SocketException se) { @@ -90,10 +89,12 @@ #region Public Methods - public static bool StartServer(String path) + public static bool StartServer(string path) { if (IsServerRunning()) + { Trace.WriteLine("WLirc: WinLIRC server was not started (already running)"); + } else { Trace.WriteLine("WLirc: Starting WinLIRC server..."); @@ -134,16 +135,16 @@ try { SocketInfo info = (SocketInfo)async.AsyncState; - int receivedBytesCount = info._socket.EndReceive(async); + int receivedBytesCount = info.Sock.EndReceive(async); // Convert received bytes to string char[] chars = new char[receivedBytesCount + 1]; - System.Text.Decoder decoder = Encoding.UTF8.GetDecoder(); - decoder.GetChars(info._dataBuffer, 0, receivedBytesCount, chars, 0); - System.String data = new System.String(chars); + Decoder decoder = Encoding.UTF8.GetDecoder(); + decoder.GetChars(info.DataBuffer, 0, receivedBytesCount, chars, 0); + string data = new string(chars); - String[] commands = data.Split(new char[] { '\n', '\r', '\0' }, StringSplitOptions.RemoveEmptyEntries); - foreach (String cmd in commands) + string[] commands = data.Split(new char[] { '\n', '\r', '\0' }, StringSplitOptions.RemoveEmptyEntries); + foreach (string cmd in commands) ProcessData(cmd); SetupDataCallback(); // Listen to new signals again @@ -161,7 +162,7 @@ /// <summary> /// Process received data, i.e. send event to event handlers /// </summary> - private void ProcessData(String data) + private void ProcessData(string data) { // Ignore commands we do not need (like the startup message) if (data.Equals("BEGIN", StringComparison.OrdinalIgnoreCase) || @@ -169,17 +170,21 @@ data.Equals("SIGHUP", StringComparison.OrdinalIgnoreCase)) return; - Command command = new Command(data); + WinLircCommand command = new WinLircCommand(data); #region Time-based repeat filter + if (_lastCommand.IsSameCommand(command)) + { if ((command.Time - _lastCommand.Time) < _buttonReleaseTime) { Trace.WriteLine(String.Format("WLirc: Command '{0}' ignored because of repeat filter", command.Button)); return; } - #endregion + } + #endregion Time-based repeat filter + Trace.WriteLine(String.Format("WLirc: Command '{0}' accepted", command.Button)); _lastCommand = command; @@ -189,53 +194,6 @@ #endregion Private Methods - #region Helper classes - - /// <summary> - /// Class containing information for the data callback function - /// </summary> - private class SocketInfo - { - public Socket _socket; - public byte[] _dataBuffer = new byte[512]; - } - - /// <summary> - /// Class containing information on a WinLIRC command - /// </summary> - public class Command - { - String _remote; - String _button; - DateTime _time; - - public Command() - { - _time = DateTime.Now; - } - - public Command(string data) - { - String[] dataElements = data.Split(' '); - _button = dataElements[2]; - _remote = dataElements[3]; - _time = DateTime.Now; - } - - public bool IsSameCommand(Command second) - { - if ((_button == second._button) && (_remote == second._remote)) - return true; - return false; - } - - public String Button { get { return _button; } } - public String Remote { get { return _remote; } } - public DateTime Time { get { return _time; } } - } - - #endregion Helper classes - } } Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.Designer.cs 2008-04-27 15:12:02 UTC (rev 1744) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.Designer.cs 2008-04-27 16:46:16 UTC (rev 1745) @@ -90,7 +90,6 @@ this.groupBoxMouseModeOptions = new System.Windows.Forms.GroupBox(); this.labelMouseModeToggle = new System.Windows.Forms.Label(); this.labelMouseStep = new System.Windows.Forms.Label(); - this.checkBoxAbstractRemoteMode = new System.Windows.Forms.CheckBox(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownMouseStep)).BeginInit(); this.tabControl.SuspendLayout(); this.tabPageRemotes.SuspendLayout(); @@ -547,7 +546,6 @@ // // tabPageRemotes // - this.tabPageRemotes.Controls.Add(this.checkBoxAbstractRemoteMode); this.tabPageRemotes.Controls.Add(this.comboBoxRemotePresets); this.tabPageRemotes.Controls.Add(this.buttonLoadPreset); this.tabPageRemotes.Controls.Add(this.buttonClearAll); @@ -604,9 +602,9 @@ | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.treeViewRemotes.HideSelection = false; - this.treeViewRemotes.Location = new System.Drawing.Point(8, 40); + this.treeViewRemotes.Location = new System.Drawing.Point(8, 8); this.treeViewRemotes.Name = "treeViewRemotes"; - this.treeViewRemotes.Size = new System.Drawing.Size(552, 160); + this.treeViewRemotes.Size = new System.Drawing.Size(552, 192); this.treeViewRemotes.TabIndex = 0; this.treeViewRemotes.KeyDown += new System.Windows.Forms.KeyEventHandler(this.treeViewRemotes_KeyDown); // @@ -860,18 +858,6 @@ this.labelMouseStep.Text = "Mouse step distance:"; this.labelMouseStep.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // checkBoxAbstractRemoteMode - // - this.checkBoxAbstractRemoteMode.Enabled = false; - this.checkBoxAbstractRemoteMode.Location = new System.Drawing.Point(8, 8); - this.checkBoxAbstractRemoteMode.Name = "checkBoxAbstractRemoteMode"; - this.checkBoxAbstractRemoteMode.Size = new System.Drawing.Size(176, 24); - this.checkBoxAbstractRemoteMode.TabIndex = 6; - this.checkBoxAbstractRemoteMode.Text = "Use Abstract Remote Model"; - this.toolTips.SetToolTip(this.checkBoxAbstractRemoteMode, "Use the abstract remote model"); - this.checkBoxAbstractRemoteMode.UseVisualStyleBackColor = true; - this.checkBoxAbstractRemoteMode.CheckedChanged += new System.EventHandler(this.checkBoxAbstractRemoteMode_CheckedChanged); - // // SetupForm // this.AcceptButton = this.buttonOK; @@ -973,6 +959,5 @@ private System.Windows.Forms.GroupBox groupBoxMouseModeOptions; private System.Windows.Forms.ListView listViewIR; private System.Windows.Forms.ListView listViewMacro; - private System.Windows.Forms.CheckBox checkBoxAbstractRemoteMode; } } \ No newline at end of file Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.cs 2008-04-27 15:12:02 UTC (rev 1744) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.cs 2008-04-27 16:46:16 UTC (rev 1745) @@ -1027,11 +1027,6 @@ #endregion Other Controls - private void checkBoxAbstractRemoteMode_CheckedChanged(object sender, EventArgs e) - { - // TODO: Implement proper abstract remote model handling - } - } } Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.resx =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.resx 2008-04-27 15:12:02 UTC (rev 1744) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.resx 2008-04-27 16:46:16 UTC (rev 1745) @@ -120,9 +120,6 @@ <metadata name="toolTips.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>17, 17</value> </metadata> - <metadata name="toolTips.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> - <value>17, 17</value> - </metadata> <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>59</value> </metadata> Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs 2008-04-27 15:12:02 UTC (rev 1744) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs 2008-04-27 16:46:16 UTC (rev 1745) @@ -855,11 +855,6 @@ /// <param name="msg">Message.</param> void OnMessage(GUIMessage msg) { - // TODO: Remove this ... - Log.Error("MESSAGE RECEIVED: {0}, {1}, {2}", - Enum.GetName(typeof(GUIMessage.MessageType), msg.Message), - msg.Label, msg.Param1); - MapEvent(msg); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2008-07-05 12:55:44
|
Revision: 1885 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1885&view=rev Author: and-81 Date: 2008-07-05 05:55:37 -0700 (Sat, 05 Jul 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Debug Client/Program.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 File Tool/FormMain.cs trunk/plugins/IR Server Suite/Applications/Translator/Configuration.cs trunk/plugins/IR Server Suite/Applications/Translator/CopyDataWM.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/EditProgramForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Program.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/Program.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/Setup.Designer.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/Setup.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray Launcher.csproj trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs trunk/plugins/IR Server Suite/Common/IrssUtils/FocusForcer.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Win32.cs trunk/plugins/IR Server Suite/Documentation/Translator/index.html trunk/plugins/IR Server Suite/Documentation/irblast.html trunk/plugins/IR Server Suite/Documentation/new.html trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/iMon/Imon PAD.xml Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/Program.cs 2008-07-05 12:46:52 UTC (rev 1884) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/Program.cs 2008-07-05 12:55:37 UTC (rev 1885) @@ -7,6 +7,9 @@ static class Program { + /// <summary> + /// Main method. + /// </summary> [STAThread] static void Main() { Modified: trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2008-07-05 12:46:52 UTC (rev 1884) +++ trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2008-07-05 12:55:37 UTC (rev 1885) @@ -28,7 +28,7 @@ static string _blastPort = "Default"; - static int _delay = 50; + static int _delay = 250; static bool _treatAsChannelNumber; static int _padChannelNumber; @@ -59,25 +59,29 @@ for (int index = 0; index < args.Length; index++) { - switch (args[index].ToUpperInvariant()) + string parameter = args[index].ToUpperInvariant(); + if (parameter.StartsWith("-", StringComparison.Ordinal) || parameter.StartsWith("/", StringComparison.Ordinal)) + parameter = parameter.Substring(1); + + switch (parameter) { - case "-HOST": + case "HOST": _serverHost = args[++index]; continue; - case "-PORT": + case "PORT": _blastPort = args[++index]; continue; - case "-DELAY": + case "DELAY": _delay = int.Parse(args[++index]); continue; - case "-CHANNEL": + case "CHANNEL": _treatAsChannelNumber = true; continue; - case "-PAD": + case "PAD": _padChannelNumber = int.Parse(args[++index]); continue; @@ -201,15 +205,17 @@ { IrssLog.Debug("Show Help"); - Console.WriteLine("IRBlast [-host x] [-port x] [-speed x] [-pad x] [-channel] <commands>"); + Console.WriteLine("IRBlast [-host x] [-port x] [-delay x] [-pad x] [-channel] <commands>"); Console.WriteLine(""); - Console.WriteLine("Use -host to specify the computer that is hosting the IR Server."); + Console.WriteLine("Use -host to specify the computer that is hosting the IR Server (Optional,"); + Console.WriteLine(" defaults to localhost)."); Console.WriteLine("Use -port to blast to a particular blaster port (Optional)."); - Console.WriteLine("Use -speed to set the blaster speed (Optional)."); Console.WriteLine("Use -channel to tell IR Blast to break apart the following IR Command and"); - Console.WriteLine(" use each digit for a separate IR blast (Optional)."); + Console.WriteLine(" use each digit for a separate IR blast (Optional)."); + Console.WriteLine("Use -delay to specify a time to delay between each command or digit in a"); + Console.WriteLine(" channel number (Optional)."); Console.WriteLine("Use -pad to tell IR Blast to pad channel numbers to a certain length"); - Console.WriteLine(" (Optional, Requires -channel)."); + Console.WriteLine(" (Optional, Requires -channel)."); Console.WriteLine("Use a tilde ~ between commands to insert half second pauses."); Console.WriteLine(""); Console.WriteLine(""); Modified: trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2008-07-05 12:46:52 UTC (rev 1884) +++ trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2008-07-05 12:55:37 UTC (rev 1885) @@ -29,7 +29,7 @@ static string _blastPort = "Default"; - static int _delay = 50; + static int _delay = 250; static bool _treatAsChannelNumber; static int _padChannelNumber; @@ -58,25 +58,29 @@ for (int index = 0; index < args.Length; index++) { - switch (args[index].ToUpperInvariant()) + string parameter = args[index].ToUpperInvariant(); + if (parameter.StartsWith("-", StringComparison.Ordinal) || parameter.StartsWith("/", StringComparison.Ordinal)) + parameter = parameter.Substring(1); + + switch (parameter) { - case "-HOST": + case "HOST": _serverHost = args[++index]; continue; - case "-PORT": + case "PORT": _blastPort = args[++index]; continue; - case "-DELAY": + case "DELAY": _delay = int.Parse(args[++index]); continue; - case "-CHANNEL": + case "CHANNEL": _treatAsChannelNumber = true; continue; - case "-PAD": + case "PAD": _padChannelNumber = int.Parse(args[++index]); continue; Modified: trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.cs 2008-07-05 12:46:52 UTC (rev 1884) +++ trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.cs 2008-07-05 12:55:37 UTC (rev 1885) @@ -60,7 +60,6 @@ #endregion Constructor - void RefreshForm() { if (String.IsNullOrEmpty(_fileName)) @@ -653,7 +652,7 @@ string port = comboBoxPort.Text; byte[] codeBytes = _code.ToByteArray(); - + byte[] outData = new byte[4 + port.Length + codeBytes.Length]; BitConverter.GetBytes(port.Length).CopyTo(outData, 0); Modified: trunk/plugins/IR Server Suite/Applications/Translator/Configuration.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Configuration.cs 2008-07-05 12:46:52 UTC (rev 1884) +++ trunk/plugins/IR Server Suite/Applications/Translator/Configuration.cs 2008-07-05 12:55:37 UTC (rev 1885) @@ -65,7 +65,7 @@ } /// <summary> - /// System wide button mappings. + /// Gets system wide button mappings. /// </summary> /// <value>The system wide mappings.</value> [XmlArray] @@ -75,7 +75,7 @@ } /// <summary> - /// Program settings. + /// Gets program settings. /// </summary> /// <value>The programs.</value> [XmlArray] @@ -85,7 +85,7 @@ } /// <summary> - /// Mapped events. + /// Gets mapped events. /// </summary> /// <value>The events.</value> [XmlArray] Modified: trunk/plugins/IR Server Suite/Applications/Translator/CopyDataWM.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/CopyDataWM.cs 2008-07-05 12:46:52 UTC (rev 1884) +++ trunk/plugins/IR Server Suite/Applications/Translator/CopyDataWM.cs 2008-07-05 12:55:37 UTC (rev 1885) @@ -85,7 +85,7 @@ /// <summary> /// Starts this instance. /// </summary> - /// <returns></returns> + /// <returns><c>true</c> if successful; otherwise, <c>false</c>.</returns> public bool Start() { if (Handle != IntPtr.Zero) Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/EditProgramForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/EditProgramForm.cs 2008-07-05 12:46:52 UTC (rev 1884) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/EditProgramForm.cs 2008-07-05 12:55:37 UTC (rev 1885) @@ -110,9 +110,7 @@ find.Description = "Please specify the starting folder for the application"; find.ShowNewFolderButton = true; if (find.ShowDialog(this) == DialogResult.OK) - { textBoxAppStartFolder.Text = find.SelectedPath; - } } private void buttonTest_Click(object sender, EventArgs e) Modified: trunk/plugins/IR Server Suite/Applications/Translator/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2008-07-05 12:46:52 UTC (rev 1884) +++ trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2008-07-05 12:55:37 UTC (rev 1885) @@ -165,19 +165,19 @@ // Adjust process priority ... AdjustPriority(_config.ProcessPriority); - /* - foreach (ProgramSettings progSettings in _config.Programs) - { - AppProfile profile = new AppProfile(); + + //foreach (ProgramSettings progSettings in _config.Programs) + //{ + // AppProfile profile = new AppProfile(); - profile.Name = progSettings.Name; - profile.MatchType = AppProfile.DetectionMethod.Executable; - profile.MatchParameters = progSettings.FileName; - profile.ButtonMappings.AddRange(progSettings.ButtonMappings); + // profile.Name = progSettings.Name; + // profile.MatchType = AppProfile.DetectionMethod.Executable; + // profile.MatchParameters = progSettings.FileName; + // profile.ButtonMappings.AddRange(progSettings.ButtonMappings); - AppProfile.Save(profile, "C:\\" + profile.Name + ".xml"); - } - */ + // AppProfile.Save(profile, "C:\\" + profile.Name + ".xml"); + //} + // Setup notify icon ... _container = new Container(); @@ -282,88 +282,95 @@ for (int index = 0; index < args.Length; index++) { string command = args[index].ToUpperInvariant(); + if (command.StartsWith("-") || command.StartsWith("/")) + command = command.Substring(1); switch (command) { - case "-BLAST": + case "BLAST": if (args.Length > index + 2) CopyDataWM.SendCopyDataMessage(Common.CmdPrefixBlast + args[++index] + '|' + args[++index]); else throw new CommandStructureException("Blast command requires two parameters (IR file, Port)"); - continue; + break; - case "-MACRO": + case "MACRO": if (args.Length > index + 1) CopyDataWM.SendCopyDataMessage(Common.CmdPrefixMacro + args[++index]); else throw new CommandStructureException("Macro command requires a parameter (Macro file)"); - continue; + break; - case "-EJECT": + case "EJECT": if (args.Length > index + 1) CopyDataWM.SendCopyDataMessage(Common.CmdPrefixEject + args[++index]); else throw new CommandStructureException("Eject command requires a parameter (Drive)"); - continue; + break; - case "-SHUTDOWN": + case "SHUTDOWN": CopyDataWM.SendCopyDataMessage(Common.CmdPrefixShutdown); - continue; + break; - case "-REBOOT": + case "REBOOT": CopyDataWM.SendCopyDataMessage(Common.CmdPrefixReboot); - continue; + break; - case "-STANDBY": + case "STANDBY": CopyDataWM.SendCopyDataMessage(Common.CmdPrefixStandby); - continue; + break; - case "-HIBERNATE": + case "HIBERNATE": CopyDataWM.SendCopyDataMessage(Common.CmdPrefixHibernate); - continue; + break; - case "-LOGOFF": + case "LOGOFF": CopyDataWM.SendCopyDataMessage(Common.CmdPrefixLogOff); - continue; + break; - case "-OSD": + case "OSD": CopyDataWM.SendCopyDataMessage(Common.CmdPrefixTranslator); - continue; + break; - case "-CHANNEL": + case "CHANNEL": + if (args.Length > index + 4) { - if (args.Length > index + 3) - { - string channel = args[++index]; - int padding = int.Parse(args[++index]); - string port = args[++index]; + string channel = args[++index]; + int padding = int.Parse(args[++index]); + string port = args[++index]; + int delay = int.Parse(args[++index]); - while (channel.Length < padding) - channel = '0' + channel; + while (channel.Length < padding) + channel = '0' + channel; - foreach (char digit in channel) - CopyDataWM.SendCopyDataMessage(Common.CmdPrefixBlast + digit + '|' + port); - } - else + foreach (char digit in channel) { - throw new CommandStructureException("Channel command requires three parameters (Channel, Padding, Port)"); + CopyDataWM.SendCopyDataMessage(Common.CmdPrefixBlast + digit + '|' + port); + if (delay > 0) + Thread.Sleep(delay); } - - continue; } + else + { + throw new CommandStructureException("Channel command requires three parameters (Channel, Padding, Port, Delay)"); + } + break; - case "-CONFIG": + case "CONFIG": if (args.Length > index + 1) _configFile = args[++index]; else throw new CommandStructureException("Config command requires a parameter (Config file path)"); dontRun = false; - continue; + break; - //TODO: Add more command line options. + // TODO: Add more command line options. + + default: + throw new CommandStructureException(String.Format("Unrecognised command line parameter \"{0}\"", args[index])); } } @@ -447,18 +454,16 @@ _notifyIcon.ContextMenuStrip.Items.Add(launch); } - /* - string[] irList = Common.GetIRList(false); - if (irList.Length > 0) - { - ToolStripMenuItem irCommands = new ToolStripMenuItem("&IR Commands"); + //string[] irList = Common.GetIRList(false); + //if (irList.Length > 0) + //{ + // ToolStripMenuItem irCommands = new ToolStripMenuItem("&IR Commands"); - foreach (string irCommand in irList) - irCommands.DropDownItems.Add(irCommand, null, new EventHandler(ClickIrCommand)); + // foreach (string irCommand in irList) + // irCommands.DropDownItems.Add(irCommand, null, new EventHandler(ClickIrCommand)); - _notifyIcon.ContextMenuStrip.Items.Add(irCommands); - } - */ + // _notifyIcon.ContextMenuStrip.Items.Add(irCommands); + //} string[] macroList = IrssMacro.GetMacroList(Program.FolderMacros, false); if (macroList.Length > 0) @@ -853,7 +858,7 @@ int pid = Win32.GetForegroundWindowPID(); if (pid == -1) { - IrssLog.Debug("Failed to retreive foreground window process ID"); + IrssLog.Debug("Failed to retrieve foreground window process ID"); return null; } Modified: trunk/plugins/IR Server Suite/Applications/Tray Launcher/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Tray Launcher/Program.cs 2008-07-05 12:46:52 UTC (rev 1884) +++ trunk/plugins/IR Server Suite/Applications/Tray Launcher/Program.cs 2008-07-05 12:55:37 UTC (rev 1885) @@ -8,6 +8,9 @@ namespace TrayLauncher { + /// <summary> + /// Tray Launcher Program class. + /// </summary> static class Program { Modified: trunk/plugins/IR Server Suite/Applications/Tray Launcher/Setup.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Tray Launcher/Setup.Designer.cs 2008-07-05 12:46:52 UTC (rev 1884) +++ trunk/plugins/IR Server Suite/Applications/Tray Launcher/Setup.Designer.cs 2008-07-05 12:55:37 UTC (rev 1885) @@ -39,6 +39,8 @@ this.buttonCancel = new System.Windows.Forms.Button(); this.checkBoxLaunchOnLoad = new System.Windows.Forms.CheckBox(); this.groupBoxOptions = new System.Windows.Forms.GroupBox(); + this.checkBoxRepeatsFocus = new System.Windows.Forms.CheckBox(); + this.checkBoxOneInstance = new System.Windows.Forms.CheckBox(); this.toolTip = new System.Windows.Forms.ToolTip(this.components); this.buttonRemoteButton = new System.Windows.Forms.Button(); this.groupBoxServerHost = new System.Windows.Forms.GroupBox(); @@ -96,7 +98,7 @@ // buttonOK // this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonOK.Location = new System.Drawing.Point(152, 192); + this.buttonOK.Location = new System.Drawing.Point(152, 224); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(56, 24); this.buttonOK.TabIndex = 4; @@ -108,7 +110,7 @@ // this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.buttonCancel.Location = new System.Drawing.Point(216, 192); + this.buttonCancel.Location = new System.Drawing.Point(216, 224); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(56, 24); this.buttonCancel.TabIndex = 5; @@ -130,19 +132,46 @@ // this.groupBoxOptions.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxOptions.Controls.Add(this.checkBoxRepeatsFocus); + this.groupBoxOptions.Controls.Add(this.checkBoxOneInstance); this.groupBoxOptions.Controls.Add(this.checkBoxAuto); this.groupBoxOptions.Controls.Add(this.checkBoxLaunchOnLoad); this.groupBoxOptions.Location = new System.Drawing.Point(8, 136); this.groupBoxOptions.Name = "groupBoxOptions"; - this.groupBoxOptions.Size = new System.Drawing.Size(264, 48); + this.groupBoxOptions.Size = new System.Drawing.Size(264, 80); this.groupBoxOptions.TabIndex = 2; this.groupBoxOptions.TabStop = false; this.groupBoxOptions.Text = "Options"; // + // checkBoxRepeatsFocus + // + this.checkBoxRepeatsFocus.Enabled = false; + this.checkBoxRepeatsFocus.Location = new System.Drawing.Point(136, 48); + this.checkBoxRepeatsFocus.Name = "checkBoxRepeatsFocus"; + this.checkBoxRepeatsFocus.Size = new System.Drawing.Size(120, 24); + this.checkBoxRepeatsFocus.TabIndex = 3; + this.checkBoxRepeatsFocus.Text = "Repeats focus"; + this.toolTip.SetToolTip(this.checkBoxRepeatsFocus, "With the target application running if the trigger button is pressed then give it" + + " focus"); + this.checkBoxRepeatsFocus.UseVisualStyleBackColor = true; + // + // checkBoxOneInstance + // + this.checkBoxOneInstance.Checked = true; + this.checkBoxOneInstance.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkBoxOneInstance.Location = new System.Drawing.Point(8, 48); + this.checkBoxOneInstance.Name = "checkBoxOneInstance"; + this.checkBoxOneInstance.Size = new System.Drawing.Size(120, 24); + this.checkBoxOneInstance.TabIndex = 2; + this.checkBoxOneInstance.Text = "One instance only"; + this.toolTip.SetToolTip(this.checkBoxOneInstance, "Don\'t start more than one instance of the target application"); + this.checkBoxOneInstance.UseVisualStyleBackColor = true; + this.checkBoxOneInstance.CheckedChanged += new System.EventHandler(this.checkBoxOneInstance_CheckedChanged); + // // buttonRemoteButton // this.buttonRemoteButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.buttonRemoteButton.Location = new System.Drawing.Point(8, 192); + this.buttonRemoteButton.Location = new System.Drawing.Point(8, 224); this.buttonRemoteButton.Name = "buttonRemoteButton"; this.buttonRemoteButton.Size = new System.Drawing.Size(96, 24); this.buttonRemoteButton.TabIndex = 3; @@ -181,7 +210,7 @@ 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(280, 224); + this.ClientSize = new System.Drawing.Size(280, 256); this.Controls.Add(this.buttonRemoteButton); this.Controls.Add(this.groupBoxServerHost); this.Controls.Add(this.groupBoxOptions); @@ -217,5 +246,7 @@ private System.Windows.Forms.GroupBox groupBoxServerHost; private System.Windows.Forms.Button buttonRemoteButton; private System.Windows.Forms.ComboBox comboBoxComputer; + private System.Windows.Forms.CheckBox checkBoxOneInstance; + private System.Windows.Forms.CheckBox checkBoxRepeatsFocus; } } \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Applications/Tray Launcher/Setup.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Tray Launcher/Setup.cs 2008-07-05 12:46:52 UTC (rev 1884) +++ trunk/plugins/IR Server Suite/Applications/Tray Launcher/Setup.cs 2008-07-05 12:55:37 UTC (rev 1885) @@ -45,6 +45,16 @@ get { return checkBoxLaunchOnLoad.Checked; } set { checkBoxLaunchOnLoad.Checked = value; } } + public bool OneInstanceOnly + { + get { return checkBoxOneInstance.Checked; } + set { checkBoxOneInstance.Checked = value; } + } + public bool RepeatsFocus + { + get { return checkBoxRepeatsFocus.Checked; } + set { checkBoxRepeatsFocus.Checked = value; } + } public string LaunchKeyCode { get { return _launchKeyCode; } @@ -114,6 +124,11 @@ _launchKeyCode = keyCode; } + private void checkBoxOneInstance_CheckedChanged(object sender, EventArgs e) + { + checkBoxRepeatsFocus.Enabled = checkBoxOneInstance.Checked; + } + } } Modified: trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray Launcher.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray Launcher.csproj 2008-07-05 12:46:52 UTC (rev 1884) +++ trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray Launcher.csproj 2008-07-05 12:55:37 UTC (rev 1885) @@ -16,7 +16,7 @@ <AssemblyOriginatorKeyFile>..\..\IR Server Suite.snk</AssemblyOriginatorKeyFile> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> - <DebugSymbols>false</DebugSymbols> + <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>bin\Debug\</OutputPath> Modified: trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs 2008-07-05 12:46:52 UTC (rev 1884) +++ trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs 2008-07-05 12:55:37 UTC (rev 1885) @@ -26,6 +26,8 @@ static readonly string ConfigurationFile = Path.Combine(Common.FolderAppData, "Tray Launcher\\Tray Launcher.xml"); + const string ProcessCommandThreadName = "ProcessCommand"; + #endregion Constants #region Variables @@ -40,6 +42,8 @@ string _programFile; bool _autoRun; bool _launchOnLoad; + bool _oneInstanceOnly; + bool _repeatsFocus; string _launchKeyCode; Container _container; @@ -139,7 +143,7 @@ _notifyIcon.Visible = true; if (!didSetup && _launchOnLoad) - ClickLaunch(null, null); + Launch(); return true; } @@ -188,28 +192,33 @@ _autoRun = false; } + XmlDocument doc = new XmlDocument(); + try { - XmlDocument doc = new XmlDocument(); doc.Load(ConfigurationFile); - - _serverHost = doc.DocumentElement.Attributes["ServerHost"].Value; - _programFile = doc.DocumentElement.Attributes["ProgramFile"].Value; - _launchOnLoad = bool.Parse(doc.DocumentElement.Attributes["LaunchOnLoad"].Value); - _launchKeyCode = doc.DocumentElement.Attributes["LaunchKeyCode"].Value; } catch (FileNotFoundException) { IrssLog.Warn("Configuration file not found, using defaults"); CreateDefaultSettings(); + return; } catch (Exception ex) { IrssLog.Error(ex); CreateDefaultSettings(); + return; } + + try { _serverHost = doc.DocumentElement.Attributes["ServerHost"].Value; } catch { _serverHost = "localhost"; } + try { _programFile = doc.DocumentElement.Attributes["ProgramFile"].Value; } catch { _programFile = String.Empty; } + try { _launchOnLoad = bool.Parse(doc.DocumentElement.Attributes["LaunchOnLoad"].Value); } catch { _launchOnLoad = false; } + try { _oneInstanceOnly = bool.Parse(doc.DocumentElement.Attributes["OneInstanceOnly"].Value); } catch { _oneInstanceOnly = true; } + try { _repeatsFocus = bool.Parse(doc.DocumentElement.Attributes["RepeatsFocus"].Value); } catch { _repeatsFocus = true; } + try { _launchKeyCode = doc.DocumentElement.Attributes["LaunchKeyCode"].Value; } catch { _launchKeyCode = "Start"; } } void SaveSettings() { @@ -235,10 +244,12 @@ writer.WriteStartDocument(true); writer.WriteStartElement("settings"); // <settings> - writer.WriteAttributeString("ServerHost", _serverHost); - writer.WriteAttributeString("ProgramFile", _programFile); - writer.WriteAttributeString("LaunchOnLoad", _launchOnLoad.ToString()); - writer.WriteAttributeString("LaunchKeyCode", _launchKeyCode); + writer.WriteAttributeString("ServerHost", _serverHost); + writer.WriteAttributeString("ProgramFile", _programFile); + writer.WriteAttributeString("LaunchOnLoad", _launchOnLoad.ToString()); + writer.WriteAttributeString("OneInstanceOnly", _oneInstanceOnly.ToString()); + writer.WriteAttributeString("RepeatsFocus", _repeatsFocus.ToString()); + writer.WriteAttributeString("LaunchKeyCode", _launchKeyCode); writer.WriteEndElement(); // </settings> writer.WriteEndDocument(); @@ -251,10 +262,12 @@ } void CreateDefaultSettings() { - _serverHost = "localhost"; - _programFile = String.Empty; - _launchOnLoad = false; - _launchKeyCode = "Start"; + _serverHost = "localhost"; + _programFile = String.Empty; + _launchOnLoad = false; + _oneInstanceOnly = true; + _repeatsFocus = true; + _launchKeyCode = "Start"; SaveSettings(); } @@ -380,7 +393,7 @@ IrssLog.Info("Remote Event: {0}", keyCode); if (keyCode.Equals(_launchKeyCode, StringComparison.Ordinal)) - ClickLaunch(null, null); + Launch(); } bool Configure() @@ -428,37 +441,69 @@ { IrssLog.Info("Launch"); + Launch(); + } + void ClickQuit(object sender, EventArgs e) + { + IrssLog.Info("Quit"); + if (_inConfiguration) { IrssLog.Info("In Configuration"); return; } + Stop(); + + Application.Exit(); + } + + void Launch() + { + if (_inConfiguration) + { + IrssLog.Info("Can't launch target application, in Configuration"); + return; + } + try { // Check for multiple instances - foreach (Process process in Process.GetProcesses()) + if (_oneInstanceOnly) { - try + foreach (Process process in Process.GetProcesses()) { - if (Path.GetFileName(process.MainModule.ModuleName).Equals(Path.GetFileName(_programFile), StringComparison.OrdinalIgnoreCase)) + try { - IrssLog.Info("Program already running."); - return; + if (Path.GetFileName(process.MainModule.ModuleName).Equals(Path.GetFileName(_programFile), StringComparison.OrdinalIgnoreCase)) + { + IrssLog.Info("Can't launch target application, program already running"); + if (_repeatsFocus) + { + IrssLog.Info("Attempting to give focus to target application ..."); + + FocusForcer forcer = new FocusForcer(process.Id); + forcer.ForceOnce(); + } + return; + } } - } - catch (Win32Exception ex) - { - if (ex.ErrorCode != -2147467259) // Ignore "Unable to enumerate the process modules" errors. + catch (Win32Exception ex) + { + if (ex.ErrorCode != -2147467259) // Ignore "Unable to enumerate the process modules" errors. + IrssLog.Error(ex); + } + catch (Exception ex) + { IrssLog.Error(ex); + } } - catch (Exception ex) - { - IrssLog.Error(ex); - } } - string[] launchCommand = new string[] { + IrssLog.Info("Launching \"{0}\" ...", _programFile); + + string[] launchCommand = new string[] + { _programFile, Path.GetDirectoryName(_programFile), String.Empty, @@ -466,7 +511,7 @@ false.ToString(), true.ToString(), false.ToString(), - true.ToString() + true.ToString() }; Common.ProcessRunCommand(launchCommand); @@ -477,21 +522,7 @@ MessageBox.Show(ex.Message, "Tray Launcher", MessageBoxButtons.OK, MessageBoxIcon.Error); } } - void ClickQuit(object sender, EventArgs e) - { - IrssLog.Info("Quit"); - if (_inConfiguration) - { - IrssLog.Info("In Configuration"); - return; - } - - Stop(); - - Application.Exit(); - } - #endregion Implementation } Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs 2008-07-05 12:46:52 UTC (rev 1884) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs 2008-07-05 12:55:37 UTC (rev 1885) @@ -107,7 +107,7 @@ if (args.Length > 0) // Command Line Start ... { - List<String> virtualButtons = new List<string>(); + List<string> virtualButtons = new List<string>(); try { @@ -148,7 +148,7 @@ if (_registered) { - foreach (String button in virtualButtons) + foreach (string button in virtualButtons) { if (button.StartsWith("~", StringComparison.OrdinalIgnoreCase)) { Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/FocusForcer.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/FocusForcer.cs 2008-07-05 12:46:52 UTC (rev 1884) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/FocusForcer.cs 2008-07-05 12:55:37 UTC (rev 1885) @@ -36,6 +36,38 @@ #region Public Methods + public bool ForceOnce() + { + Process process = Process.GetProcessById(_processId); + if (process == null || process.HasExited) + throw new InvalidOperationException("Cannot force focus, process is not running"); + + _waitHandle = new AutoResetEvent(false); + + try + { + Win32.EnumWindowsProc ewc = new Win32.EnumWindowsProc(CheckWindow); + + int focusedId = Win32.GetForegroundWindowPID(); + if (focusedId != _processId) + { + _windowHandle = IntPtr.Zero; + Win32.EnumerateWindows(ewc, IntPtr.Zero); + + bool waitResult = _waitHandle.WaitOne(5000, false); + if (waitResult && _windowHandle != IntPtr.Zero) + return Win32.SetForegroundWindow(_windowHandle, true); + } + } + finally + { + _waitHandle.Close(); + _waitHandle = null; + } + + return false; + } + /// <summary> /// Forces the process into focus (once). /// </summary> @@ -64,8 +96,7 @@ Win32.EnumerateWindows(ewc, IntPtr.Zero); bool waitResult = _waitHandle.WaitOne(5000, false); - - if (_windowHandle != IntPtr.Zero) + if (waitResult && _windowHandle != IntPtr.Zero) return Win32.SetForegroundWindow(_windowHandle, true); } Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Win32.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Win32.cs 2008-07-05 12:46:52 UTC (rev 1884) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Win32.cs 2008-07-05 12:55:37 UTC (rev 1885) @@ -2250,7 +2250,6 @@ Trace.WriteLine("SetForegroundWindow: Done"); #endif - // We've done all that we can so base our return value on whether we have succeeded or not return (GetForegroundWindow() == hWnd); } Modified: trunk/plugins/IR Server Suite/Documentation/Translator/index.html =================================================================== --- trunk/plugins/IR Server Suite/Documentation/Translator/index.html 2008-07-05 12:46:52 UTC (rev 1884) +++ trunk/plugins/IR Server Suite/Documentation/Translator/index.html 2008-07-05 12:55:37 UTC (rev 1885) @@ -19,7 +19,7 @@ Execute the given macro.</LI> <BR> <LI>-eject [Drive]<BR> -Eject the supplied optical drive.</LI> +Eject the optical drive specified.</LI> <BR> <LI>-shutdown<BR> Request a system shutdown.</LI> @@ -39,12 +39,16 @@ <LI>-osd<BR> Display the Translator On-Screen Display.</LI> <BR> -<LI>-channel [Number] [Padding] [Port]<BR> +<LI>-channel [Number] [Padding] [Port] [Delay]<BR> Blast a series of IR Commands contained within the given channel number.<BR> Use the padding value to specify the minimum size of the channel number.<BR> +You can specify a delay (in milliseconds) between each channel digit.<BR> All blasting will be performed on the specified port.</LI> +<BR> +<LI>-config [Config File]<BR> +Use a specific configuration file.</LI> </UL> -Translator must already be running for command line parameters to be acted on.</P> +Translator must already be running for command line parameters to be acted on (except -config).</P> <IMG SRC="programs.png"> Modified: trunk/plugins/IR Server Suite/Documentation/irblast.html =================================================================== --- trunk/plugins/IR Server Suite/Documentation/irblast.html 2008-07-05 12:46:52 UTC (rev 1884) +++ trunk/plugins/IR Server Suite/Documentation/irblast.html 2008-07-05 12:55:37 UTC (rev 1885) @@ -14,6 +14,7 @@ Use -host to specify the computer that is hosting the IR Server.<BR> Use -port to blast to a particular blaster port (optional).<BR> Use -channel to tell IR Blast to break apart the following IR Command and use each digit for a separate IR blast (optional).<BR> +Use -delay to specify a time to delay between each command or digit in a channel number (Optional).<BR> Use -pad to tell IR Blast to pad channel numbers to a certain length (Optional, Requires -channel).<BR> Use a tilde ~ between commands to insert half second pauses.</P> Modified: trunk/plugins/IR Server Suite/Documentation/new.html =================================================================== --- trunk/plugins/IR Server Suite/Documentation/new.html 2008-07-05 12:46:52 UTC (rev 1884) +++ trunk/plugins/IR Server Suite/Documentation/new.html 2008-07-05 12:55:37 UTC (rev 1885) @@ -28,7 +28,6 @@ <LI>TV3 Blaster Plugin: Fixed a fatal error.</LI> <LI>General: Anywhere that previously took user input for a command and could include escape codes can now also include Environment Variables (including clipboard contents, date, time, and others). See documentation for more info.</LI> <LI>IR Blast: Now defaults to "localhost" if no host is specified on the command line (this will make it simpler to use on most setups).</LI> -<LI>IR Blast: Now has a default delay between blasts of 50 milliseconds, this can be customized by the command line parameter "-delay x", where x is a delay in milliseconds (0 for no delay).</LI> <LI>MP Control plugin: Multi-Mapping command can now jump to a specific mapping set (or "Toggle").</LI> <LI>MediaPortal plugins: New macro commands (Send MP Action and Send MP Message).</LI> <LI>Translator: Can create a shortcut on the users desktop to launch a macro.</LI> @@ -78,6 +77,11 @@ <LI>Input Service: Now enables "Interact with desktop" setting for service, this should get MCE Replacement Driver users the ability to use the Remote Keyboard properly.</LI> <LI>New Input Plugin: Pinnacle Serial Receiver is now supported.</LI> <LI>MP Control Plugin: Fixed remote mapping bug (in plugin configuration).</LI> +<LI>iMon Plugin: Better support for iMon PAD remote when using Abstract Remote Model (thanks to chemelli).</LI> +<LI>Lirc/WinLirc Plugin: Improved support for Lirc/WinLirc (thanks to zaphman). All WinLirc users please test.</LI> +<LI>IR Blast: Corrected documentation and command line help.</LI> +<LI>Translator: Changed "-channel" command line parameter to have four parameters (Channel, Padding, Port, Delay).</LI> +<LI>IR Blast: Now has a default delay between blasts of 250 milliseconds, this can be customized by the command line parameter "-delay x", where x is a delay in milliseconds (0 for no delay).</LI> </UL></P> <BR> Modified: trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/iMon/Imon PAD.xml =================================================================== --- trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/iMon/Imon PAD.xml 2008-07-05 12:46:52 UTC (rev 1884) +++ trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/iMon/Imon PAD.xml 2008-07-05 12:55:37 UTC (rev 1885) @@ -1,5 +1,19 @@ <?xml version="1.0" standalone="yes"?> <DocumentElement> + <RemoteTable RawCode="1002" AbstractButton="Power" /> + <RemoteTable RawCode="1016" AbstractButton="Power2" /> + <RemoteTable RawCode="1064" AbstractButton="Record" /> + <RemoteTable RawCode="1128" AbstractButton="Play" /> + <RemoteTable RawCode="1114" AbstractButton="Eject" /> + <RemoteTable RawCode="1130" AbstractButton="Rewind" /> + <RemoteTable RawCode="1144" AbstractButton="Pause" /> + <RemoteTable RawCode="1192" AbstractButton="FastForward" /> + <RemoteTable RawCode="1208" AbstractButton="NextChapter" /> + <RemoteTable RawCode="1220" AbstractButton="Stop" /> + <RemoteTable RawCode="1066" AbstractButton="PreviousChapter" /> + + <RemoteTable RawCode="1032" AbstractButton="Clear" /> + <RemoteTable RawCode="1148" AbstractButton="OK" /> <RemoteTable RawCode="1038" AbstractButton="VolumeUp" /> <RemoteTable RawCode="1042" AbstractButton="VolumeDown" /> @@ -18,17 +32,6 @@ <RemoteTable RawCode="1214" AbstractButton="Number7" /> <RemoteTable RawCode="1136" AbstractButton="Number8" /> <RemoteTable RawCode="1160" AbstractButton="Number9" /> - <RemoteTable RawCode="1128" AbstractButton="Play" /> - <RemoteTable RawCode="1144" AbstractButton="Pause" /> - <RemoteTable RawCode="1220" AbstractButton="Stop" /> - <RemoteTable RawCode="1192" AbstractButton="FastForward" /> - <RemoteTable RawCode="1130" AbstractButton="Rewind" /> - <RemoteTable RawCode="1064" AbstractButton="Record" /> - <RemoteTable RawCode="1066" AbstractButton="NextChapter" /> - <RemoteTable RawCode="1208" AbstractButton="PreviousChapter" /> - <RemoteTable RawCode="1002" AbstractButton="Power" /> - <RemoteTable RawCode="1016" AbstractButton="Power2" /> - <RemoteTable RawCode="1252" AbstractButton="Clear" /> <RemoteTable RawCode="1034" AbstractButton="Enter" /> <RemoteTable RawCode="1096" AbstractButton="Hash" /> <RemoteTable RawCode="1056" AbstractButton="Star" /> @@ -47,6 +50,5 @@ <RemoteTable RawCode="1230" AbstractButton="Menu" /> <RemoteTable RawCode="1124" AbstractButton="Teletext" /> <RemoteTable RawCode="1198" AbstractButton="Guide" /> - <RemoteTable RawCode="1114" AbstractButton="Eject" /> <RemoteTable RawCode="1150" AbstractButton="Home" /> </DocumentElement> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |