You can subscribe to this list here.
2007 |
Jan
(36) |
Feb
(79) |
Mar
(123) |
Apr
(95) |
May
(119) |
Jun
(172) |
Jul
(124) |
Aug
(100) |
Sep
(83) |
Oct
(52) |
Nov
(97) |
Dec
(87) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(131) |
Feb
(80) |
Mar
(163) |
Apr
(178) |
May
(73) |
Jun
(54) |
Jul
(106) |
Aug
(118) |
Sep
(50) |
Oct
(125) |
Nov
(100) |
Dec
(99) |
2009 |
Jan
(104) |
Feb
(99) |
Mar
(68) |
Apr
(81) |
May
(52) |
Jun
(87) |
Jul
(67) |
Aug
(33) |
Sep
(27) |
Oct
(37) |
Nov
(60) |
Dec
(116) |
2010 |
Jan
(82) |
Feb
(79) |
Mar
(38) |
Apr
(50) |
May
(45) |
Jun
(53) |
Jul
(23) |
Aug
(86) |
Sep
(22) |
Oct
(96) |
Nov
(97) |
Dec
(73) |
2011 |
Jan
(24) |
Feb
(45) |
Mar
(28) |
Apr
(31) |
May
(42) |
Jun
(25) |
Jul
|
Aug
(12) |
Sep
(28) |
Oct
(13) |
Nov
(43) |
Dec
(13) |
2012 |
Jan
(62) |
Feb
(28) |
Mar
(6) |
Apr
(16) |
May
(7) |
Jun
|
Jul
(16) |
Aug
(2) |
Sep
(1) |
Oct
(4) |
Nov
(1) |
Dec
(3) |
2013 |
Jan
(5) |
Feb
|
Mar
(34) |
Apr
(9) |
May
(6) |
Jun
(10) |
Jul
(32) |
Aug
(8) |
Sep
(11) |
Oct
(35) |
Nov
(24) |
Dec
(22) |
2014 |
Jan
(44) |
Feb
(9) |
Mar
(9) |
Apr
(15) |
May
(25) |
Jun
(34) |
Jul
(16) |
Aug
(11) |
Sep
(7) |
Oct
(6) |
Nov
(1) |
Dec
(12) |
2015 |
Jan
(33) |
Feb
(19) |
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(5) |
From: <an...@us...> - 2007-09-06 16:53:27
|
Revision: 898 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=898&view=rev Author: and-81 Date: 2007-09-06 09:50:58 -0700 (Thu, 06 Sep 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverReplacement.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverVista.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverXP.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrCode.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Keyboard.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/NotifyWindow.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Pronto.cs 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 2007-09-06 15:59:39 UTC (rev 897) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs 2007-09-06 16:50:58 UTC (rev 898) @@ -20,7 +20,7 @@ #region Enumerations [Flags] - enum Digcfs + enum Digcfs : uint { None = 0x00, Default = 0x01, @@ -31,15 +31,24 @@ } [Flags] - public enum FileShares + protected enum CreateFileAccessTypes : uint { + GenericRead = 0x80000000, + GenericWrite = 0x40000000, + GenericExecute = 0x20000000, + GenericAll = 0x10000000, + } + + [Flags] + protected enum CreateFileShares : uint + { None = 0x00, Read = 0x01, Write = 0x02, Delete = 0x04, } - public enum CreationDisposition + protected enum CreateFileDisposition : uint { None = 0, New = 1, @@ -50,7 +59,7 @@ } [Flags] - public enum FileAttributes : uint + protected enum CreateFileAttributes : uint { Readonly = 0x00000001, Hidden = 0x00000002, @@ -79,15 +88,6 @@ FirstPipeInstance = 0x00080000, } - [Flags] - public enum FileAccessTypes : uint - { - GenericRead = 0x80000000, - GenericWrite = 0x40000000, - GenericExecute = 0x20000000, - GenericAll = 0x10000000, - } - #endregion Enumerations #region Structures @@ -185,9 +185,12 @@ #region Constructors - public Driver() { } - public Driver(Guid deviceGuid, string devicePath, RemoteCallback remoteCallback, KeyboardCallback keyboardCallback, MouseCallback mouseCallback) + protected Driver() { } + protected Driver(Guid deviceGuid, string devicePath, RemoteCallback remoteCallback, KeyboardCallback keyboardCallback, MouseCallback mouseCallback) { + if (String.IsNullOrEmpty(devicePath)) + throw new ArgumentException("Null or Empty device path supplied", "devicePath"); + _deviceGuid = deviceGuid; _devicePath = devicePath; 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 2007-09-06 15:59:39 UTC (rev 897) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverReplacement.cs 2007-09-06 16:50:58 UTC (rev 898) @@ -23,16 +23,16 @@ SafeFileHandle handle, ref NativeOverlapped overlapped, out int bytesTransferred, - bool wait); + [MarshalAs(UnmanagedType.Bool)] bool wait); [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)] static extern SafeFileHandle CreateFile( [MarshalAs(UnmanagedType.LPTStr)] string fileName, - [MarshalAs(UnmanagedType.U4)] FileAccessTypes fileAccess, - [MarshalAs(UnmanagedType.U4)] FileShares fileShare, + [MarshalAs(UnmanagedType.U4)] CreateFileAccessTypes fileAccess, + [MarshalAs(UnmanagedType.U4)] CreateFileShares fileShare, IntPtr securityAttributes, - [MarshalAs(UnmanagedType.U4)] CreationDisposition creationDisposition, - [MarshalAs(UnmanagedType.U4)] FileAttributes flags, + [MarshalAs(UnmanagedType.U4)] CreateFileDisposition creationDisposition, + [MarshalAs(UnmanagedType.U4)] CreateFileAttributes flags, IntPtr templateFile); [DllImport("kernel32.dll", SetLastError = true)] @@ -109,8 +109,8 @@ #region Constants // Vendor ID's for SMK and Topseed devices. - const string VidSMK = "vid_1784"; - const string VidTopseed = "vid_0609"; + const string VidSMK = "vid_1784"; + const string VidTopseed = "vid_0609"; // Device variables const int DeviceBufferSize = 100; @@ -188,12 +188,12 @@ int lastError; - _readHandle = CreateFile(_devicePath + "\\Pipe01", FileAccessTypes.GenericRead, FileShares.None, IntPtr.Zero, CreationDisposition.OpenExisting, FileAttributes.Overlapped, IntPtr.Zero); + _readHandle = CreateFile(_devicePath + "\\Pipe01", CreateFileAccessTypes.GenericRead, CreateFileShares.None, IntPtr.Zero, CreateFileDisposition.OpenExisting, CreateFileAttributes.Overlapped, IntPtr.Zero); lastError = Marshal.GetLastWin32Error(); if (_readHandle.IsInvalid) throw new Win32Exception(lastError); - _writeHandle = CreateFile(_devicePath + "\\Pipe00", FileAccessTypes.GenericWrite, FileShares.None, IntPtr.Zero, CreationDisposition.OpenExisting, FileAttributes.Overlapped, IntPtr.Zero); + _writeHandle = CreateFile(_devicePath + "\\Pipe00", CreateFileAccessTypes.GenericWrite, CreateFileShares.None, IntPtr.Zero, CreateFileDisposition.OpenExisting, CreateFileAttributes.Overlapped, IntPtr.Zero); lastError = Marshal.GetLastWin32Error(); if (_writeHandle.IsInvalid) throw new Win32Exception(lastError); @@ -296,7 +296,7 @@ #region Implementation - byte[] CarrierPacket(IrCode code) + static byte[] CarrierPacket(IrCode code) { byte[] carrierPacket = new byte[SetCarrierFreqPacket.Length]; SetCarrierFreqPacket.CopyTo(carrierPacket, 0); @@ -319,7 +319,7 @@ return carrierPacket; } - byte[] DataPacket(IrCode code) + static byte[] DataPacket(IrCode code) { if (code.TimingData.Length == 0) return null; @@ -518,7 +518,7 @@ continue; sinceLastPacket = DateTime.Now.Subtract(lastPacketTime); - if (sinceLastPacket.TotalMilliseconds >= PacketTimeout) + if (sinceLastPacket.TotalMilliseconds >= PacketTimeout + 50) IrDecoder.DecodeIR(null, null, null, null); lastPacketTime = DateTime.Now; @@ -609,7 +609,7 @@ } } - catch + catch (Exception) { CancelIo(_readHandle); } @@ -693,7 +693,7 @@ } } - int[] GetTimingDataFromPacket(byte[] packet) + static int[] GetTimingDataFromPacket(byte[] packet) { List<int> timingData = new List<int>(); @@ -737,7 +737,7 @@ return timingData.ToArray(); } - void GetIrCodeLengths(IrCode code, out int onTime, out int onCount) + static void GetIrCodeLengths(IrCode code, out int onTime, out int onCount) { onTime = 0; onCount = 0; 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 2007-09-06 15:59:39 UTC (rev 897) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverVista.cs 2007-09-06 16:50:58 UTC (rev 898) @@ -220,30 +220,20 @@ [DllImport("kernel32.dll", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] - static extern bool DeviceIoControl( - SafeFileHandle handle, - [MarshalAs(UnmanagedType.U4)] IoCtrl ioControlCode, - IntPtr inBuffer, int inBufferSize, - IntPtr outBuffer, int outBufferSize, - out int bytesReturned, - IntPtr overlapped); - - [DllImport("kernel32.dll", SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] static extern bool GetOverlappedResult( SafeFileHandle handle, ref NativeOverlapped overlapped, out int bytesTransferred, - bool wait); + [MarshalAs(UnmanagedType.Bool)] bool wait); [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)] static extern SafeFileHandle CreateFile( [MarshalAs(UnmanagedType.LPTStr)] string fileName, - [MarshalAs(UnmanagedType.U4)] FileAccessTypes fileAccess, - [MarshalAs(UnmanagedType.U4)] FileShares fileShare, + [MarshalAs(UnmanagedType.U4)] CreateFileAccessTypes fileAccess, + [MarshalAs(UnmanagedType.U4)] CreateFileShares fileShare, IntPtr securityAttributes, - [MarshalAs(UnmanagedType.U4)] CreationDisposition creationDisposition, - [MarshalAs(UnmanagedType.U4)] FileAttributes flags, + [MarshalAs(UnmanagedType.U4)] CreateFileDisposition creationDisposition, + [MarshalAs(UnmanagedType.U4)] CreateFileAttributes flags, IntPtr templateFile); [DllImport("kernel32.dll")] @@ -262,16 +252,16 @@ #region Device Details - uint _numTxPorts = 0; - uint _numRxPorts = 0; + uint _numTxPorts = 0; + //uint _numRxPorts = 0; uint _learnPortMask = 0; - bool _legacyDevice = false; - bool _canFlashLed = false; + //bool _legacyDevice = false; + //bool _canFlashLed = false; bool[] _blasters; - uint _receivePort = 0; - uint _learnPort = 0; + uint _receivePort = 0; + uint _learnPort = 0; #endregion Device Details @@ -358,7 +348,7 @@ } _numTxPorts = structure.TransmitPorts; - _numRxPorts = structure.ReceivePorts; + //_numRxPorts = structure.ReceivePorts; _learnPortMask = structure.LearningMask; int receivePort = FirstLowBit(_learnPortMask); @@ -371,9 +361,9 @@ else _learnPort = _receivePort; - DeviceCapabilityFlags flags = structure.DetailsFlags; - _legacyDevice = (int)(flags & DeviceCapabilityFlags.Legacy) != 0; - _canFlashLed = (int)(flags & DeviceCapabilityFlags.FlashLed) != 0; + //DeviceCapabilityFlags flags = structure.DetailsFlags; + //_legacyDevice = (int)(flags & DeviceCapabilityFlags.Legacy) != 0; + //_canFlashLed = (int)(flags & DeviceCapabilityFlags.FlashLed) != 0; } void GetBlasters() @@ -520,7 +510,7 @@ _notifyWindow = new NotifyWindow(); _notifyWindow.Class = _deviceGuid; - _eHomeHandle = CreateFile(_devicePath, FileAccessTypes.GenericRead | FileAccessTypes.GenericWrite, FileShares.None, IntPtr.Zero, CreationDisposition.OpenExisting, FileAttributes.Overlapped, IntPtr.Zero); + _eHomeHandle = CreateFile(_devicePath, CreateFileAccessTypes.GenericRead | CreateFileAccessTypes.GenericWrite, CreateFileShares.None, IntPtr.Zero, CreateFileDisposition.OpenExisting, CreateFileAttributes.Overlapped, IntPtr.Zero); int lastError = Marshal.GetLastWin32Error(); if (_eHomeHandle.IsInvalid) throw new Win32Exception(lastError); @@ -613,7 +603,7 @@ #region Implementation - byte[] DataPacket(IrCode code) + static byte[] DataPacket(IrCode code) { if (code.TimingData.Length == 0) return null; @@ -755,7 +745,7 @@ } } } - catch + catch (Exception) { CancelIo(_eHomeHandle); } @@ -790,20 +780,15 @@ return rawData; } - static byte ConvertBcdToByte(byte b) + static int FirstHighBit(uint mask) { - return (byte)(((b >> 4) * 10) + (b & 15)); - } - - int FirstHighBit(uint mask) - { for (int i = 0; i < 32; i++) if ((mask & (1 << i)) != 0) return i; return -1; } - int FirstLowBit(uint mask) + static int FirstLowBit(uint mask) { for (int i = 0; i < 32; i++) if ((mask & (1 << i)) == 0) 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 2007-09-06 15:59:39 UTC (rev 897) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverXP.cs 2007-09-06 16:50:58 UTC (rev 898) @@ -23,16 +23,16 @@ SafeFileHandle handle, ref NativeOverlapped overlapped, out int bytesTransferred, - bool wait); + [MarshalAs(UnmanagedType.Bool)] bool wait); [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)] static extern SafeFileHandle CreateFile( [MarshalAs(UnmanagedType.LPTStr)] string fileName, - [MarshalAs(UnmanagedType.U4)] FileAccessTypes fileAccess, - [MarshalAs(UnmanagedType.U4)] FileShares fileShare, + [MarshalAs(UnmanagedType.U4)] CreateFileAccessTypes fileAccess, + [MarshalAs(UnmanagedType.U4)] CreateFileShares fileShare, IntPtr securityAttributes, - [MarshalAs(UnmanagedType.U4)] CreationDisposition creationDisposition, - [MarshalAs(UnmanagedType.U4)] FileAttributes flags, + [MarshalAs(UnmanagedType.U4)] CreateFileDisposition creationDisposition, + [MarshalAs(UnmanagedType.U4)] CreateFileAttributes flags, IntPtr templateFile); [DllImport("kernel32.dll", SetLastError = true)] @@ -109,8 +109,8 @@ #region Constants // Vendor ID's for SMK and Topseed devices. - const string VidSMK = "vid_1784"; - const string VidTopseed = "vid_0609"; + const string VidSMK = "vid_1784"; + const string VidTopseed = "vid_0609"; // Device variables const int DeviceBufferSize = 100; @@ -187,7 +187,7 @@ int lastError; - _eHomeHandle = CreateFile(_devicePath, FileAccessTypes.GenericRead | FileAccessTypes.GenericWrite, FileShares.None, IntPtr.Zero, CreationDisposition.OpenExisting, FileAttributes.Overlapped, IntPtr.Zero); + _eHomeHandle = CreateFile(_devicePath, CreateFileAccessTypes.GenericRead | CreateFileAccessTypes.GenericWrite, CreateFileShares.None, IntPtr.Zero, CreateFileDisposition.OpenExisting, CreateFileAttributes.Overlapped, IntPtr.Zero); lastError = Marshal.GetLastWin32Error(); if (_eHomeHandle.IsInvalid) throw new Win32Exception(lastError); @@ -274,7 +274,7 @@ throw new Exception("Invalid device type"); } - //_debugFile.WriteLine(code.ToByteArray()); + //Dump(code.ToByteArray()); // Set port WriteSync(portPacket); @@ -290,7 +290,7 @@ #region Implementation - byte[] CarrierPacket(IrCode code) + static byte[] CarrierPacket(IrCode code) { byte[] carrierPacket = new byte[SetCarrierFreqPacket.Length]; SetCarrierFreqPacket.CopyTo(carrierPacket, 0); @@ -313,7 +313,7 @@ return carrierPacket; } - byte[] DataPacket(IrCode code) + static byte[] DataPacket(IrCode code) { if (code.TimingData.Length == 0) return null; @@ -600,7 +600,7 @@ } } - catch + catch (Exception) { CancelIo(_eHomeHandle); } @@ -684,7 +684,7 @@ } } - int[] GetTimingDataFromPacket(byte[] packet) + static int[] GetTimingDataFromPacket(byte[] packet) { List<int> timingData = new List<int>(); @@ -728,7 +728,7 @@ return timingData.ToArray(); } - void GetIrCodeLengths(IrCode code, out int onTime, out int onCount) + static void GetIrCodeLengths(IrCode code, out int onTime, out int onCount) { onTime = 0; onCount = 0; Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrCode.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrCode.cs 2007-09-06 15:59:39 UTC (rev 897) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrCode.cs 2007-09-06 16:50:58 UTC (rev 898) @@ -108,8 +108,8 @@ /// <summary> /// Add timing data to this IR code. /// </summary> - /// <param name="addTimingData">Addition timing data.</param> - public void AddTimingData(int[] addTimingData) + /// <param name="timingData">Addition timing data.</param> + public void AddTimingData(int[] timingData) { List<int> newTimingData = new List<int>(); @@ -122,28 +122,25 @@ } else if (_timingData.Length == 0) { - _timingData = new int[addTimingData.Length]; - addTimingData.CopyTo(_timingData, 0); + _timingData = new int[timingData.Length]; + timingData.CopyTo(_timingData, 0); return; } - if (addTimingData.Length == 0 || index >= _timingData.Length) - { + if (timingData.Length == 0 || index >= _timingData.Length) return; - } - - if (Math.Sign(addTimingData[0]) == Math.Sign(_timingData[index])) + if (Math.Sign(timingData[0]) == Math.Sign(_timingData[index])) { - newTimingData.Add(_timingData[index] + addTimingData[0]); + newTimingData.Add(_timingData[index] + timingData[0]); - for (index = 1; index < addTimingData.Length; index++) - newTimingData.Add(addTimingData[index]); + for (index = 1; index < timingData.Length; index++) + newTimingData.Add(timingData[index]); } else { newTimingData.Add(_timingData[index]); - newTimingData.AddRange(addTimingData); + newTimingData.AddRange(timingData); } _timingData = newTimingData.ToArray(); 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 2007-09-06 15:59:39 UTC (rev 897) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Keyboard.cs 2007-09-06 16:50:58 UTC (rev 898) @@ -28,146 +28,146 @@ /// </summary> public enum VKey { - None = 0, - VK_0 = 0x30, - VK_1 = 0x31, - VK_2 = 0x32, - VK_3 = 0x33, - VK_4 = 0x34, - VK_5 = 0x35, - VK_6 = 0x36, - VK_7 = 0x37, - VK_8 = 0x38, - VK_9 = 0x39, - VK_A = 0x41, - VK_B = 0x42, - VK_C = 0x43, - VK_D = 0x44, - VK_E = 0x45, - VK_F = 0x46, - VK_G = 0x47, - VK_H = 0x48, - VK_I = 0x49, - VK_J = 0x4A, - VK_K = 0x4B, - VK_L = 0x4C, - VK_M = 0x4D, - VK_N = 0x4E, - VK_O = 0x4F, - VK_P = 0x50, - VK_Q = 0x51, - VK_R = 0x52, - VK_S = 0x53, - VK_T = 0x54, - VK_U = 0x55, - VK_V = 0x56, - VK_W = 0x57, - VK_X = 0x58, - VK_Y = 0x59, - VK_Z = 0x5A, - VK_ADD = 0x6B, - VK_APPS = 0x5D, - VK_ATTN = 0xF6, - VK_BACK = 0x8, - VK_CANCEL = 0x3, - VK_CAPITAL = 0x14, - VK_CLEAR = 0xC, - VK_CONTROL = 0x11, - VK_CRSEL = 0xF7, - VK_DECIMAL = 0x6E, - VK_DELETE = 0x2E, - VK_DIVIDE = 0x6F, - VK_DOWN = 0x28, - VK_END = 0x23, - VK_EREOF = 0xF9, - VK_ESCAPE = 0x1B, - VK_EXECUTE = 0x2B, - VK_EXSEL = 0xF8, - VK_F1 = 0x70, - VK_F2 = 0x71, - VK_F3 = 0x72, - VK_F4 = 0x73, - VK_F5 = 0x74, - VK_F6 = 0x75, - VK_F7 = 0x76, - VK_F8 = 0x77, - VK_F9 = 0x78, - VK_F10 = 0x79, - VK_F11 = 0x7A, - VK_F12 = 0x7B, - VK_F13 = 0x7C, - VK_F14 = 0x7D, - VK_F15 = 0x7E, - VK_F16 = 0x7F, - VK_F17 = 0x80, - VK_F18 = 0x81, - VK_F19 = 0x82, - VK_F20 = 0x83, - VK_F21 = 0x84, - VK_F22 = 0x85, - VK_F23 = 0x86, - VK_F24 = 0x87, - VK_HELP = 0x2F, - VK_HOME = 0x24, - VK_INSERT = 0x2D, - VK_LBUTTON = 0x1, + None = 0, + VK_0 = 0x30, + VK_1 = 0x31, + VK_2 = 0x32, + VK_3 = 0x33, + VK_4 = 0x34, + VK_5 = 0x35, + VK_6 = 0x36, + VK_7 = 0x37, + VK_8 = 0x38, + VK_9 = 0x39, + VK_A = 0x41, + VK_B = 0x42, + VK_C = 0x43, + VK_D = 0x44, + VK_E = 0x45, + VK_F = 0x46, + VK_G = 0x47, + VK_H = 0x48, + VK_I = 0x49, + VK_J = 0x4A, + VK_K = 0x4B, + VK_L = 0x4C, + VK_M = 0x4D, + VK_N = 0x4E, + VK_O = 0x4F, + VK_P = 0x50, + VK_Q = 0x51, + VK_R = 0x52, + VK_S = 0x53, + VK_T = 0x54, + VK_U = 0x55, + VK_V = 0x56, + VK_W = 0x57, + VK_X = 0x58, + VK_Y = 0x59, + VK_Z = 0x5A, + VK_ADD = 0x6B, + VK_APPS = 0x5D, + VK_ATTN = 0xF6, + VK_BACK = 0x8, + VK_CANCEL = 0x3, + VK_CAPITAL = 0x14, + VK_CLEAR = 0xC, + VK_CONTROL = 0x11, + VK_CRSEL = 0xF7, + VK_DECIMAL = 0x6E, + VK_DELETE = 0x2E, + VK_DIVIDE = 0x6F, + VK_DOWN = 0x28, + VK_END = 0x23, + VK_EREOF = 0xF9, + VK_ESCAPE = 0x1B, + VK_EXECUTE = 0x2B, + VK_EXSEL = 0xF8, + VK_F1 = 0x70, + VK_F2 = 0x71, + VK_F3 = 0x72, + VK_F4 = 0x73, + VK_F5 = 0x74, + VK_F6 = 0x75, + VK_F7 = 0x76, + VK_F8 = 0x77, + VK_F9 = 0x78, + VK_F10 = 0x79, + VK_F11 = 0x7A, + VK_F12 = 0x7B, + VK_F13 = 0x7C, + VK_F14 = 0x7D, + VK_F15 = 0x7E, + VK_F16 = 0x7F, + VK_F17 = 0x80, + VK_F18 = 0x81, + VK_F19 = 0x82, + VK_F20 = 0x83, + VK_F21 = 0x84, + VK_F22 = 0x85, + VK_F23 = 0x86, + VK_F24 = 0x87, + VK_HELP = 0x2F, + VK_HOME = 0x24, + VK_INSERT = 0x2D, + VK_LBUTTON = 0x1, VK_LCONTROL = 0xA2, - VK_LEFT = 0x25, - VK_LMENU = 0xA4, - VK_LSHIFT = 0xA0, - VK_LWIN = 0x5B, - VK_MBUTTON = 0x4, - VK_MENU = 0x12, + VK_LEFT = 0x25, + VK_LMENU = 0xA4, + VK_LSHIFT = 0xA0, + VK_LWIN = 0x5B, + VK_MBUTTON = 0x4, + VK_MENU = 0x12, VK_MULTIPLY = 0x6A, - VK_NEXT = 0x22, - VK_NONAME = 0xFC, - VK_NUMLOCK = 0x90, - VK_NUMPAD0 = 0x60, - VK_NUMPAD1 = 0x61, - VK_NUMPAD2 = 0x62, - VK_NUMPAD3 = 0x63, - VK_NUMPAD4 = 0x64, - VK_NUMPAD5 = 0x65, - VK_NUMPAD6 = 0x66, - VK_NUMPAD7 = 0x67, - VK_NUMPAD8 = 0x68, - VK_NUMPAD9 = 0x69, - VK_OEM_1 = 0xBA, // ";:" - VK_OEM_2 = 0xBF, // "/?" - VK_OEM_3 = 0xC0, // "`~" for US - VK_OEM_4 = 0xDB, // "[{" for US - VK_OEM_5 = 0xDC, // "\|" for US - VK_OEM_6 = 0xDD, // "]}" for US - VK_OEM_7 = 0xDE, // "'"" for US - VK_OEM_102 = 0xE2, + VK_NEXT = 0x22, + VK_NONAME = 0xFC, + VK_NUMLOCK = 0x90, + VK_NUMPAD0 = 0x60, + VK_NUMPAD1 = 0x61, + VK_NUMPAD2 = 0x62, + VK_NUMPAD3 = 0x63, + VK_NUMPAD4 = 0x64, + VK_NUMPAD5 = 0x65, + VK_NUMPAD6 = 0x66, + VK_NUMPAD7 = 0x67, + VK_NUMPAD8 = 0x68, + VK_NUMPAD9 = 0x69, + VK_OEM_1 = 0xBA, // ";:" + VK_OEM_2 = 0xBF, // "/?" + VK_OEM_3 = 0xC0, // "`~" for US + VK_OEM_4 = 0xDB, // "[{" for US + VK_OEM_5 = 0xDC, // "\|" for US + VK_OEM_6 = 0xDD, // "]}" for US + VK_OEM_7 = 0xDE, // "'"" for US + VK_OEM_102 = 0xE2, VK_OEM_CLEAR = 0xFE, VK_OEM_COMMA = 0xBC, VK_OEM_MINUS = 0xBD, VK_OEM_PERIOD = 0xBE, VK_OEM_PLUS = 0xBB, // "+=" - VK_PA1 = 0xFD, - VK_PAUSE = 0x13, - VK_PLAY = 0xFA, - VK_PRINT = 0x2A, - VK_PRIOR = 0x21, + VK_PA1 = 0xFD, + VK_PAUSE = 0x13, + VK_PLAY = 0xFA, + VK_PRINT = 0x2A, + VK_PRIOR = 0x21, VK_PROCESSKEY = 0xE5, - VK_RBUTTON = 0x2, + VK_RBUTTON = 0x2, VK_RCONTROL = 0xA3, - VK_RETURN = 0xD, - VK_RIGHT = 0x27, - VK_RMENU = 0xA5, - VK_RSHIFT = 0xA1, - VK_RWIN = 0x5C, - VK_SCROLL = 0x91, - VK_SELECT = 0x29, + VK_RETURN = 0xD, + VK_RIGHT = 0x27, + VK_RMENU = 0xA5, + VK_RSHIFT = 0xA1, + VK_RWIN = 0x5C, + VK_SCROLL = 0x91, + VK_SELECT = 0x29, VK_SEPARATOR = 0x6C, - VK_SHIFT = 0x10, + VK_SHIFT = 0x10, VK_SNAPSHOT = 0x2C, - VK_SPACE = 0x20, + VK_SPACE = 0x20, VK_SUBTRACT = 0x6D, - VK_TAB = 0x9, - VK_UP = 0x26, - VK_ZOOM = 0xFB, + VK_TAB = 0x9, + VK_UP = 0x26, + VK_ZOOM = 0xFB, } /// <summary> @@ -176,11 +176,11 @@ [Flags] public enum KeyEvents { - KeyDown = 0, - ExtendedKey = 1, - KeyUp = 2, - Unicode = 4, - ScanCode = 8, + KeyDown = 0x00, + ExtendedKey = 0x01, + KeyUp = 0x02, + Unicode = 0x04, + ScanCode = 0x08, } #endregion Enumerations Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs 2007-09-06 15:59:39 UTC (rev 897) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs 2007-09-06 16:50:58 UTC (rev 898) @@ -101,8 +101,6 @@ Mouse.MouseEvents _mouseButtons = Mouse.MouseEvents.None; - DateTime _lastPacketTime = DateTime.Now; - RemoteHandler _remoteHandler = null; KeyboardHandler _keyboardHandler = null; MouseHandler _mouseHandler = null; Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/NotifyWindow.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/NotifyWindow.cs 2007-09-06 15:59:39 UTC (rev 897) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/NotifyWindow.cs 2007-09-06 16:50:58 UTC (rev 898) @@ -68,7 +68,8 @@ [DllImport("kernel32")] [return: MarshalAs(UnmanagedType.Bool)] - static extern bool CancelIo(IntPtr handle); + static extern bool CancelIo( + IntPtr handle); #endregion Interop Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Pronto.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Pronto.cs 2007-09-06 15:59:39 UTC (rev 897) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Pronto.cs 2007-09-06 16:50:58 UTC (rev 898) @@ -78,33 +78,31 @@ /// </summary> /// <param name="fileName">File to write Pronto data to.</param> /// <param name="prontoData">Pronto data to write.</param> - /// <returns>Success.</returns> - public static bool WriteProntoFile(string fileName, ushort[] prontoData) + public static void WriteProntoFile(string fileName, ushort[] prontoData) { - try - { - StreamWriter file = new StreamWriter(fileName, false); + if (String.IsNullOrEmpty(fileName)) + throw new ArgumentException("Null or Empty filename provided.", "fileName"); - for (int index = 0; index < prontoData.Length; index++) - { - file.Write(String.Format("{0:X4}", prontoData[index])); - if (index != prontoData.Length - 1) - file.Write(' '); - } + if (prontoData == null || prontoData.Length == 0) + throw new ArgumentException("Null or Empty pronto data provided.", "prontoData"); - file.Flush(); - file.Close(); - } - catch + StreamWriter file = new StreamWriter(fileName, false); + + for (int index = 0; index < prontoData.Length; index++) { - return false; + file.Write(String.Format("{0:X4}", prontoData[index])); + if (index != prontoData.Length - 1) + file.Write(' '); } - return true; + file.Close(); } public static IrCode ConvertProntoDataToIrCode(ushort[] prontoData) { + if (prontoData == null || prontoData.Length == 0) + throw new ArgumentException("Null or Empty pronto data provided.", "prontoData"); + switch ((CodeType)prontoData[0]) { case CodeType.RawOscillated: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2007-09-06 15:59:42
|
Revision: 897 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=897&view=rev Author: chef_koch Date: 2007-09-06 08:59:39 -0700 (Thu, 06 Sep 2007) Log Message: ----------- yup we can ;) Modified Paths: -------------- trunk/plugins/myGUIProgramsAlt/README.txt Modified: trunk/plugins/myGUIProgramsAlt/README.txt =================================================================== --- trunk/plugins/myGUIProgramsAlt/README.txt 2007-09-06 13:42:33 UTC (rev 896) +++ trunk/plugins/myGUIProgramsAlt/README.txt 2007-09-06 15:59:39 UTC (rev 897) @@ -93,32 +93,4 @@ - [low] genre: thumbs for genre, for example it could be created on AllGame lookup, for first file with this genre -Iso mounting -> pro/contra??? The user can easliy script this. - - - -CHEFKOCH: can we remove this? ------------------------------------------------------------------------------------ --> FileItems - - Filename: for the image of FileItem is parsed by FileItem Title, and is only the base filename, - this means that we can append out counter _1 _2 or anything else to have more than image per fileitem - - Filepath: GetSubfolder(Config.Dir.Thumbs, @"MyProgramsAlt\" + FatherApplicationItemTitle) - - database: remove 'imagefile' in tblFileItem - - config: remove the image label and textbox in fileDetailsForm - maybe add a label as a hint, which the contain two sample filenames, the plugin is searching for - these samples are created on the fly by Title - Example: Nintendo 64 Mario Kart 64 - "C:\Program Files\Team MediaPortal\Thumbs\MyProgramsAlt\Nintendo 64\Mario Kart 64_1.png" - "C:\Program Files\Team MediaPortal\Thumbs\MyProgramsAlt\Nintendo 64\Mario Kart 64_2.png" - -pros: - no need to config paths for imagesDirs, appitems or fileitems - - no need to store the paths in database -> which is not working correct atm - - no need to check whether we have write access, when downloading the images - -cons: - it's a bit coding work ;) <- Most should be done already, maybe some minor bug ;) - - after renaming an Application Item, - - appImage is not assigned - - subFolder with FileItemImages is not assigned anymore - -> 1. can be renamed by hand - -> 2. can be renamed by plugin, when renaming the appItem - -> 3. there could be a msgBox, which asks the user what to do, 1. or 2. ? go for two!! --------------------------------------------------------------------------------------- +Iso mounting -> pro/contra??? The user can easliy script this. \ 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: <rs...@us...> - 2007-09-06 13:42:43
|
Revision: 896 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=896&view=rev Author: rsparey Date: 2007-09-06 06:42:33 -0700 (Thu, 06 Sep 2007) Log Message: ----------- work on overlays and home screens Modified Paths: -------------- trunk/skins/Foofaraw/Development Skin/Foofaraw/BasicHome.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/Media/background.png trunk/skins/Foofaraw/Development Skin/Foofaraw/Media/tv_background.png trunk/skins/Foofaraw/Development Skin/Foofaraw/musicOverlay.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/myHome.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicsongs.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/videoOverlay.xml Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/BasicHome.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/BasicHome.xml 2007-09-05 17:23:54 UTC (rev 895) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/BasicHome.xml 2007-09-06 13:42:33 UTC (rev 896) @@ -3,6 +3,7 @@ <id>35</id> <defaultcontrol>4</defaultcontrol> <allowoverlay>yes</allowoverlay> + <autohidetopbar>no</autohidetopbar> <controls> <control> <description>BG</description> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/Media/background.png =================================================================== (Binary files differ) Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/Media/tv_background.png =================================================================== (Binary files differ) Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/musicOverlay.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/musicOverlay.xml 2007-09-05 17:23:54 UTC (rev 895) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/musicOverlay.xml 2007-09-06 13:42:33 UTC (rev 896) @@ -3,12 +3,24 @@ <id>2004</id> <defaultcontrol>2</defaultcontrol> <controls> + <control> + <description>VIDEO BACKGROUND</description> + <type>image</type> + <id>0</id> + <posX>10</posX> + <posY>575</posY> + <width>211</width> + <height>182</height> + <texture>tv_background.png</texture> + <animation effect="fade" time="500">WindowClose</animation> + <animation effect="fade" time="250">WindowOpen</animation> + </control> <control> <description>play time label</description> <type>label</type> <id>2</id> - <posX>322</posX> - <posY>700</posY> + <posX>50</posX> + <posY>705</posY> <label>#currentplaytime</label> <align>left</align> <font>wipeout</font> @@ -18,26 +30,26 @@ </control> <control> - <description>music logo</description> + <description>Album Artwork</description> <type>image</type> <id>1</id> - <posX>160</posX> - <posY>580</posY> + <posX>30</posX> + <posY>600</posY> <width>180</width> - <height>144</height> + <height>101</height> <keepaspectratio>yes</keepaspectratio> <centered>yes</centered> <texture>#Play.Current.Thumb</texture> <animation effect="fade" time="500">WindowClose</animation> <animation effect="fade" time="250">WindowOpen</animation> </control> - + <control> <description>play logo</description> <type>image</type> <id>3</id> - <posX>37</posX> - <posY>580</posY> + <posX>0</posX> + <posY>695</posY> <texture>logo_play.png</texture> <animation effect="fade" time="500">WindowClose</animation> <animation effect="fade" time="250">WindowOpen</animation> @@ -46,8 +58,8 @@ <description>Pause logo</description> <type>image</type> <id>4</id> - <posX>36</posX> - <posY>580</posY> + <posX>0</posX> + <posY>695</posY> <texture>logo_pause.png</texture> <animation effect="fade" time="500">WindowClose</animation> <animation effect="fade" time="250">WindowOpen</animation> @@ -56,8 +68,8 @@ <description>FF logo</description> <type>image</type> <id>7</id> - <posX>18</posX> - <posY>580</posY> + <posX>0</posX> + <posY>695</posY> <texture>logo_fastforward.png</texture> <animation effect="fade" time="500">WindowClose</animation> <animation effect="fade" time="250">WindowOpen</animation> @@ -66,8 +78,8 @@ <description>RW logo</description> <type>image</type> <id>8</id> - <posX>18</posX> - <posY>580</posY> + <posX>0</posX> + <posY>695</posY> <texture>logo_rewind.png</texture> <animation effect="fade" time="500">WindowClose</animation> <animation effect="fade" time="250">WindowOpen</animation> @@ -75,10 +87,10 @@ <control> <description>album/artist/genre etc info label</description> <type>fadelabel</type> - <width>180</width> + <width>180</width> <height>40</height> - <posX>170</posX> - <posY>715</posY> + <posX>25</posX> + <posY>725</posY> <font>font13</font> <label>#Play.Current.Title\r#Play.Current.Artist\r#Play.Current.Album\r#Play.Current.Duration</label> <textcolor>FFFFFFFF</textcolor> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/myHome.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/myHome.xml 2007-09-05 17:23:54 UTC (rev 895) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/myHome.xml 2007-09-06 13:42:33 UTC (rev 896) @@ -2,29 +2,13 @@ <window> <id>0</id> <defaultcontrol>50</defaultcontrol> - <allowoverlay>no</allowoverlay> + <allowoverlay>yes</allowoverlay> <autohidetopbar>no</autohidetopbar> <controls> <import>common.window.xml</import> <import>common.time.xml</import> - <control> - <description>background image</description> - <type>image</type> - <id>1</id> - <width>1366</width> - <height>768</height> - </control> + <control> - <description>time block</description> - <type>image</type> - <id>1</id> - <posX>885</posX> - <posY>700</posY> - <width>471</width> - <height>58</height> - <texture>time_block.png</texture> - </control> - <control> <description>icon background</description> <type>image</type> <id>1</id> @@ -71,199 +55,124 @@ <texture>top-strip.png</texture> </control> + <control> - <description>Menu</description> - <type>menu</type> - <animation effect="fade" time="800">WindowOpen</animation> - <animation effect="fade" time="200">WindowClose</animation> - <animation effect="zoom" start="300,300" end="100,100" center="750,500" time="500">WindowOpen</animation> - <animation effect="zoom" start="100,100" end="5,5" center="750,500" time="300">WindowClose</animation> - <id>50</id> - <posX>508</posX> - <posY>180</posY> - <width>350</width> - <textcolor>ffffffff</textcolor> - <textColorNoFocus>ffffffff</textColorNoFocus> - <dimColor>80ffffff</dimColor> - <buttonTextXOff>30</buttonTextXOff> - <buttonTextYOff>15</buttonTextYOff> - <buttonOffset>0</buttonOffset> - <buttonFont>font16</buttonFont> - <buttonHeight>60</buttonHeight> - <spaceBetweenButtons>18</spaceBetweenButtons> - <numberOfButtons>5</numberOfButtons> - <textureButtonFocus>hp_selectionbar.png</textureButtonFocus> - <textureButtonNoFocus>-</textureButtonNoFocus> - <hoverX>150</hoverX> - <hoverY>220</hoverY> - <hoverWidth>300</hoverWidth> - <hoverHeight>600</hoverHeight> - <hoverKeepAspectratio>yes</hoverKeepAspectratio> - <scrollTime>100</scrollTime> - <scrollTimeMin>60</scrollTimeMin> - <textureBackground></textureBackground> - <onright>11</onright> - <onleft>10</onleft> - </control> - <!-- TOPBAR Buttons --> - <control> - <description>Shut Down button</description> + <description>shutdown button</description> <type>button</type> <animation effect="fade" time="1500">WindowOpen</animation> <animation effect="fade" time="500">WindowClose</animation> <animation effect="zoom" start="000,0" end="100,100" center="1326,39" time="150">focus</animation> <animation effect="zoom" start="100,100" end="100,100" center="1326,39" time="300">unfocus</animation> <id>10</id> - <posX>1300</posX> + <posX>1289</posX> <posY>10</posY> - <width>52</width> + <width>51</width> <height>58</height> <textureFocus>button_shutdown_focus.png</textureFocus> <textureNoFocus>button_shutdown_nofocus.png</textureNoFocus> <label>-</label> <action>99</action> - <onleft>13</onleft> - <onright>50</onright> + <onleft>50</onleft> + <onright>11</onright> <onup>10</onup> <ondown>50</ondown> </control> <control> - <description>videowallpaper button</description> + <description>Back button</description> <type>button</type> - <animation effect="fade" time="1500">WindowOpen</animation> + <animation effect="fade" time="1500">WindowOpen</animation> <animation effect="fade" time="500">WindowClose</animation> - <animation effect="zoom" start="100,100" end="100,100" center="1226,39" time="150">focus</animation> - <animation effect="zoom" start="100,100" end="100,100" center="1226,39" time="300">unfocus</animation> - <id>11</id> - <posX>1148</posX> + <animation effect="zoom" start="000,0" end="100,100" center="1326,39" time="150">focus</animation> + <animation effect="zoom" start="100,100" end="100,100" center="1326,39" time="300">unfocus</animation> + <id>21</id> + <posX>728</posX> <posY>10</posY> - <width>52</width> + <width>51</width> <height>58</height> - <textureFocus>button_tvdesktop_focus.png</textureFocus> - <textureNoFocus>button_tvdesktop_nofocus.png</textureNoFocus> + <textureFocus>back_enabled.png</textureFocus> + <textureNoFocus>back_disabled.png</textureNoFocus> + <action>10</action> <label>-</label> - <action>101</action> - <onleft>50</onleft> - <onright>12</onright> - <onup>11</onup> - <ondown>50</ondown> + <action>10</action> + <onleft>31</onleft> + <onright>26</onright> + <onup>21</onup> + <ondown>2</ondown> </control> <control> <description>basichome button button</description> <type>button</type> - <animation effect="fade" time="1500">WindowOpen</animation> + <animation effect="fade" time="1500">WindowOpen</animation> <animation effect="fade" time="500">WindowClose</animation> - <animation effect="zoom" start="100,100" end="100,100" center="978,39" time="150">focus</animation> - <animation effect="zoom" start="100,100" end="100,100" center="978,39" time="300">unfocus</animation> - <id>12</id> - <posX>1200</posX> + <animation effect="zoom" start="000,0" end="100,100" center="1326,39" time="150">focus</animation> + <animation effect="zoom" start="100,100" end="100,100" center="1326,39" time="300">unfocus</animation> + <id>26</id> + <posX>779</posX> <posY>10</posY> - <width>52</width> + <width>51</width> <height>58</height> <textureFocus>Basic_focus.png</textureFocus> <textureNoFocus>Basic_nofocus.png</textureNoFocus> <label>-</label> <action>115</action> - <onleft>11</onleft> - <onright>13</onright> - <onup>12</onup> - <ondown>50</ondown> + <onleft>21</onleft> + <onright>22</onright> + <onup>26</onup> + <ondown>2</ondown> </control> <control> - <description>Exit button</description> + <description>back button</description> <type>button</type> - <animation effect="fade" time="1500">WindowOpen</animation> + <animation effect="fade" time="1500">WindowOpen</animation> <animation effect="fade" time="500">WindowClose</animation> - <animation effect="zoom" start="100,100" end="100,100" center="1276,39" time="150">focus</animation> - <animation effect="zoom" start="100,100" end="100,100" center="1276,39" time="300">unfocus</animation> - <id>13</id> - <posX>1250</posX> + <animation effect="zoom" start="000,0" end="100,100" center="1326,39" time="150">focus</animation> + <animation effect="zoom" start="100,100" end="100,100" center="1326,39" time="300">unfocus</animation> + <id>22</id> + <posX>830</posX> <posY>10</posY> - <width>50</width> + <width>51</width> <height>58</height> - <textureFocus>button_close_focus.png</textureFocus> - <textureNoFocus>button_close_nofocus.png</textureNoFocus> + <textureFocus>skipback_enabled.png</textureFocus> + <textureNoFocus>skipback_disabled.png</textureNoFocus> + <action>15</action> <label>-</label> - <action>97</action> - <onleft>12</onleft> - <onright>10</onright> - <onup>13</onup> - <ondown>27</ondown> + <onleft>26</onleft> + <onright>23</onright> + <onup>22</onup> + <ondown>2</ondown> </control> - <control> - <visible>player.hasmedia</visible> - <description>video window</description> - <type>videowindow</type> - <id>99</id> - <posX>900</posX> - <posY>230</posY> - <width>400</width> - <height>225</height> - <onleft>50</onleft> - <onright>50</onright> - <onup>11</onup> - <ondown>27</ondown> - <action>18</action> - <textureFocus>tv_green_border.png</textureFocus> - <animation effect="fade" time="500">visiblechange</animation> - </control> - - <control> - <description>right end cap</description> - <description>image</description> - <type>image</type> - <id>1</id> - <posX>1260</posX> - <posY>460</posY> - <width>53</width> - <height>58</height> - <texture>endcap_right.png</texture> - <visible>Control.IsVisible(99)</visible> - <animation effect="fade" time="500">visiblechange</animation> - </control> - <control> - <description>left end cap</description> - <visible>player.hasmedia</visible> - <description>image</description> - <type>image</type> - <id>1</id> - <posX>895</posX> - <posY>460</posY> - <width>53</width> - <height>58</height> - <texture>endcap_left.png</texture> - <visible>Control.IsVisible(99)</visible> - <animation effect="fade" time="500">visiblechange</animation> - </control> - - - <control> + <control> <description>rewind button</description> <type>button</type> + <animation effect="fade" time="1500">WindowOpen</animation> + <animation effect="fade" time="500">WindowClose</animation> + <animation effect="zoom" start="000,0" end="100,100" center="1326,39" time="150">focus</animation> + <animation effect="zoom" start="100,100" end="100,100" center="1326,39" time="300">unfocus</animation> <id>23</id> - <posX>948</posX> - <posY>460</posY> - <width>52</width> + <posX>881</posX> + <posY>10</posY> + <width>51</width> <height>58</height> <textureFocus>rew_enabled.png</textureFocus> <textureNoFocus>rew_disabled.png</textureNoFocus> <action>78</action> <label>-</label> - <onleft>50</onleft> + <onleft>22</onleft> <onright>24</onright> - <onup>99</onup> - <ondown>11</ondown> - <visible>Control.IsVisible(99)</visible> - <animation effect="fade" time="500">visiblechange</animation> + <onup>23</onup> + <ondown>2</ondown> </control> <control> - <visible>player.hasmedia</visible> <description>play button</description> <type>button</type> + <animation effect="fade" time="1500">WindowOpen</animation> + <animation effect="fade" time="500">WindowClose</animation> + <animation effect="zoom" start="000,0" end="100,100" center="1326,39" time="150">focus</animation> + <animation effect="zoom" start="100,100" end="100,100" center="1326,39" time="300">unfocus</animation> <id>24</id> - <posX>1000</posX> - <posY>460</posY> - <width>52</width> + <posX>932</posX> + <posY>10</posY> + <width>51</width> <height>58</height> <textureFocus>play_enabled.png</textureFocus> <textureNoFocus>play_disabled.png</textureNoFocus> @@ -271,17 +180,19 @@ <label>-</label> <onleft>23</onleft> <onright>25</onright> - <onup>99</onup> - <ondown>11</ondown> - animation> - <animation effect="zoom" start="100,100" end="100,100" center="1326,39" time="300">unfocus</animation> + <onup>24</onup> + <ondown>2</ondown> </control> <control> <description>pause button</description> <type>button</type> + <animation effect="fade" time="1500">WindowOpen</animation> + <animation effect="fade" time="500">WindowClose</animation> + <animation effect="zoom" start="000,0" end="100,100" center="1326,39" time="150">focus</animation> + <animation effect="zoom" start="100,100" end="100,100" center="1326,39" time="300">unfocus</animation> <id>25</id> - <posX>1052</posX> - <posY>460</posY> + <posX>983</posX> + <posY>10</posY> <width>52</width> <height>58</height> <textureFocus>pause_enabled.png</textureFocus> @@ -290,19 +201,20 @@ <label>-</label> <onleft>24</onleft> <onright>27</onright> - <onup>99</onup> - <ondown>11</ondown> - <visible>Control.IsVisible(99)</visible> - <animation effect="fade" time="500">visiblechange</animation> + <onup>25</onup> + <ondown>2</ondown> </control> <control> - <visible>player.hasmedia</visible> <description>stop button</description> <type>button</type> + <animation effect="fade" time="1500">WindowOpen</animation> + <animation effect="fade" time="500">WindowClose</animation> + <animation effect="zoom" start="000,0" end="100,100" center="1326,39" time="150">focus</animation> + <animation effect="zoom" start="100,100" end="100,100" center="1326,39" time="300">unfocus</animation> <id>27</id> - <posX>1104</posX> - <posY>460</posY> - <width>52</width> + <posX>1034</posX> + <posY>10</posY> + <width>51</width> <height>58</height> <textureFocus>stop_enabled.png</textureFocus> <textureNoFocus>stop_disabled.png</textureNoFocus> @@ -310,19 +222,20 @@ <label>-</label> <onleft>25</onleft> <onright>28</onright> - <onup>99</onup> - <ondown>11</ondown> - <visible>Control.IsVisible(99)</visible> - <animation effect="fade" time="500">visiblechange</animation> + <onup>27</onup> + <ondown>2</ondown> </control> <control> - <visible>player.hasmedia</visible> <description>fast forward button</description> <type>button</type> + <animation effect="fade" time="1500">WindowOpen</animation> + <animation effect="fade" time="500">WindowClose</animation> + <animation effect="zoom" start="000,0" end="100,100" center="1326,39" time="150">focus</animation> + <animation effect="zoom" start="100,100" end="100,100" center="1326,39" time="300">unfocus</animation> <id>28</id> - <posX>1156</posX> - <posY>460</posY> - <width>52</width> + <posX>1085</posX> + <posY>10</posY> + <width>51</width> <height>58</height> <textureFocus>fastforward_enabled.png</textureFocus> <textureNoFocus>fastforward_disabled.png</textureNoFocus> @@ -330,18 +243,19 @@ <label>-</label> <onleft>27</onleft> <onright>29</onright> - <onup>99</onup> - <ondown>11</ondown> - <visible>Control.IsVisible(99)</visible> - <animation effect="fade" time="500">visiblechange</animation> + <onup>28</onup> + <ondown>2</ondown> </control> <control> - <visible>player.hasmedia</visible> <description>next button</description> <type>button</type> + <animation effect="fade" time="1500">WindowOpen</animation> + <animation effect="fade" time="500">WindowClose</animation> + <animation effect="zoom" start="000,0" end="100,100" center="1326,39" time="150">focus</animation> + <animation effect="zoom" start="100,100" end="100,100" center="1326,39" time="300">unfocus</animation> <id>29</id> - <posX>1208</posX> - <posY>460</posY> + <posX>1136</posX> + <posY>10</posY> <width>52</width> <height>58</height> <textureFocus>skipforward_enabled.png</textureFocus> @@ -349,12 +263,90 @@ <action>14</action> <label>-</label> <onleft>28</onleft> - <onright>50</onright> - <onup>99</onup> - <ondown>11</ondown> - <visible>Control.IsVisible(99)</visible> - <animation effect="fade" time="500">visiblechange</animation> + <onright>30</onright> + <onup>29</onup> + <ondown>2</ondown> </control> + <control> + <description>Minimize button</description> + <type>button</type> + <animation effect="fade" time="1500">WindowOpen</animation> + <animation effect="fade" time="500">WindowClose</animation> + <animation effect="zoom" start="000,0" end="100,100" center="1326,39" time="150">focus</animation> + <animation effect="zoom" start="100,100" end="100,100" center="1326,39" time="300">unfocus</animation> + <id>30</id> + <posX>1187</posX> + <posY>10</posY> + <width>52</width> + <height>58</height> + <textureFocus>minimize_enabled.png</textureFocus> + <textureNoFocus>minimize_disabled.png</textureNoFocus> + <label>-</label> + <action>18</action> + <onleft>29</onleft> + <onright>31</onright> + <onup>30</onup> + <ondown>2</ondown> + </control> + <control> + <description>Exit button</description> + <type>button</type> + <animation effect="fade" time="1500">WindowOpen</animation> + <animation effect="fade" time="500">WindowClose</animation> + <animation effect="zoom" start="000,0" end="100,100" center="1326,39" time="150">focus</animation> + <animation effect="zoom" start="100,100" end="100,100" center="1326,39" time="300">unfocus</animation> + <id>31</id> + <posX>1238</posX> + <posY>10</posY> + <width>52</width> + <height>58</height> + <textureFocus>exit_enabled.png</textureFocus> + <textureNoFocus>exit_disabled.png</textureNoFocus> + <action>97</action> + <label>-</label> + <action>97</action> + <onleft>30</onleft> + <onright>21</onright> + <onup>31</onup> + <ondown>2</ondown> + </control> + + + <control> + <description>Menu</description> + <type>menu</type> + <animation effect="fade" time="800">WindowOpen</animation> + <animation effect="fade" time="200">WindowClose</animation> + <animation effect="zoom" start="300,300" end="100,100" center="750,500" time="500">WindowOpen</animation> + <animation effect="zoom" start="100,100" end="5,5" center="750,500" time="300">WindowClose</animation> + <id>50</id> + <posX>508</posX> + <posY>180</posY> + <width>350</width> + <textcolor>ffffffff</textcolor> + <textColorNoFocus>ffffffff</textColorNoFocus> + <dimColor>80ffffff</dimColor> + <buttonTextXOff>30</buttonTextXOff> + <buttonTextYOff>15</buttonTextYOff> + <buttonOffset>0</buttonOffset> + <buttonFont>font16</buttonFont> + <buttonHeight>60</buttonHeight> + <spaceBetweenButtons>18</spaceBetweenButtons> + <numberOfButtons>5</numberOfButtons> + <textureButtonFocus>hp_selectionbar.png</textureButtonFocus> + <textureButtonNoFocus>-</textureButtonNoFocus> + <hoverX>150</hoverX> + <hoverY>220</hoverY> + <hoverWidth>300</hoverWidth> + <hoverHeight>600</hoverHeight> + <hoverKeepAspectratio>yes</hoverKeepAspectratio> + <scrollTime>100</scrollTime> + <scrollTimeMin>60</scrollTimeMin> + <textureBackground></textureBackground> + <onright>11</onright> + <onleft>10</onleft> + </control> + <control> <type>image</type> <id>1</id> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicsongs.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicsongs.xml 2007-09-05 17:23:54 UTC (rev 895) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicsongs.xml 2007-09-06 13:42:33 UTC (rev 896) @@ -104,7 +104,7 @@ <id>1</id> <animation effect="fade" time="400">WindowClose</animation> <animation effect="fade" time="400">WindowOpen</animation> - <posX>200</posX> + <posX>240</posX> <posY>600</posY> <width>1000</width> <label>#selecteditem</label> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/videoOverlay.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/videoOverlay.xml 2007-09-05 17:23:54 UTC (rev 895) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/videoOverlay.xml 2007-09-06 13:42:33 UTC (rev 896) @@ -3,16 +3,29 @@ <id>3000</id> <defaultcontrol>2</defaultcontrol> <controls> - <control> + + <control> + <description>VIDEO BACKGROUND</description> + <type>image</type> + <id>0</id> + <posX>10</posX> + <posY>575</posY> + <width>211</width> + <height>182</height> + <texture>tv_background.png</texture> + <animation effect="fade" time="500">WindowClose</animation> + <animation effect="fade" time="250">WindowOpen</animation> + </control> + <control> <description>play time label</description> <type>label</type> <id>2</id> - <posX>20</posX> + <posX>50</posX> <posY>705</posY> <label>#currentplaytime</label> <align>left</align> - <font>font13</font> - <textcolor>ffffffff</textcolor> + <font>wipeout</font> + <textcolor>20ffffff</textcolor> <animation effect="fade" time="500">WindowClose</animation> <animation effect="fade" time="250">WindowOpen</animation> </control> @@ -20,8 +33,8 @@ <description>play logo</description> <type>image</type> <id>3</id> - <posX>37</posX> - <posY>528</posY> + <posX>0</posX> + <posY>695</posY> <texture>logo_play.png</texture> <animation effect="fade" time="500">WindowClose</animation> <animation effect="fade" time="250">WindowOpen</animation> @@ -30,8 +43,8 @@ <description>Pause logo</description> <type>image</type> <id>4</id> - <posX>36</posX> - <posY>525</posY> + <posX>0</posX> + <posY>695</posY> <texture>logo_pause.png</texture> <animation effect="fade" time="500">WindowClose</animation> <animation effect="fade" time="250">WindowOpen</animation> @@ -40,8 +53,8 @@ <description>FF logo</description> <type>image</type> <id>7</id> - <posX>18</posX> - <posY>528</posY> + <posX>0</posX> + <posY>695</posY> <texture>logo_fastforward.png</texture> <animation effect="fade" time="500">WindowClose</animation> <animation effect="fade" time="250">WindowOpen</animation> @@ -50,8 +63,8 @@ <description>RW logo</description> <type>image</type> <id>8</id> - <posX>18</posX> - <posY>528</posY> + <posX>0</posX> + <posY>695</posY> <texture>logo_rewind.png</texture> <animation effect="fade" time="500">WindowClose</animation> <animation effect="fade" time="250">WindowOpen</animation> @@ -59,10 +72,10 @@ <control> <description>scrolling info label</description> <type>fadelabel</type> - <width>700</width> + <width>180</width> <height>40</height> - <posX>170</posX> - <posY>705</posY> + <posX>25</posX> + <posY>725</posY> <font>font13</font> <label>#Play.Current.Title\r#Play.Current.Genre\r#Play.Current.Year\r#Play.Current.Director</label> <animation effect="fade" time="500">WindowClose</animation> @@ -74,8 +87,8 @@ <description>video preview window</description> <type>videowindow</type> <id>1</id> - <posX>157</posX> - <posY>574</posY> + <posX>20</posX> + <posY>600</posY> <width>180</width> <height>101</height> <action>18</action> @@ -83,5 +96,6 @@ <animation effect="fade" time="500">WindowClose</animation> <animation effect="fade" time="250">WindowOpen</animation> </control> + </controls> </window> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-09-05 17:23:57
|
Revision: 895 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=895&view=rev Author: and-81 Date: 2007-09-05 10:23:54 -0700 (Wed, 05 Sep 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrCode.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrDecoder.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/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/Microsoft MCE Transceiver/Pronto.cs Added Paths: ----------- 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 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 2007-09-05 13:05:02 UTC (rev 894) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs 2007-09-05 17:23:54 UTC (rev 895) @@ -11,6 +11,9 @@ namespace MicrosoftMceTransceiver { + /// <summary> + /// Base class for the different MCE device driver access classes. + /// </summary> public abstract class Driver { @@ -111,7 +114,8 @@ struct DeviceInterfaceDetailData { public int Size; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string DevicePath; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] + public string DevicePath; } #endregion Structures @@ -196,12 +200,28 @@ #region Abstract Methods + /// <summary> + /// Start using the device. + /// </summary> public abstract void Start(); + /// <summary> + /// Stop access to the device. + /// </summary> public abstract void Stop(); - + // TODO: Change learn interface to return LearnStatus + /// <summary> + /// Learn an IR Command. + /// </summary> + /// <param name="learnTimeout">How long to wait before aborting learn.</param> + /// <returns>Newly learned IR Command.</returns> public abstract IrCode Learn(int learnTimeout); + /// <summary> + /// Send an IR Command. + /// </summary> + /// <param name="code">IR code data to send.</param> + /// <param name="port">IR port to send to.</param> public abstract void Send(IrCode code, uint port); #endregion Abstract Methods Added: 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 (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverReplacement.cs 2007-09-05 17:23:54 UTC (rev 895) @@ -0,0 +1,759 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.IO; +using System.Runtime.InteropServices; +using System.ServiceProcess; +using System.Text; +using System.Threading; + +using Microsoft.Win32.SafeHandles; + +namespace MicrosoftMceTransceiver +{ + + public class DriverReplacement : Driver + { + + #region Interop + + [DllImport("kernel32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool GetOverlappedResult( + SafeFileHandle handle, + ref NativeOverlapped overlapped, + out int bytesTransferred, + bool wait); + + [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)] + static extern SafeFileHandle CreateFile( + [MarshalAs(UnmanagedType.LPTStr)] string fileName, + [MarshalAs(UnmanagedType.U4)] FileAccessTypes fileAccess, + [MarshalAs(UnmanagedType.U4)] FileShares fileShare, + IntPtr securityAttributes, + [MarshalAs(UnmanagedType.U4)] CreationDisposition creationDisposition, + [MarshalAs(UnmanagedType.U4)] FileAttributes flags, + IntPtr templateFile); + + [DllImport("kernel32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool ReadFile( + SafeFileHandle handle, + IntPtr buffer, + int bytesToRead, + out int bytesRead, + ref NativeOverlapped overlapped); + + [DllImport("kernel32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool WriteFile( + SafeFileHandle handle, + byte[] buffer, + int bytesToWrite, + out int bytesWritten, + ref NativeOverlapped overlapped); + + [DllImport("kernel32.dll")] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool CancelIo( + SafeFileHandle handle); + + [DllImport("kernel32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool CloseHandle( + SafeFileHandle handle); + + #endregion Interop + + #region Enumerations + + /// <summary> + /// Type of device in use. + /// This is used to determine the blaster port selection method. + /// </summary> + enum DeviceType + { + /// <summary> + /// Device is a first party Microsoft MCE transceiver. + /// </summary> + Microsoft = 0, + /// <summary> + /// Device is an third party SMK or Topseed MCE transceiver. + /// </summary> + SmkTopseed = 1, + } + + /// <summary> + /// Device input port. + /// </summary> + enum InputPort + { + Receive = 0, + Learning = 1, + } + + /// <summary> + /// Read Thread Mode. + /// </summary> + enum ReadThreadMode + { + Receiving, + Learning, + LearningDone, + LearningFailed, + Stop, + } + + #endregion Enumerations + + #region Constants + + // Vendor ID's for SMK and Topseed devices. + const string VidSMK = "vid_1784"; + const string VidTopseed = "vid_0609"; + + // Device variables + const int DeviceBufferSize = 100; + const int PacketTimeout = 100; + const int WriteSyncTimeout = 5000; + + // Microsoft Port Packets + static readonly byte[][] MicrosoftPorts = new byte[][] + { + new byte[] { 0x9F, 0x08, 0x06 }, // Both + new byte[] { 0x9F, 0x08, 0x04 }, // 1 + new byte[] { 0x9F, 0x08, 0x02 }, // 2 + }; + + // SMK or Topseed Port Packets + static readonly byte[][] SmkTopseedPorts = new byte[][] + { + new byte[] { 0x9F, 0x08, 0x00 }, // Both + new byte[] { 0x9F, 0x08, 0x01 }, // 1 + new byte[] { 0x9F, 0x08, 0x02 }, // 2 + }; + + // Start and Stop Packets + static readonly byte[] StartPacket = { 0x00, 0xFF, 0xAA }; + static readonly byte[] StopPacket = { 0xFF, 0xBB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; + + // Misc Packets + static readonly byte[] SetCarrierFreqPacket = { 0x9F, 0x06, 0x01, 0x80 }; + static readonly byte[] SetInputPortPacket = { 0x9F, 0x14, 0x00 }; + static readonly byte[] SetTimeoutPacket = { 0x9F, 0x0C, 0x00, 0x00 }; + + #endregion Constants + + #region Variables + + NotifyWindow _notifyWindow; + + SafeFileHandle _readHandle; + SafeFileHandle _writeHandle; + + Thread _readThread; + ReadThreadMode _readThreadMode; + ManualResetEvent _stopReadThread; + + IrCode _learningCode; + + DeviceType _deviceType = DeviceType.Microsoft; + + //StreamWriter _debugFile; + + #endregion Variables + + #region Constructor + + public DriverReplacement(Guid deviceGuid, string devicePath, RemoteCallback remoteCallback, KeyboardCallback keyboardCallback, MouseCallback mouseCallback) + : base(deviceGuid, devicePath, remoteCallback, keyboardCallback, mouseCallback) + { + if (devicePath.IndexOf(VidSMK, StringComparison.InvariantCultureIgnoreCase) != -1 || devicePath.IndexOf(VidTopseed, StringComparison.InvariantCultureIgnoreCase) != -1) + _deviceType = DeviceType.SmkTopseed; + else + _deviceType = DeviceType.Microsoft; + } + + #endregion Constructor + + #region Driver overrides + + public override void Start() + { + //_debugFile = new StreamWriter("\\DriverReplacement.log", false); + //_debugFile.AutoFlush = true; + + _notifyWindow = new NotifyWindow(); + _notifyWindow.Class = _deviceGuid; + + int lastError; + + _readHandle = CreateFile(_devicePath + "\\Pipe01", FileAccessTypes.GenericRead, FileShares.None, IntPtr.Zero, CreationDisposition.OpenExisting, FileAttributes.Overlapped, IntPtr.Zero); + lastError = Marshal.GetLastWin32Error(); + if (_readHandle.IsInvalid) + throw new Win32Exception(lastError); + + _writeHandle = CreateFile(_devicePath + "\\Pipe00", FileAccessTypes.GenericWrite, FileShares.None, IntPtr.Zero, CreationDisposition.OpenExisting, FileAttributes.Overlapped, IntPtr.Zero); + lastError = Marshal.GetLastWin32Error(); + if (_writeHandle.IsInvalid) + throw new Win32Exception(lastError); + + // Initialize device ... + WriteSync(StartPacket); + SetTimeout(PacketTimeout); + SetInputPort(InputPort.Receive); + + StartReadThread(); + + _notifyWindow.Create(); + _notifyWindow.DeviceArrival += new DeviceEventHandler(OnDeviceArrival); + _notifyWindow.DeviceRemoval += new DeviceEventHandler(OnDeviceRemoval); + _notifyWindow.RegisterDeviceRemoval(_readHandle.DangerousGetHandle()); + } + + public override void Stop() + { + WriteSync(StopPacket); + + OnDeviceRemoval(); + + CloseDevice(); + + //_debugFile.Close(); + } + + public override IrCode Learn(int learnTimeout) + { + //_debugFile.WriteLine("Start Learn"); + + _learningCode = new IrCode(); + + SetInputPort(InputPort.Learning); + + int learnStartTick = Environment.TickCount; + _readThreadMode = ReadThreadMode.Learning; + + // Wait for the learning to finish ... + while (_readThreadMode == ReadThreadMode.Learning && Environment.TickCount < learnStartTick + learnTimeout) + Thread.Sleep(100); + + //_debugFile.WriteLine("End Learn"); + + ReadThreadMode modeWas = _readThreadMode; + + _readThreadMode = ReadThreadMode.Receiving; + SetInputPort(InputPort.Receive); + + switch (modeWas) + { + case ReadThreadMode.Learning: + // Timeout. + return null; + + case ReadThreadMode.LearningFailed: + // Failure. + return null; + + case ReadThreadMode.LearningDone: + //_debugFile.WriteLine(_learningCode.ToByteArray()); + + if (_learningCode.FinalizeData()) + return _learningCode; // Success. + else + return null; // Failure. + + default: + return null; + } + } + + public override void Send(IrCode code, uint port) + { + //_debugFile.WriteLine("Send"); + + byte[] portPacket; + switch (_deviceType) + { + case DeviceType.Microsoft: portPacket = MicrosoftPorts[port]; break; + case DeviceType.SmkTopseed: portPacket = SmkTopseedPorts[port]; break; + default: + throw new Exception("Invalid device type"); + } + + //Dump(code.ToByteArray()); + + // Set port + WriteSync(portPacket); + + // Set carrier frequency + WriteSync(CarrierPacket(code)); + + // Send packet + WriteSync(DataPacket(code)); + } + + #endregion Driver overrides + + #region Implementation + + byte[] CarrierPacket(IrCode code) + { + byte[] carrierPacket = new byte[SetCarrierFreqPacket.Length]; + SetCarrierFreqPacket.CopyTo(carrierPacket, 0); + + if (code.Carrier == IrCode.CarrierFrequencyUnknown || code.Carrier == IrCode.CarrierFrequencyDCMode) + return carrierPacket; + + for (int scaler = 1; scaler <= 4; scaler++) + { + int divisor = (10000000 >> (2 * scaler)) / code.Carrier; + + if (divisor <= 0xFF) + { + carrierPacket[2] = (byte)scaler; + carrierPacket[3] = (byte)divisor; + break; + } + } + + return carrierPacket; + } + + byte[] DataPacket(IrCode code) + { + if (code.TimingData.Length == 0) + return null; + + // Construct data bytes into "packet" ... + List<byte> packet = new List<byte>(); + + for (int index = 0; index < code.TimingData.Length; index++) + { + double time = (double)code.TimingData[index]; + + byte duration = (byte)Math.Abs(Math.Round(time / 50)); + bool pulse = (time > 0); + + while (duration > 0x7F) + { + packet.Add((byte)(pulse ? 0xFF : 0x7F)); + + duration -= 0x7F; + } + + packet.Add((byte)(pulse ? 0x80 | duration : duration)); + } + + // Insert byte count markers into packet data bytes ... + int subpackets = (int)Math.Ceiling(packet.Count / (double)4); + + byte[] output = new byte[packet.Count + subpackets + 1]; + + int outputPos = 0; + + for (int packetPos = 0; packetPos < packet.Count; ) + { + byte copyCount = (byte)(packet.Count - packetPos < 4 ? packet.Count - packetPos : 0x04); + + output[outputPos++] = (byte)(0x80 | copyCount); + + for (int index = 0; index < copyCount; index++) + output[outputPos++] = packet[packetPos++]; + } + + output[outputPos] = 0x80; + + return output; + } + + /// <summary> + /// Set the receive buffer timeout. + /// </summary> + /// <param name="timeout">Packet timeout (in milliseconds).</param> + void SetTimeout(int timeout) + { + byte[] timeoutPacket = new byte[SetTimeoutPacket.Length]; + SetTimeoutPacket.CopyTo(timeoutPacket, 0); + + int timeoutSamples = 20 * timeout; + + timeoutPacket[2] = (byte)(timeoutSamples >> 8); + timeoutPacket[3] = (byte)(timeoutSamples % 256); + + WriteSync(timeoutPacket); + } + + void SetInputPort(InputPort port) + { + byte[] inputPortPacket = new byte[SetInputPortPacket.Length]; + SetInputPortPacket.CopyTo(inputPortPacket, 0); + + inputPortPacket[2] = (byte)(port + 1); + + WriteSync(inputPortPacket); + } + + void StartReadThread() + { + _stopReadThread = new ManualResetEvent(false); + _readThreadMode = ReadThreadMode.Receiving; + + _readThread = new Thread(new ThreadStart(ReadThread)); + _readThread.IsBackground = true; + _readThread.Name = "IR Server Microsoft MCE Transceiver Read"; + _readThread.Start(); + } + + void StopReadThread() + { + if (_readThread != null) + { + _readThreadMode = ReadThreadMode.Stop; + _stopReadThread.Set(); + + //_readThread.Abort(); + + if (Thread.CurrentThread != _readThread) + _readThread.Join(); + + _readThread = null; + } + } + + void CloseDevice() + { + if (_readHandle != null) + CloseHandle(_readHandle); + + if (_writeHandle != null) + CloseHandle(_writeHandle); + } + + void OnDeviceArrival() + { + _notifyWindow.UnregisterDeviceArrival(); + + StartReadThread(); + + _notifyWindow.RegisterDeviceRemoval(_readHandle.DangerousGetHandle()); + } + void OnDeviceRemoval() + { + _notifyWindow.UnregisterDeviceRemoval(); + _notifyWindow.RegisterDeviceArrival(); + + StopReadThread(); + } + + void ReadThread() + { + int bytesRead; + TimeSpan sinceLastPacket; + DateTime lastPacketTime = DateTime.Now; + + byte[] packetBytes; + + int lastError; + + NativeOverlapped lpOverlapped = new NativeOverlapped(); + lpOverlapped.InternalLow = IntPtr.Zero; + lpOverlapped.InternalHigh = IntPtr.Zero; + lpOverlapped.OffsetLow = 0; + lpOverlapped.OffsetHigh = 0; + + WaitHandle waitHandle = new ManualResetEvent(false); + SafeHandle safeWaitHandle = waitHandle.SafeWaitHandle; + WaitHandle[] waitHandles = new WaitHandle[] { waitHandle, _stopReadThread }; + + bool success = false; + safeWaitHandle.DangerousAddRef(ref success); + if (!success) + return; + + IntPtr deviceBufferPtr = IntPtr.Zero; + + try + { + deviceBufferPtr = Marshal.AllocHGlobal(DeviceBufferSize); + + while (_readThreadMode != ReadThreadMode.Stop) + { + bytesRead = 0; + + lpOverlapped.EventHandle = safeWaitHandle.DangerousGetHandle(); + + bool readDevice = ReadFile(_readHandle, deviceBufferPtr, DeviceBufferSize, out bytesRead, ref lpOverlapped); + lastError = Marshal.GetLastWin32Error(); + + if (!readDevice) + { + if (lastError != Win32ErrorCodes.ERROR_SUCCESS && lastError != Win32ErrorCodes.ERROR_IO_PENDING) + throw new Win32Exception(lastError); + + while (true) + { + int handle = WaitHandle.WaitAny(waitHandles, PacketTimeout + 50, false); + + if (handle == Win32ErrorCodes.WAIT_TIMEOUT) + continue; + else if (handle == 0) + break; + else if (handle == 1) + throw new Exception("Stop Read Thread"); + else + throw new Exception("Invalid wait handle return"); + } + + bool getOverlapped = GetOverlappedResult(_readHandle, ref lpOverlapped, out bytesRead, true); + lastError = Marshal.GetLastWin32Error(); + + if (!getOverlapped) + { + if (lastError != Win32ErrorCodes.ERROR_SUCCESS) + throw new Win32Exception(lastError); + } + } + + if (bytesRead == 0) + continue; + + sinceLastPacket = DateTime.Now.Subtract(lastPacketTime); + if (sinceLastPacket.TotalMilliseconds >= PacketTimeout) + IrDecoder.DecodeIR(null, null, null, null); + + lastPacketTime = DateTime.Now; + + packetBytes = new byte[bytesRead]; + Marshal.Copy(deviceBufferPtr, packetBytes, 0, bytesRead); + + //Dump(packetBytes); + + int[] timingData; + + switch (_readThreadMode) + { + case ReadThreadMode.Receiving: + { + if (packetBytes[0] >= 0x81 && packetBytes[0] <= 0x8F) + { + timingData = GetTimingDataFromPacket(packetBytes); + if (timingData == null) + break; + + IrDecoder.DecodeIR(timingData, _remoteCallback, _keyboardCallback, _mouseCallback); + } + break; + } + + case ReadThreadMode.Learning: + { + timingData = GetTimingDataFromPacket(packetBytes); + if (timingData == null) + { + if (_learningCode.TimingData.Length > 0) + { + _learningCode = null; + _readThreadMode = ReadThreadMode.LearningFailed; + } + break; + } + + _learningCode.AddTimingData(timingData); + + // 9F 01 02 9F 15 00 BE 80 + int indexOf9F = Array.IndexOf(packetBytes, (byte)0x9F); + while (indexOf9F != -1) + { + if (packetBytes.Length > indexOf9F + 3 && packetBytes[indexOf9F + 1] == 0x15) + { + byte b1 = packetBytes[indexOf9F + 2]; + byte b2 = packetBytes[indexOf9F + 3]; + + int onTime, onCount; + GetIrCodeLengths(_learningCode, out onTime, out onCount); + + double carrierCount = ((b1 * 256) + b2); + + if (carrierCount / onCount < 2) + { + _learningCode.Carrier = IrCode.CarrierFrequencyDCMode; + } + else + { + double carrier = (double)1000000 * carrierCount / onTime; + + if (carrier > 32000) + _learningCode.Carrier = (int)(carrier + 0.05 * carrier - 32000 / 48000); + else + _learningCode.Carrier = (int)carrier; + } + + //_debugFile.WriteLine(String.Format("Carrier Freq ({0:X2}, {1:X2}): {2}", b1, b2, _learningCode.Carrier)); + + _readThreadMode = ReadThreadMode.LearningDone; + break; + } + + if (packetBytes.Length > indexOf9F + 1) + indexOf9F = Array.IndexOf(packetBytes, (byte)0x9F, indexOf9F + 1); + else + { + _readThreadMode = ReadThreadMode.LearningFailed; + break; + } + } + + break; + } + } + + } + } + catch + { + CancelIo(_readHandle); + } + finally + { + if (deviceBufferPtr != IntPtr.Zero) + Marshal.FreeHGlobal(deviceBufferPtr); + + safeWaitHandle.DangerousRelease(); + waitHandle.Close(); + } + } + /* + void Dump(byte[] data) + { + _debugFile.WriteLine("Dump"); + foreach (byte d in data) + _debugFile.Write(String.Format("{0:X2} ", d)); + _debugFile.WriteLine(); + } + */ + void WriteSync(byte[] data) + { + NativeOverlapped lpOverlapped = new NativeOverlapped(); + lpOverlapped.InternalLow = IntPtr.Zero; + lpOverlapped.InternalHigh = IntPtr.Zero; + lpOverlapped.OffsetLow = 0; + lpOverlapped.OffsetHigh = 0; + + int bytesWritten = 0; + + int lastError; + + WaitHandle waitHandle = new ManualResetEvent(false); + SafeHandle safeWaitHandle = waitHandle.SafeWaitHandle; + WaitHandle[] waitHandles = new WaitHandle[] { waitHandle }; + + bool success = false; + safeWaitHandle.DangerousAddRef(ref success); + if (!success) + return; + + try + { + lpOverlapped.EventHandle = safeWaitHandle.DangerousGetHandle(); + + bool writeDevice = WriteFile(_writeHandle, data, data.Length, out bytesWritten, ref lpOverlapped); + lastError = Marshal.GetLastWin32Error(); + + if (!writeDevice) + { + if (lastError != Win32ErrorCodes.ERROR_SUCCESS && lastError != Win32ErrorCodes.ERROR_IO_PENDING) + throw new Win32Exception(lastError); + + int handle = WaitHandle.WaitAny(waitHandles, WriteSyncTimeout, false); + + if (handle == Win32ErrorCodes.WAIT_TIMEOUT) + throw new Exception("Timeout trying to write data to device"); + else if (handle != 0) + throw new Exception("Invalid wait handle return"); + + bool getOverlapped = GetOverlappedResult(_writeHandle, ref lpOverlapped, out bytesWritten, true); + lastError = Marshal.GetLastWin32Error(); + + if (!getOverlapped) + { + if (lastError != Win32ErrorCodes.ERROR_SUCCESS) + throw new Win32Exception(lastError); + } + } + } + catch + { + CancelIo(_writeHandle); + throw; + } + finally + { + safeWaitHandle.DangerousRelease(); + waitHandle.Close(); + } + } + + int[] GetTimingDataFromPacket(byte[] packet) + { + List<int> timingData = new List<int>(); + + int len = 0; + + for (int index = 0; index < packet.Length; ) + { + byte curByte = packet[index]; + + if (curByte == 0x9F) + break; + + if (curByte < 0x81 || curByte > 0x8F) + return null; + + int bytes = curByte & 0x7F; + int j; + + for (j = index + 1; j < index + bytes + 1; j++) + { + curByte = packet[j]; + + if ((curByte & 0x80) != 0) + len += (int)(curByte & 0x7F); + else + len -= (int)curByte; + + if ((curByte & 0x7F) != 0x7F) + { + timingData.Add(len * 50); + len = 0; + } + } + + index = j; + } + + if (len != 0) + timingData.Add(len * 50); + + return timingData.ToArray(); + } + + void GetIrCodeLengths(IrCode code, out int onTime, out int onCount) + { + onTime = 0; + onCount = 0; + + foreach (int time in code.TimingData) + { + if (time > 0) + { + onTime += time; + onCount++; + } + } + } + + #endregion Implementation + + } + +} Added: 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 (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverVista.cs 2007-09-05 17:23:54 UTC (rev 895) @@ -0,0 +1,860 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.IO; +using System.Runtime.InteropServices; +using System.ServiceProcess; +using System.Text; +using System.Threading; + +using Microsoft.Win32.SafeHandles; + +namespace MicrosoftMceTransceiver +{ + + public class DriverVista : Driver + { + + #region Constants + + // Device variables + const int DeviceBufferSize = 100; + const int PacketTimeout = 100; + const int WriteSyncTimeout = 5000; + + #endregion Constants + + #region Enumerations + + public enum IoCtrl : uint + { + StartReceive = 0x0F608028, + StopReceive = 0x0F60802C, + GetDetails = 0x0F604004, + GetBlasters = 0x0F604008, + Receive = 0x0F604022, + Transmit = 0x0F608015, + } + + /// <summary> + /// IR Device Capability Flags. + /// </summary> + [Flags] + public enum DeviceCapabilityFlags : uint + { + /// <summary> + /// Hardware supports legacy key signing. + /// </summary> + LegacySigning = 0x0001, + /// <summary> + /// Hardware has unique serial number. + /// </summary> + SerialNumber = 0x0002, + /// <summary> + /// Can hardware flash LED to identify receiver? + /// </summary> + FlashLed = 0x0004, + /// <summary> + /// Is this a legacy device? + /// </summary> + Legacy = 0x0008, + /// <summary> + /// Device can wake from S1. + /// </summary> + WakeS1 = 0x0010, + /// <summary> + /// Device can wake from S2. + /// </summary> + WakeS2 = 0x0020, + /// <summary> + /// Device can wake from S3. + /// </summary> + WakeS3 = 0x0040, + /// <summary> + /// Device can wake from S4. + /// </summary> + WakeS4 = 0x0080, + /// <summary> + /// Device can wake from S5. + /// </summary> + WakeS5 = 0x0100, + } + + [Flags] + public enum TransmitFlags : uint + { + /// <summary> + /// Pulse Mode. + /// </summary> + PulseMode = 0x01, + /// <summary> + /// DC Mode. + /// </summary> + DCMode = 0x02, + } + + /// <summary> + /// Read Thread Mode. + /// </summary> + enum ReadThreadMode + { + Receiving, + Learning, + LearningDone, + LearningFailed, + Stop, + } + + #endregion Enumerations + + #region Structures + + [StructLayout(LayoutKind.Sequential)] + public struct TransmitChunk + { + /// <summary> + /// Next chunk offset. + /// </summary> + public uint OffsetToNextChunk; + /// <summary> + /// Repeat count. + /// </summary> + public uint RepeatCount; + /// <summary> + /// Number of bytes. + /// </summary> + public uint ByteCount; + } + + [StructLayout(LayoutKind.Sequential)] + public struct TransmitParams + { + /// <summary> + /// Bitmask containing ports to transmit on. + /// </summary> + public uint TransmitPortMask; + /// <summary> + /// Carrier period. + /// </summary> + public uint CarrierPeriod; + /// <summary> + /// Transmit Flags. + /// </summary> + [MarshalAs(UnmanagedType.U4)] + public TransmitFlags Flags; + /// <summary> + /// Pulse Size. If Pulse Mode Flag set. + /// </summary> + public uint PulseSize; + } + + [StructLayout(LayoutKind.Sequential)] + public struct ReceiveParams + { + /// <summary> + /// Last packet in block? + /// </summary> + public uint DataEnd; + /// <summary> + /// Number of bytes in block. + /// </summary> + public uint ByteCount; + /// <summary> + /// Carrier frequency of IR received. + /// </summary> + public uint CarrierFrequency; + } + + [StructLayout(LayoutKind.Sequential)] + public struct StartReceiveParams + { + /// <summary> + /// Index of the receiver to use. + /// </summary> + public uint Receiver; + /// <summary> + /// Receive timeout, in milliseconds? + /// </summary> + public uint Timeout; + } + + [StructLayout(LayoutKind.Sequential)] + public struct DeviceCapabilities + { + /// <summary> + /// Protocol version. Currently must be 100 (1.0). + /// </summary> + public uint ProtocolVersion; + /// <summary> + /// Number of transmit ports \x96 0-32. + /// </summary> + public uint TransmitPorts; + /// <summary> + /// Number of receive ports \x96 0-32 (For beanbag, this is two (one for learning, one for normal). + /// </summary> + public uint ReceivePorts; + /// <summary> + /// Bitmask identifying which receivers are learning receivers \x96 low bit is the first receiver, second-low bit is the second receiver, etc ... + /// </summary> + public uint LearningMask; + /// <summary> + /// Device flags. + /// </summary> + [MarshalAs(UnmanagedType.U4)] + public DeviceCapabilityFlags DetailsFlags; + } + + #endregion Structures + + #region Interop + + [DllImport("kernel32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool DeviceIoControl( + SafeFileHandle handle, + [MarshalAs(UnmanagedType.U4)] IoCtrl ioControlCode, + IntPtr inBuffer, int inBufferSize, + IntPtr outBuffer, int outBufferSize, + out int bytesReturned, + ref NativeOverlapped overlapped); + + [DllImport("kernel32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool DeviceIoControl( + SafeFileHandle handle, + [MarshalAs(UnmanagedType.U4)] IoCtrl ioControlCode, + IntPtr inBuffer, int inBufferSize, + IntPtr outBuffer, int outBufferSize, + out int bytesReturned, + IntPtr overlapped); + + [DllImport("kernel32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool GetOverlappedResult( + SafeFileHandle handle, + ref NativeOverlapped overlapped, + out int bytesTransferred, + bool wait); + + [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)] + static extern SafeFileHandle CreateFile( + [MarshalAs(UnmanagedType.LPTStr)] string fileName, + [MarshalAs(UnmanagedType.U4)] FileAccessTypes fileAccess, + [MarshalAs(UnmanagedType.U4)] FileShares fileShare, + IntPtr securityAttributes, + [MarshalAs(UnmanagedType.U4)] CreationDisposition creationDisposition, + [MarshalAs(UnmanagedType.U4)] FileAttributes flags, + IntPtr templateFile); + + [DllImport("kernel32.dll")] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool CancelIo( + SafeFileHandle handle); + + [DllImport("kernel32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool CloseHandle( + SafeFileHandle handle); + + #endregion Interop + + #region Variables + + #region Device Details + + uint _numTxPorts = 0; + uint _numRxPorts = 0; + uint _learnPortMask = 0; + bool _legacyDevice = false; + bool _canFlashLed = false; + + bool[] _blasters; + + uint _receivePort = 0; + uint _learnPort = 0; + + #endregion Device Details + + NotifyWindow _notifyWindow; + + SafeFileHandle _eHomeHandle; + + Thread _readThread; + ReadThreadMode _readThreadMode; + + IrCode _learningCode; + + //StreamWriter _debugFile; + + #endregion Variables + + #region Constructor + + public DriverVista(Guid deviceGuid, string devicePath, RemoteCallback remoteCallback, KeyboardCallback keyboardCallback, MouseCallback mouseCallback) + : base(deviceGuid, devicePath, remoteCallback, keyboardCallback, mouseCallback) + { + + } + + #endregion Constructor + + #region Device Control Functions + + void StartReceive(uint receivePort, uint timeout) + { + int bytesReturned; + + StartReceiveParams structure; + structure.Receiver = receivePort; + structure.Timeout = timeout; + + IntPtr structPtr = Marshal.AllocHGlobal(Marshal.SizeOf(structure)); + + try + { + Marshal.StructureToPtr(structure, structPtr, false); + + IoControlSync(IoCtrl.StartReceive, structPtr, Marshal.SizeOf(structure), IntPtr.Zero, 0, out bytesReturned); + } + catch + { + throw; + } + finally + { + Marshal.FreeHGlobal(structPtr); + } + } + + void StopReceive() + { + int bytesReturned; + IoControlSync(IoCtrl.StopReceive, IntPtr.Zero, 0, IntPtr.Zero, 0, out bytesReturned); + } + + void GetDeviceCapabilities() + { + int bytesReturned; + + DeviceCapabilities structure = new DeviceCapabilities(); + + IntPtr structPtr = Marshal.AllocHGlobal(Marshal.SizeOf(structure)); + + try + { + Marshal.StructureToPtr(structure, structPtr, false); + + IoControlSync(IoCtrl.GetDetails, IntPtr.Zero, 0, structPtr, Marshal.SizeOf(structure), out bytesReturned); + + structure = (DeviceCapabilities)Marshal.PtrToStructure(structPtr, typeof(DeviceCapabilities)); + } + catch + { + throw; + } + finally + { + Marshal.FreeHGlobal(structPtr); + } + + _numTxPorts = structure.TransmitPorts; + _numRxPorts = structure.ReceivePorts; + _learnPortMask = structure.LearningMask; + + int receivePort = FirstLowBit(_learnPortMask); + if (receivePort != -1) + _receivePort = (uint)receivePort; + + int learnPort = FirstHighBit(_learnPortMask); + if (learnPort != -1) + _learnPort = (uint)learnPort; + else + _learnPort = _receivePort; + + DeviceCapabilityFlags flags = structure.DetailsFlags; + _legacyDevice = (int)(flags & DeviceCapabilityFlags.Legacy) != 0; + _canFlashLed = (int)(flags & DeviceCapabilityFlags.FlashLed) != 0; + } + + void GetBlasters() + { + int bytesReturned; + + if (_numTxPorts == 0) + return; + + _blasters = new bool[_numTxPorts]; + for (int i = 0; i < _blasters.Length; i++) + _blasters[i] = false; + + uint data = 0; + + IntPtr pointerToData = Marshal.AllocHGlobal(sizeof(uint)); + + try + { + Marshal.StructureToPtr(data, pointerToData, false); + + IoControlSync(IoCtrl.GetBlasters, IntPtr.Zero, 0, pointerToData, sizeof(uint), out bytesReturned); + + data = (uint)Marshal.PtrToStructure(pointerToData, typeof(uint)); + } + catch + { + throw; + } + finally + { + Marshal.FreeHGlobal(pointerToData); + } + + for (int j = 0; j < _blasters.Length; j++) + _blasters[j] = ((data & (((int)1) << j)) != 0); + } + + void TransmitIR(byte[] irData, int carrier, uint transmitPortMask) + { + int bytesReturned; + + TransmitParams transmitParams = new TransmitParams(); + transmitParams.TransmitPortMask = transmitPortMask; + + if (carrier == IrCode.CarrierFrequencyUnknown) + carrier = IrCode.CarrierFrequencyDefault; + + if (IsPulseMode((uint)carrier)) + { + transmitParams.Flags = TransmitFlags.PulseMode; + transmitParams.PulseSize = (uint)carrier; + } + else + { + //transmitParams.Flags = TransmitFlags.DCMode; + transmitParams.CarrierPeriod = GetCarrierPeriod((uint)carrier); + } + + TransmitChunk transmitChunk = new TransmitChunk(); + transmitChunk.OffsetToNextChunk = 0; + transmitChunk.RepeatCount = 1; + transmitChunk.ByteCount = (uint)irData.Length; + + int bufferSize = irData.Length + Marshal.SizeOf(typeof(TransmitChunk)) + 8; + byte[] buffer = new byte[bufferSize]; + + byte[] rawTransmitChunk = RawSerialize(transmitChunk); + Array.Copy(rawTransmitChunk, buffer, rawTransmitChunk.Length); + + Array.Copy(irData, 0, buffer, rawTransmitChunk.Length, irData.Length); + + IntPtr structurePtr = Marshal.AllocHGlobal(Marshal.SizeOf(transmitParams)); + IntPtr bufferPtr = Marshal.AllocHGlobal(buffer.Length); + + try + { + Marshal.StructureToPtr(transmitParams, structurePtr, true); + + Marshal.Copy(buffer, 0, bufferPtr, buffer.Length); + + IoControlSync(IoCtrl.Transmit, structurePtr, Marshal.SizeOf(typeof(TransmitParams)), bufferPtr, bufferSize, out bytesReturned); + } + catch + { + throw; + } + finally + { + Marshal.FreeHGlobal(structurePtr); + Marshal.FreeHGlobal(bufferPtr); + } + } + + void IoControlSync(IoCtrl ioControlCode, IntPtr inBuffer, int inBufferSize, IntPtr outBuffer, int outBufferSize, out int bytesReturned) + { + NativeOverlapped overlapped; + overlapped.InternalLow = IntPtr.Zero; + overlapped.InternalHigh = IntPtr.Zero; + overlapped.OffsetLow = 0; + overlapped.OffsetHigh = 0; + + try + { + int lastError; + + using (WaitHandle waitHandle = new ManualResetEvent(false)) + { + overlapped.EventHandle = waitHandle.SafeWaitHandle.DangerousGetHandle(); + + if (!DeviceIoControl(_eHomeHandle, ioControlCode, inBuffer, inBufferSize, outBuffer, outBufferSize, out bytesReturned, ref overlapped)) + { + lastError = Marshal.GetLastWin32Error(); + if (lastError != Win32ErrorCodes.ERROR_IO_PENDING) + throw new Win32Exception(lastError); + + waitHandle.WaitOne(); + + if (!GetOverlappedResult(_eHomeHandle, ref overlapped, out bytesReturned, false)) + { + lastError = Marshal.GetLastWin32Error(); + throw new Win32Exception(lastError); + } + } + } + + } + catch + { + CancelIo(_eHomeHandle); + throw; + } + } + + #endregion Device Control Functions + + #region Driver overrides + + public override void Start() + { + //_debugFile = new StreamWriter("\\DriverVista.log", false); + //_debugFile.AutoFlush = true; + + _notifyWindow = new NotifyWindow(); + _notifyWindow.Class = _deviceGuid; + + _eHomeHandle = CreateFile(_devicePath, FileAccessTypes.GenericRead | FileAccessTypes.GenericWrite, FileShares.None, IntPtr.Zero, CreationDisposition.OpenExisting, FileAttributes.Overlapped, IntPtr.Zero); + int lastError = Marshal.GetLastWin32Error(); + if (_eHomeHandle.IsInvalid) + throw new Win32Exception(lastError); + + GetAllDeviceInformation(); + + StartReceive(_receivePort, PacketTimeout); + + _readThreadMode = ReadThreadMode.Receiving; + + StartReadThread(); + + _notifyWindow.Create(); + _notifyWindow.DeviceArrival += new DeviceEventHandler(OnDeviceArrival); + _notifyWindow.DeviceRemoval += new DeviceEventHandler(OnDeviceRemoval); + _notifyWindow.RegisterDeviceRemoval(_eHomeHandle.DangerousGetHandle()); + } + public override void Stop() + { + OnDeviceRemoval(); + + CloseDevice(); + + //_debugFile.Close(); + } + + public override IrCode Learn(int learnTimeout) + { + //_debugFile.WriteLine("Learn"); + + StopReadThread(); + + _learningCode = new IrCode(); + + StartReceive(_learnPort, PacketTimeout); + + _readThreadMode = ReadThreadMode.Learning; + + StartReadThread(); + + int learnStartTick = Environment.TickCount; + + // Wait for the learning to finish ... + while (_readThreadMode == ReadThreadMode.Learning && Environment.TickCount < learnStartTick + learnTimeout) + Thread.Sleep(PacketTimeout); + + //_debugFile.WriteLine("End Learn"); + + ReadThreadMode modeWas = _readThreadMode; + + StopReadThread(); + + StartReceive(_receivePort, PacketTimeout); + + _readThreadMode = ReadThreadMode.Receiving; + + StartReadThread(); + + switch (modeWas) + { + case ReadThreadMode.Learning: + // Timeout. + return null; + + case ReadThreadMode.LearningFailed: + // Failure. + return null; + + case ReadThreadMode.LearningDone: + //_debugFile.WriteLine(_learningCode.ToByteArray()); + + if (_learningCode.FinalizeData()) + return _learningCode; // Success. + else + return null; // Failure. + + default: + return null; + } + } + + public override void Send(IrCode code, uint port) + { + byte[] data = DataPacket(code); + + TransmitIR(data, code.Carrier, port); + } + + #endregion Driver overrides + + #region Implementation + + byte[] DataPacket(IrCode code) + { + if (code.TimingData.Length == 0) + return null; + + byte[] data = new byte[code.TimingData.Length * 4]; + + int dataIndex = 0; + for (int timeIndex = 0; timeIndex < code.TimingData.Length; timeIndex++) + { + uint time = (uint)(50 * (int)Math.Round((double)code.TimingData[timeIndex] / 50)); + + for (int timeShift = 0; timeShift < 4; timeShift++) + { + data[dataIndex++] = (byte)(time & 0xFF); + time >>= 8; + } + } + + return data; + } + + void GetAllDeviceInformation() + { + GetDeviceCapabilities(); + GetBlasters(); + } + + void StartReadThread() + { + _readThread = new Thread(new ThreadStart(ReadThread)); + _readThread.IsBackground = true; + _readThread.Name = "IR Server Microsoft MCE Transceiver Read"; + _readThread.Start(); + } + void StopReadThread() + { + if (_readThread != null) + { + _readThreadMode = ReadThreadMode.Stop; + + _readThread.Abort(); + + if (Thread.CurrentThread != _readThread) + _readThread.Join(); + + _readThread = null; + } + } + + void CloseDevice() + { + if (_eHomeHandle != null) + CloseHandle(_eHomeHandle); + } + + void OnDeviceArrival() + { + _notifyWindow.UnregisterDeviceArrival(); + + StartReceive(_receivePort, PacketTimeout); + + _readThreadMode = ReadThreadMode.Receiving; + + StartReadThread(); + + _notifyWindow.RegisterDeviceRemoval(_eHomeHandle.DangerousGetHandle()); + } + void OnDeviceRemoval() + { + _notifyWindow.UnregisterDeviceRemoval(); + _notifyWindow.RegisterDeviceArrival(); + + StopReadThread(); + } + + void ReadThread() + { + int bytesRead; + TimeSpan sinceLastPacket; + DateTime lastPacketTime = DateTime.Now; + + IntPtr deviceBufferPtr = IntPtr.Zero; + IntPtr receiveParamsPtr = IntPtr.Zero; + + try + { + deviceBufferPtr = Marshal.AllocHGlobal(DeviceBufferSize); + + int receiveParamsSize = Marshal.SizeOf(typeof(ReceiveParams)) + DeviceBufferSize + 8; + receiveParamsPtr = Marshal.AllocHGlobal(receiveParamsSize); + + ReceiveParams receiveParams = new ReceiveParams(); + receiveParams.ByteCount = DeviceBufferSize; + Marshal.StructureToPtr(receiveParams, receiveParamsPtr, false); + + while (_readThreadMode != ReadThreadMode.Stop) + { + IoControlSync(IoCtrl.Receive, IntPtr.Zero, 0, receiveParamsPtr, receiveParamsSize, out bytesRead); + + if (bytesRead > Marshal.SizeOf(receiveParams)) + { + int dataSize = bytesRead; + + bytesRead -= Marshal.SizeOf(receiveParams); + + sinceLastPacket = DateTime.Now.Subtract(lastPacketTime); + if (sinceLastPacket.TotalMilliseconds >= PacketTimeout + 50) + IrDecoder.DecodeIR(null, null, null, null); + + lastPacketTime = DateTime.Now; + + byte[] packetBytes = new byte[bytesRead]; + byte[] dataBytes = new byte[dataSize]; + + Marshal.Copy(receiveParamsPtr, dataBytes, 0, dataSize); + Array.Copy(dataBytes, dataSize - bytesRead, packetBytes, 0, bytesRead); + + int[] timingData = GetTimingDataFromPacket(packetBytes); + + //_debugFile.WriteLine("Received:"); + //Dump(timingData); + + if (_readThreadMode == ReadThreadMode.Learning) + _learningCode.AddTimingData(timingData); + else + IrDecoder.DecodeIR(timingData, _remoteCallback, _keyboardCallback, _mouseCallback); + } + + // Determine carrier frequency when learning ... + if (_readThreadMode == ReadThreadMode.Learning && bytesRead >= Marshal.SizeOf(receiveParams)) + { + ReceiveParams receiveParams2 = (ReceiveParams)Marshal.PtrToStructure(receiveParamsPtr, typeof(ReceiveParams)); + + if (receiveParams2.DataEnd != 0 && receiveParams2.CarrierFrequency != 0) + { + _learningCode.Carrier = (int)receiveParams2.CarrierFrequency; + _readThreadMode = ReadThreadMode.LearningDone; + } + } + } + } + catch + { + CancelIo(_eHomeHandle); + } + finally + { + StopReceive(); + + if (deviceBufferPtr != IntPtr.Zero) + Marshal.FreeHGlobal(deviceBufferPtr); + + if (receiveParamsPtr != IntPtr.Zero) + Marshal.FreeHGlobal(receiveParamsPtr); + } + } + + #endregion Implementation + + #region Misc Methods + + static byte[] RawSerialize(object anything) + { + int rawSize = Marshal.SizeOf(anything); + byte[] rawData = new byte[rawSize]; + + GCHandle handle = GCHandle.Alloc(rawData, GCHandleType.Pinned); + IntPtr buffer = handle.AddrOfPinnedObject(); + + Marshal.StructureToPtr(anything, buffer, false); + + handle.Free(); + + return rawData; + } + + static byte ConvertBcdToByte(byte b) + { + return (byte)(((b >> 4) * 10) + (b & 15)); + } + + int FirstHighBit(uint mask) + { + for (int i = 0; i < 32; i++) + if ((mask & (1 << i)) != 0) + return i; + + return -1; + } + int FirstLowBit(uint mask) + { + for (int i = 0; i < 32; i++) + if ((mask & (1 << i)) == 0) + return i; + + return -1; + } + + static uint GetCarrierPeriod(uint carrier) + { + return (uint)(1000000 / carrier); + } + + static bool IsPulseMode(uint carrier) + { + if (carrier > 0 && carrier < 100) + return true; + + return false; + } + + static int[] GetTimingDataFromPacket(byte[] packetBytes) + { + int[] timingData = new int[packetBytes.Length / 4]; + + int timingDataIndex = 0; + + for (int index = 0; index < packetBytes.Length; index += 4) + timingData[timingDataIndex++] = + (int) + (packetBytes[index] + + (packetBytes[index + 1] << 8) + + (packetBytes[index + 2] << 16) + + (packetBytes[index + 3] << 24)); + + return timingData; + } + /* + void Dump(Array array) + { + foreach (object item in array) + { + _debugFile.Write(item); + _debugFile.Write(", "); + } + + _debugFile.WriteLine(); + } + */ + #endregion Misc Methods + + } + +} Added: 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 (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DriverXP.cs 2007-09-05 17:23:54 UTC (rev 895) @@ -0,0 +1,750 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.IO; +using System.Runtime.InteropServices; +using System.ServiceProcess; +using System.Text; +using System.Threading; + +using Microsoft.Win32.SafeHandles; + +namespace MicrosoftMceTransceiver +{ + + public class DriverXP : Driver + { + + #region Interop + + [DllImport("kernel32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool GetOverlappedResult( + SafeFileHandle handle, + ref NativeOverlapped overlapped, + out int bytesTransferred, + bool wait); + + [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)] + static extern SafeFileHandle CreateFile( + [MarshalAs(UnmanagedType.LPTStr)] string fileName, + [MarshalAs(UnmanagedType.U4)] FileAccessTypes fileAccess, + [MarshalAs(UnmanagedType.U4)] FileShares fileShare, + IntPtr securityAttributes, + [MarshalAs(UnmanagedType.U4)] CreationDisposition creationDisposition, + [MarshalAs(UnmanagedType.U4)] FileAttributes flags, + IntPtr templateFile); + + [DllImport("kernel32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool ReadFile( + SafeFileHandle handle, + IntPtr buffer, + int bytesToRead, + out int bytesRead, + ref NativeOverlapped overlapped); + + [DllImport("kernel32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool WriteFile( + SafeFileHandle handle, + byte[] buffer, + int bytesToWrite, + out int bytesWritten, + ref NativeOverlapped overlapped); + + [DllImport("kernel32.dll")] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool CancelIo( + SafeFileHandle handle); + + [DllImport("kernel32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool CloseHandle( + SafeFileHandle handle); + + #endregion Interop + + #region Enumerations + + /// <summary> + /// Type of device in use. + /// This is used to determine the blaster port selection method. + /// </summary> + enum DeviceType + { + /// <summary> + /// Device is a first party Microsoft MCE transceiver. + /// </summary> + Microsoft = 0, + /// <summary> + /// Device is an third party SMK or Topseed MCE transceiver. + /// </summary> + SmkTopseed = 1, + } + + /// <summary> + /// Device input port. + /// </summary> + enum InputPort + { + Receive = 0, + Learning = 1, + } + + /// <summary> + /// Read Thread Mode. + /// </summary> + enum ReadThreadMode + { + Receiving, + Learning, + LearningDone, + LearningFailed, + Stop, + } + + #endregion Enumerations + + #region Constants + + // Vendor ID's for SMK and Topseed devices. + const string VidSMK = "vid_1784"; + const string VidTopseed = "vid_0609"; + + // Device variables + const int DeviceBufferSize = 100; + const int PacketTimeout = 100; + const int WriteSyncTimeout = 5000; + + // Microsoft Port Packets + static readonly byte[][] MicrosoftPorts = new byte[][] + { + new byte[] { 0x9F, 0x08, 0x06 }, // Both + new byte[] { 0x9F, 0x08, 0x04 }, // 1 + new byte[] { 0x9F, 0x08, 0x02 }, // 2 + }; + + // SMK or Topseed Port Packets + static readonly byte[][] SmkTopseedPorts = new byte[][] + { + new byte[] { 0x9F, 0x08, 0x00 }, // Both + new byte[] { 0x9F, 0x08, 0x01 }, // 1 + new byte[] { 0x9F, 0x08, 0x02 }, // 2 + }; + + // Start and Stop Packets + static readonly byte[] StartPacket = { 0x00, 0xFF, 0xAA }; + static readonly byte[] StopPacket = { 0xFF, 0xBB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; + + // Misc Packets + static readonly byte[] SetCarrierFreqPacket = { 0x9F, 0x06, 0x01, 0x80 }; + static readonly byte[] SetInputPortPacket = { 0x9F, 0x14, 0x00 }; + static readonly byte[] SetTimeoutPacket = { 0x9F, 0x0C, 0x00, 0x00 }; + + #endregion Constants + + #region Variables + + NotifyWindow _notifyWindow; + + SafeFileHandle _eHomeHandle; + + Thread _readThread; + ReadThreadMode _readThreadMode; + ManualResetEvent _stopReadThread; + + IrCode _learningCode; + + DeviceType _deviceType = DeviceType.Microsoft; + + //StreamWriter _debugFile; + + #endregion Variables + + #region Constructor + + public DriverXP(Guid deviceGuid, string devicePath, RemoteCallback remoteCallback, KeyboardCallback keyboardCallback, MouseCallback mouseCallback) + : base(deviceGuid, devicePath, remoteCallback, keyboardCallback, mouseCallback) + { + if (devicePath.IndexOf(VidSMK, StringComparison.InvariantCultureIgnoreCase) != -1 || devicePath.IndexOf(VidTopseed, StringComparison.InvariantCultureIgnoreCase) != -1) + _deviceType = DeviceType.SmkTopseed; + else + _deviceType = DeviceType.Microsoft; + } + + #endregion Constructor + + #region Driver overrides + + public override void Start() + { + //_debugFile = new StreamWriter("\\DriverXP.log", false); + //_debugFile.AutoFlush = true; + + _notifyWindow = new NotifyWindow(); + _notifyWindow.Class = _deviceGuid; + + int lastError; + + _eHomeHandle = CreateFile(_devicePath, FileAccessTypes.GenericRead | FileAccessTypes.GenericWrite, FileShares.None, IntPtr.Zero, CreationDisposition.OpenExisting, FileAttributes.Overlapped, IntPtr.Zero); + lastError = Marshal.GetLastWin32Error(); + if (_eHomeHandle.IsInvalid) + throw new Win32Exception(lastError); + + // Initialize device ... + WriteSync(StartPacket); + SetTimeout(PacketTimeout); + SetInputPort(InputPort.Receive); + + StartReadThread(); + + _notifyWindow.Create(); + _notifyWindow.DeviceArrival += new DeviceEventHandler(OnDeviceArrival); + _notifyWindow.DeviceRemoval += new DeviceEventHandler(OnDeviceRemoval); + _notifyWindow.RegisterDeviceRemoval(_eHomeHandle.DangerousGetHandle()); + } + + public override void Stop() + { + WriteSync(StopPacket); + + OnDeviceRemoval(); + + CloseDevice(); + + //_debugFile.Close(); + } + + public override IrCode Learn(int learnTimeout) + { + //_debugFile.WriteLine("Start Learn"); + + _learningCode = new IrCode(); + + SetInputPort(InputPort.Learning); + + int learnStartTick = Environment.TickCount; + _readThreadMode = ReadThreadMode.Learning; + + // Wait for the learning to finish ... + while (_readThreadMode == ReadThreadMode.Learning && Environment.TickCount < learnStartTick + learnTimeout) + Thread.Sleep(100); + + //_debugFile.WriteLine("End Learn"); + + ReadThreadMode modeWas = _readThreadMode; + + _readThreadMode = ReadThreadMode.Receiving; + SetInputPort(InputPort.Receive); + + switch (modeWas) + { + case ReadThreadMode.Learning: + // Timeout. + return null; + + case ReadThreadMode.LearningFailed: + // Failure. + return null; + + case ReadThreadMode.LearningDone: + //_debugFile.WriteLine(_learningCode.ToByteArray()); + + if (_learningCode.FinalizeData()) + return _learningCode; // Success. + else + return null; // Failure. + + default: + return null; + } + } + + public override void Send(IrCode code, uint port) + { + //_debugFile.WriteLine("Send"); + + byte[] portPacket; + switch (_deviceType) + { + case DeviceType.Microsoft: portPacket = MicrosoftPorts[port]; break; + case DeviceType.SmkTopseed: portPacket = SmkTopseedPorts[port]; break; + default: + throw new Exception("Invalid device type"); + } + + //_debugFile.WriteLine(code.ToByteArray()); + + // Set port + WriteSync(portPacket); + + // Set carrier frequency + WriteSync(CarrierPacket(code)); + + // Send packet + WriteSync(DataPacket(code)); + } + + #endregion Driver overrides + + #region Implementation + + byte[] CarrierPacket(IrCode code) + { + byte[] carrierPacket = new byte[SetCarrierFreqPacket.Length]; + SetCarrierFreqPacket.CopyTo(carrierPacket, 0); + + if (code.Carrier == IrCode.CarrierFrequencyUnknown || code.Carrier == IrCode.CarrierFrequencyDCMode) + return carrierPacket; + + for (int scaler = 1; scaler <= 4; scaler++) + { + int divisor = (10000000 >> (2 * scaler)) / code.Carrier; + + if (divisor <= 0xFF) + { + carrierPacket[2] = (byte)scaler; + carrierPacket[3] = (byte)divisor; + break; + } + } + + return carrierPacket; + } + + byte[] DataPacket(IrCode code) + { + if (code.TimingData.Length == 0) + return null; + + // Construct data bytes into "packet" ... + List<byte> packet = new List<byte>(); + + for (int index = 0; index < code.TimingData.Length; index++) + { + double time = (double)code.TimingData[index]; + + byte duration = (byte)Math.Abs(Math.Round(time / 50)); + bool pulse = (time > 0); + + while (duration > 0x7F) + { + packet.Add((byte)(pulse ? 0xFF : 0x7F)); + + duration -= 0x7F; + } + + packet.Add((byte)(pulse ? 0x80 | duration : duration)); + } + + // Insert byte count markers into packet data bytes ... + int subpackets = (int)Math.Ceiling(packet.Count / (double)4); + + byte[] output = new byte[packet.Count + subpackets + 1]; + + int outputPos = 0; + + for (int packetPos = 0; packetPos < packet.Count; ) + { + byte copyCount = (byte)(packet.Count - packetPos < 4 ? packet.Count - packetPos : 0x04); + + output[outputPos++] = (byte)(0x80 | copyCount); + + for (int index = 0; index < copyCount; index++) + output[outputPos++] = packet[packetPos++]; + } + + output[outputPos] = 0x80; + + return output; + } + + /// <summary> + /// Set the receive buffer timeout. + /// </summary> + /// <param name="timeout">Packet timeout (in milliseconds).</param> + void SetTimeout(int timeout) + { + byte[] timeoutPacket = new byte[SetTimeoutPacket.Length]; + SetTimeoutPacket.CopyTo(timeoutPacket, 0); + + int timeoutSamples = 20 * timeout; + + timeoutPacket[2] = (byte)(timeoutSamples >> 8); + timeoutPacket[3] = (byte)(timeoutSamples % 256); + + WriteSync(timeoutPacket); + } + + void SetInputPort(InputPort port) + { + byte[] inputPortPacket = new byte[SetInputPortPacket.Length]; + SetInputPortPacket.CopyTo(inputPortPacket, 0); + + inputPortPacket[2] = (byte)(port + 1); + + WriteSync(inputPortPacket); + } + + void StartReadThread() + { + _stopReadThread = new ManualResetEvent(false); + _readThreadMode = ReadThreadMode.Receiving; + + _readThread = new Th... [truncated message content] |
From: <rs...@us...> - 2007-09-05 13:05:07
|
Revision: 894 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=894&view=rev Author: rsparey Date: 2007-09-05 06:05:02 -0700 (Wed, 05 Sep 2007) Log Message: ----------- updated my pics dialogue Updated home updated plug-in home Modified Paths: -------------- trunk/skins/Foofaraw/Development Skin/Foofaraw/DialogMenu.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/DialogPictureInfo.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/myHome.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/myHomePlugIns.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicgenres.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicsongs.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/mypics.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/myplugins.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/myradio.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/mytvhome.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/myvideo.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/myvideoTitle.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/release notes.xml Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/DialogMenu.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/DialogMenu.xml 2007-09-04 18:53:33 UTC (rev 893) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/DialogMenu.xml 2007-09-05 13:05:02 UTC (rev 894) @@ -27,10 +27,11 @@ <description>Heading text label</description> <type>label</type> <id>4</id> - <posX>600</posX> + <posX>500</posX> <posY>185</posY> <label>181</label> <font>font13</font> + <align>Left</align> <textcolor>FFFFFFFF</textcolor> <animation effect="fade" time="200">WindowOpen</animation> <animation effect="fade" time="200">WindowClose</animation> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/DialogPictureInfo.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/DialogPictureInfo.xml 2007-09-04 18:53:33 UTC (rev 893) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/DialogPictureInfo.xml 2007-09-05 13:05:02 UTC (rev 894) @@ -1,44 +1,75 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <window> <id>2014</id> - <defaultcontrol>6</defaultcontrol> + <defaultcontrol>21</defaultcontrol> <allowoverlay>no</allowoverlay> <controls> - <control> - <description>background image</description> + + + + + + <control> <type>image</type> + <decription>mid_strip</decription> <id>1</id> - <width>1366</width> - <height>768</height> + <posX>12</posX> + <posY>186</posY> + <width>1342</width> + <height>365</height> + <texture>mid_strip.png</texture> + <animation effect="fade" time="200">WindowOpen</animation> + <animation effect="fade" time="200">WindowClose</animation> + + </control> - <control> + <control> <type>image</type> + <decription>bottom_strip</decription> <id>1</id> - <posX>113</posX> - <posY>26</posY> - <texture>info_logo.png</texture> - <animation effect="fade" time="200">WindowOpen</animation> + <posX>12</posX> + <posY>547</posY> + <width>1342</width> + <height>18</height> + <texture>bottom_strip.png</texture> + <animation effect="fade" time="200">WindowOpen</animation> <animation effect="fade" time="200">WindowClose</animation> + + </control> + <control> + <type>image</type> + <decription>top-strip</decription> + <id>1</id> + <posX>12</posX> + <posY>155</posY> + <width>1342</width> + <height>36</height> + <texture>top-strip.png</texture> + <animation effect="fade" time="200">WindowOpen</animation> + <animation effect="fade" time="200">WindowClose</animation> + + </control> <control> <description>Image Title value</description> <type>label</type> <id>20</id> - <posX>1252</posX> - <posY>93</posY> - <label>-</label> - <font>font16</font> - <align>right</align> - <textcolor>FFFFFFFF</textcolor> - <animation effect="fade" time="200">WindowOpen</animation> - <animation effect="fade" time="200">WindowClose</animation> + <animation effect="fade" time="400">WindowClose</animation> + <animation effect="fade" time="400">WindowOpen</animation> + <posX>200</posX> + <posY>600</posY> + <width>1000</width> + <label>-</label> + <font>wipeout</font> + <align>Left</align> + <textcolor>ffffffff</textcolor> </control> <control> <description>Dimensions txt</description> <type>label</type> <id>1</id> - <posX>113</posX> - <posY>133</posY> + <posX>645</posX> + <posY>225</posY> <label>9000</label> <font>font13</font> <textcolor>FFB2D4F5</textcolor> @@ -49,8 +80,8 @@ <description>Resolution txt</description> <type>label</type> <id>1</id> - <posX>113</posX> - <posY>160</posY> + <posX>645</posX> + <posY>250</posY> <label>9001</label> <font>font13</font> <textcolor>FFB2D4F5</textcolor> @@ -61,8 +92,8 @@ <description>Flash txt</description> <type>label</type> <id>1</id> - <posX>113</posX> - <posY>186</posY> + <posX>645</posX> + <posY>275</posY> <label>9002</label> <font>font13</font> <textcolor>FFB2D4F5</textcolor> @@ -73,8 +104,8 @@ <description>Metering mode txt</description> <type>label</type> <id>1</id> - <posX>113</posX> - <posY>213</posY> + <posX>645</posX> + <posY>300</posY> <label>9003</label> <font>font13</font> <textcolor>FFB2D4F5</textcolor> @@ -85,8 +116,8 @@ <description>Exposure Compensation txt</description> <type>label</type> <id>1</id> - <posX>113</posX> - <posY>240</posY> + <posX>645</posX> + <posY>325</posY> <label>9004</label> <font>font13</font> <textcolor>FFB2D4F5</textcolor> @@ -97,44 +128,22 @@ <description>Shutterspeed txt</description> <type>label</type> <id>1</id> - <posX>113</posX> - <posY>266</posY> + <posX>645</posX> + <posY>350</posY> <label>9005</label> <font>font13</font> <textcolor>FFB2D4F5</textcolor> <animation effect="fade" time="200">WindowOpen</animation> <animation effect="fade" time="200">WindowClose</animation> </control> + + <control> - <description>Date Taken txt</description> - <type>label</type> - <id>1</id> - <posX>645</posX> - <posY>240</posY> - <label>9006</label> - <font>font13</font> - <textcolor>FFB2D4F5</textcolor> - <animation effect="fade" time="200">WindowOpen</animation> - <animation effect="fade" time="200">WindowClose</animation> - </control> - <control> - <description>Fstop txt</description> - <type>label</type> - <id>1</id> - <posX>645</posX> - <posY>266</posY> - <label>9007</label> - <font>font13</font> - <textcolor>FFB2D4F5</textcolor> - <animation effect="fade" time="200">WindowOpen</animation> - <animation effect="fade" time="200">WindowClose</animation> - </control> - <control> <description>Exposure Time txt</description> <type>label</type> <id>1</id> <posX>645</posX> - <posY>133</posY> + <posY>375</posY> <label>9008</label> <font>font13</font> <align>left</align> @@ -147,7 +156,7 @@ <type>label</type> <id>1</id> <posX>645</posX> - <posY>160</posY> + <posY>400</posY> <label>9009</label> <font>font13</font> <textcolor>FFB2D4F5</textcolor> @@ -159,7 +168,7 @@ <type>label</type> <id>1</id> <posX>645</posX> - <posY>186</posY> + <posY>425</posY> <label>9010</label> <font>font13</font> <textcolor>FFB2D4F5</textcolor> @@ -171,7 +180,7 @@ <type>label</type> <id>1</id> <posX>645</posX> - <posY>213</posY> + <posY>450</posY> <label>9011</label> <font>font13</font> <textcolor>FFB2D4F5</textcolor> @@ -182,8 +191,8 @@ <description>Image Dimensions value</description> <type>label</type> <id>21</id> - <posX>379</posX> - <posY>133</posY> + <posX>910</posX> + <posY>225</posY> <label>-</label> <font>font13</font> <textcolor>FFFFFFFF</textcolor> @@ -194,8 +203,8 @@ <description>Resolutions value</description> <type>label</type> <id>22</id> - <posX>379</posX> - <posY>160</posY> + <posX>910</posX> + <posY>250</posY> <label>-</label> <font>font13</font> <textcolor>FFFFFFFF</textcolor> @@ -206,8 +215,8 @@ <description>Flash value</description> <type>fadelabel</type> <id>23</id> - <posX>379</posX> - <posY>186</posY> + <posX>910</posX> + <posY>275</posY> <width>173</width> <label>-</label> <font>font13</font> @@ -219,8 +228,8 @@ <description>Metering Mode value</description> <type>fadelabel</type> <id>24</id> - <posX>379</posX> - <posY>213</posY> + <posX>910</posX> + <posY>300</posY> <width>173</width> <label>-</label> <font>font13</font> @@ -232,8 +241,8 @@ <description>Exposure Compensation value</description> <type>fadelabel</type> <id>25</id> - <posX>379</posX> - <posY>240</posY> + <posX>910</posX> + <posY>325</posY> <width>533</width> <label>-</label> <font>font13</font> @@ -245,8 +254,8 @@ <description>Shutter Speed value</description> <type>fadelabel</type> <id>26</id> - <posX>379</posX> - <posY>266</posY> + <posX>910</posX> + <posY>350</posY> <width>533</width> <label>-</label> <font>font13</font> @@ -255,35 +264,24 @@ <animation effect="fade" time="200">WindowClose</animation> </control> <control> - <description>Date Taken value</description> + <description>Real Date Taken value</description> <type>label</type> <id>27</id> <posX>910</posX> - <posY>240</posY> + <posY>475</posY> <label>-</label> <font>font13</font> <textcolor>FFFFFFFF</textcolor> <animation effect="fade" time="200">WindowOpen</animation> <animation effect="fade" time="200">WindowClose</animation> </control> + <control> - <description>Fstop value</description> - <type>label</type> - <id>28</id> - <posX>910</posX> - <posY>266</posY> - <label>-</label> - <font>font13</font> - <textcolor>FFFFFFFF</textcolor> - <animation effect="fade" time="200">WindowOpen</animation> - <animation effect="fade" time="200">WindowClose</animation> - </control> - <control> <description>Exposure Time value</description> <type>label</type> <id>29</id> <posX>910</posX> - <posY>133</posY> + <posY>375</posY> <label>-</label> <font>font13</font> <textcolor>FFFFFFFF</textcolor> @@ -295,7 +293,7 @@ <type>fadelabel</type> <id>30</id> <posX>910</posX> - <posY>160</posY> + <posY>400</posY> <width>266</width> <label>-</label> <font>font13</font> @@ -308,7 +306,7 @@ <type>fadelabel</type> <id>31</id> <posX>910</posX> - <posY>186</posY> + <posY>425</posY> <width>266</width> <label>-</label> <font>font13</font> @@ -321,27 +319,77 @@ <type>label</type> <id>32</id> <posX>910</posX> - <posY>213</posY> + <posY>450</posY> <label>-</label> <font>font13</font> <textcolor>FFFFFFFF</textcolor> <animation effect="fade" time="200">WindowOpen</animation> <animation effect="fade" time="200">WindowClose</animation> </control> + <control> + <description>Date Taken txt</description> + <type>label</type> + <id>1</id> + <posX>645</posX> + <posY>475</posY> + <label>9006</label> + <font>font13</font> + <textcolor>FFB2D4F5</textcolor> + <animation effect="fade" time="200">WindowOpen</animation> + <animation effect="fade" time="200">WindowClose</animation> + </control> + <control> + <description>Date Taken value</description> + <type>label</type> + <id>27</id> + <posX>910</posX> + <posY>475</posY> + <label>-</label> + <font>font13</font> + <textcolor>FFFFFFFF</textcolor> + <animation effect="fade" time="200">WindowOpen</animation> + <animation effect="fade" time="200">WindowClose</animation> + </control> + <control> + <description>Fstop txt</description> + <type>label</type> + <id>1</id> + <posX>645</posX> + <posY>500</posY> + <label>9007</label> + <font>font13</font> + <textcolor>FFB2D4F5</textcolor> + <animation effect="fade" time="200">WindowOpen</animation> + <animation effect="fade" time="200">WindowClose</animation> + </control> + <control> + <description>Fstop value</description> + <type>label</type> + <id>28</id> + <posX>910</posX> + <posY>500</posY> + <label>-</label> + <font>font13</font> + <textcolor>FFFFFFFF</textcolor> + <animation effect="fade" time="200">WindowOpen</animation> + <animation effect="fade" time="200">WindowClose</animation> + </control> <control> <description>Image</description> <type>image</type> + <id>3</id> - <posX>303</posX> - <posY>320</posY> + <posX>50</posX> + <posY>200</posY> <width>533</width> - <height>400</height> + <height>330</height> <texture>-</texture> <colorkey>FFFF00FF</colorkey> <colordiffuse>FFFFFFFF</colordiffuse> - <keepaspectratio>yes</keepaspectratio> - <animation effect="fade" time="200">WindowOpen</animation> + <keepaspectratio>no</keepaspectratio> + <animation effect="fade" delay="500" time="2000">WindowOpen</animation> <animation effect="fade" time="200">WindowClose</animation> </control> + </controls> </window> \ No newline at end of file Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/myHome.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/myHome.xml 2007-09-04 18:53:33 UTC (rev 893) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/myHome.xml 2007-09-05 13:05:02 UTC (rev 894) @@ -3,7 +3,7 @@ <id>0</id> <defaultcontrol>50</defaultcontrol> <allowoverlay>no</allowoverlay> - <autohidetopbar>yes</autohidetopbar> + <autohidetopbar>no</autohidetopbar> <controls> <import>common.window.xml</import> <import>common.time.xml</import> @@ -36,6 +36,41 @@ <animation effect="fade" time="500" delay="1000">WindowOpen</animation> <animation effect="fade" time="500">WindowClose</animation> </control> + <control> + <type>image</type> + <decription>mid_strip</decription> + <id>1</id> + <posX>12</posX> + <posY>186</posY> + <width>1342</width> + <height>365</height> + <texture>mid_strip.png</texture> + <animation effect="zoom" start="100,100" end="100,115" center="12,186" time="1000" acceleration ="-1" >WindowOpen</animation> + <animation effect="zoom" start="100,115" end="100,100" center="12,186" time="1000" acceleration ="-1" >WindowClose</animation> + </control> + <control> + <type>image</type> + <decription>bottom_strip</decription> + <id>1</id> + <posX>12</posX> + <posY>547</posY> + <width>1342</width> + <height>18</height> + <texture>bottom_strip.png</texture> + <animation effect="slide" time="1000" start="0,0" end="0,50" acceleration="-1" >WindowOpen</animation> + <animation effect="slide" time="1000" start="0,50" end="0,0" acceleration="-1" >WindowClose</animation> + </control> + <control> + <type>image</type> + <decription>top-strip</decription> + <id>1</id> + <posX>12</posX> + <posY>155</posY> + <width>1342</width> + <height>36</height> + <texture>top-strip.png</texture> + + </control> <control> <description>Menu</description> <type>menu</type> @@ -45,7 +80,7 @@ <animation effect="zoom" start="100,100" end="5,5" center="750,500" time="300">WindowClose</animation> <id>50</id> <posX>508</posX> - <posY>165</posY> + <posY>180</posY> <width>350</width> <textcolor>ffffffff</textcolor> <textColorNoFocus>ffffffff</textColorNoFocus> @@ -60,7 +95,7 @@ <textureButtonFocus>hp_selectionbar.png</textureButtonFocus> <textureButtonNoFocus>-</textureButtonNoFocus> <hoverX>150</hoverX> - <hoverY>180</hoverY> + <hoverY>220</hoverY> <hoverWidth>300</hoverWidth> <hoverHeight>600</hoverHeight> <hoverKeepAspectratio>yes</hoverKeepAspectratio> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/myHomePlugIns.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/myHomePlugIns.xml 2007-09-04 18:53:33 UTC (rev 893) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/myHomePlugIns.xml 2007-09-05 13:05:02 UTC (rev 894) @@ -77,6 +77,41 @@ <animation effect="slide" time="1000" delay="2000" start="-600,0" end="0,0" acceleration="-1">WindowOpen</animation> <animation effect="fade" time="500" start="50">WindowClose</animation> </control> + <control> + <type>image</type> + <decription>mid_strip</decription> + <id>1</id> + <posX>12</posX> + <posY>186</posY> + <width>1342</width> + <height>365</height> + <texture>mid_strip.png</texture> + <animation effect="zoom" start="100,100" end="100,115" center="12,186" time="1000" acceleration ="-1" >WindowOpen</animation> + <animation effect="zoom" start="100,115" end="100,100" center="12,186" time="1000" acceleration ="-1" >WindowClose</animation> + </control> + <control> + <type>image</type> + <decription>bottom_strip</decription> + <id>1</id> + <posX>12</posX> + <posY>547</posY> + <width>1342</width> + <height>18</height> + <texture>bottom_strip.png</texture> + <animation effect="slide" time="1000" start="0,0" end="0,50" acceleration="-1" >WindowOpen</animation> + <animation effect="slide" time="1000" start="0,50" end="0,0" acceleration="-1" >WindowClose</animation> + </control> + <control> + <type>image</type> + <decription>top-strip</decription> + <id>1</id> + <posX>12</posX> + <posY>155</posY> + <width>1342</width> + <height>36</height> + <texture>top-strip.png</texture> + + </control> <control> <description>Menu</description> <type>menu</type> @@ -86,7 +121,7 @@ <animation effect="zoom" start="100,100" end="5,5" center="750,500" time="300">WindowClose</animation> <id>50</id> <posX>508</posX> - <posY>165</posY> + <posY>180</posY> <width>350</width> <textcolor>ffffffff</textcolor> <textColorNoFocus>ffffffff</textColorNoFocus> @@ -101,7 +136,7 @@ <textureButtonFocus>hp_selectionbar.png</textureButtonFocus> <textureButtonNoFocus>-</textureButtonNoFocus> <hoverX>150</hoverX> - <hoverY>180</hoverY> + <hoverY>220</hoverY> <hoverWidth>300</hoverWidth> <hoverHeight>600</hoverHeight> <hoverKeepAspectratio>yes</hoverKeepAspectratio> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicgenres.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicgenres.xml 2007-09-04 18:53:33 UTC (rev 893) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicgenres.xml 2007-09-05 13:05:02 UTC (rev 894) @@ -7,142 +7,278 @@ <define>#header.image:music_logo.png</define> <define>#header.hover:hover_my music.png</define> <controls> - <import>common.window.xml</import> - <control> - <type>group</type> - <description>group element</description> - <animation effect="fade" time="250">WindowOpen</animation> + <control> + <description>BG</description> + <type>image</type> + <id>1</id> + <width>1366</width> + <height>768</height> + + </control> + + <import>common.time.xml</import> + + <control> + <description>icon background</description> + <type>image</type> + <id>1</id> + <posX>0</posX> + <posY>0</posY> + <width>377</width> + <height>133</height> + <texture>Logo_background.png</texture> + <animation effect="fade" time="500" delay="1000">WindowOpen</animation> <animation effect="fade" time="500">WindowClose</animation> - <animation effect="slide" time="250" start="-300,0">WindowOpen</animation> - <animation effect="slide" time="500" end="0,-300">WindowClose</animation> - <posX>113</posX> - <posY>129</posY> - <layout>StackLayout</layout> - <control> - <description>View-As button</description> - <type>button</type> - <id>2</id> - <label>100</label> - <onleft>2</onleft> - <onright>50</onright> - <onup>17</onup> - <ondown>3</ondown> - </control> - <control> - <type>sortbutton</type> - <id>3</id> - <label>103</label> - <onleft>3</onleft> - <onright>50</onright> - <onup>2</onup> - <ondown>6</ondown> - </control> - <control> - <description>Albums/Artists/Songs/Genres button</description> - <type>button</type> - <id>6</id> - <label>457</label> - <onleft>6</onleft> - <onright>50</onright> - <onup>3</onup> - <ondown>9</ondown> - </control> - <control> - <description>Search button</description> - <type>button</type> - <id>9</id> - <label>137</label> - <onleft>9</onleft> - <onright>50</onright> - <onup>6</onup> - <ondown>12</ondown> - </control> - <control> - <description>Play CD</description> - <type>button</type> - <id>12</id> - <label>890</label> - <onleft>12</onleft> - <onright>50</onright> - <onup>9</onup> - <ondown>10</ondown> - </control> - <control> - <description>Eject Disc</description> - <type>button</type> - <id>10</id> - <label>654</label> - <onleft>10</onleft> - <onright>50</onright> - <onup>12</onup> - <ondown>11</ondown> - <action>100</action> - </control> - <control> - <type>image</type> - <description>Divider image</description> - <id>999</id> - <texture>hbar1.png</texture> - <keepaspectratio>yes</keepaspectratio> - </control> - <control> - <description>Now playing button</description> - <type>button</type> - <id>11</id> - <label>4540</label> - <onleft>11</onleft> - <onright>50</onright> - <onup>10</onup> - <ondown>8</ondown> - <hyperlink>510</hyperlink> - </control> - <control> - <description>Playlist button</description> - <type>button</type> - <id>8</id> - <label>4555</label> - <action>33</action> - <onleft>8</onleft> - <onright>50</onright> - <onup>11</onup> - <ondown>14</ondown> - </control> - <control> - <description>My Playlists</description> - <type>button</type> - <id>14</id> - <label>983</label> - <onleft>14</onleft> - <onright>50</onright> - <onup>8</onup> - <ondown>99</ondown> - </control> </control> + <control> + <type>image</type> + <description>Music top left text logo</description> + <id>1</id> + <posX>90</posX> + <posY>18</posY> + <texture>music_logo.png</texture> + <animation effect="fade" time="500" delay="1300">WindowOpen</animation> + <animation effect="fade" time="500">WindowClose</animation> + </control> + <control> + <type>image</type> + <id>1</id> + <posX>15</posX> + <posY>6</posY> + <width>61</width> + <height>122</height> + <texture>hover_my music.png</texture> + <animation effect="fade" time="1000" delay="2000">WindowOpen</animation> + <animation effect="fade" time="500">WindowClose</animation> + </control> + <control> + <type>label</type> + <description>My Music Label</description> + <id>1</id> + <posX>251</posX> + <posY>68</posY> + <label>2</label> + <font>wipeouts</font> + <align>center</align> + <textcolor>ffffffff</textcolor> + <animation effect="fade" time="1000" end="60" delay="2000">WindowOpen</animation> + <animation effect="slide" time="1000" delay="2000" start="-600,0" end="0,0" acceleration="-1">WindowOpen</animation> + <animation effect="fade" time="500" start="50">WindowClose</animation> + </control> + <control> + <type>image</type> + <decription>mid_strip</decription> + <id>1</id> + <posX>12</posX> + <posY>186</posY> + <width>1342</width> + <height>365</height> + <texture>mid_strip.png</texture> + + </control> + <control> + <type>image</type> + <decription>bottom_strip</decription> + <id>1</id> + <posX>12</posX> + <posY>547</posY> + <width>1342</width> + <height>18</height> + <texture>bottom_strip.png</texture> + + </control> + <control> + <type>image</type> + <decription>top-strip</decription> + <id>1</id> + <posX>12</posX> + <posY>155</posY> + <width>1342</width> + <height>36</height> + <texture>top-strip.png</texture> + + </control> + + <control> + <description>Selected item Label</description> + <type>fadelabel</type> + <id>1</id> + <animation effect="fade" time="400">WindowClose</animation> + <animation effect="fade" time="400">WindowOpen</animation> + <posX>200</posX> + <posY>600</posY> + <width>1000</width> + <label>#selecteditem</label> + <font>wipeout</font> + <align>Left</align> + <textcolor>ffffffff</textcolor> + </control> + + + <control> + <description>View-As button</description> + <type>button</type> + <id>2</id> + <animation effect="fade" time="400">WindowClose</animation> + <animation effect="fade" time="400">WindowOpen</animation> + <posY>155</posY> + <posX>12</posX> + <label>100</label> + <font>font14</font> + <onleft>2</onleft> + <onright>3</onright> + <onup>21</onup> + <ondown>50</ondown> + <width>209</width> + <height>36</height> + <textureFocus>tab_left_corner_down.png</textureFocus> + <textureNoFocus>tab_left_corner_up.png</textureNoFocus> + + + + + </control> + <control> + <type>sortbutton</type> + <id>3</id> + <animation effect="fade" time="400">WindowClose</animation> + <animation effect="fade" time="400">WindowOpen</animation> + <posY>155</posY> + <posX>221</posX> + <label>103</label> + <font>font14</font> + <width>209</width> + <height>36</height> + <onleft>2</onleft> + <onright>6</onright> + <onup>21</onup> + <ondown>50</ondown> + <textureFocus>tab_down.png</textureFocus> + <textureNoFocus>tab_up.png</textureNoFocus> + <textureAscending>arrow_round_up_nofocus.png</textureAscending> + <textureAscendingFocused>arrow_round_up_focus.png</textureAscendingFocused> + <textureDescending>arrow_round_down_nofocus.png</textureDescending> + <textureDescendingFocused>arrow_round_down_focus.png</textureDescendingFocused> + <offsetSortButtonX>180</offsetSortButtonX> + <offsetSortButtonY>8</offsetSortButtonY> + <textcolor>white</textcolor> + </control> + + <control> + <description>Switch View button</description> + <type>button</type> + <id>6</id> + <animation effect="fade" time="400">WindowClose</animation> + <animation effect="fade" time="400">WindowOpen</animation> + <posY>155</posY> + <posX>430</posX> + <label>457</label> + <font>font14</font> + <width>209</width> + <height>36</height> + <onleft>3</onleft> + <onright>7</onright> + <onup>21</onup> + <ondown>50</ondown> + <textureFocus>tab_down.png</textureFocus> + <textureNoFocus>tab_up.png</textureNoFocus> + <textcolor>white</textcolor> + </control> + <control> + <description>Search Button</description> + <type>button</type> + <id>7</id> + <animation effect="fade" time="400">WindowClose</animation> + <animation effect="fade" time="400">WindowOpen</animation> + <posY>155</posY> + <posX>639</posX> + <label>137</label> + <font>font14</font> + <width>209</width> + <height>36</height> + <onleft>6</onleft> + <onright>8</onright> + <onup>21</onup> + <ondown>50</ondown> + <textureFocus>tab_down.png</textureFocus> + <textureNoFocus>tab_up.png</textureNoFocus> + <textcolor>white</textcolor> + </control> + <control> + <description>Play CD</description> + <type>button</type> + <id>8</id> + <animation effect="fade" time="400">WindowClose</animation> + <animation effect="fade" time="400">WindowOpen</animation> + + <posY>155</posY> + <posX>848</posX> + <label>890</label> + <font>font14</font> + <width>209</width> + <height>36</height> + <onleft>7</onleft> + <onright>9</onright> + <onup>21</onup> + <ondown>50</ondown> + <textureFocus>tab_down.png</textureFocus> + <textureNoFocus>tab_up.png</textureNoFocus> + <textcolor>white</textcolor> + <selectedColor>black</selectedColor> + </control> + <control> + <description>My Playlists</description> + <type>button</type> + <id>9</id> + <animation effect="fade" time="400">WindowClose</animation> + <animation effect="fade" time="400">WindowOpen</animation> + <posY>155</posY> + <posX>1057</posX> + <label>983</label> + <font>font14</font> + <ondown>99</ondown> + <width>209</width> + <height>36</height> + <onleft>8</onleft> + <onright>9</onright> + <onup>21</onup> + <ondown>50</ondown> + <textureFocus>tab_down.png</textureFocus> + <textureNoFocus>tab_up.png</textureNoFocus> + <textcolor>white</textcolor> + </control> <control> <type>group</type> <description>group element</description> - <animation effect="fade" time="250">WindowOpen</animation> - <animation effect="fade" time="500">WindowClose</animation> - <animation effect="slide" time="400" start="0,-300">WindowOpen</animation> - <animation effect="slide" time="400" end="800,0">WindowClose</animation> + <animation effect="fade" time="200">WindowOpen</animation> + <animation effect="fade" time="200">WindowClose</animation> <control> <description>composite control consisting of a list control and a thumbnail panel</description> <type>facadeview</type> <id>50</id> <control> - <description>listcontrol</description> - <type>listcontrol</type> - <id>50</id> - <onleft>2</onleft> - <textcolor>FFFFFFFF</textcolor> - </control> + <description>listcontrol</description> + <type>listcontrol</type> + <id>50</id> + <onleft>2</onleft> + <onright>2</onright> + <onup>2</onup> + <ondown>50</ondown> + <spinPosX>1240</spinPosX> + <spinPosY>515</spinPosY> + </control> + <control> + <description>Thumbnail Panel</description> + <type>thumbnailpanel</type> + <id>50</id> + <onleft>2</onleft> + <onright>2</onright> + <onup>2</onup> + <ondown>50</ondown> + <spinPosX>1240</spinPosX> + <spinPosY>515</spinPosY> + </control> <control> - <description>Thumbnail Panel</description> - <type>thumbnailpanel</type> - <id>51</id> - <onleft>2</onleft> - </control> - <control> <description>album view listcontrol</description> <type>listcontrol</type> <subtype>album</subtype> @@ -160,15 +296,86 @@ <textureHeight>132</textureHeight> <onleft>2</onleft> </control> - <control> - <description>Filmstrip view</description> - <type>filmstrip</type> - <id>53</id> - <onleft>2</onleft> - <onright>2</onright> - <onup>2</onup> - <ondown>2</ondown> - </control> + <control> + <description>Filmstrip view</description> + <type>filmstrip</type> + <id>50</id> + <onleft>2</onleft> + <onright>2</onright> + <onup>2</onup> + <ondown>50</ondown> + <posX>25</posX> + <posY>260</posY> + <width>1360</width> + <height>400</height> + <spinWidth>27</spinWidth> + <spinHeight>27</spinHeight> + <spinPosX>1240</spinPosX> + <spinPosY>515</spinPosY> + <spinColor>ffffffff</spinColor> + <textureUp>arrow_round_up_nofocus.png</textureUp> + <textureDown>arrow_round_down_nofocus.png</textureDown> + <textureUpFocus>arrow_round_up_focus.png</textureUpFocus> + <textureDownFocus>arrow_round_down_focus.png</textureDownFocus> + <itemWidth>120</itemWidth> + <itemHeight>100</itemHeight> + <textureWidth>220</textureWidth> + <textureHeight>100</textureHeight> + <thumbWidth>101</thumbWidth> + <thumbHeight>101</thumbHeight> + <thumbPosX>15</thumbPosX><!-- 10 --> + <thumbPosY>1</thumbPosY><!-- 10 --> + <imageFolder>cd_box.png</imageFolder> + <imageFolderFocus>cd_box.png</imageFolderFocus> + <keepaspectratio>no</keepaspectratio> + <font>-</font> + <selectedColor>-</selectedColor> + <textcolor>white</textcolor> + <textXOff>-5000</textXOff> + <colordiffuse>ffffffff</colordiffuse> + <remoteColor>ffFFA075</remoteColor> + <downloadColor>ff80ff80</downloadColor> + <suffix>|</suffix> + <textureWidthBig>100</textureWidthBig> + <textureHeightBig>100</textureHeightBig> + <itemWidthBig>100</itemWidthBig> + <itemHeightBig>84</itemHeightBig> + <thumbWidthBig>84</thumbWidthBig> + <thumbHeightBig>100</thumbHeightBig> + <thumbPosXBig>0</thumbPosXBig> + <thumbPosYBig>0</thumbPosYBig> + <background>-</background> + <backgroundx>130</backgroundx> + <backgroundy>130</backgroundy> + <backgroundwidth>320</backgroundwidth> + <backgroundheight>320</backgroundheight> + <backgrounddiffuse>60ffffff</backgrounddiffuse> + <InfoImage>-</InfoImage> + <InfoImagex>920</InfoImagex> + <InfoImagey>130</InfoImagey> + <InfoImagewidth>310</InfoImagewidth> + <InfoImageheight>450</InfoImageheight> + <InfoImagediffuse>ffffffff</InfoImagediffuse> + + + <textureWidth>120</textureWidth> + <textureHeight>105</textureHeight> + + <showFolder>yes</showFolder> + <showBackGround>no</showBackGround> + <showInfoImage>no</showInfoImage> + <enableFocusZoom>no</enableFocusZoom> + + <thumbs flipY="true" diffuse="Thumb_Mask.png"/> + + <InfoImage flipY="true" diffuse="Thumb_Mask.png"/> + <enableFocusZoom>no</enableFocusZoom> + <thumbAnimation effect="zoom" start="100,100" end="130,130" time="200">focus</thumbAnimation> + <thumbAnimation effect="zoom" start="130,130" end="100,100" time="200">unfocus</thumbAnimation> + + + <animation effect="fade" time="500">delay="1300">WindowOpen</animation> + </control> </control> </control> </controls> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicsongs.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicsongs.xml 2007-09-04 18:53:33 UTC (rev 893) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicsongs.xml 2007-09-05 13:05:02 UTC (rev 894) @@ -104,12 +104,12 @@ <id>1</id> <animation effect="fade" time="400">WindowClose</animation> <animation effect="fade" time="400">WindowOpen</animation> - <posX>250</posX> + <posX>200</posX> <posY>600</posY> <width>1000</width> <label>#selecteditem</label> <font>wipeout</font> - <align>center</align> + <align>Left</align> <textcolor>ffffffff</textcolor> </control> @@ -124,10 +124,10 @@ <posY>155</posY> <posX>12</posX> <label>100</label> - <font>font10</font> + <font>font14</font> <onleft>2</onleft> <onright>3</onright> - <onup>2</onup> + <onup>21</onup> <ondown>50</ondown> <width>209</width> <height>36</height> @@ -146,12 +146,12 @@ <posY>155</posY> <posX>221</posX> <label>103</label> - <font>font10</font> + <font>font14</font> <width>209</width> <height>36</height> <onleft>2</onleft> <onright>6</onright> - <onup>3</onup> + <onup>21</onup> <ondown>50</ondown> <textureFocus>tab_down.png</textureFocus> <textureNoFocus>tab_up.png</textureNoFocus> @@ -161,7 +161,7 @@ <textureDescendingFocused>arrow_round_down_focus.png</textureDescendingFocused> <offsetSortButtonX>180</offsetSortButtonX> <offsetSortButtonY>8</offsetSortButtonY> - <textcolor>black</textcolor> + <textcolor>white</textcolor> </control> <control> @@ -173,16 +173,16 @@ <posY>155</posY> <posX>430</posX> <label>457</label> - <font>font10</font> + <font>font14</font> <width>209</width> <height>36</height> <onleft>3</onleft> <onright>7</onright> - <onup>6</onup> + <onup>21</onup> <ondown>50</ondown> <textureFocus>tab_down.png</textureFocus> <textureNoFocus>tab_up.png</textureNoFocus> - <textcolor>black</textcolor> + <textcolor>white</textcolor> </control> <control> <description>Search Button</description> @@ -193,16 +193,16 @@ <posY>155</posY> <posX>639</posX> <label>137</label> - <font>font10</font> + <font>font14</font> <width>209</width> <height>36</height> <onleft>6</onleft> <onright>8</onright> - <onup>7</onup> + <onup>21</onup> <ondown>50</ondown> <textureFocus>tab_down.png</textureFocus> <textureNoFocus>tab_up.png</textureNoFocus> - <textcolor>black</textcolor> + <textcolor>white</textcolor> </control> <control> <description>Play CD</description> @@ -214,16 +214,16 @@ <posY>155</posY> <posX>848</posX> <label>890</label> - <font>font10</font> + <font>font14</font> <width>209</width> <height>36</height> <onleft>7</onleft> <onright>9</onright> - <onup>8</onup> + <onup>21</onup> <ondown>50</ondown> <textureFocus>tab_down.png</textureFocus> <textureNoFocus>tab_up.png</textureNoFocus> - <textcolor>black</textcolor> + <textcolor>white</textcolor> <selectedColor>black</selectedColor> </control> <control> @@ -235,17 +235,17 @@ <posY>155</posY> <posX>1057</posX> <label>983</label> - <font>font10</font> + <font>font14</font> <ondown>99</ondown> <width>209</width> <height>36</height> <onleft>8</onleft> <onright>9</onright> - <onup>17</onup> + <onup>21</onup> <ondown>50</ondown> <textureFocus>tab_down.png</textureFocus> <textureNoFocus>tab_up.png</textureNoFocus> - <textcolor>black</textcolor> + <textcolor>white</textcolor> </control> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/mypics.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/mypics.xml 2007-09-04 18:53:33 UTC (rev 893) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/mypics.xml 2007-09-05 13:05:02 UTC (rev 894) @@ -100,12 +100,12 @@ <id>1</id> <animation effect="fade" time="400">WindowClose</animation> <animation effect="fade" time="400">WindowOpen</animation> - <posX>250</posX> + <posX>200</posX> <posY>600</posY> <width>1000</width> <label>#selecteditem</label> <font>wipeout</font> - <align>center</align> + <align>Left</align> <textcolor>ffffffff</textcolor> </control> @@ -215,27 +215,8 @@ <textureNoFocus>tab_up.png</textureNoFocus> <textcolor>white</textcolor> </control> - <control> - <description>Rotate</description> - <type>button</type> - <id>9</id> - <animation effect="fade" time="400">WindowClose</animation> - <animation effect="fade" time="400">WindowOpen</animation> - <posY>155</posY> - <posX>1057</posX> - <label>735</label> - <ondown>99</ondown> - <width>209</width> - <height>36</height> - <onleft>8</onleft> - <onright>9</onright> - <onup>17</onup> - <ondown>50</ondown> - <textureFocus>tab_down.png</textureFocus> - <textureNoFocus>tab_up.png</textureNoFocus> - <textcolor>white</textcolor> - </control> + <control> <type>group</type> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/myplugins.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/myplugins.xml 2007-09-04 18:53:33 UTC (rev 893) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/myplugins.xml 2007-09-05 13:05:02 UTC (rev 894) @@ -83,6 +83,41 @@ <animation effect="fade" time="250">WindowOpen</animation> <animation effect="fade" time="500">WindowClose</animation> </control> + <control> + <type>image</type> + <decription>mid_strip</decription> + <id>1</id> + <posX>12</posX> + <posY>186</posY> + <width>1342</width> + <height>365</height> + <texture>mid_strip.png</texture> + <animation effect="zoom" start="100,100" end="100,115" center="12,186" time="1000" acceleration ="-1" >WindowOpen</animation> + <animation effect="zoom" start="100,115" end="100,100" center="12,186" time="1000" acceleration ="-1" >WindowClose</animation> + </control> + <control> + <type>image</type> + <decription>bottom_strip</decription> + <id>1</id> + <posX>12</posX> + <posY>547</posY> + <width>1342</width> + <height>18</height> + <texture>bottom_strip.png</texture> + <animation effect="slide" time="1000" start="0,0" end="0,50" acceleration="-1" >WindowOpen</animation> + <animation effect="slide" time="1000" start="0,50" end="0,0" acceleration="-1" >WindowClose</animation> + </control> + <control> + <type>image</type> + <decription>top-strip</decription> + <id>1</id> + <posX>12</posX> + <posY>155</posY> + <width>1342</width> + <height>36</height> + <texture>top-strip.png</texture> + + </control> <control> <description>template for panel in which all buttons should b fitted</description> <type>image</type> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/myradio.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/myradio.xml 2007-09-04 18:53:33 UTC (rev 893) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/myradio.xml 2007-09-05 13:05:02 UTC (rev 894) @@ -112,8 +112,7 @@ <animation effect="fade" time="400">WindowOpen</animation> <posY>155</posY> <posX>12</posX> - <label>100</label> - <font>font10</font> + <label>100</label> <font>font14</font> <onleft>2</onleft> <onright>3</onright> <onup>2</onup> @@ -139,8 +138,7 @@ <animation effect="fade" time="400">WindowOpen</animation> <posY>155</posY> <posX>221</posX> - <label>103</label> - <font>font10</font> + <label>103</label> <font>font14</font> <width>209</width> <height>36</height> <onleft>2</onleft> @@ -170,8 +168,7 @@ <animation effect="fade" time="400">WindowClose</animation> <animation effect="fade" time="400">WindowOpen</animation> <posY>155</posY> - <posX>430</posX> - <font>font10</font> + <posX>430</posX> <font>font14</font> <label>210</label> <width>209</width> <height>36</height> @@ -191,8 +188,7 @@ <animation effect="fade" time="400">WindowOpen</animation> <posY>155</posY> <posX>639</posX> - <label>209</label> - <font>font10</font> + <label>209</label> <font>font14</font> <width>209</width> <height>36</height> <onleft>6</onleft> @@ -212,8 +208,7 @@ <posY>155</posY> <posX>848</posX> - <label>533</label> - <font>font10</font> + <label>533</label> <font>font14</font> <width>209</width> <height>36</height> <onleft>7</onleft> @@ -232,8 +227,7 @@ <animation effect="fade" time="400">WindowOpen</animation> <posY>155</posY> <posX>1057</posX> - <label>983</label> - <font>font10</font> + <label>983</label> <font>font14</font> <ondown>99</ondown> <width>209</width> <height>36</height> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/mytvhome.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/mytvhome.xml 2007-09-04 18:53:33 UTC (rev 893) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/mytvhome.xml 2007-09-05 13:05:02 UTC (rev 894) @@ -3,8 +3,6 @@ <id>1</id> <defaultcontrol>11</defaultcontrol> <allowoverlay>no</allowoverlay> - - <define>#header.label:605</define> <controls> @@ -77,11 +75,11 @@ <onup>11</onup> <ondown>2</ondown> <onleft>22</onleft> - <onright>22</onright> + <onright>8</onright> </control> <control> <description>TV ON</description> - <type>button</type> + <type>togglebutton</type> <id>8</id> <animation effect="fade" time="400">WindowClose</animation> <animation effect="slide" time="500" start="1000,0" end="0,0" delay="100" acceleration="-1">WindowOpen</animation> @@ -92,17 +90,15 @@ <font>font14</font> <width>209</width> <height>36</height> - <onleft>2</onleft> - <onright>6</onright> + <onleft>11</onleft> + <onright>2</onright> <onup>3</onup> <ondown>50</ondown> <textureFocus>tab_down.png</textureFocus> <textureNoFocus>tab_up.png</textureNoFocus> <textureAscending>arrow_round_up_nofocus.png</textureAscending> - <onup>11</onup> - <ondown>2</ondown> - <onleft>21</onleft> - <onright>21</onright> + + </control> <control> <description>TV GUIDE</description> @@ -118,47 +114,39 @@ <font>font14</font> <width>209</width> <height>36</height> + <onleft>8</onleft> + <onright>7</onright> + <onup>21</onup> + <ondown>50</ondown> + <textureFocus>tab_down.png</textureFocus> + <textureNoFocus>tab_up.png</textureNoFocus> + <textureAscending>arrow_round_up_nofocus.png</textureAscending> + + </control> + <control> + <description>Channel Button</description> + <type>button</type> + <id>7</id> + <animation effect="fade" time="400">WindowClose</animation> + <animation effect="slide" time="500" start="1000,0" end="0,0" delay="100" acceleration="-1">WindowOpen</animation> + <animation effect="fade" time="400" delay="100">WindowOpen</animation> + <posY>155</posY> + <posX>639</posX> + <label>602</label> + <font>font14</font> + <width>209</width> + <height>36</height> <onleft>2</onleft> - <onright>6</onright> - <onup>3</onup> + <onright>11</onright> + <onup>21</onup> <ondown>50</ondown> <textureFocus>tab_down.png</textureFocus> <textureNoFocus>tab_up.png</textureNoFocus> <textureAscending>arrow_round_up_nofocus.png</textureAscending> <onup>11</onup> - <ondown>2</ondown> - <onleft>21</onleft> - <onright>21</onright> + </control> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <control> + <control> <description>Current program title</description> <type>fadelabel</type> <id>13</id> @@ -250,20 +238,8 @@ <animation effect="fade" time="250">WindowOpen</animation> <animation effect="fade" time="500">WindowClose</animation> </control> + <control> - <description>rectangle</description> - <type>image</type> - <id>21</id> - <posX>161</posX> - <posY>560</posY> - <width>120</width> - <height>120</height> - <texture>tv_background.png</texture> - <colordiffuse>White</colordiffuse> - <animation effect="fade" time="250">WindowOpen</animation> - <animation effect="fade" time="500">WindowClose</animation> - </control> - <control> <description>Recording Channel</description> <type>image</type> <id>22</id> @@ -381,17 +357,8 @@ <animation effect="slide" time="1000" delay="2000" start="-600,0" end="0,0" acceleration="-1">WindowOpen</animation> <animation effect="fade" time="500" start="50">WindowClose</animation> </control> - <control> - <description>Channel button</description> - <type>button</type> - <id>7</id> - <label>602</label> - <onup>6</onup> - <ondown>8</ondown> - <onright>99</onright> - <onleft>99</onleft> - </control> + </controls> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/myvideo.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/myvideo.xml 2007-09-04 18:53:33 UTC (rev 893) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/myvideo.xml 2007-09-05 13:05:02 UTC (rev 894) @@ -106,7 +106,7 @@ <posY>600</posY> <width>1000</width> <label>#selecteditem</label> - <font>wipeouts</font> + <font>wipeout</font> <align>center</align> <textcolor>ffffffff</textcolor> </control> @@ -122,7 +122,7 @@ <posY>155</posY> <posX>12</posX> <label>100</label> - <font>font10</font> + <font>font14</font> <onleft>20</onleft> <onright>3</onright> <onup>21</onup> @@ -144,7 +144,7 @@ <posY>155</posY> <posX>221</posX> <label>103</label> - <font>font10</font> + <font>font14</font> <width>209</width> <height>36</height> <onleft>2</onleft> @@ -171,7 +171,7 @@ <posY>155</posY> <posX>430</posX> <label>457</label> - <font>font10</font> + <font>font14</font> <width>209</width> <height>36</height> <onleft>3</onleft> @@ -193,7 +193,7 @@ <posY>155</posY> <posX>639</posX> - <font>font10</font> + <font>font14</font> <width>209</width> <height>36</height> <onleft>5</onleft> @@ -216,7 +216,7 @@ <posY>155</posY> <posX>848</posX> <label>341</label> - <font>font10</font> + <font>font14</font> <width>209</width> <height>36</height> <onleft>8</onleft> @@ -240,7 +240,7 @@ <posY>155</posY> <posX>1057</posX> - <font>font10</font> + <font>font14</font> <ondown>99</ondown> <width>209</width> <height>36</height> @@ -385,7 +385,7 @@ <posX>639</posX> <label>TV Series</label> <hyperlink>9811</hyperlink> - <font>font10</font> + <font>font14</font> <width>209</width> <height>36</height> <onleft>5</onleft> @@ -408,7 +408,7 @@ <posY>158</posY> <posX>848</posX> <label>654</label> - <font>font10</font> + <font>font14</font> <width>209</width> <height>36</height> <onleft>8</onleft> @@ -431,7 +431,7 @@ <posY>158</posY> <posX>1057</posX> <label>654</label> - <font>font10</font> + <font>font14</font> <width>209</width> <height>36</height> <onleft>9</onleft> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/myvideoTitle.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/myvideoTitle.xml 2007-09-04 18:53:33 UTC (rev 893) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/myvideoTitle.xml 2007-09-05 13:05:02 UTC (rev 894) @@ -141,7 +141,7 @@ <posY>155</posY> <posX>12</posX> <label>100</label> - <font>font10</font> + <font>font14</font> <onleft>20</onleft> <onright>3</onright> <onup>21</onup> @@ -163,7 +163,7 @@ <posY>155</posY> <posX>221</posX> <label>103</label> - <font>font10</font> + <font>font14</font> <width>209</width> <height>36</height> <onleft>2</onleft> @@ -189,7 +189,7 @@ <posY>155</posY> <posX>430</posX> <label>457</label> - <font>font10</font> + <font>font14</font> <width>209</width> <height>36</height> <onleft>3</onleft> @@ -211,7 +211,7 @@ <posY>155</posY> <posX>639</posX> - <font>font10</font> + <font>font14</font> <width>209</width> <height>36</height> <onleft>5</onleft> @@ -232,7 +232,7 @@ <posY>155</posY> <posX>848</posX> <label>341</label> - <font>font10</font> + <font>font14</font> <width>209</width> <height>36</height> <onleft>8</onleft> @@ -256,7 +256,7 @@ <posY>155</posY> <posX>1057</posX> - <font>font10</font> + <font>font14</font> <ondown>99</ondown> <width>209</width> <height>36</height> @@ -387,7 +387,7 @@ <posX>639</posX> <label>TV Series</label> <hyperlink>9811</hyperlink> - <font>font10</font> + <font>font14</font> <width>209</width> <height>36</height> <onleft>5</onleft> @@ -410,7 +410,7 @@ <posY>158</posY> <posX>848</posX> <label>654</label> - <font>font10</font> + <font>font14</font> <width>209</width> <height>36</height> <onleft>8</onleft> @@ -433,7 +433,7 @@ <posY>158</posY> <posX>1057</posX> <label>654</label> - <font>font10</font> + <font>font14</font> <width>209</width> <height>36</height> <onleft>9</onleft> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/release notes.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/release notes.xml 2007-09-04 18:53:33 UTC (rev 893) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/release notes.xml 2007-09-05 13:05:02 UTC (rev 894) @@ -14,4 +14,8 @@ Updated my videos layout added dvd-box -updated default dvd-big \ No newline at end of file +updated default dvd-big +update myhmusicgenre.xml +updated my pics dialog +Updated home +updated plugin home \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nor...@us...> - 2007-09-04 18:53:42
|
Revision: 893 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=893&view=rev Author: northern_sky Date: 2007-09-04 11:53:33 -0700 (Tue, 04 Sep 2007) Log Message: ----------- some importrestructure Modified Paths: -------------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/DirectoryImport.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/GamebaseImport.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/ImportBase.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/MameImport.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItem.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemDirectoryCache.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemGameBase.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemMame.cs Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/DirectoryImport.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/DirectoryImport.cs 2007-09-04 08:54:30 UTC (rev 892) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/DirectoryImport.cs 2007-09-04 18:53:33 UTC (rev 893) @@ -16,34 +16,32 @@ { public class DirectoryImport: ImportBase { - private ApplicationItem applicationItem = null; - private DatabaseHandler dbHandlerInstance = DatabaseHandler.DBHandlerInstance; - public DirectoryImport(ApplicationItem objApp) + public DirectoryImport(ApplicationItem applicationItem) { - applicationItem = objApp; + this.applicationItem = applicationItem; } private void ImportFileItem(FileInfo fileInfo) { - FileItem curFile = new FileItem(); - curFile.FileID = -1; // to force an INSERT statement when writing the item - curFile.ApplicationItemId = applicationItem.ApplicationItemId; - curFile.Title = Path.GetFileNameWithoutExtension(fileInfo.Name); - curFile.Filename = fileInfo.FullName; - curFile.LastTimeLaunched = DateTime.MinValue; - curFile.LaunchCount = 0; + FileItem newFileItem = new FileItem(); + newFileItem.FileID = -1; // to force an INSERT statement when writing the item + newFileItem.ApplicationItemId = applicationItem.ApplicationItemId; + newFileItem.Title = Path.GetFileNameWithoutExtension(fileInfo.Name); + newFileItem.Filename = fileInfo.FullName; + newFileItem.LastTimeLaunched = DateTime.MinValue; + newFileItem.LaunchCount = 0; //curFile.Imagefile = GetThumbsFile(fileInfo, curFile.Title); - curFile.Imagefile = ImportImageFiles(curFile.Filename, curFile.Title, applicationItem); + newFileItem.Imagefile = ImportImageFiles(newFileItem.Filename, newFileItem.Title, applicationItem); - if ((curFile.Imagefile == "") && (applicationItem.ImportValidImagesOnly)) + if ((newFileItem.Imagefile == "") && (applicationItem.ImportValidImagesOnly)) { // SendDisplayText("", (int)(100 * (((double)count) / total))); } else { - curFile.Write(); + newFileItem.Write(); } } @@ -117,7 +115,7 @@ } } - public void StartImport() + public override void StartImport() { string[] fileDirPaths = this.applicationItem.FileDirectory.Split(';'); Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/GamebaseImport.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/GamebaseImport.cs 2007-09-04 08:54:30 UTC (rev 892) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/GamebaseImport.cs 2007-09-04 18:53:33 UTC (rev 893) @@ -42,58 +42,61 @@ /// </summary> public class GamebaseImport : ImportBase { - private ApplicationItem applicationItem = null; - - public GamebaseImport(ApplicationItem objApp) + + public GamebaseImport(ApplicationItem applicationItem) { - applicationItem = objApp; + this.applicationItem = applicationItem; } - void DBImportGamebaseItem(OleDbDataReader myReader, string romFilename, string imgFilename, int curPos, int maxGames) { - FileItem curFile = new FileItem(); - curFile.FileID = -1; // to force an INSERT statement when writing the item - curFile.ApplicationItemId = applicationItem.ApplicationItemId; - curFile.Title = myReader["name"].ToString(); - curFile.Filename = romFilename; - curFile.Imagefile = imgFilename; + FileItem newFileItem = new FileItem(); + newFileItem.FileID = -1; // to force an INSERT statement when writing the item + newFileItem.ApplicationItemId = applicationItem.ApplicationItemId; + newFileItem.Title = myReader["name"].ToString(); + newFileItem.Filename = romFilename; + newFileItem.Imagefile = imgFilename; string strGenre1 = myReader["ParentGenre"].ToString(); string strGenre2 = myReader["Genre"].ToString(); int LexiconId = DatabaseHandler.DBHandlerInstance.LexiconDataExists("tblGenre", "genre", strGenre1); - curFile.GenreId = LexiconId; + newFileItem.GenreId = LexiconId; LexiconId = DatabaseHandler.DBHandlerInstance.LexiconDataExists("tblGenre", "genre", strGenre2); - curFile.GenreStyleId = LexiconId; + newFileItem.GenreStyleId = LexiconId; // todo: country - curFile.Country = ""; + newFileItem.Country = ""; LexiconId = DatabaseHandler.DBHandlerInstance.LexiconDataExists("tblManufacturer", "manufacturer", myReader["Publisher"].ToString()); - curFile.ManufacturerId = LexiconId; - curFile.Year = Convert.ToInt32(myReader["Year"]); - curFile.Rating = Convert.ToInt32(myReader["Rating"]) * 2; - if (curFile.Rating > 10) + newFileItem.ManufacturerId = LexiconId; + newFileItem.Year = Convert.ToInt32(myReader["Year"]); + newFileItem.Rating = Convert.ToInt32(myReader["Rating"]) * 2; + if (newFileItem.Rating > 10) { - curFile.Rating = 10; + newFileItem.Rating = 10; } - if (curFile.Rating < 1) + if (newFileItem.Rating < 1) { - curFile.Rating = 5; // average / not rated.... + newFileItem.Rating = 5; // average / not rated.... } - curFile.Overview = myReader["MemoText"].ToString(); - curFile.Platform = applicationItem.Title; + newFileItem.Overview = myReader["MemoText"].ToString(); + newFileItem.Platform = applicationItem.Title; // not imported properties => set default values - curFile.LastTimeLaunched = DateTime.MinValue; - curFile.LaunchCount = 0; - curFile.Write(); + newFileItem.LastTimeLaunched = DateTime.MinValue; + newFileItem.LaunchCount = 0; + newFileItem.Write(); return; } - public void StartImport() + public override void StartImport() { + string curRomname = ""; + string curFullRomname = ""; + string curTitleImage = ""; + bool bDoImport = false; + // string strCon = "Provider=Microsoft.Jet.OLEDB.4.0 ;Data Source=C:\\media\\GameBase\\snes\\Snes.mdb"; string strCon = String.Format("Provider=Microsoft.Jet.OLEDB.4.0 ;Data Source={0}", applicationItem.ApplicationItemSource); @@ -125,27 +128,20 @@ ORDER BY Games.Name "; - string curRomname = ""; - string curFullRomname = ""; - string curTitleImage = ""; - bool bDoImport = false; + try { using (OleDbConnection myCon = new OleDbConnection(strCon)) { - using (OleDbCommand myCmd = new OleDbCommand(sqlStr, myCon)) { - using (SQLiteTransaction transaction = DatabaseHandler.DBHandlerInstance.SqlLiteConn.BeginTransaction()) { myCon.Open(); int maxGames = CountGames(myCon, sqlStrCount); - using (OleDbDataReader myReader = myCmd.ExecuteReader()) { - int i = 0; while (myReader.Read()) { @@ -221,7 +217,6 @@ { Log.Info("myProgams error in connecting to gamebase-mdb \n {0}", er.ToString()); } - return res; } } Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/ImportBase.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/ImportBase.cs 2007-09-04 08:54:30 UTC (rev 892) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/ImportBase.cs 2007-09-04 18:53:33 UTC (rev 893) @@ -5,8 +5,8 @@ using System.IO; using GUIProgramsAlt.Items; using GUIProgramsAlt; +using GUIProgramsAlt.Database; - namespace GUIProgramsAlt.Imports { public abstract class ImportBase @@ -15,6 +15,8 @@ public delegate void ReadNewFileEventHandler(object sender, FileReadEventArgs e); public event ReadNewFileEventHandler ReadNewFileEvent = null; + protected ApplicationItem applicationItem = null; + protected DatabaseHandler dbHandlerInstance = DatabaseHandler.DBHandlerInstance; protected void OnReadNewFileEvent(object sender,FileReadEventArgs e) { @@ -24,7 +26,9 @@ } } - public virtual void startImport() + + + public virtual void StartImport() { //override Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/MameImport.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/MameImport.cs 2007-09-04 08:54:30 UTC (rev 892) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/MameImport.cs 2007-09-04 18:53:33 UTC (rev 893) @@ -48,7 +48,6 @@ /// </summary> public class MameImport : ImportBase { - ApplicationItem currentApplication = null; ConditionChecker conditionChecker = new ConditionChecker(); @@ -73,7 +72,7 @@ public MameImport(ApplicationItem applicationItem) { - currentApplication = applicationItem; + this.applicationItem = applicationItem; } void ReadListFull() @@ -85,7 +84,7 @@ using (Process process = new Process()) { - ProcessStartInfo processStartInfo = new ProcessStartInfo(currentApplication.Executable); + ProcessStartInfo processStartInfo = new ProcessStartInfo(applicationItem.Executable); processStartInfo.Arguments = "-listfull"; processStartInfo.UseShellExecute = false; processStartInfo.RedirectStandardOutput = true; @@ -112,13 +111,13 @@ void ReadListClones() { string line; - if (((ApplicationItemMame)currentApplication).ImportOriginalsOnly) + if (((ApplicationItemMame)applicationItem).ImportOriginalsOnly) { OnReadNewFileEvent(this,new FileReadEventArgs(20,"generating mame list (clones)")); using (Process process = new Process()) { - ProcessStartInfo myProcessStartInfo = new ProcessStartInfo(currentApplication.Executable); + ProcessStartInfo myProcessStartInfo = new ProcessStartInfo(applicationItem.Executable); myProcessStartInfo.Arguments = "-listclones"; myProcessStartInfo.UseShellExecute = false; myProcessStartInfo.RedirectStandardOutput = true; @@ -234,11 +233,11 @@ { char separator = ';'; conditionChecker.Clear(); - string[] fileDirs = currentApplication.FileDirectory.Split(separator); + string[] fileDirs = applicationItem.FileDirectory.Split(separator); - if (conditionChecker.DoCheck(System.IO.File.Exists(currentApplication.Executable), "mame-application not found!")) + if (conditionChecker.DoCheck(System.IO.File.Exists(applicationItem.Executable), "mame-application not found!")) { - mameDir = Path.GetDirectoryName(currentApplication.Executable); + mameDir = Path.GetDirectoryName(applicationItem.Executable); catverIniFile = mameDir + "\\catver.ini"; historyDatFile = mameDir + "\\history.dat"; } @@ -276,7 +275,7 @@ } - public void StartImport() + public override void StartImport() { if (!CheckPrerequisites()) { @@ -329,9 +328,9 @@ string fullEntry = ""; string genreEntry = ""; string versionEntry = ""; - bool onlyOriginals = ((ApplicationItemMame)currentApplication).ImportOriginalsOnly; - bool importMahjongGames = currentApplication.ImportMameMahjong; - bool importPlaychoiceGames = currentApplication.ImportMamePlaychoice10; + bool onlyOriginals = ((ApplicationItemMame)applicationItem).ImportOriginalsOnly; + bool importMahjongGames = applicationItem.ImportMameMahjong; + bool importPlaychoiceGames = applicationItem.ImportMamePlaychoice10; bool shouldImport = true; MameHistoryContainer mameHistoryNode = null; @@ -342,11 +341,11 @@ { FileItem curFile = new FileItem(); - curFile.ApplicationItemId = currentApplication.ApplicationItemId; + curFile.ApplicationItemId = applicationItem.ApplicationItemId; curFile.Filename = fullRomname; - curFile.Imagefile = ImportImageFiles(curFile.Filename, curFile.Title, currentApplication); + curFile.Imagefile = ImportImageFiles(curFile.Filename, curFile.Title, applicationItem); - if ((curFile.Imagefile == "") && (currentApplication.ImportValidImagesOnly)) + if ((curFile.Imagefile == "") && (applicationItem.ImportValidImagesOnly)) { OnReadNewFileEvent(this,new FileReadEventArgs( (int)(100 * (((double)count) / total)),"")); return; Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItem.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItem.cs 2007-09-04 08:54:30 UTC (rev 892) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItem.cs 2007-09-04 18:53:33 UTC (rev 893) @@ -51,6 +51,8 @@ { public abstract class ApplicationItem { + protected ImportBase importBase = null; + #region Events/Delegates // public delegate void FilelinkLaunchEventHandler(FilelinkItem curLink, bool mpGuiMode); @@ -67,6 +69,11 @@ public delegate void ImportDelegate(); protected ImportDelegate importDelegate = null; + protected void Import_ReadNewFileEvent(object sender, FileReadEventArgs e) + { + this.SetGUIProgressDialog(e.message, e.ctr); + } + public virtual void OnImportFinished(object sender, EventArgs e) { if (ImportFinishedEvent != null) @@ -463,7 +470,16 @@ protected virtual void Import(bool mpGUIMode) { - //override + + + if (!File.Exists(this.Executable)) // no "mame.exe" + return; + + + importBase.ReadNewFileEvent += new ImportBase.ReadNewFileEventHandler(Import_ReadNewFileEvent); + importDelegate = new ImportDelegate(importBase.StartImport); + importDelegate.BeginInvoke(new AsyncCallback(ImportEnded), null); + } #endregion protected methods Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemDirectoryCache.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemDirectoryCache.cs 2007-09-04 08:54:30 UTC (rev 892) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemDirectoryCache.cs 2007-09-04 18:53:33 UTC (rev 893) @@ -80,7 +80,6 @@ { Import(mpGuiMode); FixFileLinks(); - LoadFiles(); } protected override void Import(bool mpGUIMode) @@ -89,27 +88,14 @@ { ShowProgressDialog("Importing from folders.."); } - DirectoryImport directoryImport = null; - if (!File.Exists(this.Executable)) // no "mame.exe" - return; - ValidExtensions = ValidExtensions.Replace(" ", ""); - + importBase = new DirectoryImport(this); + base.Import(mpGUIMode); + } - directoryImport = new DirectoryImport(this); - directoryImport.ReadNewFileEvent += new ImportBase.ReadNewFileEventHandler(directoryImport_ReadNewFileEvent); - importDelegate = new ImportDelegate(directoryImport.StartImport); - importDelegate.BeginInvoke(new AsyncCallback(ImportEnded), null); - - - #endregion ApplicationItem Overloads - } - - void directoryImport_ReadNewFileEvent(object sender, FileReadEventArgs e) - { - this.SetGUIProgressDialog(e.message, e.ctr); - } + #endregion ApplicationItem Overloads + } } \ No newline at end of file Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemGameBase.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemGameBase.cs 2007-09-04 08:54:30 UTC (rev 892) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemGameBase.cs 2007-09-04 18:53:33 UTC (rev 893) @@ -60,35 +60,25 @@ if ((ApplicationItemSource == "") || (!File.Exists(ApplicationItemSource))) return; - GamebaseImport gameBaseImport = null; if (mpGUIMode) { ShowProgressDialog("Importing from gameBase.."); } - if (!File.Exists(this.Executable)) // no "mame.exe" - return; + importBase = new GamebaseImport(this); + base.Import(mpGUIMode); - gameBaseImport = new GamebaseImport(this); - gameBaseImport.ReadNewFileEvent += new ImportBase.ReadNewFileEventHandler(gameBaseImport_ReadNewFileEvent); - importDelegate = new ImportDelegate(gameBaseImport.StartImport); - importDelegate.BeginInvoke(new AsyncCallback(ImportEnded), null); - } - void gameBaseImport_ReadNewFileEvent(object sender, FileReadEventArgs e) - { - this.SetGUIProgressDialog(e.message, e.ctr); - } + public override void Refresh(bool bGUIMode) { DeleteFiles(); Import(bGUIMode); FixFileLinks(); - LoadFiles(); } #endregion ApplicationItem Overloads } Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemMame.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemMame.cs 2007-09-04 08:54:30 UTC (rev 892) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemMame.cs 2007-09-04 18:53:33 UTC (rev 893) @@ -103,31 +103,20 @@ DeleteFiles(); Import(bGUIMode); FixFileLinks(); - LoadFiles(); } protected override void Import(bool mpGUIMode) { - if (!File.Exists(this.Executable)) // no "mame.exe" - return; - MameImport mameImport = null; - if (mpGUIMode) { - ShowProgressDialog("Importing Mameitems.."); + ShowProgressDialog("Importing from mame.."); } - mameImport = new MameImport(this); - mameImport.ReadNewFileEvent += new ImportBase.ReadNewFileEventHandler(mameImport_OnReadNewFileEvent); - importDelegate = new ImportDelegate(mameImport.StartImport); - importDelegate.BeginInvoke(new AsyncCallback(ImportEnded),null); + importBase = new MameImport(this); + base.Import(mpGUIMode); } - void mameImport_OnReadNewFileEvent(object sender,FileReadEventArgs e) - { - this.SetGUIProgressDialog(e.message, e.ctr); - } #endregion ApplicationItem Overloads } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gib...@us...> - 2007-09-04 08:54:32
|
Revision: 892 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=892&view=rev Author: gibman_dk Date: 2007-09-04 01:54:30 -0700 (Tue, 04 Sep 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/SkinChanger/SkinChanger/SkinChanger.cs Modified: trunk/plugins/SkinChanger/SkinChanger/SkinChanger.cs =================================================================== --- trunk/plugins/SkinChanger/SkinChanger/SkinChanger.cs 2007-09-04 07:32:31 UTC (rev 891) +++ trunk/plugins/SkinChanger/SkinChanger/SkinChanger.cs 2007-09-04 08:54:30 UTC (rev 892) @@ -4,6 +4,7 @@ using MediaPortal.GUI.Library; using MediaPortal.Configuration; using System.Windows.Forms; +using MediaPortal.Player; namespace MediaPortal.GUI.SkinChanger { @@ -180,8 +181,14 @@ { newSkin = (string)_skins[_activeSkinIndex + 1]; _activeSkinIndex++; - } - + } + /* + if (GUIGraphicsContext.Skin == newSkin) + { + _activeSkinIndex++; + newSkin = (string)_skins[_activeSkinIndex]; + } + */ SwitchToSkin(newSkin); } @@ -205,6 +212,13 @@ newSkin = (string)_skins[_activeSkinIndex - 1]; _activeSkinIndex--; } + /* + if (GUIGraphicsContext.Skin == newSkin) + { + _activeSkinIndex--; + newSkin = (string)_skins[_activeSkinIndex]; + } + */ SwitchToSkin(newSkin); } @@ -212,6 +226,11 @@ private void SwitchToSkin(string newSkin) { + //we have to pause the gplayer, otherwise we might hang the app. + if (g_Player.IsVideo || g_Player.IsTV && !g_Player.Paused) + { + g_Player.Pause(); + } // Set the skin to the selected skin and reload GUI GUIGraphicsContext.Skin = newSkin; @@ -229,7 +248,16 @@ if (autosize && !GUIGraphicsContext.Fullscreen) Form.ActiveForm.Size = new System.Drawing.Size(GUIGraphicsContext.SkinSize.Width, GUIGraphicsContext.SkinSize.Height); } - GUIWindowManager.OnResize(); + GUIWindowManager.OnResize(); + + // we need to refresh the current active screen, otherwise we will see some unwanted stuff. + GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_WINDOW_INIT, GUIWindowManager.ActiveWindow, 0, 0, 0, 0, null); + GUIWindowManager.SendThreadMessage(msg); + + if (g_Player.Paused) + { + g_Player.Pause(); + } } #endregion This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gre...@us...> - 2007-09-04 07:32:34
|
Revision: 891 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=891&view=rev Author: gregmac45 Date: 2007-09-04 00:32:31 -0700 (Tue, 04 Sep 2007) Log Message: ----------- Added page with all available trailers for movie Modified Paths: -------------- trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/ImageDowloader.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesTrailerUtil.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/AppleTrailers.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/HDHelper.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/ItmsHelper.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/RegexParsers.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/TrailerIndex.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/TrailerStream.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs 2007-09-03 19:59:11 UTC (rev 890) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs 2007-09-04 07:32:31 UTC (rev 891) @@ -23,13 +23,17 @@ { [SkinControlAttribute(2)] protected GUIButtonControl btnViewAs = null; + [SkinControlAttribute(3)] + protected GUIButtonControl btnNext = null; + [SkinControlAttribute(4)] + protected GUIButtonControl btnPrevious = null; [SkinControlAttribute(50)] protected GUIFacadeControl facadeView = null; [SkinControlAttribute(1)] protected GUIImage logoImage = null; - [SkinControlAttribute(4)] - protected GUITextControl txtDesc = null; + //[SkinControlAttribute(4)] + //protected GUITextControl txtDesc = null; //private ILog moLog; protected View currentView = View.Icons; @@ -42,6 +46,7 @@ private State _CurrentState = State.home; private String msDownloadDir = Directory.GetCurrentDirectory()+"\\"; private List<VideoInfo> moCurrentVideoList = new List<VideoInfo>(); + private List<VideoInfo> moCurrentTrailerList = new List<VideoInfo>(); private String []msFilterArray; private String msThumbLocation; private int miSelectedIndex = 0; @@ -212,6 +217,7 @@ if (_CurrentState == State.home) { DisplaySites(); + SwitchView(); //currentView = View.List; //ChangeFacadeView(); @@ -228,7 +234,7 @@ else{ DisplayVideoDetails(moSelectedVideo); } - UpdateViewSate(); + UpdateViewState(); //base.OnPageLoad(); } protected override void OnShowContextMenu() @@ -299,7 +305,7 @@ } public override void OnAction(Action action) { - if (action.wID == Action.ActionType.ACTION_PREVIOUS_MENU) + if (action.wID == Action.ActionType.ACTION_PREVIOUS_MENU && _CurrentState!= State.home ) { OnShowPreviousMenu2(); return; @@ -366,10 +372,10 @@ { miSelectedIndex = facadeView.SelectedListItemIndex; //play the video - Play(moCurrentVideoList[facadeView.SelectedListItemIndex -1]); + Play(moCurrentTrailerList[facadeView.SelectedListItemIndex -1]); } } - UpdateViewSate(); + UpdateViewState(); } else if (control == btnViewAs) { @@ -378,7 +384,19 @@ //do //{ //shouldContinue = false; - } + } + else if (control == btnNext) + { + moCurrentVideoList = SiteUtilFactory.getSiteUtil(msSelectedSiteId).getNextPageVideos(); + DisplayVideos(false); + UpdateViewState(); + } + else if (control == btnPrevious) + { + moCurrentVideoList = SiteUtilFactory.getSiteUtil(msSelectedSiteId).getPreviousPageVideos(); + DisplayVideos(false); + UpdateViewState(); + } base.OnClicked(controlId, control, actionType); } @@ -393,7 +411,7 @@ } else if (_CurrentState == State.videos) { - Log.Info("Set the stopDownload to true 2"); + Log.Info("Set the stopDownload to true 3"); ImageDownloader._stopDownload = true; DisplayCategories(); @@ -406,13 +424,15 @@ //Log.Info("Set the stopDownload to true 2"); ImageDownloader._stopDownload = true; - DisplayVideos(true); + DisplayVideos(false); SwitchView(); btnViewAs.Visible = true; _CurrentState = State.videos; } + DisplayVideoInfo(null); + UpdateViewState(); } public override bool OnMessage(GUIMessage message) { @@ -493,18 +513,50 @@ cat.url = "favorites"; loSite.RssList.Add("dynamic",cat); moSiteList.Add("100",loSite); + + if (!String.IsNullOrEmpty(settings.msDownloadDir)) + { + try{ + if (System.IO.Directory.Exists(settings.msDownloadDir)==false) + { + + System.IO.Directory.CreateDirectory(msDownloadDir); + + } + } + catch (Exception e) + { + Log.Error("Failed to create download dir"); + Log.Error(e); + } + //add a downloaded videos site + loSite = new SiteSettings(); + loSite.id = "99"; + loSite.name = "Downloaded Videos"; + loSite.enabled = true; + cat = new RssLink(); + cat.name = "All"; + cat.url = settings.msDownloadDir; + loSite.RssList.Add(cat.name, cat); + moSiteList.Add("99", loSite); + } + try + { + Log.Info("checking existance of thumb dir:" + settings.msThumbLocation); + if (System.IO.Directory.Exists(settings.msThumbLocation)==false) + { + Log.Info("Thumb dir does not exist."); + System.IO.Directory.CreateDirectory(settings.msThumbLocation); + Log.Info("thumb dir created"); + } + } + catch (Exception e) + { + Log.Error("Failed to create thumb dir"); + Log.Error(e); + } + - //add a downloaded videos site - loSite = new SiteSettings(); - loSite.id = "99"; - loSite.name = "Downloaded Videos"; - loSite.enabled = true; - cat = new RssLink(); - cat.name = "All"; - cat.url = settings.msDownloadDir; - loSite.RssList.Add(cat.name,cat); - moSiteList.Add("99",loSite); - } private void DisplaySites() { @@ -655,7 +707,7 @@ } //GUIPropertyManager.SetProperty("#itemcount", facadeView.Count-1 +""); - ImageDownloader.getImages(loImageUrlList,msThumbLocation,facadeView); + ImageDownloader.getImages(loImageUrlList,OnlineVideoSettings.getInstance().msThumbLocation,facadeView); // Log.Info("Getting images"); // BackgroundWorker worker = new BackgroundWorker(); // @@ -698,7 +750,7 @@ moSelectedVideo = foVideo; SiteUtilBase loSiteUtil = SiteUtilFactory.getSiteUtil(msSelectedSiteId); List<VideoInfo> loVideoList= loSiteUtil.getOtherVideoList(foVideo); - moCurrentVideoList.Clear(); + moCurrentTrailerList.Clear(); GUIControl.ClearControl(GetID, facadeView.GetID); GUIListItem loListItem = new GUIListItem(".."); loListItem.IsFolder = true; @@ -711,7 +763,7 @@ { liIdx++; loVideoInfo.Description = cleanString(loVideoInfo.Description); - + moSelectedVideo.Description = loVideoInfo.Description; loListItem = new GUIListItem(loVideoInfo.Title); loListItem.Label2 = loVideoInfo.Title2; loListItem.Path = loVideoInfo.VideoUrl; @@ -722,11 +774,11 @@ facadeView.Add(loListItem); //loListItem.RetrieveArt = true; //loImageUrlList.Add(loVideoInfo.ImageUrl); - moCurrentVideoList.Add(loVideoInfo); + moCurrentTrailerList.Add(loVideoInfo); } facadeView.View = GUIFacadeControl.ViewMode.List; btnViewAs.Visible = false; - DisplayVideoInfo(loVideoList[0]); + //DisplayVideoInfo(loVideoList[0]); //strLine = GUILocalizeStrings.Get(101); } @@ -858,28 +910,81 @@ } return fsStr; } - private void UpdateViewSate(){ + private void UpdateViewState(){ switch(_CurrentState){ case State.home: GUIPropertyManager.SetProperty("#header.label","OnlineVideos"); GUIPropertyManager.SetProperty("#header.image",""); - DisplayVideoInfo(null); + GUIControl.HideControl(GetID,btnNext.GetID); + GUIControl.HideControl(GetID,btnPrevious.GetID); + GUIControl.HideControl(GetID, 23); + GUIControl.HideControl(GetID, 24); + GUIControl.HideControl(GetID, 25); + GUIControl.HideControl(GetID, 58); + GUIControl.HideControl(GetID, 59); + DisplayVideoInfo(null); break; case State.categories: GUIPropertyManager.SetProperty("#header.label","Categories"); GUIPropertyManager.SetProperty("#header.image","OnlineVidlogo"+msSelectedSiteId+".jpeg"); + GUIControl.HideControl(GetID,btnNext.GetID); + GUIControl.HideControl(GetID,btnPrevious.GetID); + GUIControl.HideControl(GetID, 23); + GUIControl.HideControl(GetID, 24); + GUIControl.HideControl(GetID, 25); + GUIControl.HideControl(GetID, 58); + GUIControl.HideControl(GetID, 59); DisplayVideoInfo(null); break; case State.videos: GUIPropertyManager.SetProperty("#header.label",msSelectedCategoryName); GUIPropertyManager.SetProperty("#header.image","OnlineVidlogo"+msSelectedSiteId+".jpeg"); - DisplayVideoInfo(null); + GUIControl.ShowControl(GetID,btnNext.GetID); + GUIControl.HideControl(GetID, 23); + GUIControl.HideControl(GetID, 24); + GUIControl.HideControl(GetID, 25); + GUIControl.HideControl(GetID, 58); + GUIControl.HideControl(GetID, 59); + + SiteUtilBase loSiteUtil = SiteUtilFactory.getSiteUtil(msSelectedSiteId); + if (loSiteUtil.hasNextPage()) + { + GUIControl.EnableControl(GetID,btnNext.GetID); + } + else + { + GUIControl.DisableControl(GetID,btnNext.GetID); + } + GUIControl.ShowControl(GetID,btnPrevious.GetID); + if (loSiteUtil.hasPreviousPage()) + { + GUIControl.EnableControl(GetID, btnPrevious.GetID); + } + else + { + GUIControl.DisableControl(GetID,btnPrevious.GetID); + } + DisplayVideoInfo(null); break; case State.info: GUIPropertyManager.SetProperty("#header.label",moSelectedVideo.Title); GUIPropertyManager.SetProperty("#header.image","OnlineVidlogo"+msSelectedSiteId+".jpeg"); - //DisplayVideoInfo(); + GUIControl.HideControl(GetID,btnNext.GetID); + GUIControl.HideControl(GetID,btnPrevious.GetID); + + GUIControl.ShowControl(GetID, 23); + GUIPropertyManager.SetProperty("#movieposter", ImageDownloader.downloadPoster(moSelectedVideo.ImageUrl.Replace("_m", "_l"),moSelectedVideo.Title,OnlineVideoSettings.getInstance().msThumbLocation)); + GUIPropertyManager.SetProperty("#movietitle", moSelectedVideo.Title); + GUIPropertyManager.SetProperty("#trailerdesc", moSelectedVideo.Description); + //Log.Info("trailer desc:{0}", moSelectedVideo.Description); + GUIControl.ShowControl(GetID, 24); + GUIControl.ShowControl(GetID, 25); + GUIControl.ShowControl(GetID, 58); + GUIControl.ShowControl(GetID, 59); + + + DisplayVideoInfo(null); break; } } @@ -946,8 +1051,11 @@ } protected void SwitchView() { - if (facadeView == null) - return; + if (facadeView == null) + { + //Log.Info("SwitchView - facadeview is null"); + return; + } string strLine = String.Empty; switch (currentView) Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/ImageDowloader.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/ImageDowloader.cs 2007-09-03 19:59:11 UTC (rev 890) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/ImageDowloader.cs 2007-09-04 07:32:31 UTC (rev 891) @@ -127,6 +127,20 @@ } */ #endregion + public static string downloadPoster(String fsUrl, String fsMovieName,string fsLocation) + { + + String lsPosterLocation = fsLocation + fsMovieName + "_p.jpg"; + if (System.IO.File.Exists(lsPosterLocation) == false) + { + WebClient client = new WebClient(); + Log.Info("downloading Poster image :" + fsUrl); + client.DownloadFile(fsUrl, lsPosterLocation); + } + return lsPosterLocation; + } + + public static void getImages(List<String> imageUrlList,String ThumbLocation,GUIFacadeControl facadeView){ Log.Info("Getting images"); BackgroundWorker worker = new BackgroundWorker(); Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesTrailerUtil.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesTrailerUtil.cs 2007-09-03 19:59:11 UTC (rev 890) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesTrailerUtil.cs 2007-09-04 07:32:31 UTC (rev 891) @@ -85,12 +85,14 @@ List<OnlineVideos.GUIOnlineVideos.VideoInfo> videoList = new List<OnlineVideos.GUIOnlineVideos.VideoInfo>(); TrailerInfo trailer = (TrailerInfo)video.Other; trailer = AppleTrailers.GetTrailerUrls(trailer); - Console.WriteLine("Found {0} trailer urls",trailer.trailers.Count); + //Log.Info("getOtherVideoList overview:" + trailer.Overview); + //Console.WriteLine("Found {0} trailer urls",trailer.trailers.Count); GUIOnlineVideos.VideoInfo newVideo; foreach (String name in trailer.trailers.Keys){ newVideo = loadVideoInfo(trailer); newVideo.Title = name; - newVideo.VideoUrl = trailer.trailers[name]; + newVideo.VideoUrl = trailer.trailers[name]; + Log.Info("added video url={0}", newVideo.VideoUrl); videoList.Add(newVideo); } return videoList; @@ -98,9 +100,12 @@ public override String getUrl(GUIOnlineVideos.VideoInfo video,GUIOnlineVideos.SiteSettings foSite) { TrailerInfo trailer = (TrailerInfo)video.Other; - trailer = AppleTrailers.ProcessTrailer(trailer,OnlineVideoSettings.getInstance().AppleTrailerSize); - Log.Info("Trailer quality set to {0}",OnlineVideoSettings.getInstance().AppleTrailerSize); - Console.WriteLine("Found {0} trailer urls",trailer.TrailerStreamCollection.Count); + Log.Info("requesting to get url for " + video.VideoUrl); + trailer.Url = new Uri("http://movies.apple.com" + video.VideoUrl); + Log.Info("Trailer quality set to {0}", OnlineVideoSettings.getInstance().AppleTrailerSize); + trailer = AppleTrailers.ProcessTrailer(trailer,OnlineVideoSettings.getInstance().AppleTrailerSize); + + //Console.WriteLine("Found {0} trailer urls",trailer.TrailerStreamCollection.Count); return trailer.TrailerStreamCollection[0].Uri.ToString(); } public List<GUIOnlineVideos.VideoInfo> getAllTrailers(){ @@ -176,5 +181,44 @@ return newVideo; } + public override bool hasNextPage() + { + if (AppleTrailers.currentPage == null || AppleTrailers.currentPage.NextPageUri == null) + { + //Log.Info("current page is null or next page uri is null"); + return false; + } + //Log.Info("{0}",AppleTrailers.currentPage.NextPageUri); + Log.Info(AppleTrailers.currentPage.NextPageUri.ToString()); + return String.IsNullOrEmpty(AppleTrailers.currentPage.NextPageUri.ToString()) == false; + } + public override List<GUIOnlineVideos.VideoInfo> getNextPageVideos() + { + List<GUIOnlineVideos.VideoInfo> trailerList = new List<GUIOnlineVideos.VideoInfo>(); + if (hasNextPage()) + { + trailerList = getVideoList(AppleTrailers.currentPage.NextPageUri.ToString()); + } + return trailerList; + } + public override List<GUIOnlineVideos.VideoInfo> getPreviousPageVideos() + { + List<GUIOnlineVideos.VideoInfo> trailerList = new List<GUIOnlineVideos.VideoInfo>(); + if (hasPreviousPage()) + { + trailerList = getVideoList(AppleTrailers.currentPage.BackPageUri.ToString()); + } + return trailerList; + + } + public override bool hasPreviousPage() + { + if (AppleTrailers.currentPage == null || AppleTrailers.currentPage.BackPageUri == null) + { + return false; + } + return String.IsNullOrEmpty(AppleTrailers.currentPage.BackPageUri.ToString()) == false; + } + } } Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/AppleTrailers.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/AppleTrailers.cs 2007-09-03 19:59:11 UTC (rev 890) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/AppleTrailers.cs 2007-09-04 07:32:31 UTC (rev 891) @@ -18,7 +18,9 @@ public class AppleTrailers { public static List<ITMSClient.TrailerInfo> trailers = new List<ITMSClient.TrailerInfo>(); + public static ITMSClient.TrailerIndex currentPage; + /* public static string casturl; public static string TempXML = string.Empty; @@ -54,18 +56,20 @@ public static bool tview = false; public static bool cview = false; public static bool mview = false; - + */ public static bool _workerCompleted = false; - public static string PosterUrl = string.Empty; + //public static string PosterUrl = string.Empty; // mediaportal.xml - public static string server = string.Empty; + //public static string server = string.Empty; public void HandleHttpError(object sender, ITMSClient.HTTPErrorEventArgs e){ } public static void GetAppleTrailersRSS(object sender, DoWorkEventArgs e) { + currentPage = null; + _workerCompleted = false; //.+=new ITMSClient.HTTPErrorEventHandler(HandleHttpError); //loListItem.OnItemSelected+= new MediaPortal.GUI.Library.GUIListItem.ItemSelectedHandler(OnVideoItemSelected); @@ -77,12 +81,12 @@ if (xmlContent.IsValid) { - //Log.Info("xml is valid"); - ITMSClient.TrailerIndex indexPage = new ITMSClient.TrailerIndex("test", xmlContent); - RSSTitle = "Apple HD Trailers"; + Log.Info("xml is valid"); + currentPage = new ITMSClient.TrailerIndex("test", xmlContent); + //RSSTitle = "Apple HD Trailers"; //trailers.Add(indexPage.TrailerInfoCollection.); //Log.Info("FOund {0} trailers.", indexPage.TrailerInfoCollection.Count); - foreach (ITMSClient.TrailerInfo trailerInfo in indexPage.TrailerInfoCollection) + foreach (ITMSClient.TrailerInfo trailerInfo in currentPage.TrailerInfoCollection) { /* ITMSClient.TrailerInfo trailer = ProcessTrailer(trailerInfo); @@ -96,15 +100,15 @@ } - pageUri = indexPage.NextPageUri; + //pageUri = indexPage.NextPageUri; } - else - { - pageUri = null; - } + //else + //{ + // pageUri = null; + //} _workerCompleted = true; - foundt = true; - tview = true; + //foundt = true; + //tview = true; } @@ -120,7 +124,7 @@ { ITMSClient.TrailerInfo trailerInfo = (ITMSClient.TrailerInfo)obj; - //Log.Info("Processing Trailer {0}",trailerInfo.Title); + Log.Info("Processing Trailer {0}",trailerInfo.Title); // Lookup the trailer in the media library string key = trailerInfo.Title.GetHashCode().ToString(); // Populate the rest of the meta data Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/HDHelper.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/HDHelper.cs 2007-09-03 19:59:11 UTC (rev 890) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/HDHelper.cs 2007-09-04 07:32:31 UTC (rev 891) @@ -32,6 +32,7 @@ /// </summary> public sealed class HDHelper { + /* private const string URI = "http://www.apple.com/trailers/"; static public Hashtable GetAvailableMovies() @@ -51,13 +52,13 @@ ITMSContent content = ITMSHelper.GetITMSPage(trailerPage); switch (size) { - case TrailerSize.HD480p: + case TrailerSize.h480p: regex = new Regex("HREF=\"(?<url>.+?_480p.mov)\""); break; - case TrailerSize.HD720p: + case TrailerSize.h720p: regex = new Regex("HREF=\"(?<url>.+?_720p.mov)\""); break; - case TrailerSize.HD1080p: + case TrailerSize.h1080p: regex = new Regex("HREF=\"(?<url>.+?_1080p.mov)\""); break; } @@ -65,6 +66,7 @@ string url = regex.Match(content.Xml).Groups["url"].Value; return new Uri(content.WebResponse.ResponseUri, url); } + */ } Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/ItmsHelper.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/ItmsHelper.cs 2007-09-03 19:59:11 UTC (rev 890) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/ItmsHelper.cs 2007-09-04 07:32:31 UTC (rev 891) @@ -37,7 +37,7 @@ #region Constants // The iTunes server won't talk to us unless we pretend to be a bona-fide iTunes client private const string USER_AGENT = "User-Agent: iTunes/6.0 (Windows)"; - private static Hashtable HighDef = HDHelper.GetAvailableMovies(); + //private static Hashtable HighDef = HDHelper.GetAvailableMovies(); #endregion @@ -52,8 +52,9 @@ //String desc; if (field.Success) { - //Log.Info("got the movie details for {0}",trailerInfo.Title); + //Log.Info("got the movie overview {0}",trailerInfo.Title); trailerInfo.Overview = field.Groups["overview"].Value.Replace("\r\n", " ").Replace('\u0092', '\'').Replace('\u0093', '"').Replace('\u0094', '"'); + //Log.Info("got the movie overview {0}", trailerInfo.Overview); } String name; String url; @@ -82,6 +83,7 @@ /// <returns></returns> static public TrailerInfo PopulateTrailerDetails(TrailerInfo trailerInfo, ITMSClient.TrailerSize desiredSize) { + Log.Info("pop details for " + trailerInfo.Url); //Log.Info("Populating Trailer details for {0}", trailerInfo.Title); string[] MONTHS = new string[]{"January","February","March","April","May","June","July","August","September","October","November","December"}; //const string DIRECTOR = "(dir.)"; @@ -90,6 +92,7 @@ StringBuilder actors = new StringBuilder("|"); ITMSContent infoPage = GetITMSPage(trailerInfo.Url); + Log.Info("got itms page for " + trailerInfo.Url); //Log.Info(infoPage.Xml); if (infoPage.IsValid) { @@ -151,9 +154,9 @@ trailerInfo.Actors = actors.ToString(); */ trailerInfo.TrailerStreamCollection = new TrailerStreamCollection(); - + /* // WARNING: HACK CODE FOR HIGHDEF TRAILERS - if (desiredSize >= TrailerSize.HD480p) + if (desiredSize >= TrailerSize.h480p) { if (HighDef.Contains(trailerInfo.Title)) { @@ -168,16 +171,18 @@ } } // END HACK CODE - + */ // Get movie trailer streams if (desiredSize != TrailerSize.None && trailerInfo.TrailerStreamCollection.Count == 0) { foreach (Capture url in fields.Groups["urls"].Captures) { //Log.Info("Found stream url:{0}", url); - TrailerStreamCollection tsc = GetTrailerStreamCollection(new Uri(infoPage.WebResponse.ResponseUri, url.Value)); + //TrailerStreamCollection tsc = GetTrailerStreamCollection(new Uri(infoPage.WebResponse.ResponseUri, url.Value)); + TrailerStreamCollection tsc = GetTrailerStreamCollection(infoPage); TrailerStream myStream = GetDesiredTrailerStream(tsc, desiredSize); + Log.Info("Addinf stream to collection:" + myStream.Uri); trailerInfo.TrailerStreamCollection.Add(myStream); //trailerInfo.TrailerStreamCollection = tsc; } @@ -229,6 +234,7 @@ static public ITMSContent GetITMSPage(Uri uri, DateTime ifModifiedSince) { + //Log.Info("GetItmsPage witrh uri:" + uri); const int TIMEOUT = 30000; // 30 seconds StreamReader sReader = null; HttpWebRequest request = null; @@ -236,7 +242,7 @@ ITMSContent content = null; //Log.Debug("GetITMSPage: " + uri.AbsoluteUri); - //Log.Info("GetITMSPage: " + uri.AbsoluteUri); + Log.Info("GetITMSPage: " + uri.AbsoluteUri); try { request = (HttpWebRequest) HttpWebRequest.Create(uri); @@ -297,6 +303,11 @@ /// <returns></returns> private static TrailerStream GetDesiredTrailerStream(TrailerStreamCollection trailerStreams, TrailerSize desiredSize) { + Log.Info("GetDesiredTrailerStream - desiredSize=" + desiredSize); + foreach (TrailerStream stream1 in trailerStreams) + { + Log.Info("GetDesiredTrailerStream - size available:" + stream1.Size); + } //Log.Info("getting desired Trailer size of {0}", desiredSize); // Find the largest desired size supported by the available streams while (trailerStreams.ContainsKey(desiredSize) == false && desiredSize > 0) @@ -329,11 +340,13 @@ /// </summary> /// <param name="trailerInfo">Trailer info.</param> /// <returns></returns> - private static TrailerStreamCollection GetTrailerStreamCollection(Uri url) + //private static TrailerStreamCollection GetTrailerStreamCollection(Uri url) + private static TrailerStreamCollection GetTrailerStreamCollection(ITMSContent trailerPage) { + //Log.Info("GetTrailerStreamCollection url:" + url); TrailerStreamCollection streamCollection = new TrailerStreamCollection(3); - ITMSContent trailerPage = GetITMSPage(url); + //ITMSContent trailerPage = GetITMSPage(url); if (trailerPage.IsValid) { string type = String.Empty; Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/RegexParsers.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/RegexParsers.cs 2007-09-03 19:59:11 UTC (rev 890) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/RegexParsers.cs 2007-09-04 07:32:31 UTC (rev 891) @@ -3,107 +3,131 @@ namespace ITMSClient { - /// <summary> - /// Regular expression parsers for iTunes movie XML pages - /// </summary> - internal sealed class RegexParsers - { - /// <summary> - /// Used to find the link to the next index page from the current index page - /// Returns the url and page number - /// </summary> - internal static Regex indexNextPageRegex = new Regex( - @"\<GotoURL url=""(?<url>index_(?<pagenum>\d{1,3})\.xml)""\>\s*\<TextView[^/]*?\<B\>More", - RegexOptions.Singleline - | RegexOptions.ExplicitCapture - | RegexOptions.Compiled - ); + /// <summary> + /// Regular expression parsers for iTunes movie XML pages + /// </summary> + internal sealed class RegexParsers + { + /// <summary> + /// Used to find the link to the next index page from the current index page + /// Returns the url and page number + /// </summary> + internal static Regex indexNextPageRegex = new Regex( + @"\<GotoURL url=""(?<url>\w*_(?<pagenum>\d{1,3})\.xml)""\>\s*\<TextView[^/]*?\<B\>More", + RegexOptions.Singleline + | RegexOptions.ExplicitCapture + | RegexOptions.Compiled + ); + internal static Regex indexBackPageRegex = new Regex( + @"\<GotoURL url=""(?<url>\w*_(?<pagenum>\d{1,3})\.xml)""\>\s*\<TextView[^/]*?\<B\>Back", + RegexOptions.Singleline + | RegexOptions.ExplicitCapture + | RegexOptions.Compiled + ); - /// <summary> - /// Used to pull the title, studio and url link for each movie trailer on the index page - /// </summary> - internal static Regex indexDetailsRegex = new Regex( - //"<GotoURL[^>]+url=\"(?<url>/moviesxml/[^\"]+?/index.xml)\">\\s*<B>(?<title>[^<]+)</B>.+?" - //+ "<GotoURL[^>]+>\\s*(?<studio>.+?)\\s*</GotoURL>", + /// <summary> + /// Used to pull the title, studio and url link for each movie trailer on the index page + /// </summary> + internal static Regex indexDetailsRegex = new Regex( + //"<GotoURL[^>]+url=\"(?<url>/moviesxml/[^\"]+?/index.xml)\">\\s*<B>(?<title>[^<]+)</B>.+?" + //+ "<GotoURL[^>]+>\\s*(?<studio>.+?)\\s*</GotoURL>", //"<GotoURL[^>]+url=\"(?<url>/moviesxml/[^\"]+?/index.xml)\">\\s*<[^>]+><B>(?<title>[^<]+)</B>[^>]+>(?>\\s+[^>]+>)+\\s+<GotoURL[^>]+>\\s*<[^>]+>(?<studio>.+?)\\s*</SetFontStyle>", //"<GotoURL[^>]+url=\"(?<url>/moviesxml/[^\"]+?/index.xml)\">\\s*<[^>]+><B>(?<title>[^<]+)</B>[^>]+>.+?<GotoURL[^>]+>\\s*<[^>]+>(?<studio>.+?)\\s*</GotoURL>", @"<PictureView[^.]+ url=""(?<poster>[^""]*.jpg)"".+?<GotoURL[^>]+url=""(?<url>/moviesxml/[^""]+?/index.xml)"">\s*<[^>]+><B>(?<title>[^<]+)</B>[^>]+>.+?<GotoURL[^>]+>\s*<[^>]+>(?<studio>.+?)\s*</GotoURL>", - RegexOptions.Singleline - | RegexOptions.ExplicitCapture - | RegexOptions.Compiled - ); + RegexOptions.Singleline + | RegexOptions.ExplicitCapture + | RegexOptions.Compiled + ); - /// <summary> - /// Used to capture all the movie details from the movie details index.xml page - /// </summary> - internal static Regex moviedetailsRegex1 = new Regex( - @"<PictureView.+?url=""(?<poster>[^""]+)"".+?" + internal static Regex indexDetailsRegex2 = new Regex( + "<GotoURL url=\"(?<url>[^\"]*)\".+?\\s*<PictureView.+?url=\"(" + + "?<poster>[^\"]+)\".+?[^>]+>.+?[^>]+>.+?[^>]+>.+?[^>]+>.+?[^>" + + "]+>.+?\\s*<b>(?<title>[^<]+)</b>.+?[^>]+>.+?[^>]+>.+?[^>]+>." + + "+?[^>]+>.+?\\s*(?<studio>.+?)\\s*</", + RegexOptions.Singleline + | RegexOptions.ExplicitCapture + | RegexOptions.Compiled + ); + internal static Regex indexBoxOfficeRegex = new Regex( + "<GotoURL target=\"[^\"]*\" url=\"(?<url>[^\"]*)\".+?\\s*[^>]" + + "+>.+?[^>]+>.+?[^>]+>.+?[^>]+>.+?[^>]+>.+?[^>]+>.+?[^>]+>\\s*" + + "<b>(?<title>[^<]+)</b>(?<poster>)(?<studio>)", +RegexOptions.Singleline + | RegexOptions.ExplicitCapture + | RegexOptions.Compiled + ); + + /// <summary> + /// Used to capture all the movie details from the movie details index.xml page + /// </summary> + internal static Regex moviedetailsRegex1 = new Regex( + @"<PictureView.+?url=""(?<poster>[^""]+)"".+?" + @"<TextView[^>]*>\s*[^>]+>\s*<b>(?<title>[^<]+?)</b>.+?" + @"<TextView[^>]*>\s*[^>]+>\s*(?<copyright>[^<]+?)\s*<.+?" + @"<TextView[^>]*>\s*[^>]+>\s*(?<overview>[^<]*?)\s*<", - RegexOptions.Singleline - | RegexOptions.ExplicitCapture - | RegexOptions.Compiled - ); + RegexOptions.Singleline + | RegexOptions.ExplicitCapture + | RegexOptions.Compiled + ); - internal static Regex moviedetailsRegex2 = new Regex( - //@"Release:\s*(?<release>[^<]+?)\s*<.+?" - //+ @"<TextView[^>]*>(\s*<GotoURL[^>]*>(?<genres>[^<]+)</GotoURL>,?){0,}\s*</TextView>.+?" - //+ @"Rating:\s*(?<rating>.+?)\s*<.+?" - //+ @"(<TextView[^>]*>\s*(?<cast>[^<]*?)\s*</TextView>.+?){0,}</VBoxView>.+?" - // @"(<GotoURL[^>]+url=""(?<urls>/moviesxml/[^>]+?/index.xml)"">\s*<TextView.+?){0,}</Document>", + internal static Regex moviedetailsRegex2 = new Regex( + //@"Release:\s*(?<release>[^<]+?)\s*<.+?" + //+ @"<TextView[^>]*>(\s*<GotoURL[^>]*>(?<genres>[^<]+)</GotoURL>,?){0,}\s*</TextView>.+?" + //+ @"Rating:\s*(?<rating>.+?)\s*<.+?" + //+ @"(<TextView[^>]*>\s*(?<cast>[^<]*?)\s*</TextView>.+?){0,}</VBoxView>.+?" + // @"(<GotoURL[^>]+url=""(?<urls>/moviesxml/[^>]+?/index.xml)"">\s*<TextView.+?){0,}</Document>", "<GotoURL[^>]+url=\"(?<urls>/moviesxml/[^\"]+)[^>]*>\\s*<TextView", - RegexOptions.Singleline - | RegexOptions.ExplicitCapture - | RegexOptions.Compiled - ); + RegexOptions.Singleline + | RegexOptions.ExplicitCapture + | RegexOptions.Compiled + ); - internal static Regex dateRegex = new Regex( - @"(?<month>\w+) (?<day>\d+).+?(?<year>(19|20)\d\d)", - RegexOptions.ExplicitCapture - | RegexOptions.Compiled - ); + internal static Regex dateRegex = new Regex( + @"(?<month>\w+) (?<day>\d+).+?(?<year>(19|20)\d\d)", + RegexOptions.ExplicitCapture + | RegexOptions.Compiled + ); - /// <summary> - /// Used to find the different sizes of Quicktime trailer movies available from - /// the trailer size selection page - /// Returns the url and the size of the movie - /// </summary> - internal static Regex streamRegex = new Regex( - //@"<GotoURL.+?url=""(?<url>.*?(?<size>(small|medium|large|fullscreen))\.xml)""", + /// <summary> + /// Used to find the different sizes of Quicktime trailer movies available from + /// the trailer size selection page + /// Returns the url and the size of the movie + /// </summary> + internal static Regex streamRegex = new Regex( + //@"<GotoURL.+?url=""(?<url>.*?(?<size>(small|medium|large|fullscreen))\.xml)""", @"<key>episodeURL</key><string>(?<url>[^<]*(?<size>h[\d]*p*)[w]*\.mov)", - RegexOptions.ExplicitCapture - | RegexOptions.Compiled - ); - - //Used to find the multiple trailer urls - internal static Regex trailerLinkRegex = new Regex( - "<HBoxView[^>]*>\\s*<GotoURL\\starget=\"main\"\\surl=\"(?<url>[^\"]*)[^=]*=[^=]*=\"(?<name>[^\"]*)", - RegexOptions.Singleline - | RegexOptions.ExplicitCapture - | RegexOptions.Compiled - ); - + RegexOptions.ExplicitCapture + | RegexOptions.Compiled + ); - /// <summary> - /// Used to pull the type and length of the Quicktime trailer movies available from - /// the trailer size selection page - /// </summary> - internal static Regex streamDetailsRegex = new Regex( - @"<b>(?<type>.+?)\s\((?<minutes>\d{0,2}):(?<seconds>\d{2})\)?</b>", - RegexOptions.ExplicitCapture - | RegexOptions.Compiled - ); + //Used to find the multiple trailer urls + internal static Regex trailerLinkRegex = new Regex( + "<HBoxView[^>]*>\\s*<GotoURL\\starget=\"main\"\\surl=\"(?<url>[^\"]*)[^=]*=[^=]*=\"(?<name>[^\"]*)", + RegexOptions.Singleline + | RegexOptions.ExplicitCapture + | RegexOptions.Compiled + ); - /// <summary> - /// Used to find the actual Quicktime movie on the final movie playback page - /// Returns the url of the .mov file - /// </summary> - internal static Regex movRegex = new Regex( - @"\<MovieView.+?url=""(?<url>.+?\.mov)""", - RegexOptions.ExplicitCapture - | RegexOptions.Compiled - ); - } + /// <summary> + /// Used to pull the type and length of the Quicktime trailer movies available from + /// the trailer size selection page + /// </summary> + internal static Regex streamDetailsRegex = new Regex( + @"<b>(?<type>.+?)\s\((?<minutes>\d{0,2}):(?<seconds>\d{2})\)?</b>", + RegexOptions.ExplicitCapture + | RegexOptions.Compiled + ); + + /// <summary> + /// Used to find the actual Quicktime movie on the final movie playback page + /// Returns the url of the .mov file + /// </summary> + internal static Regex movRegex = new Regex( + @"\<MovieView.+?url=""(?<url>.+?\.mov)""", + RegexOptions.ExplicitCapture + | RegexOptions.Compiled + ); + + } } Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/TrailerIndex.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/TrailerIndex.cs 2007-09-03 19:59:11 UTC (rev 890) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/TrailerIndex.cs 2007-09-04 07:32:31 UTC (rev 891) @@ -33,6 +33,7 @@ protected ITMSContent _content = null; protected TrailerInfoCollection _trailers = null; protected Uri _nextPageUri = null; + protected Uri _backPageUri = null; protected string _sectionName; #region Constructor @@ -78,17 +79,45 @@ { get { + if (_nextPageUri == null) { + Match nextPage = RegexParsers.indexNextPageRegex.Match(Content.Xml); - if (nextPage.Success) - this._nextPageUri = new Uri(Content.WebResponse.ResponseUri, nextPage.Groups["url"].Value); - else - this._nextPageUri = null; + + if (nextPage.Success) + { + this._nextPageUri = new Uri(Content.WebResponse.ResponseUri, nextPage.Groups["url"].Value); + Log.Info("Found next page"); + } + else + this._nextPageUri = null; } return _nextPageUri; } } + public Uri BackPageUri + { + get + { + Log.Info("backPage uri requested"); + if (_backPageUri == null) + { + Log.Info("backPage currently null"); + Match backPage = RegexParsers.indexBackPageRegex.Match(Content.Xml); + Log.Info("backPage regex performed"); + if (backPage.Success) + { + Log.Info("backPage regex successful"); + this._backPageUri = new Uri(Content.WebResponse.ResponseUri, backPage.Groups["url"].Value); + Log.Info("TrailerIndex.BackPageUri - Found previous page"); + } + else + this._backPageUri = null; + } + return _backPageUri; + } + } /// <summary> /// Gets the count of trailers on the page @@ -112,21 +141,48 @@ protected void ParseIndexPage() { Log.Info("Parsing index page"); - MatchCollection movieItemCollection = RegexParsers.indexDetailsRegex.Matches(Content.Xml); - _trailers = new TrailerInfoCollection(movieItemCollection.Count); - Debug.Assert(movieItemCollection.Count > 0, "No movies found in index page xml"); + MatchCollection movieItemCollection = RegexParsers.indexDetailsRegex.Matches(Content.Xml); + if (movieItemCollection.Count == 0) + { + movieItemCollection = RegexParsers.indexDetailsRegex2.Matches(Content.Xml); + + if (movieItemCollection.Count == 0) + { + movieItemCollection = RegexParsers.indexBoxOfficeRegex.Matches(Content.Xml); + if (movieItemCollection.Count == 0) + { + Log.Info("No movies found in index page xml"); + return; + } + } + + } + _trailers = new TrailerInfoCollection(movieItemCollection.Count); + Log.Info("ParseIndexPage - Found {0} trailers.", movieItemCollection.Count); foreach (Match movieItem in movieItemCollection) { + Log.Info("ParseIndexPage - success ={0}", movieItem.Success); Debug.Assert(movieItem.Success); TrailerInfo trailerInfo = new TrailerInfo(); trailerInfo.Url = new Uri(Content.WebResponse.ResponseUri, movieItem.Groups["url"].Value); + Log.Info("ParseIndexPage - url set"); trailerInfo.Title = movieItem.Groups["title"].Value; - trailerInfo.Studio = movieItem.Groups["studio"].Value; - trailerInfo.PosterUrl = new Uri(movieItem.Groups["poster"].Value); + Log.Info("ParseIndexPage - title set"); + if (movieItem.Groups["studio"] != null) + { + trailerInfo.Studio = movieItem.Groups["studio"].Value; + Log.Info("ParseIndexPage - studio set"); + } + if (movieItem.Groups["poster"] != null && !String.IsNullOrEmpty(movieItem.Groups["poster"].Value)) + { + trailerInfo.PosterUrl = new Uri(movieItem.Groups["poster"].Value); + Log.Info("ParseIndexPage - poster set"); + } trailerInfo.Section = this._sectionName; //Console.WriteLine("Adding trailer {0}", trailerInfo.Title); _trailers.Add(trailerInfo); + Log.Info("ParseIndexPage - trailer added to list"); } } #endregion Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/TrailerStream.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/TrailerStream.cs 2007-09-03 19:59:11 UTC (rev 890) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/TrailerStream.cs 2007-09-04 07:32:31 UTC (rev 891) @@ -12,9 +12,9 @@ //Medium, //Large, //Fullscreen, - HD480p, - HD720p, - HD1080p + h480p, + h720p, + h1080p } /// <summary> Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs 2007-09-03 19:59:11 UTC (rev 890) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs 2007-09-04 07:32:31 UTC (rev 891) @@ -85,6 +85,24 @@ { return ""; } + + public virtual bool hasNextPage() + { + return false; + } + public virtual List<GUIOnlineVideos.VideoInfo> getNextPageVideos() + { + return new List<GUIOnlineVideos.VideoInfo>(); + } + public virtual bool hasPreviousPage() + { + return false; + } + public virtual List<GUIOnlineVideos.VideoInfo> getPreviousPageVideos() + { + return new List<GUIOnlineVideos.VideoInfo>(); + } + //public virtual bool addFavorite(String fsId,String fsUserName,String fsPassword){ public virtual void AddFavorite(GUIOnlineVideos.VideoInfo foVideo,String fsSiteId){ //return false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nor...@us...> - 2007-09-03 19:59:19
|
Revision: 890 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=890&view=rev Author: northern_sky Date: 2007-09-03 12:59:11 -0700 (Mon, 03 Sep 2007) Log Message: ----------- fixed import from gui and progressDialog Modified Paths: -------------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Database/DatabaseHandler.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesImportProgress.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.csproj trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/DirectoryImport.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/GamebaseImport.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/ImportBase.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/MameImport.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItem.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemDirectoryCache.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemGameBase.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemMame.cs trunk/plugins/myGUIProgramsAlt/README.txt Added Paths: ----------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/FileReadEventArgs.cs Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Database/DatabaseHandler.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Database/DatabaseHandler.cs 2007-09-03 15:38:01 UTC (rev 889) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Database/DatabaseHandler.cs 2007-09-03 19:59:11 UTC (rev 890) @@ -353,6 +353,7 @@ } public object ExecuteStmtScalar(string stmt) + { object o = null; try Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesImportProgress.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesImportProgress.cs 2007-09-03 15:38:01 UTC (rev 889) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesImportProgress.cs 2007-09-03 19:59:11 UTC (rev 890) @@ -89,7 +89,7 @@ this.progressTextBox.Text = ""; System.Windows.Forms.Application.DoEvents(); // make sure the title caption appears.... - CurApp.OnRefreshInfo += new ApplicationItem.RefreshInfoEventHandler(RefreshInfo); + //----------- CurApp.OnRefreshInfoEvent += new ApplicationItem.RefreshInfoEventHandler(RefreshInfo); //backgroundWorker.ReportProgress(10); try { @@ -99,7 +99,7 @@ } finally { - CurApp.OnRefreshInfo -= new ApplicationItem.RefreshInfoEventHandler(RefreshInfo); + //--------- CurApp.OnRefreshInfoEvent -= new ApplicationItem.RefreshInfoEventHandler(RefreshInfo); this.Text = "Import finished."; progressTextBox.Text = importFinishedText; isImportRunning = false; Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.cs 2007-09-03 15:38:01 UTC (rev 889) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.cs 2007-09-03 19:59:11 UTC (rev 890) @@ -1086,11 +1086,9 @@ { if (currentApplicationItem != null) { + currentApplicationItem.ImportFinishedEvent += new ApplicationItem.ImportFinishedEventHandler(currentApplicationItem_ImportFinishedEvent); currentApplicationItem.Refresh(true); - prevFilepath = currentApplicationItem.DefaultFilepath(); - // todo: reset viewHandler - UpdateButtonStates(); - UpdateListControl(); + } } else if (control == btnViews) @@ -1111,6 +1109,14 @@ } } + void currentApplicationItem_ImportFinishedEvent(object sender, EventArgs e) + { + prevFilepath = currentApplicationItem.DefaultFilepath(); + // todo: reset viewHandler + UpdateButtonStates(); + UpdateListControl(); + } + protected override void OnShowContextMenu() { GUIListItem item = facadeView.SelectedListItem; Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.csproj =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.csproj 2007-09-03 15:38:01 UTC (rev 889) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.csproj 2007-09-03 19:59:11 UTC (rev 890) @@ -144,6 +144,7 @@ <Compile Include="GUIProgramsAltFileInfo.cs" /> <Compile Include="Imports\AllGameScraper.cs" /> <Compile Include="Imports\DirectoryImport.cs" /> + <Compile Include="Imports\FileReadEventArgs.cs" /> <Compile Include="Imports\GamebaseImport.cs" /> <Compile Include="Imports\ImportBase.cs" /> <Compile Include="Imports\MameImport.cs" /> Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/DirectoryImport.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/DirectoryImport.cs 2007-09-03 15:38:01 UTC (rev 889) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/DirectoryImport.cs 2007-09-03 19:59:11 UTC (rev 890) @@ -22,15 +22,9 @@ public DirectoryImport(ApplicationItem objApp) { applicationItem = objApp; - OnReadNewFile += new MyEventHandler(applicationItem.ReadNewFile); } - public void DeInit() - { - OnReadNewFile -= new MyEventHandler(applicationItem.ReadNewFile); - } - private void ImportFileItem(FileInfo fileInfo) { FileItem curFile = new FileItem(); @@ -55,48 +49,57 @@ private void DeleteOrphaned() { - string TheFileName; - foreach (FileItem DBfile in applicationItem.ItemList) + + for (int i = 0; i < applicationItem.ItemList.Count; i++) { + FileItem fileItem = null; - TheFileName = DBfile.Filename; + if (applicationItem.ItemList[i] is FileItem) + { + fileItem = (FileItem) applicationItem.ItemList[i]; + if (!File.Exists(fileItem.Filename)) + { + fileItem.Delete(); + } - //if (!DBfile.IsFolder) - //{ - if (!File.Exists(TheFileName)) { DBfile.Delete(); } - //} - //else - //{ - //if (!Directory.Exists(TheFileName)) { DBfile.Delete(); } - - //} - + } } } - private void ImportFile(string dirPath, bool mpGuiMode) + private void ImportFile(string dirPath) { - + double total = 0; FileInfo fileInDir = null; if (Directory.Exists(dirPath)) { DirectoryInfo directoryInfo = new DirectoryInfo(dirPath); FileSystemInfo[] allUnderLyingFiles = directoryInfo.GetFileSystemInfos(); - + total = allUnderLyingFiles.Length; + for (int i = 0; i < allUnderLyingFiles.Length; i++) { + + OnReadNewFileEvent(this, new FileReadEventArgs((int)(100 * (((double) i ) / total)), "Importing from directory " + dirPath)); + if (allUnderLyingFiles[i] is FileInfo) { Boolean FileExists = false; fileInDir = (FileInfo)allUnderLyingFiles[i]; - foreach (FileItem DBfile in applicationItem.ItemList) + for (int j = 0; j < applicationItem.ItemList.Count; j++) { - if (DBfile.Filename == fileInDir.FullName) + FileItem fileItem = null; + + if (applicationItem.ItemList[j] is FileItem) { - FileExists = true; - break;//ugly + fileItem = (FileItem)applicationItem.ItemList[j]; + if(fileItem.Filename == fileInDir.FullName) + { + + FileExists = true; + break;//ugly + } } } if (!FileExists) @@ -108,23 +111,26 @@ else if (allUnderLyingFiles[i] is DirectoryInfo) { DirectoryInfo directory = (DirectoryInfo)allUnderLyingFiles[i]; - ImportFile(directory.FullName, mpGuiMode); + ImportFile(directory.FullName); } } } } - public void StartImport(string[] fileDirPaths, bool mpGuiMode) + public void StartImport() { + string[] fileDirPaths = this.applicationItem.FileDirectory.Split(';'); + using (SQLiteTransaction transaction = dbHandlerInstance.SqlLiteConn.BeginTransaction()) { DeleteOrphaned(); //get all maindirs foreach (string dirPath in fileDirPaths) { - ImportFile(dirPath, mpGuiMode); + ImportFile(dirPath); } transaction.Commit(); + OnReadNewFileEvent(this, new FileReadEventArgs(100, "Import done...................")); } } } Added: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/FileReadEventArgs.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/FileReadEventArgs.cs (rev 0) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/FileReadEventArgs.cs 2007-09-03 19:59:11 UTC (rev 890) @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace GUIProgramsAlt.Imports +{ + public class FileReadEventArgs + { + + public FileReadEventArgs(int ctr, string message) + { + this.ctr = ctr; + this.message = message; + } + public readonly int ctr; + public readonly string message; + } +} Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/GamebaseImport.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/GamebaseImport.cs 2007-09-03 15:38:01 UTC (rev 889) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/GamebaseImport.cs 2007-09-03 19:59:11 UTC (rev 890) @@ -47,15 +47,9 @@ public GamebaseImport(ApplicationItem objApp) { applicationItem = objApp; - OnReadNewFile += new MyEventHandler(applicationItem.ReadNewFile); } - public void DeInit() - { - OnReadNewFile -= new MyEventHandler(applicationItem.ReadNewFile); - } - void DBImportGamebaseItem(OleDbDataReader myReader, string romFilename, string imgFilename, int curPos, int maxGames) { @@ -95,10 +89,7 @@ curFile.LastTimeLaunched = DateTime.MinValue; curFile.LaunchCount = 0; curFile.Write(); - //this.OnReadNewFile(curFile.Title, curPos, maxGames); // send event to whom it may concern.... - //this.OnReadNewFile(curFile.Title, (int)(100 * (((double)curPos) / maxGames))); - SendDisplayText(curFile.Title, (int)(100 * (((double)curPos) / maxGames))); - return; + return; } public void StartImport() @@ -198,9 +189,13 @@ { Log.Info("*missing* gamebase game {0}", curRomname); } + OnReadNewFileEvent(this, new FileReadEventArgs((int)(100 * (((double)i) / maxGames)), "Importing " + curRomname)); + } } transaction.Commit(); + OnReadNewFileEvent(this, new FileReadEventArgs(100, "Import done")); + } } } Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/ImportBase.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/ImportBase.cs 2007-09-03 15:38:01 UTC (rev 889) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/ImportBase.cs 2007-09-03 19:59:11 UTC (rev 890) @@ -4,24 +4,33 @@ using System.IO; using GUIProgramsAlt.Items; +using GUIProgramsAlt; + namespace GUIProgramsAlt.Imports { public abstract class ImportBase { // event: read new file - protected delegate void MyEventHandler(string informationMessage, int progressBarCtr); + public delegate void ReadNewFileEventHandler(object sender, FileReadEventArgs e); + public event ReadNewFileEventHandler ReadNewFileEvent = null; - protected event MyEventHandler OnReadNewFile = null; - protected void SendDisplayText(string displayText, int progressBarCtr) + protected void OnReadNewFileEvent(object sender,FileReadEventArgs e) { - if (OnReadNewFile != null) + if (ReadNewFileEvent != null) { - OnReadNewFile(displayText, progressBarCtr); + ReadNewFileEvent(sender,e); } } + public virtual void startImport() + { + + //override + + } + protected string ImportImageFiles(string fileName, string fileTitle,ApplicationItem applicationItem) { string thumb = ""; @@ -71,6 +80,5 @@ } return thumb; } - } } Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/MameImport.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/MameImport.cs 2007-09-03 15:38:01 UTC (rev 889) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/MameImport.cs 2007-09-03 19:59:11 UTC (rev 890) @@ -74,20 +74,14 @@ public MameImport(ApplicationItem applicationItem) { currentApplication = applicationItem; - OnReadNewFile += new MyEventHandler(currentApplication.ReadNewFile); } - public void DeInit() - { - OnReadNewFile -= new MyEventHandler(currentApplication.ReadNewFile); - } - void ReadListFull() { fullRomListDictionary.Clear(); string line = string.Empty; - SendDisplayText("generating mame list (full)", 10); + OnReadNewFileEvent(this,new FileReadEventArgs(10,"generating mame list (full)")); using (Process process = new Process()) { @@ -120,7 +114,7 @@ string line; if (((ApplicationItemMame)currentApplication).ImportOriginalsOnly) { - SendDisplayText("generating mame list (clones)", 20); + OnReadNewFileEvent(this,new FileReadEventArgs(20,"generating mame list (clones)")); using (Process process = new Process()) { @@ -251,18 +245,18 @@ if (conditionChecker.IsOk) { - SendDisplayText("Generating lists...", 0); + OnReadNewFileEvent(this,new FileReadEventArgs(0,"Generating lists...")); ReadListFull(); - SendDisplayText("Generating lists.....", 0); + OnReadNewFileEvent(this,new FileReadEventArgs(0,"Generating lists.....")); ReadListClones(); if (System.IO.File.Exists(catverIniFile)) { - SendDisplayText("Reading catver.ini.......", 0); + OnReadNewFileEvent(this,new FileReadEventArgs(0,"Reading catver.ini.......")); ReadCatverIni(); } if (System.IO.File.Exists(historyDatFile)) { - SendDisplayText("Reading history.dat............", 0); + OnReadNewFileEvent(this,new FileReadEventArgs(0,"Reading history.dat............")); ReadHistoryDat(); } @@ -286,7 +280,7 @@ { if (!CheckPrerequisites()) { - SendDisplayText(conditionChecker.Problems, 0); + OnReadNewFileEvent(this,new FileReadEventArgs(0,conditionChecker.Problems)); Log.Info("MameImporter: import failed! Details: {0}", conditionChecker.Problems); return; } @@ -304,7 +298,7 @@ transaction.Commit(); } - SendDisplayText("Import done...................", 100); + OnReadNewFileEvent(this,new FileReadEventArgs(100,"Import done...................")); } @@ -354,7 +348,7 @@ if ((curFile.Imagefile == "") && (currentApplication.ImportValidImagesOnly)) { - SendDisplayText("", (int)(100 * (((double)count) / total))); + OnReadNewFileEvent(this,new FileReadEventArgs( (int)(100 * (((double)count) / total)),"")); return; } if (this.fullRomListDictionary.ContainsKey(curRomname)) @@ -409,8 +403,8 @@ curFile.Rating = 5; curFile.Write(); - // OnReadNewFile(curFile.Title, count, localRomNames.Length); - SendDisplayText(curFile.Title, (int)(100 * (((double)count) / total))); + // OnReadNewFileEvent(curFile.Title, count, localRomNames.Length); + OnReadNewFileEvent(this,new FileReadEventArgs((int)(100 * (((double)count) / total)),curFile.Title) ); } } @@ -418,7 +412,7 @@ } else { - SendDisplayText("", (int)(100 * (((double)count) / total))); + OnReadNewFileEvent(this,new FileReadEventArgs((int)(100 * (((double)count) / total)),"") ); } } Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItem.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItem.cs 2007-09-03 15:38:01 UTC (rev 889) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItem.cs 2007-09-03 19:59:11 UTC (rev 890) @@ -41,6 +41,7 @@ using MediaPortal.Util; using GUIProgramsAlt; +using GUIProgramsAlt.Imports; using GUIProgramsAlt.Database; using GUIProgramsAlt.Items; @@ -52,13 +53,44 @@ { #region Events/Delegates - public delegate void FilelinkLaunchEventHandler(FilelinkItem curLink, bool mpGuiMode); - public event FilelinkLaunchEventHandler OnLaunchFilelink = null; + // public delegate void FilelinkLaunchEventHandler(FilelinkItem curLink, bool mpGuiMode); + // public event FilelinkLaunchEventHandler OnLaunchFilelink = null; // event: read new file - public delegate void RefreshInfoEventHandler(string informationMessage, int progressBarProgess); - public event RefreshInfoEventHandler OnRefreshInfo = null; + public delegate void RefreshInfoEventHandler(object sender ,FileReadEventArgs e) ; + public event RefreshInfoEventHandler OnRefreshInfoEvent = null; + + public delegate void ImportFinishedEventHandler(object sender,EventArgs e); + public event ImportFinishedEventHandler ImportFinishedEvent; + + public delegate void ImportDelegate(); + protected ImportDelegate importDelegate = null; + + public virtual void OnImportFinished(object sender, EventArgs e) + { + if (ImportFinishedEvent != null) + { + ImportFinishedEvent(this,e); + } + } + + protected void ImportEnded(IAsyncResult result) + { + filesAreLoaded = false; + if (progressDialog != null) + { + progressDialog.Close(); + } + OnImportFinished(this, null); + if (progressDialog != null) + { + progressDialog.Close(); + progressDialog.ShowWaitCursor = false; + + } + } + #endregion Events/Delegates #region Variables @@ -302,7 +334,7 @@ public ApplicationItem() { - // .. init member variables ... + // .. init member variables ... appID = -1; fatherID = -1; title = ""; @@ -337,7 +369,6 @@ protected void ShowProgressDialog(string headerText) { progressDialog = (GUIDialogProgress)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_PROGRESS); - progressDialog.ShowWaitCursor = true; progressDialog.SetHeading(headerText); progressDialog.SetLine(0,headerText); progressDialog.SetLine(1, ""); @@ -346,30 +377,26 @@ progressDialog.Progress(); } - public void ReadNewFile(string informationMessage, int progressBarCtr) + public void SetGUIProgressDialog(string informationMessage, int progressBarCtr) { + if (progressDialog != null) { + + progressDialog.ShowProgressBar(true); + progressDialog.ShowWaitCursor = true; + progressDialog.SetLine(2, String.Format("{0} {1}", GUILocalizeStrings.Get(13005), informationMessage)); // "last imported file {0}" - /* if ((curPos > 0) && (maxPos > 0)) - { - int perc = 100 * curPos / maxPos; - guiDialogProgress.SetPercentage(perc); - }*/ + progressDialog.SetPercentage(progressBarCtr); progressDialog.Progress(); + + } - SendRefreshInfo(String.Format("{0} {1}", GUILocalizeStrings.Get(13005), informationMessage), progressBarCtr); + // SendRefreshInfo(String.Format("{0} {1}", GUILocalizeStrings.Get(13005), informationMessage), progressBarCtr); } - protected void SendRefreshInfo(string informationMessage, int progressBarCtr) - { - if (OnRefreshInfo != null) - { - OnRefreshInfo(informationMessage, progressBarCtr); - } - } + - protected void DoPreLaunch() { if (waitForExit && (preLaunch != "")) Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemDirectoryCache.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemDirectoryCache.cs 2007-09-03 15:38:01 UTC (rev 889) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemDirectoryCache.cs 2007-09-03 19:59:11 UTC (rev 890) @@ -87,31 +87,29 @@ { if (mpGUIMode) { - ShowProgressDialog("Import directory"); + ShowProgressDialog("Importing from folders.."); } DirectoryImport directoryImport = null; - try - { - directoryImport = new DirectoryImport(this); - + + if (!File.Exists(this.Executable)) // no "mame.exe" + return; + + ValidExtensions = ValidExtensions.Replace(" ", ""); - string[] fileDirPaths = this.FileDirectory.Split(';'); - directoryImport.StartImport(fileDirPaths, mpGUIMode); + - } - finally - { - if (directoryImport != null) - { - directoryImport.DeInit(); - } + directoryImport = new DirectoryImport(this); + directoryImport.ReadNewFileEvent += new ImportBase.ReadNewFileEventHandler(directoryImport_ReadNewFileEvent); + importDelegate = new ImportDelegate(directoryImport.StartImport); + importDelegate.BeginInvoke(new AsyncCallback(ImportEnded), null); - if (mpGUIMode) - { - progressDialog.Close(); - } - } + #endregion ApplicationItem Overloads } + + void directoryImport_ReadNewFileEvent(object sender, FileReadEventArgs e) + { + this.SetGUIProgressDialog(e.message, e.ctr); + } } } \ No newline at end of file Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemGameBase.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemGameBase.cs 2007-09-03 15:38:01 UTC (rev 889) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemGameBase.cs 2007-09-03 19:59:11 UTC (rev 890) @@ -62,30 +62,27 @@ GamebaseImport gameBaseImport = null; - // show progress dialog and run the import... if (mpGUIMode) { - ShowProgressDialog("Import gamebase"); + ShowProgressDialog("Importing from gameBase.."); } - try - { - gameBaseImport = new GamebaseImport(this); - gameBaseImport.StartImport(); - } - finally - { - if (gameBaseImport != null) - { - gameBaseImport.DeInit(); - } - if (mpGUIMode) - { - progressDialog.Close(); - } - } + if (!File.Exists(this.Executable)) // no "mame.exe" + return; + + + gameBaseImport = new GamebaseImport(this); + gameBaseImport.ReadNewFileEvent += new ImportBase.ReadNewFileEventHandler(gameBaseImport_ReadNewFileEvent); + importDelegate = new ImportDelegate(gameBaseImport.StartImport); + importDelegate.BeginInvoke(new AsyncCallback(ImportEnded), null); + } + void gameBaseImport_ReadNewFileEvent(object sender, FileReadEventArgs e) + { + this.SetGUIProgressDialog(e.message, e.ctr); + } + public override void Refresh(bool bGUIMode) { DeleteFiles(); Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemMame.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemMame.cs 2007-09-03 15:38:01 UTC (rev 889) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemMame.cs 2007-09-03 19:59:11 UTC (rev 890) @@ -30,6 +30,7 @@ using System.Diagnostics; using System.IO; using SQLite.NET; +using System.Threading; using MediaPortal.Dialogs; using MediaPortal.GUI.Library; @@ -54,6 +55,7 @@ public ApplicationItemMame() { + // some nice working mame defaults... Title = "MAME"; Executable = "..Your path to mame.exe goes here..."; @@ -113,26 +115,20 @@ if (mpGUIMode) { - ShowProgressDialog("Import mame"); + ShowProgressDialog("Importing Mameitems.."); } - try - { - mameImport = new MameImport(this); - mameImport.StartImport(); - } - finally - { - if (mameImport != null) - { - mameImport.DeInit(); - } + mameImport = new MameImport(this); + mameImport.ReadNewFileEvent += new ImportBase.ReadNewFileEventHandler(mameImport_OnReadNewFileEvent); + importDelegate = new ImportDelegate(mameImport.StartImport); + importDelegate.BeginInvoke(new AsyncCallback(ImportEnded),null); - if (mpGUIMode) - { - progressDialog.Close(); - } - } } + + void mameImport_OnReadNewFileEvent(object sender,FileReadEventArgs e) + { + this.SetGUIProgressDialog(e.message, e.ctr); + } + #endregion ApplicationItem Overloads } } \ No newline at end of file Modified: trunk/plugins/myGUIProgramsAlt/README.txt =================================================================== --- trunk/plugins/myGUIProgramsAlt/README.txt 2007-09-03 15:38:01 UTC (rev 889) +++ trunk/plugins/myGUIProgramsAlt/README.txt 2007-09-03 19:59:11 UTC (rev 890) @@ -5,7 +5,7 @@ chefkoch is doing stuff on this to,Great,it will for sure speed-up development! :--INSTALLATION -Copy contents of metadata-folder to MP root folder ,skin to relevant folder, and the GUIPrograms.dll to MP/windowsplugins to run. +Copy contents of metadata-folder to MP root folder ,skin to relevant folder, and the GUIProgramsAlt.dll to MP/windowsplugins to run. Copy SQLite.Dll to same folder as plugin .. Copy skin to relevant folder. There will possibly be db-changes and xml-changes between versions, so always make sure that you have a clean install between updates. @@ -33,7 +33,7 @@ Testing,bugfixing,codecleanup --Optimize some things if possibly +-Optimize some things if possible -Change graphics for fileinfobackground (it says mymovies...) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <i-...@us...> - 2007-09-03 16:31:26
|
Revision: 885 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=885&view=rev Author: i-loop Date: 2007-09-02 23:04:05 -0700 (Sun, 02 Sep 2007) Log Message: ----------- removed the 3d example from the homescreen Modified Paths: -------------- trunk/skins/BlueTwoBig/Development Version/myHome.xml Modified: trunk/skins/BlueTwoBig/Development Version/myHome.xml =================================================================== --- trunk/skins/BlueTwoBig/Development Version/myHome.xml 2007-09-02 17:15:27 UTC (rev 884) +++ trunk/skins/BlueTwoBig/Development Version/myHome.xml 2007-09-03 06:04:05 UTC (rev 885) @@ -40,8 +40,6 @@ <animation effect="fade" time="500">WindowClose</animation> <animation effect="zoom" start="20,20" end="100,100" center="384,288" time="500">WindowOpen</animation> <animation effect="zoom" start="100,100" end="20,20" center="384,288" time="500">WindowClose</animation> - <animation effect="rotatey" start="0" end="20" center="525,0" tween="back" ease="easeout" time="500">focus</animation> - <animation effect="rotatey" start="20" end="0" center="525,0" tween="back" ease="easeout" time="500">unfocus</animation> <id>50</id> <posX>370</posX> <posY>130</posY> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rs...@us...> - 2007-09-03 15:38:34
|
Revision: 889 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=889&view=rev Author: rsparey Date: 2007-09-03 08:38:01 -0700 (Mon, 03 Sep 2007) Log Message: ----------- UPDATED SUPPORT FILES DIRECTORY Added Paths: ----------- trunk/skins/Foofaraw/Foofaraw Support Files/Administration/ trunk/skins/Foofaraw/Foofaraw Support Files/Administration/Design Process Document.cdr trunk/skins/Foofaraw/Foofaraw Support Files/BACKGROUND CHANGER/ trunk/skins/Foofaraw/Foofaraw Support Files/BACKGROUND CHANGER/FoofarawBackgroundChanger.exe trunk/skins/Foofaraw/Foofaraw Support Files/BACKGROUND CHANGER/FoofarawBackgroundChanger.pdb trunk/skins/Foofaraw/Foofaraw Support Files/BACKGROUND CHANGER/FoofarawBackgroundChanger.vshost.exe trunk/skins/Foofaraw/Foofaraw Support Files/Desktop Backgrounds/ trunk/skins/Foofaraw/Foofaraw Support Files/Desktop Backgrounds/Foofaraw.jpg trunk/skins/Foofaraw/Foofaraw Support Files/Desktop Backgrounds/Thumbs.db trunk/skins/Foofaraw/Foofaraw Support Files/Desktop Backgrounds/foodrop-back.jpg trunk/skins/Foofaraw/Foofaraw Support Files/Research/ trunk/skins/Foofaraw/Foofaraw Support Files/Research/3rd Party buttons/ trunk/skins/Foofaraw/Foofaraw Support Files/Research/3rd Party buttons/alphabet_glass_bars/ trunk/skins/Foofaraw/Foofaraw Support Files/Research/3rd Party buttons/alphabet_glass_bars/alphabet_glass_bars.ai trunk/skins/Foofaraw/Foofaraw Support Files/Research/3rd Party buttons/alphabet_glass_bars/alphabet_glass_bars.eps trunk/skins/Foofaraw/Foofaraw Support Files/Research/3rd Party buttons/alphabet_glass_bars/alphabet_glass_bars.png trunk/skins/Foofaraw/Foofaraw Support Files/Research/3rd Party buttons/alphabet_glass_bars/alphabet_glass_bars.svg trunk/skins/Foofaraw/Foofaraw Support Files/Research/3rd Party buttons/round_glass_buttons/ trunk/skins/Foofaraw/Foofaraw Support Files/Research/3rd Party buttons/round_glass_buttons/round_glass_buttons.ai trunk/skins/Foofaraw/Foofaraw Support Files/Research/3rd Party buttons/round_glass_buttons/round_glass_buttons.eps trunk/skins/Foofaraw/Foofaraw Support Files/Research/3rd Party buttons/round_glass_buttons/round_glass_buttons.png trunk/skins/Foofaraw/Foofaraw Support Files/Research/3rd Party buttons/round_glass_buttons/round_glass_buttons.svg trunk/skins/Foofaraw/Foofaraw Support Files/Research/3rd Party buttons/vector_glass_buttons/ trunk/skins/Foofaraw/Foofaraw Support Files/Research/3rd Party buttons/vector_glass_buttons/assorted_glass buttons.png trunk/skins/Foofaraw/Foofaraw Support Files/Research/3rd Party buttons/vector_glass_buttons/assorted_glass_bars.ai trunk/skins/Foofaraw/Foofaraw Support Files/Research/3rd Party buttons/vector_glass_buttons/assorted_glass_bars.eps trunk/skins/Foofaraw/Foofaraw Support Files/Research/Corel/ trunk/skins/Foofaraw/Foofaraw Support Files/Research/Corel/COOL SING SOFTWARE.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Research/Corel/board1.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Research/Corel/colour ideas - 2006.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Research/Corel/screens.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Research/PSP/ trunk/skins/Foofaraw/Foofaraw Support Files/Research/PSP/100_2829.JPG trunk/skins/Foofaraw/Foofaraw Support Files/Research/PSP/100_2830.JPG trunk/skins/Foofaraw/Foofaraw Support Files/Research/PSP/100_2831.JPG trunk/skins/Foofaraw/Foofaraw Support Files/Research/PSP/100_2832.JPG trunk/skins/Foofaraw/Foofaraw Support Files/Research/PSP/100_2833.JPG trunk/skins/Foofaraw/Foofaraw Support Files/Research/PSP/100_2834.JPG trunk/skins/Foofaraw/Foofaraw Support Files/Research/PSP/100_2835.JPG trunk/skins/Foofaraw/Foofaraw Support Files/Research/PSP/100_2836.JPG trunk/skins/Foofaraw/Foofaraw Support Files/Research/PSP/100_2837.JPG trunk/skins/Foofaraw/Foofaraw Support Files/Research/PSP/Thumbs.db trunk/skins/Foofaraw/Foofaraw Support Files/Research/Pdf/ trunk/skins/Foofaraw/Foofaraw Support Files/Research/Pdf/product boards.pdf trunk/skins/Foofaraw/Foofaraw Support Files/Research/Thumbs.db trunk/skins/Foofaraw/Foofaraw Support Files/Skin Backgrounds/ trunk/skins/Foofaraw/Foofaraw Support Files/Skin Backgrounds/Background Pack.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Backgrounds/Backup_of_Background Pack.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/ trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/Hover Icons/ trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/Hover Icons/Hover Icon Template.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/Hover Icons/Thumbs.db trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/Hover Icons/hover TV SERIES.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/Hover Icons/hover Trailers.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/Hover Icons/hover alarm.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/Hover Icons/hover camera.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/Hover Icons/hover dream box.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/Hover Icons/hover mail.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/Hover Icons/hover msn.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/Hover Icons/hover music video.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/Hover Icons/hover music-puzzle.png trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/Hover Icons/hover my explorer.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/Hover Icons/hover my internet.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/Hover Icons/hover my status.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/Hover Icons/hover photo-puzzle.png trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/Hover Icons/hover puzzle pieces.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/Hover Icons/hover radio-puzzle.png trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/Hover Icons/hover recipe.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/Hover Icons/hover remote.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/Hover Icons/hover suduko.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/Hover Icons/hover tetris.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/Hover Icons/hover tv-puzzle.png trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/Hover Icons/hover video editor.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/Hover Icons/hover video-puzzle.png trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/Hover Icons/hover wikipedia.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/Hover Icons/hover x10.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/Hover Icons/hoverapplications.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/Thumbs.db trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/icons/ trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/icons/Backup_of_DVD CASE.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/icons/Backup_of_cd case.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/icons/Backup_of_lens.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/icons/Backup_of_photo frame.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/icons/CLAP.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/icons/DVD CASE.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/icons/arrows.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/icons/burn.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/icons/camera.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/icons/cd case.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/icons/drop.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/icons/folder.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/icons/foofaraw.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/icons/full-folder.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/icons/jigsaw.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/icons/lens.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/icons/photo frame.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/icons/photos.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/icons/radio icon.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/icons/speaker(1).cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/icons/sung tele.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/icons/up a directory.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Icons/icons/usb.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Layout/ trunk/skins/Foofaraw/Foofaraw Support Files/Skin Layout/Skin Layout.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Layout/TVCONCEPT/ trunk/skins/Foofaraw/Foofaraw Support Files/Skin Layout/TVCONCEPT/TV CONCEPT.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Layout/Time Block Layout.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Layout/Waiting Animation Layout.cdr trunk/skins/Foofaraw/Foofaraw Support Files/Skin Layout/Y REF CONVERTOR FROM COREL TO MP.xls trunk/skins/Foofaraw/Foofaraw Support Files/Skin Layout/obsoulete/ trunk/skins/Foofaraw/Foofaraw Support Files/Skin Layout/obsoulete/Foofaraw Layout1.cdr trunk/skins/Foofaraw/Foofaraw Support Files/release notes 1.0.3.cdr Added: trunk/skins/Foofaraw/Foofaraw Support Files/Administration/Design Process Document.cdr =================================================================== (Binary files differ) Property changes on: trunk/skins/Foofaraw/Foofaraw Support Files/Administration/Design Process Document.cdr ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/skins/Foofaraw/Foofaraw Support Files/BACKGROUND CHANGER/FoofarawBackgroundChanger.exe =================================================================== (Binary files differ) Property changes on: trunk/skins/Foofaraw/Foofaraw Support Files/BACKGROUND CHANGER/FoofarawBackgroundChanger.exe ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/skins/Foofaraw/Foofaraw Support Files/BACKGROUND CHANGER/FoofarawBackgroundChanger.pdb =================================================================== (Binary files differ) Property changes on: trunk/skins/Foofaraw/Foofaraw Support Files/BACKGROUND CHANGER/FoofarawBackgroundChanger.pdb ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/skins/Foofaraw/Foofaraw Support Files/BACKGROUND CHANGER/FoofarawBackgroundChanger.vshost.exe =================================================================== (Binary files differ) Property changes on: trunk/skins/Foofaraw/Foofaraw Support Files/BACKGROUND CHANGER/FoofarawBackgroundChanger.vshost.exe ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/skins/Foofaraw/Foofaraw Support Files/Desktop Backgrounds/Foofaraw.jpg =================================================================== (Binary files differ) Property changes on: trunk/skins/Foofaraw/Foofaraw Support Files/Desktop Backgrounds/Foofaraw.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/skins/Foofaraw/Foofaraw Support Files/Desktop Backgrounds/Thumbs.db =================================================================== (Binary files differ) Property changes on: trunk/skins/Foofaraw/Foofaraw Support Files/Desktop Backgrounds/Thumbs.db ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/skins/Foofaraw/Foofaraw Support Files/Desktop Backgrounds/foodrop-back.jpg =================================================================== (Binary files differ) Property changes on: trunk/skins/Foofaraw/Foofaraw Support Files/Desktop Backgrounds/foodrop-back.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/skins/Foofaraw/Foofaraw Support Files/Research/3rd Party buttons/alphabet_glass_bars/alphabet_glass_bars.ai =================================================================== --- trunk/skins/Foofaraw/Foofaraw Support Files/Research/3rd Party buttons/alphabet_glass_bars/alphabet_glass_bars.ai (rev 0) +++ trunk/skins/Foofaraw/Foofaraw Support Files/Research/3rd Party buttons/alphabet_glass_bars/alphabet_glass_bars.ai 2007-09-03 15:38:01 UTC (rev 889) @@ -0,0 +1,18874 @@ +%PDF-1.4 +%\xE2\xE3\xCF\xD3 +1 0 obj<</Pages 2 0 R/Type/Catalog/Metadata 6989 0 R>> +endobj +2 0 obj<</Count 1/Kids[6 0 R]/Type/Pages>> +endobj +3 0 obj<</ModDate(D:20070211190838-06'00')/CreationDate(D:20070208043420Z)/Creator(Illustrator)/Producer(Adobe PDF library 6.66)>> +endobj +5 0 obj null +endobj +6 0 obj<</Contents 6982 0 R/Type/Page/Parent 2 0 R/Thumb 6988 0 R/MediaBox[0.0 0.0 465.0 400.0]/BleedBox[0.0 0.0 465.0 400.0]/TrimBox[0.0 0.0 465.0 400.0]/ArtBox[39.37207 144.0 424.0 265.62549]/Resources<</XObject<</Fm0 4990 0 R/Fm1 5028 0 R/Fm2 5042 0 R/Fm3 5074 0 R/Fm4 5087 0 R/Fm5 5119 0 R/Fm6 5132 0 R/Fm7 5164 0 R/Fm8 5177 0 R/Fm9 5209 0 R/Fm10 5222 0 R/Fm11 5254 0 R/Fm12 5267 0 R/Fm13 5299 0 R/Fm14 5312 0 R/Fm15 5344 0 R/Fm16 5357 0 R/Fm17 5389 0 R/Fm18 5402 0 R/Fm19 5434 0 R/Fm20 5447 0 R/Fm21 5479 0 R/Fm22 5492 0 R/Fm23 5524 0 R/Fm24 5537 0 R/Fm25 5569 0 R/Fm26 5582 0 R/Fm27 5614 0 R/Fm28 5627 0 R/Fm29 5659 0 R/Fm30 5672 0 R/Fm31 5704 0 R/Fm32 5717 0 R/Fm33 5749 0 R/Fm34 5762 0 R/Fm35 5794 0 R/Fm36 5807 0 R/Fm37 5839 0 R/Fm38 5852 0 R/Fm39 5884 0 R/Im0 6342 0 R/Fm40 5897 0 R/Fm41 5929 0 R/Fm42 5942 0 R/Fm43 5974 0 R/Fm44 5987 0 R/Fm45 6019 0 R/Fm46 6032 0 R/Fm47 6064 0 R/Fm48 6077 0 R/Fm49 6109 0 R/Fm50 6122 0 R/Fm51 6154 0 R/Fm52 6167 0 R/Fm53 6199 0 R/Fm54 6212 0 R/Fm55 6244 0 R/Fm56 6257 0 R/Fm57 6289 0 R/Fm58 6302 0 R/Fm59 6334 0 R/Im1 6349 0 R/Im2 6356 0 R/Im3 6363 0 R/Im4 6370 0 R/Im5 6377 0 R/Im6 6384 0 R/Im7 6391 0 R/Im8 6398 0 R/Im9 6405 0 R/Im10 6412 0 R/Im11 6419 0 R/Im12 6426 0 R/Im13 6433 0 R/Im14 6440 0 R/Im15 6447 0 R/Im16 6454 0 R/Im17 6461 0 R/Im18 6468 0 R/Im19 6475 0 R/Im20 6482 0 R/Im21 6489 0 R/Im22 6496 0 R/Im23 6503 0 R/Im24 6510 0 R/Im25 6517 0 R/Im26 6524 0 R/Im27 6531 0 R/Im28 6538 0 R/Im29 6545 0 R>>/ProcSet[/PDF/ImageC]/ExtGState<</GS0 4980 0 R/GS1 4991 0 R/GS2 5011 0 R/GS3 4984 0 R/GS4 5026 0 R/GS5 6546 0 R/GS6 6547 0 R/GS7 5036 0 R/GS8 6562 0 R/GS9 6577 0 R/GS10 6592 0 R/GS11 6607 0 R/GS12 6622 0 R/GS13 6637 0 R/GS14 6652 0 R/GS15 6667 0 R/GS16 6682 0 R/GS17 6697 0 R/GS18 6712 0 R/GS19 6727 0 R/GS20 6742 0 R/GS21 6757 0 R/GS22 6772 0 R/GS23 6787 0 R/GS24 6802 0 R/GS25 6817 0 R/GS26 6832 0 R/GS27 6847 0 R/GS28 6862 0 R/GS29 6877 0 R/GS30 6892 0 R/GS31 6907 0 R/GS32 6922 0 R/GS33 6937 0 R/GS34 6952 0 R/GS35 6967 0 R>>/Shading<</Sh0<</ColorSpace/DeviceRGB/Function 6336 0 R/Domain[0.0 1.0]/ShadingType 2/Extend[true true]/AntiAlias false/Coords[0.0 0.0 1.0 0.0]>>/Sh1<</ColorSpace/DeviceRGB/Function 6343 0 R/Domain[0.0 1.0]/ShadingType 2/Extend[true true]/AntiAlias false/Coords[0.0 0.0 1.0 0.0]>>/Sh2<</ColorSpace/DeviceRGB/Function 6350 0 R/Domain[0.0 1.0]/ShadingType 2/Extend[true true]/AntiAlias false/Coords[0.0 0.0 1.0 0.0]>>/Sh3<</ColorSpace/DeviceRGB/Function 6357 0 R/Domain[0.0 1.0]/ShadingType 2/Extend[true true]/AntiAlias false/Coords[0.0 0.0 1.0 0.0]>>/Sh4<</ColorSpace/DeviceRGB/Function 6364 0 R/Domain[0.0 1.0]/ShadingType 2/Extend[true true]/AntiAlias false/Coords[0.0 0.0 1.0 0.0]>>/Sh5<</ColorSpace/DeviceRGB/Function 6371 0 R/Domain[0.0 1.0]/ShadingType 2/Extend[true true]/AntiAlias false/Coords[0.0 0.0 1.0 0.0]>>/Sh6<</ColorSpace/DeviceRGB/Function 6378 0 R/Domain[0.0 1.0]/ShadingType 2/Extend[true true]/AntiAlias false/Coords[0.0 0.0 1.0 0.0]>>/Sh7<</ColorSpace/DeviceRGB/Function 6385 0 R/Domain[0.0 1.0]/ShadingType 2/Extend[true true]/AntiAlias false/Coords[0.0 0.0 1.0 0.0]>>/Sh8<</ColorSpace/DeviceRGB/Function 6392 0 R/Domain[0.0 1.0]/ShadingType 2/Extend[true true]/AntiAlias false/Coords[0.0 0.0 1.0 0.0]>>/Sh9<</ColorSpace/DeviceRGB/Function 6399 0 R/Domain[0.0 1.0]/ShadingType 2/Extend[true true]/AntiAlias false/Coords[0.0 0.0 1.0 0.0]>>/Sh10<</ColorSpace/DeviceRGB/Function 6406 0 R/Domain[0.0 1.0]/ShadingType 2/Extend[true true]/AntiAlias false/Coords[0.0 0.0 1.0 0.0]>>/Sh11<</ColorSpace/DeviceRGB/Function 6413 0 R/Domain[0.0 1.0]/ShadingType 2/Extend[true true]/AntiAlias false/Coords[0.0 0.0 1.0 0.0]>>/Sh12<</ColorSpace/DeviceRGB/Function 6420 0 R/Domain[0.0 1.0]/ShadingType 2/Extend[true true]/AntiAlias false/Coords[0.0 0.0 1.0 0.0]>>/Sh13<</ColorSpace/DeviceRGB/Function 6427 0 R/Domain[0.0 1.0]/ShadingType 2/Extend[true true]/AntiAlias false/Coords[0.0 0.0 1.0 0.0]>>/Sh14<</ColorSpace/DeviceRGB/Function 6434 0 R/Domain[0.0 1.0]/ShadingType 2/Extend[true true]/AntiAlias false/Coords[0.0 0.0 1.0 0.0]>>/Sh15<</ColorSpace/DeviceRGB/Function 6441 0 R/Domain[0.0 1.0]/ShadingType 2/Extend[true true]/AntiAlias false/Coords[0.0 0.0 1.0 0.0]>>/Sh16<</ColorSpace/DeviceRGB/Function 6448 0 R/Domain[0.0 1.0]/ShadingType 2/Extend[true true]/AntiAlias false/Coords[0.0 0.0 1.0 0.0]>>/Sh17<</ColorSpace/DeviceRGB/Function 6455 0 R/Domain[0.0 1.0]/ShadingType 2/Extend[true true]/AntiAlias false/Coords[0.0 0.0 1.0 0.0]>>/Sh18<</ColorSpace/DeviceRGB/Function 6462 0 R/Domain[0.0 1.0]/ShadingType 2/Extend[true true]/AntiAlias false/Coords[0.0 0.0 1.0 0.0]>>/Sh19<</ColorSpace/DeviceRGB/Function 6469 0 R/Domain[0.0 1.0]/ShadingType 2/Extend[true true]/AntiAlias false/Coords[0.0 0.0 1.0 0.0]>>/Sh20<</ColorSpace/DeviceRGB/Function 6476 0 R/Domain[0.0 1.0]/ShadingType 2/Extend[true true]/AntiAlias false/Coords[0.0 0.0 1.0 0.0]>>/Sh21<</ColorSpace/DeviceRGB/Function 6483 0 R/Domain[0.0 1.0]/ShadingType 2/Extend[true true]/AntiAlias false/Coords[0.0 0.0 1.0 0.0]>>/Sh22<</ColorSpace/DeviceRGB/Function 6490 0 R/Domain[0.0 1.0]/ShadingType 2/Extend[true true]/AntiAlias false/Coords[0.0 0.0 1.0 0.0]>>/Sh23<</ColorSpace/DeviceRGB/Function 6497 0 R/Domain[0.0 1.0]/ShadingType 2/Extend[true true]/AntiAlias false/Coords[0.0 0.0 1.0 0.0]>>/Sh24<</ColorSpace/DeviceRGB/Function 6504 0 R/Domain[0.0 1.0]/ShadingType 2/Extend[true true]/AntiAlias false/Coords[0.0 0.0 1.0 0.0]>>/Sh25<</ColorSpace/DeviceRGB/Function 6511 0 R/Domain[0.0 1.0]/ShadingType 2/Extend[true true]/AntiAlias false/Coords[0.0 0.0 1.0 0.0]>>/Sh26<</ColorSpace/DeviceRGB/Function 6518 0 R/Domain[0.0 1.0]/ShadingType 2/Extend[true true]/AntiAlias false/Coords[0.0 0.0 1.0 0.0]>>/Sh27<</ColorSpace/DeviceRGB/Function 6525 0 R/Domain[0.0 1.0]/ShadingType 2/Extend[true true]/AntiAlias false/Coords[0.0 0.0 1.0 0.0]>>/Sh28<</ColorSpace/DeviceRGB/Function 6532 0 R/Domain[0.0 1.0]/ShadingType 2/Extend[true true]/AntiAlias false/Coords[0.0 0.0 1.0 0.0]>>/Sh29<</ColorSpace/DeviceRGB/Function 6539 0 R/Domain[0.0 1.0]/ShadingType 2/Extend[true true]/AntiAlias false/Coords[0.0 0.0 1.0 0.0]>>>>/Properties<</MC0<</Color[20224.0 32768.0 32768.0]/Title(Layer 1)/Visible true/Preview true/Editable true/Printed true/Dimmed true>>>>>>/Group 6983 0 R/PieceInfo<</Illustrator 7 0 R>>/LastModified(D:20070211190834-06'00')>> +endobj +7 0 obj<</LastModified(D:20070211190834-06'00')/Private 8 0 R>> +endobj +8 0 obj<</CreatorVersion 11/ContainerVersion 9/RoundtripVersion 11/AIMetaData 4795 0 R/AIPrivateData1 4796 0 R/AIPrivateData2 4798 0 R/AIPrivateData3 4800 0 R/AIPrivateData4 4802 0 R/AIPrivateData5 4804 0 R/AIPrivateData6 4806 0 R/AIPrivateData7 4808 0 R/AIPrivateData8 4810 0 R/AIPrivateData9 4812 0 R/AIPrivateData10 4814 0 R/AIPrivateData11 4816 0 R/NumBlock 92/AIPrivateData12 4818 0 R/AIPrivateData13 4820 0 R/AIPrivateData14 4822 0 R/AIPrivateData15 4824 0 R/AIPrivateData16 4826 0 R/AIPrivateData17 4828 0 R/AIPrivateData18 4830 0 R/AIPrivateData19 4832 0 R/AIPrivateData20 4834 0 R/AIPrivateData21 4836 0 R/AIPrivateData22 4838 0 R/AIPrivateData23 4840 0 R/AIPrivateData24 4842 0 R/AIPrivateData25 4844 0 R/AIPrivateData26 4846 0 R/AIPrivateData27 4848 0 R/AIPrivateData28 4850 0 R/AIPrivateData29 4852 0 R/AIPrivateData30 4854 0 R/AIPrivateData31 4856 0 R/AIPrivateData32 4858 0 R/AIPrivateData33 4860 0 R/AIPrivateData34 4862 0 R/AIPrivateData35 4864 0 R/AIPrivateData36 4866 0 R/AIPrivateData37 4868 0 R/AIPrivateData38 4870 0 R/AIPrivateData39 4872 0 R/AIPrivateData40 4874 0 R/AIPrivateData41 4876 0 R/AIPrivateData42 4878 0 R/AIPrivateData43 4880 0 R/AIPrivateData44 4882 0 R/AIPrivateData45 4884 0 R/AIPrivateData46 4886 0 R/AIPrivateData47 4888 0 R/AIPrivateData48 4890 0 R/AIPrivateData49 4892 0 R/AIPrivateData50 4894 0 R/AIPrivateData51 4896 0 R/AIPrivateData52 4898 0 R/AIPrivateData53 4900 0 R/AIPrivateData54 4902 0 R/AIPrivateData55 4904 0 R/AIPrivateData56 4906 0 R/AIPrivateData57 4908 0 R/AIPrivateData58 4910 0 R/AIPrivateData59 4912 0 R/AIPrivateData60 4914 0 R/AIPrivateData61 4916 0 R/AIPrivateData62 4918 0 R/AIPrivateData63 4920 0 R/AIPrivateData64 4922 0 R/AIPrivateData65 4924 0 R/AIPrivateData66 4926 0 R/AIPrivateData67 4928 0 R/AIPrivateData68 4930 0 R/AIPrivateData69 4932 0 R/AIPrivateData70 4934 0 R/AIPrivateData71 4936 0 R/AIPrivateData72 4938 0 R/AIPrivateData73 4940 0 R/AIPrivateData74 4942 0 R/AIPrivateData75 4944 0 R/AIPrivateData76 4946 0 R/AIPrivateData77 4948 0 R/AIPrivateData78 4950 0 R/AIPrivateData79 4952 0 R/AIPrivateData80 4954 0 R/AIPrivateData81 4956 0 R/AIPrivateData82 4958 0 R/AIPrivateData83 4960 0 R/AIPrivateData84 4962 0 R/AIPrivateData85 4964 0 R/AIPrivateData86 4966 0 R/AIPrivateData87 4968 0 R/AIPrivateData88 4970 0 R/AIPrivateData89 4972 0 R/AIPrivateData90 4974 0 R/AIPrivateData91 4976 0 R/AIPrivateData92 4978 0 R/AIPrivateData93 2587 0 R/AIPrivateData94 2589 0 R/AIPrivateData95 2591 0 R/AIPrivateData96 2593 0 R/AIPrivateData97 2595 0 R/AIPrivateData98 2597 0 R/AIPrivateData99 2599 0 R>> +endobj +2401 0 obj null +endobj +2586 0 obj 4831 +endobj +2587 0 obj<</Length 2586 0 R/Filter[/FlateDecode]>>stream +H\x89\xEC\x95\xF9[SgG\xDBGQ\xF6%a\xDF\x88\xEC$A\xB6 \x89(\x9BQ0*\x9BRY\x84V(\x95\xC4h\xA5\xA5H-\x85\xA2P)\x82Ҳ\xA8E\xC4R\\x8AK\x9D\xF9+f\xDE{\x93\-HrI\xF8\x9E\x9F\xDF7\x9C\xE7sϽ|\xF4т\xF0\xBF\xF7X\x98\xBF,B \x80 |
From: <rs...@us...> - 2007-09-03 13:41:30
|
Revision: 888 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=888&view=rev Author: rsparey Date: 2007-09-03 06:41:19 -0700 (Mon, 03 Sep 2007) Log Message: ----------- Created folder remotely Added Paths: ----------- trunk/skins/Foofaraw/Foofaraw Support Files/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rs...@us...> - 2007-09-03 13:40:41
|
Revision: 887 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=887&view=rev Author: rsparey Date: 2007-09-03 06:40:39 -0700 (Mon, 03 Sep 2007) Log Message: ----------- Removed file/folder Removed Paths: ------------- trunk/skins/Foofaraw/Support Files/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rs...@us...> - 2007-09-03 13:25:59
|
Revision: 886 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=886&view=rev Author: rsparey Date: 2007-09-03 06:07:48 -0700 (Mon, 03 Sep 2007) Log Message: ----------- Updated my videos layout added dvd-box updated default dvd-big Modified Paths: -------------- trunk/skins/Foofaraw/Development Skin/Foofaraw/Media/defaultVideoBig.png trunk/skins/Foofaraw/Development Skin/Foofaraw/myvideo.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/myvideoTitle.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/release notes.xml Added Paths: ----------- trunk/skins/Foofaraw/Development Skin/Foofaraw/Media/dvd_box.png Removed Paths: ------------- trunk/skins/Foofaraw/Development Skin/Foofaraw/old recorded tv (REF).xml trunk/skins/Foofaraw/Development Skin/Foofaraw/old tv (DELETE ME).xml Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/Media/defaultVideoBig.png =================================================================== (Binary files differ) Added: trunk/skins/Foofaraw/Development Skin/Foofaraw/Media/dvd_box.png =================================================================== (Binary files differ) Property changes on: trunk/skins/Foofaraw/Development Skin/Foofaraw/Media/dvd_box.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/myvideo.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/myvideo.xml 2007-09-03 06:04:05 UTC (rev 885) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/myvideo.xml 2007-09-03 13:07:48 UTC (rev 886) @@ -316,11 +316,11 @@ <textureWidth>220</textureWidth> <textureHeight>100</textureHeight> <thumbWidth>101</thumbWidth> - <thumbHeight>101</thumbHeight> + <thumbHeight>154</thumbHeight> <thumbPosX>15</thumbPosX><!-- 10 --> <thumbPosY>1</thumbPosY><!-- 10 --> - <imageFolder>cd_box.png</imageFolder> - <imageFolderFocus>cd_box.png</imageFolderFocus> + <imageFolder>dvd_box.png</imageFolder> + <imageFolderFocus>dvd_box.png</imageFolderFocus> <keepaspectratio>no</keepaspectratio> <font>-</font> <selectedColor>-</selectedColor> @@ -353,7 +353,7 @@ <textureWidth>120</textureWidth> - <textureHeight>105</textureHeight> + <textureHeight>159</textureHeight> <showFolder>yes</showFolder> <showBackGround>no</showBackGround> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/myvideoTitle.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/myvideoTitle.xml 2007-09-03 06:04:05 UTC (rev 885) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/myvideoTitle.xml 2007-09-03 13:07:48 UTC (rev 886) @@ -7,7 +7,111 @@ <define>#header.image:videos_logo.png</define> <define>#header.hover:hover_my videos.png</define> <controls> + <import>common.window.xml</import> + <import>common.time.xml</import> + <control> + <type>image</type> + <decription>mid_strip</decription> + <id>1</id> + <posX>12</posX> + <posY>186</posY> + <width>1342</width> + <height>365</height> + <texture>mid_strip.png</texture> + </control> + + <control> + <type>image</type> + <decription>bottom_strip</decription> + <id>1</id> + <posX>12</posX> + <posY>547</posY> + <width>1342</width> + <height>18</height> + <texture>bottom_strip.png</texture> + </control> + + <control> + <type>image</type> + <decription>top-strip</decription> + <id>1</id> + <posX>12</posX> + <posY>155</posY> + <width>1342</width> + <height>36</height> + <texture>top-strip.png</texture> + </control> + + + + + <control> + <description>icon and label background</description> + <type>image</type> + <id>1</id> + <posX>0</posX> + <posY>0</posY> + <width>377</width> + <height>133</height> + <texture>Logo_background.png</texture> + <animation effect="fade" time="500" delay="1000">WindowOpen</animation> + <animation effect="fade" time="500">WindowClose</animation> + </control> + <control> + <type>image</type> + <description>Picture text gfx</description> + <id>1</id> + <posX>90</posX> + <posY>18</posY> + <texture>videos_logo.png</texture> + <animation effect="fade" time="500" delay="1300">WindowOpen</animation> + <animation effect="fade" time="500">WindowClose</animation> + </control> + + <control> + <type>image</type> + <decription>video icon</decription> + <id>1</id> + <posX>15</posX> + <posY>5</posY> + <width>61</width> + <height>122</height> + <texture>hover_my videos.png</texture> + <animation effect="fade" time="1000" delay="2000">WindowOpen</animation> + <animation effect="fade" time="500">WindowClose</animation> + </control> + <control> + <type>label</type> + <description>My videos Label</description> + <id>1</id> + <posX>251</posX> + <posY>68</posY> + <label>3</label> + <font>wipeouts</font> + <align>center</align> + <textcolor>ffffffff</textcolor> + <animation effect="fade" time="1000" end="60" delay="2000">WindowOpen</animation> + <animation effect="slide" time="1000" delay="2000" start="-600,0" end="0,0" acceleration="-1">WindowOpen</animation> + <animation effect="fade" time="500" start="50">WindowClose</animation> + </control> + + + <control> + <description>Selected item Label</description> + <type>fadelabel</type> + <id>1</id> + <animation effect="fade" time="400">WindowClose</animation> + <animation effect="fade" time="400">WindowOpen</animation> + <posX>250</posX> + <posY>600</posY> + <width>1000</width> + <label>#selecteditem</label> + <font>wipeouts</font> + <align>center</align> + <textcolor>ffffffff</textcolor> + </control> + <control> <type>imagelist</type> <animation effect="fade" time="250">WindowOpen</animation> @@ -27,63 +131,339 @@ <align>right</align> <percentage>#rating</percentage> </control> - <control> - <type>group</type> - <description>group element</description> - <animation effect="slide" time="400" start="0,-300">WindowOpen</animation> - <animation effect="slide" time="400" end="800,0">WindowClose</animation> - <animation effect="fade" time="250">WindowOpen</animation> - <animation effect="fade" time="500">WindowClose</animation> - <layout>StackLayout</layout> - <posX>113</posX> - <posY>129</posY> + <control> - <description>View-As button</description> - <type>button</type> - <id>2</id> - <label>100</label> - <onup>17</onup> - <onright>50</onright> - </control> + <description>View-As button</description> + <type>button</type> + <id>2</id> + <animation effect="fade" time="400">WindowClose</animation> + <animation effect="fade" time="400">WindowOpen</animation> + <posY>155</posY> + <posX>12</posX> + <label>100</label> + <font>font10</font> + <onleft>20</onleft> + <onright>3</onright> + <onup>21</onup> + <ondown>50</ondown> + <width>209</width> + <height>36</height> + <textureFocus>tab_left_corner_down.png</textureFocus> + <textureNoFocus>tab_left_corner_up.png</textureNoFocus> + + + + + </control> <control> - <type>sortbutton</type> - <id>3</id> - <label>103</label> - </control> + <type>sortbutton</type> + <id>3</id> + <animation effect="fade" time="400">WindowClose</animation> + <animation effect="fade" time="400">WindowOpen</animation> + <posY>155</posY> + <posX>221</posX> + <label>103</label> + <font>font10</font> + <width>209</width> + <height>36</height> + <onleft>2</onleft> + <onright>5</onright> + <onup>21</onup> + <ondown>50</ondown> + <textureFocus>tab_down.png</textureFocus> + <textureNoFocus>tab_up.png</textureNoFocus> + <textureAscending>arrow_round_up_nofocus.png</textureAscending> + <textureAscendingFocused>arrow_round_up_focus.png</textureAscendingFocused> + <textureDescending>arrow_round_down_nofocus.png</textureDescending> + <textureDescendingFocused>arrow_round_down_focus.png</textureDescendingFocused> + <offsetSortButtonX>180</offsetSortButtonX> + <offsetSortButtonY>8</offsetSortButtonY> + <textcolor>black</textcolor> + </control> + <control> + <description>Switch View button</description> + <type>button</type> + <id>5</id> + <animation effect="fade" time="400">WindowClose</animation> + <animation effect="fade" time="400">WindowOpen</animation> + <posY>155</posY> + <posX>430</posX> + <label>457</label> + <font>font10</font> + <width>209</width> + <height>36</height> + <onleft>3</onleft> + <onright>8</onright> + <onup>21</onup> + <ondown>50</ondown> + <textureFocus>tab_down.png</textureFocus> + <textureNoFocus>tab_up.png</textureNoFocus> + + </control> <control> - <description>Switch view</description> - <type>button</type> - <id>5</id> - <label>457</label> - </control> + <description>Trailers</description> + <type>button</type> + <id>8</id> + <hyperlink>5900</hyperlink> + <label>5906</label> + <animation effect="fade" time="400">WindowClose</animation> + <animation effect="fade" time="400">WindowOpen</animation> + <posY>155</posY> + <posX>639</posX> + + <font>font10</font> + <width>209</width> + <height>36</height> + <onleft>5</onleft> + <onright>6</onright> + <onup>21</onup> + <ondown>584</ondown> + <textureFocus>tab_down.png</textureFocus> + <textureNoFocus>tab_up.png</textureNoFocus> + + </control> <control> - <description>Playlist button</description> - <type>button</type> - <id>20</id> + <description>Play DVD</description> + <type>button</type> + <id>6</id> + <animation effect="fade" time="400">WindowClose</animation> + <animation effect="fade" time="400">WindowOpen</animation> + + <posY>155</posY> + <posX>848</posX> + <label>341</label> + <font>font10</font> + <width>209</width> + <height>36</height> + <onleft>8</onleft> + <onright>20</onright> + <onup>21</onup> + <ondown>7</ondown> + <textureFocus>tab_down.png</textureFocus> + <textureNoFocus>tab_up.png</textureNoFocus> + + + </control> + + + <control> + <description>Playlist</description> + <type>button</type> + <id>20</id> <label>136</label> - <action>33</action> - </control> - <control> - <description>Play DVD</description> - <type>button</type> - <id>6</id> - <label>341</label> - </control> - <control> - <description>Eject Disc</description> - <type>button</type> - <id>7</id> - <label>654</label> - <action>100</action> - </control> - <control> - <description>Trailers</description> - <type>button</type> - <id>8</id> - <hyperlink>5900</hyperlink> - <label>5906</label> - </control> + <animation effect="fade" time="400">WindowClose</animation> + <animation effect="fade" time="400">WindowOpen</animation> + <posY>155</posY> + <posX>1057</posX> + + <font>font10</font> + <ondown>99</ondown> + <width>209</width> + <height>36</height> + <onleft>6</onleft> + <onright>2</onright> + <onup>21</onup> + <ondown>9</ondown> + <textureFocus>tab_down.png</textureFocus> + <textureNoFocus>tab_up.png</textureNoFocus> + + </control> + + <control> + <description>composite control consisting of a list control and a thumbnail panel</description> + <type>facadeview</type> + <id>50</id> + <control> + <description>listcontrol</description> + <type>listcontrol</type> + <id>50</id> + <onleft>2</onleft> + <onright>2</onright> + <onup>2</onup> + <ondown>2</ondown> + </control> + + <control> + <description>Thumbnail Panel</description> + <type>thumbnailpanel</type> + <id>50</id> + <onleft>2</onleft> + <onright>2</onright> + <onup>2</onup> + <ondown>2</ondown> + </control> + + <control> + <description>Filmstrip view</description> + <type>filmstrip</type> + <id>50</id> + <onleft>2</onleft> + <onright>2</onright> + <onup>2</onup> + <ondown>50</ondown> + <posX>25</posX> + <posY>260</posY> + <width>1360</width> + <height>400</height> + <spinWidth>27</spinWidth> + <spinHeight>27</spinHeight> + <spinPosX>1240</spinPosX> + <spinPosY>515</spinPosY> + <spinColor>ffffffff</spinColor> + <textureUp>arrow_round_up_nofocus.png</textureUp> + <textureDown>arrow_round_down_nofocus.png</textureDown> + <textureUpFocus>arrow_round_up_focus.png</textureUpFocus> + <textureDownFocus>arrow_round_down_focus.png</textureDownFocus> + <itemWidth>120</itemWidth> + <itemHeight>100</itemHeight> + <textureWidth>220</textureWidth> + <textureHeight>100</textureHeight> + <thumbWidth>101</thumbWidth> + <thumbHeight>154</thumbHeight> + <thumbPosX>15</thumbPosX><!-- 10 --> + <thumbPosY>1</thumbPosY><!-- 10 --> + <imageFolder>dvd_box.png</imageFolder> + <imageFolderFocus>dvd_box.png</imageFolderFocus> + <keepaspectratio>no</keepaspectratio> + <font>-</font> + <selectedColor>-</selectedColor> + <textcolor>white</textcolor> + <textXOff>-5000</textXOff> + <colordiffuse>ffffffff</colordiffuse> + <remoteColor>ffFFA075</remoteColor> + <downloadColor>ff80ff80</downloadColor> + <suffix>|</suffix> + <textureWidthBig>100</textureWidthBig> + <textureHeightBig>100</textureHeightBig> + <itemWidthBig>100</itemWidthBig> + <itemHeightBig>84</itemHeightBig> + <thumbWidthBig>84</thumbWidthBig> + <thumbHeightBig>100</thumbHeightBig> + <thumbPosXBig>0</thumbPosXBig> + <thumbPosYBig>0</thumbPosYBig> + <background>-</background> + <backgroundx>130</backgroundx> + <backgroundy>130</backgroundy> + <backgroundwidth>320</backgroundwidth> + <backgroundheight>320</backgroundheight> + <backgrounddiffuse>60ffffff</backgrounddiffuse> + <InfoImage>-</InfoImage> + <InfoImagex>920</InfoImagex> + <InfoImagey>130</InfoImagey> + <InfoImagewidth>310</InfoImagewidth> + <InfoImageheight>450</InfoImageheight> + <InfoImagediffuse>ffffffff</InfoImagediffuse> + + + <textureWidth>120</textureWidth> + <textureHeight>159</textureHeight> + + <showFolder>yes</showFolder> + <showBackGround>no</showBackGround> + <showInfoImage>no</showInfoImage> + <enableFocusZoom>no</enableFocusZoom> + + <thumbs flipY="true" diffuse="Thumb_Mask.png"/> + + <InfoImage flipY="true" diffuse="Thumb_Mask.png"/> + <enableFocusZoom>no</enableFocusZoom> + <thumbAnimation effect="zoom" start="100,100" end="130,130" time="200">focus</thumbAnimation> + <thumbAnimation effect="zoom" start="130,130" end="100,100" time="200">unfocus</thumbAnimation> + + + <animation effect="fade" time="500">delay="1300">WindowOpen</animation> + </control> + + </control> + + <control> + <description>Tv Series</description> + + <type>button</type> + <id>584</id> + <animation effect="fade" time="400">WindowClose</animation> + <animation effect="fade" time="400">WindowOpen</animation> + <posY>158</posY> + <posX>639</posX> + <label>TV Series</label> + <hyperlink>9811</hyperlink> + <font>font10</font> + <width>209</width> + <height>36</height> + <onleft>5</onleft> + <onright>6</onright> + <onup>8</onup> + <ondown>50</ondown> + <textureFocus>tab_down.png</textureFocus> + <textureNoFocus>tab_up.png</textureNoFocus> + <visible>Control.HasFocus(8)|Control.HasFocus(584)</visible> + <animation effect="fade" time="250">visiblechange</animation> + <animation effect="slide" end="0,36" time="250">visiblechange</animation> + </control> + <control> + <description>Eject DVD</description> + + <type>button</type> + <id>7</id> + <animation effect="fade" time="400">WindowClose</animation> + <animation effect="fade" time="400">WindowOpen</animation> + <posY>158</posY> + <posX>848</posX> + <label>654</label> + <font>font10</font> + <width>209</width> + <height>36</height> + <onleft>8</onleft> + <onright>20</onright> + <onup>6</onup> + <ondown>50</ondown> + <textureFocus>tab_down.png</textureFocus> + <textureNoFocus>tab_up.png</textureNoFocus> + <visible>Control.HasFocus(6)|Control.HasFocus(7)</visible> + <animation effect="fade" time="250">visiblechange</animation> + <animation effect="slide" end="0,36" time="250">visiblechange</animation> + </control> + <control> + <description>my playlists</description> + + <type>button</type> + <id>9</id> + <animation effect="fade" time="400">WindowClose</animation> + <animation effect="fade" time="400">WindowOpen</animation> + <posY>158</posY> + <posX>1057</posX> + <label>654</label> + <font>font10</font> + <width>209</width> + <height>36</height> + <onleft>9</onleft> + <onright>2</onright> + <onup>20</onup> + <ondown>50</ondown> + <textureFocus>tab_down.png</textureFocus> + <textureNoFocus>tab_up.png</textureNoFocus> + <visible>Control.HasFocus(20)|Control.HasFocus(9)</visible> + <animation effect="fade" time="250">visiblechange</animation> + <animation effect="slide" end="0,36" time="250">visiblechange</animation> + </control> + <control> + <type>imagelist</type> + <animation effect="fade" time="250">WindowOpen</animation> + <animation effect="fade" time="500">WindowClose</animation> + <id>101</id> + <posX>1233</posX> + <posY>1240</posY> + <width>210</width> + <height>42</height> + <textureWidth>21</textureWidth> + <textureHeight>21</textureHeight> + <subitems> + <subitem>greystar.png</subitem> + <subitem>star.png</subitem> + </subitems> + <orientation>horizontal</orientation> + <align>right</align> + <percentage>#rating</percentage> </control> - <import>common.facade.video.xml</import> - </controls> + </controls> </window> \ No newline at end of file Deleted: trunk/skins/Foofaraw/Development Skin/Foofaraw/old recorded tv (REF).xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/old recorded tv (REF).xml 2007-09-03 06:04:05 UTC (rev 885) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/old recorded tv (REF).xml 2007-09-03 13:07:48 UTC (rev 886) @@ -1,229 +0,0 @@ -<control> - <type>group</type> - <description>group element</description> - <id>24</id> - <posX>106</posX> - <posY>124</posY> - <width>264</width> - <height>234</height> - <animation effect="fade" time="500" delay="50">WindowOpen</animation> - <animation effect="slide" time="500" delay="50" start="-600,0" end="0,0" acceleration="-1">WindowOpen</animation> - <animation effect="fade" time="500">WindowClose</animation> - <mpe> - <layout>Grid</layout> - <spring>no</spring> - <spacing>0</spacing> - <padding> - <top>0</top> - <right>0</right> - <bottom>0</bottom> - <left>0</left> - </padding> - </mpe> - <control> - <type>button</type> - <description>View-As button</description> - <id>2</id> - <posX>113</posX> - <posY>129</posY> - <onleft>2</onleft> - <onright>10</onright> - <onup>17</onup> - <ondown>3</ondown> - <label>100</label> - </control> - <control> - <type>sortbutton</type> - <id>3</id> - <posX>113</posX> - <posY>174</posY> - <onleft>2</onleft> - <onright>10</onright> - <onup>2</onup> - <ondown>5</ondown> - <font>font13</font> - <label>620</label> - </control> - <control> - <type>button</type> - <description>All,Genre,Channel button</description> - <id>5</id> - <posX>113</posX> - <posY>220</posY> - <onleft>6</onleft> - <onright>10</onright> - <onup>2</onup> - <ondown>6</ondown> - <label>457</label> - </control> - <control> - <type>button</type> - <description>cleanup button</description> - <id>6</id> - <posX>113</posX> - <posY>265</posY> - <onleft>2</onleft> - <onright>10</onright> - <onup>5</onup> - <ondown>7</ondown> - <label>624</label> - </control> - <control> - <type>button</type> - <description>compress button</description> - <id>7</id> - <posX>113</posX> - <posY>310</posY> - <onleft>2</onleft> - <onright>10</onright> - <onup>6</onup> - <ondown>99</ondown> - <hyperlink>609</hyperlink> - <label>896</label> - </control> - </control> - - <control> - <type>group</type> - <description>group element</description> - <id>0</id> - <posX>485</posX> - <posY>124</posY> - <width>584</width> - <height>622</height> - <animation effect="fade" time="250">WindowOpen</animation> - <animation effect="slide" time="500" start="0,-500" end="0,0" acceleration="-1">WindowOpen</animation> - <animation effect="fade" time="500">WindowClose</animation> - <mpe> - <layout>Grid</layout> - <spring>no</spring> - <spacing>0</spacing> - <padding> - <top>0</top> - <right>0</right> - <bottom>0</bottom> - <left>0</left> - </padding> - </mpe> - - <control> - <type>listcontrol</type> - <description>scheduler recordings listcontrol</description> - <id>10</id> - <posX>453</posX> - <height>600</height> - <width>550</width> - <onleft>2</onleft> - <onright>11</onright> - <onup>2</onup> - <ondown>2</ondown> - <font>font10</font> - <font2>font10</font2> - <font3>font10</font3> - <textXOff>32</textXOff> - <textXOff2>530</textXOff2> - <textXOff3>172</textXOff3> - <textYOff>12</textYOff> - <textYOff2>12</textYOff2> - <textYOff3>48</textYOff3> - <IconXOff>22</IconXOff> - <IconYOff>16</IconYOff> - <textcolor2>ff000000</textcolor2> - <textcolor3>ffccef61</textcolor3> - <itemHeight>50</itemHeight> - <itemWidth>50</itemWidth> - <textureHeight>132</textureHeight> - <keepaspectratio>yes</keepaspectratio> - <spinPosX>885</spinPosX> - <textureFocus>list_sub_focus_big.png</textureFocus> - <textureNoFocus>list_sub_nofocus_big.png</textureNoFocus> - <textureHeight>85</textureHeight> - - </control> - <control> - <type>listcontrol</type> - <description>listcontrol</description> - <id>11</id> - <posX>493</posX> - <onleft>10</onleft> - <onright>2</onright> - <onup>2</onup> - <ondown>2</ondown> - <textureHeight>42</textureHeight> - <textYOff2>5</textYOff2> - </control> - <control> - <type>fadelabel</type> - <description>Current program title</description> - <id>13</id> - <posX>493</posX> - <posY>555</posY> - <width>573</width> - <label>#TV.RecordedTV.Title</label> - <disabledcolor>ff000000</disabledcolor> - <textcolor>00b2d4f5</textcolor> - </control> - <control> - <type>label</type> - <description>Current program time</description> - <id>14</id> - <posX>1233</posX> - <posY>555</posY> - <align>right</align> - <label>#TV.RecordedTV.Time</label> - <textcolor>ffb2d4f5</textcolor> - <visible>false</visible> - </control> - <control> - <type>textboxscrollup</type> - <description>Description1</description> - <id>15</id> - <posX>1033</posX> - <posY>133</posY> - <width>250</width> - <height>515</height> - <colordiffuse>ffffffff</colordiffuse> - <font>font12</font> - <label>#TV.RecordedTV.Description</label> - <textcolor>ffb2d4f5</textcolor> - </control> - <!-- <control> - <type>label</type> - <description>genre</description> - <id>17</id> - <posX>966</posX> - <posY>613</posY> - <label>#TV.RecordedTV.Genre</label> - <align>right</align> - <textcolor>ffb2d4f5</textcolor> - </control> --> - </control> - <!-- <control> - <description>TV background</description> - <type>image</type> - <id>98</id> - <posX>113</posX> - <posY>544</posY> - <width>235</width> - <height>175</height> - <colordiffuse>60ffffff</colordiffuse> - <texture>previewbackground.png</texture> - <animation effect="fade" time="250">WindowOpen</animation> - <animation effect="fade" time="500">WindowClose</animation> - </control> --> - <control> - <type>videowindow</type> - <description>TV preview window</description> - <id>99</id> - <posX>121</posX> - <posY>550</posY> - <width>221</width> - <height>161</height> - <onup>5</onup> - <textureFocus>tv_green_border.png</textureFocus> - <action>18</action> - <animation effect="fade" time="250">WindowOpen</animation> - <animation effect="fade" time="500">WindowClose</animation> - </control> - </controls> -</window> \ No newline at end of file Deleted: trunk/skins/Foofaraw/Development Skin/Foofaraw/old tv (DELETE ME).xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/old tv (DELETE ME).xml 2007-09-03 06:04:05 UTC (rev 885) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/old tv (DELETE ME).xml 2007-09-03 13:07:48 UTC (rev 886) @@ -1,402 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<window> - <id>1</id> - <defaultcontrol>11</defaultcontrol> - <allowoverlay>no</allowoverlay> - - <define>#header.label:605</define> - <controls> - - - <import>common.window.xml</import> - <import>common.time.xml</import> - <control> - <description>icon background</description> - <type>image</type> - <id>1</id> - <posX>0</posX> - <posY>0</posY> - <width>377</width> - <height>133</height> - <texture>Logo_background.png</texture> - <animation effect="fade" time="500" delay="1000">WindowOpen</animation> - <animation effect="fade" time="500">WindowClose</animation> - </control> - - <control> - <type>group</type> - <layout>StackLayout</layout> - <description>group element</description> - <animation effect="fade" time="250">WindowOpen</animation> - <animation effect="fade" time="1000">WindowClose</animation> - <animation effect="fade" time="500" delay="2000" condition="Player.HasMedia">unfocus</animation> - <posX>50</posX> - <posY>130</posY> - <control> - <description>Recordings</description> - <type>button</type> - <id>11</id> - <label>604</label> - <hyperlink>603</hyperlink> - <onup>13</onup> - <ondown>2</ondown> - <onright>99</onright> - <onleft>99</onleft> - </control> - - - <control> - <description>TVGuide</description> - <type>button</type> - <id>2</id> - <label>600</label> - <hyperlink>600</hyperlink> - <onup>11</onup> - <ondown>12</ondown> - <onright>99</onright> - <onleft>99</onleft> - </control> - <control> - <description>Search</description> - <type>button</type> - <id>12</id> - <label>137</label> - <hyperlink>604</hyperlink> - <onup>2</onup> - <ondown>3</ondown> - <onright>99</onright> - <onleft>99</onleft> - </control> - <control> - <description>Record Now</description> - <type>button</type> - <id>3</id> - <label>601</label> - <onup>12</onup> - <ondown>6</ondown> - <onright>99</onright> - <onleft>99</onleft> - </control> - <control> - <description>Group button</description> - <type>button</type> - <id>6</id> - <label>971</label> - <onup>3</onup> - <ondown>7</ondown> - <onright>99</onright> - <onleft>99</onleft> - </control> - <control> - <description>Channel button</description> - <type>button</type> - <id>7</id> - <label>602</label> - <onup>6</onup> - <ondown>8</ondown> - <onright>99</onright> - <onleft>99</onleft> - </control> - <control> - <description>TV On/Off button</description> - <type>togglebutton</type> - <id>8</id> - <font>font13</font> - <textcolor>White</textcolor> - <colordiffuse>White</colordiffuse> - <disabledcolor>#60ffffff</disabledcolor> - <label>707</label> - <onup>7</onup> - <ondown>9</ondown> - <onright>99</onright> - <onleft>99</onleft> - </control> - <control> - <description>Timeshifting On/Off button</description> - <type>togglebutton</type> - <id>9</id> - <font>font13</font> - <textcolor>White</textcolor> - <colordiffuse>White</colordiffuse> - <label>708</label> - <onup>8</onup> - <ondown>10</ondown> - <onright>99</onright> - <onleft>99</onleft> - </control> - <control> - <description>Scheduler</description> - <type>button</type> - <id>10</id> - <label>603</label> - <hyperlink>601</hyperlink> - <onup>9</onup> - <ondown>13</ondown> - <onright>99</onright> - <onleft>99</onleft> - </control> - - <control> - <description>Teletext</description> - <type>button</type> - <id>13</id> - <label>1441</label> - <onup>10</onup> - <ondown>11</ondown> - <onright>99</onright> - <onleft>99</onleft> - </control> - </control> - - <control> - <description>video window</description> - <visible>player.hasmedia</visible> - <type>videowindow</type> - <id>99</id> - <posX>300</posX> - <posY>100</posY> - <width>800</width> - <height>450</height> - <onleft>11</onleft> - <onright>11</onright> - <action>18</action> - <textureFocus>tv_green_border.png</textureFocus> - <animation effect="fade" time="500">WindowOpen</animation> - <animation effect="fade" time="500">WindowClose</animation> - - - - - </control> - - - - - <control> - <description>Current program title</description> - <type>fadelabel</type> - <id>13</id> - <posX>330</posX> - <posY>550</posY> - <width>200</width> - <label>#TV.View.title</label> - <font>font13</font> - <textcolor>White</textcolor> - <animation effect="fade" time="250">WindowOpen</animation> - <animation effect="fade" time="500">WindowClose</animation> - </control> - - <control> - <description>Current program time</description> - <type>label</type> - <id>13</id> - <posX>700</posX> - <posY>550</posY> - <label>#TV.View.start - #TV.View.stop</label> - <font>font13</font> - <align>left</align> - <textcolor>FFFFFFFF</textcolor> - <animation effect="fade" time="250">WindowOpen</animation> - <animation effect="fade" time="500">WindowClose</animation> - </control> - <control> - <description>Current Channelname</description> - <type>fadelabel</type> - <id>13</id> - <posX>190</posX> - <posY>550</posY> - <width>200</width> - <label>#TV.View.channel</label> - <font>font13</font> - <align>Left</align> - <textcolor>FFFFFFFF</textcolor> - <animation effect="fade" time="250">WindowOpen</animation> - <animation effect="fade" time="500">WindowClose</animation> - </control> - <control> - <description>Description1</description> - <type>textboxscrollup</type> - <id>15</id> - <posX>330</posX> - <posY>580</posY> - <width>510</width> - <height>120</height> - <seperator>----------------------------------------------------------------------------------------------</seperator> - <label>#TV.View.description</label> - <font>font12</font> - <textcolor>White</textcolor> - <animation effect="fade" time="250">WindowOpen</animation> - <animation effect="fade" time="500">WindowClose</animation> - </control> - <control> - <description>Progress background</description> - <type>image</type> - <id>1</id> - <posX>50</posX> - <posY>700</posY> - <width>546</width> - <texture>osd_progress_background.png</texture> - <animation effect="fade" time="250">WindowOpen</animation> - <animation effect="fade" time="500">WindowClose</animation> - </control> - <control> - <description>progress bar</description> - <type>progress</type> - <id>20</id> - <posX>43</posX> - <posY>705</posY> - <width>544</width> - <label>#TV.View.Percentage</label> - <visible>yes</visible> - <animation effect="fade" time="250">WindowOpen</animation> - <animation effect="fade" time="500">WindowClose</animation> - </control> - <control> - <description>progress bar shine</description> - - <type>image</type> - <id>1</id> - <posX>55</posX> - <posY>705</posY> - <width>538</width> - <height>25</height> - <texture>osd_progress_shine.png</texture> - <animation effect="fade" time="250">WindowOpen</animation> - <animation effect="fade" time="500">WindowClose</animation> - </control> - <control> - <description>rectangle</description> - <type>image</type> - <id>21</id> - <posX>161</posX> - <posY>560</posY> - <width>120</width> - <height>120</height> - <texture>tv_background.png</texture> - <colordiffuse>White</colordiffuse> - <animation effect="fade" time="250">WindowOpen</animation> - <animation effect="fade" time="500">WindowClose</animation> - </control> - <control> - <description>Recording Channel</description> - <type>image</type> - <id>22</id> - <posX>170</posX> - <posY>566</posY> - <width>106</width> - <height>106</height> - <texture>#TV.Record.thumb</texture> - <animation effect="fade" time="250">WindowOpen</animation> - <animation effect="fade" time="500">WindowClose</animation> - </control> - <control> - <description>record info label</description> - <type>fadelabel</type> - <id>23</id> - <width>200</width> - <height>40</height> - <posX>161</posX> - <label>#TV.Record.channel\r#TV.Record.title\r#TV.Record.start-#TV.Record.stop</label> - <font>font13</font> - <textcolor>White</textcolor> - <animation effect="fade" time="250">WindowOpen</animation> - <animation effect="fade" time="500">WindowClose</animation> - </control> - <control> - <description>record pin</description> - <type>image</type> - <id>24</id> - <posX>493</posX> - <posY>566</posY> - <texture>tvguide_record_button.png</texture> - <visible>no</visible> - <animation effect="fade" time="250">WindowOpen</animation> - <animation effect="fade" time="500">WindowClose</animation> - </control> - - <control> - <description>On Next</description> - <visable>player.hasvideo</visable> - <type>fadelabel</type> - <id>13</id> - <posX>900</posX> - <posY>550</posY> - <width>600</width> - <label>On Next</label> - <font>font13</font> - <align>Left</align> - <textcolor>FFFFFFFF</textcolor> - <animation effect="fade" time="250">WindowOpen</animation> - <animation effect="fade" time="500">WindowClose</animation> - </control> - - <control> - <description>On Next Program Title</description> - <visable>player.hasvideo</visable> - <type>fadelabel</type> - <id>13</id> - <posX>900</posX> - <posY>580</posY> - <width>400</width> - <label>#TV.Next.title</label> - <font>font13</font> - <align>Left</align> - <textcolor>FFFFFFFF</textcolor> - <animation effect="fade" time="250">WindowOpen</animation> - <animation effect="fade" time="500">WindowClose</animation> - </control> - - <control> - <description>On Now Channel Logo</description> - <visable>player.hasvideo</visable> - <type>image</type> - <id>22</id> - <posX>50</posX> - <posY>545</posY> - <width>115</width> - <height>115</height> - <texture>#TV.View.thumb</texture> - <animation effect="fade" time="250">WindowOpen</animation> - <animation effect="fade" time="500">WindowClose</animation> - </control> - <control> - <type>image</type> - <description>Television top left text logo</description> - <id>1</id> - <posX>90</posX> - <posY>23</posY> - <texture>television_logo.png</texture> - <animation effect="fade" time="500" delay="1300">WindowOpen</animation> - <animation effect="fade" time="500">WindowClose</animation> - </control> - - <control> - <type>image</type> - <id>1</id> - <posX>15</posX> - <posY>0</posY> - <width>61</width> - <height>122</height> - <texture>hover_my tv.png</texture> - <animation effect="fade" time="1000" delay="2000">WindowOpen</animation> - <animation effect="fade" time="500">WindowClose</animation> - </control> - <control> - <type>label</type> - <description>My TV Label</description> - <id>1</id> - <posX>251</posX> - <posY>68</posY> - <label>605</label> - <font>wipeouts</font> - <align>center</align> - <textcolor>ffffffff</textcolor> - <animation effect="fade" time="1000" end="60" delay="2000">WindowOpen</animation> - <animation effect="slide" time="1000" delay="2000" start="-600,0" end="0,0" acceleration="-1">WindowOpen</animation> - <animation effect="fade" time="500" start="50">WindowClose</animation> - </control> - - - </controls> - -</window> \ No newline at end of file Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/release notes.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/release notes.xml 2007-09-03 06:04:05 UTC (rev 885) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/release notes.xml 2007-09-03 13:07:48 UTC (rev 886) @@ -11,5 +11,7 @@ updated tv guide Updated radio guide.. added cd_box.png for music film strip -Updated my videos.. (not complete film strip view +Updated my videos layout +added dvd-box +updated default dvd-big \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-09-02 17:15:29
|
Revision: 884 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=884&view=rev Author: and-81 Date: 2007-09-02 10:15:27 -0700 (Sun, 02 Sep 2007) Log Message: ----------- Added Paths: ----------- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrDecoder.cs Added: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrDecoder.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrDecoder.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrDecoder.cs 2007-09-02 17:15:27 UTC (rev 884) @@ -0,0 +1,1353 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace MicrosoftMceTransceiver +{ + + #region Enumerations + + /// <summary> + /// Protocol of IR Code. + /// </summary> + public enum IRProtocol + { + None, + //ITT, + JVC, + NEC, + //NRC17, + RC5, + RC6, + RCA, + //RCMM, + RECS80, + //Sharp, + SIRC, + //XSAT, + } + + #endregion Enumerations + + #region Delegates + + public delegate void RemoteCallback(IRProtocol codeType, uint keyCode); + public delegate void KeyboardCallback(uint keyCode, uint modifiers); + public delegate void MouseCallback(int deltaX, int deltaY, bool rightButton, bool leftButton); + + #endregion Delegates + + /// <summary> + /// Used for decoding received IR codes. + /// </summary> + public static class IrDecoder + { + + #region Constants + + //public const uint PulseBit = 0x01000000; + //public const uint PulseMask = 0x00FFFFFF; + + //const UInt16 ToggleBitMce = 0x8000; + const UInt16 ToggleMaskMce = 0x7FFF; + const UInt16 CustomerMce = 0x800F; + + const UInt16 ToggleMaskRC5 = 0xF7FF; + const UInt16 ToggleMaskRC5X = 0xFFFF; + + const uint PrefixRC6 = 0x000FC950; + const uint PrefixRC6A = 0x000FCA90; + + const uint MceMouse = 1; + const uint MceKeyboard = 4; + + #endregion Constants + + #region Detection Data + + static RemoteDetectionData JVC_Data = null; + static RemoteDetectionData NEC_Data = null; + static RemoteDetectionData RC5_Data = null; + static RemoteDetectionData RC6_Data = null; + static RemoteDetectionData RCA_Data = null; + static RemoteDetectionData RECS80_Data = null; + static RemoteDetectionData SIRC_Data = null; + + static MceDetectionData MCE_Data = null; + + #endregion Detection Data + + #region Methods + + /// <summary> + /// Decode timing data to discover IR Protocol and button code. + /// </summary> + /// <param name="timingData">Input timing data.</param> + /// <param name="remoteCallback">Method to call when Remote button decoded.</param> + /// <param name="keyboardCallback">Method to call when Keyboard event decoded.</param> + /// <param name="mouseCallback">Method to call when Mouse event decoded.</param> + public static void DecodeIR(int[] timingData, RemoteCallback remoteCallback, KeyboardCallback keyboardCallback, MouseCallback mouseCallback) + { +// DetectITT(timingData, remoteCallback); + DetectJVC(timingData, remoteCallback); + DetectNEC(timingData, remoteCallback); +// DetectNRC17(timingData, remoteCallback); + DetectRC5(timingData, remoteCallback); + DetectRC6(timingData, remoteCallback); + DetectRCA(timingData, remoteCallback); +// DetectRCMM(timingData, remoteCallback); + DetectRECS80(timingData, remoteCallback); +// DetectSharp(timingData, remoteCallback); + DetectSIRC(timingData, remoteCallback); // 15 Bit +// DetectXSAT(timingData, remoteCallback); + + DetectMCE(timingData, keyboardCallback, mouseCallback); + } + + static void DetectJVC(int[] timingData, RemoteCallback remoteCallback) + { + if (JVC_Data == null || timingData == null) + JVC_Data = new RemoteDetectionData(); + + if (timingData == null) + return; + + for (int i = 0; i < timingData.Length; i++) + { + int duration = Math.Abs(timingData[i]); + bool pulse = (timingData[i] > 0); + bool ignored = true; + + switch (JVC_Data.State) + { + + #region HeaderPulse + case RemoteDetectionState.HeaderPulse: + //Console.WriteLine("JVC HeaderPulse"); + + if (pulse && duration >= 8200 && duration <= 8600) + { + JVC_Data.State = RemoteDetectionState.HeaderSpace; + ignored = false; + } + break; + #endregion HeaderPulse + + #region HeaderSpace + case RemoteDetectionState.HeaderSpace: + //Console.WriteLine("JVC HeaderSpace"); + + if (!pulse && duration >= 4000 && duration <= 4400) + { + JVC_Data.State = RemoteDetectionState.Data; + JVC_Data.HalfBit = 0; + JVC_Data.Bit = 0; + JVC_Data.Code = 0; + ignored = false; + } + break; + #endregion HeaderSpace + + #region Data + case RemoteDetectionState.Data: + //Console.WriteLine("JVC Data"); + + if (pulse && duration >= 350 && duration <= 750) + { + JVC_Data.HalfBit = 1; + ignored = false; + } + else if (!pulse && duration >= 250 && duration <= 650 && JVC_Data.HalfBit == 1) + { + JVC_Data.Code <<= 1; + JVC_Data.Bit++; + JVC_Data.HalfBit = 0; + ignored = false; + } + else if (!pulse && duration >= 1450 && duration <= 1850 && JVC_Data.HalfBit == 1) + { + JVC_Data.Code <<= 1; + JVC_Data.Code |= 1; + JVC_Data.Bit++; + JVC_Data.HalfBit = 0; + ignored = false; + } + else + { + //Console.WriteLine("JVC Error"); + } + + if (JVC_Data.Bit == 16) + { + remoteCallback(IRProtocol.JVC, JVC_Data.Code); + JVC_Data.State = RemoteDetectionState.Leading; + } + break; + #endregion Data + + #region Leading + case RemoteDetectionState.Leading: + //Console.WriteLine("JVC Leading"); + + if (pulse && duration >= 350 && duration <= 750) + { + JVC_Data = new RemoteDetectionData(); + JVC_Data.State = RemoteDetectionState.Data; + ignored = false; + } + break; + #endregion Leading + + } + + if (ignored && (JVC_Data.State != RemoteDetectionState.HeaderPulse)) + JVC_Data = new RemoteDetectionData(); + } + } + static void DetectNEC(int[] timingData, RemoteCallback remoteCallback) + { + if (NEC_Data == null || timingData == null) + NEC_Data = new RemoteDetectionData(); + + if (timingData == null) + return; + + for (int i = 0; i < timingData.Length; i++) + { + int duration = Math.Abs(timingData[i]); + bool pulse = (timingData[i] > 0); + bool ignored = true; + + switch (NEC_Data.State) + { + + #region HeaderPulse + case RemoteDetectionState.HeaderPulse: + //Console.WriteLine("NEC HeaderPulse"); + + if (pulse && duration >= 8800 && duration <= 9200) + { + NEC_Data.State = RemoteDetectionState.HeaderSpace; + ignored = false; + } + break; + #endregion HeaderPulse + + #region HeaderSpace + case RemoteDetectionState.HeaderSpace: + //Console.WriteLine("NEC HeaderSpace"); + + if (!pulse && duration >= 4300 && duration <= 4700) + { + NEC_Data.State = RemoteDetectionState.Data; + NEC_Data.HalfBit = 0; + NEC_Data.Bit = 0; + NEC_Data.Code = 0; + ignored = false; + } + else if (!pulse && duration >= 2050 && duration <= 2450) // For Repeats + { + remoteCallback(IRProtocol.NEC, NEC_Data.Code); + NEC_Data.State = RemoteDetectionState.HeaderPulse; + ignored = false; + } + + break; + #endregion HeaderSpace + + #region Data + case RemoteDetectionState.Data: + //Console.WriteLine("NEC Data"); + + if (pulse && duration >= 350 && duration <= 750) + { + NEC_Data.HalfBit = 1; + ignored = false; + } + else if (!pulse && duration >= 250 && duration <= 650 && NEC_Data.HalfBit == 1) + { + NEC_Data.Code <<= 1; + NEC_Data.Bit++; + NEC_Data.HalfBit = 0; + ignored = false; + } + else if (!pulse && duration >= 1550 && duration <= 1950 && NEC_Data.HalfBit == 1) + { + NEC_Data.Code <<= 1; + NEC_Data.Code |= 1; + NEC_Data.Bit++; + NEC_Data.HalfBit = 0; + ignored = false; + } + else + { + //Console.WriteLine("NEC Error"); + } + + if (NEC_Data.Bit == 32) + { + remoteCallback(IRProtocol.NEC, NEC_Data.Code); + NEC_Data.State = RemoteDetectionState.HeaderPulse; + } + break; + #endregion Data + + } + + if (ignored && (NEC_Data.State != RemoteDetectionState.HeaderPulse)) + NEC_Data = new RemoteDetectionData(); + } + } + static void DetectRC5(int[] timingData, RemoteCallback remoteCallback) + { + if (RC5_Data == null || timingData == null) + RC5_Data = new RemoteDetectionData(); + + if (timingData == null) + return; + + for (int i = 0; i < timingData.Length; i++) + { + int duration = Math.Abs(timingData[i]); + bool pulse = (timingData[i] > 0); + bool ignored = true; + + switch (RC5_Data.State) + { + + #region HeaderPulse + case RemoteDetectionState.HeaderPulse: + //Console.WriteLine("RC5 HeaderPulse"); + + if (pulse) + { + if ((duration >= 750) && (duration <= 1100)) + { + RC5_Data.State = RemoteDetectionState.HeaderSpace; + RC5_Data.Bit = 13; + RC5_Data.Code = (uint)1 << RC5_Data.Bit; + ignored = false; + } + else if ((duration >= 1500) && (duration <= 2000)) + { + RC5_Data.State = RemoteDetectionState.Data; + RC5_Data.Bit = 13; + RC5_Data.Code = (uint)1 << RC5_Data.Bit; + RC5_Data.HalfBit = 0; + ignored = false; + } + } + break; + #endregion HeaderPulse + + #region HeaderSpace + case RemoteDetectionState.HeaderSpace: + //Console.WriteLine("RC5 HeaderSpace"); + + if (!pulse && (duration >= 750) && (duration <= 1000)) + { + RC5_Data.State = RemoteDetectionState.Data; + RC5_Data.HalfBit = 0; + ignored = false; + } + break; + #endregion HeaderSpace + + #region Data + case RemoteDetectionState.Data: + //Console.WriteLine("RC5 Data"); + + if (RC5_Data.HalfBit == 0) + { + if (pulse) + { + if (((duration >= 750) && (duration <= 1100)) || ((duration >= 1500) && (duration <= 2000))) + { + RC5_Data.HalfBit = (byte)((duration >= 1500) ? 0 : 1); + RC5_Data.Bit--; + RC5_Data.Code |= (uint)1 << RC5_Data.Bit; + ignored = false; + + if ((RC5_Data.Bit == 0) || ((RC5_Data.Bit == 1) && (duration >= 1500))) + RC5_Data.State = RemoteDetectionState.KeyCode; + } + else + { + //Console.WriteLine("RC5 Error {0} on bit {1}", duration, bit); + } + } + else + { + if (((duration >= 750) && (duration <= 1100)) || ((duration >= 1500) && (duration <= 2000))) + { + RC5_Data.HalfBit = (byte)((duration >= 1500) ? 0 : 1); + RC5_Data.Bit--; + ignored = false; + + if (RC5_Data.Bit == 0) + RC5_Data.State = RemoteDetectionState.KeyCode; + } + else if ((RC5_Data.Bit == 7) && (((duration >= 4300) && (duration <= 4700)) || ((duration >= 5200) && (duration <= 5600)))) + { + ignored = false; + RC5_Data.HalfBit = (byte)((duration >= 5200) ? 0 : 1); + RC5_Data.Code <<= 6; + RC5_Data.Bit += 5; + } + else + { + //Console.WriteLine("RC5 Space Error {0} on bit {1}", duration, bit); + } + } + break; + } + + if ((duration >= 750) && (duration <= 1100)) + { + RC5_Data.HalfBit = 0; + ignored = false; + + if ((RC5_Data.Bit == 1) && pulse) + RC5_Data.State = RemoteDetectionState.KeyCode; + } + else if ((RC5_Data.Bit == 7) && (((duration >= 3400) && (duration <= 3800)) || ((duration >= 4300) && (duration <= 4700)))) + { + RC5_Data.HalfBit = (byte)((duration >= 4300) ? 0 : 1); + RC5_Data.Code <<= 6; + RC5_Data.Bit += 6; + ignored = false; + } + else + { + //Console.WriteLine("RC5 Duration Error {0} on bit {1}", duration, bit); + } + break; + #endregion Data + + #region Leading + case RemoteDetectionState.Leading: + //Console.WriteLine("RC5 Leading"); + + if (pulse) + break; + + if (duration > 10000) + { + RC5_Data.State = RemoteDetectionState.HeaderPulse; + ignored = false; + } + break; + #endregion Leading + + } + + if (RC5_Data.State == RemoteDetectionState.KeyCode) + { + if (RC5_Data.Code > 0xFFFF) + RC5_Data.Code &= ToggleMaskRC5X; + else + RC5_Data.Code &= ToggleMaskRC5; + + remoteCallback(IRProtocol.RC5, RC5_Data.Code); + + RC5_Data.State = RemoteDetectionState.HeaderPulse; + } + + if (ignored && (RC5_Data.State != RemoteDetectionState.Leading) && (RC5_Data.State != RemoteDetectionState.HeaderPulse)) + RC5_Data.State = RemoteDetectionState.HeaderPulse; + } + + } + static void DetectRC6(int[] timingData, RemoteCallback remoteCallback) + { + if (RC6_Data == null || timingData == null) + RC6_Data = new RemoteDetectionData(); + + if (timingData == null) + return; + + for (int i = 0; i < timingData.Length; i++) + { + int duration = Math.Abs(timingData[i]); + bool pulse = (timingData[i] > 0); + bool ignored = true; + + switch (RC6_Data.State) + { + + #region HeaderPulse + case RemoteDetectionState.HeaderPulse: + //Console.WriteLine("RC6 HeaderPulse"); + + if (pulse && (duration >= 2600) && (duration <= 3300)) + { + RC6_Data.State = RemoteDetectionState.HeaderSpace; + RC6_Data.Header = 0x000FC000; + RC6_Data.Bit = 14; + RC6_Data.HalfBit = 0; + RC6_Data.Code = 0; + RC6_Data.LongPulse = false; + RC6_Data.LongSpace = false; + ignored = false; + } + break; + #endregion HeaderPulse + + #region HeaderSpace + case RemoteDetectionState.HeaderSpace: + //Console.WriteLine("RC6 HeaderSpace"); + + if (!pulse && (duration >= 750) && (duration <= 1000)) + { + RC6_Data.State = RemoteDetectionState.PreData; + RC6_Data.Bit -= 2; + ignored = false; + } + break; + #endregion HeaderSpace + + #region PreData + case RemoteDetectionState.PreData: + //Console.WriteLine("RC6 PreData"); + + if (pulse) + { + if ((duration >= 350) && (duration <= 600)) + { + ignored = false; + if (RC6_Data.Bit != 0) RC6_Data.Header |= (uint)(1 << --RC6_Data.Bit); + } + else if ((duration >= 750) && (duration <= 1000)) + { + ignored = false; + if (RC6_Data.Bit != 0) RC6_Data.Header |= (uint)(1 << --RC6_Data.Bit); + if (RC6_Data.Bit != 0) RC6_Data.Header |= (uint)(1 << --RC6_Data.Bit); + } + else if ((duration >= 1200) && (duration <= 1600)) + { + ignored = false; + if (RC6_Data.Bit != 0) RC6_Data.Header |= (uint)(1 << --RC6_Data.Bit); + if (RC6_Data.Bit != 0) RC6_Data.Header |= (uint)(1 << --RC6_Data.Bit); + if (RC6_Data.Bit != 0) RC6_Data.Header |= (uint)(1 << --RC6_Data.Bit); + else + { + RC6_Data.HalfBit = 1; + RC6_Data.LongPulse = true; + } + } + else + { + //Console.WriteLine(string.Format("RC6 Error Bit {0} {1} {2}", bit, pulse ? "Pulse" : "Space", duration)); + } + } + else + { + if ((duration >= 300) && (duration <= 600)) + { + RC6_Data.Bit--; + ignored = false; + } + else if ((duration >= 750) && (duration <= 1000)) + { + ignored = false; + if (RC6_Data.Bit > 2) + RC6_Data.Bit -= 2; + else + RC6_Data.Bit = 0; + } + else if ((duration >= 1200) && (duration <= 1600)) + { + ignored = false; + if (RC6_Data.Bit >= 3) + { + RC6_Data.Bit -= 3; + } + else + { + RC6_Data.HalfBit = 1; + RC6_Data.LongPulse = true; + RC6_Data.Bit = 0; + } + } + else + { + //Console.WriteLine(string.Format("RC6 Error Bit {0} {1} {2}", bit, pulse ? "Pulse" : "Space", duration)); + } + } + + if ((ignored == false) && (RC6_Data.Bit == 0)) + { + if ((RC6_Data.Header & 0xFFFFFFF0) == PrefixRC6) + { + RC6_Data.Bit = 16; + } + else if ((RC6_Data.Header & 0xFFFFFFF0) == PrefixRC6A) + { + RC6_Data.Bit = 32; + } + else + { + ignored = true; + break; + } + + RC6_Data.State = RemoteDetectionState.Data; + } + break; + #endregion PreData + + #region Data + case RemoteDetectionState.Data: + //Console.WriteLine("RC6 Data"); + + if ((RC6_Data.HalfBit % 2) == 0) + { + if (pulse && (duration >= 350) && (duration <= 600)) + { + ignored = false; + RC6_Data.LongPulse = true; + RC6_Data.HalfBit++; + + if (RC6_Data.Bit == 1) + RC6_Data.State = RemoteDetectionState.KeyCode; + } + else if (!pulse && (duration >= 300) && (duration <= 600)) + { + ignored = false; + RC6_Data.LongSpace = true; + RC6_Data.HalfBit++; + } + else + { + //Console.WriteLine(string.Format("RC6 Error Halfbit0 {0} {1}", pulse ? "Pulse" : "Space", duration)); + } + break; + } + + if (RC6_Data.LongPulse) + { + RC6_Data.LongPulse = false; + if (pulse) + { + //Console.WriteLine(string.Format("RC6 Error Pulse after LongPulse {0} {1}", pulse ? "Pulse" : "Space", duration)); + break; + } + + if ((duration >= 750) && (duration <= 1000)) + { + RC6_Data.Bit--; + RC6_Data.LongSpace = true; + RC6_Data.HalfBit += 2; + ignored = false; + } + else if ((duration >= 300) && (duration <= 600)) + { + RC6_Data.Bit--; + RC6_Data.HalfBit++; + ignored = false; + } + else + { + //Console.WriteLine(string.Format("RC6 Error Pulse LongPulse {0} {1}", pulse ? "Pulse" : "Space", duration)); + } + } + else if (RC6_Data.LongSpace) + { + RC6_Data.LongSpace = false; + + if (!pulse) + { + //Console.WriteLine(string.Format("RC6 Error Pulse after LongPulse {0} {1}", pulse ? "Pulse" : "Space", duration)); + break; + } + + if (RC6_Data.Bit == 32) + RC6_Data.Bit = 24; + + if ((duration >= 750) && (duration <= 1000)) + { + RC6_Data.Bit--; + RC6_Data.Code |= (uint)1 << RC6_Data.Bit; + RC6_Data.LongPulse = true; + RC6_Data.HalfBit += 2; + ignored = false; + + if (RC6_Data.Bit == 1) + RC6_Data.State = RemoteDetectionState.KeyCode; + } + else if ((duration >= 350) && (duration <= 600)) + { + RC6_Data.Bit--; + RC6_Data.Code |= (uint)1 << RC6_Data.Bit; + RC6_Data.HalfBit++; + ignored = false; + + if (RC6_Data.Bit == 0) + RC6_Data.State = RemoteDetectionState.KeyCode; + } + else + { + //Console.WriteLine(string.Format("RC6 Error LongPulse {0} {1}", pulse ? "Pulse" : "Space", duration)); + } + } + break; + #endregion Data + + } + + if (RC6_Data.State == RemoteDetectionState.KeyCode) + { + if ((~RC6_Data.Code >> 16) == CustomerMce) + RC6_Data.Code &= ToggleMaskMce; + + remoteCallback(IRProtocol.RC6, RC6_Data.Code); + + RC6_Data.State = RemoteDetectionState.HeaderPulse; + } + + if (ignored && (RC6_Data.State != RemoteDetectionState.HeaderPulse)) + RC6_Data.State = RemoteDetectionState.HeaderPulse; + } + + } + static void DetectRCA(int[] timingData, RemoteCallback remoteCallback) + { + if (RCA_Data == null || timingData == null) + RCA_Data = new RemoteDetectionData(); + + if (timingData == null) + return; + + for (int i = 0; i < timingData.Length; i++) + { + int duration = Math.Abs(timingData[i]); + bool pulse = (timingData[i] > 0); + bool ignored = true; + + switch (RCA_Data.State) + { + + #region HeaderPulse + case RemoteDetectionState.HeaderPulse: + //Console.WriteLine("RCA HeaderPulse"); + + if (pulse && duration >= 3800 && duration <= 4200) + { + RCA_Data.State = RemoteDetectionState.HeaderSpace; + ignored = false; + } + break; + #endregion HeaderPulse + + #region HeaderSpace + case RemoteDetectionState.HeaderSpace: + //Console.WriteLine("RCA HeaderSpace"); + + if (!pulse && duration >= 3800 && duration <= 4200) + { + RCA_Data.State = RemoteDetectionState.Data; + RCA_Data.HalfBit = 0; + RCA_Data.Bit = 0; + RCA_Data.Code = 0; + ignored = false; + } + break; + #endregion HeaderSpace + + #region Data + case RemoteDetectionState.Data: + //Console.WriteLine("RCA Data"); + + if (pulse && duration >= 300 && duration <= 700) + { + RCA_Data.HalfBit = 1; + ignored = false; + } + else if (!pulse && duration >= 800 && duration <= 1250 && RCA_Data.HalfBit == 1) + { + RCA_Data.Code <<= 1; + RCA_Data.Bit++; + RCA_Data.HalfBit = 0; + ignored = false; + } + else if (!pulse && duration >= 1800 && duration <= 2200 && RCA_Data.HalfBit == 1) + { + RCA_Data.Code <<= 1; + RCA_Data.Code |= 1; + RCA_Data.Bit++; + RCA_Data.HalfBit = 0; + ignored = false; + } + else + { + //Console.WriteLine("RCA Error"); + } + + if (RCA_Data.Bit == 12) + { + remoteCallback(IRProtocol.RCA, RCA_Data.Code); + RCA_Data.State = RemoteDetectionState.HeaderPulse; + } + break; + #endregion Data + + } + + if (ignored && (RCA_Data.State != RemoteDetectionState.HeaderPulse)) + RCA_Data.State = RemoteDetectionState.HeaderPulse; + } + } + static void DetectRECS80(int[] timingData, RemoteCallback remoteCallback) + { + if (RECS80_Data == null || timingData == null) + RECS80_Data = new RemoteDetectionData(); + + if (timingData == null) + return; + + for (int i = 0; i < timingData.Length; i++) + { + int duration = Math.Abs(timingData[i]); + bool pulse = (timingData[i] > 0); + bool ignored = true; + + switch (RECS80_Data.State) + { + + #region HeaderPulse + case RemoteDetectionState.HeaderPulse: + //Console.WriteLine("RECS80 HeaderPulse"); + + if (pulse && (duration >= 3300) && (duration <= 4100)) + { + RECS80_Data.State = RemoteDetectionState.HeaderSpace; + ignored = false; + } + break; + #endregion HeaderPulse + + #region HeaderSpace + case RemoteDetectionState.HeaderSpace: + //Console.WriteLine("RECS80 HeaderSpace"); + + if (!pulse && (duration >= 1400) && (duration <= 1800)) + { + RECS80_Data.State = RemoteDetectionState.Data; + RECS80_Data.HalfBit = 0; + RECS80_Data.Bit = 48; + RECS80_Data.Header = 0; + RECS80_Data.Code = 0; + ignored = false; + } + break; + #endregion HeaderSpace + + #region Data + case RemoteDetectionState.Data: + //Console.WriteLine("RECS80 Data"); + + if ((RECS80_Data.HalfBit % 2) == 0) + { + if (!pulse) + break; + + if ((duration >= 350) && (duration <= 600)) + { + RECS80_Data.HalfBit = 1; + RECS80_Data.Bit--; + ignored = false; + } + break; + } + else + { + if (pulse) + break; + + if ((duration >= 400) && (duration <= 750)) + { + RECS80_Data.HalfBit = 0; + ignored = false; + } + else if ((duration >= 1100) && (duration <= 1500)) + { + RECS80_Data.HalfBit = 0; + if (RECS80_Data.Bit > 15) + RECS80_Data.Header |= (uint)(1 << (RECS80_Data.Bit - 16)); + else + RECS80_Data.Code |= (uint)(1 << RECS80_Data.Bit); + ignored = false; + } + else + { + break; + } + + if (RECS80_Data.Bit == 0) + { + RECS80_Data.Code &= 0x0000FFFF; + remoteCallback(IRProtocol.RECS80, RECS80_Data.Code); + + RECS80_Data.State = RemoteDetectionState.HeaderPulse; + } + } + break; + #endregion Data + + } + + if (ignored && (RECS80_Data.State != RemoteDetectionState.HeaderPulse)) + RECS80_Data.State = RemoteDetectionState.HeaderPulse; + } + } + static void DetectSIRC(int[] timingData, RemoteCallback remoteCallback) + { + if (SIRC_Data == null || timingData == null) + SIRC_Data = new RemoteDetectionData(); + + if (timingData == null) + return; + + for (int i = 0; i < timingData.Length; i++) + { + int duration = Math.Abs(timingData[i]); + bool pulse = (timingData[i] > 0); + bool ignored = true; + + switch (SIRC_Data.State) + { + + #region HeaderPulse + case RemoteDetectionState.HeaderPulse: + //Console.WriteLine("SIRC HeaderPulse"); + + if (pulse && duration >= 2200 && duration <= 2600) + { + SIRC_Data.State = RemoteDetectionState.HeaderSpace; + ignored = false; + } + break; + #endregion HeaderPulse + + #region HeaderSpace + case RemoteDetectionState.HeaderSpace: + //Console.WriteLine("SIRC HeaderSpace"); + + if (!pulse && duration >= 400 && duration <= 800) + { + SIRC_Data.State = RemoteDetectionState.Data; + SIRC_Data.Bit = 0; + SIRC_Data.Code = 0; + ignored = false; + } + break; + #endregion HeaderSpace + + #region Data + case RemoteDetectionState.Data: + //Console.WriteLine("SIRC Data"); + + if (pulse && duration >= 400 && duration <= 800) + { + SIRC_Data.Code <<= 1; + SIRC_Data.Bit++; + ignored = false; + } + else if (pulse && duration >= 1000 && duration <= 1400) + { + SIRC_Data.Code <<= 1; + SIRC_Data.Code |= 1; + SIRC_Data.Bit++; + ignored = false; + } + else if (!pulse && duration >= 400 && duration <= 800) + { + ignored = false; + } + else + { + //Console.WriteLine("SIRC Error"); + } + + if (SIRC_Data.Bit == 15) + { + remoteCallback(IRProtocol.SIRC, SIRC_Data.Code); + SIRC_Data.State = RemoteDetectionState.HeaderPulse; + } + break; + #endregion Data + + } + + if (ignored && (SIRC_Data.State != RemoteDetectionState.HeaderPulse)) + SIRC_Data.State = RemoteDetectionState.HeaderPulse; + } + + } + + //static uint biggest = 0; + //static uint smallest = 1000000; + + static void DetectMCE(int[] timingData, KeyboardCallback keyboardCallback, MouseCallback mouseCallback) + { + // Mouse: 0 0001 xxxxxxxxxxxxxxxxxxxxxxxxxxxxx + // Keyboard: 0 0100 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + + const int HalfBit_None = 0; + const int HalfBit_Zero = 1; + const int HalfBit_One = 2; + + if (MCE_Data == null || timingData == null) + { + MCE_Data = new MceDetectionData(); + + // TODO: if lingering mouse data ... + if (mouseCallback != null) + mouseCallback(0, 0, false, false); + } + + if (timingData == null) + return; + + for (int i = 0; i < timingData.Length; i++) + { + int duration = Math.Abs(timingData[i]); + bool pulse = (timingData[i] > 0); + + #region Working data ... + if (MCE_Data.State != MceKeyboardDetectState.Header) + { + switch (MCE_Data.HalfBit) + { + case HalfBit_None: + if (duration >= 100 && duration <= 450) + MCE_Data.HalfBit = (pulse ? 2 : 1); + else if (duration >= 500 && duration <= 800) + { + //Console.WriteLine("Bad bit sequence double {0}", pulse); + MCE_Data.HalfBit = (pulse ? 2 : 1); + //MCE_Data = new MceDetectionData(); + return; + } + else + { + // Over Length duration (Treat as a Zero bit) + //Console.WriteLine("Bad duration {0}", duration); + MCE_Data.Working <<= 1; + MCE_Data.Bit--; + } + break; + + case HalfBit_Zero: + if (duration >= 100 && duration <= 450) + { + if (pulse) + { + MCE_Data.Working <<= 1; + MCE_Data.Bit--; + MCE_Data.HalfBit = 0; + } + else + { + //Console.WriteLine("Bad bit sequence 00"); + MCE_Data = new MceDetectionData(); + //return; + } + } + else if (duration >= 500 && duration <= 800) + { + if (pulse) + { + MCE_Data.Working <<= 1; + MCE_Data.Bit--; + MCE_Data.HalfBit = 2; + } + else + { + //Console.WriteLine("Bad bit sequence 00 0"); + MCE_Data = new MceDetectionData(); + //return; + } + } + else + { + //Console.WriteLine("Bad duration {0}", duration); + if (MCE_Data.Bit == 1) + { + MCE_Data.Working <<= 1; + //MceKeyboard_Data.Working |= 1; + MCE_Data.Bit--; + MCE_Data.HalfBit = 0; + //i--; + } + else + MCE_Data = new MceDetectionData(); + //return; + } + break; + + case HalfBit_One: + if (duration >= 100 && duration <= 450) + { + if (!pulse) + { + MCE_Data.Working <<= 1; + MCE_Data.Working |= 1; + MCE_Data.Bit--; + MCE_Data.HalfBit = 0; + } + else + { + //Console.WriteLine("Bad bit sequence 11"); + MCE_Data = new MceDetectionData(); + //return; + } + } + else if (duration >= 500 && duration <= 800) + { + if (!pulse) + { + MCE_Data.Working <<= 1; + MCE_Data.Working |= 1; + MCE_Data.Bit--; + MCE_Data.HalfBit = 1; + } + else + { + //Console.WriteLine("Bad bit sequence 11 1"); + MCE_Data = new MceDetectionData(); + //return; + } + } + else + { + //Console.WriteLine("Bad duration {0}", duration); + if (MCE_Data.Bit == 1) + { + MCE_Data.Working <<= 1; + MCE_Data.Working |= 1; + MCE_Data.Bit--; + MCE_Data.HalfBit = 0; + //i--; + } + else + MCE_Data = new MceDetectionData(); + //return; + } + break; + } + } + #endregion Working data ... + + switch (MCE_Data.State) + { + + #region Header + case MceKeyboardDetectState.Header: + //Console.WriteLine("KB Header"); + + if (pulse && (duration >= 2600) && (duration <= 3300)) + { + MCE_Data.State = MceKeyboardDetectState.CodeType; + MCE_Data.Type = 0; + MCE_Data.Bit = 5; + MCE_Data.Working = 0; + } + break; + #endregion Header + + #region CodeType + case MceKeyboardDetectState.CodeType: + //Console.WriteLine("KB CodeType"); + + if (MCE_Data.Bit == 0) + { + MCE_Data.Type = MCE_Data.Working; + + if (MCE_Data.Type == MceKeyboard) + { + MCE_Data.State = MceKeyboardDetectState.KeyboardIgnore; + MCE_Data.Bit = 16; + MCE_Data.Working = 0; + } + else if (MCE_Data.Type == MceMouse) + { + MCE_Data.State = MceKeyboardDetectState.MouseIgnore; + MCE_Data.Bit = 8; + MCE_Data.Working = 0; + } + else + { + //Console.WriteLine("KB: Invalid Type {0}", MceKeyboard_Data.Type); + return; + } + } + + break; + #endregion CodeType + + + #region Keyboard + + #region KeyboardIgnore + case MceKeyboardDetectState.KeyboardIgnore: + //Console.WriteLine("KB KeyboardIgnore"); + + if (MCE_Data.Bit == 0) + { + MCE_Data.State = MceKeyboardDetectState.KeyCode; + MCE_Data.Bit = 8; + MCE_Data.Working = 0; + } + break; + #endregion KeyboardIgnore + + #region KeyCode + case MceKeyboardDetectState.KeyCode: + //Console.WriteLine("KB KeyCode"); + + if (MCE_Data.Bit == 0) + { + MCE_Data.KeyCode = MCE_Data.Working; + + MCE_Data.State = MceKeyboardDetectState.Modifiers; + MCE_Data.Bit = 8; + MCE_Data.Working = 0; + } + break; + #endregion KeyCode + + #region Modifiers + case MceKeyboardDetectState.Modifiers: + //Console.WriteLine("KB Modifiers"); + + if (MCE_Data.Bit == 0) + { + MCE_Data.Modifiers = MCE_Data.Working; + + keyboardCallback(MCE_Data.KeyCode, MCE_Data.Modifiers); + + MCE_Data = new MceDetectionData(); + } + break; + #endregion Modifiers + + #endregion Keyboard + + #region Mouse + + #region MouseIgnore + case MceKeyboardDetectState.MouseIgnore: + //Console.WriteLine("KB MouseIgnore"); + + if (MCE_Data.Bit == 0) + { + MCE_Data.State = MceKeyboardDetectState.DeltaY; + MCE_Data.Bit = 7; + MCE_Data.Working = 0; + } + break; + #endregion MouseIgnore + + #region DeltaY + case MceKeyboardDetectState.DeltaY: + //Console.WriteLine("KB DeltaY"); + + if (MCE_Data.Bit == 0) + { + //Console.WriteLine("KB DeltaY Set"); + MCE_Data.DeltaY = ScaleMouseDelta((int)MCE_Data.Working); + + MCE_Data.State = MceKeyboardDetectState.DeltaX; + MCE_Data.Bit = 7; + MCE_Data.Working = 0; + } + break; + #endregion DeltaY + + #region DeltaX + case MceKeyboardDetectState.DeltaX: + //Console.WriteLine("KB DeltaX"); + + if (MCE_Data.Bit == 0) + { + //Console.WriteLine("KB DeltaX Set"); + MCE_Data.DeltaX = ScaleMouseDelta((int)MCE_Data.Working); + + MCE_Data.State = MceKeyboardDetectState.Right; + MCE_Data.Bit = 1; + MCE_Data.Working = 0; + } + break; + #endregion DeltaX + + #region Right + case MceKeyboardDetectState.Right: + //Console.WriteLine("KB Right"); + + if (MCE_Data.Bit == 0) + { + //Console.WriteLine("KB Right Set"); + MCE_Data.Right = (MCE_Data.Working == 1); + + MCE_Data.State = MceKeyboardDetectState.Left; + MCE_Data.Bit = 1; + MCE_Data.Working = 0; + } + break; + #endregion Right + + #region Left + case MceKeyboardDetectState.Left: + //Console.WriteLine("KB Left"); + + if (MCE_Data.Bit == 0) + { + //Console.WriteLine("KB Left Set"); + MCE_Data.Left = (MCE_Data.Working == 1); + + MCE_Data.State = MceKeyboardDetectState.Checksum; + MCE_Data.Bit = 5; + MCE_Data.Working = 0; + } + break; + #endregion Left + + #region Checksum + case MceKeyboardDetectState.Checksum: + //Console.WriteLine("KB Checksum"); + + if (MCE_Data.Bit == 0) + { + //Console.WriteLine("KB Checksum Set"); + mouseCallback(MCE_Data.DeltaX, MCE_Data.DeltaY, MCE_Data.Right, MCE_Data.Left); + + MCE_Data = new MceDetectionData(); + } + break; + #endregion Checksum + + #endregion Mouse + + } + + if (MCE_Data.Bit < 0) + MCE_Data = new MceDetectionData(); + + } + } + + static int ScaleMouseDelta(int delta) + { + int scaledDelta = delta; + if (delta >= 0x62) + scaledDelta -= 0x80; + + return scaledDelta; + } + + #endregion Methods + + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-09-02 17:14:47
|
Revision: 883 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=883&view=rev Author: and-81 Date: 2007-09-02 10:14:46 -0700 (Sun, 02 Sep 2007) Log Message: ----------- Removed Paths: ------------- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IRDecoder.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrDecoder.cs Deleted: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IRDecoder.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IRDecoder.cs 2007-09-02 17:09:43 UTC (rev 882) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IRDecoder.cs 2007-09-02 17:14:46 UTC (rev 883) @@ -1,1413 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace MicrosoftMceTransceiver -{ - - #region Enumerations - - /// <summary> - /// Protocol of IR Code. - /// </summary> - public enum IRProtocol - { - None, - //ITT, - JVC, - NEC, - //NRC17, - RC5, - RC6, - RCA, - //RCMM, - RECS80, - //Sharp, - SIRC, - //XSAT, - } - - #endregion Enumerations - - #region Delegates - - public delegate void RemoteCallback(IRProtocol codeType, uint keyCode); - public delegate void KeyboardCallback(uint keyCode, uint modifiers); - public delegate void MouseCallback(int deltaX, int deltaY, bool rightButton, bool leftButton); - - #endregion Delegates - - /// <summary> - /// Used for decoding received IR codes. - /// </summary> - public static class IRDecoder - { - - #region Constants - - public const uint PulseBit = 0x01000000; - public const uint PulseMask = 0x00FFFFFF; - - //const UInt16 ToggleBitMce = 0x8000; - const UInt16 ToggleMaskMce = 0x7FFF; - const UInt16 CustomerMce = 0x800F; - - const UInt16 ToggleMaskRC5 = 0xF7FF; - const UInt16 ToggleMaskRC5X = 0xFFFF; - - const uint PrefixRC6 = 0x000FC950; - const uint PrefixRC6A = 0x000FCA90; - - const uint MceMouse = 1; - const uint MceKeyboard = 4; - - #endregion Constants - - #region Members - - //static bool _processITT = true; - static bool _processJVC = true; - static bool _processNEC = true; - //static bool _processNRC17 = true; - static bool _processRC5 = true; - static bool _processRC6 = true; - static bool _processRCA = true; - //static bool _processRCMM = true; - static bool _processRECS80 = true; - //static bool _processSharp = true; - static bool _processSIRC = true; - //static bool _processXSAT = true; - - static bool _processMCE = true; - - #endregion Members - - #region Properties - - public static bool ProcessJVC - { - get { return _processJVC; } - set { _processJVC = value; } - } - public static bool ProcessNEC - { - get { return _processNEC; } - set { _processNEC = value; } - } - public static bool ProcessRC5 - { - get { return _processRC5; } - set { _processRC5 = value; } - } - public static bool ProcessRC6 - { - get { return _processRC6; } - set { _processRC6 = value; } - } - public static bool ProcessRCA - { - get { return _processRCA; } - set { _processRCA = value; } - } - public static bool ProcessRECS80 - { - get { return _processRECS80; } - set { _processRECS80 = value; } - } - public static bool ProcessSIRC - { - get { return _processSIRC; } - set { _processSIRC = value; } - } - - public static bool ProcessMCE - { - get { return _processMCE; } - set { _processMCE = value; } - } - - #endregion Properties - - #region Detection Data - - static RemoteDetectionData JVC_Data = null; - static RemoteDetectionData NEC_Data = null; - static RemoteDetectionData RC5_Data = null; - static RemoteDetectionData RC6_Data = null; - static RemoteDetectionData RCA_Data = null; - static RemoteDetectionData RECS80_Data = null; - static RemoteDetectionData SIRC_Data = null; - - static MceDetectionData MCE_Data = null; - - #endregion Detection Data - - #region Methods - - /// <summary> - /// Decode timing data to discover IR Protocol and button code. - /// </summary> - /// <param name="timingData">Input timing data.</param> - /// <param name="remoteCallback">Method to call when Remote button decoded.</param> - /// <param name="keyboardCallback">Method to call when Keyboard event decoded.</param> - /// <param name="mouseCallback">Method to call when Mouse event decoded.</param> - public static void DecodeIR(uint[] timingData, RemoteCallback remoteCallback, KeyboardCallback keyboardCallback, MouseCallback mouseCallback) - { -// if (_processITT) DetectITT(timingData, remoteCallback); - if (_processJVC) DetectJVC(timingData, remoteCallback); - if (_processNEC) DetectNEC(timingData, remoteCallback); -// if (_processNRC17) DetectNRC17(timingData, remoteCallback); - if (_processRC5) DetectRC5(timingData, remoteCallback); - if (_processRC6) DetectRC6(timingData, remoteCallback); - if (_processRCA) DetectRCA(timingData, remoteCallback); -// if (_processRCMM) DetectRCMM(timingData, remoteCallback); - if (_processRECS80) DetectRECS80(timingData, remoteCallback); -// if (_processSharp) DetectSharp(timingData, remoteCallback); - if (_processSIRC) DetectSIRC(timingData, remoteCallback); // 15 Bit -// if (_processXSAT) DetectXSAT(timingData, remoteCallback); - - if (_processMCE) - DetectMCE(timingData, keyboardCallback, mouseCallback); - } - - static void DetectJVC(uint[] timingData, RemoteCallback remoteCallback) - { - if (JVC_Data == null || timingData == null) - JVC_Data = new RemoteDetectionData(); - - if (timingData == null) - return; - - for (int i = 0; i < timingData.Length; i++) - { - uint duration = timingData[i] & PulseMask; - bool pulse = ((timingData[i] & PulseBit) != 0); - bool ignored = true; - - switch (JVC_Data.State) - { - - #region HeaderPulse - case RemoteDetectionState.HeaderPulse: - //Console.WriteLine("JVC HeaderPulse"); - - if (pulse && duration >= 8200 && duration <= 8600) - { - JVC_Data.State = RemoteDetectionState.HeaderSpace; - ignored = false; - } - break; - #endregion HeaderPulse - - #region HeaderSpace - case RemoteDetectionState.HeaderSpace: - //Console.WriteLine("JVC HeaderSpace"); - - if (!pulse && duration >= 4000 && duration <= 4400) - { - JVC_Data.State = RemoteDetectionState.Data; - JVC_Data.HalfBit = 0; - JVC_Data.Bit = 0; - JVC_Data.Code = 0; - ignored = false; - } - break; - #endregion HeaderSpace - - #region Data - case RemoteDetectionState.Data: - //Console.WriteLine("JVC Data"); - - if (pulse && duration >= 350 && duration <= 750) - { - JVC_Data.HalfBit = 1; - ignored = false; - } - else if (!pulse && duration >= 250 && duration <= 650 && JVC_Data.HalfBit == 1) - { - JVC_Data.Code <<= 1; - JVC_Data.Bit++; - JVC_Data.HalfBit = 0; - ignored = false; - } - else if (!pulse && duration >= 1450 && duration <= 1850 && JVC_Data.HalfBit == 1) - { - JVC_Data.Code <<= 1; - JVC_Data.Code |= 1; - JVC_Data.Bit++; - JVC_Data.HalfBit = 0; - ignored = false; - } - else - { - //Console.WriteLine("JVC Error"); - } - - if (JVC_Data.Bit == 16) - { - remoteCallback(IRProtocol.JVC, JVC_Data.Code); - JVC_Data.State = RemoteDetectionState.Leading; - } - break; - #endregion Data - - #region Leading - case RemoteDetectionState.Leading: - //Console.WriteLine("JVC Leading"); - - if (pulse && duration >= 350 && duration <= 750) - { - JVC_Data = new RemoteDetectionData(); - JVC_Data.State = RemoteDetectionState.Data; - ignored = false; - } - break; - #endregion Leading - - } - - if (ignored && (JVC_Data.State != RemoteDetectionState.HeaderPulse)) - JVC_Data = new RemoteDetectionData(); - } - } - static void DetectNEC(uint[] timingData, RemoteCallback remoteCallback) - { - if (NEC_Data == null || timingData == null) - NEC_Data = new RemoteDetectionData(); - - if (timingData == null) - return; - - for (int i = 0; i < timingData.Length; i++) - { - uint duration = timingData[i] & PulseMask; - bool pulse = ((timingData[i] & PulseBit) != 0); - bool ignored = true; - - switch (NEC_Data.State) - { - - #region HeaderPulse - case RemoteDetectionState.HeaderPulse: - //Console.WriteLine("NEC HeaderPulse"); - - if (pulse && duration >= 8800 && duration <= 9200) - { - NEC_Data.State = RemoteDetectionState.HeaderSpace; - ignored = false; - } - break; - #endregion HeaderPulse - - #region HeaderSpace - case RemoteDetectionState.HeaderSpace: - //Console.WriteLine("NEC HeaderSpace"); - - if (!pulse && duration >= 4300 && duration <= 4700) - { - NEC_Data.State = RemoteDetectionState.Data; - NEC_Data.HalfBit = 0; - NEC_Data.Bit = 0; - NEC_Data.Code = 0; - ignored = false; - } - else if (!pulse && duration >= 2050 && duration <= 2450) // For Repeats - { - remoteCallback(IRProtocol.NEC, NEC_Data.Code); - NEC_Data.State = RemoteDetectionState.HeaderPulse; - ignored = false; - } - - break; - #endregion HeaderSpace - - #region Data - case RemoteDetectionState.Data: - //Console.WriteLine("NEC Data"); - - if (pulse && duration >= 350 && duration <= 750) - { - NEC_Data.HalfBit = 1; - ignored = false; - } - else if (!pulse && duration >= 250 && duration <= 650 && NEC_Data.HalfBit == 1) - { - NEC_Data.Code <<= 1; - NEC_Data.Bit++; - NEC_Data.HalfBit = 0; - ignored = false; - } - else if (!pulse && duration >= 1550 && duration <= 1950 && NEC_Data.HalfBit == 1) - { - NEC_Data.Code <<= 1; - NEC_Data.Code |= 1; - NEC_Data.Bit++; - NEC_Data.HalfBit = 0; - ignored = false; - } - else - { - //Console.WriteLine("NEC Error"); - } - - if (NEC_Data.Bit == 32) - { - remoteCallback(IRProtocol.NEC, NEC_Data.Code); - NEC_Data.State = RemoteDetectionState.HeaderPulse; - } - break; - #endregion Data - - } - - if (ignored && (NEC_Data.State != RemoteDetectionState.HeaderPulse)) - NEC_Data = new RemoteDetectionData(); - } - } - static void DetectRC5(uint[] timingData, RemoteCallback remoteCallback) - { - if (RC5_Data == null || timingData == null) - RC5_Data = new RemoteDetectionData(); - - if (timingData == null) - return; - - for (int i = 0; i < timingData.Length; i++) - { - uint duration = timingData[i] & PulseMask; - bool pulse = ((timingData[i] & PulseBit) != 0); - bool ignored = true; - - switch (RC5_Data.State) - { - - #region HeaderPulse - case RemoteDetectionState.HeaderPulse: - //Console.WriteLine("RC5 HeaderPulse"); - - if (pulse) - { - if ((duration >= 750) && (duration <= 1100)) - { - RC5_Data.State = RemoteDetectionState.HeaderSpace; - RC5_Data.Bit = 13; - RC5_Data.Code = (uint)1 << RC5_Data.Bit; - ignored = false; - } - else if ((duration >= 1500) && (duration <= 2000)) - { - RC5_Data.State = RemoteDetectionState.Data; - RC5_Data.Bit = 13; - RC5_Data.Code = (uint)1 << RC5_Data.Bit; - RC5_Data.HalfBit = 0; - ignored = false; - } - } - break; - #endregion HeaderPulse - - #region HeaderSpace - case RemoteDetectionState.HeaderSpace: - //Console.WriteLine("RC5 HeaderSpace"); - - if (!pulse && (duration >= 750) && (duration <= 1000)) - { - RC5_Data.State = RemoteDetectionState.Data; - RC5_Data.HalfBit = 0; - ignored = false; - } - break; - #endregion HeaderSpace - - #region Data - case RemoteDetectionState.Data: - //Console.WriteLine("RC5 Data"); - - if (RC5_Data.HalfBit == 0) - { - if (pulse) - { - if (((duration >= 750) && (duration <= 1100)) || ((duration >= 1500) && (duration <= 2000))) - { - RC5_Data.HalfBit = (byte)((duration >= 1500) ? 0 : 1); - RC5_Data.Bit--; - RC5_Data.Code |= (uint)1 << RC5_Data.Bit; - ignored = false; - - if ((RC5_Data.Bit == 0) || ((RC5_Data.Bit == 1) && (duration >= 1500))) - RC5_Data.State = RemoteDetectionState.KeyCode; - } - else - { - //Console.WriteLine("RC5 Error {0} on bit {1}", duration, bit); - } - } - else - { - if (((duration >= 750) && (duration <= 1100)) || ((duration >= 1500) && (duration <= 2000))) - { - RC5_Data.HalfBit = (byte)((duration >= 1500) ? 0 : 1); - RC5_Data.Bit--; - ignored = false; - - if (RC5_Data.Bit == 0) - RC5_Data.State = RemoteDetectionState.KeyCode; - } - else if ((RC5_Data.Bit == 7) && (((duration >= 4300) && (duration <= 4700)) || ((duration >= 5200) && (duration <= 5600)))) - { - ignored = false; - RC5_Data.HalfBit = (byte)((duration >= 5200) ? 0 : 1); - RC5_Data.Code <<= 6; - RC5_Data.Bit += 5; - } - else - { - //Console.WriteLine("RC5 Space Error {0} on bit {1}", duration, bit); - } - } - break; - } - - if ((duration >= 750) && (duration <= 1100)) - { - RC5_Data.HalfBit = 0; - ignored = false; - - if ((RC5_Data.Bit == 1) && pulse) - RC5_Data.State = RemoteDetectionState.KeyCode; - } - else if ((RC5_Data.Bit == 7) && (((duration >= 3400) && (duration <= 3800)) || ((duration >= 4300) && (duration <= 4700)))) - { - RC5_Data.HalfBit = (byte)((duration >= 4300) ? 0 : 1); - RC5_Data.Code <<= 6; - RC5_Data.Bit += 6; - ignored = false; - } - else - { - //Console.WriteLine("RC5 Duration Error {0} on bit {1}", duration, bit); - } - break; - #endregion Data - - #region Leading - case RemoteDetectionState.Leading: - //Console.WriteLine("RC5 Leading"); - - if (pulse) - break; - - if (duration > 10000) - { - RC5_Data.State = RemoteDetectionState.HeaderPulse; - ignored = false; - } - break; - #endregion Leading - - } - - if (RC5_Data.State == RemoteDetectionState.KeyCode) - { - if (RC5_Data.Code > 0xFFFF) - RC5_Data.Code &= ToggleMaskRC5X; - else - RC5_Data.Code &= ToggleMaskRC5; - - remoteCallback(IRProtocol.RC5, RC5_Data.Code); - - RC5_Data.State = RemoteDetectionState.HeaderPulse; - } - - if (ignored && (RC5_Data.State != RemoteDetectionState.Leading) && (RC5_Data.State != RemoteDetectionState.HeaderPulse)) - RC5_Data.State = RemoteDetectionState.HeaderPulse; - } - - } - static void DetectRC6(uint[] timingData, RemoteCallback remoteCallback) - { - if (RC6_Data == null || timingData == null) - RC6_Data = new RemoteDetectionData(); - - if (timingData == null) - return; - - for (int i = 0; i < timingData.Length; i++) - { - uint duration = timingData[i] & PulseMask; - bool pulse = ((timingData[i] & PulseBit) != 0); - bool ignored = true; - - switch (RC6_Data.State) - { - - #region HeaderPulse - case RemoteDetectionState.HeaderPulse: - //Console.WriteLine("RC6 HeaderPulse"); - - if (pulse && (duration >= 2600) && (duration <= 3300)) - { - RC6_Data.State = RemoteDetectionState.HeaderSpace; - RC6_Data.Header = 0x000FC000; - RC6_Data.Bit = 14; - RC6_Data.HalfBit = 0; - RC6_Data.Code = 0; - RC6_Data.LongPulse = false; - RC6_Data.LongSpace = false; - ignored = false; - } - break; - #endregion HeaderPulse - - #region HeaderSpace - case RemoteDetectionState.HeaderSpace: - //Console.WriteLine("RC6 HeaderSpace"); - - if (!pulse && (duration >= 750) && (duration <= 1000)) - { - RC6_Data.State = RemoteDetectionState.PreData; - RC6_Data.Bit -= 2; - ignored = false; - } - break; - #endregion HeaderSpace - - #region PreData - case RemoteDetectionState.PreData: - //Console.WriteLine("RC6 PreData"); - - if (pulse) - { - if ((duration >= 350) && (duration <= 600)) - { - ignored = false; - if (RC6_Data.Bit != 0) RC6_Data.Header |= (uint)(1 << --RC6_Data.Bit); - } - else if ((duration >= 750) && (duration <= 1000)) - { - ignored = false; - if (RC6_Data.Bit != 0) RC6_Data.Header |= (uint)(1 << --RC6_Data.Bit); - if (RC6_Data.Bit != 0) RC6_Data.Header |= (uint)(1 << --RC6_Data.Bit); - } - else if ((duration >= 1200) && (duration <= 1600)) - { - ignored = false; - if (RC6_Data.Bit != 0) RC6_Data.Header |= (uint)(1 << --RC6_Data.Bit); - if (RC6_Data.Bit != 0) RC6_Data.Header |= (uint)(1 << --RC6_Data.Bit); - if (RC6_Data.Bit != 0) RC6_Data.Header |= (uint)(1 << --RC6_Data.Bit); - else - { - RC6_Data.HalfBit = 1; - RC6_Data.LongPulse = true; - } - } - else - { - //Console.WriteLine(string.Format("RC6 Error Bit {0} {1} {2}", bit, pulse ? "Pulse" : "Space", duration)); - } - } - else - { - if ((duration >= 300) && (duration <= 600)) - { - RC6_Data.Bit--; - ignored = false; - } - else if ((duration >= 750) && (duration <= 1000)) - { - ignored = false; - if (RC6_Data.Bit > 2) - RC6_Data.Bit -= 2; - else - RC6_Data.Bit = 0; - } - else if ((duration >= 1200) && (duration <= 1600)) - { - ignored = false; - if (RC6_Data.Bit >= 3) - { - RC6_Data.Bit -= 3; - } - else - { - RC6_Data.HalfBit = 1; - RC6_Data.LongPulse = true; - RC6_Data.Bit = 0; - } - } - else - { - //Console.WriteLine(string.Format("RC6 Error Bit {0} {1} {2}", bit, pulse ? "Pulse" : "Space", duration)); - } - } - - if ((ignored == false) && (RC6_Data.Bit == 0)) - { - if ((RC6_Data.Header & 0xFFFFFFF0) == PrefixRC6) - { - RC6_Data.Bit = 16; - } - else if ((RC6_Data.Header & 0xFFFFFFF0) == PrefixRC6A) - { - RC6_Data.Bit = 32; - } - else - { - ignored = true; - break; - } - - RC6_Data.State = RemoteDetectionState.Data; - } - break; - #endregion PreData - - #region Data - case RemoteDetectionState.Data: - //Console.WriteLine("RC6 Data"); - - if ((RC6_Data.HalfBit % 2) == 0) - { - if (pulse && (duration >= 350) && (duration <= 600)) - { - ignored = false; - RC6_Data.LongPulse = true; - RC6_Data.HalfBit++; - - if (RC6_Data.Bit == 1) - RC6_Data.State = RemoteDetectionState.KeyCode; - } - else if (!pulse && (duration >= 300) && (duration <= 600)) - { - ignored = false; - RC6_Data.LongSpace = true; - RC6_Data.HalfBit++; - } - else - { - //Console.WriteLine(string.Format("RC6 Error Halfbit0 {0} {1}", pulse ? "Pulse" : "Space", duration)); - } - break; - } - - if (RC6_Data.LongPulse) - { - RC6_Data.LongPulse = false; - if (pulse) - { - //Console.WriteLine(string.Format("RC6 Error Pulse after LongPulse {0} {1}", pulse ? "Pulse" : "Space", duration)); - break; - } - - if ((duration >= 750) && (duration <= 1000)) - { - RC6_Data.Bit--; - RC6_Data.LongSpace = true; - RC6_Data.HalfBit += 2; - ignored = false; - } - else if ((duration >= 300) && (duration <= 600)) - { - RC6_Data.Bit--; - RC6_Data.HalfBit++; - ignored = false; - } - else - { - //Console.WriteLine(string.Format("RC6 Error Pulse LongPulse {0} {1}", pulse ? "Pulse" : "Space", duration)); - } - } - else if (RC6_Data.LongSpace) - { - RC6_Data.LongSpace = false; - - if (!pulse) - { - //Console.WriteLine(string.Format("RC6 Error Pulse after LongPulse {0} {1}", pulse ? "Pulse" : "Space", duration)); - break; - } - - if (RC6_Data.Bit == 32) - RC6_Data.Bit = 24; - - if ((duration >= 750) && (duration <= 1000)) - { - RC6_Data.Bit--; - RC6_Data.Code |= (uint)1 << RC6_Data.Bit; - RC6_Data.LongPulse = true; - RC6_Data.HalfBit += 2; - ignored = false; - - if (RC6_Data.Bit == 1) - RC6_Data.State = RemoteDetectionState.KeyCode; - } - else if ((duration >= 350) && (duration <= 600)) - { - RC6_Data.Bit--; - RC6_Data.Code |= (uint)1 << RC6_Data.Bit; - RC6_Data.HalfBit++; - ignored = false; - - if (RC6_Data.Bit == 0) - RC6_Data.State = RemoteDetectionState.KeyCode; - } - else - { - //Console.WriteLine(string.Format("RC6 Error LongPulse {0} {1}", pulse ? "Pulse" : "Space", duration)); - } - } - break; - #endregion Data - - } - - if (RC6_Data.State == RemoteDetectionState.KeyCode) - { - if ((~RC6_Data.Code >> 16) == CustomerMce) - RC6_Data.Code &= ToggleMaskMce; - - remoteCallback(IRProtocol.RC6, RC6_Data.Code); - - RC6_Data.State = RemoteDetectionState.HeaderPulse; - } - - if (ignored && (RC6_Data.State != RemoteDetectionState.HeaderPulse)) - RC6_Data.State = RemoteDetectionState.HeaderPulse; - } - - } - static void DetectRCA(uint[] timingData, RemoteCallback remoteCallback) - { - if (RCA_Data == null || timingData == null) - RCA_Data = new RemoteDetectionData(); - - if (timingData == null) - return; - - for (int i = 0; i < timingData.Length; i++) - { - uint duration = timingData[i] & PulseMask; - bool pulse = ((timingData[i] & PulseBit) != 0); - bool ignored = true; - - switch (RCA_Data.State) - { - - #region HeaderPulse - case RemoteDetectionState.HeaderPulse: - //Console.WriteLine("RCA HeaderPulse"); - - if (pulse && duration >= 3800 && duration <= 4200) - { - RCA_Data.State = RemoteDetectionState.HeaderSpace; - ignored = false; - } - break; - #endregion HeaderPulse - - #region HeaderSpace - case RemoteDetectionState.HeaderSpace: - //Console.WriteLine("RCA HeaderSpace"); - - if (!pulse && duration >= 3800 && duration <= 4200) - { - RCA_Data.State = RemoteDetectionState.Data; - RCA_Data.HalfBit = 0; - RCA_Data.Bit = 0; - RCA_Data.Code = 0; - ignored = false; - } - break; - #endregion HeaderSpace - - #region Data - case RemoteDetectionState.Data: - //Console.WriteLine("RCA Data"); - - if (pulse && duration >= 300 && duration <= 700) - { - RCA_Data.HalfBit = 1; - ignored = false; - } - else if (!pulse && duration >= 800 && duration <= 1250 && RCA_Data.HalfBit == 1) - { - RCA_Data.Code <<= 1; - RCA_Data.Bit++; - RCA_Data.HalfBit = 0; - ignored = false; - } - else if (!pulse && duration >= 1800 && duration <= 2200 && RCA_Data.HalfBit == 1) - { - RCA_Data.Code <<= 1; - RCA_Data.Code |= 1; - RCA_Data.Bit++; - RCA_Data.HalfBit = 0; - ignored = false; - } - else - { - //Console.WriteLine("RCA Error"); - } - - if (RCA_Data.Bit == 12) - { - remoteCallback(IRProtocol.RCA, RCA_Data.Code); - RCA_Data.State = RemoteDetectionState.HeaderPulse; - } - break; - #endregion Data - - } - - if (ignored && (RCA_Data.State != RemoteDetectionState.HeaderPulse)) - RCA_Data.State = RemoteDetectionState.HeaderPulse; - } - } - static void DetectRECS80(uint[] timingData, RemoteCallback remoteCallback) - { - if (RECS80_Data == null || timingData == null) - RECS80_Data = new RemoteDetectionData(); - - if (timingData == null) - return; - - for (int i = 0; i < timingData.Length; i++) - { - uint duration = timingData[i] & PulseMask; - bool pulse = ((timingData[i] & PulseBit) != 0); - bool ignored = true; - - switch (RECS80_Data.State) - { - - #region HeaderPulse - case RemoteDetectionState.HeaderPulse: - //Console.WriteLine("RECS80 HeaderPulse"); - - if (pulse && (duration >= 3300) && (duration <= 4100)) - { - RECS80_Data.State = RemoteDetectionState.HeaderSpace; - ignored = false; - } - break; - #endregion HeaderPulse - - #region HeaderSpace - case RemoteDetectionState.HeaderSpace: - //Console.WriteLine("RECS80 HeaderSpace"); - - if (!pulse && (duration >= 1400) && (duration <= 1800)) - { - RECS80_Data.State = RemoteDetectionState.Data; - RECS80_Data.HalfBit = 0; - RECS80_Data.Bit = 48; - RECS80_Data.Header = 0; - RECS80_Data.Code = 0; - ignored = false; - } - break; - #endregion HeaderSpace - - #region Data - case RemoteDetectionState.Data: - //Console.WriteLine("RECS80 Data"); - - if ((RECS80_Data.HalfBit % 2) == 0) - { - if (!pulse) - break; - - if ((duration >= 350) && (duration <= 600)) - { - RECS80_Data.HalfBit = 1; - RECS80_Data.Bit--; - ignored = false; - } - break; - } - else - { - if (pulse) - break; - - if ((duration >= 400) && (duration <= 750)) - { - RECS80_Data.HalfBit = 0; - ignored = false; - } - else if ((duration >= 1100) && (duration <= 1500)) - { - RECS80_Data.HalfBit = 0; - if (RECS80_Data.Bit > 15) - RECS80_Data.Header |= (uint)(1 << (RECS80_Data.Bit - 16)); - else - RECS80_Data.Code |= (uint)(1 << RECS80_Data.Bit); - ignored = false; - } - else - { - break; - } - - if (RECS80_Data.Bit == 0) - { - RECS80_Data.Code &= 0x0000FFFF; - remoteCallback(IRProtocol.RECS80, RECS80_Data.Code); - - RECS80_Data.State = RemoteDetectionState.HeaderPulse; - } - } - break; - #endregion Data - - } - - if (ignored && (RECS80_Data.State != RemoteDetectionState.HeaderPulse)) - RECS80_Data.State = RemoteDetectionState.HeaderPulse; - } - } - static void DetectSIRC(uint[] timingData, RemoteCallback remoteCallback) - { - if (SIRC_Data == null || timingData == null) - SIRC_Data = new RemoteDetectionData(); - - if (timingData == null) - return; - - for (int i = 0; i < timingData.Length; i++) - { - uint duration = timingData[i] & PulseMask; - bool pulse = ((timingData[i] & PulseBit) != 0); - bool ignored = true; - - switch (SIRC_Data.State) - { - - #region HeaderPulse - case RemoteDetectionState.HeaderPulse: - //Console.WriteLine("SIRC HeaderPulse"); - - if (pulse && duration >= 2200 && duration <= 2600) - { - SIRC_Data.State = RemoteDetectionState.HeaderSpace; - ignored = false; - } - break; - #endregion HeaderPulse - - #region HeaderSpace - case RemoteDetectionState.HeaderSpace: - //Console.WriteLine("SIRC HeaderSpace"); - - if (!pulse && duration >= 400 && duration <= 800) - { - SIRC_Data.State = RemoteDetectionState.Data; - SIRC_Data.Bit = 0; - SIRC_Data.Code = 0; - ignored = false; - } - break; - #endregion HeaderSpace - - #region Data - case RemoteDetectionState.Data: - //Console.WriteLine("SIRC Data"); - - if (pulse && duration >= 400 && duration <= 800) - { - SIRC_Data.Code <<= 1; - SIRC_Data.Bit++; - ignored = false; - } - else if (pulse && duration >= 1000 && duration <= 1400) - { - SIRC_Data.Code <<= 1; - SIRC_Data.Code |= 1; - SIRC_Data.Bit++; - ignored = false; - } - else if (!pulse && duration >= 400 && duration <= 800) - { - ignored = false; - } - else - { - //Console.WriteLine("SIRC Error"); - } - - if (SIRC_Data.Bit == 15) - { - remoteCallback(IRProtocol.SIRC, SIRC_Data.Code); - SIRC_Data.State = RemoteDetectionState.HeaderPulse; - } - break; - #endregion Data - - } - - if (ignored && (SIRC_Data.State != RemoteDetectionState.HeaderPulse)) - SIRC_Data.State = RemoteDetectionState.HeaderPulse; - } - - } - - //static uint biggest = 0; - //static uint smallest = 1000000; - - static void DetectMCE(uint[] timingData, KeyboardCallback keyboardCallback, MouseCallback mouseCallback) - { - // Mouse: 0 0001 xxxxxxxxxxxxxxxxxxxxxxxxxxxxx - // Keyboard: 0 0100 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx - - const int HalfBit_None = 0; - const int HalfBit_Zero = 1; - const int HalfBit_One = 2; - - if (MCE_Data == null || timingData == null) - MCE_Data = new MceDetectionData(); - - if (timingData == null) - return; - - for (int i = 0; i < timingData.Length; i++) - { - uint duration = timingData[i] & PulseMask; - bool pulse = ((timingData[i] & PulseBit) != 0); - - #region Working data ... - if (MCE_Data.State != MceKeyboardDetectState.Header) - { - switch (MCE_Data.HalfBit) - { - case HalfBit_None: - if (duration >= 100 && duration <= 450) - MCE_Data.HalfBit = (pulse ? 2 : 1); - else if (duration >= 500 && duration <= 800) - { - //Console.WriteLine("Bad bit sequence double {0}", pulse); - MCE_Data.HalfBit = (pulse ? 2 : 1); - //MCE_Data = new MceDetectionData(); - return; - } - else - { - // Over Length duration (Treat as a Zero bit) - //Console.WriteLine("Bad duration {0}", duration); - MCE_Data.Working <<= 1; - MCE_Data.Bit--; - } - break; - - case HalfBit_Zero: - if (duration >= 100 && duration <= 450) - { - if (pulse) - { - MCE_Data.Working <<= 1; - MCE_Data.Bit--; - MCE_Data.HalfBit = 0; - } - else - { - //Console.WriteLine("Bad bit sequence 00"); - MCE_Data = new MceDetectionData(); - //return; - } - } - else if (duration >= 500 && duration <= 800) - { - if (pulse) - { - MCE_Data.Working <<= 1; - MCE_Data.Bit--; - MCE_Data.HalfBit = 2; - } - else - { - //Console.WriteLine("Bad bit sequence 00 0"); - MCE_Data = new MceDetectionData(); - //return; - } - } - else - { - //Console.WriteLine("Bad duration {0}", duration); - if (MCE_Data.Bit == 1) - { - MCE_Data.Working <<= 1; - //MceKeyboard_Data.Working |= 1; - MCE_Data.Bit--; - MCE_Data.HalfBit = 0; - //i--; - } - else - MCE_Data = new MceDetectionData(); - //return; - } - break; - - case HalfBit_One: - if (duration >= 100 && duration <= 450) - { - if (!pulse) - { - MCE_Data.Working <<= 1; - MCE_Data.Working |= 1; - MCE_Data.Bit--; - MCE_Data.HalfBit = 0; - } - else - { - //Console.WriteLine("Bad bit sequence 11"); - MCE_Data = new MceDetectionData(); - //return; - } - } - else if (duration >= 500 && duration <= 800) - { - if (!pulse) - { - MCE_Data.Working <<= 1; - MCE_Data.Working |= 1; - MCE_Data.Bit--; - MCE_Data.HalfBit = 1; - } - else - { - //Console.WriteLine("Bad bit sequence 11 1"); - MCE_Data = new MceDetectionData(); - //return; - } - } - else - { - //Console.WriteLine("Bad duration {0}", duration); - if (MCE_Data.Bit == 1) - { - MCE_Data.Working <<= 1; - MCE_Data.Working |= 1; - MCE_Data.Bit--; - MCE_Data.HalfBit = 0; - //i--; - } - else - MCE_Data = new MceDetectionData(); - //return; - } - break; - } - } - #endregion Working data ... - - switch (MCE_Data.State) - { - - #region Header - case MceKeyboardDetectState.Header: - //Console.WriteLine("KB Header"); - - if (pulse && (duration >= 2600) && (duration <= 3300)) - { - MCE_Data.State = MceKeyboardDetectState.CodeType; - MCE_Data.Type = 0; - MCE_Data.Bit = 5; - MCE_Data.Working = 0; - } - break; - #endregion Header - - #region CodeType - case MceKeyboardDetectState.CodeType: - //Console.WriteLine("KB CodeType"); - - if (MCE_Data.Bit == 0) - { - MCE_Data.Type = MCE_Data.Working; - - if (MCE_Data.Type == MceKeyboard) - { - MCE_Data.State = MceKeyboardDetectState.KeyboardIgnore; - MCE_Data.Bit = 16; - MCE_Data.Working = 0; - } - else if (MCE_Data.Type == MceMouse) - { - MCE_Data.State = MceKeyboardDetectState.MouseIgnore; - MCE_Data.Bit = 8; - MCE_Data.Working = 0; - } - else - { - //Console.WriteLine("KB: Invalid Type {0}", MceKeyboard_Data.Type); - return; - } - } - - break; - #endregion CodeType - - - #region Keyboard - - #region KeyboardIgnore - case MceKeyboardDetectState.KeyboardIgnore: - //Console.WriteLine("KB KeyboardIgnore"); - - if (MCE_Data.Bit == 0) - { - MCE_Data.State = MceKeyboardDetectState.KeyCode; - MCE_Data.Bit = 8; - MCE_Data.Working = 0; - } - break; - #endregion KeyboardIgnore - - #region KeyCode - case MceKeyboardDetectState.KeyCode: - //Console.WriteLine("KB KeyCode"); - - if (MCE_Data.Bit == 0) - { - MCE_Data.KeyCode = MCE_Data.Working; - - MCE_Data.State = MceKeyboardDetectState.Modifiers; - MCE_Data.Bit = 8; - MCE_Data.Working = 0; - } - break; - #endregion KeyCode - - #region Modifiers - case MceKeyboardDetectState.Modifiers: - //Console.WriteLine("KB Modifiers"); - - if (MCE_Data.Bit == 0) - { - MCE_Data.Modifiers = MCE_Data.Working; - - keyboardCallback(MCE_Data.KeyCode, MCE_Data.Modifiers); - - MCE_Data = new MceDetectionData(); - } - break; - #endregion Modifiers - - #endregion Keyboard - - #region Mouse - - #region MouseIgnore - case MceKeyboardDetectState.MouseIgnore: - //Console.WriteLine("KB MouseIgnore"); - - if (MCE_Data.Bit == 0) - { - MCE_Data.State = MceKeyboardDetectState.DeltaY; - MCE_Data.Bit = 7; - MCE_Data.Working = 0; - } - break; - #endregion MouseIgnore - - #region DeltaY - case MceKeyboardDetectState.DeltaY: - //Console.WriteLine("KB DeltaY"); - - if (MCE_Data.Bit == 0) - { - //Console.WriteLine("KB DeltaY Set"); - MCE_Data.DeltaY = ScaleMouseDelta(MCE_Data.Working); - - MCE_Data.State = MceKeyboardDetectState.DeltaX; - MCE_Data.Bit = 7; - MCE_Data.Working = 0; - } - break; - #endregion DeltaY - - #region DeltaX - case MceKeyboardDetectState.DeltaX: - //Console.WriteLine("KB DeltaX"); - - if (MCE_Data.Bit == 0) - { - //Console.WriteLine("KB DeltaX Set"); - MCE_Data.DeltaX = ScaleMouseDelta(MCE_Data.Working); - - MCE_Data.State = MceKeyboardDetectState.Right; - MCE_Data.Bit = 1; - MCE_Data.Working = 0; - } - break; - #endregion DeltaX - - #region Right - case MceKeyboardDetectState.Right: - //Console.WriteLine("KB Right"); - - if (MCE_Data.Bit == 0) - { - //Console.WriteLine("KB Right Set"); - MCE_Data.Right = (MCE_Data.Working == 1); - - MCE_Data.State = MceKeyboardDetectState.Left; - MCE_Data.Bit = 1; - MCE_Data.Working = 0; - } - break; - #endregion Right - - #region Left - case MceKeyboardDetectState.Left: - //Console.WriteLine("KB Left"); - - if (MCE_Data.Bit == 0) - { - //Console.WriteLine("KB Left Set"); - MCE_Data.Left = (MCE_Data.Working == 1); - - MCE_Data.State = MceKeyboardDetectState.Checksum; - MCE_Data.Bit = 5; - MCE_Data.Working = 0; - } - break; - #endregion Left - - #region Checksum - case MceKeyboardDetectState.Checksum: - //Console.WriteLine("KB Checksum"); - - if (MCE_Data.Bit == 0) - { - //Console.WriteLine("KB Checksum Set"); - mouseCallback(MCE_Data.DeltaX, MCE_Data.DeltaY, MCE_Data.Right, MCE_Data.Left); - - MCE_Data = new MceDetectionData(); - } - break; - #endregion Checksum - - #endregion Mouse - - } - - if (MCE_Data.Bit < 0) - MCE_Data = new MceDetectionData(); - - } - } - - static int ScaleMouseDelta(uint delta) - { - int scaledDelta = (int)delta; - if (delta >= 0x62) - scaledDelta -= 0x80; - - return scaledDelta; - } - - #endregion Methods - - } - -} Deleted: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrDecoder.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrDecoder.cs 2007-09-02 17:09:43 UTC (rev 882) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrDecoder.cs 2007-09-02 17:14:46 UTC (rev 883) @@ -1,1353 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace MicrosoftMceTransceiver -{ - - #region Enumerations - - /// <summary> - /// Protocol of IR Code. - /// </summary> - public enum IRProtocol - { - None, - //ITT, - JVC, - NEC, - //NRC17, - RC5, - RC6, - RCA, - //RCMM, - RECS80, - //Sharp, - SIRC, - //XSAT, - } - - #endregion Enumerations - - #region Delegates - - public delegate void RemoteCallback(IRProtocol codeType, uint keyCode); - public delegate void KeyboardCallback(uint keyCode, uint modifiers); - public delegate void MouseCallback(int deltaX, int deltaY, bool rightButton, bool leftButton); - - #endregion Delegates - - /// <summary> - /// Used for decoding received IR codes. - /// </summary> - public static class IrDecoder - { - - #region Constants - - //public const uint PulseBit = 0x01000000; - //public const uint PulseMask = 0x00FFFFFF; - - //const UInt16 ToggleBitMce = 0x8000; - const UInt16 ToggleMaskMce = 0x7FFF; - const UInt16 CustomerMce = 0x800F; - - const UInt16 ToggleMaskRC5 = 0xF7FF; - const UInt16 ToggleMaskRC5X = 0xFFFF; - - const uint PrefixRC6 = 0x000FC950; - const uint PrefixRC6A = 0x000FCA90; - - const uint MceMouse = 1; - const uint MceKeyboard = 4; - - #endregion Constants - - #region Detection Data - - static RemoteDetectionData JVC_Data = null; - static RemoteDetectionData NEC_Data = null; - static RemoteDetectionData RC5_Data = null; - static RemoteDetectionData RC6_Data = null; - static RemoteDetectionData RCA_Data = null; - static RemoteDetectionData RECS80_Data = null; - static RemoteDetectionData SIRC_Data = null; - - static MceDetectionData MCE_Data = null; - - #endregion Detection Data - - #region Methods - - /// <summary> - /// Decode timing data to discover IR Protocol and button code. - /// </summary> - /// <param name="timingData">Input timing data.</param> - /// <param name="remoteCallback">Method to call when Remote button decoded.</param> - /// <param name="keyboardCallback">Method to call when Keyboard event decoded.</param> - /// <param name="mouseCallback">Method to call when Mouse event decoded.</param> - public static void DecodeIR(int[] timingData, RemoteCallback remoteCallback, KeyboardCallback keyboardCallback, MouseCallback mouseCallback) - { -// DetectITT(timingData, remoteCallback); - DetectJVC(timingData, remoteCallback); - DetectNEC(timingData, remoteCallback); -// DetectNRC17(timingData, remoteCallback); - DetectRC5(timingData, remoteCallback); - DetectRC6(timingData, remoteCallback); - DetectRCA(timingData, remoteCallback); -// DetectRCMM(timingData, remoteCallback); - DetectRECS80(timingData, remoteCallback); -// DetectSharp(timingData, remoteCallback); - DetectSIRC(timingData, remoteCallback); // 15 Bit -// DetectXSAT(timingData, remoteCallback); - - DetectMCE(timingData, keyboardCallback, mouseCallback); - } - - static void DetectJVC(int[] timingData, RemoteCallback remoteCallback) - { - if (JVC_Data == null || timingData == null) - JVC_Data = new RemoteDetectionData(); - - if (timingData == null) - return; - - for (int i = 0; i < timingData.Length; i++) - { - int duration = Math.Abs(timingData[i]); - bool pulse = (timingData[i] > 0); - bool ignored = true; - - switch (JVC_Data.State) - { - - #region HeaderPulse - case RemoteDetectionState.HeaderPulse: - //Console.WriteLine("JVC HeaderPulse"); - - if (pulse && duration >= 8200 && duration <= 8600) - { - JVC_Data.State = RemoteDetectionState.HeaderSpace; - ignored = false; - } - break; - #endregion HeaderPulse - - #region HeaderSpace - case RemoteDetectionState.HeaderSpace: - //Console.WriteLine("JVC HeaderSpace"); - - if (!pulse && duration >= 4000 && duration <= 4400) - { - JVC_Data.State = RemoteDetectionState.Data; - JVC_Data.HalfBit = 0; - JVC_Data.Bit = 0; - JVC_Data.Code = 0; - ignored = false; - } - break; - #endregion HeaderSpace - - #region Data - case RemoteDetectionState.Data: - //Console.WriteLine("JVC Data"); - - if (pulse && duration >= 350 && duration <= 750) - { - JVC_Data.HalfBit = 1; - ignored = false; - } - else if (!pulse && duration >= 250 && duration <= 650 && JVC_Data.HalfBit == 1) - { - JVC_Data.Code <<= 1; - JVC_Data.Bit++; - JVC_Data.HalfBit = 0; - ignored = false; - } - else if (!pulse && duration >= 1450 && duration <= 1850 && JVC_Data.HalfBit == 1) - { - JVC_Data.Code <<= 1; - JVC_Data.Code |= 1; - JVC_Data.Bit++; - JVC_Data.HalfBit = 0; - ignored = false; - } - else - { - //Console.WriteLine("JVC Error"); - } - - if (JVC_Data.Bit == 16) - { - remoteCallback(IRProtocol.JVC, JVC_Data.Code); - JVC_Data.State = RemoteDetectionState.Leading; - } - break; - #endregion Data - - #region Leading - case RemoteDetectionState.Leading: - //Console.WriteLine("JVC Leading"); - - if (pulse && duration >= 350 && duration <= 750) - { - JVC_Data = new RemoteDetectionData(); - JVC_Data.State = RemoteDetectionState.Data; - ignored = false; - } - break; - #endregion Leading - - } - - if (ignored && (JVC_Data.State != RemoteDetectionState.HeaderPulse)) - JVC_Data = new RemoteDetectionData(); - } - } - static void DetectNEC(int[] timingData, RemoteCallback remoteCallback) - { - if (NEC_Data == null || timingData == null) - NEC_Data = new RemoteDetectionData(); - - if (timingData == null) - return; - - for (int i = 0; i < timingData.Length; i++) - { - int duration = Math.Abs(timingData[i]); - bool pulse = (timingData[i] > 0); - bool ignored = true; - - switch (NEC_Data.State) - { - - #region HeaderPulse - case RemoteDetectionState.HeaderPulse: - //Console.WriteLine("NEC HeaderPulse"); - - if (pulse && duration >= 8800 && duration <= 9200) - { - NEC_Data.State = RemoteDetectionState.HeaderSpace; - ignored = false; - } - break; - #endregion HeaderPulse - - #region HeaderSpace - case RemoteDetectionState.HeaderSpace: - //Console.WriteLine("NEC HeaderSpace"); - - if (!pulse && duration >= 4300 && duration <= 4700) - { - NEC_Data.State = RemoteDetectionState.Data; - NEC_Data.HalfBit = 0; - NEC_Data.Bit = 0; - NEC_Data.Code = 0; - ignored = false; - } - else if (!pulse && duration >= 2050 && duration <= 2450) // For Repeats - { - remoteCallback(IRProtocol.NEC, NEC_Data.Code); - NEC_Data.State = RemoteDetectionState.HeaderPulse; - ignored = false; - } - - break; - #endregion HeaderSpace - - #region Data - case RemoteDetectionState.Data: - //Console.WriteLine("NEC Data"); - - if (pulse && duration >= 350 && duration <= 750) - { - NEC_Data.HalfBit = 1; - ignored = false; - } - else if (!pulse && duration >= 250 && duration <= 650 && NEC_Data.HalfBit == 1) - { - NEC_Data.Code <<= 1; - NEC_Data.Bit++; - NEC_Data.HalfBit = 0; - ignored = false; - } - else if (!pulse && duration >= 1550 && duration <= 1950 && NEC_Data.HalfBit == 1) - { - NEC_Data.Code <<= 1; - NEC_Data.Code |= 1; - NEC_Data.Bit++; - NEC_Data.HalfBit = 0; - ignored = false; - } - else - { - //Console.WriteLine("NEC Error"); - } - - if (NEC_Data.Bit == 32) - { - remoteCallback(IRProtocol.NEC, NEC_Data.Code); - NEC_Data.State = RemoteDetectionState.HeaderPulse; - } - break; - #endregion Data - - } - - if (ignored && (NEC_Data.State != RemoteDetectionState.HeaderPulse)) - NEC_Data = new RemoteDetectionData(); - } - } - static void DetectRC5(int[] timingData, RemoteCallback remoteCallback) - { - if (RC5_Data == null || timingData == null) - RC5_Data = new RemoteDetectionData(); - - if (timingData == null) - return; - - for (int i = 0; i < timingData.Length; i++) - { - int duration = Math.Abs(timingData[i]); - bool pulse = (timingData[i] > 0); - bool ignored = true; - - switch (RC5_Data.State) - { - - #region HeaderPulse - case RemoteDetectionState.HeaderPulse: - //Console.WriteLine("RC5 HeaderPulse"); - - if (pulse) - { - if ((duration >= 750) && (duration <= 1100)) - { - RC5_Data.State = RemoteDetectionState.HeaderSpace; - RC5_Data.Bit = 13; - RC5_Data.Code = (uint)1 << RC5_Data.Bit; - ignored = false; - } - else if ((duration >= 1500) && (duration <= 2000)) - { - RC5_Data.State = RemoteDetectionState.Data; - RC5_Data.Bit = 13; - RC5_Data.Code = (uint)1 << RC5_Data.Bit; - RC5_Data.HalfBit = 0; - ignored = false; - } - } - break; - #endregion HeaderPulse - - #region HeaderSpace - case RemoteDetectionState.HeaderSpace: - //Console.WriteLine("RC5 HeaderSpace"); - - if (!pulse && (duration >= 750) && (duration <= 1000)) - { - RC5_Data.State = RemoteDetectionState.Data; - RC5_Data.HalfBit = 0; - ignored = false; - } - break; - #endregion HeaderSpace - - #region Data - case RemoteDetectionState.Data: - //Console.WriteLine("RC5 Data"); - - if (RC5_Data.HalfBit == 0) - { - if (pulse) - { - if (((duration >= 750) && (duration <= 1100)) || ((duration >= 1500) && (duration <= 2000))) - { - RC5_Data.HalfBit = (byte)((duration >= 1500) ? 0 : 1); - RC5_Data.Bit--; - RC5_Data.Code |= (uint)1 << RC5_Data.Bit; - ignored = false; - - if ((RC5_Data.Bit == 0) || ((RC5_Data.Bit == 1) && (duration >= 1500))) - RC5_Data.State = RemoteDetectionState.KeyCode; - } - else - { - //Console.WriteLine("RC5 Error {0} on bit {1}", duration, bit); - } - } - else - { - if (((duration >= 750) && (duration <= 1100)) || ((duration >= 1500) && (duration <= 2000))) - { - RC5_Data.HalfBit = (byte)((duration >= 1500) ? 0 : 1); - RC5_Data.Bit--; - ignored = false; - - if (RC5_Data.Bit == 0) - RC5_Data.State = RemoteDetectionState.KeyCode; - } - else if ((RC5_Data.Bit == 7) && (((duration >= 4300) && (duration <= 4700)) || ((duration >= 5200) && (duration <= 5600)))) - { - ignored = false; - RC5_Data.HalfBit = (byte)((duration >= 5200) ? 0 : 1); - RC5_Data.Code <<= 6; - RC5_Data.Bit += 5; - } - else - { - //Console.WriteLine("RC5 Space Error {0} on bit {1}", duration, bit); - } - } - break; - } - - if ((duration >= 750) && (duration <= 1100)) - { - RC5_Data.HalfBit = 0; - ignored = false; - - if ((RC5_Data.Bit == 1) && pulse) - RC5_Data.State = RemoteDetectionState.KeyCode; - } - else if ((RC5_Data.Bit == 7) && (((duration >= 3400) && (duration <= 3800)) || ((duration >= 4300) && (duration <= 4700)))) - { - RC5_Data.HalfBit = (byte)((duration >= 4300) ? 0 : 1); - RC5_Data.Code <<= 6; - RC5_Data.Bit += 6; - ignored = false; - } - else - { - //Console.WriteLine("RC5 Duration Error {0} on bit {1}", duration, bit); - } - break; - #endregion Data - - #region Leading - case RemoteDetectionState.Leading: - //Console.WriteLine("RC5 Leading"); - - if (pulse) - break; - - if (duration > 10000) - { - RC5_Data.State = RemoteDetectionState.HeaderPulse; - ignored = false; - } - break; - #endregion Leading - - } - - if (RC5_Data.State == RemoteDetectionState.KeyCode) - { - if (RC5_Data.Code > 0xFFFF) - RC5_Data.Code &= ToggleMaskRC5X; - else - RC5_Data.Code &= ToggleMaskRC5; - - remoteCallback(IRProtocol.RC5, RC5_Data.Code); - - RC5_Data.State = RemoteDetectionState.HeaderPulse; - } - - if (ignored && (RC5_Data.State != RemoteDetectionState.Leading) && (RC5_Data.State != RemoteDetectionState.HeaderPulse)) - RC5_Data.State = RemoteDetectionState.HeaderPulse; - } - - } - static void DetectRC6(int[] timingData, RemoteCallback remoteCallback) - { - if (RC6_Data == null || timingData == null) - RC6_Data = new RemoteDetectionData(); - - if (timingData == null) - return; - - for (int i = 0; i < timingData.Length; i++) - { - int duration = Math.Abs(timingData[i]); - bool pulse = (timingData[i] > 0); - bool ignored = true; - - switch (RC6_Data.State) - { - - #region HeaderPulse - case RemoteDetectionState.HeaderPulse: - //Console.WriteLine("RC6 HeaderPulse"); - - if (pulse && (duration >= 2600) && (duration <= 3300)) - { - RC6_Data.State = RemoteDetectionState.HeaderSpace; - RC6_Data.Header = 0x000FC000; - RC6_Data.Bit = 14; - RC6_Data.HalfBit = 0; - RC6_Data.Code = 0; - RC6_Data.LongPulse = false; - RC6_Data... [truncated message content] |
From: <an...@us...> - 2007-09-02 17:09:50
|
Revision: 882 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=882&view=rev Author: and-81 Date: 2007-09-02 10:09:43 -0700 (Sun, 02 Sep 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/HcwTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug USB Receiver/IgorPlug USB Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.resx 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/Microsoft MCE Transceiver/Pronto.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/XBCDRC Receiver/XBCDRC Receiver.cs trunk/plugins/IR Server Suite/IR Server Suite.sln Added Paths: ----------- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrCode.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrDecoder.cs Removed Paths: ------------- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DeviceAccess.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IRCodeConversion.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MceIrCode.cs Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs 2007-08-31 15:38:37 UTC (rev 881) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs 2007-09-02 17:09:43 UTC (rev 882) @@ -30,7 +30,7 @@ #region Variables - RemoteButtonHandler _remoteButtonHandler = null; + RemoteHandler _remoteHandler = null; FileStream _deviceStream; byte[] _deviceBuffer; @@ -79,21 +79,17 @@ #endregion - #region IIRServerPlugin Members + #region Implementation - public string Name { get { return "Custom HID Receiver"; } } - public string Version { get { return "1.0.3.4"; } } - public string Author { get { return "and-81"; } } - public string Description { get { return "Supports HID USB devices."; } } - public bool CanReceive { get { return true; } } - public bool CanTransmit { get { return false; } } - public bool CanLearn { get { return false; } } - public bool CanConfigure { get { return true; } } + public override string Name { get { return "Custom HID Receiver"; } } + public override string Version { get { return "1.0.3.4"; } } + public override string Author { get { return "and-81"; } } + public override string Description { get { return "Supports HID USB devices."; } } - public RemoteButtonHandler RemoteButtonCallback + public RemoteHandler RemoteCallback { - get { return _remoteButtonHandler; } - set { _remoteButtonHandler = value; } + get { return _remoteHandler; } + set { _remoteHandler = value; } } public string[] AvailablePorts { get { return Ports; } } @@ -108,7 +104,7 @@ } } - public bool Start() + public override bool Start() { if (String.IsNullOrEmpty(_deviceID)) throw new Exception("No HID Device selected for use"); @@ -134,9 +130,9 @@ return true; } - public void Suspend() { } - public void Resume() { } - public void Stop() + public override void Suspend() { } + public override void Resume() { } + public override void Stop() { if (_deviceStream == null) return; @@ -156,12 +152,6 @@ public bool Transmit(string file) { return false; } public LearnStatus Learn(string file) { return LearnStatus.Failure; } - public bool SetPort(string port) { return true; } - - #endregion IIRServerPlugin Members - - #region Implementation - protected virtual void Dispose(bool disposeManagedResources) { // process only if mananged and unmanaged resources have @@ -312,7 +302,7 @@ if (bytesRead == 0) throw new Exception("Error reading from HID Device, zero bytes read"); - if (_remoteButtonHandler != null) + if (_remoteHandler != null) { string keyCode = String.Empty; @@ -333,13 +323,13 @@ if (timeSpan.Milliseconds >= _repeatDelay) { - _remoteButtonHandler(keyCode); + _remoteHandler(keyCode); _lastCodeTime = DateTime.Now; } } else { - _remoteButtonHandler(keyCode); + _remoteHandler(keyCode); _lastCodeTime = DateTime.Now; _lastKeyCode = keyCode; } Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.csproj 2007-08-31 15:38:37 UTC (rev 881) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.csproj 2007-09-02 17:09:43 UTC (rev 882) @@ -33,6 +33,25 @@ <TreatWarningsAsErrors>true</TreatWarningsAsErrors> <UseVSHostingProcess>false</UseVSHostingProcess> </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> + <OutputPath>bin\x86\Debug\</OutputPath> + <DefineConstants>DEBUG</DefineConstants> + <TreatWarningsAsErrors>false</TreatWarningsAsErrors> + <DebugType>full</DebugType> + <PlatformTarget>x86</PlatformTarget> + <UseVSHostingProcess>false</UseVSHostingProcess> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> + <OutputPath>bin\x86\Release\</OutputPath> + <Optimize>true</Optimize> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <DebugType> + </DebugType> + <PlatformTarget>x86</PlatformTarget> + <UseVSHostingProcess>false</UseVSHostingProcess> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> <ItemGroup> <Reference Include="System" /> <Reference Include="System.Data" /> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs 2007-08-31 15:38:37 UTC (rev 881) +++ trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs 2007-09-02 17:09:43 UTC (rev 882) @@ -187,7 +187,7 @@ #region Variables - static RemoteHandler _remoteButtonHandler = null; + static RemoteHandler _remoteHandler = null; static FileStream _deviceStream; static byte[] _deviceBuffer; @@ -243,8 +243,8 @@ public RemoteHandler RemoteCallback { - get { return _remoteButtonHandler; } - set { _remoteButtonHandler = value; } + get { return _remoteHandler; } + set { _remoteHandler = value; } } static void OpenDevice() @@ -354,8 +354,8 @@ { _lastCodeTime = DateTime.Now; - if (_remoteButtonHandler != null) - _remoteButtonHandler(keyCode.ToString()); + if (_remoteHandler != null) + _remoteHandler(keyCode.ToString()); } else { @@ -366,8 +366,8 @@ { _lastCodeTime = DateTime.Now; - if (_remoteButtonHandler != null) - _remoteButtonHandler(keyCode.ToString()); + if (_remoteHandler != null) + _remoteHandler(keyCode.ToString()); } } Modified: trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/HcwTransceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/HcwTransceiver.cs 2007-08-31 15:38:37 UTC (rev 881) +++ trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/HcwTransceiver.cs 2007-09-02 17:09:43 UTC (rev 882) @@ -38,7 +38,7 @@ //Sets up callback so that other forms can catch a key press public delegate void HCWEvent(int keypress); - public event HCWEvent HCWKeyPressed; + //public event HCWEvent HCWKeyPressed; #endregion Delegates @@ -77,11 +77,6 @@ string _lastCode = String.Empty; DateTime _lastCodeTime = DateTime.Now; - // ------- - - int _abortLearn = AllowLearn; - bool _learnTimedOut; - #endregion Variables #region Implementation Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug USB Receiver/IgorPlug USB Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug USB Receiver/IgorPlug USB Receiver.cs 2007-08-31 15:38:37 UTC (rev 881) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug USB Receiver/IgorPlug USB Receiver.cs 2007-09-02 17:09:43 UTC (rev 882) @@ -13,7 +13,7 @@ namespace IgorPlugUSBReceiver { - public class IgorPlugUSBReceiver : IRServerPlugin + public class IgorPlugUSBReceiver : IRServerPlugin, IRemoteReceiver { #region Constants @@ -59,17 +59,28 @@ #endregion Interop - #region IIRServerPlugin Members + #region Implementation - public string Name { get { return "IgorPlug USB"; } } - public string Version { get { return "1.0.3.4"; } } - public string Author { get { return "and-81"; } } - public string Description { get { return "IgorPlug USB Receiver"; } } - public bool CanReceive { get { return true; } } - public bool CanTransmit { get { return false; } } - public bool CanLearn { get { return false; } } - public bool CanConfigure { get { return false; } } + public override string Name { get { return "IgorPlug USB"; } } + public override string Version { get { return "1.0.3.4"; } } + public override string Author { get { return "and-81"; } } + public override string Description { get { return "IgorPlug USB Receiver"; } } + public override bool Start() + { + ThreadStart readThreadStart = new ThreadStart(ReadThread); + _readThread = new Thread(readThreadStart); + _readThread.Start(); + + return true; + } + public override void Suspend() { } + public override void Resume() { } + public override void Stop() + { + _readThread.Abort(); + } + public RemoteHandler RemoteCallback { get { return _remoteButtonHandler; } @@ -83,21 +94,7 @@ public string[] AvailablePorts { get { return Ports; } } public void Configure() { } - public bool Start() - { - ThreadStart readThreadStart = new ThreadStart(ReadThread); - _readThread = new Thread(readThreadStart); - _readThread.Start(); - return true; - } - public void Suspend() { } - public void Resume() { } - public void Stop() - { - _readThread.Abort(); - } - public bool Transmit(string file) { return false; } public LearnStatus Learn(out byte[] data) { @@ -105,12 +102,6 @@ return LearnStatus.Failure; } - public bool SetPort(string port) { return true; } - - #endregion IIRServerPlugin Members - - #region Implementation - void ReadThread() { try Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.Designer.cs 2007-08-31 15:38:37 UTC (rev 881) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.Designer.cs 2007-09-02 17:09:43 UTC (rev 882) @@ -37,14 +37,14 @@ this.buttonCancel = new System.Windows.Forms.Button(); this.groupBoxTimes = new System.Windows.Forms.GroupBox(); this.toolTips = new System.Windows.Forms.ToolTip(this.components); - this.comboBoxBlasterType = new System.Windows.Forms.ComboBox(); this.numericUpDownLearnTimeout = new System.Windows.Forms.NumericUpDown(); this.numericUpDownKeyHeldDelay = new System.Windows.Forms.NumericUpDown(); this.numericUpDownKeyRepeatDelay = new System.Windows.Forms.NumericUpDown(); this.checkBoxHandleKeyboardLocal = new System.Windows.Forms.CheckBox(); this.checkBoxHandleMouseLocal = new System.Windows.Forms.CheckBox(); this.numericUpDownMouseSensitivity = new System.Windows.Forms.NumericUpDown(); - this.labelBlasterType = new System.Windows.Forms.Label(); + this.checkBoxDisableMCEServices = new System.Windows.Forms.CheckBox(); + this.buttonAdvanced = new System.Windows.Forms.Button(); this.labelLearnIRTimeout = new System.Windows.Forms.Label(); this.tabControl = new System.Windows.Forms.TabControl(); this.tabPageBasic = new System.Windows.Forms.TabPage(); @@ -58,7 +58,6 @@ this.tabPageMouse = new System.Windows.Forms.TabPage(); this.labelMouseSensitivity = new System.Windows.Forms.Label(); this.checkBoxEnableMouse = new System.Windows.Forms.CheckBox(); - this.checkBoxLearnAsPronto = new System.Windows.Forms.CheckBox(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownButtonRepeatDelay)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownButtonHeldDelay)).BeginInit(); this.groupBoxTimes.SuspendLayout(); @@ -148,7 +147,7 @@ this.buttonOK.Location = new System.Drawing.Point(120, 208); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(64, 24); - this.buttonOK.TabIndex = 1; + this.buttonOK.TabIndex = 2; this.buttonOK.Text = "OK"; this.buttonOK.UseVisualStyleBackColor = true; this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); @@ -159,7 +158,7 @@ this.buttonCancel.Location = new System.Drawing.Point(192, 208); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(64, 24); - this.buttonCancel.TabIndex = 2; + this.buttonCancel.TabIndex = 3; this.buttonCancel.Text = "Cancel"; this.buttonCancel.UseVisualStyleBackColor = true; this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); @@ -177,16 +176,6 @@ this.groupBoxTimes.TabStop = false; this.groupBoxTimes.Text = "Remote button timing (in milliseconds)"; // - // comboBoxBlasterType - // - this.comboBoxBlasterType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.comboBoxBlasterType.FormattingEnabled = true; - this.comboBoxBlasterType.Location = new System.Drawing.Point(144, 40); - this.comboBoxBlasterType.Name = "comboBoxBlasterType"; - this.comboBoxBlasterType.Size = new System.Drawing.Size(88, 21); - this.comboBoxBlasterType.TabIndex = 1; - this.toolTips.SetToolTip(this.comboBoxBlasterType, "Choose between Microsoft or SMK manufactured MCE IR transceivers"); - // // numericUpDownLearnTimeout // this.numericUpDownLearnTimeout.Increment = new decimal(new int[] { @@ -194,7 +183,7 @@ 0, 0, 0}); - this.numericUpDownLearnTimeout.Location = new System.Drawing.Point(144, 72); + this.numericUpDownLearnTimeout.Location = new System.Drawing.Point(144, 40); this.numericUpDownLearnTimeout.Maximum = new decimal(new int[] { 60000, 0, @@ -207,7 +196,7 @@ 0}); this.numericUpDownLearnTimeout.Name = "numericUpDownLearnTimeout"; this.numericUpDownLearnTimeout.Size = new System.Drawing.Size(88, 20); - this.numericUpDownLearnTimeout.TabIndex = 3; + this.numericUpDownLearnTimeout.TabIndex = 1; this.numericUpDownLearnTimeout.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.numericUpDownLearnTimeout.ThousandsSeparator = true; this.toolTips.SetToolTip(this.numericUpDownLearnTimeout, "When teaching IR commands this is how long before the process times out"); @@ -321,21 +310,36 @@ 0, 65536}); // - // labelBlasterType + // checkBoxDisableMCEServices // - this.labelBlasterType.Location = new System.Drawing.Point(8, 40); - this.labelBlasterType.Name = "labelBlasterType"; - this.labelBlasterType.Size = new System.Drawing.Size(136, 21); - this.labelBlasterType.TabIndex = 0; - this.labelBlasterType.Text = "Blaster manufacturer:"; - this.labelBlasterType.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.checkBoxDisableMCEServices.Checked = true; + this.checkBoxDisableMCEServices.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkBoxDisableMCEServices.Location = new System.Drawing.Point(8, 80); + this.checkBoxDisableMCEServices.Name = "checkBoxDisableMCEServices"; + this.checkBoxDisableMCEServices.Size = new System.Drawing.Size(224, 24); + this.checkBoxDisableMCEServices.TabIndex = 2; + this.checkBoxDisableMCEServices.Text = "Disable Windows Media Center services"; + this.toolTips.SetToolTip(this.checkBoxDisableMCEServices, "Disable Microsoft Windows Media Center services to prevent interference with IR S" + + "erver"); + this.checkBoxDisableMCEServices.UseVisualStyleBackColor = true; // + // buttonAdvanced + // + this.buttonAdvanced.Location = new System.Drawing.Point(8, 208); + this.buttonAdvanced.Name = "buttonAdvanced"; + this.buttonAdvanced.Size = new System.Drawing.Size(72, 24); + this.buttonAdvanced.TabIndex = 1; + this.buttonAdvanced.Text = "Advanced"; + this.toolTips.SetToolTip(this.buttonAdvanced, "Click here for advanced driver settings"); + this.buttonAdvanced.UseVisualStyleBackColor = true; + this.buttonAdvanced.Click += new System.EventHandler(this.buttonAdvanced_Click); + // // labelLearnIRTimeout // - this.labelLearnIRTimeout.Location = new System.Drawing.Point(8, 72); + this.labelLearnIRTimeout.Location = new System.Drawing.Point(8, 40); this.labelLearnIRTimeout.Name = "labelLearnIRTimeout"; this.labelLearnIRTimeout.Size = new System.Drawing.Size(136, 20); - this.labelLearnIRTimeout.TabIndex = 2; + this.labelLearnIRTimeout.TabIndex = 0; this.labelLearnIRTimeout.Text = "Learn IR timeout:"; this.labelLearnIRTimeout.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // @@ -353,11 +357,9 @@ // // tabPageBasic // - this.tabPageBasic.Controls.Add(this.checkBoxLearnAsPronto); + this.tabPageBasic.Controls.Add(this.checkBoxDisableMCEServices); this.tabPageBasic.Controls.Add(this.labelLearnIRTimeout); - this.tabPageBasic.Controls.Add(this.labelBlasterType); this.tabPageBasic.Controls.Add(this.numericUpDownLearnTimeout); - this.tabPageBasic.Controls.Add(this.comboBoxBlasterType); this.tabPageBasic.Location = new System.Drawing.Point(4, 22); this.tabPageBasic.Name = "tabPageBasic"; this.tabPageBasic.Padding = new System.Windows.Forms.Padding(3); @@ -478,17 +480,6 @@ this.checkBoxEnableMouse.Text = "Enable mouse input"; this.checkBoxEnableMouse.UseVisualStyleBackColor = true; // - // checkBoxLearnAsPronto - // - this.checkBoxLearnAsPronto.Enabled = false; - this.checkBoxLearnAsPronto.Location = new System.Drawing.Point(8, 104); - this.checkBoxLearnAsPronto.Name = "checkBoxLearnAsPronto"; - this.checkBoxLearnAsPronto.Size = new System.Drawing.Size(224, 24); - this.checkBoxLearnAsPronto.TabIndex = 4; - this.checkBoxLearnAsPronto.Text = "Store learned codes in Pronto format"; - this.toolTips.SetToolTip(this.checkBoxLearnAsPronto, "Store learned IR commands in Philips Pronto format"); - this.checkBoxLearnAsPronto.UseVisualStyleBackColor = true; - // // Configure // this.AcceptButton = this.buttonOK; @@ -497,6 +488,7 @@ this.CancelButton = this.buttonCancel; this.ClientSize = new System.Drawing.Size(264, 239); this.ControlBox = false; + this.Controls.Add(this.buttonAdvanced); this.Controls.Add(this.tabControl); this.Controls.Add(this.buttonCancel); this.Controls.Add(this.buttonOK); @@ -531,8 +523,6 @@ private System.Windows.Forms.Button buttonCancel; private System.Windows.Forms.GroupBox groupBoxTimes; private System.Windows.Forms.ToolTip toolTips; - private System.Windows.Forms.ComboBox comboBoxBlasterType; - private System.Windows.Forms.Label labelBlasterType; private System.Windows.Forms.Label labelLearnIRTimeout; private System.Windows.Forms.NumericUpDown numericUpDownLearnTimeout; private System.Windows.Forms.TabControl tabControl; @@ -552,6 +542,7 @@ private System.Windows.Forms.NumericUpDown numericUpDownMouseSensitivity; private System.Windows.Forms.CheckBox checkBoxHandleMouseLocal; private System.Windows.Forms.CheckBox checkBoxEnableMouse; - private System.Windows.Forms.CheckBox checkBoxLearnAsPronto; + private System.Windows.Forms.CheckBox checkBoxDisableMCEServices; + private System.Windows.Forms.Button buttonAdvanced; } } \ No newline at end of file Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.cs 2007-08-31 15:38:37 UTC (rev 881) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.cs 2007-09-02 17:09:43 UTC (rev 882) @@ -13,22 +13,15 @@ #region Properties - public BlasterType BlastType - { - get { return (BlasterType)Enum.Parse(typeof(BlasterType), comboBoxBlasterType.SelectedItem as string, true); } - set { comboBoxBlasterType.SelectedItem = Enum.GetName(typeof(BlasterType), value); } - } - public int LearnTimeout { get { return Decimal.ToInt32(numericUpDownLearnTimeout.Value); } set { numericUpDownLearnTimeout.Value = new Decimal(value); } } - - public bool LearnAsPronto + public bool DisableMceServices { - get { return checkBoxLearnAsPronto.Checked; } - set { checkBoxLearnAsPronto.Checked = value; } + get { return checkBoxDisableMCEServices.Checked; } + set { checkBoxDisableMCEServices.Checked = value; } } public bool EnableRemote @@ -91,15 +84,18 @@ public Configure() { InitializeComponent(); - - comboBoxBlasterType.Items.Clear(); - comboBoxBlasterType.Items.AddRange(Enum.GetNames(typeof(BlasterType))); } #endregion Constructor #region Buttons + private void buttonAdvanced_Click(object sender, EventArgs e) + { + Advanced advanced = new Advanced(); + advanced.ShowDialog(this); + } + private void buttonOK_Click(object sender, EventArgs e) { this.DialogResult = DialogResult.OK; Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.resx =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.resx 2007-08-31 15:38:37 UTC (rev 881) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.resx 2007-09-02 17:09:43 UTC (rev 882) @@ -120,7 +120,4 @@ <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 Deleted: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DeviceAccess.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DeviceAccess.cs 2007-08-31 15:38:37 UTC (rev 881) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DeviceAccess.cs 2007-09-02 17:09:43 UTC (rev 882) @@ -1,303 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Runtime.InteropServices; -using System.Text; - -using Microsoft.Win32.SafeHandles; - -namespace MicrosoftMceTransceiver -{ - - /// <summary> - /// Provides access to the MCE driver. - /// </summary> - public static class DeviceAccess - { - - #region Enumerations - - [Flags] - enum Digcfs - { - None = 0x00, - Default = 0x01, - Present = 0x02, - AllClasses = 0x04, - Profile = 0x08, - DeviceInterface = 0x10, - } - - [Flags] - public enum FileShares - { - None = 0x00, - Read = 0x01, - Write = 0x02, - Delete = 0x04, - } - - public enum CreationDisposition - { - None = 0, - New = 1, - CreateAlways = 2, - OpenExisting = 3, - OpenAlways = 4, - TruncateExisting = 5, - } - - [Flags] - public enum FileAttributes : 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, - } - - [Flags] - public enum FileAccessTypes : uint - { - GenericRead = 0x80000000, - GenericWrite = 0x40000000, - GenericExecute = 0x20000000, - GenericAll = 0x10000000, - } - - #endregion Enumerations - - #region Structures - - [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; - } - - #endregion Structures - - #region Interop - - [DllImport("kernel32", SetLastError = true, CharSet = CharSet.Auto)] - static extern SafeFileHandle CreateFile( - [MarshalAs(UnmanagedType.LPTStr)] string fileName, - [MarshalAs(UnmanagedType.U4)] FileAccessTypes fileAccess, - [MarshalAs(UnmanagedType.U4)] FileShares fileShare, - IntPtr securityAttributes, - [MarshalAs(UnmanagedType.U4)] CreationDisposition creationDisposition, - [MarshalAs(UnmanagedType.U4)] FileAttributes flags, - IntPtr templateFile); - - [DllImport("kernel32")] - [return: MarshalAs(UnmanagedType.Bool)] - static extern bool CancelIo( - SafeFileHandle handle); - - [DllImport("setupapi", CharSet = CharSet.Auto)] - static extern IntPtr SetupDiGetClassDevs( - ref Guid classGuid, - [MarshalAs(UnmanagedType.LPTStr)] string enumerator, - IntPtr hwndParent, - [MarshalAs(UnmanagedType.U4)] Digcfs 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 Methods - - /// <summary> - /// Find the device path for the supplied Device Class Guid. - /// </summary> - /// <param name="classGuid">GUID to locate device with.</param> - /// <returns>Device path.</returns> - public static string FindDevice(Guid classGuid) - { - string devicePath = null; - - IntPtr handle = SetupDiGetClassDevs(ref classGuid, null, IntPtr.Zero, Digcfs.DeviceInterface | Digcfs.Present); - - if (handle.ToInt32() == -1) - return null; - - for (int deviceIndex = 0; ; deviceIndex++) - { - DeviceInfoData deviceInfoData = new DeviceInfoData(); - deviceInfoData.Size = Marshal.SizeOf(deviceInfoData); - - if (!SetupDiEnumDeviceInfo(handle, deviceIndex, ref deviceInfoData)) - { - int lastError = Marshal.GetLastWin32Error(); - - // out of devices or do we have an error? - if (lastError != 0x0103 && lastError != 0x007E) - { - SetupDiDestroyDeviceInfoList(handle); - throw new Win32Exception(lastError); - } - - SetupDiDestroyDeviceInfoList(handle); - break; - } - - DeviceInterfaceData deviceInterfaceData = new DeviceInterfaceData(); - deviceInterfaceData.Size = Marshal.SizeOf(deviceInterfaceData); - - if (!SetupDiEnumDeviceInterfaces(handle, ref deviceInfoData, ref classGuid, 0, ref deviceInterfaceData)) - { - SetupDiDestroyDeviceInfoList(handle); - throw new Win32Exception(Marshal.GetLastWin32Error()); - } - - uint cbData = 0; - - if (!SetupDiGetDeviceInterfaceDetail(handle, ref deviceInterfaceData, IntPtr.Zero, 0, ref cbData, IntPtr.Zero) && 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)) - { - SetupDiDestroyDeviceInfoList(handle); - throw new Win32Exception(Marshal.GetLastWin32Error()); - } - - if ((deviceInterfaceDetailData.DevicePath.IndexOf("#vid_03ee&pid_2501") != -1) || // Mitsumi MCE remote - (deviceInterfaceDetailData.DevicePath.IndexOf("#vid_043e&pid_9803") != -1) || // LG - (deviceInterfaceDetailData.DevicePath.IndexOf("#vid_045e&pid_00a0") != -1) || // Microsoft - (deviceInterfaceDetailData.DevicePath.IndexOf("#vid_0471&pid_0815") != -1) || // Microsoft/Philips 2005 - (deviceInterfaceDetailData.DevicePath.IndexOf("#vid_0471&pid_060c") != -1) || // Philips (HP branded) - (deviceInterfaceDetailData.DevicePath.IndexOf("#vid_045e&pid_006d") != -1) || // Microsoft/Philips 2004 - (deviceInterfaceDetailData.DevicePath.IndexOf("#vid_0609&pid_031d") != -1) || // SMK/Toshiba G83C0004D410 (Hauppauge) - (deviceInterfaceDetailData.DevicePath.IndexOf("#vid_0609&pid_0322") != -1) || // SMK (Sony VAIO) - (deviceInterfaceDetailData.DevicePath.IndexOf("#vid_107b&pid_3009") != -1) || // FIC Spectra/Mycom Mediacenter - (deviceInterfaceDetailData.DevicePath.IndexOf("#vid_1308&pid_c001") != -1) || // Shuttle - (deviceInterfaceDetailData.DevicePath.IndexOf("#vid_1460&pid_9150") != -1) || // HP - (deviceInterfaceDetailData.DevicePath.IndexOf("#vid_1509&pid_9242") != -1) || // Fujitsu Scaleo-E - (deviceInterfaceDetailData.DevicePath.IndexOf("#vid_1784&pid_0001") != -1) || // Topseed - (deviceInterfaceDetailData.DevicePath.IndexOf("#vid_179d&pid_0010") != -1) || // Ricavision internal - (deviceInterfaceDetailData.DevicePath.IndexOf("#vid_195d&pid_7002") != -1) || // Itron ione Libra Q-11 - (deviceInterfaceDetailData.DevicePath.StartsWith(@"\\?\hid#irdevice&col01#2"))) // Microsoft/Philips 2005 (Vista) - { - SetupDiDestroyDeviceInfoList(handle); - devicePath = deviceInterfaceDetailData.DevicePath; - break; - } - } - - return devicePath; - } - - /// <summary> - /// Open a handle to the device driver. - /// </summary> - /// <param name="devicePath">Device path.</param> - /// <param name="access">Access type.</param> - /// <param name="share">Share type.</param> - /// <returns>Handle to device driver.</returns> - public static SafeFileHandle OpenHandle(string devicePath, FileAccessTypes access, FileShares share) - { - return CreateFile(devicePath, access, share, - IntPtr.Zero, CreationDisposition.OpenExisting, FileAttributes.Overlapped, IntPtr.Zero); - } - - /// <summary> - /// Cancel IO for device. - /// </summary> - /// <param name="deviceHandle">Handle to device.</param> - /// <returns>Success.</returns> - public static bool CancelDeviceIo(SafeFileHandle deviceHandle) - { - return CancelIo(deviceHandle); - } - - #endregion Methods - - } - -} Added: 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 (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Driver.cs 2007-09-02 17:09:43 UTC (rev 882) @@ -0,0 +1,283 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.IO; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading; + +using Microsoft.Win32.SafeHandles; + +namespace MicrosoftMceTransceiver +{ + + public abstract class Driver + { + + #region Enumerations + + [Flags] + enum Digcfs + { + None = 0x00, + Default = 0x01, + Present = 0x02, + AllClasses = 0x04, + Profile = 0x08, + DeviceInterface = 0x10, + } + + [Flags] + public enum FileShares + { + None = 0x00, + Read = 0x01, + Write = 0x02, + Delete = 0x04, + } + + public enum CreationDisposition + { + None = 0, + New = 1, + CreateAlways = 2, + OpenExisting = 3, + OpenAlways = 4, + TruncateExisting = 5, + } + + [Flags] + public enum FileAttributes : 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, + } + + [Flags] + public enum FileAccessTypes : uint + { + GenericRead = 0x80000000, + GenericWrite = 0x40000000, + GenericExecute = 0x20000000, + GenericAll = 0x10000000, + } + + #endregion Enumerations + + #region Structures + + [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; + } + + #endregion Structures + + #region Interop + + [DllImport("setupapi.dll", CharSet = CharSet.Auto)] + static extern IntPtr SetupDiGetClassDevs( + ref Guid classGuid, + [MarshalAs(UnmanagedType.LPTStr)] string enumerator, + IntPtr hwndParent, + [MarshalAs(UnmanagedType.U4)] Digcfs flags); + + [DllImport("setupapi.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool SetupDiEnumDeviceInfo( + IntPtr handle, + int index, + ref DeviceInfoData deviceInfoData); + + [DllImport("setupapi.dll", 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.dll", 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.dll", 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.dll")] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool SetupDiDestroyDeviceInfoList( + IntPtr handle); + + #endregion Interop + + #region Variables + + protected Guid _deviceGuid; + protected string _devicePath; + + protected RemoteCallback _remoteCallback = null; + protected KeyboardCallback _keyboardCallback = null; + protected MouseCallback _mouseCallback = null; + + #endregion Variables + + #region Constructors + + public Driver() { } + public Driver(Guid deviceGuid, string devicePath, RemoteCallback remoteCallback, KeyboardCallback keyboardCallback, MouseCallback mouseCallback) + { + _deviceGuid = deviceGuid; + _devicePath = devicePath; + + _remoteCallback = remoteCallback; + _keyboardCallback = keyboardCallback; + _mouseCallback = mouseCallback; + } + + #endregion Constructors + + #region Abstract Methods + + public abstract void Start(); + + public abstract void Stop(); + + public abstract IrCode Learn(int learnTimeout); + + public abstract void Send(IrCode code, uint port); + + #endregion Abstract Methods + + #region Static Methods + + /// <summary> + /// Find the device path for the supplied Device Class Guid. + /// </summary> + /// <param name="classGuid">GUID to locate device with.</param> + /// <returns>Device path.</returns> + public static string Find(Guid classGuid) + { + IntPtr handle = SetupDiGetClassDevs(ref classGuid, null, IntPtr.Zero, Digcfs.DeviceInterface | Digcfs.Present); + + if (handle.ToInt32() == -1) + return null; + + for (int deviceIndex = 0; ; deviceIndex++) + { + DeviceInfoData deviceInfoData = new DeviceInfoData(); + deviceInfoData.Size = Marshal.SizeOf(deviceInfoData); + + if (!SetupDiEnumDeviceInfo(handle, deviceIndex, ref deviceInfoData)) + { + int lastError = Marshal.GetLastWin32Error(); + + // out of devices or do we have an error? + if (lastError != Win32ErrorCodes.ERROR_NO_MORE_ITEMS && lastError != Win32ErrorCodes.ERROR_MOD_NOT_FOUND) + { + SetupDiDestroyDeviceInfoList(handle); + throw new Win32Exception(lastError); + } + + SetupDiDestroyDeviceInfoList(handle); + break; + } + + DeviceInterfaceData deviceInterfaceData = new DeviceInterfaceData(); + deviceInterfaceData.Size = Marshal.SizeOf(deviceInterfaceData); + + if (!SetupDiEnumDeviceInterfaces(handle, ref deviceInfoData, ref classGuid, 0, ref deviceInterfaceData)) + { + SetupDiDestroyDeviceInfoList(handle); + throw new Win32Exception(Marshal.GetLastWin32Error()); + } + + uint cbData = 0; + + if (!SetupDiGetDeviceInterfaceDetail(handle, ref deviceInterfaceData, IntPtr.Zero, 0, ref cbData, IntPtr.Zero) && 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)) + { + SetupDiDestroyDeviceInfoList(handle); + throw new Win32Exception(Marshal.GetLastWin32Error()); + } + + if (!String.IsNullOrEmpty(deviceInterfaceDetailData.DevicePath)) + { + SetupDiDestroyDeviceInfoList(handle); + return deviceInterfaceDetailData.DevicePath; + } + } + + return null; + } + + #endregion Static Methods + + } + +} Deleted: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IRCodeConversion.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IRCodeConversion.cs 2007-08-31 15:38:37 UTC (rev 881) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IRCodeConversion.cs 2007-09-02 17:09:43 UTC (rev 882) @@ -1,121 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace MicrosoftMceTransceiver -{ - - public static class IRCodeConversion - { - - #region Member Variables - - static uint[] timingData = null; - static int timingDataCount = 0; - static uint lastSpace = IRDecoder.PulseMask; - - #endregion Member Variables - - public static byte[] ConvertRawPacketToNativeData(byte[] rawPacket) - { - List<byte> nativeData = new List<byte>(); - byte packetByte; - int jump = 0; - - for (int index = 0; index < rawPacket.Length; index += jump + 1) - { - packetByte = rawPacket[index]; - - if (packetByte == 0x9F) - { - // Packet is finished - break; - } - - if (packetByte >= 0x81 && packetByte <= 0x84) - { - jump = packetByte & 0x7F; - - if (index + jump + 1 > rawPacket.Length) - { - // bad packet - return null; - } - - for (int get = index + 1; get < index + jump + 1; get++) - nativeData.Add(rawPacket[get]); - } - else - { - // Bad packet - return null; - } - } - - return nativeData.ToArray(); - } - - // TODO: Rewrite - public static uint[] ConvertNativeDataToTimingData(byte[] nativeData) - { - int index = 0; - uint code; - - if (timingData == null || nativeData == null) - { - timingData = new uint[100]; - timingData[1] = lastSpace; - timingData[2] = 0; - timingDataCount = 2; - } - - if (nativeData == null) - return null; - - bool pulse; - - while (index < nativeData.Length) - { - pulse = false; - code = nativeData[index++]; - - if ((code & 0x80) != 0) - { - pulse = true; - code &= 0x7F; - } - code *= 50; - - if (pulse) - { - if (lastSpace != 0) - { - timingData[timingDataCount++] = lastSpace; - lastSpace = 0; - timingData[timingDataCount] = 0; - } - - timingData[timingDataCount] += code; - timingData[timingDataCount] |= IRDecoder.PulseBit; - } - else - { - if (timingData[timingDataCount] != 0 && lastSpace == 0) - timingDataCount++; - - lastSpace += code; - } - } - - uint[] outData = new uint[timingDataCount]; - Array.Copy(timingData, outData, outData.Length); - - timingData[0] = timingData[timingDataCount]; - timingDataCount = 0; - - return outData; - } - - } - -} Added: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrCode.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrCode.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrCode.cs 2007-09-02 17:09:43 UTC (rev 882) @@ -0,0 +1,206 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; + +// Remember: Pulse is Positive, Space is Negative. + +namespace MicrosoftMceTransceiver +{ + + /// <summary> + /// Encapsulates an MCE compatible IR code. + /// </summary> + public class IrCode + { + + #region Constants + + public const int CarrierFrequencyUnknown = -1; + public const int CarrierFrequencyPulseMode = 0; + public const int CarrierFrequencyDefault = 36000; + + const int LongestSpace = -10000; + + #endregion Constants + + #region Member Variables + + int _carrier; + int[] _timingData; + + #endregion Member Variables + + #region Properties + + /// <summary> + /// The IR carrier frequency. + /// </summary> + public int Carrier + { + get { return _carrier; } + set { _carrier = value; } + } + + /// <summary> + /// The IR timing data. + /// </summary> + public int[] TimingData + { + get { return _timingData; } + set { _timingData = value; } + } + + #endregion Properties + + #region Constructors + + public IrCode() : this(CarrierFrequencyUnknown, new int[] { }) { } + public IrCode(int carrier) : this(carrier, new int[] { }) { } + public IrCode(int[] timingData) : this(CarrierFrequencyUnknown, timingData) { } + public IrCode(int carrier, int[] timingData) + { + _carrier = carrier; + _timingData = timingData; + } + + #endregion Constructors + + #region Methods + + public bool Finalize() + { + if (_timingData.Length == 0) + return false; + + List<int> newData = new List<int>(); + + for (int index = 0; index < _timingData.Length; index++) + { + int time = _timingData[index]; + + if (time < LongestSpace) + { + newData.Add(LongestSpace); + break; + } + else + { + newData.Add(time); + } + } + + _timingData = newData.ToArray(); + return true; + } + + /// <summary> + /// Add timing data to this IR code. + /// </summary> + /// <param name="addTimingData">Addition timing data.</param> + public void AddTimingData(int[] addTimingData) + { + List<int> newTimingData = new List<int>(); + + int index = 0; + + if (_timingData.Length > 1) + { + for (index = 0; index < _timingData.Length - 1; index++) + newTimingData.Add(_timingData[index]); + } + else if (_timingData.Length == 0) + { + _timingData = new int[addTimingData.Length]; + addTimingData.CopyTo(_timingData, 0); + return; + } + + if (addTimingData.Length == 0 || index >= _timingData.Length) + { + return; + } + + + if (Math.Sign(addTimingData[0]) == Math.Sign(_timingData[index])) + { + newTimingData.Add(_timingData[index] + addTimingData[0]); + + for (index = 1; index < addTimingData.Length; index++) + newTimingData.Add(addTimingData[index]); + } + else + { + newTimingData.Add(_timingData[index]); + newTimingData.AddRange(addTimingData); + } + + _timingData = newTimingData.ToArray(); + } + + public override string ToString() + { + ushort[] prontoData = Pronto.ConvertIrCodeToProntoRaw(this); + + StringBuilder output = new StringBuilder(); + + for (int index = 0; index < prontoData.Length; index++) + { + output.Append(prontoData[index].ToString("X4")); + if (index != prontoData.Length - 1) + output.Append(' '); + } + + return output.ToString(); + } + + #endregion Methods + + #region Static Methods + + /// <summary> + /// Takes old IR file bytes. + /// </summary> + /// <param name="data">IR file bytes.</param> + /// <returns>New IrCode object.</returns> + public static IrCode FromBytes(byte[] data) + { + List<int> timingData = new List<int>(); + + int len = 0; + + for (int index = 0; index < data.Length; index++) + { + byte curByte = data[index]; + + if ((curByte & 0x80) != 0) + len += (int)(curByte & 0x7F); + else + len -= (int)(curByte & 0x7F); + + if ((curByte & 0x7F) != 0x7F) + { + timingData.Add(len * 50); + len = 0; + } + } + + return new IrCode(timingData.ToArray()); + } + + public static IrCode FromString(string code) + { + string[] stringData = code.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); + + ushort[] prontoData = new ushort[stringData.Length]; + for (int i = 0; i < stringData.Length; i++) + prontoData[i] = ushort.Parse(stringData[i], System.Globalization.NumberStyles.HexNumber); + + return Pronto.ConvertProntoDataToIrCode(prontoData); + } + + #endregion Static Methods + + } + +} Added: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrDecoder.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrDecoder.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/IrDecoder.cs 2007-09-02 17:09:43 UTC (rev 882) @@ -0,0 +1,1353 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace MicrosoftMceTransceiver +{ + + #region Enumerations + + /// <summary> + /// Protocol of IR Code. + /// </summary> + public enum IRProtocol + { + None, + //ITT, + JVC, + NEC, + //NRC17, + RC5, + RC6, + RCA, + //RCMM, + RECS80, + //Sharp, + SIRC, + //XSAT, + } + + #endregion Enumerations + + #region Delegates + + public delegate void RemoteCallback(IRProtocol codeType, uint keyCode); + public delegate void KeyboardCallback(uint keyCode, uint modifiers); + public delegate void MouseCallback(int deltaX, int deltaY, bool rightButton, bool leftButton); + + #endregion Delegates + + /// <summary> + /// Used for decoding received IR codes. + /// </summary> + public static class IrDecoder + { + + #region Constants + + //public const uint PulseBit = 0x01000000; + //public const uint PulseMask = 0x00FFFFFF; + + //const UInt16 ToggleBitMce = 0x8000; + const UInt16 ToggleMaskMce = 0x7FFF; + const UInt16 CustomerMce = 0x800F; + + const UInt16 ToggleMaskRC5 = 0xF7FF; + const UInt16 ToggleMaskRC5X = 0xFFFF; + + const uint PrefixRC6 = 0x000FC950; + const uint PrefixRC6A = 0x000FCA90; + + const uint MceMouse = 1; + const uint MceKeyboard = 4; + + #endregion Constants + + #region Detection Data + + static RemoteDetectionData JVC_Data = null; + static RemoteDetectionData NEC_Data = null; + static RemoteDetectionData RC5_Data = null; + static RemoteDetectionData RC6_Data = null; + static RemoteDetectionData RCA_Data = null; + static RemoteDetectionData RECS80_Data = null; + static RemoteDetectionData SIRC_Data = null; + + static MceDetectionData MCE_Data = null; + + #endregion Detection Data + + #region Methods + + /// <summary> + /// Decode timing data to discover IR Protocol and button code. + /// </summary> + /// <param name="timingData">Input timing data.</param> + /// <param name="remoteCallback">Method to call when Remote button decoded.</param> + /// <param name="keyboardCallback">Method to call when Keyboard event decoded.</param> + /// <param name="mouseCallback">Method to call when Mouse event decoded.</param> + public static void DecodeIR(int[] timingData, RemoteCallback remoteCallback, KeyboardCallback keyboardCallback, MouseCallback mouseCallback) + { +// DetectITT(timingData, remoteCallback); + DetectJVC(timingData, remoteCallback); + DetectNEC(timingData, remoteCallback); +// DetectNRC17(timingData, remoteCallback); + DetectRC5(timingData, remoteCallback); + DetectRC6(timingData, remoteCallback); + DetectRCA(timingData, remoteCallback); +// DetectRCMM(timingData, remoteCallback); + DetectRECS80(timingData, remoteCallback); +// DetectSharp(timingData, remoteCallback); + DetectSIRC(timingData, remoteCallback); // 15 Bit +// DetectXSAT(timingData, remoteCallback); + + DetectMCE(timingData, keyboardCallback, mouseCallback); + } + + static void DetectJVC(int[] timingData, RemoteCallback remoteCallback) + { + if (JVC_Data == null || timingData == null) + JVC_Data = new RemoteDetectionData(); + + if (timingData == null) + return; + + for (int i = 0; i < timingData.Length; i++) + { + int duration = Math.Abs(timingData[i]); + bool pulse = (timingData[i] > 0); + bool ignored = true; + + switch (JVC_Data.State) + { + + #region HeaderPulse + case RemoteDetectionState.HeaderPulse: + //Console.WriteLine("JVC HeaderPulse"); + + if (pulse && duration >= 8200 && duration <= 8600) + { + JVC_Data.State = RemoteDetectionState.HeaderSpace; + ignored = false; + } + break; + #endregion HeaderPulse + + #region HeaderSpace + case RemoteDetectionState.HeaderSpace: + //Console.WriteLine("JVC HeaderSpace"); + + if (!pulse && duration >= 4000 && duration <= 4400) + { + JVC_Data.State = RemoteDetectionState.Data; + JVC_Data.HalfBit = 0; + JVC_Data.Bit = 0; + JVC_Data.Code = 0; + ignored = false; + } + break; + #endregion HeaderSpace + + #region Data + case RemoteDetectionState.Data: + //Console.WriteLine("JVC Data"); + + if (pulse && duration >= 350 && duration <= 750) + { + JVC_Data.HalfBit = 1; + ignored = false; + } + else if (!pulse && duration >= 250 && duration <= 650 && JVC_Data.HalfBit == 1) + { + JVC_Data.Code <<= 1; + JVC_Data.Bit++; + JVC_Data.HalfBit = 0; + ignored = false; + } + else if (!pulse && duration >= 1450 && duration <= 1850 && JVC_Data.HalfBit == 1) + { + JVC_Data.Code <<= 1; + JVC_Data.Code |= 1; + JVC_Data.Bit++; + JVC_Data.HalfBit = 0; + ignored = false; + } + else + { + //Console.WriteLine("JVC Error"); + } + + if (JVC_Data.Bit == 16) + { + remoteCallback(IRProtocol.JVC, JVC_Data.Code); + JVC_Data.State = RemoteDetectionState.Leading; + } + break; + #endregion Data + + #region Leading + case RemoteDetectionState.Leading: + //Console.WriteLine("JVC Leading"); + + if (pulse && duration >= 350 && duration <= 750) + { + JVC_Data = new RemoteDetectionData(); + JVC_Data.State = RemoteDetectionState.Data; + ignored = false; + } + break; + #endregion Leading + + } + + if (ignored && (JVC_Data.State != RemoteDetectionState.HeaderPulse)) + JVC_Data = new RemoteDetectionData(); + } + } + static void DetectNEC(int[] timingData, RemoteCallback remoteCallback) + { + if (NEC_Data == null || timingData == null) + NEC_Data = new RemoteDetectionData(); + + if (timingData == null) + return; + + for (int i = 0; i < timingData.Length; i++) + { + int duration = Math.Abs(timingData[i]); + bool pulse = (timingData[i] > 0); + bool ignored = true; + + switch (NEC_Data.State) + { + + #region HeaderPulse + case RemoteDetectionState.HeaderPulse: + //Console.WriteLine("NEC HeaderPulse"); + + if (pulse && duration >= 8800 && durati... [truncated message content] |
From: <ide...@us...> - 2007-08-31 15:38:41
|
Revision: 881 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=881&view=rev Author: ideasdigger Date: 2007-08-31 08:38:37 -0700 (Fri, 31 Aug 2007) Log Message: ----------- Should work with MediaPortal 0.2.3.0 RC1 Modified Paths: -------------- trunk/plugins/WebBrowserIE/Plugins/Windows/Interop.SHDocVw.dll trunk/plugins/WebBrowserIE/Plugins/Windows/WebBrowser.dll Modified: trunk/plugins/WebBrowserIE/Plugins/Windows/Interop.SHDocVw.dll =================================================================== (Binary files differ) Modified: trunk/plugins/WebBrowserIE/Plugins/Windows/WebBrowser.dll =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ide...@us...> - 2007-08-31 15:24:36
|
Revision: 880 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=880&view=rev Author: ideasdigger Date: 2007-08-31 08:24:29 -0700 (Fri, 31 Aug 2007) Log Message: ----------- Fixed: the VirtualWebKeyboard class was replaced with the new DialogWebKeyboard. Added the Utills.dll reference. Modified Paths: -------------- trunk/plugins/WebBrowserIE/Sources/GUIWebBrowser.cs trunk/plugins/WebBrowserIE/Sources/GUIWebBrowser.csproj Modified: trunk/plugins/WebBrowserIE/Sources/GUIWebBrowser.cs =================================================================== --- trunk/plugins/WebBrowserIE/Sources/GUIWebBrowser.cs 2007-08-31 13:06:50 UTC (rev 879) +++ trunk/plugins/WebBrowserIE/Sources/GUIWebBrowser.cs 2007-08-31 15:24:29 UTC (rev 880) @@ -223,16 +223,6 @@ GUIGraphicsContext.form.Focus(); } - public override void Render(float timePassed) - { - base.Render(timePassed); - } - - public override void Process() - { - base.Process(); - } - /// <summary> /// Called when [action]. /// </summary> @@ -364,7 +354,7 @@ private void GetStringFromKeyboard(ref string strLine) { - VirtualWebKeyboard keyboard = (VirtualWebKeyboard)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_VIRTUAL_WEB_KEYBOARD); + DialogWebKeyboard keyboard = (DialogWebKeyboard)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_VIRTUAL_WEB_KEYBOARD); if (null == keyboard) return; keyboard.Reset(); keyboard.Text = strLine; Modified: trunk/plugins/WebBrowserIE/Sources/GUIWebBrowser.csproj =================================================================== --- trunk/plugins/WebBrowserIE/Sources/GUIWebBrowser.csproj 2007-08-31 13:06:50 UTC (rev 879) +++ trunk/plugins/WebBrowserIE/Sources/GUIWebBrowser.csproj 2007-08-31 15:24:29 UTC (rev 880) @@ -63,6 +63,11 @@ <Reference Include="System.Drawing" /> <Reference Include="System.Windows.Forms" /> <Reference Include="System.Xml" /> + <Reference Include="Utils, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\..\..\Program Files\Team MediaPortal\MediaPortal\Utils.DLL</HintPath> + <Private>False</Private> + </Reference> </ItemGroup> <ItemGroup> <Compile Include="Common.cs" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rs...@us...> - 2007-08-31 13:06:55
|
Revision: 879 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=879&view=rev Author: rsparey Date: 2007-08-31 06:06:50 -0700 (Fri, 31 Aug 2007) Log Message: ----------- updated my radio icon view and started work on my video's menu Modified Paths: -------------- trunk/skins/Foofaraw/Development Skin/Foofaraw/mypics.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/myradio.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/myvideo.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/references.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/release notes.xml Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/mypics.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/mypics.xml 2007-08-30 21:28:51 UTC (rev 878) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/mypics.xml 2007-08-31 13:06:50 UTC (rev 879) @@ -128,7 +128,7 @@ <height>36</height> <textureFocus>tab_left_corner_down.png</textureFocus> <textureNoFocus>tab_left_corner_up.png</textureNoFocus> - <textcolor>black</textcolor> + <textcolor>white</textcolor> @@ -155,7 +155,7 @@ <textureDescendingFocused>arrow_round_down_focus.png</textureDescendingFocused> <offsetSortButtonX>180</offsetSortButtonX> <offsetSortButtonY>8</offsetSortButtonY> - <textcolor>black</textcolor> + <textcolor>white</textcolor> </control> <control> <description>SlideShow button</description> @@ -174,7 +174,7 @@ <ondown>50</ondown> <textureFocus>tab_down.png</textureFocus> <textureNoFocus>tab_up.png</textureNoFocus> - <textcolor>black</textcolor> + <textcolor>white</textcolor> </control> <control> <description>Recursive Slideshow</description> @@ -193,7 +193,7 @@ <ondown>50</ondown> <textureFocus>tab_down.png</textureFocus> <textureNoFocus>tab_up.png</textureNoFocus> - <textcolor>black</textcolor> + <textcolor>white</textcolor> </control> <control> <description>Create Thumbnails</description> @@ -213,7 +213,7 @@ <ondown>50</ondown> <textureFocus>tab_down.png</textureFocus> <textureNoFocus>tab_up.png</textureNoFocus> - <textcolor>black</textcolor> + <textcolor>white</textcolor> </control> <control> <description>Rotate</description> @@ -233,7 +233,7 @@ <ondown>50</ondown> <textureFocus>tab_down.png</textureFocus> <textureNoFocus>tab_up.png</textureNoFocus> - <textcolor>black</textcolor> + <textcolor>white</textcolor> </control> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/myradio.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/myradio.xml 2007-08-30 21:28:51 UTC (rev 878) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/myradio.xml 2007-08-31 13:06:50 UTC (rev 879) @@ -243,7 +243,7 @@ <ondown>50</ondown> <textureFocus>tab_down.png</textureFocus> <textureNoFocus>tab_up.png</textureNoFocus> - <textcolor>black</textcolor> + <textcolor>white</textcolor> </control> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/myvideo.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/myvideo.xml 2007-08-30 21:28:51 UTC (rev 878) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/myvideo.xml 2007-08-31 13:06:50 UTC (rev 879) @@ -123,9 +123,9 @@ <posX>12</posX> <label>100</label> <font>font10</font> - <onleft>2</onleft> + <onleft>20</onleft> <onright>3</onright> - <onup>2</onup> + <onup>21</onup> <ondown>50</ondown> <width>209</width> <height>36</height> @@ -148,8 +148,8 @@ <width>209</width> <height>36</height> <onleft>2</onleft> - <onright>6</onright> - <onup>3</onup> + <onright>5</onright> + <onup>21</onup> <ondown>50</ondown> <textureFocus>tab_down.png</textureFocus> <textureNoFocus>tab_up.png</textureNoFocus> @@ -175,33 +175,37 @@ <width>209</width> <height>36</height> <onleft>3</onleft> - <onright>7</onright> - <onup>6</onup> + <onright>8</onright> + <onup>21</onup> <ondown>50</ondown> <textureFocus>tab_down.png</textureFocus> <textureNoFocus>tab_up.png</textureNoFocus> </control> <control> - <description>TV Series</description> + <description>Trailers</description> <type>button</type> - <id>1</id> + <id>8</id> + <hyperlink>5900</hyperlink> + <label>5906</label> <animation effect="fade" time="400">WindowClose</animation> <animation effect="fade" time="400">WindowOpen</animation> <posY>155</posY> <posX>639</posX> - <label>TV Series</label> + <font>font10</font> <width>209</width> <height>36</height> - <onleft>6</onleft> - <onright>8</onright> - <onup>7</onup> - <ondown>50</ondown> + <onleft>5</onleft> + <onright>6</onright> + <onup>21</onup> + <ondown>584</ondown> <textureFocus>tab_down.png</textureFocus> <textureNoFocus>tab_up.png</textureNoFocus> </control> + + <control> <description>Play DVD</description> <type>button</type> @@ -215,45 +219,22 @@ <font>font10</font> <width>209</width> <height>36</height> - <onleft>7</onleft> - <onright>9</onright> - <onup>8</onup> - <ondown>50</ondown> + <onleft>8</onleft> + <onright>20</onright> + <onup>21</onup> + <ondown>7</ondown> <textureFocus>tab_down.png</textureFocus> <textureNoFocus>tab_up.png</textureNoFocus> </control> - <control> - <description>Tv Series</description> - - <type>button</type> - <id>584</id> - <animation effect="fade" time="400">WindowClose</animation> - <animation effect="fade" time="400">WindowOpen</animation> - <posY>147</posY> - <posX>1057</posX> - <label>TV Series</label> - <font>font10</font> - <width>209</width> - <height>36</height> - <onleft>6</onleft> - <onright>8</onright> - <onup>7</onup> - <ondown>9</ondown> - <textureFocus>tab_down.png</textureFocus> - <textureNoFocus>tab_up.png</textureNoFocus> - <visible>Control.HasFocus(9)|Control.HasFocus(584)</visible> - <animation effect="fade" time="250">visiblechange</animation> - <animation effect="slide" end="0,-30" time="250">visiblechange</animation> - </control> + <control> - <description>Trailers</description> + <description>Playlist</description> <type>button</type> - <id>9</id> - <hyperlink>5900</hyperlink> - <label>5906</label> + <id>20</id> + <label>136</label> <animation effect="fade" time="400">WindowClose</animation> <animation effect="fade" time="400">WindowOpen</animation> <posY>155</posY> @@ -263,10 +244,10 @@ <ondown>99</ondown> <width>209</width> <height>36</height> - <onleft>8</onleft> - <onright>9</onright> - <onup>584</onup> - <ondown>50</ondown> + <onleft>6</onleft> + <onright>2</onright> + <onup>21</onup> + <ondown>9</ondown> <textureFocus>tab_down.png</textureFocus> <textureNoFocus>tab_up.png</textureNoFocus> @@ -313,31 +294,155 @@ <description>Filmstrip view</description> <type>filmstrip</type> <id>50</id> - <onleft>2</onleft> - <onright>2</onright> - <onup>2</onup> - <ondown>2</ondown> - <itemWidth>110</itemWidth> - <itemHeight>220</itemHeight> - <thumbWidth>80</thumbWidth> - <thumbHeight>111</thumbHeight> - <background>dvd_case.png</background> - <backgroundx>100</backgroundx> - <backgroundy>580</backgroundy> - <backgroundwidth>95</backgroundwidth> - <backgroundheight>180</backgroundheight> - <backgrounddiffuse>ffffffff</backgrounddiffuse> - - - + <onleft>2</onleft> + <onright>2</onright> + <onup>2</onup> + <ondown>50</ondown> + <posX>25</posX> + <posY>260</posY> + <width>1360</width> + <height>400</height> + <spinWidth>27</spinWidth> + <spinHeight>27</spinHeight> + <spinPosX>1240</spinPosX> + <spinPosY>515</spinPosY> + <spinColor>ffffffff</spinColor> + <textureUp>arrow_round_up_nofocus.png</textureUp> + <textureDown>arrow_round_down_nofocus.png</textureDown> + <textureUpFocus>arrow_round_up_focus.png</textureUpFocus> + <textureDownFocus>arrow_round_down_focus.png</textureDownFocus> + <itemWidth>120</itemWidth> + <itemHeight>100</itemHeight> + <textureWidth>220</textureWidth> + <textureHeight>100</textureHeight> + <thumbWidth>101</thumbWidth> + <thumbHeight>101</thumbHeight> + <thumbPosX>15</thumbPosX><!-- 10 --> + <thumbPosY>1</thumbPosY><!-- 10 --> + <imageFolder>cd_box.png</imageFolder> + <imageFolderFocus>cd_box.png</imageFolderFocus> + <keepaspectratio>no</keepaspectratio> + <font>-</font> + <selectedColor>-</selectedColor> + <textcolor>white</textcolor> + <textXOff>-5000</textXOff> + <colordiffuse>ffffffff</colordiffuse> + <remoteColor>ffFFA075</remoteColor> + <downloadColor>ff80ff80</downloadColor> + <suffix>|</suffix> + <textureWidthBig>100</textureWidthBig> + <textureHeightBig>100</textureHeightBig> + <itemWidthBig>100</itemWidthBig> + <itemHeightBig>84</itemHeightBig> + <thumbWidthBig>84</thumbWidthBig> + <thumbHeightBig>100</thumbHeightBig> + <thumbPosXBig>0</thumbPosXBig> + <thumbPosYBig>0</thumbPosYBig> + <background>-</background> + <backgroundx>130</backgroundx> + <backgroundy>130</backgroundy> + <backgroundwidth>320</backgroundwidth> + <backgroundheight>320</backgroundheight> + <backgrounddiffuse>60ffffff</backgrounddiffuse> + <InfoImage>-</InfoImage> + <InfoImagex>920</InfoImagex> + <InfoImagey>130</InfoImagey> + <InfoImagewidth>310</InfoImagewidth> + <InfoImageheight>450</InfoImageheight> + <InfoImagediffuse>ffffffff</InfoImagediffuse> + + + <textureWidth>120</textureWidth> + <textureHeight>105</textureHeight> + + <showFolder>yes</showFolder> + <showBackGround>no</showBackGround> + <showInfoImage>no</showInfoImage> + <enableFocusZoom>no</enableFocusZoom> + + <thumbs flipY="true" diffuse="Thumb_Mask.png"/> + + <InfoImage flipY="true" diffuse="Thumb_Mask.png"/> + <enableFocusZoom>no</enableFocusZoom> + <thumbAnimation effect="zoom" start="100,100" end="130,130" time="200">focus</thumbAnimation> + <thumbAnimation effect="zoom" start="130,130" end="100,100" time="200">unfocus</thumbAnimation> + + + <animation effect="fade" time="500">delay="1300">WindowOpen</animation> </control> - <control> - <description>playlist listcontrol</description> - <type>playlistcontrol</type> - <id>50</id> - <scrollOffset>1</scrollOffset> - </control> + </control> - </control> + </control> + + <control> + <description>Tv Series</description> + + <type>button</type> + <id>584</id> + <animation effect="fade" time="400">WindowClose</animation> + <animation effect="fade" time="400">WindowOpen</animation> + <posY>158</posY> + <posX>639</posX> + <label>TV Series</label> + <hyperlink>9811</hyperlink> + <font>font10</font> + <width>209</width> + <height>36</height> + <onleft>5</onleft> + <onright>6</onright> + <onup>8</onup> + <ondown>50</ondown> + <textureFocus>tab_down.png</textureFocus> + <textureNoFocus>tab_up.png</textureNoFocus> + <visible>Control.HasFocus(8)|Control.HasFocus(584)</visible> + <animation effect="fade" time="250">visiblechange</animation> + <animation effect="slide" end="0,36" time="250">visiblechange</animation> + </control> + <control> + <description>Eject DVD</description> + + <type>button</type> + <id>7</id> + <animation effect="fade" time="400">WindowClose</animation> + <animation effect="fade" time="400">WindowOpen</animation> + <posY>158</posY> + <posX>848</posX> + <label>654</label> + <font>font10</font> + <width>209</width> + <height>36</height> + <onleft>8</onleft> + <onright>20</onright> + <onup>6</onup> + <ondown>50</ondown> + <textureFocus>tab_down.png</textureFocus> + <textureNoFocus>tab_up.png</textureNoFocus> + <visible>Control.HasFocus(6)|Control.HasFocus(7)</visible> + <animation effect="fade" time="250">visiblechange</animation> + <animation effect="slide" end="0,36" time="250">visiblechange</animation> + </control> + <control> + <description>my playlists</description> + + <type>button</type> + <id>9</id> + <animation effect="fade" time="400">WindowClose</animation> + <animation effect="fade" time="400">WindowOpen</animation> + <posY>158</posY> + <posX>1057</posX> + <label>654</label> + <font>font10</font> + <width>209</width> + <height>36</height> + <onleft>9</onleft> + <onright>2</onright> + <onup>20</onup> + <ondown>50</ondown> + <textureFocus>tab_down.png</textureFocus> + <textureNoFocus>tab_up.png</textureNoFocus> + <visible>Control.HasFocus(20)|Control.HasFocus(9)</visible> + <animation effect="fade" time="250">visiblechange</animation> + <animation effect="slide" end="0,36" time="250">visiblechange</animation> + </control> </controls> </window> \ No newline at end of file Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/references.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/references.xml 2007-08-30 21:28:51 UTC (rev 878) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/references.xml 2007-08-31 13:06:50 UTC (rev 879) @@ -162,8 +162,8 @@ <height>330</height> <spinWidth>27</spinWidth> <spinHeight>27</spinHeight> - <spinPosX>1255</spinPosX> - <spinPosY>510</spinPosY> + <spinPosX>1240</spinPosX> + <spinPosY>515</spinPosY> <spinColor>ffffffff</spinColor> <textureUp>arrow_round_up_nofocus.png</textureUp> <textureDown>arrow_round_down_nofocus.png</textureDown> @@ -341,8 +341,8 @@ <height>350</height> <spinWidth>27</spinWidth> <spinHeight>27</spinHeight> - <spinPosX>1270</spinPosX> - <spinPosY>480</spinPosY> + <spinPosX>1240</spinPosX> + <spinPosY>515</spinPosY> <spinColor>ffffffff</spinColor> <textureUp>arrow_round_up_nofocus.png</textureUp> <textureDown>arrow_round_down_nofocus.png</textureDown> @@ -395,8 +395,8 @@ <height>400</height> <spinWidth>27</spinWidth> <spinHeight>27</spinHeight> - <spinPosX>1270</spinPosX> - <spinPosY>480</spinPosY> + <spinPosX>1240</spinPosX> + <spinPosY>515</spinPosY> <spinColor>ffffffff</spinColor> <textureUp>arrow_round_up_nofocus.png</textureUp> <textureDown>arrow_round_down_nofocus.png</textureDown> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/release notes.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/release notes.xml 2007-08-30 21:28:51 UTC (rev 878) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/release notes.xml 2007-08-31 13:06:50 UTC (rev 879) @@ -11,4 +11,5 @@ updated tv guide Updated radio guide.. added cd_box.png for music film strip +Updated my videos.. (not complete film strip view This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gre...@us...> - 2007-08-30 21:28:58
|
Revision: 878 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=878&view=rev Author: gregmac45 Date: 2007-08-30 14:28:51 -0700 (Thu, 30 Aug 2007) Log Message: ----------- Added ability to set trailer quality Modified Paths: -------------- trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.Designer.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesTrailerUtil.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/AppleTrailers.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/ItmsHelper.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/RegexParsers.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/TrailerStream.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideoSettings.cs Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.Designer.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.Designer.cs 2007-08-30 13:10:21 UTC (rev 877) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.Designer.cs 2007-08-30 21:28:51 UTC (rev 878) @@ -39,6 +39,8 @@ { this.tabControl1 = new System.Windows.Forms.TabControl(); this.General_Tab = new System.Windows.Forms.TabPage(); + this.label4 = new System.Windows.Forms.Label(); + this.cmbTrailerSize = new System.Windows.Forms.ComboBox(); this.txtDownloadDir = new System.Windows.Forms.TextBox(); this.label3 = new System.Windows.Forms.Label(); this.groupBox2 = new System.Windows.Forms.GroupBox(); @@ -81,11 +83,13 @@ this.tabControl1.Margin = new System.Windows.Forms.Padding(4); this.tabControl1.Name = "tabControl1"; this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(639, 697); + this.tabControl1.Size = new System.Drawing.Size(639, 715); this.tabControl1.TabIndex = 0; // // General_Tab // + this.General_Tab.Controls.Add(this.label4); + this.General_Tab.Controls.Add(this.cmbTrailerSize); this.General_Tab.Controls.Add(this.txtDownloadDir); this.General_Tab.Controls.Add(this.label3); this.General_Tab.Controls.Add(this.groupBox2); @@ -98,11 +102,27 @@ this.General_Tab.Margin = new System.Windows.Forms.Padding(4); this.General_Tab.Name = "General_Tab"; this.General_Tab.Padding = new System.Windows.Forms.Padding(4); - this.General_Tab.Size = new System.Drawing.Size(631, 668); + this.General_Tab.Size = new System.Drawing.Size(631, 686); this.General_Tab.TabIndex = 0; this.General_Tab.Text = "General"; this.General_Tab.UseVisualStyleBackColor = true; // + // label4 + // + this.label4.Location = new System.Drawing.Point(20, 103); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(188, 23); + this.label4.TabIndex = 22; + this.label4.Text = "Apple Trailers Max Quality"; + // + // cmbTrailerSize + // + this.cmbTrailerSize.FormattingEnabled = true; + this.cmbTrailerSize.Location = new System.Drawing.Point(293, 100); + this.cmbTrailerSize.Name = "cmbTrailerSize"; + this.cmbTrailerSize.Size = new System.Drawing.Size(121, 24); + this.cmbTrailerSize.TabIndex = 21; + // // txtDownloadDir // this.txtDownloadDir.Location = new System.Drawing.Point(293, 70); @@ -130,18 +150,18 @@ this.groupBox2.Controls.Add(this.label26); this.groupBox2.Controls.Add(this.txtRssName); this.groupBox2.Controls.Add(this.label25); - this.groupBox2.Location = new System.Drawing.Point(20, 363); + this.groupBox2.Location = new System.Drawing.Point(20, 391); this.groupBox2.Margin = new System.Windows.Forms.Padding(4); this.groupBox2.Name = "groupBox2"; this.groupBox2.Padding = new System.Windows.Forms.Padding(4); - this.groupBox2.Size = new System.Drawing.Size(548, 294); + this.groupBox2.Size = new System.Drawing.Size(548, 281); this.groupBox2.TabIndex = 18; this.groupBox2.TabStop = false; this.groupBox2.Text = "Site Categories"; // // btnAdd // - this.btnAdd.Location = new System.Drawing.Point(116, 246); + this.btnAdd.Location = new System.Drawing.Point(116, 248); this.btnAdd.Margin = new System.Windows.Forms.Padding(4); this.btnAdd.Name = "btnAdd"; this.btnAdd.Size = new System.Drawing.Size(100, 28); @@ -154,7 +174,7 @@ // this.CategoryList.FormattingEnabled = true; this.CategoryList.ItemHeight = 16; - this.CategoryList.Location = new System.Drawing.Point(29, 23); + this.CategoryList.Location = new System.Drawing.Point(8, 23); this.CategoryList.Margin = new System.Windows.Forms.Padding(4); this.CategoryList.Name = "CategoryList"; this.CategoryList.Size = new System.Drawing.Size(159, 212); @@ -163,7 +183,7 @@ // // btnDeleteRss // - this.btnDeleteRss.Location = new System.Drawing.Point(8, 246); + this.btnDeleteRss.Location = new System.Drawing.Point(8, 248); this.btnDeleteRss.Margin = new System.Windows.Forms.Padding(4); this.btnDeleteRss.Name = "btnDeleteRss"; this.btnDeleteRss.Size = new System.Drawing.Size(100, 28); @@ -231,7 +251,7 @@ this.groupBox1.Controls.Add(this.label27); this.groupBox1.Controls.Add(this.siteList); this.groupBox1.Controls.Add(this.chkEnabled); - this.groupBox1.Location = new System.Drawing.Point(20, 106); + this.groupBox1.Location = new System.Drawing.Point(20, 129); this.groupBox1.Margin = new System.Windows.Forms.Padding(4); this.groupBox1.Name = "groupBox1"; this.groupBox1.Padding = new System.Windows.Forms.Padding(4); @@ -389,7 +409,7 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(681, 716); + this.ClientSize = new System.Drawing.Size(681, 744); this.Controls.Add(this.tabControl1); this.Margin = new System.Windows.Forms.Padding(4); this.Name = "Configuration"; @@ -405,6 +425,8 @@ this.groupBox1.PerformLayout(); this.ResumeLayout(false); } + private System.Windows.Forms.ComboBox cmbTrailerSize; + private System.Windows.Forms.Label label4; private System.Windows.Forms.TextBox txtDownloadDir; private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1; private System.Windows.Forms.Label label3; Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.cs 2007-08-30 13:10:21 UTC (rev 877) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.cs 2007-08-30 21:28:51 UTC (rev 878) @@ -54,6 +54,13 @@ siteList.Items.Add(site.name); moSiteList.Add(site); } + foreach(ITMSClient.TrailerSize size in Enum.GetValues(typeof(ITMSClient.TrailerSize))){ + + cmbTrailerSize.Items.Add(size); + if(size==OnlineVideoSettings.getInstance().AppleTrailerSize){ + cmbTrailerSize.SelectedIndex = cmbTrailerSize.Items.Count-1; + } + } } @@ -170,6 +177,7 @@ settings.msFilterArray = lsFilterArray; settings.msThumbLocation = txtThumbLoc.Text; settings.msDownloadDir = txtDownloadDir.Text; + settings.AppleTrailerSize = (ITMSClient.TrailerSize) cmbTrailerSize.SelectedItem; settings.moSiteList.Clear(); foreach(GUIOnlineVideos.SiteSettings site in moSiteList){ settings.moSiteList.Add(site.id,site); Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs 2007-08-30 13:10:21 UTC (rev 877) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs 2007-08-30 21:28:51 UTC (rev 878) @@ -37,7 +37,8 @@ private String msSelectedSiteId; private String msSelectedCategoryValue; private String msSelectedCategoryName; - private String msSelectedVideo; + private VideoInfo moSelectedVideo; + private State _CurrentState = State.home; private String msDownloadDir = Directory.GetCurrentDirectory()+"\\"; private List<VideoInfo> moCurrentVideoList = new List<VideoInfo>(); @@ -78,6 +79,7 @@ public class VideoInfo { public String Title; + public String Title2; public String Description = ""; public String VideoUrl = ""; public String ImageUrl = ""; @@ -224,7 +226,7 @@ facadeView.SelectedListItemIndex = miSelectedIndex; } else{ - DisplayVideoDetails(moCurrentVideoList[facadeView.SelectedListItemIndex - 1]); + DisplayVideoDetails(moSelectedVideo); } UpdateViewSate(); //base.OnPageLoad(); @@ -693,7 +695,7 @@ } private void DisplayVideoDetails(VideoInfo foVideo) { - msSelectedVideo = foVideo.Title; + moSelectedVideo = foVideo; SiteUtilBase loSiteUtil = SiteUtilFactory.getSiteUtil(msSelectedSiteId); List<VideoInfo> loVideoList= loSiteUtil.getOtherVideoList(foVideo); moCurrentVideoList.Clear(); @@ -711,6 +713,7 @@ loVideoInfo.Description = cleanString(loVideoInfo.Description); loListItem = new GUIListItem(loVideoInfo.Title); + loListItem.Label2 = loVideoInfo.Title2; loListItem.Path = loVideoInfo.VideoUrl; loListItem.ItemId = liIdx; //loListItem.RetrieveArt = false; @@ -874,7 +877,7 @@ break; case State.info: - GUIPropertyManager.SetProperty("#header.label",msSelectedVideo); + GUIPropertyManager.SetProperty("#header.label",moSelectedVideo.Title); GUIPropertyManager.SetProperty("#header.image","OnlineVidlogo"+msSelectedSiteId+".jpeg"); //DisplayVideoInfo(); break; Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesTrailerUtil.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesTrailerUtil.cs 2007-08-30 13:10:21 UTC (rev 877) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesTrailerUtil.cs 2007-08-30 21:28:51 UTC (rev 878) @@ -51,17 +51,11 @@ } */ DownloadTrailers(fsUrl); - GUIOnlineVideos.VideoInfo loItem; + //GUIOnlineVideos.VideoInfo loItem; foreach (ITMSClient.TrailerInfo trailer in HDTrailerPlugin.AppleTrailers.trailers) { - loItem = new GUIOnlineVideos.VideoInfo(); - loItem.Title = trailer.Title; - if(trailer.PosterUrl!=null) - loItem.ImageUrl = trailer.PosterUrl.ToString(); - loItem.Tags = trailer.Genre; - loItem.Other = trailer; /* try{ ITMSClient.TrailerInfo trailerMore = AppleTrailers.ProcessTrailer(trailer); @@ -75,7 +69,7 @@ // //loItem.Length = trailer.. */ - loListItems.Add(loItem); + loListItems.Add(loadVideoInfo(trailer)); /* }catch(Exception e){ Log.Debug("skipped {0}. Unable to parse video url out of {1}",trailer.Title, trailer.Url); @@ -93,13 +87,10 @@ trailer = AppleTrailers.GetTrailerUrls(trailer); Console.WriteLine("Found {0} trailer urls",trailer.trailers.Count); GUIOnlineVideos.VideoInfo newVideo; - foreach (String name in trailer.trailers.Keys){ - newVideo = new GUIOnlineVideos.VideoInfo(); + foreach (String name in trailer.trailers.Keys){ + newVideo = loadVideoInfo(trailer); newVideo.Title = name; - newVideo.VideoUrl = trailer.trailers[name]; - newVideo.Description = trailer.Overview; - Console.WriteLine(newVideo.Description); - newVideo.Other = trailer; + newVideo.VideoUrl = trailer.trailers[name]; videoList.Add(newVideo); } return videoList; @@ -107,12 +98,13 @@ public override String getUrl(GUIOnlineVideos.VideoInfo video,GUIOnlineVideos.SiteSettings foSite) { TrailerInfo trailer = (TrailerInfo)video.Other; - trailer = AppleTrailers.ProcessTrailer(trailer); + trailer = AppleTrailers.ProcessTrailer(trailer,OnlineVideoSettings.getInstance().AppleTrailerSize); + Log.Info("Trailer quality set to {0}",OnlineVideoSettings.getInstance().AppleTrailerSize); Console.WriteLine("Found {0} trailer urls",trailer.TrailerStreamCollection.Count); return trailer.TrailerStreamCollection[0].Uri.ToString(); } public List<GUIOnlineVideos.VideoInfo> getAllTrailers(){ - GUIOnlineVideos.VideoInfo loItem; + //GUIOnlineVideos.VideoInfo loItem; Dictionary<string, GUIOnlineVideos.RssLink> loRssList= OnlineVideoSettings.getInstance().moSiteList[getSiteId()].RssList; List<GUIOnlineVideos.VideoInfo> loListItems = new List<GUIOnlineVideos.VideoInfo>(); foreach(GUIOnlineVideos.RssLink link in loRssList.Values){ @@ -129,16 +121,9 @@ if(loTrailersFound.ContainsKey(trailer.Title) == false){ loTrailersFound.Add(trailer.Title.ToUpper(), ""); - loItem = new GUIOnlineVideos.VideoInfo(); - loItem.Title = trailer.Title; - if(trailer.PosterUrl!=null){ - loItem.ImageUrl = trailer.PosterUrl.ToString(); - } - loItem.Description = trailer.Overview; - loItem.VideoUrl = trailer.Url.ToString(); - loItem.Other = trailer; + //loItem.Length = trailer.. - loListItems.Add(loItem); + loListItems.Add(loadVideoInfo(trailer)); } } @@ -179,5 +164,17 @@ //Log.Info("finished getting trailers from url:"+fsLink.url); } + private GUIOnlineVideos.VideoInfo loadVideoInfo(TrailerInfo trailer){ + GUIOnlineVideos.VideoInfo newVideo = new GUIOnlineVideos.VideoInfo(); + newVideo.Title = trailer.Title; + newVideo.VideoUrl = trailer.Title; + newVideo.Description = trailer.Overview; + if(trailer.PosterUrl!=null){ + newVideo.ImageUrl = trailer.PosterUrl.ToString(); + } + newVideo.Other = trailer; + return newVideo; + + } } } Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/AppleTrailers.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/AppleTrailers.cs 2007-08-30 13:10:21 UTC (rev 877) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/AppleTrailers.cs 2007-08-30 21:28:51 UTC (rev 878) @@ -116,7 +116,7 @@ /// </summary> /// <param name="obj">Obj.</param> /// <returns></returns> - public static ITMSClient.TrailerInfo ProcessTrailer(object obj) + public static ITMSClient.TrailerInfo ProcessTrailer(object obj ,ITMSClient.TrailerSize size) { ITMSClient.TrailerInfo trailerInfo = (ITMSClient.TrailerInfo)obj; @@ -124,7 +124,7 @@ // Lookup the trailer in the media library string key = trailerInfo.Title.GetHashCode().ToString(); // Populate the rest of the meta data - trailerInfo = ITMSClient.ITMSHelper.PopulateTrailerDetails(trailerInfo, ITMSClient.TrailerSize.h640); + trailerInfo = ITMSClient.ITMSHelper.PopulateTrailerDetails(trailerInfo, size); // Get the poster image if it doesn't already exist //if (trailerInfo.PosterUrl != null) Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/ItmsHelper.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/ItmsHelper.cs 2007-08-30 13:10:21 UTC (rev 877) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/ItmsHelper.cs 2007-08-30 21:28:51 UTC (rev 878) @@ -179,6 +179,7 @@ TrailerStream myStream = GetDesiredTrailerStream(tsc, desiredSize); trailerInfo.TrailerStreamCollection.Add(myStream); + //trailerInfo.TrailerStreamCollection = tsc; } } trailerInfo.TrailerStreamCollection.TrimToSize(); Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/RegexParsers.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/RegexParsers.cs 2007-08-30 13:10:21 UTC (rev 877) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/RegexParsers.cs 2007-08-30 21:28:51 UTC (rev 878) @@ -71,7 +71,7 @@ /// </summary> internal static Regex streamRegex = new Regex( //@"<GotoURL.+?url=""(?<url>.*?(?<size>(small|medium|large|fullscreen))\.xml)""", - @"<key>episodeURL</key><string>(?<url>[^<]*(?<size>h[\d]*)[w]*\.mov)", + @"<key>episodeURL</key><string>(?<url>[^<]*(?<size>h[\d]*p*)[w]*\.mov)", RegexOptions.ExplicitCapture | RegexOptions.Compiled ); Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/TrailerStream.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/TrailerStream.cs 2007-08-30 13:10:21 UTC (rev 877) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/TrailerStream.cs 2007-08-30 21:28:51 UTC (rev 878) @@ -103,4 +103,4 @@ } } -} \ No newline at end of file +} Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideoSettings.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideoSettings.cs 2007-08-30 13:10:21 UTC (rev 877) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideoSettings.cs 2007-08-30 21:28:51 UTC (rev 878) @@ -24,9 +24,10 @@ public String msDownloadDir; public String[] msFilterArray; public Dictionary<String,GUIOnlineVideos.SiteSettings> moSiteList = new Dictionary<String, GUIOnlineVideos.SiteSettings>(); - + public ITMSClient.TrailerSize AppleTrailerSize = ITMSClient.TrailerSize.h640; private const String SETTINGS_FILE = "OnlineVideoSites.xml"; private const String THUMBNAIL_DIR = "thumbDir"; + private const String TRAILER_SIZE = "trailerSize"; private const String DOWNLOAD_DIR = "downloadDir"; private const String SECTION = "onlinevideos"; private const String FILTER = "filter"; @@ -42,20 +43,24 @@ loadSettings(); } private void loadSettings(){ - + String lsTrailerSize; using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { msThumbLocation = xmlreader.GetValueAsString(SECTION, THUMBNAIL_DIR, ""); msDownloadDir = xmlreader.GetValueAsString(SECTION, DOWNLOAD_DIR, ""); String lsFilter = xmlreader.GetValueAsString(SECTION, FILTER, ""); - + lsTrailerSize = xmlreader.GetValueAsString(SECTION,TRAILER_SIZE,"h640"); msFilterArray = lsFilter.Split(new char[] { ',' }); if (msFilterArray.Length == 1 && msFilterArray[0] == "") { msFilterArray = null; } } + if(Enum.IsDefined(typeof(ITMSClient.TrailerSize),lsTrailerSize)){ + AppleTrailerSize = (ITMSClient.TrailerSize)Enum.Parse(typeof(ITMSClient.TrailerSize),lsTrailerSize,true); + } + if(String.IsNullOrEmpty(msThumbLocation)){ msThumbLocation = Config.GetFolder(Config.Dir.Thumbs) +@"\OnlineVideos\"; @@ -157,6 +162,7 @@ } xmlwriter.SetValue(SECTION,THUMBNAIL_DIR,msThumbLocation); xmlwriter.SetValue(SECTION, DOWNLOAD_DIR,msDownloadDir ); + xmlwriter.SetValue(SECTION,TRAILER_SIZE,AppleTrailerSize.ToString()); } Console.WriteLine(System.IO.Directory.GetCurrentDirectory()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rs...@us...> - 2007-08-30 13:10:25
|
Revision: 877 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=877&view=rev Author: rsparey Date: 2007-08-30 06:10:21 -0700 (Thu, 30 Aug 2007) Log Message: ----------- finished pictures and music film strip views... working on radio icon views. added photo_frame.png Modified Paths: -------------- trunk/skins/Foofaraw/Development Skin/Foofaraw/BasicHome.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/common.window.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicsongs.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/mypics.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/myradio.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/references.xml Added Paths: ----------- trunk/skins/Foofaraw/Development Skin/Foofaraw/Media/photo_frame.png Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/BasicHome.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/BasicHome.xml 2007-08-29 23:30:10 UTC (rev 876) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/BasicHome.xml 2007-08-30 13:10:21 UTC (rev 877) @@ -4,7 +4,14 @@ <defaultcontrol>4</defaultcontrol> <allowoverlay>yes</allowoverlay> <controls> - <import>common.window.xml</import> + <control> + <description>BG</description> + <type>image</type> + <id>1</id> + <width>1366</width> + <height>768</height> + + </control> <import>common.time.xml</import> Added: trunk/skins/Foofaraw/Development Skin/Foofaraw/Media/photo_frame.png =================================================================== (Binary files differ) Property changes on: trunk/skins/Foofaraw/Development Skin/Foofaraw/Media/photo_frame.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/common.window.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/common.window.xml 2007-08-29 23:30:10 UTC (rev 876) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/common.window.xml 2007-08-30 13:10:21 UTC (rev 877) @@ -14,7 +14,7 @@ <type>label</type> <id>1</id> <posX>1200</posX> - <posY>485</posY> + <posY>520</posY> <label>#itemcount</label> <align>right</align> <textcolor>White</textcolor> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicsongs.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicsongs.xml 2007-08-29 23:30:10 UTC (rev 876) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicsongs.xml 2007-08-30 13:10:21 UTC (rev 877) @@ -6,7 +6,15 @@ <define>#header.label:134</define> <controls> - <import>common.window.xml</import> + <control> + <description>BG</description> + <type>image</type> + <id>1</id> + <width>1366</width> + <height>768</height> + + </control> + <import>common.time.xml</import> <control> @@ -263,6 +271,8 @@ <onright>2</onright> <onup>2</onup> <ondown>50</ondown> + <spinPosX>1240</spinPosX> + <spinPosY>515</spinPosY> </control> <control> <description>Thumbnail Panel</description> @@ -272,6 +282,8 @@ <onright>2</onright> <onup>2</onup> <ondown>50</ondown> + <spinPosX>1240</spinPosX> + <spinPosY>515</spinPosY> </control> <control> <description>Filmstrip view</description> @@ -288,7 +300,7 @@ <spinWidth>27</spinWidth> <spinHeight>27</spinHeight> <spinPosX>1240</spinPosX> - <spinPosY>480</spinPosY> + <spinPosY>515</spinPosY> <spinColor>ffffffff</spinColor> <textureUp>arrow_round_up_nofocus.png</textureUp> <textureDown>arrow_round_down_nofocus.png</textureDown> @@ -308,6 +320,7 @@ <font>-</font> <selectedColor>-</selectedColor> <textcolor>white</textcolor> + <textXOff>-5000</textXOff> <colordiffuse>ffffffff</colordiffuse> <remoteColor>ffFFA075</remoteColor> <downloadColor>ff80ff80</downloadColor> @@ -341,6 +354,7 @@ <showBackGround>no</showBackGround> <showInfoImage>no</showInfoImage> <enableFocusZoom>no</enableFocusZoom> + <thumbs flipY="true" diffuse="Thumb_Mask.png"/> <InfoImage flipY="true" diffuse="Thumb_Mask.png"/> @@ -353,6 +367,19 @@ </control> </control> </control> + <control> + <description>Number of Files Label</description> + <type>label</type> + <id>1</id> + <posX>1200</posX> + <posY>520</posY> + <label>#itemcount</label> + <align>right</align> + <textcolor>White</textcolor> + <font>font1</font> + <animation effect="fade" time="200">WindowOpen</animation> + <animation effect="fade" time="200">WindowClose</animation> + </control> </controls> </window> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/mypics.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/mypics.xml 2007-08-29 23:30:10 UTC (rev 876) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/mypics.xml 2007-08-30 13:10:21 UTC (rev 877) @@ -267,7 +267,7 @@ <onup>2</onup> <ondown>50</ondown> </control> - <control> + <control> <description>Filmstrip view</description> <type>filmstrip</type> <id>50</id> @@ -275,8 +275,76 @@ <onright>2</onright> <onup>2</onup> <ondown>50</ondown> - - <InfoImage flipY="true" diffuse="Thumb_Mask.png"/> + <posX>25</posX> + <posY>260</posY> + <width>1360</width> + <height>400</height> + <spinWidth>27</spinWidth> + <spinHeight>27</spinHeight> + <spinPosX>1240</spinPosX> + <spinPosY>515</spinPosY> + <spinColor>ffffffff</spinColor> + <textureUp>arrow_round_up_nofocus.png</textureUp> + <textureDown>arrow_round_down_nofocus.png</textureDown> + <textureUpFocus>arrow_round_up_focus.png</textureUpFocus> + <textureDownFocus>arrow_round_down_focus.png</textureDownFocus> + <itemWidth>150</itemWidth> + <itemHeight>100</itemHeight> + <textureWidth>220</textureWidth> + <textureHeight>100</textureHeight> + <thumbWidth>135</thumbWidth> + <thumbHeight>101</thumbHeight> + <thumbPosX>6</thumbPosX><!-- 10 --> + <thumbPosY>6</thumbPosY><!-- 10 --> + <imageFolder>photo_frame.png</imageFolder> + <imageFolderFocus>photo_frame.png</imageFolderFocus> + <keepaspectratio>no</keepaspectratio> + <font>-</font> + <selectedColor>-</selectedColor> + <textcolor>white</textcolor> + <textXOff>-5000</textXOff> + <colordiffuse>ffffffff</colordiffuse> + <remoteColor>ffFFA075</remoteColor> + <downloadColor>ff80ff80</downloadColor> + <suffix>|</suffix> + <textureWidthBig>100</textureWidthBig> + <textureHeightBig>100</textureHeightBig> + <itemWidthBig>100</itemWidthBig> + <itemHeightBig>84</itemHeightBig> + <thumbWidthBig>84</thumbWidthBig> + <thumbHeightBig>100</thumbHeightBig> + <thumbPosXBig>0</thumbPosXBig> + <thumbPosYBig>0</thumbPosYBig> + <background>-</background> + <backgroundx>130</backgroundx> + <backgroundy>130</backgroundy> + <backgroundwidth>320</backgroundwidth> + <backgroundheight>320</backgroundheight> + <backgrounddiffuse>60ffffff</backgrounddiffuse> + <InfoImage>-</InfoImage> + <InfoImagex>920</InfoImagex> + <InfoImagey>130</InfoImagey> + <InfoImagewidth>310</InfoImagewidth> + <InfoImageheight>455</InfoImageheight> + <InfoImagediffuse>ffffffff</InfoImagediffuse> + + + <textureWidth>150</textureWidth> + <textureHeight>110</textureHeight> + + <showFolder>yes</showFolder> + <showBackGround>no</showBackGround> + <showInfoImage>no</showInfoImage> + <enableFocusZoom>no</enableFocusZoom> + + <thumbs flipY="true" diffuse="Thumb_Mask.png"/> + + <InfoImage flipY="true" diffuse="Thumb_Mask.png"/> + <enableFocusZoom>no</enableFocusZoom> + <thumbAnimation effect="zoom" start="100,100" end="130,130" time="200">focus</thumbAnimation> + <thumbAnimation effect="zoom" start="130,130" end="100,100" time="200">unfocus</thumbAnimation> + + <animation effect="fade" time="500">delay="1300">WindowOpen</animation> </control> </control> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/myradio.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/myradio.xml 2007-08-29 23:30:10 UTC (rev 876) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/myradio.xml 2007-08-30 13:10:21 UTC (rev 877) @@ -88,6 +88,21 @@ <texture>top-strip.png</texture> </control> + <control> + <description>Selected item Label</description> + <type>fadelabel</type> + <id>1</id> + <animation effect="fade" time="400">WindowClose</animation> + <animation effect="fade" time="400">WindowOpen</animation> + <posX>250</posX> + <posY>600</posY> + <width>1000</width> + <label>#selecteditem</label> + <font>wipeout</font> + <align>center</align> + <textcolor>ffffffff</textcolor> + </control> + <control> <description>View-As button</description> @@ -258,6 +273,56 @@ <onright>2</onright> <onup>2</onup> <ondown>50</ondown> + <posX>30</posX> + <posY>198</posY> + <width>1316</width> + <height>350</height> + <spinWidth>27</spinWidth> + <spinHeight>27</spinHeight> + <spinPosX>1240</spinPosX> + <spinPosY>515</spinPosY> + <spinColor>ffffffff</spinColor> + <textureUp>arrow_round_up_nofocus.png</textureUp> + <textureDown>arrow_round_down_nofocus.png</textureDown> + <textureUpFocus>arrow_round_up_focus.png</textureUpFocus> + <textureDownFocus>arrow_round_down_focus.png</textureDownFocus> + <itemWidth>120</itemWidth> + <itemHeight>110</itemHeight> + <textureWidth>50</textureWidth> + <textureHeight>50</textureHeight> + <thumbWidth>101</thumbWidth> + <thumbHeight>101</thumbHeight> + <thumbPosX>0</thumbPosX> + <thumbPosY>0</thumbPosY> + <imageFolder>-</imageFolder> + <imageFolderFocus>-</imageFolderFocus> + + <font>-</font> + <selectedColor>ffffffff</selectedColor> + <textcolor>ffb9d5dd</textcolor> + <colordiffuse>ffffffff</colordiffuse> + <remoteColor>ffFFA075</remoteColor> + <downloadColor>ff80ff80</downloadColor> + <suffix>|</suffix> + <textureWidthBig>105</textureWidthBig><!-- 150 --> + <textureHeightBig>105</textureHeightBig> <!-- 150 --> + <itemWidthBig>150</itemWidthBig><!-- 180 --> + <itemHeightBig>150</itemHeightBig><!-- 180 --> + <thumbWidthBig>130</thumbWidthBig> + <thumbHeightBig>130</thumbHeightBig> + <thumbPosXBig>0</thumbPosXBig><!-- 19 --> + <thumbPosYBig>20</thumbPosYBig> <!-- 19 --> + <unfocusedAlpha>180</unfocusedAlpha> + <textXOff>5</textXOff> + <textyOff>150</textyOff> + <showFrame>yes</showFrame> + <showFolder>no</showFolder> + <showBackGround>yes</showBackGround> + <showInfoImage>no</showInfoImage> + <enableFocusZoom>no</enableFocusZoom> + <thumbs flipY="true" diffuse="Thumb_Mask.png"/> + <thumbAnimation effect="zoom" start="100,100" end="150,150" time="200">focus</thumbAnimation> + <thumbAnimation effect="zoom" start="150,150" end="100,100" time="200">unfocus</thumbAnimation> </control> </control> </controls> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/references.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/references.xml 2007-08-29 23:30:10 UTC (rev 876) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/references.xml 2007-08-30 13:10:21 UTC (rev 877) @@ -381,6 +381,7 @@ <showBackGround>yes</showBackGround> <showInfoImage>no</showInfoImage> <enableFocusZoom>no</enableFocusZoom> + <thumbs flipY="false" diffuse="Thumb_Mask.png"/> <thumbAnimation effect="zoom" start="100,100" end="150,150" time="200">focus</thumbAnimation> <thumbAnimation effect="zoom" start="150,150" end="100,100" time="200">unfocus</thumbAnimation> </control> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gre...@us...> - 2007-08-29 23:30:16
|
Revision: 876 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=876&view=rev Author: gregmac45 Date: 2007-08-29 16:30:10 -0700 (Wed, 29 Aug 2007) Log Message: ----------- Added code to get all trailers for a movie Modified Paths: -------------- trunk/plugins/OnlineVideos/Source/OnlineVideos/BreakUtil.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/FavoriteUtil.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesTrailerUtil.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/AppleTrailers.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/ItmsHelper.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/RegexParsers.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/TrailerInfo.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/Main.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideoSettings.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideos.csproj trunk/plugins/OnlineVideos/Source/OnlineVideos/Runner.csproj trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/YouTubeUtil.cs Added Paths: ----------- trunk/plugins/OnlineVideos/Source/OnlineVideos/LiveVideoUtil.cs Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/BreakUtil.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/BreakUtil.cs 2007-08-29 13:29:29 UTC (rev 875) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/BreakUtil.cs 2007-08-29 23:30:10 UTC (rev 876) @@ -21,7 +21,7 @@ { public override string getSiteId() { - return "break"; + return "22"; } protected override String getUrl(String fsId) Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.cs 2007-08-29 13:29:29 UTC (rev 875) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.cs 2007-08-29 23:30:10 UTC (rev 876) @@ -26,7 +26,7 @@ { //private String msSelectedSiteID; private String msSelectedCategoryName; - private List<GUIOnlineVideos.Site> moSiteList = new List<GUIOnlineVideos.Site>(); + private List<GUIOnlineVideos.SiteSettings> moSiteList = new List<GUIOnlineVideos.SiteSettings>(); public Configuration() { @@ -50,7 +50,7 @@ } txtFilters.Text = lsFilterList; } - foreach(GUIOnlineVideos.Site site in settings.moSiteList.Values){ + foreach(GUIOnlineVideos.SiteSettings site in settings.moSiteList.Values){ siteList.Items.Add(site.name); moSiteList.Add(site); } @@ -61,7 +61,7 @@ { if(siteList.SelectedIndex>-1){ OnlineVideoSettings settings = OnlineVideoSettings.getInstance(); - GUIOnlineVideos.Site site = moSiteList[siteList.SelectedIndex]; + GUIOnlineVideos.SiteSettings site = moSiteList[siteList.SelectedIndex]; txtSiteName.Text = site.name; TxtSiteId.Text = site.id; txtUserId.Text = site.username; @@ -83,7 +83,7 @@ { if(CategoryList.SelectedIndex>-1){ OnlineVideoSettings settings = OnlineVideoSettings.getInstance(); - GUIOnlineVideos.Site site = moSiteList[siteList.SelectedIndex]; + GUIOnlineVideos.SiteSettings site = moSiteList[siteList.SelectedIndex]; msSelectedCategoryName = CategoryList.SelectedItem.ToString(); Log.Info("Category change site:{0} with selected category of {1}",site.name,msSelectedCategoryName); @@ -98,7 +98,7 @@ void BtnSiteSaveClick(object sender, EventArgs e) { OnlineVideoSettings settings = OnlineVideoSettings.getInstance(); - GUIOnlineVideos.Site site = moSiteList[siteList.SelectedIndex]; + GUIOnlineVideos.SiteSettings site = moSiteList[siteList.SelectedIndex]; //site.id = TxtSiteId; site.name = txtSiteName.Text; site.username = txtUserId.Text; @@ -123,7 +123,7 @@ void BtnRssSaveClick(object sender, EventArgs e) { OnlineVideoSettings settings = OnlineVideoSettings.getInstance(); - GUIOnlineVideos.Site site = moSiteList[siteList.SelectedIndex]; + GUIOnlineVideos.SiteSettings site = moSiteList[siteList.SelectedIndex]; GUIOnlineVideos.RssLink link = site.RssList[msSelectedCategoryName]; link.name = txtRssName.Text; link.url = txtRssUrl.Text; @@ -140,7 +140,7 @@ link.name = "new"; link.url = "http://"; link.isDynamic = false; - GUIOnlineVideos.Site site = moSiteList[siteList.SelectedIndex]; + GUIOnlineVideos.SiteSettings site = moSiteList[siteList.SelectedIndex]; site.RssList.Add(link.name,link); CategoryList.Items.Add(link.name); CategoryList.SelectedIndex = CategoryList.Items.Count-1; @@ -152,7 +152,7 @@ { if(CategoryList.SelectedIndex>-1){ OnlineVideoSettings settings = OnlineVideoSettings.getInstance(); - GUIOnlineVideos.Site site = moSiteList[siteList.SelectedIndex]; + GUIOnlineVideos.SiteSettings site = moSiteList[siteList.SelectedIndex]; msSelectedCategoryName = CategoryList.SelectedItem.ToString(); site.RssList.Remove(msSelectedCategoryName); CategoryList.Items.RemoveAt(CategoryList.SelectedIndex); @@ -171,7 +171,7 @@ settings.msThumbLocation = txtThumbLoc.Text; settings.msDownloadDir = txtDownloadDir.Text; settings.moSiteList.Clear(); - foreach(GUIOnlineVideos.Site site in moSiteList){ + foreach(GUIOnlineVideos.SiteSettings site in moSiteList){ settings.moSiteList.Add(site.id,site); } settings.saveSettings(); Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/FavoriteUtil.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/FavoriteUtil.cs 2007-08-29 13:29:29 UTC (rev 875) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/FavoriteUtil.cs 2007-08-29 23:30:10 UTC (rev 876) @@ -39,10 +39,10 @@ { return "100"; } - public override string getUrl(OnlineVideos.GUIOnlineVideos.VideoInfo video, OnlineVideos.GUIOnlineVideos.Site foSite) + public override string getUrl(OnlineVideos.GUIOnlineVideos.VideoInfo video, OnlineVideos.GUIOnlineVideos.SiteSettings foSite) { - GUIOnlineVideos.Site loSite = OnlineVideoSettings.getInstance().moSiteList[video.SiteID]; + GUIOnlineVideos.SiteSettings loSite = OnlineVideoSettings.getInstance().moSiteList[video.SiteID]; return SiteUtilFactory.getSiteUtil(video.SiteID).getUrl(video,loSite);; } public override List<GUIOnlineVideos.VideoInfo> getVideoList(string fsUrl) @@ -73,8 +73,8 @@ FavoritesDatabase db = FavoritesDatabase.getInstance(); string [] lsSiteIds = db.getSiteIDs(); - Dictionary <String, GUIOnlineVideos.Site> loSiteList = OnlineVideoSettings.getInstance().moSiteList; - GUIOnlineVideos.Site loSite; + Dictionary <String, GUIOnlineVideos.SiteSettings> loSiteList = OnlineVideoSettings.getInstance().moSiteList; + GUIOnlineVideos.SiteSettings loSite; GUIOnlineVideos.RssLink cat; foreach(string lsSiteId in lsSiteIds){ loSite = loSiteList[lsSiteId]; Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs 2007-08-29 13:29:29 UTC (rev 875) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs 2007-08-29 23:30:10 UTC (rev 876) @@ -33,10 +33,11 @@ //private ILog moLog; protected View currentView = View.Icons; - private Dictionary <String, Site> moSiteList = new Dictionary<String, Site>(); + private Dictionary <String, SiteSettings> moSiteList = new Dictionary<String, SiteSettings>(); private String msSelectedSiteId; private String msSelectedCategoryValue; private String msSelectedCategoryName; + private String msSelectedVideo; private State _CurrentState = State.home; private String msDownloadDir = Directory.GetCurrentDirectory()+"\\"; private List<VideoInfo> moCurrentVideoList = new List<VideoInfo>(); @@ -58,7 +59,7 @@ LargeIcons = 2, FilmStrip = 3 } - public class Site + public class SiteSettings { public String name; public String id; @@ -223,7 +224,7 @@ facadeView.SelectedListItemIndex = miSelectedIndex; } else{ - DisplayVideoDetails(); + DisplayVideoDetails(moCurrentVideoList[facadeView.SelectedListItemIndex - 1]); } UpdateViewSate(); //base.OnPageLoad(); @@ -265,7 +266,7 @@ break; case 2: SiteUtilBase siteUtil = SiteUtilFactory.getSiteUtil(msSelectedSiteId); - Site loSite = moSiteList [msSelectedSiteId]; + SiteSettings loSite = moSiteList [msSelectedSiteId]; if(msSelectedCategoryValue.StartsWith("fav:") == false){ //siteUtil.addFavorite(moCurrentVideoList[liSelected].VideoUrl,loSite.username,loSite.password); Log.Info("Received request to add video to favorites."); @@ -281,7 +282,7 @@ SiteUtilBase site = SiteUtilFactory.getSiteUtil(msSelectedSiteId); //Log.Info("VideoList before:"); //foreach(VideoInfo video in moCurrentVideoList){ - //Log.Info(video.Title); + //Log.Info(video.Title); //} moCurrentVideoList = site.getRelatedVideos(moCurrentVideoList[liSelected].Tags); //Log.Info("VideoList after:"); @@ -298,30 +299,10 @@ { if (action.wID == Action.ActionType.ACTION_PREVIOUS_MENU) { - if (_CurrentState == State.info) - { - Log.Info("Set the stopDownload to true 1"); - ImageDownloader._stopDownload = true; - DisplayVideos(false); - _CurrentState = State.videos; - return; + OnShowPreviousMenu2(); + return; + } - if (_CurrentState == State.videos) - { - Log.Info("Set the stopDownload to true 1"); - ImageDownloader._stopDownload = true; - DisplayCategories(); - _CurrentState = State.categories; - return; - } - else if (_CurrentState == State.categories) - { - DisplaySites(); - _CurrentState = State.home; - return; - } - - } base.OnAction(action); } protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType) @@ -341,8 +322,7 @@ { if (facadeView.SelectedListItemIndex == 0) { - DisplaySites(); - _CurrentState = State.home; + OnShowPreviousMenu2(); } else { @@ -358,18 +338,17 @@ ImageDownloader._stopDownload = true; if (facadeView.SelectedListItemIndex == 0) { - DisplayCategories(); - _CurrentState = State.categories; + OnShowPreviousMenu2(); } else { - miSelectedIndex = facadeView.SelectedListItemIndex; - if(msSelectedCategory == "20"){ - DiplayVideoDetails(moCurrentVideoList[facadeView.SelectedListItemIndex - 1]); - }else{ - - //play the video - Play(moCurrentVideoList[facadeView.SelectedListItemIndex -1]); + miSelectedIndex = facadeView.SelectedListItemIndex; + if(msSelectedSiteId == "15"){ + DisplayVideoDetails(moCurrentVideoList[facadeView.SelectedListItemIndex - 1]); + _CurrentState = State.info; + }else{ + //play the video + Play(moCurrentVideoList[facadeView.SelectedListItemIndex -1]); } } } @@ -379,14 +358,13 @@ ImageDownloader._stopDownload = true; if (facadeView.SelectedListItemIndex == 0) { - DisplayVideos(false); - _CurrentState = State.videos; + OnShowPreviousMenu2(); } else { miSelectedIndex = facadeView.SelectedListItemIndex; //play the video - Play(moCurrentVideoList[facadeView.SelectedListItemIndex -1]); + Play(moCurrentVideoList[facadeView.SelectedListItemIndex -1]); } } UpdateViewSate(); @@ -402,10 +380,38 @@ base.OnClicked(controlId, control, actionType); } - private void DiplayVideoDetails(VideoInfo videoInfo) - { - throw new Exception("The method or operation is not implemented."); - } + private void OnShowPreviousMenu2(){ + if (_CurrentState == State.categories) + { + + DisplaySites(); + _CurrentState = State.home; + + + } + else if (_CurrentState == State.videos) + { + Log.Info("Set the stopDownload to true 2"); + ImageDownloader._stopDownload = true; + + DisplayCategories(); + _CurrentState = State.categories; + + + } + else if (_CurrentState == State.info) + { + //Log.Info("Set the stopDownload to true 2"); + ImageDownloader._stopDownload = true; + + DisplayVideos(true); + SwitchView(); + btnViewAs.Visible = true; + _CurrentState = State.videos; + + + } + } public override bool OnMessage(GUIMessage message) { /* @@ -475,7 +481,7 @@ msFilterArray = settings.msFilterArray; moSiteList= settings.moSiteList; //create a favorites site - Site loSite = new Site(); + SiteSettings loSite = new SiteSettings(); loSite.id = "100"; loSite.name = "Favorites"; loSite.enabled = true; @@ -487,7 +493,7 @@ moSiteList.Add("100",loSite); //add a downloaded videos site - loSite = new Site(); + loSite = new SiteSettings(); loSite.id = "99"; loSite.name = "Downloaded Videos"; loSite.enabled = true; @@ -505,7 +511,7 @@ GUIListItem loListItem; String image; - foreach (Site loSite in moSiteList.Values) + foreach (SiteSettings loSite in moSiteList.Values) { if(loSite.enabled){ @@ -535,7 +541,7 @@ loListItem.IsFolder = true; MediaPortal.Util.Utils.SetDefaultIcons(loListItem); facadeView.Add(loListItem); - Site loSite = moSiteList[msSelectedSiteId]; + SiteSettings loSite = moSiteList[msSelectedSiteId]; SiteUtilBase loSiteUtil = SiteUtilFactory.getSiteUtil(msSelectedSiteId); foreach (RssLink loCat in loSite.RssList.Values) { @@ -685,6 +691,42 @@ } + private void DisplayVideoDetails(VideoInfo foVideo) + { + msSelectedVideo = foVideo.Title; + SiteUtilBase loSiteUtil = SiteUtilFactory.getSiteUtil(msSelectedSiteId); + List<VideoInfo> loVideoList= loSiteUtil.getOtherVideoList(foVideo); + moCurrentVideoList.Clear(); + GUIControl.ClearControl(GetID, facadeView.GetID); + GUIListItem loListItem = new GUIListItem(".."); + loListItem.IsFolder = true; + loListItem.ItemId = 0; + //loListItem.OnItemSelected+= new MediaPortal.GUI.Library.GUIListItem.ItemSelectedHandler(OnVideoItemSelected); + MediaPortal.Util.Utils.SetDefaultIcons(loListItem); + facadeView.Add(loListItem); + int liIdx = 0; + foreach (VideoInfo loVideoInfo in loVideoList) + { + liIdx++; + loVideoInfo.Description = cleanString(loVideoInfo.Description); + + loListItem = new GUIListItem(loVideoInfo.Title); + loListItem.Path = loVideoInfo.VideoUrl; + loListItem.ItemId = liIdx; + //loListItem.RetrieveArt = false; + //loListItem.OnRetrieveArt += new MediaPortal.GUI.Library.GUIListItem.RetrieveCoverArtHandler(OnRetrieveCoverArt); + //loListItem.OnItemSelected+=new MediaPortal.GUI.Library.GUIListItem.ItemSelectedHandler( OnVideoItemSelected); + facadeView.Add(loListItem); + //loListItem.RetrieveArt = true; + //loImageUrlList.Add(loVideoInfo.ImageUrl); + moCurrentVideoList.Add(loVideoInfo); + } + facadeView.View = GUIFacadeControl.ViewMode.List; + btnViewAs.Visible = false; + DisplayVideoInfo(loVideoList[0]); + //strLine = GUILocalizeStrings.Get(101); + + } /* public void downloadImages(object sender, DoWorkEventArgs e) { @@ -711,7 +753,7 @@ } } - + private bool GetUserInputString(ref string sString) { VirtualKeyboard keyBoard = (VirtualKeyboard)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_VIRTUAL_KEYBOARD); @@ -725,7 +767,7 @@ private void Play(VideoInfo foListItem) { //foListItem. - Site loSite = moSiteList[msSelectedSiteId]; + SiteSettings loSite = moSiteList[msSelectedSiteId]; String lsUrl = SiteUtilFactory.getSiteUtil(msSelectedSiteId).getUrl(foListItem,loSite); if (mbPlayFullscreen) { @@ -752,7 +794,7 @@ } private void SaveVideo(VideoInfo foListItem) { - Site loSite = moSiteList[msSelectedSiteId]; + SiteSettings loSite = moSiteList[msSelectedSiteId]; //String lsUrl = SiteUtilFactory.getSiteUtil(msSelectedSiteId).getUrl(foListItem.Path); String lsUrl = SiteUtilFactory.getSiteUtil(msSelectedSiteId).getUrl(foListItem,loSite); WebClient loClient = new WebClient(); @@ -831,9 +873,10 @@ DisplayVideoInfo(null); break; case State.info: - GUIPropertyManager.SetProperty("#header.label",String.Empty); - GUIPropertyManager.SetProperty("#header.image",String.Empty); - DisplayVideoInfo(null); + + GUIPropertyManager.SetProperty("#header.label",msSelectedVideo); + GUIPropertyManager.SetProperty("#header.image","OnlineVidlogo"+msSelectedSiteId+".jpeg"); + //DisplayVideoInfo(); break; } } @@ -965,6 +1008,7 @@ GUIControl.ShowControl(GetID,121); GUIControl.ShowControl(GetID,131); GUIControl.ShowControl(GetID,141); + //if() //Log.Info(foVideo.Description); } } Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesTrailerUtil.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesTrailerUtil.cs 2007-08-29 13:29:29 UTC (rev 875) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesTrailerUtil.cs 2007-08-29 23:30:10 UTC (rev 876) @@ -23,6 +23,10 @@ { return "15"; } + public override bool hasMultipleVideos() + { + return true; + } public override List<GUIOnlineVideos.VideoInfo> getVideoList(String fsUrl) { List<GUIOnlineVideos.VideoInfo> loListItems = new List<GUIOnlineVideos.VideoInfo>(); @@ -82,11 +86,29 @@ return loListItems; } - - public override String getUrl(GUIOnlineVideos.VideoInfo video,GUIOnlineVideos.Site foSite) + public override List<OnlineVideos.GUIOnlineVideos.VideoInfo> getOtherVideoList(OnlineVideos.GUIOnlineVideos.VideoInfo video) { + List<OnlineVideos.GUIOnlineVideos.VideoInfo> videoList = new List<OnlineVideos.GUIOnlineVideos.VideoInfo>(); TrailerInfo trailer = (TrailerInfo)video.Other; + trailer = AppleTrailers.GetTrailerUrls(trailer); + Console.WriteLine("Found {0} trailer urls",trailer.trailers.Count); + GUIOnlineVideos.VideoInfo newVideo; + foreach (String name in trailer.trailers.Keys){ + newVideo = new GUIOnlineVideos.VideoInfo(); + newVideo.Title = name; + newVideo.VideoUrl = trailer.trailers[name]; + newVideo.Description = trailer.Overview; + Console.WriteLine(newVideo.Description); + newVideo.Other = trailer; + videoList.Add(newVideo); + } + return videoList; + } + public override String getUrl(GUIOnlineVideos.VideoInfo video,GUIOnlineVideos.SiteSettings foSite) + { + TrailerInfo trailer = (TrailerInfo)video.Other; trailer = AppleTrailers.ProcessTrailer(trailer); + Console.WriteLine("Found {0} trailer urls",trailer.TrailerStreamCollection.Count); return trailer.TrailerStreamCollection[0].Uri.ToString(); } public List<GUIOnlineVideos.VideoInfo> getAllTrailers(){ @@ -144,12 +166,12 @@ worker.RunWorkerAsync(fsLink); DateTime startTime = DateTime.Now; TimeSpan duration = new TimeSpan(); - using (WaitCursor cursor = new WaitCursor()) + //using (WaitCursor cursor = new WaitCursor()) { while (HDTrailerPlugin.AppleTrailers._workerCompleted == false && duration.TotalSeconds < 10){ //Log.Info("donwload trailer duration = {0} seconds",duration.TotalSeconds); - GUIWindowManager.Process(); + //GUIWindowManager.Process(); duration = DateTime.Now - startTime;; } Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/AppleTrailers.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/AppleTrailers.cs 2007-08-29 13:29:29 UTC (rev 875) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/AppleTrailers.cs 2007-08-29 23:30:10 UTC (rev 876) @@ -134,6 +134,14 @@ return trailerInfo; } #endregion + public static ITMSClient.TrailerInfo GetTrailerUrls(object obj) + { + + ITMSClient.TrailerInfo trailerInfo = (ITMSClient.TrailerInfo)obj; + // Populate the rest of the meta data + trailerInfo = ITMSClient.ITMSHelper.PopulateTrailerUrls(trailerInfo); + return trailerInfo; + } Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/ItmsHelper.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/ItmsHelper.cs 2007-08-29 13:29:29 UTC (rev 875) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/ItmsHelper.cs 2007-08-29 23:30:10 UTC (rev 876) @@ -2,22 +2,23 @@ * iTunes Movie Trailer Import * Copyright (c) 2005 Jonathan Bradshaw * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated + * documentation files (the "Software"), to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions + * The above copyright notice and this permission notice shall be included in all copies or substantial portions * of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED - * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. */ using System; using System.Collections; +using System.Collections.Generic; using System.Diagnostics; using System.Text; using System.Text.RegularExpressions; @@ -38,7 +39,41 @@ private const string USER_AGENT = "User-Agent: iTunes/6.0 (Windows)"; private static Hashtable HighDef = HDHelper.GetAvailableMovies(); #endregion - + + + static public TrailerInfo PopulateTrailerUrls(TrailerInfo trailerInfo) + { + MatchCollection matches; + //Console.WriteLine(""); + ITMSContent infoPage = GetITMSPage(trailerInfo.Url); + if (infoPage.IsValid) + { + Match field = RegexParsers.moviedetailsRegex1.Match(infoPage.Xml); + //String desc; + if (field.Success) + { + //Log.Info("got the movie details for {0}",trailerInfo.Title); + trailerInfo.Overview = field.Groups["overview"].Value.Replace("\r\n", " ").Replace('\u0092', '\'').Replace('\u0093', '"').Replace('\u0094', '"'); + } + String name; + String url; + + Dictionary<string, string> trailers = new Dictionary<string, string>(); + // First regular expression parser + matches = RegexParsers.trailerLinkRegex.Matches(infoPage.Xml); + if (matches.Count>0) + { + foreach(Match fields in matches){ + name = fields.Groups["name"].Value; + url=fields.Groups["url"].Value; + trailers.Add(name,url); + + } + trailerInfo.trailers = trailers; + } + } + return trailerInfo; + } #region Public Methods /// <summary> /// Populates the full meta data for a particular trailer @@ -47,7 +82,7 @@ /// <returns></returns> static public TrailerInfo PopulateTrailerDetails(TrailerInfo trailerInfo, ITMSClient.TrailerSize desiredSize) { - //Log.Info("Populating Trailer details for {0}", trailerInfo.Title); + //Log.Info("Populating Trailer details for {0}", trailerInfo.Title); string[] MONTHS = new string[]{"January","February","March","April","May","June","July","August","September","October","November","December"}; //const string DIRECTOR = "(dir.)"; Match fields; @@ -55,26 +90,26 @@ StringBuilder actors = new StringBuilder("|"); ITMSContent infoPage = GetITMSPage(trailerInfo.Url); - //Log.Info(infoPage.Xml); - if (infoPage.IsValid) - { - // First regular expression parser - fields = RegexParsers.moviedetailsRegex1.Match(infoPage.Xml); - if (fields.Success) - { - //Log.Info("got the movie details for {0}",trailerInfo.Title); - trailerInfo.Title = fields.Groups["title"].Value.Replace('\u0092', '\'').Replace('\u0093', '"').Replace('\u0094', '"'); - trailerInfo.PosterUrl = new Uri(fields.Groups["poster"].Value); - trailerInfo.Copyright = fields.Groups["copyright"].Value; - trailerInfo.Overview = fields.Groups["overview"].Value.Replace("\r\n", " ").Replace('\u0092', '\'').Replace('\u0093', '"').Replace('\u0094', '"'); + //Log.Info(infoPage.Xml); + if (infoPage.IsValid) + { + // First regular expression parser + fields = RegexParsers.moviedetailsRegex1.Match(infoPage.Xml); + if (fields.Success) + { + //Log.Info("got the movie details for {0}",trailerInfo.Title); + trailerInfo.Title = fields.Groups["title"].Value.Replace('\u0092', '\'').Replace('\u0093', '"').Replace('\u0094', '"'); + trailerInfo.PosterUrl = new Uri(fields.Groups["poster"].Value); + trailerInfo.Copyright = fields.Groups["copyright"].Value; + trailerInfo.Overview = fields.Groups["overview"].Value.Replace("\r\n", " ").Replace('\u0092', '\'').Replace('\u0093', '"').Replace('\u0094', '"'); - // Second regular expression parser (split due to issues with .NET regex spinning out of control) + // Second regular expression parser (split due to issues with .NET regex spinning out of control) - fields = RegexParsers.moviedetailsRegex2.Match(infoPage.Xml); - /* + fields = RegexParsers.moviedetailsRegex2.Match(infoPage.Xml); + /* if (fields.Success) { - trailerInfo.Rating = fields.Groups["rating"].Value; + trailerInfo.Rating = fields.Groups["rating"].Value; // Release details (either a date or Coming Soon) and year (assume this year if we don't find one) trailerInfo.Release = fields.Groups["release"].Value; @@ -83,7 +118,7 @@ { trailerInfo.Year = Convert.ToInt32(date.Groups["year"].Value); trailerInfo.SortDate = new DateTime( - trailerInfo.Year, + trailerInfo.Year, Array.IndexOf(MONTHS, date.Groups["month"].Value)+1, Convert.ToInt32(date.Groups["day"].Value)); } @@ -114,47 +149,48 @@ actors.Append(cast.Value.Trim()).Append("|"); } trailerInfo.Actors = actors.ToString(); - */ - trailerInfo.TrailerStreamCollection = new TrailerStreamCollection(); + */ + trailerInfo.TrailerStreamCollection = new TrailerStreamCollection(); - // WARNING: HACK CODE FOR HIGHDEF TRAILERS - if (desiredSize >= TrailerSize.HD480p) - { - if (HighDef.Contains(trailerInfo.Title)) - { - Console.WriteLine("Found HD movie for " + trailerInfo.Title); - Uri page = HighDef[trailerInfo.Title] as Uri; - Uri mov = HDHelper.GetHDMovie(page, desiredSize); - TrailerStream myStream = new TrailerStream(desiredSize, page); - myStream.Type = "HD"; - trailerInfo.Type = "HD"; - myStream.Movie = mov; - trailerInfo.TrailerStreamCollection.Add(myStream); - } - } - // END HACK CODE + // WARNING: HACK CODE FOR HIGHDEF TRAILERS + if (desiredSize >= TrailerSize.HD480p) + { + if (HighDef.Contains(trailerInfo.Title)) + { + Console.WriteLine("Found HD movie for " + trailerInfo.Title); + Uri page = HighDef[trailerInfo.Title] as Uri; + Uri mov = HDHelper.GetHDMovie(page, desiredSize); + TrailerStream myStream = new TrailerStream(desiredSize, page); + myStream.Type = "HD"; + trailerInfo.Type = "HD"; + myStream.Movie = mov; + trailerInfo.TrailerStreamCollection.Add(myStream); + } + } + // END HACK CODE - // Get movie trailer streams - if (desiredSize != TrailerSize.None && trailerInfo.TrailerStreamCollection.Count == 0) - { - foreach (Capture url in fields.Groups["urls"].Captures) - { - //Log.Info("Found stream url:{0}", url); - TrailerStreamCollection tsc = GetTrailerStreamCollection(new Uri(infoPage.WebResponse.ResponseUri, url.Value)); - TrailerStream myStream = GetDesiredTrailerStream(tsc, desiredSize); - trailerInfo.TrailerStreamCollection.Add(myStream); - } - } - trailerInfo.TrailerStreamCollection.TrimToSize(); - //} - } - } - else - { - Log.Debug("Invalid page {0} for trailer {1}", trailerInfo.Url, trailerInfo.Title); - } + // Get movie trailer streams + if (desiredSize != TrailerSize.None && trailerInfo.TrailerStreamCollection.Count == 0) + { + foreach (Capture url in fields.Groups["urls"].Captures) + { + //Log.Info("Found stream url:{0}", url); + TrailerStreamCollection tsc = GetTrailerStreamCollection(new Uri(infoPage.WebResponse.ResponseUri, url.Value)); + + TrailerStream myStream = GetDesiredTrailerStream(tsc, desiredSize); + trailerInfo.TrailerStreamCollection.Add(myStream); + } + } + trailerInfo.TrailerStreamCollection.TrimToSize(); + //} + } + } + else + { + Log.Debug("Invalid page {0} for trailer {1}", trailerInfo.Url, trailerInfo.Title); + } return trailerInfo; - } + } /// <summary> /// Downloads the cover image to the specified destination directory if @@ -169,14 +205,14 @@ Uri uri = TrailerInfo.PosterUrl; string filename = Path.Combine(destinationDirectory, uri.AbsolutePath.Remove(0, uri.AbsolutePath.LastIndexOf('/')+1)); if (File.Exists(filename) == false) - try - { - webClient.DownloadFile(uri.AbsoluteUri, filename); - } - catch (WebException) - { - return String.Empty; - } + try + { + webClient.DownloadFile(uri.AbsoluteUri, filename); + } + catch (WebException) + { + return String.Empty; + } return filename; } @@ -199,8 +235,8 @@ ITMSContent content = null; //Log.Debug("GetITMSPage: " + uri.AbsoluteUri); - //Log.Info("GetITMSPage: " + uri.AbsoluteUri); - try + //Log.Info("GetITMSPage: " + uri.AbsoluteUri); + try { request = (HttpWebRequest) HttpWebRequest.Create(uri); request.KeepAlive = false; @@ -211,18 +247,18 @@ if (ifModifiedSince != DateTime.MinValue) request.IfModifiedSince = ifModifiedSince; - //Log.Info("getiing request response"); + //Log.Info("getiing request response"); response = (HttpWebResponse) request.GetResponse(); - //Log.Info("got response"); - sReader = new StreamReader(response.GetResponseStream(), - System.Text.Encoding.UTF8, false, (int) Math.Abs(response.ContentLength)); - //Log.Info("Got Response Stream"); - - //Log.Info("Download xml"); - content = new ITMSContent(response, - HttpUtility.HtmlDecode( - sReader.ReadToEnd())); - //Log.Info("created ITMSContent"); + //Log.Info("got response"); + sReader = new StreamReader(response.GetResponseStream(), + System.Text.Encoding.UTF8, false, (int) Math.Abs(response.ContentLength)); + //Log.Info("Got Response Stream"); + + //Log.Info("Download xml"); + content = new ITMSContent(response, + HttpUtility.HtmlDecode( + sReader.ReadToEnd())); + //Log.Info("created ITMSContent"); //Log.Debug(response.LastModified); } catch (WebException ex) @@ -241,14 +277,14 @@ }catch(Exception e){ Log.Error(e); } - finally + finally { - if(sReader != null) + if(sReader != null) sReader.Close(); - if(response != null) + if(response != null) response.Close(); } - return content; + return content; } #endregion @@ -259,8 +295,8 @@ /// <param name="uri">URI.</param> /// <returns></returns> private static TrailerStream GetDesiredTrailerStream(TrailerStreamCollection trailerStreams, TrailerSize desiredSize) - { - //Log.Info("getting desired Trailer size of {0}", desiredSize); + { + //Log.Info("getting desired Trailer size of {0}", desiredSize); // Find the largest desired size supported by the available streams while (trailerStreams.ContainsKey(desiredSize) == false && desiredSize > 0) desiredSize = desiredSize - 1; @@ -282,8 +318,8 @@ stream.Date = content.WebResponse.LastModified; } } - */ - //Log.Info("Finished getting desired trailer"); + */ + //Log.Info("Finished getting desired trailer"); return stream; } @@ -307,21 +343,21 @@ // Details not available for older trailers if (streamDetails.Groups["type"].Success) type = streamDetails.Groups["type"].Value; - if (streamDetails.Groups["minutes"].Success) - { - string minutes = streamDetails.Groups["minutes"].Value; - if (String.IsNullOrEmpty(minutes)) - minutes = "0"; - length = new TimeSpan(0, Convert.ToInt32(minutes), Convert.ToInt32(streamDetails.Groups["seconds"].Value)); - } + if (streamDetails.Groups["minutes"].Success) + { + string minutes = streamDetails.Groups["minutes"].Value; + if (String.IsNullOrEmpty(minutes)) + minutes = "0"; + length = new TimeSpan(0, Convert.ToInt32(minutes), Convert.ToInt32(streamDetails.Groups["seconds"].Value)); + } MatchCollection streamMatches = RegexParsers.streamRegex.Matches(trailerPage.Xml); foreach (Match m in streamMatches) { TrailerSize size = (TrailerSize) Enum.Parse(typeof(TrailerSize), m.Groups["size"].Value, true); - //Log.Info("found size {0}",size); - Uri uri = new Uri(trailerPage.WebResponse.ResponseUri, m.Groups["url"].Value); - //Log.Info("found url {0}", uri.ToString()); + //Log.Info("found size {0}",size); + Uri uri = new Uri(trailerPage.WebResponse.ResponseUri, m.Groups["url"].Value); + //Log.Info("found url {0}", uri.ToString()); TrailerStream ts = new TrailerStream(size, uri); ts.Length = length; ts.Type = type; Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/RegexParsers.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/RegexParsers.cs 2007-08-29 13:29:29 UTC (rev 875) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/RegexParsers.cs 2007-08-29 23:30:10 UTC (rev 876) @@ -75,6 +75,15 @@ RegexOptions.ExplicitCapture | RegexOptions.Compiled ); + + //Used to find the multiple trailer urls + internal static Regex trailerLinkRegex = new Regex( + "<HBoxView[^>]*>\\s*<GotoURL\\starget=\"main\"\\surl=\"(?<url>[^\"]*)[^=]*=[^=]*=\"(?<name>[^\"]*)", + RegexOptions.Singleline + | RegexOptions.ExplicitCapture + | RegexOptions.Compiled + ); + /// <summary> /// Used to pull the type and length of the Quicktime trailer movies available from Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/TrailerInfo.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/TrailerInfo.cs 2007-08-29 13:29:29 UTC (rev 875) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/TrailerInfo.cs 2007-08-29 23:30:10 UTC (rev 876) @@ -18,6 +18,8 @@ */ using System; using System.Collections; +using System.Collections.Generic; +using System.Collections.Specialized; using System.IO; namespace ITMSClient @@ -45,6 +47,7 @@ private Uri _posterUrl; private DateTime _sortDate; private TrailerStreamCollection _trailerStreamCollection; + private Dictionary<String, String> _trailers; #endregion #region Properties @@ -214,6 +217,11 @@ get { return _sortDate; } set { _sortDate = value; } } + public Dictionary<String, String> trailers + { + get{return _trailers;} + set{_trailers = value;} + } #endregion } } Added: trunk/plugins/OnlineVideos/Source/OnlineVideos/LiveVideoUtil.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/LiveVideoUtil.cs (rev 0) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/LiveVideoUtil.cs 2007-08-29 23:30:10 UTC (rev 876) @@ -0,0 +1,74 @@ +/* + * Created by SharpDevelop. + * User: GZamor1 + * Date: 8/28/2007 + * Time: 3:09 PM + * + * To change this template use Tools | Options | Coding | Edit Standard Headers. + */ + +using System; +using MediaPortal.GUI.Library; +using System.Text.RegularExpressions; +using System.Net; +using System.Text; +using System.Xml; +using System.IO; +using System.ComponentModel; +using MediaPortal.Player; +using System.Collections.Generic; +//using MediaPortal.Utils.Services; +using MediaPortal.Dialogs; +//using Rss; +using MediaPortal.GUI.View ; + +namespace OnlineVideos +{ + /// <summary> + /// Description of LiveVideoUtil. + /// </summary> + public class LiveVideoUtil : SiteUtilBase + { + public override string getSiteId() + { + return "21"; + } + + protected override String getUrl(String fsId) + { + + String lsHtml = getHTMLData(fsId); + Match loMatch = Regex.Match(lsHtml,@"GetFlashPlayer\('([^']*)"); + String lsUrl = ""; + if(loMatch.Success){ + lsUrl = System.Web.HttpUtility.UrlDecode(loMatch.Groups[1].Value); + lsUrl = Regex.Match(lsUrl,"video=([^&]*)").Groups[1].Value; + lsHtml = getHTMLData(lsUrl); + lsHtml = System.Web.HttpUtility.UrlDecode(getHTMLData(lsUrl)); + + //loMatch = Regex.Match(lsHtml,) + //lsUrl = System.Web.HttpUtility.UrlDecode(lsHtml); + lsUrl = Regex.Match(lsHtml,"video_id=([^&]*)").Groups[1].Value; + }else{ + Log.Info("LiveVideo video not found. Site could have changed layout."); + } + return lsUrl; + } + public override List<GUIOnlineVideos.VideoInfo> getVideoList(string fsUrl) + { + List<RssItem> loRssItemList = getRssDataItems(fsUrl); + List<GUIOnlineVideos.VideoInfo> loVideoList = new List<GUIOnlineVideos.VideoInfo>(); + GUIOnlineVideos.VideoInfo video; + foreach(RssItem rssItem in loRssItemList){ + video = new GUIOnlineVideos.VideoInfo(); + video.Description = rssItem.mediaDescription; + video.ImageUrl = rssItem.mediaThumbnail; + video.Title = rssItem.title; + video.Length = rssItem.contentList[0].duration; + video.VideoUrl = rssItem.link; + loVideoList.Add(video); + } + return loVideoList; + } + } +} Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/Main.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/Main.cs 2007-08-29 13:29:29 UTC (rev 875) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/Main.cs 2007-08-29 23:30:10 UTC (rev 876) @@ -33,9 +33,13 @@ //SiteUtilBase loUtil = new YouTubeUtil(); //List<GUIOnlineVideos.VideoInfo> loList = loUtil.getVideoList("http://youtube.com/rss/global/top_rated.rss"); - SiteUtilBase loUtil = new ItunesTrailerUtil(); - List<GUIOnlineVideos.VideoInfo> loList = loUtil.getVideoList("%transformers"); + ItunesTrailerUtil loUtil = new ItunesTrailerUtil(); + List<GUIOnlineVideos.VideoInfo> loList = loUtil.getVideoList("http://movies.apple.com/moviesxml/s/dreamworks/index_1.xml"); + //loUtil.getUrl(loList[0],null); + loList =loUtil.getOtherVideoList(loList[9]); + //loUtil.getUrl(loList[8],null); + //loUtil.getUrl(loList[loList.Count-1],null); /* SiteUtilBase loUtil = new BlipTvUtil(); Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideoSettings.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideoSettings.cs 2007-08-29 13:29:29 UTC (rev 875) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideoSettings.cs 2007-08-29 23:30:10 UTC (rev 876) @@ -23,7 +23,7 @@ public String msThumbLocation; public String msDownloadDir; public String[] msFilterArray; - public Dictionary<String,GUIOnlineVideos.Site> moSiteList = new Dictionary<String, GUIOnlineVideos.Site>(); + public Dictionary<String,GUIOnlineVideos.SiteSettings> moSiteList = new Dictionary<String, GUIOnlineVideos.SiteSettings>(); private const String SETTINGS_FILE = "OnlineVideoSites.xml"; private const String THUMBNAIL_DIR = "thumbDir"; @@ -69,14 +69,14 @@ XmlNode root = doc.SelectSingleNode("//settings/sites/site"); XmlNodeList nodeList; nodeList = root.SelectNodes("//settings/sites/site"); - List<GUIOnlineVideos.Site> loSiteList = new List<GUIOnlineVideos.Site>(); - GUIOnlineVideos.Site loSite; + List<GUIOnlineVideos.SiteSettings> loSiteList = new List<GUIOnlineVideos.SiteSettings>(); + GUIOnlineVideos.SiteSettings loSite; XmlNodeList RssNodeList; GUIOnlineVideos.RssLink loRssData; bool lbDonwloadDirSet = false; foreach (XmlNode chileNode in nodeList) { - loSite = new GUIOnlineVideos.Site(); + loSite = new GUIOnlineVideos.SiteSettings(); XmlNode node = chileNode.SelectSingleNode("name"); loSite.name = node.InnerText; @@ -202,7 +202,7 @@ XmlElement siteRssNode; XmlElement siteEnabledNode; String lsConfirm; - foreach(GUIOnlineVideos.Site site in moSiteList.Values){ + foreach(GUIOnlineVideos.SiteSettings site in moSiteList.Values){ siteNode = xmlDoc.CreateElement("site"); siteNameNode = xmlDoc.CreateElement("name"); Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideos.csproj =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideos.csproj 2007-08-29 13:29:29 UTC (rev 875) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideos.csproj 2007-08-29 23:30:10 UTC (rev 876) @@ -40,10 +40,12 @@ <Reference Include="Core, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> <HintPath>C:\Program Files\Team MediaPortal\MediaPortal\Core.DLL</HintPath> + <Private>False</Private> </Reference> <Reference Include="Databases, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> <HintPath>C:\Program Files\Team MediaPortal\MediaPortal\Databases.DLL</HintPath> + <Private>False</Private> </Reference> <Reference Include="Dialogs, Version=0.0.0.0, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> @@ -69,6 +71,7 @@ <Reference Include="Utils, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> <HintPath>C:\Program Files\Team MediaPortal\MediaPortal\Utils.DLL</HintPath> + <Private>False</Private> </Reference> </ItemGroup> <ItemGroup> @@ -82,6 +85,7 @@ <Compile Include="FavoriteUtil.cs" /> <Compile Include="FavoriteVideo.cs" /> <Compile Include="GenericSiteUtil.cs" /> + <Compile Include="LiveVideoUtil.cs" /> <Compile Include="OnlineVideoSettings.cs" /> <Compile Include="RocketboomUtil.cs" /> <Compile Include="MyVideodeUtil.cs" /> Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/Runner.csproj =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/Runner.csproj 2007-08-29 13:29:29 UTC (rev 875) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/Runner.csproj 2007-08-29 23:30:10 UTC (rev 876) @@ -24,14 +24,18 @@ <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> </PropertyGroup> <ItemGroup> - <Reference Include="Core, Version=0.2.2.0, Culture=neutral, processorArchitecture=x86"> + <Reference Include="Core"> + <HintPath>..\..\..\..\Mediaportal\Databases\bin\Debug\Core.dll</HintPath> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\Mediaportal\Core\bin\Release\Core.DLL</HintPath> </Reference> <Reference Include="System" /> <Reference Include="System.Data" /> <Reference Include="System.Windows.Forms" /> <Reference Include="System.Xml" /> + <Reference Include="Utils"> + <HintPath>..\..\..\..\Mediaportal\Databases\bin\Debug\Utils.dll</HintPath> + <SpecificVersion>False</SpecificVersion> + </Reference> </ItemGroup> <ItemGroup> <Compile Include="Main.cs" /> Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs 2007-08-29 13:29:29 UTC (rev 875) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs 2007-08-29 23:30:10 UTC (rev 876) @@ -99,12 +99,17 @@ return db.removeFavoriteVideo(foVideo); } - public virtual String getUrl(GUIOnlineVideos.VideoInfo video,GUIOnlineVideos.Site foSite) + public virtual String getUrl(GUIOnlineVideos.VideoInfo video,GUIOnlineVideos.SiteSettings foSite) { return getUrl(video.VideoUrl); } + public virtual bool hasMultipleVideos(){ + return false; + } + public virtual List<GUIOnlineVideos.VideoInfo> getOtherVideoList(GUIOnlineVideos.VideoInfo foVideo){ + return new List<GUIOnlineVideos.VideoInfo>(); + } - public List<RssItem> getRssDataItems(String fsUrl){ List<RssItem> loRssItems = new List<RssItem>(); try{ @@ -293,7 +298,7 @@ _workerCompleted = true; //return HTMLdownload; } - public static abstract String getSiteId(); + public abstract String getSiteId(); protected bool isPossibleVideo(string fsUrl){ string extensionFile = System.IO.Path.GetExtension(fsUrl).ToLower(); Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/YouTubeUtil.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/YouTubeUtil.cs 2007-08-29 13:29:29 UTC (rev 875) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/YouTubeUtil.cs 2007-08-29 23:30:10 UTC (rev 876) @@ -186,14 +186,14 @@ return loListItems; } */ - public override String getUrl(GUIOnlineVideos.VideoInfo foVideo,GUIOnlineVideos.Site foSite) + public override String getUrl(GUIOnlineVideos.VideoInfo foVideo,GUIOnlineVideos.SiteSettings foSite) { String lsSessionId = getSessionId(foVideo.VideoUrl,foSite); String lsUrl = "http://youtube.com/get_video?video_id=" +foVideo.VideoUrl + "&t=" + lsSessionId; Log.Info("youtube video url={0}", lsUrl); return lsUrl+"&txe=.flv"; } - public String getSessionId(String fsId,GUIOnlineVideos.Site foSite) + public String getSessionId(String fsId,GUIOnlineVideos.SiteSettings foSite) { //Log.Info("getting youtube session id"); String lsUrl; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rs...@us...> - 2007-08-29 13:29:31
|
Revision: 875 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=875&view=rev Author: rsparey Date: 2007-08-29 06:29:29 -0700 (Wed, 29 Aug 2007) Log Message: ----------- Worked on music film strip view. to include jewel case Modified Paths: -------------- trunk/skins/Foofaraw/Development Skin/Foofaraw/Media/cd_box.png trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicsongs.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/mypics.xml Added Paths: ----------- trunk/skins/Foofaraw/Development Skin/Foofaraw/Media/cd_art.png Added: trunk/skins/Foofaraw/Development Skin/Foofaraw/Media/cd_art.png =================================================================== (Binary files differ) Property changes on: trunk/skins/Foofaraw/Development Skin/Foofaraw/Media/cd_art.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/Media/cd_box.png =================================================================== (Binary files differ) Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicsongs.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicsongs.xml 2007-08-28 11:15:21 UTC (rev 874) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicsongs.xml 2007-08-29 13:29:29 UTC (rev 875) @@ -100,7 +100,7 @@ <posY>600</posY> <width>1000</width> <label>#selecteditem</label> - <font>wipeouts</font> + <font>wipeout</font> <align>center</align> <textcolor>ffffffff</textcolor> </control> @@ -281,59 +281,74 @@ <onright>2</onright> <onup>2</onup> <ondown>50</ondown> + <posX>25</posX> + <posY>260</posY> + <width>1360</width> + <height>400</height> + <spinWidth>27</spinWidth> + <spinHeight>27</spinHeight> + <spinPosX>1240</spinPosX> + <spinPosY>480</spinPosY> + <spinColor>ffffffff</spinColor> + <textureUp>arrow_round_up_nofocus.png</textureUp> + <textureDown>arrow_round_down_nofocus.png</textureDown> + <textureUpFocus>arrow_round_up_focus.png</textureUpFocus> + <textureDownFocus>arrow_round_down_focus.png</textureDownFocus> <itemWidth>120</itemWidth> - <itemHeight>220</itemHeight> + <itemHeight>100</itemHeight> <textureWidth>220</textureWidth> - <textureHeight>220</textureHeight> + <textureHeight>100</textureHeight> <thumbWidth>101</thumbWidth> <thumbHeight>101</thumbHeight> <thumbPosX>15</thumbPosX><!-- 10 --> - <thumbPosY>40</thumbPosY><!-- 10 --> - <imageFolder>icon_empty_nofocus_music.png</imageFolder> - <imageFolderFocus>icon_empty_focus_music.png</imageFolderFocus> + <thumbPosY>1</thumbPosY><!-- 10 --> + <imageFolder>cd_box.png</imageFolder> + <imageFolderFocus>cd_box.png</imageFolderFocus> + <keepaspectratio>no</keepaspectratio> <font>-</font> - <selectedColor>ffffffff</selectedColor> + <selectedColor>-</selectedColor> <textcolor>white</textcolor> <colordiffuse>ffffffff</colordiffuse> <remoteColor>ffFFA075</remoteColor> - <downloadColor>ff80ff80</downloadColor> + <downloadColor>ff80ff80</downloadColor> <suffix>|</suffix> <textureWidthBig>100</textureWidthBig> <textureHeightBig>100</textureHeightBig> <itemWidthBig>100</itemWidthBig> - <itemHeightBig>100</itemHeightBig> + <itemHeightBig>84</itemHeightBig> <thumbWidthBig>84</thumbWidthBig> - <thumbHeightBig>84</thumbHeightBig> + <thumbHeightBig>100</thumbHeightBig> <thumbPosXBig>0</thumbPosXBig> <thumbPosYBig>0</thumbPosYBig> <background>-</background> - <backgroundx>915</backgroundx> + <backgroundx>130</backgroundx> <backgroundy>130</backgroundy> <backgroundwidth>320</backgroundwidth> - <backgroundheight>460</backgroundheight> + <backgroundheight>320</backgroundheight> <backgrounddiffuse>60ffffff</backgrounddiffuse> <InfoImage>-</InfoImage> - <InfoImagex>100</InfoImagex> - <InfoImagey>135</InfoImagey> + <InfoImagex>920</InfoImagex> + <InfoImagey>130</InfoImagey> <InfoImagewidth>310</InfoImagewidth> <InfoImageheight>450</InfoImageheight> <InfoImagediffuse>ffffffff</InfoImagediffuse> - - - - <frame>cd_box.png</frame> - <frameFocus>cd_box.png</frameFocus> + + <textureWidth>120</textureWidth> - <textureHeight>240</textureHeight> - <showFrame>yes</showFrame> - <showFolder>no</showFolder> + <textureHeight>105</textureHeight> + + <showFolder>yes</showFolder> <showBackGround>no</showBackGround> <showInfoImage>no</showInfoImage> <enableFocusZoom>no</enableFocusZoom> <thumbs flipY="true" diffuse="Thumb_Mask.png"/> <InfoImage flipY="true" diffuse="Thumb_Mask.png"/> + <enableFocusZoom>no</enableFocusZoom> + <thumbAnimation effect="zoom" start="100,100" end="130,130" time="200">focus</thumbAnimation> + <thumbAnimation effect="zoom" start="130,130" end="100,100" time="200">unfocus</thumbAnimation> + <animation effect="fade" time="500">delay="1300">WindowOpen</animation> </control> </control> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/mypics.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/mypics.xml 2007-08-28 11:15:21 UTC (rev 874) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/mypics.xml 2007-08-29 13:29:29 UTC (rev 875) @@ -275,13 +275,7 @@ <onright>2</onright> <onup>2</onup> <ondown>50</ondown> - <!--<posX>60</posX> - <itemWidth>200</itemWidth> - <itemHeight>200</itemHeight> - <textureWidth>160</textureWidth> - <textureHeight>160</textureHeight> - <thumbWidth>150</thumbWidth> - <thumbHeight>100</thumbHeight>--> + <InfoImage flipY="true" diffuse="Thumb_Mask.png"/> <animation effect="fade" time="500">delay="1300">WindowOpen</animation> </control> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nor...@us...> - 2007-08-28 11:15:31
|
Revision: 874 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=874&view=rev Author: northern_sky Date: 2007-08-28 04:15:21 -0700 (Tue, 28 Aug 2007) Log Message: ----------- Fixed sort for appitems, updated readme with final to-do's Modified Paths: -------------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsDirCache.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGamebase.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsMame.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItem.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemFactory.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ProgramSort.cs trunk/plugins/myGUIProgramsAlt/README.txt Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsDirCache.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsDirCache.cs 2007-08-27 23:31:18 UTC (rev 873) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsDirCache.cs 2007-08-28 11:15:21 UTC (rev 874) @@ -54,7 +54,7 @@ shellexecuteCheckBox.Checked = applicationItem.UseShellExecute; quoteCheckBox.Checked = applicationItem.UseQuotes; waitExitCheckBox.Checked = (applicationItem.WaitForExit); - allowGUIImportCheckBox.Checked = applicationItem.RefreshGUIAllowed; + allowGUIImportCheckBox.Checked = applicationItem.ReimportFromGUIAllowed; if (applicationItem.PlatformId != 0) { platformComboBox.SelectedValue = applicationItem.PlatformId; @@ -76,7 +76,7 @@ curApp.UseQuotes = quoteCheckBox.Checked; curApp.WaitForExit = waitExitCheckBox.Checked; curApp.Item_Type = ItemType.DIRCACHE; - curApp.RefreshGUIAllowed = allowGUIImportCheckBox.Checked; + curApp.ReimportFromGUIAllowed = allowGUIImportCheckBox.Checked; curApp.PlatformId = (int)platformComboBox.SelectedValue; } Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGamebase.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGamebase.cs 2007-08-27 23:31:18 UTC (rev 873) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGamebase.cs 2007-08-28 11:15:21 UTC (rev 874) @@ -53,7 +53,7 @@ this.startupDirComboBox.Text = curApp.StartupDir; this.quoteCheckBox.Checked = true; //(applicationItem.UseQuotes); this.waitExitCheckBox.Checked = (curApp.WaitForExit); - this.allowGUIImportCheckBox.Checked = curApp.RefreshGUIAllowed; + this.allowGUIImportCheckBox.Checked = curApp.ReimportFromGUIAllowed; } public override void SaveSettings(ApplicationItem curApp) @@ -65,7 +65,7 @@ curApp.UseQuotes = this.quoteCheckBox.Checked; curApp.WaitForExit = this.waitExitCheckBox.Checked; curApp.Item_Type = ItemType.GAMEBASE; - curApp.RefreshGUIAllowed = this.allowGUIImportCheckBox.Checked; + curApp.ReimportFromGUIAllowed = this.allowGUIImportCheckBox.Checked; } Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsMame.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsMame.cs 2007-08-27 23:31:18 UTC (rev 873) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsMame.cs 2007-08-28 11:15:21 UTC (rev 874) @@ -56,7 +56,7 @@ base.SaveSettings(curApp); curApp.Item_Type = ItemType.MAMEDIRECT; - curApp.RefreshGUIAllowed = true; + curApp.ReimportFromGUIAllowed = true; } public override bool ValidateEntries(ApplicationItem curApp) Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.cs 2007-08-27 23:31:18 UTC (rev 873) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.cs 2007-08-28 11:15:21 UTC (rev 874) @@ -61,7 +61,7 @@ { #region Variables - + bool currentSortAsc = true; ProgramViewHandler viewHandler = ProgramViewHandler.Instance; List<ApplicationItem> globalApplicationList;// dbHandlerInstance.ApplicationItemList; @@ -74,7 +74,7 @@ ProgramSort.SortMethod currentSortMethod = ProgramSort.SortMethod.Title; DatabaseHandler dbHandlerInstance = DatabaseHandler.DBHandlerInstance; - ApplicationItem currentApplicationItem = null; + ApplicationItem currentApplicationItem = null; string prevFilepath = ""; int selectedItemIndex = -1; Layout currentLayout = Layout.List; @@ -95,8 +95,8 @@ [SkinControl(50)] protected GUIFacadeControl facadeView = null; - + #endregion Variables #region Constructor / Destructor @@ -267,10 +267,10 @@ if (currentApplicationItem == null) {//create a fake tmpappitem so it's not null - currentApplicationItem = new ApplicationItemGrouper(); + currentApplicationItem = new ApplicationItemGrouper(); } currentApplicationItem.ApplicationItemId = xmlreader.GetValueAsInt("myProgramsAlt", "applicationItemId", -1); - + ViewHandler.CurrentLevel = xmlreader.GetValueAsInt("myProgramsAlt", "lastViewLevel", -1); CurrentSortAsc = xmlreader.GetValueAsBool("myProgramsAlt", "sortASC", true); ViewHandler.CurrentView = xmlreader.GetValueAsString("myProgramsAlt", "view", ""); @@ -297,7 +297,7 @@ } else { - btnReimport.IsVisible = currentApplicationItem.RefreshGUIAllowed; + btnReimport.IsVisible = currentApplicationItem.ReimportFromGUIAllowed; } facadeView.IsVisible = true; @@ -351,6 +351,7 @@ case ProgramSort.SortMethod.Platform: sortBy = "Sort by: Platform"; //tmp break; + } if (btnSortBy != null) @@ -402,7 +403,7 @@ // some preconditions... if (selectedGUIListItem == null) return; if (currentApplicationItem == null) return; - + ThumbnailPath = ""; if (selectedGUIListItem.ThumbnailImage != "" && selectedGUIListItem.ThumbnailImage != GUIGraphicsContext.Skin + @"\media\DefaultFolderBig.png" @@ -803,6 +804,27 @@ } } + + bool DoesListOnlyContainsItemOfType<T>() + { + bool onlyContainsType = true; + + GUIListItem item = null; + if (facadeView != null) + { + for (int i = 0; i < facadeView.Count; ++i) + { + item = facadeView[i]; + if ((item.MusicTag != null) && !(item.MusicTag is T)) + { + return (onlyContainsType = false); + } + + } + } + return onlyContainsType; + } + void SelectSortMethod() { GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); @@ -812,14 +834,18 @@ dlg.Reset(); dlg.SetHeading(495); + dlg.AddLocalizedString(268); // title - dlg.AddLocalizedString(363); // filename - dlg.AddLocalizedString(367); // rating - dlg.Add("Sort by: Times launched");//"LaunchCount"//whats the mapping to these??? - dlg.Add("Sort by: Date launched"); - dlg.Add("Sort by: Platform"); + + if (DoesListOnlyContainsItemOfType<FileItem>()) + { + dlg.AddLocalizedString(363); // filename + dlg.AddLocalizedString(367); // rating + dlg.Add("Sort by: Times launched");//"LaunchCount"//whats the mapping to these??? + dlg.Add("Sort by: Date launched"); + dlg.Add("Sort by: Platform"); + } - dlg.DoModal(GetID); if (dlg.SelectedLabel == -1) @@ -937,11 +963,11 @@ ViewHandler.CurrentView = selectedView.Name; - if (facadeView.Count <= 0) - { - GUIControl.FocusControl(GetID, btnViewAs.GetID); - } - + if (facadeView.Count <= 0) + { + GUIControl.FocusControl(GetID, btnViewAs.GetID); + } + } UpdateButtonStates(); Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItem.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItem.cs 2007-08-27 23:31:18 UTC (rev 873) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItem.cs 2007-08-28 11:15:21 UTC (rev 874) @@ -204,7 +204,7 @@ set { enabled = value; } } - public bool RefreshGUIAllowed + public bool ReimportFromGUIAllowed { get { return refreshGUIAllowed; } set { refreshGUIAllowed = value; } @@ -757,7 +757,7 @@ parameterArray[15] = dbHandlerInstance.GetParameter<bool>(ImportValidImagesOnly, "@importValidImagesOnly", DbType.Boolean); parameterArray[16] = dbHandlerInstance.GetParameter<int>(Position, "@position", DbType.Int32); parameterArray[17] = dbHandlerInstance.GetParameter<bool>(Enabled, "@enabled", DbType.Boolean); - parameterArray[18] = dbHandlerInstance.GetParameter<bool>(RefreshGUIAllowed, "@refreshGUIAllowed", DbType.Boolean); + parameterArray[18] = dbHandlerInstance.GetParameter<bool>(ReimportFromGUIAllowed, "@refreshGUIAllowed", DbType.Boolean); parameterArray[19] = dbHandlerInstance.GetParameter<int>(PlatformId, "@platformId", DbType.Int32); parameterArray[20] = dbHandlerInstance.GetParameter<bool>(WaitForExit, "@waitForExit", DbType.Boolean); parameterArray[21] = dbHandlerInstance.GetParameter<string>(PreLaunch, "@preLaunch", DbType.String); @@ -855,7 +855,7 @@ parameterArray[15] = dbHandlerInstance.GetParameter<bool>(ImportValidImagesOnly, "@importValidImagesOnly", DbType.Boolean); parameterArray[16] = dbHandlerInstance.GetParameter<int>(Position, "@position", DbType.Int32); parameterArray[17] = dbHandlerInstance.GetParameter<bool>(Enabled, "@enabled", DbType.Boolean); - parameterArray[18] = dbHandlerInstance.GetParameter<bool>(RefreshGUIAllowed, "@refreshGUIAllowed", DbType.Boolean); + parameterArray[18] = dbHandlerInstance.GetParameter<bool>(ReimportFromGUIAllowed, "@refreshGUIAllowed", DbType.Boolean); parameterArray[19] = dbHandlerInstance.GetParameter<int>(PlatformId, "@platformId", DbType.Int32); parameterArray[20] = dbHandlerInstance.GetParameter<bool>(WaitForExit, "@waitForExit", DbType.Boolean); parameterArray[21] = dbHandlerInstance.GetParameter<string>(PreLaunch, "@preLaunch", DbType.String); Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemFactory.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemFactory.cs 2007-08-27 23:31:18 UTC (rev 873) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemFactory.cs 2007-08-28 11:15:21 UTC (rev 874) @@ -122,7 +122,7 @@ item.ValidExtensions = (string)dataReader["validextensions"]; item.ImportValidImagesOnly =(bool) dataReader["importvalidimagesonly"]; item.Position = Convert.ToInt32(dataReader["iposition"]); - item.RefreshGUIAllowed = (bool) dataReader["refreshGUIAllowed"]; + item.ReimportFromGUIAllowed = (bool) dataReader["refreshGUIAllowed"]; item.PlatformId = Convert.ToInt32(dataReader["platformId"]); item.WaitForExit =(bool) dataReader["waitforexit"]; item.PreLaunch = (string) dataReader["preLaunch"]; Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ProgramSort.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ProgramSort.cs 2007-08-27 23:31:18 UTC (rev 873) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ProgramSort.cs 2007-08-28 11:15:21 UTC (rev 874) @@ -68,66 +68,86 @@ if (item2 == null) return -1; if (item1.MusicTag == null) return -1; if (item2.MusicTag == null) return -1; - - - - if (item1.MusicTag.GetType().BaseType.Name == "ApplicationItem") return -1;//quick fix for not allowing applicationsitems... - if (item2.MusicTag.GetType().BaseType.Name == "ApplicationItem") return -1;//quick fix for not allowing applicationsitems... - if (item1.MusicTag.GetType().Name == "FilterItem") return -1;//quick fix for not allowing filteritems... if (item2.MusicTag.GetType().Name == "FilterItem") return -1;//quick fix for not allowing filteritems... - + if (item1.Label == "..") return -1; // if the .. item has no musicTag then, it is already catched at the beginning of this method if (item2.Label == "..") return -1; + + //applicationitem sort only allows by title for now + if ((item1.MusicTag is ApplicationItem) && (item2.MusicTag is ApplicationItem)) + + { + ApplicationItem Item1 = item1.MusicTag as ApplicationItem; + ApplicationItem Item2 = item2.MusicTag as ApplicationItem; + + switch (currentSortMethod) + { + case SortMethod.Title: + if (sortAscending) + return String.Compare(Item1.Title, Item2.Title, true); + else + return String.Compare(Item2.Title, Item1.Title, true); + default: + return -1; + } + } + + + string strSize1 = ""; string strSize2 = ""; if (item1.FileInfo != null) strSize1 = MediaPortal.Util.Utils.GetSize(item1.FileInfo.Length); if (item2.FileInfo != null) strSize2 = MediaPortal.Util.Utils.GetSize(item2.FileInfo.Length); + //fileitem sort + if ((item1.MusicTag is FileItem) && (item2.MusicTag is FileItem)) + { + FileItem fileItem1 = item1.MusicTag as FileItem; + FileItem fileItem2 = item2.MusicTag as FileItem; + if (fileItem1 == null) return -1; + if (fileItem2 == null) return -1; - FileItem fileItem1 = item1.MusicTag as FileItem; - FileItem fileItem2 = item2.MusicTag as FileItem; - if (fileItem1 == null) return -1; - if (fileItem2 == null) return -1; + switch (currentSortMethod) + { + case SortMethod.Title: + if (sortAscending) + return String.Compare(fileItem1.Title, fileItem2.Title, true); + else + return String.Compare(fileItem2.Title, fileItem1.Title, true); - switch (currentSortMethod) - { - case SortMethod.Title: - if (sortAscending) - return String.Compare(fileItem1.Title, fileItem2.Title, true); - else - return String.Compare(fileItem2.Title, fileItem1.Title, true); + case SortMethod.Filename: + if (sortAscending) + return String.Compare(fileItem1.filePath, fileItem2.filePath, true); + else + return String.Compare(fileItem2.filePath, fileItem1.filePath, true); - case SortMethod.Filename: - if (sortAscending) - return String.Compare(fileItem1.filePath, fileItem2.filePath, true); - else - return String.Compare(fileItem2.filePath, fileItem1.filePath, true); + case SortMethod.Rating: + if (sortAscending) + return fileItem1.Rating.CompareTo(fileItem2.Rating); + else + return fileItem2.Rating.CompareTo(fileItem1.Rating); - case SortMethod.Rating: - if (sortAscending) - return fileItem1.Rating.CompareTo(fileItem2.Rating); - else - return fileItem2.Rating.CompareTo(fileItem1.Rating); + case SortMethod.LaunchCount: + if (sortAscending) + return fileItem1.LaunchCount.CompareTo(fileItem2.LaunchCount); + else + return fileItem2.LaunchCount.CompareTo(fileItem1.LaunchCount); - case SortMethod.LaunchCount: - if (sortAscending) - return fileItem1.LaunchCount.CompareTo(fileItem2.LaunchCount); - else - return fileItem2.LaunchCount.CompareTo(fileItem1.LaunchCount); + case SortMethod.LastTimeLaunched: + if (sortAscending) + return DateTime.Compare(fileItem1.LastTimeLaunched, fileItem2.LastTimeLaunched); + else + return DateTime.Compare(fileItem2.LastTimeLaunched, fileItem1.LastTimeLaunched); - case SortMethod.LastTimeLaunched: - if (sortAscending) - return DateTime.Compare(fileItem1.LastTimeLaunched, fileItem2.LastTimeLaunched); - else - return DateTime.Compare(fileItem2.LastTimeLaunched, fileItem1.LastTimeLaunched); - - case SortMethod.Platform: - if (sortAscending) - return String.Compare(fileItem1.Platform, fileItem2.Platform, true); - else - return String.Compare(fileItem2.Platform, fileItem1.Platform, true); + case SortMethod.Platform: + if (sortAscending) + return String.Compare(fileItem1.Platform, fileItem2.Platform, true); + else + return String.Compare(fileItem2.Platform, fileItem1.Platform, true); + } + return 0; } return 0; } Modified: trunk/plugins/myGUIProgramsAlt/README.txt =================================================================== --- trunk/plugins/myGUIProgramsAlt/README.txt 2007-08-27 23:31:18 UTC (rev 873) +++ trunk/plugins/myGUIProgramsAlt/README.txt 2007-08-28 11:15:21 UTC (rev 874) @@ -32,9 +32,18 @@ ---------------- Testing,bugfixing,codecleanup -Optimize some things if possibly -- for example, try gamebase with 10000 items.. +-Optimize some things if possibly +-Change graphics for fileinfobackground (it says mymovies...) + +-Add sort for filteritems too. + +-Fix brokenprogressdialogs in gui reimport + +-Allow the amg best match update from fileinfo window for fileitem + + BUGS: - Just add em... @@ -49,10 +58,7 @@ .: Things to clear :. --------------------- -Name: -MyEmu...? - Add some more specific emulator support.. - using emulator ids??? yes at some point. this could benefit automatic downloads etc - easier application image assigning together with thumbsdir -> we also could provide icons for most common system This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |