From: <an...@us...> - 2008-03-21 04:49:15
|
Revision: 1491 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1491&view=rev Author: and-81 Date: 2008-03-20 21:49:12 -0700 (Thu, 20 Mar 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.cs trunk/plugins/IR Server Suite/Applications/IR File Tool/IrDecoder.cs trunk/plugins/IR Server Suite/Applications/IR Server/Advanced.Designer.cs trunk/plugins/IR Server Suite/Applications/IR Server/Advanced.cs trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs trunk/plugins/IR Server Suite/Applications/IR Server/IR Server.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/DeviceIoOverlapped.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 Suite.nsi trunk/plugins/IR Server Suite/IR Server Suite.sln trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Advanced.Designer.cs trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Advanced.cs trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Config.Designer.cs trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Config.cs trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Configuration.csproj trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Exclusions.Designer.cs trunk/plugins/IR Server Suite/Input Service/Input Service Configuration/Exclusions.cs Added Paths: ----------- trunk/plugins/IR Server Suite/Applications/IR Server/Exclusions.Designer.cs trunk/plugins/IR Server Suite/Applications/IR Server/Exclusions.cs trunk/plugins/IR Server Suite/Applications/IR Server/Exclusions.resx Modified: trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.cs 2008-03-20 11:58:28 UTC (rev 1490) +++ trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.cs 2008-03-21 04:49:12 UTC (rev 1491) @@ -400,102 +400,97 @@ } private void buttonAttemptDecode_Click(object sender, EventArgs e) { + // NOTES: + // All start with a correct RC6 0xFCA93 header. + /* int[][] timingData = new int[][] { - - new int[] { - +2800, -750, +550, -350, +550, -350, +500, -800, +550, -800, +1400, -800, +550, -350, +500, -400, +500, -400, +500, -350, +550, -350, +500, -400, +500, -400, +500, -350, +500, -400, +500, -8400, +900, -850, +500, -400, +500, -400, +450, -400, +500, -400, +500, -400, +950, -400, +450, -850, +950, -50800, - }, - new int[] { - +2700, -850, +450, -400, +500, -400, +500, -850, +500, -850, +1350, -850, +500, -400, +450, -400, +500, -400, +500, -400, +500, -400, +450, -400, +500, -400, +500, -400, +500, -400, +450, -400, +950, -400, +500, -400, +450, -450, +450, -850, +500, -400, +450, -450, +450, -400, +500, -400, +900, -900, +450, -400, +500, -400, +4600, -31750, - }, +new int[] { 2800, -750, 550, -350, 500, -400, 500, -800, 550, -800, 1400, -800, 550, -350, 500, -400, 500, -400, 500, -350, 500, -400, 500, -400, 500, -400, 500, -350, 500, -400, 500, -400, 950, -350, 500, -400, 500, -400, 500, -850, 450, -400, 500, -400, 500, -400, 6550, -850, 450, -400, 500, -400, 500, -850, 500, -800, 1400, -850, 500, -400, 450, -400, 500, -400, 500, -400, 500, -400, 450, -400, 500, -400, 500, -400, 500, -2800, 350, -400, 500, -400, 450, -450, 900, -25400 }, - // RC6A (RC6_24) // no, Replay - new int[] { - 3107, -887, 443, -443, 443, -443, 443, -887, 443, -887, 887, -443, 443, -443, 443, -443, 443, -443, 443, -443, 443, -443, 887, -443, 443, -887, 887, -443, 443, -443, 443, -443, 443, -443, 443, -887, 443, -443, 443, -443, 443, -443, 887, -443, 443, -443, 443, -887, 443, -443, 443, -443, 443, -75000 - }, +new int[] { 2800, -750, 550, -350, 550, -350, 500, -800, 550, -800, 1400, -800, 550, -350, 550, -350, 500, -400, 500, -350, 550, -350, 500, -400, 500, -400, 500, -350, 550, -350, 500, -3750, 250, -400, 500, -800, 500, -400, 500, -400, 500, -400, 900, -850, 500, -400, 500, -400, 500, -350, 500, -400, 500, -400, 500, -400, 500, -350, 500, -400, 950, -31550 }, - // RC6_MCE - new int[] { - +2750, -800, +550, -350, +500, -350, +550, -800, +500, -800, +1450, // Header - -800, +500, -350, +550, -350, +500, -400, +500, -350, +550, -350, +500, -400, +500, -350, +500, -400, +500, -400, +500, -350, +950, -400, +500, -400, +500, -350, +500, -850, +500, -400, +450, -400, +500, -400, +500, -400, +900, -850, +500, -400, +500, -350, +500, -400, +500, -400, +500, -350, +950, -400, +500, -850, +900, -19050, - }, - // Nothing - new int[] { - +2800, -750, +550, -350, +550, -350, +500, -800, +550, -800, +1400, // Header - -800, +550, -350, +500, -400, +500, -400, +500, -350, +550, -350, +500, -400, +500, -400, +500, -350, +500, -400, +500, -8400, +900, -850, +500, -400, +500, -400, +450, -400, +500, -400, +500, -400, +950, -400, +450, -850, +950, -70000, - }, - // RC6_24 - new int[] { - +2700, -850, +450, -400, +500, -400, +500, -850, +500, -850, +1350, // Header - -850, +500, -400, +450, -400, +500, -400, +500, -400, +500, -400, +450, -400, +500, -400, +500, -400, +500, -400, +450, -400, +950, -400, +500, -400, +450, -450, +450, -850, +500, -400, +450, -450, +450, -400, +500, -400, +900, -900, +450, -400, +500, -400, +4600, -61750, - }, +new int[] { 2700, -850, 500, -400, 450, -400, 500, -850, 500, -850, 1350, -850, 500, -400, 500, -400, 450, -400, 500, -400, 500, -400, 500, -400, 450, -400, 500, -400, 500, -400, 500, -400, 900, -400, 500, -400, 500, -400, 450, -450, 450, -850, 500, -400, 450, -31750 }, - new int[] { - +2650, -900, +450, -400, +450, -450, +450, -900, +450, -850, +1350, // Header - -900, +450, -400, +500, -400, +450, -450, +450, -450, +450, -400, +500, -400, +450, -450, +450, -450, +450, -400, +500, -400, +900, -450, +450, -450, +450, -400, +450, -450, +5150, -31750, - }, - }; +new int[] { 2700, -850, 450, -400, 500, -400, 500, -850, 450, -850, 1400, -850, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 1850, -400, 500, -400, 450, -450, 450, -450, 900, -25400 }, - for (int index = 0; index < timingData.GetLength(0); index++) - { - IrDecoder.DecodeIR(timingData[index], new RemoteCallback(RemoteEvent), new KeyboardCallback(KeyboardEvent), new MouseCallback(MouseEvent)); +new int[] { 2700, -850, 450, -400, 500, -400, 450, -900, 450, -900, 1350, -850, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 450, -400, 500, -400, 450, -5350, 450, -400, 500, -850, 450, -450, 450, -400, 500, -400, 900, -900, 450, -400, 500, -400, 450, -450, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 900, -31750 }, - IrCode newCode = new IrCode(timingData[index]); - Pronto.WriteProntoFile(String.Format("C:\\{0}.ir", index), Pronto.ConvertIrCodeToProntoRaw(newCode)); +new int[] { 2700, -850, 450, -450, 450, -400, 500, -850, 450, -900, 1350, -850, 450, -450, 450, -450, 450, -400, 450, -450, 450, -450, 450, -450, 450, -400, 450, -450, 450, -450, 1100, -300, 450, -450, 450, -450, 450, -400, 500, -400, 900, -25400, }, - } - */ - /* +new int[] { 2700, -850, 450, -450, 450, -400, 500, -850, 450, -900, 1350, -850, 450, -450, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 450, -400, 500, -4400, 450, -450, 450, -450, 450, -900, 400, -450, 450, -450, 450, -400, 950, -850, 450, -450, 450, -450, 450, -400, 450, -450, 450, -450, 450, -450, 450, -400, 450, -31750 }, - byte[] data = new byte[] { - //0x11, 0x8A, 0x08, 0x08, 0x8A, 0x11, 0x11, 0x9B, 0x11, 0x08, 0x8A, 0x08, 0x08, 0x8A, 0x08, 0x08, 0x8A, 0x08, 0x08, 0x8B, 0x07, 0x08, 0x8A, 0x08, 0x09, 0x8A, 0x08, 0x09, 0x89, 0x12, 0x08, 0x8A, 0x08, 0x09, 0x89, 0x09, 0x12, 0x8A, 0x08, 0x08, 0x8A, 0x08, 0x08, 0x93, 0x08, 0x08, 0x8A, 0x08, 0x11, 0x89, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x5C - 0x11, 0x89, 0x08, 0x08, 0x8A, 0x11, 0x11, 0x9C, 0x11, 0x08, 0x8A, 0x08, 0x08, 0x8A, 0x09, 0x08, 0x8A, 0x08, 0x08, 0x8A, 0x08, 0x08, 0x8A, 0x08, 0x08, 0x8A, 0x09, 0x08, 0x8A, 0x09, 0x11, 0x8B, 0x08, 0x08, 0x8A, 0x08, 0x12, 0x8A, 0x08, 0x08, 0x8A, 0x09, 0x12, 0x8A, 0x08, 0x08, 0x92, 0x12, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x5C, - }; +new int[] { 2650, -900, 450, -400, 500, -400, 450, -900, 450, -900, 1300, -900, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 450, -400, 900, -450, 450, -450, 450, -450, 450, -400, 500, -850, 5150, -31750 }, - List<int> timingData = new List<int>(); +new int[] { 2650, -900, 450, -400, 500, -400, 450, -900, 450, -900, 1300, -900, 450, -400, 500, -400, 450, -450, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 450, -950, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 900, -25400 }, - int len = 0; - byte curByte; - int time; +new int[] { 2700, -900, 400, -450, 450, -450, 450, -900, 450, -850, 1350, -900, 450, -400, 450, -450, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 450, -3750, 250, -400, 500, -400, 450, -450, 450, -900, 450, -400, 500, -400, 450, -450, 900, -900, 450, -400, 450, -450, 450, -450, 450, -400, 500, -400, 450, -450, 450, -31750 }, - for (int j = 0; j < data.Length; j++) - { - curByte = data[j]; +new int[] { 2700, -900, 400, -450, 450, -450, 450, -850, 450, -900, 1350, -900, 400, -450, 450, -450, 450, -450, 450, -400, 450, -450, 450, -450, 450, -450, 450, -400, 500, -400, 450, -450, 900, -400, 500, -400, 450, -450, 450, -450, 450, -31750 }, - if ((curByte & 0x80) != 0) - len -= (int)(curByte & 0x7F); - else - len += (int)curByte; +new int[] { 2700, -850, 450, -450, 450, -450, 450, -850, 450, -900, 1350, -900, 400, -450, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 450, -450, 450, -400, 1000, -400, 450, -450, 450, -450, 450, -450, 450, -400, 500, -400, 900, -25400 }, - if ((curByte & 0x7F) != 0x7F) - { - time = len * 50; +new int[] { 2700, -850, 450, -400, 500, -400, 450, -900, 450, -900, 1350, -850, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 450, -400, 500, -400, 450, -3550, 450, -450, 450, -450, 450, -400, 500, -850, 450, -450, 450, -400, 500, -400, 900, -900, 450, -400, 500, -400, 450, -450, 450, -450, 450, -400, 500, -400, 450, -31750 }, - if (timingData.Count > 0 && ((timingData[timingData.Count - 1] > 0 && time > 0) || (timingData[timingData.Count - 1] < 0 && time < 0))) - timingData[timingData.Count - 1] += time; - else - timingData.Add(time); - - len = 0; - } - } +new int[] { 2700, -900, 450, -400, 450, -450, 450, -900, 450, -850, 1350, -900, 450, -400, 450, -450, 450, -450, 450, -450, 450, -400, 450, -450, 450, -450, 450, -450, 450, -400, 450, -450, 900, -450, 450, -400, 500, -400, 450, -450, 5300, -31750 }, - if (len != 0) - { - time = len * 50; - - if ((timingData[timingData.Count - 1] > 0 && time > 0) || (timingData[timingData.Count - 1] < 0 && time < 0)) - timingData[timingData.Count - 1] += time; - else - timingData.Add(time); - } +new int[] { 2700, -850, 450, -450, 450, -450, 450, -900, 400, -900, 1350, -900, 400, -450, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 450, -400, 500, -400, 450, -12900, 450, -400, 500, -400, 450, -450, 450, -450, 450, -400, 500, -400, 900, -25400 }, - IrDecoder.DecodeIR(timingData.ToArray(), new RemoteCallback(RemoteEvent), new KeyboardCallback(KeyboardEvent), new MouseCallback(MouseEvent)); - */ +new int[] { 2700, -850, 450, -450, 450, -400, 450, -900, 450, -900, 1350, -850, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 450, -400, 500, -400, 450, -2500, 650, -400, 450, -450, 450, -450, 450, -400, 500, -850, 450, -450, 450, -400, 500, -400, 900, -900, 450, -400, 500, -400, 450, -450, 450, -450, 450, -450, 450, -31750 }, +new int[] { 2700, -850, 450, -400, 500, -400, 450, -900, 450, -900, 1350, -850, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 450, -400, 950, -400, 450, -450, 450, -450, 450, -400, 4650, -31750 }, + +new int[] { 2700, -900, 400, -450, 450, -450, 450, -900, 450, -850, 1350, -900, 450, -400, 500, -400, 450, -450, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 450, -11950, 450, -450, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 450, -400, 900, -19050 }, + +new int[] { 2700, -850, 450, -450, 450, -400, 500, -850, 450, -900, 1350, -850, 450, -450, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 450, -400, 2400, -300, 900, -400, 500, -400, 450, -450, 450, -450, 450, -900, 400, -450, 450, -450, 450, -400, 950, -850, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 4700, -31750 }, + +new int[] { 2650, -900, 450, -400, 500, -400, 450, -900, 450, -900, 1300, -900, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 450, -400, 950, -400, 450, -450, 450, -450, 450, -31750 }, + +new int[] { 2700, -900, 450, -400, 450, -450, 450, -900, 450, -850, 1350, -900, 450, -400, 500, -400, 450, -450, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 5350, -31750 }, + +new int[] { 2700, -900, 400, -450, 450, -450, 450, -900, 450, -850, 1350, -900, 450, -400, 450, -450, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 450, -1300, 450, -450, 900, -450, 450, -400, 500, -400, 450, -450, 450, -900, 450, -400, 450, -450, 450, -450, 900, -900, 400, -450, 450, -450, 450, -450, 450, -400, 450, -31750 }, + +new int[] { 2700, -850, 450, -450, 450, -400, 500, -850, 450, -900, 1350, -850, 450, -450, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 900, -400, 500, -400, 450, -450, 450, -31750 }, + +new int[] { 2700, -850, 450, -400, 500, -400, 450, -900, 450, -900, 1300, -900, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 450, -400, 500, -400, 450, -450, 4700, -450, 450, -400, 500, -400, 450, -450, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 900, -19050 }, + +new int[] { 2700, -900, 450, -400, 450, -450, 450, -900, 450, -850, 1350, -900, 450, -400, 500, -400, 450, -450, 450, -450, 450, 3350, 350, -900, 1350, -900, 450, -400, 450, -450, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 450, -400, 500, -400, 450, -450, 900, -400, 500, -400, 450, -31750 }, + +new int[] { 2650, -900, 450, -400, 500, -400, 450, -900, 450, -900, 1300, -900, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 450, -400, 500, -400, 450, -450, 10650, -900, 450, -400, 500, -400, 450, -450, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 900, -19050 }, + +new int[] { 2700, -900, 450, -400, 450, -450, 450, -900, 450, -850, 1350, -900, 450, -400, 450, -450, 450, -450, 450, -450, 450, -400, 450, -450, 450, -450, 550, -350, 450, -400, 450, -450, 900, -450, 450, -400, 500, -400, 450, -450, 450, -900, 450, -400, 450, -450, 450, -450, 900, -900, 450, -400, 450, -450, 450, -450, 4700, -31750 }, + +new int[] { 2700, -850, 450, -450, 450, -400, 500, -850, 450, -900, 1350, -900, 400, -450, 450, -450, 450, -450, 450, -400, 450, -450, 450, -450, 450, -450, 450, -400, 450, -450, 450, -450, 900, -400, 500, -400, 450, -31750 }, + +new int[] { 2650, -900, 450, -400, 500, -400, 450, -900, 450, -900, 1300, -900, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 450, -400, 500, -400, 450, -450, 10650, -900, 450, -400, 500, -400, 450, -450, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 900, -19050 }, + +new int[] { 2700, -900, 450, -400, 450, -450, 450, -900, 450, -850, 1350, -900, 450, -400, 500, -400, 450, -450, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 450, -400, 500, -400, 900, -450, 450, -450, 450, -400, 500, -400, 450, -900, 450, -400, 500, -400, 450, -450, 900, -900, 450, -400, 450, -450, 450, -31750 }, + +new int[] { 2700, -900, 400, -450, 450, -450, 450, -900, 450, -850, 1350, -900, 450, -400, 450, -450, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 450, -400, 500, -400, 450, -450, 900, -450, 450, -400, 3350, -31750 }, + +new int[] { 2650, -900, 450, -400, 450, -450, 450, -900, 450, -900, 1300, -900, 450, -400, 500, -400, 450, -450, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 450, 2400, 50, -450, 900, -900, 450, -400, 450, -450, 450, -450, 450, -450, 450, -400, 450, -450, 450, -450, 450, -450, 900, -19050 }, + +new int[] { 2700, -900, 400, -450, 450, -450, 450, -900, 450, -850, 1350, -900, 450, -400, 450, -450, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 450, -400, 500, -400, 450, -450, 900, -450, 450, -400, 500, -400, 450, -450, 450, -900, 450, -400, 450, -450, 450, -450, 900, -900, 400, -450, 450, -450, 4300, -31750 }, + +new int[] { 2700, -900, 400, -450, 450, -450, 450, -900, 450, -850, 1350, -900, 450, -400, 450, -450, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 450, -400, 500, -400, 450, -450, 900, -450, 3600, -31750 }, + +new int[] { 2700, -850, 450, -450, 450, -400, 500, -850, 450, -900, 1350, -850, 450, -450, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 450, -400, 500, -400, 2300, -200, 450, -400, 900, -900, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 450, -400, 500, -400, 450, -450, 900, -19050 }, + +new int[] { 2650, -900, 450, -400, 450, -450, 450, -900, 450, -900, 1300, -900, 450, -400, 500, -400, 450, -450, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 450, -400, 500, -400, 900, -450, 450, -450, 450, -400, 500, -400, 450, -900, 450, -400, 500, -400, 450, -450, 900, -900, 450, -400, 4650, -31750 }, + +new int[] { 2700, -900, 400, -450, 450, -450, 450, -900, 400, -900, 1350, -900, 450, -400, 450, -450, 450, -450, 450, -400, 500, -400, 450, -450, 450, -450, 450, -400, 500, -400, 450, -450, 900, -3500, 550, -25400 }, + + }; + + for (int index = 0; index < timingData.GetLength(0); index++) + { + IrDecoder.DecodeIR(timingData[index], new RemoteCallback(RemoteEvent), new KeyboardCallback(KeyboardEvent), new MouseCallback(MouseEvent)); + + //IrCode newCode = new IrCode(timingData[index]); + //Pronto.WriteProntoFile(String.Format("C:\\{0}.ir", index), Pronto.ConvertIrCodeToProntoRaw(newCode)); + } + */ IrDecoder.DecodeIR(_code.TimingData, new RemoteCallback(RemoteEvent), new KeyboardCallback(KeyboardEvent), new MouseCallback(MouseEvent)); } Modified: trunk/plugins/IR Server Suite/Applications/IR File Tool/IrDecoder.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR File Tool/IrDecoder.cs 2008-03-20 11:58:28 UTC (rev 1490) +++ trunk/plugins/IR Server Suite/Applications/IR File Tool/IrDecoder.cs 2008-03-21 04:49:12 UTC (rev 1491) @@ -141,22 +141,16 @@ #region Constants - const ushort ToggleBitMce = 0x8000; - const ushort ToggleMaskMce = 0x7FFF; - const ushort CustomerMce = 0x800F; + const uint ToggleBitMce = 0x8000; + const uint ToggleMaskMce = 0x7FFF; + const uint CustomerMce = 0x800F; - const ushort ToggleBitRC5 = 0x0800; - const ushort ToggleMaskRC5 = 0x07FF; + const uint ToggleBitRC5 = 0x0800; + const uint ToggleMaskRC5 = 0x07FF; const uint ToggleBitRC5X = 0x00020000; const uint ToggleMaskRC5X = 0x0001FFFF; - const uint RC6HeaderMask = 0xFFFFFFF0; - - //const uint PrefixRC6 = 0x000FC950; - //const uint PrefixRC6A = 0x000FCA90; - //const uint PrefixRC6M2X = 0x000FCA93; - const uint MceMouse = 1; const uint MceKeyboard = 4; @@ -1132,6 +1126,7 @@ remoteCallback(IrProtocol.RC5, RC5_Data.Code, first); RC5_Data.State = RemoteDetectionState.HeaderPulse; + ignored = false; } if (ignored && (RC5_Data.State != RemoteDetectionState.Leading) && (RC5_Data.State != RemoteDetectionState.HeaderPulse)) @@ -1254,9 +1249,6 @@ ignored = false; RC6_Data.LongPulse = true; RC6_Data.HalfBit++; - - //if (RC6_Data.Bit == 1) - //RC6_Data.State = RemoteDetectionState.KeyCode; } else if (!pulse && IsBetween(duration, 300, 600)) { @@ -1276,6 +1268,7 @@ if (RC6_Data.LongPulse) { RC6_Data.LongPulse = false; + if (pulse) break; @@ -1315,19 +1308,18 @@ //if (RC6_Data.Bit == 32) //RC6_Data.Bit = 24; + //if (RC6_Data.Bit == 24) + //RC6_Data.Bit = 32; + if (IsBetween(duration, 750, 1000)) { RC6_Data.Bit++; RC6_Data.Code = RC6_Data.Code << 1; RC6_Data.Code |= 1; - //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 (IsBetween(duration, 300, 600)) { @@ -1337,9 +1329,6 @@ RC6_Data.HalfBit++; ignored = false; - - //if (RC6_Data.Bit == 0) - //RC6_Data.State = RemoteDetectionState.KeyCode; } else if (duration > 4000) { @@ -1395,37 +1384,17 @@ protocolVariation = IrProtocol.RC6_32; else break; - - /* - if (RC6_Data.Header == PrefixRC6M2X) - { - if (RC6_Data.Bit == 16) - protocolVariation = IrProtocol.RC6_16; - else if (RC6_Data.Bit == 20) - protocolVariation = IrProtocol.RC6_20; - else if (RC6_Data.Bit == 24) - protocolVariation = IrProtocol.RC6_24; - else if (RC6_Data.Bit == 32) - protocolVariation = IrProtocol.RC6_32; - else - break; - } - else if ((RC6_Data.Header & RC6HeaderMask) == PrefixRC6A) - { - protocolVariation = IrProtocol.RC6A; - } - */ } remoteCallback(protocolVariation, RC6_Data.Code, first); RC6_Data.State = RemoteDetectionState.HeaderPulse; + ignored = false; } if (ignored && (RC6_Data.State != RemoteDetectionState.HeaderPulse)) RC6_Data.State = RemoteDetectionState.HeaderPulse; } - } static void DetectRCA(int[] timingData, RemoteCallback remoteCallback) { Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Advanced.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Advanced.Designer.cs 2008-03-20 11:58:28 UTC (rev 1490) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Advanced.Designer.cs 2008-03-21 04:49:12 UTC (rev 1491) @@ -39,9 +39,9 @@ this.buttonCancel = new System.Windows.Forms.Button(); this.buttonOK = new System.Windows.Forms.Button(); this.toolTips = new System.Windows.Forms.ToolTip(this.components); - this.groupBoxAbstractRemoteModel = new System.Windows.Forms.GroupBox(); this.buttonExclusions = new System.Windows.Forms.Button(); this.checkBoxAbstractRemoteMode = new System.Windows.Forms.CheckBox(); + this.groupBoxAbstractRemoteModel = new System.Windows.Forms.GroupBox(); this.groupBoxPriority = new System.Windows.Forms.GroupBox(); this.labelPriority = new System.Windows.Forms.Label(); this.comboBoxPriority = new System.Windows.Forms.ComboBox(); @@ -152,19 +152,6 @@ this.buttonOK.UseVisualStyleBackColor = true; this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); // - // groupBoxAbstractRemoteModel - // - this.groupBoxAbstractRemoteModel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.groupBoxAbstractRemoteModel.Controls.Add(this.buttonExclusions); - this.groupBoxAbstractRemoteModel.Controls.Add(this.checkBoxAbstractRemoteMode); - this.groupBoxAbstractRemoteModel.Location = new System.Drawing.Point(8, 136); - this.groupBoxAbstractRemoteModel.Name = "groupBoxAbstractRemoteModel"; - this.groupBoxAbstractRemoteModel.Size = new System.Drawing.Size(384, 56); - this.groupBoxAbstractRemoteModel.TabIndex = 1; - this.groupBoxAbstractRemoteModel.TabStop = false; - this.groupBoxAbstractRemoteModel.Text = "Abstract Remote Model"; - // // buttonExclusions // this.buttonExclusions.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); @@ -176,6 +163,7 @@ this.buttonExclusions.Text = "Exclusions"; this.toolTips.SetToolTip(this.buttonExclusions, "Configure Abstract Remote Model exclusions"); this.buttonExclusions.UseVisualStyleBackColor = true; + this.buttonExclusions.Visible = false; this.buttonExclusions.Click += new System.EventHandler(this.buttonExclusions_Click); // // checkBoxAbstractRemoteMode @@ -191,6 +179,19 @@ this.checkBoxAbstractRemoteMode.UseVisualStyleBackColor = true; this.checkBoxAbstractRemoteMode.CheckedChanged += new System.EventHandler(this.checkBoxAbstractRemoteMode_CheckedChanged); // + // groupBoxAbstractRemoteModel + // + this.groupBoxAbstractRemoteModel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxAbstractRemoteModel.Controls.Add(this.buttonExclusions); + this.groupBoxAbstractRemoteModel.Controls.Add(this.checkBoxAbstractRemoteMode); + this.groupBoxAbstractRemoteModel.Location = new System.Drawing.Point(8, 136); + this.groupBoxAbstractRemoteModel.Name = "groupBoxAbstractRemoteModel"; + this.groupBoxAbstractRemoteModel.Size = new System.Drawing.Size(384, 56); + this.groupBoxAbstractRemoteModel.TabIndex = 1; + this.groupBoxAbstractRemoteModel.TabStop = false; + this.groupBoxAbstractRemoteModel.Text = "Abstract Remote Model"; + // // groupBoxPriority // this.groupBoxPriority.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Advanced.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Advanced.cs 2008-03-20 11:58:28 UTC (rev 1490) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Advanced.cs 2008-03-21 04:49:12 UTC (rev 1491) @@ -23,7 +23,7 @@ public bool AbstractRemoteMode { get { return checkBoxAbstractRemoteMode.Checked; } - set { checkBoxAbstractRemoteMode.Checked = value; } + set { buttonExclusions.Enabled = checkBoxAbstractRemoteMode.Checked = value; } } public IRServerMode Mode { @@ -105,15 +105,13 @@ private void buttonExclusions_Click(object sender, EventArgs e) { - /* - Exclusions exclusions = new Exclusions(new string[] { "plugin1", "plugin2", "plugin3" }); - exclusions.ExclusionList = new string[] { "plugin1" }; + Exclusions exclusions = new Exclusions(); + //exclusions.ExclusionList = new string[] { "Microsoft MCE:" }; if (exclusions.ShowDialog(this) == DialogResult.OK) { } - */ } private void radioButtonServer_CheckedChanged(object sender, EventArgs e) @@ -131,7 +129,7 @@ private void checkBoxAbstractRemoteMode_CheckedChanged(object sender, EventArgs e) { - //buttonExclusions.Enabled = checkBoxAbstractRemoteMode.Checked; + buttonExclusions.Enabled = checkBoxAbstractRemoteMode.Checked; } #endregion Controls Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs 2008-03-20 11:58:28 UTC (rev 1490) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs 2008-03-21 04:49:12 UTC (rev 1491) @@ -233,6 +233,7 @@ private void toolStripButtonDetect_Click(object sender, EventArgs e) { + // TODO: Place on a seperate thread? Detect(); } private void toolStripButtonAdvancedSettings_Click(object sender, EventArgs e) @@ -248,128 +249,151 @@ void CreateGrid() { - int row = 0; + IrssLog.Info("Creating configuration grid ..."); - gridPlugins.Rows.Clear(); - gridPlugins.Columns.SetCount(5); + try + { + int row = 0; - // Setup Column Headers - gridPlugins.Rows.Insert(row); + gridPlugins.Rows.Clear(); + gridPlugins.Columns.SetCount(5); - SourceGrid.Cells.ColumnHeader header = new SourceGrid.Cells.ColumnHeader(" "); - header.AutomaticSortEnabled = false; - gridPlugins[row, ColIcon] = header; + // Setup Column Headers + gridPlugins.Rows.Insert(row); - gridPlugins[row, ColName] = new SourceGrid.Cells.ColumnHeader("Name"); - gridPlugins[row, ColReceive] = new SourceGrid.Cells.ColumnHeader("Receive"); - gridPlugins[row, ColTransmit] = new SourceGrid.Cells.ColumnHeader("Transmit"); - gridPlugins[row, ColConfigure] = new SourceGrid.Cells.ColumnHeader("Configure"); - gridPlugins.FixedRows = 1; + SourceGrid.Cells.ColumnHeader header = new SourceGrid.Cells.ColumnHeader(" "); + header.AutomaticSortEnabled = false; + gridPlugins[row, ColIcon] = header; - foreach (PluginBase transceiver in _transceivers) - { - gridPlugins.Rows.Insert(++row); - gridPlugins.Rows[row].Tag = transceiver; + gridPlugins[row, ColName] = new SourceGrid.Cells.ColumnHeader("Name"); + gridPlugins[row, ColReceive] = new SourceGrid.Cells.ColumnHeader("Receive"); + gridPlugins[row, ColTransmit] = new SourceGrid.Cells.ColumnHeader("Transmit"); + gridPlugins[row, ColConfigure] = new SourceGrid.Cells.ColumnHeader("Configure"); + gridPlugins.FixedRows = 1; - // Icon Cell - if (transceiver.DeviceIcon != null) + foreach (PluginBase transceiver in _transceivers) { - SourceGrid.Cells.Image iconCell = new SourceGrid.Cells.Image(transceiver.DeviceIcon); - iconCell.Editor.EnableEdit = false; + gridPlugins.Rows.Insert(++row); + gridPlugins.Rows[row].Tag = transceiver; - gridPlugins[row, ColIcon] = iconCell; - } - else - { - gridPlugins[row, ColIcon] = new SourceGrid.Cells.Cell(); - } + // Icon Cell + if (transceiver.DeviceIcon != null) + { + SourceGrid.Cells.Image iconCell = new SourceGrid.Cells.Image(transceiver.DeviceIcon); + iconCell.Editor.EnableEdit = false; - // Name Cell - SourceGrid.Cells.Cell nameCell = new SourceGrid.Cells.Cell(transceiver.Name); + gridPlugins[row, ColIcon] = iconCell; + } + else + { + gridPlugins[row, ColIcon] = new SourceGrid.Cells.Cell(); + } - SourceGrid.Cells.Controllers.CustomEvents nameCellController = new SourceGrid.Cells.Controllers.CustomEvents(); - nameCellController.DoubleClick += new EventHandler(PluginDoubleClick); - nameCell.AddController(nameCellController); + // Name Cell + SourceGrid.Cells.Cell nameCell = new SourceGrid.Cells.Cell(transceiver.Name); - nameCell.AddController(new SourceGrid.Cells.Controllers.ToolTipText()); - nameCell.ToolTipText = String.Format("{0}\nVersion: {1}\nAuthor: {2}\n{3}", transceiver.Name, transceiver.Version, transceiver.Author, transceiver.Description); + SourceGrid.Cells.Controllers.CustomEvents nameCellController = new SourceGrid.Cells.Controllers.CustomEvents(); + nameCellController.DoubleClick += new EventHandler(PluginDoubleClick); + nameCell.AddController(nameCellController); - gridPlugins[row, ColName] = nameCell; + nameCell.AddController(new SourceGrid.Cells.Controllers.ToolTipText()); + nameCell.ToolTipText = String.Format("{0}\nVersion: {1}\nAuthor: {2}\n{3}", transceiver.Name, transceiver.Version, transceiver.Author, transceiver.Description); - // Receive Cell - if (transceiver is IRemoteReceiver || transceiver is IMouseReceiver || transceiver is IKeyboardReceiver) - { - gridPlugins[row, ColReceive] = new SourceGrid.Cells.CheckBox(); - } - else - { - gridPlugins[row, ColReceive] = new SourceGrid.Cells.Cell(); - } + gridPlugins[row, ColName] = nameCell; - // Transmit Cell - if (transceiver is ITransmitIR) - { - SourceGrid.Cells.CheckBox checkbox = new SourceGrid.Cells.CheckBox(); + // Receive Cell + if (transceiver is IRemoteReceiver || transceiver is IMouseReceiver || transceiver is IKeyboardReceiver) + { + gridPlugins[row, ColReceive] = new SourceGrid.Cells.CheckBox(); + } + else + { + gridPlugins[row, ColReceive] = new SourceGrid.Cells.Cell(); + } - SourceGrid.Cells.Controllers.CustomEvents checkboxcontroller = new SourceGrid.Cells.Controllers.CustomEvents(); - checkboxcontroller.ValueChanged += new EventHandler(TransmitChanged); - checkbox.Controller.AddController(checkboxcontroller); + // Transmit Cell + if (transceiver is ITransmitIR) + { + SourceGrid.Cells.CheckBox checkbox = new SourceGrid.Cells.CheckBox(); - gridPlugins[row, ColTransmit] = checkbox; - } - else - { - gridPlugins[row, ColTransmit] = new SourceGrid.Cells.Cell(); - } + SourceGrid.Cells.Controllers.CustomEvents checkboxcontroller = new SourceGrid.Cells.Controllers.CustomEvents(); + checkboxcontroller.ValueChanged += new EventHandler(TransmitChanged); + checkbox.Controller.AddController(checkboxcontroller); - // Configure Cell - if (transceiver is IConfigure) - { - SourceGrid.Cells.Button button = new SourceGrid.Cells.Button("Configure"); + gridPlugins[row, ColTransmit] = checkbox; + } + else + { + gridPlugins[row, ColTransmit] = new SourceGrid.Cells.Cell(); + } - SourceGrid.Cells.Controllers.Button buttonClickEvent = new SourceGrid.Cells.Controllers.Button(); - buttonClickEvent.Executed += new EventHandler(buttonClickEvent_Executed); - button.Controller.AddController(buttonClickEvent); + // Configure Cell + if (transceiver is IConfigure) + { + SourceGrid.Cells.Button button = new SourceGrid.Cells.Button("Configure"); - gridPlugins[row, ColConfigure] = button; + SourceGrid.Cells.Controllers.Button buttonClickEvent = new SourceGrid.Cells.Controllers.Button(); + buttonClickEvent.Executed += new EventHandler(buttonClickEvent_Executed); + button.Controller.AddController(buttonClickEvent); + + gridPlugins[row, ColConfigure] = button; + } + else + { + gridPlugins[row, ColConfigure] = new SourceGrid.Cells.Cell(); + } } - else - { - gridPlugins[row, ColConfigure] = new SourceGrid.Cells.Cell(); - } + + gridPlugins.Columns[ColIcon].AutoSizeMode = SourceGrid.AutoSizeMode.EnableAutoSize; + gridPlugins.Columns[ColName].AutoSizeMode = SourceGrid.AutoSizeMode.Default; + gridPlugins.Columns[ColReceive].AutoSizeMode = SourceGrid.AutoSizeMode.EnableAutoSize; + gridPlugins.Columns[ColTransmit].AutoSizeMode = SourceGrid.AutoSizeMode.EnableAutoSize; + gridPlugins.Columns[ColConfigure].AutoSizeMode = SourceGrid.AutoSizeMode.EnableAutoSize; + gridPlugins.AutoStretchColumnsToFitWidth = true; + gridPlugins.AutoSizeCells(); } - - gridPlugins.Columns[ColIcon].AutoSizeMode = SourceGrid.AutoSizeMode.EnableAutoSize; - gridPlugins.Columns[ColName].AutoSizeMode = SourceGrid.AutoSizeMode.Default; - gridPlugins.Columns[ColReceive].AutoSizeMode = SourceGrid.AutoSizeMode.EnableAutoSize; - gridPlugins.Columns[ColTransmit].AutoSizeMode = SourceGrid.AutoSizeMode.EnableAutoSize; - gridPlugins.Columns[ColConfigure].AutoSizeMode = SourceGrid.AutoSizeMode.EnableAutoSize; - gridPlugins.AutoStretchColumnsToFitWidth = true; - gridPlugins.AutoSizeCells(); + catch (Exception ex) + { + IrssLog.Error(ex); + MessageBox.Show(this, ex.ToString(), "Error setting up plugin grid", MessageBoxButtons.OK, MessageBoxIcon.Error); + } } void Detect() { + IrssLog.Info("Attempting to detect Input Plugins ..."); + SourceGrid.Cells.CheckBox checkBox; for (int row = 1; row < gridPlugins.RowsCount; row++) { - PluginBase plugin = gridPlugins.Rows[row].Tag as PluginBase; - - bool detected = plugin.Detect(); + try + { + PluginBase plugin = gridPlugins.Rows[row].Tag as PluginBase; - // Receive - checkBox = gridPlugins[row, ColReceive] as SourceGrid.Cells.CheckBox; - if (checkBox != null) - checkBox.Checked = detected; - - // Transmit - checkBox = gridPlugins[row, ColTransmit] as SourceGrid.Cells.CheckBox; - if (checkBox != null) - checkBox.Checked = detected; + bool detected = plugin.Detect(); + + IrssLog.Info("Found: {0}", plugin.Name); + + // Receive + checkBox = gridPlugins[row, ColReceive] as SourceGrid.Cells.CheckBox; + if (checkBox != null) + checkBox.Checked = detected; + + // Transmit + checkBox = gridPlugins[row, ColTransmit] as SourceGrid.Cells.CheckBox; + if (checkBox != null) + checkBox.Checked = detected; + } + catch (Exception ex) + { + IrssLog.Error(ex); + } } } void Advanced() { + IrssLog.Info("Entering advanced configuration ..."); + Advanced advanced = new Advanced(); advanced.AbstractRemoteMode = _abstractRemoteMode; Added: trunk/plugins/IR Server Suite/Applications/IR Server/Exclusions.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Exclusions.Designer.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Exclusions.Designer.cs 2008-03-21 04:49:12 UTC (rev 1491) @@ -0,0 +1,146 @@ +namespace IRServer +{ + partial class Exclusions + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Exclusions)); + this.buttonCancel = new System.Windows.Forms.Button(); + this.buttonOK = new System.Windows.Forms.Button(); + this.treeViewExclusions = new System.Windows.Forms.TreeView(); + this.labelExplain = new System.Windows.Forms.Label(); + this.labelExpandAll = new System.Windows.Forms.Label(); + this.labelCollapseAll = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // buttonCancel + // + this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.buttonCancel.Location = new System.Drawing.Point(240, 312); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(64, 24); + this.buttonCancel.TabIndex = 5; + this.buttonCancel.Text = "Cancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); + // + // buttonOK + // + this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonOK.Location = new System.Drawing.Point(168, 312); + this.buttonOK.Name = "buttonOK"; + this.buttonOK.Size = new System.Drawing.Size(64, 24); + this.buttonOK.TabIndex = 4; + this.buttonOK.Text = "OK"; + this.buttonOK.UseVisualStyleBackColor = true; + this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); + // + // treeViewExclusions + // + this.treeViewExclusions.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.treeViewExclusions.CheckBoxes = true; + this.treeViewExclusions.Location = new System.Drawing.Point(8, 72); + this.treeViewExclusions.Name = "treeViewExclusions"; + this.treeViewExclusions.ShowNodeToolTips = true; + this.treeViewExclusions.Size = new System.Drawing.Size(296, 232); + this.treeViewExclusions.TabIndex = 1; + // + // labelExplain + // + this.labelExplain.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.labelExplain.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + this.labelExplain.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.labelExplain.Location = new System.Drawing.Point(8, 8); + this.labelExplain.Name = "labelExplain"; + this.labelExplain.Size = new System.Drawing.Size(296, 56); + this.labelExplain.TabIndex = 0; + this.labelExplain.Text = "Put a check next to any device or individual remote you would like to exclude fro" + + "m being processed by the Abstract Remote Model"; + this.labelExplain.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // labelExpandAll + // + this.labelExpandAll.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.labelExpandAll.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.labelExpandAll.Location = new System.Drawing.Point(8, 304); + this.labelExpandAll.Name = "labelExpandAll"; + this.labelExpandAll.Size = new System.Drawing.Size(16, 16); + this.labelExpandAll.TabIndex = 2; + this.labelExpandAll.Text = "+"; + this.labelExpandAll.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.labelExpandAll.Click += new System.EventHandler(this.labelExpandAll_Click); + // + // labelCollapseAll + // + this.labelCollapseAll.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.labelCollapseAll.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.labelCollapseAll.Location = new System.Drawing.Point(24, 304); + this.labelCollapseAll.Name = "labelCollapseAll"; + this.labelCollapseAll.Size = new System.Drawing.Size(16, 16); + this.labelCollapseAll.TabIndex = 3; + this.labelCollapseAll.Text = "-"; + this.labelCollapseAll.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.labelCollapseAll.Click += new System.EventHandler(this.labelCollapseAll_Click); + // + // Exclusions + // + this.AcceptButton = this.buttonOK; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.buttonCancel; + this.ClientSize = new System.Drawing.Size(312, 346); + this.Controls.Add(this.labelExplain); + this.Controls.Add(this.treeViewExclusions); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.buttonOK); + this.Controls.Add(this.labelExpandAll); + this.Controls.Add(this.labelCollapseAll); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(320, 380); + this.Name = "Exclusions"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Abstrct Remote Model Exclusions"; + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Button buttonCancel; + private System.Windows.Forms.Button buttonOK; + private System.Windows.Forms.TreeView treeViewExclusions; + private System.Windows.Forms.Label labelExplain; + private System.Windows.Forms.Label labelExpandAll; + private System.Windows.Forms.Label labelCollapseAll; + + } +} \ No newline at end of file Added: trunk/plugins/IR Server Suite/Applications/IR Server/Exclusions.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Exclusions.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Exclusions.cs 2008-03-21 04:49:12 UTC (rev 1491) @@ -0,0 +1,112 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.IO; +using System.Text; +using System.Windows.Forms; + +using IrssUtils; + +namespace IRServer +{ + + partial class Exclusions : Form + { + + /// <summary> + /// Gets or sets the exclusion list. + /// </summary> + /// <value>The exclusion list.</value> + public string[] ExclusionList + { + get + { + List<string> exclusions = new List<string>(); + foreach (TreeNode node in treeViewExclusions.Nodes) + if (node.Checked) + exclusions.Add(node.Tag as string); + + return exclusions.ToArray(); + } + set + { + foreach (TreeNode node in treeViewExclusions.Nodes) + { + node.Checked = false; + + foreach (string exclusion in value) + if (exclusion.Equals(node.Tag as string, StringComparison.OrdinalIgnoreCase)) + node.Checked = true; + } + } + } + + /// <summary> + /// Initializes a new instance of the <see cref="Exclusions"/> class. + /// </summary> + public Exclusions() + { + InitializeComponent(); + + InitTree(); + } + + void InitTree() + { + treeViewExclusions.Nodes.Clear(); + + string AbstractRemoteMapFolder = Path.Combine(Common.FolderAppData, "Input Service\\Abstract Remote Maps"); + + string[] folders = Directory.GetDirectories(AbstractRemoteMapFolder, "*", SearchOption.TopDirectoryOnly); + foreach (string folder in folders) + { + if (!Directory.Exists(folder)) + continue; + + string device = Path.GetFileName(folder); + + TreeNode deviceNode = new TreeNode(device); + deviceNode.Tag = String.Format("{0}:", device); + + string[] files = Directory.GetFiles(folder, "*.xml", SearchOption.TopDirectoryOnly); + foreach (string file in files) + { + if (!File.Exists(file)) + continue; + + string remote = Path.GetFileNameWithoutExtension(file); + + TreeNode remoteNode = new TreeNode(remote); + remoteNode.Tag = String.Format("{0}:{1}", device, remote); + + deviceNode.Nodes.Add(remoteNode); + } + + treeViewExclusions.Nodes.Add(deviceNode); + } + } + + private void buttonOK_Click(object sender, EventArgs e) + { + this.DialogResult = DialogResult.OK; + this.Close(); + } + private void buttonCancel_Click(object sender, EventArgs e) + { + this.DialogResult = DialogResult.Cancel; + this.Close(); + } + + private void labelExpandAll_Click(object sender, EventArgs e) + { + treeViewExclusions.ExpandAll(); + } + private void labelCollapseAll_Click(object sender, EventArgs e) + { + treeViewExclusions.CollapseAll(); + } + + } + +} Added: trunk/plugins/IR Server Suite/Applications/IR Server/Exclusions.resx =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Exclusions.resx (rev 0) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Exclusions.resx 2008-03-21 04:49:12 UTC (rev 1491) @@ -0,0 +1,168 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> + <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value> + AAABAAIAICAAAAEACACoCAAAJgAAABAQEAABAAQAKAEAAM4IA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