From: <an...@us...> - 2008-02-24 07:08:50
|
Revision: 1393 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1393&view=rev Author: and-81 Date: 2008-02-23 23:08:47 -0800 (Sat, 23 Feb 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Microsoft MCE Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/RC102 Receiver/RC102Receiver.cs trunk/plugins/IR Server Suite/IR Server Suite.sln trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs trunk/plugins/MCEReplacement/MCEReplacement.cs Added Paths: ----------- trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/ trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/IR501 Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/IR501Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/Properties/ trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/ trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507 Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/Properties/ trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/Properties/AssemblyInfo.cs Added: trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/IR501 Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/IR501 Receiver.csproj (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/IR501 Receiver.csproj 2008-02-24 07:08:47 UTC (rev 1393) @@ -0,0 +1,59 @@ +<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>{C7BF555E-638F-4E1B-9D5A-D2D226C77676}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>InputService.Plugin</RootNamespace> + <AssemblyName>IR501 Receiver</AssemblyName> + <ApplicationIcon>Icon.ico</ApplicationIcon> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <DocumentationFile>bin\Debug\IR501 Receiver.XML</DocumentationFile> + <UseVSHostingProcess>false</UseVSHostingProcess> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + </ItemGroup> + <ItemGroup> + <Compile Include="IR501Receiver.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </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> + --> +</Project> \ No newline at end of file Added: trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/IR501Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/IR501Receiver.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/IR501Receiver.cs 2008-02-24 07:08:47 UTC (rev 1393) @@ -0,0 +1,379 @@ +using System; +using System.ComponentModel; +#if TRACE +using System.Diagnostics; +#endif +using System.IO; +using System.Runtime.InteropServices; + +using Microsoft.Win32.SafeHandles; + +namespace InputService.Plugin +{ + + /// <summary> + /// IR Server Plugin for the IR501 IR receiver. + /// </summary> + [CLSCompliant(false)] + public class IR501Receiver : PluginBase, IRemoteReceiver + { + + #region Interop + + [DllImport("kernel32", SetLastError = true, CharSet = CharSet.Auto)] + static extern SafeFileHandle CreateFile( + String fileName, + [MarshalAs(UnmanagedType.U4)] FileAccess fileAccess, + [MarshalAs(UnmanagedType.U4)] FileShare fileShare, + IntPtr securityAttributes, + [MarshalAs(UnmanagedType.U4)] FileMode creationDisposition, + [MarshalAs(UnmanagedType.U4)] EFileAttributes flags, + IntPtr template); + + [Flags] + enum EFileAttributes : uint + { + Readonly = 0x00000001, + Hidden = 0x00000002, + System = 0x00000004, + Directory = 0x00000010, + Archive = 0x00000020, + Device = 0x00000040, + Normal = 0x00000080, + Temporary = 0x00000100, + SparseFile = 0x00000200, + ReparsePoint = 0x00000400, + Compressed = 0x00000800, + Offline = 0x00001000, + NotContentIndexed = 0x00002000, + Encrypted = 0x00004000, + Write_Through = 0x80000000, + Overlapped = 0x40000000, + NoBuffering = 0x20000000, + RandomAccess = 0x10000000, + SequentialScan = 0x08000000, + DeleteOnClose = 0x04000000, + BackupSemantics = 0x02000000, + PosixSemantics = 0x01000000, + OpenReparsePoint = 0x00200000, + OpenNoRecall = 0x00100000, + FirstPipeInstance = 0x00080000, + } + + [StructLayout(LayoutKind.Sequential)] + struct DeviceInfoData + { + public int Size; + public Guid Class; + public uint DevInst; + public IntPtr Reserved; + } + + [StructLayout(LayoutKind.Sequential)] + struct DeviceInterfaceData + { + public int Size; + public Guid Class; + public uint Flags; + public uint Reserved; + } + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] + struct DeviceInterfaceDetailData + { + public int Size; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] + public string DevicePath; + } + + [DllImport("hid")] + static extern void HidD_GetHidGuid( + ref Guid guid); + + [DllImport("setupapi", CharSet = CharSet.Auto)] + static extern IntPtr SetupDiGetClassDevs( + ref Guid ClassGuid, + [MarshalAs(UnmanagedType.LPTStr)] string Enumerator, + IntPtr hwndParent, + UInt32 Flags); + + [DllImport("setupapi", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool SetupDiEnumDeviceInfo( + IntPtr handle, + int Index, + ref DeviceInfoData deviceInfoData); + + [DllImport("setupapi", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool SetupDiEnumDeviceInterfaces( + IntPtr handle, + ref DeviceInfoData deviceInfoData, + ref Guid guidClass, + int MemberIndex, + ref DeviceInterfaceData deviceInterfaceData); + + [DllImport("setupapi", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool SetupDiGetDeviceInterfaceDetail( + IntPtr handle, + ref DeviceInterfaceData deviceInterfaceData, + IntPtr unused1, + int unused2, + ref uint requiredSize, + IntPtr unused3); + + [DllImport("setupapi", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool SetupDiGetDeviceInterfaceDetail( + IntPtr handle, + ref DeviceInterfaceData deviceInterfaceData, + ref DeviceInterfaceDetailData deviceInterfaceDetailData, + uint detailSize, + IntPtr unused1, + IntPtr unused2); + + [DllImport("setupapi")] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool SetupDiDestroyDeviceInfoList(IntPtr handle); + + #endregion Interop + + #region Constants + + const int DeviceBufferSize = 4; + + const string DeviceID = "vid_147a&pid_e001"; + + #endregion Constants + + #region Variables + + RemoteHandler _remoteButtonHandler; + + FileStream _deviceStream; + byte[] _deviceBuffer; + + int _lastCode = -1; + 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 "IR501"; } } + /// <summary> + /// IR Server plugin version. + /// </summary> + /// <value>The version.</value> + public override string Version { get { return "1.0.4.2"; } } + /// <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 "Support for the IR501 IR Receiver"; } } + + /// <summary> + /// Detect the presence of this device. Devices that cannot be detected will always return false. + /// </summary> + /// <returns> + /// <c>true</c> if the device is present, otherwise <c>false</c>. + /// </returns> + public override bool Detect() + { + try + { + Guid guid = new Guid(); + HidD_GetHidGuid(ref guid); + + string devicePath = FindDevice(guid); + + return (devicePath != null); + } + catch + { + return false; + } + } + + /// <summary> + /// Start the IR Server plugin. + /// </summary> + public override void Start() + { + Guid guid = new Guid(); + HidD_GetHidGuid(ref guid); + + string devicePath = FindDevice(guid); + if (String.IsNullOrEmpty(devicePath)) + throw new ApplicationException("Device not found"); + + SafeFileHandle deviceHandle = CreateFile(devicePath, FileAccess.Read, FileShare.ReadWrite, IntPtr.Zero, FileMode.Open, EFileAttributes.Overlapped, IntPtr.Zero); + int lastError = Marshal.GetLastWin32Error(); + + if (deviceHandle.IsInvalid) + throw new Win32Exception(lastError, "Failed to open device"); + + //_deviceWatcher.RegisterDeviceRemoval(deviceHandle); + + _deviceBuffer = new byte[DeviceBufferSize]; + _deviceStream = new FileStream(deviceHandle, FileAccess.Read, _deviceBuffer.Length, true); + _deviceStream.BeginRead(_deviceBuffer, 0, _deviceBuffer.Length, new AsyncCallback(OnReadComplete), null); + } + /// <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 (_deviceStream == null) + return; + + try + { + _deviceStream.Dispose(); + } + catch (IOException) + { + // we are closing the stream so ignore this + } + finally + { + _deviceStream = null; + } + } + + /// <summary> + /// Callback for remote button presses. + /// </summary> + /// <value>The remote callback.</value> + public RemoteHandler RemoteCallback + { + get { return _remoteButtonHandler; } + set { _remoteButtonHandler = value; } + } + + static string FindDevice(Guid classGuid) + { + int lastError; + + // 0x12 = DIGCF_PRESENT | DIGCF_DEVICEINTERFACE + IntPtr handle = SetupDiGetClassDevs(ref classGuid, "", IntPtr.Zero, 0x12); + lastError = Marshal.GetLastWin32Error(); + + if (handle.ToInt32() == -1) + throw new Win32Exception(lastError); + + string devicePath = null; + + for (int deviceIndex = 0; ; deviceIndex++) + { + DeviceInfoData deviceInfoData = new DeviceInfoData(); + deviceInfoData.Size = Marshal.SizeOf(deviceInfoData); + + if (SetupDiEnumDeviceInfo(handle, deviceIndex, ref deviceInfoData) == false) + { + // out of devices or do we have an error? + lastError = Marshal.GetLastWin32Error(); + if (lastError != 0x0103 && lastError != 0x007E) + { + SetupDiDestroyDeviceInfoList(handle); + throw new Win32Exception(Marshal.GetLastWin32Error()); + } + + SetupDiDestroyDeviceInfoList(handle); + break; + } + + DeviceInterfaceData deviceInterfaceData = new DeviceInterfaceData(); + deviceInterfaceData.Size = Marshal.SizeOf(deviceInterfaceData); + + if (SetupDiEnumDeviceInterfaces(handle, ref deviceInfoData, ref classGuid, 0, ref deviceInterfaceData) == false) + { + SetupDiDestroyDeviceInfoList(handle); + throw new Win32Exception(Marshal.GetLastWin32Error()); + } + + uint cbData = 0; + + if (SetupDiGetDeviceInterfaceDetail(handle, ref deviceInterfaceData, IntPtr.Zero, 0, ref cbData, IntPtr.Zero) == false && cbData == 0) + { + SetupDiDestroyDeviceInfoList(handle); + throw new Win32Exception(Marshal.GetLastWin32Error()); + } + + DeviceInterfaceDetailData deviceInterfaceDetailData = new DeviceInterfaceDetailData(); + deviceInterfaceDetailData.Size = 5; + + if (SetupDiGetDeviceInterfaceDetail(handle, ref deviceInterfaceData, ref deviceInterfaceDetailData, cbData, IntPtr.Zero, IntPtr.Zero) == false) + { + SetupDiDestroyDeviceInfoList(handle); + throw new Win32Exception(Marshal.GetLastWin32Error()); + } + + if (deviceInterfaceDetailData.DevicePath.IndexOf(DeviceID, StringComparison.InvariantCultureIgnoreCase) != -1) + { + SetupDiDestroyDeviceInfoList(handle); + devicePath = deviceInterfaceDetailData.DevicePath; + break; + } + } + + return devicePath; + } + + void OnReadComplete(IAsyncResult asyncResult) + { + try + { + if (_deviceStream.EndRead(asyncResult) == DeviceBufferSize && _deviceBuffer[1] == 0) + { + TimeSpan timeSpan = DateTime.Now - _lastCodeTime; + + int keyCode = (int)_deviceBuffer[2]; + + if (keyCode != _lastCode || timeSpan.Milliseconds > 250) + { + if (_remoteButtonHandler != null) + _remoteButtonHandler(keyCode.ToString()); + + _lastCodeTime = DateTime.Now; + } + + _lastCode = keyCode; + } + + _deviceStream.BeginRead(_deviceBuffer, 0, _deviceBuffer.Length, new AsyncCallback(OnReadComplete), null); + } + catch (Exception) + { + } + } + + #endregion Implementation + + } + +} Added: trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/Icon.ico =================================================================== (Binary files differ) Property changes on: trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/Icon.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/Properties/AssemblyInfo.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR501 Receiver/Properties/AssemblyInfo.cs 2008-02-24 07:08:47 UTC (rev 1393) @@ -0,0 +1,39 @@ +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Security.Permissions; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("IR501 Receiver")] +[assembly: AssemblyDescription("Support for the IR501 IR receiver")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("and-81")] +[assembly: AssemblyProduct("IR501 Receiver")] +[assembly: AssemblyCopyright("Aaron Dinnage")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.4.2")] +[assembly: AssemblyFileVersion("1.0.4.2")] + +[assembly: CLSCompliant(true)] +[assembly: Guid("733bd6d4-9188-4f52-9bc4-9cc03deaef17")] + +[assembly: SecurityPermission(SecurityAction.RequestMinimum, UnmanagedCode = true)] Added: trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507 Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507 Receiver.csproj (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507 Receiver.csproj 2008-02-24 07:08:47 UTC (rev 1393) @@ -0,0 +1,59 @@ +<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>{1DD4B652-DBF4-47E2-B46C-C810EEE3B7C3}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>InputService.Plugin</RootNamespace> + <AssemblyName>IR507 Receiver</AssemblyName> + <ApplicationIcon>Icon.ico</ApplicationIcon> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <DocumentationFile>bin\Debug\IR507 Receiver.XML</DocumentationFile> + <UseVSHostingProcess>false</UseVSHostingProcess> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + </ItemGroup> + <ItemGroup> + <Compile Include="IR507Receiver.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </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> + --> +</Project> \ No newline at end of file Added: trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507Receiver.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/IR507Receiver.cs 2008-02-24 07:08:47 UTC (rev 1393) @@ -0,0 +1,379 @@ +using System; +using System.ComponentModel; +#if TRACE +using System.Diagnostics; +#endif +using System.IO; +using System.Runtime.InteropServices; + +using Microsoft.Win32.SafeHandles; + +namespace InputService.Plugin +{ + + /// <summary> + /// IR Server Plugin for the IR507 IR receiver. + /// </summary> + [CLSCompliant(false)] + public class IR507Receiver : PluginBase, IRemoteReceiver + { + + #region Interop + + [DllImport("kernel32", SetLastError = true, CharSet = CharSet.Auto)] + static extern SafeFileHandle CreateFile( + String fileName, + [MarshalAs(UnmanagedType.U4)] FileAccess fileAccess, + [MarshalAs(UnmanagedType.U4)] FileShare fileShare, + IntPtr securityAttributes, + [MarshalAs(UnmanagedType.U4)] FileMode creationDisposition, + [MarshalAs(UnmanagedType.U4)] EFileAttributes flags, + IntPtr template); + + [Flags] + enum EFileAttributes : uint + { + Readonly = 0x00000001, + Hidden = 0x00000002, + System = 0x00000004, + Directory = 0x00000010, + Archive = 0x00000020, + Device = 0x00000040, + Normal = 0x00000080, + Temporary = 0x00000100, + SparseFile = 0x00000200, + ReparsePoint = 0x00000400, + Compressed = 0x00000800, + Offline = 0x00001000, + NotContentIndexed = 0x00002000, + Encrypted = 0x00004000, + Write_Through = 0x80000000, + Overlapped = 0x40000000, + NoBuffering = 0x20000000, + RandomAccess = 0x10000000, + SequentialScan = 0x08000000, + DeleteOnClose = 0x04000000, + BackupSemantics = 0x02000000, + PosixSemantics = 0x01000000, + OpenReparsePoint = 0x00200000, + OpenNoRecall = 0x00100000, + FirstPipeInstance = 0x00080000, + } + + [StructLayout(LayoutKind.Sequential)] + struct DeviceInfoData + { + public int Size; + public Guid Class; + public uint DevInst; + public IntPtr Reserved; + } + + [StructLayout(LayoutKind.Sequential)] + struct DeviceInterfaceData + { + public int Size; + public Guid Class; + public uint Flags; + public uint Reserved; + } + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] + struct DeviceInterfaceDetailData + { + public int Size; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] + public string DevicePath; + } + + [DllImport("hid")] + static extern void HidD_GetHidGuid( + ref Guid guid); + + [DllImport("setupapi", CharSet = CharSet.Auto)] + static extern IntPtr SetupDiGetClassDevs( + ref Guid ClassGuid, + [MarshalAs(UnmanagedType.LPTStr)] string Enumerator, + IntPtr hwndParent, + UInt32 Flags); + + [DllImport("setupapi", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool SetupDiEnumDeviceInfo( + IntPtr handle, + int Index, + ref DeviceInfoData deviceInfoData); + + [DllImport("setupapi", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool SetupDiEnumDeviceInterfaces( + IntPtr handle, + ref DeviceInfoData deviceInfoData, + ref Guid guidClass, + int MemberIndex, + ref DeviceInterfaceData deviceInterfaceData); + + [DllImport("setupapi", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool SetupDiGetDeviceInterfaceDetail( + IntPtr handle, + ref DeviceInterfaceData deviceInterfaceData, + IntPtr unused1, + int unused2, + ref uint requiredSize, + IntPtr unused3); + + [DllImport("setupapi", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool SetupDiGetDeviceInterfaceDetail( + IntPtr handle, + ref DeviceInterfaceData deviceInterfaceData, + ref DeviceInterfaceDetailData deviceInterfaceDetailData, + uint detailSize, + IntPtr unused1, + IntPtr unused2); + + [DllImport("setupapi")] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool SetupDiDestroyDeviceInfoList(IntPtr handle); + + #endregion Interop + + #region Constants + + const int DeviceBufferSize = 4; + + const string DeviceID = "vid_0e6a&pid_6002"; + + #endregion Constants + + #region Variables + + RemoteHandler _remoteButtonHandler; + + FileStream _deviceStream; + byte[] _deviceBuffer; + + int _lastCode = -1; + 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 "IR507"; } } + /// <summary> + /// IR Server plugin version. + /// </summary> + /// <value>The version.</value> + public override string Version { get { return "1.0.4.2"; } } + /// <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 "Support for the IR507 IR Receiver"; } } + + /// <summary> + /// Detect the presence of this device. Devices that cannot be detected will always return false. + /// </summary> + /// <returns> + /// <c>true</c> if the device is present, otherwise <c>false</c>. + /// </returns> + public override bool Detect() + { + try + { + Guid guid = new Guid(); + HidD_GetHidGuid(ref guid); + + string devicePath = FindDevice(guid); + + return (devicePath != null); + } + catch + { + return false; + } + } + + /// <summary> + /// Start the IR Server plugin. + /// </summary> + public override void Start() + { + Guid guid = new Guid(); + HidD_GetHidGuid(ref guid); + + string devicePath = FindDevice(guid); + if (String.IsNullOrEmpty(devicePath)) + throw new ApplicationException("Device not found"); + + SafeFileHandle deviceHandle = CreateFile(devicePath, FileAccess.Read, FileShare.ReadWrite, IntPtr.Zero, FileMode.Open, EFileAttributes.Overlapped, IntPtr.Zero); + int lastError = Marshal.GetLastWin32Error(); + + if (deviceHandle.IsInvalid) + throw new Win32Exception(lastError, "Failed to open device"); + + //_deviceWatcher.RegisterDeviceRemoval(deviceHandle); + + _deviceBuffer = new byte[DeviceBufferSize]; + _deviceStream = new FileStream(deviceHandle, FileAccess.Read, _deviceBuffer.Length, true); + _deviceStream.BeginRead(_deviceBuffer, 0, _deviceBuffer.Length, new AsyncCallback(OnReadComplete), null); + } + /// <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 (_deviceStream == null) + return; + + try + { + _deviceStream.Dispose(); + } + catch (IOException) + { + // we are closing the stream so ignore this + } + finally + { + _deviceStream = null; + } + } + + /// <summary> + /// Callback for remote button presses. + /// </summary> + /// <value>The remote callback.</value> + public RemoteHandler RemoteCallback + { + get { return _remoteButtonHandler; } + set { _remoteButtonHandler = value; } + } + + static string FindDevice(Guid classGuid) + { + int lastError; + + // 0x12 = DIGCF_PRESENT | DIGCF_DEVICEINTERFACE + IntPtr handle = SetupDiGetClassDevs(ref classGuid, "", IntPtr.Zero, 0x12); + lastError = Marshal.GetLastWin32Error(); + + if (handle.ToInt32() == -1) + throw new Win32Exception(lastError); + + string devicePath = null; + + for (int deviceIndex = 0; ; deviceIndex++) + { + DeviceInfoData deviceInfoData = new DeviceInfoData(); + deviceInfoData.Size = Marshal.SizeOf(deviceInfoData); + + if (SetupDiEnumDeviceInfo(handle, deviceIndex, ref deviceInfoData) == false) + { + // out of devices or do we have an error? + lastError = Marshal.GetLastWin32Error(); + if (lastError != 0x0103 && lastError != 0x007E) + { + SetupDiDestroyDeviceInfoList(handle); + throw new Win32Exception(Marshal.GetLastWin32Error()); + } + + SetupDiDestroyDeviceInfoList(handle); + break; + } + + DeviceInterfaceData deviceInterfaceData = new DeviceInterfaceData(); + deviceInterfaceData.Size = Marshal.SizeOf(deviceInterfaceData); + + if (SetupDiEnumDeviceInterfaces(handle, ref deviceInfoData, ref classGuid, 0, ref deviceInterfaceData) == false) + { + SetupDiDestroyDeviceInfoList(handle); + throw new Win32Exception(Marshal.GetLastWin32Error()); + } + + uint cbData = 0; + + if (SetupDiGetDeviceInterfaceDetail(handle, ref deviceInterfaceData, IntPtr.Zero, 0, ref cbData, IntPtr.Zero) == false && cbData == 0) + { + SetupDiDestroyDeviceInfoList(handle); + throw new Win32Exception(Marshal.GetLastWin32Error()); + } + + DeviceInterfaceDetailData deviceInterfaceDetailData = new DeviceInterfaceDetailData(); + deviceInterfaceDetailData.Size = 5; + + if (SetupDiGetDeviceInterfaceDetail(handle, ref deviceInterfaceData, ref deviceInterfaceDetailData, cbData, IntPtr.Zero, IntPtr.Zero) == false) + { + SetupDiDestroyDeviceInfoList(handle); + throw new Win32Exception(Marshal.GetLastWin32Error()); + } + + if (deviceInterfaceDetailData.DevicePath.IndexOf(DeviceID, StringComparison.InvariantCultureIgnoreCase) != -1) + { + SetupDiDestroyDeviceInfoList(handle); + devicePath = deviceInterfaceDetailData.DevicePath; + break; + } + } + + return devicePath; + } + + void OnReadComplete(IAsyncResult asyncResult) + { + try + { + if (_deviceStream.EndRead(asyncResult) == DeviceBufferSize && _deviceBuffer[1] == 0) + { + TimeSpan timeSpan = DateTime.Now - _lastCodeTime; + + int keyCode = (int)_deviceBuffer[2]; + + if (keyCode != _lastCode || timeSpan.Milliseconds > 250) + { + if (_remoteButtonHandler != null) + _remoteButtonHandler(keyCode.ToString()); + + _lastCodeTime = DateTime.Now; + } + + _lastCode = keyCode; + } + + _deviceStream.BeginRead(_deviceBuffer, 0, _deviceBuffer.Length, new AsyncCallback(OnReadComplete), null); + } + catch (Exception) + { + } + } + + #endregion Implementation + + } + +} Added: trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/Icon.ico =================================================================== (Binary files differ) Property changes on: trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/Icon.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/Properties/AssemblyInfo.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR507 Receiver/Properties/AssemblyInfo.cs 2008-02-24 07:08:47 UTC (rev 1393) @@ -0,0 +1,39 @@ +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Security.Permissions; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("IR507 Receiver")] +[assembly: AssemblyDescription("Support for the IR507 IR receiver")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("and-81")] +[assembly: AssemblyProduct("IR507 Receiver")] +[assembly: AssemblyCopyright("Aaron Dinnage")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.4.2")] +[assembly: AssemblyFileVersion("1.0.4.2")] + +[assembly: CLSCompliant(true)] +[assembly: Guid("7b404b6c-e5a5-4d76-b5b6-d71dfd7696fb")] + +[assembly: SecurityPermission(SecurityAction.RequestMinimum, UnmanagedCode = true)] Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Microsoft MCE Transceiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Microsoft MCE Transceiver.csproj 2008-02-23 14:15:20 UTC (rev 1392) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Microsoft MCE Transceiver.csproj 2008-02-24 07:08:47 UTC (rev 1393) @@ -5,11 +5,12 @@ <ProductVersion>8.0.50727</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{BABC30EB-7D0F-4398-9FCB-E517EA8D2AA9}</ProjectGuid> - <OutputType>Library</OutputType> + <OutputType>Exe</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>MicrosoftMceTransceiver</RootNamespace> <AssemblyName>Microsoft MCE Transceiver</AssemblyName> <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent> + <StartupObject>InputService.Plugin.MicrosoftMceTransceiver</StartupObject> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>false</DebugSymbols> @@ -98,7 +99,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> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs 2008-02-23 14:15:20 UTC (rev 1392) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs 2008-02-24 07:08:47 UTC (rev 1393) @@ -48,10 +48,126 @@ /// <summary> /// IR Server Plugin for Microsoft MCE Transceiver device. /// </summary> - public class MicrosoftMceTransceiver : - PluginBase, IConfigure, ITransmitIR, ILearnIR, IRemoteReceiver, IKeyboardReceiver, IMouseReceiver + public class MicrosoftMceTransceiver : PluginBase, IConfigure, ITransmitIR, ILearnIR, IRemoteReceiver, IKeyboardReceiver, IMouseReceiver { + #region Debug + + static void xRemote(string code) + { + Console.WriteLine("Remote: {0}", code); + } + static void xKeyboard(int button, bool up) + { + Console.WriteLine("Keyboard: {0}, {1}", button, up); + } + static void xMouse(int x, int y, int buttons) + { + Console.WriteLine("Mouse: ({0}, {1}) - {2}", x, y, buttons); + } + + static void Dump(int[] timingData) + { + foreach (int time in timingData) + Console.Write("{0}, ", time); + Console.WriteLine(); + } + + [STAThread] + static void Main() + { + MicrosoftMceTransceiver c = new MicrosoftMceTransceiver(); + + //c.Configure(null); + + c.RemoteCallback += new RemoteHandler(xRemote); + c.KeyboardCallback += new KeyboardHandler(xKeyboard); + c.MouseCallback += new MouseHandler(xMouse); + + c.Start(); + + //Application.Run(); + + byte[] fileBytes; + string fileName = @"C:\test2.IR"; + /* + if (c.Learn(out fileBytes) == LearnStatus.Success) + { + using (FileStream writeFile = File.OpenWrite(fileName)) + { + writeFile.Write(fileBytes, 0, fileBytes.Length); + } + } + */ + Console.WriteLine("Testing IR longest length without crashing receiver"); + + using (FileStream file = File.OpenRead(fileName)) + { + if (file.Length == 0) + throw new IOException(String.Format("Cannot Blast. IR file \"{0}\" has no data, possible IR learn failure", fileName)); + + fileBytes = new byte[file.Length]; + file.Read(fileBytes, 0, (int)file.Length); + } + + IrCode code = IrCode.FromByteArray(fileBytes); + Dump(code.TimingData); + + + Console.WriteLine("Press any key to begin ..."); + Console.ReadKey(); + + int length = 750000; + //for (int length = 700000; length < 5000000; length += 50000) + while (true) + { + Console.WriteLine("Blasting with approx. total time of {0}us ...", length); + + List<int> newCode = new List<int>(); + + int total = 0; + for (int index = 0; index < code.TimingData.Length; index++) + { + int time = code.TimingData[index]; + + if (total + Math.Abs(time) >= length) + { + if (time > 0) + { + break; + } + else + { + time = total - length; + } + } + + newCode.Add(time); + total += Math.Abs(time); + } + + Console.WriteLine("Blasting with actual total time of {0}us ...", total); + + IrCode test = new IrCode(code.Carrier, newCode.ToArray()); + Dump(test.TimingData); + + c.Transmit("Both", test.ToByteArray(true)); + + Console.WriteLine("Blast complete, press any key to contiue ..."); + if (Console.ReadKey().Key == ConsoleKey.Escape) + break; + } + + Console.WriteLine("Done"); + + c.Stop(); + c = null; + } + + #endregion Debug + + + #region Constants static readonly string ConfigurationFile = Modified: trunk/plugins/IR Server Suite/IR Server Plugins/RC102 Receiver/RC102Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/RC102 Receiver/RC102Receiver.cs 2008-02-23 14:15:20 UTC (rev 1392) +++ trunk/plugins/IR Server Suite/IR Server Plugins/RC102 Receiver/RC102Receiver.cs 2008-02-24 07:08:47 UTC (rev 1393) @@ -144,7 +144,9 @@ const int DeviceBufferSize = 4; const string DeviceID = "vid_147a&pid_e019"; - + //const string DeviceID = "vid_147a&pid_e001"; // 501 + //const string DeviceID = "vid_0e6a&pid_6002"; // 507 + #endregion Constants #region Variables @@ -180,7 +182,7 @@ /// A description of the IR Server plugin. /// </summary> /// <value>The description.</value> - public override string Description { get { return "Support for RC102 and compatible IR receivers"; } } + public override string Description { get { return "Support for RC102 remote receiver"; } } /// <summary> /// Detect the presence of this device. Devices that cannot be detected will always return false. Modified: trunk/plugins/IR Server Suite/IR Server Suite.sln =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite.sln 2008-02-23 14:15:20 UTC (rev 1392) +++ trunk/plugins/IR Server Suite/IR Server Suite.sln 2008-02-24 07:08:47 UTC (rev 1393) @@ -407,6 +407,18 @@ Release.AspNetCompiler.Debug = "False" EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IR501 Receiver", "IR Server Plugins\IR501 Receiver\IR501 Receiver.csproj", "{C7BF555E-638F-4E1B-9D5A-D2D226C77676}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IR507 Receiver", "IR Server Plugins\IR507 Receiver\IR507 Receiver.csproj", "{1DD4B652-DBF4-47E2-B46C-C810EEE3B7C3}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1019,6 +1031,24 @@ {F8CC05AA-6306-459E-BD32-40C02489EFEC}.Release|Any CPU.ActiveCfg = Release|Any CPU {F8CC05AA-6306-459E-BD32-40C02489EFEC}.Release|Any CPU.Build.0 = Release|Any CPU {F8CC05AA-6306-459E-BD32-40C02489EFEC}.Release|x86.ActiveCfg = Release|Any CPU + {C7BF555E-638F-4E1B-9D5A-D2D226C77676}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C7BF555E-638F-4E1B-9D5A-D2D226C77676}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C7BF555E-638F-4E1B-9D5A-D2D226C77676}.Debug|x86.ActiveCfg = Debug|Any CPU + {C7BF555E-638F-4E1B-9D5A-D2D226C77676}.MyDboxSVN|Any CPU.ActiveCfg = Release|Any CPU + {C7BF555E-638F-4E1B-9D5A-D2D226C77676}.MyDboxSVN|Any CPU.Build.0 = Release|Any CPU + {C7BF555E-638F-4E1B-9D5A-D2D226C77676}.MyDboxSVN|x86.ActiveCfg = Release|Any CPU + {C7BF555E-638F-4E1B-9D5A-D2D226C77676}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C7BF555E-638F-4E1B-9D5A-D2D226C77676}.Release|Any CPU.Build.0 = Release|Any CPU + {C7BF555E-638F-4E1B-9D5A-D2D226C77676}.Release|x86.ActiveCfg = Release|Any CPU + {1DD4B652-DBF4-47E2-B46C-C810EEE3B7C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1DD4B652-DBF4-47E2-B46C-C810EEE3B7C3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1DD4B652-DBF4-47E2-B46C-C810EEE3B7C3}.Debug|x86.ActiveCfg = Debug|Any CPU + {1DD4B652-DBF4-47E2-B46C-C810EEE3B7C3}.MyDboxSVN|Any CPU.ActiveCfg = Release|Any CPU + {1DD4B652-DBF4-47E2-B46C-C810EEE3B7C3}.MyDboxSVN|Any CPU.Build.0 = Release|Any CPU + {1DD4B652-DBF4-47E2-B46C-C810EEE3B7C3}.MyDboxSVN|x86.ActiveCfg = Release|Any CPU + {1DD4B652-DBF4-47E2-B46C-C810EEE3B7C3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1DD4B652-DBF4-47E2-B46C-C810EEE3B7C3}.Release|Any CPU.Build.0 = Release|Any CPU + {1DD4B652-DBF4-47E2-B46C-C810EEE3B7C3}.Release|x86.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1064,6 +1094,8 @@ {ABA2DAF3-B4CF-42BF-8686-DD662B0D6406} = {0D1620EE-01B9-43B5-9FAA-E983BD9EBDBD} {A2702ACF-C59E-4564-8A4A-5CBFF21C1E66} = {0D1620EE-01B9-43B5-9FAA-E983BD9EBDBD} {26DEDF6D-F60D-4311-9A9E-DDF64500D5BF} = {0D1620EE-01B9-43B5-9FAA-E983BD9EBDBD} + {C7BF555E-638F-4E1B-9D5A-D2D226C77676} = {0D1620EE-01B9-43B5-9FAA-E983BD9EBDBD} + {1DD4B652-DBF4-47E2-B46C-C810EEE3B7C3} = {0D1620EE-01B9-43B5-9FAA-E983BD9EBDBD} {E8BEBBCC-1EE0-488D-8806-98ADCB7F0479} = {6C18D808-E5ED-4CFB-A7CD-E2BDBB1D9BDA} {7946D42A-4BCB-4D79-80EB-BA9B17CE2E90} = {6C18D808-E5ED-4CFB-A7CD-E2BDBB1D9BDA} {CD395FC2-70E2-42C4-8A20-5469A0C5EB50} = {6C18D808-E5ED-4CFB-A7CD-E2BDBB1D9BDA} 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-02-23 14:15:20 UTC (rev 1392) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs 2008-02-24 07:08:47 UTC (rev 1393) @@ -846,8 +846,7 @@ { Log.Debug("MESSAGE RECEIVED: {0}", Enum.GetName(typeof(GUIMessage.MessageType), msg.Message)); - if (EventMapperEnabled) - MapEvent(msg); + MapEvent(msg); } /// <summary> Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs 2008-02-23 14:15:20 UTC (rev 1392) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs 2008-02-24 07:08:47 UTC (rev 1393) @@ -405,6 +405,7 @@ { Thread newThread = new Thread(new ParameterizedThreadStart(ProcessExternalChannel)); newThread.Name = "ProcessExternalChannel"; + newThread.Priority = ThreadPriority.AboveNormal; newThread.IsBackground = true; newThread.Start(new string[] { msg.Label, msg.Label2 }); } Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs 2008-02-23 14:15:20 UTC (rev 1392) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs 2008-02-24 07:08:47 UTC (rev 1393) @@ -368,6 +368,7 @@ Thread newThread = new Thread(new ParameterizedThreadStart(ProcessExternalChannel)); newThread.Name = "ProcessExternalChannel"; + newThread.Priority = ThreadPriority.AboveNormal; newThread.IsBackground = true; newThread.Start(new int[] { analogChannel.ChannelNumber, tvEvent.Card.Id }); } Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2008-02-23 14:15:20 UTC (rev 1392) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2008-02-24 07:08:47 UTC (rev 1393) @@ -933,6 +933,7 @@ { Thread newThread = new Thread(new ParameterizedThreadStart(ProcessExternalChannel)); newThread.Name = "ProcessExternalChannel"; + newThread.Priority = ThreadPriority.AboveNormal; newThread.IsBackground = true; newThread.Start(new string[] { msg.Label, msg.Label2 }); } @@ -1014,7 +1015,7 @@ if (card < 0) { card = _externalChannelConfigs[0].CardId; - Log.Warn("TV2BlasterPlugin: MediaPortal reports invalid TV Card ID ({0}), using STB settings for first TV Card ({1})", data[1], card); + Log.Warn("MCEReplacement: MediaPortal reports invalid TV Card ID ({0}), using STB settings for first TV Card ({1})", data[1], card); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |